/
StdMiningEquipment.xml
787 lines (623 loc) · 17.7 KB
/
StdMiningEquipment.xml
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
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
<?xml version="1.0" encoding="utf-8"?>
<TranscendenceModule>
<!-- STATION TYPES -->
<!-- Mining Pod
DATA
ownerID: Object that created it.
podType: UNID of item type that created this.
status:
Nil: Ready to be armed.
'armed: Armed to explode
-->
<StationType UNID="&stMiningPod;"
name= "(mining pod)"
sovereign= "&svNeutral;"
attributes= "miningPod"
scale= "flotsam"
mobile= "true"
mass= "1"
>
<ImageVariants>
<Image imageID="&rsMiningPod;" imageX="0" imageY="0" imageWidth="24" imageHeight="24" />
<Image imageID="&rsMiningPod;" imageX="24" imageY="0" imageWidth="24" imageHeight="24" />
</ImageVariants>
<Communications>
<Message name="Detonate" key="A">
<OnShow>
(and (= (objGetID gSender) (objGetData gSource 'ownerID))
(not (objGetData gSource 'status))
)
</OnShow>
<Invoke>
(block (
(podType (objGetData gSource 'podType))
overlayID
)
; Remove the radius overlay and add an armed radius
(enum (objGetOverlays gSource) oldOverlayID
(if (= (objGetOverlayType gSource oldOverlayID) &ovMiningPodRadius;)
(objRemoveOverlay gSource oldOverlayID)
)
)
(setq overlayID (objAddOverlay gSource &ovMiningPodArmedRadius;))
(objSetOverlayProperty gSource overlayID 'counter (typGetStaticData podType 'effectRadius))
; Add a timer overlay to the pod
(setq overlayID (objAddOverlay gSource &ovMiningPodTimer;))
(objSetOverlayData gSource overlayID 'sourceID (objGetData gSource 'ownerID))
(objSetOverlayData gSource overlayID 'startTime (unvGetTick))
(objSetOverlayData gSource overlayID 'podType podType)
; Armed
(objSetData gSource 'status 'armed)
)
</Invoke>
</Message>
</Communications>
</StationType>
<!-- ITEMS -->
<!-- Level 2: Mining Laser -->
<ItemType UNID="&itMiningLaser;"
name= "mining laser"
attributes= "commonwealth, energyWeapon, majorItem, miningEquipment, specialty"
level= "2"
frequency= "rare"
value= "1150"
mass= "2000"
description= "This powerful laser is generally used for asteroid mining."
>
<Image imageID="&rsItems2;" imageX="96" imageY="96" imageWidth="96" imageHeight="96"/>
<Weapon
type= "continuousBeam"
repeating= "4"
damage= "laser:1d4+1; mining:3;"
relativisticSpeed= "true"
fireRate= "30"
lifetime= "3"
powerUse= "30"
effect= "&efGreenLaserContinuousBeam;"
fireEffect= "&efGreenLaserFireEffect;"
hitEffect= "&efGreenLaserHitEffect;"
sound= "&snLaserCannon;"
>
</Weapon>
</ItemType>
<!-- Level 2: Seismic Scanner Pod -->
<ItemType UNID="&itSeismicScannerPod;"
name= "seismic scanner pod"
attributes= "commonwealth, miningEquipment"
inherit= "&baMiningPodItem;"
level= "2"
frequency= "common"
numberAppearing= "4d6"
value= "150"
mass= "500"
description= "This scanner pod explodes into a seismic wave that reveals the location of valuable ores in asteroids. It has a 30 light-seconds range, and it detects ores up to level 5."
>
<Image imageID="&rsItems2;" imageX="192" imageY="96" imageWidth="96" imageHeight="96"/>
<StaticData>
<Data id="effectRadius">30</Data>
<Data id="imageVariant">0</Data>
<Data id="oreCriteria">"t +ore; L:1-5;"</Data>
</StaticData>
<Events>
<OnEffect>
(sysCreateWeaponFire
&vtSeismicScannerPower;
(list (@ gData 'sourceObj) 'explosion Nil "seismic scanner pod" 0x00)
(objGetPos (@ gData 'podObj))
0
0
Nil
(list 'detonateNow 'fireEffect 'soundEffect)
)
</OnEffect>
</Events>
</ItemType>
<ItemType UNID="&vtSeismicScannerPower;"
name= "seismic scanner power"
virtual= "true"
inherit= "&baSeismicScannerPower;"
level= "2"
>
<Weapon
type= "area"
damage= "blast:3d6"
fireRate= "30"
expansionSpeed= "80"
missileSpeed= "0"
lifetime= "20"
powerUse= "500"
canHitSource= "true"
sound= "&snArmorHit1;"
>
<Effect>
<Shockwave
style= "glowRing"
width= "2"
glowSize= "12"
primaryColor= "#ffd4cb"
secondaryColor= "#f24b29"
/>
</Effect>
</Weapon>
<StaticData>
<Data id="podType">&itSeismicScannerPod;</Data>
</StaticData>
</ItemType>
<!-- Level 3: Class-A Excavation Pod -->
<ItemType UNID="&itClassAExcavationPod;"
name= "class A excavation pod"
attributes= "commonwealth, miningEquipment"
inherit= "&baMiningPodItem;"
level= "3"
frequency= "uncommon"
numberAppearing= "2d6"
value= "250"
mass= "500"
description= "Class A excavation pods uses a seismic charge to extract ore from asteroids in a 30 light-second radius."
>
<Image imageID="&rsItems3;" imageX="96" imageY="192" imageWidth="96" imageHeight="96"/>
<StaticData>
<Data id="effectRadius">30</Data>
<Data id="imageVariant">1</Data>
</StaticData>
<Events>
<OnEffect>
(sysCreateWeaponFire
&vtClassAExcavationPower;
(list (@ gData 'sourceObj) 'explosion Nil "class A excavation pod" 0x00)
(objGetPos (@ gData 'podObj))
0
0
Nil
(list 'detonateNow 'fireEffect 'soundEffect)
)
</OnEffect>
</Events>
</ItemType>
<ItemType UNID="&vtClassAExcavationPower;"
name= "class A excavation power"
virtual= "true"
level= "3"
>
<Weapon
type= "area"
damage= "blast:4d6; mining:5"
fireRate= "30"
expansionSpeed= "80"
missileSpeed= "0"
lifetime= "20"
powerUse= "500"
canHitSource= "true"
>
<FireEffect
sound="&snArmorHit1;"
>
<Flare
style= "fadingBlast"
radius= "120"
primaryColor= "#ffc29a"
lifetime= "8"
/>
</FireEffect>
<Effect>
<Shockwave
style= "image"
>
<Image imageID= "&rsShockwave3;"
imageX= "0"
imageY= "0"
imageWidth= "512"
imageHeight= "128"
/>
</Shockwave>
</Effect>
</Weapon>
</ItemType>
<!-- Level 5: Class-B Excavation Pod -->
<ItemType UNID="&itClassBExcavationPod;"
name= "class B excavation pod"
attributes= "commonwealth, miningEquipment"
inherit= "&baMiningPodItem;"
level= "5"
frequency= "uncommon"
numberAppearing= "2d6"
value= "500"
mass= "500"
description= "This improved excavation pod has 40 light-second radius."
>
<Image imageID="&rsItems5;" imageX="192" imageY="96" imageWidth="96" imageHeight="96"/>
<StaticData>
<Data id="effectRadius">40</Data>
<Data id="imageVariant">1</Data>
</StaticData>
<Events>
<OnEffect>
(sysCreateWeaponFire
&vtClassBExcavationPower;
(list (@ gData 'sourceObj) 'explosion Nil "class B excavation pod" 0x00)
(objGetPos (@ gData 'podObj))
0
0
Nil
(list 'detonateNow 'fireEffect 'soundEffect)
)
</OnEffect>
</Events>
</ItemType>
<ItemType UNID="&vtClassBExcavationPower;"
name= "class B excavation power"
virtual= "true"
level= "5"
>
<Weapon
type= "area"
damage= "blast:6d6; mining:6"
fireRate= "30"
expansionSpeed= "80"
missileSpeed= "0"
lifetime= "25"
powerUse= "500"
canHitSource= "true"
>
<FireEffect
sound="&snArmorHit1;"
>
<Flare
style= "fadingBlast"
radius= "180"
primaryColor= "#ffc29a"
lifetime= "8"
/>
</FireEffect>
<Effect>
<Shockwave
style= "image"
>
<Image imageID= "&rsShockwave3;"
imageX= "0"
imageY= "0"
imageWidth= "512"
imageHeight= "128"
/>
</Shockwave>
</Effect>
</Weapon>
</ItemType>
<!-- Level 6: Advanced Scanner Pod -->
<ItemType UNID="&itAdvancedScannerPod;"
name= "advanced scanner pod"
attributes= "commonwealth, miningEquipment, notStandard"
inherit= "&baMiningPodItem;"
level= "6"
frequency= "uncommon"
numberAppearing= "4d6"
value= "250"
mass= "500"
description= "This is an improved version of the seismic scanner pod. It detects ore of level 10 or below in a 60 light-second radius."
>
<Image imageID="&rsItems6;" imageX="288" imageY="96" imageWidth="96" imageHeight="96"/>
<StaticData>
<Data id="effectRadius">60</Data>
<Data id="imageVariant">0</Data>
<Data id="oreCriteria">"t +ore; L:1-10;"</Data>
</StaticData>
<Events>
<OnEffect>
(sysCreateWeaponFire
&vtAdvancedScannerPower;
(list (@ gData 'sourceObj) 'explosion Nil "advanced scanner pod" 0x00)
(objGetPos (@ gData 'podObj))
0
0
Nil
(list 'detonateNow 'fireEffect 'soundEffect)
)
</OnEffect>
</Events>
</ItemType>
<ItemType UNID="&vtAdvancedScannerPower;"
name= "advanced scanner power"
virtual= "true"
inherit= "&baSeismicScannerPower;"
level= "6"
>
<Weapon
type= "area"
damage= "blast:5d6"
fireRate= "30"
expansionSpeed= "80"
missileSpeed= "0"
lifetime= "38"
powerUse= "500"
canHitSource= "true"
sound= "&snArmorHit1;"
>
<Effect>
<Shockwave
style= "glowRing"
width= "2"
glowSize= "12"
primaryColor= "#f7ffcc"
secondaryColor= "#d1f229"
/>
</Effect>
</Weapon>
<StaticData>
<Data id="podType">&itAdvancedScannerPod;</Data>
</StaticData>
</ItemType>
<!-- Level 6: Plasma Torch -->
<ItemType UNID="&itPlasmaTorch;"
name= "plasma torch(es)"
attributes= "commonwealth, majorItem, miningEquipment"
level= "6"
frequency= "rare"
value= "12000"
mass= "4000"
description= "Plasma torches are used for large-scale asteroid mining."
>
<Image imageID="&rsItems6;" imageX="192" imageY="96" imageWidth="96" imageHeight="96"/>
<Weapon
type= "particles"
damage= "plasma:30; mining:5; WMD:2"
fireRate= "30"
powerUse= "300"
sound= "&snRecoillessCannon;"
>
<ParticleSystem
style= "spray"
emitLifetime= "1"
emitRate= "60-75"
emitSpeed= "40"
spreadAngle= "1"
particleLifetime= "30"
particleEffect= "&efPlasmaParticleDefault;"
>
</ParticleSystem>
</Weapon>
</ItemType>
<!-- Level 8: Class-C Excavation Pod -->
<ItemType UNID="&itClassCExcavationPod;"
name= "class C excavation pod"
attributes= "commonwealth, miningEquipment, notStandard"
inherit= "&baMiningPodItem;"
level= "8"
frequency= "uncommon"
numberAppearing= "2d6"
value= "1000"
mass= "500"
description= "The class C excavation pod is used for large-scale asteroid mining. It uses a thermonuclear change and has a range of 60 light-seconds."
>
<Image imageID="&rsItems8;" imageX="192" imageY="96" imageWidth="96" imageHeight="96"/>
<StaticData>
<Data id="effectRadius">60</Data>
<Data id="imageVariant">1</Data>
</StaticData>
<Events>
<OnEffect>
(sysCreateWeaponFire
&vtClassCExcavationPower;
(list (@ gData 'sourceObj) 'explosion Nil "class C excavation pod" 0x00)
(objGetPos (@ gData 'podObj))
0
0
Nil
(list 'detonateNow 'fireEffect 'soundEffect)
)
</OnEffect>
</Events>
</ItemType>
<ItemType UNID="&vtClassCExcavationPower;"
name= "class C excavation power"
virtual= "true"
level= "8"
>
<Weapon
type= "area"
damage= "thermo:8d12; mining:7"
fireRate= "30"
expansionSpeed= "80"
missileSpeed= "0"
lifetime= "38"
powerUse= "500"
canHitSource= "true"
>
<FireEffect
sound="&snArmorHit1;"
>
<Flare
style= "fadingBlast"
radius= "240"
primaryColor= "#ffc29a"
lifetime= "8"
/>
</FireEffect>
<Effect>
<Shockwave
style= "image"
>
<Image imageID= "&rsShockwave3;"
imageX= "0"
imageY= "0"
imageWidth= "512"
imageHeight= "128"
/>
</Shockwave>
</Effect>
</Weapon>
</ItemType>
<!-- OVERLAYS -->
<OverlayType UNID="&ovMiningPodRadius;"
attributes= "effect"
>
<Counter style= "radius"
color= "#5ff12a"
/>
</OverlayType>
<OverlayType UNID="&ovMiningPodArmedRadius;"
attributes= "effect"
>
<Counter style= "radius"
color= "#f24b29"
/>
</OverlayType>
<OverlayType UNID="&ovMiningPodTimer;"
attributes= "effect"
>
<Counter style= "progress"
color= "#f24b29"
max= "100"
/>
<Events>
<OnUpdate>
(block (
(startTime (objGetOverlayData gSource aOverlayID 'startTime))
(detonateTime 150)
(progress (subtract (unvGetTick) startTime))
(percentDone (if (gr detonateTime 0) (divide (multiply progress 100) detonateTime) 0))
(podType (objGetOverlayData gSource aOverlayID 'podType))
)
(switch
; If we're still ticking, set the counter
(ls progress detonateTime)
(block Nil
(objSetOverlayProperty gSource aOverlayID 'counter percentDone)
(objSetOverlayProperty gSource aOverlayID 'counterLabel (typTranslate podType "msgWaiting"))
)
; Boom!
(block Nil
(typFireEvent podType 'OnEffect {
sourceObj: (objGetObjByID (objGetOverlayData gSource aOverlayID 'sourceID))
podObj: gSource
overlayID: aOverlayID
})
; We get destroyed
(objDestroy gSource)
)
)
)
</OnUpdate>
</Events>
</OverlayType>
<!-- BASE CLASSES -->
<ItemType UNID="&baMiningPodItem;"
name= "(mining pod)"
virtual= "true"
level= "1"
>
<Invoke>
(block (
(podType (itmGetType gItem))
(miningPodObj Nil)
(overlayID Nil)
)
; Create a mining pod
(setq miningPodObj (sysCreateStation &stMiningPod; (objGetPos gSource)))
(objSetName miningPodObj (itmGetName gItem 0x00) 0x00)
(objIncVel miningPodObj (sysVectorPolarVelocity (objGetProperty gSource 'rotation) 5))
(objSetData miningPodObj 'ownerID (objGetID gSource))
(objSetData miningPodObj 'podType podType)
(staSetImageVariant miningPodObj (typGetStaticData podType 'imageVariant))
; Add a radius overlay to indicate its area of effect
(setq overlayID (objAddOverlay miningPodObj &ovMiningPodRadius;))
(objSetOverlayProperty miningPodObj overlayID 'counter (typGetStaticData (itmGetType gItem) 'effectRadius))
; Identify and consume the pod
(itmSetKnown gItem)
(objRemoveItem gSource gItem 1)
)
</Invoke>
<Events>
</Events>
<Language>
<Text id="msgWaiting">"Armed"</Text>
</Language>
</ItemType>
<ItemType UNID="&baSeismicScannerPower;"
name= "(seismic scanner base class)"
virtual= "true"
level= "2"
>
<Events>
<OnCreateShot>
(block Nil
(objSetData gSource 'asteroidsFound 0)
(objSetData gSource 'asteroidsInDeposit 0)
)
</OnCreateShot>
<OnDamageAbandoned>
(block (
(podType (typGetStaticData aWeaponType 'podType))
)
(if (miningScanObj gSource podType)
(block (depositID)
(objIncData aCause 'asteroidsFound 1)
; If this asteroid is part of a larger ore deposit,
; then remember it.
(if (setq depositID (objGetData gSource 'oreDeposit))
(block Nil
(objSetData aCause 'depositID depositID)
(objIncData aCause 'asteroidsInDeposit 1)
)
)
)
)
; We return Nil to indicate that we want the default damage
; to apply.
Nil
)
</OnDamageAbandoned>
<OnDestroyShot>
(switch
; If we found asteroids in a deposit, then we broadcast a
; message to all stations (to let them know that a desposit
; has been found).
(!= (objGetData gSource 'asteroidsInDeposit) 0)
(miningNotifyOnOreDepositFound (objGetObjByID (objGetData gSource 'depositID)) aOrderGiver)
; If we found some ore, then nothing to do (we've marked the ore
; found).
(!= (objGetData gSource 'asteroidsFound) 0)
Nil
; If we found no ore, tell the player/orderGiver
(objSendMessage aOrderGiver Nil (typTranslate &ovMiningOreCount; 'msgNoOreFound))
)
</OnDestroyShot>
</Events>
</ItemType>
<!-- GLOBALS -->
<Globals>
(block Nil
(setq miningScanObj (lambda (asteroidObj podType)
(block (
(podOreCriteria (typGetStaticData podType 'oreCriteria))
(oreCriteria (if podOreCriteria podOreCriteria "t +ore;"))
oreFound
)
(switch
; If not an asteroid, then nothing to do
(not (objHasAttribute asteroidObj "asteroid"))
Nil
; If there is no detectable ore here, nothing to do
(not (setq oreFound (objGetItems asteroidObj oreCriteria)))
Nil
; If we already have this overlay, then nothing to do
(filter (objGetOverlays asteroidObj) theOverlay
(= (objGetOverlayType asteroidObj theOverlay) &ovMiningOreCount;)
)
Nil
; Otherwise, create an overlay
(block (
overlayID
)
(setq overlayID (objAddOverlay asteroidObj &ovMiningOreCount;))
(objSetOverlayProperty asteroidObj overlayID 'counterLabel (typTranslate &ovMiningOreCount; 'msgScanning))
; Return TRUE to indicate that we found ore
True
)
)
)
))
)
</Globals>
<!-- RESOURCES -->
<Image UNID="&rsMiningPod;" bitmap="Resources\MiningPod.jpg" bitmask="Resources\MiningPodMask.bmp" loadOnUse="true"/>
</TranscendenceModule>