Go to the documentation of this file.
53 fire_blaster (
self, start, dir, damage, speed, effect,
false);
63 fire_grenade (
self, start, aimdir, damage, speed, 2.5, damage+40);
73 fire_rocket (
self, start, dir, damage, speed, damage+20, damage);
83 fire_rail (
self, start, aimdir, damage, kick);
93 fire_bfg (
self, start, aimdir, damage, speed, damage_radius);
115 if (self->waterlevel)
118 self->s.sound =
gi.
soundindex (
"infantry/inflies1.wav");
120 self->nextthink =
level.time + 60;
125 if (self->waterlevel)
137 self->monsterinfo.attack_finished =
level.time + time;
158 point[2] = ent->
s.
origin[2] - 0.25;
366 move =
self->monsterinfo.currentmove;
369 if ((self->monsterinfo.nextframe) && (self->monsterinfo.nextframe >= move->
firstframe) && (self->monsterinfo.nextframe <= move->
lastframe))
371 self->s.frame =
self->monsterinfo.nextframe;
372 self->monsterinfo.nextframe = 0;
383 move =
self->monsterinfo.currentmove;
422 if (self->linkcount != self->monsterinfo.linkcount)
424 self->monsterinfo.linkcount =
self->linkcount;
444 if (self->health <= 0)
452 self->enemy = activator;
462 self->s.origin[2] += 1;
468 self->air_finished =
level.time + 12;
473 if (self->enemy && !(self->spawnflags & 1) && !(self->enemy->flags &
FL_NOTARGET))
489 self->enemy = activator;
522 if (self->deathtarget)
523 self->target =
self->deathtarget;
542 if ((self->spawnflags & 4) && !(self->monsterinfo.aiflags &
AI_GOOD_GUY))
544 self->spawnflags &= ~4;
545 self->spawnflags |= 1;
550 level.total_monsters++;
556 self->air_finished =
level.time + 12;
558 self->max_health =
self->health;
565 if (!self->monsterinfo.checkattack)
567 VectorCopy (self->s.origin, self->s.old_origin);
577 if (self->monsterinfo.currentmove)
578 self->s.frame =
self->monsterinfo.currentmove->firstframe + (rand() % (
self->monsterinfo.currentmove->lastframe -
self->monsterinfo.currentmove->firstframe + 1));
587 if (self->health <= 0)
600 while ((target =
G_Find (target,
FOFS(targetname), self->target)) !=
NULL)
602 if (strcmp(target->
classname,
"point_combat") == 0)
604 self->combattarget =
self->target;
612 if (notcombat && self->combattarget)
613 gi.
dprintf(
"%s at %s has target with mixed types\n", self->classname,
vtos(self->s.origin));
619 if (self->combattarget)
624 while ((target =
G_Find (target,
FOFS(targetname), self->combattarget)) !=
NULL)
626 if (strcmp(target->
classname,
"point_combat") != 0)
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],
638 self->goalentity =
self->movetarget =
G_PickTarget(self->target);
639 if (!self->movetarget)
641 gi.
dprintf (
"%s can't find target %s at %s\n", self->classname, self->target,
vtos(self->s.origin));
643 self->monsterinfo.pausetime = 100000000;
644 self->monsterinfo.stand (
self);
646 else if (strcmp (self->movetarget->classname,
"path_corner") == 0)
650 self->monsterinfo.walk (
self);
655 self->goalentity =
self->movetarget =
NULL;
656 self->monsterinfo.pausetime = 100000000;
657 self->monsterinfo.stand (
self);
662 self->monsterinfo.pausetime = 100000000;
663 self->monsterinfo.stand (
self);
673 if (!(self->spawnflags & 2) &&
level.time < 1)
677 if (self->groundentity)
679 gi.
dprintf (
"%s in solid at %s\n", self->classname,
vtos(self->s.origin));
682 if (!self->yaw_speed)
683 self->yaw_speed = 20;
684 self->viewheight = 25;
688 if (self->spawnflags & 2)
702 gi.
dprintf (
"%s in solid at %s\n", self->classname,
vtos(self->s.origin));
704 if (!self->yaw_speed)
705 self->yaw_speed = 10;
706 self->viewheight = 25;
710 if (self->spawnflags & 2)
725 if (!self->yaw_speed)
726 self->yaw_speed = 10;
727 self->viewheight = 10;
731 if (self->spawnflags & 2)
void(* dprintf)(char *fmt,...)
void AttackFinished(edict_t *self, float time)
void monster_fire_rocket(edict_t *self, vec3_t start, vec3_t dir, int damage, int speed, int flashtype)
#define MASK_MONSTERSOLID
trace_t(* trace)(vec3_t start, vec3_t mins, vec3_t maxs, vec3_t end, edict_t *passent, int contentmask)
void flymonster_start(edict_t *self)
#define VectorSubtract(a, b, c)
gitem_t * FindItemByClassname(char *classname)
void(* multicast)(vec3_t origin, multicast_t to)
qboolean monster_start(edict_t *self)
void(* endfunc)(edict_t *self)
void monster_fire_blaster(edict_t *self, vec3_t start, vec3_t dir, int damage, int speed, int flashtype, int effect)
void fire_rail(edict_t *self, vec3_t start, vec3_t aimdir, int damage, int kick)
void M_SetEffects(edict_t *ent)
qboolean M_walkmove(edict_t *ent, float yaw, float dist)
void monster_triggered_start(edict_t *self)
void fire_rocket(edict_t *self, vec3_t start, vec3_t dir, int damage, int speed, float damage_radius, int radius_damage)
static void M_FliesOff(edict_t *self)
void fire_bfg(edict_t *self, vec3_t start, vec3_t dir, int damage, int speed, float damage_radius)
void walkmonster_start_go(edict_t *self)
edict_t * G_Find(edict_t *from, int fieldofs, char *match)
void monster_use(edict_t *self, edict_t *other, edict_t *activator)
struct gclient_s * client
void(* sound)(edict_t *ent, int channel, int soundindex, float volume, float attenuation, float timeofs)
void monster_fire_railgun(edict_t *self, vec3_t start, vec3_t aimdir, int damage, int kick, int flashtype)
void M_CheckGround(edict_t *ent)
float vectoyaw(vec3_t vec)
void fire_grenade(edict_t *self, vec3_t start, vec3_t aimdir, int damage, int speed, float timer, float damage_radius)
void monster_start_go(edict_t *self)
void flymonster_start_go(edict_t *self)
void swimmonster_start(edict_t *self)
qboolean M_CheckAttack(edict_t *self)
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)
int groundentity_linkcount
void monster_think(edict_t *self)
void monster_fire_bullet(edict_t *self, vec3_t start, vec3_t dir, int damage, int kick, int hspread, int vspread, int flashtype)
void(* thinkfunc)(edict_t *self)
#define POWER_ARMOR_SHIELD
#define POWER_ARMOR_SCREEN
void monster_triggered_spawn(edict_t *self)
void M_droptofloor(edict_t *ent)
void G_FreeEdict(edict_t *e)
void M_MoveFrame(edict_t *self)
static void M_FliesOn(edict_t *self)
int(* soundindex)(char *name)
int(* pointcontents)(vec3_t point)
void M_CatagorizePosition(edict_t *ent)
void M_WorldEffects(edict_t *ent)
void monster_triggered_spawn_use(edict_t *self, edict_t *other, edict_t *activator)
void monster_fire_bfg(edict_t *self, vec3_t start, vec3_t aimdir, int damage, int speed, int kick, float damage_radius, int flashtype)
void FoundTarget(edict_t *self)
float damage_debounce_time
void monster_fire_grenade(edict_t *self, vec3_t start, vec3_t aimdir, int damage, int speed, int flashtype)
void walkmonster_start(edict_t *self)
void(* WriteShort)(int c)
void fire_bullet(edict_t *self, vec3_t start, vec3_t aimdir, int damage, int kick, int hspread, int vspread, int mod)
void monster_death_use(edict_t *self)
void(* use)(edict_t *self, edict_t *other, edict_t *activator)
monsterinfo_t monsterinfo
void G_UseTargets(edict_t *ent, edict_t *activator)
edict_t * Drop_Item(edict_t *ent, gitem_t *item)
void M_FlyCheck(edict_t *self)
void swimmonster_start_go(edict_t *self)
qboolean KillBox(edict_t *ent)
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)
void fire_blaster(edict_t *self, vec3_t start, vec3_t aimdir, int damage, int speed, int effect, qboolean hyper)
void(* aifunc)(edict_t *self, float dist)
void fire_shotgun(edict_t *self, vec3_t start, vec3_t aimdir, int damage, int kick, int hspread, int vspread, int count, int mod)
edict_t * G_PickTarget(char *targetname)
void(* linkentity)(edict_t *ent)