vkQuake2 doxygen  1.0 dev
m_brain.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
5 modify it under the terms of the GNU General Public License
6 as published by the Free Software Foundation; either version 2
7 of the License, or (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.
12 
13 See the GNU General Public License for more details.
14 
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 
19 */
20 /*
21 ==============================================================================
22 
23 brain
24 
25 ==============================================================================
26 */
27 
28 #include "g_local.h"
29 #include "m_brain.h"
30 
31 
32 static int sound_chest_open;
35 static int sound_death;
36 static int sound_idle1;
37 static int sound_idle2;
38 static int sound_idle3;
39 static int sound_pain1;
40 static int sound_pain2;
41 static int sound_sight;
42 static int sound_search;
43 static int sound_melee1;
44 static int sound_melee2;
45 static int sound_melee3;
46 
47 
48 void brain_sight (edict_t *self, edict_t *other)
49 {
50  gi.sound (self, CHAN_VOICE, sound_sight, 1, ATTN_NORM, 0);
51 }
52 
53 void brain_search (edict_t *self)
54 {
55  gi.sound (self, CHAN_VOICE, sound_search, 1, ATTN_NORM, 0);
56 }
57 
58 
59 void brain_run (edict_t *self);
60 void brain_dead (edict_t *self);
61 
62 
63 //
64 // STAND
65 //
66 
68 {
69  ai_stand, 0, NULL,
70  ai_stand, 0, NULL,
71  ai_stand, 0, NULL,
72  ai_stand, 0, NULL,
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 
80  ai_stand, 0, NULL,
81  ai_stand, 0, NULL,
82  ai_stand, 0, NULL,
83  ai_stand, 0, NULL,
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 
91  ai_stand, 0, NULL,
92  ai_stand, 0, NULL,
93  ai_stand, 0, NULL,
94  ai_stand, 0, NULL,
95  ai_stand, 0, NULL,
96  ai_stand, 0, NULL,
97  ai_stand, 0, NULL,
98  ai_stand, 0, NULL,
99  ai_stand, 0, NULL,
100  ai_stand, 0, NULL
101 };
103 
104 void brain_stand (edict_t *self)
105 {
106  self->monsterinfo.currentmove = &brain_move_stand;
107 }
108 
109 
110 //
111 // IDLE
112 //
113 
115 {
116  ai_stand, 0, NULL,
117  ai_stand, 0, NULL,
118  ai_stand, 0, NULL,
119  ai_stand, 0, NULL,
120  ai_stand, 0, NULL,
121  ai_stand, 0, NULL,
122  ai_stand, 0, NULL,
123  ai_stand, 0, NULL,
124  ai_stand, 0, NULL,
125  ai_stand, 0, NULL,
126 
127  ai_stand, 0, NULL,
128  ai_stand, 0, NULL,
129  ai_stand, 0, NULL,
130  ai_stand, 0, NULL,
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 
138  ai_stand, 0, NULL,
139  ai_stand, 0, NULL,
140  ai_stand, 0, NULL,
141  ai_stand, 0, NULL,
142  ai_stand, 0, NULL,
143  ai_stand, 0, NULL,
144  ai_stand, 0, NULL,
145  ai_stand, 0, NULL,
146  ai_stand, 0, NULL,
147  ai_stand, 0, NULL
148 };
150 
151 void brain_idle (edict_t *self)
152 {
153  gi.sound (self, CHAN_AUTO, sound_idle3, 1, ATTN_IDLE, 0);
154  self->monsterinfo.currentmove = &brain_move_idle;
155 }
156 
157 
158 //
159 // WALK
160 //
162 {
163  ai_walk, 7, NULL,
164  ai_walk, 2, NULL,
165  ai_walk, 3, NULL,
166  ai_walk, 3, NULL,
167  ai_walk, 1, NULL,
168  ai_walk, 0, NULL,
169  ai_walk, 0, NULL,
170  ai_walk, 9, NULL,
171  ai_walk, -4, NULL,
172  ai_walk, -1, NULL,
173  ai_walk, 2, NULL
174 };
176 
177 // walk2 is FUBAR, do not use
178 #if 0
179 void brain_walk2_cycle (edict_t *self)
180 {
181  if (random() > 0.1)
182  self->monsterinfo.nextframe = FRAME_walk220;
183 }
184 
185 mframe_t brain_frames_walk2 [] =
186 {
187  ai_walk, 3, NULL,
188  ai_walk, -2, NULL,
189  ai_walk, -4, NULL,
190  ai_walk, -3, NULL,
191  ai_walk, 0, NULL,
192  ai_walk, 1, NULL,
193  ai_walk, 12, NULL,
194  ai_walk, 0, NULL,
195  ai_walk, -3, NULL,
196  ai_walk, 0, NULL,
197 
198  ai_walk, -2, NULL,
199  ai_walk, 0, NULL,
200  ai_walk, 0, NULL,
201  ai_walk, 1, NULL,
202  ai_walk, 0, NULL,
203  ai_walk, 0, NULL,
204  ai_walk, 0, NULL,
205  ai_walk, 0, NULL,
206  ai_walk, 0, NULL,
207  ai_walk, 10, NULL, // Cycle Start
208 
209  ai_walk, -1, NULL,
210  ai_walk, 7, NULL,
211  ai_walk, 0, NULL,
212  ai_walk, 3, NULL,
213  ai_walk, -3, NULL,
214  ai_walk, 2, NULL,
215  ai_walk, 4, NULL,
216  ai_walk, -3, NULL,
217  ai_walk, 2, NULL,
218  ai_walk, 0, NULL,
219 
220  ai_walk, 4, brain_walk2_cycle,
221  ai_walk, -1, NULL,
222  ai_walk, -1, NULL,
223  ai_walk, -8, NULL,
224  ai_walk, 0, NULL,
225  ai_walk, 1, NULL,
226  ai_walk, 5, NULL,
227  ai_walk, 2, NULL,
228  ai_walk, -1, NULL,
229  ai_walk, -5, NULL
230 };
231 mmove_t brain_move_walk2 = {FRAME_walk201, FRAME_walk240, brain_frames_walk2, NULL};
232 #endif
233 
234 void brain_walk (edict_t *self)
235 {
236 // if (random() <= 0.5)
237  self->monsterinfo.currentmove = &brain_move_walk1;
238 // else
239 // self->monsterinfo.currentmove = &brain_move_walk2;
240 }
241 
242 
243 
245 {
246  ai_move, 0, NULL,
247  ai_move, 0, NULL,
248  ai_move, 0, NULL,
249  ai_move, 0, NULL,
250  ai_move, 0, NULL,
251  ai_move, 0, NULL,
252  ai_move, 0, NULL,
253  ai_move, 0, NULL,
254  ai_move, 0, NULL
255 };
257 
259 {
260  ai_move, -2, NULL,
261  ai_move, 2, NULL,
262  ai_move, 1, NULL,
263  ai_move, 3, NULL,
264  ai_move, 0, NULL,
265  ai_move, -4, NULL
266 };
268 
270 {
271  ai_move, -2, NULL,
272  ai_move, 0, NULL,
273  ai_move, 0, NULL,
274  ai_move, 0, NULL,
275  ai_move, 0, NULL,
276  ai_move, 3, NULL,
277  ai_move, 1, NULL,
278  ai_move, -2, NULL
279 };
281 
283 {
284  ai_move, -6, NULL,
285  ai_move, -2, NULL,
286  ai_move, -6, NULL,
287  ai_move, 0, NULL,
288  ai_move, 0, NULL,
289  ai_move, 0, NULL,
290  ai_move, 0, NULL,
291  ai_move, 0, NULL,
292  ai_move, 0, NULL,
293  ai_move, 0, NULL,
294  ai_move, 0, NULL,
295  ai_move, 0, NULL,
296  ai_move, 0, NULL,
297  ai_move, 2, NULL,
298  ai_move, 0, NULL,
299  ai_move, 2, NULL,
300  ai_move, 1, NULL,
301  ai_move, 7, NULL,
302  ai_move, 0, NULL,
303  ai_move, 3, NULL,
304  ai_move, -1, NULL
305 };
307 
308 
309 //
310 // DUCK
311 //
312 
314 {
315  if (self->monsterinfo.aiflags & AI_DUCKED)
316  return;
317  self->monsterinfo.aiflags |= AI_DUCKED;
318  self->maxs[2] -= 32;
319  self->takedamage = DAMAGE_YES;
320  gi.linkentity (self);
321 }
322 
324 {
325  if (level.time >= self->monsterinfo.pausetime)
326  self->monsterinfo.aiflags &= ~AI_HOLD_FRAME;
327  else
328  self->monsterinfo.aiflags |= AI_HOLD_FRAME;
329 }
330 
331 void brain_duck_up (edict_t *self)
332 {
333  self->monsterinfo.aiflags &= ~AI_DUCKED;
334  self->maxs[2] += 32;
335  self->takedamage = DAMAGE_AIM;
336  gi.linkentity (self);
337 }
338 
340 {
341  ai_move, 0, NULL,
344  ai_move, -3, NULL,
345  ai_move, -1, brain_duck_up,
346  ai_move, -5, NULL,
347  ai_move, -6, NULL,
348  ai_move, -6, NULL
349 };
351 
352 void brain_dodge (edict_t *self, edict_t *attacker, float eta)
353 {
354  if (random() > 0.25)
355  return;
356 
357  if (!self->enemy)
358  self->enemy = attacker;
359 
360  self->monsterinfo.pausetime = level.time + eta + 0.5;
361  self->monsterinfo.currentmove = &brain_move_duck;
362 }
363 
364 
366 {
367  ai_move, 0, NULL,
368  ai_move, 0, NULL,
369  ai_move, 0, NULL,
370  ai_move, 9, NULL,
371  ai_move, 0, NULL
372 };
374 
376 {
377  ai_move, 0, NULL,
378  ai_move, 0, NULL,
379  ai_move, -2, NULL,
380  ai_move, 9, NULL,
381  ai_move, 0, NULL,
382  ai_move, 0, NULL,
383  ai_move, 0, NULL,
384  ai_move, 0, NULL,
385  ai_move, 0, NULL,
386  ai_move, 0, NULL,
387  ai_move, 0, NULL,
388  ai_move, 0, NULL,
389  ai_move, 0, NULL,
390  ai_move, 0, NULL,
391  ai_move, 0, NULL,
392  ai_move, 0, NULL,
393  ai_move, 0, NULL,
394  ai_move, 0, NULL
395 };
397 
398 
399 //
400 // MELEE
401 //
402 
404 {
405  gi.sound (self, CHAN_BODY, sound_melee1, 1, ATTN_NORM, 0);
406 }
407 
409 {
410  vec3_t aim;
411 
412  VectorSet (aim, MELEE_DISTANCE, self->maxs[0], 8);
413  if (fire_hit (self, aim, (15 + (rand() %5)), 40))
414  gi.sound (self, CHAN_WEAPON, sound_melee3, 1, ATTN_NORM, 0);
415 }
416 
418 {
419  gi.sound (self, CHAN_BODY, sound_melee2, 1, ATTN_NORM, 0);
420 }
421 
423 {
424  vec3_t aim;
425 
426  VectorSet (aim, MELEE_DISTANCE, self->mins[0], 8);
427  if (fire_hit (self, aim, (15 + (rand() %5)), 40))
428  gi.sound (self, CHAN_WEAPON, sound_melee3, 1, ATTN_NORM, 0);
429 }
430 
432 {
433  ai_charge, 8, NULL,
434  ai_charge, 3, NULL,
435  ai_charge, 5, NULL,
436  ai_charge, 0, NULL,
438  ai_charge, 0, NULL,
439  ai_charge, -5, NULL,
441  ai_charge, 0, NULL,
443  ai_charge, 1, NULL,
445  ai_charge, -3, NULL,
446  ai_charge, 6, NULL,
447  ai_charge, -1, NULL,
448  ai_charge, -3, NULL,
449  ai_charge, 2, NULL,
450  ai_charge, -11,NULL
451 };
453 
455 {
456  self->spawnflags &= ~65536;
457  self->monsterinfo.power_armor_type = POWER_ARMOR_NONE;
458  gi.sound (self, CHAN_BODY, sound_chest_open, 1, ATTN_NORM, 0);
459 }
460 
462 {
463  vec3_t aim;
464 
465  VectorSet (aim, MELEE_DISTANCE, 0, 8);
466  if (fire_hit (self, aim, (10 + (rand() %5)), -600) && skill->value > 0)
467  self->spawnflags |= 65536;
469 }
470 
472 {
473  self->monsterinfo.power_armor_type = POWER_ARMOR_SCREEN;
474  if (self->spawnflags & 65536)
475  {
476  self->spawnflags &= ~65536;
477  self->monsterinfo.currentmove = &brain_move_attack1;
478  }
479 }
480 
482 {
483  ai_charge, 5, NULL,
484  ai_charge, -4, NULL,
485  ai_charge, -4, NULL,
486  ai_charge, -3, NULL,
488  ai_charge, 0, NULL,
490  ai_charge, 0, NULL,
491  ai_charge, 2, NULL,
492  ai_charge, 0, NULL,
494  ai_charge, 0, NULL,
495  ai_charge, 4, NULL,
496  ai_charge, 3, NULL,
497  ai_charge, 2, NULL,
498  ai_charge, -3, NULL,
499  ai_charge, -6, NULL
500 };
502 
503 void brain_melee(edict_t *self)
504 {
505  if (random() <= 0.5)
506  self->monsterinfo.currentmove = &brain_move_attack1;
507  else
508  self->monsterinfo.currentmove = &brain_move_attack2;
509 }
510 
511 
512 //
513 // RUN
514 //
515 
517 {
518  ai_run, 9, NULL,
519  ai_run, 2, NULL,
520  ai_run, 3, NULL,
521  ai_run, 3, NULL,
522  ai_run, 1, NULL,
523  ai_run, 0, NULL,
524  ai_run, 0, NULL,
525  ai_run, 10, NULL,
526  ai_run, -4, NULL,
527  ai_run, -1, NULL,
528  ai_run, 2, NULL
529 };
531 
532 void brain_run (edict_t *self)
533 {
534  self->monsterinfo.power_armor_type = POWER_ARMOR_SCREEN;
535  if (self->monsterinfo.aiflags & AI_STAND_GROUND)
536  self->monsterinfo.currentmove = &brain_move_stand;
537  else
538  self->monsterinfo.currentmove = &brain_move_run;
539 }
540 
541 
542 void brain_pain (edict_t *self, edict_t *other, float kick, int damage)
543 {
544  float r;
545 
546  if (self->health < (self->max_health / 2))
547  self->s.skinnum = 1;
548 
549  if (level.time < self->pain_debounce_time)
550  return;
551 
552  self->pain_debounce_time = level.time + 3;
553  if (skill->value == 3)
554  return; // no pain anims in nightmare
555 
556  r = random();
557  if (r < 0.33)
558  {
559  gi.sound (self, CHAN_VOICE, sound_pain1, 1, ATTN_NORM, 0);
560  self->monsterinfo.currentmove = &brain_move_pain1;
561  }
562  else if (r < 0.66)
563  {
564  gi.sound (self, CHAN_VOICE, sound_pain2, 1, ATTN_NORM, 0);
565  self->monsterinfo.currentmove = &brain_move_pain2;
566  }
567  else
568  {
569  gi.sound (self, CHAN_VOICE, sound_pain1, 1, ATTN_NORM, 0);
570  self->monsterinfo.currentmove = &brain_move_pain3;
571  }
572 }
573 
574 void brain_dead (edict_t *self)
575 {
576  VectorSet (self->mins, -16, -16, -24);
577  VectorSet (self->maxs, 16, 16, -8);
578  self->movetype = MOVETYPE_TOSS;
579  self->svflags |= SVF_DEADMONSTER;
580  self->nextthink = 0;
581  gi.linkentity (self);
582 }
583 
584 
585 
586 void brain_die (edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point)
587 {
588  int n;
589 
590  self->s.effects = 0;
591  self->monsterinfo.power_armor_type = POWER_ARMOR_NONE;
592 
593 // check for gib
594  if (self->health <= self->gib_health)
595  {
596  gi.sound (self, CHAN_VOICE, gi.soundindex ("misc/udeath.wav"), 1, ATTN_NORM, 0);
597  for (n= 0; n < 2; n++)
598  ThrowGib (self, "models/objects/gibs/bone/tris.md2", damage, GIB_ORGANIC);
599  for (n= 0; n < 4; n++)
600  ThrowGib (self, "models/objects/gibs/sm_meat/tris.md2", damage, GIB_ORGANIC);
601  ThrowHead (self, "models/objects/gibs/head2/tris.md2", damage, GIB_ORGANIC);
602  self->deadflag = DEAD_DEAD;
603  return;
604  }
605 
606  if (self->deadflag == DEAD_DEAD)
607  return;
608 
609 // regular death
610  gi.sound (self, CHAN_VOICE, sound_death, 1, ATTN_NORM, 0);
611  self->deadflag = DEAD_DEAD;
612  self->takedamage = DAMAGE_YES;
613  if (random() <= 0.5)
614  self->monsterinfo.currentmove = &brain_move_death1;
615  else
616  self->monsterinfo.currentmove = &brain_move_death2;
617 }
618 
619 /*QUAKED monster_brain (1 .5 0) (-16 -16 -24) (16 16 32) Ambush Trigger_Spawn Sight
620 */
622 {
623  if (deathmatch->value)
624  {
625  G_FreeEdict (self);
626  return;
627  }
628 
629  sound_chest_open = gi.soundindex ("brain/brnatck1.wav");
630  sound_tentacles_extend = gi.soundindex ("brain/brnatck2.wav");
631  sound_tentacles_retract = gi.soundindex ("brain/brnatck3.wav");
632  sound_death = gi.soundindex ("brain/brndeth1.wav");
633  sound_idle1 = gi.soundindex ("brain/brnidle1.wav");
634  sound_idle2 = gi.soundindex ("brain/brnidle2.wav");
635  sound_idle3 = gi.soundindex ("brain/brnlens1.wav");
636  sound_pain1 = gi.soundindex ("brain/brnpain1.wav");
637  sound_pain2 = gi.soundindex ("brain/brnpain2.wav");
638  sound_sight = gi.soundindex ("brain/brnsght1.wav");
639  sound_search = gi.soundindex ("brain/brnsrch1.wav");
640  sound_melee1 = gi.soundindex ("brain/melee1.wav");
641  sound_melee2 = gi.soundindex ("brain/melee2.wav");
642  sound_melee3 = gi.soundindex ("brain/melee3.wav");
643 
644  self->movetype = MOVETYPE_STEP;
645  self->solid = SOLID_BBOX;
646  self->s.modelindex = gi.modelindex ("models/monsters/brain/tris.md2");
647  VectorSet (self->mins, -16, -16, -24);
648  VectorSet (self->maxs, 16, 16, 32);
649 
650  self->health = 300;
651  self->gib_health = -150;
652  self->mass = 400;
653 
654  self->pain = brain_pain;
655  self->die = brain_die;
656 
657  self->monsterinfo.stand = brain_stand;
658  self->monsterinfo.walk = brain_walk;
659  self->monsterinfo.run = brain_run;
660  self->monsterinfo.dodge = brain_dodge;
661 // self->monsterinfo.attack = brain_attack;
662  self->monsterinfo.melee = brain_melee;
663  self->monsterinfo.sight = brain_sight;
664  self->monsterinfo.search = brain_search;
665  self->monsterinfo.idle = brain_idle;
666 
667  self->monsterinfo.power_armor_type = POWER_ARMOR_SCREEN;
668  self->monsterinfo.power_armor_power = 100;
669 
670  gi.linkentity (self);
671 
672  self->monsterinfo.currentmove = &brain_move_stand;
673  self->monsterinfo.scale = MODEL_SCALE;
674 
675  walkmonster_start (self);
676 }
gi
game_import_t gi
Definition: g_main.c:25
FRAME_death201
#define FRAME_death201
Definition: m_actor.h:35
deathmatch
cvar_t * deathmatch
Definition: g_main.c:35
FRAME_duck01
#define FRAME_duck01
Definition: m_brain.h:170
DEAD_DEAD
#define DEAD_DEAD
Definition: g_local.h:115
sound_melee2
static int sound_melee2
Definition: m_brain.c:44
sound_melee1
static int sound_melee1
Definition: m_brain.c:43
FRAME_pain301
#define FRAME_pain301
Definition: m_actor.h:104
brain_move_attack2
mmove_t brain_move_attack2
Definition: m_brain.c:501
ThrowGib
void ThrowGib(edict_t *self, char *gibname, int damage, int type)
Definition: g_misc.c:135
MELEE_DISTANCE
#define MELEE_DISTANCE
Definition: g_local.h:82
brain_move_attack1
mmove_t brain_move_attack1
Definition: m_brain.c:452
brain_tentacle_attack
void brain_tentacle_attack(edict_t *self)
Definition: m_brain.c:461
ai_charge
void ai_charge(edict_t *self, float dist)
Definition: g_ai.c:194
FRAME_death205
#define FRAME_death205
Definition: m_actor.h:39
SOLID_BBOX
@ SOLID_BBOX
Definition: game.h:37
brain_frames_pain3
mframe_t brain_frames_pain3[]
Definition: m_brain.c:258
brain_frames_attack1
mframe_t brain_frames_attack1[]
Definition: m_brain.c:431
FRAME_stand01
#define FRAME_stand01
Definition: m_boss31.h:136
brain_duck_up
void brain_duck_up(edict_t *self)
Definition: m_brain.c:331
brain_frames_run
mframe_t brain_frames_run[]
Definition: m_brain.c:516
FRAME_walk240
#define FRAME_walk240
Definition: m_brain.h:76
FRAME_attak118
#define FRAME_attak118
Definition: m_boss31.h:41
FRAME_death101
#define FRAME_death101
Definition: m_actor.h:28
AI_STAND_GROUND
#define AI_STAND_GROUND
Definition: g_local.h:129
MODEL_SCALE
#define MODEL_SCALE
Definition: m_actor.h:506
DAMAGE_YES
@ DAMAGE_YES
Definition: g_local.h:89
game_import_t::sound
void(* sound)(edict_t *ent, int channel, int soundindex, float volume, float attenuation, float timeofs)
Definition: game.h:109
brain_die
void brain_die(edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point)
Definition: m_brain.c:586
ATTN_IDLE
#define ATTN_IDLE
Definition: q_shared.h:996
brain_chest_open
void brain_chest_open(edict_t *self)
Definition: m_brain.c:454
SP_monster_brain
void SP_monster_brain(edict_t *self)
Definition: m_brain.c:621
fire_hit
qboolean fire_hit(edict_t *self, vec3_t aim, int damage, int kick)
Definition: g_weapon.c:63
FRAME_defens01
#define FRAME_defens01
Definition: m_brain.h:178
brain_move_run
mmove_t brain_move_run
Definition: m_brain.c:530
sound_chest_open
static int sound_chest_open
Definition: m_brain.c:32
ATTN_NORM
#define ATTN_NORM
Definition: q_shared.h:995
FRAME_pain101
#define FRAME_pain101
Definition: m_actor.h:98
brain_frames_duck
mframe_t brain_frames_duck[]
Definition: m_brain.c:339
walkmonster_start
void walkmonster_start(edict_t *self)
Definition: g_monster.c:692
MOVETYPE_STEP
@ MOVETYPE_STEP
Definition: g_local.h:196
brain_swing_right
void brain_swing_right(edict_t *self)
Definition: m_brain.c:403
FRAME_walk111
#define FRAME_walk111
Definition: m_brain.h:34
brain_swing_left
void brain_swing_left(edict_t *self)
Definition: m_brain.c:417
brain_sight
void brain_sight(edict_t *self, edict_t *other)
Definition: m_brain.c:48
brain_walk
void brain_walk(edict_t *self)
Definition: m_brain.c:234
FRAME_defens08
#define FRAME_defens08
Definition: m_brain.h:185
FRAME_attak201
#define FRAME_attak201
Definition: m_boss31.h:42
SVF_DEADMONSTER
#define SVF_DEADMONSTER
Definition: game.h:28
CHAN_AUTO
#define CHAN_AUTO
Definition: q_shared.h:983
POWER_ARMOR_SCREEN
#define POWER_ARMOR_SCREEN
Definition: g_local.h:160
brain_stand
void brain_stand(edict_t *self)
Definition: m_brain.c:104
brain_hit_left
void brain_hit_left(edict_t *self)
Definition: m_brain.c:422
FRAME_walk220
#define FRAME_walk220
Definition: m_brain.h:56
CHAN_VOICE
#define CHAN_VOICE
Definition: q_shared.h:985
sound_sight
static int sound_sight
Definition: m_brain.c:41
edict_s
Definition: g_local.h:968
G_FreeEdict
void G_FreeEdict(edict_t *e)
Definition: g_utils.c:452
monsterinfo_t::pausetime
float pausetime
Definition: g_local.h:436
r
GLdouble GLdouble r
Definition: qgl_win.c:336
sound_search
static int sound_search
Definition: m_brain.c:42
FRAME_stand30
#define FRAME_stand30
Definition: m_boss2.h:24
game_import_t::soundindex
int(* soundindex)(char *name)
Definition: game.h:122
brain_idle
void brain_idle(edict_t *self)
Definition: m_brain.c:151
AI_HOLD_FRAME
#define AI_HOLD_FRAME
Definition: g_local.h:136
FRAME_pain121
#define FRAME_pain121
Definition: m_brain.h:132
game_import_t::modelindex
int(* modelindex)(char *name)
Definition: game.h:121
brain_frames_death1
mframe_t brain_frames_death1[]
Definition: m_brain.c:375
brain_move_death2
mmove_t brain_move_death2
Definition: m_brain.c:373
FRAME_walk201
#define FRAME_walk201
Definition: m_boss32.h:498
mframe_t
Definition: g_local.h:403
mmove_t
Definition: g_local.h:410
brain_frames_pain2
mframe_t brain_frames_pain2[]
Definition: m_brain.c:269
FRAME_stand31
#define FRAME_stand31
Definition: m_boss2.h:25
cvar_s::value
float value
Definition: q_shared.h:331
FRAME_stand60
#define FRAME_stand60
Definition: m_brain.h:245
ai_walk
void ai_walk(edict_t *self, float dist)
Definition: g_ai.c:163
random
#define random()
Definition: g_local.h:515
brain_duck_hold
void brain_duck_hold(edict_t *self)
Definition: m_brain.c:323
NULL
#define NULL
Definition: q_shared.h:67
brain_move_defense
mmove_t brain_move_defense
Definition: m_brain.c:256
sound_pain2
static int sound_pain2
Definition: m_brain.c:40
brain_move_duck
mmove_t brain_move_duck
Definition: m_brain.c:350
brain_pain
void brain_pain(edict_t *self, edict_t *other, float kick, int damage)
Definition: m_brain.c:542
skill
cvar_t * skill
Definition: g_main.c:38
brain_frames_walk1
mframe_t brain_frames_walk1[]
Definition: m_brain.c:161
sound_tentacles_retract
static int sound_tentacles_retract
Definition: m_brain.c:34
ai_move
void ai_move(edict_t *self, float dist)
Definition: g_ai.c:92
m_brain.h
FRAME_duck08
#define FRAME_duck08
Definition: m_brain.h:177
brain_frames_death2
mframe_t brain_frames_death2[]
Definition: m_brain.c:365
FRAME_pain306
#define FRAME_pain306
Definition: m_boss31.h:116
sound_melee3
static int sound_melee3
Definition: m_brain.c:45
brain_melee
void brain_melee(edict_t *self)
Definition: m_brain.c:503
edict_s::monsterinfo
monsterinfo_t monsterinfo
Definition: g_local.h:1114
brain_frames_pain1
mframe_t brain_frames_pain1[]
Definition: m_brain.c:282
DAMAGE_AIM
@ DAMAGE_AIM
Definition: g_local.h:90
CHAN_WEAPON
#define CHAN_WEAPON
Definition: q_shared.h:984
level
GLint level
Definition: qgl_win.c:116
ai_run
void ai_run(edict_t *self, float dist)
Definition: g_ai.c:914
GIB_ORGANIC
#define GIB_ORGANIC
Definition: g_local.h:125
FRAME_pain208
#define FRAME_pain208
Definition: m_brain.h:140
brain_frames_idle
mframe_t brain_frames_idle[]
Definition: m_brain.c:114
brain_hit_right
void brain_hit_right(edict_t *self)
Definition: m_brain.c:408
sound_tentacles_extend
static int sound_tentacles_extend
Definition: m_brain.c:33
ThrowHead
void ThrowHead(edict_t *self, char *gibname, int damage, int type)
Definition: g_misc.c:183
FRAME_pain201
#define FRAME_pain201
Definition: m_actor.h:101
sound_idle3
static int sound_idle3
Definition: m_brain.c:38
brain_chest_closed
void brain_chest_closed(edict_t *self)
Definition: m_brain.c:471
sound_death
static int sound_death
Definition: m_brain.c:35
MOVETYPE_TOSS
@ MOVETYPE_TOSS
Definition: g_local.h:198
FRAME_attak217
#define FRAME_attak217
Definition: m_brain.h:111
VectorSet
#define VectorSet(v, x, y, z)
Definition: q_shared.h:168
FRAME_death118
#define FRAME_death118
Definition: m_brain.h:164
CHAN_BODY
#define CHAN_BODY
Definition: q_shared.h:987
brain_move_death1
mmove_t brain_move_death1
Definition: m_brain.c:396
brain_frames_stand
mframe_t brain_frames_stand[]
Definition: m_brain.c:67
brain_run
void brain_run(edict_t *self)
Definition: m_brain.c:532
sound_idle2
static int sound_idle2
Definition: m_brain.c:37
AI_DUCKED
#define AI_DUCKED
Definition: g_local.h:140
game_import_t::linkentity
void(* linkentity)(edict_t *ent)
Definition: game.h:138
brain_move_pain1
mmove_t brain_move_pain1
Definition: m_brain.c:306
brain_dead
void brain_dead(edict_t *self)
Definition: m_brain.c:574
sound_idle1
static int sound_idle1
Definition: m_brain.c:36
brain_move_stand
mmove_t brain_move_stand
Definition: m_brain.c:102
brain_move_pain3
mmove_t brain_move_pain3
Definition: m_brain.c:267
brain_move_walk1
mmove_t brain_move_walk1
Definition: m_brain.c:175
FRAME_walk101
#define FRAME_walk101
Definition: m_brain.h:24
vec3_t
vec_t vec3_t[3]
Definition: q_shared.h:134
brain_dodge
void brain_dodge(edict_t *self, edict_t *attacker, float eta)
Definition: m_brain.c:352
brain_search
void brain_search(edict_t *self)
Definition: m_brain.c:53
brain_duck_down
void brain_duck_down(edict_t *self)
Definition: m_brain.c:313
POWER_ARMOR_NONE
#define POWER_ARMOR_NONE
Definition: g_local.h:159
ai_stand
void ai_stand(edict_t *self, float dist)
Definition: g_ai.c:106
brain_move_pain2
mmove_t brain_move_pain2
Definition: m_brain.c:280
sound_pain1
static int sound_pain1
Definition: m_brain.c:39
brain_frames_attack2
mframe_t brain_frames_attack2[]
Definition: m_brain.c:481
FRAME_attak101
#define FRAME_attak101
Definition: m_boss31.h:24
g_local.h
brain_frames_defense
mframe_t brain_frames_defense[]
Definition: m_brain.c:244
brain_move_idle
mmove_t brain_move_idle
Definition: m_brain.c:149