Merge branch 'jartha/fix-gimmick-control' into 'master'

Fix Turbines and Ice Cubes being considered pain states; fix Aerial Highlands clouds taking away drift charge

Closes #1465, #1428, #1368, and #1186

See merge request kart-krew-dev/ring-racers-internal!2584
This commit is contained in:
Oni VelocitOni 2025-06-04 00:44:38 +00:00
commit 4f1a8104e1
4 changed files with 21 additions and 6 deletions

View file

@ -15710,6 +15710,12 @@ void K_MakeObjectReappear(mobj_t *mo)
boolean K_PlayerCanUseItem(player_t *player)
{
if (player->icecube.frozen)
return false;
if (player->turbine && (player->mo->flags & MF_NOCLIP))
return false;
return (player->mo->health > 0 && !player->spectator && !P_PlayerInPain(player) && !mapreset && leveltime > introtime);
}

View file

@ -17,6 +17,7 @@
#include "../s_sound.h"
#include "../r_main.h"
#include "../m_random.h"
#include "../k_hitlag.h"
#define BULB_ZTHRUST 96*FRACUNIT
@ -143,7 +144,6 @@ void Obj_PlayerCloudThink(player_t *player)
if (player->cloud)
{
player->cloud--;
P_InstaThrust(mo, 0, 0);
mo->momz = 0;
player->fastfall = 0;
@ -157,6 +157,7 @@ void Obj_PlayerCloudThink(player_t *player)
player->cloudlaunch = TICRATE;
P_InstaThrust(mo, mo->cusval, mo->cvmem);
K_AddHitLag(mo, 6, false);
}
}
}

View file

@ -237,7 +237,6 @@ void Obj_playerWPZTurbine(player_t *p)
if (mode && !distreached)
p->turbineangle = (INT32)R_PointToAngle2(t->x, t->y, pmo->x, pmo->y);
p->spinouttimer = TICRATE;
pmo->pitch = 0;
// determine target x/y/z
@ -344,7 +343,6 @@ void Obj_playerWPZTurbine(player_t *p)
pmo->momy = (pmo->momy*17)/10;
}
p->spinouttimer = 0;
pmo->flags &= ~MF_NOCLIP;
}
}

View file

@ -405,7 +405,7 @@ UINT8 P_FindHighestLap(void)
//
boolean P_PlayerInPain(const player_t *player)
{
if (player->spinouttimer || (player->tumbleBounces > 0) || (player->pflags & PF_FAULT) || player->icecube.frozen)
if (player->spinouttimer || (player->tumbleBounces > 0) || (player->pflags & PF_FAULT))
return true;
return false;
@ -2539,9 +2539,19 @@ void P_MovePlayer(player_t *player)
player->glanceDir = 0;
player->pflags &= ~PF_GAINAX;
}
else if ((player->pflags & PF_FAULT) || (player->spinouttimer > 0))
else if ((player->pflags & PF_FAULT) || (player->spinouttimer > 0) || (player->turbine && (player->mo->flags & MF_NOCLIP)))
{
UINT16 speed = ((player->pflags & PF_FAULT) ? player->nocontrol : player->spinouttimer)/8;
tic_t timer = 0;
if ((player->pflags & PF_FAULT))
timer = player->nocontrol;
else if (player->spinouttimer > 0)
timer = player->spinouttimer;
else if (player->turbine && (player->mo->flags & MF_NOCLIP))
timer = TICRATE;
UINT16 speed = timer / 8;
if (speed > 8)
speed = 8;
else if (speed < 1)