Go to the documentation of this file.
25 #define MAX_ACTOR_NAMES 8
93 self->s.
frame =
self->monsterinfo.currentmove->firstframe + (rand() % (
self->monsterinfo.currentmove->lastframe -
self->monsterinfo.currentmove->firstframe + 1));
138 if ((
level.time < self->pain_debounce_time) && (!self->enemy))
140 if (self->movetarget)
234 if (self->health < (self->max_health / 2))
237 if (
level.time < self->pain_debounce_time)
240 self->pain_debounce_time =
level.time + 3;
278 if (self->enemy->health > 0)
280 VectorMA (self->enemy->s.origin, -0.2, self->enemy->velocity,
target);
281 target[2] +=
self->enemy->viewheight;
286 target[2] += (
self->enemy->size[2] / 2);
344 if (self->health <= -80)
347 for (n= 0; n < 2; n++)
349 for (n= 0; n < 4; n++)
376 if (
level.time >= self->monsterinfo.pausetime)
396 n = (rand() & 15) + 3 + 7;
405 self->goalentity =
self->movetarget =
G_PickTarget(self->target);
406 if ((!self->movetarget) || (strcmp(self->movetarget->classname,
"target_actor") != 0))
408 gi.
dprintf (
"%s has bad target %s at %s\n", self->classname, self->target,
vtos(self->s.origin));
410 self->monsterinfo.pausetime = 100000000;
411 self->monsterinfo.stand (
self);
417 self->monsterinfo.walk (
self);
433 if (!self->targetname)
435 gi.
dprintf(
"untargeted %s at %s\n", self->classname,
vtos(self->s.origin));
442 gi.
dprintf(
"%s with no target at %s\n", self->classname,
vtos(self->s.origin));
449 self->s.modelindex =
gi.
modelindex(
"players/male/tris.md2");
464 self->monsterinfo.melee =
NULL;
465 self->monsterinfo.sight =
NULL;
522 if (self->spawnflags & 1)
524 other->
velocity[0] =
self->movedir[0] *
self->speed;
525 other->
velocity[1] =
self->movedir[1] *
self->speed;
530 other->
velocity[2] =
self->movedir[2];
535 if (self->spawnflags & 2)
538 else if (self->spawnflags & 4)
544 if (self->spawnflags & 32)
546 if (self->spawnflags & 16)
558 if (!(self->spawnflags & 6) && (self->pathtarget))
562 savetarget =
self->target;
563 self->target =
self->pathtarget;
565 self->target = savetarget;
587 if (!self->targetname)
588 gi.
dprintf (
"%s with no targetname at %s\n", self->classname,
vtos(self->s.origin));
596 if (self->spawnflags & 1)
602 if (self->s.angles[
YAW] == 0)
603 self->s.angles[
YAW] = 360;
void G_ProjectSource(vec3_t point, vec3_t distance, vec3_t forward, vec3_t right, vec3_t result)
void(* dprintf)(char *fmt,...)
#define DEFAULT_BULLET_HSPREAD
void ThrowGib(edict_t *self, char *gibname, int damage, int type)
#define VectorSubtract(a, b, c)
void ai_charge(edict_t *self, float dist)
void actor_pain(edict_t *self, edict_t *other, float kick, int damage)
#define MZ2_ACTOR_MACHINEGUN_1
mframe_t actor_frames_pain1[]
void actor_run(edict_t *self)
void actor_walk(edict_t *self)
mmove_t actor_move_flipoff
mmove_t actor_move_death2
void(* stand)(edict_t *self)
mmove_t actor_move_attack
struct gclient_s * client
void(* sound)(edict_t *ent, int channel, int soundindex, float volume, float attenuation, float timeofs)
void actor_attack(edict_t *self)
float vectoyaw(vec3_t vec)
void actor_fire(edict_t *self)
mframe_t actor_frames_taunt[]
void ai_turn(edict_t *self, float dist)
void walkmonster_start(edict_t *self)
char * actor_names[MAX_ACTOR_NAMES]
void AngleVectors(vec3_t angles, vec3_t forward, vec3_t right, vec3_t up)
vec3_t monster_flash_offset[]
void SP_target_actor(edict_t *self)
#define DEFAULT_BULLET_VSPREAD
mframe_t actor_frames_death1[]
void G_FreeEdict(edict_t *e)
mframe_t actor_frames_flipoff[]
mframe_t actor_frames_stand[]
int(* soundindex)(char *name)
int(* modelindex)(char *name)
void actorMachineGun(edict_t *self)
void actor_die(edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point)
void ai_walk(edict_t *self, float dist)
mframe_t actor_frames_attack[]
vec_t VectorNormalize(vec3_t v)
void actor_dead(edict_t *self)
void SP_misc_actor(edict_t *self)
void actor_use(edict_t *self, edict_t *other, edict_t *activator)
mmove_t actor_move_death1
void monster_fire_bullet(edict_t *self, vec3_t start, vec3_t dir, int damage, int kick, int hspread, int vspread, int flashtype)
void ai_move(edict_t *self, float dist)
void(* cprintf)(edict_t *ent, int printlevel, char *fmt,...)
monsterinfo_t monsterinfo
mframe_t actor_frames_pain3[]
void ai_run(edict_t *self, float dist)
void G_UseTargets(edict_t *ent, edict_t *activator)
mframe_t actor_frames_pain2[]
void VectorMA(vec3_t veca, float scale, vec3_t vecb, vec3_t vecc)
void G_SetMovedir(vec3_t angles, vec3_t movedir)
void ThrowHead(edict_t *self, char *gibname, int damage, int type)
mframe_t actor_frames_run[]
mframe_t actor_frames_death2[]
#define VectorSet(v, x, y, z)
edict_t * G_PickTarget(char *targetname)
void(* linkentity)(edict_t *ent)
void actor_stand(edict_t *self)
mframe_t actor_frames_walk[]
void target_actor_touch(edict_t *self, edict_t *other, cplane_t *plane, csurface_t *surf)
void ai_stand(edict_t *self, float dist)