From 6c8db5bc0eaebaf63ab31c062afb79d300f34a78 Mon Sep 17 00:00:00 2001 From: AJ Martinez Date: Mon, 11 Mar 2024 17:54:25 -0700 Subject: [PATCH] Use gamespeed multiplier checks for "hard" difficulty behavior (4th Gear compatibility) --- src/k_kart.c | 9 ++++++++- src/p_slopes.c | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index 937339a25..a6a587e0b 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -422,6 +422,13 @@ fixed_t K_GetKartGameSpeedScalar(SINT8 value) // Hard = 118.75% // Nightmare = 137.5% ?!?! + // WARNING: This value is used instead of directly checking game speed in some + // cases, where hard difficulty breakpoints are needed, but compatibility with + // the "4th Gear" cheat seemed relevant. Sorry about the weird indirection! + // At the time of writing: + // K_UpdateOffroad (G3+ double offroad penalty speed) + // P_ButteredSlope (G1- Slope Assist) + if (cv_4thgear.value && !netgame && (!demo.playback || !demo.netgame) && !modeattacking) value = 3; @@ -1210,7 +1217,7 @@ static void K_UpdateOffroad(player_t *player) // If you are in offroad, a timer starts. if (offroadstrength) { - UINT8 offramp = (gamespeed == KARTSPEED_HARD ? 2 : 1); + UINT8 offramp = (K_GetKartGameSpeedScalar(gamespeed) > FRACUNIT ? 2 : 1); if (player->offroad < offroadstrength) player->offroad += offroadstrength * offramp / TICRATE; diff --git a/src/p_slopes.c b/src/p_slopes.c index ad6714acb..80b921f3a 100644 --- a/src/p_slopes.c +++ b/src/p_slopes.c @@ -1174,7 +1174,7 @@ void P_ButteredSlope(mobj_t *mo) // Easy / Battle: SUPER NERF slope climbs, so that they're usually possible without resources. // (New players suck at budgeting, and may not remember they have spindash / rings at all!) // Special exception for Tutorial because we're trying to teach slope mechanics there. - if (gamespeed == KARTSPEED_EASY && gametype != GT_TUTORIAL) + if (K_GetKartGameSpeedScalar(gamespeed) < FRACUNIT && gametype != GT_TUTORIAL) { // Same as above, but use facing angle: angle_t easyangle = mo->angle - mo->standingslope->xydirection;