icculus quake2 doxygen  1.0 dev
g_monster.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 #include "g_local.h"
21 
22 
23 //
24 // monster weapons
25 //
26 
27 //FIXME mosnters should call these with a totally accurate direction
28 // and we can mess it up based on skill. Spread should be for normal
29 // and we can tighten or loosen based on skill. We could muck with
30 // the damages too, but I'm not sure that's such a good idea.
31 void monster_fire_bullet (edict_t *self, vec3_t start, vec3_t dir, int damage, int kick, int hspread, int vspread, int flashtype)
32 {
33  fire_bullet (self, start, dir, damage, kick, hspread, vspread, MOD_UNKNOWN);
34 
36  gi.WriteShort (self - g_edicts);
37  gi.WriteByte (flashtype);
38  gi.multicast (start, MULTICAST_PVS);
39 }
40 
41 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)
42 {
43  fire_shotgun (self, start, aimdir, damage, kick, hspread, vspread, count, MOD_UNKNOWN);
44 
46  gi.WriteShort (self - g_edicts);
47  gi.WriteByte (flashtype);
48  gi.multicast (start, MULTICAST_PVS);
49 }
50 
51 void monster_fire_blaster (edict_t *self, vec3_t start, vec3_t dir, int damage, int speed, int flashtype, int effect)
52 {
53  fire_blaster (self, start, dir, damage, speed, effect, false);
54 
56  gi.WriteShort (self - g_edicts);
57  gi.WriteByte (flashtype);
58  gi.multicast (start, MULTICAST_PVS);
59 }
60 
61 void monster_fire_grenade (edict_t *self, vec3_t start, vec3_t aimdir, int damage, int speed, int flashtype)
62 {
63  fire_grenade (self, start, aimdir, damage, speed, 2.5, damage+40);
64 
66  gi.WriteShort (self - g_edicts);
67  gi.WriteByte (flashtype);
68  gi.multicast (start, MULTICAST_PVS);
69 }
70 
71 void monster_fire_rocket (edict_t *self, vec3_t start, vec3_t dir, int damage, int speed, int flashtype)
72 {
73  fire_rocket (self, start, dir, damage, speed, damage+20, damage);
74 
76  gi.WriteShort (self - g_edicts);
77  gi.WriteByte (flashtype);
78  gi.multicast (start, MULTICAST_PVS);
79 }
80 
81 void monster_fire_railgun (edict_t *self, vec3_t start, vec3_t aimdir, int damage, int kick, int flashtype)
82 {
83  fire_rail (self, start, aimdir, damage, kick);
84 
86  gi.WriteShort (self - g_edicts);
87  gi.WriteByte (flashtype);
88  gi.multicast (start, MULTICAST_PVS);
89 }
90 
91 void monster_fire_bfg (edict_t *self, vec3_t start, vec3_t aimdir, int damage, int speed, int kick, float damage_radius, int flashtype)
92 {
93  fire_bfg (self, start, aimdir, damage, speed, damage_radius);
94 
96  gi.WriteShort (self - g_edicts);
97  gi.WriteByte (flashtype);
98  gi.multicast (start, MULTICAST_PVS);
99 }
100 
101 
102 
103 //
104 // Monster utility functions
105 //
106 
107 static void M_FliesOff (edict_t *self)
108 {
109  self->s.effects &= ~EF_FLIES;
110  self->s.sound = 0;
111 }
112 
113 static void M_FliesOn (edict_t *self)
114 {
115  if (self->waterlevel)
116  return;
117  self->s.effects |= EF_FLIES;
118  self->s.sound = gi.soundindex ("infantry/inflies1.wav");
119  self->think = M_FliesOff;
120  self->nextthink = level.time + 60;
121 }
122 
123 void M_FlyCheck (edict_t *self)
124 {
125  if (self->waterlevel)
126  return;
127 
128  if (random() > 0.5)
129  return;
130 
131  self->think = M_FliesOn;
132  self->nextthink = level.time + 5 + 10 * random();
133 }
134 
135 void AttackFinished (edict_t *self, float time)
136 {
137  self->monsterinfo.attack_finished = level.time + time;
138 }
139 
140 
142 {
143  vec3_t point;
144  trace_t trace;
145 
146  if (ent->flags & (FL_SWIM|FL_FLY))
147  return;
148 
149  if (ent->velocity[2] > 100)
150  {
151  ent->groundentity = NULL;
152  return;
153  }
154 
155 // if the hull point one-quarter unit down is solid the entity is on ground
156  point[0] = ent->s.origin[0];
157  point[1] = ent->s.origin[1];
158  point[2] = ent->s.origin[2] - 0.25;
159 
160  trace = gi.trace (ent->s.origin, ent->mins, ent->maxs, point, ent, MASK_MONSTERSOLID);
161 
162  // check steepness
163  if ( trace.plane.normal[2] < 0.7 && !trace.startsolid)
164  {
165  ent->groundentity = NULL;
166  return;
167  }
168 
169 // ent->groundentity = trace.ent;
170 // ent->groundentity_linkcount = trace.ent->linkcount;
171 // if (!trace.startsolid && !trace.allsolid)
172 // VectorCopy (trace.endpos, ent->s.origin);
173  if (!trace.startsolid && !trace.allsolid)
174  {
175  VectorCopy (trace.endpos, ent->s.origin);
176  ent->groundentity = trace.ent;
177  ent->groundentity_linkcount = trace.ent->linkcount;
178  ent->velocity[2] = 0;
179  }
180 }
181 
182 
184 {
185  vec3_t point;
186  int cont;
187 
188 //
189 // get waterlevel
190 //
191  point[0] = ent->s.origin[0];
192  point[1] = ent->s.origin[1];
193  point[2] = ent->s.origin[2] + ent->mins[2] + 1;
194  cont = gi.pointcontents (point);
195 
196  if (!(cont & MASK_WATER))
197  {
198  ent->waterlevel = 0;
199  ent->watertype = 0;
200  return;
201  }
202 
203  ent->watertype = cont;
204  ent->waterlevel = 1;
205  point[2] += 26;
206  cont = gi.pointcontents (point);
207  if (!(cont & MASK_WATER))
208  return;
209 
210  ent->waterlevel = 2;
211  point[2] += 22;
212  cont = gi.pointcontents (point);
213  if (cont & MASK_WATER)
214  ent->waterlevel = 3;
215 }
216 
217 
219 {
220  int dmg;
221 
222  if (ent->health > 0)
223  {
224  if (!(ent->flags & FL_SWIM))
225  {
226  if (ent->waterlevel < 3)
227  {
228  ent->air_finished = level.time + 12;
229  }
230  else if (ent->air_finished < level.time)
231  { // drown!
232  if (ent->pain_debounce_time < level.time)
233  {
234  dmg = 2 + 2 * floor(level.time - ent->air_finished);
235  if (dmg > 15)
236  dmg = 15;
238  ent->pain_debounce_time = level.time + 1;
239  }
240  }
241  }
242  else
243  {
244  if (ent->waterlevel > 0)
245  {
246  ent->air_finished = level.time + 9;
247  }
248  else if (ent->air_finished < level.time)
249  { // suffocate!
250  if (ent->pain_debounce_time < level.time)
251  {
252  dmg = 2 + 2 * floor(level.time - ent->air_finished);
253  if (dmg > 15)
254  dmg = 15;
256  ent->pain_debounce_time = level.time + 1;
257  }
258  }
259  }
260  }
261 
262  if (ent->waterlevel == 0)
263  {
264  if (ent->flags & FL_INWATER)
265  {
266  gi.sound (ent, CHAN_BODY, gi.soundindex("player/watr_out.wav"), 1, ATTN_NORM, 0);
267  ent->flags &= ~FL_INWATER;
268  }
269  return;
270  }
271 
272  if ((ent->watertype & CONTENTS_LAVA) && !(ent->flags & FL_IMMUNE_LAVA))
273  {
274  if (ent->damage_debounce_time < level.time)
275  {
276  ent->damage_debounce_time = level.time + 0.2;
277  T_Damage (ent, world, world, vec3_origin, ent->s.origin, vec3_origin, 10*ent->waterlevel, 0, 0, MOD_LAVA);
278  }
279  }
280  if ((ent->watertype & CONTENTS_SLIME) && !(ent->flags & FL_IMMUNE_SLIME))
281  {
282  if (ent->damage_debounce_time < level.time)
283  {
284  ent->damage_debounce_time = level.time + 1;
285  T_Damage (ent, world, world, vec3_origin, ent->s.origin, vec3_origin, 4*ent->waterlevel, 0, 0, MOD_SLIME);
286  }
287  }
288 
289  if ( !(ent->flags & FL_INWATER) )
290  {
291  if (!(ent->svflags & SVF_DEADMONSTER))
292  {
293  if (ent->watertype & CONTENTS_LAVA)
294  if (random() <= 0.5)
295  gi.sound (ent, CHAN_BODY, gi.soundindex("player/lava1.wav"), 1, ATTN_NORM, 0);
296  else
297  gi.sound (ent, CHAN_BODY, gi.soundindex("player/lava2.wav"), 1, ATTN_NORM, 0);
298  else if (ent->watertype & CONTENTS_SLIME)
299  gi.sound (ent, CHAN_BODY, gi.soundindex("player/watr_in.wav"), 1, ATTN_NORM, 0);
300  else if (ent->watertype & CONTENTS_WATER)
301  gi.sound (ent, CHAN_BODY, gi.soundindex("player/watr_in.wav"), 1, ATTN_NORM, 0);
302  }
303 
304  ent->flags |= FL_INWATER;
305  ent->damage_debounce_time = 0;
306  }
307 }
308 
309 
311 {
312  vec3_t end;
313  trace_t trace;
314 
315  ent->s.origin[2] += 1;
316  VectorCopy (ent->s.origin, end);
317  end[2] -= 256;
318 
319  trace = gi.trace (ent->s.origin, ent->mins, ent->maxs, end, ent, MASK_MONSTERSOLID);
320 
321  if (trace.fraction == 1 || trace.allsolid)
322  return;
323 
324  VectorCopy (trace.endpos, ent->s.origin);
325 
326  gi.linkentity (ent);
327  M_CheckGround (ent);
328  M_CatagorizePosition (ent);
329 }
330 
331 
333 {
336 
338  {
339  ent->s.effects |= EF_COLOR_SHELL;
340  ent->s.renderfx |= RF_SHELL_RED;
341  }
342 
343  if (ent->health <= 0)
344  return;
345 
346  if (ent->powerarmor_time > level.time)
347  {
349  {
350  ent->s.effects |= EF_POWERSCREEN;
351  }
353  {
354  ent->s.effects |= EF_COLOR_SHELL;
355  ent->s.renderfx |= RF_SHELL_GREEN;
356  }
357  }
358 }
359 
360 
361 void M_MoveFrame (edict_t *self)
362 {
363  mmove_t *move;
364  int index;
365 
366  move = self->monsterinfo.currentmove;
367  self->nextthink = level.time + FRAMETIME;
368 
369  if ((self->monsterinfo.nextframe) && (self->monsterinfo.nextframe >= move->firstframe) && (self->monsterinfo.nextframe <= move->lastframe))
370  {
371  self->s.frame = self->monsterinfo.nextframe;
372  self->monsterinfo.nextframe = 0;
373  }
374  else
375  {
376  if (self->s.frame == move->lastframe)
377  {
378  if (move->endfunc)
379  {
380  move->endfunc (self);
381 
382  // regrab move, endfunc is very likely to change it
383  move = self->monsterinfo.currentmove;
384 
385  // check for death
386  if (self->svflags & SVF_DEADMONSTER)
387  return;
388  }
389  }
390 
391  if (self->s.frame < move->firstframe || self->s.frame > move->lastframe)
392  {
393  self->monsterinfo.aiflags &= ~AI_HOLD_FRAME;
394  self->s.frame = move->firstframe;
395  }
396  else
397  {
398  if (!(self->monsterinfo.aiflags & AI_HOLD_FRAME))
399  {
400  self->s.frame++;
401  if (self->s.frame > move->lastframe)
402  self->s.frame = move->firstframe;
403  }
404  }
405  }
406 
407  index = self->s.frame - move->firstframe;
408  if (move->frame[index].aifunc) {
409  if (!(self->monsterinfo.aiflags & AI_HOLD_FRAME))
410  move->frame[index].aifunc (self, move->frame[index].dist * self->monsterinfo.scale);
411  else
412  move->frame[index].aifunc (self, 0);
413  }
414  if (move->frame[index].thinkfunc)
415  move->frame[index].thinkfunc (self);
416 }
417 
418 
419 void monster_think (edict_t *self)
420 {
421  M_MoveFrame (self);
422  if (self->linkcount != self->monsterinfo.linkcount)
423  {
424  self->monsterinfo.linkcount = self->linkcount;
425  M_CheckGround (self);
426  }
427  M_CatagorizePosition (self);
428  M_WorldEffects (self);
429  M_SetEffects (self);
430 }
431 
432 
433 /*
434 ================
435 monster_use
436 
437 Using a monster makes it angry at the current activator
438 ================
439 */
440 void monster_use (edict_t *self, edict_t *other, edict_t *activator)
441 {
442  if (self->enemy)
443  return;
444  if (self->health <= 0)
445  return;
446  if (activator->flags & FL_NOTARGET)
447  return;
448  if (!(activator->client) && !(activator->monsterinfo.aiflags & AI_GOOD_GUY))
449  return;
450 
451 // delay reaction so if the monster is teleported, its sound is still heard
452  self->enemy = activator;
453  FoundTarget (self);
454 }
455 
456 
457 void monster_start_go (edict_t *self);
458 
459 
461 {
462  self->s.origin[2] += 1;
463  KillBox (self);
464 
465  self->solid = SOLID_BBOX;
466  self->movetype = MOVETYPE_STEP;
467  self->svflags &= ~SVF_NOCLIENT;
468  self->air_finished = level.time + 12;
469  gi.linkentity (self);
470 
471  monster_start_go (self);
472 
473  if (self->enemy && !(self->spawnflags & 1) && !(self->enemy->flags & FL_NOTARGET))
474  {
475  FoundTarget (self);
476  }
477  else
478  {
479  self->enemy = NULL;
480  }
481 }
482 
483 void monster_triggered_spawn_use (edict_t *self, edict_t *other, edict_t *activator)
484 {
485  // we have a one frame delay here so we don't telefrag the guy who activated us
486  self->think = monster_triggered_spawn;
487  self->nextthink = level.time + FRAMETIME;
488  if (activator->client)
489  self->enemy = activator;
490  self->use = monster_use;
491 }
492 
494 {
495  self->solid = SOLID_NOT;
496  self->movetype = MOVETYPE_NONE;
497  self->svflags |= SVF_NOCLIENT;
498  self->nextthink = 0;
499  self->use = monster_triggered_spawn_use;
500 }
501 
502 
503 /*
504 ================
505 monster_death_use
506 
507 When a monster dies, it fires all of its targets with the current
508 enemy as activator.
509 ================
510 */
512 {
513  self->flags &= ~(FL_FLY|FL_SWIM);
514  self->monsterinfo.aiflags &= AI_GOOD_GUY;
515 
516  if (self->item)
517  {
518  Drop_Item (self, self->item);
519  self->item = NULL;
520  }
521 
522  if (self->deathtarget)
523  self->target = self->deathtarget;
524 
525  if (!self->target)
526  return;
527 
528  G_UseTargets (self, self->enemy);
529 }
530 
531 
532 //============================================================================
533 
535 {
536  if (deathmatch->value)
537  {
538  G_FreeEdict (self);
539  return false;
540  }
541 
542  if ((self->spawnflags & 4) && !(self->monsterinfo.aiflags & AI_GOOD_GUY))
543  {
544  self->spawnflags &= ~4;
545  self->spawnflags |= 1;
546 // gi.dprintf("fixed spawnflags on %s at %s\n", self->classname, vtos(self->s.origin));
547  }
548 
549  if (!(self->monsterinfo.aiflags & AI_GOOD_GUY))
550  level.total_monsters++;
551 
552  self->nextthink = level.time + FRAMETIME;
553  self->svflags |= SVF_MONSTER;
554  self->s.renderfx |= RF_FRAMELERP;
555  self->takedamage = DAMAGE_AIM;
556  self->air_finished = level.time + 12;
557  self->use = monster_use;
558  self->max_health = self->health;
559  self->clipmask = MASK_MONSTERSOLID;
560 
561  self->s.skinnum = 0;
562  self->deadflag = DEAD_NO;
563  self->svflags &= ~SVF_DEADMONSTER;
564 
565  if (!self->monsterinfo.checkattack)
566  self->monsterinfo.checkattack = M_CheckAttack;
567  VectorCopy (self->s.origin, self->s.old_origin);
568 
569  if (st.item)
570  {
571  self->item = FindItemByClassname (st.item);
572  if (!self->item)
573  gi.dprintf("%s at %s has bad item: %s\n", self->classname, vtos(self->s.origin), st.item);
574  }
575 
576  // randomize what frame they start on
577  if (self->monsterinfo.currentmove)
578  self->s.frame = self->monsterinfo.currentmove->firstframe + (rand() % (self->monsterinfo.currentmove->lastframe - self->monsterinfo.currentmove->firstframe + 1));
579 
580  return true;
581 }
582 
584 {
585  vec3_t v;
586 
587  if (self->health <= 0)
588  return;
589 
590  // check for target to combat_point and change to combattarget
591  if (self->target)
592  {
593  qboolean notcombat;
594  qboolean fixup;
595  edict_t *target;
596 
597  target = NULL;
598  notcombat = false;
599  fixup = false;
600  while ((target = G_Find (target, FOFS(targetname), self->target)) != NULL)
601  {
602  if (strcmp(target->classname, "point_combat") == 0)
603  {
604  self->combattarget = self->target;
605  fixup = true;
606  }
607  else
608  {
609  notcombat = true;
610  }
611  }
612  if (notcombat && self->combattarget)
613  gi.dprintf("%s at %s has target with mixed types\n", self->classname, vtos(self->s.origin));
614  if (fixup)
615  self->target = NULL;
616  }
617 
618  // validate combattarget
619  if (self->combattarget)
620  {
621  edict_t *target;
622 
623  target = NULL;
624  while ((target = G_Find (target, FOFS(targetname), self->combattarget)) != NULL)
625  {
626  if (strcmp(target->classname, "point_combat") != 0)
627  {
628  gi.dprintf("%s at (%i %i %i) has a bad combattarget %s : %s at (%i %i %i)\n",
629  self->classname, (int)self->s.origin[0], (int)self->s.origin[1], (int)self->s.origin[2],
630  self->combattarget, target->classname, (int)target->s.origin[0], (int)target->s.origin[1],
631  (int)target->s.origin[2]);
632  }
633  }
634  }
635 
636  if (self->target)
637  {
638  self->goalentity = self->movetarget = G_PickTarget(self->target);
639  if (!self->movetarget)
640  {
641  gi.dprintf ("%s can't find target %s at %s\n", self->classname, self->target, vtos(self->s.origin));
642  self->target = NULL;
643  self->monsterinfo.pausetime = 100000000;
644  self->monsterinfo.stand (self);
645  }
646  else if (strcmp (self->movetarget->classname, "path_corner") == 0)
647  {
648  VectorSubtract (self->goalentity->s.origin, self->s.origin, v);
649  self->ideal_yaw = self->s.angles[YAW] = vectoyaw(v);
650  self->monsterinfo.walk (self);
651  self->target = NULL;
652  }
653  else
654  {
655  self->goalentity = self->movetarget = NULL;
656  self->monsterinfo.pausetime = 100000000;
657  self->monsterinfo.stand (self);
658  }
659  }
660  else
661  {
662  self->monsterinfo.pausetime = 100000000;
663  self->monsterinfo.stand (self);
664  }
665 
666  self->think = monster_think;
667  self->nextthink = level.time + FRAMETIME;
668 }
669 
670 
672 {
673  if (!(self->spawnflags & 2) && level.time < 1)
674  {
675  M_droptofloor (self);
676 
677  if (self->groundentity)
678  if (!M_walkmove (self, 0, 0))
679  gi.dprintf ("%s in solid at %s\n", self->classname, vtos(self->s.origin));
680  }
681 
682  if (!self->yaw_speed)
683  self->yaw_speed = 20;
684  self->viewheight = 25;
685 
686  monster_start_go (self);
687 
688  if (self->spawnflags & 2)
690 }
691 
693 {
694  self->think = walkmonster_start_go;
695  monster_start (self);
696 }
697 
698 
700 {
701  if (!M_walkmove (self, 0, 0))
702  gi.dprintf ("%s in solid at %s\n", self->classname, vtos(self->s.origin));
703 
704  if (!self->yaw_speed)
705  self->yaw_speed = 10;
706  self->viewheight = 25;
707 
708  monster_start_go (self);
709 
710  if (self->spawnflags & 2)
712 }
713 
714 
716 {
717  self->flags |= FL_FLY;
718  self->think = flymonster_start_go;
719  monster_start (self);
720 }
721 
722 
724 {
725  if (!self->yaw_speed)
726  self->yaw_speed = 10;
727  self->viewheight = 10;
728 
729  monster_start_go (self);
730 
731  if (self->spawnflags & 2)
733 }
734 
736 {
737  self->flags |= FL_SWIM;
738  self->think = swimmonster_start_go;
739  monster_start (self);
740 }
gi
game_import_t gi
Definition: g_main.c:25
AI_RESURRECTING
#define AI_RESURRECTING
Definition: g_local.h:141
game_import_t::dprintf
void(* dprintf)(char *fmt,...)
Definition: game.h:106
cplane_s::normal
vec3_t normal
Definition: q_shared.h:411
edict_s::s
entity_state_t s
Definition: g_local.h:964
AttackFinished
void AttackFinished(edict_t *self, float time)
Definition: g_monster.c:135
edict_s::groundentity
edict_t * groundentity
Definition: g_local.h:1073
deathmatch
cvar_t * deathmatch
Definition: g_main.c:35
monster_fire_rocket
void monster_fire_rocket(edict_t *self, vec3_t start, vec3_t dir, int damage, int speed, int flashtype)
Definition: g_monster.c:71
RF_SHELL_RED
#define RF_SHELL_RED
Definition: q_shared.h:623
YAW
#define YAW
Definition: q_shared.h:66
MASK_MONSTERSOLID
#define MASK_MONSTERSOLID
Definition: q_shared.h:394
game_import_t::trace
trace_t(* trace)(vec3_t start, vec3_t mins, vec3_t maxs, vec3_t end, edict_t *passent, int contentmask)
Definition: game.h:128
trace_t::fraction
float fraction
Definition: q_shared.h:453
flymonster_start
void flymonster_start(edict_t *self)
Definition: g_monster.c:715
VectorSubtract
#define VectorSubtract(a, b, c)
Definition: q_shared.h:156
AI_GOOD_GUY
#define AI_GOOD_GUY
Definition: g_local.h:135
FindItemByClassname
gitem_t * FindItemByClassname(char *classname)
Definition: g_items.c:77
trace_t::plane
cplane_t plane
Definition: q_shared.h:455
CONTENTS_WATER
#define CONTENTS_WATER
Definition: qfiles.h:338
game_import_t::multicast
void(* multicast)(vec3_t origin, multicast_t to)
Definition: game.h:144
SOLID_BBOX
@ SOLID_BBOX
Definition: game.h:37
monster_start
qboolean monster_start(edict_t *self)
Definition: g_monster.c:534
FRAMETIME
#define FRAMETIME
Definition: g_local.h:73
RF_SHELL_GREEN
#define RF_SHELL_GREEN
Definition: q_shared.h:624
entity_state_s::renderfx
int renderfx
Definition: q_shared.h:1181
mmove_t::endfunc
void(* endfunc)(edict_t *self)
Definition: g_local.h:413
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:51
v
GLdouble v
Definition: qgl_win.c:143
fire_rail
void fire_rail(edict_t *self, vec3_t start, vec3_t aimdir, int damage, int kick)
Definition: g_weapon.c:658
M_SetEffects
void M_SetEffects(edict_t *ent)
Definition: g_monster.c:332
st
spawn_temp_t st
Definition: g_main.c:27
mmove_t::lastframe
int lastframe
Definition: g_local.h:411
M_walkmove
qboolean M_walkmove(edict_t *ent, float yaw, float dist)
Definition: m_move.c:542
monster_triggered_start
void monster_triggered_start(edict_t *self)
Definition: g_monster.c:493
EF_FLIES
#define EF_FLIES
Definition: q_shared.h:571
entity_state_s::origin
vec3_t origin
Definition: q_shared.h:1173
edict_s::linkcount
int linkcount
Definition: g_local.h:971
SVF_NOCLIENT
#define SVF_NOCLIENT
Definition: game.h:27
fire_rocket
void fire_rocket(edict_t *self, vec3_t start, vec3_t dir, int damage, int speed, float damage_radius, int radius_damage)
Definition: g_weapon.c:620
mmove_t::frame
mframe_t * frame
Definition: g_local.h:412
edict_s::air_finished
float air_finished
Definition: g_local.h:1027
M_FliesOff
static void M_FliesOff(edict_t *self)
Definition: g_monster.c:107
MASK_WATER
#define MASK_WATER
Definition: q_shared.h:395
qboolean
qboolean
Definition: q_shared.h:56
trace_t
Definition: q_shared.h:449
fire_bfg
void fire_bfg(edict_t *self, vec3_t start, vec3_t dir, int damage, int speed, float damage_radius)
Definition: g_weapon.c:883
walkmonster_start_go
void walkmonster_start_go(edict_t *self)
Definition: g_monster.c:671
G_Find
edict_t * G_Find(edict_t *from, int fieldofs, char *match)
Definition: g_utils.c:45
monster_use
void monster_use(edict_t *self, edict_t *other, edict_t *activator)
Definition: g_monster.c:440
edict_s::client
struct gclient_s * client
Definition: g_local.h:965
game_import_t::sound
void(* sound)(edict_t *ent, int channel, int soundindex, float volume, float attenuation, float timeofs)
Definition: game.h:109
FOFS
#define FOFS(x)
Definition: g_local.h:504
monster_fire_railgun
void monster_fire_railgun(edict_t *self, vec3_t start, vec3_t aimdir, int damage, int kick, int flashtype)
Definition: g_monster.c:81
M_CheckGround
void M_CheckGround(edict_t *ent)
Definition: g_monster.c:141
vectoyaw
float vectoyaw(vec3_t vec)
Definition: g_utils.c:333
fire_grenade
void fire_grenade(edict_t *self, vec3_t start, vec3_t aimdir, int damage, int speed, float timer, float damage_radius)
Definition: g_weapon.c:486
monster_start_go
void monster_start_go(edict_t *self)
Definition: g_monster.c:583
flymonster_start_go
void flymonster_start_go(edict_t *self)
Definition: g_monster.c:699
edict_s::mins
vec3_t mins
Definition: g_local.h:984
swimmonster_start
void swimmonster_start(edict_t *self)
Definition: g_monster.c:735
MOD_SLIME
#define MOD_SLIME
Definition: g_local.h:481
M_CheckAttack
qboolean M_CheckAttack(edict_t *self)
Definition: g_ai.c:607
g_edicts
edict_t * g_edicts
Definition: g_main.c:33
ATTN_NORM
#define ATTN_NORM
Definition: q_shared.h:1019
T_Damage
void T_Damage(edict_t *targ, edict_t *inflictor, edict_t *attacker, vec3_t dir, vec3_t point, vec3_t normal, int damage, int knockback, int dflags, int mod)
Definition: g_combat.c:378
edict_s::groundentity_linkcount
int groundentity_linkcount
Definition: g_local.h:1074
MOVETYPE_STEP
@ MOVETYPE_STEP
Definition: g_local.h:194
entity_state_s::effects
unsigned int effects
Definition: q_shared.h:1180
FL_SWIM
#define FL_SWIM
Definition: g_local.h:58
monster_think
void monster_think(edict_t *self)
Definition: g_monster.c:419
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:31
EF_COLOR_SHELL
#define EF_COLOR_SHELL
Definition: q_shared.h:565
SVF_DEADMONSTER
#define SVF_DEADMONSTER
Definition: game.h:28
mframe_t::thinkfunc
void(* thinkfunc)(edict_t *self)
Definition: g_local.h:405
POWER_ARMOR_SHIELD
#define POWER_ARMOR_SHIELD
Definition: g_local.h:159
trace_t::allsolid
qboolean allsolid
Definition: q_shared.h:451
POWER_ARMOR_SCREEN
#define POWER_ARMOR_SCREEN
Definition: g_local.h:158
edict_s::svflags
int svflags
Definition: g_local.h:983
edict_s::classname
char * classname
Definition: g_local.h:1005
FL_INWATER
#define FL_INWATER
Definition: g_local.h:60
monster_triggered_spawn
void monster_triggered_spawn(edict_t *self)
Definition: g_monster.c:460
edict_s
Definition: g_local.h:962
M_droptofloor
void M_droptofloor(edict_t *ent)
Definition: g_monster.c:310
G_FreeEdict
void G_FreeEdict(edict_t *e)
Definition: g_utils.c:452
M_MoveFrame
void M_MoveFrame(edict_t *self)
Definition: g_monster.c:361
MOVETYPE_NONE
@ MOVETYPE_NONE
Definition: g_local.h:188
M_FliesOn
static void M_FliesOn(edict_t *self)
Definition: g_monster.c:113
game_import_t::soundindex
int(* soundindex)(char *name)
Definition: game.h:122
game_import_t::pointcontents
int(* pointcontents)(vec3_t point)
Definition: game.h:129
AI_HOLD_FRAME
#define AI_HOLD_FRAME
Definition: g_local.h:134
M_CatagorizePosition
void M_CatagorizePosition(edict_t *ent)
Definition: g_monster.c:183
M_WorldEffects
void M_WorldEffects(edict_t *ent)
Definition: g_monster.c:218
mmove_t
Definition: g_local.h:408
cvar_s::value
float value
Definition: q_shared.h:324
vtos
char * vtos(vec3_t v)
Definition: g_utils.c:293
monster_triggered_spawn_use
void monster_triggered_spawn_use(edict_t *self, edict_t *other, edict_t *activator)
Definition: g_monster.c:483
random
#define random()
Definition: g_local.h:509
monster_fire_bfg
void monster_fire_bfg(edict_t *self, vec3_t start, vec3_t aimdir, int damage, int speed, int kick, float damage_radius, int flashtype)
Definition: g_monster.c:91
FL_NOTARGET
#define FL_NOTARGET
Definition: g_local.h:62
mmove_t::firstframe
int firstframe
Definition: g_local.h:410
edict_s::watertype
int watertype
Definition: g_local.h:1093
NULL
#define NULL
Definition: q_shared.h:60
FoundTarget
void FoundTarget(edict_t *self)
Definition: g_ai.c:347
monsterinfo_t::aiflags
int aiflags
Definition: g_local.h:419
edict_s::damage_debounce_time
float damage_debounce_time
Definition: g_local.h:1047
SOLID_NOT
@ SOLID_NOT
Definition: game.h:35
monster_fire_grenade
void monster_fire_grenade(edict_t *self, vec3_t start, vec3_t aimdir, int damage, int speed, int flashtype)
Definition: g_monster.c:61
edict_s::velocity
vec3_t velocity
Definition: g_local.h:1024
walkmonster_start
void walkmonster_start(edict_t *self)
Definition: g_monster.c:692
FL_IMMUNE_SLIME
#define FL_IMMUNE_SLIME
Definition: g_local.h:63
CONTENTS_SLIME
#define CONTENTS_SLIME
Definition: qfiles.h:337
DEAD_NO
#define DEAD_NO
Definition: g_local.h:111
EF_POWERSCREEN
#define EF_POWERSCREEN
Definition: q_shared.h:566
game_import_t::WriteShort
void(* WriteShort)(int c)
Definition: game.h:148
fire_bullet
void fire_bullet(edict_t *self, vec3_t start, vec3_t aimdir, int damage, int kick, int hspread, int vspread, int mod)
Definition: g_weapon.c:277
VectorCopy
#define VectorCopy(a, b)
Definition: q_shared.h:158
edict_s::pain_debounce_time
float pain_debounce_time
Definition: g_local.h:1046
monster_death_use
void monster_death_use(edict_t *self)
Definition: g_monster.c:511
edict_s::use
void(* use)(edict_t *self, edict_t *other, edict_t *activator)
Definition: g_local.h:1041
edict_s::monsterinfo
monsterinfo_t monsterinfo
Definition: g_local.h:1108
trace_t::endpos
vec3_t endpos
Definition: q_shared.h:454
vec3_origin
vec3_t vec3_origin
Definition: q_shared.c:24
DAMAGE_AIM
@ DAMAGE_AIM
Definition: g_local.h:88
world
#define world
Definition: g_local.h:550
spawn_temp_t::item
char * item
Definition: g_local.h:360
game_import_t::WriteByte
void(* WriteByte)(int c)
Definition: game.h:147
level
GLint level
Definition: qgl_win.c:116
G_UseTargets
void G_UseTargets(edict_t *ent, edict_t *activator)
Definition: g_utils.c:173
edict_s::flags
int flags
Definition: g_local.h:996
Drop_Item
edict_t * Drop_Item(edict_t *ent, gitem_t *item)
Definition: g_items.c:843
M_FlyCheck
void M_FlyCheck(edict_t *self)
Definition: g_monster.c:123
monsterinfo_t::power_armor_type
int power_armor_type
Definition: g_local.h:446
CONTENTS_LAVA
#define CONTENTS_LAVA
Definition: qfiles.h:336
edict_s::maxs
vec3_t maxs
Definition: g_local.h:984
trace_t::startsolid
qboolean startsolid
Definition: q_shared.h:452
MOD_UNKNOWN
#define MOD_UNKNOWN
Definition: g_local.h:463
mframe_t::dist
float dist
Definition: g_local.h:404
swimmonster_start_go
void swimmonster_start_go(edict_t *self)
Definition: g_monster.c:723
trace_t::ent
struct edict_s * ent
Definition: q_shared.h:458
FL_FLY
#define FL_FLY
Definition: g_local.h:57
KillBox
qboolean KillBox(edict_t *ent)
Definition: g_utils.c:549
SVF_MONSTER
#define SVF_MONSTER
Definition: game.h:29
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:41
fire_blaster
void fire_blaster(edict_t *self, vec3_t start, vec3_t aimdir, int damage, int speed, int effect, qboolean hyper)
Definition: g_weapon.c:345
RF_SHELL_BLUE
#define RF_SHELL_BLUE
Definition: q_shared.h:625
RF_FRAMELERP
#define RF_FRAMELERP
Definition: q_shared.h:619
FL_IMMUNE_LAVA
#define FL_IMMUNE_LAVA
Definition: g_local.h:64
edict_s::waterlevel
int waterlevel
Definition: g_local.h:1094
mframe_t::aifunc
void(* aifunc)(edict_t *self, float dist)
Definition: g_local.h:403
CHAN_BODY
#define CHAN_BODY
Definition: q_shared.h:1011
DAMAGE_NO_ARMOR
#define DAMAGE_NO_ARMOR
Definition: g_local.h:658
svc_muzzleflash2
@ svc_muzzleflash2
Definition: qcommon.h:209
fire_shotgun
void fire_shotgun(edict_t *self, vec3_t start, vec3_t aimdir, int damage, int kick, int hspread, int vspread, int count, int mod)
Definition: g_weapon.c:290
G_PickTarget
edict_t * G_PickTarget(char *targetname)
Definition: g_utils.c:118
game_import_t::linkentity
void(* linkentity)(edict_t *ent)
Definition: game.h:138
MULTICAST_PVS
@ MULTICAST_PVS
Definition: q_shared.h:111
vec3_t
vec_t vec3_t[3]
Definition: q_shared.h:127
MOD_LAVA
#define MOD_LAVA
Definition: g_local.h:482
MOD_WATER
#define MOD_WATER
Definition: g_local.h:480
edict_s::powerarmor_time
float powerarmor_time
Definition: g_local.h:1057
count
GLint GLsizei count
Definition: qgl_win.c:128
g_local.h
edict_s::health
int health
Definition: g_local.h:1051