From 089cffd900c7a9fcf1cdccad5416ddc8e60d3f42 Mon Sep 17 00:00:00 2001 From: Sally Coolatta Date: Wed, 22 Jul 2020 18:21:50 -0400 Subject: [PATCH] Recovery stat has risen from its grave Boost stacking potential is increased for low weight. Also changed order of operations so that flashing tics differences are more significant in Battle. --- src/k_kart.c | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index 8c0baac04..748ae4446 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -2025,9 +2025,18 @@ static fixed_t K_FlameShieldDashVar(INT32 val) return (3*FRACUNIT/4) + (((val * FRACUNIT) / TICRATE) / 2); } +// GAME OVER +// RETURN OF THE RECOVERY STAT FROM KARTZ +#define RETURN_OF_RECOVERY + // sets k_boostpower, k_speedboost, and k_accelboost to whatever we need it to be static void K_GetKartBoostPower(player_t *player) { +#ifdef RETURN_OF_RECOVERY + const fixed_t maxrecoveryincrease = FRACUNIT/2; + const fixed_t recovery = FRACUNIT - ((9-player->kartweight) * maxrecoveryincrease / 8); +#endif // RETURN_OF_RECOVERY + fixed_t boostpower = FRACUNIT; fixed_t speedboost = 0, accelboost = 0; UINT8 numboosts = 0; @@ -2045,12 +2054,24 @@ static void K_GetKartBoostPower(player_t *player) if (player->kartstuff[k_bananadrag] > TICRATE) boostpower = (4*boostpower)/5; +#ifdef RETURN_OF_RECOVERY + #define ADDBOOST(s,a) { \ numboosts++; \ - speedboost += (s) / numboosts; \ - accelboost += (a) / numboosts; \ + speedboost += FixedDiv(s, FRACUNIT + (recovery * numboosts-1)); \ + accelboost += FixedDiv(a, FRACUNIT + (recovery * numboosts-1)); \ } +#else + +#define ADDBOOST(s,a) { \ + numboosts++; \ + speedboost += s / numboosts; \ + accelboost += a / numboosts; \ +} + +#endif // RETURN_OF_RECOVERY + if (player->kartstuff[k_sneakertimer]) // Sneaker { UINT8 i; @@ -2195,11 +2216,11 @@ UINT16 K_GetKartFlashing(player_t *player) if (!player) return tics; + tics += (tics/8) * (player->kartspeed); + if (G_BattleGametype()) tics *= 2; - tics += (flashingtics/8) * (player->kartspeed); - return tics; }