More instawhip tuning cleanup

This commit is contained in:
AJ Martinez 2023-10-13 17:36:06 -07:00
parent f36e699398
commit 2a0f9da975
3 changed files with 18 additions and 13 deletions

View file

@ -8275,7 +8275,7 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
if (!(player->cmd.buttons & BT_ATTACK)) // Deliberate Item button release, no need to protect you from lockout if (!(player->cmd.buttons & BT_ATTACK)) // Deliberate Item button release, no need to protect you from lockout
player->instaWhipChargeLockout = 0; player->instaWhipChargeLockout = 0;
if (player->instaWhipCharge && player->instaWhipCharge < INSTAWHIP_COOLDOWN) if (player->instaWhipCharge && player->instaWhipCharge < INSTAWHIP_CHARGETIME)
{ {
if (!S_SoundPlaying(player->mo, sfx_wchrg1)) if (!S_SoundPlaying(player->mo, sfx_wchrg1))
S_StartSound(player->mo, sfx_wchrg1); S_StartSound(player->mo, sfx_wchrg1);
@ -8285,7 +8285,7 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
S_StopSoundByID(player->mo, sfx_wchrg1); S_StopSoundByID(player->mo, sfx_wchrg1);
} }
if (player->instaWhipCharge >= INSTAWHIP_COOLDOWN) if (player->instaWhipCharge >= INSTAWHIP_CHARGETIME)
{ {
if (!S_SoundPlaying(player->mo, sfx_wchrg2)) if (!S_SoundPlaying(player->mo, sfx_wchrg2))
S_StartSound(player->mo, sfx_wchrg2); S_StartSound(player->mo, sfx_wchrg2);
@ -8295,7 +8295,7 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
S_StopSoundByID(player->mo, sfx_wchrg2); S_StopSoundByID(player->mo, sfx_wchrg2);
} }
if (P_PlayerInPain(player) || player->itemamount) if (P_PlayerInPain(player) || player->itemamount || player->respawn.state != RESPAWNST_NONE)
player->instaWhipCharge = 0; player->instaWhipCharge = 0;
if (player->tiregrease) if (player->tiregrease)
@ -11031,7 +11031,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
{ {
chargingwhip = false; chargingwhip = false;
releasedwhip = (ATTACK_IS_DOWN && player->rings <= 0); releasedwhip = (ATTACK_IS_DOWN && player->rings <= 0);
player->instaWhipCharge = INSTAWHIP_COOLDOWN; player->instaWhipCharge = INSTAWHIP_CHARGETIME;
} }
if (leveltime < starttime || player->spindash) if (leveltime < starttime || player->spindash)
@ -11043,7 +11043,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
if (chargingwhip) if (chargingwhip)
{ {
//CONS_Printf("charging %d\n", player->instaWhipCharge); //CONS_Printf("charging %d\n", player->instaWhipCharge);
player->instaWhipCharge = min(player->instaWhipCharge + 1, INSTAWHIP_COOLDOWN + 1); player->instaWhipCharge = min(player->instaWhipCharge + 1, INSTAWHIP_CHARGETIME + 1);
if (player->instaWhipCharge == 1) if (player->instaWhipCharge == 1)
{ {
@ -11052,20 +11052,24 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
Obj_SpawnInstaWhipRecharge(player, ANGLE_240); Obj_SpawnInstaWhipRecharge(player, ANGLE_240);
} }
if (player->instaWhipCharge == INSTAWHIP_COOLDOWN) if (player->instaWhipCharge == INSTAWHIP_CHARGETIME)
{ {
Obj_SpawnInstaWhipReject(player); Obj_SpawnInstaWhipReject(player);
} }
if (player->instaWhipCharge > INSTAWHIP_COOLDOWN) if (player->instaWhipCharge > INSTAWHIP_CHARGETIME)
{ {
if (leveltime%(TICRATE/2) == 0) if ((leveltime%(INSTAWHIP_RINGDRAINEVERY)) == 0 && !(gametyperules & GTR_SPHERES))
P_PlayerRingBurst(player, 1); {
if (player->rings > -20)
S_StartSound(player->mo, sfx_antiri);
player->rings--;
}
} }
} }
else if (releasedwhip) else if (releasedwhip)
{ {
if (player->instaWhipCharge < INSTAWHIP_COOLDOWN) if (player->instaWhipCharge < INSTAWHIP_CHARGETIME)
{ {
S_StartSound(player->mo, sfx_kc50); S_StartSound(player->mo, sfx_kc50);
player->instaWhipCharge = 0; player->instaWhipCharge = 0;
@ -11076,7 +11080,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
player->guardCooldown = INSTAWHIP_DROPGUARD; player->guardCooldown = INSTAWHIP_DROPGUARD;
if (!K_PowerUpRemaining(player, POWERUP_BARRIER)) if (!K_PowerUpRemaining(player, POWERUP_BARRIER))
{ {
player->guardCooldown = INSTAWHIP_COOLDOWN; player->guardCooldown = INSTAWHIP_CHARGETIME;
} }
S_StartSound(player->mo, sfx_iwhp); S_StartSound(player->mo, sfx_iwhp);

View file

@ -30,8 +30,9 @@ Make sure this matches the actual number of states
#define SHRINK_PHYSICS_SCALE (3*FRACUNIT/4) #define SHRINK_PHYSICS_SCALE (3*FRACUNIT/4)
#define INSTAWHIP_DURATION (12) #define INSTAWHIP_DURATION (12)
#define INSTAWHIP_COOLDOWN (5*TICRATE/4) #define INSTAWHIP_CHARGETIME (5*TICRATE/4)
#define INSTAWHIP_DROPGUARD (12) #define INSTAWHIP_DROPGUARD (12)
#define INSTAWHIP_RINGDRAINEVERY (TICRATE/2)
#define GUARDBREAK_COOLDOWN (TICRATE*4) #define GUARDBREAK_COOLDOWN (TICRATE*4)
#define FLAMESHIELD_MAX (120) #define FLAMESHIELD_MAX (120)

View file

@ -50,7 +50,7 @@ void Obj_SpawnInstaWhipRecharge(player_t *player, angle_t angleOffset)
{ {
mobj_t *x = P_SpawnMobjFromMobj(player->mo, 0, 0, 0, MT_INSTAWHIP_RECHARGE); mobj_t *x = P_SpawnMobjFromMobj(player->mo, 0, 0, 0, MT_INSTAWHIP_RECHARGE);
x->tics = max(INSTAWHIP_COOLDOWN - player->instaWhipCharge - states[x->info->raisestate].tics, 0); x->tics = max(INSTAWHIP_CHARGETIME - player->instaWhipCharge - states[x->info->raisestate].tics, 0);
x->renderflags |= RF_SLOPESPLAT | RF_NOSPLATBILLBOARD; x->renderflags |= RF_SLOPESPLAT | RF_NOSPLATBILLBOARD;
P_SetTarget(&recharge_target(x), player->mo); P_SetTarget(&recharge_target(x), player->mo);