forked from EmeraldTiger/Re-Mobilize
-
Notifications
You must be signed in to change notification settings - Fork 0
/
zombie.qc
865 lines (755 loc) · 37.9 KB
/
zombie.qc
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
/*
==============================================================================
ZOMBIES!.qc - Version 1.1
by Ace_Dave
http://www.trenton.edu/~weiden/quake
==============================================================================
*/
$cd /raid/quake/id1/models/zombie
$origin 0 0 24
$base base
$skin skin
$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8
$frame stand9 stand10 stand11 stand12 stand13 stand14 stand15
$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 walk9 walk10 walk11
$frame walk12 walk13 walk14 walk15 walk16 walk17 walk18 walk19
$frame run1 run2 run3 run4 run5 run6 run7 run8 run9 run10 run11 run12
$frame run13 run14 run15 run16 run17 run18
$frame atta1 atta2 atta3 atta4 atta5 atta6 atta7 atta8 atta9 atta10 atta11
$frame atta12 atta13
$frame attb1 attb2 attb3 attb4 attb5 attb6 attb7 attb8 attb9 attb10 attb11
$frame attb12 attb13 attb14
$frame attc1 attc2 attc3 attc4 attc5 attc6 attc7 attc8 attc9 attc10 attc11
$frame attc12
$frame paina1 paina2 paina3 paina4 paina5 paina6 paina7 paina8 paina9 paina10
$frame paina11 paina12
$frame painb1 painb2 painb3 painb4 painb5 painb6 painb7 painb8 painb9 painb10
$frame painb11 painb12 painb13 painb14 painb15 painb16 painb17 painb18 painb19
$frame painb20 painb21 painb22 painb23 painb24 painb25 painb26 painb27 painb28
$frame painc1 painc2 painc3 painc4 painc5 painc6 painc7 painc8 painc9 painc10
$frame painc11 painc12 painc13 painc14 painc15 painc16 painc17 painc18
$frame paind1 paind2 paind3 paind4 paind5 paind6 paind7 paind8 paind9 paind10
$frame paind11 paind12 paind13
$frame paine1 paine2 paine3 paine4 paine5 paine6 paine7 paine8 paine9 paine10
$frame paine11 paine12 paine13 paine14 paine15 paine16 paine17 paine18 paine19
$frame paine20 paine21 paine22 paine23 paine24 paine25 paine26 paine27 paine28
$frame paine29 paine30
$frame cruc_1 cruc_2 cruc_3 cruc_4 cruc_5 cruc_6
float SPAWN_CRUCIFIED = 1;
float SPAWN_DEAD_CRUCIFIED = 4;
float SPAWN_SLEEPING = 16; //changed from 2 which was Zer default
// float SPAWN_DEAD = 4; -- not used in progs_dump -- dumptruck_ds -- this is from Zer src for my reference
// float SPAWN_DEAD_CRUCIFIED = 8; -- not used in progs_dump -- dumptruck_ds -- this is from Zer src for my reference
//=============================================================================
.float inpain;
// motionless crucified zombie
void() zombie_dead_cruc1 = [$cruc_1, zombie_dead_cruc1] {self.nextthink = time + 1;};
// new "stand" - for sleeping zombies
void() zombie_stand1 =[ $paine11, zombie_stand2 ]
{
self.solid = SOLID_NOT;
if (self.count == 0) //dumptruck_ds -- count value > 0 to leave the zombie sleeping until triggered!
ai_stand();
};
void() zombie_stand2 =[ $paine11, zombie_stand1 ]
{
if (self.count == 0)
ai_stand();
};
// old "stand" - called when standing only
void() alt_zombie_stand1 =[ $stand1, alt_zombie_stand2 ] {self.health = 60; ai_stand();};
void() alt_zombie_stand2 =[ $stand2, zombie_stand3 ] {ai_stand();};
void() zombie_stand3 =[ $stand3, zombie_stand4 ] {ai_stand();};
void() zombie_stand4 =[ $stand4, zombie_stand5 ] {ai_stand();};
void() zombie_stand5 =[ $stand5, zombie_stand6 ] {ai_stand();};
void() zombie_stand6 =[ $stand6, zombie_stand7 ] {ai_stand();};
void() zombie_stand7 =[ $stand7, zombie_stand8 ] {ai_stand();};
void() zombie_stand8 =[ $stand8, zombie_stand9 ] {ai_stand();};
void() zombie_stand9 =[ $stand9, zombie_stand10 ] {ai_stand();};
void() zombie_stand10 =[ $stand10, zombie_stand11 ] {ai_stand();};
void() zombie_stand11 =[ $stand11, zombie_stand12 ] {ai_stand();};
void() zombie_stand12 =[ $stand12, zombie_stand13 ] {ai_stand();};
void() zombie_stand13 =[ $stand13, zombie_stand14 ] {ai_stand();};
void() zombie_stand14 =[ $stand14, zombie_stand15 ] {ai_stand();};
void() zombie_stand15 =[ $stand15, alt_zombie_stand1 ] {ai_stand();};
void() zombie_cruc1 = [ $cruc_1, zombie_cruc2 ] {
if (random() < 0.1)
sound_idle (self, CHAN_VOICE, "zombie/idle_w2.wav", 1, ATTN_STATIC);};
void() zombie_cruc2 = [ $cruc_2, zombie_cruc3 ] {self.nextthink = time + 0.1 + random()*0.1;};
void() zombie_cruc3 = [ $cruc_3, zombie_cruc4 ] {self.nextthink = time + 0.1 + random()*0.1;};
void() zombie_cruc4 = [ $cruc_4, zombie_cruc5 ] {self.nextthink = time + 0.1 + random()*0.1;};
void() zombie_cruc5 = [ $cruc_5, zombie_cruc6 ] {self.nextthink = time + 0.1 + random()*0.1;};
void() zombie_cruc6 = [ $cruc_6, zombie_cruc1 ] {self.nextthink = time + 0.1 + random()*0.1;};
void() zombie_walk1 =[ $walk1, zombie_walk2 ] {
self.solid = SOLID_SLIDEBOX;
self.health = 60; //so he doesn't fall
ai_walk(0);};
void() zombie_walk2 =[ $walk2, zombie_walk3 ] {ai_walk(2);};
void() zombie_walk3 =[ $walk3, zombie_walk4 ] {ai_walk(3);};
void() zombie_walk4 =[ $walk4, zombie_walk5 ] {ai_walk(2);};
void() zombie_walk5 =[ $walk5, zombie_walk6 ] {ai_walk(1);};
void() zombie_walk6 =[ $walk6, zombie_walk7 ] {ai_walk(0);};
void() zombie_walk7 =[ $walk7, zombie_walk8 ] {ai_walk(0);};
void() zombie_walk8 =[ $walk8, zombie_walk9 ] {ai_walk(0);};
void() zombie_walk9 =[ $walk9, zombie_walk10 ] {ai_walk(0);};
void() zombie_walk10 =[ $walk10, zombie_walk11 ] {ai_walk(0);};
void() zombie_walk11 =[ $walk11, zombie_walk12 ] {ai_walk(2);};
void() zombie_walk12 =[ $walk12, zombie_walk13 ] {ai_walk(2);};
void() zombie_walk13 =[ $walk13, zombie_walk14 ] {ai_walk(1);};
void() zombie_walk14 =[ $walk14, zombie_walk15 ] {ai_walk(0);};
void() zombie_walk15 =[ $walk15, zombie_walk16 ] {ai_walk(0);};
void() zombie_walk16 =[ $walk16, zombie_walk17 ] {ai_walk(0);};
void() zombie_walk17 =[ $walk17, zombie_walk18 ] {ai_walk(0);};
void() zombie_walk18 =[ $walk18, zombie_walk19 ] {ai_walk(0);};
void() zombie_walk19 =[ $walk19, zombie_walk1 ] {
ai_walk(0);
if (random() < 0.2)
sound_misc (self, CHAN_VOICE, "zombie/z_idle.wav", 1, ATTN_IDLE);};
void() zombie_run1 =[ $run1, zombie_run2 ] {
if (self.spawnflags & SPAWN_SLEEPING)
{ // sloppy hack, but it fixes the illusionary zombie bug
body_model ("progs/zombie.mdl"); //custom_mdls dumptruck_ds
// setmodel (self, "progs/zombie.mdl");
resize('-16 -16 -24', '16 16 40');
}
ai_run(1);
self.inpain = 0;};
void() zombie_run2 =[ $run2, zombie_run3 ] {ai_run(1);};
void() zombie_run3 =[ $run3, zombie_run4 ] {ai_run(0);};
void() zombie_run4 =[ $run4, zombie_run5 ] {ai_run(1);};
void() zombie_run5 =[ $run5, zombie_run6 ] {ai_run(2);};
void() zombie_run6 =[ $run6, zombie_run7 ] {ai_run(3);};
void() zombie_run7 =[ $run7, zombie_run8 ] {ai_run(4);};
void() zombie_run8 =[ $run8, zombie_run9 ] {ai_run(4);};
void() zombie_run9 =[ $run9, zombie_run10 ] {ai_run(2);};
void() zombie_run10 =[ $run10, zombie_run11 ] {ai_run(0);};
void() zombie_run11 =[ $run11, zombie_run12 ] {ai_run(0);};
void() zombie_run12 =[ $run12, zombie_run13 ] {ai_run(0);};
void() zombie_run13 =[ $run13, zombie_run14 ] {ai_run(2);};
void() zombie_run14 =[ $run14, zombie_run15 ] {ai_run(4);};
void() zombie_run15 =[ $run15, zombie_run16 ] {ai_run(6);};
void() zombie_run16 =[ $run16, zombie_run17 ] {ai_run(7);};
void() zombie_run17 =[ $run17, zombie_run18 ] {ai_run(3);};
void() zombie_run18 =[ $run18, zombie_run1 ] {
ai_run(8);
if (random() < 0.2)
sound_misc (self, CHAN_VOICE, "zombie/z_idle.wav", 1, ATTN_IDLE);
if (random() > 0.8)
sound_sight (self, CHAN_VOICE, "zombie/z_idle1.wav", 1, ATTN_IDLE);
};
/*
=============================================================================
ATTACKS
=============================================================================
*/
// void() Z_hit =
// {
// sound_hit (self, CHAN_WEAPON, "zombie/z_hit.wav", 1, ATTN_NORM);
// };
//
// void() Z_land =
// {
// sound_land (self, CHAN_WEAPON, "zombie/z_miss.wav", 1, ATTN_NORM); // bounce sound
// };
// void() ZombieGrenadeTouch2 =
// {
// if (other == self.owner)
// return; // don't explode on owner
// if (other.takedamage)
// {
// // Z_hit();
// T_Damage (other, self, self.owner, 10 );
// sound_hit (self, CHAN_WEAPON, "zombie/z_hit.wav", 1, ATTN_NORM);
// remove (self);
// return;
// }
// // Z_land();
// sound_land (self, CHAN_WEAPON, "zombie/z_miss.wav", 1, ATTN_NORM); // bounce sound
// self.velocity = '0 0 0';
// self.avelocity = '0 0 0';
// self.touch = SUB_Remove;
// };
/*
================
ZombieFireGrenade
================
*/
void(vector st) ZombieFireGrenade =
{
local entity missile;
local vector org;
sound_attack (self, CHAN_WEAPON, "zombie/z_shot1.wav", 1, ATTN_NORM);
missile = spawn ();
missile.owner = self;
missile.movetype = MOVETYPE_BOUNCE;
missile.solid = SOLID_BBOX;
// calc org
org = self.origin + st_x * v_forward + st_y * v_right + (st_z - 24) * v_up;
// set missile speed
makevectors (self.angles);
missile.velocity = normalize(self.enemy.origin - org);
missile.velocity = missile.velocity * 600;
missile.velocity_z = 200;
missile.avelocity = '3000 1000 2000';
missile.touch = ZombieGrenadeTouch;
// set missile duration
missile.nextthink = time + 2.5;
missile.think = SUB_Remove;
// setmodel (missile, "progs/zom_gib.mdl");
if (self.mdl_proj != "") // dumptruck_ds custom_mdls
{
setmodel (missile, self.mdl_proj);
}
else
{
setmodel (missile, "progs/zom_gib.mdl");
}
if (!missile.skin_proj) // dumptruck_ds
{
missile.skin = self.skin_proj;
}
else
{
missile.skin = 0;
}
setsize (missile, '0 0 0', '0 0 0');
setorigin (missile, org);
};
void() zombie_atta1 =[ $atta1, zombie_atta2 ] {ai_face();};
void() zombie_atta2 =[ $atta2, zombie_atta3 ] {ai_face();};
void() zombie_atta3 =[ $atta3, zombie_atta4 ] {ai_face();};
void() zombie_atta4 =[ $atta4, zombie_atta5 ] {ai_face();};
void() zombie_atta5 =[ $atta5, zombie_atta6 ] {ai_face();};
void() zombie_atta6 =[ $atta6, zombie_atta7 ] {ai_face();};
void() zombie_atta7 =[ $atta7, zombie_atta8 ] {ai_face();};
void() zombie_atta8 =[ $atta8, zombie_atta9 ] {ai_face();};
void() zombie_atta9 =[ $atta9, zombie_atta10 ] {ai_face();};
void() zombie_atta10 =[ $atta10, zombie_atta11 ] {ai_face();};
void() zombie_atta11 =[ $atta11, zombie_atta12 ] {ai_face();};
void() zombie_atta12 =[ $atta12, zombie_atta13 ] {ai_face();};
void() zombie_atta13 =[ $atta13, zombie_run1 ] {ai_face();ZombieFireGrenade('-10 -22 30');};
void() zombie_attb1 =[ $attb1, zombie_attb2 ] {ai_face();};
void() zombie_attb2 =[ $attb2, zombie_attb3 ] {ai_face();};
void() zombie_attb3 =[ $attb3, zombie_attb4 ] {ai_face();};
void() zombie_attb4 =[ $attb4, zombie_attb5 ] {ai_face();};
void() zombie_attb5 =[ $attb5, zombie_attb6 ] {ai_face();};
void() zombie_attb6 =[ $attb6, zombie_attb7 ] {ai_face();};
void() zombie_attb7 =[ $attb7, zombie_attb8 ] {ai_face();};
void() zombie_attb8 =[ $attb8, zombie_attb9 ] {ai_face();};
void() zombie_attb9 =[ $attb9, zombie_attb10 ] {ai_face();};
void() zombie_attb10 =[ $attb10, zombie_attb11 ] {ai_face();};
void() zombie_attb11 =[ $attb11, zombie_attb12 ] {ai_face();};
void() zombie_attb12 =[ $attb12, zombie_attb13 ] {ai_face();};
void() zombie_attb13 =[ $attb13, zombie_attb14 ] {ai_face();};
void() zombie_attb14 =[ $attb13, zombie_run1 ] {ai_face();ZombieFireGrenade('-10 -24 29');};
void() zombie_attc1 =[ $attc1, zombie_attc2 ] {ai_face();};
void() zombie_attc2 =[ $attc2, zombie_attc3 ] {ai_face();};
void() zombie_attc3 =[ $attc3, zombie_attc4 ] {ai_face();};
void() zombie_attc4 =[ $attc4, zombie_attc5 ] {ai_face();};
void() zombie_attc5 =[ $attc5, zombie_attc6 ] {ai_face();};
void() zombie_attc6 =[ $attc6, zombie_attc7 ] {ai_face();};
void() zombie_attc7 =[ $attc7, zombie_attc8 ] {ai_face();};
void() zombie_attc8 =[ $attc8, zombie_attc9 ] {ai_face();};
void() zombie_attc9 =[ $attc9, zombie_attc10 ] {ai_face();};
void() zombie_attc10 =[ $attc10, zombie_attc11 ] {ai_face();};
void() zombie_attc11 =[ $attc11, zombie_attc12 ] {ai_face();};
void() zombie_attc12 =[ $attc12, zombie_run1 ] {ai_face();ZombieFireGrenade('-12 -19 29');};
void() zombie_missile =
{
local float r;
r = random();
if (r < 0.3)
zombie_atta1 ();
else if (r < 0.6)
zombie_attb1 ();
else
zombie_attc1 ();
};
//////////////////////////
/// turret frames START
/////////////////////////
void() zombie_turret_atta1 =[ $atta1, zombie_turret_atta2 ] {self.health = 60;ai_face();};
void() zombie_turret_atta2 =[ $atta2, zombie_turret_atta3 ] {ai_face();};
void() zombie_turret_atta3 =[ $atta3, zombie_turret_atta4 ] {ai_face();};
void() zombie_turret_atta4 =[ $atta4, zombie_turret_atta5 ] {ai_face();};
void() zombie_turret_atta5 =[ $atta5, zombie_turret_atta6 ] {ai_face();};
void() zombie_turret_atta6 =[ $atta6, zombie_turret_atta7 ] {ai_face();};
void() zombie_turret_atta7 =[ $atta7, zombie_turret_atta8 ] {ai_face();};
void() zombie_turret_atta8 =[ $atta8, zombie_turret_atta9 ] {ai_face();};
void() zombie_turret_atta9 =[ $atta9, zombie_turret_atta10 ] {ai_face();};
void() zombie_turret_atta10 =[ $atta10, zombie_turret_atta11 ] {ai_face();self.attack_elevation = IterateElevation(OGRE_DEFAULT_ELEVATION, self.enemy.origin);};
void() zombie_turret_atta11 =[ $atta11, zombie_turret_atta12 ] {ai_face();self.attack_elevation = IterateElevation(self.attack_elevation, self.enemy.origin);};
void() zombie_turret_atta12 =[ $atta12, zombie_turret_atta13 ] {ai_face();self.attack_elevation = IterateElevation(self.attack_elevation, self.enemy.origin);};
void() zombie_turret_atta13 =[ $atta13, alt_zombie_seek_stand1 ] {ai_run(0);PreachFireZombie(self.attack_elevation);};
void() zombie_turret_attb1 =[ $attb1, zombie_turret_attb2 ] {self.health = 60;ai_face();};
void() zombie_turret_attb2 =[ $attb2, zombie_turret_attb3 ] {ai_face();};
void() zombie_turret_attb3 =[ $attb3, zombie_turret_attb4 ] {ai_face();};
void() zombie_turret_attb4 =[ $attb4, zombie_turret_attb5 ] {ai_face();};
void() zombie_turret_attb5 =[ $attb5, zombie_turret_attb6 ] {ai_face();};
void() zombie_turret_attb6 =[ $attb6, zombie_turret_attb7 ] {ai_face();};
void() zombie_turret_attb7 =[ $attb7, zombie_turret_attb8 ] {ai_face();};
void() zombie_turret_attb8 =[ $attb8, zombie_turret_attb9 ] {ai_face();};
void() zombie_turret_attb9 =[ $attb9, zombie_turret_attb10 ] {ai_face();};
void() zombie_turret_attb10 =[ $attb10, zombie_turret_attb11 ] {ai_face();};
void() zombie_turret_attb11 =[ $attb11, zombie_turret_attb12 ] {ai_face();self.attack_elevation = IterateElevation(OGRE_DEFAULT_ELEVATION, self.enemy.origin);};
void() zombie_turret_attb12 =[ $attb12, zombie_turret_attb13 ] {ai_face();self.attack_elevation = IterateElevation(self.attack_elevation, self.enemy.origin);};
void() zombie_turret_attb13 =[ $attb13, zombie_turret_attb14 ] {ai_face();self.attack_elevation = IterateElevation(self.attack_elevation, self.enemy.origin);};
void() zombie_turret_attb14 =[ $attb13, alt_zombie_seek_stand1 ] {ai_run(0);PreachFireZombie(self.attack_elevation);};
void() zombie_turret_attc1 =[ $attc1, zombie_turret_attc2 ] {self.health = 60;ai_face();};
void() zombie_turret_attc2 =[ $attc2, zombie_turret_attc3 ] {ai_face();};
void() zombie_turret_attc3 =[ $attc3, zombie_turret_attc4 ] {ai_face();};
void() zombie_turret_attc4 =[ $attc4, zombie_turret_attc5 ] {ai_face();};
void() zombie_turret_attc5 =[ $attc5, zombie_turret_attc6 ] {ai_face();};
void() zombie_turret_attc6 =[ $attc6, zombie_turret_attc7 ] {ai_face();};
void() zombie_turret_attc7 =[ $attc7, zombie_turret_attc8 ] {ai_face();};
void() zombie_turret_attc8 =[ $attc8, zombie_turret_attc9 ] {ai_face();};
void() zombie_turret_attc9 =[ $attc9, zombie_turret_attc10 ] {ai_face();self.attack_elevation = IterateElevation(OGRE_DEFAULT_ELEVATION, self.enemy.origin);};
void() zombie_turret_attc10 =[ $attc10, zombie_turret_attc11 ] {ai_face();self.attack_elevation = IterateElevation(self.attack_elevation, self.enemy.origin);};
void() zombie_turret_attc11 =[ $attc11, zombie_turret_attc12 ] {ai_face();self.attack_elevation = IterateElevation(self.attack_elevation, self.enemy.origin);};
void() zombie_turret_attc12 =[ $attc12, alt_zombie_seek_stand1 ] {ai_run(0);PreachFireZombie(self.attack_elevation);};
void() alt_zombie_seek_stand1 =[ $stand1, alt_zombie_seek_stand2 ] {self.health = 60; ai_run(0);};
void() alt_zombie_seek_stand2 =[ $stand2, zombie_seek_stand3 ] {ai_run(0);};
void() zombie_seek_stand3 =[ $stand3, zombie_seek_stand4 ] {ai_run(0);};
void() zombie_seek_stand4 =[ $stand4, zombie_seek_stand5 ] {ai_run(0);};
void() zombie_seek_stand5 =[ $stand5, zombie_seek_stand6 ] {ai_run(0);};
void() zombie_seek_stand6 =[ $stand6, zombie_seek_stand7 ] {ai_run(0);};
void() zombie_seek_stand7 =[ $stand7, zombie_seek_stand8 ] {ai_run(0);};
void() zombie_seek_stand8 =[ $stand8, zombie_seek_stand9 ] {ai_run(0);};
void() zombie_seek_stand9 =[ $stand9, zombie_seek_stand10 ] {ai_run(0);};
void() zombie_seek_stand10 =[ $stand10, zombie_seek_stand11 ] {ai_run(0);};
void() zombie_seek_stand11 =[ $stand11, zombie_seek_stand12 ] {ai_run(0);};
void() zombie_seek_stand12 =[ $stand12, zombie_seek_stand13 ] {ai_run(0);};
void() zombie_seek_stand13 =[ $stand13, zombie_seek_stand14 ] {ai_run(0);};
void() zombie_seek_stand14 =[ $stand14, zombie_seek_stand15 ] {ai_run(0);};
void() zombie_seek_stand15 =[ $stand15, alt_zombie_seek_stand1 ] {ai_run(0);};
void() zombie_turret_missile =
{
local float r;
r = random();
if (r < 0.3)
zombie_turret_attb1 ();
else if (r < 0.6)
zombie_turret_atta1 ();
else
zombie_turret_attc1 ();
};
//////////////////////////
/// turret frames END
/////////////////////////
/*
=============================================================================
PAIN
=============================================================================
*/
void() zombie_paina1 =[ $paina1, zombie_paina2 ] {sound_pain (self, CHAN_VOICE, "zombie/z_pain.wav", 1, ATTN_NORM);};
void() zombie_paina2 =[ $paina2, zombie_paina3 ] {ai_painforward(3);};
void() zombie_paina3 =[ $paina3, zombie_paina4 ] {ai_painforward(1);};
void() zombie_paina4 =[ $paina4, zombie_paina5 ] {ai_pain(1);};
void() zombie_paina5 =[ $paina5, zombie_paina6 ] {ai_pain(3);};
void() zombie_paina6 =[ $paina6, zombie_paina7 ] {ai_pain(1);};
void() zombie_paina7 =[ $paina7, zombie_paina8 ] {};
void() zombie_paina8 =[ $paina8, zombie_paina9 ] {};
void() zombie_paina9 =[ $paina9, zombie_paina10 ] {};
void() zombie_paina10 =[ $paina10, zombie_paina11 ] {};
void() zombie_paina11 =[ $paina11, zombie_paina12 ] {};
void() zombie_paina12 =[ $paina12, zombie_run1 ] {};
void() zombie_painb1 =[ $painb1, zombie_painb2 ] {sound_misc2 (self, CHAN_VOICE, "zombie/z_pain1.wav", 1, ATTN_NORM);};
void() zombie_painb2 =[ $painb2, zombie_painb3 ] {ai_pain(2);};
void() zombie_painb3 =[ $painb3, zombie_painb4 ] {ai_pain(8);};
void() zombie_painb4 =[ $painb4, zombie_painb5 ] {ai_pain(6);};
void() zombie_painb5 =[ $painb5, zombie_painb6 ] {ai_pain(2);};
void() zombie_painb6 =[ $painb6, zombie_painb7 ] {};
void() zombie_painb7 =[ $painb7, zombie_painb8 ] {};
void() zombie_painb8 =[ $painb8, zombie_painb9 ] {};
void() zombie_painb9 =[ $painb9, zombie_painb10 ] {sound_misc3 (self, CHAN_BODY, "zombie/z_fall.wav", 1, ATTN_NORM);};
void() zombie_painb10 =[ $painb10, zombie_painb11 ] {};
void() zombie_painb11 =[ $painb11, zombie_painb12 ] {};
void() zombie_painb12 =[ $painb12, zombie_painb13 ] {};
void() zombie_painb13 =[ $painb13, zombie_painb14 ] {};
void() zombie_painb14 =[ $painb14, zombie_painb15 ] {};
void() zombie_painb15 =[ $painb15, zombie_painb16 ] {};
void() zombie_painb16 =[ $painb16, zombie_painb17 ] {};
void() zombie_painb17 =[ $painb17, zombie_painb18 ] {};
void() zombie_painb18 =[ $painb18, zombie_painb19 ] {};
void() zombie_painb19 =[ $painb19, zombie_painb20 ] {};
void() zombie_painb20 =[ $painb20, zombie_painb21 ] {};
void() zombie_painb21 =[ $painb21, zombie_painb22 ] {};
void() zombie_painb22 =[ $painb22, zombie_painb23 ] {};
void() zombie_painb23 =[ $painb23, zombie_painb24 ] {};
void() zombie_painb24 =[ $painb24, zombie_painb25 ] {};
void() zombie_painb25 =[ $painb25, zombie_painb26 ] {ai_painforward(1);};
void() zombie_painb26 =[ $painb26, zombie_painb27 ] {};
void() zombie_painb27 =[ $painb27, zombie_painb28 ] {};
void() zombie_painb28 =[ $painb28, zombie_run1 ] {};
void() zombie_painc1 =[ $painc1, zombie_painc2 ] {sound_misc2 (self, CHAN_VOICE, "zombie/z_pain1.wav", 1, ATTN_NORM);};
void() zombie_painc2 =[ $painc2, zombie_painc3 ] {};
void() zombie_painc3 =[ $painc3, zombie_painc4 ] {ai_pain(3);};
void() zombie_painc4 =[ $painc4, zombie_painc5 ] {ai_pain(1);};
void() zombie_painc5 =[ $painc5, zombie_painc6 ] {};
void() zombie_painc6 =[ $painc6, zombie_painc7 ] {};
void() zombie_painc7 =[ $painc7, zombie_painc8 ] {};
void() zombie_painc8 =[ $painc8, zombie_painc9 ] {};
void() zombie_painc9 =[ $painc9, zombie_painc10 ] {};
void() zombie_painc10 =[ $painc10, zombie_painc11 ] {};
void() zombie_painc11 =[ $painc11, zombie_painc12 ] {ai_painforward(1);};
void() zombie_painc12 =[ $painc12, zombie_painc13 ] {ai_painforward(1);};
void() zombie_painc13 =[ $painc13, zombie_painc14 ] {};
void() zombie_painc14 =[ $painc14, zombie_painc15 ] {};
void() zombie_painc15 =[ $painc15, zombie_painc16 ] {};
void() zombie_painc16 =[ $painc16, zombie_painc17 ] {};
void() zombie_painc17 =[ $painc17, zombie_painc18 ] {};
void() zombie_painc18 =[ $painc18, zombie_run1 ] {};
void() zombie_paind1 =[ $paind1, zombie_paind2 ] {sound_pain (self, CHAN_VOICE, "zombie/z_pain.wav", 1, ATTN_NORM);};
void() zombie_paind2 =[ $paind2, zombie_paind3 ] {};
void() zombie_paind3 =[ $paind3, zombie_paind4 ] {};
void() zombie_paind4 =[ $paind4, zombie_paind5 ] {};
void() zombie_paind5 =[ $paind5, zombie_paind6 ] {};
void() zombie_paind6 =[ $paind6, zombie_paind7 ] {};
void() zombie_paind7 =[ $paind7, zombie_paind8 ] {};
void() zombie_paind8 =[ $paind8, zombie_paind9 ] {};
void() zombie_paind9 =[ $paind9, zombie_paind10 ] {ai_pain(1);};
void() zombie_paind10 =[ $paind10, zombie_paind11 ] {};
void() zombie_paind11 =[ $paind11, zombie_paind12 ] {};
void() zombie_paind12 =[ $paind12, zombie_paind13 ] {};
void() zombie_paind13 =[ $paind13, zombie_run1 ] {};
void() zombie_paine1 =[ $paine1, zombie_paine2 ] {
if (self.axhitme == 2) // Chainsaw will gib zombie
{
T_Damage(self, world, world, 80);
return;
}
sound_pain (self, CHAN_VOICE, "zombie/z_pain.wav", 1, ATTN_NORM);
self.health = 60;
};
void() zombie_paine2 =[ $paine2, zombie_paine3 ] {ai_pain(8);};
void() zombie_paine3 =[ $paine3, zombie_paine4 ] {ai_pain(5);};
void() zombie_paine4 =[ $paine4, zombie_paine5 ] {ai_pain(3);};
void() zombie_paine5 =[ $paine5, zombie_paine6 ] {ai_pain(1);};
void() zombie_paine6 =[ $paine6, zombie_paine7 ] {ai_pain(2);};
void() zombie_paine7 =[ $paine7, zombie_paine8 ] {ai_pain(1);};
void() zombie_paine8 =[ $paine8, zombie_paine9 ] {ai_pain(1);};
void() zombie_paine9 =[ $paine9, zombie_paine10 ] {ai_pain(2);};
void() zombie_paine10 =[ $paine10, zombie_paine11 ] {
sound_misc3 (self, CHAN_BODY, "zombie/z_fall.wav", 1, ATTN_NORM);
self.solid = SOLID_NOT;
};
void() zombie_paine11 =[ $paine11, zombie_paine12 ] {self.nextthink = self.nextthink + 5;self.health = 60;};
void() zombie_paine12 =[ $paine12, zombie_paine13 ]{
// see if ok to stand up
self.health = 60;
sound_misc (self, CHAN_VOICE, "zombie/z_idle.wav", 1, ATTN_IDLE);
self.solid = SOLID_SLIDEBOX;
if (!walkmove (0, 0))
{
self.think = zombie_paine11;
self.solid = SOLID_NOT;
return;
}
};
void() zombie_paine13 =[ $paine13, zombie_paine14 ] {};
void() zombie_paine14 =[ $paine14, zombie_paine15 ] {};
void() zombie_paine15 =[ $paine15, zombie_paine16 ] {};
void() zombie_paine16 =[ $paine16, zombie_paine17 ] {};
void() zombie_paine17 =[ $paine17, zombie_paine18 ] {};
void() zombie_paine18 =[ $paine18, zombie_paine19 ] {};
void() zombie_paine19 =[ $paine19, zombie_paine20 ] {};
void() zombie_paine20 =[ $paine20, zombie_paine21 ] {};
void() zombie_paine21 =[ $paine21, zombie_paine22 ] {};
void() zombie_paine22 =[ $paine22, zombie_paine23 ] {};
void() zombie_paine23 =[ $paine23, zombie_paine24 ] {};
void() zombie_paine24 =[ $paine24, zombie_paine25 ] {};
void() zombie_paine25 =[ $paine25, zombie_paine26 ] {ai_painforward(5);};
void() zombie_paine26 =[ $paine26, zombie_paine27 ] {ai_painforward(3);};
void() zombie_paine27 =[ $paine27, zombie_paine28 ] {ai_painforward(1);};
void() zombie_paine28 =[ $paine28, zombie_paine29 ] {ai_pain(1);};
void() zombie_paine29 =[ $paine29, zombie_paine30 ] {};
void() zombie_paine30 =[ $paine30, zombie_run1 ] {};
void() zombie_die =
{
sound_death (self, CHAN_VOICE, "zombie/z_gib.wav", 1, ATTN_NORM);
if (self.mdl_head != "") //dumptruck_ds custom_mdls
{
ThrowHead (self.mdl_head, self.health);
}
else
{
ThrowHead ("progs/h_zombie.mdl", self.health/*, self.dest*/); //commented out dest -- dumptruck_ds
}
// ThrowGib ("progs/gib1.mdl", self.health/*, self.dest*/);
// ThrowGib ("progs/gib2.mdl", self.health/*, self.dest*/);
// ThrowGib ("progs/gib3.mdl", self.health/*, self.dest*/);
if (self.mdl_gib1 != "") // custom models -- dumptruck_ds
{
ThrowGib (self.mdl_gib1, self.health);
}
else
{
ThrowGib ("progs/gib1.mdl", self.health);
}
if (self.mdl_gib2 != "")
{
ThrowGib (self.mdl_gib2, self.health);
}
else
{
ThrowGib ("progs/gib2.mdl", self.health);
}
if (self.mdl_gib3 != "")
{
ThrowGib (self.mdl_gib3, self.health);
}
else
{
ThrowGib ("progs/gib3.mdl", self.health);
}
DropStuff();
};
/*
=================
zombie_pain
Zombies can only be killed (gibbed) by doing 60 hit points of damage
in a single frame (rockets, grenades, quad shotgun, quad nailgun).
A hit of 25 points or more (super shotgun, quad nailgun) will always put it
down to the ground.
A hit of from 10 to 40 points in one frame will cause it to go down if it
has been twice in two seconds, otherwise it goes into one of the four
fast pain frames.
A hit of less than 10 points of damage (winged by a shotgun) will be ignored.
FIXME: don't use pain_finished because of nightmare hack
=================
*/
void(entity attacker, float take) zombie_pain =
{
if (self.spawnflags & I_AM_TURRET)
{
self.health = 60; // always reset health
if (take >= 60)
{
zombie_die();
}
else
return;
}
local float r;
self.health = 60; // always reset health
if (take < 9)
return; // totally ignore
if (self.inpain == 2)
return; // down on ground, so don't reset any counters
// go down immediately if a big enough hit
if ((take >= 25) || (self.axhitme == 2))
{
self.inpain = 2;
zombie_paine1 ();
return;
}
if (self.inpain)
{
// if hit again in next gre seconds while not in pain frames, definately drop
self.pain_finished = time + 3;
return; // currently going through an animation, don't change
}
if (self.pain_finished > time)
{
// hit again, so drop down
self.inpain = 2;
zombie_paine1 ();
return;
}
// gp into one of the fast pain animations
self.inpain = 1;
r = random();
if (r < 0.25)
zombie_paina1 ();
else if (r < 0.5)
zombie_painb1 ();
else if (r < 0.75)
zombie_painc1 ();
else
zombie_paind1 ();
};
void() zombie_decide = // stand up if orig. lying down, else just start running
{
if (self.health==61)
zombie_paine12();
else
zombie_run1();
self.th_run = zombie_run1;
};
void() zombie_use = // wake up a sleeping zombie!
{
self.count = 0;
//attacker = other;
monster_use();
};
void() zombie_start = // determine if zombie is to be lying down, or standing
{
self.count = 1; //dumptruck_ds -- Don't start zombie_stand1 yet!
self.use = zombie_use; //dumptruck_ds -- makes self.count = 0 so zombie_stand1 is called
if (self.spawnflags & SPAWN_SLEEPING)
{
if (!SUB_IsTargeted ())
{
dprint ("WARNING: removed untargeted sleeping zombie at ");
dprint (vtos (self.origin));
dprint ("\n");
monster_update_total (-1);
remove (self);
return;
}
self.inpain = 2;
zombie_stand1 ();
}
else
{
alt_zombie_stand1 ();
}
self.th_stand = alt_zombie_stand1;
};
// void() zombie_start2 = //unused in progs_dump -- dumptruck_ds
// {
// local vector org;
// local entity teldeath;
//
// if (self.style)
// {
// makevectors (self.angles);
// org = self.origin + 16 * v_forward;
// spawn_tfog (org);
// teldeath = spawn();
// teldeath.origin = org;
// teldeath.owner = self;
// // teldeath.think = sf64_teledeath; -- not used in progs_dump -- dumptruck_ds
// teldeath.nextthink = time + 0.1;
// }
//
// self.solid = SOLID_SLIDEBOX;
// self.movetype = MOVETYPE_STEP;
//
// setmodel (self, "progs/zombie.mdl");
//
// setsize (self, '-16 -16 -24', '16 16 40');
// self.health = 61;
//
// walkmonster_start();
// };
//============================================================================
/*QUAKED monster_zombie (1 0 0) (-16 -16 -24) (16 16 32) CRUCIFIED AMBUSH CRUCIFIED_MOTIONLESS TRIGGER_SPAWNED SPAWN_SLEEPING X X X NOT_ON_EASY NOT_ON_NORMAL NOT_ON_HARD_OR_NIGHTMARE NOT_IN_DEATHMATCH NOT_IN_COOP NOT_IN_SINGLEPLAYER X NOT_ON_HARD_ONLY NOT_ON_NIGHTMARE_ONLY
{
model ( {{ spawnflags & 1 -> { "path" : "progs/zombie.mdl", "frame" : 192 }, "progs/zombie.mdl" }} );
}
If crucified, stick the bounding box 12 pixels back into a wall to look right.
Default health = 60
If SPAWN_SLEEPING is used there must be a targetname set. The zombie will stand up when targeted. Crucified motionless zombies are silent and do not animate." //dumptruck_ds
snd_death(string) : "Path to custom death sound"
snd_pain(string) : "Path to custom pain sound"
snd_attack(string) : "Path to custom attack sound (WHOOSH)"
snd_idle(string) : "Path to custom idle sound (CRUCIFIED ONLY)"
snd_misc(string) : "Path to custom (IDLE 2) sound"
snd_sight(string) : "Path to custom sight sound"
snd_misc2(string) : "Path to custom (PAIN 2) sound"
snd_misc3(string) : "Path to custom (FALLING) sound"
mdl_head(string) : "Path to custom head model"
mdl_body(string) : "Path to custom body model"
mdl_proj(string) : "Path to custom projectile model"
skin_head(float) : "Skin index of custom head model"
skin_proj(float) : "Skin index of custom projectile model"
mdl_gib1(string) : "Path to custom 1st gib model"
mdl_gib2(string) : "Path to custom 2nd gib model"
mdl_gib3(string) : "Path to custom 3rd gib model"
effects(choices) : "Add a visual effect to an entity"
0 : "None (Default)"
1 : "Brightfield (yellow particles)"
4 : "Bright light"
8 : "Dim light"
berserk(choices) "Skips certain pain animations similar to skill 3 (Makes a semi-nightmare monster!)"
0 : "Off (Default)"
1 : "Berserk (skip pain animations)"
delay(float) : "Delay spawn in for this amount of time"
wait(choices) : "Play an effect when trigger spawned?"
0 : "Teleport Effects (Default)"
1 : "Spawn Silently"
spawn_angry(Choices)
0 : "Only when trigger spawned, default behavior - not angry"
1 : "Only when trigger spawned, set to 1 to spawn angry at player"
infight_mode(Choices)
0 : "Default behavior, only with different classnames"
1 : "Infight with monsters with the same classname but a different mdl_body"
2 : "Infight with monsters with the same classname and model but a different skin"
3 : "Infight no matter what"
health(integer) : "Set this to a custom health amount"
pain_target(string) : "Fire this target when pain_threshold is reached"
pain_threshold(integer) : "Fire pain_target when health drops below this amount"
sight_trigger(integer) : "1 = Fire target upon seeing the player instead of death"
skin(integer) : "Skin index (default 0) Use this when your custom model has more than one skin to select"
obit_name(string) : "When used with obit_method, this will set part of the text for a custom obituary. e.g. a Super Soldier! Using the examples here, the obituary would read: Player was eviscerated by a Super Solider!"
obit_method(string) : "When used with obit_name, will set part of the text for a custom obituary. e.g. eviscerated - If empty, defaults to killed."
damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by this number (e.g. 4 = Quad damage)"
spawnflags(Flags) =
1 : "Crucified"
2 : "Ambush"
4 : "Crucified motionless"
16 : "Spawn Sleeping"
*/
void() monster_zombie =
{
if (SUB_Inhibit ()) // new spawnflags for all entities -- iw
return;
if (deathmatch /*&& (!(self.spawnflags & SPAWN_DEAD_CRUCIFIED))*/)
{
remove(self);
return;
}
precache_body_model ("progs/zombie.mdl"); //custom_mdls dumptruck_ds
precache_head_model ("progs/h_zombie.mdl");
precache_proj_model ("progs/zom_gib.mdl");
// precache_model ("progs/zombie.mdl");
// precache_model ("progs/h_zombie.mdl");
// precache_model ("progs/zom_gib.mdl");
precache_sound_misc ("zombie/z_idle.wav");
precache_sound_sight ("zombie/z_idle1.wav");
precache_sound_attack ("zombie/z_shot1.wav");
precache_sound_death ("zombie/z_gib.wav");
precache_sound_pain ("zombie/z_pain.wav");
precache_sound_misc2 ("zombie/z_pain1.wav");
precache_sound_misc3 ("zombie/z_fall.wav");
precache_sound ("zombie/z_miss.wav");
precache_sound ("zombie/z_hit.wav");
precache_sound_idle ("zombie/idle_w2.wav");
precache_gib1 ("progs/gib1.mdl");
precache_gib2 ("progs/gib2.mdl");
precache_gib3 ("progs/gib3.mdl");
self.th_stand = zombie_start;
self.th_walk = zombie_walk1;
if (self.spawnflags & I_AM_TURRET)
{
self.th_run = alt_zombie_seek_stand1;
}
else
{
self.th_run = zombie_decide;
}
self.th_pain = zombie_pain;
self.th_die = zombie_die;
self.th_turret = zombie_turret_missile;
self.th_missile = zombie_missile;
self.solid = SOLID_SLIDEBOX;
self.movetype = MOVETYPE_STEP;
body_model ("progs/zombie.mdl"); //custom_mdls dumptruck_ds
// setmodel (self, "progs/zombie.mdl");
resize('-16 -16 -24', '16 16 40');
self.health = 61;
if (self.spawnflags & SPAWN_CRUCIFIED)
{
self.movetype = MOVETYPE_NONE;
zombie_cruc1 ();
}
else if (self.spawnflags & SPAWN_DEAD_CRUCIFIED)
{
self.movetype = MOVETYPE_NONE;
zombie_dead_cruc1 ();
}
else
walkmonster_start();
};