summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/engine/fox_beam.c5
-rw-r--r--src/engine/fox_enmy.c3
-rw-r--r--src/engine/fox_play.c12
-rw-r--r--src/port/ui/ImguiUI.cpp3
4 files changed, 18 insertions, 5 deletions
diff --git a/src/engine/fox_beam.c b/src/engine/fox_beam.c
index ac4c7a16..37152833 100644
--- a/src/engine/fox_beam.c
+++ b/src/engine/fox_beam.c
@@ -1769,9 +1769,10 @@ void PlayerShot_SearchLockOnTarget(PlayerShot* shot) {
!(gControllerHold[shot->sourceId].button & A_BUTTON) || (shot->timer == 0)) {
Object_Kill(&shot->obj, shot->sfxSource);
}
- } else {
+ } else {
+ bool rapidFire = CVarGetInteger("gRapidFire", 0) == 1;
if ((shot->obj.pos.y < gGroundHeight) || PlayerShot_FindLockTarget(shot) ||
- !(gControllerHold[gMainController].button & A_BUTTON) || (shot->timer == 0)) {
+ (!(gControllerHold[gMainController].button & A_BUTTON)^rapidFire) || (shot->timer == 0)) {
Object_Kill(&shot->obj, shot->sfxSource);
}
}
diff --git a/src/engine/fox_enmy.c b/src/engine/fox_enmy.c
index 429a4366..ead5021f 100644
--- a/src/engine/fox_enmy.c
+++ b/src/engine/fox_enmy.c
@@ -2813,7 +2813,8 @@ void Actor_Update(Actor* this) {
}
}
} else if (this->lockOnTimers[TEAM_ID_FOX] != 0) {
- if (!(gControllerHold[gMainController].button & A_BUTTON)) {
+ bool rapidFire = CVarGetInteger("gRapidFire", 0) == 1;
+ if (!(gControllerHold[gMainController].button & A_BUTTON) || (rapidFire && (gControllerHold[gMainController].button & A_BUTTON))) {
this->lockOnTimers[TEAM_ID_FOX]--;
}
gChargeTimers[0] = 0;
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;
diff --git a/src/port/ui/ImguiUI.cpp b/src/port/ui/ImguiUI.cpp
index 741bdb8a..4e4d5852 100644
--- a/src/port/ui/ImguiUI.cpp
+++ b/src/port/ui/ImguiUI.cpp
@@ -498,6 +498,9 @@ void DrawCheatsMenu() {
UIWidgets::CVarCheckbox("Hyper Laser", "gHyperLaser");
UIWidgets::CVarSliderInt("Laser Range Multiplier: %d%%", "gLaserRangeMult", 15, 800, 100,
{ .tooltip = "Changes how far your lasers fly." });
+ UIWidgets::CVarCheckbox("Rapid-fire mode", "gRapidFire", {
+ .tooltip = "Hold A to keep firing. Release A to start charging a shot."
+ });
UIWidgets::CVarCheckbox("Self destruct button", "gHit64SelfDestruct", {
.tooltip = "Press Down on the D-PAD to instantly self destruct."
});