StructureController

Claim this structure to take control over the room. The controller structure cannot be damaged or destroyed.

It can be addressed by Room.controller property.

Level Upgrade to next level Downgrade timer
1 200 energy 20,000 ticks
2 45,000 energy 10,000 ticks
3 135,000 energy 20,000 ticks
4 405,000 energy 40,000 ticks
5 1,215,000 energy 80,000 ticks
6 3,645,000 energy 120,000 ticks
7 10,935,000 energy 150,000 ticks
8 200,000 ticks

Safe mode

Effect Blocks attack , rangedAttack , rangedMassAttack , dismantle , heal , rangedHeal , attackController , and withdraw methods of all hostile creeps in the room, plus enableRoom and usePower methods of hostile Power Creeps. Only one room can be in safe mode at the same time.
When safe mode is active, all hostile creeps become visually transparent and passable - your creeps can move through them freely (but not vice versa).
Duration 20,000 ticks
Cooldown 50,000 ticks (no cooldown in Novice Areas, also no cooldown for initial Safe Mode in your first room)
Generation
  • Each new controller level generates one available activation
  • Can be generated by creeps using 1,000 ghodium
  • All available activations are reset if the controller is downgraded

effects array

Applied effects, an array of objects with the following properties:

parameter type description
effect number

Effect ID of the applied effect. Can be either natural effect ID or Power ID.

level
optional
number

Power level of the applied effect. Absent if the effect is not a Power effect.

ticksRemaining number

How many ticks will the effect last.

Inherited from RoomObject
pos RoomPosition

An object representing the position of this object in the room.

Inherited from RoomObject
room Room

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.

Inherited from Structure
hits number

The current amount of hit points of the structure.

Inherited from Structure
hitsMax number

The total amount of hit points of the structure.

Inherited from Structure
id string

A unique object identificator. You can use Game.getObjectById method to retrieve an object instance by its id .

Inherited from Structure
structureType string

One of the STRUCTURE_* constants.

Inherited from Structure
destroy ()

Destroy this structure immediately.

Return value

One of the following codes:
constant value description
OK 0

The operation has been scheduled successfully.

ERR_NOT_OWNER -1

You are not the owner of this structure.

ERR_BUSY -4

Hostile creeps are in the room.

Inherited from Structure
isActive ()

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.

Return value

A boolean value.

Inherited from Structure
notifyWhenAttacked (enabled)

Toggle auto notification when the structure is under attack. The notification will be sent to your account email. Turned on by default.

parameter type description
enabled boolean

Whether to enable notification or disable.

Return value

One of the following codes:
constant value description
OK 0

The operation has been scheduled successfully.

ERR_NOT_OWNER -1

You are not the owner of this structure.

ERR_INVALID_ARGS -10

enable argument is not a boolean value.

Inherited from OwnedStructure
my boolean

Whether this is your own structure.

Inherited from OwnedStructure
owner object

An object with the structure’s owner info containing the following properties:

parameter type description
username string

The name of the owner user.

isPowerEnabled boolean

Whether using power is enabled in this room. Use PowerCreep.enableRoom to turn powers on.

level number

Current controller level, from 0 to 8.

progress number

The current progress of upgrading the controller to the next level.

progressTotal number

The progress needed to reach the next level.

reservation object

An object with the controller reservation info if present:

parameter type description
username string

The name of a player who reserved this controller.

ticksToEnd number

The amount of game ticks when the reservation will end.

safeMode number

How many ticks of safe mode remaining, or undefined.

safeModeAvailable number

Safe mode activations available to use.

safeModeCooldown number

During this period in ticks new safe mode activations will be blocked, undefined if cooldown is inactive.

sign object

An object with the controller sign info if present:

parameter type description
username string

The name of a player who signed this controller.

text string

The sign text.

time number

The sign time in game ticks.

datetime Date

The sign real date.

ticksToDowngrade number

The amount of game ticks when this controller will lose one level. This timer is set to 50% on level upgrade or downgrade, and it can be increased by using Creep.upgradeController . Must be full to upgrade the controller to the next level.

upgradeBlocked number

The amount of game ticks while this controller cannot be upgraded due to attack. Safe mode is also unavailable during this period.

activateSafeMode ()

room.controller.activateSafeMode();

Activate safe mode if available.

Return value

One of the following codes:
constant value description
OK 0

The operation has been scheduled successfully.

ERR_NOT_OWNER -1

You are not the owner of this controller.

ERR_BUSY -4

There is another room in safe mode already.

ERR_NOT_ENOUGH_RESOURCES -6

There is no safe mode activations available.

ERR_TIRED -11

The previous safe mode is still cooling down, or the controller is upgradeBlocked , or the controller is downgraded for 50% plus 5000 ticks or more.

unclaim ()

room.controller.unclaim();

Make your claimed controller neutral again.

Return value

One of the following codes:
constant value description
OK 0

The operation has been scheduled successfully.

ERR_NOT_OWNER -1

You are not the owner of this controller.