Expand description
Constants, most copied from the game constants.
Last updated on 2020-12-13, at commit
e4589666113334bb1f967b9a5540b642141b6dab
.
Currently missing:
- OBSTACLE_OBJECT_TYPES
- WORLD_WIDTH / WORLD_HEIGHT (deprecated in Screeps)
- POWER_INFO
Re-exports§
pub use self::find::FindConstant;
pub use self::look::LookConstant;
pub use self::extra::*;
Modules§
- control
- Re-export of all constants related to
StructureController
behavior and GCL. - creep
- Re-export of all constants related to
Creep
behavior and operations. - extra
- Additional constants representing internal game mechanics that aren’t included in the game’s constants
- find
- Constants for use with the
Room::find
function. - flags
- Re-export of all constants related to
Flag
s. - look
- Constants for use with
Room::look_for_at
and related functions. - market
- Re-export of all constants related to the market.
- minerals
- Re-export of all constants related to
Mineral
behavior andStructureLab
operations. - nuke
- Re-export of all constants related to
StructureNuker
andNuke
. - observer
- Re-export of all constants related to
StructureObserver
operations. - portal
- Re-export of all constants related to
StructurePortal
behavior. - power
- Re-export of all constants related to power.
- resource
- Re-export of all constants related to
Resource
s. - seasonal
- Constants that are unique to object types or mechanics found in Screeps seasonal.
- source
- Re-export of all constants related to
Source
behavior. - spawn
- Re-export of all constants related to
StructureSpawn
operations. - structure
- Re-export of all constants related to structures.
- tombstone
- Re-export of all constants related to
Tombstone
s. - tower
- Re-export of all constants related to
StructureTower
operations.
Structs§
- Factory
Recipe - Returned values from
ResourceType::commodity_recipe
representing a commodity that can be produced in factories. - Invalid
Constant String
Enums§
- Boost
- Returned values from
ResourceType::boost
representing the effect of boosting a creep with the given resource. - Color
- Translates
COLOR_*
andCOLORS_ALL
constants. - Density
- Translates the
DENSITY_*
constants. - Direction
- Translates direction constants.
- Effect
Type - Translates effect types on room objects, which can include both
PWR_*
andEFFECT_*
constants. - Error
Code - Translates non-OK return codes.
- Exit
Direction - Type used for when the game returns a direction to an exit.
- Intershard
Resource Type - Translates
SUBSCRIPTION_TOKEN
andINTERSHARD_RESOURCES
constants. - Market
Resource Type - Translates all resource types that can be used on the market.
- Natural
Effect Type - Translates the
EFFECT_*
constants, which are natural effect types - Order
Type - Translates
ORDER_*
constants. - Part
- Translates body part type and
BODYPARTS_ALL
constants - Power
Creep Class - Translates the
POWER_CLASS
constants, which are classes of power creeps - Power
Type - Translates the
PWR_*
constants, which are types of powers used by power creeps - Resource
Type - Translates the values of the
RESOURCES_ALL
constant, representing all possible in-game (non-intershard) resources. - Structure
Type - Translates
STRUCTURE_*
constants. - Terrain
- Translates
TERRAIN_*
constants.
Constants§
- ATTACK_
POWER - Hits of damage per effective attack part per
Creep::attack
action. - BUILD_
POWER - Construction site progress added per effective work part per
Creep::build
action. - CARRY_
CAPACITY - Store capacity provided per effective carry part.
- CONSTRUCTION_
COST_ ROAD_ SWAMP_ RATIO - Build, decay, and hits multiplier for roads built on swamp tiles.
- CONSTRUCTION_
COST_ ROAD_ WALL_ RATIO - Build, decay, and hits multiplier for roads built on natural wall tiles (tunnels)
- CONTAINER_
CAPACITY - Store capacity of container structures.
- CONTAINER_
DECAY - Hits lost on the container per decay.
- CONTAINER_
DECAY_ TIME - Ticks between hit loss due to decay in unowned rooms.
- CONTAINER_
DECAY_ TIME_ OWNED - Ticks between hit loss due to decay in owned rooms.
- CONTAINER_
HITS - Initial hits for container structures; consider using the
StructureType::initial_hits
function. - CONTROLLER_
ATTACK_ BLOCKED_ UPGRADE - A controller cannot be attacked or upgraded for this number of ticks after
one or more creeps successfully uses
Creep::attack_controller
against it. - CONTROLLER_
CLAIM_ DOWNGRADE - Additional decay of the
StructureController::ticks_to_downgrade
timer caused by each claim part used perCreep::attack_controller
action. - CONTROLLER_
DOWNGRADE_ RESTORE - Ticks added to a
StructureController::ticks_to_downgrade
timer on each tick that at least one creep successfully usedCreep::upgrade_controller
. - CONTROLLER_
DOWNGRADE_ SAFEMODE_ THRESHOLD - Ticks under 50% of
controller_downgrade
max that safe mode becomes unavailable. - CONTROLLER_
MAX_ UPGRADE_ PER_ TICK - Maxiumum energy per tick that can be spent on
Creep::upgrade_controller
at room control level 8 without power creep effects or boosts. - CONTROLLER_
NUKE_ BLOCKED_ UPGRADE - Ticks a controller cannot be attacked or upgraded for after a nuke detonation in the room.
- CONTROLLER_
RESERVE - Reservation ticks added per claim part per
Creep::reserve_controller
action. - CONTROLLER_
RESERVE_ MAX - Maximum ticks of reservation allowed on a controller
- CREEP_
CLAIM_ LIFE_ TIME - Initial ticks_to_live of a creep with at least one claim part.
- CREEP_
CORPSE_ RATE - Percentage of TTL-adjusted creep resource costs added to tombstone.
- CREEP_
LIFE_ TIME - Initial ticks_to_live of a creep without any claim parts.
- CREEP_
PART_ MAX_ ENERGY - The upper limit of energy per body part considered for return in tombstones
- CREEP_
SPAWN_ TIME - Ticks taken to spawn each creep body part, before power creep effects.
- DEPOSIT_
DECAY_ TIME - Time since last harvest that a deposit will decay.
- DEPOSIT_
EXHAUST_ MULTIPLY - Multiplier for deposit cooldown determination.
- DEPOSIT_
EXHAUST_ POW - Exponential growth rate for deposit cooldown determination.
- DISMANTLE_
COST - Amount in energy returned to the dismantling creep per hit dismantled.
- DISMANTLE_
POWER - Hits removed per effective work part per
Creep::dismantle
action. - ENERGY_
DECAY - The total amount of a resource that must be accumulated in a dropped
Resource
for one unit of that resource to decay each tick, rounded up. - ENERGY_
REGEN_ TIME - Ticks to source regen after first
Creep::harvest
since last regen. - EXTENSION_
HITS - Initial hits for extension structures; consider using the
StructureType::initial_hits
function. - EXTRACTOR_
COOLDOWN - Ticks of cooldown for the extractor timer after tick that at least one creep
successfully used
Creep::harvest
. - EXTRACTOR_
HITS - Initial hits for extractor structures; consider using the
StructureType::initial_hits
function. - FACTORY_
CAPACITY - Store capacity of factory structures.
- FACTORY_
HITS - Initial hits for factory structures; consider using the
StructureType::initial_hits
function. - FLAGS_
LIMIT - Maximum number of total flags a player is allowed to have on a shard.
- GCL_
MULTIPLY - Base growth rate of control points needed per global control level (GCL).
- GCL_
NOVICE - Maximum GCL for players allowed to spawn in a Novice area.
- GCL_POW
- Exponential growth rate of control points needed per global control level (GCL).
- HARVEST_
DEPOSIT_ POWER - Amount harvested from a deposit per effective work part per
Creep::harvest
action. - HARVEST_
MINERAL_ POWER - Amount harvested from a mineral per effective work part per
Creep::harvest
action. - HARVEST_
POWER - Energy harvested from a source per effective work part per
Creep::harvest
action. - HEAL_
POWER - Hits of damage healed per effective heal part per
Creep::heal
action. - INVADERS_
ENERGY_ GOAL - Base value for calculating the energy harvest amount that will trigger invader spawns.
- INVADER_
CORE_ CONTROLLER_ DOWNGRADE - Duration of stronghold ‘deployment’, during which they are invulnerable.
- INVADER_
CORE_ CONTROLLER_ POWER - The reservation points added or removed per tick by invader cores.
- INVADER_
CORE_ HITS - Initial hits for invader cores; consider using the
StructureType::initial_hits
function. - LAB_
BOOST_ ENERGY - Cost in energy to boost each creep body part.
- LAB_
BOOST_ MINERAL - Cost in boost minerals to boost each creep body part.
- LAB_
ENERGY_ CAPACITY - Store capacity for energy in lab structures.
- LAB_
HITS - Initial hits for lab structures; consider using the
StructureType::initial_hits
function. - LAB_
MINERAL_ CAPACITY - Store capacity for minerals in lab structures.
- LAB_
REACTION_ AMOUNT - Amount of compounds consumed and produced per reaction, before power creep effects.
- LAB_
UNBOOST_ ENERGY - Energy refunded by
StructureLab::unboost_creep
per creep body part (none). - LAB_
UNBOOST_ MINERAL - Minerals spent on boosts refunded by
StructureLab::unboost_creep
per creep body part. - LINK_
CAPACITY - Energy capacity of link structures.
- LINK_
COOLDOWN - Ticks of link cooldown after transferring energy per distance to destination.
- LINK_
HITS - Initial hits for link structures; consider using the
StructureType::initial_hits
function. - LINK_
LOSS_ RATIO - Percentage of the energy that is lost when transferred by
StructureLink::transfer_energy
. - MARKET_
FEE - Percentage of order value in credits charged as a fee for market listings.
- MARKET_
MAX_ ORDERS - Maximum number of total orders a player is allowed to have on the market.
- MARKET_
ORDER_ LIFE_ TIME - Time, in milliseconds, after which a market order will expire (30 days).
- MAX_
CONSTRUCTION_ SITES - Maximum allowed construction sites at once per player.
- MAX_
CREEP_ SIZE - Maximum body parts per creep.
- MINERAL_
DENSITY_ CHANGE - Percentage chance to randomly determine a new density when currently moderate or high density (a new density is always chosen when low or ultra).
- MINERAL_
RANDOM_ FACTOR - Currently unused in game (see
Density::probability
instead). - MINERAL_
REGEN_ TIME - Ticks after depletion for minerals to regenerate.
- NUKER_
COOLDOWN - Cooldown for nuker structers after firing.
- NUKER_
ENERGY_ CAPACITY - Energy capacity of the nuker, which is spent to fire a nuke.
- NUKER_
GHODIUM_ CAPACITY - Ghodium capacity of the nuker, which is spent to fire a nuke.
- NUKER_
HITS - Initial hits for nuker structures; consider using the
StructureType::initial_hits
function. - NUKE_
DAMAGE_ RANGE_ 0 - Damage in hits done by nukes at the point of impact.
- NUKE_
DAMAGE_ RANGE_ 2 - Damage in hits done by nukes within range 2.
- NUKE_
LAND_ TIME - Tick until impact after firing a nuke.
- NUKE_
RANGE - Range in rooms of nukers.
- OBSERVER_
HITS - Initial hits for observer structures; consider using the
StructureType::initial_hits
function. - OBSERVER_
RANGE - Maximum range in rooms for
StructureObserver::observe_room
. - PIXEL_
CPU_ COST - Cost, paid from
CpuInfo::bucket
, to generate a pixel usingCpuInfo::generate_pixel
- PORTAL_
DECAY - Ticks that a portal that has reached the end of its stable lifetime will remain before decaying.
- PORTAL_
MAX_ TIMEOUT - Maximum time after a portal decays in a center room that a new portal will appear, in milliseconds.
- PORTAL_
MIN_ TIMEOUT - Minimum time after a portal decays in a center room that a new portal will appear, in milliseconds.
- PORTAL_
UNSTABLE - The amount of time after spawning, in milliseconds, that random center room
portals will become unstable and begin to decay, disappearing
PORTAL_DECAY
ticks later. - POWER_
BANK_ CAPACITY_ CRIT - Chance of adding an additional
POWER_BANK_CAPACITY_MAX
to the random power amount calculated when spawning a power bank. (source) - POWER_
BANK_ CAPACITY_ MAX - Maximum power capacity for power banks, before accounting for
POWER_BANK_CAPACITY_CRIT
. - POWER_
BANK_ CAPACITY_ MIN - Maximum power capacity for power banks.
- POWER_
BANK_ DECAY - Ticks for a power bank to decay if not destroyed.
- POWER_
BANK_ HITS - Initial hits for power bank structures; consider using the
StructureType::initial_hits
function. - POWER_
BANK_ HIT_ BACK - Percentage of damage dealt to power banks that is dealt back to attacking creeps.
- POWER_
BANK_ RESPAWN_ TIME - Base value for power bank respawn time calculation.
- POWER_
CREEP_ DELETE_ COOLDOWN - Time, in milliseconds, after a deletion is started via
AccountPowerCreep::delete
that it can no longer be canceled. - POWER_
CREEP_ LIFE_ TIME - Maximum ticks to live for power creeps
- POWER_
CREEP_ MAX_ LEVEL - Maximum level for power creeps.
- POWER_
CREEP_ SPAWN_ COOLDOWN - Time, in milliseconds, that a power creep must wait to respawn after dying.
- POWER_
LEVEL_ MULTIPLY - Base growth rate of processed power needed per global power level (GPL).
- POWER_
LEVEL_ POW - Exponential growth rate of processed power needed per global power level (GPL).
- POWER_
SPAWN_ ENERGY_ CAPACITY - Maximum energy capacity for a power spawn to use in
StructurePowerSpawn::process_power
. - POWER_
SPAWN_ ENERGY_ RATIO - Energy consumed per point of power processed by
StructurePowerSpawn::process_power
. - POWER_
SPAWN_ HITS - Initial hits for power spawn structures; consider using the
StructureType::initial_hits
function. - POWER_
SPAWN_ POWER_ CAPACITY - Maximum power capacity for a power spawn to use in
StructurePowerSpawn::process_power
. - RAMPART_
DECAY_ AMOUNT - Hits lost per decay period for ramparts
- RAMPART_
DECAY_ TIME - Ticks between rampart decays, losing
RAMPART_DECAY_AMOUNT
hits. - RAMPART_
HITS - Initial hits for rampart structures when built; consider using the
StructureType::initial_hits
function. - RAMPART_
HITS_ MAX_ RCL2 - Max rampart hits at RCL 2; consider using the
rampart_hits_max
function. - RAMPART_
HITS_ MAX_ RCL3 - Max rampart hits at RCL 3; consider using the
rampart_hits_max
function. - RAMPART_
HITS_ MAX_ RCL4 - Max rampart hits at RCL 4; consider using the
rampart_hits_max
function. - RAMPART_
HITS_ MAX_ RCL5 - Max rampart hits at RCL 5; consider using the
rampart_hits_max
function. - RAMPART_
HITS_ MAX_ RCL6 - Max rampart hits at RCL 6; consider using the
rampart_hits_max
function. - RAMPART_
HITS_ MAX_ RCL7 - Max rampart hits at RCL 7; consider using the
rampart_hits_max
function. - RAMPART_
HITS_ MAX_ RCL8 - Max rampart hits at RCL 8; consider using the
rampart_hits_max
function. - RANGED_
ATTACK_ POWER - Hits of damage per effective ranged attack part per
Creep::ranged_attack
action. - RANGED_
HEAL_ POWER - Hits of damage healed per effective heal part per
Creep::ranged_heal
action. - REPAIR_
COST - Cost in energy for each hit repaired by creeps before boosts.
- REPAIR_
POWER - Hits repaired per effective work part per
Creep::repair
action. - RESOURCES_
ALL - A collection of all resource types. This is a direct translation of the
RESOURCES_ALL
constant in game using the rustResourceType
enum. - ROAD_
DECAY_ AMOUNT - Hits lost upon decay for roads, before swamp/tunnel multipliers
- ROAD_
DECAY_ TIME - Ticks between road decay events without traffic
- ROAD_
HITS - Maximum hits for road structures, before swamp/tunnel multipliers
- ROAD_
WEAROUT - Tick penalty to a road’s decay, per creep body part, when a creep steps on it.
- ROAD_
WEAROUT_ POWER_ CREEP - Tick penalty to a road’s decay when a power creep steps on it.
- RUIN_
DECAY - Ticks that ruins will last when structures are destroyed.
- SAFE_
MODE_ COOLDOWN - Ticks since last safe mode activation before another is allowed.
- SAFE_
MODE_ COST - Cost in
Ghodium
to add a safe mode activation to a controller viaCreep::generate_safe_mode
- SAFE_
MODE_ DURATION - Duration of safe mode once activated, in ticks.
- SIGN_
PLANNED_ AREA - Text added to signs of unowned rooms when a novice or respawn area is planned for the sector.
- SOURCE_
ENERGY_ CAPACITY - Source energy capacity immediately after regeneration in owned and reserved rooms.
- SOURCE_
ENERGY_ KEEPER_ CAPACITY - Source energy capacity immediately after regeneration in source keeper (sector center) rooms.
- SOURCE_
ENERGY_ NEUTRAL_ CAPACITY - Source energy capacity immediately after regeneration in neutral rooms.
- SPAWN_
ENERGY_ CAPACITY - Maximum energy capacity of spawn structures.
- SPAWN_
ENERGY_ START - Initial energy for spawn structures when built.
- SPAWN_
HITS - Initial hits for spawn structures; consider using the
StructureType::initial_hits
function. - SPAWN_
RENEW_ RATIO - Additional TTL bonus, and reduction in energy cost, when renewing a creep compared to spawning.
- STORAGE_
CAPACITY - Store capacity for storage structures without power creep effects.
- STORAGE_
HITS - Initial hits for storage structures; consider using the
StructureType::initial_hits
function. - STRONGHOLD_
DECAY_ TICKS - Average ticks until collapse for a stronghold.
- SYSTEM_
USERNAME - Owner username of system-owned structures and creeps.
- TERMINAL_
CAPACITY - Store capacity of terminal structures.
- TERMINAL_
COOLDOWN - Cooldown after a terminal is used before it can be used again.
- TERMINAL_
HITS - Initial hits for terminal structures; consider using the
StructureType::initial_hits
function. - TERMINAL_
MIN_ SEND - Currently unused in game.
- TERMINAL_
SEND_ COST - Currently unused in game (see
market::calc_transaction_cost
andTERMINAL_SEND_COST_SCALE
instead). - TOMBSTONE_
DECAY_ PER_ PART - Ticks per body part in total creep size that a creep’s tombstone will remain before decaying.
- TOMBSTONE_
DECAY_ POWER_ CREEP - Ticks that a power creep’s tombstone will remain.
- TOWER_
CAPACITY - Energy capacity of tower structures.
- TOWER_
ENERGY_ COST - Energy cost of each tower action.
- TOWER_
FALLOFF - Maximum percentage reduction in healing, repair, and attack effectiveness for towers due to range.
- TOWER_
FALLOFF_ RANGE - Tower actions at a range greater than or equal to this distance suffer the
maxium falloff penalties - see
TOWER_FALLOFF
. - TOWER_
HITS - Initial hits for tower structures; consider using the
StructureType::initial_hits
function. - TOWER_
OPTIMAL_ RANGE - Tower actions at a range beyond this distance suffer falloff penalties - see
TOWER_FALLOFF
. - TOWER_
POWER_ ATTACK - Tower damage per
StructureTower::attack
before range reduction. - TOWER_
POWER_ HEAL - Hits healed per
StructureTower::heal
before range reduction. - TOWER_
POWER_ REPAIR - Hits healed per
StructureTower::repair
before range reduction. - UPGRADE_
CONTROLLER_ POWER - Control points added per effective work part per
Creep::upgrade_controller
action. - WALL_
HITS - Initial hits for wall structures when built; consider using the
StructureType::initial_hits
function. - WALL_
HITS_ MAX - Maximum hits for wall structures.
Functions§
- controller_
downgrade - Translates the
CONTROLLER_DOWNGRADE
constant, the maximum value ofStructureController::ticks_to_downgrade
for each controller level. - controller_
levels - Translates the
CONTROLLER_LEVELS
constant. - extension_
energy_ capacity - Translates the
EXTENSION_ENERGY_CAPACITY
constant, the energy capacity of each source structure at a given room control level. - invader_
core_ creep_ spawn_ time - Ticks per body part that invader cores of each level take to spawn defensive creeps.
- invader_
core_ expand_ time - Ticks between creation of invader cores in rooms in the sector for each level of stronghold.
- mineral_
min_ amount - Translates the
MINERAL_MIN_AMOUNT
constant; currently unused in game (seeDensity::amount
instead). - rampart_
hits_ max - Translates the
RAMPART_HITS_MAX
constant, the maximum rampart hits for a given room control level. - ruin_
decay_ structures - Structures with special rules for their ruins’ ticks to live, currently only power banks.
- stronghold_
rampart_ hits - Rampart hits for each level of stronghold.