diff --git a/src/d_player.h b/src/d_player.h index 5fa9c3906..7f286400c 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -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. diff --git a/src/k_kart.c b/src/k_kart.c index 04077ef0c..e77361973 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -11583,6 +11583,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; } @@ -11735,7 +11737,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); @@ -11816,6 +11823,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; } } diff --git a/src/k_respawn.c b/src/k_respawn.c index 5e67044e9..d08c8d6c2 100644 --- a/src/k_respawn.c +++ b/src/k_respawn.c @@ -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); diff --git a/src/lua_playerlib.c b/src/lua_playerlib.c index 56636fd19..d706ac381 100644 --- a/src/lua_playerlib.c +++ b/src/lua_playerlib.c @@ -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")) diff --git a/src/p_saveg.cpp b/src/p_saveg.cpp index 51a1a94b9..224342b0c 100644 --- a/src/p_saveg.cpp +++ b/src/p_saveg.cpp @@ -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);