diff --git a/src/k_kart.c b/src/k_kart.c index 6094391e6..eacbf47c8 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -2678,6 +2678,30 @@ boolean K_SlopeResistance(player_t *player) return false; } +fixed_t K_PlayerTripwireSpeedThreshold(player_t *player) +{ + fixed_t required_speed = 2 * K_GetKartSpeed(player, false, false); // 200% + + if (player->offroad && K_ApplyOffroad(player)) + { + // Increase to 300% if you're lawnmowering. + required_speed = (required_speed * 3) / 2; + } + + if (player->botvars.rubberband > FRACUNIT && K_PlayerUsesBotMovement(player) == true) + { + // Make it harder for bots to do this when rubberbanding. + + // This is actually biased really hard against the bot, + // because the bot rubberbanding speed increase is + // decreased with other boosts. + + required_speed = FixedMul(required_speed, player->botvars.rubberband); + } + + return required_speed; +} + tripwirepass_t K_TripwirePassConditions(player_t *player) { if ( @@ -2688,7 +2712,7 @@ tripwirepass_t K_TripwirePassConditions(player_t *player) if ( player->flamedash || - (player->speed > 2 * K_GetKartSpeed(player, false, false) && player->tripwireReboundDelay == 0) + ((player->speed > K_PlayerTripwireSpeedThreshold(player)) && player->tripwireReboundDelay == 0) ) return TRIPWIRE_BOOST; diff --git a/src/k_kart.h b/src/k_kart.h index 4879e5fff..3b346fd4c 100644 --- a/src/k_kart.h +++ b/src/k_kart.h @@ -106,6 +106,7 @@ void K_StripOther(player_t *player); void K_MomentumToFacing(player_t *player); boolean K_ApplyOffroad(player_t *player); boolean K_SlopeResistance(player_t *player); +fixed_t K_PlayerTripwireSpeedThreshold(player_t *player); tripwirepass_t K_TripwirePassConditions(player_t *player); boolean K_TripwirePass(player_t *player); boolean K_MovingHorizontally(player_t *player);