mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Bot friction amount is based on their speed
Similar to !1814 but it is eased into.
This commit is contained in:
parent
68ee84168c
commit
b8e3ac465e
1 changed files with 7 additions and 5 deletions
12
src/k_kart.c
12
src/k_kart.c
|
|
@ -11758,17 +11758,19 @@ fixed_t K_PlayerBaseFriction(const player_t *player, fixed_t original)
|
|||
}
|
||||
else if (K_PlayerUsesBotMovement(player) == true)
|
||||
{
|
||||
const fixed_t speedPercent = min(FRACUNIT, FixedDiv(player->speed, K_GetKartSpeed(player, false, false)));
|
||||
const fixed_t extraFriction = FixedMul(FixedMul(FRACUNIT >> 5, factor), speedPercent);
|
||||
|
||||
// A bit extra friction to help them without drifting.
|
||||
// Remove this line once they can drift.
|
||||
frict -= FixedMul(FRACUNIT >> 5, factor);
|
||||
frict -= extraFriction;
|
||||
|
||||
// Bots gain more traction as they rubberband.
|
||||
fixed_t traction_value = FixedMul(player->botvars.rubberband, max(FRACUNIT, K_BotMapModifier()));
|
||||
const fixed_t traction_value = FixedMul(player->botvars.rubberband, max(FRACUNIT, K_BotMapModifier()));
|
||||
if (traction_value > FRACUNIT)
|
||||
{
|
||||
const fixed_t extraFriction = FixedMul(FRACUNIT >> 5, factor);
|
||||
const fixed_t mul = traction_value - FRACUNIT;
|
||||
frict -= FixedMul(extraFriction, mul);
|
||||
const fixed_t traction_mul = traction_value - FRACUNIT;
|
||||
frict -= FixedMul(extraFriction, traction_mul);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue