diff --git a/soh/soh/Enhancements/custom-message/CustomMessageTypes.h b/soh/soh/Enhancements/custom-message/CustomMessageTypes.h index 33e79bf07..318b39d44 100644 --- a/soh/soh/Enhancements/custom-message/CustomMessageTypes.h +++ b/soh/soh/Enhancements/custom-message/CustomMessageTypes.h @@ -135,6 +135,9 @@ typedef enum { TEXT_MALON_HOW_IS_EPONA_DOING = 0x2001, TEXT_MALON_EPONA_LOOKS_GREAT = 0x2002, TEXT_MALON_OBSTICLE_COURSE = 0x2003, + TEXT_MALON_MEET_EPONA = 0x2047, + TEXT_MALON_EPONA_IS_AFRAID = 0x2048, + TEXT_MALON_LETS_SING_THIS_SONG = 0x2049, TEXT_MALON_EVERYONE_TURNING_EVIL = 0x204C, TEXT_MALON_I_SING_THIS_SONG = 0x2050, TEXT_MALON_EVERYONE_LIKED_SONG = 0x2051, diff --git a/soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h b/soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h index 5bbc637ac..091eb9de6 100644 --- a/soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h +++ b/soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h @@ -1419,6 +1419,14 @@ typedef enum { // - None VB_MALON_RETURN_FROM_CASTLE, + // #### `result` + // ```c + // true + // ``` + // #### `args` + // - None + VB_SEND_MALON_HOME, + // #### `result` // ```c // CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD) diff --git a/soh/soh/Enhancements/randomizer/Messages/Miscellaneous.cpp b/soh/soh/Enhancements/randomizer/Messages/Miscellaneous.cpp index aeb726531..c45c81369 100644 --- a/soh/soh/Enhancements/randomizer/Messages/Miscellaneous.cpp +++ b/soh/soh/Enhancements/randomizer/Messages/Miscellaneous.cpp @@ -39,10 +39,23 @@ void BuildShootingGalleryNoBowMessage(uint16_t* textId, bool* loadFromMessageTab *loadFromMessageTable = false; } +void BuildFixedMallonAtCastleMessage(uint16_t* textId, bool* loadFromMessageTable) { + CustomMessage msg = + CustomMessage("Looks like my dad already went back to the %rranch%w. You should come visit sometime!", + "Mein Vater ist wohl schon wieder auf der %rFarm%w, du solltest ihn mal besuchen kommen!", + "On dirait que père est déjà rentré au %rranch%w. Tu devrais nous rendre visite à l'occasion!"); + msg.AutoFormat(); + msg.LoadIntoFont(); + *loadFromMessageTable = false; +} + void RegisterMiscellaneousMessages() { COND_ID_HOOK(OnOpenText, TEXT_LAKE_HYLIA_WATER_SWITCH_NAVI, IS_RANDO, BuildWaterSwitchMessage); COND_ID_HOOK(OnOpenText, TEXT_LAKE_HYLIA_WATER_SWITCH_SIGN, IS_RANDO, BuildWaterSwitchMessage); COND_ID_HOOK(OnOpenText, TEXT_SHOOTING_GALLERY_MAN_COME_BACK_WITH_BOW, IS_RANDO, BuildShootingGalleryNoBowMessage); + COND_ID_HOOK(OnOpenText, TEXT_MALON_MEET_EPONA, IS_RANDO, BuildFixedMallonAtCastleMessage); + COND_ID_HOOK(OnOpenText, TEXT_MALON_EPONA_IS_AFRAID, IS_RANDO, BuildFixedMallonAtCastleMessage); + COND_ID_HOOK(OnOpenText, TEXT_MALON_LETS_SING_THIS_SONG, IS_RANDO, BuildFixedMallonAtCastleMessage); } static RegisterShipInitFunc initFunc(RegisterMiscellaneousMessages, { "IS_RANDO" }); \ No newline at end of file diff --git a/soh/soh/Enhancements/randomizer/hook_handlers.cpp b/soh/soh/Enhancements/randomizer/hook_handlers.cpp index 1fdbac591..440ee1722 100644 --- a/soh/soh/Enhancements/randomizer/hook_handlers.cpp +++ b/soh/soh/Enhancements/randomizer/hook_handlers.cpp @@ -253,6 +253,12 @@ void RandomizerOnFlagSetHandler(int16_t flagType, int16_t flag) { Flags_SetRandomizerInf(RAND_INF_ZELDAS_LETTER); } + if (flagType == FLAG_EVENT_CHECK_INF && flag == EVENTCHKINF_TALON_RETURNED_FROM_CASTLE) { + if (Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_POCKET_EGG)) { + Flags_SetRandomizerInf(RAND_INF_TALON_SENT_MALON_HOME); + } + } + RandomizerCheck rc = GetRandomizerCheckFromFlag(flagType, flag); if (rc == RC_UNKNOWN_CHECK) return; @@ -932,6 +938,13 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_l *should = true; } break; + case VB_MALON_RETURN_FROM_CASTLE: + *should = Flags_GetEventChkInf(EVENTCHKINF_TALON_RETURNED_FROM_CASTLE) && + Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_POCKET_EGG); + break; + case VB_SEND_MALON_HOME: + *should = Flags_GetRandomizerInf(RAND_INF_TALON_SENT_MALON_HOME); + break; case VB_MIDO_CONSIDER_DEKU_TREE_DEAD: *should = Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_KOKIRI_EMERALD_DEKU_TREE_DEAD); break; diff --git a/soh/soh/Enhancements/randomizer/randomizer_inf.h b/soh/soh/Enhancements/randomizer/randomizer_inf.h index c0ab61941..64e3e4e44 100644 --- a/soh/soh/Enhancements/randomizer/randomizer_inf.h +++ b/soh/soh/Enhancements/randomizer/randomizer_inf.h @@ -2112,3 +2112,4 @@ DEFINE_RAND_INF(RAND_INF_DEKU_TREE_QUEEN_GOHMA_GRASS_8) DEFINE_RAND_INF(RAND_INF_OBTAINED_RUTOS_LETTER) DEFINE_RAND_INF(RAND_INF_OBTAINED_NAYRUS_LOVE) DEFINE_RAND_INF(RAND_INF_OBTAINED_ROCS_FEATHER) +DEFINE_RAND_INF(RAND_INF_TALON_SENT_MALON_HOME) diff --git a/soh/src/overlays/actors/ovl_En_Ma1/z_en_ma1.c b/soh/src/overlays/actors/ovl_En_Ma1/z_en_ma1.c index 81057f34c..91f3c6ab7 100644 --- a/soh/src/overlays/actors/ovl_En_Ma1/z_en_ma1.c +++ b/soh/src/overlays/actors/ovl_En_Ma1/z_en_ma1.c @@ -329,7 +329,9 @@ void func_80AA0D88(EnMa1* this, PlayState* play) { } if ((play->sceneNum == SCENE_HYRULE_CASTLE) && malonReturnedFromCastle) { - Actor_Kill(&this->actor); + if (GameInteractor_Should(VB_SEND_MALON_HOME, true)) { + Actor_Kill(&this->actor); + } } else if (!malonReturnedFromCastle || malonTaughtEponasSong) { if (this->interactInfo.talkState == NPC_TALK_STATE_ACTION) { this->actionFunc = func_80AA0EA0;