-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathENEMYSTATES.CON
2431 lines (2269 loc) · 69.8 KB
/
ENEMYSTATES.CON
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
// Checks for bosses to put up life meters.
state checkbosslifemeters
ifvarand ACTORFLAGS 1024
{
ifvare BOSSMETERID1 -1
{
setvarvar BOSSMETERID1 THISACTOR
}
else
{
ifvare BOSSMETERID2 -1
{
setvarvar BOSSMETERID2 BOSSMETERID1
setvarvar BOSSMETERID1 THISACTOR
}
else
{
setvarvar BOSSMETERID3 BOSSMETERID2
setvarvar BOSSMETERID2 BOSSMETERID1
setvarvar BOSSMETERID1 THISACTOR
}
}
}
ends
// Makes it that monsters have to be properly facing the player to land damage with melee attacks [like for if they're blinded or confused]
state miscmeleeangle_check
findnearsprite APLAYER 2560 TEMP
ifvarn TEMP -1
{
getactor[TEMP].x mx
getactor[TEMP].y my
getactor[THISACTOR].x x
getactor[THISACTOR].y y
subvarvar mx x
subvarvar my y
getangle angvar mx my
setvarvar temp angvar
subvar temp 256
addvar temp 2048
setvarvar tempb angvar
addvar tempb 256
addvar tempb 2048
}
getactor[THISACTOR].ang tempc
addvar tempc 2048
ends
// Clamps Angle checks for specfic actors
state actorproperangle
getactor[THISACTOR].ang tempe
ifvarl tempe 0 addvar tempe 2048
ifvarg tempe 2047 subvar tempe 2048
setactor[THISACTOR].ang tempe
ends
state miscspeedchecks-actors
// Check Status Ailments
ifvarand ACTORSTATUS? 2 // Haste
{
mulvar ACTORSPEED 125
divvar ACTORSPEED 100
}
else
ifvarand ACTORSTATUS? 4 // Slow
{
mulvar ACTORSPEED 75
divvar ACTORSPEED 100
}
ifvarand ACTORSTATUS? 16 // Dimness
{
// Random 90-100% speed
randvar TEMPVAR 5
ifrnd 128 mulvar TEMPVAR -1
addvar TEMPVAR 95
mulvarvar ACTORSPEED TEMPVAR4
divvar ACTORSPEED 100
}
ifvarand ACTORSTATUS? 128 // Confusion
{
// Random 80-100% speed
randvar TEMPVAR 10
ifrnd 128 mulvar TEMPVAR -1
addvar TEMPVAR 90
mulvarvar ACTORSPEED TEMPVAR4
divvar ACTORSPEED 100
}
// Check Winter Clothes
ifactor ROTATEGUN nullop
else ifactor DRONE nullop
else ifactor TANK nullop
else ifactor EMPTYTANK nullop
else ifactor SCORPIONTANK nullop
else
{
ifvarg enemywinterclothes 0
{
setvar TEMPVAR4 8
mulvarvar TEMPVAR4 enemywinterclothes
divvar TEMPVAR4 100
setvar TEMPVAR 150
subvarvar TEMPVAR TEMPVAR4
mulvarvar ACTORSPEED TEMPVAR
divvar ACTORSPEED 150
}
}
// Check Enemy's Health Levels
setvarvar TEMPVAR4 ACTORHP
mulvar TEMPVAR4 1000
divvarvar TEMPVAR4 ACTORMAXHP
ifvarl TEMPVAR4 101
{
mulvar ACTORSPEED 60
divvar ACTORSPEED 100
}
else
ifvarg TEMPVAR4 100 ifvarl TEMPVAR4 251
{
mulvar ACTORSPEED 80
divvar ACTORSPEED 100
}
// Check for Elite Flag
ifvarand ACTORFLAGS 512
{
mulvar ACTORSPEED 112
divvar ACTORSPEED 100
}
ends
// Sets the Monster's Max HP Atomic Levels [2x]
state accquireenemystats
setvarvar ACTORMAXHPATOMIC ACTORMAXHP
mulvar ACTORMAXHPATOMIC 2
setvarvar ACTORMAXAPATOMIC ACTORMAXAP
mulvar ACTORMAXAPATOMIC 2
ends
// Allows Monsters and other Actors to damage each other with the Icon of the Defender
state invulnicon-nonplayers
ifvare oldskoolmode 0
{
getactor[THISACTOR].x TESTX
getactor[THISACTOR].y TESTY
getactor[THISACTOR].z TESTZ
getactor[THISACTOR].picnum TEMP
setactor[THISACTOR].x TESTX
setactor[THISACTOR].y TESTY
setactor[THISACTOR].z TESTZ
getactor[THISACTOR].xrepeat TESTXREPEAT1
getactor[THISACTOR].yrepeat TESTYREPEAT1
getactorvar[THISACTOR].ACTORSHEIGHT INVULNAURARANGEZ
mulvarvar INVULNAURARANGEZ TESTYREPEAT1
mulvar INVULNAURARANGEZ 4
setvar INVULNAURARANGEXY 844
addvarvar INVULNAURARANGEXY TESTXREPEAT1
addvar INVULNAURARANGEZ 1688
addvarvar INVULNAURARANGEZ TESTYREPEAT1
addvarvar INVULNAURARANGEZ TESTYREPEAT1
getactor[THISACTOR].picnum TEMP
ifvare TEMP ROTATEGUN state invulntarget_monsters
ifvare TEMP SHARK state invulntarget_monsters
ifvare TEMP LIZTROOP state invulntarget_monsters
ifvare TEMP PIGCOP state invulntarget_monsters
ifvare TEMP RECON state invulntarget_monsters
ifvare TEMP LIZMAN state invulntarget_monsters
ifvare TEMP OCTABRAIN state invulntarget_monsters
ifvare TEMP DRONE state invulntarget_monsters
ifvare TEMP NEWBEAST state invulntarget_monsters
ifvare TEMP COMMANDER state invulntarget_monsters
ifvare TEMP TANK state invulntarget_monsters
ifvare TEMP SCORPIONTANK state invulntarget_monsters
ifvare TEMP BOSS1 state invulntarget_monsters
ifvare TEMP BOSS2 state invulntarget_monsters
ifvare TEMP BOSS3 state invulntarget_monsters
ifvare TEMP BOSS4 state invulntarget_monsters
ifvare TEMP PRESIDENTCLINTON state invulntarget_civilians
ifvare TEMP ROBOTDOG state invulntarget_civilians
ifvare TEMP ROBOTDOG2 state invulntarget_civilians
ifvare TEMP PODFEM1 state invulntarget_civilians
ifvare TEMP NAKED1 state invulntarget_civilians
ifvare TEMP FEM1 state invulntarget_civilians
ifvare TEMP FEM2 state invulntarget_civilians
ifvare TEMP FEM3 state invulntarget_civilians
ifvare TEMP FEM4 state invulntarget_civilians
ifvare TEMP FEM5 state invulntarget_civilians
ifvare TEMP FEM6 state invulntarget_civilians
ifvare TEMP FEM7 state invulntarget_civilians
ifvare TEMP FEM9 state invulntarget_civilians
ifvare TEMP FEM10 state invulntarget_civilians
ifvare TEMP TOUGHGAL state invulntarget_civilians
ifvare TEMP WOMAN state invulntarget_civilians
ifvare TEMP DANCE1 state invulntarget_civilians
ifvare TEMP DANCE2 state invulntarget_civilians
ifvare TEMP DANCE3 state invulntarget_civilians
ifvare TEMP DANCE5 state invulntarget_civilians
ifvare TEMP DANCE6 state invulntarget_civilians
ifvare TEMP DANCE7 state invulntarget_civilians
ifvare TEMP DANCE9 state invulntarget_civilians
ifvare TEMP STAND1 state invulntarget_civilians
ifvare TEMP DEALER state invulntarget_civilians
ifvare TEMP STAND3 state invulntarget_civilians
ifvare TEMP STAND4 state invulntarget_civilians
ifvare TEMP WOLFDUDE state invulntarget_civilians
ifvare TEMP COP1 state invulntarget_civilians
ifvare TEMP PUNKDUDE state invulntarget_civilians
ifvare TEMP COP2 state invulntarget_civilians
ifvare TEMP SITTINGDUDE state invulntarget_civilians
ifvare TEMP ANIMEGIRL1 state invulntarget_civilians
ifvare TEMP ANIMEGIRL2 state invulntarget_civilians
ifvare TEMP ANIMEGIRL3 state invulntarget_civilians
ifvare TEMP ANIMEGIRL4 state invulntarget_civilians
}
ends
// Healing Sectors [ACTORS]
state healingsector_actor
ifvare mainmenu 0 ifvarg ACTORHP 0
{
getactor[THISACTOR].sectnum temph
getactorvar[temph].healsectortype TEMPVAR7
ifvarg TEMPVAR7 0
{
addvar healsectordelaycur 1
getactorvar[temph].healsectordelaymax TEMPVAR6
ifvarvarl healsectordelaycur TEMPVAR6 nullop
else
{
ifvarand TEMPVAR7 1 // HP Healing
{
getactorvar[temph].healsectormaxheal TEMPVAR4
ifvarg TEMPVAR4 0
{
mulvarvar TEMPVAR4 ACTORMAXHP
divvar TEMPVAR4 1000
}
else { mulvar TEMPVAR4 -1 }
ifvarvarl ACTORHP TEMPVAR4
{
getactorvar[temph].healsectoramount TEMPVAR5
ifvarg TEMPVAR5 0
{
mulvarvar TEMPVAR5 ACTORMAXHP
divvar TEMPVAR5 1000
}
else { mulvar TEMPVAR5 -1 }
addvarvar ACTORHP TEMPVAR5
ifvarvarg ACTORHP TEMPVAR4 setvarvar ACTORHP TEMPVAR4
ifvarg TEMPVAR5 0
{
setvarvar SHOWDAMAGE TEMPVAR5
setvar SHOWDAMAGETYPE 3
setvarvar SHOWDAMAGEACTORID THISACTOR
state showdamage
}
sound MYSTERIOUS_HEALING // REGEN_HEALTH5
ifactor EMPTYTANK
{
ifvarvare THISACTOR VEHICLEID setvar VDISPLAYHPFLASHTIMER -28
}
setvar ACTORHPDAMAGED? -1
}
}
ifvarand TEMPVAR7 2 // AP Healing
{
getactorvar[temph].healsectormaxheal TEMPVAR4
ifvarg TEMPVAR4 0
{
mulvarvar TEMPVAR4 ACTORMAXAP
divvar TEMPVAR4 1000
}
else { mulvar TEMPVAR4 -1 }
ifvarvarl ACTORAP TEMPVAR4
{
getactorvar[temph].healsectoramount TEMPVAR5
ifvarg TEMPVAR5 0
{
mulvarvar TEMPVAR5 ACTORMAXAP
divvar TEMPVAR5 1000
}
else { mulvar TEMPVAR5 -1 }
getactorvar[temph].healsectorarmorab TEMPVAR3
ifvarvarl ACTORARMORPERCENT TEMPVAR3 setvarvar ACTORARMORPERCENT TEMPVAR3
addvarvar ACTORAP TEMPVAR5
ifvarvarg ACTORAP TEMPVAR4 setvarvar ACTORAP TEMPVAR4
ifvarg TEMPVAR5 0
{
setvarvar SHOWDAMAGE TEMPVAR5
setvar SHOWDAMAGETYPE 4
setvarvar SHOWDAMAGEACTORID THISACTOR
state showdamage
}
sound MYSTERIOUS_ARMOR // REGEN_ARMOR5
ifactor EMPTYTANK
{
ifvarvare THISACTOR VEHICLEID setvar VDISPLAYAPFLASHTIMER -28
}
setvar ACTORAPDAMAGED? -1
}
}
setvar healsectordelaycur 0
}
}
else
{
setvar healsectordelaycur 0
}
}
ends
// Freeze Damage stuff :P
state dealfreezedamage-actor
ifvarvarg freezetimer freezetimermax
{
setvarvar tempd ACTORMAXHP
setvarvar tempb freezing
divvar tempb 4
addvar tempb 56
setvarvar tempc tempb
divvar tempc 2
randvarvar tempf tempc
ifrnd 128 mulvar tempf -1
addvarvar tempb tempf
mulvarvar tempd tempb
divvar tempd 1000
// Check Actor Types
ifactor EGG
{
mulvar tempd 5 // 500% Damage
}
else
ifactor SHARK
{
ifspritepal 24 { mulvar tempd 3 divvar tempd 2 } // 150% Damage
else { mulvar tempd 7 divvar tempd 10 } // 70% Damage
}
else
ifactor ROTATEGUN
{
ifspritepal 19 { mulvar tempd 6 divvar tempd 5 } // 120% Damage
else ifspritepal 7 { mulvar tempd 6 divvar tempd 5 } // 120% Damage
else { mulvar tempd 6 divvar tempd 5 } // 120% Damage
}
else
ifactor LIZTROOP
{
ifspritepal 19 { mulvar tempd 4 divvar tempd 3 } // 133% Damage
else ifspritepal 17 { divvar tempd 50 } // 2% Damage
}
else
ifactor LIZMAN
{
ifspritepal 19 { mulvar tempd 4 } // 400% Damage
else ifspritepal 6 { mulvar tempd 4 divvar tempd 3 } // 133% Damage
else ifspritepal 17 { mulvar tempd 3 divvar tempd 2 } // 150% Damage
else { mulvar tempd 3 divvar tempd 4 } // 75% Damage
}
// Sentry Drones Have no Differences
else
ifactor OCTABRAIN
{
ifspritepal 14 { divvar tempd 2 } // 50% Damage
else { divvar tempd 4 } // 25% Damage
}
// Pigcops Have no Differences
else
ifactor BOSS1
{
ifspritepal 24 { mulvar tempd 9 divvar tempd 2 } // 450% Damage
else ifspritepal 0 { mulvar tempd 3 divvar tempd 2 } // 150% Damage
else ifspritepal 3 { mulvar tempd 3 divvar tempd 2 } // 150% Damage
else { mulvar tempd 3 } // 300% Damage
}
else
ifactor BOSS2
{
ifspritepal 24 { mulvar tempd 7 divvar tempd 2 } // 350% Damage
else ifspritepal 0 { mulvar tempd 5 divvar tempd 4 } // 125% Damage
else ifspritepal 3 { mulvar tempd 5 divvar tempd 4 } // 125% Damage
else { mulvar tempd 2 } // 200% Damage
}
else
ifactor BOSS3
{
ifspritepal 24 { mulvar tempd 6 } // 600% Damage
else ifspritepal 0 { mulvar tempd 2 } // 200% Damage
else ifspritepal 3 { mulvar tempd 2 } // 200% Damage
else { mulvar tempd 4 } // 400% Damage
}
// Commanders Have no Differences
// Tanks Have no Differences
// Alien Queens Have no Differences
// Protector Drones Have no Differences
// Scorpion Tanks Have no Differences
ifvarg enemywinterclothes 0
{
setvar tempc 90
mulvarvar tempc enemywinterclothes
divvar tempc 100
setvar tempb 100
subvarvar tempb tempc
mulvarvar tempd tempb
divvar tempd 100
}
ifvarn ENEMYHASSHIKON? 0 divvar tempd 10
ifvarl tempd 1 setvar tempd 1
ifvarg ACTORHP 0
{
setactor[THISACTOR].htpicnum FREEZEBLAST // SHOTSPARK1
setactor[THISACTOR].htowner THISACTOR
subvarvar ACTORHP tempd
ifvarl ACTORHP 1 setvar ACTORHP 0
ifvarvarg ACTORHP ACTORMAXHPATOMIC setvarvar ACTORHP ACTORMAXHPATOMIC
ifvarg tempd 0 setvar ACTORHPDAMAGED? 1
ifvarl tempd 0 setvar ACTORHPDAMAGED? -1
ifvarg tempd 0
{
setvarvar SHOWDAMAGE tempd
setvar SHOWDAMAGETYPE 0
setvarvar SHOWDAMAGEACTORID THISACTOR
state showdamage
}
else
ifvarl tempd 0
{
setvarvar SHOWDAMAGE tempd
mulvar SHOWDAMAGE -1
setvar SHOWDAMAGETYPE 3
setvarvar SHOWDAMAGEACTORID THISACTOR
state showdamage
}
ifvarg tempd 0 state monsterpainsounds2
}
ifvarvarg freezing freezetimermax setvar freezetimer 0 else subvarvar freezetimer freezetimermax
}
ends
state freezecode_actor
ifvarl enemywinterclothes 0 setvar enemywinterclothes 0
ifvarg enemywinterclothes 100 setvar enemywinterclothes 100
setvarvar freezing freezingbase
getactor[THISACTOR].sectnum TEMPVAR2 getactorvar[TEMPVAR2].freezingmod TEMPVAR3
addvarvar freezing TEMPVAR3
ifvarl freezing 0 setvar freezing 0
ifvarn freezing 0
{
ifvare mainmenu 0
{
ifvarl ACTORINVULNTIME 1
{
setvarvar tempe freezing
ifvarl tempe 1 setvar tempe 1
// Checks if the actor's outside, inside, underwater, sitting in water, etc
ifoutside
{
ifvare WATER? 1 // 240%
{
getactor[THISACTOR].sectnum temp
getsector[temp].floorpicnum TEMPVAR3
ifvare TEMPVAR3 NEWFLOORPLASMA setvar tempe 0
else ifvare TEMPVAR3 HOTLAVA setvar tempe 0
else ifvare TEMPVAR3 MEGALAVA setvar tempe 0
else ifvare TEMPVAR3 ULTRALAVA setvar tempe 0
else ifvare TEMPVAR3 HYPERMAGMA setvar tempe 0
else
{
getactor[THISACTOR].sectnum temp
getsector[temp].hitag TEMPVAR3
ifvare TEMPVAR3 NEWFLOORPLASMA setvar tempe 0
else ifvare TEMPVAR3 HOTLAVA setvar tempe 0
else ifvare TEMPVAR3 MEGALAVA setvar tempe 0
else ifvare TEMPVAR3 ULTRALAVA setvar tempe 0
else ifvare TEMPVAR3 HYPERMAGMA setvar tempe 0
else
{
mulvar tempe 12
divvar tempe 5
}
}
}
else
ifvare WATER? 2 // 560%
{
getactor[THISACTOR].sectnum temp
getsector[temp].ceilingpicnum TEMPVAR3
ifvare TEMPVAR3 NEWFLOORPLASMA setvar tempe 0
else ifvare TEMPVAR3 HOTLAVA setvar tempe 0
else ifvare TEMPVAR3 MEGALAVA setvar tempe 0
else ifvare TEMPVAR3 ULTRALAVA setvar tempe 0
else ifvare TEMPVAR3 HYPERMAGMA setvar tempe 0
else
{
getactor[THISACTOR].sectnum temp
getsector[temp].hitag TEMPVAR3
ifvare TEMPVAR3 NEWFLOORPLASMA setvar tempe 0
else ifvare TEMPVAR3 HOTLAVA setvar tempe 0
else ifvare TEMPVAR3 MEGALAVA setvar tempe 0
else ifvare TEMPVAR3 ULTRALAVA setvar tempe 0
else ifvare TEMPVAR3 HYPERMAGMA setvar tempe 0
else
{
mulvar tempe 28
divvar tempe 5
}
}
}
else // 100%
{
mulvar tempe 5
divvar tempe 5
}
ifvarl tempe 1 setvar tempe 1
}
else
{
ifvare WATER? 1 // 240%
{
getactor[THISACTOR].sectnum temp
getsector[temp].floorpicnum TEMPVAR3
ifvare TEMPVAR3 NEWFLOORPLASMA setvar tempe 0
else ifvare TEMPVAR3 HOTLAVA setvar tempe 0
else ifvare TEMPVAR3 MEGALAVA setvar tempe 0
else ifvare TEMPVAR3 ULTRALAVA setvar tempe 0
else ifvare TEMPVAR3 HYPERMAGMA setvar tempe 0
else
{
getactor[THISACTOR].sectnum temp
getsector[temp].hitag TEMPVAR3
ifvare TEMPVAR3 NEWFLOORPLASMA setvar tempe 0
else ifvare TEMPVAR3 HOTLAVA setvar tempe 0
else ifvare TEMPVAR3 MEGALAVA setvar tempe 0
else ifvare TEMPVAR3 ULTRALAVA setvar tempe 0
else ifvare TEMPVAR3 HYPERMAGMA setvar tempe 0
else
{
mulvar tempe 12
divvar tempe 5
}
}
}
else
ifvare WATER? 2 // 560%
{
getactor[THISACTOR].sectnum temp
getsector[temp].ceilingpicnum TEMPVAR3
ifvare TEMPVAR3 NEWFLOORPLASMA setvar tempe 0
else ifvare TEMPVAR3 HOTLAVA setvar tempe 0
else ifvare TEMPVAR3 MEGALAVA setvar tempe 0
else ifvare TEMPVAR3 ULTRALAVA setvar tempe 0
else ifvare TEMPVAR3 HYPERMAGMA setvar tempe 0
else
{
getactor[THISACTOR].sectnum temp
getsector[temp].hitag TEMPVAR3
ifvare TEMPVAR3 NEWFLOORPLASMA setvar tempe 0
else ifvare TEMPVAR3 HOTLAVA setvar tempe 0
else ifvare TEMPVAR3 MEGALAVA setvar tempe 0
else ifvare TEMPVAR3 ULTRALAVA setvar tempe 0
else ifvare TEMPVAR3 HYPERMAGMA setvar tempe 0
else
{
mulvar tempe 28
divvar tempe 5
}
}
}
else // 25%
{
mulvar tempe 1
divvar tempe 4
}
ifvarl tempe 1 setvar tempe 1
}
ifvarg enemywinterclothes 0
{
setvar tempc 95
mulvarvar tempc enemywinterclothes
divvar tempc 100
setvar tempb 100
subvarvar tempb tempc
mulvarvar tempe tempb
divvar tempe 100
}
ifvarn ENEMYHASSHIKON? 0 divvar tempe 10
ifvarl tempe 1
{
ifvarg enemywinterclothes 0
{
setvarvar RNDMIZERLIMIT freezing
ifvarn ENEMYHASSHIKON? 0 divvar RNDMIZERLIMIT 10
mulvar RNDMIZERLIMIT -4 addvar RNDMIZERLIMIT 256
ifvarl RNDMIZERLIMIT 0 setvar RNDMIZERLIMIT 0 ifvarg RNDMIZERLIMIT 256 setvar RNDMIZERLIMIT 256
mulvarvar RNDMIZERLIMIT enemywinterclothes
divvar RNDMIZERLIMIT 100
state rndmizer256
ifvarvarg RNDMIZER RNDMIZERLIMIT setvar tempe 1
else
{
setvar tempe 0
setvar RNDMIZERLIMIT 20
mulvarvar RNDMIZERLIMIT enemywinterclothes
divvar RNDMIZERLIMIT 100
addvar RNDMIZERLIMIT 5
mulvar RNDMIZERLIMIT -1
addvar RNDMIZERLIMIT 256
ifvarl RNDMIZERLIMIT 0 setvar RNDMIZERLIMIT 0 ifvarg RNDMIZERLIMIT 256 setvar RNDMIZERLIMIT 256
state rndmizer256
ifvarvarg RNDMIZER RNDMIZERLIMIT { subvar freezetimer 1 ifvarl freezetimer 0 setvar freezetimer 0 }
}
}
else
{
setvarvar RNDMIZERLIMIT freezing
ifvarn ENEMYHASSHIKON? 0 divvar RNDMIZERLIMIT 10
mulvar RNDMIZERLIMIT -40 addvar RNDMIZERLIMIT 256
ifvarl RNDMIZERLIMIT 0 setvar RNDMIZERLIMIT 0 ifvarg RNDMIZERLIMIT 256 setvar RNDMIZERLIMIT 256
state rndmizer256
ifvarvarg RNDMIZER RNDMIZERLIMIT setvar tempe 1
else
{
setvar tempe 0
ifrnd 5 { subvar freezetimer 1 ifvarl freezetimer 0 setvar freezetimer 0 }
}
}
}
ifvare FROZEN? 0 addvarvar freezetimer tempe
state dealfreezedamage-actor
}
else
{
ifvarg freezetimer 0 { randvar tempb 2 addvar tempb 1 subvarvar freezetimer tempb }
ifvarl freezetimer 0 setvar freezetimer 0
}
}
else
{
ifvarg freezetimer 0 { randvar tempb 2 addvar tempb 1 subvarvar freezetimer tempb }
ifvarl freezetimer 0 setvar freezetimer 0
}
}
else
{
ifvarg freezetimer 0 { randvar tempb 2 ifrnd 128 mulvar tempb -1 addvar tempb 4 subvarvar freezetimer tempb }
ifvarl freezetimer 0 setvar freezetimer 0
}
ends
// Falling Damage for NPCs/Monster
state enemyfalldamagesounds
ifvarg ACTORHP 0
{
state monsterpainsounds2
ifactor EMPTYTANK sound METALTHUD
ifactor TANK sound METALTHUD
ifactor SCORPIONTANK sound METALTHUD
}
ends
state resetfallresist_nonplayer
setvarvar ACTORFALLRESIST ACTORMAXFALLRESIST setvar ACTORFALLCOUNTER 0
ends
state checkfallcounter_nonplayer
getsector[THISACTOR].lotag temp
ifvare temp 2 // Under Water
{
ifvarn ACTORFALLING? 0 setvar ACTORFALLING? 0
ifvarn ACTORFALLCOUNTER 0 setvar ACTORFALLCOUNTER 0
ifvarvarn ACTORFALLRESIST ACTORMAXFALLRESIST setvarvar ACTORFALLRESIST ACTORMAXFALLRESIST
}
else
{
getactor[THISACTOR].zvel ACTORZVEL
ifvarg ACTORZVEL 0 // positive zvel = falling/lowering
{
setvar ACTORFALLING? 1
ifvarg ACTORZVEL 2399 // (once thought to be 2560) 2559
{
ifvare ACTORFALLING? 1
{
ifvare mainmenu 0
{
ifvarg ACTORFALLRESIST 0
{
ifvarl ACTORINVULNTIME 1 subvar ACTORFALLRESIST 1 else state resetfallresist_nonplayer
//addlogvar ACTORFALLRESIST
}
ifvare ACTORFALLRESIST 0
{
ifvarl ACTORINVULNTIME 1 addvar ACTORFALLCOUNTER 1 else state resetfallresist_nonplayer
//addlogvar ACTORFALLCOUNTER
}
ifvarl ACTORFALLRESIST 0
{
ifvarl ACTORINVULNTIME 1 addvar ACTORFALLRESIST 1 else state resetfallresist_nonplayer
ifvarl ACTORINVULNTIME 1 addvar ACTORFALLCOUNTER 1 else state resetfallresist_nonplayer
//addlogvar ACTORFALLRESIST
//addlogvar ACTORFALLCOUNTER
}
}
}
}
}
else
{
ifvare ACTORFALLING? 1
{
ifvare ACTORZVEL 0 // Stopped
{
iffloordistl 8 // On the ground...
{
ifvare sector[THISACTOR].lotag 2 nullop // Lands in underwater sector: Since The NPC/Enemy lands in water, no fall damage is received
else ifvare sector[THISACTOR].lotag 1 nullop // Lands in sinkable water/sector: Since The NPC/Enemy lands in water, no fall damage is received
else // Lands on hard surface
{
ifvare mainmenu 0
{
ifvare ACTORDEATHSWITCHDELAY 0 ifvarl ACTORINVULNTIME 1
{
// Deal Fall-based damage >.>
ifvarg ACTORFALLCOUNTER 8
{
setvarvar ACTORFALLDAMAGE ACTORMAXHP
ifvarg ACTORFALLCOUNTER 7
{
setvar ACTORFALLDAMAGERATIO 80
setvarvar TEMPVAR2 ACTORFALLCOUNTER
subvar TEMPVAR2 8
mulvarvar TEMPVAR2 17
addvarvar ACTORFALLDAMAGERATIO TEMPVAR2
}
randvar TEMPVAR 51
subvarvar ACTORFALLDAMAGERATIO TEMPVAR
ifvarl ACTORFALLDAMAGERATIO 0 setvar ACTORFALLDAMAGERATIO 0
ifvarg ACTORFALLDAMAGERATIO 8320 setvar ACTORFALLDAMAGERATIO 8320
// Up to 244
mulvarvar ACTORFALLDAMAGE ACTORFALLDAMAGERATIO
divvar ACTORFALLDAMAGE 1000
ifvarl ACTORFALLDAMAGE 0 setvar ACTORFALLDAMAGE 0
ifvarvarg ACTORFALLDAMAGE STATLIMITATOMIC setvarvar ACTORFALLDAMAGE STATLIMITATOMIC
ifvarn ENEMYHASSHIKON? 0 divvar ACTORFALLDAMAGE 10
setvarvar tempb ACTORHP
subvarvar tempb ACTORFALLDAMAGE
ifvarg ACTORFALLDAMAGE 0 setvar ACTORHPDAMAGED? 1
ifvarg ACTORFALLDAMAGE 0
{
setvarvar SHOWDAMAGE ACTORFALLDAMAGE
setvar SHOWDAMAGETYPE 0
setvarvar SHOWDAMAGEACTORID THISACTOR
state showdamage
}
ifvarl tempb 0 setvar tempb 0
setactor[THISACTOR].htowner THISACTOR
setactor[THISACTOR].htpicnum -1
setvarvar ACTORHP tempb
ifvarl ACTORHP 1
{
setvar ACTORHP 0
setactor[THISACTOR].extra 0
state checkactorsurvivalvalue
setactor[THISACTOR].htowner THISACTOR
setactor[THISACTOR].htpicnum SHOTSPARK1
setactor[THISACTOR].htextra 1
}
state enemyfalldamagesounds
}
}
}
}
ifvarn ACTORFALLING? 0 setvar ACTORFALLING? 0
ifvarn ACTORFALLCOUNTER 0 setvar ACTORFALLCOUNTER 0
ifvarvarn ACTORFALLRESIST ACTORMAXFALLRESIST setvarvar ACTORFALLRESIST ACTORMAXFALLRESIST
}
else // An enemy [ie LIZTROOP] is Jetpacking out of their fall...
{
ifvarn ACTORFALLING? 0 setvar ACTORFALLING? 0
ifvarn ACTORFALLCOUNTER 0 setvar ACTORFALLCOUNTER 0
ifvarvarn ACTORFALLRESIST ACTORMAXFALLRESIST setvarvar ACTORFALLRESIST ACTORMAXFALLRESIST
}
}
else
ifvarl ACTORZVEL 0 // flying/rising
{
ifvarn ACTORFALLING? 0 setvar ACTORFALLING? 0
ifvarn ACTORFALLCOUNTER 0 setvar ACTORFALLCOUNTER 0
ifvarvarn ACTORFALLRESIST ACTORMAXFALLRESIST setvarvar ACTORFALLRESIST ACTORMAXFALLRESIST
}
}
}
}
ends
state enemyfall-flyingcheck
//addlogvar ACTORFALLING?
//addlogvar ACTORFALLCOUNTER
//addlogvar ACTORFALLRESIST
ifvarn ACTORFALLING? 0 setvar ACTORFALLING? 0
ifvarn ACTORFALLCOUNTER 0 setvar ACTORFALLCOUNTER 0
ifvarvarn ACTORFALLRESIST ACTORMAXFALLRESIST setvarvar ACTORFALLRESIST ACTORMAXFALLRESIST
//addlogvar ACTORFALLING?
//addlogvar ACTORFALLCOUNTER
//addlogvar ACTORFALLRESIST
ends
// MINI-CHECKS
state enemyquaddamage
ifvare mainmenu 0 ifvarn FROZEN? 1 subvar ACTORQUADTIME 1
//state itemfullbright
ifvare ACTORQUADTIME 104 sound QUADDAMAGE2
ifvare ACTORQUADTIME 1
{
state getitemseekerspeciesquote
ifvare ITEMSEEKSPECIESTYPE 0 redefinequote 301 ^10AN ENEMY'S QUAD DAMAGE JUST WORE OFF! :D
ifvare ITEMSEEKSPECIESTYPE 1 redefinequote 301 ^15A CIVILIAN'S QUAD DAMAGE JUST WORE OFF! -_-
ifvare ITEMSEEKSPECIESTYPE 2 redefinequote 301 ^15A VEHICLE'S QUAD DAMAGE JUST WORE OFF! :(
setvarvar fta fta_normal setvar ftq 301
}
ends
state enemyvampireitem
ifvare mainmenu 0 ifvarn FROZEN? 1 subvar ACTORVAMPIRETIME 1
//state itemfullbright
ifvare ACTORVAMPIRETIME 1
{
state getitemseekerspeciesquote
ifvare ITEMSEEKSPECIESTYPE 0 redefinequote 301 ^10AN ENEMY'S VAMPIRE MASK JUST WORE OFF! XD
ifvare ITEMSEEKSPECIESTYPE 1 redefinequote 301 ^15A CIVILIAN'S VAMPIRE MASK JUST WORE OFF! @_@
ifvare ITEMSEEKSPECIESTYPE 2 redefinequote 301 ^15A VEHICLE'S VAMPIRE MASK JUST WORE OFF! :(
setvarvar fta fta_normal setvar ftq 301
}
ends
state enemyinvulnitem
ifvare mainmenu 0
{
ifvarn FROZEN? 1
{
addvar ACTORINVULNCOUNTER 1
subvar ACTORINVULNTIME 1
}
}
ifvarand ACTORSTATUS? 4 // Remove Slow
{
subvar ACTORSTATUS? 4
setvar ACTORSLOWTIMER 0
}
ifvarand ACTORSTATUS? 8 // Remove Poison
{
subvar ACTORSTATUS? 8
setvar ACTORPOISONTIMER 0
setvar ACTORPOISONHITOWNER -1
//addlogvar ACTORPOISONHITOWNER
}
ifvarand ACTORSTATUS? 16 // Remove Dimness
{
subvar ACTORSTATUS? 16
setvar ACTORDIMNESSTIMER 0
}
ifvarand ACTORSTATUS? 128 // Remove Confusion
{
subvar ACTORSTATUS? 128
setvar ACTORCONFUSIONTIMER 0
}
ifvarand ACTORSTATUS? 16384 // Remove Corrosion
{
subvar ACTORSTATUS? 16384
setvar ACTORCORROSIONTIMER 0
}
//state itemfullbright
state invulnicon-nonplayers
ifvarg ACTORINVULNCOUNTER 38 { sound INVULN_PULSE setvar ACTORINVULNCOUNTER 0 }
ifvare ACTORINVULNTIME 104 sound INVULNITEM2
ifvare ACTORINVULNTIME 1
{
state getitemseekerspeciesquote
ifvare ITEMSEEKSPECIESTYPE 0 redefinequote 301 ^10AN ENEMY'S INVULN ITEM JUST WORE OFF! :D
ifvare ITEMSEEKSPECIESTYPE 1 redefinequote 301 ^15A CIVILIAN'S INVULN ITEM JUST WORE OFF! -_-
ifvare ITEMSEEKSPECIESTYPE 2 redefinequote 301 ^15A VEHICLE'S INVULN ITEM JUST WORE OFF! ;_;
setvarvar fta fta_normal setvar ftq 301
}
ends
state enemyrecover5perhealth
addvarvar ACTORHP ACTORREGENAMOUNT2
ifvarg ACTORREGENAMOUNT2 0
{
setvarvar SHOWDAMAGE ACTORREGENAMOUNT2
setvar SHOWDAMAGETYPE 3
setvarvar SHOWDAMAGEACTORID THISACTOR
state showdamage
}
ifvarvarg ACTORHP STATLIMITATOMIC setvarvar ACTORHP STATLIMITATOMIC
ifvarvarg ACTORHP ACTORMAXHPATOMIC setvarvar ACTORHP ACTORMAXHPATOMIC
ifvarvarl ACTORHP STATLIMITATOMIC
{
sound REGEN_HEALTH5
ifvare DRIVERID -1 setvar ACTORHPDAMAGED? -1 else ifvarvare DRIVERID PLAYERID setvar VEHICLEHPDAMAGED? -1
}
ends
state enemyregenitem
ifvarg ACTORREGENTIME 0
{
ifvarand ACTORPOWERUPBITFIELD 4 nullop else addvar ACTORPOWERUPBITFIELD 4
//state itemfullbright
ifvare mainmenu 0 ifvarn FROZEN? 1 addvar ACTORREGENCOUNTER 1
ifvarand ACTORSTATUS? 8 // Remove Poison
{
subvar ACTORSTATUS? 8
setvar ACTORPOISONTIMER 0
setvar ACTORPOISONHITOWNER -1
//addlogvar ACTORPOISONHITOWNER
}
ifvarg ACTORREGENCOUNTER 25
{
setvarvar ACTORREGENAMOUNT1 ACTORMAXHP
ifvare PUBLICBETA? 1 mulvar ACTORREGENAMOUNT1 150 else mulvar ACTORREGENAMOUNT1 50
divvar ACTORREGENAMOUNT1 1000
setvarvar ACTORREGENAMOUNT2 ACTORMAXHP
ifvare PUBLICBETA? 1 mulvar ACTORREGENAMOUNT2 50 else mulvar ACTORREGENAMOUNT2 16
divvar ACTORREGENAMOUNT2 1000
ifvarvarl ACTORHP ACTORMAXHPATOMIC ifvarvarg ACTORHP ACTORMAXHP state enemyrecover5perhealth
else ifvarvare ACTORHP ACTORMAXHP state enemyrecover5perhealth
else ifvarvarl ACTORHP ACTORMAXHP ifvarg ACTORHP -1
{
addvarvar ACTORHP ACTORREGENAMOUNT1
ifvarg ACTORREGENAMOUNT1 0
{
setvarvar SHOWDAMAGE ACTORREGENAMOUNT1
setvar SHOWDAMAGETYPE 3
setvarvar SHOWDAMAGEACTORID THISACTOR
state showdamage
}
ifvarvarg ACTORHP STATLIMITATOMIC setvarvar ACTORHP STATLIMITATOMIC
ifvarvarg ACTORHP ACTORMAXHPATOMIC setvarvar ACTORHP ACTORMAXHPATOMIC
ifvarvarl ACTORHP STATLIMITATOMIC
{
sound REGEN_HEALTH15
ifvare DRIVERID -1 setvar ACTORHPDAMAGED? -1 else ifvarvare DRIVERID PLAYERID setvar VEHICLEHPDAMAGED? -1
}
}
setvar ACTORREGENCOUNTER 0
}
ifvare mainmenu 0 ifvarn FROZEN? 1 subvar ACTORREGENTIME 1
ifvare ACTORREGENTIME 1
{
setvar ACTORREGENCOUNTER 0
state getitemseekerspeciesquote
ifvare ITEMSEEKSPECIESTYPE 0 redefinequote 301 ^10AN ENEMY'S REGENERATION ANKH JUST WORE OFF! :D
ifvare ITEMSEEKSPECIESTYPE 1 redefinequote 301 ^15A CIVILIAN'S REGENERATION ANKH JUST WORE OFF! -_-
ifvare ITEMSEEKSPECIESTYPE 2 redefinequote 301 ^15A VEHICLE'S REGENERATION ANKH JUST WORE OFF! :(
setvarvar fta fta_normal setvar ftq 301
}
}
else
{
ifvarand ACTORPOWERUPBITFIELD 4 subvar ACTORPOWERUPBITFIELD 4
}
ends