Merge branch 'easy-balance' into 'master'

Changes for different game speeds

See merge request KartKrew/Kart!1039
This commit is contained in:
Oni 2023-03-12 09:33:31 +00:00
commit 0f303100d4
2 changed files with 32 additions and 9 deletions

View file

@ -2138,7 +2138,19 @@ void G_Ticker(boolean run)
{
if (playeringame[i])
{
K_PlayerLoseLife(&players[i]);
if (players[i].bot == true && grandprixinfo.gp == true && grandprixinfo.masterbots == false)
{
players[i].botvars.difficulty--;
if (players[i].botvars.difficulty < 1)
{
players[i].botvars.difficulty = 1;
}
}
else
{
K_PlayerLoseLife(&players[i]);
}
}
}

View file

@ -1112,13 +1112,18 @@ void P_HandleSlopeLanding(mobj_t *thing, pslope_t *slope)
// Handles sliding down slopes, like if they were made of butter :)
void P_ButteredSlope(mobj_t *mo)
{
fixed_t thrust;
const fixed_t gameSpeed = K_GetKartGameSpeedScalar(gamespeed);
fixed_t thrust = 0;
if (mo->flags & (MF_NOCLIPHEIGHT|MF_NOGRAVITY))
{
return; // don't slide down slopes if you can't touch them or you're not affected by gravity
}
if (P_CanApplySlopePhysics(mo, mo->standingslope) == false)
{
return; // No physics, no butter.
}
if (mo->player != NULL)
{
@ -1141,17 +1146,23 @@ void P_ButteredSlope(mobj_t *mo)
thrust = FINESINE(mo->standingslope->zangle>>ANGLETOFINESHIFT) * 5 / 4 * (mo->eflags & MFE_VERTICALFLIP ? 1 : -1);
if (mo->player) {
if (mo->momx || mo->momy)
{
fixed_t mult = FRACUNIT;
if (mo->momx || mo->momy) {
angle_t angle = R_PointToAngle2(0, 0, mo->momx, mo->momy) - mo->standingslope->xydirection;
angle_t angle = R_PointToAngle2(0, 0, mo->momx, mo->momy) - mo->standingslope->xydirection;
if (P_MobjFlip(mo) * mo->standingslope->zdelta < 0)
angle ^= ANGLE_180;
mult = FRACUNIT + (FRACUNIT + FINECOSINE(angle>>ANGLETOFINESHIFT))*4/3;
if (P_MobjFlip(mo) * mo->standingslope->zdelta < 0)
{
angle ^= ANGLE_180;
}
// Make uphill easier to climb, and downhill even faster.
mult = FINECOSINE(angle >> ANGLETOFINESHIFT);
// Make relative to game speed
mult = FixedMul(mult, gameSpeed);
mult = FRACUNIT + (FRACUNIT + mult)*4/3;
thrust = FixedMul(thrust, mult);
}