summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKiloku <mateus.sateles@protonmail.com>2025-01-04 21:27:25 -0300
committerAlejandro Asenjo Nitti <96613413+sonicdcer@users.noreply.github.com>2025-01-08 14:28:49 -0500
commit76dab3e20dc0ddb6b07031be28584367f422db4f (patch)
treeb0c5c5303956bae32f5d8a12c329ae204e1652af
parent0b5dfd900e31e7b7e5b813f4c589596efece2c6a (diff)
Rapid fire mode on Blue Marine and Landmaster
-rw-r--r--src/engine/fox_play.c19
-rw-r--r--src/overlays/ovl_i3/fox_aq.c22
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;