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
This commit is contained in:
Anonimus 2025-09-24 18:26:09 -04:00
parent 87337da97c
commit 5ea5b11902
2 changed files with 20 additions and 4 deletions

View file

@ -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)

View file

@ -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;