Shrinking animation

This commit is contained in:
TehRealSalt 2019-10-27 20:15:27 -04:00
parent 9ed7bf7626
commit 0afc901d1f
2 changed files with 26 additions and 38 deletions

View file

@ -4225,10 +4225,7 @@ static void K_DoShrink(player_t *user)
// Grow should get taken away.
if (players[i].kartstuff[k_growshrinktimer] > 0)
K_RemoveGrowShrink(&players[i]);
// Don't hit while invulnerable!
else if (!players[i].kartstuff[k_invincibilitytimer]
&& players[i].kartstuff[k_growshrinktimer] <= 0
&& !players[i].kartstuff[k_hyudorotimer])
else
{
// Start shrinking!
K_DropItems(&players[i]);
@ -4265,22 +4262,11 @@ static void K_DoShrink(player_t *user)
}
}
// @TODO: This should probably go into the P_KillMobj code for items?
if (mobj->eflags & MFE_VERTICALFLIP)
mobj->z -= mobj->height;
else
mobj->z += mobj->height;
S_StartSound(mobj, mobj->info->deathsound);
P_KillMobj(mobj, user->mo, user->mo);
P_SetObjectMomZ(mobj, 8*FRACUNIT, false);
P_InstaThrust(mobj, (angle_t)P_RandomRange(0, 359)*ANG1, 16*FRACUNIT);
mobj->destscale = 0;
mobj->flags |= (MF_NOTHINK|MF_NOCLIPTHING);
if (mobj->type == MT_SPB)
spbplace = -1;
}
}

View file

@ -1658,18 +1658,11 @@ void P_XYMovement(mobj_t *mo)
{
mo->health--;
if (mo->health == 0)
mo->destscale = 1;
}
else
{
if (mo->scale < mapobjectscale/16)
{
P_RemoveMobj(mo);
return;
}
mo->destscale = 0;
}
}
//}
if (!P_TryMove(mo, mo->x + xmove, mo->y + ymove, true) && !(mo->eflags & MFE_SPRUNG))
{
// blocked move
@ -6112,7 +6105,7 @@ boolean P_IsKartItem(INT32 type)
type == MT_JAWZ || type == MT_JAWZ_DUD || type == MT_JAWZ_SHIELD ||
type == MT_SSMINE || type == MT_SSMINE_SHIELD ||
type == MT_SINK || type == MT_SINK_SHIELD ||
type == MT_FLOATINGITEM || type == MT_SPB)
type == MT_SPB)
return true;
else
return false;
@ -6881,8 +6874,16 @@ void P_MobjThinker(mobj_t *mobj)
mobj->z -= mobj->height - oldheight;
if (mobj->scale == mobj->destscale)
{
/// \todo Lua hook for "reached destscale"?
switch(mobj->type)
if (mobj->scale == 0)
{
P_RemoveMobj(mobj);
return;
}
switch (mobj->type)
{
case MT_EGGMOBILE_FIRE:
mobj->destscale = FRACUNIT;
@ -6892,6 +6893,7 @@ void P_MobjThinker(mobj_t *mobj)
break;
}
}
}
if (mobj->type == MT_GHOST && mobj->fuse > 0 // Not guaranteed to be MF_SCENERY or not MF_SCENERY!
&& (signed)(mobj->frame >> FF_TRANSSHIFT) < (NUMTRANSMAPS-1) - mobj->fuse / 2)