Get the total creep count (including spawning creeps) for a spawn request.
Get the creeps that are assigned to the spawn request. By default spawning creeps are excluded.
Check if a spawn request has at least one creep spawning or alive.
Process all spawn requests. Must be called in your code after spawn requests have been registered.
Register a spawn request. Requies a unique id, room to spawn from and a SpawnRequester object.
interface SpawnRequester {
shouldSpawn: () => boolean;
canSpawn: () => boolean;
generateSpawnRequest: () => SpawnRequest;
}
interface SpawnRequest {
body: string[];
memory?: any;
name?: string;
onSuccess?: (id: string, name: string) => void;
}
Sets the spawn timer to N ticks in the future Game.time + ticks
.
Sets the spawn timer to Game.time + (CREEP_LIFE_TIME / cycleModifier)
. (default 1)
Check the spawn timer to see if it has passed.
Generated using TypeDoc
Generate a body given a room to spawn from and a segment to repeat. By default it generate as big a creep as it can. Set
maxCost
andmaxSize
options to configure this.interface GenerateBodyOptions { maxCost?: number; maxSize?: number; moveShield?: boolean; // Place move parts at the front. additionalSegment?: string[]; // An additional not repeated segment. sortOrder?: { // Override the default sorting [partConstant: string]: number; other: number; }; }