Merge branch 'further-sting-leniency' into 'master'

Don't sting just after using rings

See merge request kart-krew-dev/ring-racers-internal!2905
This commit is contained in:
AJ Martinez 2025-09-26 21:29:21 +00:00
commit d5fc805cbd
5 changed files with 14 additions and 2 deletions

View file

@ -801,6 +801,8 @@ struct player_t
fixed_t spindashspeed; // Spindash release speed
UINT8 spindashboost; // Spindash release boost timer
UINT8 ringboostinprogress; // Ring overhead, don't sting!
fixed_t fastfall; // Fast fall momentum
fixed_t fastfallBase; // Fast fall base speed multiplier

View file

@ -1328,7 +1328,7 @@ boolean K_PvPTouchDamage(mobj_t *t1, mobj_t *t2)
bool stung = false;
if (RINGTOTAL(t2->player) <= 0 && t2->health == 1 && !(t2->player->pflags2 & PF2_UNSTINGABLE))
if (RINGTOTAL(t2->player) <= 0 && t2->player->ringboostinprogress == 0 && t2->health == 1 && !(t2->player->pflags2 & PF2_UNSTINGABLE))
{
P_DamageMobj(t2, t1, t1, 1, DMG_STING|DMG_WOMBO);
// CONS_Printf("T2 stung\n");

View file

@ -9975,7 +9975,7 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
// Race: spawn ring debt indicator
// Battle: spawn zero-bumpers indicator
if (!(player->pflags2 & PF2_UNSTINGABLE) && ((gametyperules & GTR_SPHERES) ? player->mo->health <= 1 : RINGTOTAL(player) <= 0))
if (!(player->pflags2 & PF2_UNSTINGABLE) && player->ringboostinprogress == 0 && ((gametyperules & GTR_SPHERES) ? player->mo->health <= 1 : RINGTOTAL(player) <= 0))
{
UINT8 doubler;
@ -10748,6 +10748,9 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
}
}
if (player->ringboostinprogress)
player->ringboostinprogress--;
if (player->baildrop)
{
// freeze the stunned timer while baildrop is active
@ -15041,6 +15044,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
{
P_SetOrigin(ring, ring->x, ring->y, ring->z);
ring->extravalue1 = 1;
player->ringboostinprogress = 25;
}

View file

@ -347,6 +347,8 @@ static int player_get(lua_State *L)
lua_pushinteger(L, plr->spindashspeed);
else if (fastcmp(field,"spindashboost"))
lua_pushinteger(L, plr->spindashboost);
else if (fastcmp(field,"ringboostinprogress"))
lua_pushinteger(L, plr->ringboostinprogress);
else if (fastcmp(field,"fastfall"))
lua_pushfixed(L, plr->fastfall);
else if (fastcmp(field,"fastfallbase"))
@ -1012,6 +1014,8 @@ static int player_set(lua_State *L)
plr->spindashspeed = luaL_checkinteger(L, 3);
else if (fastcmp(field,"spindashboost"))
plr->spindashboost = luaL_checkinteger(L, 3);
else if (fastcmp(field,"ringboostinprogress"))
plr->ringboostinprogress = luaL_checkinteger(L, 3);
else if (fastcmp(field,"fastfall"))
plr->fastfall = luaL_checkfixed(L, 3);
else if (fastcmp(field,"fastfallbase"))

View file

@ -512,6 +512,7 @@ static void P_NetArchivePlayers(savebuffer_t *save)
WRITEUINT16(save->p, players[i].spindash);
WRITEFIXED(save->p, players[i].spindashspeed);
WRITEUINT8(save->p, players[i].spindashboost);
WRITEUINT8(save->p, players[i].ringboostinprogress);
WRITEFIXED(save->p, players[i].fastfall);
WRITEFIXED(save->p, players[i].fastfallBase);
@ -1191,6 +1192,7 @@ static void P_NetUnArchivePlayers(savebuffer_t *save)
players[i].spindash = READUINT16(save->p);
players[i].spindashspeed = READFIXED(save->p);
players[i].spindashboost = READUINT8(save->p);
players[i].ringboostinprogress = READUINT8(save->p);
players[i].fastfall = READFIXED(save->p);
players[i].fastfallBase = READFIXED(save->p);