Merge remote-tracking branch 'origin/master' into stun

This commit is contained in:
Lach 2025-05-14 19:10:53 +10:00
commit 03f6b1cc17
9 changed files with 66 additions and 0 deletions

View file

@ -729,6 +729,8 @@ struct player_t
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.
UINT8 cangrabitems;
SINT8 drift; // (-5 to 5) - Drifting Left or Right, plus a bigger counter = sharper turn
fixed_t driftcharge; // Charge your drift so you can release a burst of speed
UINT16 driftboost; // (0 to 125 baseline) - Boost you get from drifting

View file

@ -2241,6 +2241,8 @@ void G_PlayerReborn(INT32 player, boolean betweenmaps)
UINT8 botdiffincrease;
boolean botrival;
boolean cangrabitems;
SINT8 xtralife;
uint8_t public_key[PUBKEYLENGTH];
@ -2342,6 +2344,8 @@ void G_PlayerReborn(INT32 player, boolean betweenmaps)
bot = players[player].bot;
botdifficulty = players[player].botvars.difficulty;
cangrabitems = players[player].cangrabitems;
botdiffincrease = players[player].botvars.diffincrease;
botrival = players[player].botvars.rival;
@ -2425,6 +2429,13 @@ void G_PlayerReborn(INT32 player, boolean betweenmaps)
bigwaypointgap = 0;
tallyactive = false;
cangrabitems = 0;
if (gametyperules & GTR_SPHERES
|| gametyperules & GTR_CATCHER
|| G_TimeAttackStart()
|| gametype == GT_TUTORIAL)
cangrabitems = EARLY_ITEM_FLICKER;
}
else
{
@ -2567,6 +2578,8 @@ void G_PlayerReborn(INT32 player, boolean betweenmaps)
p->charflags = charflags;
p->lastfakeskin = lastfakeskin;
p->cangrabitems = cangrabitems;
memcpy(players[player].availabilities, availabilities, sizeof(availabilities));
p->followitem = followitem;

View file

@ -4235,6 +4235,8 @@ void K_CheckpointCrossAward(player_t *player)
return;
player->exp += K_GetExpAdjustment(player);
if (!player->cangrabitems)
player->cangrabitems = 1;
K_AwardPlayerRings(player, (player->bot ? 20 : 10), true);
}
@ -9605,6 +9607,8 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
player->invincibilitytimer--;
}
if (player->cangrabitems && player->cangrabitems <= EARLY_ITEM_FLICKER)
player->cangrabitems++;
if (!player->invincibilitytimer)
player->invincibilityextensions = 0;

View file

@ -60,6 +60,8 @@ Make sure this matches the actual number of states
#define SCAMDIST (2000)
#define EARLY_ITEM_FLICKER (NUMTRANSMAPS)
// 2023-08-26 +ang20 to Sal's OG values to make them friendlier - Tyron
#define STUMBLE_STEEP_VAL (ANG60 + ANG20)
#define STUMBLE_STEEP_VAL_AIR (ANG30 + ANG10 + ANG20)

View file

@ -268,6 +268,8 @@ static int player_get(lua_State *L)
lua_pushinteger(L, plr->justDI);
else if (fastcmp(field,"flipdi"))
lua_pushboolean(L, plr->flipDI);
else if (fastcmp(field,"cangrabitems"))
lua_pushinteger(L, plr->cangrabitems);
else if (fastcmp(field,"analoginput"))
lua_pushboolean(L, plr->analoginput);
else if (fastcmp(field,"transfer"))
@ -884,6 +886,8 @@ static int player_set(lua_State *L)
plr->justDI = luaL_checkinteger(L, 3);
else if (fastcmp(field,"flipdi"))
plr->flipDI = luaL_checkboolean(L, 3);
else if (fastcmp(field,"cangrabitems"))
plr->cangrabitems = luaL_checkinteger(L, 3);
else if (fastcmp(field,"incontrol"))
plr->incontrol = luaL_checkinteger(L, 3);
else if (fastcmp(field,"progressivethrust"))

View file

@ -115,6 +115,38 @@ void Obj_RandomItemVisuals(mobj_t *mobj)
if (mobj->type != MT_RANDOMITEM)
return;
// Fade items in as we cross the first checkpoint, but don't touch their visibility otherwise!
if (!((mobj->flags & MF_NOCLIPTHING) || mobj->fuse))
{
UINT8 maxgrab = 0;
for (UINT8 i = 0; i <= r_splitscreen; i++)
{
maxgrab = max(maxgrab, players[displayplayers[i]].cangrabitems);
}
if (maxgrab == 0)
mobj->renderflags |= RF_DONTDRAW;
else
mobj->renderflags &= ~RF_DONTDRAW;
if (maxgrab > 0 && maxgrab <= EARLY_ITEM_FLICKER)
{
UINT8 maxtranslevel = NUMTRANSMAPS;
UINT8 trans = maxgrab;
if (trans > maxtranslevel)
trans = maxtranslevel;
trans = NUMTRANSMAPS - trans;
mobj->renderflags &= ~(RF_TRANSMASK);
if (trans != 0)
mobj->renderflags |= (trans << RF_TRANSSHIFT);
}
}
// Respawn flow, documented by a dumb asshole:
// P_TouchSpecialThing -> P_ItemPop sets fuse, NOCLIPTHING and DONTDRAW.
// P_FuseThink does visual flicker, and when fuse is 0, unsets NOCLIPTHING/DONTDRAW/etc...

View file

@ -128,6 +128,9 @@ boolean P_CanPickupItem(player_t *player, UINT8 weapon)
if (weapon != PICKUP_EGGBOX && player->instaWhipCharge)
return false;
if (weapon == PICKUP_ITEMBOX && !player->cangrabitems)
return false;
if (weapon == PICKUP_RINGORSPHERE)
{
if (player->stunned > 0)

View file

@ -461,6 +461,8 @@ static void P_NetArchivePlayers(savebuffer_t *save)
WRITEUINT8(save->p, players[i].justDI);
WRITEUINT8(save->p, players[i].flipDI);
WRITEUINT8(save->p, players[i].cangrabitems);
WRITESINT8(save->p, players[i].drift);
WRITEFIXED(save->p, players[i].driftcharge);
WRITEUINT16(save->p, players[i].driftboost);
@ -1101,6 +1103,8 @@ static void P_NetUnArchivePlayers(savebuffer_t *save)
players[i].justDI = READUINT8(save->p);
players[i].flipDI = (boolean)READUINT8(save->p);
players[i].cangrabitems = READUINT8(save->p);
players[i].drift = READSINT8(save->p);
players[i].driftcharge = READFIXED(save->p);
players[i].driftboost = READUINT16(save->p);

View file

@ -2359,6 +2359,8 @@ static void P_UpdatePlayerAngle(player_t *player)
angle_t targetAngle = (player->cmd.angle) << TICCMD_REDUCE;
angle_t targetDelta = targetAngle - (player->mo->angle);
#define SOLVERANGLECHEATS
#ifdef SOLVERANGLECHEATS
// Corrections via fake turn go through easing.
// That means undoing them takes the same amount of time as doing them.