Spinout should be affected by friction and offroad.

This commit is contained in:
Latapostrophe 2019-07-13 13:44:09 +02:00
parent c96f5dba0c
commit 8b122e63d4
2 changed files with 11 additions and 4 deletions

View file

@ -2117,6 +2117,7 @@ void K_SpinPlayer(player_t *player, mobj_t *source, INT32 type, mobj_t *inflicto
if (player->kartstuff[k_spinouttype] <= 0) // type 0 is spinout, type 1 is wipeout if (player->kartstuff[k_spinouttype] <= 0) // type 0 is spinout, type 1 is wipeout
{ {
// At spinout, player speed is increased to 1/4 their regular speed, moving them forward // At spinout, player speed is increased to 1/4 their regular speed, moving them forward
if (player->speed < K_GetKartSpeed(player, true)/4) if (player->speed < K_GetKartSpeed(player, true)/4)
P_InstaThrust(player->mo, player->mo->angle, FixedMul(K_GetKartSpeed(player, true)/4, player->mo->scale)); P_InstaThrust(player->mo, player->mo->angle, FixedMul(K_GetKartSpeed(player, true)/4, player->mo->scale));
S_StartSound(player->mo, sfx_slip); S_StartSound(player->mo, sfx_slip);
@ -5812,14 +5813,19 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
player->mo->movefactor = 32; player->mo->movefactor = 32;
} }
// Wipeout slowdown // Wipeout slowdown and banana slowdown in offroad (make sure this doesn't apply if we're boosting, however.)
if (player->kartstuff[k_spinouttimer] && player->kartstuff[k_wipeoutslow]) if ((player->kartstuff[k_spinouttimer] || player->kartstuff[k_wipeoutslow]) && !player->kartstuff[k_sneakertimer])
{ {
if (player->kartstuff[k_offroad]) if (player->kartstuff[k_offroad])
player->mo->friction -= 4912; player->mo->friction -= 4912;
if (player->kartstuff[k_wipeoutslow] == 1) if (player->kartstuff[k_wipeoutslow] == 1)
player->mo->friction -= 9824; player->mo->friction -= 9824;
} }
// Band-aid to make sure we never get any weird shit (tm) happening on us.
if (player->mo->friction < 0)
player->mo->friction = 0;
} }
K_KartDrift(player, onground); K_KartDrift(player, onground);

View file

@ -1908,7 +1908,8 @@ void P_XYMovement(mobj_t *mo)
if (mo->type == MT_ORBINAUT || mo->type == MT_JAWZ_DUD || mo->type == MT_JAWZ || mo->type == MT_BALLHOG) //(mo->type == MT_JAWZ && !mo->tracer)) if (mo->type == MT_ORBINAUT || mo->type == MT_JAWZ_DUD || mo->type == MT_JAWZ || mo->type == MT_BALLHOG) //(mo->type == MT_JAWZ && !mo->tracer))
return; return;
if (mo->player && (mo->player->kartstuff[k_spinouttimer] && !mo->player->kartstuff[k_wipeoutslow]) && mo->player->speed <= K_GetKartSpeed(mo->player, false)/2) // hey maybe we should check for offroad as well before ignoring literally all friction ever
if (mo->player && (mo->player->kartstuff[k_spinouttimer] && !mo->player->kartstuff[k_offroad] && !mo->player->kartstuff[k_wipeoutslow]) && mo->player->speed <= K_GetKartSpeed(mo->player, false)/4)
return; return;
//} //}