From 5ea5b11902719226097188a7b0e7d3ac2341dc90 Mon Sep 17 00:00:00 2001 From: Anonimus Date: Wed, 24 Sep 2025 18:26:09 -0400 Subject: [PATCH] Bandaid: exaggerate AltInvinc legacy cluster distance checks Closes #89; this (hopefully) brings it more in line with the DtF checks Bagging may be a concern, not too sure yet --- src/k_kart.c | 19 +++++++++++++++++-- src/k_odds.c | 5 +++-- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index 3360c2778..b0764ca24 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -2329,10 +2329,13 @@ static fixed_t K_InvincibilityEasing(fixed_t x) min(FRACUNIT, FixedMul(u - FRACUNIT, FRACUNIT/4)), (INVINMIDTIME/10), (INVINMAXTIME/10)); } +// 2.5 * FRACUNIT +#define LEGACYALTINVINMUL 163840 UINT16 K_GetInvincibilityTime(player_t *player) { UINT32 i, pingame; + fixed_t distmul = FRACUNIT; if (K_GetKartInvinType() == KARTINVIN_LEGACY) return BASEINVINTIME; @@ -2351,12 +2354,24 @@ UINT16 K_GetInvincibilityTime(player_t *player) } if (pingame <= 1) - return BASEINVINTIME; + { + return BASEINVINTIME; + } - fixed_t clustermul = K_InvincibilityEasing(player->distancefromcluster); + if (K_UsingLegacyCheckpoints() && !(gametype == GT_BATTLE)) + { + // Legacy waypointing is janky and finicky, so tack on a safety-net multiplier. + // If an invincible player gets ahead of the cluster player, bottlenecking activates + // regardless. + distmul = LEGACYALTINVINMUL; + } + + fixed_t clustermul = K_InvincibilityEasing(FixedMul(player->distancefromcluster,distmul)); return FixedMul(BASEINVINTIME, clustermul); } +#undef LEGACYALTINVINMUL + static fixed_t K_GetInvincibilitySpeed(UINT16 time) { if (K_GetKartInvinType() == KARTINVIN_LEGACY) diff --git a/src/k_odds.c b/src/k_odds.c index 984211800..e191fad79 100644 --- a/src/k_odds.c +++ b/src/k_odds.c @@ -719,8 +719,9 @@ INT32 K_KartGetLegacyItemOdds(UINT8 pos, SINT8 item, fixed_t clusterDist, fixed_ // Nonetheless, apply the start cooldown. cooldownOnStart = true; - // Unique odds for Invincibility. - newodds = K_KartGetInvincibilityOdds(clusterDist); + // Unique odds for Invincibility. In legacy waypointing, + // its odds are doubled. + newodds = K_KartGetInvincibilityOdds(clusterDist) * 2; newodds *= BASEODDSMUL; break;