void stalker_pain (edict_t *self, edict_t *other, float kick, int damage) { if (self->deadflag == DEAD_DEAD) return; if (self->health < (self->max_health / 2)) { self->s.skinnum = 1; } if (skill->value == 3) return; // no pain anims in nightmare // if (self->monsterinfo.aiflags & AI_DODGING) // monster_done_dodge (self); if (self->groundentity == NULL) return; // if we're reactivating or false dying, ignore the pain. if (self->monsterinfo.currentmove == &stalker_move_false_death_end || self->monsterinfo.currentmove == &stalker_move_false_death_start ) return; if (self->monsterinfo.currentmove == &stalker_move_false_death) { stalker_reactivate(self); return; } if ((self->health > 0) && (self->health < (self->max_health / 4))) { if(random() < (0.2 * skill->value)) { if( !STALKER_ON_CEILING(self) || stalker_ok_to_transition(self) ) { // gi.dprintf("starting false death sequence\n"); stalker_false_death_start(self); return; } } } if (level.time < self->pain_debounce_time) return; self->pain_debounce_time = level.time + 3; // gi.dprintf("stalker_pain\n"); if (damage > 10) // don't react unless the damage was significant { // stalker should dodge jump periodically to help avoid damage. if(self->groundentity && (random() < 0.5)) stalker_dodge_jump(self); else self->monsterinfo.currentmove = &stalker_move_pain; gi.sound (self, CHAN_WEAPON, sound_pain, 1, ATTN_NORM, 0); } }
void stalker_dodge(edict_t *self, edict_t *attacker, float eta, trace_t *tr /* unused */) { if (!self || !attacker) { return; } if (!self->groundentity || (self->health <= 0)) { return; } if (!self->enemy) { self->enemy = attacker; FoundTarget(self); return; } if ((eta < 0.1) || (eta > 5)) { return; } /* this will override the foundtarget call of stalker_run */ stalker_dodge_jump(self); }
void stalker_dodge (edict_t *self, edict_t *attacker, float eta, trace_t *tr) { if (!self->groundentity || self->health <= 0) return; if (!self->enemy) { self->enemy = attacker; FoundTarget(self); return; } // PMM - don't bother if it's going to hit anyway; fix for weird in-your-face etas (I was // seeing numbers like 13 and 14) if ((eta < 0.1) || (eta > 5)) return; // this will override the foundtarget call of stalker_run stalker_dodge_jump(self); }
void stalker_pain(edict_t *self, edict_t *other /* unused */, float kick, int damage) { if (!self) { return; } if (self->deadflag == DEAD_DEAD) { return; } if (self->health < (self->max_health / 2)) { self->s.skinnum = 1; } if (skill->value == 3) { return; /* no pain anims in nightmare */ } if (self->groundentity == NULL) { return; } /* if we're reactivating or false dying, ignore the pain. */ if ((self->monsterinfo.currentmove == &stalker_move_false_death_end) || (self->monsterinfo.currentmove == &stalker_move_false_death_start)) { return; } if (self->monsterinfo.currentmove == &stalker_move_false_death) { stalker_reactivate(self); return; } if ((self->health > 0) && (self->health < (self->max_health / 4))) { if (random() < (0.2 * skill->value)) { if (!STALKER_ON_CEILING(self) || stalker_ok_to_transition(self)) { stalker_false_death_start(self); return; } } } if (level.time < self->pain_debounce_time) { return; } self->pain_debounce_time = level.time + 3; if (damage > 10) /* don't react unless the damage was significant */ { /* stalker should dodge jump periodically to help avoid damage. */ if (self->groundentity && (random() < 0.5)) { stalker_dodge_jump(self); } else { self->monsterinfo.currentmove = &stalker_move_pain; } gi.sound(self, CHAN_WEAPON, sound_pain, 1, ATTN_NORM, 0); } }