Updated various monster code to use IsAlive() and things
This commit is contained in:
parent
b8f2ca446f
commit
e373af4ca5
20 changed files with 31 additions and 33 deletions
|
@ -80,7 +80,7 @@ void
|
|||
monster_alien_controller::Death(void)
|
||||
{
|
||||
/* if we're already dead (corpse) don't change animations */
|
||||
if (style != MONSTER_DEAD) {
|
||||
if (IsAlive() == true) {
|
||||
SetFrame(CON_DIE);
|
||||
Sound_Play(this, CHAN_VOICE, "monster_alien_controller.die");
|
||||
}
|
||||
|
@ -93,7 +93,7 @@ void
|
|||
monster_alien_controller::IdleNoise(void)
|
||||
{
|
||||
/* don't make noise if we're dead (corpse) */
|
||||
if (style == MONSTER_DEAD) {
|
||||
if (IsAlive() == false) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -93,7 +93,7 @@ void
|
|||
monster_alien_grunt::Death(void)
|
||||
{
|
||||
/* if we're already dead (corpse) don't change animations */
|
||||
if (style != MONSTER_DEAD) {
|
||||
if (IsAlive() == true) {
|
||||
/* headshots == different animation */
|
||||
if (g_dmg_iHitBody == BODY_HEAD) {
|
||||
if (random() < 0.5) {
|
||||
|
@ -116,7 +116,7 @@ void
|
|||
monster_alien_grunt::IdleNoise(void)
|
||||
{
|
||||
/* don't make noise if we're dead (corpse) */
|
||||
if (style == MONSTER_DEAD) {
|
||||
if (IsAlive() == false) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -188,7 +188,7 @@ void
|
|||
monster_alien_slave::Death(void)
|
||||
{
|
||||
/* if we're already dead (corpse) don't change animations */
|
||||
if (style != MONSTER_DEAD) {
|
||||
if (IsAlive() == true) {
|
||||
/* headshots == different animation */
|
||||
if (g_dmg_iHitBody == BODY_HEAD) {
|
||||
if (random() < 0.5) {
|
||||
|
|
|
@ -52,7 +52,7 @@ void
|
|||
monster_barnacle::Death(void)
|
||||
{
|
||||
/* if we're already dead (corpse) don't change animations */
|
||||
if (style != MONSTER_DEAD) {
|
||||
if (IsAlive() == true) {
|
||||
SetFrame(BCL_DIE);
|
||||
Sound_Play(this, CHAN_VOICE, "monster_barnacle.die");
|
||||
}
|
||||
|
|
|
@ -155,13 +155,11 @@ monster_barney::Pain(void)
|
|||
|
||||
super::Pain();
|
||||
|
||||
#if 0
|
||||
if (m_flAnimTime > time)
|
||||
if (InAnimation() == true)
|
||||
return;
|
||||
|
||||
if (random() < 0.25f)
|
||||
return;
|
||||
#endif
|
||||
|
||||
Sound_Speak(this, "monster_barney.pain");
|
||||
|
||||
|
|
|
@ -62,7 +62,7 @@ void
|
|||
monster_bigmomma::IdleNoise(void)
|
||||
{
|
||||
/* don't make noise if we're dead (corpse) */
|
||||
if (style == MONSTER_DEAD) {
|
||||
if (IsAlive() == false) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -97,7 +97,7 @@ void
|
|||
monster_bigmomma::Death(void)
|
||||
{
|
||||
/* if we're already dead (corpse) don't change animations */
|
||||
if (style != MONSTER_DEAD) {
|
||||
if (IsAlive() == true) {
|
||||
SetFrame(GON_DIE);
|
||||
Sound_Play(this, CHAN_VOICE, "monster_bigmomma.die");
|
||||
}
|
||||
|
|
|
@ -90,7 +90,7 @@ void
|
|||
monster_bullchicken::IdleNoise(void)
|
||||
{
|
||||
/* don't make noise if we're dead (corpse) */
|
||||
if (style == MONSTER_DEAD) {
|
||||
if (IsAlive() == false) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -125,7 +125,7 @@ void
|
|||
monster_bullchicken::Death(void)
|
||||
{
|
||||
/* if we're already dead (corpse) don't change animations */
|
||||
if (style != MONSTER_DEAD) {
|
||||
if (IsAlive() == true) {
|
||||
|
||||
/* two different animations */
|
||||
SetFrame((random() < 0.5) ? BULL_DIE : BULL_DIE2);
|
||||
|
|
|
@ -32,7 +32,7 @@ void
|
|||
monster_cockroach::Death(void)
|
||||
{
|
||||
/* if we're already dead (corpse) don't change animations */
|
||||
if (style != MONSTER_DEAD) {
|
||||
if (IsAlive() == true) {
|
||||
Sound_Play(this, CHAN_VOICE, "monster_cockroach.die");
|
||||
}
|
||||
|
||||
|
|
|
@ -64,7 +64,7 @@ void
|
|||
monster_gargantua::IdleNoise(void)
|
||||
{
|
||||
/* don't make noise if we're dead (corpse) */
|
||||
if (style == MONSTER_DEAD) {
|
||||
if (IsAlive() == false) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -99,7 +99,7 @@ void
|
|||
monster_gargantua::Death(void)
|
||||
{
|
||||
/* if we're already dead (corpse) don't change animations */
|
||||
if (style != MONSTER_DEAD) {
|
||||
if (IsAlive() == true) {
|
||||
SetFrame(GARG_DIE);
|
||||
Sound_Play(this, CHAN_VOICE, "monster_gargantua.die");
|
||||
}
|
||||
|
|
|
@ -129,7 +129,7 @@ void
|
|||
monster_headcrab::Death(void)
|
||||
{
|
||||
/* if we're already dead (corpse) don't change animations */
|
||||
if (style != MONSTER_DEAD) {
|
||||
if (IsAlive() == true) {
|
||||
SetFrame(HC_DIE);
|
||||
Sound_Play(this, CHAN_VOICE, "monster_headcrab.die");
|
||||
}
|
||||
|
@ -142,7 +142,7 @@ void
|
|||
monster_headcrab::IdleNoise(void)
|
||||
{
|
||||
/* don't make noise if we're dead (corpse) */
|
||||
if (style == MONSTER_DEAD) {
|
||||
if (IsAlive() == false) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -151,7 +151,7 @@ void
|
|||
monster_houndeye::Death(void)
|
||||
{
|
||||
/* if we're already dead (corpse) don't change animations */
|
||||
if (style != MONSTER_DEAD) {
|
||||
if (IsAlive() == true) {
|
||||
SetFrame(HE_DIE + floor(random(0, 4)));
|
||||
|
||||
Sound_Play(this, CHAN_VOICE, "monster_houndeye.die");
|
||||
|
@ -165,7 +165,7 @@ void
|
|||
monster_houndeye::IdleNoise(void)
|
||||
{
|
||||
/* don't make noise if we're dead (corpse) */
|
||||
if (style == MONSTER_DEAD) {
|
||||
if (IsAlive() == false) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@ void
|
|||
monster_human_assassin::Death(void)
|
||||
{
|
||||
/* if we're already dead (corpse) don't change animations */
|
||||
if (style != MONSTER_DEAD) {
|
||||
if (IsAlive() == true) {
|
||||
/* headshots == different animation */
|
||||
/* this animation may not have been used, but it looks cool */
|
||||
if (g_dmg_iHitBody == BODY_HEAD) {
|
||||
|
|
|
@ -248,7 +248,7 @@ void
|
|||
monster_human_grunt::Death(void)
|
||||
{
|
||||
/* if we're already dead (corpse) don't change animations */
|
||||
if (style != MONSTER_DEAD) {
|
||||
if (IsAlive() == true) {
|
||||
/* headshots == different animation */
|
||||
/* this animation may not have been used, but it looks cool */
|
||||
if (g_dmg_iHitBody == BODY_HEAD) {
|
||||
|
|
|
@ -77,7 +77,7 @@ void
|
|||
monster_ichthyosaur::Death(void)
|
||||
{
|
||||
/* if we're already dead (corpse) don't change animations */
|
||||
if (style != MONSTER_DEAD) {
|
||||
if (IsAlive() == true) {
|
||||
int r = floor(random(0,3));
|
||||
|
||||
switch (r) {
|
||||
|
@ -103,7 +103,7 @@ void
|
|||
monster_ichthyosaur::IdleNoise(void)
|
||||
{
|
||||
/* don't make noise if we're dead (corpse) */
|
||||
if (style == MONSTER_DEAD) {
|
||||
if (IsAlive() == false) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -56,7 +56,7 @@ void
|
|||
monster_leech::Death(void)
|
||||
{
|
||||
/* if we're already dead (corpse) don't change animations */
|
||||
if (style != MONSTER_DEAD) {
|
||||
if (IsAlive() == true) {
|
||||
SetFrame(LEECH_DIE);
|
||||
think = DeathEnd;
|
||||
nextthink = time + 1.0f;
|
||||
|
|
|
@ -64,7 +64,7 @@ void
|
|||
monster_nihilanth::IdleNoise(void)
|
||||
{
|
||||
/* don't make noise if we're dead (corpse) */
|
||||
if (style == MONSTER_DEAD) {
|
||||
if (IsAlive() == false) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -101,7 +101,7 @@ void
|
|||
monster_nihilanth::Death(void)
|
||||
{
|
||||
/* if we're already dead (corpse) don't change animations */
|
||||
if (style != MONSTER_DEAD) {
|
||||
if (IsAlive() == true) {
|
||||
SetFrame(NIL_DIE);
|
||||
Sound_Play(this, CHAN_VOICE, "monster_nihilanth.die");
|
||||
}
|
||||
|
|
|
@ -106,7 +106,7 @@ monster_scientist::Pain(void)
|
|||
return;
|
||||
}
|
||||
|
||||
if (style != MONSTER_DEAD) {
|
||||
if (IsAlive() == true) {
|
||||
Sound_Speak(this, "monster_scientist.pain");
|
||||
SetFrame(SCIA_FLINCH + floor(random(0, 6)));
|
||||
m_iFlags |= MONSTER_FEAR;
|
||||
|
@ -119,7 +119,7 @@ monster_scientist::Death(void)
|
|||
{
|
||||
WarnAllies();
|
||||
|
||||
if (style != MONSTER_DEAD) {
|
||||
if (IsAlive() == true) {
|
||||
SetFrame(SCIA_DIE_SIMPLE + floor(random(0, 6)));
|
||||
Sound_Speak(this, "monster_scientist.die");
|
||||
}
|
||||
|
|
|
@ -47,7 +47,7 @@ void
|
|||
monster_sentry::Death(void)
|
||||
{
|
||||
/* if we're already dead (corpse) don't change animations */
|
||||
if (style != MONSTER_DEAD) {
|
||||
if (IsAlive() == true) {
|
||||
SetFrame(SENT_DIE);
|
||||
Sound_Play(this, CHAN_VOICE, "monster_sentry.die");
|
||||
}
|
||||
|
|
|
@ -94,7 +94,7 @@ void
|
|||
monster_tentacle::IdleNoise(void)
|
||||
{
|
||||
/* don't make noise if we're dead (corpse) */
|
||||
if (style == MONSTER_DEAD) {
|
||||
if (IsAlive() == false) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -162,7 +162,7 @@ void
|
|||
monster_zombie::Death(void)
|
||||
{
|
||||
/* if we're already dead (corpse) don't change animations */
|
||||
if (style != MONSTER_DEAD) {
|
||||
if (IsAlive() == true) {
|
||||
/* headshots == different animation */
|
||||
if (g_dmg_iHitBody == BODY_HEAD) {
|
||||
if (random() < 0.5) {
|
||||
|
@ -185,7 +185,7 @@ void
|
|||
monster_zombie::IdleNoise(void)
|
||||
{
|
||||
/* don't make noise if we're dead (corpse) */
|
||||
if (style == MONSTER_DEAD) {
|
||||
if (IsAlive() == false) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue