diff --git a/src/d_player.h b/src/d_player.h index 9659340ed..e7beb4e22 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -696,6 +696,7 @@ struct player_t UINT8 gateSound; // Sound effect combo SINT8 aizdriftstrat; // (-1 to 1) - Let go of your drift while boosting? Helper for the SICK STRATZ (sliptiding!) you have just unlocked + SINT8 aizdriftextend; // Nonzero when you were sliptiding last tic, sign indicates direction. INT32 aizdrifttilt; INT32 aizdriftturn; diff --git a/src/k_kart.c b/src/k_kart.c index 0444d3c11..013a6939f 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -10533,20 +10533,21 @@ static void K_KartDrift(player_t *player, boolean onground) // No longer meet the conditions to sliptide? // We'll spot you the sliptide as long as you keep turning, but no charging wavedashes. - boolean keepsliptide = false; + boolean extendedSliptide = false; + // We don't meet sliptide conditions! if ((player->handleboost < (SLIPTIDEHANDLING/2)) || (!player->steering) || (!player->aizdriftstrat) || (player->steering > 0) != (player->aizdriftstrat > 0)) { - if (!player->drift && player->steering && player->aizdriftstrat && player->wavedash // If we were sliptiding last tic, - && (player->steering > 0) == (player->aizdriftstrat > 0) // we're steering in the right direction, + if (!player->drift && player->steering && player->aizdriftextend // If we were sliptiding last tic, + && (player->steering > 0) == (player->aizdriftextend > 0) // we're steering in the right direction, && player->speed >= K_GetKartSpeed(player, false, true)) // and we're above the threshold to spawn dust... { - keepsliptide = true; // Then keep your current sliptide, but note the behavior change for wavedash handling. + extendedSliptide = true; // Then keep your current sliptide, but note the behavior change for wavedash handling. } - else + else // Otherwise, update sliptide status as usual. { if (!player->drift) player->aizdriftstrat = 0; @@ -10558,16 +10559,22 @@ static void K_KartDrift(player_t *player, boolean onground) if (player->airtime > 2) // Arbitrary number. Small discontinuities due to Super Jank shouldn't thrash your handling properties. { player->aizdriftstrat = 0; - keepsliptide = false; + extendedSliptide = false; } + // If we're sliptiding, whether through an extension or otherwise, allow sliptide extensions next tic. + if (K_Sliptiding(player)) + player->aizdriftextend = player->aizdriftstrat; + else + player->aizdriftextend = 0; + if ((player->aizdriftstrat && !player->drift) - || (keepsliptide)) + || (extendedSliptide)) { K_SpawnAIZDust(player); - if (!keepsliptide) + if (!extendedSliptide) { // Give charge proportional to your angle. Sharp turns are rewarding, slow analog slides are not—remember, this is giving back the speed you gave up. UINT16 addCharge = FixedInt( @@ -10605,9 +10612,9 @@ static void K_KartDrift(player_t *player, boolean onground) player->aizdriftstrat = 0; */ - if (!K_Sliptiding(player) || keepsliptide) + if (!K_Sliptiding(player) || extendedSliptide) { - if (!keepsliptide && K_IsLosingWavedash(player) && player->wavedash > 0) + if (!extendedSliptide && K_IsLosingWavedash(player) && player->wavedash > 0) { if (player->wavedash > HIDEWAVEDASHCHARGE && !S_SoundPlaying(player->mo, sfx_waved2)) S_StartSoundAtVolume(player->mo, sfx_waved2, 255); // Losing combo time, going to boost diff --git a/src/lua_playerlib.c b/src/lua_playerlib.c index fbd93153a..d912e1fca 100644 --- a/src/lua_playerlib.c +++ b/src/lua_playerlib.c @@ -287,6 +287,8 @@ static int player_get(lua_State *L) lua_pushinteger(L, plr->gateSound); else if (fastcmp(field,"aizdriftstraft")) lua_pushinteger(L, plr->aizdriftstrat); + else if (fastcmp(field,"aizdriftextend")) + lua_pushinteger(L, plr->aizdriftextend); else if (fastcmp(field,"aizdrifttilt")) lua_pushinteger(L, plr->aizdrifttilt); else if (fastcmp(field,"aizdriftturn")) diff --git a/src/p_saveg.c b/src/p_saveg.c index 8a423f5ec..9c450c667 100644 --- a/src/p_saveg.c +++ b/src/p_saveg.c @@ -443,6 +443,7 @@ static void P_NetArchivePlayers(savebuffer_t *save) WRITEUINT8(save->p, players[i].gateSound); WRITESINT8(save->p, players[i].aizdriftstrat); + WRITESINT8(save->p, players[i].aizdriftextend); WRITEINT32(save->p, players[i].aizdrifttilt); WRITEINT32(save->p, players[i].aizdriftturn); @@ -1025,6 +1026,7 @@ static void P_NetUnArchivePlayers(savebuffer_t *save) players[i].gateSound = READUINT8(save->p); players[i].aizdriftstrat = READSINT8(save->p); + players[i].aizdriftextend = READSINT8(save->p); players[i].aizdrifttilt = READINT32(save->p); players[i].aizdriftturn = READINT32(save->p);