From 0b5dfd900e31e7b7e5b813f4c589596efece2c6a Mon Sep 17 00:00:00 2001 From: Kiloku Date: Sat, 4 Jan 2025 21:08:04 -0300 Subject: Rapid fire mode on arwing --- src/engine/fox_play.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/engine/fox_play.c') diff --git a/src/engine/fox_play.c b/src/engine/fox_play.c index f3e1b37d..42af3268 100644 --- a/src/engine/fox_play.c +++ b/src/engine/fox_play.c @@ -3323,8 +3323,9 @@ bool Player_CanLockOn(s32 playerNum) { bool Player_UpdateLockOn(Player* player) { bool hasBombTarget; s32 i; - - if (gInputHold->button & A_BUTTON) { + + bool rapidFire = CVarGetInteger("gRapidFire", 0) == 1; + if (rapidFire ? !(gInputHold->button & A_BUTTON) : (gInputHold->button & A_BUTTON)) { gChargeTimers[player->num]++; if (gChargeTimers[player->num] > 21) { gChargeTimers[player->num] = 21; @@ -3440,6 +3441,8 @@ bool Player_UpdateLockOn(Player* player) { } void Player_Shoot(Player* player) { + bool rapidFire = CVarGetInteger("gRapidFire", 0) == 1; + switch (player->form) { case FORM_ARWING: if ((player->arwing.rightWingState <= WINGSTATE_BROKEN) || @@ -3452,6 +3455,11 @@ void Player_Shoot(Player* player) { } else { Math_SmoothStepToF(&player->arwing.laserGunsYpos, 0.0f, 1.0f, 0.5f, 0.0f); } + if (rapidFire && (gShootButton[player->num] & gInputHold->button)){ + if (player->shotTimer <= 0){ + player->shotTimer = 3; + } + } if (gShootButton[player->num] & gInputPress->button) { Player_ArwingLaser(player); player->shotTimer = 8; -- cgit v1.2.3