mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
E-Braking on ground: cancels Insta-Whip
- Lets you keep your Whip while fast-falling. - Make sure Insta-Whip can't interrupt Guard and vice-versa.
This commit is contained in:
parent
9d0b29b73d
commit
94aea179ed
1 changed files with 18 additions and 4 deletions
22
src/k_kart.c
22
src/k_kart.c
|
|
@ -8582,9 +8582,6 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
|
|||
S_StartSound(player->mo, sfx_s1af);
|
||||
|
||||
player->oldGuard = true;
|
||||
|
||||
if (!K_PowerUpRemaining(player, POWERUP_BARRIER))
|
||||
player->instaWhipCharge = 0;
|
||||
}
|
||||
else if (player->oldGuard)
|
||||
{
|
||||
|
|
@ -10827,6 +10824,11 @@ boolean K_PlayerGuard(const player_t *player)
|
|||
return true;
|
||||
}
|
||||
|
||||
if (player->instaWhipCharge != 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (player->spheres == 0)
|
||||
return false;
|
||||
|
||||
|
|
@ -11676,7 +11678,19 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
|
|||
player->instaWhipCharge = 0;
|
||||
}
|
||||
|
||||
if (chargingwhip)
|
||||
if (chargingwhip && K_PressingEBrake(player))
|
||||
{
|
||||
// 1) E-braking on the ground: cancels Insta-Whip.
|
||||
// Still lets you keep your Whip while fast-falling.
|
||||
// 2) Do not interrupt Guard.
|
||||
if (P_IsObjectOnGround(player->mo) || K_PlayerGuard(player))
|
||||
{
|
||||
if (player->instaWhipCharge)
|
||||
player->defenseLockout = PUNISHWINDOW;
|
||||
player->instaWhipCharge = 0;
|
||||
}
|
||||
}
|
||||
else if (chargingwhip)
|
||||
{
|
||||
player->instaWhipCharge = min(player->instaWhipCharge + 1, INSTAWHIP_TETHERBLOCK + 1);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue