Scale fast fall momentum with speed at time of trigger

Previous was 4x gravity. Now 3x at the lowest, scales up
to around 8x at 200% speed (can go further).
This commit is contained in:
James R 2023-03-13 20:09:38 -07:00
parent 94faf486fd
commit f390ff26ec
2 changed files with 12 additions and 1 deletions

View file

@ -9946,6 +9946,13 @@ static void K_KartSpindash(player_t *player)
// Update fastfall.
player->fastfall = player->mo->momz;
player->spindash = 0;
if (player->fastfallBase == 0)
{
// Factors 3D momentum.
player->fastfallBase = FixedHypot(player->speed, player->mo->momz);
}
return;
}
else if (player->fastfall != 0)

View file

@ -1148,7 +1148,11 @@ fixed_t P_GetMobjGravity(mobj_t *mo)
else if (mo->player->fastfall != 0)
{
// Fast falling
gravityadd *= 4;
const fixed_t unit = 64 * mapobjectscale;
const fixed_t mult = 3*FRACUNIT + (3 * FixedDiv(mo->player->fastfallBase, unit));
gravityadd = FixedMul(gravityadd, mult);
}
}
else