Merge branch 'invinc-shrink-nerfs' into 'master'

Grow/invinc tweakpass

Closes #1333

See merge request KartKrew/Kart!2321
This commit is contained in:
Oni 2024-05-01 01:06:38 +00:00
commit dc116bfccc
5 changed files with 25 additions and 5 deletions

View file

@ -982,6 +982,8 @@ struct player_t
UINT8 lastsafelap;
UINT8 lastsafecheatcheck;
UINT8 ignoreAirtimeLeniency; // We bubblebounced or otherwise did an airtime thing with control, powerup timers should still count down
fixed_t topAccel; // Reduced on straight wall collisions to give players extra recovery time
mobj_t *stumbleIndicator;

View file

@ -8947,7 +8947,7 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
}
}
if (player->invincibilitytimer && (onground == true || K_PowerUpRemaining(player, POWERUP_SMONITOR)))
if (player->invincibilitytimer && (player->ignoreAirtimeLeniency > 0 || onground == true || K_PowerUpRemaining(player, POWERUP_SMONITOR)))
player->invincibilitytimer--;
if (!player->invincibilitytimer)
@ -8983,7 +8983,7 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
if ((player->respawn.state == RESPAWNST_NONE) && player->growshrinktimer != 0)
{
if (player->growshrinktimer > 0 && onground == true)
if (player->growshrinktimer > 0 && (onground == true || player->ignoreAirtimeLeniency > 0))
player->growshrinktimer--;
if (player->growshrinktimer < 0)
player->growshrinktimer++;
@ -9009,6 +9009,9 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
player->finalfailsafe = 0;
}
if (player->ignoreAirtimeLeniency)
player->ignoreAirtimeLeniency--;
if (player->freeRingShooterCooldown && !player->mo->hitlag)
player->freeRingShooterCooldown--;
@ -11913,6 +11916,8 @@ boolean K_FastFallBounce(player_t *player)
fixed_t fallspeed = abs(player->fastfall);
P_InstaThrust(player->mo, player->mo->angle, 11*max(minspeed, fallspeed)/10);
player->ignoreAirtimeLeniency = max(player->ignoreAirtimeLeniency, TICRATE);
bounce += 3 * mapobjectscale;
}
else
@ -12559,12 +12564,13 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
if (ATTACK_IS_DOWN && !HOLDING_ITEM && NO_HYUDORO) // Doesn't hold your item slot hostage normally, so you're free to waste it if you have multiple
{
UINT32 behind = K_GetItemRouletteDistance(player, player->itemRoulette.playing);
UINT32 behindScaled = behind * TICRATE / 4000;
UINT32 behindScaled = behind * TICRATE / 4500;
behindScaled = min(behindScaled, 10*TICRATE);
K_DoInvincibility(player,
max(10u * TICRATE + behindScaled, player->invincibilitytimer + 5u*TICRATE));
max(7u * TICRATE + behindScaled, player->invincibilitytimer + 5u*TICRATE));
K_PlayPowerGloatSound(player->mo);
player->itemamount--;
player->botvars.itemconfirm = 0;
}

View file

@ -368,6 +368,8 @@ static int player_get(lua_State *L)
lua_pushinteger(L, plr->lastsafelap);
else if (fastcmp(field,"lastsafecheatcheck"))
lua_pushinteger(L, plr->lastsafecheatcheck);
else if (fastcmp(field,"ignoreairtimeleniency"))
lua_pushinteger(L, plr->ignoreAirtimeLeniency);
else if (fastcmp(field,"topaccel"))
lua_pushinteger(L, plr->topAccel);
else if (fastcmp(field,"instawhipcharge"))
@ -916,6 +918,8 @@ static int player_set(lua_State *L)
plr->lastsafelap = luaL_checkinteger(L, 3);
else if (fastcmp(field,"lastsafecheatcheck"))
plr->lastsafecheatcheck = luaL_checkinteger(L, 3);
else if (fastcmp(field,"ignoreairtimeleniency"))
plr->ignoreAirtimeLeniency = luaL_checkinteger(L, 3);
else if (fastcmp(field,"topaccel"))
plr->topAccel = luaL_checkinteger(L, 3);
else if (fastcmp(field,"instawhipcharge"))

View file

@ -23,6 +23,7 @@
#include "../z_zone.h"
#include "../k_waypoint.h"
#include "../music.h"
#include "../m_easing.h"
#define POHBEE_HOVER (128 << FRACBITS)
#define POHBEE_SPEED (128 << FRACBITS)
@ -569,7 +570,10 @@ boolean Obj_ShrinkLaserCollide(mobj_t *gun, mobj_t *victim)
K_RemoveGrowShrink(victim->player);
}
victim->player->growshrinktimer += 6*TICRATE;
UINT8 oldGrow = max(victim->player->growshrinktimer, 0);
fixed_t easePercent = min(oldGrow * 6*TICRATE / FRACUNIT, FRACUNIT);
victim->player->growshrinktimer += Easing_OutSine(easePercent, 6*TICRATE, 2*TICRATE);
S_StartSound(victim, sfx_kc5a);
if (victim->player->roundconditions.consecutive_grow_lasers < UINT8_MAX)

View file

@ -587,6 +587,8 @@ static void P_NetArchivePlayers(savebuffer_t *save)
WRITEUINT8(save->p, players[i].lastsafelap);
WRITEUINT8(save->p, players[i].lastsafecheatcheck);
WRITEUINT8(save->p, players[i].ignoreAirtimeLeniency);
WRITEFIXED(save->p, players[i].topAccel);
WRITEMEM(save->p, players[i].public_key, PUBKEYLENGTH);
@ -1183,6 +1185,8 @@ static void P_NetUnArchivePlayers(savebuffer_t *save)
players[i].lastsafelap = READUINT8(save->p);
players[i].lastsafecheatcheck = READUINT8(save->p);
players[i].ignoreAirtimeLeniency = READUINT8(save->p);
players[i].topAccel = READFIXED(save->p);
READMEM(save->p, players[i].public_key, PUBKEYLENGTH);