From 76dab3e20dc0ddb6b07031be28584367f422db4f Mon Sep 17 00:00:00 2001 From: Kiloku Date: Sat, 4 Jan 2025 21:27:25 -0300 Subject: [PATCH] Rapid fire mode on Blue Marine and Landmaster --- src/engine/fox_play.c | 19 ++++++++++++++++--- src/overlays/ovl_i3/fox_aq.c | 22 +++++++++++++++++++--- 2 files changed, 35 insertions(+), 6 deletions(-) diff --git a/src/engine/fox_play.c b/src/engine/fox_play.c index 42af3268..a321371a 100644 --- a/src/engine/fox_play.c +++ b/src/engine/fox_play.c @@ -3323,7 +3323,7 @@ bool Player_CanLockOn(s32 playerNum) { bool Player_UpdateLockOn(Player* player) { bool hasBombTarget; s32 i; - + bool rapidFire = CVarGetInteger("gRapidFire", 0) == 1; if (rapidFire ? !(gInputHold->button & A_BUTTON) : (gInputHold->button & A_BUTTON)) { gChargeTimers[player->num]++; @@ -3476,8 +3476,21 @@ void Player_Shoot(Player* player) { case FORM_LANDMASTER: if (!Player_UpdateLockOn(player)) { - if (gShootButton[player->num] & gInputPress->button) { - Player_TankCannon(player); + if (rapidFire) { + if (gShootButton[player->num] & (gInputHold->button)) { + if (player-> shotTimer > 0) { + player->shotTimer--; + } + if (player->shotTimer <= 0){ + Player_TankCannon(player); + player->shotTimer = 3; + } + } + } + else { + if (gShootButton[player->num] & (gInputPress->button)) { + Player_TankCannon(player); + } } Player_SmartBomb(player); } diff --git a/src/overlays/ovl_i3/fox_aq.c b/src/overlays/ovl_i3/fox_aq.c index be2d3604..fc6fa608 100644 --- a/src/overlays/ovl_i3/fox_aq.c +++ b/src/overlays/ovl_i3/fox_aq.c @@ -1328,11 +1328,27 @@ void Aquas_BlueMarineShoot(Player* player) { Aquas_801A9DE4(player); } - if (gInputPress->button & A_BUTTON) { - Aquas_BlueMarineLaser(player); + bool rapidFire = CVarGetInteger("gRapidFire", 0) == 1; + + if (rapidFire){ + if (gInputHold->button & A_BUTTON) + { + if (player-> shotTimer > 0) { + player->shotTimer--; + } + if (player->shotTimer <= 0){ + Aquas_BlueMarineLaser(player); + player->shotTimer = 3; + } + } + } + else { + if (gInputPress->button & A_BUTTON) { + Aquas_BlueMarineLaser(player); + } } - if (gInputPress->button & B_BUTTON) { + if ((rapidFire ? gInputHold->button : gInputPress->button) & B_BUTTON) { Aquas_BlueMarineTorpedo(player); if (D_i3_801C4190[0] != 0) { D_i3_801C4190[3] = 1;