summaryrefslogtreecommitdiff
path: root/src/engine/fox_play.c
diff options
context:
space:
mode:
authorKiloku <mateus.sateles@protonmail.com>2025-01-04 21:08:04 -0300
committerAlejandro Asenjo Nitti <96613413+sonicdcer@users.noreply.github.com>2025-01-08 14:28:49 -0500
commit0b5dfd900e31e7b7e5b813f4c589596efece2c6a (patch)
treef77819653e4d16d907d97922164f2ece0aea89a8 /src/engine/fox_play.c
parent0c6b548e3c6d12dc875c0cd6dc4982061a8bb9fb (diff)
Rapid fire mode on arwing
Diffstat (limited to 'src/engine/fox_play.c')
-rw-r--r--src/engine/fox_play.c12
1 files changed, 10 insertions, 2 deletions
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;