Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion api/source/Deposit.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Learn more about deposits from [this article](/resources.html).
<tbody>
<tr>
<td><strong>Cooldown</strong></td>
<td>`0.001 * totalHarvested ^ 1.2`<td>
<td><code>0.001 * totalHarvested ^ 1.2</code><td>
</tr>
<tr>
<td><strong>Decay</strong></td>
Expand Down
5 changes: 2 additions & 3 deletions api/source/Map.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ switch(terrain.get(10,15)) {
}
```

Get a <a href="#Room-Terrain">`Room.Terrain`</a> object which provides fast access to static terrain data. This method works for any room in the world even if you have no access to it.
Get a <a href="#Room-Terrain"><code>Room.Terrain</code></a> object which provides fast access to static terrain data. This method works for any room in the world even if you have no access to it.

{% api_method_params %}
roomName : string
Expand All @@ -229,7 +229,7 @@ The room name.

### Return value

Returns new <a href="#Room-Terrain">`Room.Terrain`</a> object.
Returns new <a href="#Room-Terrain"><code>Room.Terrain</code></a> object.


{% api_method Game.map.getTerrainAt 'x, y, roomName|pos' 1 '{"deprecated": "Please use a faster method [`Game.map.getRoomTerrain`](#Game.map.getRoomTerrain) instead."}'%}
Expand Down Expand Up @@ -318,4 +318,3 @@ property | type | description
---|---
`status` | string | One of the following string values: <ul><li><code>normal</code> &ndash; the room has no restrictions</li><li><code>closed</code> &ndash; the room is not available</li><li><code>novice</code> &ndash; the room is part of a novice area</li><li><code>respawn</code> &ndash; the room is part of a respawn area</li></ul>
`timestamp` | number | Status expiration time <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getTime#Syntax">in milliseconds since UNIX epoch time</a>. This property is null if the status is permanent.

2 changes: 1 addition & 1 deletion api/source/PathFinder.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ An object containing additional pathfinding flags.
<li>
<div class="api-arg-title">maxCost</div>
<div class="api-arg-type">number</div>
<div class="api-arg-desc">The maximum allowed cost of the path returned. If at any point the pathfinder detects that it is impossible to find a path with a cost less than or equal to `maxCost` it will immediately halt the search. The default is Infinity.</div>
<div class="api-arg-desc">The maximum allowed cost of the path returned. If at any point the pathfinder detects that it is impossible to find a path with a cost less than or equal to <code>maxCost</code> it will immediately halt the search. The default is Infinity.</div>
</li>
<li>
<div class="api-arg-title">heuristicWeight</div>
Expand Down
2 changes: 1 addition & 1 deletion api/source/Room.Terrain.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ for(let y = 0; y < 50; y++) {
}
```

Get terrain type at the specified room position by `(x,y)` coordinates. Unlike the <a href="#Game.map.getTerrainAt">`Game.map.getTerrainAt(...)`</a> method, this one doesn't perform any string operations and returns integer terrain type values (see below).
Get terrain type at the specified room position by `(x,y)` coordinates. Unlike the <a href="#Game.map.getTerrainAt"><code>Game.map.getTerrainAt(...)</code></a> method, this one doesn't perform any string operations and returns integer terrain type values (see below).

{% api_method_params %}
x : number
Expand Down
112 changes: 56 additions & 56 deletions api/source/Room.md
Original file line number Diff line number Diff line change
Expand Up @@ -486,134 +486,134 @@ The `data` property is different for each event type according to the following
<th>event</th><th>description</th>
</tr>
<tr>
<td>`EVENT_ATTACK`</td>
<td><code>EVENT_ATTACK</code></td>
<td>
A creep or a structure performed an attack to another object.
<ul>
<li>`targetId` - the target object ID</li>
<li>`damage` - the amount of hits damaged</li>
<li>`attackType` - one of the following constants:
<li><code>targetId</code> - the target object ID</li>
<li><code>damage</code> - the amount of hits damaged</li>
<li><code>attackType</code> - one of the following constants:
<ul>
<li>`EVENT_ATTACK_TYPE_MELEE` - a creep attacked with [attack](#Creep.attack)</li>
<li>`EVENT_ATTACK_TYPE_RANGED` - a creep attacked with [rangedAttack](#Creep.rangedAttack), or a tower attacked with [attack](#StructureTower.attack)</li>
<li>`EVENT_ATTACK_TYPE_RANGED_MASS` - a creep attacked with [rangedMassAttack](#Creep.rangedMassAttack)</li>
<li>`EVENT_ATTACK_TYPE_DISMANTLE` - a creep attacked with [dismantle](#Creep.dismantle)</li>
<li>`EVENT_ATTACK_TYPE_HIT_BACK` - a creep hit back on another creep's [attack](#Creep.attack)</li>
<li>`EVENT_ATTACK_TYPE_NUKE` - a nuke landed</li>
<li><code>EVENT_ATTACK_TYPE_MELEE</code> - a creep attacked with <a href="#Creep.attack">attack</a></li>
<li><code>EVENT_ATTACK_TYPE_RANGED</code> - a creep attacked with <a href="#Creep.rangedAttack">rangedAttack</a>, or a tower attacked with <a href="#StructureTower.attack">attack</a></li>
<li><code>EVENT_ATTACK_TYPE_RANGED_MASS</code> - a creep attacked with <a href="#Creep.rangedMassAttack">rangedMassAttack</a></li>
<li><code>EVENT_ATTACK_TYPE_DISMANTLE</code> - a creep attacked with <a href="#Creep.dismantle">dismantle</a></li>
<li><code>EVENT_ATTACK_TYPE_HIT_BACK</code> - a creep hit back on another creep's <a href="#Creep.attack">attack</a></li>
<li><code>EVENT_ATTACK_TYPE_NUKE</code> - a nuke landed</li>
</ul>
</li>
</ul>
</td>
</tr>
<tr>
<td>`EVENT_OBJECT_DESTROYED`</td>
<td><code>EVENT_OBJECT_DESTROYED</code></td>
<td>
A game object is destroyed or killed.
<ul><li>`type` - the type of the destroyed object</li></ul>
<ul><li><code>type</code> - the type of the destroyed object</li></ul>
</td>
</tr>
<tr>
<td>`EVENT_ATTACK_CONTROLLER`</td>
<td>A creep performed [`attackController`](#Creep.attackController) in the room.</td>
<td><code>EVENT_ATTACK_CONTROLLER</code></td>
<td>A creep performed <a href="#Creep.attackController"><code>attackController</code></a> in the room.</td>
</tr>
<tr>
<td>`EVENT_BUILD`</td>
<td><code>EVENT_BUILD</code></td>
<td>
A creep performed [`build`](#Creep.build) in the room.
A creep performed <a href="#Creep.build"><code>build</code></a> in the room.
<ul>
<li>`targetId` - the target object ID</li>
<li>`amount` - the amount of build progress gained</li>
<li>`structureType` - one of the STRUCTURE_* constants</li>
<li>`x` - the X position of the target construction site</li>
<li>`y` - the Y position of the target construction site</li>
<li>`incomplete` - status of build progress</li>
<li><code>targetId</code> - the target object ID</li>
<li><code>amount</code> - the amount of build progress gained</li>
<li><code>structureType</code> - one of the STRUCTURE_* constants</li>
<li><code>x</code> - the X position of the target construction site</li>
<li><code>y</code> - the Y position of the target construction site</li>
<li><code>incomplete</code> - status of build progress</li>
</ul>
</td>
</tr>
<tr>
<td>`EVENT_HARVEST`</td>
<td><code>EVENT_HARVEST</code></td>
<td>
A creep performed [`harvest`](#Creep.harvest) in the room.
A creep performed <a href="#Creep.harvest"><code>harvest</code></a> in the room.
<ul>
<li>`targetId` - the target object ID</li>
<li>`amount` - the amount of resource harvested</li>
<li><code>targetId</code> - the target object ID</li>
<li><code>amount</code> - the amount of resource harvested</li>
</ul>
</td>
</tr>
<tr>
<td>`EVENT_HEAL`</td>
<td><code>EVENT_HEAL</code></td>
<td>
A creep or a tower healed a creep.
<ul>
<li>`targetId` - the target object ID</li>
<li>`amount` - the amount of hits healed</li>
<li>`healType` - one of the following constants:
<li><code>targetId</code> - the target object ID</li>
<li><code>amount</code> - the amount of hits healed</li>
<li><code>healType</code> - one of the following constants:
<ul>
<li>`EVENT_HEAL_TYPE_MELEE` - a creep healed with [heal](#Creep.heal)</li>
<li>`EVENT_HEAL_TYPE_RANGED` - a creep healed with [rangedHeal](#Creep.rangedHeal), or a tower healed with [heal](#StructureTower.heal)</li>
<li><code>EVENT_HEAL_TYPE_MELEE</code> - a creep healed with <a href="#Creep.heal">heal</a></li>
<li><code>EVENT_HEAL_TYPE_RANGED</code> - a creep healed with <a href="#Creep.rangedHeal">rangedHeal</a>, or a tower healed with <a href="#StructureTower.heal">heal</a></li>
</ul>
</li>
</ul>
</td>
</tr>
<tr>
<td>`EVENT_REPAIR`</td>
<td><code>EVENT_REPAIR</code></td>
<td>
A creep or a tower repaired a structure.
<ul>
<li>`targetId` - the target object ID</li>
<li>`amount` - the amount of hits repaired</li>
<li>`energySpent` - the energy amount spent on the operation</li>
<li><code>targetId</code> - the target object ID</li>
<li><code>amount</code> - the amount of hits repaired</li>
<li><code>energySpent</code> - the energy amount spent on the operation</li>
</ul>
</td>
</tr>
<tr>
<td>`EVENT_RESERVE_CONTROLLER`</td>
<td><code>EVENT_RESERVE_CONTROLLER</code></td>
<td>
A creep performed [`reserveController`](#Creep.reserveController) in the room.
A creep performed <a href="#Creep.reserveController"><code>reserveController</code></a> in the room.
<ul>
<li>`amount` - the amount of reservation time gained</li>
<li><code>amount</code> - the amount of reservation time gained</li>
</ul>
</td>
</tr>
<tr>
<td>`EVENT_UPGRADE_CONTROLLER`</td>
<td><code>EVENT_UPGRADE_CONTROLLER</code></td>
<td>
A creep performed [`upgradeController`](#Creep.upgradeController) in the room.
A creep performed <a href="#Creep.upgradeController"><code>upgradeController</code></a> in the room.
<ul>
<li>`amount` - the amount of control points gained</li>
<li>`energySpent` - the energy amount spent on the operation</li>
<li><code>amount</code> - the amount of control points gained</li>
<li><code>energySpent</code> - the energy amount spent on the operation</li>
</ul>
</td>
</tr>
<tr>
<td>`EVENT_EXIT`</td>
<td><code>EVENT_EXIT</code></td>
<td>
A creep moved to another room.
<ul>
<li>`room` - the name of the target room</li>
<li>`x`, `y` - the coordinates in another room where the creep has appeared</li>
<li><code>room</code> - the name of the target room</li>
<li><code>x</code>, <code>y</code> - the coordinates in another room where the creep has appeared</li>
</ul>
</td>
</tr>
<tr>
<td>`EVENT_TRANSFER`</td>
<td><code>EVENT_TRANSFER</code></td>
<td>
A link performed [`transferEnergy`](https://docs.screeps.com/api/#StructureLink.transferEnergy) or a creep performed [`transfer`](#Creep.transfer) or [`withdraw`](#Creep.withdraw).
A link performed <a href="https://docs.screeps.com/api/#StructureLink.transferEnergy"><code>transferEnergy</code></a> or a creep performed <a href="#Creep.transfer"><code>transfer</code></a> or <a href="#Creep.withdraw"><code>withdraw</code></a>.
<ul>
<li>`targetId` - the target object ID</li>
<li>`resourceType` - the type of resource transferred</li>
<li>`amount` - the amount of resource transferred</li>
<li><code>targetId</code> - the target object ID</li>
<li><code>resourceType</code> - the type of resource transferred</li>
<li><code>amount</code> - the amount of resource transferred</li>
</ul>
</td>
</tr>
<tr>
<td>`EVENT_POWER`</td>
<td><code>EVENT_POWER</code></td>
<td>
Apply one the creep's powers on the specified target.
<ul>
<li>`targetId` - the target object ID</li>
<li>`power` - the power ability to use, one of the PWR_* constants</li>
<li><code>targetId</code> - the target object ID</li>
<li><code>power</code> - the power ability to use, one of the PWR_* constants</li>
</ul>
</td>
</tr>
Expand Down Expand Up @@ -657,11 +657,11 @@ switch(terrain.get(10,15)) {
}
```

Get a <a href="#Room-Terrain">`Room.Terrain`</a> object which provides fast access to static terrain data. This method works for any room in the world even if you have no access to it.
Get a <a href="#Room-Terrain"><code>Room.Terrain</code></a> object which provides fast access to static terrain data. This method works for any room in the world even if you have no access to it.

### Return value

Returns new <a href="#Room-Terrain">`Room.Terrain`</a> object.
Returns new <a href="#Room-Terrain"><code>Room.Terrain</code></a> object.

{% api_method lookAt 'x, y|target' 2 %}

Expand Down
2 changes: 1 addition & 1 deletion api/source/StructureLab.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Learn more about minerals from [this article](/resources.html).
</tr>
<tr>
<td><strong>Reaction cooldown</strong></td>
<td>Depends on the reaction (see [this article](/resources.html))</td>
<td>Depends on the reaction (see <a href="/resources.html">this article</a>)</td>
</tr>
<tr>
<td><strong>Distance to input labs</strong></td>
Expand Down
2 changes: 1 addition & 1 deletion api/source/StructureSpawn.md
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ An object with additional options for the spawning process.
<li>
<div class="api-arg-title">dryRun</div>
<div class="api-arg-type">boolean</div>
<div class="api-arg-desc">If `dryRun` is true, the operation will only check if it is possible to create a creep.</div>
<div class="api-arg-desc">If <code>dryRun</code> is true, the operation will only check if it is possible to create a creep.</div>
</li>
<li>
<div class="api-arg-title">directions</div>
Expand Down
4 changes: 2 additions & 2 deletions source/auth-tokens.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Three HTTP header are set for informational purposes which you can use to handle
| Header Name | Description |
|-|-|
| `X-RateLimit-Limit` | The maximum number of requests you're permitted to make per limit window. |
| <nobr>`X-RateLimit-Remaining`</nobr> | The number of requests remaining in the current rate limit window. |
| <nobr><code>X-RateLimit-Remaining</code></nobr> | The number of requests remaining in the current rate limit window. |
| `X-RateLimit-Reset` | The time at which the current rate limit window resets in UTC epoch seconds. |

```
Expand Down Expand Up @@ -91,4 +91,4 @@ window.addEventListener('message', (event) => {

Please note that this page uses Google Invisible reCAPTCHA, so that it cannot be used automatically.

You can query info on a specific token (including its unlimited period timer) using the endpoint `https://screeps.com/api/auth/query-token?token=XXX`.
You can query info on a specific token (including its unlimited period timer) using the endpoint `https://screeps.com/api/auth/query-token?token=XXX`.
12 changes: 6 additions & 6 deletions source/invaders.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,18 @@ There are two sizes of invader creeps:
</tr>
<tr>
<td style="text-align: left;">Melee</td>
<td style="text-align: center;">![](img/smallMelee.png)</td>
<td style="text-align: center;">![](img/bigMelee.png)</td>
<td style="text-align: center;"><img src="img/smallMelee.png" alt=""></td>
<td style="text-align: center;"><img src="img/bigMelee.png" alt=""></td>
</tr>
<tr>
<td style="text-align: left;">Ranged</td>
<td style="text-align: center;">![](img/smallRanged.png)</td>
<td style="text-align: center;">![](img/bigRanged.png)</td>
<td style="text-align: center;"><img src="img/smallRanged.png" alt=""></td>
<td style="text-align: center;"><img src="img/bigRanged.png" alt=""></td>
</tr>
<tr>
<td style="text-align: left;">Healer</td>
<td style="text-align: center;">![](img/smallHealer.png)</td>
<td style="text-align: center;">![](img/bigHealer.png)</td>
<td style="text-align: center;"><img src="img/smallHealer.png" alt=""></td>
<td style="text-align: center;"><img src="img/bigHealer.png" alt=""></td>
</tr>
</tbody>
</table>
Expand Down
4 changes: 2 additions & 2 deletions source/ptr.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ The Public Test Realm is a stand-alone game server with its own world data, play

<div style="text-align: center">

<p><strong style="font-size: 20px; background: #eee; padding: 10px 40px;">[ENTER](https://screeps.com/ptr/)</strong></p>
<p><strong style="font-size: 20px; background: #eee; padding: 10px 40px;"><a href="https://screeps.com/ptr/" target="_blank" rel="external">ENTER</a></strong></p>

<p>[API Reference](http://docs-ptr.screeps.com/api/)</p>
<p><a href="http://docs-ptr.screeps.com/api/" target="_blank" rel="external">API Reference</a></p>
</div>

---
Expand Down
Loading