-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathDXRMemes.uc
1549 lines (1427 loc) · 55.1 KB
/
DXRMemes.uc
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
class DXRMemes extends DXRActorsBase transient;
// make sure none of this affects speed or score, because it can be easily disabled
var Actor rotating;
function RandomDancing(Actor a)
{
if (IsHuman(a.class)) {
if (ScriptedPawn(a).Orders == 'Standing' ||
ScriptedPawn(a).Orders == 'Sitting' ||
ScriptedPawn(a).Orders == '') {
if (a.HasAnim('Dance')){
if (chance_single(dxr.flags.settings.dancingpercent)) ScriptedPawn(a).SetOrders('Dancing');
}
}
}
}
function PlayDressUp(Actor a,class<Actor> influencer, float rotYaw)
{
local int i;
local Rotator r;
a.Texture = influencer.default.Texture;
a.Mesh = influencer.default.Mesh;
for (i=0;i<=7;i++){
a.MultiSkins[i] = influencer.default.MultiSkins[i];
}
if (influencer.default.Physics == PHYS_Rotating){
a.RotationRate = influencer.default.RotationRate;
a.SetPhysics(influencer.default.Physics);
a.bFixedRotationDir = influencer.default.bFixedRotationDir;
}
a.DrawScale = a.CollisionHeight / influencer.default.CollisionHeight;
r.Yaw = rotYaw;
a.SetRotation(r);
}
function RandomLiberty()
{
local NYLiberty liberty;
local NYLibertyTop top;
local int i;
foreach AllActors(class'NYLibertyTop',top){
if(IsOctober()) {
top.style = STY_Translucent;
top.ScaleGlow = 0.5;
}
}
foreach AllActors(class'NYLiberty',liberty){
SetGlobalSeed("RandomLiberty");
if(IsOctober()) {
liberty.style = STY_Translucent;
liberty.ScaleGlow = 0.5;
}
if ( rng(3)!=0 && !IsAprilFools() ) return; //33% chance of getting a random statue
//Rotation doesn't work here because the statue is static
switch(rng(22)){
case 0: PlayDressUp(liberty,class'Cactus1',0); return;
case 1: PlayDressUp(liberty,class'HKBuddha',0); return;
case 2: PlayDressUp(liberty,class'Basketball',0); return;
case 3: PlayDressUp(liberty,class'#var(prefix)DXLogo',0); return;
case 4: PlayDressUp(liberty,class'Flowers',0); return;
case 5: PlayDressUp(liberty,class'Trophy',0); return;
case 6: PlayDressUp(liberty,class'LiquorBottle',0); return;
case 7: PlayDressUp(liberty,class'ChildMale2',0); return;
case 8: PlayDressUp(liberty,class'WaterCooler',0); return;
case 9: PlayDressUp(liberty,class'VendingMachine',0); return;
case 10: PlayDressUp(liberty,class'SodaCan',0); return;
case 11: PlayDressUp(liberty,class'BoneSkull',0); return;
case 12: PlayDressUp(liberty,class'Liquor40oz',0); return;
case 13: PlayDressUp(liberty,class'Barrel1',0);liberty.Skin=Texture'Barrel1Tex8'; return; //Poison barrel
case 14: PlayDressUp(liberty,class'Barrel1',0);liberty.Skin=Texture'Barrel1Tex11'; return; //Yellow barrel
case 15: PlayDressUp(liberty,class'BobPageAugmented',0); return;
case 16: PlayDressUp(liberty,class'JCDouble',0); return;
case 17: PlayDressUp(liberty,class'Tree1',0); return;
case 18: PlayDressUp(liberty,class'Tree2',0); return; //Tree3 looks bad, that's why it isn't here
case 19: PlayDressUp(liberty,class'Tree4',0); return;
case 20: PlayDressUp(liberty,class'Vase1',0); return;
case 21: PlayDressUp(liberty,class'Lamp1',0); return;
}
}
}
function RandomBobPage()
{
local BobPageAugmented bob;
local int i;
foreach AllActors(class'BobPageAugmented',bob){
SetGlobalSeed("RandomBobPage");
if ( rng(3)!=0 && !IsAprilFools() ) return; //33% chance of getting a random bob
switch(rng(28)){
case 0: PlayDressUp(bob,class'Cactus1',8000); return;
case 1: PlayDressUp(bob,class'Mailbox',8000); return;
case 2: PlayDressUp(bob,class'CarWrecked',8000); return;
case 3: PlayDressUp(bob,class'#var(prefix)DXLogo',8000); return;
case 4: PlayDressUp(bob,class'HKBuddha',8000); return;
case 5: PlayDressUp(bob,class'Lamp1',0); return;
case 6: PlayDressUp(bob,class'LiquorBottle',8000); return;
case 7: PlayDressUp(bob,class'Microscope',0); return;
case 8: PlayDressUp(bob,class'Seagull',-8000); return;
case 9: PlayDressUp(bob,class'SignFloor',8000); return;
case 10: PlayDressUp(bob,class'StatueLion',8000); return;
case 11: PlayDressUp(bob,class'Trashbag',8000); return;
case 12: PlayDressUp(bob,class'Trashbag2',8000); return;
case 13: PlayDressUp(bob,class'TrashCan3',0); return;
case 14: PlayDressUp(bob,class'Basketball',8000); return;
case 15: PlayDressUp(bob,class'Flowers',8000); return;
case 16: PlayDressUp(bob,class'ChairLeather',8000); return;
case 17: PlayDressUp(bob,class'NYLiberty',8000); return;
case 18: PlayDressUp(bob,class'NYLibertyTorch',8000); return;
case 19: PlayDressUp(bob,class'Trophy',8000); return;
case 20: PlayDressUp(bob,class'MiniSub',8000); return;
case 21: PlayDressUp(bob,class'WaterCooler',8000); return;
case 22: PlayDressUp(bob,class'Mutt',-8000); return;
case 23: PlayDressUp(bob,class'Fish2',-8000); return;
case 24: PlayDressUp(bob,class'MilitaryBot',-8000); return;
case 25: PlayDressUp(bob,class'VendingMachine',-8000); return;
case 26: PlayDressUp(bob,class'Hooker1',-8000); return;
case 27: PlayDressUp(bob,class'ChildMale2',-8000); return;
}
}
}
//These need a bit more manual fiddling than the others since you are so much closer to them, including underneath
function RandomMJ12Globe()
{
local Earth earth;
local int i;
local float scaleMult;
local Rotator startRot;
foreach AllActors(class'Earth',earth){
SetGlobalSeed("RandomGlobe");
earth.bIsSecretGoal=True;
startRot = earth.Rotation;
scaleMult=1.0;
if ( rng(3)!=0 && !IsAprilFools() ) return; //33% chance of getting a random globe
switch(rng(16)){
case 0:
PlayDressUp(earth,class'Basketball',0);
startRot = rotm(8000,0,7000,0); //Give it a bit of tilt for more drama
scaleMult = 2;
break;
case 1:
PlayDressUp(earth,class'BoneSkull',0);
startRot = rotm(0,32765,-5000,0); //Slightly tilted down
scaleMult = 1.0;
break;
case 2:
PlayDressUp(earth,class'Liquor40oz',0);
startRot = rotm(0,16000,12000,0);
scaleMult = 2;
break;
case 3:
PlayDressUp(earth,class'#var(prefix)DXLogo',0);
startRot = earth.Rotation;
scaleMult = 3;
break;
case 4:
PlayDressUp(earth,class'SodaCan',0);
startRot = rotm(6000,16000,12000,0);
scaleMult = 1.0;
break;
case 5: //Does this one even look good?
PlayDressUp(earth,class'BoneFemur',0);
startRot = rotm(0,16000,12000,0);
scaleMult = 0.25;
break;
case 6:
PlayDressUp(earth,class'ChildMale2',24000);
startRot = earth.Rotation;
scaleMult = 1.5;
break;
case 7:
PlayDressUp(earth,class'Trophy',0);
startRot = earth.Rotation;
scaleMult = 1.0;
break;
case 8:
PlayDressUp(earth,class'GrayCarcass',0);
startRot = rotm(-16385,20000,0,0);
scaleMult = 0.25;
break;
case 9:
PlayDressUp(earth,class'Mutt',24000);
startRot = earth.Rotation;
scaleMult = 1.5;
break;
case 10:
PlayDressUp(earth,class'IonStormLogo',-20000);
startRot = earth.Rotation;
scaleMult = 8;
break;
case 11:
PlayDressUp(earth,class'EidosLogo',-20000);
startRot = earth.Rotation;
scaleMult = 0.4;
break;
case 12:
PlayDressUp(earth,class'HKTukTuk',-20000);
startRot = earth.Rotation;
scaleMult = 0.6;
break;
case 13:
PlayDressUp(earth,class'CarWrecked',-20000);
startRot = earth.Rotation;
scaleMult = 1.0;
break;
case 14:
PlayDressUp(earth,class'MiniSub',-20000);
startRot = earth.Rotation;
scaleMult = 1.0;
break;
case 15:
PlayDressUp(earth,class'JCDouble',24000);
startRot = earth.Rotation;
scaleMult = 1.5;
break;
}
earth.RotationRate = rot(0,-750,0);
earth.DrawScale = earth.DrawScale * scaleMult;
earth.SetRotation(startRot);
return;
}
}
function PreFirstEntry()
{
Super.PreFirstEntry();
if(!class'MenuChoice_ToggleMemes'.static.IsEnabled(dxr.flags)) return;
switch(dxr.localURL)
{
case "15_AREA51_PAGE":
RandomBobPage();
break;
case "01_NYC_UNATCOIsland":
case "03_NYC_UNATCOIsland":
case "04_NYC_UNATCOIsland":
case "05_NYC_UNATCOIsland":
RandomLiberty();
break;
case "04_NYC_HOTEL":
if(IsAprilFools())
PaulToilet();
break;
case "06_HONGKONG_MJ12LAB":
RandomMJ12Globe();
break;
}
}
function AnyEntry()
{
local #var(prefix)DXLogo logo;
local #var(prefix)IonStormLogo islogo;
local #var(prefix)EidosLogo elogo;
local #var(prefix)ElectricityEmitter elec;
local Actor a;
local Rotator r;
local Vector v;
Super.AnyEntry();
TitleScreenRandoLogo();// do this even when memes disabled
if(!class'MenuChoice_ToggleMemes'.static.IsEnabled(dxr.flags)) return;
switch(dxr.localURL)
{
case "DXONLY":
case "DX":
l("Memeing up "$ dxr.localURL);
foreach AllActors(class'Actor', a) {
a.SetCollision(false,false,false);
}
foreach AllActors(class'#var(prefix)DXLogo', logo)
{
a = ReplaceWithRandomClass(logo);
if (IsHuman(a.class)){
ScriptedPawn(a).SetOrders('Standing');
}
//Maybe make them dance?
RandomDancing(a);
//Get it spinning just right
rotating = a;
a.SetPhysics(PHYS_None);
a.bFixedRotationDir = True;
a.bRotateToDesired = False;
r.Pitch = 2500;
r.Yaw = 5000;
r.Roll = 0;
a.RotationRate = r;
//Get rid of any ambient sounds it may make
a.AmbientSound = None;
GotoState('RotatingState');
}
foreach AllActors(class'#var(prefix)IonStormLogo', islogo)
{
a = ReplaceWithRandomClass(islogo);
if (IsHuman(a.class)){
ScriptedPawn(a).SetOrders('Standing');
}
//Maybe make them dance?
RandomDancing(a);
a.SetPhysics(PHYS_None);
a.DrawScale *= 2.0;
//Get rid of any ambient sounds it may make
a.AmbientSound = None;
}
foreach AllActors(class'#var(prefix)EidosLogo', elogo)
{
a = ReplaceWithRandomClass(elogo);
if (IsHuman(a.class)){
ScriptedPawn(a).SetOrders('Standing');
}
//Maybe make them dance?
RandomDancing(a);
a.SetPhysics(PHYS_None);
a.DrawScale *= 2.0;
//Get rid of any ambient sounds it may make
a.AmbientSound = None;
}
foreach AllActors(class'#var(prefix)ElectricityEmitter', elec)
{
v.Z = 70;
elec.move(v);
}
break;
case "INTRO":
case "ENDGAME1":
case "ENDGAME2":
case "ENDGAME3":
case "ENDGAME4":
case "ENDGAME4REV":
//case "00_TRAINING":
// extra randomization in the intro for the lolz
l("Memeing up "$ dxr.localURL);
RandomizeCutscene();
FixEndgameEndCamera();
break;
}
}
function TitleScreenRandoLogo()
{
local #var(prefix)DXText text;
local vector v;
if(dxr.localURL == "DXONLY" || dxr.localURL == "DX") {
foreach AllActors(class'#var(prefix)DXText',text)
{
text.bHidden=True; //Hide all the original text
}
}
if (dxr.localURL=="DX"){
text = Spawn(class'DXRText',,,vectm(-60.979568,57.046417,-137.022430),rotm(0,32768,0,0));
text.Skin = None;
text = Spawn(class'DXRText',,,vectm(138.886353,57.125278,-137.022430),rotm(0,32768,0,0));
text.Skin = Texture'DeusExDeco.Skins.DXTextTex2';
// Randomizer logo
v = vect(10, 57.15, -177.66);// midpoint
text = Spawn(class'DXRText',,,vectm(v.X - 100, v.Y, v.Z),rotm(0,32768,0,0));
text.Skin = Texture'RandomizerTextTex1'; //Left half of "Randomizer" text texture
text = Spawn(class'DXRText',,,vectm(v.X + 100, v.Y, v.Z),rotm(0,32768,0,0));
text.Skin = Texture'RandomizerTextTex2'; //Right half of "Randomizer" text texture
} else if (dxr.localURL=="DXONLY"){
text = Spawn(class'DXRText',,,vectm(-62.015648,-55.260841,-139.022430),rotm(0,49136,0,0));
text.Skin = None;
text = Spawn(class'DXRText',,,vectm(-61.787956,144.605042,-139.022430),rotm(0,49136,0,0));
text.Skin = Texture'DeusExDeco.Skins.DXTextTex2';
// Randomizer logo
v = vect(-62, 10, -178.990417);// midpoint
text = Spawn(class'DXRText',,,vectm(v.X, v.Y - 100, v.Z),rotm(0,49136,0,0));
text.Skin = Texture'RandomizerTextTex1'; //Left half of "Randomizer" text texture
text = Spawn(class'DXRText',,,vectm(v.X, v.Y + 100, v.Z),rotm(0,49136,0,0));
text.Skin = Texture'RandomizerTextTex2'; //Right half of "Randomizer" text texture
}
}
function FixEndgameEndCamera()
{
local CameraPoint cp;
local int endCameraSeq;
local bool RevisionMaps;
RevisionMaps = class'DXRMapVariants'.static.IsRevisionMaps(player());
switch(dxr.localURL)
{
case "ENDGAME1":
endCameraSeq=29; //Same in Vanilla and Revision
break;
case "ENDGAME2":
if(RevisionMaps)
endCameraSeq=32;
else
endCameraSeq=31;
break;
case "ENDGAME3":
if(RevisionMaps)
endCameraSeq=28;
else
endCameraSeq=27;
break;
default:
return;
}
foreach AllActors(class'CameraPoint',cp){
if (cp.sequenceNum==endCameraSeq){
cp.timeWaitPost+=60;
}
}
}
function PostFirstEntry()
{
local ScriptedPawn sp;
local InterpolationPoint p;
local LuciusDeBeers lucius;
local #var(prefix)SignFloor sf;
local vector v;
local rotator r;
Super.PostFirstEntry();
SetSeed("Memes Dancing");
foreach AllActors(class'ScriptedPawn',sp)
{
//Make people dance across the world, reduced rando sets this to 0%
// we want to keep this in memes disabled because it could affect speed/difficulty/score/races
RandomDancing(sp);
}
if(IsAprilFools()) {
foreach AllActors(class'#var(prefix)SignFloor', sf) {
class'FrictionTrigger'.static.CreateIce(sf, sf.Location, 160, 32);
}
}
if(!class'MenuChoice_ToggleMemes'.static.IsEnabled(dxr.flags)) return;
SetSeed("Memes InterpolationPoints");
/* might want to first search for the InterpolateTrigger to make sure you find the right tag for the chopper's path and not the camera's path, and maybe go through them in order by the Position variable
foreach AllActors(class'InterpolationPoint', p) {
if( p.Position == 0 || p.Position == 1 ) continue;
v = p.Location;
v.X += rngfn() * 160.0 * p.Position;
v.Y += rngfn() * 160.0 * p.Position;
v.Z += rngfn() * 160.0 * p.Position;
p.SetLocation( v );
r.Pitch = rng(65536);
r.Yaw = rng(65536);
r.Roll = rng(65536);
p.SetRotation( r );
}*/
//Add Leo Gold if he made it! and other intro/outro stuff
switch(dxr.localURL)
{
case "INTRO":
MakeAllGhosts();
break;
case "ENDGAME1":
case "ENDGAME2":
case "ENDGAME3":
case "ENDGAME4":
case "ENDGAME4REV":
AddLeo();
MakeAllGhosts();
break;
}
foreach AllActors(class'LuciusDeBeers', lucius) {
lucius.bInvincible = false;
}
}
function AddLeo()
{
local bool broughtLeo;
local bool alive;
local POVCorpse c;
local vector loc;
local Rotator rot;
local TerroristCommander leo;
local DeusExPlayer p;
foreach AllActors(class'DeusExPlayer',p){break;}
if (p!=None && POVCorpse(p.inHand)!=None){
c = POVCorpse(p.inHand);
if (c.carcClassString == "DeusEx.TerroristCommanderCarcass"){
broughtLeo = true;
alive = c.bNotDead;
}
}
if (!broughtLeo){
return;
}
if (alive){
rot.Yaw = 16472;
} else {
rot.Yaw = 0;
}
switch(dxr.localURL)
{
case "ENDGAME1":
case "ENDGAME2": //They actually lined these two up!
l("Endgame 1 or 2");
loc.X = 189;
loc.Y = -7816;
loc.Z = -48;
break;
case "ENDGAME3":
l("Endgame 3");
loc.X = 192;
loc.Y = -7813;
loc.Z = -48;
break;
case "ENDGAME4":
case "ENDGAME4REV":
l("Endgame 4");
loc.X = -736;
loc.Y = -22;
loc.Z = -32;
rot.Yaw = -8064; //Different angle in Dance Party
break;
}
if (alive){
leo = Spawn(class'TerroristCommander',,,loc,rot);
leo.bImportant=False; //Don't worry buddy, you're still important - I just don't want you gone
leo.SetOrders('Standing','',True);
leo.bInvincible=True; //In case of explosions or lightning...
} else {
Spawn(class'TerroristCommanderCarcass',,,loc,rot);
}
}
function PaulToilet()
{
local #var(prefix)PaulDenton paul;
local #var(prefix)Chair1 chair;
local #var(prefix)Toilet toilet;
local #var(prefix)FlagTrigger ft;
foreach AllActors(class'#var(prefix)PaulDenton', paul) {
chair = #var(prefix)Chair1(findNearestToActor(class'#var(prefix)Chair1', paul));
toilet = #var(prefix)Toilet(findNearestToActor(class'#var(prefix)Toilet', paul));
ft = #var(prefix)FlagTrigger(findNearestToActor(class'#var(prefix)FlagTrigger', paul));
break;
}
chair.Event = '';
chair.Destroy();
paul.SetLocation(toilet.Location);
ft.SetLocation(paul.Location);
}
state() RotatingState {
event Tick(float deltaTime)
{
local Rotator r;
if( rotating == None ) return;
r = rotating.Rotation;
r.Pitch += float(rotating.RotationRate.Pitch) * deltaTime;
r.Yaw += float(rotating.RotationRate.Yaw) * deltaTime;
r.Roll += float(rotating.RotationRate.Roll) * deltaTime;
rotating.SetRotation(r);
//This is a bit kludgy, HangingDecoration
//override the rotation behaviour.
//Worth it for the meme though
if (rotating.IsA('HangingDecoration')) {
HangingDecoration(rotating).origRot = r;
}
if (rotating.IsA('DeusExProjectile')) {
DeusExProjectile(rotating).bStuck = true;
}
}
}
state() JumpInTheLine {
event Tick(float delta)
{
local float t;
local #var(prefix)ScriptedPawn p;
local vector v;
// why does this only affect some of the ScriptedPawns?
foreach AllActors(class'#var(prefix)ScriptedPawn', p) {
if(MrH(p) != None) continue;
t = Level.TimeSeconds - p.Location.X - p.Location.Y;
t = sin(t / 2.0) * 160.0;
v = p.Location;
v.Z = t - 16;
p.SetLocation(v);
}
}
}
function RandomizeCutscene()
{
local Actor a;
local #var(prefix)Tree t;
local class<Actor> old_skips[6];
local int i;
//local CameraPoint c;
SetSeed("RandomizeCutscene");
foreach AllActors(class'#var(prefix)Tree', t)
{ // exclude 90% of trees from the SwapAll by temporarily hiding them
if( rng(100) < 90 ) t.bHidden = true;
}
for(i=0; i<ArrayCount(_skipactor_types); i++) {
old_skips[i] = _skipactor_types[i];
_skipactor_types[i] = None;
}
i=0;
_skipactor_types[i++] = class'DeusExPlayer';
_skipactor_types[i++] = class'Mover';
_skipactor_types[i++] = class'Earth';
#ifdef revision
_skipactor_types[i++] = class<Actor>(DynamicLoadObject("RevisionDeco.Rev_SphereLight", class'class'));
#endif
SwapAll("Engine.Actor", 20);
for(i=0; i<ArrayCount(_skipactor_types); i++) {
_skipactor_types[i] = old_skips[i];
}
foreach AllActors(class'#var(prefix)Tree', t)
{
t.bHidden = false;
}
foreach AllActors(class'Actor', a)
{
if( Mover(a) != None ) continue;
if( Earth(a) != None ) continue;
if( #var(prefix)BreakableGlass(a) != None ) continue;
if( a.IsA('Rev_SphereLight') ) continue;
if( a.bHidden || DeusExPlayer(a) != None ) continue;
if(chance_single(50))
SetActorScale(a, rngrange(1, 0.3, 1.7));
else
SetActorScale(a, rngrange(1, 0.8, 1.2));
if(chance_single(50))
a.Fatness = rng(50) + 105;
else
a.Fatness = rng(20) + 120;
}
/*foreach AllActors(class'CameraPoint', c)
{
c.bHidden = false;
}
SwapAll('CameraPoint', 100);
foreach AllActors(class'CameraPoint', c)
{
c.bHidden = true;
}*/
RandomBobPage();
RandomLiberty();
RandomMJ12Globe();
RandomizeDialog();
}
function MakeAllGhosts()
{
local #var(prefix)ScriptedPawn p;
local bool isEndgame4;
if(!IsOctober()) return;
if(dxr.localURL~="ENDGAME4" || dxr.localURL~="ENDGAME4REV") {
isEndgame4 = true;
GotoState('JumpInTheLine');
}
foreach AllActors(class'#var(prefix)ScriptedPawn', p) {
if(#var(prefix)Robot(p) != None) continue;
if(MrH(p) != None) continue;
class'DXRHalloween'.static.MakeGhost(p);
if(isEndgame4) {
p.SetPhysics(PHYS_None);
p.SetCollision(false,false,false);
p.SetLocation(p.Location+vect(0,0,8));// raise them by half a foot?
Level.Game.SetGameSpeed(0.5);
}
}
}
function SwapSpeech(ConSpeech a, ConSpeech b)
{
local int soundID;
local string subtitle;
subtitle = a.speech;
soundID = a.soundID;
a.speech = b.speech;
a.soundID = b.soundID;
b.speech = subtitle;
b.soundID = soundID;
}
function RandomizeDialog()
{
local ConSpeech s, speech[100];
local int i, j, num, soundID;
local string subtitle;
//local Conversation conv;
SetSeed("RandomizeDialog");
foreach AllObjects(class'ConSpeech', s) {
speech[num++] = s;
}
for(i=0;i<num;i++) {
if(chance_single(10)) {
j = rng(num);
SwapSpeech(speech[i], speech[j]);
}
}
/*foreach AllObjects(class'Conversation', conv) {
RandomizeDialogConversation(conv);
}*/
}
function RandomizeDialogConversation(Conversation conv)
{
local ConEvent co;
local ConEventSpeech es;
local ConSpeech s, speech[100];
local int i, j, num, soundID;
local string subtitle;
SetSeed("RandomizeDialogConversation "$conv.conName);
for(co=conv.eventList; co!=None; co=co.nextEvent) {
es = ConEventSpeech(co);
if(es==None) continue;
speech[num++] = es.conSpeech;
}
// last thing before release: do this per conversation...
for(i=0;i<num;i++) {
j = rng(num);
SwapSpeech(speech[i], speech[j]);
}
}
static function float GetVoicePitch(DXRando dxr){
if (dxr.IsAprilFools()){
if ((dxr.seed)%10>=5){
return 1.5;
} else {
return 0.75;
}
}
return 1.0;
}
function AddDXRCredits(CreditsWindow cw)
{
if(IsAprilFools()) {
cw.PrintLn();
cw.PrintHeader("APRIL FOOLS!");
cw.PrintLn();
cw.PrintLn();
}
}
function bool is_valid(string s, class<Object> o)
{// determines if a class is worthy of replacing the logo in the menu
local class<Actor> a;
a = class<Actor>(o);
if ( a == None ) return false;
if ( a.default.bHidden ) return false;
if ( a.default.Mesh == None ) return false;
if ( a.default.DrawType != DT_Mesh ) return false;
if ( a.default.Style != STY_Normal ) return false;
l( "if ( r == i++ ) return class'" $ s $ "';" );
//i++;//was a global variable in my code that outputted code...
return true;
}
function Actor ReplaceWithRandomClass(Actor old)
{
local Actor a;
local string newActorClass;
local int i;
for(i=0; i<10; i++) {
newActorClass = GetRandomActorClass();
if(newActorClass == "") {
err("GetRandomActorClass() got empty string");
continue;
}
l(old$" replaced with "$newActorClass);
a = ReplaceActor(old, newActorClass );
if(#var(injectsprefix)MedicalBot(a) != None && chance_single(50)) {
#var(injectsprefix)MedicalBot(a).MakeAugsOnly();
}
if(DXRJackOLantern(a) != None) {
a.SetRotation(rot(0, 16384, 0));
a.DrawScale *= 4;
}
if( a != None ) return a;
}
warning("ReplaceWithRandomClass("$old$") failed");
return None;
}
const num_random_actor_classes = 551;
function string GetRandomActorClass()
{
local string s;
s = _GetRandomActorClass(rng(num_random_actor_classes));
if(s=="") return "";
if(InStr(s, ".") != -1) return s;
#ifdef hx
return "HX.HX" $ s;
#else
return "DeusEx." $ s;
#endif
}
function ExtendedTests()
{
local int r;
local string s;
Super.ExtendedTests();
r = num_random_actor_classes;
s = _GetRandomActorClass(r);
teststring(s, "", "_GetRandomActorClass(" $ r $ ") is empty string, " $ s);
r--;
s = _GetRandomActorClass(r);
test(s!="", "_GetRandomActorClass(" $ r $ ") is not empty string, " $ s);
s = _GetRandomActorClass(0);
test(s!="", "_GetRandomActorClass(0) is not empty string, " $ s);
}
function string _GetRandomActorClass(int r)
{
local int i;
// DXRando classes
if(r==i++) return "#var(package).MrH";
//if(r=i++) return "#var(package).Spiderweb"; // doesn't look good
if(r==i++) return "#var(package).DXRJackOLantern";
if(r==i++) return "#var(package).DeathMarker";
if(r==i++) return "#var(package).BarDancer";
if(r==i++) return "#var(package).FrenchGray";
if(r==i++) return "#var(package).FrenchGrayCarcass";
if(r==i++) return "#var(package).LeMerchantCarcass";
if(r==i++) return "#var(package).MJ12Clone1";
if(r==i++) return "#var(package).MJ12Clone1Carcass";
if(r==i++) return "#var(package).MJ12Clone2";
if(r==i++) return "#var(package).MJ12Clone2Carcass";
if(r==i++) return "#var(package).MJ12Clone3";
if(r==i++) return "#var(package).MJ12Clone3Carcass";
if(r==i++) return "#var(package).MJ12Clone4";
if(r==i++) return "#var(package).MJ12Clone4Carcass";
if(r==i++) return "#var(package).MJ12CloneAugShield1";
if(r==i++) return "#var(package).MJ12CloneAugShield1Carcass";
if(r==i++) return "#var(package).MJ12CloneAugShield1NametagCarcass";
if(r==i++) return "#var(package).MJ12CloneAugStealth1";
if(r==i++) return "#var(package).MJ12CloneAugStealth1Carcass";
if(r==i++) return "#var(package).MJ12CloneAugStealth1NametagCarcass";
if(r==i++) return "#var(package).MJ12CloneAugTough1";
if(r==i++) return "#var(package).MJ12CloneAugTough1Carcass";
if(r==i++) return "#var(package).MJ12CloneAugTough1NametagCarcass";
if(r==i++) return "#var(package).NSFClone1";
if(r==i++) return "#var(package).NSFClone1Carcass";
if(r==i++) return "#var(package).NSFClone2";
if(r==i++) return "#var(package).NSFClone2Carcass";
if(r==i++) return "#var(package).NSFClone3";
if(r==i++) return "#var(package).NSFClone3Carcass";
if(r==i++) return "#var(package).NSFClone4";
if(r==i++) return "#var(package).NSFClone4Carcass";
if(r==i++) return "#var(package).NSFCloneAugShield1";
if(r==i++) return "#var(package).NSFCloneAugShield1Carcass";
if(r==i++) return "#var(package).NSFCloneAugShield1NametagCarcass";
if(r==i++) return "#var(package).NSFCloneAugStealth1";
if(r==i++) return "#var(package).NSFCloneAugStealth1Carcass";
if(r==i++) return "#var(package).NSFCloneAugStealth1NametagCarcass";
if(r==i++) return "#var(package).NSFCloneAugTough1";
if(r==i++) return "#var(package).NSFCloneAugTough1Carcass";
if(r==i++) return "#var(package).NSFCloneAugTough1NametagCarcass";
if(r==i++) return "#var(package).UNATCOClone1";
if(r==i++) return "#var(package).UNATCOClone1Carcass";
if(r==i++) return "#var(package).UNATCOClone2";
if(r==i++) return "#var(package).UNATCOClone2Carcass";
if(r==i++) return "#var(package).UNATCOClone3";
if(r==i++) return "#var(package).UNATCOClone3Carcass";
if(r==i++) return "#var(package).UNATCOClone4";
if(r==i++) return "#var(package).UNATCOClone4Carcass";
if(r==i++) return "#var(package).UNATCOCloneAugShield1";
if(r==i++) return "#var(package).UNATCOCloneAugShield1Carcass";
if(r==i++) return "#var(package).UNATCOCloneAugShield1NametagCarcass";
if(r==i++) return "#var(package).UNATCOCloneAugStealth1";
if(r==i++) return "#var(package).UNATCOCloneAugStealth1Carcass";
if(r==i++) return "#var(package).UNATCOCloneAugStealth1NametagCarcass";
if(r==i++) return "#var(package).UNATCOCloneAugTough1";
if(r==i++) return "#var(package).UNATCOCloneAugTough1Carcass";
if(r==i++) return "#var(package).UNATCOCloneAugTough1NametagCarcass";
// medbot class twice, with 50% chance to be an augbot
if(r==i++) return "#var(package).#var(injectsprefix)MedicalBot";
if(r==i++) return "#var(package).#var(injectsprefix)MedicalBot";
if(r==i++) return "#var(package).NervousWorker";
if(r==i++) return "#var(package).NervousWorkerCarcass";
if(r==i++) return "#var(package).LeMerchant";
// vanilla classes
if ( r == i++ ) return "AcousticSensor";
if ( r == i++ ) return "AdaptiveArmor";
if ( r == i++ ) return "AIPrototype";
if ( r == i++ ) return "AlarmLight";
if ( r == i++ ) return "AlarmUnit";
if ( r == i++ ) return "AlexJacobson";
if ( r == i++ ) return "AlexJacobsonCarcass";
if ( r == i++ ) return "Ammo10mm";
if ( r == i++ ) return "Ammo20mm";
if ( r == i++ ) return "Ammo3006";
if ( r == i++ ) return "Ammo762mm";
if ( r == i++ ) return "AmmoBattery";
if ( r == i++ ) return "ammocrate";
if ( r == i++ ) return "AmmoDart";
if ( r == i++ ) return "AmmoDartFlare";
if ( r == i++ ) return "AmmoDartPoison";
if ( r == i++ ) return "AmmoEMPGrenade";
//if ( r == i++ ) return "AmmoGasGrenade";
//if ( r == i++ ) return "AmmoGraySpit";
//if ( r == i++ ) return "AmmoGreaselSpit";
//if ( r == i++ ) return "AmmoLAM";
//if ( r == i++ ) return "AmmoNanoVirusGrenade";
if ( r == i++ ) return "AmmoNapalm";
//if ( r == i++ ) return "AmmoNone";
if ( r == i++ ) return "AmmoPepper";
if ( r == i++ ) return "AmmoPlasma";
if ( r == i++ ) return "AmmoRocket";
if ( r == i++ ) return "AmmoRocketMini";
//if ( r == i++ ) return "AmmoRocketRobot";
if ( r == i++ ) return "AmmoRocketWP";