Merge branch 'adjust-garden-top' into 'master'

Adjust Garden Top physics

See merge request KartKrew/Kart!890
This commit is contained in:
Oni 2023-01-17 06:24:10 +00:00
commit 892a19c85f
4 changed files with 45 additions and 6 deletions

View file

@ -3386,7 +3386,7 @@ fixed_t K_GetNewSpeed(player_t *player)
if (player->curshield == KSHIELD_TOP)
{
p_speed = 11 * p_speed / 10;
p_speed = 15 * p_speed / 10;
}
if (K_PlayerUsesBotMovement(player) == true && player->botvars.rubberband > 0)
@ -9873,7 +9873,9 @@ void K_AdjustPlayerFriction(player_t *player)
player->mo->friction += ((FRACUNIT - prevfriction) / greasetics) * player->tiregrease;
}
if (player->curshield == KSHIELD_TOP)
// Less friction on Top unless grinding
if (player->curshield == KSHIELD_TOP &&
K_GetForwardMove(player) > 0)
{
player->mo->friction += 1024;
}

View file

@ -661,6 +661,42 @@ static void K_DropDashWait(player_t *player)
}
/*--------------------------------------------------
static boolean K_CanDropDash(player_t *player)
Checks if you can use the Drop Dash maneuver.
Input Arguments:-
player - Player to check.
Return:-
Whether a Drop Dash should be allowed.
--------------------------------------------------*/
static boolean K_CanDropDash(player_t *player)
{
const UINT16 buttons = K_GetKartButtons(player);
if (!(buttons & BT_ACCELERATE))
{
return false;
}
// Since we're letting players spin out on respawn, don't let them charge a dropdash in this state. (It wouldn't work anyway)
if (player->spinouttimer)
{
return false;
}
// Garden Top is overpowered enough
if (player->curshield == KSHIELD_TOP)
{
return false;
}
return true;
}
/*--------------------------------------------------
static void K_HandleDropDash(player_t *player)
@ -699,7 +735,7 @@ static void K_HandleDropDash(player_t *player)
// The old behavior was stupid and prone to accidental usage.
// Let's rip off Mania instead, and turn this into a Drop Dash!
if ((buttons & BT_ACCELERATE) && !player->spinouttimer) // Since we're letting players spin out on respawn, don't let them charge a dropdash in this state. (It wouldn't work anyway)
if (K_CanDropDash(player))
{
player->respawn.dropdash++;
}

View file

@ -1134,7 +1134,7 @@ fixed_t P_GetMobjGravity(mobj_t *mo)
if (K_IsHoldingDownTop(mo->player))
{
gravityadd = (5*gravityadd)/2;
gravityadd *= 3;
}
else if (mo->player->fastfall != 0)
{

View file

@ -2017,14 +2017,15 @@ static void P_3dMovement(player_t *player)
if (onground && player->curshield == KSHIELD_TOP && (K_GetKartButtons(player) & BT_DRIFT) != BT_DRIFT && (player->oldcmd.buttons & BT_DRIFT))
{
const fixed_t gmin = FRACUNIT/4;
const fixed_t gmax = 5*FRACUNIT/2;
const fixed_t gmax = 3*FRACUNIT;
const fixed_t grindfactor = (gmax - gmin) / GARDENTOP_MAXGRINDTIME;
const fixed_t grindscale = gmin + (player->topdriftheld * grindfactor);
const fixed_t speed = R_PointToDist2(0, 0, player->mo->momx, player->mo->momy);
const fixed_t minspeed = 3 * K_GetKartSpeed(player, false, false) / 5; // 60% top speed
P_InstaThrust(player->mo, player->mo->angle, FixedMul(speed, grindscale));
P_InstaThrust(player->mo, player->mo->angle, FixedMul(max(speed, minspeed), grindscale));
player->topdriftheld = 0;/* reset after release */
}