mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Merge branch 'shorter-turn-lockout' into 'master'
Adjust steering lock after successful DI See merge request KartKrew/Kart!602
This commit is contained in:
commit
7b64b07494
5 changed files with 16 additions and 7 deletions
|
|
@ -402,7 +402,7 @@ typedef struct player_s
|
|||
UINT8 justbumped; // Prevent players from endlessly bumping into each other
|
||||
UINT8 tumbleBounces;
|
||||
UINT16 tumbleHeight; // In *mobjscaled* fracunits, or mfu, not raw fu
|
||||
boolean justDI; // Directional Influence ended, true until letting go of turn
|
||||
UINT8 justDI; // Turn-lockout timer to briefly prevent unintended turning after DI, resets when actionable or no input
|
||||
boolean flipDI; // Bananas flip the DI direction. Was a bug, but it made bananas much more interesting.
|
||||
|
||||
SINT8 drift; // (-5 to 5) - Drifting Left or Right, plus a bigger counter = sharper turn
|
||||
|
|
|
|||
13
src/k_kart.c
13
src/k_kart.c
|
|
@ -7561,6 +7561,15 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
|
|||
if (player->instashield)
|
||||
player->instashield--;
|
||||
|
||||
if (player->justDI)
|
||||
{
|
||||
player->justDI--;
|
||||
|
||||
// return turning if player is fully actionable, no matter when!
|
||||
if (!P_PlayerInPain(player))
|
||||
player->justDI = 0;
|
||||
}
|
||||
|
||||
if (player->eggmanexplode)
|
||||
{
|
||||
if (player->spectator || (gametype == GT_BATTLE && !player->bumpers))
|
||||
|
|
@ -8296,7 +8305,7 @@ INT16 K_GetKartTurnValue(player_t *player, INT16 turnvalue)
|
|||
return 0;
|
||||
}
|
||||
|
||||
if (player->justDI == true)
|
||||
if (player->justDI > 0)
|
||||
{
|
||||
// No turning until you let go after DI-ing.
|
||||
return 0;
|
||||
|
|
@ -10496,7 +10505,7 @@ void K_HandleDirectionalInfluence(player_t *player)
|
|||
}
|
||||
|
||||
// DI attempted!!
|
||||
player->justDI = true;
|
||||
player->justDI = MAXHITLAGTICS;
|
||||
|
||||
cmd = &player->cmd;
|
||||
|
||||
|
|
|
|||
|
|
@ -239,7 +239,7 @@ static int player_get(lua_State *L)
|
|||
else if (fastcmp(field,"tumbleHeight"))
|
||||
lua_pushinteger(L, plr->tumbleHeight);
|
||||
else if (fastcmp(field,"justDI"))
|
||||
lua_pushboolean(L, plr->justDI);
|
||||
lua_pushinteger(L, plr->justDI);
|
||||
else if (fastcmp(field,"flipDI"))
|
||||
lua_pushboolean(L, plr->flipDI);
|
||||
else if (fastcmp(field,"drift"))
|
||||
|
|
@ -593,7 +593,7 @@ static int player_set(lua_State *L)
|
|||
else if (fastcmp(field,"tumbleHeight"))
|
||||
plr->tumbleHeight = luaL_checkinteger(L, 3);
|
||||
else if (fastcmp(field,"justDI"))
|
||||
plr->justDI = luaL_checkboolean(L, 3);
|
||||
plr->justDI = luaL_checkinteger(L, 3);
|
||||
else if (fastcmp(field,"flipDI"))
|
||||
plr->flipDI = luaL_checkboolean(L, 3);
|
||||
else if (fastcmp(field,"drift"))
|
||||
|
|
|
|||
|
|
@ -521,7 +521,7 @@ static void P_NetUnArchivePlayers(void)
|
|||
players[i].tumbleBounces = READUINT8(save_p);
|
||||
players[i].tumbleHeight = READUINT16(save_p);
|
||||
|
||||
players[i].justDI = (boolean)READUINT8(save_p);
|
||||
players[i].justDI = READUINT8(save_p);
|
||||
players[i].flipDI = (boolean)READUINT8(save_p);
|
||||
|
||||
players[i].drift = READSINT8(save_p);
|
||||
|
|
|
|||
|
|
@ -2142,7 +2142,7 @@ void P_MovePlayer(player_t *player)
|
|||
|
||||
if (cmd->turning == 0)
|
||||
{
|
||||
player->justDI = false;
|
||||
player->justDI = 0;
|
||||
}
|
||||
|
||||
// Kart frames
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue