Change bounce behavior

- Always allow bounce after fast fall
- Allow for more bounces
- Lose speed on bounces that don't reach max
This commit is contained in:
Sally Coolatta 2022-09-05 10:54:16 -04:00
parent 1eb1309032
commit eb7e2287c4

View file

@ -9311,20 +9311,28 @@ static void K_KartSpindash(player_t *player)
{
// Handle fastfall bounce.
const fixed_t maxBounce = player->mo->scale * 10;
const fixed_t minBounce = player->mo->scale * 2;
fixed_t bounce = abs(player->fastfall) / 4;
const fixed_t minBounce = player->mo->scale;
fixed_t bounce = 2 * abs(player->fastfall) / 3;
if (bounce > maxBounce)
{
bounce = maxBounce;
}
if (bounce > minBounce)
else
{
S_StartSound(player->mo, sfx_ffbonc);
player->mo->momz = bounce * P_MobjFlip(player->mo);
// Lose speed on bad bounce.
player->mo->momx /= 2;
player->mo->momy /= 2;
if (bounce < minBounce)
{
bounce = minBounce;
}
}
S_StartSound(player->mo, sfx_ffbonc);
player->mo->momz = bounce * P_MobjFlip(player->mo);
player->fastfall = 0;
return;
}