Add K_MomentumThreshold, raise threshold for K_MomentumAngle to 6 FU, same as K_AirFailsafe

This commit is contained in:
James R 2023-03-22 15:41:19 -07:00
parent 54dd8b0252
commit 9b5db6fedb
2 changed files with 8 additions and 2 deletions

View file

@ -3485,9 +3485,14 @@ fixed_t K_3dKartMovement(player_t *player)
return finalspeed;
}
fixed_t K_MomentumThreshold(const mobj_t *mo)
{
return 6 * mo->scale;
}
angle_t K_MomentumAngle(mobj_t *mo)
{
if (FixedHypot(mo->momx, mo->momy) >= mo->scale)
if (FixedHypot(mo->momx, mo->momy) > K_MomentumThreshold(mo))
{
return R_PointToAngle2(0, 0, mo->momx, mo->momy);
}
@ -10076,7 +10081,7 @@ boolean K_FastFallBounce(player_t *player)
static void K_AirFailsafe(player_t *player)
{
const fixed_t maxSpeed = 6*player->mo->scale;
const fixed_t maxSpeed = K_MomentumThreshold(player->mo);
const fixed_t thrustSpeed = 6*player->mo->scale; // 10*player->mo->scale
if (player->speed > maxSpeed // Above the max speed that you're allowed to use this technique.

View file

@ -83,6 +83,7 @@ void K_KartPlayerHUDUpdate(player_t *player);
void K_KartResetPlayerColor(player_t *player);
void K_KartPlayerThink(player_t *player, ticcmd_t *cmd);
void K_KartPlayerAfterThink(player_t *player);
fixed_t K_MomentumThreshold(const mobj_t *mo);
angle_t K_MomentumAngle(mobj_t *mo);
void K_AddHitLag(mobj_t *mo, INT32 tics, boolean fromDamage);
void K_SetHitLagForObjects(mobj_t *mo1, mobj_t *mo2, INT32 tics, boolean fromDamage);