-
Notifications
You must be signed in to change notification settings - Fork 217
/
Copy pathpw_structuredefs.lua
584 lines (443 loc) · 16.8 KB
/
pw_structuredefs.lua
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
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
local STRUCTURE_COST_MULT = 4 -- Base cost matches planetwars metagame cost.
local fakeWeapondef = {
name = [[Bogus Fake Targeter]],
avoidGround = false, -- avoid nothing, else attempts to move out to clear line of fine
avoidFriendly = false,
avoidFeature = false,
avoidNeutral = false,
damage = {
default = 11.34,
subs = 0.567,
},
explosionGenerator = [[custom:FLASHPLOSION]],
noSelfDamage = true,
range = 300,
reloadtime = 1,
tolerance = 5000,
turret = true,
weaponType = [[StarburstLauncher]],
weaponVelocity = 500,
}
local fakeWeapons = {
{
def = "BOGUS_FAKE_TARGETER",
badtargetcategory = "FIXEDWING",
onlytargetcategory = "FIXEDWING LAND SINK TURRET SHIP SWIM FLOAT GUNSHIP HOVER",
},
}
local structureConfig = {
generic_tech = function(unitDef)
unitDef.maxdamage = 10000
unitDef.objectname = "pw_techlab.dae"
unitDef.script = "pw_techlab.lua"
unitDef.footprintx = 8
unitDef.footprintz = 9
unitDef.buildpic = "pw_generic.png"
unitDef.customparams.soundselect = "radar_select"
unitDef.customparams.statsname = "generic_tech"
end,
pw_artefact = function(unitDef)
unitDef.maxdamage = 50000
unitDef.name = "Ancient Artefact"
unitDef.description = "Mysterious Relic"
unitDef.objectname = "pw_artefact.dae"
unitDef.script = "pw_artefact.lua"
unitDef.icontype = [[pw_special]]
unitDef.footprintx = 4
unitDef.footprintz = 4
unitDef.buildcostmetal = 600*STRUCTURE_COST_MULT
unitDef.customparams.soundselect = "cloaker_select"
unitDef.collisionvolumescales = [[60 70 60]]
unitDef.collisionvolumetype = [[CylY]]
unitDef.featuredefs.dead.object = "pw_artefact_dead.dae"
end,
pw_dropfac = function(unitDef)
unitDef.maxdamage = 25000
unitDef.name = "Dropship Factory"
unitDef.description = "Produces dropships"
unitDef.objectname = "pw_dropfac.dae"
unitDef.icontype = [[pw_dropfac]]
unitDef.script = "pw_dropfac.lua"
unitDef.footprintx = 20
unitDef.footprintz = 16
unitDef.buildcostmetal = 400*STRUCTURE_COST_MULT
unitDef.customparams.soundselect = "building_select1"
unitDef.collisionvolumescales = [[275 120 215]]
-- builder-related stuff
unitDef.showNanoSpray = false
unitDef.builder = true
unitDef.canmove = true
unitDef.canattack = true
unitDef.workertime = 10
unitDef.buildoptions = { [[gunshiptrans]], [[gunshipheavytrans]] }
unitDef.customparams.nongroundfac = [[1]]
unitDef.customparams.landflystate = [[0]]
unitDef.yardmap = string.rep("o", unitDef.footprintx * unitDef.footprintz)
unitDef.featuredefs.dead.object = "pw_dropfac_dead.dae"
unitDef.featuredefs.heap.object = "debris8x8b.s3o"
end,
pw_bomberfac = function(unitDef)
unitDef.maxdamage = 20000
unitDef.name = "Bomber Factory"
unitDef.description = "Produces bombers"
unitDef.objectname = "pw_dropdepot.dae"
unitDef.script = "pw_bomberfac.lua"
unitDef.icontype = [[pw_bomberfac]]
unitDef.waterline = 30
unitDef.footprintx = 16
unitDef.footprintz = 11
unitDef.buildcostmetal = 400*STRUCTURE_COST_MULT
unitDef.customparams.soundselect = "building_select1"
unitDef.collisionvolumescales = [[240 160 120]]
unitDef.collisionvolumeoffsets = [[0 -10 0]]
-- builder-related stuff
unitDef.showNanoSpray = false
unitDef.builder = true
unitDef.canmove = true
unitDef.canattack = true
unitDef.workertime = 10
unitDef.buildoptions = { [[bomberprec]], [[bomberriot]], [[bomberdisarm]], [[bomberheavy]] }
unitDef.customparams.nongroundfac = [[1]]
unitDef.customparams.landflystate = [[0]]
unitDef.yardmap = string.rep("o", unitDef.footprintx * unitDef.footprintz)
unitDef.buildpic = "pw_dropdepot.png"
unitDef.featuredefs.dead.object = "pw_dropdepot_dead.dae"
unitDef.featuredefs.heap.object = "debris8x8b.s3o"
end,
pw_mine = function(unitDef)
unitDef.maxdamage = 10000
unitDef.name = "Power Generator Unit"
unitDef.description = "Produces 50 energy/turn"
unitDef.objectname = "pw_mine2.dae"
unitDef.script = "pw_mine2.lua"
unitDef.icontype = [[pw_energy]]
unitDef.customparams = unitDef.customparams or {}
unitDef.customparams.pylonrange = 300
unitDef.customparams.removewait = 1
unitDef.energymake = 4
unitDef.footprintx = 7
unitDef.footprintz = 7
unitDef.buildcostmetal = 100*STRUCTURE_COST_MULT
unitDef.collisionvolumescales = [[90 125 90]]
unitDef.customparams.soundselect = "building_select2"
unitDef.featuredefs.dead.object = "pw_mine2_dead.dae"
end,
pw_mine2 = function(unitDef)
unitDef.maxdamage = 16000
unitDef.name = "Orbital Solar Array"
unitDef.description = "Produces 100 energy/turn"
unitDef.objectname = "pw_mine.dae"
unitDef.script = "pw_mine.lua"
unitDef.customparams = unitDef.customparams or {}
unitDef.customparams.pylonrange = 400
unitDef.customparams.removewait = 1
unitDef.energymake = 6
unitDef.footprintx = 4
unitDef.footprintz = 4
unitDef.buildcostmetal = 275*STRUCTURE_COST_MULT
unitDef.collisionvolumescales = [[56 120 56]]
unitDef.collisionvolumetype = [[CylY]]
unitDef.collisionvolumeoffsets = [[0 10 0]]
unitDef.customparams.soundselect = "building_select2"
unitDef.featuredefs.dead.object = "pw_mine_dead.dae"
unitDef.featuredefs.heap.object = "debris4x4b.s3o"
end,
pw_mine3 = function(unitDef)
unitDef.maxdamage = 24000
unitDef.name = "Planetary Geothermal Tap"
unitDef.description = "Produces 250 energy/turn"
unitDef.objectname = "pw_mine3.dae"
unitDef.script = "pw_mine3.lua"
unitDef.icontype = [[pw_energy2]]
unitDef.customparams = unitDef.customparams or {}
unitDef.customparams.pylonrange = 500
unitDef.customparams.removewait = 1
unitDef.energymake = 8
unitDef.footprintx = 12
unitDef.footprintz = 12
unitDef.buildcostmetal = 625*STRUCTURE_COST_MULT
unitDef.explodeas = "NUCLEAR_MISSILE"
unitDef.selfdestructas = "NUCLEAR_MISSILE"
unitDef.customparams.soundselect = "building_select2"
unitDef.collisionvolumescales = [[130 130 130]]
unitDef.featuredefs.dead.object = "pw_mine3_dead.dae"
end,
pw_garrison = function(unitDef)
unitDef.maxdamage = 16000
unitDef.name = "Field Garrison"
unitDef.description = "Reduces Influence gain"
unitDef.objectname = "pw_wormhole.dae"
unitDef.icontype = [[pw_defense]]
unitDef.script = "pw_wormhole.lua"
unitDef.canattack = true
unitDef.sightdistance = 330
unitDef.footprintx = 11
unitDef.footprintz = 6
unitDef.buildcostmetal = 250*STRUCTURE_COST_MULT
unitDef.customparams.soundselect = "factory_select"
unitDef.weapondefs = {bogus_fake_targeter = CopyTable(fakeWeapondef, true)}
unitDef.weapons = CopyTable(fakeWeapons, true)
unitDef.collisionvolumescales = [[160 65 80]]
unitDef.featuredefs.dead.object = "pw_wormhole_dead.dae"
end,
pw_interception = function(unitDef)
unitDef.maxdamage = 16000
unitDef.name = "Interception Network"
unitDef.description = "Intercepts planetary bombers"
unitDef.objectname = "pw_warpjammer.s3o"
unitDef.script = "pw_warpjammer.lua"
unitDef.icontype = [[pw_interception]]
unitDef.footprintx = 6
unitDef.footprintz = 6
unitDef.buildcostmetal = 250*STRUCTURE_COST_MULT
unitDef.customparams.soundselect = "radar_select"
unitDef.sightdistance = 800
unitDef.radardistance = 2100
unitDef.radaremitheight = 150
unitDef.losemitheight = 150
unitDef.onoffable = false
unitDef.energyuse = 0
unitDef.collisionvolumescales = [[100 80 100]]
unitDef.collisionvolumetype = [[Box]]
unitDef.featuredefs.dead.object = "pw_warpjammer_dead.dae"
end,
pw_grid = function(unitDef)
unitDef.maxdamage = 20000
unitDef.name = "Planetary Defense Grid"
unitDef.description = "Defends against everything"
unitDef.objectname = "pw_wormhole2.dae"
unitDef.icontype = [[pw_defense2]]
unitDef.script = "pw_wormhole2.lua"
unitDef.footprintx = 8
unitDef.footprintz = 8
unitDef.buildcostmetal = 750*STRUCTURE_COST_MULT
unitDef.canattack = true
unitDef.sightdistance = 495
unitDef.customparams.soundselect = "turret_select"
unitDef.weapondefs = {bogus_fake_targeter = CopyTable(fakeWeapondef, true)}
unitDef.weapondefs.bogus_fake_targeter.range = 450
unitDef.weapons = CopyTable(fakeWeapons, true)
unitDef.collisionvolumescales = [[100 90 100]]
unitDef.collisionvolumetype = [[CylY]]
unitDef.featuredefs.dead.object = "pw_wormhole2_dead.dae"
end,
pw_wormhole = function(unitDef)
unitDef.maxdamage = 12500
unitDef.name = "Wormhole Generator"
unitDef.description = "Links this planet to nearby planets"
unitDef.objectname = "pw_estorage.dae"
unitDef.icontype = [[pw_wormhole]]
unitDef.footprintx = 3
unitDef.footprintz = 3
unitDef.buildcostmetal = 75*STRUCTURE_COST_MULT
unitDef.customparams.evacuation_speed = "1.25" -- 8 minutes
unitDef.customparams.soundselect = "shield_select"
unitDef.collisionvolumescales = [[40 45 40]]
unitDef.collisionvolumetype = [[CylY]]
unitDef.featuredefs.dead.object = "pw_estorage_dead.dae"
end,
pw_wormhole2 = function(unitDef)
unitDef.maxdamage = 17500
unitDef.name = "Improved Wormhole"
unitDef.description = "Links this planet to nearby planets"
unitDef.objectname = "pw_gaspowerstation.dae"
unitDef.script = "pw_gaspowerstation.lua"
unitDef.icontype = [[pw_wormhole2]]
unitDef.footprintx = 6
unitDef.footprintz = 6
unitDef.buildcostmetal = 250*STRUCTURE_COST_MULT
unitDef.customparams.evacuation_speed = "2" -- 5 minutes
unitDef.customparams.soundselect = "shield_select"
unitDef.collisionvolumescales = [[70 60 70]]
unitDef.collisionvolumetype = [[CylY]]
unitDef.featuredefs.dead.object = "pw_gaspowerstation_dead.dae"
end,
pw_warpgate = function(unitDef)
unitDef.maxdamage = 15000
unitDef.name = "Warp Gate"
unitDef.description = "Produces warp cores"
unitDef.objectname = "pw_techlab.dae"
unitDef.script = "pw_techlab.lua"
unitDef.icontype = [[pw_warpgate]]
unitDef.footprintx = 8
unitDef.footprintz = 9
unitDef.buildcostmetal = 500*STRUCTURE_COST_MULT
unitDef.customparams.soundselect = "cloaker_select"
unitDef.featuredefs.dead.object = "pw_techlab_dead.dae"
end,
pw_warpjammer = function(unitDef)
unitDef.maxdamage = 12000
unitDef.name = "Warp Jammer"
unitDef.description = "Prevents warp attacks"
unitDef.objectname = "pw_warpgate.dae"
unitDef.script = "pw_warpgate.lua"
unitDef.icontype = [[pw_jammer]]
unitDef.footprintx = 8
unitDef.footprintz = 8
unitDef.buildcostmetal = 300*STRUCTURE_COST_MULT
unitDef.explodeas = "GRAV_BLAST"
unitDef.selfdestructas = "GRAV_BLAST"
unitDef.customparams.soundselect = "radar_select"
unitDef.customparams.area_cloak = 1
unitDef.customparams.area_cloak_upkeep = 12
unitDef.customparams.area_cloak_radius = 550
unitDef.customparams.area_cloak_decloak_distance = 75
unitDef.radardistancejam = 550
unitDef.onoffable = true
unitDef.energyuse = 1.5
unitDef.customparams.priority_misc = 2
unitDef.collisionvolumescales = [[120 100 120]]
unitDef.collisionvolumetype = [[CylY]]
unitDef.featuredefs.dead.object = "pw_warpgate_dead.dae"
end,
pw_inhibitor = function(unitDef)
unitDef.maxdamage = 15000
unitDef.name = "Wormhole Inhibitor"
unitDef.description = "Blocks Influence Spread"
unitDef.objectname = "pw_mstorage2.dae"
unitDef.icontype = [[pw_riot]]
unitDef.footprintx = 7
unitDef.footprintz = 5
unitDef.buildcostmetal = 350*STRUCTURE_COST_MULT
unitDef.customparams.soundselect = "shield_select"
unitDef.collisionvolumescales = [[80 25 60]]
unitDef.collisionvolumetype = [[Box]]
unitDef.featuredefs.dead.object = "pw_mstorage2_dead.dae"
end,
pw_guerilla = function(unitDef)
unitDef.maxdamage = 15000
unitDef.name = "Guerilla Jumpgate"
unitDef.description = "Spreads Influence remotely"
unitDef.objectname = "pw_gaspowerstation.dae"
unitDef.script = "pw_gaspowerstation.lua"
unitDef.footprintx = 6
unitDef.footprintz = 6
unitDef.buildcostmetal = 750*STRUCTURE_COST_MULT
unitDef.customparams.soundselect = "shield_select"
unitDef.collisionvolumescales = [[70 60 70]]
unitDef.collisionvolumetype = [[CylY]]
unitDef.featuredefs.dead.object = "pw_gaspowerstation_dead.dae"
end,
------------------------------------------------------------------------
-- The following are presently just for galaxy missions
------------------------------------------------------------------------
pw_metal = function(unitDef)
unitDef.maxdamage = 10000
unitDef.name = "Ancient Fabricator"
unitDef.description = "Produces Metal out of thin air (+10)"
unitDef.objectname = "pw_mine3.dae"
unitDef.script = "pw_mine3.lua"
unitDef.icontype = [[pw_metal]]
unitDef.customparams = unitDef.customparams or {}
unitDef.customparams.removewait = 1
unitDef.metalmake = 10
unitDef.footprintx = 12
unitDef.footprintz = 12
unitDef.buildcostmetal = 2000
unitDef.explodeas = "NUCLEAR_MISSILE"
unitDef.selfdestructas = "NUCLEAR_MISSILE"
unitDef.customparams.soundselect = "building_select2"
unitDef.collisionvolumescales = [[130 130 130]]
unitDef.featuredefs.dead.object = "pw_mine3_dead.dae"
end,
pw_techlab = function(unitDef)
unitDef.maxdamage = 2500
unitDef.buildcostmetal = 1000
unitDef.name = "Tech Lab"
unitDef.description = "Contains powerful ancient technology"
unitDef.objectname = "pw_techlab.dae"
unitDef.script = "pw_techlab.lua"
unitDef.footprintx = 8
unitDef.footprintz = 9
unitDef.buildpic = "pw_generic.png"
unitDef.customparams = unitDef.customparams or {}
unitDef.customparams.removewait = 1
unitDef.customparams.soundselect = "radar_select"
end,
------------------------------------------------------------------------
-- the following are presently just for missions
------------------------------------------------------------------------
pw_gaspowerstation = function(unitDef)
unitDef.maxdamage = 15000
unitDef.name = "Gas Power Station"
unitDef.description = "Produces Energy"
unitDef.objectname = "pw_gaspowerstation.dae"
unitDef.script = "pw_gaspowerstation.lua"
unitDef.footprintx = 6
unitDef.footprintz = 6
unitDef.customparams.soundselect = "geo_select"
unitDef.collisionvolumescales = [[70 60 70]]
unitDef.collisionvolumetype = [[CylY]]
unitDef.featuredefs.dead.object = "pw_gaspowerstation_dead.dae"
end,
pw_mstorage2 = function(unitDef)
unitDef.maxdamage = 15000
unitDef.name = "Metal Storage"
unitDef.description = "Stores metal"
unitDef.objectname = "pw_mstorage2.dae"
unitDef.footprintx = 7
unitDef.footprintz = 5
--unitDef.customparams.soundselect = "shield_select"
unitDef.collisionvolumescales = [[80 25 60]]
unitDef.collisionvolumetype = [[Box]]
unitDef.featuredefs.dead.object = "pw_mstorage2_dead.dae"
end,
pw_estorage = function(unitDef)
unitDef.maxdamage = 10000
unitDef.name = "Energy Storage"
unitDef.description = "Stores energy"
unitDef.objectname = "pw_estorage.dae"
unitDef.footprintx = 3
unitDef.footprintz = 3
unitDef.customparams.soundselect = "fusion_select"
unitDef.collisionvolumescales = [[40 45 40]]
unitDef.collisionvolumetype = [[CylY]]
unitDef.featuredefs.dead.object = "pw_estorage_dead.dae"
end,
pw_estorage2 = function(unitDef)
unitDef.maxdamage = 15000
unitDef.name = "Double Energy Storage"
unitDef.description = "Stores energy"
unitDef.objectname = "pw_estorage2.dae"
unitDef.footprintx = 5
unitDef.footprintz = 3
unitDef.customparams.soundselect = "fusion_select"
unitDef.collisionvolumescales = [[60 45 40]]
unitDef.collisionvolumetype = [[Box]]
unitDef.featuredefs.dead.object = "pw_estorage2_dead.dae"
end,
pw_warpgatealt = function(unitDef)
unitDef.maxdamage = 15000
unitDef.name = "Warp Gate"
unitDef.description = "Produces warp cores"
unitDef.objectname = "pw_warpgate.dae"
unitDef.script = "pw_warpgate.lua"
unitDef.footprintx = 8
unitDef.footprintz = 8
unitDef.explodeas = "GRAV_BLAST"
unitDef.selfdestructas = "GRAV_BLAST"
unitDef.customparams.soundselect = "cloaker_select"
unitDef.customparams.statsname = "pw_warpgate"
unitDef.collisionvolumescales = [[120 100 120]]
unitDef.collisionvolumetype = [[CylY]]
unitDef.featuredefs.dead.object = "pw_warpgate_dead.dae"
end,
pw_relay = function(unitDef)
unitDef.maxdamage = 6000
unitDef.name = "Communication Relay"
unitDef.description = "Sends messages across the void"
unitDef.objectname = "pw_warpgate_alt.dae"
unitDef.script = "pw_warpgate_alt.lua"
unitDef.icontype = [[pw_relay]]
unitDef.footprintx = 4
unitDef.footprintz = 4
unitDef.customparams.soundselect = "radar_select"
unitDef.customparams.statsname = "pw_warpgate_alt"
unitDef.collisionvolumescales = [[55 70 55]]
unitDef.collisionvolumetype = [[CylY]]
unitDef.featuredefs.dead.object = "pw_warpgate_alt_dead.dae"
end,
}
return structureConfig