monster_scientist: Make use of the new NSMonster APIs

This commit is contained in:
Marco Cawthorne 2022-07-25 09:16:52 -07:00
parent 18bd1303b6
commit fefc95108f
Signed by: eukara
GPG Key ID: CE2032F0A2882A22
1 changed files with 6 additions and 9 deletions

View File

@ -208,7 +208,8 @@ monster_scientist::TalkPanic(void)
void
monster_scientist::Pain(void)
{
if (style == MONSTER_DEAD)
/* don't bother if we're fully dead */
if (IsAlive() == false)
return;
if (autocvar_sh_sciattack)
@ -216,17 +217,13 @@ monster_scientist::Pain(void)
StartleAllies();
if (m_flAnimTime > time) {
if (InAnimation() == true)
return;
}
if (random() < 0.25f) {
if (random() < 0.25f)
return;
}
if (style != MONSTER_DEAD)
Sound_Speak(this, "monster_scientist.pain");
Sound_Speak(this, "monster_scientist.pain");
frame = SCIA_FLINCH + floor(random(0, 6));
m_flAnimTime = time + 0.25f;
m_iFlags |= MONSTER_FEAR;
@ -240,7 +237,7 @@ monster_scientist::Death(void)
StartleAllies();
if (style != MONSTER_DEAD) {
if (IsAlive() == false) {
if (g_dmg_eAttacker.flags & FL_CLIENT)
rules.ScientistKill((player)g_dmg_eAttacker, (entity)this);