Quake II RTX doxygen  1.0 dev
m_soldier.c
Go to the documentation of this file.
1 /*
2 Copyright (C) 1997-2001 Id Software, Inc.
3 
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
8 
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13 
14 You should have received a copy of the GNU General Public License along
15 with this program; if not, write to the Free Software Foundation, Inc.,
16 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17 */
18 /*
19 ==============================================================================
20 
21 SOLDIER
22 
23 ==============================================================================
24 */
25 
26 #include "g_local.h"
27 #include "m_soldier.h"
28 
29 
30 static int sound_idle;
31 static int sound_sight1;
32 static int sound_sight2;
33 static int sound_pain_light;
34 static int sound_pain;
35 static int sound_pain_ss;
36 static int sound_death_light;
37 static int sound_death;
38 static int sound_death_ss;
39 static int sound_cock;
40 
41 
42 void soldier_idle(edict_t *self)
43 {
44  if (random() > 0.8)
45  gi.sound(self, CHAN_VOICE, sound_idle, 1, ATTN_IDLE, 0);
46 }
47 
48 void soldier_cock(edict_t *self)
49 {
50  if (self->s.frame == FRAME_stand322)
51  gi.sound(self, CHAN_WEAPON, sound_cock, 1, ATTN_IDLE, 0);
52  else
53  gi.sound(self, CHAN_WEAPON, sound_cock, 1, ATTN_NORM, 0);
54 }
55 
56 
57 // STAND
58 
59 void soldier_stand(edict_t *self);
60 
62  { ai_stand, 0, soldier_idle },
63  { ai_stand, 0, NULL },
64  { ai_stand, 0, NULL },
65  { ai_stand, 0, NULL },
66  { ai_stand, 0, NULL },
67  { ai_stand, 0, NULL },
68  { ai_stand, 0, NULL },
69  { ai_stand, 0, NULL },
70  { ai_stand, 0, NULL },
71  { ai_stand, 0, NULL },
72 
73  { ai_stand, 0, NULL },
74  { ai_stand, 0, NULL },
75  { ai_stand, 0, NULL },
76  { ai_stand, 0, NULL },
77  { ai_stand, 0, NULL },
78  { ai_stand, 0, NULL },
79  { ai_stand, 0, NULL },
80  { ai_stand, 0, NULL },
81  { ai_stand, 0, NULL },
82  { ai_stand, 0, NULL },
83 
84  { ai_stand, 0, NULL },
85  { ai_stand, 0, NULL },
86  { ai_stand, 0, NULL },
87  { ai_stand, 0, NULL },
88  { ai_stand, 0, NULL },
89  { ai_stand, 0, NULL },
90  { ai_stand, 0, NULL },
91  { ai_stand, 0, NULL },
92  { ai_stand, 0, NULL },
93  { ai_stand, 0, NULL }
94 };
96 
98  { ai_stand, 0, NULL },
99  { ai_stand, 0, NULL },
100  { ai_stand, 0, NULL },
101  { ai_stand, 0, NULL },
102  { ai_stand, 0, NULL },
103  { ai_stand, 0, NULL },
104  { ai_stand, 0, NULL },
105  { ai_stand, 0, NULL },
106  { ai_stand, 0, NULL },
107  { ai_stand, 0, NULL },
108 
109  { ai_stand, 0, NULL },
110  { ai_stand, 0, NULL },
111  { ai_stand, 0, NULL },
112  { ai_stand, 0, NULL },
113  { ai_stand, 0, NULL },
114  { ai_stand, 0, NULL },
115  { ai_stand, 0, NULL },
116  { ai_stand, 0, NULL },
117  { ai_stand, 0, NULL },
118  { ai_stand, 0, NULL },
119 
120  { ai_stand, 0, NULL },
121  { ai_stand, 0, soldier_cock },
122  { ai_stand, 0, NULL },
123  { ai_stand, 0, NULL },
124  { ai_stand, 0, NULL },
125  { ai_stand, 0, NULL },
126  { ai_stand, 0, NULL },
127  { ai_stand, 0, NULL },
128  { ai_stand, 0, NULL },
129  { ai_stand, 0, NULL },
130 
131  { ai_stand, 0, NULL },
132  { ai_stand, 0, NULL },
133  { ai_stand, 0, NULL },
134  { ai_stand, 0, NULL },
135  { ai_stand, 0, NULL },
136  { ai_stand, 0, NULL },
137  { ai_stand, 0, NULL },
138  { ai_stand, 0, NULL },
139  { ai_stand, 0, NULL }
140 };
142 
143 #if 0
144 mframe_t soldier_frames_stand4 [] = {
145  { ai_stand, 0, NULL },
146  { ai_stand, 0, NULL },
147  { ai_stand, 0, NULL },
148  { ai_stand, 0, NULL },
149  { ai_stand, 0, NULL },
150  { ai_stand, 0, NULL },
151  { ai_stand, 0, NULL },
152  { ai_stand, 0, NULL },
153  { ai_stand, 0, NULL },
154  { ai_stand, 0, NULL },
155 
156  { ai_stand, 0, NULL },
157  { ai_stand, 0, NULL },
158  { ai_stand, 0, NULL },
159  { ai_stand, 0, NULL },
160  { ai_stand, 0, NULL },
161  { ai_stand, 0, NULL },
162  { ai_stand, 0, NULL },
163  { ai_stand, 0, NULL },
164  { ai_stand, 0, NULL },
165  { ai_stand, 0, NULL },
166 
167  { ai_stand, 0, NULL },
168  { ai_stand, 0, NULL },
169  { ai_stand, 0, NULL },
170  { ai_stand, 0, NULL },
171  { ai_stand, 0, NULL },
172  { ai_stand, 0, NULL },
173  { ai_stand, 0, NULL },
174  { ai_stand, 0, NULL },
175  { ai_stand, 0, NULL },
176  { ai_stand, 0, NULL },
177 
178  { ai_stand, 0, NULL },
179  { ai_stand, 0, NULL },
180  { ai_stand, 0, NULL },
181  { ai_stand, 0, NULL },
182  { ai_stand, 0, NULL },
183  { ai_stand, 0, NULL },
184  { ai_stand, 0, NULL },
185  { ai_stand, 0, NULL },
186  { ai_stand, 0, NULL },
187  { ai_stand, 0, NULL },
188 
189  { ai_stand, 0, NULL },
190  { ai_stand, 0, NULL },
191  { ai_stand, 0, NULL },
192  { ai_stand, 0, NULL },
193  { ai_stand, 0, NULL },
194  { ai_stand, 0, NULL },
195  { ai_stand, 4, NULL },
196  { ai_stand, 1, NULL },
197  { ai_stand, -1, NULL },
198  { ai_stand, -2, NULL },
199 
200  { ai_stand, 0, NULL },
201  { ai_stand, 0, NULL }
202 };
203 mmove_t soldier_move_stand4 = {FRAME_stand401, FRAME_stand452, soldier_frames_stand4, NULL};
204 #endif
205 
206 void soldier_stand(edict_t *self)
207 {
208  if ((self->monsterinfo.currentmove == &soldier_move_stand3) || (random() < 0.8))
209  self->monsterinfo.currentmove = &soldier_move_stand1;
210  else
211  self->monsterinfo.currentmove = &soldier_move_stand3;
212 }
213 
214 
215 //
216 // WALK
217 //
218 
219 void soldier_walk1_random(edict_t *self)
220 {
221  if (random() > 0.1)
222  self->monsterinfo.nextframe = FRAME_walk101;
223 }
224 
226  { ai_walk, 3, NULL },
227  { ai_walk, 6, NULL },
228  { ai_walk, 2, NULL },
229  { ai_walk, 2, NULL },
230  { ai_walk, 2, NULL },
231  { ai_walk, 1, NULL },
232  { ai_walk, 6, NULL },
233  { ai_walk, 5, NULL },
234  { ai_walk, 3, NULL },
235  { ai_walk, -1, soldier_walk1_random },
236  { ai_walk, 0, NULL },
237  { ai_walk, 0, NULL },
238  { ai_walk, 0, NULL },
239  { ai_walk, 0, NULL },
240  { ai_walk, 0, NULL },
241  { ai_walk, 0, NULL },
242  { ai_walk, 0, NULL },
243  { ai_walk, 0, NULL },
244  { ai_walk, 0, NULL },
245  { ai_walk, 0, NULL },
246  { ai_walk, 0, NULL },
247  { ai_walk, 0, NULL },
248  { ai_walk, 0, NULL },
249  { ai_walk, 0, NULL },
250  { ai_walk, 0, NULL },
251  { ai_walk, 0, NULL },
252  { ai_walk, 0, NULL },
253  { ai_walk, 0, NULL },
254  { ai_walk, 0, NULL },
255  { ai_walk, 0, NULL },
256  { ai_walk, 0, NULL },
257  { ai_walk, 0, NULL },
258  { ai_walk, 0, NULL }
259 };
261 
263  { ai_walk, 4, NULL },
264  { ai_walk, 4, NULL },
265  { ai_walk, 9, NULL },
266  { ai_walk, 8, NULL },
267  { ai_walk, 5, NULL },
268  { ai_walk, 1, NULL },
269  { ai_walk, 3, NULL },
270  { ai_walk, 7, NULL },
271  { ai_walk, 6, NULL },
272  { ai_walk, 7, NULL }
273 };
275 
276 void soldier_walk(edict_t *self)
277 {
278  if (random() < 0.5)
279  self->monsterinfo.currentmove = &soldier_move_walk1;
280  else
281  self->monsterinfo.currentmove = &soldier_move_walk2;
282 }
283 
284 
285 //
286 // RUN
287 //
288 
289 void soldier_run(edict_t *self);
290 
292  { ai_run, 7, NULL },
293  { ai_run, 5, NULL }
294 };
296 
298  { ai_run, 10, NULL },
299  { ai_run, 11, NULL },
300  { ai_run, 11, NULL },
301  { ai_run, 16, NULL },
302  { ai_run, 10, NULL },
303  { ai_run, 15, NULL }
304 };
306 
307 void soldier_run(edict_t *self)
308 {
309  if (self->monsterinfo.aiflags & AI_STAND_GROUND) {
310  self->monsterinfo.currentmove = &soldier_move_stand1;
311  return;
312  }
313 
314  if (self->monsterinfo.currentmove == &soldier_move_walk1 ||
315  self->monsterinfo.currentmove == &soldier_move_walk2 ||
316  self->monsterinfo.currentmove == &soldier_move_start_run) {
317  self->monsterinfo.currentmove = &soldier_move_run;
318  } else {
319  self->monsterinfo.currentmove = &soldier_move_start_run;
320  }
321 }
322 
323 
324 //
325 // PAIN
326 //
327 
329  { ai_move, -3, NULL },
330  { ai_move, 4, NULL },
331  { ai_move, 1, NULL },
332  { ai_move, 1, NULL },
333  { ai_move, 0, NULL }
334 };
336 
338  { ai_move, -13, NULL },
339  { ai_move, -1, NULL },
340  { ai_move, 2, NULL },
341  { ai_move, 4, NULL },
342  { ai_move, 2, NULL },
343  { ai_move, 3, NULL },
344  { ai_move, 2, NULL }
345 };
347 
349  { ai_move, -8, NULL },
350  { ai_move, 10, NULL },
351  { ai_move, -4, NULL },
352  { ai_move, -1, NULL },
353  { ai_move, -3, NULL },
354  { ai_move, 0, NULL },
355  { ai_move, 3, NULL },
356  { ai_move, 0, NULL },
357  { ai_move, 0, NULL },
358  { ai_move, 0, NULL },
359  { ai_move, 0, NULL },
360  { ai_move, 1, NULL },
361  { ai_move, 0, NULL },
362  { ai_move, 1, NULL },
363  { ai_move, 2, NULL },
364  { ai_move, 4, NULL },
365  { ai_move, 3, NULL },
366  { ai_move, 2, NULL }
367 };
369 
371  { ai_move, 0, NULL },
372  { ai_move, 0, NULL },
373  { ai_move, 0, NULL },
374  { ai_move, -10, NULL },
375  { ai_move, -6, NULL },
376  { ai_move, 8, NULL },
377  { ai_move, 4, NULL },
378  { ai_move, 1, NULL },
379  { ai_move, 0, NULL },
380  { ai_move, 2, NULL },
381  { ai_move, 5, NULL },
382  { ai_move, 2, NULL },
383  { ai_move, -1, NULL },
384  { ai_move, -1, NULL },
385  { ai_move, 3, NULL },
386  { ai_move, 2, NULL },
387  { ai_move, 0, NULL }
388 };
390 
391 
392 void soldier_pain(edict_t *self, edict_t *other, float kick, int damage)
393 {
394  float r;
395  int n;
396 
397  if (self->health < (self->max_health / 2))
398  self->s.skinnum |= 1;
399 
400  if (level.time < self->pain_debounce_time) {
401  if ((self->velocity[2] > 100) && ((self->monsterinfo.currentmove == &soldier_move_pain1) || (self->monsterinfo.currentmove == &soldier_move_pain2) || (self->monsterinfo.currentmove == &soldier_move_pain3)))
402  self->monsterinfo.currentmove = &soldier_move_pain4;
403  return;
404  }
405 
406  self->pain_debounce_time = level.time + 3;
407 
408  n = self->s.skinnum | 1;
409  if (n == 1)
410  gi.sound(self, CHAN_VOICE, sound_pain_light, 1, ATTN_NORM, 0);
411  else if (n == 3)
412  gi.sound(self, CHAN_VOICE, sound_pain, 1, ATTN_NORM, 0);
413  else
414  gi.sound(self, CHAN_VOICE, sound_pain_ss, 1, ATTN_NORM, 0);
415 
416  if (self->velocity[2] > 100) {
417  self->monsterinfo.currentmove = &soldier_move_pain4;
418  return;
419  }
420 
421  if (skill->value == 3)
422  return; // no pain anims in nightmare
423 
424  r = random();
425 
426  if (r < 0.33)
427  self->monsterinfo.currentmove = &soldier_move_pain1;
428  else if (r < 0.66)
429  self->monsterinfo.currentmove = &soldier_move_pain2;
430  else
431  self->monsterinfo.currentmove = &soldier_move_pain3;
432 }
433 
434 
435 //
436 // ATTACK
437 //
438 
439 static int blaster_flash [] = {MZ2_SOLDIER_BLASTER_1, MZ2_SOLDIER_BLASTER_2, MZ2_SOLDIER_BLASTER_3, MZ2_SOLDIER_BLASTER_4, MZ2_SOLDIER_BLASTER_5, MZ2_SOLDIER_BLASTER_6, MZ2_SOLDIER_BLASTER_7, MZ2_SOLDIER_BLASTER_8};
440 static int shotgun_flash [] = {MZ2_SOLDIER_SHOTGUN_1, MZ2_SOLDIER_SHOTGUN_2, MZ2_SOLDIER_SHOTGUN_3, MZ2_SOLDIER_SHOTGUN_4, MZ2_SOLDIER_SHOTGUN_5, MZ2_SOLDIER_SHOTGUN_6, MZ2_SOLDIER_SHOTGUN_7, MZ2_SOLDIER_SHOTGUN_8};
441 static int machinegun_flash [] = {MZ2_SOLDIER_MACHINEGUN_1, MZ2_SOLDIER_MACHINEGUN_2, MZ2_SOLDIER_MACHINEGUN_3, MZ2_SOLDIER_MACHINEGUN_4, MZ2_SOLDIER_MACHINEGUN_5, MZ2_SOLDIER_MACHINEGUN_6, MZ2_SOLDIER_MACHINEGUN_7, MZ2_SOLDIER_MACHINEGUN_8};
442 
443 void soldier_fire(edict_t *self, int flash_number)
444 {
445  vec3_t start;
446  vec3_t forward, right, up;
447  vec3_t aim;
448  vec3_t dir;
449  vec3_t end;
450  float r, u;
451  int flash_index;
452 
453  if (self->s.skinnum < 2)
454  flash_index = blaster_flash[flash_number];
455  else if (self->s.skinnum < 4)
456  flash_index = shotgun_flash[flash_number];
457  else
458  flash_index = machinegun_flash[flash_number];
459 
460  AngleVectors(self->s.angles, forward, right, NULL);
461  G_ProjectSource(self->s.origin, monster_flash_offset[flash_index], forward, right, start);
462 
463  if (flash_number == 5 || flash_number == 6) {
464  VectorCopy(forward, aim);
465  } else {
466  VectorCopy(self->enemy->s.origin, end);
467  end[2] += self->enemy->viewheight;
468  VectorSubtract(end, start, aim);
469  vectoangles(aim, dir);
470  AngleVectors(dir, forward, right, up);
471 
472  r = crandom() * 1000;
473  u = crandom() * 500;
474  VectorMA(start, 8192, forward, end);
475  VectorMA(end, r, right, end);
476  VectorMA(end, u, up, end);
477 
478  VectorSubtract(end, start, aim);
479  VectorNormalize(aim);
480  }
481 
482  if (self->s.skinnum <= 1) {
483  monster_fire_blaster(self, start, aim, 5, 600, flash_index, EF_BLASTER);
484  } else if (self->s.skinnum <= 3) {
486  } else {
487  if (!(self->monsterinfo.aiflags & AI_HOLD_FRAME))
488  self->monsterinfo.pausetime = level.time + (3 + rand() % 8) * FRAMETIME;
489 
490  monster_fire_bullet(self, start, aim, 2, 4, DEFAULT_BULLET_HSPREAD, DEFAULT_BULLET_VSPREAD, flash_index);
491 
492  if (level.time >= self->monsterinfo.pausetime)
493  self->monsterinfo.aiflags &= ~AI_HOLD_FRAME;
494  else
495  self->monsterinfo.aiflags |= AI_HOLD_FRAME;
496  }
497 }
498 
499 // ATTACK1 (blaster/shotgun)
500 
501 void soldier_fire1(edict_t *self)
502 {
503  soldier_fire(self, 0);
504 }
505 
506 void soldier_attack1_refire1(edict_t *self)
507 {
508  if (self->s.skinnum > 1)
509  return;
510 
511  if (self->enemy->health <= 0)
512  return;
513 
514  if (((skill->value == 3) && (random() < 0.5)) || (range(self, self->enemy) == RANGE_MELEE))
515  self->monsterinfo.nextframe = FRAME_attak102;
516  else
517  self->monsterinfo.nextframe = FRAME_attak110;
518 }
519 
520 void soldier_attack1_refire2(edict_t *self)
521 {
522  if (self->s.skinnum < 2)
523  return;
524 
525  if (self->enemy->health <= 0)
526  return;
527 
528  if (((skill->value == 3) && (random() < 0.5)) || (range(self, self->enemy) == RANGE_MELEE))
529  self->monsterinfo.nextframe = FRAME_attak102;
530 }
531 
533  { ai_charge, 0, NULL },
534  { ai_charge, 0, NULL },
535  { ai_charge, 0, soldier_fire1 },
536  { ai_charge, 0, NULL },
537  { ai_charge, 0, NULL },
539  { ai_charge, 0, NULL },
540  { ai_charge, 0, soldier_cock },
542  { ai_charge, 0, NULL },
543  { ai_charge, 0, NULL },
544  { ai_charge, 0, NULL }
545 };
547 
548 // ATTACK2 (blaster/shotgun)
549 
550 void soldier_fire2(edict_t *self)
551 {
552  soldier_fire(self, 1);
553 }
554 
555 void soldier_attack2_refire1(edict_t *self)
556 {
557  if (self->s.skinnum > 1)
558  return;
559 
560  if (self->enemy->health <= 0)
561  return;
562 
563  if (((skill->value == 3) && (random() < 0.5)) || (range(self, self->enemy) == RANGE_MELEE))
564  self->monsterinfo.nextframe = FRAME_attak204;
565  else
566  self->monsterinfo.nextframe = FRAME_attak216;
567 }
568 
569 void soldier_attack2_refire2(edict_t *self)
570 {
571  if (self->s.skinnum < 2)
572  return;
573 
574  if (self->enemy->health <= 0)
575  return;
576 
577  if (((skill->value == 3) && (random() < 0.5)) || (range(self, self->enemy) == RANGE_MELEE))
578  self->monsterinfo.nextframe = FRAME_attak204;
579 }
580 
582  { ai_charge, 0, NULL },
583  { ai_charge, 0, NULL },
584  { ai_charge, 0, NULL },
585  { ai_charge, 0, NULL },
586  { ai_charge, 0, soldier_fire2 },
587  { ai_charge, 0, NULL },
588  { ai_charge, 0, NULL },
590  { ai_charge, 0, NULL },
591  { ai_charge, 0, NULL },
592  { ai_charge, 0, NULL },
593  { ai_charge, 0, NULL },
594  { ai_charge, 0, soldier_cock },
595  { ai_charge, 0, NULL },
597  { ai_charge, 0, NULL },
598  { ai_charge, 0, NULL },
599  { ai_charge, 0, NULL }
600 };
602 
603 // ATTACK3 (duck and shoot)
604 
605 void soldier_duck_down(edict_t *self)
606 {
607  if (self->monsterinfo.aiflags & AI_DUCKED)
608  return;
609  self->monsterinfo.aiflags |= AI_DUCKED;
610  self->maxs[2] -= 32;
611  self->takedamage = DAMAGE_YES;
612  self->monsterinfo.pausetime = level.time + 1;
613  gi.linkentity(self);
614 }
615 
616 void soldier_duck_up(edict_t *self)
617 {
618  self->monsterinfo.aiflags &= ~AI_DUCKED;
619  self->maxs[2] += 32;
620  self->takedamage = DAMAGE_AIM;
621  gi.linkentity(self);
622 }
623 
624 void soldier_fire3(edict_t *self)
625 {
626  soldier_duck_down(self);
627  soldier_fire(self, 2);
628 }
629 
630 void soldier_attack3_refire(edict_t *self)
631 {
632  if ((level.time + 0.4) < self->monsterinfo.pausetime)
633  self->monsterinfo.nextframe = FRAME_attak303;
634 }
635 
637  { ai_charge, 0, NULL },
638  { ai_charge, 0, NULL },
639  { ai_charge, 0, soldier_fire3 },
640  { ai_charge, 0, NULL },
641  { ai_charge, 0, NULL },
643  { ai_charge, 0, soldier_duck_up },
644  { ai_charge, 0, NULL },
645  { ai_charge, 0, NULL }
646 };
648 
649 // ATTACK4 (machinegun)
650 
651 void soldier_fire4(edict_t *self)
652 {
653  soldier_fire(self, 3);
654 //
655 // if (self->enemy->health <= 0)
656 // return;
657 //
658 // if ( ((skill->value == 3) && (random() < 0.5)) || (range(self, self->enemy) == RANGE_MELEE) )
659 // self->monsterinfo.nextframe = FRAME_attak402;
660 }
661 
663  { ai_charge, 0, NULL },
664  { ai_charge, 0, NULL },
665  { ai_charge, 0, soldier_fire4 },
666  { ai_charge, 0, NULL },
667  { ai_charge, 0, NULL },
668  { ai_charge, 0, NULL }
669 };
671 
672 #if 0
673 // ATTACK5 (prone)
674 
675 void soldier_fire5(edict_t *self)
676 {
677  soldier_fire(self, 4);
678 }
679 
680 void soldier_attack5_refire(edict_t *self)
681 {
682  if (self->enemy->health <= 0)
683  return;
684 
685  if (((skill->value == 3) && (random() < 0.5)) || (range(self, self->enemy) == RANGE_MELEE))
686  self->monsterinfo.nextframe = FRAME_attak505;
687 }
688 
689 mframe_t soldier_frames_attack5 [] = {
690  { ai_charge, 8, NULL },
691  { ai_charge, 8, NULL },
692  { ai_charge, 0, NULL },
693  { ai_charge, 0, NULL },
694  { ai_charge, 0, soldier_fire5 },
695  { ai_charge, 0, NULL },
696  { ai_charge, 0, NULL },
697  { ai_charge, 0, soldier_attack5_refire }
698 };
699 mmove_t soldier_move_attack5 = {FRAME_attak501, FRAME_attak508, soldier_frames_attack5, soldier_run};
700 #endif
701 
702 // ATTACK6 (run & shoot)
703 
704 void soldier_fire8(edict_t *self)
705 {
706  soldier_fire(self, 7);
707 }
708 
709 void soldier_attack6_refire(edict_t *self)
710 {
711  if (self->enemy->health <= 0)
712  return;
713 
714  if (range(self, self->enemy) < RANGE_MID)
715  return;
716 
717  if (skill->value == 3)
718  self->monsterinfo.nextframe = FRAME_runs03;
719 }
720 
722  { ai_charge, 10, NULL },
723  { ai_charge, 4, NULL },
724  { ai_charge, 12, NULL },
725  { ai_charge, 11, soldier_fire8 },
726  { ai_charge, 13, NULL },
727  { ai_charge, 18, NULL },
728  { ai_charge, 15, NULL },
729  { ai_charge, 14, NULL },
730  { ai_charge, 11, NULL },
731  { ai_charge, 8, NULL },
732  { ai_charge, 11, NULL },
733  { ai_charge, 12, NULL },
734  { ai_charge, 12, NULL },
736 };
738 
739 void soldier_attack(edict_t *self)
740 {
741  if (self->s.skinnum < 4) {
742  if (random() < 0.5)
743  self->monsterinfo.currentmove = &soldier_move_attack1;
744  else
745  self->monsterinfo.currentmove = &soldier_move_attack2;
746  } else {
747  self->monsterinfo.currentmove = &soldier_move_attack4;
748  }
749 }
750 
751 
752 //
753 // SIGHT
754 //
755 
756 void soldier_sight(edict_t *self, edict_t *other)
757 {
758  if (random() < 0.5)
759  gi.sound(self, CHAN_VOICE, sound_sight1, 1, ATTN_NORM, 0);
760  else
761  gi.sound(self, CHAN_VOICE, sound_sight2, 1, ATTN_NORM, 0);
762 
763  if ((skill->value > 0) && (range(self, self->enemy) >= RANGE_MID)) {
764  if (random() > 0.5)
765  self->monsterinfo.currentmove = &soldier_move_attack6;
766  }
767 }
768 
769 //
770 // DUCK
771 //
772 
773 void soldier_duck_hold(edict_t *self)
774 {
775  if (level.time >= self->monsterinfo.pausetime)
776  self->monsterinfo.aiflags &= ~AI_HOLD_FRAME;
777  else
778  self->monsterinfo.aiflags |= AI_HOLD_FRAME;
779 }
780 
782  { ai_move, 5, soldier_duck_down },
783  { ai_move, -1, soldier_duck_hold },
784  { ai_move, 1, NULL },
785  { ai_move, 0, soldier_duck_up },
786  { ai_move, 5, NULL }
787 };
789 
790 void soldier_dodge(edict_t *self, edict_t *attacker, float eta)
791 {
792  float r;
793 
794  r = random();
795  if (r > 0.25)
796  return;
797 
798  if (!self->enemy)
799  self->enemy = attacker;
800 
801  if (skill->value == 0) {
802  self->monsterinfo.currentmove = &soldier_move_duck;
803  return;
804  }
805 
806  self->monsterinfo.pausetime = level.time + eta + 0.3;
807  r = random();
808 
809  if (skill->value == 1) {
810  if (r > 0.33)
811  self->monsterinfo.currentmove = &soldier_move_duck;
812  else
813  self->monsterinfo.currentmove = &soldier_move_attack3;
814  return;
815  }
816 
817  if (skill->value >= 2) {
818  if (r > 0.66)
819  self->monsterinfo.currentmove = &soldier_move_duck;
820  else
821  self->monsterinfo.currentmove = &soldier_move_attack3;
822  return;
823  }
824 
825  self->monsterinfo.currentmove = &soldier_move_attack3;
826 }
827 
828 
829 //
830 // DEATH
831 //
832 
833 void soldier_fire6(edict_t *self)
834 {
835  soldier_fire(self, 5);
836 }
837 
838 void soldier_fire7(edict_t *self)
839 {
840  soldier_fire(self, 6);
841 }
842 
843 void soldier_dead(edict_t *self)
844 {
845  VectorSet(self->mins, -16, -16, -24);
846  VectorSet(self->maxs, 16, 16, -8);
847  self->movetype = MOVETYPE_TOSS;
848  self->svflags |= SVF_DEADMONSTER;
849  self->nextthink = 0;
850  gi.linkentity(self);
851 }
852 
854  { ai_move, 0, NULL },
855  { ai_move, -10, NULL },
856  { ai_move, -10, NULL },
857  { ai_move, -10, NULL },
858  { ai_move, -5, NULL },
859  { ai_move, 0, NULL },
860  { ai_move, 0, NULL },
861  { ai_move, 0, NULL },
862  { ai_move, 0, NULL },
863  { ai_move, 0, NULL },
864 
865  { ai_move, 0, NULL },
866  { ai_move, 0, NULL },
867  { ai_move, 0, NULL },
868  { ai_move, 0, NULL },
869  { ai_move, 0, NULL },
870  { ai_move, 0, NULL },
871  { ai_move, 0, NULL },
872  { ai_move, 0, NULL },
873  { ai_move, 0, NULL },
874  { ai_move, 0, NULL },
875 
876  { ai_move, 0, NULL },
877  { ai_move, 0, soldier_fire6 },
878  { ai_move, 0, NULL },
879  { ai_move, 0, NULL },
880  { ai_move, 0, soldier_fire7 },
881  { ai_move, 0, NULL },
882  { ai_move, 0, NULL },
883  { ai_move, 0, NULL },
884  { ai_move, 0, NULL },
885  { ai_move, 0, NULL },
886 
887  { ai_move, 0, NULL },
888  { ai_move, 0, NULL },
889  { ai_move, 0, NULL },
890  { ai_move, 0, NULL },
891  { ai_move, 0, NULL },
892  { ai_move, 0, NULL }
893 };
895 
897  { ai_move, -5, NULL },
898  { ai_move, -5, NULL },
899  { ai_move, -5, NULL },
900  { ai_move, 0, NULL },
901  { ai_move, 0, NULL },
902  { ai_move, 0, NULL },
903  { ai_move, 0, NULL },
904  { ai_move, 0, NULL },
905  { ai_move, 0, NULL },
906  { ai_move, 0, NULL },
907 
908  { ai_move, 0, NULL },
909  { ai_move, 0, NULL },
910  { ai_move, 0, NULL },
911  { ai_move, 0, NULL },
912  { ai_move, 0, NULL },
913  { ai_move, 0, NULL },
914  { ai_move, 0, NULL },
915  { ai_move, 0, NULL },
916  { ai_move, 0, NULL },
917  { ai_move, 0, NULL },
918 
919  { ai_move, 0, NULL },
920  { ai_move, 0, NULL },
921  { ai_move, 0, NULL },
922  { ai_move, 0, NULL },
923  { ai_move, 0, NULL },
924  { ai_move, 0, NULL },
925  { ai_move, 0, NULL },
926  { ai_move, 0, NULL },
927  { ai_move, 0, NULL },
928  { ai_move, 0, NULL },
929 
930  { ai_move, 0, NULL },
931  { ai_move, 0, NULL },
932  { ai_move, 0, NULL },
933  { ai_move, 0, NULL },
934  { ai_move, 0, NULL }
935 };
937 
939  { ai_move, -5, NULL },
940  { ai_move, -5, NULL },
941  { ai_move, -5, NULL },
942  { ai_move, 0, NULL },
943  { ai_move, 0, NULL },
944  { ai_move, 0, NULL },
945  { ai_move, 0, NULL },
946  { ai_move, 0, NULL },
947  { ai_move, 0, NULL },
948  { ai_move, 0, NULL },
949 
950  { ai_move, 0, NULL },
951  { ai_move, 0, NULL },
952  { ai_move, 0, NULL },
953  { ai_move, 0, NULL },
954  { ai_move, 0, NULL },
955  { ai_move, 0, NULL },
956  { ai_move, 0, NULL },
957  { ai_move, 0, NULL },
958  { ai_move, 0, NULL },
959  { ai_move, 0, NULL },
960 
961  { ai_move, 0, NULL },
962  { ai_move, 0, NULL },
963  { ai_move, 0, NULL },
964  { ai_move, 0, NULL },
965  { ai_move, 0, NULL },
966  { ai_move, 0, NULL },
967  { ai_move, 0, NULL },
968  { ai_move, 0, NULL },
969  { ai_move, 0, NULL },
970  { ai_move, 0, NULL },
971 
972  { ai_move, 0, NULL },
973  { ai_move, 0, NULL },
974  { ai_move, 0, NULL },
975  { ai_move, 0, NULL },
976  { ai_move, 0, NULL },
977  { ai_move, 0, NULL },
978  { ai_move, 0, NULL },
979  { ai_move, 0, NULL },
980  { ai_move, 0, NULL },
981  { ai_move, 0, NULL },
982 
983  { ai_move, 0, NULL },
984  { ai_move, 0, NULL },
985  { ai_move, 0, NULL },
986  { ai_move, 0, NULL },
987  { ai_move, 0, NULL },
988 };
990 
992  { ai_move, 0, NULL },
993  { ai_move, 0, NULL },
994  { ai_move, 0, NULL },
995  { ai_move, 0, NULL },
996  { ai_move, 0, NULL },
997  { ai_move, 0, NULL },
998  { ai_move, 0, NULL },
999  { ai_move, 0, NULL },
1000  { ai_move, 0, NULL },
1001  { ai_move, 0, NULL },
1002 
1003  { ai_move, 0, NULL },
1004  { ai_move, 0, NULL },
1005  { ai_move, 0, NULL },
1006  { ai_move, 0, NULL },
1007  { ai_move, 0, NULL },
1008  { ai_move, 0, NULL },
1009  { ai_move, 0, NULL },
1010  { ai_move, 0, NULL },
1011  { ai_move, 0, NULL },
1012  { ai_move, 0, NULL },
1013 
1014  { ai_move, 0, NULL },
1015  { ai_move, 0, NULL },
1016  { ai_move, 0, NULL },
1017  { ai_move, 0, NULL },
1018  { ai_move, 0, NULL },
1019  { ai_move, 0, NULL },
1020  { ai_move, 0, NULL },
1021  { ai_move, 0, NULL },
1022  { ai_move, 0, NULL },
1023  { ai_move, 0, NULL },
1024 
1025  { ai_move, 0, NULL },
1026  { ai_move, 0, NULL },
1027  { ai_move, 0, NULL },
1028  { ai_move, 0, NULL },
1029  { ai_move, 0, NULL },
1030  { ai_move, 0, NULL },
1031  { ai_move, 0, NULL },
1032  { ai_move, 0, NULL },
1033  { ai_move, 0, NULL },
1034  { ai_move, 0, NULL },
1035 
1036  { ai_move, 0, NULL },
1037  { ai_move, 0, NULL },
1038  { ai_move, 0, NULL },
1039  { ai_move, 0, NULL },
1040  { ai_move, 0, NULL },
1041  { ai_move, 0, NULL },
1042  { ai_move, 0, NULL },
1043  { ai_move, 0, NULL },
1044  { ai_move, 0, NULL },
1045  { ai_move, 0, NULL },
1046 
1047  { ai_move, 0, NULL },
1048  { ai_move, 0, NULL },
1049  { ai_move, 0, NULL }
1050 };
1052 
1054  { ai_move, -5, NULL },
1055  { ai_move, -5, NULL },
1056  { ai_move, -5, NULL },
1057  { ai_move, 0, NULL },
1058  { ai_move, 0, NULL },
1059  { ai_move, 0, NULL },
1060  { ai_move, 0, NULL },
1061  { ai_move, 0, NULL },
1062  { ai_move, 0, NULL },
1063  { ai_move, 0, NULL },
1064 
1065  { ai_move, 0, NULL },
1066  { ai_move, 0, NULL },
1067  { ai_move, 0, NULL },
1068  { ai_move, 0, NULL },
1069  { ai_move, 0, NULL },
1070  { ai_move, 0, NULL },
1071  { ai_move, 0, NULL },
1072  { ai_move, 0, NULL },
1073  { ai_move, 0, NULL },
1074  { ai_move, 0, NULL },
1075 
1076  { ai_move, 0, NULL },
1077  { ai_move, 0, NULL },
1078  { ai_move, 0, NULL },
1079  { ai_move, 0, NULL }
1080 };
1082 
1084  { ai_move, 0, NULL },
1085  { ai_move, 0, NULL },
1086  { ai_move, 0, NULL },
1087  { ai_move, 0, NULL },
1088  { ai_move, 0, NULL },
1089  { ai_move, 0, NULL },
1090  { ai_move, 0, NULL },
1091  { ai_move, 0, NULL },
1092  { ai_move, 0, NULL },
1093  { ai_move, 0, NULL }
1094 };
1096 
1097 void soldier_die(edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point)
1098 {
1099  int n;
1100 
1101 // check for gib
1102  if (self->health <= self->gib_health) {
1103  gi.sound(self, CHAN_VOICE, gi.soundindex("misc/udeath.wav"), 1, ATTN_NORM, 0);
1104  for (n = 0; n < 3; n++)
1105  ThrowGib(self, "models/objects/gibs/sm_meat/tris.md2", damage, GIB_ORGANIC);
1106  ThrowGib(self, "models/objects/gibs/chest/tris.md2", damage, GIB_ORGANIC);
1107  ThrowHead(self, "models/objects/gibs/head2/tris.md2", damage, GIB_ORGANIC);
1108  self->deadflag = DEAD_DEAD;
1109  return;
1110  }
1111 
1112  if (self->deadflag == DEAD_DEAD)
1113  return;
1114 
1115 // regular death
1116  self->deadflag = DEAD_DEAD;
1117  self->takedamage = DAMAGE_YES;
1118  self->s.skinnum |= 1;
1119 
1120  if (self->s.skinnum == 1)
1121  gi.sound(self, CHAN_VOICE, sound_death_light, 1, ATTN_NORM, 0);
1122  else if (self->s.skinnum == 3)
1123  gi.sound(self, CHAN_VOICE, sound_death, 1, ATTN_NORM, 0);
1124  else // (self->s.skinnum == 5)
1125  gi.sound(self, CHAN_VOICE, sound_death_ss, 1, ATTN_NORM, 0);
1126 
1127  if (fabs((self->s.origin[2] + self->viewheight) - point[2]) <= 4) {
1128  // head shot
1129  self->monsterinfo.currentmove = &soldier_move_death3;
1130  return;
1131  }
1132 
1133  n = rand() % 5;
1134  if (n == 0)
1135  self->monsterinfo.currentmove = &soldier_move_death1;
1136  else if (n == 1)
1137  self->monsterinfo.currentmove = &soldier_move_death2;
1138  else if (n == 2)
1139  self->monsterinfo.currentmove = &soldier_move_death4;
1140  else if (n == 3)
1141  self->monsterinfo.currentmove = &soldier_move_death5;
1142  else
1143  self->monsterinfo.currentmove = &soldier_move_death6;
1144 }
1145 
1146 
1147 //
1148 // SPAWN
1149 //
1150 
1151 void SP_monster_soldier_x(edict_t *self)
1152 {
1153 
1154  self->s.modelindex = gi.modelindex("models/monsters/soldier/tris.md2");
1155  self->monsterinfo.scale = MODEL_SCALE;
1156  VectorSet(self->mins, -16, -16, -24);
1157  VectorSet(self->maxs, 16, 16, 32);
1158  self->movetype = MOVETYPE_STEP;
1159  self->solid = SOLID_BBOX;
1160 
1161  sound_idle = gi.soundindex("soldier/solidle1.wav");
1162  sound_sight1 = gi.soundindex("soldier/solsght1.wav");
1163  sound_sight2 = gi.soundindex("soldier/solsrch1.wav");
1164  sound_cock = gi.soundindex("infantry/infatck3.wav");
1165 
1166  self->mass = 100;
1167 
1168  self->pain = soldier_pain;
1169  self->die = soldier_die;
1170 
1171  self->monsterinfo.stand = soldier_stand;
1172  self->monsterinfo.walk = soldier_walk;
1173  self->monsterinfo.run = soldier_run;
1174  self->monsterinfo.dodge = soldier_dodge;
1175  self->monsterinfo.attack = soldier_attack;
1176  self->monsterinfo.melee = NULL;
1177  self->monsterinfo.sight = soldier_sight;
1178 
1179  gi.linkentity(self);
1180 
1181  self->monsterinfo.stand(self);
1182 
1183  walkmonster_start(self);
1184 }
1185 
1186 
1187 /*QUAKED monster_soldier_light (1 .5 0) (-16 -16 -24) (16 16 32) Ambush Trigger_Spawn Sight
1188 */
1189 void SP_monster_soldier_light(edict_t *self)
1190 {
1191  if (deathmatch->value) {
1192  G_FreeEdict(self);
1193  return;
1194  }
1195 
1196  SP_monster_soldier_x(self);
1197 
1198  sound_pain_light = gi.soundindex("soldier/solpain2.wav");
1199  sound_death_light = gi.soundindex("soldier/soldeth2.wav");
1200  gi.modelindex("models/objects/laser/tris.md2");
1201  gi.soundindex("misc/lasfly.wav");
1202  gi.soundindex("soldier/solatck2.wav");
1203 
1204  self->s.skinnum = 0;
1205  self->health = 20;
1206  self->gib_health = -30;
1207 }
1208 
1209 /*QUAKED monster_soldier (1 .5 0) (-16 -16 -24) (16 16 32) Ambush Trigger_Spawn Sight
1210 */
1211 void SP_monster_soldier(edict_t *self)
1212 {
1213  if (deathmatch->value) {
1214  G_FreeEdict(self);
1215  return;
1216  }
1217 
1218  SP_monster_soldier_x(self);
1219 
1220  sound_pain = gi.soundindex("soldier/solpain1.wav");
1221  sound_death = gi.soundindex("soldier/soldeth1.wav");
1222  gi.soundindex("soldier/solatck1.wav");
1223 
1224  self->s.skinnum = 2;
1225  self->health = 30;
1226  self->gib_health = -30;
1227 }
1228 
1229 /*QUAKED monster_soldier_ss (1 .5 0) (-16 -16 -24) (16 16 32) Ambush Trigger_Spawn Sight
1230 */
1231 void SP_monster_soldier_ss(edict_t *self)
1232 {
1233  if (deathmatch->value) {
1234  G_FreeEdict(self);
1235  return;
1236  }
1237 
1238  SP_monster_soldier_x(self);
1239 
1240  sound_pain_ss = gi.soundindex("soldier/solpain3.wav");
1241  sound_death_ss = gi.soundindex("soldier/soldeth3.wav");
1242  gi.soundindex("soldier/solatck3.wav");
1243 
1244  self->s.skinnum = 4;
1245  self->health = 40;
1246  self->gib_health = -30;
1247 }
soldier_move_pain4
mmove_t soldier_move_pain4
Definition: m_soldier.c:389
FRAME_attak401
#define FRAME_attak401
Definition: m_boss32.h:231
gi
game_import_t gi
Definition: g_main.c:23
soldier_move_pain2
mmove_t soldier_move_pain2
Definition: m_soldier.c:346
SP_monster_soldier_light
void SP_monster_soldier_light(edict_t *self)
Definition: m_soldier.c:1189
sound_cock
static int sound_cock
Definition: m_soldier.c:39
sound_sight2
static int sound_sight2
Definition: m_soldier.c:32
FRAME_death201
#define FRAME_death201
Definition: m_actor.h:33
deathmatch
cvar_t * deathmatch
Definition: g_main.c:33
soldier_move_attack4
mmove_t soldier_move_attack4
Definition: m_soldier.c:670
FRAME_duck01
#define FRAME_duck01
Definition: m_brain.h:168
FRAME_death501
#define FRAME_death501
Definition: m_soldier.h:463
SP_monster_soldier_ss
void SP_monster_soldier_ss(edict_t *self)
Definition: m_soldier.c:1231
soldier_frames_start_run
mframe_t soldier_frames_start_run[]
Definition: m_soldier.c:291
G_ProjectSource
void G_ProjectSource(const vec3_t point, const vec3_t distance, const vec3_t forward, const vec3_t right, vec3_t result)
Definition: g_utils.c:23
soldier_frames_death6
mframe_t soldier_frames_death6[]
Definition: m_soldier.c:1083
FRAME_attak501
#define FRAME_attak501
Definition: m_boss32.h:257
soldier_fire2
void soldier_fire2(edict_t *self)
Definition: m_soldier.c:550
DEAD_DEAD
#define DEAD_DEAD
Definition: g_local.h:112
soldier_duck_down
void soldier_duck_down(edict_t *self)
Definition: m_soldier.c:605
soldier_idle
void soldier_idle(edict_t *self)
Definition: m_soldier.c:42
shotgun_flash
static int shotgun_flash[]
Definition: m_soldier.c:440
FRAME_pain301
#define FRAME_pain301
Definition: m_actor.h:102
blaster_flash
static int blaster_flash[]
Definition: m_soldier.c:439
DEFAULT_BULLET_HSPREAD
#define DEFAULT_BULLET_HSPREAD
Definition: g_local.h:654
ThrowGib
void ThrowGib(edict_t *self, char *gibname, int damage, int type)
Definition: g_misc.c:130
FRAME_stand339
#define FRAME_stand339
Definition: m_soldier.h:236
FRAME_runs01
#define FRAME_runs01
Definition: m_actor.h:126
ai_charge
void ai_charge(edict_t *self, float dist)
Definition: g_ai.c:175
FRAME_pain207
#define FRAME_pain207
Definition: m_brain.h:137
FRAME_attak102
#define FRAME_attak102
Definition: m_boss31.h:23
soldier_move_pain1
mmove_t soldier_move_pain1
Definition: m_soldier.c:335
soldier_frames_death4
mframe_t soldier_frames_death4[]
Definition: m_soldier.c:991
soldier_die
void soldier_die(edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point)
Definition: m_soldier.c:1097
soldier_attack3_refire
void soldier_attack3_refire(edict_t *self)
Definition: m_soldier.c:630
FRAME_stand101
#define FRAME_stand101
Definition: m_actor.h:150
FRAMETIME
#define FRAMETIME
Definition: g_local.h:75
soldier_move_pain3
mmove_t soldier_move_pain3
Definition: m_soldier.c:368
FRAME_pain401
#define FRAME_pain401
Definition: m_boss32.h:401
sound_death
static int sound_death
Definition: m_soldier.c:37
FRAME_attak204
#define FRAME_attak204
Definition: m_boss31.h:43
machinegun_flash
static int machinegun_flash[]
Definition: m_soldier.c:441
soldier_attack2_refire2
void soldier_attack2_refire2(edict_t *self)
Definition: m_soldier.c:569
SP_monster_soldier_x
void SP_monster_soldier_x(edict_t *self)
Definition: m_soldier.c:1151
soldier_frames_pain1
mframe_t soldier_frames_pain1[]
Definition: m_soldier.c:328
soldier_move_death2
mmove_t soldier_move_death2
Definition: m_soldier.c:936
sound_pain_ss
static int sound_pain_ss
Definition: m_soldier.c:35
FRAME_death610
#define FRAME_death610
Definition: m_soldier.h:496
FRAME_death101
#define FRAME_death101
Definition: m_actor.h:26
AI_STAND_GROUND
#define AI_STAND_GROUND
Definition: g_local.h:126
FRAME_run01
#define FRAME_run01
Definition: m_actor.h:114
FRAME_runs14
#define FRAME_runs14
Definition: m_soldier.h:144
soldier_frames_attack4
mframe_t soldier_frames_attack4[]
Definition: m_soldier.c:662
soldier_fire7
void soldier_fire7(edict_t *self)
Definition: m_soldier.c:838
soldier_frames_stand3
mframe_t soldier_frames_stand3[]
Definition: m_soldier.c:97
MODEL_SCALE
#define MODEL_SCALE
Definition: m_actor.h:504
sound_death_ss
static int sound_death_ss
Definition: m_soldier.c:38
DAMAGE_YES
@ DAMAGE_YES
Definition: g_local.h:88
soldier_frames_pain3
mframe_t soldier_frames_pain3[]
Definition: m_soldier.c:348
DEFAULT_SHOTGUN_COUNT
#define DEFAULT_SHOTGUN_COUNT
Definition: g_local.h:659
soldier_fire4
void soldier_fire4(edict_t *self)
Definition: m_soldier.c:651
FRAME_attak216
#define FRAME_attak216
Definition: m_brain.h:108
FRAME_walk218
#define FRAME_walk218
Definition: m_brain.h:52
FRAME_death301
#define FRAME_death301
Definition: m_actor.h:46
soldier_move_death3
mmove_t soldier_move_death3
Definition: m_soldier.c:989
soldier_sight
void soldier_sight(edict_t *self, edict_t *other)
Definition: m_soldier.c:756
other
@ other
Definition: ogg.c:63
FRAME_run02
#define FRAME_run02
Definition: m_actor.h:115
soldier_frames_run
mframe_t soldier_frames_run[]
Definition: m_soldier.c:297
FRAME_pain101
#define FRAME_pain101
Definition: m_actor.h:96
walkmonster_start
void walkmonster_start(edict_t *self)
Definition: g_monster.c:630
MOVETYPE_STEP
@ MOVETYPE_STEP
Definition: g_local.h:192
soldier_attack6_refire
void soldier_attack6_refire(edict_t *self)
Definition: m_soldier.c:709
soldier_move_attack3
mmove_t soldier_move_attack3
Definition: m_soldier.c:647
soldier_move_walk1
mmove_t soldier_move_walk1
Definition: m_soldier.c:260
FRAME_attak201
#define FRAME_attak201
Definition: m_boss31.h:40
soldier_frames_walk1
mframe_t soldier_frames_walk1[]
Definition: m_soldier.c:225
soldier_frames_pain4
mframe_t soldier_frames_pain4[]
Definition: m_soldier.c:370
FRAME_run08
#define FRAME_run08
Definition: m_actor.h:121
soldier_pain
void soldier_pain(edict_t *self, edict_t *other, float kick, int damage)
Definition: m_soldier.c:392
soldier_move_attack2
mmove_t soldier_move_attack2
Definition: m_soldier.c:601
FRAME_attak406
#define FRAME_attak406
Definition: m_boss32.h:236
vectoangles
void vectoangles(vec3_t vec, vec3_t angles)
Definition: g_utils.c:330
DEFAULT_BULLET_VSPREAD
#define DEFAULT_BULLET_VSPREAD
Definition: g_local.h:655
soldier_cock
void soldier_cock(edict_t *self)
Definition: m_soldier.c:48
G_FreeEdict
void G_FreeEdict(edict_t *e)
Definition: g_utils.c:421
FRAME_attak508
#define FRAME_attak508
Definition: m_boss32.h:264
FRAME_attak110
#define FRAME_attak110
Definition: m_boss31.h:31
soldier_move_attack1
mmove_t soldier_move_attack1
Definition: m_soldier.c:546
soldier_move_start_run
mmove_t soldier_move_start_run
Definition: m_soldier.c:295
FRAME_duck05
#define FRAME_duck05
Definition: m_brain.h:172
sound_death_light
static int sound_death_light
Definition: m_soldier.c:36
soldier_frames_attack2
mframe_t soldier_frames_attack2[]
Definition: m_soldier.c:581
soldier_move_duck
mmove_t soldier_move_duck
Definition: m_soldier.c:788
forward
static vec3_t forward
Definition: p_view.c:27
crandom
#define crandom()
Definition: g_local.h:505
soldier_walk1_random
void soldier_walk1_random(edict_t *self)
Definition: m_soldier.c:219
soldier_frames_stand1
mframe_t soldier_frames_stand1[]
Definition: m_soldier.c:61
AI_HOLD_FRAME
#define AI_HOLD_FRAME
Definition: g_local.h:133
FRAME_death235
#define FRAME_death235
Definition: m_boss32.h:307
FRAME_attak301
#define FRAME_attak301
Definition: m_boss32.h:223
soldier_move_death6
mmove_t soldier_move_death6
Definition: m_soldier.c:1095
mframe_t
Definition: g_local.h:394
soldier_fire3
void soldier_fire3(edict_t *self)
Definition: m_soldier.c:624
sound_sight1
static int sound_sight1
Definition: m_soldier.c:31
mmove_t
Definition: g_local.h:400
ai_walk
void ai_walk(edict_t *self, float dist)
Definition: g_ai.c:148
m_soldier.h
random
#define random()
Definition: g_local.h:504
FRAME_death345
#define FRAME_death345
Definition: m_soldier.h:409
AngleVectors
void AngleVectors(vec3_t angles, vec3_t forward, vec3_t right, vec3_t up)
Definition: shared.c:23
FRAME_attak309
#define FRAME_attak309
Definition: m_float.h:100
soldier_frames_attack1
mframe_t soldier_frames_attack1[]
Definition: m_soldier.c:532
soldier_duck_up
void soldier_duck_up(edict_t *self)
Definition: m_soldier.c:616
soldier_attack2_refire1
void soldier_attack2_refire1(edict_t *self)
Definition: m_soldier.c:555
soldier_stand
void soldier_stand(edict_t *self)
Definition: m_soldier.c:206
FRAME_pain105
#define FRAME_pain105
Definition: m_brain.h:114
FRAME_death453
#define FRAME_death453
Definition: m_soldier.h:462
monster_fire_bullet
void monster_fire_bullet(edict_t *self, vec3_t start, vec3_t dir, int damage, int kick, int hspread, int vspread, int flashtype)
Definition: g_monster.c:29
soldier_run
void soldier_run(edict_t *self)
Definition: m_soldier.c:307
skill
cvar_t * skill
Definition: g_main.c:36
soldier_frames_death2
mframe_t soldier_frames_death2[]
Definition: m_soldier.c:896
FRAME_runs03
#define FRAME_runs03
Definition: m_actor.h:128
soldier_move_death1
mmove_t soldier_move_death1
Definition: m_soldier.c:894
soldier_move_run
mmove_t soldier_move_run
Definition: m_soldier.c:305
soldier_frames_death5
mframe_t soldier_frames_death5[]
Definition: m_soldier.c:1053
ai_move
void ai_move(edict_t *self, float dist)
Definition: g_ai.c:86
soldier_move_stand3
mmove_t soldier_move_stand3
Definition: m_soldier.c:141
FRAME_pain417
#define FRAME_pain417
Definition: m_soldier.h:118
level_locals_t::time
float time
Definition: g_local.h:299
monster_fire_blaster
void monster_fire_blaster(edict_t *self, vec3_t start, vec3_t dir, int damage, int speed, int flashtype, int effect)
Definition: g_monster.c:49
FRAME_walk209
#define FRAME_walk209
Definition: m_boss32.h:504
FRAME_attak303
#define FRAME_attak303
Definition: m_boss32.h:225
FRAME_death524
#define FRAME_death524
Definition: m_soldier.h:486
FRAME_attak112
#define FRAME_attak112
Definition: m_boss31.h:33
RANGE_MELEE
#define RANGE_MELEE
Definition: g_local.h:116
FRAME_death401
#define FRAME_death401
Definition: m_soldier.h:410
FRAME_stand130
#define FRAME_stand130
Definition: m_actor.h:179
DAMAGE_AIM
@ DAMAGE_AIM
Definition: g_local.h:89
up
static vec3_t up
Definition: p_view.c:27
soldier_frames_death1
mframe_t soldier_frames_death1[]
Definition: m_soldier.c:853
DEFAULT_SHOTGUN_HSPREAD
#define DEFAULT_SHOTGUN_HSPREAD
Definition: g_local.h:656
right
static vec3_t right
Definition: p_view.c:27
ai_run
void ai_run(edict_t *self, float dist)
Definition: g_ai.c:821
soldier_move_attack6
mmove_t soldier_move_attack6
Definition: m_soldier.c:737
FRAME_stand301
#define FRAME_stand301
Definition: m_soldier.h:198
GIB_ORGANIC
#define GIB_ORGANIC
Definition: g_local.h:122
FRAME_death136
#define FRAME_death136
Definition: m_soldier.h:329
FRAME_run03
#define FRAME_run03
Definition: m_actor.h:116
level
level_locals_t level
Definition: g_main.c:22
DEFAULT_SHOTGUN_VSPREAD
#define DEFAULT_SHOTGUN_VSPREAD
Definition: g_local.h:657
RANGE_MID
#define RANGE_MID
Definition: g_local.h:118
soldier_move_death4
mmove_t soldier_move_death4
Definition: m_soldier.c:1051
soldier_attack1_refire1
void soldier_attack1_refire1(edict_t *self)
Definition: m_soldier.c:506
monster_flash_offset
const vec3_t monster_flash_offset[256]
Definition: m_flash.c:25
soldier_attack1_refire2
void soldier_attack1_refire2(edict_t *self)
Definition: m_soldier.c:520
ThrowHead
void ThrowHead(edict_t *self, char *gibname, int damage, int type)
Definition: g_misc.c:175
FRAME_death601
#define FRAME_death601
Definition: m_soldier.h:487
soldier_fire1
void soldier_fire1(edict_t *self)
Definition: m_soldier.c:501
FRAME_pain201
#define FRAME_pain201
Definition: m_actor.h:99
soldier_fire8
void soldier_fire8(edict_t *self)
Definition: m_soldier.c:704
FRAME_attak505
#define FRAME_attak505
Definition: m_boss32.h:261
soldier_attack
void soldier_attack(edict_t *self)
Definition: m_soldier.c:739
MOVETYPE_TOSS
@ MOVETYPE_TOSS
Definition: g_local.h:194
range
int range(edict_t *self, edict_t *other)
Definition: g_ai.c:245
FRAME_attak218
#define FRAME_attak218
Definition: m_float.h:84
soldier_frames_duck
mframe_t soldier_frames_duck[]
Definition: m_soldier.c:781
FRAME_walk133
#define FRAME_walk133
Definition: m_soldier.h:269
soldier_walk
void soldier_walk(edict_t *self)
Definition: m_soldier.c:276
FRAME_stand322
#define FRAME_stand322
Definition: m_soldier.h:219
soldier_move_death5
mmove_t soldier_move_death5
Definition: m_soldier.c:1081
FRAME_pain318
#define FRAME_pain318
Definition: m_boss31.h:126
AI_DUCKED
#define AI_DUCKED
Definition: g_local.h:137
soldier_dodge
void soldier_dodge(edict_t *self, edict_t *attacker, float eta)
Definition: m_soldier.c:790
soldier_frames_walk2
mframe_t soldier_frames_walk2[]
Definition: m_soldier.c:262
monster_fire_shotgun
void monster_fire_shotgun(edict_t *self, vec3_t start, vec3_t aimdir, int damage, int kick, int hspread, int vspread, int count, int flashtype)
Definition: g_monster.c:39
soldier_frames_attack3
mframe_t soldier_frames_attack3[]
Definition: m_soldier.c:636
SP_monster_soldier
void SP_monster_soldier(edict_t *self)
Definition: m_soldier.c:1211
soldier_fire
void soldier_fire(edict_t *self, int flash_number)
Definition: m_soldier.c:443
soldier_frames_death3
mframe_t soldier_frames_death3[]
Definition: m_soldier.c:938
soldier_frames_attack6
mframe_t soldier_frames_attack6[]
Definition: m_soldier.c:721
soldier_duck_hold
void soldier_duck_hold(edict_t *self)
Definition: m_soldier.c:773
sound_pain_light
static int sound_pain_light
Definition: m_soldier.c:33
sound_idle
static int sound_idle
Definition: m_soldier.c:30
FRAME_walk101
#define FRAME_walk101
Definition: m_brain.h:22
VectorNormalize
vec_t VectorNormalize(vec3_t v)
Definition: shared.c:55
soldier_move_stand1
mmove_t soldier_move_stand1
Definition: m_soldier.c:95
soldier_move_walk2
mmove_t soldier_move_walk2
Definition: m_soldier.c:274
ai_stand
void ai_stand(edict_t *self, float dist)
Definition: g_ai.c:100
soldier_fire6
void soldier_fire6(edict_t *self)
Definition: m_soldier.c:833
sound_pain
static int sound_pain
Definition: m_soldier.c:34
FRAME_attak101
#define FRAME_attak101
Definition: m_boss31.h:22
g_local.h
soldier_dead
void soldier_dead(edict_t *self)
Definition: m_soldier.c:843
soldier_frames_pain2
mframe_t soldier_frames_pain2[]
Definition: m_soldier.c:337