[Enhancement] No Blast Mask Cooldown (#242)

* No Blast Mask Cooldown

* Re-add empty line

* Change enum name
This commit is contained in:
aMannus
2024-05-22 09:05:03 -05:00
committed by Garrett Cox
parent be3f7f57ee
commit 7f8ea385af
7 changed files with 23 additions and 1 deletions
+1
View File
@@ -325,6 +325,7 @@ void DrawEnhancementsMenu() {
UIWidgets::CVarCheckbox("Fierce Deity's Mask Anywhere", "gEnhancements.Masks.FierceDeitysAnywhere", {
.tooltip = "Allow using Fierce Deity's mask outside of boss rooms."
});
UIWidgets::CVarCheckbox("No Blast Mask Cooldown", "gEnhancements.Masks.NoBlastMaskCooldown", {});
ImGui::EndMenu();
}
+1
View File
@@ -11,6 +11,7 @@ void InitEnhancements() {
// Masks
RegisterFastTransformation();
RegisterFierceDeityAnywhere();
RegisterNoBlastMaskCooldown();
// Restorations
RegisterSideRoll();
+1
View File
@@ -5,6 +5,7 @@
#include "Cheats/Infinite.h"
#include "Cycle/EndOfCycle.h"
#include "Masks/FierceDeityAnywhere.h"
#include "Masks/NoBlastMaskCooldown.h"
#include "Masks/FastTransformation.h"
#include "Cutscenes/SkipEntranceCutscenes.h"
#include "Cutscenes/HideTitleCards.h"
@@ -32,6 +32,7 @@ typedef enum {
GI_VB_SHOW_TITLE_CARD,
GI_VB_PLAY_ENTRANCE_CS,
GI_VB_DISABLE_FD_MASK,
GI_VB_SET_BLAST_MASK_COOLDOWN_TIMER,
GI_VB_PATCH_SIDEROLL,
GI_VB_PREVENT_MASK_TRANSFORMATION_CS,
} GIVanillaBehavior;
@@ -0,0 +1,10 @@
#include <libultraship/bridge.h>
#include "Enhancements/GameInteractor/GameInteractor.h"
void RegisterNoBlastMaskCooldown() {
REGISTER_VB_SHOULD(GI_VB_SET_BLAST_MASK_COOLDOWN_TIMER, {
if (CVarGetInteger("gEnhancements.Masks.NoBlastMaskCooldown", 0)) {
*should = false;
}
});
}
@@ -0,0 +1,6 @@
#ifndef NO_BLAST_MASK_COOLDOWN_H
#define NO_BLAST_MASK_COOLDOWN_H
void RegisterNoBlastMaskCooldown();
#endif // NO_BLAST_MASK_COOLDOWN_H
@@ -3726,7 +3726,9 @@ void Player_ProcessItemButtons(Player* this, PlayState* play) {
if (bomb != NULL) {
bomb->timer = 0;
this->blastMaskTimer = 310;
if (GameInteractor_Should(GI_VB_SET_BLAST_MASK_COOLDOWN_TIMER, true, NULL)) {
this->blastMaskTimer = 310;
}
}
}
} else if (item == ITEM_F1) {