forked from Garethp/ScreepsAutocomplete
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathStructure_Documentation.js
438 lines (389 loc) · 9.91 KB
/
Structure_Documentation.js
1
2
3
4
5
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
/**
* @class
* @constructor
* @extends {Structure}
*/
Structure_Controller = function() { };
Structure_Controller.prototype = {
/**
* Current controller level, from 0 to 8.
*
* @type {number}
*/
level: 0,
/**
* The current progress of upgrading the controller to the next level.
*
* @type {number}
*/
progress: 0,
/**
* The progress needed to reach the next level.
*
* @type {number}
*/
progressTotal: 0,
/**
* An object with the controller reservation info if present.
*
* @type {object}
*/
reservation: {
/**
* The name of a player who reserved this controller.
*
* @type {string}
*/
username: "",
/**
* The amount of game ticks when the reservation will end.
*
* @type {number}
*/
ticksToEnd: 0
},
/**
* The amount of game ticks when this controller will lose one level.
* This timer can be reset by using Creep.upgradeController.
*
* @type {number}
*/
ticksToDowngrade: 0,
/**
* Make your claimed controller neutral again.
*
* @return {number|OK|ERR_NOT_OWNER}
*/
unclaim: function() { }
};
/**
* @class
* @constructor
* @extends {Structure}
*/
Structure_Extension = function() { };
Structure_Extension.prototype =
{
/**
* The amount of energy containing in the extension.
*
* @type {number}
*/
energy: 0,
/**
* The total amount of energy the extension can contain.
*
* @type {number}
*/
energyCapacity: 0,
/**
* Transfer the energy from the extension to a creep.
*
* @param {Creep} target The creep object which energy should be transferred to.
* @param {number} [amount] The amount of energy to be transferred. If omitted, all the remaining amount of energy will be used.
*
* @return {number|OK|ERR_NOT_OWNER|ERR_NOT_ENOUGH_RESOURCES|ERR_INVALID_TARGET|ERR_FULL|ERR_NOT_IN_RANGE}
*/
transferEnergy: function(target, amount) { }
};
/**
* @class
* @constructor
* @extends {Structure}
*/
Structure_Keeper_Lair = function() { };
Structure_Keeper_Lair.prototype =
{
/**
* Time to spawning of the next Source Keeper.
*
* @type {number}
*/
ticksToSpawn: 0
};
/**
* @class
* @constructor
* @extends {Structure}
*/
Structure_Link = function() { };
Structure_Link.prototype =
{
/**
* The amount of game ticks the link has to wait until the next transfer is possible.
*
* @type {number}
*/
cooldown: 0,
/**
* The amount of energy containing in the link.
*
* @type {number}
*/
energy: 0,
/**
* The total amount of energy the link can contain.
*
* @type {number}
*/
energyCapacity: 0,
/**
* Transfer energy from the link to another link or a creep.
* If the target is a creep, it has to be at adjacent square to the link.
* If the target is a link, it can be at any location in the same room.
* Remote transfer process implies 3% energy loss and cooldown delay depending on the distance.
*
* @param {Creep|Structure|Structure_Link} target The target object.
* @param {number} [amount] The amount of energy to be transferred. If omitted, all the available energy is used.
*
* @return {number|OK|ERR_NOT_OWNER|ERR_NOT_ENOUGH_RESOURCES|ERR_INVALID_TARGET|ERR_FULL|ERR_NOT_IN_RANGE|ERR_INVALID_ARGS|ERR_TIRED|ERR_RCL_NOT_ENOUGH}
*/
transferEnergy: function(target, amount) { }
};
/**
* @class
* @constructor
* @extends {Structure}
*/
Structure_Observer = function() { };
Structure_Observer.prototype =
{
/**
* Provide visibility into a distant room from your script.
* The target room object will be available on the next tick. The maximum range is 5 rooms.
*
* @param {string} roomName The name of the target room.
*
* @return {number|OK|ERR_INVALID_ARGS|ERR_RCL_NOT_ENOUGH}
*/
observeRoom: function(roomName) { }
};
/**
* @class
* @constructor
* @extends {Structure}
*/
Structure_Power_Bank = function() { };
Structure_Power_Bank.prototype =
{
/**
* The amount of power containing.
*
* @type {number}
*/
power: 0,
/**
* The amount of game ticks when this structure will disappear.
*
* @type {number}
*/
ticksToDecay: 0
};
/**
* @class
* @constructor
* @extends {Structure}
*/
Structure_Power_Spawn = function() { };
Structure_Power_Spawn.prototype =
{
/**
* The amount of energy containing in this structure.
*
* @type {number}
*/
energy: 0,
/**
* The total amount of energy this structure can contain.
*
* @type {number}
*/
energyCapacity: 0,
/**
* The amount of power containing in this structure.
*
* @type {number}
*/
power: 0,
/**
* The total amount of power this structure can contain.
*
* @type {number}
*/
powerCapacity: 0,
/**
* Create a power creep.
*
* @note This method is under development.
*
* @param {string} name The name of the power creep.
*/
createPowerCreep: function(name) { },
/**
* Register power resource units into your account.
* Registered power allows to develop power creeps skills.
* Consumes 1 power resource unit and 50 energy resource units.
*
* @return {number|OK|ERR_NOT_ENOUGH_RESOURCES|ERR_RCL_NOT_ENOUGH}
*/
processPower: function() { },
/**
* Transfer the energy from this structure to a creep.
*
* @param {Creep} target The creep object which energy should be transferred to.
* @param {number} [amount] The amount of energy to be transferred. If omitted, all the remaining amount of energy will be used.
*
* @return {number|OK|ERR_NOT_OWNER|ERR_NOT_ENOUGH_RESOURCES|ERR_INVALID_TARGET|ERR_FULL|ERR_NOT_IN_RANGE}
*/
transferEnergy: function(target, amount) { }
};
/**
* @class
* @constructor
* @extends {Structure}
*/
Structure_Rampart = function() { };
Structure_Rampart.prototype =
{
/**
* The amount of game ticks when this rampart will lose some hit points.
*
* @type {number}
*/
ticksToDecay: 0
};
/**
* @class
* @constructor
* @extends {Structure}
*/
Structure_Road = function() { };
Structure_Road.prototype =
{
/**
* The amount of game ticks when this road will lose some hit points.
*
* @type {number}
*/
ticksToDecay: 0
};
/**
* @class
* @constructor
* @extends {Structure}
*/
Structure_Storage = function() { };
Structure_Storage.prototype =
{
/**
* An object with the storage contents.
*
* @type {object}
*/
store: {
/**
* The amount of energy resource units.
*
* @type {number}
*/
energy: 0,
/**
* The amount of power resource units if present, undefined otherwise.
*
* @type {number|undefined}
*/
power: 0
},
/**
* The total amount of resources the storage can contain.
*
* @type {number}
*/
storeCapacity: 0,
/**
* Transfer resource from this storage to a creep. The target has to be at adjacent square.
*
* @param {Creep} target The target object.
* @param {string} resourceType One of the RESOURCE_* constants.
* @param {number} [amount] The amount of resources to be transferred. If omitted, all the available amount is used.
*
* @return {number|OK|ERR_NOT_OWNER|ERR_NOT_ENOUGH_RESOURCES|ERR_INVALID_TARGET|ERR_FULL|ERR_NOT_IN_RANGE|ERR_INVALID_ARGS}
*/
transfer: function(target, resourceType, amount) { },
/**
* An alias for storage.transfer(target, RESOURCE_ENERGY, amount).
* @deprecated
*
* @param {Creep} target The target object.
* @param {number} [amount] The amount of resources to be transferred. If omitted, all the available amount is used.
*/
transferEnergy: function(target, amount) { }
};
/**
* @class
* @constructor
* @extends {Structure}
*/
Structure_Tower = function() { };
Structure_Tower.prototype =
{
/**
* The amount of energy containing in this structure.
*
* @type {number}
*/
energy: 0,
/**
* The total amount of energy this structure can contain.
*
* @type {number}
*/
energyCapacity: 0,
/**
* Remotely attack any creep in the room.
* Consumes 10 energy units per tick.
* Attack power depends on the distance to the target: from 600 hits at range 10 to 300 hits at range 40.
*
* @param {Creep} target The target creep.
*
* @return {number|OK|ERR_NOT_ENOUGH_RESOURCES|ERR_INVALID_TARGET|ERR_RCL_NOT_ENOUGH}
*/
attack: function(target) { },
/**
* Remotely heal any creep in the room.
* Consumes 10 energy units per tick.
* Heal power depends on the distance to the target: from 400 hits at range 10 to 200 hits at range 40.
*
* @param {Creep} target The target creep.
*
* @return {number|OK|ERR_NOT_ENOUGH_RESOURCES|ERR_INVALID_TARGET|ERR_RCL_NOT_ENOUGH}
*/
heal: function(target) { },
/**
* Remotely repair any structure in the room.
* Consumes 10 energy units per tick.
* Repair power depends on the distance to the target: from 600 hits at range 10 to 300 hits at range 40.
*
* @param {Spawn|Structure} target The target structure.
*
* @return {number|OK|ERR_NOT_ENOUGH_RESOURCES|ERR_INVALID_TARGET|ERR_RCL_NOT_ENOUGH}
*/
repair: function(target) { }
};
/**
* @class
* @constructor
* @extends {Structure}
*/
Structure_Wall = function() { };
Structure_Wall.prototype =
{
/**
* The amount of game ticks when the wall will disappear
*
* @note only for automatically placed border walls at the start of the game.
*
* @type {number}
*/
ticksToLive: 0
};