Spring/spindash grease & invincibility gives you slope resistence

This commit is contained in:
Sally Coolatta 2021-02-05 23:28:22 -05:00
parent e8774cf7b2
commit 7584274636
3 changed files with 9 additions and 1 deletions

View file

@ -2030,6 +2030,13 @@ boolean K_ApplyOffroad(player_t *player)
return true;
}
boolean K_SlopeResistance(player_t *player)
{
if (player->kartstuff[k_invincibilitytimer] || player->kartstuff[k_sneakertimer] || player->kartstuff[k_tiregrease])
return true;
return false;
}
static fixed_t K_FlameShieldDashVar(INT32 val)
{
// 1 second = 75% + 50% top speed

View file

@ -82,6 +82,7 @@ void K_StripItems(player_t *player);
void K_StripOther(player_t *player);
void K_MomentumToFacing(player_t *player);
boolean K_ApplyOffroad(player_t *player);
boolean K_SlopeResistance(player_t *player);
INT16 K_GetSpindashChargeTime(player_t *player);
fixed_t K_GetSpindashChargeSpeed(player_t *player);
fixed_t K_GetKartSpeedFromStat(UINT8 kartspeed);

View file

@ -1851,7 +1851,7 @@ static void P_3dMovement(player_t *player)
totalthrust.x = totalthrust.y = 0; // I forget if this is needed
totalthrust.z = FRACUNIT*P_MobjFlip(player->mo)/3; // A bit of extra push-back on slopes
if (player->kartstuff[k_sneakertimer] > 0)
if (K_SlopeResistance(player) == true)
{
totalthrust.z = -(totalthrust.z);
}