├── .circleci └── config.yml ├── .github └── workflows │ └── build-image.yml ├── .gitignore ├── Dockerfile ├── README.md ├── _config.yml ├── api ├── _config.yml ├── package-lock.json ├── package.json ├── scripts │ ├── generator.js │ ├── helper-is_ptr.js │ ├── helper-tocify.js │ ├── tag-api_method.js │ ├── tag-api_property.js │ ├── tag-api_return_codes.js │ ├── tag-constants.js │ ├── tag-content_code.js │ ├── tag-method_params.js │ └── tag-page.js ├── source │ ├── ConstructionSite.md │ ├── Creep.md │ ├── Deposit.md │ ├── Flag.md │ ├── Game.md │ ├── InterShardMemory.md │ ├── Map.md │ ├── MapVisual.md │ ├── Market.md │ ├── Memory.md │ ├── Mineral.md │ ├── Nuke.md │ ├── OwnedStructure.md │ ├── PathFinder.CostMatrix.md │ ├── PathFinder.md │ ├── PowerCreep.md │ ├── RawMemory.md │ ├── Resource.md │ ├── Room.Terrain.md │ ├── Room.md │ ├── RoomObject.md │ ├── RoomPosition.md │ ├── RoomVisual.md │ ├── Ruin.md │ ├── Source.md │ ├── Store.md │ ├── Structure.md │ ├── StructureContainer.md │ ├── StructureController.md │ ├── StructureExtension.md │ ├── StructureExtractor.md │ ├── StructureFactory.md │ ├── StructureInvaderCore.md │ ├── StructureKeeperLair.md │ ├── StructureLab.md │ ├── StructureLink.md │ ├── StructureNuker.md │ ├── StructureObserver.md │ ├── StructurePortal.md │ ├── StructurePowerBank.md │ ├── StructurePowerSpawn.md │ ├── StructureRampart.md │ ├── StructureRoad.md │ ├── StructureSpawn.md │ ├── StructureSpawnSpawning.md │ ├── StructureStorage.md │ ├── StructureTerminal.md │ ├── StructureTower.md │ ├── StructureWall.md │ ├── Tombstone.md │ ├── constants.md │ └── inherited │ │ ├── OwnedStructure.md │ │ ├── RoomObject.md │ │ └── Structure.md └── themes │ └── screeps-api │ ├── layout │ ├── index.jade │ ├── page.jade │ └── post.jade │ └── source │ ├── css │ ├── _icon-font.scss │ ├── _normalize.scss │ ├── _variables.scss │ ├── print.scss │ ├── prism.css │ └── screen.scss │ ├── fonts │ ├── slate.eot │ ├── slate.svg │ ├── slate.ttf │ ├── slate.woff │ └── slate.woff2 │ ├── img │ ├── bodyparts.png │ ├── container.png │ ├── controller.png │ ├── cpu.png │ ├── deposit.png │ ├── extractor.png │ ├── factory.png │ ├── invaderCore.png │ ├── keeperLair.png │ ├── lab.png │ ├── link-external.svg │ ├── link.png │ ├── logo.png │ ├── logotype_bw_animation.svg │ ├── navbar.png │ ├── nuke.png │ ├── observer.png │ ├── portal.png │ ├── powerBank.png │ ├── powerSpawn.png │ ├── property_types.png │ ├── rampart.png │ ├── road_plain.png │ ├── ruin.png │ ├── spawn (1).png │ ├── spawn.png │ ├── storage.png │ ├── terminal.png │ ├── tombstone.gif │ ├── tower.png │ ├── visual.png │ └── wall.png │ └── js │ ├── all.js │ ├── all_nosearch.js │ ├── app │ ├── lang.js │ ├── search.js │ └── toc.js │ └── lib │ ├── _imagesloaded.min.js │ ├── energize.js │ ├── jquery.highlight.js │ ├── jquery.js │ ├── jquery.tocify.js │ ├── jquery_ui.js │ ├── lunr.js │ └── prism.js ├── package-lock.json ├── package.json ├── scripts ├── helpers.js ├── tag-powers.js └── tags.js ├── source ├── _data │ ├── languages.yml │ └── sidebar.yml ├── _posts │ └── test.md ├── architecture.md ├── auth-tokens.md ├── changelog.md ├── commit.md ├── community-servers.md ├── contributed │ ├── advanced_grunt.md │ ├── caching-overview.md │ ├── modifying-prototypes.md │ ├── ps_ubuntu.md │ └── rules.md ├── control.md ├── cpu-limit.md ├── creeps.md ├── debugging.md ├── defense.md ├── game-loop.md ├── global-objects.md ├── index.md ├── introduction.md ├── invaders.md ├── market.md ├── modules.md ├── power.md ├── privacy-policy.md ├── ptr.md ├── resources.md ├── respawn.md ├── scripting-basics.md ├── simultaneous-actions.md ├── start-areas.md ├── third-party.md └── tos.md └── themes └── screeps-docs ├── languages ├── en.yml ├── ko.yml ├── ru.yml ├── zh-cn.yml └── zh-tw.yml ├── layout ├── archive.swig ├── layout.swig ├── page.swig ├── partial │ ├── after_footer.swig │ ├── footer.swig │ ├── google_analytics.swig │ ├── head.swig │ ├── header.swig │ ├── mobile_nav.swig │ ├── post.swig │ ├── sidebar.swig │ └── theme.swig └── post.swig └── source ├── css ├── _partial │ ├── archive.styl │ ├── base.styl │ ├── footer.styl │ ├── header.styl │ ├── highlight.styl │ ├── index.styl │ ├── mobile_nav.styl │ ├── page.styl │ ├── plugins.styl │ ├── post.styl │ └── sidebar.styl ├── _variables.styl ├── custom.styl ├── navy.styl └── prism.css ├── img ├── 2016-03-09_10-32-33.gif ├── CreateSpawn.png ├── Respawn.png ├── RespawnConfirm.png ├── action-priorities.png ├── addTwo.wasm ├── architecture_run.png ├── architecture_stage1.png ├── architecture_stage2.png ├── auth_tokens.png ├── bigHealer.png ├── bigMelee.png ├── bigRanged.png ├── binary1.png ├── binary2.png ├── binary3.png ├── bodyparts.png ├── c1.png ├── c2.png ├── chrome_2016-06-21_22-21-36.png ├── chrome_2016-11-24_14-55-59.png ├── chrome_2017-03-06_14-40-11.png ├── chrome_2017-03-08_13-01-20.png ├── colony-center.png ├── commander.png ├── commodities.png ├── commodities1.png ├── commodities2.png ├── commodities3.png ├── commodities4.png ├── commodities5.png ├── commodities6.png ├── commodities7.png ├── commodities8.png ├── community-servers.png ├── controllerDowngrade.png ├── cpu-bucket.png ├── defense1.png ├── defense2.png ├── defense3.png ├── defense4.png ├── executor.png ├── game-loop.png ├── gcl-cpu.png ├── gpl.png ├── invader-core-expand.gif ├── invader.png ├── link-external.svg ├── logo-color.png ├── logo.png ├── logotype_bw_animation.svg ├── minerals-01.png ├── minerals-02.png ├── mining_minerals.png ├── novice.png ├── operator.png ├── pc_anim.mp4 ├── power_banks.gif ├── power_banks.png ├── power_spawn.png ├── safe_mode.png ├── shards.png ├── smallHealer.png ├── smallMelee.png ├── smallRanged.png ├── stronghold1.png ├── stronghold5.png ├── stronghold_loot1.png ├── stronghold_loot2.png ├── stronghold_loot3.png ├── stronghold_loot4.png ├── stronghold_loot5.png ├── token-noratelimit.png └── world-map.png └── js ├── custom.js ├── lang_select.js ├── mobile_nav.js ├── plugins.js ├── scrollingelement.js └── toc.js /.circleci/config.yml: -------------------------------------------------------------------------------- 1 | # Javascript Node CircleCI 2.0 configuration file 2 | 3 | version: 2 4 | jobs: 5 | build: 6 | docker: 7 | - image: node:10-alpine3.11 8 | working_directory: ~/build 9 | steps: 10 | - run: 11 | name: Install dependencies 12 | command: apk add docker-cli git python2 g++ make openssh-client 13 | - checkout 14 | - run: 15 | name: Build 16 | command: | 17 | npm ci && npm run generate && cd api && npm ci && npm run generate 18 | - setup_remote_docker: 19 | - run: 20 | name: Build and push images 21 | command: | 22 | docker login -u _json_key -p "$GCRIO_KEY" https://gcr.io 23 | docker build -t gcr.io/screeps-test/docs:$CIRCLE_BUILD_NUM -f ~/build/Dockerfile ~/build 24 | docker push gcr.io/screeps-test/docs:$CIRCLE_BUILD_NUM 25 | - run: 26 | name: Tag commits 27 | command: | 28 | git tag build-$CIRCLE_BUILD_NUM && git push origin --tags 29 | 30 | workflows: 31 | version: 2 32 | production: 33 | jobs: 34 | - build: 35 | context: production 36 | -------------------------------------------------------------------------------- /.github/workflows/build-image.yml: -------------------------------------------------------------------------------- 1 | name: Build docker image 2 | on: push 3 | permissions: 4 | contents: read 5 | packages: write 6 | jobs: 7 | build: 8 | if: "!contains(github.event.head_commit.message, 'skip ci')" 9 | runs-on: ubuntu-latest 10 | steps: 11 | - name: Set up Docker Buildx 12 | id: buildx 13 | uses: docker/setup-buildx-action@v2 14 | - name: Use Node.js ${{ matrix.node-version }} 15 | uses: actions/setup-node@v1 16 | with: 17 | node-version: '10.x' 18 | - name: Checkout source 19 | uses: actions/checkout@v3 20 | - name: Build 21 | run: npm ci && npm run generate && cd api && npm ci && npm run generate 22 | - name: Log in to the Container registry 23 | uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 24 | with: 25 | registry: ghcr.io 26 | username: ${{ github.actor }} 27 | password: ${{ secrets.GITHUB_TOKEN }} 28 | - name: Generate image tag 29 | run: echo '::set-output name=IMAGE_TAG::'$(echo ${{ github.sha }} | cut -c1-8) 30 | id: tag-generator 31 | - name: Build and push Docker images 32 | uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc 33 | with: 34 | context: . 35 | push: true 36 | tags: ghcr.io/${{ github.repository }}:${{ steps.tag-generator.outputs.IMAGE_TAG }} 37 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | Thumbs.db 3 | db.json 4 | *.log 5 | node_modules/ 6 | api/node_modules/ 7 | api/db.json 8 | public/ 9 | .deploy*/ 10 | .idea 11 | .ptr -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM nginxinc/nginx-unprivileged:1.16-alpine 2 | 3 | COPY public /usr/share/nginx/html 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | This project contains the sources of the [documentation web site](http://docs.screeps.com) for Screeps online game. 2 | 3 | You need to have Node.js in order to build this project. 4 | 5 | 1. Install all npm dependendcies: 6 | 7 | ``` 8 | npm install 9 | cd api 10 | npm install 11 | cd .. 12 | ``` 13 | 14 | 2. Generate static site: 15 | 16 | ``` 17 | npm run generate 18 | cd api 19 | npm run generate 20 | cd .. 21 | ``` 22 | 23 | You can use `generate-watch` instead of `generate` to sync changes in real time. 24 | 25 | 3. Run development server: 26 | 27 | ``` 28 | npm run server 29 | ``` 30 | 31 | -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | # Hexo Configuration 2 | ## Docs: https://hexo.io/docs/configuration.html 3 | ## Source: https://github.com/hexojs/hexo/ 4 | 5 | # Site 6 | title: Screeps Documentation 7 | subtitle: 8 | description: 9 | author: Screeps 10 | language: en 11 | timezone: 12 | 13 | # URL 14 | ## If your site is put in a subdirectory, set url as 'http://yoursite.com/child' and root as '/child/' 15 | url: http://docs.screeps.com/ 16 | root: / 17 | permalink: :title/ 18 | 19 | permalink_defaults: 20 | 21 | # Directory 22 | source_dir: source 23 | public_dir: public 24 | i18n_dir: :lang 25 | skip_render: 26 | 27 | # Writing 28 | new_post_name: :title.md # File name of new posts 29 | default_layout: page 30 | titlecase: false # Transform title into titlecase 31 | external_link: true # Open external links in new tab 32 | filename_case: 0 33 | render_drafts: false 34 | post_asset_folder: false 35 | relative_link: false 36 | future: true 37 | highlight: 38 | enable: false 39 | 40 | # Date / Time format 41 | ## Hexo uses Moment.js to parse and display date 42 | ## You can customize the date format as defined in 43 | ## http://momentjs.com/docs/#/displaying/format/ 44 | date_format: MMM DD, YYYY 45 | time_format: HH:mm:ss 46 | 47 | # Pagination 48 | ## Set per_page to 0 to disable pagination 49 | per_page: 10 50 | pagination_dir: page 51 | 52 | # Extensions 53 | ## Plugins: https://hexo.io/plugins/ 54 | ## Themes: https://hexo.io/themes/ 55 | theme: screeps-docs 56 | 57 | # Deployment 58 | ## Docs: https://hexo.io/docs/deployment.html 59 | deploy: 60 | type: 61 | 62 | optimize: 63 | image_min: false 64 | css_concat: false 65 | css_min: false 66 | js_concat: true 67 | js_min: false 68 | html_min: false 69 | gzip: false 70 | 71 | marked: 72 | breaks: false 73 | smartypants: false 74 | 75 | github: screeps/docs -------------------------------------------------------------------------------- /api/_config.yml: -------------------------------------------------------------------------------- 1 | # Hexo Configuration 2 | ## Docs: https://hexo.io/docs/configuration.html 3 | ## Source: https://github.com/hexojs/hexo/ 4 | 5 | # Site 6 | title: Screeps API 7 | subtitle: 8 | description: 9 | language: 10 | timezone: 11 | 12 | # URL 13 | ## If your site is put in a subdirectory, set url as 'http://yoursite.com/child' and root as '/child/' 14 | url: http://docs.screeps.com/api 15 | root: /api/ 16 | permalink: :title.html 17 | permalink_defaults: 18 | 19 | # Directory 20 | source_dir: source 21 | public_dir: ../public/api 22 | i18n_dir: :lang 23 | skip_render: 24 | 25 | # Writing 26 | new_post_name: :title.md # File name of new posts 27 | default_layout: post 28 | titlecase: false # Transform title into titlecase 29 | external_link: true # Open external links in new tab 30 | filename_case: 0 31 | render_drafts: false 32 | post_asset_folder: false 33 | relative_link: false 34 | future: true 35 | highlight: 36 | enable: false 37 | 38 | # Date / Time format 39 | ## Hexo uses Moment.js to parse and display date 40 | ## You can customize the date format as defined in 41 | ## http://momentjs.com/docs/#/displaying/format/ 42 | date_format: YYYY-MM-DD 43 | time_format: HH:mm:ss 44 | 45 | # Pagination 46 | ## Set per_page to 0 to disable pagination 47 | per_page: 10 48 | pagination_dir: page 49 | 50 | # Extensions 51 | ## Plugins: https://hexo.io/plugins/ 52 | ## Themes: https://hexo.io/themes/ 53 | theme: screeps-api 54 | 55 | # Deployment 56 | ## Docs: https://hexo.io/docs/deployment.html 57 | deploy: 58 | type: 59 | 60 | optimize: 61 | image_min: false 62 | css_concat: false 63 | css_min: false 64 | js_concat: true 65 | js_min: false 66 | html_min: false 67 | gzip: false 68 | 69 | api_generator: 70 | 71 | marked: 72 | breaks: false 73 | smartypants: false 74 | 75 | GlobalObjects: 76 | - Game.md 77 | - InterShardMemory.md 78 | - Map.md 79 | - MapVisual.md 80 | - Market.md 81 | - Memory.md 82 | - PathFinder.md 83 | - RawMemory.md 84 | - constants.md 85 | 86 | Prototypes: 87 | - ConstructionSite.md 88 | - Creep.md 89 | - Deposit.md 90 | - Flag.md 91 | - Mineral.md 92 | - Nuke.md 93 | - OwnedStructure.md 94 | - PathFinder.CostMatrix.md 95 | - PowerCreep.md 96 | - Resource.md 97 | - Room.md 98 | - Room.Terrain.md 99 | - RoomObject.md 100 | - RoomPosition.md 101 | - RoomVisual.md 102 | - Ruin.md 103 | - Source.md 104 | - Store.md 105 | - Structure.md 106 | - StructureContainer.md 107 | - StructureController.md 108 | - StructureExtension.md 109 | - StructureExtractor.md 110 | - StructureFactory.md 111 | - StructureInvaderCore.md 112 | - StructureKeeperLair.md 113 | - StructureLab.md 114 | - StructureLink.md 115 | - StructureNuker.md 116 | - StructureObserver.md 117 | - StructurePowerBank.md 118 | - StructurePowerSpawn.md 119 | - StructurePortal.md 120 | - StructureRampart.md 121 | - StructureRoad.md 122 | - StructureSpawn.md 123 | - StructureSpawnSpawning.md 124 | - StructureStorage.md 125 | - StructureTerminal.md 126 | - StructureTower.md 127 | - StructureWall.md 128 | - Tombstone.md 129 | -------------------------------------------------------------------------------- /api/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "screeps-docs-api", 3 | "version": "0.0.0", 4 | "private": true, 5 | "hexo": { 6 | "version": "3.9.0" 7 | }, 8 | "dependencies": { 9 | "@screeps/common": "^2.15.2", 10 | "cheerio": "^0.20.0", 11 | "concat-files": "^0.1.1", 12 | "hexo": "^3.2.0", 13 | "hexo-optimize": "^2.4.6", 14 | "hexo-renderer-jade": "^0.3.0", 15 | "hexo-renderer-marked": "screeps/hexo-renderer-marked", 16 | "hexo-renderer-scss": "^1.2.0", 17 | "hexo-server": "^0.2.0", 18 | "image-min": "^0.3.2" 19 | }, 20 | "scripts": { 21 | "clean": "hexo clean", 22 | "generate": "hexo clean && hexo generate", 23 | "generate-watch": "hexo generate --watch" 24 | } 25 | } -------------------------------------------------------------------------------- /api/scripts/generator.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var _ = require('lodash'); 4 | 5 | hexo.extend.generator.register('index', function(locals) { 6 | 7 | return { 8 | path: 'index.html', 9 | layout: 'index', 10 | data: { 11 | pages: _.reduce(locals.pages.data, (result, i) => (result[i.source] = i.content, result), {}) 12 | } 13 | } 14 | }); 15 | -------------------------------------------------------------------------------- /api/scripts/helper-is_ptr.js: -------------------------------------------------------------------------------- 1 | 2 | hexo.extend.helper.register('is_ptr', function() { 3 | return process.env.IS_PTR === "1"; 4 | }); -------------------------------------------------------------------------------- /api/scripts/helper-tocify.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const cheerio = require('cheerio'); 4 | 5 | const API_PROPERTY = 'api-property--property'; 6 | const API_METHOD = 'api-property--method'; 7 | const API_DEPRECATED = 'api-property--deprecated'; 8 | const API_INHERITED = 'api-property--inherited'; 9 | 10 | const TOCIFY_ITEM__API_PROPERTY = 'tocify-item--api-property'; 11 | const TOCIFY_ITEM__API_METHOD = 'tocify-item--api-method'; 12 | const TOCIFY_ITEM__API_DEPRECATED = 'tocify-item--api-deprecated'; 13 | const TOCIFY_ITEM__API_INHERITED = 'tocify-item--api-inherited'; 14 | 15 | hexo.extend.helper.register('tocify', function(page) { 16 | const $ = cheerio.load(page, { decodeEntities: false }); 17 | 18 | let header = ''; 19 | let headerText = ''; 20 | 21 | $('h1').each(function() { 22 | const $this = $(this); 23 | 24 | const id = $this.attr('id'); 25 | const text = headerText = $this.text(); 26 | 27 | header = `
  • 28 | ${ text } 29 |
  • `; 30 | }); 31 | 32 | const subheader = []; 33 | $('h2').each(function() { 34 | const $this = $(this); 35 | 36 | const id = $this.attr('id'); 37 | let text = $this.find('.api-property__name').text(); 38 | text = text.replace(`${ headerText }.`, ''); 39 | 40 | const classes = []; 41 | if ($this.hasClass(API_PROPERTY)) { 42 | classes.push(TOCIFY_ITEM__API_PROPERTY); 43 | } else { 44 | classes.push(TOCIFY_ITEM__API_METHOD); 45 | } 46 | 47 | if ($this.hasClass(API_DEPRECATED)) { 48 | classes.push(TOCIFY_ITEM__API_DEPRECATED); 49 | } 50 | 51 | if ($this.hasClass(API_INHERITED)) { 52 | classes.push(TOCIFY_ITEM__API_INHERITED); 53 | } 54 | 55 | const item = `
  • 56 | ${ text } 57 |
  • `; 58 | 59 | subheader.push(item); 60 | }); 61 | 62 | return ``; 70 | }); 71 | -------------------------------------------------------------------------------- /api/scripts/tag-api_method.js: -------------------------------------------------------------------------------- 1 | var util = require('hexo-util'); 2 | 3 | hexo.extend.tag.register('api_method', function(args) { 4 | if(args[2] === undefined) { 5 | args[2] = args[1]; 6 | args[1] = ''; 7 | } 8 | 9 | var signatures = args[1].split('|').map(i => `(${i})`).join('
    '); 10 | var inherited = ''; 11 | var cpuDescription = { 12 | 0: 'This method has insignificant CPU cost.', 13 | 1: 'This method has low CPU cost.', 14 | 2: 'This method has medium CPU cost.', 15 | 3: 'This method has high CPU cost.', 16 | A: 'This method is an action that changes game state. It has additional 0.2 CPU cost added to its natural cost in case if OK code is returned.', 17 | }; 18 | 19 | var name = args[0]; 20 | var m = name.match(/^(.*?):(.*)$/); 21 | if(m) { 22 | name = m[2]; 23 | inherited = `
    Inherited from ${m[1]}
    `; 24 | } 25 | var opts = {}; 26 | if(args[3]) { 27 | opts = JSON.parse(args[3]); 28 | } 29 | 30 | const matches = /^${inherited}${name}${signatures} 47 |
    48 | `; 49 | if(opts.deprecated) { 50 | var text = 'This method is deprecated and will be removed soon.'; 51 | if(opts.deprecated !== true) { 52 | text += ' '+opts.deprecated; 53 | } 54 | text = hexo.render.renderSync({text, engine: 'markdown'}); 55 | result += `\n
    ${text}
    ` 56 | } 57 | return result; 58 | }, {async: false}); -------------------------------------------------------------------------------- /api/scripts/tag-api_property.js: -------------------------------------------------------------------------------- 1 | var util = require('hexo-util'); 2 | var fs = require('fs'); 3 | 4 | hexo.extend.tag.register('api_property', function (args) { 5 | var name = args[0], inherited = ''; 6 | var m = name.match(/^(.*?):(.*)$/); 7 | if (m) { 8 | name = m[2]; 9 | inherited = `
    Inherited from ${m[1]}
    `; 10 | } 11 | 12 | var opts = {}; 13 | if(args[2]) { 14 | opts = JSON.parse(args[2]); 15 | } 16 | 17 | const matches = /^${inherited}${name}${args[1]}`; 34 | if (opts.deprecated) { 35 | var text = 'This property is deprecated and will be removed soon.'; 36 | if (opts.deprecated !== true) { 37 | text += ' ' + opts.deprecated; 38 | } 39 | text = hexo.render.renderSync({text, engine: 'markdown'}); 40 | result += `
    ${text}
    ` 41 | } 42 | return result; 43 | }, {async: false}); -------------------------------------------------------------------------------- /api/scripts/tag-api_return_codes.js: -------------------------------------------------------------------------------- 1 | var util = require('hexo-util'); 2 | 3 | var codes = { 4 | OK: 0, 5 | ERR_NOT_OWNER: -1, 6 | ERR_NO_PATH: -2, 7 | ERR_NAME_EXISTS: -3, 8 | ERR_BUSY: -4, 9 | ERR_NOT_FOUND: -5, 10 | ERR_NOT_ENOUGH_ENERGY: -6, 11 | ERR_NOT_ENOUGH_RESOURCES: -6, 12 | ERR_INVALID_TARGET: -7, 13 | ERR_FULL: -8, 14 | ERR_NOT_IN_RANGE: -9, 15 | ERR_INVALID_ARGS: -10, 16 | ERR_TIRED: -11, 17 | ERR_NO_BODYPART: -12, 18 | ERR_NOT_ENOUGH_EXTENSIONS: -6, 19 | ERR_RCL_NOT_ENOUGH: -14, 20 | ERR_GCL_NOT_ENOUGH: -15, 21 | }; 22 | 23 | hexo.extend.tag.register('api_return_codes', function(args, content) { 24 | var params = content.split("\n"), 25 | result = "\n", 26 | codesHtml = []; 27 | 28 | params.forEach(i => { 29 | var [code, desc] = i.split(" | "); 30 | desc = hexo.render.renderSync({text: desc.trim(), engine: 'markdown'}); 31 | codesHtml.push({code: codes[code], html: `\n`}); 32 | }); 33 | 34 | codesHtml.sort((a,b) => b.code - a.code); 35 | 36 | result += codesHtml.map(i => i.html).join(''); 37 | 38 | result += "
    constantvaluedescription
    ${code}${codes[code]}${desc}
    \n"; 39 | 40 | return result; 41 | 42 | }, {async: false, ends: true}); -------------------------------------------------------------------------------- /api/scripts/tag-constants.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs'); 2 | 3 | hexo.extend.tag.register('constants', function (args) { 4 | var constants = fs.readFileSync(require.resolve('@screeps/common/lib/constants.js')); 5 | return hexo.render.renderSync({text: '```javascript-content\n'+constants+'\n```', engine: 'markdown'});; 6 | }, {async: false}); -------------------------------------------------------------------------------- /api/scripts/tag-content_code.js: -------------------------------------------------------------------------------- 1 | var util = require('hexo-util'); 2 | 3 | hexo.extend.tag.register('api_method_params', function(args, content) { 4 | var params = content.split("\n===\n"), 5 | result = "\n"; 6 | 7 | params.forEach(i => { 8 | var m = i.trim().match(/^(.*?) : (.*?)\n/); 9 | if(!m) { 10 | throw new Error('invalid method_params syntax in "'+i+'"'); 11 | } 12 | var desc = hexo.render.renderSync({text: i.substring(m[0].length).trim(), engine: 'markdown'}); 13 | var optional = ''; 14 | if(/ \(optional\)/.test(m[1])) { 15 | m[1] = m[1].replace(" (optional)", ""); 16 | optional = '
    optional'; 17 | } 18 | result += `\n`; 19 | }); 20 | 21 | result += "
    parametertypedescription
    ${m[1]}${optional}${m[2]}${desc}
    \n"; 22 | 23 | return result; 24 | 25 | }, {async: false, ends: true}); -------------------------------------------------------------------------------- /api/scripts/tag-method_params.js: -------------------------------------------------------------------------------- 1 | var util = require('hexo-util'); 2 | 3 | hexo.extend.tag.register('api_method_params', function(args, content) { 4 | var params = content.split("\n===\n"), 5 | result = "\n"; 6 | 7 | params.forEach(i => { 8 | var m = i.trim().match(/^(.*?) : (.*?)\n/); 9 | if(!m) { 10 | throw new Error('invalid method_params syntax in "'+i+'"'); 11 | } 12 | var desc = hexo.render.renderSync({text: i.substring(m[0].length).trim(), engine: 'markdown'}); 13 | var optional = ''; 14 | if(/ \(optional\)/.test(m[1])) { 15 | m[1] = m[1].replace(" (optional)", ""); 16 | optional = '
    optional'; 17 | } 18 | result += `\n`; 19 | }); 20 | 21 | result += "
    parametertypedescription
    ${m[1]}${optional}${m[2]}${desc}
    \n"; 22 | 23 | return result; 24 | 25 | }, {async: false, ends: true}); -------------------------------------------------------------------------------- /api/scripts/tag-page.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var _ = require('lodash'); 4 | var Promise = require('bluebird'); 5 | 6 | hexo.extend.tag.register('page', function(args) { 7 | 8 | var page = _.find(hexo.locals.get('pages').data, {source: args[0]}); 9 | if (!page) throw new Error(`Could not find a page '${args[0]}`); 10 | page = _.cloneDeep(page); 11 | 12 | if (!this.headerId) { 13 | const matches = /^ { 24 | return data.content; 25 | }); 26 | }, {async: true}); 27 | 28 | 29 | -------------------------------------------------------------------------------- /api/source/ConstructionSite.md: -------------------------------------------------------------------------------- 1 | # ConstructionSite 2 | 3 | A site of a structure which is currently under construction. A construction site can be created using the 'Construct' button at the left of the game field or the [`Room.createConstructionSite`](#Room.createConstructionSite) method. 4 | 5 | To build a structure on the construction site, give a worker creep some amount of energy and perform [`Creep.build`](#Creep.build) action. 6 | 7 | You can remove enemy construction sites by moving a creep on it. 8 | 9 | {% page inherited/RoomObject.md %} 10 | 11 | {% api_property id string %} 12 | 13 | 14 | 15 | A unique object identificator. You can use Game.getObjectById method to retrieve an object instance by its id. 16 | 17 | 18 | 19 | {% api_property my boolean %} 20 | 21 | 22 | 23 | Whether this is your own construction site. 24 | 25 | 26 | 27 | {% api_property owner object %} 28 | 29 | 30 | 31 | An object with the structure’s owner info containing the following properties: 32 | 33 | {% api_method_params %} 34 | username : string 35 | The name of the owner user. 36 | {% endapi_method_params %} 37 | 38 | 39 | {% api_property progress number %} 40 | 41 | 42 | 43 | The current construction progress. 44 | 45 | 46 | 47 | {% api_property progressTotal number %} 48 | 49 | 50 | 51 | The total construction progress needed for the structure to be built. 52 | 53 | 54 | 55 | {% api_property structureType string %} 56 | 57 | 58 | 59 | One of the STRUCTURE_* constants. 60 | 61 | 62 | 63 | {% api_method remove '' A %} 64 | 65 | 66 | 67 | Remove the construction site. 68 | 69 | 70 | 71 | ### Return value 72 | 73 | One of the following codes: 74 | {% api_return_codes %} 75 | OK | The operation has been scheduled successfully. 76 | ERR_NOT_OWNER | You are not the owner of this construction site, and it's not in your room. 77 | {% endapi_return_codes %} 78 | 79 | 80 | -------------------------------------------------------------------------------- /api/source/Deposit.md: -------------------------------------------------------------------------------- 1 | # Deposit 2 | 3 | 4 | 5 | A rare resource deposit needed for producing commodities. Can be harvested by creeps with a `WORK` body part. 6 | Each harvest operation triggers a cooldown period, which becomes longer and longer over time. 7 | 8 | Learn more about deposits from [this article](/resources.html). 9 | 10 | 11 | 12 | 13 | 14 | 16 | 17 | 18 | 19 | 20 | 21 |
    Cooldown`0.001 * totalHarvested ^ 1.2` 15 |
    Decay50,000 ticks after appearing or last harvest operation
    22 | 23 | {% page inherited/RoomObject.md %} 24 | 25 | {% api_property cooldown 'number' %} 26 | 27 | 28 | The amount of game ticks until the next harvest action is possible. 29 | 30 | 31 | {% api_property depositType 'string' %} 32 | 33 | 34 | The deposit type, one of the following constants: 35 | 36 | ```javascript-content 37 | RESOURCE_MIST 38 | RESOURCE_BIOMASS 39 | RESOURCE_METAL 40 | RESOURCE_SILICON 41 | ``` 42 | 43 | {% api_property id 'string' %} 44 | 45 | A unique object identificator. You can use Game.getObjectById method to retrieve an object instance by its id. 46 | 47 | 48 | 49 | {% api_property lastCooldown 'number' %} 50 | 51 | 52 | The cooldown of the last harvest operation on this deposit. 53 | 54 | 55 | {% api_property ticksToDecay 'number' %} 56 | 57 | 58 | The amount of game ticks when this deposit will disappear. 59 | -------------------------------------------------------------------------------- /api/source/Flag.md: -------------------------------------------------------------------------------- 1 | # Flag 2 | 3 | A flag. Flags can be used to mark particular spots in a room. Flags are visible to their owners only. You cannot have more than 10,000 flags. 4 | 5 | {% page inherited/RoomObject.md %} 6 | 7 | {% api_property color number %} 8 | 9 | Flag primary color. One of the COLOR_* constants. 10 | 11 | 12 | 13 | {% api_property memory any %} 14 | 15 | 16 | 17 | A shorthand to Memory.flags[flag.name]. You can use it for quick access the flag's specific memory data object. 18 | 19 | 20 | 21 | {% api_property name string %} 22 | 23 | 24 | 25 | Flag’s name. You can choose the name while creating a new flag, and it cannot be changed later. This name is a hash key to access the flag via the Game.flags object. The maximum name length is 100 charactes. 26 | 27 | 28 | 29 | {% api_property secondaryColor number %} 30 | 31 | 32 | 33 | Flag secondary color. One of the COLOR_* constants. 34 | 35 | 36 | 37 | {% api_method remove '' A %} 38 | 39 | 40 | 41 | Remove the flag. 42 | 43 | 44 | 45 | ### Return value 46 | 47 | Always returns 48 | OK 49 | . 50 | 51 | {% api_method setColor 'color, [secondaryColor]' A %} 52 | 53 | ```javascript 54 | Game.flags.Flag1.setColor(COLOR_GREEN, COLOR_WHITE); 55 | ``` 56 | 57 | Set new color of the flag. 58 | 59 | {% api_method_params %} 60 | color : number 61 | Primary color of the flag. One of the COLOR_* constants. 62 | === 63 | secondaryColor (optional) : number 64 | Secondary color of the flag. One of the COLOR_* constants. 65 | {% endapi_method_params %} 66 | 67 | 68 | ### Return value 69 | 70 | One of the following codes: 71 | {% api_return_codes %} 72 | OK | The operation has been scheduled successfully. 73 | ERR_INVALID_ARGS | color or secondaryColor is not a valid color constant. 74 | {% endapi_return_codes %} 75 | 76 | 77 | 78 | {% api_method setPosition 'x,y|pos' A %} 79 | 80 | ```javascript 81 | Game.flags.Flag1.setPosition(10,20); 82 | ``` 83 | 84 | ```javascript 85 | Game.flags.Flag1.setPosition( new RoomPosition(10, 20, 'W3S5') ); 86 | ``` 87 | 88 | Set new position of the flag. 89 | 90 | {% api_method_params %} 91 | x : number 92 | The X position in the room. 93 | === 94 | y : number 95 | The Y position in the room. 96 | === 97 | pos : object 98 | Can be a RoomPosition object or any object containing RoomPosition. 99 | {% endapi_method_params %} 100 | 101 | 102 | ### Return value 103 | 104 | One of the following codes: 105 | {% api_return_codes %} 106 | OK | The operation has been scheduled successfully. 107 | ERR_INVALID_TARGET | The target provided is invalid. 108 | {% endapi_return_codes %} 109 | 110 | 111 | -------------------------------------------------------------------------------- /api/source/InterShardMemory.md: -------------------------------------------------------------------------------- 1 | # InterShardMemory 2 | 3 | `InterShardMemory` object provides an interface for communicating between shards. Your script is executed separatedly 4 | on each shard, and their [`Memory`](#Memory) objects are isolated from each other. In order to pass messages and 5 | data between shards, you need to use `InterShardMemory` instead. 6 | 7 | Every shard can have its own 100 KB of data in string format that can be accessed by all other shards. 8 | A shard can write only to its own data, other shards' data is read-only. 9 | 10 | This data has nothing to do with `Memory` contents, it's a separate data container. 11 | 12 | {% api_method InterShardMemory.getLocal '' 0 %} 13 | 14 | Returns the string contents of the current shard's data. 15 | 16 | {% api_method InterShardMemory.setLocal 'value' 0 %} 17 | 18 | ```javascript 19 | var data = JSON.parse(InterShardMemory.getLocal() || "{}"); 20 | data.message = "hello from another shard!"; 21 | InterShardMemory.setLocal(JSON.stringify(data)); 22 | ``` 23 | 24 | Replace the current shard's data with the new value. 25 | 26 | {% api_method_params %} 27 | value : string 28 | New data value in string format. 29 | {% endapi_method_params %} 30 | 31 | 32 | {% api_method InterShardMemory.getRemote 'shard' 0 %} 33 | 34 | ```javascript 35 | var data = JSON.parse(InterShardMemory.getRemote('shard0') || "{}"); 36 | console.log(data.message); 37 | ``` 38 | 39 | Returns the string contents of another shard's data. 40 | 41 | {% api_method_params %} 42 | shard : string 43 | Shard name. 44 | {% endapi_method_params %} 45 | -------------------------------------------------------------------------------- /api/source/Memory.md: -------------------------------------------------------------------------------- 1 | # Memory 2 | 3 | A global plain object which can contain arbitrary data. You can access it both using the API and the Memory UI in the game editor. 4 | Learn how to work with memory from [this article](http://docs.screeps.com/global-objects.html#Memory-object). -------------------------------------------------------------------------------- /api/source/Mineral.md: -------------------------------------------------------------------------------- 1 | # Mineral 2 | 3 | A mineral deposit. Can be harvested by creeps with a `WORK` body part using the extractor structure.  4 | Learn more about minerals from [this article](/resources.html). 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 |
    Regeneration amountDENSITY_LOW: 15,000
    DENSITY_MODERATE: 35,000
    DENSITY_HIGH: 70,000
    DENSITY_ULTRA: 100,000
    Regeneration time50,000 ticks
    Density change probabilityDENSITY_LOW: 100% chance
    DENSITY_MODERATE: 5% chance
    DENSITY_HIGH: 5% chance
    DENSITY_ULTRA: 100% chance
    22 | 23 | {% page inherited/RoomObject.md %} 24 | 25 | {% api_property density 'number' %} 26 | 27 | 28 | 29 | The density that this mineral deposit will be refilled to once ticksToRegeneration reaches 0. This is one of the DENSITY_* constants. 30 | 31 | 32 | 33 | {% api_property mineralAmount 'number' %} 34 | 35 | 36 | 37 | The remaining amount of resources. 38 | 39 | 40 | 41 | {% api_property mineralType 'string' %} 42 | 43 | 44 | 45 | The resource type, one of the RESOURCE_* constants. 46 | 47 | 48 | 49 | {% api_property id 'string' %} 50 | 51 | 52 | 53 | A unique object identificator. You can use Game.getObjectById method to retrieve an object instance by its id. 54 | 55 | 56 | 57 | {% api_property ticksToRegeneration 'number' %} 58 | 59 | 60 | 61 | The remaining time after which the deposit will be refilled. 62 | 63 | 64 | -------------------------------------------------------------------------------- /api/source/Nuke.md: -------------------------------------------------------------------------------- 1 | # Nuke 2 | 3 | A nuke landing position. This object cannot be removed or modified. You can find incoming nukes in the room using the `FIND_NUKES` constant. 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 23 | 24 | 25 |
    Landing time50,000 ticks
    EffectAll creeps, construction sites and dropped resources in the room are removed immediately, even inside ramparts. Damage to structures: 14 |
      15 |
    • 10,000,000 hits at the landing position;
    • 16 |
    • 5,000,000 hits to all structures in 5x5 area.
    • 17 |
    18 |

    Note that you can stack multiple nukes from different rooms at the same target position to increase damage.

    19 |

    Nuke landing does not generate tombstones and ruins, and destroys all existing tombstones and ruins in the room

    20 |

    If the room is in safe mode, then the safe mode is cancelled immediately, and the safe mode cooldown is reset to 0.

    21 |

    The room controller is hit by triggering upgradeBlocked period, which means it is unavailable to activate safe mode again within the next 200 ticks.

    22 |
    26 | 27 | {% page inherited/RoomObject.md %} 28 | 29 | {% api_property id 'string' %} 30 | 31 | 32 | 33 | A unique object identificator. You can use Game.getObjectById method to retrieve an object instance by its id. 34 | 35 | 36 | 37 | {% api_property launchRoomName 'string' %} 38 | 39 | 40 | 41 | The name of the room where this nuke has been launched from. 42 | 43 | 44 | 45 | {% api_property timeToLand 'number' %} 46 | 47 | 48 | 49 | The remaining landing time. 50 | 51 | 52 | -------------------------------------------------------------------------------- /api/source/OwnedStructure.md: -------------------------------------------------------------------------------- 1 | # OwnedStructure 2 | 3 | The base prototype for a structure that has an owner. 4 | Such structures can be found using `FIND_MY_STRUCTURES` and `FIND_HOSTILE_STRUCTURES` constants. 5 | 6 | {% page inherited/Structure.md %} 7 | 8 | {% api_property my 'boolean' %} 9 | 10 | 11 | 12 | Whether this is your own structure. 13 | 14 | 15 | 16 | {% api_property owner 'object' %} 17 | 18 | 19 | 20 | An object with the structure’s owner info containing the following properties: 21 | 22 | {% api_method_params %} 23 | username : string 24 | The name of the owner user. 25 | {% endapi_method_params %} 26 | 27 | -------------------------------------------------------------------------------- /api/source/PathFinder.CostMatrix.md: -------------------------------------------------------------------------------- 1 | # PathFinder.CostMatrix 2 | 3 | Container for custom navigation cost data. By default `PathFinder` will only consider 4 | terrain data (plain, swamp, wall) — if you need to route around obstacles such as buildings 5 | or creeps you must put them into a `CostMatrix`. Generally you will create your `CostMatrix` 6 | from within `roomCallback`. If a non-0 value is found in a room's CostMatrix then that value 7 | will be used instead of the default terrain cost. You should avoid using large values in your 8 | CostMatrix and terrain cost flags. For example, running `PathFinder.search` with 9 | `{ plainCost: 1, swampCost: 5 }` is faster than running it with `{plainCost: 2, swampCost: 10 }` 10 | even though your paths will be the same. 11 | 12 | 13 | 14 | {% api_method constructor %} 15 | 16 | ```javascript 17 | let costs = new PathFinder.CostMatrix; 18 | ``` 19 | 20 | Creates a new CostMatrix containing 0's for all positions. 21 | 22 | 23 | 24 | 25 | 26 | {% api_method set 'x, y, cost' 0 %} 27 | 28 | ```javascript 29 | let costs = new PathFinder.CostMatrix; 30 | let pos = Game.spawns['Spawn1'].pos; 31 | costs.set(pos.x, pos.y, 255); // Can't walk over a building 32 | ``` 33 | 34 | Set the cost of a position in this CostMatrix. 35 | 36 | {% api_method_params %} 37 | x : number 38 | X position in the room. 39 | === 40 | y : number 41 | Y position in the room. 42 | === 43 | cost : number 44 | Cost of this position. Must be a whole number. A cost of 0 will use the terrain cost for that tile. A cost greater than or equal to 255 will be treated as unwalkable. 45 | {% endapi_method_params %} 46 | 47 | 48 | 49 | 50 | {% api_method get 'x, y' 0 %} 51 | 52 | 53 | 54 | Get the cost of a position in this CostMatrix. 55 | 56 | {% api_method_params %} 57 | x : number 58 | X position in the room. 59 | === 60 | y : number 61 | Y position in the room. 62 | {% endapi_method_params %} 63 | 64 | 65 | 66 | 67 | {% api_method clone '' 1 %} 68 | 69 | 70 | 71 | Copy this CostMatrix into a new CostMatrix with the same data. 72 | 73 | 74 | 75 | ### Return value 76 | 77 | A new CostMatrix instance. 78 | 79 | {% api_method serialize '' 1 %} 80 | 81 | ```javascript 82 | let costs = new PathFinder.CostMatrix; 83 | Memory.savedMatrix = costs.serialize(); 84 | ``` 85 | 86 | Returns a compact representation of this CostMatrix which can be stored via JSON.stringify. 87 | 88 | 89 | 90 | ### Return value 91 | 92 | An array of numbers. There's not much you can do with the numbers besides store them for later. 93 | 94 | {% api_method PathFinder.CostMatrix.deserialize 'val' 1 %} 95 | 96 | ```javascript 97 | let costs = PathFinder.CostMatrix.deserialize(Memory.savedMatrix) 98 | ``` 99 | 100 | Static method which deserializes a new CostMatrix using the return value of serialize. 101 | 102 | {% api_method_params %} 103 | val : object 104 | Whatever serialize returned 105 | {% endapi_method_params %} 106 | 107 | 108 | ### Return value 109 | 110 | Returns new 111 | CostMatrix 112 | instance. 113 | -------------------------------------------------------------------------------- /api/source/Resource.md: -------------------------------------------------------------------------------- 1 | # Resource 2 | 3 | A dropped piece of resource. It will decay after a while if not picked up. 4 | Dropped resource pile decays for `ceil(amount/1000)` units per tick.  5 | 6 | {% page inherited/RoomObject.md %} 7 | 8 | {% api_property amount 'number' %} 9 | 10 | 11 | 12 | The amount of resource units containing. 13 | 14 | 15 | 16 | {% api_property id 'string' %} 17 | 18 | 19 | 20 | A unique object identificator. You can use Game.getObjectById method to retrieve an object instance by its id. 21 | 22 | 23 | 24 | {% api_property resourceType 'string' %} 25 | 26 | 27 | 28 | One of the RESOURCE_* constants. 29 | 30 | 31 | -------------------------------------------------------------------------------- /api/source/RoomObject.md: -------------------------------------------------------------------------------- 1 | # RoomObject 2 | 3 | Any object with a position in a room. Almost all game objects prototypes are derived from `RoomObject`. 4 | 5 | {% api_property effects array %} 6 | Applied effects, an array of objects with the following properties: 7 | 8 | {% api_method_params %} 9 | effect : number 10 | Effect ID of the applied effect. Can be either natural effect ID or Power ID. 11 | === 12 | level (optional) : number 13 | Power level of the applied effect. Absent if the effect is not a Power effect. 14 | === 15 | ticksRemaining : number 16 | How many ticks will the effect last. 17 | {% endapi_method_params %} 18 | 19 | {% api_property pos 'RoomPosition' %} 20 | 21 | 22 | 23 | An object representing the position of this object in the room. 24 | 25 | 26 | 27 | {% api_property room 'Room' %} 28 | 29 | 30 | 31 | The link to the Room object. May be undefined in case if an object is a flag or a construction site and is placed in a room that is not visible to you. 32 | 33 | 34 | -------------------------------------------------------------------------------- /api/source/Ruin.md: -------------------------------------------------------------------------------- 1 | # Ruin 2 | 3 | 4 | 5 | A destroyed structure. This is a walkable object. 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
    Decay500 ticks except some special cases
    15 | 16 | {% page inherited/RoomObject.md %} 17 | 18 | 19 | {% api_property destroyTime 'number' %} 20 | 21 | The time when the structure has been destroyed. 22 | 23 | {% api_property id string %} 24 | 25 | A unique object identificator. You can use Game.getObjectById method to retrieve an object instance by its id. 26 | 27 | {% api_property store 'Store' %} 28 | 29 | A [`Store`](#Store) object that contains resources of this structure. 30 | 31 | {% api_property structure 'Structure | OwnedStructure' %} 32 | 33 | An object containing basic data of the destroyed structure. 34 | 35 | 36 | {% api_property ticksToDecay 'number' %} 37 | 38 | The amount of game ticks before this ruin decays. 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /api/source/Source.md: -------------------------------------------------------------------------------- 1 | # Source 2 | 3 | An energy source object. Can be harvested by creeps with a `WORK` body part. 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
    Energy amount4000 in center rooms
    3000 in an owned or reserved room
    1500 in an unreserved room
    Energy regenerationEvery 300 game ticks
    17 | 18 | {% page inherited/RoomObject.md %} 19 | 20 | {% api_property energy 'number' %} 21 | 22 | 23 | 24 | The remaining amount of energy. 25 | 26 | 27 | 28 | {% api_property energyCapacity 'number' %} 29 | 30 | 31 | 32 | The total amount of energy in the source. 33 | 34 | 35 | 36 | {% api_property id 'string' %} 37 | 38 | 39 | 40 | A unique object identificator. You can use Game.getObjectById method to retrieve an object instance by its id. 41 | 42 | 43 | 44 | {% api_property ticksToRegeneration 'number' %} 45 | 46 | 47 | 48 | The remaining time after which the source will be refilled. 49 | 50 | 51 | -------------------------------------------------------------------------------- /api/source/Store.md: -------------------------------------------------------------------------------- 1 | # Store 2 | 3 | An object that can contain resources in its cargo. 4 | 5 | There are two types of stores in the game: general purpose stores and limited stores. 6 | 7 | * General purpose stores can contain any resource within its capacity (e.g. creeps, containers, storages, terminals). 8 | 9 | * Limited stores can contain only a few types of resources needed for that particular object (e.g. spawns, extensions, labs, nukers). 10 | 11 | The `Store` prototype is the same for both types of stores, but they have different behavior depending on the `resource` argument in its methods. 12 | 13 | You can get specific resources from the store by addressing them as object properties: 14 | 15 | ```javascript-content 16 | console.log(creep.store[RESOURCE_ENERGY]); 17 | ``` 18 | 19 | 20 | 21 | {% api_method getCapacity '[resource]' 0 %} 22 | 23 | ```javascript 24 | if(creep.store[RESOURCE_ENERGY] < creep.store.getCapacity()) { 25 | goHarvest(creep); 26 | } 27 | ``` 28 | 29 | Returns capacity of this store for the specified resource. For a general purpose store, it returns total capacity if `resource` is undefined. 30 | 31 | {% api_method_params %} 32 | resource (optional) : string 33 | The type of the resource. 34 | {% endapi_method_params %} 35 | 36 | 37 | ### Return value 38 | 39 | Returns capacity number, or `null` in case of an invalid `resource` for this store type. 40 | 41 | {% api_method getFreeCapacity '[resource]' 0 %} 42 | 43 | ```javascript 44 | if(structure.store.getFreeCapacity(RESOURCE_ENERGY) > 0) { 45 | creep.transfer(structure, RESOURCE_ENERGY); 46 | } 47 | ``` 48 | Returns free capacity for the store. For a limited store, it returns the capacity available for the specified resource if `resource` is defined and valid for this store. 49 | 50 | {% api_method_params %} 51 | resource (optional) : string 52 | The type of the resource. 53 | {% endapi_method_params %} 54 | 55 | 56 | ### Return value 57 | 58 | Returns available capacity number, or `null` in case of an invalid `resource` for this store type. 59 | 60 | 61 | 62 | {% api_method getUsedCapacity '[resource]' 0 %} 63 | 64 | ```javascript 65 | if(Game.rooms['W1N1'].terminal.store.getUsedCapacity() == 0) { 66 | // terminal is empty 67 | } 68 | ``` 69 | 70 | Returns the capacity used by the specified resource. For a general purpose store, it returns total used capacity if `resource` is undefined. 71 | 72 | {% api_method_params %} 73 | resource (optional) : string 74 | The type of the resource. 75 | {% endapi_method_params %} 76 | 77 | 78 | ### Return value 79 | 80 | Returns used capacity number, or `null` in case of a not valid `resource` for this store type. 81 | -------------------------------------------------------------------------------- /api/source/Structure.md: -------------------------------------------------------------------------------- 1 | # Structure 2 | 3 | The base prototype object of all structures. 4 | 5 | {% page inherited/RoomObject.md %} 6 | 7 | {% api_property hits 'number' %} 8 | 9 | 10 | 11 | The current amount of hit points of the structure. 12 | 13 | 14 | 15 | {% api_property hitsMax 'number' %} 16 | 17 | 18 | 19 | The total amount of hit points of the structure. 20 | 21 | 22 | 23 | {% api_property id 'string' %} 24 | 25 | 26 | 27 | A unique object identificator. You can use Game.getObjectById method to retrieve an object instance by its id. 28 | 29 | 30 | 31 | {% api_property structureType 'string' %} 32 | 33 | 34 | 35 | One of the STRUCTURE_* constants. 36 | 37 | 38 | 39 | {% api_method destroy '' A %} 40 | 41 | 42 | 43 | Destroy this structure immediately. 44 | 45 | 46 | 47 | ### Return value 48 | 49 | One of the following codes: 50 | {% api_return_codes %} 51 | OK | The operation has been scheduled successfully. 52 | ERR_NOT_OWNER | You are not the owner of this structure, and it's not in your room. 53 | ERR_BUSY | Hostile creeps are in the room. 54 | {% endapi_return_codes %} 55 | 56 | 57 | 58 | {% api_method isActive '' 2 %} 59 | 60 | 61 | 62 | Check whether this structure can be used. If room controller level is insufficient, then this method will return false, and the structure will be highlighted with red in the game. 63 | 64 | 65 | 66 | ### Return value 67 | 68 | A boolean value. 69 | 70 | {% api_method notifyWhenAttacked 'enabled' A %} 71 | 72 | 73 | 74 | Toggle auto notification when the structure is under attack. The notification will be sent to your account email. Turned on by default. 75 | 76 | {% api_method_params %} 77 | enabled : boolean 78 | Whether to enable notification or disable. 79 | {% endapi_method_params %} 80 | 81 | 82 | ### Return value 83 | 84 | One of the following codes: 85 | {% api_return_codes %} 86 | OK | The operation has been scheduled successfully. 87 | ERR_NOT_OWNER | You are not the owner of this structure. 88 | ERR_INVALID_ARGS | enable argument is not a boolean value. 89 | {% endapi_return_codes %} 90 | 91 | 92 | -------------------------------------------------------------------------------- /api/source/StructureContainer.md: -------------------------------------------------------------------------------- 1 | # StructureContainer 2 | 3 | 4 | 5 | A small container that can be used to store resources. This is a walkable structure. All dropped resources automatically goes to the container at the same tile. 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 |
    Controller levelAny (including neutral rooms)
    Available per room5
    Capacity2,000
    Cost5,000
    Hits250,000
    DecayLoses 5,000 hits every 500 ticks in an owned room, and every 100 ticks in an unowned room.
    35 | 36 | {% page inherited/Structure.md %} 37 | 38 | {% api_property store 'Store' %} 39 | 40 | ```javascript 41 | const containersWithEnergy = room.find(FIND_STRUCTURES, { 42 | filter: (i) => i.structureType == STRUCTURE_CONTAINER && 43 | i.store[RESOURCE_ENERGY] > 0 44 | }); 45 | ``` 46 | 47 | 48 | A [`Store`](#Store) object that contains cargo of this structure. 49 | 50 | {% api_property storeCapacity 'number' '{"deprecated": true}' %} 51 | 52 | An alias for [`.store.getCapacity()`](#Store.getCapacity). 53 | 54 | 55 | 56 | {% api_property ticksToDecay 'number' %} 57 | 58 | 59 | 60 | The amount of game ticks when this container will lose some hit points. 61 | 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /api/source/StructureExtension.md: -------------------------------------------------------------------------------- 1 | # StructureExtension 2 | 3 | 4 | 5 | Contains energy which can be spent on spawning bigger creeps. Extensions can be placed anywhere in the room, any spawns will be able to use them regardless of distance. 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 |
    Controller level
    1
    25 extensions (50 capacity)
    310 extensions (50 capacity)
    420 extensions (50 capacity)
    530 extensions (50 capacity)
    640 extensions (50 capacity)
    750 extensions (100 capacity)
    860 extensions (200 capacity)
    Cost3,000
    Hits1,000
    54 | 55 | {% page inherited/OwnedStructure.md %} 56 | 57 | {% api_property energy 'number' '{"deprecated": true}' %} 58 | 59 | An alias for [`.store[RESOURCE_ENERGY]`](#StructureExtension.store). 60 | 61 | 62 | {% api_property energyCapacity 'number' '{"deprecated": true}' %} 63 | 64 | An alias for [`.store.getCapacity(RESOURCE_ENERGY)`](#Store.getCapacity). 65 | 66 | 67 | 68 | The total amount of energy the extension can contain. 69 | 70 | {% api_property store 'Store' %} 71 | 72 | ```javascript 73 | if(structure.store.getFreeCapacity(RESOURCE_ENERGY) > 0) { 74 | creep.transfer(structure, RESOURCE_ENERGY); 75 | } 76 | ``` 77 | 78 | 79 | A [`Store`](#Store) object that contains cargo of this structure. 80 | 81 | -------------------------------------------------------------------------------- /api/source/StructureExtractor.md: -------------------------------------------------------------------------------- 1 | # StructureExtractor 2 | 3 | 4 | 5 | Allows to harvest a mineral deposit. Learn more about minerals from [this article](/resources.html).

    6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 |
    Controller level6
    Cost5,000
    Hits500
    Cooldown5 ticks on each harvest action
    27 | 28 | {% page inherited/OwnedStructure.md %} 29 | 30 | {% api_property cooldown 'number' %} 31 | 32 | The amount of game ticks until the next harvest action is possible. 33 | 34 | 35 | -------------------------------------------------------------------------------- /api/source/StructureFactory.md: -------------------------------------------------------------------------------- 1 | # StructureFactory 2 | 3 | 4 | 5 | Produces trade commodities from base minerals and other commodities. Learn more about commodities from [this article](/resources.html#Commodities). 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 |
    Controller level
    1-6
    7-81 factory
    Cost100,000
    Hits1000
    Capacity50,000
    Production cooldownDepends on the resource
    38 | 39 | {% page inherited/OwnedStructure.md %} 40 | 41 | {% api_property cooldown 'number' %} 42 | 43 | 44 | 45 | The amount of game ticks the factory has to wait until the next production is possible. 46 | 47 | {% api_property level number %} 48 | 49 | ```javascript 50 | if(!factory.level) { 51 | Game.powerCreeps['MyOperator1'].usePower(PWR_OPERATE_FACTORY, factory); 52 | } 53 | ``` 54 | 55 | The factory's level. Can be set by applying the `PWR_OPERATE_FACTORY` power to a newly built factory. 56 | Once set, the level cannot be changed. 57 | 58 | {% api_property store 'Store' %} 59 | 60 | A [`Store`](#Store) object that contains cargo of this structure. 61 | 62 | 63 | 64 | {% api_property storeCapacity 'number' '{"deprecated": true}' %} 65 | 66 | An alias for [`.store.getCapacity()`](#Store.getCapacity). 67 | 68 | {% api_method produce 'resourceType' A %} 69 | 70 | ```javascript 71 | factory.produce(RESOURCE_UTRIUM_BAR); 72 | ``` 73 | 74 | Produces the specified commodity. All ingredients should be available in the factory store. 75 | 76 | {% api_method_params %} 77 | resourceType : string 78 | One of the RESOURCE_* constants. 79 | {% endapi_method_params %} 80 | 81 | 82 | ### Return value 83 | 84 | One of the following codes: 85 | {% api_return_codes %} 86 | OK | The operation has been scheduled successfully. 87 | ERR_NOT_OWNER | You are not the owner of this structure. 88 | ERR_RCL_NOT_ENOUGH | Your Room Controller level is insufficient to use the factory. 89 | ERR_NOT_ENOUGH_RESOURCES | The structure does not have the required amount of resources. 90 | ERR_INVALID_ARGS | The arguments provided are incorrect. 91 | ERR_INVALID_TARGET | The factory cannot produce the commodity of this level. 92 | ERR_TIRED | The factory is still cooling down. 93 | ERR_BUSY | The factory is not operated by the `PWR_OPERATE_FACTORY` power. 94 | ERR_FULL | The factory cannot contain the produce. 95 | {% endapi_return_codes %} 96 | -------------------------------------------------------------------------------- /api/source/StructureInvaderCore.md: -------------------------------------------------------------------------------- 1 | # StructureInvaderCore 2 | 3 | 4 | 5 | This NPC structure is a control center of NPC Strongholds, and also rules all invaders in the sector. It spawns NPC defenders of the stronghold, refill towers, repairs structures. 6 | While it's alive, it will spawn invaders in all rooms in the same sector. It also contains some valuable resources inside, which you can loot from its ruin if you destroy the structure. 7 | 8 | An Invader Core has two lifetime stages: deploy stage and active stage. When it appears in a random room in the sector, it has `ticksToDeploy` property, 9 | public ramparts around it, and doesn't perform any actions. While in this stage it's invulnerable to attacks (has `EFFECT_INVULNERABILITY` enabled). When the `ticksToDeploy` timer is over, it spawns structures around it and starts 10 | spawning creeps, becomes vulnerable, and receives `EFFECT_COLLAPSE_TIMER` which will remove the stronghold when this timer is over. 11 | 12 | An active Invader Core spawns level-0 Invader Cores in neutral neighbor rooms inside the sector. These lesser Invader Cores are spawned 13 | near the room controller and don't perform any activity except reserving/attacking the controller. One Invader Core can spawn up to 42 lesser Cores 14 | during its lifetime. 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 39 | 40 | 41 | 42 | 43 |
    Hits100,000
    Deploy time5,000 ticks
    Active time75,000 ticks with 10% random variation
    Lesser cores spawn interval 33 | Stronghold level 1: 4000 ticks
    34 | Stronghold level 2: 3500 ticks
    35 | Stronghold level 3: 3000 ticks
    36 | Stronghold level 4: 2500 ticks
    37 | Stronghold level 5: 2000 ticks
    38 |
    44 | 45 | {% page inherited/OwnedStructure.md %} 46 | 47 | 48 | {% api_property level 'number' %} 49 | 50 | The level of the stronghold. The amount and quality of the loot depends on the level. 51 | 52 | {% api_property ticksToDeploy 'number' %} 53 | 54 | Shows the timer for a not yet deployed stronghold, undefined otherwise. 55 | 56 | {% api_property spawning 'StructureSpawn.Spawning' %} 57 | 58 | If the core is in process of spawning a new creep, this object will contain a [`StructureSpawn.Spawning`](#StructureSpawn-Spawning) object, or null otherwise. 59 | -------------------------------------------------------------------------------- /api/source/StructureKeeperLair.md: -------------------------------------------------------------------------------- 1 | # StructureKeeperLair 2 | 3 | 4 | 5 | Non-player structure. Spawns NPC Source Keepers that guards energy sources and minerals in some rooms. This structure cannot be destroyed. 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
    Spawning time300
    15 | 16 | {% page inherited/OwnedStructure.md %} 17 | 18 | {% api_property ticksToSpawn 'number' %} 19 | 20 | Time to spawning of the next Source Keeper. 21 | 22 | 23 | -------------------------------------------------------------------------------- /api/source/StructureLink.md: -------------------------------------------------------------------------------- 1 | # StructureLink 2 | 3 | 4 | 5 | Remotely transfers energy to another Link in the same room. 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 |
    Controller level
    1-4
    52 links
    63 links
    74 links
    86 links
    Cost5,000
    Hits1,000
    Capacity800
    Cooldown time1 tick per tile of the linear distance to the target
    Energy loss3%
    54 | 55 | {% page inherited/OwnedStructure.md %} 56 | 57 | 58 | {% api_property cooldown 'number' %} 59 | 60 | 61 | 62 | The amount of game ticks the link has to wait until the next transfer is possible. 63 | 64 | 65 | 66 | {% api_property energy 'number' '{"deprecated": true}' %} 67 | 68 | An alias for [`.store[RESOURCE_ENERGY]`](#StructureExtension.store). 69 | 70 | 71 | 72 | {% api_property energyCapacity 'number' '{"deprecated": true}' %} 73 | 74 | An alias for [`.store.getCapacity(RESOURCE_ENERGY)`](#Store.getCapacity). 75 | 76 | {% api_property store 'Store' %} 77 | 78 | ```javascript 79 | if(structure.store.getFreeCapacity(RESOURCE_ENERGY) > 0) { 80 | creep.transfer(structure, RESOURCE_ENERGY); 81 | } 82 | ``` 83 | 84 | 85 | A [`Store`](#Store) object that contains cargo of this structure. 86 | 87 | 88 | 89 | {% api_method transferEnergy 'target, [amount]' A %} 90 | 91 | ```javascript 92 | const linkFrom = Game.rooms['W1N1'].lookForAt('structure', 10, 25)[0]; 93 | 94 | const linkTo = linkFrom.pos.findInRange(FIND_MY_STRUCTURES, 2, 95 | {filter: {structureType: STRUCTURE_LINK}})[0]; 96 | 97 | linkFrom.transferEnergy(linkTo); 98 | ``` 99 | 100 | Remotely transfer energy to another link at any location in the same room. 101 | 102 | {% api_method_params %} 103 | target : StructureLink 104 | The target object. 105 | === 106 | amount (optional) : number 107 | The amount of energy to be transferred. If omitted, all the available energy is used. 108 | {% endapi_method_params %} 109 | 110 | 111 | ### Return value 112 | 113 | One of the following codes: 114 | {% api_return_codes %} 115 | OK | The operation has been scheduled successfully. 116 | ERR_NOT_OWNER | You are not the owner of this link. 117 | ERR_NOT_ENOUGH_RESOURCES | The structure does not have the given amount of energy. 118 | ERR_INVALID_TARGET | The target is not a valid StructureLink object. 119 | ERR_FULL | The target cannot receive any more energy. 120 | ERR_INVALID_ARGS | The energy amount is incorrect. 121 | ERR_TIRED | The link is still cooling down. 122 | ERR_RCL_NOT_ENOUGH | Room Controller Level insufficient to use this link. 123 | ERR_NOT_IN_RANGE | The target is too far away. 124 | {% endapi_return_codes %} 125 | 126 | 127 | -------------------------------------------------------------------------------- /api/source/StructureObserver.md: -------------------------------------------------------------------------------- 1 | # StructureObserver 2 | 3 | 4 | 5 | Provides visibility into a distant room from your script. 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 |
    Controller level
    1-7
    81 observer
    Cost8,000
    Hits500
    Range10 rooms
    34 | 35 | {% page inherited/OwnedStructure.md %} 36 | 37 | 38 | {% api_method observeRoom 'roomName' A %} 39 | 40 | 41 | 42 | Provide visibility into a distant room from your script. The target room object will be available on the next tick. 43 | 44 | {% api_method_params %} 45 | roomName : string 46 | The name of the target room. 47 | {% endapi_method_params %} 48 | 49 | 50 | ### Return value 51 | 52 | One of the following codes: 53 | {% api_return_codes %} 54 | OK | The operation has been scheduled successfully. 55 | ERR_NOT_OWNER | You are not the owner of this structure. 56 | ERR_INVALID_ARGS | roomName argument is not a valid room name value. 57 | ERR_NOT_IN_RANGE | Room roomName is not in observing range. 58 | ERR_RCL_NOT_ENOUGH | Room Controller Level insufficient to use this structure. 59 | {% endapi_return_codes %} 60 | 61 | 62 | -------------------------------------------------------------------------------- /api/source/StructurePortal.md: -------------------------------------------------------------------------------- 1 | # StructurePortal 2 | 3 | 4 | 5 | A non-player structure. Instantly teleports your creeps to a distant room acting as a room exit tile. 6 | Portals appear randomly in the central room of each sector.

    7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 |
    Stable time10 days
    Decay time30,000 ticks
    20 | 21 | {% page inherited/Structure.md %} 22 | 23 | 24 | {% api_property destination 'RoomPosition | object' %} 25 | 26 | If this is an **inter-room** portal, then this property contains a `RoomPosition` object 27 | leading to the point in the destination room. 28 | 29 | If this is an **inter-shard** portal, then this property contains an object with `shard` and `room` string properties. 30 | Exact coordinates are undetermined, the creep will appear at any free spot in the destination room. 31 | 32 | 33 | {% api_property ticksToDecay 'number' %} 34 | 35 | 36 | 37 | The amount of game ticks when the portal disappears, or undefined when the portal is stable. 38 | 39 | 40 | -------------------------------------------------------------------------------- /api/source/StructurePowerBank.md: -------------------------------------------------------------------------------- 1 | # StructurePowerBank 2 | 3 | 4 | 5 | Non-player structure. Contains power resource which can be obtained by destroying the structure. 6 | Hits the attacker creep back on each attack. Learn more about power 7 | from [this article](/power.html). 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 |
    Hits2,000,000
    Return damage50%
    Capacity500 — 10,000
    Decay5,000 ticks
    29 | 30 | {% page inherited/OwnedStructure.md %} 31 | 32 | 33 | {% api_property power 'number' %} 34 | 35 | 36 | 37 | The amount of power containing. 38 | 39 | 40 | 41 | {% api_property ticksToDecay 'number' %} 42 | 43 | 44 | 45 | The amount of game ticks when this structure will disappear. 46 | -------------------------------------------------------------------------------- /api/source/StructurePowerSpawn.md: -------------------------------------------------------------------------------- 1 | # StructurePowerSpawn 2 | 3 | 4 | 5 | Processes power into your account, and spawns power creeps with special unique powers (in development). 6 | Learn more about power from [this article](/power.html). 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 |
    Controller level
    1-7
    81 power spawn
    Cost100,000
    Hits5,000
    Capacity5,000 energy units, 100 power units
    Processing cost50 energy units per 1 power unit
    Processing speed1 power unit per tick
    43 | 44 | {% page inherited/OwnedStructure.md %} 45 | 46 | 47 | {% api_property energy 'number' '{"deprecated": true}' %} 48 | 49 | An alias for [`.store[RESOURCE_ENERGY]`](#StructureExtension.store). 50 | 51 | 52 | 53 | {% api_property energyCapacity 'number' '{"deprecated": true}' %} 54 | 55 | An alias for [`.store.getCapacity(RESOURCE_ENERGY)`](#Store.getCapacity). 56 | 57 | 58 | 59 | {% api_property power 'number' '{"deprecated": true}' %} 60 | 61 | An alias for [`.store[RESOURCE_POWER]`](#StructureExtension.store). 62 | 63 | 64 | 65 | {% api_property powerCapacity 'number' '{"deprecated": true}' %} 66 | 67 | An alias for [`.store.getCapacity(RESOURCE_POWER)`](#Store.getCapacity). 68 | 69 | {% api_property store 'Store' %} 70 | 71 | ```javascript 72 | if(structure.store.getFreeCapacity(RESOURCE_ENERGY) > 0) { 73 | creep.transfer(structure, RESOURCE_ENERGY); 74 | } 75 | ``` 76 | 77 | 78 | A [`Store`](#Store) object that contains cargo of this structure. 79 | 80 | 81 | {% api_method processPower '' A %} 82 | 83 | 84 | 85 | Register power resource units into your account. Registered power allows to develop power creeps skills.  86 | 87 | 88 | 89 | ### Return value 90 | 91 | One of the following codes: 92 | {% api_return_codes %} 93 | OK | The operation has been scheduled successfully. 94 | ERR_NOT_OWNER | You are not the owner of this structure. 95 | ERR_NOT_ENOUGH_RESOURCES | The structure does not have enough energy or power resource units. 96 | ERR_RCL_NOT_ENOUGH | Room Controller Level insufficient to use this structure. 97 | {% endapi_return_codes %} 98 | 99 | -------------------------------------------------------------------------------- /api/source/StructureRampart.md: -------------------------------------------------------------------------------- 1 | # StructureRampart 2 | 3 | 4 | 5 | Blocks movement of hostile creeps, and defends your creeps and structures on the same tile. 6 | Can be used as a controllable gate. 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 |
    Controller level
    1
    2300,000 max hits
    31,000,000 max hits
    43,000,000 max hits
    510,000,000 max hits
    630,000,000 max hits
    7100,000,000 max hits
    8300,000,000 max hits
    Cost1
    Hits when constructed1
    DecayLoses 300 hits every 100 ticks
    59 | 60 | {% page inherited/OwnedStructure.md %} 61 | 62 | 63 | {% api_property isPublic 'boolean' %} 64 | 65 | 66 | 67 | If false (default), only your creeps can step on the same square. If true, any hostile creeps can pass through. 68 | 69 | 70 | 71 | {% api_property ticksToDecay 'number' %} 72 | 73 | 74 | 75 | The amount of game ticks when this rampart will lose some hit points. 76 | 77 | 78 | 79 | {% api_method setPublic 'isPublic' A %} 80 | 81 | 82 | 83 | Make this rampart public to allow other players' creeps to pass through. 84 | 85 | {% api_method_params %} 86 | isPublic : boolean 87 | Whether this rampart should be public or non-public. 88 | {% endapi_method_params %} 89 | 90 | 91 | ### Return value 92 | 93 | One of the following codes: 94 | {% api_return_codes %} 95 | OK | The operation has been scheduled successfully. 96 | ERR_NOT_OWNER | You are not the owner of this structure. 97 | {% endapi_return_codes %} 98 | 99 | 100 | -------------------------------------------------------------------------------- /api/source/StructureRoad.md: -------------------------------------------------------------------------------- 1 | # StructureRoad 2 | 3 | 4 | 5 | Decreases movement cost to 1. Using roads allows creating creeps with less `MOVE` body parts. You can also build roads on top of natural terrain walls which are otherwise impassable. 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 22 | 23 | 24 | 25 | 32 | 33 | 34 | 35 | 42 | 43 | 44 |
    Controller levelAny (including neutral rooms)
    Cost 16 |
      17 |
    • 300 on plain land
    • 18 |
    • 1,500 on swamp
    • 19 |
    • 45,000 on walls
    • 20 |
    21 |
    Hits 26 |
      27 |
    • 5,000 on plain land
    • 28 |
    • 25,000 on swamp
    • 29 |
    • 750,000 on walls
    • 30 |
    31 |
    Decay 36 |
      37 |
    • Loses 100 hits every 1,000 ticks on plain land
    • 38 |
    • Loses 500 hits every 1,000 ticks on swamp
    • 39 |
    • Loses 15,000 hits every 1,000 ticks on walls
    • 40 |
    41 | Note: every creep step decreases the decay timer for 1 tick per each creep body part
    45 | 46 | {% page inherited/Structure.md %} 47 | 48 | 49 | {% api_property ticksToDecay 'number' %} 50 | 51 | 52 | 53 | The amount of game ticks when this road will lose some hit points. 54 | 55 | 56 | -------------------------------------------------------------------------------- /api/source/StructureSpawnSpawning.md: -------------------------------------------------------------------------------- 1 | # StructureSpawn.Spawning 2 | 3 | Details of the creep being spawned currently that can be addressed by the [`StructureSpawn.spawning`](#StructureSpawn.spawning) property. 4 | 5 | {% api_property directions 'array' %} 6 | 7 | An array with the spawn directions, see [`StructureSpawn.Spawning.setDirections`](#StructureSpawn.Spawning.setDirections). 8 | 9 | {% api_property name 'string' %} 10 | 11 | The name of a new creep. 12 | 13 | {% api_property needTime 'number' %} 14 | 15 | Time needed in total to complete the spawning. 16 | 17 | {% api_property remainingTime 'number ' %} 18 | 19 | Remaining time to go. 20 | 21 | {% api_property spawn 'StructureSpawn' %} 22 | 23 | A link to the spawn. 24 | 25 | 26 | {% api_method cancel '' A %} 27 | 28 | ```javascript 29 | Game.spawns['Spawn1'].spawning.cancel(); 30 | ``` 31 | 32 | Cancel spawning immediately. Energy spent on spawning is not returned. 33 | 34 | ### Return value 35 | 36 | One of the following codes: 37 | {% api_return_codes %} 38 | OK | The operation has been scheduled successfully. 39 | ERR_NOT_OWNER | You are not the owner of this spawn. 40 | {% endapi_return_codes %} 41 | 42 | {% api_method setDirections 'directions' A %} 43 | 44 | ```javascript 45 | Game.spawns['Spawn1'].spawning.setDirections([RIGHT, TOP_RIGHT]); 46 | ``` 47 | 48 | Set desired directions where the creep should move when spawned. 49 | 50 | {% api_method_params %} 51 | directions : array<number> 52 | An array with the direction constants: 53 |
      54 |
    • TOP
    • 55 |
    • TOP_RIGHT
    • 56 |
    • RIGHT
    • 57 |
    • BOTTOM_RIGHT
    • 58 |
    • BOTTOM
    • 59 |
    • BOTTOM_LEFT
    • 60 |
    • LEFT
    • 61 |
    • TOP_LEFT
    • 62 |
    63 | {% endapi_method_params %} 64 | 65 | ### Return value 66 | 67 | One of the following codes: 68 | {% api_return_codes %} 69 | OK | The operation has been scheduled successfully. 70 | ERR_NOT_OWNER | You are not the owner of this spawn. 71 | ERR_INVALID_ARGS | The directions is array is invalid. 72 | {% endapi_return_codes %} 73 | -------------------------------------------------------------------------------- /api/source/StructureStorage.md: -------------------------------------------------------------------------------- 1 | # StructureStorage 2 | 3 | 4 | 5 | A structure that can store huge amount of resource units. Only one structure per room is allowed  6 | that can be addressed by [`Room.storage`](#Room.storage) property.

    7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 |
    Controller level
    1-3
    4-81 storage
    Cost30,000
    Hits10,000
    Capacity1,000,000
    35 | 36 | {% page inherited/OwnedStructure.md %} 37 | 38 | 39 | {% api_property store 'Store' %} 40 | 41 | A [`Store`](#Store) object that contains cargo of this structure. 42 | 43 | 44 | {% api_property storeCapacity 'number' '{"deprecated": true}' %} 45 | 46 | An alias for [`.store.getCapacity()`](#Store.getCapacity). 47 | 48 | -------------------------------------------------------------------------------- /api/source/StructureTerminal.md: -------------------------------------------------------------------------------- 1 | # StructureTerminal 2 | 3 | 4 | 5 | Sends any resources to a Terminal in another room. The destination Terminal can belong to any player. 6 | Each transaction requires additional energy (regardless of the transfer resource type) that can be 7 | calculated using [`Game.market.calcTransactionCost`](#Game.market.calcTransactionCost) method. 8 | For example, sending 1000 mineral units from W0N0 to W10N5 will consume 742 energy units. 9 | You can track your incoming and outgoing transactions using the [`Game.market`](#Game.market) object. 10 | Only one Terminal per room is allowed that can be addressed by [`Room.terminal`](#Room.terminal) property. 11 | 12 | Terminals are used in the [Market system](/market.html). 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 |
    Controller level
    1-5
    6-81 terminal
    Cost100,000
    Hits3,000
    Capacity300,000
    Cooldown on send10 ticks
    45 | 46 | {% page inherited/OwnedStructure.md %} 47 | 48 | {% api_property cooldown 'number' %} 49 | 50 | The remaining amount of ticks while this terminal cannot be used to make [`StructureTerminal.send`](#StructureTerminal.send) or [`Game.market.deal`](#Game.market.deal) calls. 51 | 52 | 53 | {% api_property store 'Store' %} 54 | 55 | A [`Store`](#Store) object that contains cargo of this structure. 56 | 57 | 58 | {% api_property storeCapacity 'number' '{"deprecated": true}' %} 59 | 60 | An alias for [`.store.getCapacity()`](#Store.getCapacity). 61 | 62 | {% api_method send 'resourceType, amount, destination, [description]' A %} 63 | 64 | ```javascript 65 | Game.rooms['W1N1'].terminal.send(RESOURCE_UTRIUM, 100, 'W2N3', 66 | 'trade contract #1'); 67 | ``` 68 | 69 | Sends resource to a Terminal in another room with the specified name. 70 | 71 | {% api_method_params %} 72 | resourceType : string 73 | One of the RESOURCE_* constants. 74 | === 75 | amount : number 76 | The amount of resources to be sent. 77 | === 78 | destination : string 79 | The name of the target room. You don't have to gain visibility in this room. 80 | === 81 | description (optional) : string 82 | The description of the transaction. It is visible to the recipient. The maximum length is 100 characters. 83 | {% endapi_method_params %} 84 | 85 | 86 | ### Return value 87 | 88 | One of the following codes: 89 | {% api_return_codes %} 90 | OK | The operation has been scheduled successfully. 91 | ERR_NOT_OWNER | You are not the owner of this structure. 92 | ERR_NOT_ENOUGH_RESOURCES | The structure does not have the required amount of resources. 93 | ERR_INVALID_ARGS | The arguments provided are incorrect. 94 | ERR_TIRED | The terminal is still cooling down. 95 | {% endapi_return_codes %} 96 | 97 | -------------------------------------------------------------------------------- /api/source/StructureWall.md: -------------------------------------------------------------------------------- 1 | # StructureWall 2 | 3 | 4 | 5 | Blocks movement of all creeps. 6 | Players can build destructible walls in controlled rooms. 7 | Some rooms also contain indestructible walls separating novice and respawn areas from the rest of the world or dividing novice / respawn areas into smaller sections. Indestructible walls have no `hits` property. 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 |
    Controller level2
    Cost1
    Hits when constructed1
    Max hits300,000,000
    29 | 30 | {% page inherited/Structure.md %} 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /api/source/Tombstone.md: -------------------------------------------------------------------------------- 1 | # Tombstone 2 | 3 | 4 | 5 | A remnant of dead creeps. This is a walkable object. 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
    Decay5 ticks per body part of the deceased creep
    15 | 16 | {% page inherited/RoomObject.md %} 17 | 18 | {% api_property creep 'Creep | PowerCreep' %} 19 | 20 | ```javascript 21 | room.find(FIND_TOMBSTONES).forEach(tombstone => { 22 | if(tombstone.creep.my) { 23 | console.log(`My creep died with ID=${tombstone.creep.id} ` + 24 | `and role=${Memory.creeps[tombstone.creep.name].role}`); 25 | } 26 | }); 27 | ``` 28 | ```javascript 29 | room.find(FIND_TOMBSTONES).forEach(tombstone => { 30 | if(tombstone.creep instanceof PowerCreep) { 31 | console.log(`Power creep died here`); 32 | } 33 | }); 34 | ```` 35 | 36 | An object containing the deceased creep or power creep. 37 | 38 | {% api_property deathTime 'number' %} 39 | 40 | Time of death. 41 | 42 | {% api_property id string %} 43 | 44 | A unique object identificator. You can use Game.getObjectById method to retrieve an object instance by its id. 45 | 46 | 47 | {% api_property store 'Store' %} 48 | 49 | A [`Store`](#Store) object that contains cargo of this structure. 50 | 51 | 52 | {% api_property ticksToDecay 'number' %} 53 | 54 | The amount of game ticks before this tombstone decays. 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /api/source/constants.md: -------------------------------------------------------------------------------- 1 | # Constants 2 | 3 | All the following constant names are available in the global scope: 4 | 5 | {% constants %} -------------------------------------------------------------------------------- /api/source/inherited/OwnedStructure.md: -------------------------------------------------------------------------------- 1 | {% page inherited/Structure.md %} 2 | 3 | {% api_property OwnedStructure:my 'boolean' %} 4 | 5 | Whether this is your own structure. 6 | 7 | {% api_property OwnedStructure:owner 'object' %} 8 | 9 | An object with the structure’s owner info containing the following properties: 10 | 11 | {% api_method_params %} 12 | username : string 13 | The name of the owner user. 14 | {% endapi_method_params %} 15 | 16 | -------------------------------------------------------------------------------- /api/source/inherited/RoomObject.md: -------------------------------------------------------------------------------- 1 | {% api_property RoomObject:effects array %} 2 | Applied effects, an array of objects with the following properties: 3 | 4 | {% api_method_params %} 5 | effect : number 6 | Effect ID of the applied effect. Can be either natural effect ID or Power ID. 7 | === 8 | level (optional) : number 9 | Power level of the applied effect. Absent if the effect is not a Power effect. 10 | === 11 | ticksRemaining : number 12 | How many ticks will the effect last. 13 | {% endapi_method_params %} 14 | 15 | 16 | {% api_property RoomObject:pos 'RoomPosition' %} 17 | 18 | 19 | 20 | An object representing the position of this object in the room. 21 | 22 | 23 | 24 | {% api_property RoomObject:room 'Room' %} 25 | 26 | 27 | 28 | The link to the Room object. May be undefined in case if an object is a flag or a construction site and is placed in a room that is not visible to you. 29 | 30 | -------------------------------------------------------------------------------- /api/source/inherited/Structure.md: -------------------------------------------------------------------------------- 1 | {% page inherited/RoomObject.md %} 2 | 3 | {% api_property Structure:hits 'number' %} 4 | 5 | 6 | 7 | The current amount of hit points of the structure. 8 | 9 | 10 | 11 | {% api_property Structure:hitsMax 'number' %} 12 | 13 | 14 | 15 | The total amount of hit points of the structure. 16 | 17 | 18 | 19 | {% api_property Structure:id 'string' %} 20 | 21 | 22 | 23 | A unique object identificator. You can use Game.getObjectById method to retrieve an object instance by its id. 24 | 25 | 26 | 27 | {% api_property Structure:structureType 'string' %} 28 | 29 | 30 | 31 | One of the STRUCTURE_* constants. 32 | 33 | 34 | 35 | {% api_method Structure:destroy '' A %} 36 | 37 | 38 | 39 | Destroy this structure immediately. 40 | 41 | 42 | 43 | ### Return value 44 | 45 | One of the following codes: 46 | {% api_return_codes %} 47 | OK | The operation has been scheduled successfully. 48 | ERR_NOT_OWNER | You are not the owner of this structure. 49 | ERR_BUSY | Hostile creeps are in the room. 50 | {% endapi_return_codes %} 51 | 52 | 53 | 54 | {% api_method Structure:isActive '' 2 %} 55 | 56 | 57 | 58 | Check whether this structure can be used. If room controller level is insufficient, then this method will return false, and the structure will be highlighted with red in the game. 59 | 60 | 61 | 62 | ### Return value 63 | 64 | A boolean value. 65 | 66 | {% api_method Structure:notifyWhenAttacked 'enabled' A %} 67 | 68 | 69 | 70 | Toggle auto notification when the structure is under attack. The notification will be sent to your account email. Turned on by default. 71 | 72 | {% api_method_params %} 73 | enabled : boolean 74 | Whether to enable notification or disable. 75 | {% endapi_method_params %} 76 | 77 | 78 | ### Return value 79 | 80 | One of the following codes: 81 | {% api_return_codes %} 82 | OK | The operation has been scheduled successfully. 83 | ERR_NOT_OWNER | You are not the owner of this structure. 84 | ERR_INVALID_ARGS | enable argument is not a boolean value. 85 | {% endapi_return_codes %} 86 | 87 | 88 | -------------------------------------------------------------------------------- /api/themes/screeps-api/layout/index.jade: -------------------------------------------------------------------------------- 1 | doctype html 2 | html(lang='en') 3 | head 4 | meta(charset='UTF-8') 5 | meta(http-equiv='X-UA-Compatible', content='IE=edge') 6 | meta(name='viewport', content='width=device-width, initial-scale=1, maximum-scale=1') 7 | title Screeps Documentation 8 | link(rel='stylesheet' href='css/print.css' media="print") 9 | link(rel='stylesheet' href='css/screen.css' media="screen") 10 | link(rel='stylesheet' href='css/prism.css' media="screen") 11 | script(src="js/lib/energize.js") 12 | script(src="js/lib/jquery.js") 13 | script(src="js/lib/jquery_ui.js") 14 | script(src="js/lib/jquery.highlight.js") 15 | script(src="js/lib/jquery.tocify.js") 16 | script(src="js/lib/lunr.js") 17 | script(src="js/lib/prism.js") 18 | script(src="js/app/lang.js") 19 | script(src="js/app/search.js") 20 | script(src="js/app/toc.js") 21 | body(class="index") 22 | a#nav-button(href="#") 23 | span 24 | NAV 25 | img(src="img/navbar.png") 26 | .tocify-wrapper 27 | .logo 28 | a(href="https://screeps.com/a/") 29 | img(src="img/logotype_bw_animation.svg") 30 | a(href="/api/") 31 | | api 32 | if is_ptr() 33 | |  [ptr] 34 | .search 35 | input.search#input-search(type="text" placeholder="Search") 36 | ul.search-results 37 | if !is_ptr() 38 | a.back(href="/index.html") 39 | | Back to docs 40 | img(src="img/link-external.svg") 41 | #toc 42 | ul.tocify-header 43 | li.tocify-item.divider(style='pointer-events: none;') Global Objects 44 | each name in config.GlobalObjects 45 | != tocify(page.pages[name]) 46 | ul.tocify-header 47 | li.tocify-item.divider(style='pointer-events: none;') Prototypes 48 | each name in config.Prototypes 49 | != tocify(page.pages[name]) 50 | 51 | .page-wrapper 52 | .dark-box 53 | .content.api-content 54 | //- h1.divider Global Objects 55 | each name in config.GlobalObjects 56 | != page.pages[name] 57 | //- h1.divider Prototypes 58 | each name in config.Prototypes 59 | != page.pages[name] 60 | 61 | .dark-box 62 | div 63 | -------------------------------------------------------------------------------- /api/themes/screeps-api/layout/page.jade: -------------------------------------------------------------------------------- 1 | != page.content -------------------------------------------------------------------------------- /api/themes/screeps-api/layout/post.jade: -------------------------------------------------------------------------------- 1 | != page.content -------------------------------------------------------------------------------- /api/themes/screeps-api/source/css/_icon-font.scss: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: 'slate'; 3 | src:url('../fonts/slate.eot?-syv14m'); 4 | src:url('../fonts/slate.eot?#iefix-syv14m') format('embedded-opentype'), 5 | url('../fonts/slate.woff2?-syv14m') format('woff2'), 6 | url('../fonts/slate.woff?-syv14m') format('woff'), 7 | url('../fonts/slate.ttf?-syv14m') format('truetype'), 8 | url('../fonts/slate.svg?-syv14m#slate') format('svg'); 9 | font-weight: normal; 10 | font-style: normal; 11 | } 12 | 13 | %icon { 14 | font-family: 'slate'; 15 | speak: none; 16 | font-style: normal; 17 | font-weight: normal; 18 | font-variant: normal; 19 | text-transform: none; 20 | line-height: 1; 21 | } 22 | 23 | %icon-exclamation-sign { 24 | @extend %icon; 25 | content: "\e600"; 26 | } 27 | %icon-info-sign { 28 | @extend %icon; 29 | content: "\e602"; 30 | } 31 | %icon-ok-sign { 32 | @extend %icon; 33 | content: "\e606"; 34 | } 35 | %icon-search { 36 | @extend %icon; 37 | content: "\e607"; 38 | } 39 | -------------------------------------------------------------------------------- /api/themes/screeps-api/source/css/prism.css: -------------------------------------------------------------------------------- 1 | /* http://prismjs.com/download.html?themes=prism-okaidia&languages=markup+css+clike+javascript */ 2 | /** 3 | * okaidia theme for JavaScript, CSS and HTML 4 | * Loosely based on Monokai textmate theme by http://www.monokai.nl/ 5 | * @author ocodia 6 | */ 7 | 8 | code[class*="language-"], 9 | pre[class*="language-"] { 10 | color: #f8f8f2; 11 | /*text-shadow: 0 1px rgba(0, 0, 0, 0.3);*/ 12 | font-family: Consolas, Monaco, 'Andale Mono', monospace; 13 | direction: ltr; 14 | text-align: left; 15 | white-space: pre; 16 | word-spacing: normal; 17 | word-break: normal; 18 | line-height: 1.5; 19 | 20 | -moz-tab-size: 4; 21 | -o-tab-size: 4; 22 | tab-size: 4; 23 | 24 | -webkit-hyphens: none; 25 | -moz-hyphens: none; 26 | -ms-hyphens: none; 27 | hyphens: none; 28 | } 29 | 30 | /* Code blocks */ 31 | pre[class*="language-"] { 32 | padding: 1em; 33 | margin: .5em 0; 34 | overflow: auto; 35 | border-radius: 0.3em; 36 | } 37 | 38 | :not(pre) > code[class*="language-"], 39 | pre[class*="language-"] { 40 | background: #2A3B5F; 41 | } 42 | 43 | /* Inline code */ 44 | :not(pre) > code[class*="language-"] { 45 | padding: .1em; 46 | border-radius: .3em; 47 | } 48 | 49 | .token.comment, 50 | .token.prolog, 51 | .token.doctype, 52 | .token.cdata { 53 | color: slategray; 54 | } 55 | 56 | .token.punctuation { 57 | color: #f8f8f2; 58 | } 59 | 60 | .namespace { 61 | opacity: .7; 62 | } 63 | 64 | .token.property, 65 | .token.tag, 66 | .token.constant, 67 | .token.symbol, 68 | .token.deleted { 69 | color: #f92672; 70 | } 71 | 72 | .token.boolean, 73 | .token.number { 74 | color: #ae81ff; 75 | } 76 | 77 | .token.selector, 78 | .token.attr-name, 79 | .token.string, 80 | .token.char, 81 | .token.builtin, 82 | .token.inserted { 83 | color: #a6e22e; 84 | } 85 | 86 | .token.operator, 87 | .token.entity, 88 | .token.url, 89 | .language-css .token.string, 90 | .style .token.string, 91 | .token.variable { 92 | color: #f8f8f2; 93 | } 94 | 95 | .token.atrule, 96 | .token.attr-value, 97 | .token.function { 98 | color: #e6db74; 99 | } 100 | 101 | .token.keyword { 102 | color: #66d9ef; 103 | } 104 | 105 | .token.regex, 106 | .token.important { 107 | color: #fd971f; 108 | } 109 | 110 | .token.important, 111 | .token.bold { 112 | font-weight: bold; 113 | } 114 | .token.italic { 115 | font-style: italic; 116 | } 117 | 118 | .token.entity { 119 | cursor: help; 120 | } -------------------------------------------------------------------------------- /api/themes/screeps-api/source/fonts/slate.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/api/themes/screeps-api/source/fonts/slate.eot -------------------------------------------------------------------------------- /api/themes/screeps-api/source/fonts/slate.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Generated by IcoMoon 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /api/themes/screeps-api/source/fonts/slate.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/api/themes/screeps-api/source/fonts/slate.ttf -------------------------------------------------------------------------------- /api/themes/screeps-api/source/fonts/slate.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/api/themes/screeps-api/source/fonts/slate.woff -------------------------------------------------------------------------------- /api/themes/screeps-api/source/fonts/slate.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/api/themes/screeps-api/source/fonts/slate.woff2 -------------------------------------------------------------------------------- /api/themes/screeps-api/source/img/bodyparts.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/api/themes/screeps-api/source/img/bodyparts.png -------------------------------------------------------------------------------- /api/themes/screeps-api/source/img/container.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/api/themes/screeps-api/source/img/container.png -------------------------------------------------------------------------------- /api/themes/screeps-api/source/img/controller.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/api/themes/screeps-api/source/img/controller.png -------------------------------------------------------------------------------- /api/themes/screeps-api/source/img/cpu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/api/themes/screeps-api/source/img/cpu.png -------------------------------------------------------------------------------- /api/themes/screeps-api/source/img/deposit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/api/themes/screeps-api/source/img/deposit.png -------------------------------------------------------------------------------- /api/themes/screeps-api/source/img/extractor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/api/themes/screeps-api/source/img/extractor.png -------------------------------------------------------------------------------- /api/themes/screeps-api/source/img/factory.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/api/themes/screeps-api/source/img/factory.png -------------------------------------------------------------------------------- /api/themes/screeps-api/source/img/invaderCore.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/api/themes/screeps-api/source/img/invaderCore.png -------------------------------------------------------------------------------- /api/themes/screeps-api/source/img/keeperLair.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/api/themes/screeps-api/source/img/keeperLair.png -------------------------------------------------------------------------------- /api/themes/screeps-api/source/img/lab.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/api/themes/screeps-api/source/img/lab.png -------------------------------------------------------------------------------- /api/themes/screeps-api/source/img/link-external.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /api/themes/screeps-api/source/img/link.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/api/themes/screeps-api/source/img/link.png -------------------------------------------------------------------------------- /api/themes/screeps-api/source/img/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/api/themes/screeps-api/source/img/logo.png -------------------------------------------------------------------------------- /api/themes/screeps-api/source/img/logotype_bw_animation.svg: -------------------------------------------------------------------------------- 1 | 2 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /api/themes/screeps-api/source/img/navbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/api/themes/screeps-api/source/img/navbar.png -------------------------------------------------------------------------------- /api/themes/screeps-api/source/img/nuke.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/api/themes/screeps-api/source/img/nuke.png -------------------------------------------------------------------------------- /api/themes/screeps-api/source/img/observer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/api/themes/screeps-api/source/img/observer.png -------------------------------------------------------------------------------- /api/themes/screeps-api/source/img/portal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/api/themes/screeps-api/source/img/portal.png -------------------------------------------------------------------------------- /api/themes/screeps-api/source/img/powerBank.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/api/themes/screeps-api/source/img/powerBank.png -------------------------------------------------------------------------------- /api/themes/screeps-api/source/img/powerSpawn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/api/themes/screeps-api/source/img/powerSpawn.png -------------------------------------------------------------------------------- /api/themes/screeps-api/source/img/property_types.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/api/themes/screeps-api/source/img/property_types.png -------------------------------------------------------------------------------- /api/themes/screeps-api/source/img/rampart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/api/themes/screeps-api/source/img/rampart.png -------------------------------------------------------------------------------- /api/themes/screeps-api/source/img/road_plain.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/api/themes/screeps-api/source/img/road_plain.png -------------------------------------------------------------------------------- /api/themes/screeps-api/source/img/ruin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/api/themes/screeps-api/source/img/ruin.png -------------------------------------------------------------------------------- /api/themes/screeps-api/source/img/spawn (1).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/api/themes/screeps-api/source/img/spawn (1).png -------------------------------------------------------------------------------- /api/themes/screeps-api/source/img/spawn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/api/themes/screeps-api/source/img/spawn.png -------------------------------------------------------------------------------- /api/themes/screeps-api/source/img/storage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/api/themes/screeps-api/source/img/storage.png -------------------------------------------------------------------------------- /api/themes/screeps-api/source/img/terminal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/api/themes/screeps-api/source/img/terminal.png -------------------------------------------------------------------------------- /api/themes/screeps-api/source/img/tombstone.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/api/themes/screeps-api/source/img/tombstone.gif -------------------------------------------------------------------------------- /api/themes/screeps-api/source/img/tower.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/api/themes/screeps-api/source/img/tower.png -------------------------------------------------------------------------------- /api/themes/screeps-api/source/img/visual.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/api/themes/screeps-api/source/img/visual.png -------------------------------------------------------------------------------- /api/themes/screeps-api/source/img/wall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/api/themes/screeps-api/source/img/wall.png -------------------------------------------------------------------------------- /api/themes/screeps-api/source/js/all.js: -------------------------------------------------------------------------------- 1 | //= require ./lib/_energize 2 | //= require ./app/_lang 3 | //= require ./app/_search 4 | //= require ./app/_toc 5 | -------------------------------------------------------------------------------- /api/themes/screeps-api/source/js/all_nosearch.js: -------------------------------------------------------------------------------- 1 | //= require ./lib/_energize 2 | //= require ./app/_lang 3 | //= require ./app/_toc 4 | -------------------------------------------------------------------------------- /api/themes/screeps-api/source/js/app/search.js: -------------------------------------------------------------------------------- 1 | //= require ../lib/_lunr 2 | //= require ../lib/_jquery 3 | //= require ../lib/_jquery.highlight 4 | (function () { 5 | 'use strict'; 6 | 7 | var content, searchResults; 8 | var highlightOpts = { element: 'span', className: 'search-highlight' }; 9 | 10 | var index = new lunr.Index(); 11 | 12 | index.ref('id'); 13 | index.field('title', { boost: 10 }); 14 | index.field('body'); 15 | index.pipeline.add(lunr.trimmer, lunr.stopWordFilter); 16 | 17 | $(populate); 18 | $(bind); 19 | 20 | function populate() { 21 | $('h1, h2').each(function() { 22 | var title = $(this); 23 | var body = title.nextUntil('h1, h2'); 24 | index.add({ 25 | id: title.prop('id'), 26 | title: title.text(), 27 | body: body.text() 28 | }); 29 | }); 30 | } 31 | 32 | function bind() { 33 | content = $('.content'); 34 | searchResults = $('.search-results'); 35 | 36 | $('#input-search').on('keyup', search); 37 | } 38 | 39 | function search(event) { 40 | unhighlight(); 41 | searchResults.addClass('visible'); 42 | 43 | // ESC clears the field 44 | if (event.keyCode === 27) this.value = ''; 45 | 46 | if (this.value) { 47 | var results = index.search(this.value).filter(function(r) { 48 | return r.score > 0.0001; 49 | }); 50 | 51 | if (results.length) { 52 | searchResults.empty(); 53 | $.each(results, function (index, result) { 54 | var elem = document.getElementById(result.ref); 55 | searchResults.append("
  • " + $(elem).text() + "
  • "); 56 | }); 57 | highlight.call(this); 58 | } else { 59 | searchResults.html('
  • '); 60 | $('.search-results li').text('No Results Found for "' + this.value + '"'); 61 | } 62 | } else { 63 | unhighlight(); 64 | searchResults.removeClass('visible'); 65 | } 66 | } 67 | 68 | function highlight() { 69 | if (this.value) content.highlight(this.value, highlightOpts); 70 | } 71 | 72 | function unhighlight() { 73 | content.unhighlight(highlightOpts); 74 | } 75 | })(); 76 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "screeps-docs", 3 | "version": "0.0.0", 4 | "private": true, 5 | "hexo": { 6 | "version": "3.2.2" 7 | }, 8 | "dependencies": { 9 | "@screeps/common": "^2.15.2", 10 | "cheerio": "^0.20.0", 11 | "concat-files": "^0.1.1", 12 | "hexo": "^3.2.2", 13 | "hexo-deployer-git": "^0.1.0", 14 | "hexo-generator-archive": "^0.1.4", 15 | "hexo-generator-feed": "^1.1.0", 16 | "hexo-generator-sitemap": "^1.1.2", 17 | "hexo-optimize": "^2.4.6", 18 | "hexo-renderer-jade": "^0.3.0", 19 | "hexo-renderer-marked": "screeps/hexo-renderer-marked", 20 | "hexo-renderer-scss": "^1.2.0", 21 | "hexo-renderer-stylus": "^0.3.1", 22 | "hexo-server": "^0.2.0", 23 | "image-min": "^0.3.2", 24 | "lodash": "^4.5.1", 25 | "lunr": "^0.6.0", 26 | "prismjs": "^1.6.0" 27 | }, 28 | "devDependencies": { 29 | "browser-sync": "^2.18.8", 30 | "cssnano": "^3.5.2", 31 | "gulp": "^3.9.1", 32 | "gulp-if": "^2.0.0", 33 | "gulp-load-plugins": "^1.2.0", 34 | "gulp-postcss": "^6.1.0", 35 | "gulp-responsive": "^3.0.1", 36 | "gulp-rev": "^6.0.1", 37 | "gulp-rev-collector": "^1.0.2", 38 | "gulp-rev-replace": "^0.4.3", 39 | "gulp-uglify": "^1.5.3", 40 | "gulp-unique-files": "^0.1.2", 41 | "gulp-useref": "^2.1.0" 42 | }, 43 | "scripts": { 44 | "clean": "hexo clean", 45 | "server": "browser-sync start --server public --files \"public/**.*\"", 46 | "generate": "hexo clean && hexo generate", 47 | "generate-watch": "hexo generate --watch", 48 | "hexo-server": "hexo server" 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /scripts/tags.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | hexo.extend.tag.register('note', function(args, content){ 4 | var className = args.shift(); 5 | var header = ''; 6 | var result = ''; 7 | 8 | if (args.length){ 9 | header += '' + args.join(' ') + ''; 10 | } 11 | 12 | result += '
    ' + header; 13 | result += hexo.render.renderSync({text: content, engine: 'markdown'}); 14 | result += '
    '; 15 | 16 | return result; 17 | }, true); 18 | 19 | hexo.extend.tag.register('index_block', function(args, content) { 20 | return `${args[0]}${content}`; 21 | }, {ends: true}); 22 | 23 | hexo.extend.tag.register('twitter_feed', function() { 24 | return ``; 27 | }); 28 | 29 | hexo.extend.tag.register('resource', function(args) { 30 | return `${args[0]}`; 31 | }); -------------------------------------------------------------------------------- /source/_data/languages.yml: -------------------------------------------------------------------------------- 1 | en: English 2 | zh-tw: 3 | name: 正體中文 4 | disqus_lang: zh_TW 5 | zh-cn: 6 | name: 简体中文 7 | disqus_lang: zh 8 | ru: 9 | name: Русский 10 | disqus_lang: ru 11 | ko: 12 | name: 한국어 13 | disqus_lang: ko -------------------------------------------------------------------------------- /source/_data/sidebar.yml: -------------------------------------------------------------------------------- 1 | _: 2 | Overview: /index.html 3 | Gameplay: 4 | Introduction: /introduction.html 5 | Creeps: /creeps.html 6 | Control: /control.html 7 | Defense: /defense.html 8 | Respawning: /respawn.html 9 | Start Areas: /start-areas.html 10 | Resources: /resources.html 11 | Market: /market.html 12 | NPC Invaders: /invaders.html 13 | Power: /power.html 14 | Scripting: 15 | Scripting Basics: /scripting-basics.html 16 | Global Objects: /global-objects.html 17 | Modules: /modules.html 18 | Debugging: /debugging.html 19 | Game Loop: /game-loop.html 20 | External Commit: /commit.html 21 | Simultaneous Actions: /simultaneous-actions.html 22 | CPU Limit: /cpu-limit.html 23 | 24 | Other: 25 | Server-Side Architecture: /architecture.html 26 | Public Test Realm (PTR): /ptr.html 27 | Third Party Tools: /third-party.html 28 | Auth Tokens: /auth-tokens.html 29 | Community Servers: /community-servers.html 30 | Terms of Service: /tos.html 31 | Privacy Policy: /privacy-policy.html 32 | 33 | Resources: 34 | Blog: http://blog.screeps.com 35 | Changelogs: http://blog.screeps.com/categories/Changelogs/ 36 | Chat: http://chat.screeps.com 37 | Forum: https://screeps.com/forum/ 38 | 39 | Contributed Articles: 40 | Contribution Rules: /contributed/rules.html 41 | Advanced Grunt Usage: /contributed/advanced_grunt.html 42 | Modifying Prototypes: /contributed/modifying-prototypes.html 43 | Caching Overview: /contributed/caching-overview.html 44 | Private Server MongoDB: /contributed/ps_ubuntu.html -------------------------------------------------------------------------------- /source/_posts/test.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/source/_posts/test.md -------------------------------------------------------------------------------- /source/changelog.md: -------------------------------------------------------------------------------- 1 | title: Changelog 2 | --- 3 | 4 | This page is still empty. -------------------------------------------------------------------------------- /source/commit.md: -------------------------------------------------------------------------------- 1 | title: Committing scripts using external tools 2 | --- 3 | 4 | Screeps has a handy embedded code editor for writing game scripts. However, in some cases (for example, you want to use a language other than JavaScript or integrate with your IDE) you will have to commit game scripts to your Screeps account from outside. 5 | 6 | {% note info %} 7 | You have to create an auth token in the [account settings](https://screeps.com/a/#!/account/auth-tokens) in order to use external synchronization. 8 | {% endnote %} 9 | 10 | ## Using Grunt task 11 | 12 | If you haven't used [Grunt](http://gruntjs.com) before, be sure to check out the [Getting Started](http://gruntjs.com/getting-started) guide, as it explains how to create a [Gruntfile](http://gruntjs.com/sample-gruntfile) as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command: 13 | 14 | npm install grunt-screeps 15 | 16 | Configure your Gruntfile.js: 17 | 18 | module.exports = function(grunt) { 19 | 20 | grunt.loadNpmTasks('grunt-screeps'); 21 | 22 | grunt.initConfig({ 23 | screeps: { 24 | options: { 25 | email: '', 26 | token: '', 27 | branch: 'default', 28 | //server: 'season' 29 | }, 30 | dist: { 31 | src: ['dist/*.js'] 32 | } 33 | } 34 | }); 35 | } 36 | 37 | Now you can run this command to commit your code from `dist` folder to your Screeps account: 38 | 39 | grunt screeps 40 | 41 | ## Using direct API access 42 | 43 | Screeps Web API has an endpoint `https://screeps.com/api/user/code` for working with scripts. The two supported methods are `POST` and `GET` for writing and retrieving respectively. Both methods accept [Basic access authentication](http://en.wikipedia.org/wiki/Basic_access_authentication). Endpoints get and return a JSON structure containing modules object with module names as keys and their content as values. 44 | 45 | An example of committing code using Node.js: 46 | 47 | var https = require('https'); 48 | 49 | var email = '', 50 | password = '', 51 | data = { 52 | branch: 'default', 53 | modules: { 54 | main: 'require("hello");', 55 | hello: 'console.log("Hello World!");' 56 | } 57 | }; 58 | 59 | var req = https.request({ 60 | hostname: 'screeps.com', 61 | port: 443, 62 | path: '/api/user/code', 63 | method: 'POST', 64 | auth: email + ':' + password, 65 | headers: { 66 | 'Content-Type': 'application/json; charset=utf-8' 67 | } 68 | }); 69 | 70 | req.write(JSON.stringify(data)); 71 | req.end(); 72 | 73 | Request: 74 | 75 | POST /api/user/code HTTP/1.1 76 | Content-Type: application/json; charset=utf-8 77 | Host: screeps.com:443 78 | Authorization: Basic PHlvdXIgZS1tYWlsPjo8eW91ciBwYXNzd29yZD4= 79 | Connection: close 80 | Transfer-Encoding: chunked 81 | 82 | {"branch":"default","modules":{"main":"require(\"hello\");","hello":"console.log(\"Hello World!\");"}} 83 | 84 | Response: 85 | 86 | X-Powered-By: Express 87 | Content-Type: application/json; charset=utf-8 88 | Content-Length: 8 89 | Date: Mon, 02 Feb 2015 18:46:11 GMT 90 | Connection: close 91 | 92 | {"ok":1} 93 | -------------------------------------------------------------------------------- /source/community-servers.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Community Servers 3 | --- 4 | 5 | Screeps is not only a MMO game with the officially maintained open world, but also an open source project. We released [game server software](https://github.com/screeps/screeps) under open license so that everybody can create their own Screeps world and modify it via flexible mod system down to its core, including unique game mechanics and rules, game objects with custom graphics and behavior. 6 | 7 | We like such community activity, this is why we display public quality servers on the game login screen in the Community Servers list. 8 | 9 | ![](img/community-servers.png) 10 | 11 | If you want your server to be included to this list, send an email to [contact@screeps.com](mailto:contact@screeps.com). Your server has to comply with the following rules: 12 | 13 | * Server version 4.0.0 or higher. 14 | 15 | * Server must have stable online during last 7 days. If it becomes inaccessible for a long time, we'll remove it from the list. 16 | 17 | * Use [`config.backend.welcomeText`](https://github.com/screeps/launcher/blob/master/init_dist/example-mods/welcome-text.js) to inform players about any specific features of your server: customizations you have made, installed mods, etc. 18 | -------------------------------------------------------------------------------- /source/cpu-limit.md: -------------------------------------------------------------------------------- 1 | title: How does CPU limit work 2 | --- 3 | 4 | The Screeps game engine exists in two variants: browser-based (**Simulation** **mode**) and server-based (**online mode**). When you play in the Simulation mode, your scripts are executed by means of your browser only. The game API in the Simulation is the same as that on the server, but the server does not take part in game calculations. 5 | 6 | On the other hand, in the online mode calculations of your scripts do not affect your browser in any way and done on the servers only. In order to maintain them, we offer CPU time that allows you to use CPU resources of the game servers. 7 | 8 | As described in the article [Understanding game loop, time and ticks](/game-loop.html), the game process is divided into game iterations, or **ticks**. During each tick, the game engine calculates each player's scripts concurrently. Then all the planned activities are executed. The duration of one game tick is not fixed - a tick ends when all scripts of all players have been executed to the end. 9 | 10 | ## CPU Limit 11 | 12 | In order to avoid abuse of execution time (which would affect the duration of the game tick for all players), we have introduced a concept of **CPU time limit**. This is a duration of time in milliseconds during which your game script is allowed to run within one tick. The CPU limit 100 means that after 100 ms execution of your script will be terminated even if it has not accomplished some work yet. Your CPU time limit depends on your [Global Control Level](/control.html) if you have active [subscription](/subscription.html), or fixed at 20 otherwise. 13 | 14 | ## Bucket 15 | 16 | However, for your convenience, there may be a rollover of unused time limit for using in future ticks. This allows to carry out resource-hungry operations in bursts once per several ticks, thus exceeding the CPU limit set in your account provided your scripts have saved resources in the preceding ticks. 17 | 18 | ![](img/cpu-bucket.png) 19 | 20 | If a script during a tick worked less time than the account CPU baseline limit set, the resulting difference is added to a cumulative bucket. You may accumulate up to 10,000 CPU. If the bucket contains any accumulation, your script can overrun your CPU limit using up to 500 CPU per tick from the amount accumulated in the bucket. 21 | 22 | For example, if your account limit is set to 150 and you consume only 100 CPU per tick, then 50 CPU per tick will go to the bucket. You will be able to execute either a one-time burst exceeding the limit by 250 CPU every 5 ticks, or a series of 20 bursts for 500 CPU each once per 200 ticks. 23 | 24 | The property [`Game.cpu.tickLimit`](/api/#Game.cpu) reflects the amount of CPU that you can spend on a current tick given the accumulation. As soon as the [`Game.cpu.bucket`](/api/#Game.cpu) is full, [`Game.cpu.tickLimit`](/api/#Game.cpu) equals 500. It will start decreasing only after the accumulation is depleted. [`Game.cpu.tickLimit`](/api/#Game.cpu) can never be less than your account limit, i.e the [`Game.cpu.limit`](/api/#Game.cpu) property. 25 | 26 | Therefore, you can plan your limit usage by postponing some calculations (for example pathfinding operations) to the moment when you are able to do them in bursts by exceeding the limit. 27 | -------------------------------------------------------------------------------- /source/debugging.md: -------------------------------------------------------------------------------- 1 | title: Debugging 2 | --- 3 | 4 | There is a standard `console.log()` method as everywhere in Javascript world. 5 | 6 | for(var i in Game.creeps) { 7 | console.log(Game.creeps[i]); 8 | } 9 | 10 | Each action command returns code `OK` if the execution was successful and one of the `ERR_*` codes in case of error. 11 | 12 | var result = creep.attack(target); 13 | if(result != OK) { 14 | console.log(creep + ' failed to attack the target ' + target + 15 | ' with the code: ' + result); 16 | } 17 | 18 | 19 | Note that a seemingly successful command may not always be executed (for example, your creep faces an obstacle it did not know about when the script started). 20 | 21 | In order to safely test your scripts in a parallel copy of the world, you can use our [Public Test Realm](/ptr.html) server. 22 | 23 | ## Debugging in the web version 24 | 25 | When playing using the web version of the game, all the console output is being forwarded to the browser console. When you are in the Simulation mode and your script is executed in your browser, that allows you to expand the objects, see and traverse their properties, etc. 26 | 27 | Also, in Chrome browser you can use `debugger` JavaScript keyword to put a breakpoint in the Simulation mode which allows you to pause your script execution for debugging: 28 | 29 | var result = creep.attack(target); 30 | if(result != OK) { 31 | debugger; 32 | } 33 | 34 | ## Memory inspector 35 | 36 | If you want to track some values in real-time, write them into Memory and add the corresponding watches in the Memory inspector panel. They will be updated automatically each tick. 37 | 38 | ![](img/chrome_2016-06-21_22-21-36.png) 39 | -------------------------------------------------------------------------------- /source/game-loop.md: -------------------------------------------------------------------------------- 1 | title: Understanding game loop, time and ticks 2 | --- 3 | 4 | Screeps is a real-time game. The game time is essentially a number of game "ticks" (or turns, cycles) that have passed since the start of the game servers. The number of the current tick is stored in the `Game.time` property. It is a global counter that increases during the entire game lifespan. 5 | 6 | Generally, ticks run in an infinite loop of your `main` module. It is important to understand that this loop is turn- and multiplayer-based: the next tick (next `Game.time` value) begins only after the full execution of all `main` modules of all players. 7 | 8 | We will now analyze the tick execution mechanism with conditional dividing it into beginning, middle, and end stages. 9 | 10 | ![](img/game-loop.png) 11 | 12 | In the **beginning of the tick, **there is a certain game situation: different game objects with some property values. Take note that any changes in these properties, appearing of new objects, and dismantling of old ones will happen only at the start of the next tick. 13 | 14 | In the **middle part of the tick,** the `main` module is executed (along with the modules required from it). The `main` operates the unchangeable game condition in the beginning of the tick. For example, by executing `creep.move()` and then (in the same tick) `creep.attack()` the attack still runs from the old coordinates, since properties `creep.pos.x` / `creep.pos.y` will change only in the next tick. 15 | 16 | In the **end of the tick, **the commands specified in the `main` accumulate in order to change the game situation by the beginning of the next tick instantaneously and independently from each other. If any conflicts arise – for example, multiple creeps want to move to the same coordinates, or you have scheduled contradictory orders – these conflicts are solved according to [predefined priorities](/simultaneous-actions.html). Another example: a mutual attack does not result in a conflict, and creeps can die at the same time. 17 | 18 | ## Additional information 19 | 20 | * Physically, resource intensity of the `main` execution is limited by the available CPU (see [`Game.cpuLimit`](/api/#Game.cpuLimit)) . 21 | * The amount of CPU actually used in the current tick is shown by [`Game.getUsedCpu`](/api/#Game.getUsedCpu). 22 | * The correlation between the game tick counter ([`Game.time`](/api/#Game.time)) and real time depends on overall capacity of servers affected. 23 | * All runtime global scope with all the variables between ticks is erased. See more in [this article](/global-objects.html). 24 | * A console command is governed by the same rules: execution is made within one tick as though it is added to the end of `main`. 25 | 26 | 27 | ## See also 28 | 29 | * [How does CPU limit work](/cpu-limit.html) 30 | * [Server-side architecture overview](/architecture.html) -------------------------------------------------------------------------------- /source/index.md: -------------------------------------------------------------------------------- 1 | title: Overview 2 | --- 3 | Welcome to the Screeps documentation. Get familiar with the game and explore our API: 4 | 5 | {% index_block "Tutorial" "https://screeps.com/a/#!/sim/tutorial" %} 6 | Learn game basics step by step in our interactive tutorial 7 | {% endindex_block %} 8 | 9 | {% index_block "API Reference" "/api" %} 10 | Reference of all game objects, methods and prototypes 11 | {% endindex_block %} 12 | 13 | {% index_block "Contributed articles" "/contributed/rules.html" %} 14 | Read articles written by other players, or contribute your own 15 | {% endindex_block %} 16 | 17 | {% index_block "Chat" "http://chat.screeps.com" %} 18 | Join the game community on our Discord server 19 | {% endindex_block %} 20 | 21 | {% index_block "Chinese version(中文)" "https://screeps-cn.github.io/" %} 22 | The unofficial Chinese version of this documentation translated and maintained by the community 23 | {% endindex_block %} 24 | 25 | ## Other resources 26 | 27 | * The quickest way to get an answer is asking a question on our [Discord server](http://chat.screeps.com). 28 | * You can find real working samples for various scenarios from other players at [GitHub](https://github.com/search?o=desc&p=1&q=screeps&s=updated&type=Repositories). 29 | * If you still have any questions or concerns, please feel free to [submit a request](http://support.screeps.com/hc/en-us/requests/new) or reach out to us by email at [contact@screeps.com](mailto:contact.screeps.com). 30 | * We also have [forum](http://support.screeps.com/hc/communities/public/topics), [Twitter](https://twitter.com/ScreepsGame), and [Facebook](https://facebook.com/ScreepsGame). 31 | -------------------------------------------------------------------------------- /source/introduction.md: -------------------------------------------------------------------------------- 1 | title: Introduction 2 | --- 3 | 4 | ## What kind of game is Screeps 5 | 6 | Screeps is a massive multiplayer online real-time strategy game. Each player can create their own colony in a **single persistent world** shared by all the players. Such a colony can mine **resources**, build **units**, conquer **territory**. As you conquer more territory, your influence in the game world grows, as well as your abilities to expand your footprint. However, it requires a lot of effort on your part, since multiple players may aim at the same territory. 7 | 8 | Screeps is developed for people with **programming skills**. Unlike some other RTS games, your units in Screeps can react to events without your participation – provided that you have programmed them properly. And, unlike other MMO, you do not have to play Screeps constantly to play well. It is quite enough just to check once in a while to see if everything goes well. 9 | 10 | ## Game world 11 | 12 | The game world consists of interconnected **rooms**. A room is a closed space 50x50 cells in size. It may have from 1 to 4 exits to other rooms. The world is separated into **shards** which are connected by intershard portals. You can consider shards a Z-axis of the world. 13 | 14 | ![](img/shards.png) 15 | 16 | Each room landscape is unique. The view of each room is generated procedurally and consists of three types of surface: 17 | 18 | * **Plain land** – simple ground with a movement cost of 2. 19 | * **Swamps** increase a movement cost to 10. 20 | * **Walls** block movement of all creeps. 21 | 22 | You can customize the room landscape with the help of the following facilities: 23 | 24 | * **Roads** decrease a movement cost to 1. Roads deteriorate due to movement and require repair. 25 | * **Constructed walls** can be created by players. Unlike natural walls, they may be attacked and destroyed by creeps. 26 | * **Ramparts** are your defenses. Only your creeps may move inside your ramparts. Besides, a creep inside a rampart cell cannot be attacked until the rampart is destroyed (though it can attack others). Ramparts deteriorate with each game cycle and require repair. 27 | 28 | In the beginning of the game, you are free to choose the place for your new colony in one of the free rooms inside the zone of the game world available for settlement. After your first spawn is set up, your room will be in **safe mode**. Use this time to create good defenses, or any player will be able to destroy your colony! 29 | 30 | ## Your colony 31 | 32 | **![](img/colony-center.png)** 33 | 34 | **Energy sources** are the main game resource. They can be harvested by worker creeps. The amount of energy in a source is limited, but resumes once in 300 game ticks. 35 | 36 | **Spawns** are your colony centers. They can accumulate mined energy and use it to create your units. There may be no more than 3 spawns in a room. Hence, by building 3 spawns in a room you actually conquer it. You can have multiple spawns totally in all your rooms though. 37 | 38 | A spawn itself can build only basic units. In order to build more complex ones, you have to construct one or more spawn **extensions**. Read more about that in the next article. 39 | -------------------------------------------------------------------------------- /source/privacy-policy.md: -------------------------------------------------------------------------------- 1 | title: Privacy Policy 2 | --- 3 | 4 | Screeps, LLC (hereinafter referred to as "We") through its online game Screeps collects personal and non-personal information about you that you provide in your account in order to provide and improve its services, but never hands this information to any third parties. We maintain all reasonable safeguards to protect the security, integrity and privacy of the personal information we collect. 5 | 6 | While the security of your information is very important to us, and we take all reasonable precautions against possible breaches of our websites, no website or Internet transmission is completely secure. So, we cannot guarantee that unauthorized access, hacking, data loss, or other breaches will never occur. We urge you to take steps to keep your personal information safe by memorizing your password or keeping it in a safe place. 7 | 8 | We do not store our users' passwords in any way. We store only their hashes. 9 | 10 | We do not collect any personal information from the payments you make on our websites. This is done solely by the third-party service provider Xsolla. You may read its Privacy Policy here: [http://xsolla.com/privacypolicy/](http://xsolla.com/privacypolicy/). 11 | 12 | As most websites, we collect information automatically, and it is stored in the form of log files. This information includes such data as Internet Protocol (IP) addresses, browser type and language, operating system, website activity, the number of "hits" a webpage is getting, and other relevant information which may be later combined with your personal and non-personal information. 13 | 14 | We may use cookies, scripts, and other technologies to improve the use of our websites, products and services. You can disable or delete cookies or set your browser to alert you when cookies are being sent to your computer. We may use local storage to store content information and preferences of our users. We may collect certain "device-identifying data" about your personal computer or mobile device to create a digital identifier of your device in order to optimize our services for it. 15 | -------------------------------------------------------------------------------- /source/ptr.md: -------------------------------------------------------------------------------- 1 | title: Public Test Realm (PTR) 2 | --- 3 | 4 | The Public Test Realm is a stand-alone game server with its own world data, players' scripts, memory, and settings. It has been created for two purposes: 5 | 6 | 1) testing changes and new features upcoming to the main server, 7 | 2) providing players with a platform to safely test their scripts in a multi-room environment. 8 | 9 | --- 10 | 11 |
    12 | 13 |

    [ENTER](https://screeps.com/ptr/)

    14 | 15 |

    [API Reference](http://docs-ptr.screeps.com/api/)

    16 |
    17 | 18 | --- 19 | 20 | Both World Mode and Simulation Mode are available on PTR. All the game world data is copied from the main server to PTR every Monday at 0:00 UTC, and old PTR data is then wiped (including players’ scripts). **Don’t use PTR for prolonged storage of your code!** 21 | 22 | Registering new accounts on PTR is blocked. Each time after data is copied from the main server into PTR, existing players accounts are copied as well. Your account CPU subscription is deactivated by default. Click the Activate button on the [order page](https://screeps.com/ptr/#!/order) to enable your free PTR subscription until the next PTR reset. 23 | 24 | Please take note that construction of any structures on the PTR costs only 1 energy unit and the controller upgrade requires 1000 energy units. It allows quick creation of infrastructure you need for testing purposes. 25 | 26 | If you use [grunt-screeps](/commit.html) for committing your scripts from a local machine, you can provide ptr: true option in order to commit your code to the PTR. 27 | 28 | Engine code changes from the PTR are periodically deployed to the `ptr` branch of the private server package on npm, so you can use this command to run it locally: 29 | 30 | ``` 31 | npm install screeps@ptr 32 | ``` 33 | -------------------------------------------------------------------------------- /source/respawn.md: -------------------------------------------------------------------------------- 1 | title: Respawning 2 | --- 3 | 4 | In Screeps, the game is never over, and a global win of any player is hardly ever possible. The game is devised in such a way that you can always continue playing, gain revenge, change landscape, save your achievements, etc. 5 | 6 | ## Initial spawn 7 | 8 | The game begins from your appearance on the map. You can choose any room with a neutral Controller and at least one energy source, although we recommend to choose a room with two sources and inside one of the [Start Areas](/start-areas.html). So, after analyzing the landscape, place your spawn on the map: 9 | 10 | ![](img/CreateSpawn.png) 11 | 12 | Now the room is in [Safe mode](/defense.html) during **20,000 game ticks** (approx. 15** **hours depending on the tick duration). Use this period to explore the room, develop, plan defenses, and prepare for capturing territory and resources. 13 | 14 | When the spawn is placed, it has 300 energy units first. For your safety, the spawn is constantly refilled with a small amount of 1 energy unit per tick, so that you won't stuck without energy. 15 | 16 | {% note info %} 17 | A spawn stops generating energy when there are 300 energy units in the spawn itself or any other spawns and extensions in the room. 18 | {% endnote %} 19 | 20 | ## Respawn 21 | 22 | If you have chosen hastily and now want to move to a more interesting room, or if another player forced you to do so, you can restart the game with the help of the **Respawn** feature. It has a 180 seconds timeout. You will also need to respawn if your rooms are captured by an enemy and you don't have an extra foothold with creeps to build a spawn. 23 | 24 | ![](img/Respawn.png) 25 | 26 | ![](img/RespawnConfirm.png) 27 | 28 | As you have already known from the article [Control](/control.html), a player's **Global Control Level** (GCL) remains the same after the Respawn. So, if you have a right to claim 3 rooms, you will never lose it. 29 | 30 | Always try to control as many rooms as your GCL allows. It will allow your colony develop at the maximum speed. Even after a respawn from scratch, a high GCL will let you find a place with many free rooms and instantly claim some into your domain for parallel development. 31 | -------------------------------------------------------------------------------- /source/scripting-basics.md: -------------------------------------------------------------------------------- 1 | title: Scripting Basics 2 | --- 3 | 4 | Writing scripts for Screeps is similar to writing any other JavaScript application. You write your scripts in a special in-game editor, and they are executed continuously even while you are offline (with the exception of the Simulation Room). 5 | 6 | Your game script is executed each game tick in a loop. The game tick duration depends on the current load of servers. The goal of a script is to process the current situation within the game and pass orders to your creeps and spawns. Commands are not executed instantly. Rather, the game remembers your commands and executes them later, after all players' scripts have been executed. For more details on this topic, see the article [Understanding game loop, time and ticks](/game-loop.html). 7 | 8 | Please remember that the exact duration of the execution of your script is limited by the CPU time available in your account. In case of exceeding the limit, the script execution will be stopped. The exception is the Simulation Room where the script execution time is unlimited. 9 | -------------------------------------------------------------------------------- /source/simultaneous-actions.md: -------------------------------------------------------------------------------- 1 | title: Simultaneous execution of creep actions 2 | --- 3 | 4 | The exact methods available to a creep are determined by its parts. You may opt to create an all-in-one creep out of all existing parts, but you won't be able to execute all methods simultaneously. Here are the dependencies: 5 | 6 | ![](img/action-priorities.png) 7 | 8 | If you try to execute all the dependent methods within one tick, **only the most right one will be executed**. Each attempt means a correct execution returning the `OK` result. For example: 9 | 10 | // tick 1 11 | creep.build(constructionSite); // ERR_NOT_ENOUGH_ENERGY 12 | creep.harvest(source); // OK – executed, creep gained energy 13 | // tick 2 14 | creep.build(constructionSite); // OK – executed 15 | creep.harvest(source); // OK, but execution failed since it was blocked by build 16 | 17 | However, you may execute multiple methods by combining methods from different pipelines (including those which are not involved in any dependency above). For example: 18 | 19 | creep.moveTo(target); 20 | creep.rangedMassAttack(); 21 | creep.heal(target); 22 | creep.transfer(target, RESOURCE_ENERGY, amountTransfer); 23 | creep.drop(amountDrop, RESOURCE_ENERGY); 24 | creep.pickup(energy); 25 | creep.claimController(controller); 26 | 27 | All these methods may be successfully executed within one tick. 28 | 29 | Combining methods with energy usage may have two possible results: 30 | 31 | * with enough energy for executing all scheduled operations, all of them will be executed, 32 | * othwerwise, the conflict will arise and only the most right one will be executed. 33 | 34 | ## Methods call priority 35 | 36 | The sequence of calling commands for different methods in the code is irrelevant, only the aforementioned priorities matter. But if the same method is specified, the last call has the priority. For example: 37 | 38 | creep.moveTo(target); // will be ignored 39 | creep.move(RIGHT); // will be ignored 40 | creep.move(LEFT); // will be executed 41 | 42 | The creep will move to the left in this tick. 43 | 44 | ## Additionally 45 | 46 | 1. Though healing healthy creeps and repairing undamaged building may be senseless, it returns `OK` and blocks more left methods in its pipeline. 47 | 2. While `transfer` may work along with `drop`, you cannot execute `transfer` two and more times per tick (to transfer energy to multiple objects). The same is true for all similar methods. 48 | 3. Simultaneously executed methods using `CARRY` body part don't affect each other. Each of them has the amount of energy available in the beginning of the tick. See more about this in [Understanding game loop, time and ticks](/game-loop.html). 49 | -------------------------------------------------------------------------------- /source/start-areas.md: -------------------------------------------------------------------------------- 1 | title: Start Areas 2 | --- 3 | 4 | ## Novice Areas 5 | 6 | To allow each player start out in the game and develop a colony without facing veterans of the Screeps world, we’ve devised a system of special temporary sectors for novice players. They are marked in green, and the “**Novice Area**” label pops up as you hover the mouse pointer over them. 7 | 8 | ![](img/novice.png) 9 | 10 | The following rules are in force in these rooms: 11 | 12 | * The sector is completely separated from the outer world with a blind, indestructible wall preventing outside players from entering it. Getting inside a Novice Area is possible only by placing there your initial spawn directly. 13 | * Only players with GCL 3 or lower is allowed to start playing in these rooms. 14 | * Each player is allowed to [claim](/api/#Creep.claimController) not more than 3 rooms. But the room [reservation](/api/#Creep.reserveController) is unlimited. 15 | * No cooldown between [safe mode](/defense.html) activations. 16 | * It’s prohibited to use [Nukers](/api/#StructureNuker). 17 | 18 | Novice Areas have the day counter. After it runs out, the walls disappear, rooms lose the green mark, all the limitations are cancelled, and the sector becomes a regular part of the world. After zones are opened, residents can start outward expansion, but can also face invasion into their sectors. 19 | 20 | The majority of novice sectors are divided into 4x4 room size quarters. Apart from the common outer wall that encircles the entire 10x10 sector, there are also inside walls that intersect these “quarters.” The counters of those walls are lower than the total Novice Area counter. It means that each resident starts out in the game by facing other players only in their own “quarter” first, but after a few days they can meet all the residents of the sector. 21 | 22 | ## Respawn Areas 23 | 24 | Another similar kind of isolated world map zones is **Respawn Areas**. They are highlighted with blue color and have only the Nukers usage restriction. All players with any GCL can place their first spawn in this area and claim as many rooms as their GCL allows. 25 | 26 | ![chrome_2017-03-06_14-40-11.png](img/chrome_2017-03-06_14-40-11.png) 27 | 28 | ## Areas generation in inner sectors 29 | 30 | We keep monitoring the Novice and Respawn Areas population progress and open new areas as it becomes necessary. Please mind that such areas can be allocated in previously opened sectors of the common world provided they are sufficiently big, not populated, and not in use by anyone. 31 | 32 | {% note info %} 33 | If you don’t want some rooms to get transformed into Novice or Respawn Areas, you should take care to [reserve](/api/#Creep.reserveController) them. 34 | {% endnote %} 35 | 36 | When a Novice or Respawn Area is being planned in an inner sector, all free rooms in this sector will be signed by the game with the following message: 37 | 38 | ![chrome_2017-03-08_13-01-20.png](img/chrome_2017-03-08_13-01-20.png) 39 | 40 | You can use game constants `SYSTEM_USERNAME`, `SIGN_NOVICE_AREA`, and `SIGN_RESPAWN_AREA` to programmatically check the signs in the rooms that are important to you and reserve them if such a message detected. 41 | -------------------------------------------------------------------------------- /themes/screeps-docs/languages/en.yml: -------------------------------------------------------------------------------- 1 | menu: 2 | docs: Docs 3 | api: API 4 | news: News 5 | plugins: Plugins 6 | themes: Themes 7 | search: Search 8 | 9 | index: 10 | get_started: Get started 11 | 12 | page: 13 | contents: Contents 14 | back_to_top: Back to Top 15 | improve: Improve this doc 16 | prev: Prev 17 | next: Next 18 | last_updated: "Last updated: %s" 19 | 20 | sidebar: 21 | docs: 22 | getting_started: Getting Started 23 | overview: Overview 24 | setup: Setup 25 | configuration: Configuration 26 | commands: Commands 27 | migration: Migration 28 | basic_usage: Basic Usage 29 | writing: Writing 30 | front_matter: Front-matter 31 | tag_plugins: Tag Plugins 32 | asset_folders: Asset Folders 33 | data_files: Data Files 34 | server: Server 35 | generating: Generating 36 | deployment: Deployment 37 | customization: Customization 38 | permalinks: Permalinks 39 | themes: Themes 40 | structure: Structure 41 | templates: Templates 42 | variables: Variables 43 | helpers: Helpers 44 | internationalization: Internationalization (i18n) 45 | plugins: Plugins 46 | miscellaneous: Miscellaneous 47 | troubleshooting: Troubleshooting 48 | contributing: Contributing 49 | api: 50 | core: Core 51 | overview: Overview 52 | events: Events 53 | locals: Locals 54 | router: Router 55 | box: Box 56 | rendering: Rendering 57 | posts: Posts 58 | scaffolds: Scaffolds 59 | themes: Themes 60 | extensions: Extensions 61 | console: Console 62 | deployer: Deployer 63 | filter: Filter 64 | generator: Generator 65 | helper: Helper 66 | migrator: Migrator 67 | processor: Processor 68 | renderer: Renderer 69 | tag: Tag -------------------------------------------------------------------------------- /themes/screeps-docs/languages/ko.yml: -------------------------------------------------------------------------------- 1 | menu: 2 | docs: Docs 3 | api: API 4 | news: News 5 | plugins: Plugins 6 | themes: Themes 7 | search: Search 8 | 9 | index: 10 | get_started: Get started 11 | 12 | page: 13 | contents: Contents 14 | back_to_top: Back to Top 15 | improve: Improve this doc 16 | prev: Prev 17 | next: Next 18 | last_updated: "Last updated: %s" 19 | 20 | sidebar: 21 | docs: 22 | getting_started: Getting Started 23 | overview: Overview 24 | setup: Setup 25 | configuration: Configuration 26 | commands: Commands 27 | migration: Migration 28 | basic_usage: Basic Usage 29 | writing: Writing 30 | front_matter: Front-matter 31 | tag_plugins: Tag Plugins 32 | asset_folders: Asset Folders 33 | data_files: Data Files 34 | server: Server 35 | generating: Generating 36 | deployment: Deployment 37 | customization: Customization 38 | permalinks: Permalinks 39 | themes: Themes 40 | structure: Structure 41 | templates: Templates 42 | variables: Variables 43 | helpers: Helpers 44 | internationalization: Internationalization (i18n) 45 | plugins: Plugins 46 | miscellaneous: Miscellaneous 47 | troubleshooting: Troubleshooting 48 | contributing: Contributing 49 | api: 50 | core: Core 51 | overview: Overview 52 | events: Events 53 | locals: Locals 54 | router: Router 55 | box: Box 56 | rendering: Rendering 57 | posts: Posts 58 | scaffolds: Scaffolds 59 | themes: Themes 60 | extensions: Extensions 61 | console: Console 62 | deployer: Deployer 63 | filter: Filter 64 | generator: Generator 65 | helper: Helper 66 | migrator: Migrator 67 | processor: Processor 68 | renderer: Renderer 69 | tag: Tag -------------------------------------------------------------------------------- /themes/screeps-docs/languages/ru.yml: -------------------------------------------------------------------------------- 1 | menu: 2 | docs: Docs 3 | api: API 4 | news: Новости 5 | plugins: Плагины 6 | themes: Темы 7 | search: Поиск 8 | 9 | index: 10 | get_started: Начнём 11 | 12 | page: 13 | contents: Содержание 14 | back_to_top: Наверх 15 | improve: Предложить улучшение 16 | prev: Пред 17 | next: След 18 | last_updated: "Последнее обновление: %s" 19 | 20 | sidebar: 21 | docs: 22 | getting_started: Начало работы 23 | overview: Обзор 24 | setup: Установка 25 | configuration: Конфигурация 26 | commands: Команды 27 | migration: Миграция 28 | basic_usage: Основы 29 | writing: Написание 30 | front_matter: Шапка файла 31 | tag_plugins: Плагины тэгов 32 | asset_folders: Папки с материалами 33 | data_files: Файлы с данными 34 | server: Сервер 35 | generating: Генерация 36 | deployment: Публикация 37 | customization: Кастомизация 38 | permalinks: Постоянные ссылки 39 | themes: Темы 40 | structure: Структура 41 | templates: Шаблоны 42 | variables: Переменные 43 | helpers: Помощники 44 | internationalization: Интернацинализация (i18n) 45 | plugins: Плагины 46 | miscellaneous: Разное 47 | troubleshooting: Решение проблем 48 | contributing: Содействие 49 | api: 50 | core: Ядро 51 | overview: Обзор 52 | events: События 53 | locals: Переменные 54 | router: Маршруты 55 | box: Модуль 56 | rendering: Рендеринг 57 | posts: Посты 58 | scaffolds: Заготовки 59 | themes: Темы 60 | extensions: Расширения 61 | console: Консоль 62 | deployer: Инструмент размещения 63 | filter: Фильтр 64 | generator: Генератор 65 | helper: Помошник 66 | migrator: Мигратор 67 | processor: Обработчик 68 | renderer: Рендер 69 | tag: Тэг -------------------------------------------------------------------------------- /themes/screeps-docs/languages/zh-cn.yml: -------------------------------------------------------------------------------- 1 | menu: 2 | docs: 文档 3 | api: API 4 | news: 新闻 5 | plugins: 插件 6 | themes: 主题 7 | search: 搜索 8 | 9 | index: 10 | get_started: 开始使用 11 | 12 | page: 13 | contents: 目录 14 | back_to_top: 回到顶部 15 | improve: 改进本文 16 | prev: 上一页 17 | next: 下一页 18 | last_updated: 上次更新:%s 19 | 20 | sidebar: 21 | docs: 22 | getting_started: 开始使用 23 | overview: 概述 24 | setup: 建站 25 | configuration: 配置 26 | commands: 命令 27 | migration: 迁移 28 | basic_usage: 基本操作 29 | writing: 写作 30 | front_matter: Front-matter 31 | tag_plugins: 标签插件 32 | asset_folders: 资源文件夹 33 | data_files: 数据文件夹 34 | server: 服务器 35 | generating: 生成器 36 | deployment: 部署 37 | customization: 自定义 38 | permalinks: 永久链接 39 | themes: 主题 40 | structure: 结构 41 | templates: 模版 42 | variables: 变量 43 | helpers: 辅助函数 44 | internationalization: 国际化 (i18n) 45 | plugins: 插件 46 | miscellaneous: 其他 47 | troubleshooting: 问题解答 48 | contributing: 贡献 49 | api: 50 | core: 核心 51 | overview: 概述 52 | events: 事件 53 | locals: 本地变量 54 | router: 路由 55 | box: 盒(Box) 56 | rendering: 渲染 57 | posts: 文章 58 | scaffolds: 模版 (Scaffold) 59 | themes: 主题 60 | extensions: 扩展 61 | console: 控制台 (Console) 62 | deployer: 部署器 (Deployer) 63 | filter: 过滤器 (Filter) 64 | generator: 生成器 (Generator) 65 | helper: 辅助函数 (Helper) 66 | migrator: 迁移器 (Migrator) 67 | processor: 处理器 (Processor) 68 | renderer: 渲染引擎 (Renderer) 69 | tag: 标签 (Tag) -------------------------------------------------------------------------------- /themes/screeps-docs/languages/zh-tw.yml: -------------------------------------------------------------------------------- 1 | menu: 2 | docs: 文件 3 | api: API 4 | news: 新聞 5 | plugins: 外掛 6 | themes: 主題 7 | search: 搜尋 8 | 9 | index: 10 | get_started: 開始使用 11 | 12 | page: 13 | contents: 目錄 14 | back_to_top: 回到頁首 15 | improve: 改善這篇文件 16 | prev: 上一頁 17 | next: 下一頁 18 | last_updated: 上次更新:%s 19 | 20 | sidebar: 21 | docs: 22 | getting_started: 開始使用 23 | overview: 概覽 24 | setup: 建立 25 | configuration: 配置 26 | commands: 指令 27 | migration: 轉移 28 | basic_usage: 基本操作 29 | writing: 寫作 30 | front_matter: Front-matter 31 | tag_plugins: 標籤外掛 32 | asset_folders: 資產資料夾 33 | data_files: 資料檔案 34 | server: 伺服器 35 | generating: 產生檔案 36 | deployment: 佈署 37 | customization: 自定 38 | permalinks: 永久連結 39 | themes: 主題 40 | structure: 結構 41 | templates: 模版 42 | variables: 變數 43 | helpers: 輔助函數 44 | internationalization: 國際化 (i18n) 45 | plugins: 外掛 46 | miscellaneous: 其他 47 | troubleshooting: 解決問題 48 | contributing: 貢獻 49 | api: 50 | core: 核心 51 | overview: 概覽 52 | events: 事件 53 | locals: 區域變數 54 | router: 路由 55 | box: 箱子 (Box) 56 | rendering: 渲染 57 | posts: 文章 58 | scaffolds: 鷹架 (Scaffold) 59 | themes: 主題 60 | extensions: 擴充 61 | console: 控制台 (Console) 62 | deployer: 佈署器 (Deployer) 63 | filter: 過濾器 (Filter) 64 | generator: 產生器 (Generator) 65 | helper: 輔助函數 (Helper) 66 | migrator: 轉移器 (Migrator) 67 | processor: 處理器 (Processor) 68 | renderer: 渲染引擎 (Renderer) 69 | tag: 標籤外掛 (Tag) -------------------------------------------------------------------------------- /themes/screeps-docs/layout/archive.swig: -------------------------------------------------------------------------------- 1 | {% set page.title = 'News' %} 2 |
    3 |
    4 |
    5 | {% for post in page.posts %} 6 | {% if loop.index == 1 %} 7 | {{ partial('partial/post', {post: post}) }} 8 | {% else %} 9 | 15 | {% endif %} 16 | {% endfor %} 17 |
    18 |
    19 |
    -------------------------------------------------------------------------------- /themes/screeps-docs/layout/layout.swig: -------------------------------------------------------------------------------- 1 | 2 | 3 | {{ partial('partial/head') }} 4 | 5 |
    6 | {{ partial('partial/header') }} 7 | {{ body }} 8 | {{ partial('partial/footer') }} 9 |
    10 |
    11 | {{ partial('partial/mobile_nav') }} 12 | {{ partial('partial/after_footer') }} 13 | 14 | -------------------------------------------------------------------------------- /themes/screeps-docs/layout/page.swig: -------------------------------------------------------------------------------- 1 |
    2 |
    3 |
    4 |
    5 |
    6 |
    7 |
    8 |
    9 |

    {{ page.title }}

    10 | 11 |
    12 |
    13 | {% if page.contributed %} 14 | 15 | {% endif %} 16 | {{ page_anchor(page.content) }} 17 |
    18 |
    19 | 20 | {{ page_nav() }} 21 |
    22 |
    23 |
    24 | 37 |
    38 |
    39 | {{ partial('partial/sidebar') }} 40 |
    41 |
    42 |
    43 | -------------------------------------------------------------------------------- /themes/screeps-docs/layout/partial/after_footer.swig: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {{ js('js/lang_select') }} 5 | {{ js('js/scrollingelement') }} 6 | {{ js('js/toc') }} 7 | {{ js('js/mobile_nav') }} 8 | {{ js('js/custom') }} 9 | 10 | 11 | {% if page.layout === 'plugins' %} 12 | 13 | 14 | 15 | {{ js('js/plugins') }} 16 | 17 | {% endif %} 18 | 19 | {% if config.algolia[page.lang] %} 20 | 21 | 29 | {% endif %} -------------------------------------------------------------------------------- /themes/screeps-docs/layout/partial/footer.swig: -------------------------------------------------------------------------------- 1 | 12 | -------------------------------------------------------------------------------- /themes/screeps-docs/layout/partial/google_analytics.swig: -------------------------------------------------------------------------------- 1 | {% if config.google_analytics %} 2 | 11 | {% endif %} -------------------------------------------------------------------------------- /themes/screeps-docs/layout/partial/head.swig: -------------------------------------------------------------------------------- 1 | 2 | 3 | {% if page.title %}{{ page.title }} | {% endif %}{{ config.title }} 4 | 5 | 6 | 7 | 8 | 9 | {% if page.layout == 'page' or page.layout == 'index' %} 10 | {% for lang in site.data.languages %} 11 | 12 | {% endfor %} 13 | {% endif %} 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | {{ css('css/prism') }} 34 | 35 | 36 | 37 | 38 | 39 | {{ feed_tag('atom.xml') }} 40 | 41 | {{ open_graph({ 42 | fb_admins: config.fb_admins, 43 | twitter_site: config.twitter 44 | }) }} 45 | 46 | {{ partial('google_analytics') }} 47 | 48 | -------------------------------------------------------------------------------- /themes/screeps-docs/layout/partial/header.swig: -------------------------------------------------------------------------------- 1 | 15 | -------------------------------------------------------------------------------- /themes/screeps-docs/layout/partial/mobile_nav.swig: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /themes/screeps-docs/layout/partial/post.swig: -------------------------------------------------------------------------------- 1 | 16 | -------------------------------------------------------------------------------- /themes/screeps-docs/layout/partial/sidebar.swig: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /themes/screeps-docs/layout/partial/theme.swig: -------------------------------------------------------------------------------- 1 |
  • 2 |
    3 | 4 | {% if plugin.preview %} 5 | 6 | {% endif %} 7 |
    8 | {{ plugin.name }} 9 |

    {{ plugin.description }}

    10 |
    11 | {% for tag in plugin.tags %} 12 | {{ tag }} 13 | {% endfor %} 14 |
    15 |
  • -------------------------------------------------------------------------------- /themes/screeps-docs/layout/post.swig: -------------------------------------------------------------------------------- 1 |
    2 |
    3 |
    4 | {{ partial('partial/post', {post: page}) }} 5 |
    6 |
    7 |
    -------------------------------------------------------------------------------- /themes/screeps-docs/source/css/_partial/archive.styl: -------------------------------------------------------------------------------- 1 | .archive-post 2 | padding: 1em 0 3 | border-top: 1px solid color-border 4 | &:last-child 5 | padding-bottom: 40px 6 | 7 | .archive-post-link 8 | clearfix() 9 | display: block 10 | color: color-default 11 | text-decoration: none 12 | line-height: line-height 13 | &:hover 14 | color: color-link-hover 15 | 16 | .archive-post-title 17 | font-family: font-title 18 | float: left 19 | font-weight: bold 20 | 21 | .archive-post-date 22 | color: color-gray 23 | float: right 24 | font-size: 0.9em -------------------------------------------------------------------------------- /themes/screeps-docs/source/css/_partial/base.styl: -------------------------------------------------------------------------------- 1 | global-reset() 2 | 3 | html 4 | box-sizing: border-box 5 | 6 | *, *:before, *:after 7 | box-sizing: inherit 8 | 9 | button 10 | input[type="reset"] 11 | input[type="button"] 12 | input[type="submit"] 13 | &::-moz-focus-inner 14 | padding: 0 15 | margin: 0 16 | border: 0 17 | 18 | input, button, select 19 | margin: 0 20 | padding: 0 21 | border: 0 22 | 23 | html, body 24 | @media screen 25 | height: 100% 26 | // overflow: hidden 27 | 28 | body 29 | background: #f5f7f9 30 | font-size: font-size 31 | font-family: font-sans 32 | color: color-default 33 | text-rendering: optimizeLegibility 34 | -webkit-font-smoothing: antialiased 35 | -moz-osx-font-smoothing: grayscale 36 | position: relative 37 | 38 | .wrapper 39 | clearfix() 40 | 41 | .inner 42 | clearfix() 43 | @media screen 44 | padding: 0 gutter-width 45 | 46 | #container 47 | max-width: 1280px 48 | margin: 0 auto 49 | 50 | -------------------------------------------------------------------------------- /themes/screeps-docs/source/css/_partial/footer.styl: -------------------------------------------------------------------------------- 1 | #footer 2 | clearfix() 3 | padding: 40px 0 4 | color: rgba(255, 255, 255, 0.6) 5 | font-family: font-title 6 | position: relative 7 | background: color-navy 8 | text-align: center 9 | @media mq-normal 10 | text-align: left 11 | @media print 12 | display: none 13 | a 14 | color: inherit 15 | text-decoration: none 16 | transition: 0.2s 17 | &:hover 18 | color: #fff 19 | 20 | #footer-copyright 21 | line-height: 1.4 22 | @media mq-normal 23 | float: left 24 | a 25 | font-weight: bold 26 | 27 | #footer-links 28 | margin-top: 1em 29 | @media mq-normal 30 | float: right 31 | margin-top: 0 32 | 33 | .footer-link 34 | font-size: 30px 35 | margin-left: 20px 36 | &:first-child 37 | margin-left: 0 -------------------------------------------------------------------------------- /themes/screeps-docs/source/css/_partial/header.styl: -------------------------------------------------------------------------------- 1 | header-padding-normal = 10px 2 | header-padding-max = 30px 3 | header-height = 50px 4 | 5 | #header 6 | position: relative 7 | @media print 8 | display: none 9 | @media mq-mobile 10 | background: #f5f7f9 11 | 12 | #header-inner 13 | display: flex 14 | flex-flow: row nowrap 15 | align-items: center 16 | height: header-height; 17 | padding: 0 18 | @media mq-mobile 19 | padding-left: 50px 20 | 21 | #logo-wrap 22 | padding: 10px header-padding-max 23 | @media mq-normal 24 | width: sidebar-width 25 | 26 | #logo-docs 27 | color: #9fa1ad; 28 | text-decoration: none; 29 | font-size: 21px; 30 | vertical-align: top; 31 | display: inline-block; 32 | 33 | #logo 34 | hide-text() 35 | background: url("../img/logotype_bw_animation.svg") no-repeat 36 | width: 120px 37 | height: 20px 38 | background-size: @width @height 39 | display: inline-block 40 | vertical-align: top 41 | margin-top: 3px 42 | 43 | #header-main 44 | background: white; 45 | flex-grow: 1 46 | height: header-height 47 | border-left: 1px solid #eee 48 | @media mq-mobile 49 | display: none 50 | 51 | #main-nav 52 | display: none 53 | flex: 1 auto 54 | padding-left: 20px 55 | @media mq-normal 56 | display: block 57 | 58 | .main-nav-link 59 | color: #fff 60 | text-decoration: none 61 | line-height: header-height 62 | opacity: 0.7 63 | transition: 0.2s 64 | font-family: font-title 65 | display: inline-block 66 | padding: 0 15px 67 | &:hover 68 | opacity: 1 69 | color: color-link-hover 70 | 71 | #search-input-wrap 72 | display: none 73 | padding-left: 6px 74 | padding-bottom: 8px 75 | border-bottom: 1px solid color-gray 76 | &.on 77 | display: inline-block 78 | 79 | #search-input-icon 80 | color: #fff 81 | padding-right: 0.5em 82 | display: inline-block 83 | opacity: 0.7 84 | 85 | #search-input 86 | background: none 87 | font-size: inherit 88 | font-family: font-title 89 | color: #fff 90 | outline: none 91 | -webkit-appearance: none 92 | 93 | #lang-select-wrap 94 | display: none 95 | position: relative 96 | @media mq-normal 97 | display: block 98 | 99 | #lang-select-label 100 | color: #fff 101 | opacity: 0.7 102 | font-family: font-title 103 | line-height: header-height 104 | span 105 | padding-left: 8px 106 | i 107 | opacity: 0.7 108 | 109 | #lang-select 110 | opacity: 0 111 | position: absolute 112 | top: 0 113 | left: 0 114 | width: 100% 115 | height: 100% 116 | -webkit-appearance: menulist-button 117 | font-size: inherit 118 | 119 | .api-link 120 | margin: 0 -15px 40px -15px; 121 | display: block; 122 | text-decoration: none; 123 | background: #4f536d; 124 | padding: 10px 15px; 125 | color: white; 126 | border-radius: 3px; 127 | 128 | @media mq-mobile 129 | margin: 20px 0 30px 0 130 | border-radius: 0 131 | 132 | img 133 | width: 12px; 134 | height: 16px; 135 | vertical-align: middle; 136 | margin-left: 14px; 137 | position: relative 138 | top: -1px -------------------------------------------------------------------------------- /themes/screeps-docs/source/css/_partial/highlight.styl: -------------------------------------------------------------------------------- 1 | // https://github.com/chriskempson/tomorrow-theme 2 | highlight-background = #fff 3 | highlight-current-line = #efefef 4 | highlight-selection = #d6d6d6 5 | highlight-foreground = #4d4d4c 6 | highlight-comment = #8e908c 7 | highlight-red = #c82829 8 | highlight-orange = #f5871f 9 | highlight-yellow = #eab700 10 | highlight-green = #718c00 11 | highlight-aqua = #3e999f 12 | highlight-blue = #4271ae 13 | highlight-purple = #8959a8 14 | 15 | pre, code 16 | font-family: font-mono 17 | background: #eee 18 | font-size: 0.95em 19 | 20 | code 21 | padding: 0 5px 22 | 23 | pre 24 | padding: 10px 15px 25 | line-height: 22px 26 | code 27 | border: none 28 | display: block 29 | padding: 0 30 | 31 | .highlight 32 | background: #2A3B5F 33 | padding: 10px 15px 34 | color: white 35 | overflow: auto 36 | margin: 0 37 | table 38 | margin: 0 !important 39 | border: 0 40 | th, td 41 | padding: 0 42 | figcaption 43 | clearfix() 44 | margin: -5px 0 5px 45 | font-size: 0.9em 46 | color: color-gray 47 | a 48 | float: right 49 | pre 50 | padding: 0 51 | border: none 52 | background: none 53 | code 54 | background: none 55 | .line 56 | height: 22px 57 | 58 | 59 | pre 60 | .comment 61 | .title 62 | color: highlight-comment 63 | .variable 64 | .attribute 65 | .tag 66 | .regexp 67 | .ruby .constant 68 | .xml .tag .title 69 | .xml .pi 70 | .xml .doctype 71 | .html .doctype 72 | .css .id 73 | .css .class 74 | .css .pseudo 75 | color: highlight-red 76 | .number 77 | .preprocessor 78 | .built_in 79 | .literal 80 | .params 81 | .constant 82 | color: highlight-orange 83 | .class 84 | .ruby .class .title 85 | .css .rules .attribute 86 | color: highlight-green 87 | .string 88 | .value 89 | .inheritance 90 | .header 91 | .ruby .symbol 92 | .xml .cdata 93 | color: highlight-green 94 | .css .hexcolor 95 | color: highlight-aqua 96 | .function 97 | .python .decorator 98 | .python .title 99 | .ruby .function .title 100 | .ruby .title .keyword 101 | .perl .sub 102 | .javascript .title 103 | .coffeescript .title 104 | color: highlight-blue 105 | .keyword 106 | .javascript .function 107 | color: highlight-purple -------------------------------------------------------------------------------- /themes/screeps-docs/source/css/_partial/index.styl: -------------------------------------------------------------------------------- 1 | .index-block 2 | display: inline-block; 3 | width: 250px; 4 | margin: 0 20px 20px 0; 5 | box-shadow: 0px 4px 12px 0px rgba(0, 0, 0, 0.19); 6 | padding: 10px 20px; 7 | cursor: pointer; 8 | border-radius: 2px; 9 | line-height: 1.4 10 | text-decoration: none !important 11 | transition: transform .5s 12 | 13 | span 14 | color: color-default 15 | 16 | &__title 17 | display: block; 18 | color: color-link !important 19 | font-weight: bold 20 | margin-bottom: 5px 21 | 22 | &:hover 23 | transform: translate(0, -2px) 24 | 25 | #twitter-feed 26 | margin-top: 35px -------------------------------------------------------------------------------- /themes/screeps-docs/source/css/_partial/mobile_nav.styl: -------------------------------------------------------------------------------- 1 | toggle-width = 25px 2 | toggle-height = toggle-width * 0.8 3 | toggle-line = 2px 4 | transition-duration = 0.4s 5 | lang-select-height = 40px 6 | 7 | #mobile-nav 8 | position: fixed 9 | top: 0 10 | width: mobile-nav-width 11 | left: @width * -1 12 | height: 100% 13 | background: #f5f7f9 14 | transition: transition-duration 15 | font-family: font-title 16 | .mobile-nav-on & 17 | transform: translateX(100%) 18 | 19 | #mobile-nav-inner 20 | overflow-y: auto 21 | padding: 10px 0 22 | position: absolute 23 | top: 0 24 | bottom: lang-select-height 25 | left: 0 26 | right: 0 27 | -webkit-overflow-scrolling: touch 28 | 29 | #mobile-nav-toggle 30 | position: absolute 31 | top: 0 32 | bottom: 0 33 | left: gutter-width 34 | width: toggle-width 35 | height: toggle-height 36 | margin: auto 37 | opacity: 0.5 38 | cursor: pointer 39 | transition: 0.2s 40 | &:active, .mobile-nav-on & 41 | opacity: 1 42 | @media mq-normal 43 | display: none 44 | 45 | .mobile-nav-toggle-bar 46 | background: #000 47 | position: absolute 48 | left: 0 49 | width: 100% 50 | height: toggle-line 51 | transition: transition-duration 52 | transform-origin: 0 53 | border-radius: toggle-line 54 | &:first-child 55 | top: 0 56 | .mobile-nav-on & 57 | transform: rotate(45deg) 58 | &:nth-child(2) 59 | top: (toggle-height - toggle-line) * 0.5 60 | .mobile-nav-on & 61 | opacity: 0 62 | &:last-child 63 | top: toggle-height - toggle-line 64 | .mobile-nav-on & 65 | transform: rotate(-45deg) 66 | 67 | .mobile-nav-link 68 | color: #000 69 | text-decoration: none 70 | display: block 71 | padding: 10px 15px 72 | line-height: 1 73 | white-space: nowrap 74 | overflow: hidden 75 | text-overflow: ellipsis 76 | 77 | &.current 78 | color: color-link 79 | &:hover 80 | color: color-link-hover 81 | 82 | .mobile-nav-title 83 | color: #666 84 | padding: 10px 15px 85 | line-height: 1 86 | display: block 87 | text-transform: uppercase; 88 | font-size: 12px; 89 | margin-top: 10px 90 | white-space: nowrap 91 | overflow: hidden 92 | text-overflow: ellipsis 93 | font-family: Lato, "Helvetica Neue", Helvetica, Arial, sans-serif; 94 | 95 | #mobile-lang-select-wrap 96 | position: absolute 97 | bottom: 0 98 | left: 0 99 | width: 100% 100 | background: color-navy 101 | border-top: 1px solid #444 102 | 103 | #mobile-lang-select-label 104 | line-height: lang-select-height 105 | color: #fff 106 | padding: 10px 15px 107 | i 108 | opacity: 0.7 109 | span 110 | padding-left: 8px 111 | 112 | #mobile-lang-select 113 | -webkit-appearance: menulist-button 114 | opacity: 0 115 | position: absolute 116 | top: 0 117 | left: 0 118 | width: 100% 119 | height: 100% 120 | 121 | #container 122 | transition: transition-duration 123 | height: 100% 124 | // overflow: auto 125 | -webkit-overflow-scrolling: touch 126 | .mobile-nav-on & 127 | transform: translateX(mobile-nav-width) 128 | overflow: hidden 129 | 130 | #mobile-nav-dimmer 131 | position: absolute 132 | top: 0 133 | left: 100% 134 | width: 100% 135 | height: 100% 136 | background: #000 137 | opacity: 0 138 | display: none 139 | transition: opacity transition-duration, transform 0s transition-duration 140 | .mobile-nav-on & 141 | opacity: 0.7 142 | transform: translateX(-100%) 143 | display: block 144 | transition: opacity transition-duration 145 | -------------------------------------------------------------------------------- /themes/screeps-docs/source/css/_partial/plugins.styl: -------------------------------------------------------------------------------- 1 | #plugin-list-header 2 | clearfix() 3 | margin: 40px 0 4 | 5 | #plugin-list-title 6 | font-family: font-title 7 | font-size: 36px 8 | font-weight: 300 9 | line-height: 1 10 | float: left 11 | 12 | #plugin-list-count 13 | color: color-gray 14 | padding-top: 1em 15 | text-align: right 16 | @media mq-normal 17 | float: right 18 | line-height: 40px 19 | padding-top: 0 20 | padding-right: 15px 21 | 22 | #plugin-search-input 23 | font-size: 16px 24 | font-family: inherit 25 | -webkit-appearance: none 26 | border: 1px solid color-border 27 | padding: 10px 10px 28 | width: 100% 29 | margin-top: 25px 30 | @media mq-normal 31 | float: right 32 | width: 50% 33 | margin-top: 0 34 | 35 | #plugin-list 36 | margin: 40px -20px 37 | display: flex 38 | flex-flow: column 39 | @media mq-tablet 40 | flex-flow: row wrap 41 | 42 | .plugin 43 | display: none 44 | padding: 20px 45 | @media mq-tablet 46 | flex: 0 0 50% 47 | @media mq-normal 48 | flex: 0 0 (100 / 3)% 49 | &.on 50 | display: block 51 | 52 | .plugin-name 53 | font-family: font-title 54 | font-weight: bold 55 | color: color-link 56 | font-size: 20px 57 | text-decoration: none 58 | line-height: 1 59 | &:hover 60 | color: color-link-hover 61 | 62 | .plugin-desc 63 | line-height: line-height 64 | margin: 1em 0 65 | 66 | .plugin-tag-list 67 | clearfix() 68 | line-height: 1.3 69 | 70 | .plugin-tag 71 | color: color-gray 72 | font-size: 0.9em 73 | text-decoration: none 74 | float: left 75 | margin-right: 10px 76 | &:hover 77 | color: color-link-hover 78 | &:before 79 | content: "#" 80 | 81 | .plugin-screenshot 82 | margin-bottom: 15px 83 | position: relative 84 | padding-top: (10 / 16 * 100)% // 16:10 ratio 85 | height: 0 86 | overflow: hidden 87 | 88 | .plugin-screenshot-img 89 | position: absolute 90 | top: 0 91 | left: 0 92 | width: 100% 93 | height: auto 94 | 95 | .plugin-preview-link 96 | position: absolute 97 | top: 0 98 | left: 0 99 | width: 100% 100 | height: 100% 101 | background: rgba(0, 0, 0, 0.7) 102 | color: #fff 103 | text-align: center 104 | opacity: 0 105 | transition: 0.15s 106 | &:hover 107 | opacity: 1 108 | .fa 109 | opacity: 1 110 | transform: scale(1) 111 | .fa 112 | position: absolute 113 | top: 0 114 | left: 0 115 | bottom: 0 116 | right: 0 117 | margin: auto 118 | font-size: 50px 119 | width: @font-size 120 | height: @font-size 121 | opacity: 0 122 | transform: scale(6) 123 | transition: 0.2s 124 | transition-delay: 0.15s -------------------------------------------------------------------------------- /themes/screeps-docs/source/css/_partial/post.styl: -------------------------------------------------------------------------------- 1 | .post 2 | margin: 0 auto 3 | float: none 4 | @media screen 5 | max-width: 800px -------------------------------------------------------------------------------- /themes/screeps-docs/source/css/_partial/sidebar.styl: -------------------------------------------------------------------------------- 1 | #sidebar 2 | width: sidebar-width 3 | float: left 4 | padding-top: 40px; 5 | padding-bottom: 40px 6 | opacity: 0.8 7 | margin-left: sidebar-width * -1 8 | display: none 9 | @media mq-normal 10 | display: block 11 | 12 | .sidebar-title 13 | margin-top: 20px 14 | padding: 10px 0 15 | font-family: font-title 16 | display: inline-block 17 | line-height: 1 18 | color: #666; 19 | text-transform: uppercase; 20 | font-size: .8em; 21 | 22 | .sidebar-link 23 | font-family: font-title 24 | display: block 25 | color: #000 26 | text-decoration: none 27 | padding: 7px 0 28 | line-height: 1 29 | position: relative 30 | width: 100% 31 | text-overflow: ellipsis 32 | overflow: hidden 33 | white-space: nowrap 34 | &.current 35 | color: color-link 36 | &:hover 37 | color: color-link-hover -------------------------------------------------------------------------------- /themes/screeps-docs/source/css/_variables.styl: -------------------------------------------------------------------------------- 1 | // Config 2 | support-for-ie = false 3 | vendor-prefixes = webkit moz ms official 4 | 5 | // Colors 6 | color-default = #444 7 | color-gray = #999 8 | color-border = #e3e3e3 9 | color-navy = hsl(210, 25%, 12%) 10 | color-link = #0e83cd 11 | color-link-hover = lighten(color-link, 10%) 12 | 13 | // Typography 14 | font-sans = "Helvetica Neue", Helvetica, Arial, sans-serif 15 | font-serif = Garamond, Georgia, "Times New Roman", serif 16 | font-mono = "Source Code Pro", Monaco, Menlo, Consolas, monospace 17 | font-title = Lato, font-sans 18 | font-size = 15px 19 | line-height = 1.6em 20 | 21 | // Layout 22 | max-width = 1200px 23 | gutter-width = 30px 24 | sidebar-width = 250px 25 | mobile-nav-width = 260px 26 | 27 | // Media queries 28 | mq-mobile = "screen and (max-width: 768px)" 29 | mq-normal = "screen and (min-width: 769px)" 30 | mq-tablet = "screen and (min-width: 480px)" 31 | -------------------------------------------------------------------------------- /themes/screeps-docs/source/css/custom.styl: -------------------------------------------------------------------------------- 1 | .collapsible-table 2 | margin: 5px 0; 3 | 4 | &__header 5 | padding: 30px; 6 | background-color: #22242b; 7 | color: #ddd; 8 | font-size: 18px; 9 | cursor: pointer; 10 | position: relative; 11 | overflow: hidden; 12 | 13 | i.fa 14 | margin-right: 10px; 15 | font-size: 25px; 16 | vertical-align: middle; 17 | 18 | span 19 | vertical-align: middle; 20 | 21 | &:hover 22 | color: white; 23 | 24 | em 25 | font-style: normal; 26 | color: #999; 27 | font-size: 14px; 28 | margin-left: 10px; 29 | 30 | img 31 | position: absolute; 32 | right: 0; 33 | top: 0; 34 | 35 | &__content 36 | display: none; -------------------------------------------------------------------------------- /themes/screeps-docs/source/css/navy.styl: -------------------------------------------------------------------------------- 1 | @import "nib" 2 | @import "_variables" 3 | 4 | @import "_partial/base" 5 | @import "_partial/header" 6 | @import "_partial/index" 7 | @import "_partial/sidebar" 8 | @import "_partial/page" 9 | @import "_partial/post" 10 | @import "_partial/plugins" 11 | @import "_partial/archive" 12 | @import "_partial/mobile_nav" 13 | @import "_partial/footer" 14 | @import "_partial/highlight" 15 | 16 | @import "custom" -------------------------------------------------------------------------------- /themes/screeps-docs/source/css/prism.css: -------------------------------------------------------------------------------- 1 | /* http://prismjs.com/download.html?themes=prism-okaidia&languages=markup+css+clike+javascript */ 2 | /** 3 | * okaidia theme for JavaScript, CSS and HTML 4 | * Loosely based on Monokai textmate theme by http://www.monokai.nl/ 5 | * @author ocodia 6 | */ 7 | 8 | code[class*="language-"], 9 | pre[class*="language-"] { 10 | color: #f8f8f2; 11 | /*text-shadow: 0 1px rgba(0, 0, 0, 0.3);*/ 12 | font-family: Consolas, Monaco, 'Andale Mono', monospace; 13 | direction: ltr; 14 | text-align: left; 15 | white-space: pre; 16 | word-spacing: normal; 17 | word-break: normal; 18 | line-height: 1.5; 19 | 20 | -moz-tab-size: 4; 21 | -o-tab-size: 4; 22 | tab-size: 4; 23 | 24 | -webkit-hyphens: none; 25 | -moz-hyphens: none; 26 | -ms-hyphens: none; 27 | hyphens: none; 28 | } 29 | 30 | /* Code blocks */ 31 | pre[class*="language-"] { 32 | padding: 1em; 33 | margin: .5em 0; 34 | overflow: auto; 35 | border-radius: 0.3em; 36 | } 37 | 38 | :not(pre) > code[class*="language-"], 39 | pre[class*="language-"] { 40 | background: #2A3B5F; 41 | } 42 | 43 | /* Inline code */ 44 | :not(pre) > code[class*="language-"] { 45 | padding: .1em; 46 | border-radius: .3em; 47 | } 48 | 49 | .token.comment, 50 | .token.prolog, 51 | .token.doctype, 52 | .token.cdata { 53 | color: slategray; 54 | } 55 | 56 | .token.punctuation { 57 | color: #f8f8f2; 58 | } 59 | 60 | .namespace { 61 | opacity: .7; 62 | } 63 | 64 | .token.property, 65 | .token.tag, 66 | .token.constant, 67 | .token.symbol, 68 | .token.deleted { 69 | color: #f92672; 70 | } 71 | 72 | .token.boolean, 73 | .token.number { 74 | color: #ae81ff; 75 | } 76 | 77 | .token.selector, 78 | .token.attr-name, 79 | .token.string, 80 | .token.char, 81 | .token.builtin, 82 | .token.inserted { 83 | color: #a6e22e; 84 | } 85 | 86 | .token.operator, 87 | .token.entity, 88 | .token.url, 89 | .language-css .token.string, 90 | .style .token.string, 91 | .token.variable { 92 | color: #f8f8f2; 93 | } 94 | 95 | .token.atrule, 96 | .token.attr-value, 97 | .token.function { 98 | color: #e6db74; 99 | } 100 | 101 | .token.keyword { 102 | color: #66d9ef; 103 | } 104 | 105 | .token.regex, 106 | .token.important { 107 | color: #fd971f; 108 | } 109 | 110 | .token.important, 111 | .token.bold { 112 | font-weight: bold; 113 | } 114 | .token.italic { 115 | font-style: italic; 116 | } 117 | 118 | .token.entity { 119 | cursor: help; 120 | } -------------------------------------------------------------------------------- /themes/screeps-docs/source/img/2016-03-09_10-32-33.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/themes/screeps-docs/source/img/2016-03-09_10-32-33.gif -------------------------------------------------------------------------------- /themes/screeps-docs/source/img/CreateSpawn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/themes/screeps-docs/source/img/CreateSpawn.png -------------------------------------------------------------------------------- /themes/screeps-docs/source/img/Respawn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/themes/screeps-docs/source/img/Respawn.png -------------------------------------------------------------------------------- /themes/screeps-docs/source/img/RespawnConfirm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/themes/screeps-docs/source/img/RespawnConfirm.png -------------------------------------------------------------------------------- /themes/screeps-docs/source/img/action-priorities.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/themes/screeps-docs/source/img/action-priorities.png -------------------------------------------------------------------------------- /themes/screeps-docs/source/img/addTwo.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/themes/screeps-docs/source/img/addTwo.wasm -------------------------------------------------------------------------------- /themes/screeps-docs/source/img/architecture_run.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/themes/screeps-docs/source/img/architecture_run.png -------------------------------------------------------------------------------- /themes/screeps-docs/source/img/architecture_stage1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/themes/screeps-docs/source/img/architecture_stage1.png -------------------------------------------------------------------------------- /themes/screeps-docs/source/img/architecture_stage2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/themes/screeps-docs/source/img/architecture_stage2.png -------------------------------------------------------------------------------- /themes/screeps-docs/source/img/auth_tokens.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/themes/screeps-docs/source/img/auth_tokens.png -------------------------------------------------------------------------------- /themes/screeps-docs/source/img/bigHealer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/themes/screeps-docs/source/img/bigHealer.png -------------------------------------------------------------------------------- /themes/screeps-docs/source/img/bigMelee.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/themes/screeps-docs/source/img/bigMelee.png -------------------------------------------------------------------------------- /themes/screeps-docs/source/img/bigRanged.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/themes/screeps-docs/source/img/bigRanged.png -------------------------------------------------------------------------------- /themes/screeps-docs/source/img/binary1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/themes/screeps-docs/source/img/binary1.png -------------------------------------------------------------------------------- /themes/screeps-docs/source/img/binary2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/themes/screeps-docs/source/img/binary2.png -------------------------------------------------------------------------------- /themes/screeps-docs/source/img/binary3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/themes/screeps-docs/source/img/binary3.png -------------------------------------------------------------------------------- /themes/screeps-docs/source/img/bodyparts.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/themes/screeps-docs/source/img/bodyparts.png -------------------------------------------------------------------------------- /themes/screeps-docs/source/img/c1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/themes/screeps-docs/source/img/c1.png -------------------------------------------------------------------------------- /themes/screeps-docs/source/img/c2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/themes/screeps-docs/source/img/c2.png -------------------------------------------------------------------------------- /themes/screeps-docs/source/img/chrome_2016-06-21_22-21-36.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/themes/screeps-docs/source/img/chrome_2016-06-21_22-21-36.png -------------------------------------------------------------------------------- /themes/screeps-docs/source/img/chrome_2016-11-24_14-55-59.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/themes/screeps-docs/source/img/chrome_2016-11-24_14-55-59.png -------------------------------------------------------------------------------- /themes/screeps-docs/source/img/chrome_2017-03-06_14-40-11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/themes/screeps-docs/source/img/chrome_2017-03-06_14-40-11.png -------------------------------------------------------------------------------- /themes/screeps-docs/source/img/chrome_2017-03-08_13-01-20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/themes/screeps-docs/source/img/chrome_2017-03-08_13-01-20.png -------------------------------------------------------------------------------- /themes/screeps-docs/source/img/colony-center.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/themes/screeps-docs/source/img/colony-center.png -------------------------------------------------------------------------------- /themes/screeps-docs/source/img/commander.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/themes/screeps-docs/source/img/commander.png -------------------------------------------------------------------------------- /themes/screeps-docs/source/img/commodities.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/themes/screeps-docs/source/img/commodities.png -------------------------------------------------------------------------------- /themes/screeps-docs/source/img/commodities1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/themes/screeps-docs/source/img/commodities1.png -------------------------------------------------------------------------------- /themes/screeps-docs/source/img/commodities2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/themes/screeps-docs/source/img/commodities2.png -------------------------------------------------------------------------------- /themes/screeps-docs/source/img/commodities3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/themes/screeps-docs/source/img/commodities3.png -------------------------------------------------------------------------------- /themes/screeps-docs/source/img/commodities4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/themes/screeps-docs/source/img/commodities4.png -------------------------------------------------------------------------------- /themes/screeps-docs/source/img/commodities5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/themes/screeps-docs/source/img/commodities5.png -------------------------------------------------------------------------------- /themes/screeps-docs/source/img/commodities6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/themes/screeps-docs/source/img/commodities6.png -------------------------------------------------------------------------------- /themes/screeps-docs/source/img/commodities7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/themes/screeps-docs/source/img/commodities7.png -------------------------------------------------------------------------------- /themes/screeps-docs/source/img/commodities8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/themes/screeps-docs/source/img/commodities8.png -------------------------------------------------------------------------------- /themes/screeps-docs/source/img/community-servers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/themes/screeps-docs/source/img/community-servers.png -------------------------------------------------------------------------------- /themes/screeps-docs/source/img/controllerDowngrade.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/themes/screeps-docs/source/img/controllerDowngrade.png -------------------------------------------------------------------------------- /themes/screeps-docs/source/img/cpu-bucket.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/themes/screeps-docs/source/img/cpu-bucket.png -------------------------------------------------------------------------------- /themes/screeps-docs/source/img/defense1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/themes/screeps-docs/source/img/defense1.png -------------------------------------------------------------------------------- /themes/screeps-docs/source/img/defense2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/themes/screeps-docs/source/img/defense2.png -------------------------------------------------------------------------------- /themes/screeps-docs/source/img/defense3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/themes/screeps-docs/source/img/defense3.png -------------------------------------------------------------------------------- /themes/screeps-docs/source/img/defense4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/themes/screeps-docs/source/img/defense4.png -------------------------------------------------------------------------------- /themes/screeps-docs/source/img/executor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/themes/screeps-docs/source/img/executor.png -------------------------------------------------------------------------------- /themes/screeps-docs/source/img/game-loop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/themes/screeps-docs/source/img/game-loop.png -------------------------------------------------------------------------------- /themes/screeps-docs/source/img/gcl-cpu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/themes/screeps-docs/source/img/gcl-cpu.png -------------------------------------------------------------------------------- /themes/screeps-docs/source/img/gpl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/themes/screeps-docs/source/img/gpl.png -------------------------------------------------------------------------------- /themes/screeps-docs/source/img/invader-core-expand.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/themes/screeps-docs/source/img/invader-core-expand.gif -------------------------------------------------------------------------------- /themes/screeps-docs/source/img/invader.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/themes/screeps-docs/source/img/invader.png -------------------------------------------------------------------------------- /themes/screeps-docs/source/img/link-external.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /themes/screeps-docs/source/img/logo-color.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/themes/screeps-docs/source/img/logo-color.png -------------------------------------------------------------------------------- /themes/screeps-docs/source/img/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/themes/screeps-docs/source/img/logo.png -------------------------------------------------------------------------------- /themes/screeps-docs/source/img/logotype_bw_animation.svg: -------------------------------------------------------------------------------- 1 | 2 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /themes/screeps-docs/source/img/minerals-01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/themes/screeps-docs/source/img/minerals-01.png -------------------------------------------------------------------------------- /themes/screeps-docs/source/img/minerals-02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/themes/screeps-docs/source/img/minerals-02.png -------------------------------------------------------------------------------- /themes/screeps-docs/source/img/mining_minerals.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/themes/screeps-docs/source/img/mining_minerals.png -------------------------------------------------------------------------------- /themes/screeps-docs/source/img/novice.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/themes/screeps-docs/source/img/novice.png -------------------------------------------------------------------------------- /themes/screeps-docs/source/img/operator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/themes/screeps-docs/source/img/operator.png -------------------------------------------------------------------------------- /themes/screeps-docs/source/img/pc_anim.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/themes/screeps-docs/source/img/pc_anim.mp4 -------------------------------------------------------------------------------- /themes/screeps-docs/source/img/power_banks.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/themes/screeps-docs/source/img/power_banks.gif -------------------------------------------------------------------------------- /themes/screeps-docs/source/img/power_banks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/themes/screeps-docs/source/img/power_banks.png -------------------------------------------------------------------------------- /themes/screeps-docs/source/img/power_spawn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/themes/screeps-docs/source/img/power_spawn.png -------------------------------------------------------------------------------- /themes/screeps-docs/source/img/safe_mode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/themes/screeps-docs/source/img/safe_mode.png -------------------------------------------------------------------------------- /themes/screeps-docs/source/img/shards.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/themes/screeps-docs/source/img/shards.png -------------------------------------------------------------------------------- /themes/screeps-docs/source/img/smallHealer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/themes/screeps-docs/source/img/smallHealer.png -------------------------------------------------------------------------------- /themes/screeps-docs/source/img/smallMelee.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/themes/screeps-docs/source/img/smallMelee.png -------------------------------------------------------------------------------- /themes/screeps-docs/source/img/smallRanged.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/themes/screeps-docs/source/img/smallRanged.png -------------------------------------------------------------------------------- /themes/screeps-docs/source/img/stronghold1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/themes/screeps-docs/source/img/stronghold1.png -------------------------------------------------------------------------------- /themes/screeps-docs/source/img/stronghold5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/themes/screeps-docs/source/img/stronghold5.png -------------------------------------------------------------------------------- /themes/screeps-docs/source/img/stronghold_loot1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/themes/screeps-docs/source/img/stronghold_loot1.png -------------------------------------------------------------------------------- /themes/screeps-docs/source/img/stronghold_loot2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/themes/screeps-docs/source/img/stronghold_loot2.png -------------------------------------------------------------------------------- /themes/screeps-docs/source/img/stronghold_loot3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/themes/screeps-docs/source/img/stronghold_loot3.png -------------------------------------------------------------------------------- /themes/screeps-docs/source/img/stronghold_loot4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/themes/screeps-docs/source/img/stronghold_loot4.png -------------------------------------------------------------------------------- /themes/screeps-docs/source/img/stronghold_loot5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/themes/screeps-docs/source/img/stronghold_loot5.png -------------------------------------------------------------------------------- /themes/screeps-docs/source/img/token-noratelimit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/themes/screeps-docs/source/img/token-noratelimit.png -------------------------------------------------------------------------------- /themes/screeps-docs/source/img/world-map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/screeps/docs/f96f46242d431cd84ae06f6ac70cbba31190050f/themes/screeps-docs/source/img/world-map.png -------------------------------------------------------------------------------- /themes/screeps-docs/source/js/custom.js: -------------------------------------------------------------------------------- 1 | $(function() { 2 | $('.collapsible-table__header').click(function() { 3 | $(this).parent().find('.collapsible-table__content').toggle(); 4 | if($(this).parent().find('.collapsible-table__content:visible').length) { 5 | $(this).find('i.fa').addClass('fa-minus-square').removeClass('fa-plus-sqaure'); 6 | } 7 | else { 8 | $(this).find('i.fa').addClass('fa-plus-square').removeClass('fa-minus-square'); 9 | } 10 | }) 11 | }); -------------------------------------------------------------------------------- /themes/screeps-docs/source/js/lang_select.js: -------------------------------------------------------------------------------- 1 | (function(){ 2 | 'use strict'; 3 | 4 | function changeLang(){ 5 | var lang = this.value; 6 | var canonical = this.dataset.canonical; 7 | if (lang === 'en') lang = ''; 8 | if (lang) lang += '/'; 9 | 10 | location.href = '/' + lang + canonical; 11 | } 12 | 13 | document.getElementById('lang-select').addEventListener('change', changeLang); 14 | document.getElementById('mobile-lang-select').addEventListener('change', changeLang); 15 | })(); -------------------------------------------------------------------------------- /themes/screeps-docs/source/js/mobile_nav.js: -------------------------------------------------------------------------------- 1 | (function(){ 2 | 'use strict'; 3 | 4 | var body = document.getElementsByTagName('body')[0]; 5 | var navToggle = document.getElementById('mobile-nav-toggle'); 6 | var container = document.getElementById('container'); 7 | var dimmer = document.getElementById('mobile-nav-dimmer'); 8 | var CLASS_NAME = 'mobile-nav-on'; 9 | if (!navToggle) return; 10 | 11 | navToggle.addEventListener('click', function(e){ 12 | e.preventDefault(); 13 | e.stopPropagation(); 14 | body.classList.toggle(CLASS_NAME); 15 | }); 16 | 17 | dimmer.addEventListener('click', function(e){ 18 | if (!body.classList.contains(CLASS_NAME)) return; 19 | 20 | e.preventDefault(); 21 | body.classList.remove(CLASS_NAME); 22 | }); 23 | })(); -------------------------------------------------------------------------------- /themes/screeps-docs/source/js/plugins.js: -------------------------------------------------------------------------------- 1 | (function(){ 2 | 'use strict'; 3 | 4 | var elements = document.getElementsByClassName('plugin'); 5 | var $count = document.getElementById('plugin-list-count'); 6 | var $input = document.getElementById('plugin-search-input'); 7 | var elementLen = elements.length; 8 | var index = lunr.Index.load(window.SEARCH_INDEX); 9 | 10 | function updateCount(count){ 11 | $count.innerHTML = count + (count === 1 ? ' item' : ' items'); 12 | } 13 | 14 | function addClass(elem, className){ 15 | var classList = elem.classList; 16 | 17 | if (!classList.contains(className)){ 18 | classList.add(className); 19 | } 20 | } 21 | 22 | function removeClass(elem, className){ 23 | var classList = elem.classList; 24 | 25 | if (classList.contains(className)){ 26 | classList.remove(className); 27 | } 28 | } 29 | 30 | function search(value){ 31 | var result = index.search(value); 32 | var len = result.length; 33 | var selected = {}; 34 | var i = 0; 35 | 36 | for (i = 0; i < len; i++){ 37 | selected[result[i].ref] = true; 38 | } 39 | 40 | for (i = 0; i < elementLen; i++){ 41 | if (selected[i]){ 42 | addClass(elements[i], 'on'); 43 | } else { 44 | removeClass(elements[i], 'on'); 45 | } 46 | } 47 | 48 | updateCount(len); 49 | } 50 | 51 | function displayAll(){ 52 | for (var i = 0; i < elementLen; i++){ 53 | addClass(elements[i], 'on'); 54 | } 55 | 56 | updateCount(elements.length); 57 | } 58 | 59 | function hashchange(){ 60 | var hash = location.hash.substring(1); 61 | $input.value = hash; 62 | 63 | if (hash){ 64 | search(hash); 65 | } else { 66 | displayAll(); 67 | } 68 | } 69 | 70 | $input.addEventListener('input', function(){ 71 | var value = this.value; 72 | 73 | if (!value) return displayAll(); 74 | search(value); 75 | }); 76 | 77 | window.addEventListener('hashchange', hashchange); 78 | hashchange(); 79 | })(); -------------------------------------------------------------------------------- /themes/screeps-docs/source/js/toc.js: -------------------------------------------------------------------------------- 1 | (function(){ 2 | 'use strict'; 3 | 4 | var header = document.getElementById('header'); 5 | var toc = document.getElementById('article-toc'); 6 | var tocTop = document.getElementById('article-toc-top'); 7 | var headerHeight = header.clientHeight; 8 | 9 | if (!toc) return; 10 | 11 | function updateSidebarPosition(){ 12 | var scrollTop = document.scrollingElement.scrollTop; 13 | 14 | if (scrollTop > headerHeight){ 15 | toc.classList.add('fixed'); 16 | } else { 17 | toc.classList.remove('fixed'); 18 | } 19 | } 20 | 21 | window.addEventListener('scroll', function(){ 22 | window.requestAnimationFrame(updateSidebarPosition); 23 | }); 24 | 25 | updateSidebarPosition(); 26 | 27 | tocTop.addEventListener('click', function(e){ 28 | e.preventDefault(); 29 | document.scrollingElement.scrollTop = 0; 30 | }); 31 | })(); 32 | --------------------------------------------------------------------------------