diff --git a/soh/soh/Enhancements/custom-message/CustomMessageTypes.h b/soh/soh/Enhancements/custom-message/CustomMessageTypes.h index 916e1a7f822..1f6d012f1f7 100644 --- a/soh/soh/Enhancements/custom-message/CustomMessageTypes.h +++ b/soh/soh/Enhancements/custom-message/CustomMessageTypes.h @@ -53,6 +53,7 @@ typedef enum { TEXT_WARP_RANDOM_REPLACED_TEXT = 0x9200, TEXT_LAKE_HYLIA_WATER_SWITCH_SIGN = 0x346, // 0x3yy for cuttable sign range TEXT_LAKE_HYLIA_WATER_SWITCH_NAVI = 0x1B3, // 0x1yy for Navi msg range + TEXT_BLAST_MASK = 0x1B4, } TextIDs; #ifdef __cplusplus diff --git a/soh/soh/Enhancements/mods.cpp b/soh/soh/Enhancements/mods.cpp index 6d66ff05599..35cc360c45a 100644 --- a/soh/soh/Enhancements/mods.cpp +++ b/soh/soh/Enhancements/mods.cpp @@ -1072,6 +1072,25 @@ void RegisterRandomizedEnemySizes() { }); } +void RegisterBlastMask() { + GameInteractor::Instance->RegisterGameHook([]() { + if (!CVarGetInteger("gBlastmask", 0)) { + return; + } + Player* player = GET_PLAYER(gPlayState); + u8 currentMask = Player_GetMask(gPlayState); + Input* input = &gPlayState->state.input[0]; + if (currentMask == PLAYER_MASK_SPOOKY) { + if (CHECK_BTN_ALL(input->press.button, BTN_B)) { + GameInteractor::RawAction::SpawnActor(ACTOR_EN_BOM, 1); + } + gPlayState->interfaceCtx.restrictions.bButton = 1; + } else { + gPlayState->interfaceCtx.restrictions.bButton = 0; + } + }); +} + void InitMods() { RegisterTTS(); RegisterInfiniteMoney(); @@ -1101,4 +1120,5 @@ void InitMods() { RegisterRandomizerSheikSpawn(); RegisterRandomizedEnemySizes(); NameTag_RegisterHooks(); + RegisterBlastMask(); } diff --git a/soh/soh/OTRGlobals.cpp b/soh/soh/OTRGlobals.cpp index 1199a7e99af..a907d7fc358 100644 --- a/soh/soh/OTRGlobals.cpp +++ b/soh/soh/OTRGlobals.cpp @@ -2463,6 +2463,9 @@ extern "C" int CustomMessage_RetrieveIfExists(PlayState* play) { if (textId == TEXT_MARKET_GUARD_NIGHT && CVarGetInteger("gMarketSneak", 0) && play->sceneNum == SCENE_MARKET_ENTRANCE_NIGHT) { messageEntry = CustomMessageManager::Instance->RetrieveMessage(customMessageTableID, TEXT_MARKET_GUARD_NIGHT); } + if (textId == TEXT_BLAST_MASK && CVarGetInteger("gBlastmask", 0)) { + messageEntry = CustomMessageManager::Instance->RetrieveMessage(customMessageTableID, TEXT_BLAST_MASK); + } font->charTexBuf[0] = (messageEntry.GetTextBoxType() << 4) | messageEntry.GetTextBoxPosition(); switch (gSaveContext.language) { case LANGUAGE_FRA: diff --git a/soh/soh/SohMenuBar.cpp b/soh/soh/SohMenuBar.cpp index a5fc1229907..f4137ce4337 100644 --- a/soh/soh/SohMenuBar.cpp +++ b/soh/soh/SohMenuBar.cpp @@ -596,6 +596,8 @@ void DrawEnhancementsMenu() { "Wearing the Bunny Hood grants a speed increase like in Majora's Mask. The longer jump option is not accounted for in randomizer logic.\n\n" "Also disables NPC's reactions to wearing the Bunny Hood." ); + UIWidgets::PaddedEnhancementCheckbox("Enable Blastmask", "gBlastmask", true, false); + UIWidgets::Tooltip("Press B to explode!"); UIWidgets::PaddedEnhancementCheckbox("Bunny Hood Equippable as Adult", "gAdultBunnyHood", true, false, (CVarGetInteger("gMMBunnyHood", BUNNY_HOOD_VANILLA) == BUNNY_HOOD_VANILLA), "Only available with increased bunny hood speed", UIWidgets::CheckboxGraphics::Cross, false); UIWidgets::Tooltip("Allows the bunny hood to be equipped normally from the pause menu as adult."); UIWidgets::PaddedEnhancementCheckbox("Mask Select in Inventory", "gMaskSelect", true, false); diff --git a/soh/soh/z_message_OTR.cpp b/soh/soh/z_message_OTR.cpp index f90e8bb9370..2ab57666588 100644 --- a/soh/soh/z_message_OTR.cpp +++ b/soh/soh/z_message_OTR.cpp @@ -154,4 +154,7 @@ extern "C" void OTRMessage_Init() CustomMessage("You look bored. Wanna go out for a&walk?\x1B&%gYes&No%w", "Du siehst gelangweilt aus.&Willst du einen Spaziergang machen?\x1B&%gJa&Nein%w", "Tu as l'air de t'ennuyer. Tu veux&aller faire un tour?\x1B&%gOui&Non%w")); + CustomMessageManager::Instance->CreateMessage( + customMessageTableID, TEXT_BLAST_MASK, + CustomMessage("Have you tried pressing B?", "Have you tried pressing B?", "Have you tried pressing B?")); } diff --git a/soh/src/code/z_face_reaction.c b/soh/src/code/z_face_reaction.c index 899c6afc657..0a7ad462d6e 100644 --- a/soh/src/code/z_face_reaction.c +++ b/soh/src/code/z_face_reaction.c @@ -1,5 +1,6 @@ #include "global.h" #include "soh/Enhancements/enhancementTypes.h" +#include "soh/Enhancements/custom-message/CustomMessageTypes.h" u16 sReactionTextIds[][PLAYER_MASK_MAX] = { { 0x0000, 0x7124, 0x7127, 0x7126, 0x7125, 0x7127, 0x7124, 0x7125, 0x7127 }, @@ -66,7 +67,9 @@ u16 sReactionTextIds[][PLAYER_MASK_MAX] = { u16 Text_GetFaceReaction(PlayState* play, u32 reactionSet) { u8 currentMask = Player_GetMask(play); - + if (CVarGetInteger("gBlastmask", 0) && Player_GetMask(gPlayState) == PLAYER_MASK_SPOOKY) { + return TEXT_BLAST_MASK; + } if (CVarGetInteger("gMMBunnyHood", BUNNY_HOOD_VANILLA) != BUNNY_HOOD_VANILLA && currentMask == PLAYER_MASK_BUNNY) { return 0; } else {