Merge branch 'sliptide-improvements' into 'master'

Wavedash refinement

See merge request KartKrew/Kart!1040
This commit is contained in:
Sal 2023-03-13 02:54:55 +00:00
commit e70c23fe0f
4 changed files with 32 additions and 21 deletions

View file

@ -4064,10 +4064,14 @@ void K_UpdateStumbleIndicator(player_t *player)
}
}
#define MIN_WAVEDASH_CHARGE (5*TICRATE/8)
static boolean K_IsLosingSliptideZip(player_t *player)
{
if (player->mo == NULL || P_MobjWasRemoved(player->mo) == true)
return true;
if (!K_Sliptiding(player) && player->sliptideZip < MIN_WAVEDASH_CHARGE)
return true;
if (!K_Sliptiding(player) && player->drift == 0
&& P_IsObjectOnGround(player->mo) && player->sneakertimer == 0
&& player->driftboost == 0)
@ -9393,6 +9397,8 @@ static void K_KartDrift(player_t *player, boolean onground)
K_SpawnAIZDust(player);
player->sliptideZip++;
if (player->sliptideZip == MIN_WAVEDASH_CHARGE)
S_StartSound(player->mo, sfx_waved5);
if (abs(player->aizdrifttilt) < ANGLE_22h)
{
@ -9419,6 +9425,8 @@ static void K_KartDrift(player_t *player, boolean onground)
S_StopSoundByID(player->mo, sfx_waved4);
player->sliptideZipDelay++;
if (player->sliptideZipDelay > TICRATE/2)
{
if (player->sliptideZip >= MIN_WAVEDASH_CHARGE)
{
fixed_t maxZipPower = 2*FRACUNIT;
fixed_t minZipPower = 1*FRACUNIT;
@ -9443,12 +9451,13 @@ static void K_KartDrift(player_t *player, boolean onground)
player->sliptideZipBoost += yourBoost;
K_SpawnDriftBoostExplosion(player, 0);
player->sliptideZip = 0;
player->sliptideZipDelay = 0;
S_StartSoundAtVolume(player->mo, sfx_waved3, 2*255/3); // Boost
}
S_StopSoundByID(player->mo, sfx_waved1);
S_StopSoundByID(player->mo, sfx_waved2);
S_StopSoundByID(player->mo, sfx_waved4);
S_StartSoundAtVolume(player->mo, sfx_waved3, 2*255/3); // Boost
player->sliptideZip = 0;
player->sliptideZipDelay = 0;
}
}
else

View file

@ -2241,7 +2241,7 @@ static void P_UpdatePlayerAngle(player_t *player)
angle_t leniency = (2*ANG1/3) * min(player->cmd.latency, 6);
// Don't force another turning tic, just give them the desired angle!
if (targetDelta == angleChange || player->pflags & PF_DRIFTEND || (maxTurnRight == 0 && maxTurnLeft == 0))
if (targetDelta == angleChange || player->pflags & PF_DRIFTEND || K_Sliptiding(player) || (maxTurnRight == 0 && maxTurnLeft == 0))
{
// We are where we need to be.
// ...Or we aren't, but shouldn't be able to steer.

View file

@ -1135,6 +1135,7 @@ sfxinfo_t S_sfx[NUMSFX] =
{"waved2", false, 32, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
{"waved3", false, 32, 64, -1, NULL, 0, -1, -1, LUMPERROR, ""},
{"waved4", false, 32, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
{"waved5", false, 32, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
// Passing sounds
{"pass01", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},

View file

@ -1204,6 +1204,7 @@ typedef enum
sfx_waved2,
sfx_waved3,
sfx_waved4,
sfx_waved5,
// Passing sounds
sfx_pass01,