diff --git a/soh/soh/Enhancements/randomizer/randomizer.cpp b/soh/soh/Enhancements/randomizer/randomizer.cpp index 43e278ab5fc..50f90ee5efc 100644 --- a/soh/soh/Enhancements/randomizer/randomizer.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer.cpp @@ -2419,6 +2419,17 @@ GetItemID Randomizer::GetRandomizedItemIdFromKnownCheck(RandomizerCheck randomiz return GetItemFromGet(this->itemLocations[randomizerCheck], ogId); } +std::string Randomizer::GetCustomGetItemMessage(GetItemID giid) { + if (!gSaveContext.n64ddFlag) { + return "Not Randomized."; + } + + switch (giid) { + default: + "There is no custom message for this item."; + } +} + RandomizerCheck Randomizer::GetCheckFromActor(s16 sceneNum, s16 actorId, s16 actorParams) { if (!gSaveContext.n64ddFlag) { return RC_UNKNOWN_CHECK; diff --git a/soh/soh/Enhancements/randomizer/randomizer.h b/soh/soh/Enhancements/randomizer/randomizer.h index 5fe2e0ae4c5..5d67c86926c 100644 --- a/soh/soh/Enhancements/randomizer/randomizer.h +++ b/soh/soh/Enhancements/randomizer/randomizer.h @@ -42,6 +42,7 @@ class Randomizer { std::string GetHintFromCheck(RandomizerCheck check); GetItemID GetRandomizedItemIdFromKnownCheck(RandomizerCheck randomizerCheck, GetItemID ogId); GetItemID GetRandomizedItemId(GetItemID ogId, s16 actorId, s16 actorParams, s16 sceneNum); + std::string GetCustomGetItemMessage(GetItemID giid); }; #ifdef __cplusplus diff --git a/soh/soh/OTRGlobals.cpp b/soh/soh/OTRGlobals.cpp index 3a862d58ab4..265909e5cf6 100644 --- a/soh/soh/OTRGlobals.cpp +++ b/soh/soh/OTRGlobals.cpp @@ -1528,3 +1528,8 @@ extern "C" s32 GetRandomizedItemId(GetItemID ogId, s16 actorId, s16 actorParams, extern "C" s32 GetRandomizedItemIdFromKnownCheck(RandomizerCheck randomizerCheck, GetItemID ogId) { return OTRGlobals::Instance->gRandomizer->GetRandomizedItemIdFromKnownCheck(randomizerCheck, ogId); } + +extern "C" int Randomizer_GetCustomGetItemMessage(GetItemID giid, char* buffer, const int maxBufferSize) { + const std::string& getItemText = OTRGlobals::Instance->gRandomizer->GetCustomGetItemMessage(giid); + return CopyStringToCharBuffer(getItemText, buffer, maxBufferSize); +} diff --git a/soh/soh/OTRGlobals.h b/soh/soh/OTRGlobals.h index 7c56e54c118..bf0384be145 100644 --- a/soh/soh/OTRGlobals.h +++ b/soh/soh/OTRGlobals.h @@ -99,6 +99,7 @@ s16 GetItemModelFromId(s16 itemId); s32 GetItemIDFromGetItemID(s32 getItemId); s32 GetRandomizedItemId(GetItemID ogId, s16 actorId, s16 actorParams, s16 sceneNum); s32 GetRandomizedItemIdFromKnownCheck(RandomizerCheck randomizerCheck, GetItemID ogId); +int Randomizer_GetCustomGetItemMessage(GetItemID giid, char* buffer, const int maxBufferSize); #endif #endif diff --git a/soh/src/code/z_message_PAL.c b/soh/src/code/z_message_PAL.c index 9cf592e4fb8..46b8b7e94d8 100644 --- a/soh/src/code/z_message_PAL.c +++ b/soh/src/code/z_message_PAL.c @@ -1735,6 +1735,9 @@ void Message_OpenText(GlobalContext* globalCtx, u16 textId) { } else { msgCtx->msgLength = font->msgLength = CopyGanonHintText(font->msgBuf, sizeof(font->msgBuf)); } + } else if (gSaveContext.n64ddFlag && textId == 0xF8) { + msgCtx->msgLength = font->msgLength = Randomizer_GetCustomGetItemMessage( + GET_PLAYER(globalCtx)->getItemId, font->msgBuf, sizeof(font->msgBuf)); } else { msgCtx->msgLength = font->msgLength; char* src = (uintptr_t)font->msgOffset;