Toxomister death effects

This commit is contained in:
James R 2025-07-08 15:10:51 -07:00
parent 6001336873
commit e2c4341896
5 changed files with 25 additions and 6 deletions

View file

@ -3122,6 +3122,7 @@ const char *const STATE_LIST[] = { // array length left dynamic for sanity testi
"S_STON",
"S_TOXAA",
"S_TOXAA_DEAD",
"S_TOXAB",
"S_TOXBA",
};

View file

@ -3708,6 +3708,7 @@ state_t states[NUMSTATES] =
{SPR_STON, 0, -1, {NULL}, 0, 0, S_STON}, // S_STON
//
{SPR_TOXA, 0, -1, {NULL}, 0, 0, S_TOXAA}, // S_TOXAA
{SPR_TOXA, 0, 175, {NULL}, 0, 0, S_NULL}, // S_TOXAA_DEAD
{SPR_TOXA, 1, -1, {NULL}, 0, 0, S_TOXAB}, // S_TOXAB
{SPR_TOXB, FF_ANIMATE|FF_RANDOMANIM, -1, {NULL}, 6, 5, S_TOXBA}, // S_TOXBA
};
@ -22731,7 +22732,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
sfx_None, // painsound
S_NULL, // meleestate
S_NULL, // missilestate
S_NULL, // deathstate
S_TOXAA_DEAD, // deathstate
S_NULL, // xdeathstate
sfx_None, // deathsound
0, // speed

View file

@ -4191,6 +4191,7 @@ typedef enum state
S_STON,
S_TOXAA,
S_TOXAA_DEAD,
S_TOXAB,
S_TOXBA,

View file

@ -75,7 +75,7 @@ struct Eye : Mobj
{
static constexpr INT32 kOrbitRadius = 24;
bool valid() const { return Mobj::valid(owner()); }
bool valid() const { return Mobj::valid(owner()) && owner()->health > 0; }
bool tick()
{
@ -230,8 +230,15 @@ struct Pole : Mobj
if (K_TryPickMeUp(this, toucher, false))
return false;
// TODO: spawn a puff of smoke?
remove();
// Adapted from P_XYMovement, MT_JAWZ
voice(info->deathsound);
P_KillMobj(this, NULL, NULL, DMG_NORMAL);
P_SetObjectMomZ(this, 24*FRACUNIT, false);
instathrust(R_PointToAngle2(toucher->x, toucher->y, x, y), 32 * mapobjectscale);
flags &= ~MF_NOGRAVITY;
hitlag(toucher, toucher, 8, true);
return false;
}
@ -306,7 +313,7 @@ struct Cloud : Mobj
bool tick_patrol()
{
if (Mobj::valid(pole()))
if (Mobj::valid(pole()) && pole()->health > 0)
{
move_origin(pole()->pos());
instathrust(angle, 64 * mapobjectscale);

View file

@ -1246,9 +1246,12 @@ fixed_t P_GetMobjGravity(mobj_t *mo)
gravityadd /= 2;
break;
case MT_GACHABOM:
case MT_TOXOMISTER_POLE:
gravityadd = (5*gravityadd)/2;
break;
case MT_TOXOMISTER_POLE:
if (mo->health > 0)
gravityadd = (5*gravityadd)/2;
break;
case MT_BANANA:
case MT_BALLHOG:
case MT_BALLHOG_RETICULE_TEST:
@ -6868,6 +6871,12 @@ static boolean P_MobjDeadThink(mobj_t *mobj)
P_SetMobjState(mobj, mobj->info->xdeathstate);
/* FALLTHRU */
case MT_JAWZ_SHIELD:
mobj->renderflags ^= RF_DONTDRAW;
break;
case MT_TOXOMISTER_POLE:
if (mobj->momz == 0 && P_IsObjectOnGround(mobj))
P_SetMobjState(mobj, mobj->info->xdeathstate);
mobj->renderflags ^= RF_DONTDRAW;
break;
case MT_SSMINE: