mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Shrinking animation
This commit is contained in:
parent
9ed7bf7626
commit
0afc901d1f
2 changed files with 26 additions and 38 deletions
28
src/k_kart.c
28
src/k_kart.c
|
|
@ -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]);
|
||||
|
|
@ -4261,26 +4258,15 @@ static void K_DoShrink(player_t *user)
|
|||
if (mobj->target && mobj->target->player)
|
||||
{
|
||||
if (mobj->target->player->kartstuff[k_position] > user->kartstuff[k_position])
|
||||
continue; // this guy's behind us, don't take his stuff away!
|
||||
continue; // this guy's behind us, don't take his stuff away!
|
||||
}
|
||||
}
|
||||
|
||||
// @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;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -9342,17 +9328,17 @@ static void K_drawKartWanted(void)
|
|||
return;
|
||||
|
||||
// set X/Y coords depending on splitscreen.
|
||||
if (splitscreen < 3) // 1P and 2P use the same code.
|
||||
if (splitscreen < 3) // 1P and 2P use the same code.
|
||||
{
|
||||
basex = WANT_X;
|
||||
basey = WANT_Y;
|
||||
if (splitscreen == 2)
|
||||
{
|
||||
basey += 16; // slight adjust for 3P
|
||||
basey += 16; // slight adjust for 3P
|
||||
basex -= 6;
|
||||
}
|
||||
}
|
||||
else if (splitscreen == 3) // 4P splitscreen...
|
||||
else if (splitscreen == 3) // 4P splitscreen...
|
||||
{
|
||||
basex = BASEVIDWIDTH/2 - (SHORT(kp_wantedsplit->width)/2); // center on screen
|
||||
basey = BASEVIDHEIGHT - 55;
|
||||
|
|
|
|||
36
src/p_mobj.c
36
src/p_mobj.c
|
|
@ -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,16 +6874,25 @@ 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)
|
||||
{
|
||||
case MT_EGGMOBILE_FIRE:
|
||||
mobj->destscale = FRACUNIT;
|
||||
mobj->scalespeed = FRACUNIT>>4;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
P_RemoveMobj(mobj);
|
||||
return;
|
||||
}
|
||||
|
||||
switch (mobj->type)
|
||||
{
|
||||
case MT_EGGMOBILE_FIRE:
|
||||
mobj->destscale = FRACUNIT;
|
||||
mobj->scalespeed = FRACUNIT>>4;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (mobj->type == MT_GHOST && mobj->fuse > 0 // Not guaranteed to be MF_SCENERY or not MF_SCENERY!
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue