This repository was archived by the owner on Jun 7, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWE_WeaponRandomizer.xml
More file actions
1952 lines (1666 loc) · 84.8 KB
/
WE_WeaponRandomizer.xml
File metadata and controls
1952 lines (1666 loc) · 84.8 KB
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
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?xml version="1.0" encoding="utf-8"?>
<TranscendenceModule>
<OverlayType UNID="&WE_ovGlobalUpdate;">
<Events>
<Placeholder>
</Placeholder>
<OnUpdate>
;update every 10 secs:
(block Nil
;(printTo 'log "WE Overlay!")
;(printTo 'log "Checking checks!")
;(printTo 'log (geq (objGetOverlayData gSource aOverlayID "Time") (multiply 15 (objGetOverlayData gSource aOverlayID "UpdateInstance"))))
;(printTo 'log (ls (ObjGetDistance gPlayer (SysFindObject gPlayer "GN")) 30))
(if
(and
(geq (objGetOverlayData gSource aOverlayID "Time") (multiply 15 (objGetOverlayData gSource aOverlayID "UpdateInstance")))
;player will not gate:
(ls (ObjGetDistance gPlayer (SysFindObject gPlayer "GN")) 30)
)
(block Nil
;(printTo 'log "Check Update Time!")
;(dbgoutput "Running OnUpdate...")
<!--
(if (eq (typGetData &svPlayer; "WE_RandomizerOnSwitch") 1)
(we_RandomizeShip)
)-->
(if (eq (typGetData &svPlayer; "WE_RandomizerOnSwitch") 1)
(if (gr (count (we_findTheShips)) 40)
(objFireOverlayEvent gSource aOverlayID "LagFix")
(objFireOverlayEvent gSource aOverlayID "WERandomize")
)
)
;randomization without the lagfix
;(objFireOverlayEvent gSource aOverlayID "WERandomize")
)
(objIncOverlayData gSource aOverlayID "Time" 1)
)
)
</OnUpdate>
<LagFix>
(block (Small_List)
;update overlay:
(objIncOverlayData gSource aOverlayID "UpdateInstance" 1)
;(setq Small_List (List Nil))
; (for i 0 2 (block Nil
; (Setq Small_List
; (lnkAppend
; Small_List
; (we_findTheShips)
; ))
; Small_List
; )
; )
;(setq Small_List (lnkRemoveNil Small_List))
;;(printTo 'log Small_List)
(setq Small_List (subset (we_findTheShips) 0 38))
(enum Small_List ship
(block (unid weapon shield ammoWeapon)
;(printTo 'log "Randomizing Ship: " (objGetName ship 1))
;(printTo 'log "ID: " (objGetID ship) " --- Obj: " (cat ship))
;; get the unid of the current ship
(setq unid (objGetType ship))
;; get main weapon
(setq weapon (@ (objGetItems ship "wI -Launcher; -Ammo;") 0))
;; get weapon list
(setq weaponList (objGetItems ship "wI -Launcher; -Ammo;"))
;; get shield
(setq shield (@ (objGetItems ship "sI") 0))
;; get eventual launcher/ammo weapon
(setq ammoWeapon (@ (objGetItems ship "wI +Ammo;") 0))
;we hold the AI ship for 1 tick
;so that eventual attack orders are not going to crash the game
;(shpOrderImmediate ship 'hold 1)
;; Handle the main weapon (old code that randomizes the main weapon only, keep here as a reference)
;(if weapon (block (level modifier)
; (setq level (list (itmGetLevel weapon) 'a))
; (setq modifier (WE_ConvertDamageTypeToString (itmGetDamageType weapon)))
;; randomize this ships weapons unless they are in the skip list
;(if (not (find we_WeaponShipSkipList unid))
; (we_RandomizeWeapon level modifier ship weapon)
;(printTo 'log "weapon randomization skipped!")
; )
; ))
;; Handle the weapons (new code, randomizes all the weapons on the ship and handles fireArcs and DevicePos)
(enum weaponList weapon
(block Nil
(if weapon (block (level modifier installPosList devicePos fireArc)
(setq level (list (itmGetLevel weapon) 'a))
(setq modifier (WE_ConvertDamageTypeToString (itmGetDamageType weapon)))
;returns a number 0,1,2,3,4... useful for debugging
;(printTo 'log (itmGetInstallPos weapon))
(setq devicePos (objGetItemProperty ship weapon 'pos))
(setq fireArc (objGetItemProperty ship weapon 'fireArc))
;(printTo 'log "devicepos " devicePos)
;(printTo 'log "firearc " firearc)
;; randomize this ships weapons unless they are in the skip list
(if (not (find we_WeaponShipSkipList unid))
(we_RandomizeWeapon level modifier ship weapon devicePos fireArc)
;(printTo 'log "weapon randomization skipped!")
)
))
)
)
;; Handle the shield
;; If the ship has no shield, then we calculate
;; the shield level from the systemlevel
(block (level)
(if shield
(setq level (itmGetLevel shield))
(setq level (sysGetLevel))
)
(if (not (find we_ShieldShipSkipList unid))
(we_RandomizeShield (list level 'a) ship shield)
;(printTo 'log "shield randomization skipped!")
)
)
;; call the ammo randomizer if there is a launcher/ammo weapon
(if ammoWeapon
(we_RandomizeAmmoWeapon ammoWeapon ship)
)
;; mark the ship so it's not going to be randomized a second time
(objSetData ship "WE_RandomizerDone" True)
;(printTo 'log "Done Randomizing")
;(printTo 'log "================")
)
)
)
</LagFix>
<WERandomize>
(block Nil
;update the overlay
(objIncOverlayData gSource aOverlayID "UpdateInstance" 1)
(enum (we_findTheShips) ship
(block (unid weapon shield ammoWeapon)
;(printTo 'log "Randomizing Ship: " (objGetName ship 1))
;(printTo 'log "ID: " (objGetID ship) " --- Obj: " (cat ship))
;; get the unid of the current ship
(setq unid (objGetType ship))
;; get main weapon
(setq weapon (@ (objGetItems ship "wI -Launcher; -Ammo;") 0))
;; get weapon list
(setq weaponList (objGetItems ship "wI -Launcher; -Ammo;"))
;; get shield
(setq shield (@ (objGetItems ship "sI") 0))
;; get eventual launcher/ammo weapon
(setq ammoWeapon (@ (objGetItems ship "wI +Ammo;") 0))
;we hold the AI ship for 1 tick
;so that eventual attack orders are not going to crash the game
;(shpOrderImmediate ship 'hold 1)
;; Handle the main weapon (old code that randomizes the main weapon only, keep here as a reference)
;(if weapon (block (level modifier)
; (setq level (list (itmGetLevel weapon) 'a))
; (setq modifier (WE_ConvertDamageTypeToString (itmGetDamageType weapon)))
;; randomize this ships weapons unless they are in the skip list
;(if (not (find we_WeaponShipSkipList unid))
; (we_RandomizeWeapon level modifier ship weapon)
;(printTo 'log "weapon randomization skipped!")
; )
; ))
;; Handle the weapons (new code, randomizes all the weapons on the ship and handles fireArcs and DevicePos)
(enum weaponList weapon
(block Nil
(if weapon (block (level modifier installPosList devicePos fireArc)
(setq level (list (itmGetLevel weapon) 'a))
(setq modifier (WE_ConvertDamageTypeToString (itmGetDamageType weapon)))
;returns a number 0,1,2,3,4... useful for debugging
;(printTo 'log (itmGetInstallPos weapon))
(setq devicePos (objGetItemProperty ship weapon 'pos))
(setq fireArc (objGetItemProperty ship weapon 'fireArc))
;(printTo 'log "devicepos " devicePos)
;(printTo 'log "firearc " firearc)
;; randomize this ships weapons unless they are in the skip list
(if (not (find we_WeaponShipSkipList unid))
(we_RandomizeWeapon level modifier ship weapon devicePos fireArc)
;(printTo 'log "weapon randomization skipped!")
)
))
)
)
;; Handle the shield
;; If the ship has no shield, then we calculate
;; the shield level from the systemlevel
(block (level)
(if shield
(setq level (itmGetLevel shield))
(setq level (sysGetLevel))
)
(if (not (find we_ShieldShipSkipList unid))
(we_RandomizeShield (list level 'a) ship shield)
;(printTo 'log "shield randomization skipped!")
)
)
;; call the ammo randomizer if there is a launcher/ammo weapon
(if ammoWeapon
(we_RandomizeAmmoWeapon ammoWeapon ship)
)
;; mark the ship so it's not going to be randomized a second time
(objSetData ship "WE_RandomizerDone" True)
;(printTo 'log "Done Randomizing")
;(printTo 'log "================")
)
)
)
</WERandomize>
</Events>
</OverlayType>
<!-- This station is just a global event hook -->
<StationType UNID="&WE_RandomWeaponsGlobalStation;"
virtual= "true"
>
<Events>
<OnGlobalPlayerEnteredSystem>
(block (station)
; Once for each system
(if (not (sysGetData (sysGetNode) "GlobalUpdateInited")) (block nil
(setq station (sysCreateStation &WE_RandomWeaponsGlobalStation;
(sysVectorRandom nil 10000 100 nil)
))
(objAddOverlay station &WE_ovGlobalUpdate;)
(sysSetData (sysGetNode) "GlobalUpdateInited" "true")
))
;setq a couple of global variables to be used in the switch item and that will be used to compute the difficulty level
;prepare them for Normal Difficulty and VanillaMode
(block (WE_Difficulty)
(setq WE_Difficulty (typGetData &svPlayer; "WE_Difficulty"))
(if (not WE_Difficulty)
(block Nil
(typSetData &svPlayer; "WE_Difficulty" 1)
)))
(block (WE_shieldPercentModifier)
(setq WE_shieldPercentModifier (typGetData &svPlayer; "WE_ShieldPercentModifier"))
(if (not WE_shieldPercentModifier)
(block Nil
(typSetData &svPlayer; "WE_ShieldPercentModifier" 25)
)))
(block (WE_Mode)
(setq WE_Mode (typGetData &svPlayer; "WE_Mode"))
(if (not WE_Mode)
(block Nil
(typSetData &svPlayer; "WE_Mode" 1)
)))
(block (WE_DarkWeapons)
(setq WE_DarkWeapons (typGetData &svPlayer; "WE_DarkWeapons"))
(if (not WE_DarkWeapons)
(block Nil
(typSetData &svPlayer; "WE_DarkWeapons" 1)
)))
(block (WE_RandomizerOnSwitch)
(setq WE_RandomizerOnSwitch (typGetData &svPlayer; "WE_RandomizerOnSwitch"))
(if (not WE_RandomizerOnSwitch)
(block Nil
;you can set this value to 0 to turn off the randomizer for testing purposes.
(typSetData &svPlayer; "WE_RandomizerOnSwitch" 1)
)))
;-----------------------------------------------------------------------------------
;(printTo 'log "Kickstart finished !")
;DEBUG! let's make all the weapons known to debug better :D
;(itmEnumTypes "w" itemType
;(itmSetKnown itemType)
;)
;we also mark the playership so that it won't get randomized, as a precaution
(objSetData gPLayership "WE_RandomizerDone" True)
)
</OnGlobalPlayerEnteredSystem>
<OnGlobalPlayerChangedShips>
(block Nil
;mark the old ship and the new one to prevent randomization
(objSetData gPLayership "WE_RandomizerDone" True)
(objSetData aOldPlayerShip "WE_RandomizerDone" True)
;we also create and update a list so that we can follow the changed ships.
(if (not (find (typGetData &svPlayer; "WE_IDList") (objGetID gPlayership)))
(block Nil
(typSetData &svPlayer; "WE_IDList" (lnkAppend (typGetData &svPlayer; "WE_IDList") (objGetID gPlayership)))
;(printTo 'log "SHIP CHANGED!")
;(printTo 'log (enum (objGetData gPlayership "WE_IDList") tempID (objGetName (objGetObjByID tempID) 1)))
)
)
)
</OnGlobalPlayerChangedShips>
<GetGlobalAchievements>
(block (theList status)
(setq status (typGetData &svPlayer; "leftEridani"))
(if status
(setq theList (list
(list
"Randomizer Status"
(if (typGetData &dsWEConfigurator; "onSwitchDescription")
(typGetData &dsWEConfigurator; "onSwitchDescription")
"ON")
"Weapons Extended 6"
)
(list
"Difficulty"
(if (typGetData &dsWEConfigurator; "DifficultyDescription")
(typGetData &dsWEConfigurator; "DifficultyDescription")
"NORMAL")
"Weapons Extended 6"
)
(list
"Mode"
(if (typGetData &dsWEConfigurator; "ModeDescription")
(typGetData &dsWEConfigurator; "ModeDescription")
"VANILLA")
"Weapons Extended 6"
)
(list
"Dark Weapons"
(if (typGetData &dsWEConfigurator; "darkWeaponsDescription")
(typGetData &dsWEConfigurator; "darkWeaponsDescription")
"SKIP SHIELDS")
"Weapons Extended 6"
)
(list
(if (typGetData &svPLayer; "IdentifiedWeapons")
"Player Identified all the weapons"
"Player honored unknown weapons")
Nil
"Weapons Extended 6"
)
))
)
theList
)
</GetGlobalAchievements>
<OnGlobalPlayerLeftSystem>
(block Nil
(if (eq (sysGetName) "Eridani")
(typSetData &svPlayer; "leftEridani" True)
)
)
</OnGlobalPlayerLeftSystem>
</Events>
</StationType>
<!-- -------------------------------------------------------------------------------------------------- -->
<!-- STATIONS ITEMS STATIONS ITEMS STATIONS ITEMS STATIONS ITEMS STATIONS ITEMS STATIONS ITEMS STATIONS-->
<!-- -------------------------------------------------------------------------------------------------- -->
<StationType UNID="&WE_OGPIStation;" virtual="true">
<Events>
<OnGlobalPaneInit>
(switch
(eq aScreenUNID &dsShipInterior;)
(scrAddAction
gScreen
'WE6
-1
"WE6 Configurator"
"w"
(block Nil
(setq prevScreen &dsShipInterior;)
(scrShowScreen gScreen &dsWEConfigurator;)
)
)
)
</OnGlobalPaneInit>
</Events>
</StationType>
<DockScreen UNID="&dsWEConfigurator;"
name= "=(we_GetConfiguratorTitle)"
backgroundID= "none"
>
<OnScreenInit>
(block (diff mode diffDesc modeDesc)
(setq diff (or (typGetData &svPlayer; "WE_Difficulty") 1))
(setq mode (or (typGetData &svPlayer; "WE_Mode") 1))
(setq darkWeapons (or (typGetData &svPlayer; "WE_DarkWeapons") 1))
(setq onSwitch (or (typGetData &svPlayer; "WE_RandomizerOnSwitch") 1))
(setq diffDesc (@ (list "EASY" "NORMAL" "HARD") diff))
(setq modeDesc (@ (list
"Periculi's RANDOM WEAPONS MODE!"
"VANILLA MODE"
) mode))
(setq darkWeaponsDesc (@ (list "VANILLA" "SKIP SHIELDS") darkWeapons))
(setq onSwitchDesc (@ (list "OFF" "ON") onSwitch))
;; store the values on the type (so we don't have to recalculate it)
(typSetData &dsWEConfigurator; "Difficulty" diff)
(typSetData &dsWEConfigurator; "DifficultyDescription" diffDesc)
(typSetData &dsWEConfigurator; "Mode" mode)
(typSetData &dsWEConfigurator; "ModeDescription" modeDesc)
(typSetData &dsWEConfigurator; "darkWeapons" darkWeapons)
(typSetData &dsWEConfigurator; "darkWeaponsDescription" darkWeaponsDesc)
(typSetData &dsWEConfigurator; "onSwitch" onSwitch)
(typSetData &dsWEConfigurator; "onSwitchDescription" onSwitchDesc)
)
</OnScreenInit>
<InitialPane>
(or
(typGetData &dsWEConfigurator; "InitialPane")
"Default"
)
</InitialPane>
<Panes>
<Default>
<OnPaneInit>
(block (initialDesc)
(setq initialDesc (or (typGetData &dsWEConfigurator; "InitialDesc") ""))
;; nil it so it does not stick around
(typSetData &dsWEConfigurator; "InitialDesc" nil)
(scrSetDesc gScreen (cat
initialDesc
"Welcome to the Weapons Extended Configurator!\nThe Randomizer is "
(typGetData &dsWEConfigurator; "onSwitchDescription")
"\nThe difficulty is "
(typGetData &dsWEConfigurator; "DifficultyDescription")
"\nThe weapons mode is "
(typGetData &dsWEConfigurator; "ModeDescription")
"\nDark weapons behaviour is "
(typGetData &dsWEConfigurator; "darkWeaponsDescription")
"\n\nTHIS MENU WILL SELF-DEACTIVATE AFTER YOU LEAVE ERIDANI"
"\nSO CONFIGURE YOUR WE6 EXPERIENCE NOW!"
))
(if (typGetData &svPlayer; "leftEridani")
(block Nil
(scrEnableAction gScreen 0 nil)
(scrEnableAction gScreen 1 nil)
(scrEnableAction gScreen 2 nil)
(scrEnableAction gScreen 3 nil)
(scrEnableAction gScreen 4 nil)
)
)
)
</OnPaneInit>
<Actions>
<Action name="Change Difficulty" key="D">
(block Nil
(typSetData &dsWEConfigurator; "InitialPane" "Difficulty")
(typSetData &dsWEConfigurator; "Title" "Difficulty Selector")
(scrShowScreen gScreen &dsWEConfigurator;)
)
</Action>
<Action name="Change Weapons mode" key="W">
(block Nil
(typSetData &dsWEConfigurator; "InitialPane" "Mode")
(typSetData &dsWEConfigurator; "Title" "Weapons Mode Selector")
(scrShowScreen gScreen &dsWEConfigurator;)
)
</Action>
<Action name="Change Dark Weapons mode" key="A">
(block Nil
(typSetData &dsWEConfigurator; "InitialPane" "Dark")
(typSetData &dsWEConfigurator; "Title" "Dark Weapons Mode Selector")
(scrShowScreen gScreen &dsWEConfigurator;)
)
</Action>
<Action name="Identify weapons" key="I">
(block Nil
(typSetData &dsWEConfigurator; "InitialPane" "Identify")
(typSetData &dsWEConfigurator; "Title" "Identify Weapons")
(scrShowScreen gScreen &dsWEConfigurator;)
)
</Action>
<Action name="Turn ON/OFF Randomizer" key="T">
(block Nil
(typSetData &dsWEConfigurator; "InitialPane" "Switch")
(typSetData &dsWEConfigurator; "Title" "Randomizer ON/OFF switch")
(scrShowScreen gScreen &dsWEConfigurator;)
)
</Action>
<Action name="Exit" cancel="1" key="X">
(block nil
(typSetData &dsWEConfigurator; "InitialPane" nil)
(typSetData &dsWEConfigurator; "Title" nil)
(scrExitScreen gScreen)
)
</Action>
</Actions>
</Default>
<Difficulty>
<OnPaneInit>
(block nil
(scrSetDesc gScreen (cat
"You are playing in "
(typGetData &dsWEConfigurator; "DifficultyDescription")
" mode" "\n\nPlease select the difficulty level:"
))
(scrEnableAction gScreen (typGetData &dsWEConfigurator; "Difficulty") nil)
)
</OnPaneInit>
<Actions>
<Action name="Easy mode" key="E">
(block nil
(typSetData &svPlayer; "WE_Difficulty" 0)
(typSetData &svPlayer; "WE_ShieldPercentModifier" -25)
(typSetData &dsWEConfigurator; "InitialDesc" "The difficulty has been changed to EASY\n")
(typSetData &dsWEConfigurator; "InitialPane" nil)
(typSetData &dsWEConfigurator; "Title" nil)
(scrShowScreen gScreen &dsWEConfigurator;)
)
</Action>
<Action name="Normal" key="N">
(block nil
(typSetData &svPlayer; "WE_Difficulty" 1)
(typSetData &svPlayer; "WE_ShieldPercentModifier" 0)
(typSetData &dsWEConfigurator; "InitialDesc" "The difficulty has been changed to NORMAL\n")
(typSetData &dsWEConfigurator; "InitialPane" nil)
(typSetData &dsWEConfigurator; "Title" nil)
(scrShowScreen gScreen &dsWEConfigurator;)
)
</Action>
<Action name="Hard mode" key="H">
(block nil
(typSetData &svPlayer; "WE_Difficulty" 2)
(typSetData &svPlayer; "WE_ShieldPercentModifier" 25)
(typSetData &dsWEConfigurator; "InitialDesc" "The difficulty has been changed to HARD\n")
(typSetData &dsWEConfigurator; "InitialPane" nil)
(typSetData &dsWEConfigurator; "Title" nil)
(scrShowScreen gScreen &dsWEConfigurator;)
)
</Action>
<Action name="Return to main" cancel="1" key="U">
(block nil
(typSetData &dsWEConfigurator; "InitialPane" nil)
(typSetData &dsWEConfigurator; "Title" nil)
(scrShowScreen gScreen &dsWEConfigurator;)
)
</Action>
</Actions>
</Difficulty>
<Mode>
<OnPaneInit>
(block nil
(scrSetDesc gScreen (cat
"You are playing in "
(typGetData &dsWEConfigurator; "ModeDescription")
" mode" "\n\nPlease select the weapons mode:"
))
(scrEnableAction gScreen (typGetData &dsWEConfigurator; "Mode") nil)
)
</OnPaneInit>
<Actions>
<Action name="Periculi's random weapons mode!" key="P">
(block nil
(typSetData &svPlayer; "WE_Mode" 0)
(typSetData &dsWEConfigurator; "InitialDesc" "The weapons mode has been changed to Periculi's RANDOM WEAPONS MODE!\n")
(typSetData &dsWEConfigurator; "InitialPane" nil)
(typSetData &dsWEConfigurator; "Title" nil)
(scrShowScreen gScreen &dsWEConfigurator;)
)
</Action>
<Action name="Vanilla mode" key="V">
(block nil
(typSetData &svPlayer; "WE_Mode" 1)
(typSetData &dsWEConfigurator; "InitialDesc" "The weapons mode has been changed to VANILLA MODE\n")
(typSetData &dsWEConfigurator; "InitialPane" nil)
(typSetData &dsWEConfigurator; "Title" nil)
(scrShowScreen gScreen &dsWEConfigurator;)
)
</Action>
<Action name="Return to main" cancel="1" key="U">
(block nil
(typSetData &dsWEConfigurator; "InitialPane" nil)
(typSetData &dsWEConfigurator; "Title" nil)
(scrShowScreen gScreen &dsWEConfigurator;)
)
</Action>
</Actions>
</Mode>
<Dark>
<OnPaneInit>
(block nil
(scrSetDesc gScreen (cat
"Dark weapons behaviour is "
(typGetData &dsWEConfigurator; "darkWeaponsDescription")
" mode" "\n\nPlease select the weapons mode:"
))
(scrEnableAction gScreen (typGetData &dsWEConfigurator; "darkWeapons") nil)
)
</OnPaneInit>
<Actions>
<Action name="Dark Weapons behave normally (VANILLA)" key="n">
(block nil
(typSetData &svPlayer; "WE_DarkWeapons" 0)
(typSetData &dsWEConfigurator; "InitialDesc" "The weapons mode has been changed to VANILLA\n")
(typSetData &dsWEConfigurator; "InitialPane" nil)
(typSetData &dsWEConfigurator; "Title" nil)
(scrShowScreen gScreen &dsWEConfigurator;)
)
</Action>
<Action name="Dark Weapons skip shields" key="h">
(block nil
(typSetData &svPlayer; "WE_DarkWeapons" 1)
(typSetData &dsWEConfigurator; "InitialDesc" "The weapons mode has been changed to SKIP SHIELDS\n")
(typSetData &dsWEConfigurator; "InitialPane" nil)
(typSetData &dsWEConfigurator; "Title" nil)
(scrShowScreen gScreen &dsWEConfigurator;)
)
</Action>
<Action name="Return to main" cancel="1" key="U">
(block nil
(typSetData &dsWEConfigurator; "InitialPane" nil)
(typSetData &dsWEConfigurator; "Title" nil)
(scrShowScreen gScreen &dsWEConfigurator;)
)
</Action>
</Actions>
</Dark>
<Switch>
<OnPaneInit>
(block nil
(scrSetDesc gScreen (cat
"The Randomizer is "
(typGetData &dsWEConfigurator; "onSwitchDescription")
"\n\nPlease select an option:"
))
(scrEnableAction gScreen (typGetData &dsWEConfigurator; "onSwitch") nil)
)
</OnPaneInit>
<Actions>
<Action name="Turn OFF Randomizer!" key="F">
(block nil
(typSetData &svPlayer; "WE_RandomizerOnSwitch" 0)
(typSetData &dsWEConfigurator; "InitialDesc" "The Randomizer has been turned OFF!\n")
(typSetData &dsWEConfigurator; "InitialPane" nil)
(typSetData &dsWEConfigurator; "Title" nil)
(scrShowScreen gScreen &dsWEConfigurator;)
)
</Action>
<Action name="Turn ON Randomizer!" key="N">
(block nil
(typSetData &svPlayer; "WE_RandomizerOnSwitch" 1)
(typSetData &dsWEConfigurator; "InitialDesc" "The Randomizer has been turned ON!\n")
(typSetData &dsWEConfigurator; "InitialPane" nil)
(typSetData &dsWEConfigurator; "Title" nil)
(scrShowScreen gScreen &dsWEConfigurator;)
)
</Action>
<Action name="Return to main" cancel="1" key="U">
(block nil
(typSetData &dsWEConfigurator; "InitialPane" nil)
(typSetData &dsWEConfigurator; "Title" nil)
(scrShowScreen gScreen &dsWEConfigurator;)
)
</Action>
</Actions>
</Switch>
<Identify
desc="You can identify/un-identify weapons"
>
<Actions>
<Action name="IDENTIFY ALL!" key="I">
(block Nil
(itmEnumTypes "w" itemType
(itmSetKnown itemType)
)
;debug mode itmEnumTypes :D
;(itmEnumTypes "*" itemType
; (if (and (geq (itmGetLevel itemType) 1) (leq (itmGetLevel itemType) 25))
; (block nil
; (itmSetReference itemType)
; (itmSetKnown itemType)
; )
; )
;)
(typSetData &dsWEConfigurator; "InitialDesc" "Done! All the weapons ingame will now have their proper name\n")
(typSetData &dsWEConfigurator; "InitialPane" nil)
(typSetData &dsWEConfigurator; "Title" nil)
(typSetData &svPlayer; "IdentifiedWeapons" True)
(scrShowScreen gScreen &dsWEConfigurator;)
)
</Action>
<Action name="Make all main weapons unidentified!" key="N">
(block Nil
(itmEnumTypes "w~m -Launcher; -Ammo;" itemType
(itmSetKnown itemType nil)
)
(typSetData &dsWEConfigurator; "InitialDesc" "Done! All the non-launcher weapons ingame are now unidentified\n")
(typSetData &dsWEConfigurator; "InitialPane" nil)
(typSetData &dsWEConfigurator; "Title" nil)
(scrShowScreen gScreen &dsWEConfigurator;)
)
</Action>
<Action name="Return to main" cancel="1" key="U">
(block nil
(typSetData &dsWEConfigurator; "InitialPane" nil)
(typSetData &dsWEConfigurator; "Title" nil)
(scrShowScreen gScreen &dsWEConfigurator;)
)
</Action>
</Actions>
</Identify>
</Panes>
</DockScreen>
<!-- Orb Of Knowledge-->
<ItemType UNID="&itOrbOfKnowledge;"
name= "Orb Of Knowledge"
firstPlural= "true"
level= "25"
value= "1"
mass= "1"
frequency= "notrandom"
attributes= "HaloGem; MinorItem; CannotOrder; NotForSale"
description= "This Gem will give you the knowledge of all the weapons names. Use it only if you want to play without random names, otherwise just jettison it."
>
<Image imageID="&rsItems1;" imageX="0" imageY="576" imageWidth="96" imageHeight="96"/>
<Invoke>
(block Nil
; Remove the item from the player's list
(objRemoveItem gSource gItem 1)
; Identifies all the weapons in the game
(itmEnumTypes "w" itemType
(itmSetKnown itemType)
)
;debug mode itmEnumTypes :D
;(itmEnumTypes "*" itemType
; (if (and (geq (itmGetLevel itemType) 1) (leq (itmGetLevel itemType) 25))
; (block Nil
; (itmSetReference itemType)
; (itmSetKnown itemType)
; )
; ))
)
</Invoke>
</ItemType>
;-----------------------------------------------------------------------------------
;--------------------------GLOBALS--------------------------------------------------
;-----------------------------------------------------------------------------------
<Globals>
(block Nil
;;
;; CONFIGURATION
;;
;; WEAPONS
;; These are the enchancements that apply to weapons
(setq we_WeaponEnhancements (list
0x0101 0x0102 0x0103 0x0104 0x0105 0x0f01 0x0f02 0x0f03 0x1002
))
;; These are the enchancements that apply to shields (not used at the moment)
(setq we_ShieldEnhancements (list
0x0101 0x0102 0x0103 0x0104 0x0105 0x0f01 0x0f02 0x0f03 0x1002
))
;;removed negative enhancements (might get intruduced to balance too many AI ships with bonuses)
;0x8f01 0x8f02 0x8f03 0x8101 0x8102 0x8103 0x8104
;; These are the patterns from which weapons are generated
(setq we_WeaponPatterns (list
(list "cv--- ----- ----- -----" "cu--- ----- ----- -----") ;; level 1 a and b
(list "vcv-- ----- ----- -----" "vcuv- ----- ----- -----") ;; level 2 a and b
(list "-vcv- ----- ----- -----" "-vcu- ----- ----- -----") ;; level 3 a and b
(list "--vcv ----- ----- -----" "--vcu v---- ----- -----") ;; level 4 a and b
(list "---vc v---- ----- -----" "---vc uv--- ----- -----") ;; level 5 a and b
(list "----v cv--- ----- -----" "----v cuv-- ----- -----") ;; level 6 a and b
(list "----- vcv-- ----- -----" "----- vcuv- ----- -----") ;; level 7 a and b
(list "----- -vcv- ----- -----" "----- -vcuv ----- -----") ;; level 8 a and b
(list "----- --vcv ----- -----" "----- --vcu ----- -----") ;; level 9 a and b
(list "----- ---vc ----- -----" "----- ---uc ----- -----") ;; level 10 a and b
(list "----- ----v cv--- -----" "----- ----u cu--- -----") ;; level 11 a and b
(list "----- ----- vcv-- -----" "----- ----- ucu-- -----") ;; level 12 a and b
(list "----- ----- -vcv- -----" "----- ----- -ucu- -----") ;; level 13 a and b
(list "----- ----- --vcv -----" "----- ----- --ucu -----") ;; level 14 a and b
(list "----- ----- ---vc v----" "----- ----- ---uc u----") ;; level 15 a and b
(list "----- ----- ----v cv---" "----- ----- ----u cu---") ;; level 16 a and b
(list "----- ----- ----- vcv--" "----- ----- ----- ucu--") ;; level 17 a and b
(list "----- ----- ----- -vcv-" "----- ----- ----- -ucu-") ;; level 18 a and b
(list "----- ----- ----- --vcv" "----- ----- ----- --ucu") ;; level 19 a and b
))
;; There are some ships whose weapons we don't want to randomize
; removed from list on trial basis: &scGaianProcessor;
(setq we_WeaponShipSkipList (list
&scDragonSlaver; &scTheSlicerManticore; &scArcoVaughnHeavyRaider; &scKateMorgentalCruiser; &scXenophobeArk;
))
;; There are some ships whose shields we don't want to randomize
(setq we_ShieldShipSkipList (list
&scDragonSlaver; &scTheSlicerManticore; &scArcoVaughnHeavyRaider; &scLuminousDrone;
))
;;
;; This list provides attributes on items to look for, and modifiers
;; to add to the weapon generation criteria if found.
;; If there is no modifier specified it uses the +attribute;
;; Also an optional chance can be specified (an integer from 1 to 10)
;;
;; (list attribute chance modifier)
;;
(setq we_WeaponAttributeModifierList (list
(list "centauriWarlords")
(list "Ares" 10 " +Ares; -Ferian; -Ringers;")
(list "Ventari" 4)
(list "Ferian")
(list "Iocrym")
(list "OmniWeapon" 7)
(list "Urak" 7)
(list "Dwarg" 7)
(list "Gaian")
(list "MinerGear")
(list "AmmoAkan")
(list "AmmoThermo")
(list "AmmoTM7")
(list "AmmoNandao")
(list "AmmoBreacher")
(list "AmmoIocrym")
(list "AmmoKiloton")
(list "AmmoDragonfly")
(list "AmmoMicronuke")
(list "AmmoQuantumsphere")
(list "AmmoLongzhu")
(list "AmmoCnydocist")
(list "AmmoNAMI")
(list "AmmoMAG")
(list "AmmoStrelka")
(list "AmmoRasiermesser")
(list "AmmoHeavyNAMI")
(list "AmmoAres")
(list "AmmoKytryn")
(list "AmmoExtra1")
(list "AmmoExtra2")
(list "AmmoExtra3")
(list "AmmoExtra4")
(list "AmmoExtra5")
(list "AmmoExtra6")
(list "AmmoExtra7")
(list "AmmoExtra8")
(list "AmmoExtra9")
))
;;
;; This list sets criteria by sovereign to add to the weapon
;; generation criteria. Sovereigns that don't use overlapping
;; ships should use WE_ShipAttributeModifierList
;;
;;
;; (list sovereign modifier [chance])
;;
(setq we_SovereignAttributeModifierList (list
(list &svCommonwealth; " -Illegal +Commonwealth")
(list &svRogueFleet; " +CWFleet" 75)
(list &svFriendlyAuton; " -Illegal")
(list &svCorporate; " -Illegal +Commonwealth")
(list &svBlackMarket; "")
(list &svDefectiveAuton; " -Illegal")
(list &svRingers; "")
(list &svGladiator; " -Illegal -MinerGear" 90)
(list &svSistersOfDomina; "-Illegal")
(list &svCSCAntarctica; " +CWFleet")
(list &svFleetAssassins; " +CWFleet")
(list &svCommonwealthFleet; " +CWFleet")
(list &svPirates; " +Illegal" 40)
(list &svMarauders; "")
))
;;
;; This list sets criteria by ship attribute to add to the
;; weapon generation criteria.
;;
;; (list attribute modifier [chance])
;;
(setq we_ShipAttributeModifierList (list
(list "benninXenophobes" " +Xenophobe")
(list "ferian" " +Ferian")
(list "anarchists" "")
(list "gaianTerraformers" " +Gaian")
(list "heliotropes" " +Heliotrope")
(list "himalSettlers" "")
(list "huari" " +Huari")
(list "kobolWarlords" " +Kobol")
(list "penitent" " +Oracus")