mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-27 12:31:54 +00:00
Wavedash refinement
This commit is contained in:
parent
d9ef9514fa
commit
fcd1fe8b8b
2 changed files with 30 additions and 21 deletions
15
src/k_kart.c
15
src/k_kart.c
|
|
@ -4064,10 +4064,14 @@ void K_UpdateStumbleIndicator(player_t *player)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define MIN_WAVEDASH_CHARGE (5*TICRATE/8)
|
||||||
|
|
||||||
static boolean K_IsLosingSliptideZip(player_t *player)
|
static boolean K_IsLosingSliptideZip(player_t *player)
|
||||||
{
|
{
|
||||||
if (player->mo == NULL || P_MobjWasRemoved(player->mo) == true)
|
if (player->mo == NULL || P_MobjWasRemoved(player->mo) == true)
|
||||||
return true;
|
return true;
|
||||||
|
if (!K_Sliptiding(player) && player->sliptideZip < MIN_WAVEDASH_CHARGE)
|
||||||
|
return true;
|
||||||
if (!K_Sliptiding(player) && player->drift == 0
|
if (!K_Sliptiding(player) && player->drift == 0
|
||||||
&& P_IsObjectOnGround(player->mo) && player->sneakertimer == 0
|
&& P_IsObjectOnGround(player->mo) && player->sneakertimer == 0
|
||||||
&& player->driftboost == 0)
|
&& player->driftboost == 0)
|
||||||
|
|
@ -9393,6 +9397,8 @@ static void K_KartDrift(player_t *player, boolean onground)
|
||||||
K_SpawnAIZDust(player);
|
K_SpawnAIZDust(player);
|
||||||
|
|
||||||
player->sliptideZip++;
|
player->sliptideZip++;
|
||||||
|
if (player->sliptideZip == MIN_WAVEDASH_CHARGE)
|
||||||
|
S_StartSound(player->mo, sfx_cock);
|
||||||
|
|
||||||
if (abs(player->aizdrifttilt) < ANGLE_22h)
|
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);
|
S_StopSoundByID(player->mo, sfx_waved4);
|
||||||
player->sliptideZipDelay++;
|
player->sliptideZipDelay++;
|
||||||
if (player->sliptideZipDelay > TICRATE/2)
|
if (player->sliptideZipDelay > TICRATE/2)
|
||||||
|
{
|
||||||
|
if (player->sliptideZip >= MIN_WAVEDASH_CHARGE)
|
||||||
{
|
{
|
||||||
fixed_t maxZipPower = 2*FRACUNIT;
|
fixed_t maxZipPower = 2*FRACUNIT;
|
||||||
fixed_t minZipPower = 1*FRACUNIT;
|
fixed_t minZipPower = 1*FRACUNIT;
|
||||||
|
|
@ -9443,12 +9451,13 @@ static void K_KartDrift(player_t *player, boolean onground)
|
||||||
player->sliptideZipBoost += yourBoost;
|
player->sliptideZipBoost += yourBoost;
|
||||||
|
|
||||||
K_SpawnDriftBoostExplosion(player, 0);
|
K_SpawnDriftBoostExplosion(player, 0);
|
||||||
player->sliptideZip = 0;
|
S_StartSoundAtVolume(player->mo, sfx_waved3, 2*255/3); // Boost
|
||||||
player->sliptideZipDelay = 0;
|
}
|
||||||
S_StopSoundByID(player->mo, sfx_waved1);
|
S_StopSoundByID(player->mo, sfx_waved1);
|
||||||
S_StopSoundByID(player->mo, sfx_waved2);
|
S_StopSoundByID(player->mo, sfx_waved2);
|
||||||
S_StopSoundByID(player->mo, sfx_waved4);
|
S_StopSoundByID(player->mo, sfx_waved4);
|
||||||
S_StartSoundAtVolume(player->mo, sfx_waved3, 2*255/3); // Boost
|
player->sliptideZip = 0;
|
||||||
|
player->sliptideZipDelay = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
||||||
|
|
@ -2241,7 +2241,7 @@ static void P_UpdatePlayerAngle(player_t *player)
|
||||||
angle_t leniency = (2*ANG1/3) * min(player->cmd.latency, 6);
|
angle_t leniency = (2*ANG1/3) * min(player->cmd.latency, 6);
|
||||||
// Don't force another turning tic, just give them the desired angle!
|
// 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.
|
// We are where we need to be.
|
||||||
// ...Or we aren't, but shouldn't be able to steer.
|
// ...Or we aren't, but shouldn't be able to steer.
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue