23 #define MAX_ACTOR_NAMES 8
89 self->s.
frame =
self->monsterinfo.currentmove->firstframe + (rand() % (
self->monsterinfo.currentmove->lastframe -
self->monsterinfo.currentmove->firstframe + 1));
132 if ((
level.
time < self->pain_debounce_time) && (!self->enemy)) {
133 if (self->movetarget)
220 if (self->health < (self->max_health / 2))
223 if (
level.
time < self->pain_debounce_time)
226 self->pain_debounce_time =
level.
time + 3;
233 VectorSubtract(
other->s.origin, self->s.origin, v);
240 gi.cprintf(
other, PRINT_CHAT,
"%s: %s!\n", name,
messages[rand() % 3]);
256 vec3_t start, target;
262 if (self->enemy->health > 0) {
263 VectorMA(self->enemy->s.origin, -0.2, self->enemy->velocity, target);
264 target[2] +=
self->enemy->viewheight;
266 VectorCopy(self->enemy->absmin, target);
267 target[2] += (
self->enemy->size[2] / 2);
269 VectorSubtract(target, start,
forward);
280 VectorSet(self->mins, -16, -16, -24);
281 VectorSet(self->maxs, 16, 16, -8);
283 self->svflags |= SVF_DEADMONSTER;
316 void actor_die(edict_t *
self, edict_t *inflictor, edict_t *attacker,
int damage, vec3_t point)
321 if (self->health <= -80) {
323 for (n = 0; n < 2; n++)
325 for (n = 0; n < 4; n++)
352 if (
level.
time >= self->monsterinfo.pausetime)
371 n = (rand() & 15) + 3 + 7;
380 self->goalentity =
self->movetarget =
G_PickTarget(self->target);
381 if ((!self->movetarget) || (strcmp(self->movetarget->classname,
"target_actor") != 0)) {
382 gi.dprintf(
"%s has bad target %s at %s\n", self->classname, self->target,
vtos(self->s.origin));
384 self->monsterinfo.pausetime = 100000000;
385 self->monsterinfo.stand(
self);
389 VectorSubtract(self->goalentity->s.origin, self->s.origin, v);
390 self->ideal_yaw =
self->s.angles[YAW] =
vectoyaw(v);
391 self->monsterinfo.walk(
self);
406 if (!self->targetname) {
407 gi.dprintf(
"untargeted %s at %s\n", self->classname,
vtos(self->s.origin));
413 gi.dprintf(
"%s with no target at %s\n", self->classname,
vtos(self->s.origin));
419 self->solid = SOLID_BBOX;
420 self->s.modelindex =
gi.modelindex(
"players/male/tris.md2");
421 VectorSet(self->mins, -16, -16, -24);
422 VectorSet(self->maxs, 16, 16, 32);
435 self->monsterinfo.melee = NULL;
436 self->monsterinfo.sight = NULL;
471 if (
other->movetarget !=
self)
491 if (self->spawnflags & 1) {
492 other->velocity[0] =
self->movedir[0] *
self->speed;
493 other->velocity[1] =
self->movedir[1] *
self->speed;
495 if (
other->groundentity) {
496 other->groundentity = NULL;
497 other->velocity[2] =
self->movedir[2];
498 gi.sound(
other, CHAN_VOICE,
gi.soundindex(
"player/male/jump1.wav"), 1, ATTN_NORM, 0);
502 if (self->spawnflags & 2) {
503 }
else if (self->spawnflags & 4) {
507 if (self->spawnflags & 32)
509 if (self->spawnflags & 16) {
518 if (!(self->spawnflags & 6) && (self->pathtarget)) {
521 savetarget =
self->target;
522 self->target =
self->pathtarget;
524 self->target = savetarget;
529 if (!
other->goalentity)
535 }
else if (
other->movetarget ==
other->goalentity) {
536 VectorSubtract(
other->movetarget->s.origin,
other->s.origin, v);
543 if (!self->targetname)
544 gi.dprintf(
"%s with no targetname at %s\n", self->classname,
vtos(self->s.origin));
546 self->solid = SOLID_TRIGGER;
548 VectorSet(self->mins, -8, -8, -8);
549 VectorSet(self->maxs, 8, 8, 8);
550 self->svflags = SVF_NOCLIENT;
552 if (self->spawnflags & 1) {
557 if (self->s.angles[YAW] == 0)
558 self->s.angles[YAW] = 360;