Power down straight-line wavedashes

This commit is contained in:
AJ Martinez 2025-05-01 23:35:37 -04:00
parent 7fa79fa64a
commit bc17a1dbb8
5 changed files with 25 additions and 2 deletions

View file

@ -1003,6 +1003,8 @@ struct player_t
UINT8 tripwireReboundDelay; // When failing Tripwire, brieftly lock out speed-based tripwire pass (anti-cheese)
UINT16 wavedash; // How long is our chained sliptide? Grant a proportional boost when it's over.
UINT16 wavedashleft;
UINT16 wavedashright;
UINT8 wavedashdelay; // How long since the last sliptide? Only boost once you've been straightened out for a bit.
UINT16 wavedashboost; // The actual boost granted from wavedash.
fixed_t wavedashpower; // Is this a bullshit "tap" wavedash? Weaken lower-charge wavedashes while keeping long sliptides fully rewarding.

View file

@ -11584,6 +11584,8 @@ static void K_KartDrift(player_t *player, boolean onground)
player->pflags &= ~(PF_BRAKEDRIFT|PF_GETSPARKS);
// And take away wavedash properties: advanced cornering demands advanced finesse
player->wavedash = 0;
player->wavedashleft = 0;
player->wavedashright = 0;
player->wavedashboost = 0;
player->trickcharge = 0;
}
@ -11736,7 +11738,12 @@ static void K_KartDrift(player_t *player, boolean onground)
// This makes wavedash charge noticeably slower on even modest delay, despite the magnitude of the turn seeming the same.
// So we only require 90% of a turn to get full charge strength.
player->wavedash += addCharge;
if (player->steering > 0)
player->wavedashleft += addCharge;
else
player->wavedashright += addCharge;
player->wavedash = max(player->wavedashleft, player->wavedashright) + min(player->wavedashleft, player->wavedashright)/4;
if (player->wavedash >= MIN_WAVEDASH_CHARGE && (player->wavedash - addCharge) < MIN_WAVEDASH_CHARGE)
S_StartSound(player->mo, sfx_waved5);
@ -11817,6 +11824,8 @@ static void K_KartDrift(player_t *player, boolean onground)
S_StopSoundByID(player->mo, sfx_waved2);
S_StopSoundByID(player->mo, sfx_waved4);
player->wavedash = 0;
player->wavedashleft = 0;
player->wavedashright = 0;
player->wavedashdelay = 0;
}
}

View file

@ -184,7 +184,7 @@ void K_DoIngameRespawn(player_t *player)
player->gateBoost = 0;
player->trickcharge = 0;
player->infinitether = 0;
player->wavedash = player->wavedashboost = player->wavedashdelay = 0;
player->wavedash = player -> wavedashleft = player->wavedashright = player->wavedashboost = player->wavedashdelay = 0;
K_TumbleInterrupt(player);
P_ResetPlayer(player);

View file

@ -370,6 +370,10 @@ static int player_get(lua_State *L)
lua_pushinteger(L, plr->eggmanTransferDelay);
else if (fastcmp(field,"wavedash"))
lua_pushinteger(L, plr->wavedash);
else if (fastcmp(field,"wavedashleft"))
lua_pushinteger(L, plr->wavedashleft);
else if (fastcmp(field,"wavedashright"))
lua_pushinteger(L, plr->wavedashright);
else if (fastcmp(field,"wavedashdelay"))
lua_pushinteger(L, plr->wavedashdelay);
else if (fastcmp(field,"wavedashboost"))
@ -974,6 +978,10 @@ static int player_set(lua_State *L)
plr->eggmanTransferDelay = luaL_checkinteger(L, 3);
else if (fastcmp(field,"wavedash"))
plr->wavedash = luaL_checkinteger(L, 3);
else if (fastcmp(field,"wavedashleft"))
plr->wavedashleft = luaL_checkinteger(L, 3);
else if (fastcmp(field,"wavedashright"))
plr->wavedashright = luaL_checkinteger(L, 3);
else if (fastcmp(field,"wavedashdelay"))
plr->wavedashdelay = luaL_checkinteger(L, 3);
else if (fastcmp(field,"wavedashboost"))

View file

@ -603,6 +603,8 @@ static void P_NetArchivePlayers(savebuffer_t *save)
WRITEUINT8(save->p, players[i].tripwireReboundDelay);
WRITEUINT16(save->p, players[i].wavedash);
WRITEUINT16(save->p, players[i].wavedashleft);
WRITEUINT16(save->p, players[i].wavedashright);
WRITEUINT8(save->p, players[i].wavedashdelay);
WRITEUINT16(save->p, players[i].wavedashboost);
WRITEUINT16(save->p, players[i].overdrive);
@ -1237,6 +1239,8 @@ static void P_NetUnArchivePlayers(savebuffer_t *save)
players[i].tripwireReboundDelay = READUINT8(save->p);
players[i].wavedash = READUINT16(save->p);
players[i].wavedashleft = READUINT16(save->p);
players[i].wavedashright = READUINT16(save->p);
players[i].wavedashdelay = READUINT8(save->p);
players[i].wavedashboost = READUINT16(save->p);
players[i].overdrive = READUINT16(save->p);