mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-01-07 15:33:24 +00:00
Charge instawhip QoL
This commit is contained in:
parent
a9ec1cea68
commit
3e5a5baf50
3 changed files with 19 additions and 10 deletions
21
src/k_kart.c
21
src/k_kart.c
|
|
@ -1409,8 +1409,8 @@ static void K_UpdateDraft(player_t *player)
|
|||
leniency *= 4;
|
||||
}
|
||||
|
||||
// Opportunity cost for berserk attacking. Get your slingshot speed first!
|
||||
if (player->instaWhipCharge && player->rings <= 0)
|
||||
// Want to berserk attack? Get your speed FIRST.
|
||||
if (player->instaWhipCharge)
|
||||
return;
|
||||
|
||||
// Not enough speed to draft.
|
||||
|
|
@ -8137,10 +8137,7 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
|
|||
player->gateBoost--;
|
||||
|
||||
if (player->powerup.rhythmBadgeTimer > 0)
|
||||
{
|
||||
player->instaWhipCharge = min(player->instaWhipCharge, 1);
|
||||
player->powerup.rhythmBadgeTimer--;
|
||||
}
|
||||
|
||||
if (player->powerup.barrierTimer > 0)
|
||||
{
|
||||
|
|
@ -8270,8 +8267,12 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
|
|||
if (player->justbumped > 0)
|
||||
player->justbumped--;
|
||||
|
||||
// Don't screw up chain ring pickup/usage with instawhip charge.
|
||||
// If the button stays held, delay charge a bit.
|
||||
if (player->instaWhipChargeLockout)
|
||||
player->instaWhipChargeLockout--;
|
||||
if (player->rings > 0)
|
||||
player->instaWhipChargeLockout = TICRATE/2;
|
||||
if (!(player->cmd.buttons & BT_ATTACK)) // Deliberate Item button release, no need to protect you from lockout
|
||||
player->instaWhipChargeLockout = 0;
|
||||
|
||||
|
|
@ -11002,7 +11003,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
|
|||
if (player->pflags & PF_USERINGS)
|
||||
{
|
||||
boolean chargingwhip = (cmd->buttons & BT_ATTACK) && (player->rings <= 0) && (!player->instaWhipChargeLockout);
|
||||
boolean releasedwhip = !(cmd->buttons & BT_ATTACK) && (player->rings <= 0 && player->instaWhipCharge);
|
||||
boolean releasedwhip = (!(cmd->buttons & BT_ATTACK)) && (player->rings <= 0 && player->instaWhipCharge);
|
||||
|
||||
if (K_PowerUpRemaining(player, POWERUP_BADGE))
|
||||
{
|
||||
|
|
@ -11011,6 +11012,12 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
|
|||
player->instaWhipCharge = INSTAWHIP_COOLDOWN;
|
||||
}
|
||||
|
||||
if (leveltime < starttime || player->spindash)
|
||||
{
|
||||
chargingwhip = false;
|
||||
player->instaWhipCharge = 0;
|
||||
}
|
||||
|
||||
if (chargingwhip)
|
||||
{
|
||||
//CONS_Printf("charging %d\n", player->instaWhipCharge);
|
||||
|
|
@ -11025,7 +11032,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
|
|||
}
|
||||
else if (releasedwhip)
|
||||
{
|
||||
if (player->instaWhipCharge < INSTAWHIP_COOLDOWN || leveltime < starttime || player->spindash)
|
||||
if (player->instaWhipCharge < INSTAWHIP_COOLDOWN)
|
||||
{
|
||||
S_StartSound(player->mo, sfx_kc50);
|
||||
player->instaWhipCharge = 0;
|
||||
|
|
|
|||
|
|
@ -3856,8 +3856,6 @@ void A_AttractChase(mobj_t *actor)
|
|||
else
|
||||
S_StartSoundAtVolume(actor->target, sfx_s227, actor->target->player->ringvolume);
|
||||
|
||||
actor->target->player->instaWhipChargeLockout = 10;
|
||||
|
||||
actor->target->player->ringvolume -= RINGVOLUMECOLLECTPENALTY;
|
||||
|
||||
actor->target->player->pickuprings--;
|
||||
|
|
|
|||
|
|
@ -124,13 +124,17 @@ boolean P_Whipping(player_t *player)
|
|||
//
|
||||
boolean P_CanPickupItem(player_t *player, UINT8 weapon)
|
||||
{
|
||||
if (player->exiting || mapreset || (player->pflags & PF_ELIMINATED) || player->itemRoulette.reserved || P_Whipping(player))
|
||||
if (player->exiting || mapreset || (player->pflags & PF_ELIMINATED) || player->itemRoulette.reserved)
|
||||
return false;
|
||||
|
||||
// 0: Sphere/Ring
|
||||
// 1: Random Item / Capsule
|
||||
// 2: Eggbox
|
||||
// 3: Paperitem
|
||||
|
||||
if (weapon != 2 && P_Whipping(player))
|
||||
return false;
|
||||
|
||||
if (weapon)
|
||||
{
|
||||
// Item slot already taken up
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue