-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathzscript.txt
More file actions
1329 lines (1262 loc) · 35.7 KB
/
Copy pathzscript.txt
File metadata and controls
1329 lines (1262 loc) · 35.7 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
version "4.8.2"
#include "zscript/RA_Vox/RAVoxHandler.zc"
#include "zscript/RA_Vox/RABlood.zc"
#include "zscript/RA_Vox/RASpinMixin.zc"
#include "zscript/fountain.zsc"
#include "zscript/teleporter_effects.zsc"
class DPWipeHandler : EventHandler
{
PlayerInfo p ;
int alive ;
int WipeStart ;
override void PlayerEntered( PlayerEvent e )
{
p = players[ consoleplayer ] ;
alive = 1 ;
}
override void WorldTick()
{
if( p.mo.health <= 0 )
{
if( alive == 1 )
{
Shader.SetEnabled( p, "DPWipe", true );
WipeStart = gametic ;
alive = 0 ;
}
Shader.SetUniform1f( p, "DPWipe", "timer", ( gametic - WipeStart ) * 0.5 );
}
else
{
Shader.SetEnabled( p, "DPWipe", false );
alive = 1 ;
}
}
}
Class TextureHotspot
{
int xpos, ypos, r, g, b, radius, spotin, spotout;
bool isspot;
}
Class LightTexture
{
TextureID tex;
Vector2 size;
Array<TextureHotspot> hotspots;
}
Class LightTextureHandler : EventHandler
{
Array<LightTexture> ltex;
override void OnRegister()
{
ltex.Clear();
int lmp;
if ( (lmp = Wads.FindLump("LTEXDEFS")) == -1 ) return;
String txt = Wads.ReadLump(lmp);
Array<String> lines, cline;
lines.Clear();
txt.Split(lines,"\n",0);
int nspots = 0;
LightTexture ltx;
TextureHotspot hs;
for ( int i=0; i<lines.size(); i++ )
{
if ( (lines[i].CharAt(0) == "#")
|| (lines[i].Length() <= 1) ) continue;
cline.Clear();
lines[i].Split(cline," ",0);
if ( nspots )
{
if ( (cline.size() != 6) && (cline.size() != 8) )
{
Console.Printf("LTEXDEFS: line %d: expected 6 or 8 tokens, got %d.",i+1,cline.size());
return;
}
hs = new("TextureHotspot");
hs.xpos = cline[0].ToInt();
hs.ypos = cline[1].ToInt();
hs.r = cline[2].ToInt();
hs.g = cline[3].ToInt();
hs.b = cline[4].ToInt();
hs.radius = cline[5].ToInt();
if ( cline.size() == 8 )
{
hs.spotin = cline[6].ToInt();
hs.spotout = cline[7].ToInt();
hs.isspot = true;
}
else hs.isspot = false;
ltx.hotspots.Push(hs);
nspots--;
continue;
}
if ( (cline.size() != 2) && (cline.size() != 3) )
{
Console.Printf("LTEXDEFS: line %d: expected 2 or 3 tokens, got %d.",i+1,cline.size());
return;
}
ltx = new("LightTexture");
if ( cline.size() == 2 )
{
ltx.tex = TexMan.CheckForTexture(cline[0],TexMan.Type_Any);
nspots = cline[1].ToInt();
}
else
{
if ( cline[1] ~== "T" ) ltx.tex = TexMan.CheckForTexture(cline[0],TexMan.Type_Wall);
else if ( cline[1] ~== "F" ) ltx.tex = TexMan.CheckForTexture(cline[0],TexMan.Type_Flat);
else ltx.tex = TexMan.CheckForTexture(cline[0],TexMan.Type_Any);
nspots = cline[2].ToInt();
}
ltx.size = TexMan.GetScaledSize(ltx.tex);
ltx.hotspots.Clear();
ltex.Push(ltx);
}
if ( nspots ) Console.Printf("LTEXDEFS: reached EOF when %d more hotspot definitions were expected",nspots);
}
void PopulateSideSection( Side s, int part, int h, Vector3 pos, Vector2 dir, Vector2 normal )
{
// check texture first
let t = s.GetTexture(part);
if ( !t.IsValid() || t.IsNull() ) return;
int ltx = -1;
for ( int i=0; i<ltex.Size(); i++ )
{
if ( ltex[i].tex != t ) continue;
ltx = i;
break;
}
if ( ltx == -1 ) return;
int w = int((s.v2().p-s.v1().p).length());
double xo, yo, xs, ys;
int tw, th;
xo = s.GetTextureXOffset(part);
yo = s.GetTextureYOffset(part);
xs = s.GetTextureXScale(part);
ys = s.GetTextureYScale(part);
// TODO properly handle pegged/unpegged flags
// also TODO fix misalignment on upper textures
tw = int(ltex[ltx].size.x);
th = int(ltex[ltx].size.y);
if (w <= 0 || h <= 0)
return;
int x = w / 2;
int y = h / 2;
int ox = int((x+xo)*xs);
int oy = int((y+yo)*ys);
for ( int hi=0; hi<ltex[ltx].hotspots.Size(); hi++ )
{
if ( (ox%tw == ltex[ltx].hotspots[hi].xpos) && (oy%th == ltex[ltx].hotspots[hi].ypos) )
{
if ( !level.IsPointInLevel(pos+(x*dir.x,x*dir.y,-y)+(normal.x*8.,normal.y*8.,0)) ) return;
let l = Actor.Spawn("PointLightAttenuated",pos+(x*dir.x,x*dir.y,-y)+(normal.x*8.,normal.y*8.,0));
l.args[0] = ltex[ltx].hotspots[hi].r;
l.args[1] = ltex[ltx].hotspots[hi].g;
l.args[2] = ltex[ltx].hotspots[hi].b;
l.args[3] = ltex[ltx].hotspots[hi].radius;
}
}
}
void PopulateSectorPlane( Sector s, int part, Secplane plane )
{
// check texture first
let t = s.GetTexture(part);
if ( !t.IsValid() || t.IsNull() ) return;
int ltx = -1;
for ( int i=0; i<ltex.Size(); i++ )
{
if ( ltex[i].tex != t ) continue;
ltx = i;
break;
}
if ( ltx == -1 ) return;
let c = s.centerspot;
if ( level.PointInSector(c) != s ) return;
int x = int(c.x);
int y = int(c.y);
double xo, yo, xs, ys, ang;
int tw, th;
xo = s.GetXOffset(part);
yo = s.GetYOffset(part);
xs = s.GetXScale(part);
ys = s.GetYScale(part);
ang = s.GetAngle(part); // TODO handle rotation
tw = int(ltex[ltx].size.x);
th = int(ltex[ltx].size.y);
if (tw <= 0) tw = 1;
if (th <= 0) th = 1;
int ox = int((x+xo)*xs);
int oy = int((y+yo)*ys);
if ( ox < 0 ) ox = tw-ox;
if ( oy < 0 ) oy = th-oy;
for ( int hi=0; hi<ltex[ltx].hotspots.Size(); hi++ )
{
if ( (ox%tw == ltex[ltx].hotspots[hi].xpos) && (oy%th == ltex[ltx].hotspots[hi].ypos) )
{
if ( !level.IsPointInLevel((x,y,plane.ZAtPoint((x,y)))+plane.Normal*8.) ) return;
Actor l;
if ( ltex[ltx].hotspots[hi].isspot )
{
l = Actor.Spawn("SpotLightAttenuated",(x,y,plane.ZAtPoint((x,y)))+plane.Normal*8.);
DynamicLight(l).SpotInnerAngle = ltex[ltx].hotspots[hi].spotin;
DynamicLight(l).SpotOuterAngle = ltex[ltx].hotspots[hi].spotout;
l.angle = atan2(plane.Normal.y,plane.Normal.x);
l.pitch = asin(-plane.Normal.z);
}
else l = Actor.Spawn("PointLightAttenuated",(x,y,plane.ZAtPoint((x,y)))+plane.Normal*8.);
l.args[0] = ltex[ltx].hotspots[hi].r;
l.args[1] = ltex[ltx].hotspots[hi].g;
l.args[2] = ltex[ltx].hotspots[hi].b;
l.args[3] = ltex[ltx].hotspots[hi].radius;
}
}
}
override void WorldLoaded( WorldEvent e )
{
if ( e.IsSaveGame || e.IsReopen ) return;
if ( level.Lines.Size() > 4000 || level.Sectors.Size() > 1200 )
{
Console.Printf("LightTextureHandler: skipped dynamic lights on large map (%d linedefs, %d sectors).", level.Lines.Size(), level.Sectors.Size());
return;
}
for ( int li=0; li<level.Lines.Size(); li++ )
{
Line l = level.Lines[li];
Vector2 n = (l.delta.y,-l.delta.x).unit();
Vector3 p1, p2;
p1.xy = l.v1.p;
p2.xy = l.v2.p;
if ( l.sidedef[1] )
{
// this part is a mess
int c1, f1, c2, f2;
c1 = int(l.frontsector.ceilingplane.ZAtPoint(l.v1.p));
f1 = int(l.frontsector.floorplane.ZAtPoint(l.v1.p));
c2 = int(l.backsector.ceilingplane.ZAtPoint(l.v1.p));
f2 = int(l.backsector.floorplane.ZAtPoint(l.v1.p));
// front upper
p1.z = c1;
if ( c1-c2 > 0 ) PopulateSideSection(l.sidedef[0],0,c1-c2,p1,l.delta.unit(),n);
// front middle
p1.z = c2;
if ( c2-f2 > 0 ) PopulateSideSection(l.sidedef[0],1,c2-f2,p1,l.delta.unit(),n);
// front bottom
p1.z = f2;
if ( f2-f1 > 0 ) PopulateSideSection(l.sidedef[0],2,f2-f1,p1,l.delta.unit(),n);
// back upper
p2.z = c2;
if ( c2-c1 > 0 ) PopulateSideSection(l.sidedef[1],0,c2-c1,p2,-l.delta.unit(),-n);
// back middle
p2.z = c2;
if ( c1-f1 > 0 ) PopulateSideSection(l.sidedef[1],1,c1-f1,p2,-l.delta.unit(),-n);
// back bottom
p2.z = f1;
if ( f1-f2 > 0 ) PopulateSideSection(l.sidedef[1],2,f1-f2,p2,-l.delta.unit(),-n);
}
else
{
int c, f;
c = int(l.frontsector.ceilingplane.ZAtPoint(l.v1.p));
f = int(l.frontsector.floorplane.ZAtPoint(l.v1.p));
p1.z = c;
PopulateSideSection(l.sidedef[0],1,c-f,p1,l.delta.unit(),n);
}
}
for ( int si=0; si<level.Sectors.Size(); si++ )
{
Sector s = level.Sectors[si];
PopulateSectorPlane(s,0,s.floorplane);
PopulateSectorPlane(s,1,s.ceilingplane);
}
}
}
#include "actors/fancy_floors.zsc"
#include "actors/fancy_ceilings.zsc"
#include "actors/fancy_walls.zsc"
Class SpawnEnvActorHandler : EventHandler
{
// In the interests of neatness, make each piece of the puzzle a different
// function that can be easily commented out for debugging's sake
override void WorldLoaded(WorldEvent e)
{
if (e.IsSaveGame || e.IsReopen)
return;
if (level.Sectors.Size() > 1200)
{
Console.Printf("SpawnEnvActorHandler: skipped sector ambience on large map (%d sectors).", level.Sectors.Size());
SpawnWallActors();
return;
}
SpawnFloorActors();
SpawnFloorActors_OldWay();
SpawnCeilingActors();
SpawnWallActors();
}
// Spawn stuff on the floor the "old way" (in the center of every sector,
// regardless of whether that center is actually in the sector or not.
// only useful for things that are very likely gonna be a square.
// Devised by Gutawer!
void SpawnFloorActors_OldWay()
{
for (int i = 0; i < level.Sectors.Size(); i++)
{
let c = level.Sectors[i].centerspot;
Actor.Spawn("FancyEnvActorFloorOldWay", (c.x, c.y, level.Sectors[i].floorplane.ZAtPoint(c)));
}
}
// Spawn floor ambience actors at each sector center instead of a full-map grid.
void SpawnFloorActors()
{
for (int i = 0; i < level.Sectors.Size(); i++)
{
let s = level.Sectors[i];
let c = s.centerspot;
double z = s.floorplane.ZAtPoint(c);
if (level.IsPointInLevel((c.x, c.y, z)))
Actor.Spawn("FancyEnvActorFloor", (c.x, c.y, z));
}
}
// Spawn ceiling ambience actors at each sector center.
void SpawnCeilingActors()
{
for (int i = 0; i < level.Sectors.Size(); i++)
{
let s = level.Sectors[i];
let c = s.centerspot;
double z = s.ceilingplane.ZAtPoint(c);
if (level.IsPointInLevel((c.x, c.y, z)))
Actor.Spawn("FancyEnvActorCeiling", (c.x, c.y, z));
}
}
// Spawn stuff on walls. Specifically, in the middle of appropriate linedefs.
// Thanks Nash and Phantombeta!
void SpawnWallActors()
{
if (level.Lines.Size() > 2500)
{
Console.Printf("SpawnEnvActorHandler: skipped wall ambience scan on large map (%d linedefs).", level.Lines.Size());
return;
}
for (int li = 0; li < level.Lines.Size(); li++)
{
Line l = level.Lines[li];
int spamf = 0;
int spamc = 0;
// do front first, then back
for (int ii = 0; ii < 2; ii++)
{
double lineLen = l.delta.Length ();
Vector2 spawnCoords = level.Vec2Offset (l.v1.p, l.delta.Unit () * (lineLen * 0.5));
spamc = Sector.pointInSector(spawnCoords).ceilingplane.zAtPoint(spawnCoords);
spamf = Sector.pointInSector(spawnCoords).floorplane.zAtPoint(spawnCoords);
/*
if (l.sidedef[ii] && l.sidedef[ii].GetTexture(Side.top) == TexMan.CheckForTexture("PLANET1", TexMan.Type_Any))
Actor.Spawn("FancyWallTestSound", (spawnCoords,(spamc - 32)));
if (l.sidedef[ii] && l.sidedef[ii].GetTexture(Side.mid) == TexMan.CheckForTexture("COMPUTE2", TexMan.Type_Any))
Actor.Spawn("FancyWallTestSound", (spawnCoords,(spamc - (spamf * 0.5))));
if (l.sidedef[ii] && l.sidedef[ii].GetTexture(Side.bottom) == TexMan.CheckForTexture("STEP6", TexMan.Type_Any))
Actor.Spawn("FancyWallTestSound", (spawnCoords,spamf));
*/
// Plutonia Waterfall
string WallWaterfall[8];
WallWaterfall[0] = "WFALL1";
WallWaterfall[1] = "WFALL2";
WallWaterfall[2] = "WFALL3";
WallWaterfall[3] = "WFALL4";
// for WADSMOOSH
WallWaterfall[4] = "PWFALL1";
WallWaterfall[5] = "PWFALL2";
WallWaterfall[6] = "PWFALL3";
WallWaterfall[7] = "PWFALL4";
for (int i = 0; i < 8; i++)
{
if (l.sidedef[ii] && l.sidedef[ii].GetTexture(Side.top) == TexMan.CheckForTexture(WallWaterfall[i], TexMan.Type_Any))
Actor.Spawn("FancyWallWaterfall", (spawnCoords,(spamc - 32)));
if (l.sidedef[ii] && l.sidedef[ii].GetTexture(Side.mid) == TexMan.CheckForTexture(WallWaterfall[i], TexMan.Type_Any))
Actor.Spawn("FancyWallWaterfall", (spawnCoords,(spamc - (spamf * 0.5))));
if (l.sidedef[ii] && l.sidedef[ii].GetTexture(Side.bottom) == TexMan.CheckForTexture(WallWaterfall[i], TexMan.Type_Any))
Actor.Spawn("FancyWallWaterfall", (spawnCoords,spamf));
}
// Bloodfall
string WallBloodfall[4];
WallBloodfall[0] = "BFALL1";
WallBloodfall[1] = "BFALL2";
WallBloodfall[2] = "BFALL3";
WallBloodfall[3] = "BFALL4";
for (int i = 0; i < 4; i++)
{
if (l.sidedef[ii] && l.sidedef[ii].GetTexture(Side.top) == TexMan.CheckForTexture(WallBloodfall[i], TexMan.Type_Any))
Actor.Spawn("FancyWallBloodfall", (spawnCoords,(spamc - 32)));
if (l.sidedef[ii] && l.sidedef[ii].GetTexture(Side.mid) == TexMan.CheckForTexture(WallBloodfall[i], TexMan.Type_Any))
Actor.Spawn("FancyWallBloodfall", (spawnCoords,(spamc - (spamf * 0.5))));
if (l.sidedef[ii] && l.sidedef[ii].GetTexture(Side.bottom) == TexMan.CheckForTexture(WallBloodfall[i], TexMan.Type_Any))
Actor.Spawn("FancyWallBloodfall", (spawnCoords,spamf));
}
// Doom 2 Slimefall
string WallSlimefall[4];
WallSlimefall[0] = "SFALL1";
WallSlimefall[1] = "SFALL2";
WallSlimefall[2] = "SFALL3";
WallSlimefall[3] = "SFALL4";
for (int i = 0; i < 4; i++)
{
if (l.sidedef[ii] && l.sidedef[ii].GetTexture(Side.top) == TexMan.CheckForTexture(WallSlimefall[i], TexMan.Type_Any))
Actor.Spawn("FancyWallSlimefall", (spawnCoords,(spamc - 32)));
if (l.sidedef[ii] && l.sidedef[ii].GetTexture(Side.mid) == TexMan.CheckForTexture(WallSlimefall[i], TexMan.Type_Any))
Actor.Spawn("FancyWallSlimefall", (spawnCoords,(spamc - (spamf * 0.5))));
if (l.sidedef[ii] && l.sidedef[ii].GetTexture(Side.bottom) == TexMan.CheckForTexture(WallSlimefall[i], TexMan.Type_Any))
Actor.Spawn("FancyWallSlimefall", (spawnCoords,spamf));
}
// Lavafalls
string WallLavafall[12];
// ObAddon Lavafall. Probably other lavafalls, too...
WallLavafall[0] = "LFALL1";
WallLavafall[1] = "LFALL2";
WallLavafall[2] = "LFALL3";
WallLavafall[3] = "LFALL4";
WallLavafall[4] = "LFAL21";
WallLavafall[5] = "LFAL22";
WallLavafall[6] = "LFAL23";
WallLavafall[7] = "LFAL24";
// CC4 Tex
WallLavafall[8] = "LAVFALL1";
WallLavafall[9] = "LAVFALL2";
WallLavafall[10] = "LAVFALL3";
WallLavafall[11] = "LAVFALL4";
for (int i = 0; i < 12; i++)
{
if (l.sidedef[ii] && l.sidedef[ii].GetTexture(Side.top) == TexMan.CheckForTexture(WallLavafall[i], TexMan.Type_Any))
Actor.Spawn("FancyWallLavafall", (spawnCoords,(spamc - 32)));
if (l.sidedef[ii] && l.sidedef[ii].GetTexture(Side.mid) == TexMan.CheckForTexture(WallLavafall[i], TexMan.Type_Any))
Actor.Spawn("FancyWallLavafall", (spawnCoords,(spamc - (spamf * 0.5))));
if (l.sidedef[ii] && l.sidedef[ii].GetTexture(Side.bottom) == TexMan.CheckForTexture(WallLavafall[i], TexMan.Type_Any))
Actor.Spawn("FancyWallLavafall", (spawnCoords,spamf));
}
// Doom 1 Slimedrip
string WallSlimedrip[3];
WallSlimedrip[0] = "SLADRIP1";
WallSlimedrip[1] = "SLADRIP2";
WallSlimedrip[2] = "SLADRIP3";
for (int i = 0; i < 3; i++)
{
if (l.sidedef[ii] && l.sidedef[ii].GetTexture(Side.top) == TexMan.CheckForTexture(WallSlimedrip[i], TexMan.Type_Any))
Actor.Spawn("FancyWallSlimedrip", (spawnCoords,(spamc - 32)));
if (l.sidedef[ii] && l.sidedef[ii].GetTexture(Side.mid) == TexMan.CheckForTexture(WallSlimedrip[i], TexMan.Type_Any))
Actor.Spawn("FancyWallSlimedrip", (spawnCoords,(spamc - (spamf * 0.5))));
if (l.sidedef[ii] && l.sidedef[ii].GetTexture(Side.bottom) == TexMan.CheckForTexture(WallSlimedrip[i], TexMan.Type_Any))
Actor.Spawn("FancyWallSlimedrip", (spawnCoords,spamf));
}
// Gargoyle Blood Fountain
string WallGargfont[3];
WallGargfont[0] = "GSTFONT1";
WallGargfont[1] = "GSTFONT2";
WallGargfont[2] = "GSTFONT3";
for (int i = 0; i < 3; i++)
{
if (l.sidedef[ii] && l.sidedef[ii].GetTexture(Side.top) == TexMan.CheckForTexture(WallGargfont[i], TexMan.Type_Any))
Actor.Spawn("FancyWallGargfont", (spawnCoords,(spamc - 32)));
if (l.sidedef[ii] && l.sidedef[ii].GetTexture(Side.mid) == TexMan.CheckForTexture(WallGargfont[i], TexMan.Type_Any))
Actor.Spawn("FancyWallGargfont", (spawnCoords,(spamc - (spamf * 0.5))));
if (l.sidedef[ii] && l.sidedef[ii].GetTexture(Side.bottom) == TexMan.CheckForTexture(WallGargfont[i], TexMan.Type_Any))
Actor.Spawn("FancyWallGargfont", (spawnCoords,spamf));
}
// Compstation
string WallCompstation[7];
WallCompstation[0] = "COMPSTA1";
WallCompstation[1] = "COMPSTA2";
// CC4 Tex
WallCompstation[2] = "COMPSTA3";
WallCompstation[3] = "COMPSTA4";
WallCompstation[4] = "COMPSTA5";
WallCompstation[5] = "COMPSTA6";
WallCompstation[6] = "COMPTALR";
for (int i = 0; i < 7; i++)
{
if (l.sidedef[ii] && l.sidedef[ii].GetTexture(Side.top) == TexMan.CheckForTexture(WallCompstation[i], TexMan.Type_Any))
Actor.Spawn("FancyWallCompstation", (spawnCoords,(spamc - 32)));
if (l.sidedef[ii] && l.sidedef[ii].GetTexture(Side.mid) == TexMan.CheckForTexture(WallCompstation[i], TexMan.Type_Any))
Actor.Spawn("FancyWallCompstation", (spawnCoords,(spamc - (spamf * 0.5))));
if (l.sidedef[ii] && l.sidedef[ii].GetTexture(Side.bottom) == TexMan.CheckForTexture(WallCompstation[i], TexMan.Type_Any))
Actor.Spawn("FancyWallCompstation", (spawnCoords,spamf));
}
// Fireblu
string WallFireblu[2];
WallFireblu[0] = "FIREBLU1";
WallFireblu[1] = "FIREBLU2";
for (int i = 0; i < 2; i++)
{
if (l.sidedef[ii] && l.sidedef[ii].GetTexture(Side.top) == TexMan.CheckForTexture(WallFireblu[i], TexMan.Type_Any))
Actor.Spawn("FancyWallFireblu", (spawnCoords,(spamc - 32)));
if (l.sidedef[ii] && l.sidedef[ii].GetTexture(Side.mid) == TexMan.CheckForTexture(WallFireblu[i], TexMan.Type_Any))
Actor.Spawn("FancyWallFireblu", (spawnCoords,(spamc - (spamf * 0.5))));
if (l.sidedef[ii] && l.sidedef[ii].GetTexture(Side.bottom) == TexMan.CheckForTexture(WallFireblu[i], TexMan.Type_Any))
Actor.Spawn("FancyWallFireblu", (spawnCoords,spamf));
}
// Firey Walls
string WallFirewall[9];
WallFirewall[0] = "FIREMAG1";
WallFirewall[1] = "FIREMAG2";
WallFirewall[2] = "FIREMAG3";
WallFirewall[3] = "FIREWALL";
WallFirewall[4] = "FIREWALA";
WallFirewall[5] = "FIREWALB";
WallFirewall[6] = "FIRELAVA";
WallFirewall[7] = "FIRELAV2";
WallFirewall[8] = "FIRELAV3";
for (int i = 0; i < 9; i++)
{
if (l.sidedef[ii] && l.sidedef[ii].GetTexture(Side.top) == TexMan.CheckForTexture(WallFirewall[i], TexMan.Type_Any))
Actor.Spawn("FancyWallFirewall", (spawnCoords,(spamc - 32)));
if (l.sidedef[ii] && l.sidedef[ii].GetTexture(Side.mid) == TexMan.CheckForTexture(WallFirewall[i], TexMan.Type_Any))
Actor.Spawn("FancyWallFirewall", (spawnCoords,(spamc - (spamf * 0.5))));
if (l.sidedef[ii] && l.sidedef[ii].GetTexture(Side.bottom) == TexMan.CheckForTexture(WallFirewall[i], TexMan.Type_Any))
Actor.Spawn("FancyWallFirewall", (spawnCoords,spamf));
}
// Generic Hummy Tech
string WallTechhum[9];
WallTechhum[0] = "COMPTALL";
WallTechhum[1] = "COMP2";
WallTechhum[2] = "SPACEW3";
WallTechhum[3] = "COMPUTE1";
WallTechhum[4] = "PLANET1";
// CC4 Tex
WallTechhum[5] = "COMPUTE4";
WallTechhum[6] = "COMPUTE7";
WallTechhum[7] = "COMPUTE8";
WallTechhum[8] = "COMPUTE9";
for (int i = 0; i < 9; i++)
{
if (l.sidedef[ii] && l.sidedef[ii].GetTexture(Side.top) == TexMan.CheckForTexture(WallTechhum[i], TexMan.Type_Any))
Actor.Spawn("FancyWallTechhum", (spawnCoords,(spamc - 32)));
if (l.sidedef[ii] && l.sidedef[ii].GetTexture(Side.mid) == TexMan.CheckForTexture(WallTechhum[i], TexMan.Type_Any))
Actor.Spawn("FancyWallTechhum", (spawnCoords,(spamc - (spamf * 0.5))));
if (l.sidedef[ii] && l.sidedef[ii].GetTexture(Side.bottom) == TexMan.CheckForTexture(WallTechhum[i], TexMan.Type_Any))
Actor.Spawn("FancyWallTechhum", (spawnCoords,spamf));
}
// Wall-Based Lighting
string WallLights[18];
WallLights[0] = "LITE3";
WallLights[1] = "LITE5";
WallLights[2] = "LITEBLU1";
WallLights[3] = "LITEBLU4";
WallLights[4] = "BRICKLIT";
WallLights[5] = "BSTONE3";
WallLights[6] = "LITE2";
WallLights[7] = "LITE96";
WallLights[8] = "LITEMET";
WallLights[9] = "LITERED";
WallLights[10] = "LITESTON";
WallLights[11] = "LITE4";
WallLights[12] = "LITEGRN1";
WallLights[13] = "LITERED1";
WallLights[14] = "LITERED2";
WallLights[15] = "LITEYEL1";
WallLights[16] = "LITEYEL2";
WallLights[17] = "LITEYEL3";
for (int i = 0; i < 18; i++)
{
if (l.sidedef[ii] && l.sidedef[ii].GetTexture(Side.top) == TexMan.CheckForTexture(WallLights[i], TexMan.Type_Any))
Actor.Spawn("FancyWallLights", (spawnCoords,(spamc - 32)));
if (l.sidedef[ii] && l.sidedef[ii].GetTexture(Side.mid) == TexMan.CheckForTexture(WallLights[i], TexMan.Type_Any))
Actor.Spawn("FancyWallLights", (spawnCoords,(spamc - (spamf * 0.5))));
if (l.sidedef[ii] && l.sidedef[ii].GetTexture(Side.bottom) == TexMan.CheckForTexture(WallLights[i], TexMan.Type_Any))
Actor.Spawn("FancyWallLights", (spawnCoords,spamf));
}
// CCTEX4/ObAddon Static Monitor
string WallStatic[4];
WallStatic[0] = "COMPFUZ1";
WallStatic[1] = "COMPFUZ2";
WallStatic[2] = "COMPFUZ3";
WallStatic[3] = "COMPFUZ4";
for (int i = 0; i < 4; i++)
{
if (l.sidedef[ii] && l.sidedef[ii].GetTexture(Side.top) == TexMan.CheckForTexture(WallStatic[i], TexMan.Type_Any))
Actor.Spawn("FancyWallStatic", (spawnCoords,(spamc - 32)));
if (l.sidedef[ii] && l.sidedef[ii].GetTexture(Side.mid) == TexMan.CheckForTexture(WallStatic[i], TexMan.Type_Any))
Actor.Spawn("FancyWallStatic", (spawnCoords,(spamc - (spamf * 0.5))));
if (l.sidedef[ii] && l.sidedef[ii].GetTexture(Side.bottom) == TexMan.CheckForTexture(WallStatic[i], TexMan.Type_Any))
Actor.Spawn("FancyWallStatic", (spawnCoords,spamf));
}
// One-Offs
// Creepy Face Texture
if (l.sidedef[ii] && l.sidedef[ii].GetTexture(Side.top) == TexMan.CheckForTexture("SP_FACE1", TexMan.Type_Any))
Actor.Spawn("FancyWallFaces", (spawnCoords,(spamc - 32)));
if (l.sidedef[ii] && l.sidedef[ii].GetTexture(Side.mid) == TexMan.CheckForTexture("SP_FACE1", TexMan.Type_Any))
Actor.Spawn("FancyWallFaces", (spawnCoords,(spamc - (spamf * 0.5))));
if (l.sidedef[ii] && l.sidedef[ii].GetTexture(Side.bottom) == TexMan.CheckForTexture("SP_FACE1", TexMan.Type_Any))
Actor.Spawn("FancyWallFaces", (spawnCoords,spamf));
}
}
}
}
class FancyEnvActorFloor : Actor
{
Default
{
-SOLID
+DONTSPLASH
+NOTELEPORT
+NOCLIP
+NOBLOCKMAP
RenderStyle "None";
radius 1;
height 1;
}
States
{
Spawn:
TNT1 A 0;
TNT1 A 0
{
// this is marginally less dumb than last time
// Nukage
string FloorNukage[4];
FloorNukage[0] = "NUKAGE1";
FloorNukage[1] = "NUKAGE2";
FloorNukage[2] = "NUKAGE3";
FloorNukage[3] = "NUKAGE4";
for (int i = 0; i < 4; i++)
{
if (floorpic == TexMan.CheckForTexture(FloorNukage[i], TexMan.Type_Any))
{
if (!CountProximity ("FancySectorNukageCore", 256))
{
A_SpawnItem("FancySectorNukageCore");
}
A_SpawnItem("FancySectorNukage");
}
}
// Water
string FloorWater[4];
FloorWater[0] = "FWATER1";
FloorWater[1] = "FWATER2";
FloorWater[2] = "FWATER3";
FloorWater[3] = "FWATER4";
for (int i = 0; i < 4; i++)
{
if (floorpic == TexMan.CheckForTexture(FloorWater[i], TexMan.Type_Any))
A_SpawnItem("FancySectorWaterCore");
}
// Slime
string FloorSlime[12];
FloorSlime[0] = "SLIME01";
FloorSlime[1] = "SLIME02";
FloorSlime[2] = "SLIME03";
FloorSlime[3] = "SLIME04";
FloorSlime[4] = "SLIME05";
FloorSlime[5] = "SLIME06";
FloorSlime[6] = "SLIME07";
FloorSlime[7] = "SLIME08";
// ObAddon black oil sludge
FloorSlime[8] = "SLUDGE01";
FloorSlime[9] = "SLUDGE02";
FloorSlime[10] = "SLUDGE03";
FloorSlime[11] = "SLUDGE04";
for (int i = 0; i < 12; i++)
{
if (floorpic == TexMan.CheckForTexture(FloorSlime[i], TexMan.Type_Any))
A_SpawnItem("FancySectorSlimeCore");
}
// Lava
string FloorLava[8];
FloorLava[0] = "LAVA1";
FloorLava[1] = "LAVA2";
FloorLava[2] = "LAVA3";
FloorLava[3] = "LAVA4";
// ObAddon Quake Lava
FloorLava[4] = "QLAVA1";
FloorLava[5] = "QLAVA2";
FloorLava[6] = "QLAVA3";
FloorLava[7] = "QLAVA4";
for (int i = 0; i < 8; i++)
{
if (floorpic == TexMan.CheckForTexture(FloorLava[i], TexMan.Type_Any))
{
if (!CountProximity ("FancySectorLavaCore", 256))
{
A_SpawnItem("FancySectorLavaCore");
}
A_SpawnItem("FancySectorLava");
}
}
// Blood
string FloorBlood[4];
FloorBlood[0] = "BLOOD1";
FloorBlood[1] = "BLOOD2";
FloorBlood[2] = "BLOOD3";
FloorBlood[3] = "BLOOD4";
for (int i = 0; i < 4; i++)
{
if (floorpic == TexMan.CheckForTexture(FloorBlood[i], TexMan.Type_Any))
A_SpawnItem("FancySectorSlimeCore");
}
// Hot
string FloorHot[4];
FloorHot[0] = "SLIME09";
FloorHot[1] = "SLIME10";
FloorHot[2] = "SLIME11";
FloorHot[3] = "SLIME12";
for (int i = 0; i < 4; i++)
{
if (floorpic == TexMan.CheckForTexture(FloorHot[i], TexMan.Type_Any))
A_SpawnItem("FancySectorHotCore");
}
// XWATER from ObAddon
string FloorXWater[4];
FloorXWater[0] = "XWATER1";
FloorXWater[1] = "XWATER2";
FloorXWater[2] = "XWATER3";
FloorXWater[3] = "XWATER4";
for (int i = 0; i < 4; i++)
{
if (floorpic == TexMan.CheckForTexture(FloorXWater[i], TexMan.Type_Any))
A_SpawnItem("FancySectorXWaterCore");
}
}
Stop;
Remove:
TNT1 A 0;
stop;
}
}
class FancyEnvActorFloorOldWay : Actor
{
Default
{
-SOLID
+DONTSPLASH
+NOTELEPORT
+NOCLIP
+NOBLOCKMAP
RenderStyle "None";
radius 1;
height 1;
}
States
{
Spawn:
TNT1 A 0;
TNT1 A 0
{
// Floor Teleporter
string FloorTeleporter[10];
FloorTeleporter[0] = "GATE1";
FloorTeleporter[1] = "GATE2";
FloorTeleporter[2] = "GATE3";
FloorTeleporter[3] = "GATE4";
// CC4 Tex
FloorTeleporter[4] = "GATE3TN";
FloorTeleporter[5] = "GATE4BL";
FloorTeleporter[6] = "GATE4GN";
FloorTeleporter[7] = "GATE4OR";
FloorTeleporter[8] = "GATE4RD";
FloorTeleporter[9] = "GATE4YL";
for (int i = 0; i < 10; i++)
{
if (floorpic == TexMan.CheckForTexture(FloorTeleporter[i], TexMan.Type_Any))
A_SpawnItem("FancySectorTeleporterCore");
}
}
Stop;
Remove:
TNT1 A 0;
stop;
}
}
class FancyEnvActorCeiling : Actor
{
Default
{
-SOLID
+DONTSPLASH
+NOTELEPORT
+NOCLIP
+NOBLOCKMAP
RenderStyle "None";
radius 1;
height 1;
}
States
{
Spawn:
TNT1 A 0;
TNT1 A 0
{
// back to the dumb ways
if (ceilingpic == TexMan.CheckForTexture("F_SKY1", TexMan.Type_Any))
A_SpawnItem("FancySectorSky");
// Generic Ceiling Lights
string CeilingLights[10];
CeilingLights[0] = "CEIL1_2";
CeilingLights[1] = "CEIL1_3";
CeilingLights[2] = "CEIL3_6";
CeilingLights[3] = "FLAT2";
CeilingLights[4] = "FLAT17";
CeilingLights[5] = "GRNLITE1";
CeilingLights[6] = "TLITE6_1";
CeilingLights[7] = "TLITE6_4";
CeilingLights[8] = "TLITE6_5";
CeilingLights[9] = "TLITE6_6";
for (int i = 0; i < 10; i++)
{
if (ceilingpic == TexMan.CheckForTexture(CeilingLights[i], TexMan.Type_Any))
A_SpawnItem("FancySectorCeilingLite");
}
}
Stop;
}
}
Class VisualSpecialEffect : ACTOR
{
Default
{
+CLIENTSIDEONLY
+NOGRAVITY
+NOINTERACTION
+NOBLOCKMAP
+NOTELEPORT
+ROLLSPRITE
+FORCEXYBILLBOARD
+NOCLIP
+DONTSPLASH
Renderstyle "Add";
}
}
Class BouncyPhysicalThing : ACTOR
{
Default
{
+ROLLSPRITE
+DOOMBOUNCE
+FORCEXYBILLBOARD
+CLIENTSIDEONLY
+NOTELEPORT
+PAINLESS
+ALLOWBOUNCEONACTORS
+MISSILE
-NOGRAVITY
-CANBOUNCEWATER
-NOINTERACTION
Renderstyle "translucent";
Speed 0.01;
BounceType "Doom";
BounceCount 4;
Gravity 0.85;
Health 1;
Radius 1;
Height 2;
Mass 1;
}
}
Class LiquidParticle : BouncyPhysicalThing
{
Default
{
+NOTRIGGER
+EXPLODEONWATER
+DONTSPLASH
+CANNOTPUSH
+ALLOWTHRUFLAGS
+THRUACTORS
-NOGRAVITY
-SKYEXPLODE
-NOINTERACTION
-BRIGHT
BounceCount 1;
BounceFACTOR 0.25;
Friction 0.85;
Renderstyle "translucent";
Radius 2;
Height 4;
Speed 3;
Damage 0;
Alpha 0.92;
Scale 0.85;
Mass 3;
Gravity 1.08;
}
States
{
Spawn:
LQP0 A 0 NoDelay;
LQP0 A 0 A_SetScale(0.01 * random(55,99));
TNT1 A 0 A_Jump(255,"Spawn1", "Spawn2");
Spawn1:
LQP0 AAAAAAAAAA 1 A_SpawnItemEx("LiquidParticleTrail", flags: SXF_TRANSFERTRANSLATION);
LQP0 AAAAAAAAAA 1 A_SpawnItemEx("LiquidParticleTrail", flags: SXF_TRANSFERTRANSLATION);
LQP0 AAAAAAAAAA 1 A_SpawnItemEx("LiquidParticleTrail", flags: SXF_TRANSFERTRANSLATION);
LQP0 AAAAAAAAAA 1 A_FadeOut(0.1);
Stop;
Spawn2:
LQP0 AAAAAA 1 A_SpawnItemEx("LiquidParticleTrail", flags: SXF_TRANSFERTRANSLATION);
LQP0 B 1;
LQP0 CD 1;
Stop;
Crash:
LQP0 B 1;
LQP0 CD 1;
Stop;
Death:
LQP0 B 1;
LQP0 CD 1;
Stop;
}
}
Class LiquidParticleTrail : VisualSpecialEffect
{
Default
{
+PAINLESS
+MISSILE
+NOTRIGGER
+THRUACTORS
+EXPLODEONWATER
+NOCLIP
-NOGRAVITY
-NOINTERACTION
-SKYEXPLODE
-BRIGHT
Renderstyle "translucent";
Speed 3;
Damage 0;
Alpha 0.92;
Scale 0.66;
Mass 2;
Gravity 1;
}
States
{
Spawn:
LQP0 A 0 NoDelay;
LQP0 AAAAA 1 A_FadeOut(0.1);
LQP0 AAAAA 1 A_FadeOut(0.1);
Stop;
Crash:
LQP0 BCD 1;
Stop;
Death:
LQP0 BCD 1;
Stop;
}
}