Fix Sneakers in Battle

This commit is contained in:
TehRealSalt 2019-05-10 16:33:38 -04:00
parent 4801b57fa4
commit 5bacbe6222
2 changed files with 41 additions and 30 deletions

View file

@ -1306,7 +1306,7 @@ static fixed_t K_GetMobjWeight(mobj_t *mobj, mobj_t *against)
}
// This kind of wipeout happens with no rings -- doesn't remove a bumper, has no invulnerability, and is much shorter.
static void K_BumpWipeoutPlayer(player_t *player, INT32 length)
static void K_DebtStingPlayer(player_t *player, INT32 length)
{
if (player->health <= 0)
return;
@ -1493,7 +1493,7 @@ void K_KartBouncing(mobj_t *mobj1, mobj_t *mobj2, boolean bounce, boolean solid)
{
if (mobj1->player->kartstuff[k_rings] <= 0)
{
K_BumpWipeoutPlayer(mobj1->player, TICRATE + (4 * (mobj2->player->kartweight - mobj1->player->kartweight)));
K_DebtStingPlayer(mobj1->player, TICRATE + (4 * (mobj2->player->kartweight - mobj1->player->kartweight)));
K_KartPainEnergyFling(mobj1->player);
P_PlayRinglossSound(mobj1);
}
@ -1517,7 +1517,7 @@ void K_KartBouncing(mobj_t *mobj1, mobj_t *mobj2, boolean bounce, boolean solid)
{
if (mobj2->player->kartstuff[k_rings] <= 0)
{
K_BumpWipeoutPlayer(mobj2->player, TICRATE + (4 * (mobj1->player->kartweight - mobj2->player->kartweight)));
K_DebtStingPlayer(mobj2->player, TICRATE + (4 * (mobj1->player->kartweight - mobj2->player->kartweight)));
K_KartPainEnergyFling(mobj2->player);
P_PlayRinglossSound(mobj2);
}

View file

@ -1557,39 +1557,50 @@ static boolean PIT_CheckThing(mobj_t *thing)
return true;
}
if (P_IsObjectOnGround(thing) && tmthing->momz < 0)
{
K_KartBouncing(tmthing, thing, true, false);
if (G_BattleGametype() && tmthing->player->kartstuff[k_pogospring])
{
K_StealBumper(tmthing->player, thing->player, false);
K_SpinPlayer(thing->player, tmthing, 0, tmthing, false);
}
}
else if (P_IsObjectOnGround(tmthing) && thing->momz < 0)
{
K_KartBouncing(thing, tmthing, true, false);
if (G_BattleGametype() && thing->player->kartstuff[k_pogospring])
{
K_StealBumper(thing->player, tmthing->player, false);
K_SpinPlayer(tmthing->player, thing, 0, thing, false);
}
}
else
K_KartBouncing(tmthing, thing, false, false);
// The bump has to happen last
mobj_t *mo1 = tmthing;
mobj_t *mo2 = thing;
boolean zbounce = false;
if (G_BattleGametype())
{
if (thing->player->kartstuff[k_sneakertimer] && !(tmthing->player->kartstuff[k_sneakertimer]) && !(thing->player->powers[pw_flashing])) // Don't steal bumpers while intangible
if (P_IsObjectOnGround(thing) && tmthing->momz < 0)
{
K_StealBumper(thing->player, tmthing->player, false);
K_SpinPlayer(tmthing->player, thing, 0, tmthing, false);
zbounce = true;
mo1 = thing;
mo2 = tmthing;
if (G_BattleGametype() && tmthing->player->kartstuff[k_pogospring])
{
K_StealBumper(tmthing->player, thing->player, false);
K_SpinPlayer(thing->player, tmthing, 0, tmthing, false);
}
}
else if (tmthing->player->kartstuff[k_sneakertimer] && !(thing->player->kartstuff[k_sneakertimer]) && !(tmthing->player->powers[pw_flashing]))
else if (P_IsObjectOnGround(tmthing) && thing->momz < 0)
{
K_StealBumper(tmthing->player, thing->player, false);
K_SpinPlayer(thing->player, tmthing, 0, thing, false);
zbounce = true;
if (G_BattleGametype() && thing->player->kartstuff[k_pogospring])
{
K_StealBumper(thing->player, tmthing->player, false);
K_SpinPlayer(tmthing->player, thing, 0, thing, false);
}
}
if (G_BattleGametype())
{
if (thing->player->kartstuff[k_sneakertimer] && !(tmthing->player->kartstuff[k_sneakertimer]) && !(thing->player->powers[pw_flashing])) // Don't steal bumpers while intangible
{
K_StealBumper(thing->player, tmthing->player, false);
K_SpinPlayer(tmthing->player, thing, 0, tmthing, false);
}
else if (tmthing->player->kartstuff[k_sneakertimer] && !(thing->player->kartstuff[k_sneakertimer]) && !(tmthing->player->powers[pw_flashing]))
{
K_StealBumper(tmthing->player, thing->player, false);
K_SpinPlayer(thing->player, tmthing, 0, thing, false);
}
}
K_KartBouncing(mo1, mo2, zbounce, false);
}
return true;