From 7144d1a32131aa2c0e9daf21a438bc5ca1ee77ea Mon Sep 17 00:00:00 2001 From: Sarge-117 Date: Sun, 7 Aug 2022 15:26:03 -0700 Subject: [PATCH 01/23] First test of Rando-specific Navi tips First test of this experiment --- soh/src/code/z_message_PAL.c | 3 + soh/src/code/z_message_RandoNaviTips.c | 58 +++++++++++++++++++ soh/src/overlays/actors/ovl_En_Elf/z_en_elf.c | 4 +- .../actors/ovl_player_actor/z_player.c | 4 ++ 4 files changed, 67 insertions(+), 2 deletions(-) create mode 100644 soh/src/code/z_message_RandoNaviTips.c diff --git a/soh/src/code/z_message_PAL.c b/soh/src/code/z_message_PAL.c index 72058206f..0d0da6051 100644 --- a/soh/src/code/z_message_PAL.c +++ b/soh/src/code/z_message_PAL.c @@ -1750,6 +1750,9 @@ void Message_OpenText(GlobalContext* globalCtx, u16 textId) { break; } msgCtx->msgLength = font->msgLength = strlen(font->msgBuf); + } else if (textId == 0x0140 && gSaveContext.n64ddFlag) { //888888888 + RandoNaviTip(globalCtx); + msgCtx->msgLength = font->msgLength = strlen(font->msgBuf); } else { msgCtx->msgLength = font->msgLength; char* src = (uintptr_t)font->msgOffset; diff --git a/soh/src/code/z_message_RandoNaviTips.c b/soh/src/code/z_message_RandoNaviTips.c new file mode 100644 index 000000000..6f380c467 --- /dev/null +++ b/soh/src/code/z_message_RandoNaviTips.c @@ -0,0 +1,58 @@ +#include "global.h" +#include "message_data_static.h" +#include "vt.h" + +#include + +void RandoNaviTip(GlobalContext* globalCtx) { + u16 randNaviTip = rand() % 3; + MessageContext* msgCtx = &globalCtx->msgCtx; + Font* font = &msgCtx->font; + + if (randNaviTip == 0) { + switch (gSaveContext.language) { + case LANGUAGE_FRA: + strcpy(font->msgBuf, "\x08French tip about playing rando!\x02"); + break; + case LANGUAGE_GER: + strcpy(font->msgBuf, "\x08German tip about playing rando!\x02"); + break; + case LANGUAGE_ENG: + default: + strcpy(font->msgBuf, "\x08Missing a small key in a dungeon?\x01Maybe the\x05\x43 " + "boss\x05\x40 has it!\x02"); + break; + } + } + if (randNaviTip == 1) { + switch (gSaveContext.language) { + case LANGUAGE_FRA: + strcpy(font->msgBuf, "\x08French tip about playing rando!\x02"); + break; + case LANGUAGE_GER: + strcpy(font->msgBuf, "\x08German tip about playing rando!\x02"); + break; + case LANGUAGE_ENG: + default: + strcpy(font->msgBuf, "\x08Sometimes you can use the \x05\x41Megaton\x01Hammer \x05\x40" + "instead of bombs!\x02"); + break; + } + } + if (randNaviTip == 2) { + switch (gSaveContext.language) { + case LANGUAGE_FRA: + strcpy(font->msgBuf, "\x08French tip about playing rando!\x02"); + break; + case LANGUAGE_GER: + strcpy(font->msgBuf, "\x08German tip about playing rando!\x02"); + break; + case LANGUAGE_ENG: + default: + strcpy(font->msgBuf, + "\x08There are three\x05\x42 business scrubs\x05\x40 in\x01" + "Hyrule who sell \x05\x44mysterious items\x05\x40. Do\x01you know where they are?\x02"); + break; + } + } +} \ No newline at end of file diff --git a/soh/src/overlays/actors/ovl_En_Elf/z_en_elf.c b/soh/src/overlays/actors/ovl_En_Elf/z_en_elf.c index ff9e37e52..307c81f7f 100644 --- a/soh/src/overlays/actors/ovl_En_Elf/z_en_elf.c +++ b/soh/src/overlays/actors/ovl_En_Elf/z_en_elf.c @@ -1382,7 +1382,7 @@ void func_80A053F0(Actor* thisx, GlobalContext* globalCtx) { if (player->naviTextId == 0) { if (player->unk_664 == NULL) { - if (((gSaveContext.naviTimer >= 600) && (gSaveContext.naviTimer <= 3000)) || (nREG(89) != 0)) { + if (((gSaveContext.naviTimer >= 40) && (gSaveContext.naviTimer <= 3000)) || (nREG(89) != 0)) { player->naviTextId = ElfMessage_GetCUpText(globalCtx); if (player->naviTextId == 0x15F) { @@ -1401,7 +1401,7 @@ void func_80A053F0(Actor* thisx, GlobalContext* globalCtx) { if (thisx->textId == ElfMessage_GetCUpText(globalCtx)) { this->fairyFlags |= 0x80; - gSaveContext.naviTimer = 3001; + gSaveContext.naviTimer = 10; } this->fairyFlags |= 0x10; diff --git a/soh/src/overlays/actors/ovl_player_actor/z_player.c b/soh/src/overlays/actors/ovl_player_actor/z_player.c index c3df51636..61f013d4c 100644 --- a/soh/src/overlays/actors/ovl_player_actor/z_player.c +++ b/soh/src/overlays/actors/ovl_player_actor/z_player.c @@ -15286,5 +15286,9 @@ void func_80853148(GlobalContext* globalCtx, Actor* actor) { if ((this->naviActor == this->targetActor) && ((this->targetActor->textId & 0xFF00) != 0x200)) { this->naviActor->flags |= ACTOR_FLAG_8; func_80835EA4(globalCtx, 0xB); + + if (actor->textId >= 0x0140 && actor->textId <= 0x015F && gSaveContext.n64ddFlag) { + Message_StartTextbox(globalCtx, 0x0140, NULL); + } } } From 6e8b45d1293ab7bfd357ceb86e7642354b76e60b Mon Sep 17 00:00:00 2001 From: Sarge-117 Date: Sun, 7 Aug 2022 15:50:53 -0700 Subject: [PATCH 02/23] Fix text colours (Navi text is always light blue) Navi text should always be \x44 --- soh/src/code/z_message_RandoNaviTips.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/soh/src/code/z_message_RandoNaviTips.c b/soh/src/code/z_message_RandoNaviTips.c index 6f380c467..edb1b7f9b 100644 --- a/soh/src/code/z_message_RandoNaviTips.c +++ b/soh/src/code/z_message_RandoNaviTips.c @@ -12,29 +12,29 @@ void RandoNaviTip(GlobalContext* globalCtx) { if (randNaviTip == 0) { switch (gSaveContext.language) { case LANGUAGE_FRA: - strcpy(font->msgBuf, "\x08French tip about playing rando!\x02"); + strcpy(font->msgBuf, "\x08\x05\x44""French tip about playing rando!\x02"); break; case LANGUAGE_GER: - strcpy(font->msgBuf, "\x08German tip about playing rando!\x02"); + strcpy(font->msgBuf, "\x08\x05\x44German tip about playing rando!\x02"); break; case LANGUAGE_ENG: default: - strcpy(font->msgBuf, "\x08Missing a small key in a dungeon?\x01Maybe the\x05\x43 " - "boss\x05\x40 has it!\x02"); + strcpy(font->msgBuf, "\x08\x05\x44Missing a small key in a dungeon?\x01Maybe the\x05\x41 " + "boss\x05\x44 has it!\x02"); break; } } if (randNaviTip == 1) { switch (gSaveContext.language) { case LANGUAGE_FRA: - strcpy(font->msgBuf, "\x08French tip about playing rando!\x02"); + strcpy(font->msgBuf, "\x08\x05\x44""French tip about playing rando!\x02"); break; case LANGUAGE_GER: strcpy(font->msgBuf, "\x08German tip about playing rando!\x02"); break; case LANGUAGE_ENG: default: - strcpy(font->msgBuf, "\x08Sometimes you can use the \x05\x41Megaton\x01Hammer \x05\x40" + strcpy(font->msgBuf, "\x08\x05\x44Sometimes you can use the \x05\x41Megaton\x01Hammer \x05\x44" "instead of bombs!\x02"); break; } @@ -42,7 +42,7 @@ void RandoNaviTip(GlobalContext* globalCtx) { if (randNaviTip == 2) { switch (gSaveContext.language) { case LANGUAGE_FRA: - strcpy(font->msgBuf, "\x08French tip about playing rando!\x02"); + strcpy(font->msgBuf, "\x08\x05\x44""French tip about playing rando!\x02"); break; case LANGUAGE_GER: strcpy(font->msgBuf, "\x08German tip about playing rando!\x02"); @@ -50,8 +50,8 @@ void RandoNaviTip(GlobalContext* globalCtx) { case LANGUAGE_ENG: default: strcpy(font->msgBuf, - "\x08There are three\x05\x42 business scrubs\x05\x40 in\x01" - "Hyrule who sell \x05\x44mysterious items\x05\x40. Do\x01you know where they are?\x02"); + "\x08\x05\x44There are three\x05\x42 business scrubs\x05\x44 in\x01" + "Hyrule who sell \x05\x46mysterious items\x05\x44. Do\x01you know where they are?\x02"); break; } } From 48a41bd11c4bc9bd5383dffd4cfcd3323a74a67c Mon Sep 17 00:00:00 2001 From: Sarge-117 Date: Sun, 7 Aug 2022 16:31:50 -0700 Subject: [PATCH 03/23] Comment clarity --- soh/src/code/z_message_PAL.c | 3 +- soh/src/code/z_message_RandoNaviTips.c | 28 +++++++++++++++++-- .../actors/ovl_player_actor/z_player.c | 8 +++--- 3 files changed, 32 insertions(+), 7 deletions(-) diff --git a/soh/src/code/z_message_PAL.c b/soh/src/code/z_message_PAL.c index 0d0da6051..0a1204775 100644 --- a/soh/src/code/z_message_PAL.c +++ b/soh/src/code/z_message_PAL.c @@ -1750,7 +1750,8 @@ void Message_OpenText(GlobalContext* globalCtx, u16 textId) { break; } msgCtx->msgLength = font->msgLength = strlen(font->msgBuf); - } else if (textId == 0x0140 && gSaveContext.n64ddFlag) { //888888888 + // Give Navi rando-specific gameplay tips + } else if (textId == 0x0140 && gSaveContext.n64ddFlag) { RandoNaviTip(globalCtx); msgCtx->msgLength = font->msgLength = strlen(font->msgBuf); } else { diff --git a/soh/src/code/z_message_RandoNaviTips.c b/soh/src/code/z_message_RandoNaviTips.c index edb1b7f9b..4d2bd0a92 100644 --- a/soh/src/code/z_message_RandoNaviTips.c +++ b/soh/src/code/z_message_RandoNaviTips.c @@ -4,8 +4,14 @@ #include +// Function for letting Navi give general rando tips to the player instead of her +// normal generic quest tips. + +// Only applies to Navi's overworld quest hints - does not apply to enemy information +// or contextual hints (e.g. "This hallway is twisted!" in Forest Temple) + void RandoNaviTip(GlobalContext* globalCtx) { - u16 randNaviTip = rand() % 3; + u16 randNaviTip = rand() % 4; MessageContext* msgCtx = &globalCtx->msgCtx; Font* font = &msgCtx->font; @@ -51,7 +57,25 @@ void RandoNaviTip(GlobalContext* globalCtx) { default: strcpy(font->msgBuf, "\x08\x05\x44There are three\x05\x42 business scrubs\x05\x44 in\x01" - "Hyrule who sell \x05\x46mysterious items\x05\x44. Do\x01you know where they are?\x02"); + "Hyrule who sell \x05\x49mysterious items\x05\x44. Do\x01you know where they are?\x02"); + break; + } + } + if (randNaviTip == 3) { + switch (gSaveContext.language) { + case LANGUAGE_FRA: + strcpy(font->msgBuf, "\x08\x05\x44" + "French tip about playing rando!\x02"); + break; + case LANGUAGE_GER: + strcpy(font->msgBuf, "\x08German tip about playing rando!\x02"); + break; + case LANGUAGE_ENG: + default: + strcpy(font->msgBuf, + "\x08\x05\x44Stuck on this seed? You could\x01" + "throw in the towel and check the \x01" + "\x05\x49spoiler log\x05\x44...\x02"); break; } } diff --git a/soh/src/overlays/actors/ovl_player_actor/z_player.c b/soh/src/overlays/actors/ovl_player_actor/z_player.c index 61f013d4c..7d5d61615 100644 --- a/soh/src/overlays/actors/ovl_player_actor/z_player.c +++ b/soh/src/overlays/actors/ovl_player_actor/z_player.c @@ -15286,9 +15286,9 @@ void func_80853148(GlobalContext* globalCtx, Actor* actor) { if ((this->naviActor == this->targetActor) && ((this->targetActor->textId & 0xFF00) != 0x200)) { this->naviActor->flags |= ACTOR_FLAG_8; func_80835EA4(globalCtx, 0xB); - - if (actor->textId >= 0x0140 && actor->textId <= 0x015F && gSaveContext.n64ddFlag) { - Message_StartTextbox(globalCtx, 0x0140, NULL); - } + // If rando'd and Navi wants to give you a general quest tip, give a rando tip instead + // if (actor->textId >= 0x0140 && actor->textId <= 0x015F && gSaveContext.n64ddFlag) { + // Message_StartTextbox(globalCtx, 0x0140, NULL); + // } } } From a5acf6da20e19903144e493f64e23e631b643036 Mon Sep 17 00:00:00 2001 From: Sarge-117 Date: Sun, 7 Aug 2022 16:33:44 -0700 Subject: [PATCH 04/23] Set Navi timer back to normal --- soh/src/overlays/actors/ovl_En_Elf/z_en_elf.c | 4 ++-- soh/src/overlays/actors/ovl_player_actor/z_player.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/soh/src/overlays/actors/ovl_En_Elf/z_en_elf.c b/soh/src/overlays/actors/ovl_En_Elf/z_en_elf.c index 307c81f7f..ff9e37e52 100644 --- a/soh/src/overlays/actors/ovl_En_Elf/z_en_elf.c +++ b/soh/src/overlays/actors/ovl_En_Elf/z_en_elf.c @@ -1382,7 +1382,7 @@ void func_80A053F0(Actor* thisx, GlobalContext* globalCtx) { if (player->naviTextId == 0) { if (player->unk_664 == NULL) { - if (((gSaveContext.naviTimer >= 40) && (gSaveContext.naviTimer <= 3000)) || (nREG(89) != 0)) { + if (((gSaveContext.naviTimer >= 600) && (gSaveContext.naviTimer <= 3000)) || (nREG(89) != 0)) { player->naviTextId = ElfMessage_GetCUpText(globalCtx); if (player->naviTextId == 0x15F) { @@ -1401,7 +1401,7 @@ void func_80A053F0(Actor* thisx, GlobalContext* globalCtx) { if (thisx->textId == ElfMessage_GetCUpText(globalCtx)) { this->fairyFlags |= 0x80; - gSaveContext.naviTimer = 10; + gSaveContext.naviTimer = 3001; } this->fairyFlags |= 0x10; diff --git a/soh/src/overlays/actors/ovl_player_actor/z_player.c b/soh/src/overlays/actors/ovl_player_actor/z_player.c index 7d5d61615..5bf9394d7 100644 --- a/soh/src/overlays/actors/ovl_player_actor/z_player.c +++ b/soh/src/overlays/actors/ovl_player_actor/z_player.c @@ -15287,8 +15287,8 @@ void func_80853148(GlobalContext* globalCtx, Actor* actor) { this->naviActor->flags |= ACTOR_FLAG_8; func_80835EA4(globalCtx, 0xB); // If rando'd and Navi wants to give you a general quest tip, give a rando tip instead - // if (actor->textId >= 0x0140 && actor->textId <= 0x015F && gSaveContext.n64ddFlag) { - // Message_StartTextbox(globalCtx, 0x0140, NULL); - // } + if (actor->textId >= 0x0140 && actor->textId <= 0x015F && gSaveContext.n64ddFlag) { + Message_StartTextbox(globalCtx, 0x0140, NULL); + } } } From f55623e1c684727a93207a950d0ecd9beb803729 Mon Sep 17 00:00:00 2001 From: Sarge-117 Date: Tue, 9 Aug 2022 12:23:14 -0700 Subject: [PATCH 05/23] Update z_message_PAL.c --- soh/src/code/z_message_PAL.c | 96 +++++------------------------------- 1 file changed, 11 insertions(+), 85 deletions(-) diff --git a/soh/src/code/z_message_PAL.c b/soh/src/code/z_message_PAL.c index 0a1204775..3a095b0d2 100644 --- a/soh/src/code/z_message_PAL.c +++ b/soh/src/code/z_message_PAL.c @@ -1663,7 +1663,10 @@ void Message_OpenText(GlobalContext* globalCtx, u16 textId) { gSaveContext.eventInf[0] = gSaveContext.eventInf[1] = gSaveContext.eventInf[2] = gSaveContext.eventInf[3] = 0; } - if (sTextIsCredits) { + // RANDOTODO: Use this for ice trap messages + if (CustomMessage_RetrieveIfExists(globalCtx)) { + osSyncPrintf("Found custom message"); + } else if (sTextIsCredits) { Message_FindCreditsMessage(globalCtx, textId); msgCtx->msgLength = font->msgLength; char* src = (uintptr_t)font->msgOffset; @@ -1674,91 +1677,14 @@ void Message_OpenText(GlobalContext* globalCtx, u16 textId) { //font->msgLength, __FILE__, __LINE__); } else { Message_FindMessage(globalCtx, textId); - // if we're rando'd and talking to a gossip stone - if (gSaveContext.n64ddFlag && - textId == 0x2053 && - Randomizer_GetSettingValue(RSK_GOSSIP_STONE_HINTS) != 0 && - (Randomizer_GetSettingValue(RSK_GOSSIP_STONE_HINTS) == 1 || - (Randomizer_GetSettingValue(RSK_GOSSIP_STONE_HINTS) == 2 && - Player_GetMask(globalCtx) == PLAYER_MASK_TRUTH) || - (Randomizer_GetSettingValue(RSK_GOSSIP_STONE_HINTS) == 3 && - CHECK_QUEST_ITEM(QUEST_STONE_OF_AGONY)))) { + msgCtx->msgLength = font->msgLength; + char* src = (uintptr_t)font->msgOffset; + memcpy(font->msgBuf, src, font->msgLength); + } - s16 actorParams = msgCtx->talkActor->params; - - // if we're in a generic grotto - if (globalCtx->sceneNum == 62 && actorParams == 14360) { - // look for the chest in the actorlist to determine - // which grotto we're in - int numOfActorLists = sizeof(globalCtx->actorCtx.actorLists)/sizeof(globalCtx->actorCtx.actorLists[0]); - for(int i = 0; i < numOfActorLists; i++) { - if(globalCtx->actorCtx.actorLists[i].length) { - if(globalCtx->actorCtx.actorLists[i].head->id == 10) { - // set the params for the hint check to be negative chest params - actorParams = 0 - globalCtx->actorCtx.actorLists[i].head->params; - } - } - } - } - - RandomizerCheck hintCheck = Randomizer_GetCheckFromActor(globalCtx->sceneNum, msgCtx->talkActor->id, actorParams); - - // Pass the sizeof the message buffer so we don't hardcode any sizes and can rely on globals. - // If no hint can be found, this just returns 0 size and doesn't modify the buffer, so no worries. - msgCtx->msgLength = font->msgLength = Randomizer_CopyHintFromCheck(hintCheck, font->msgBuf, sizeof(font->msgBuf)); - } else if (gSaveContext.n64ddFlag && (textId == 0x7040 || textId == 0x7088)) { - // rando hints at altar - msgCtx->msgLength = font->msgLength = Randomizer_CopyAltarMessage(font->msgBuf, sizeof(font->msgBuf)); - } else if (textId == 0x00b4 && CVar_GetS32("gInjectSkulltulaCount", 0) != 0) { - switch (gSaveContext.language) { - case LANGUAGE_FRA: - strcpy(font->msgBuf, "\x08\x13\x71Vous obtenez un \x05\x41Symbole de\x01Skulltula d'or\x05\x40! " - "Vous avez\x01\collect\x96 " - "\x05\x41\x19\x05\x40 symboles en tout!\x02"); - break; - case LANGUAGE_GER: - strcpy(font->msgBuf, "\x08\x13\x71\Du erh\x93lst ein \x05\x41Goldene\x01Skulltula-Symbol\x05\x40\! " - "Du hast\x01insgesamt " - "\x05\x41\x19\x05\x40 symbol gesammelt!\x02"); - break; - case LANGUAGE_ENG: default: - strcpy(font->msgBuf, - "\x08\x13\x71You got a \x05\x41Gold Skulltula Token\x05\x40!\x01You've collected " - "\x05\x41\x19\x05\x40 tokens\x01in total!\x02"); - break; - } - msgCtx->msgLength = font->msgLength = strlen(font->msgBuf); - } else if (gSaveContext.n64ddFlag && (textId == 0x10A2 || textId == 0x10DC || textId == 0x10DD)) { - msgCtx->msgLength = font->msgLength = CopyScrubMessage(textId, font->msgBuf, sizeof(font->msgBuf)); - } else if (gSaveContext.n64ddFlag && textId == 0x70CC) { - if (INV_CONTENT(ITEM_ARROW_LIGHT) == ITEM_ARROW_LIGHT) { - msgCtx->msgLength = font->msgLength = Randomizer_CopyGanonText(font->msgBuf, sizeof(font->msgBuf)); - } else { - msgCtx->msgLength = font->msgLength = Randomizer_CopyGanonHintText(font->msgBuf, sizeof(font->msgBuf)); - } - } else if (textId == 0xF8 && GET_PLAYER(globalCtx)->getItemId == GI_ICE_TRAP) { - switch (gSaveContext.language) { - case LANGUAGE_FRA: - strcpy(font->msgBuf, "\x08\x06\x50\x05\x43IDIOT\x0E\x20\x02"); - break; - case LANGUAGE_GER: - strcpy(font->msgBuf, "\x08\x06\x15 Du bist ein\x05\x43 DUMMKOPF\x05\x40!\x0E\x20\x02"); - break; - case LANGUAGE_ENG: - default: - strcpy(font->msgBuf, "\x08\x06\x30You are a\x05\x43 FOWL\x05\x40!\x0E\x20\x02"); - break; - } - msgCtx->msgLength = font->msgLength = strlen(font->msgBuf); - // Give Navi rando-specific gameplay tips - } else if (textId == 0x0140 && gSaveContext.n64ddFlag) { - RandoNaviTip(globalCtx); - msgCtx->msgLength = font->msgLength = strlen(font->msgBuf); - } else { - msgCtx->msgLength = font->msgLength; - char* src = (uintptr_t)font->msgOffset; - memcpy(font->msgBuf, src, font->msgLength); - } + if (textId == 0x0140 && gSaveContext.n64ddFlag) { // 888888888 + RandoNaviTip(globalCtx); + msgCtx->msgLength = font->msgLength = strlen(font->msgBuf); } msgCtx->textBoxProperties = font->charTexBuf[0]; From 00e2d0fe0e6e9e9e0b9ece17e8736acc0359081c Mon Sep 17 00:00:00 2001 From: Sarge-117 Date: Tue, 9 Aug 2022 12:39:59 -0700 Subject: [PATCH 06/23] Update tips --- soh/src/code/z_message_RandoNaviTips.c | 275 +++++++++++++++++++++++-- 1 file changed, 253 insertions(+), 22 deletions(-) diff --git a/soh/src/code/z_message_RandoNaviTips.c b/soh/src/code/z_message_RandoNaviTips.c index 4d2bd0a92..8ac714e55 100644 --- a/soh/src/code/z_message_RandoNaviTips.c +++ b/soh/src/code/z_message_RandoNaviTips.c @@ -5,77 +5,308 @@ #include // Function for letting Navi give general rando tips to the player instead of her -// normal generic quest tips. +// normal generic quest tips. // Only applies to Navi's overworld quest hints - does not apply to enemy information // or contextual hints (e.g. "This hallway is twisted!" in Forest Temple) void RandoNaviTip(GlobalContext* globalCtx) { - u16 randNaviTip = rand() % 4; + u16 randNaviTip = rand() % 15; // Random number between 0 and total number of Navi tips MessageContext* msgCtx = &globalCtx->msgCtx; Font* font = &msgCtx->font; if (randNaviTip == 0) { switch (gSaveContext.language) { case LANGUAGE_FRA: - strcpy(font->msgBuf, "\x08\x05\x44""French tip about playing rando!\x02"); + strcpy(font->msgBuf, "\x05\x44" + "French tip about playing rando! 0\x02"); break; case LANGUAGE_GER: - strcpy(font->msgBuf, "\x08\x05\x44German tip about playing rando!\x02"); + strcpy(font->msgBuf, "\x05\x44" + "German tip about playing rando! 0\x02"); break; case LANGUAGE_ENG: default: - strcpy(font->msgBuf, "\x08\x05\x44Missing a small key in a dungeon?\x01Maybe the\x05\x41 " - "boss\x05\x44 has it!\x02"); + strcpy(font->msgBuf, "\x05\x44" + "Missing a small key in a dungeon?\x01" + "Maybe the\x05\x41 boss\x05\x44 has it!\x02"); break; } } if (randNaviTip == 1) { switch (gSaveContext.language) { case LANGUAGE_FRA: - strcpy(font->msgBuf, "\x08\x05\x44""French tip about playing rando!\x02"); + strcpy(font->msgBuf, "\x05\x44" + "French tip about playing rando! 1\x02"); break; case LANGUAGE_GER: - strcpy(font->msgBuf, "\x08German tip about playing rando!\x02"); + strcpy(font->msgBuf, "\x05\x44" + "German tip about playing rando! 1\x02"); break; case LANGUAGE_ENG: default: - strcpy(font->msgBuf, "\x08\x05\x44Sometimes you can use the \x05\x41Megaton\x01Hammer \x05\x44" - "instead of bombs!\x02"); + strcpy(font->msgBuf, "\x05\x44" + "Sometimes you can use the \x05\x41Megaton\x01" + "Hammer \x05\x44instead of bombs!\x02"); break; } } if (randNaviTip == 2) { switch (gSaveContext.language) { case LANGUAGE_FRA: - strcpy(font->msgBuf, "\x08\x05\x44""French tip about playing rando!\x02"); + strcpy(font->msgBuf, "\x05\x44" + "French tip about playing rando! 2\x02"); break; case LANGUAGE_GER: - strcpy(font->msgBuf, "\x08German tip about playing rando!\x02"); + strcpy(font->msgBuf, "\x05\x44" + "German tip about playing rando! 2\x02"); break; case LANGUAGE_ENG: default: - strcpy(font->msgBuf, - "\x08\x05\x44There are three\x05\x42 business scrubs\x05\x44 in\x01" - "Hyrule who sell \x05\x49mysterious items\x05\x44. Do\x01you know where they are?\x02"); + strcpy(font->msgBuf, "\x05\x44" + "There are three\x05\x42 business scrubs\x05\x44 in\x01" + "Hyrule who sell \x05\x49mysterious items\x05\x44. Do\x01" + "you know where they are?\x02"); break; } } if (randNaviTip == 3) { switch (gSaveContext.language) { case LANGUAGE_FRA: - strcpy(font->msgBuf, "\x08\x05\x44" - "French tip about playing rando!\x02"); + strcpy(font->msgBuf, "\x05\x44" + "French tip about playing rando! 3\x02"); break; case LANGUAGE_GER: - strcpy(font->msgBuf, "\x08German tip about playing rando!\x02"); + strcpy(font->msgBuf, "\x05\x44" + "German tip about playing rando! 3\x02"); break; case LANGUAGE_ENG: default: - strcpy(font->msgBuf, - "\x08\x05\x44Stuck on this seed? You could\x01" - "throw in the towel and check the \x01" - "\x05\x49spoiler log\x05\x44...\x02"); + strcpy(font->msgBuf, "\x05\x44" + "Stuck on this seed? You could\x01" + "throw in the towel and check the \x01" + "\x05\x49spoiler log\x05\x44...\x02"); + break; + } + } + if (randNaviTip == 4) { + switch (gSaveContext.language) { + case LANGUAGE_FRA: + strcpy(font->msgBuf, "\x05\x44" + "French tip about playing rando! 4\x02"); + break; + case LANGUAGE_GER: + strcpy(font->msgBuf, "\x05\x44" + "German tip about playing rando! 4\x02"); + break; + case LANGUAGE_ENG: + default: + strcpy(font->msgBuf, "\x05\x44" + "Did you know that the \x05\x46Hover\x01" + "Boots\x05\x44 can be used to cross \x01" + "quicksand?\x02"); + break; + } + } + if (randNaviTip == 5) { + switch (gSaveContext.language) { + case LANGUAGE_FRA: + strcpy(font->msgBuf, "\x05\x44" + "French tip about playing rando! 5\x02"); + break; + case LANGUAGE_GER: + strcpy(font->msgBuf, "\x05\x44" + "German tip about playing rando! 5\x02"); + break; + case LANGUAGE_ENG: + default: + strcpy(font->msgBuf, "\x05\x44" + "You can get into the back of\x01\x05\x49" + "Impa's House\x05\x44 by jumping from the\x01" + "unfinished house with a \x05\x41" + "Cucco\x05\x44!\x02"); + break; + } + } + if (randNaviTip == 6) { + switch (gSaveContext.language) { + case LANGUAGE_FRA: + strcpy(font->msgBuf, "\x05\x44" + "French tip about playing rando! 6\x02"); + break; + case LANGUAGE_GER: + strcpy(font->msgBuf, "\x05\x44" + "German tip about playing rando! 6\x02"); + break; + case LANGUAGE_ENG: + default: + strcpy(font->msgBuf, "\x05\x44" + "The \x05\x46Spirit Trial \x05\x44in \x05\x45Ganon's Castle\x05\x44\x01" + "has a\x05\x40 hidden chest\x05\x44 somewhere.\x01" + "Did you already know that?\x02"); + break; + } + } + if (randNaviTip == 7) { + switch (gSaveContext.language) { + case LANGUAGE_FRA: + strcpy(font->msgBuf, "\x05\x44" + "French tip about playing rando! 7\x02"); + break; + case LANGUAGE_GER: + strcpy(font->msgBuf, "\x05\x44" + "German tip about playing rando! 7\x02"); + break; + case LANGUAGE_ENG: + default: + strcpy(font->msgBuf, "\x05\x44" + "You know the \x05\x40" + "Bombchu Bowling\x01" + "Alley\x05\x44? I heard \x05\x40only two of the\x01" + "prizes\x05\x44 are worthwhile. The rest\x01" + "is junk!\x02"); + break; + } + } + if (randNaviTip == 8) { + switch (gSaveContext.language) { + case LANGUAGE_FRA: + strcpy(font->msgBuf, "\x05\x44" + "French tip about playing rando! 8\x02"); + break; + case LANGUAGE_GER: + strcpy(font->msgBuf, "\x05\x44" + "German tip about playing rando! 8\x02"); + break; + case LANGUAGE_ENG: + default: + strcpy(font->msgBuf, "\x05\x44" + "Have you been using \x05\x40" + "Deku Nuts \x05\x44\x01" + "enough? I've seen them blow up\x01" + "a \x05\x41" + "Bombchu\x05\x44!\x02"); + break; + } + } + if (randNaviTip == 9) { + switch (gSaveContext.language) { + case LANGUAGE_FRA: + strcpy(font->msgBuf, "\x05\x44" + "French tip about playing rando! 9\x02"); + break; + case LANGUAGE_GER: + strcpy(font->msgBuf, "\x05\x44" + "German tip about playing rando! 9\x02"); + break; + case LANGUAGE_ENG: + default: + strcpy(font->msgBuf, "\x05\x44" + "You might end up with an \x05\x40" + "extra\x01" + "key\x05\x44 for the \x05\x43Water Temple\x05\x44 or the \x05\x41" + "Fire\x01" + "Temple\x05\x44. It's for your safety!\x02"); + break; + } + } + if (randNaviTip == 10) { + switch (gSaveContext.language) { + case LANGUAGE_FRA: + strcpy(font->msgBuf, "\x05\x44" + "French tip about playing rando! 10\x02"); + break; + case LANGUAGE_GER: + strcpy(font->msgBuf, "\x05\x44" + "German tip about playing rando! 10\x02"); + break; + case LANGUAGE_ENG: + default: + strcpy(font->msgBuf, "\x05\x44" + "If you can't pick up a \x05\x41" + "bomb\x01" + "flower \x05\x44with your hands, you\x01" + "can still detonate it with \x01" + "an \x05\x40" + "arrow\x05\x44!\x02"); + break; + } + } + if (randNaviTip == 11) { + switch (gSaveContext.language) { + case LANGUAGE_FRA: + strcpy(font->msgBuf, "\x05\x44" + "French tip about playing rando! 11\x02"); + break; + case LANGUAGE_GER: + strcpy(font->msgBuf, "\x05\x44" + "German tip about playing rando! 11\x02"); + break; + case LANGUAGE_ENG: + default: + strcpy(font->msgBuf, "\x05\x44" + "Even an adult can't push large\x01" + "blocks without some \x05\x40" + "extra\x01" + "strength\x05\x44!\x02"); + break; + } + } + if (randNaviTip == 12) { + switch (gSaveContext.language) { + case LANGUAGE_FRA: + strcpy(font->msgBuf, "\x05\x44" + "French tip about playing rando! 12\x02"); + break; + case LANGUAGE_GER: + strcpy(font->msgBuf, "\x05\x44" + "German tip about playing rando! 12\x02"); + break; + case LANGUAGE_ENG: + default: + strcpy(font->msgBuf, "\x05\x44" + "I've heard that\x05\x41 Flare Dancer\x05\x44\x01" + "is weak to the \x05\x40Master Sword\x05\x44!\x01" + "Have you tried it?\x02"); + break; + } + } + if (randNaviTip == 13) { + switch (gSaveContext.language) { + case LANGUAGE_FRA: + strcpy(font->msgBuf, "\x05\x44" + "French tip about playing rando! 12\x02"); + break; + case LANGUAGE_GER: + strcpy(font->msgBuf, "\x05\x44" + "German tip about playing rando! 12\x02"); + break; + case LANGUAGE_ENG: + default: + strcpy(font->msgBuf, "\x05\x44" + "Don't have a weapon to kill a\x01" + "\x05\x41spider\x05\x44? Try throwing a \x05\x40pot\x01" + "\x05\x44" + "at it!\x02"); + break; + } + } + if (randNaviTip == 14) { + switch (gSaveContext.language) { + case LANGUAGE_FRA: + strcpy(font->msgBuf, "\x05\x44" + "French tip about playing rando! 12\x02"); + break; + case LANGUAGE_GER: + strcpy(font->msgBuf, "\x05\x44" + "German tip about playing rando! 12\x02"); + break; + case LANGUAGE_ENG: + default: + strcpy(font->msgBuf, "\x05\x44" + "I hear the patch of \x05\x40soft soil\x05\x44\x01" + "in \x05\x43Zora's River\x05\x44 is the only one\x01" + "that isn't home to a \x05\x41spider\x05\x44!\x02"); break; } } From dc6018b41e748187ba6ef58f003823d9273bf4c7 Mon Sep 17 00:00:00 2001 From: Sarge-117 Date: Tue, 9 Aug 2022 13:44:57 -0700 Subject: [PATCH 07/23] Update CMakeLists.txt --- soh/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/soh/CMakeLists.txt b/soh/CMakeLists.txt index 5342374f0..85fd7f080 100644 --- a/soh/CMakeLists.txt +++ b/soh/CMakeLists.txt @@ -485,6 +485,7 @@ set(Source_Files__src__code "src/code/z_map_exp.c" "src/code/z_map_mark.c" "src/code/z_message_PAL.c" + "src/code/z_message_RandoNaviTips.c" "src/code/z_moji.c" "src/code/z_msgevent.c" "src/code/z_olib.c" From 6a39b9e0119f79fa7b92fe3c9a717ab651c37115 Mon Sep 17 00:00:00 2001 From: Sarge-117 Date: Tue, 9 Aug 2022 13:56:45 -0700 Subject: [PATCH 08/23] Comments --- soh/src/code/z_message_PAL.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/soh/src/code/z_message_PAL.c b/soh/src/code/z_message_PAL.c index 3a095b0d2..07f80fba2 100644 --- a/soh/src/code/z_message_PAL.c +++ b/soh/src/code/z_message_PAL.c @@ -1682,7 +1682,8 @@ void Message_OpenText(GlobalContext* globalCtx, u16 textId) { memcpy(font->msgBuf, src, font->msgLength); } - if (textId == 0x0140 && gSaveContext.n64ddFlag) { // 888888888 + // (From z_player.c) In rando, Navi gives rando-related advice + if (textId == 0x0140 && gSaveContext.n64ddFlag) { RandoNaviTip(globalCtx); msgCtx->msgLength = font->msgLength = strlen(font->msgBuf); } From b4c9f4aa6ee71795bfc5fa6251c85123d2949cf8 Mon Sep 17 00:00:00 2001 From: Sarge-117 Date: Tue, 9 Aug 2022 16:07:58 -0700 Subject: [PATCH 09/23] Test switch to new message system Testing setting up the table and calling the messages --- soh/soh/Enhancements/randomizer/randomizer.cpp | 11 +++++++++++ soh/soh/Enhancements/randomizer/randomizer.h | 1 + soh/soh/OTRGlobals.cpp | 8 ++++++++ soh/src/code/z_message_PAL.c | 3 ++- soh/src/overlays/actors/ovl_player_actor/z_player.c | 6 +++--- 5 files changed, 25 insertions(+), 4 deletions(-) diff --git a/soh/soh/Enhancements/randomizer/randomizer.cpp b/soh/soh/Enhancements/randomizer/randomizer.cpp index 250f4e3f1..0c6a7530a 100644 --- a/soh/soh/Enhancements/randomizer/randomizer.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer.cpp @@ -27,6 +27,7 @@ u8 generated; const std::string Randomizer::getItemMessageTableID = "Randomizer"; const std::string Randomizer::hintMessageTableID = "RandomizerHints"; const std::string Randomizer::scrubMessageTableID = "RandomizerScrubs"; +const std::string Randomizer::NaviRandoMessageTableID = "RandomizerNavi"; Randomizer::Randomizer() { Sprite bowSprite = { dgFairyBowIconTex, 32, 32, G_IM_FMT_RGBA, G_IM_SIZ_32b, 0 }; @@ -4418,6 +4419,15 @@ void CreateScrubMessages() { } } +void CreateNaviRandoMessages() { + CustomMessageManager* customMessageManager = CustomMessageManager::Instance; + customMessageManager->AddCustomMessageTable(Randomizer::NaviRandoMessageTableID); + customMessageManager->CreateMessage(Randomizer::NaviRandoMessageTableID, 0x00, + { TEXTBOX_TYPE_BLACK, TEXTBOX_POS_BOTTOM, "Test Eng0", "Test Ger", "Test Fre" }); + customMessageManager->CreateMessage(Randomizer::NaviRandoMessageTableID, 0x01, + { TEXTBOX_TYPE_BLACK, TEXTBOX_POS_BOTTOM, "Test Eng1", "Test Ger", "Test Fre" }); +} + void Randomizer::CreateCustomMessages() { // RANDTODO: Translate into french and german and replace GIMESSAGE_UNTRANSLATED // with GIMESSAGE(getItemID, itemID, english, german, french). @@ -4446,6 +4456,7 @@ void Randomizer::CreateCustomMessages() { }; CreateGetItemMessages(getItemMessages); CreateScrubMessages(); + CreateNaviRandoMessages(); } void InitRando() { diff --git a/soh/soh/Enhancements/randomizer/randomizer.h b/soh/soh/Enhancements/randomizer/randomizer.h index 1994cfdc4..eb0ef5edd 100644 --- a/soh/soh/Enhancements/randomizer/randomizer.h +++ b/soh/soh/Enhancements/randomizer/randomizer.h @@ -29,6 +29,7 @@ class Randomizer { static const std::string getItemMessageTableID; static const std::string hintMessageTableID; static const std::string scrubMessageTableID; + static const std::string NaviRandoMessageTableID; static Sprite* GetSeedTexture(uint8_t index); s16 GetItemModelFromId(s16 itemId); diff --git a/soh/soh/OTRGlobals.cpp b/soh/soh/OTRGlobals.cpp index b85d092fb..8630e0dcc 100644 --- a/soh/soh/OTRGlobals.cpp +++ b/soh/soh/OTRGlobals.cpp @@ -1449,6 +1449,11 @@ extern "C" CustomMessageEntry Randomizer_GetScrubMessage(u16 scrubTextId) { return CustomMessageManager::Instance->RetrieveMessage(Randomizer::scrubMessageTableID, price); } +extern "C" CustomMessageEntry Randomizer_GetNaviMessage() { + u16 naviTextId = rand() % 2; + return CustomMessageManager::Instance->RetrieveMessage(Randomizer::NaviRandoMessageTableID, naviTextId); +} + extern "C" CustomMessageEntry Randomizer_GetAltarMessage() { return (LINK_IS_ADULT) ? CustomMessageManager::Instance->RetrieveMessage(Randomizer::hintMessageTableID, TEXT_ALTAR_ADULT) @@ -1542,7 +1547,10 @@ extern "C" int CustomMessage_RetrieveIfExists(GlobalContext* globalCtx) { } } else if (textId == TEXT_SCRUB_POH || textId == TEXT_SCRUB_STICK_UPGRADE || textId == TEXT_SCRUB_NUT_UPGRADE) { messageEntry = Randomizer_GetScrubMessage(textId); + } else if (textId >= 0x0140 && textId <= 0x015F) { + messageEntry = Randomizer_GetNaviMessage(); } + } if (textId == TEXT_GS_NO_FREEZE || textId == TEXT_GS_FREEZE) { if (CVar_GetS32("gInjectSkulltulaCount", 0) != 0) { diff --git a/soh/src/code/z_message_PAL.c b/soh/src/code/z_message_PAL.c index 07f80fba2..430a7e3fa 100644 --- a/soh/src/code/z_message_PAL.c +++ b/soh/src/code/z_message_PAL.c @@ -1682,11 +1682,12 @@ void Message_OpenText(GlobalContext* globalCtx, u16 textId) { memcpy(font->msgBuf, src, font->msgLength); } + /* // (From z_player.c) In rando, Navi gives rando-related advice if (textId == 0x0140 && gSaveContext.n64ddFlag) { RandoNaviTip(globalCtx); msgCtx->msgLength = font->msgLength = strlen(font->msgBuf); - } + }*/ msgCtx->textBoxProperties = font->charTexBuf[0]; msgCtx->textBoxType = msgCtx->textBoxProperties >> 4; diff --git a/soh/src/overlays/actors/ovl_player_actor/z_player.c b/soh/src/overlays/actors/ovl_player_actor/z_player.c index 1b70d3e4f..0694deb90 100644 --- a/soh/src/overlays/actors/ovl_player_actor/z_player.c +++ b/soh/src/overlays/actors/ovl_player_actor/z_player.c @@ -15293,8 +15293,8 @@ void func_80853148(GlobalContext* globalCtx, Actor* actor) { this->naviActor->flags |= ACTOR_FLAG_8; func_80835EA4(globalCtx, 0xB); // If rando'd and Navi wants to give you a general quest tip, give a rando tip instead - if (actor->textId >= 0x0140 && actor->textId <= 0x015F && gSaveContext.n64ddFlag) { - Message_StartTextbox(globalCtx, 0x0140, NULL); - } + // if (actor->textId >= 0x0140 && actor->textId <= 0x015F && gSaveContext.n64ddFlag) { + // Message_StartTextbox(globalCtx, 0x0140, NULL); + // } } } From 3c4405347d4b7e52d5cf8a91d08ce8d10e39f59c Mon Sep 17 00:00:00 2001 From: Sarge-117 Date: Tue, 9 Aug 2022 18:35:39 -0700 Subject: [PATCH 10/23] Remove old stuff + add test messages --- soh/CMakeLists.txt | 1 - .../Enhancements/randomizer/randomizer.cpp | 25 ++++++++++++++++--- soh/soh/OTRGlobals.cpp | 2 +- soh/src/code/z_message_PAL.c | 7 ------ .../actors/ovl_player_actor/z_player.c | 4 --- 5 files changed, 22 insertions(+), 17 deletions(-) diff --git a/soh/CMakeLists.txt b/soh/CMakeLists.txt index 85fd7f080..5342374f0 100644 --- a/soh/CMakeLists.txt +++ b/soh/CMakeLists.txt @@ -485,7 +485,6 @@ set(Source_Files__src__code "src/code/z_map_exp.c" "src/code/z_map_mark.c" "src/code/z_message_PAL.c" - "src/code/z_message_RandoNaviTips.c" "src/code/z_moji.c" "src/code/z_msgevent.c" "src/code/z_olib.c" diff --git a/soh/soh/Enhancements/randomizer/randomizer.cpp b/soh/soh/Enhancements/randomizer/randomizer.cpp index 0c6a7530a..7eea3f788 100644 --- a/soh/soh/Enhancements/randomizer/randomizer.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer.cpp @@ -4419,13 +4419,16 @@ void CreateScrubMessages() { } } +CustomMessageMinimal NaviMessages[]; + void CreateNaviRandoMessages() { CustomMessageManager* customMessageManager = CustomMessageManager::Instance; customMessageManager->AddCustomMessageTable(Randomizer::NaviRandoMessageTableID); - customMessageManager->CreateMessage(Randomizer::NaviRandoMessageTableID, 0x00, - { TEXTBOX_TYPE_BLACK, TEXTBOX_POS_BOTTOM, "Test Eng0", "Test Ger", "Test Fre" }); - customMessageManager->CreateMessage(Randomizer::NaviRandoMessageTableID, 0x01, - { TEXTBOX_TYPE_BLACK, TEXTBOX_POS_BOTTOM, "Test Eng1", "Test Ger", "Test Fre" }); + for (int i = 0; i <= 3; i++) { + customMessageManager->CreateMessage(Randomizer::NaviRandoMessageTableID, i, + { TEXTBOX_TYPE_BLACK, TEXTBOX_POS_BOTTOM, NaviMessages[i].english, + NaviMessages[i].german, NaviMessages[i].french }); + } } void Randomizer::CreateCustomMessages() { @@ -4471,3 +4474,17 @@ void Rando_Init(void) { } } + +CustomMessageMinimal NaviMessages[3] = { { "%cMissing a small key in a dungeon?&Maybe the %rboss %chas it!", + "%cGerman tip about playing rando! 0", + "%cFrench tip about playing rando! 0" }, + + { "%cSometimes you can use the %rMegaton &Hammer %cinstead of bombs!", + "%cGerman tip about playing rando! 1", + "%cFrench tip about playing rando! 1" }, + + { "%cThere are three %gbusiness scrubs %cin &Hyrule who sell %wmysterious items%c. Do &you know where they are?", + "%cGerman tip about playing rando! 2", + "%cFrench tip about playing rando! 2" } + +}; diff --git a/soh/soh/OTRGlobals.cpp b/soh/soh/OTRGlobals.cpp index 8630e0dcc..d79ab84d9 100644 --- a/soh/soh/OTRGlobals.cpp +++ b/soh/soh/OTRGlobals.cpp @@ -1450,7 +1450,7 @@ extern "C" CustomMessageEntry Randomizer_GetScrubMessage(u16 scrubTextId) { } extern "C" CustomMessageEntry Randomizer_GetNaviMessage() { - u16 naviTextId = rand() % 2; + u16 naviTextId = rand() % 3; return CustomMessageManager::Instance->RetrieveMessage(Randomizer::NaviRandoMessageTableID, naviTextId); } diff --git a/soh/src/code/z_message_PAL.c b/soh/src/code/z_message_PAL.c index 430a7e3fa..11c59db8b 100644 --- a/soh/src/code/z_message_PAL.c +++ b/soh/src/code/z_message_PAL.c @@ -1682,13 +1682,6 @@ void Message_OpenText(GlobalContext* globalCtx, u16 textId) { memcpy(font->msgBuf, src, font->msgLength); } - /* - // (From z_player.c) In rando, Navi gives rando-related advice - if (textId == 0x0140 && gSaveContext.n64ddFlag) { - RandoNaviTip(globalCtx); - msgCtx->msgLength = font->msgLength = strlen(font->msgBuf); - }*/ - msgCtx->textBoxProperties = font->charTexBuf[0]; msgCtx->textBoxType = msgCtx->textBoxProperties >> 4; msgCtx->textBoxPos = msgCtx->textBoxProperties & 0xF; diff --git a/soh/src/overlays/actors/ovl_player_actor/z_player.c b/soh/src/overlays/actors/ovl_player_actor/z_player.c index 0694deb90..eac49315d 100644 --- a/soh/src/overlays/actors/ovl_player_actor/z_player.c +++ b/soh/src/overlays/actors/ovl_player_actor/z_player.c @@ -15292,9 +15292,5 @@ void func_80853148(GlobalContext* globalCtx, Actor* actor) { if ((this->naviActor == this->targetActor) && ((this->targetActor->textId & 0xFF00) != 0x200)) { this->naviActor->flags |= ACTOR_FLAG_8; func_80835EA4(globalCtx, 0xB); - // If rando'd and Navi wants to give you a general quest tip, give a rando tip instead - // if (actor->textId >= 0x0140 && actor->textId <= 0x015F && gSaveContext.n64ddFlag) { - // Message_StartTextbox(globalCtx, 0x0140, NULL); - // } } } From 6de7ce372058b017b4a8b6d973121b274057ec59 Mon Sep 17 00:00:00 2001 From: Sarge-117 <108380086+Sarge-117@users.noreply.github.com> Date: Tue, 9 Aug 2022 18:37:42 -0700 Subject: [PATCH 11/23] Delete z_message_RandoNaviTips.c --- soh/src/code/z_message_RandoNaviTips.c | 313 ------------------------- 1 file changed, 313 deletions(-) delete mode 100644 soh/src/code/z_message_RandoNaviTips.c diff --git a/soh/src/code/z_message_RandoNaviTips.c b/soh/src/code/z_message_RandoNaviTips.c deleted file mode 100644 index 8ac714e55..000000000 --- a/soh/src/code/z_message_RandoNaviTips.c +++ /dev/null @@ -1,313 +0,0 @@ -#include "global.h" -#include "message_data_static.h" -#include "vt.h" - -#include - -// Function for letting Navi give general rando tips to the player instead of her -// normal generic quest tips. - -// Only applies to Navi's overworld quest hints - does not apply to enemy information -// or contextual hints (e.g. "This hallway is twisted!" in Forest Temple) - -void RandoNaviTip(GlobalContext* globalCtx) { - u16 randNaviTip = rand() % 15; // Random number between 0 and total number of Navi tips - MessageContext* msgCtx = &globalCtx->msgCtx; - Font* font = &msgCtx->font; - - if (randNaviTip == 0) { - switch (gSaveContext.language) { - case LANGUAGE_FRA: - strcpy(font->msgBuf, "\x05\x44" - "French tip about playing rando! 0\x02"); - break; - case LANGUAGE_GER: - strcpy(font->msgBuf, "\x05\x44" - "German tip about playing rando! 0\x02"); - break; - case LANGUAGE_ENG: - default: - strcpy(font->msgBuf, "\x05\x44" - "Missing a small key in a dungeon?\x01" - "Maybe the\x05\x41 boss\x05\x44 has it!\x02"); - break; - } - } - if (randNaviTip == 1) { - switch (gSaveContext.language) { - case LANGUAGE_FRA: - strcpy(font->msgBuf, "\x05\x44" - "French tip about playing rando! 1\x02"); - break; - case LANGUAGE_GER: - strcpy(font->msgBuf, "\x05\x44" - "German tip about playing rando! 1\x02"); - break; - case LANGUAGE_ENG: - default: - strcpy(font->msgBuf, "\x05\x44" - "Sometimes you can use the \x05\x41Megaton\x01" - "Hammer \x05\x44instead of bombs!\x02"); - break; - } - } - if (randNaviTip == 2) { - switch (gSaveContext.language) { - case LANGUAGE_FRA: - strcpy(font->msgBuf, "\x05\x44" - "French tip about playing rando! 2\x02"); - break; - case LANGUAGE_GER: - strcpy(font->msgBuf, "\x05\x44" - "German tip about playing rando! 2\x02"); - break; - case LANGUAGE_ENG: - default: - strcpy(font->msgBuf, "\x05\x44" - "There are three\x05\x42 business scrubs\x05\x44 in\x01" - "Hyrule who sell \x05\x49mysterious items\x05\x44. Do\x01" - "you know where they are?\x02"); - break; - } - } - if (randNaviTip == 3) { - switch (gSaveContext.language) { - case LANGUAGE_FRA: - strcpy(font->msgBuf, "\x05\x44" - "French tip about playing rando! 3\x02"); - break; - case LANGUAGE_GER: - strcpy(font->msgBuf, "\x05\x44" - "German tip about playing rando! 3\x02"); - break; - case LANGUAGE_ENG: - default: - strcpy(font->msgBuf, "\x05\x44" - "Stuck on this seed? You could\x01" - "throw in the towel and check the \x01" - "\x05\x49spoiler log\x05\x44...\x02"); - break; - } - } - if (randNaviTip == 4) { - switch (gSaveContext.language) { - case LANGUAGE_FRA: - strcpy(font->msgBuf, "\x05\x44" - "French tip about playing rando! 4\x02"); - break; - case LANGUAGE_GER: - strcpy(font->msgBuf, "\x05\x44" - "German tip about playing rando! 4\x02"); - break; - case LANGUAGE_ENG: - default: - strcpy(font->msgBuf, "\x05\x44" - "Did you know that the \x05\x46Hover\x01" - "Boots\x05\x44 can be used to cross \x01" - "quicksand?\x02"); - break; - } - } - if (randNaviTip == 5) { - switch (gSaveContext.language) { - case LANGUAGE_FRA: - strcpy(font->msgBuf, "\x05\x44" - "French tip about playing rando! 5\x02"); - break; - case LANGUAGE_GER: - strcpy(font->msgBuf, "\x05\x44" - "German tip about playing rando! 5\x02"); - break; - case LANGUAGE_ENG: - default: - strcpy(font->msgBuf, "\x05\x44" - "You can get into the back of\x01\x05\x49" - "Impa's House\x05\x44 by jumping from the\x01" - "unfinished house with a \x05\x41" - "Cucco\x05\x44!\x02"); - break; - } - } - if (randNaviTip == 6) { - switch (gSaveContext.language) { - case LANGUAGE_FRA: - strcpy(font->msgBuf, "\x05\x44" - "French tip about playing rando! 6\x02"); - break; - case LANGUAGE_GER: - strcpy(font->msgBuf, "\x05\x44" - "German tip about playing rando! 6\x02"); - break; - case LANGUAGE_ENG: - default: - strcpy(font->msgBuf, "\x05\x44" - "The \x05\x46Spirit Trial \x05\x44in \x05\x45Ganon's Castle\x05\x44\x01" - "has a\x05\x40 hidden chest\x05\x44 somewhere.\x01" - "Did you already know that?\x02"); - break; - } - } - if (randNaviTip == 7) { - switch (gSaveContext.language) { - case LANGUAGE_FRA: - strcpy(font->msgBuf, "\x05\x44" - "French tip about playing rando! 7\x02"); - break; - case LANGUAGE_GER: - strcpy(font->msgBuf, "\x05\x44" - "German tip about playing rando! 7\x02"); - break; - case LANGUAGE_ENG: - default: - strcpy(font->msgBuf, "\x05\x44" - "You know the \x05\x40" - "Bombchu Bowling\x01" - "Alley\x05\x44? I heard \x05\x40only two of the\x01" - "prizes\x05\x44 are worthwhile. The rest\x01" - "is junk!\x02"); - break; - } - } - if (randNaviTip == 8) { - switch (gSaveContext.language) { - case LANGUAGE_FRA: - strcpy(font->msgBuf, "\x05\x44" - "French tip about playing rando! 8\x02"); - break; - case LANGUAGE_GER: - strcpy(font->msgBuf, "\x05\x44" - "German tip about playing rando! 8\x02"); - break; - case LANGUAGE_ENG: - default: - strcpy(font->msgBuf, "\x05\x44" - "Have you been using \x05\x40" - "Deku Nuts \x05\x44\x01" - "enough? I've seen them blow up\x01" - "a \x05\x41" - "Bombchu\x05\x44!\x02"); - break; - } - } - if (randNaviTip == 9) { - switch (gSaveContext.language) { - case LANGUAGE_FRA: - strcpy(font->msgBuf, "\x05\x44" - "French tip about playing rando! 9\x02"); - break; - case LANGUAGE_GER: - strcpy(font->msgBuf, "\x05\x44" - "German tip about playing rando! 9\x02"); - break; - case LANGUAGE_ENG: - default: - strcpy(font->msgBuf, "\x05\x44" - "You might end up with an \x05\x40" - "extra\x01" - "key\x05\x44 for the \x05\x43Water Temple\x05\x44 or the \x05\x41" - "Fire\x01" - "Temple\x05\x44. It's for your safety!\x02"); - break; - } - } - if (randNaviTip == 10) { - switch (gSaveContext.language) { - case LANGUAGE_FRA: - strcpy(font->msgBuf, "\x05\x44" - "French tip about playing rando! 10\x02"); - break; - case LANGUAGE_GER: - strcpy(font->msgBuf, "\x05\x44" - "German tip about playing rando! 10\x02"); - break; - case LANGUAGE_ENG: - default: - strcpy(font->msgBuf, "\x05\x44" - "If you can't pick up a \x05\x41" - "bomb\x01" - "flower \x05\x44with your hands, you\x01" - "can still detonate it with \x01" - "an \x05\x40" - "arrow\x05\x44!\x02"); - break; - } - } - if (randNaviTip == 11) { - switch (gSaveContext.language) { - case LANGUAGE_FRA: - strcpy(font->msgBuf, "\x05\x44" - "French tip about playing rando! 11\x02"); - break; - case LANGUAGE_GER: - strcpy(font->msgBuf, "\x05\x44" - "German tip about playing rando! 11\x02"); - break; - case LANGUAGE_ENG: - default: - strcpy(font->msgBuf, "\x05\x44" - "Even an adult can't push large\x01" - "blocks without some \x05\x40" - "extra\x01" - "strength\x05\x44!\x02"); - break; - } - } - if (randNaviTip == 12) { - switch (gSaveContext.language) { - case LANGUAGE_FRA: - strcpy(font->msgBuf, "\x05\x44" - "French tip about playing rando! 12\x02"); - break; - case LANGUAGE_GER: - strcpy(font->msgBuf, "\x05\x44" - "German tip about playing rando! 12\x02"); - break; - case LANGUAGE_ENG: - default: - strcpy(font->msgBuf, "\x05\x44" - "I've heard that\x05\x41 Flare Dancer\x05\x44\x01" - "is weak to the \x05\x40Master Sword\x05\x44!\x01" - "Have you tried it?\x02"); - break; - } - } - if (randNaviTip == 13) { - switch (gSaveContext.language) { - case LANGUAGE_FRA: - strcpy(font->msgBuf, "\x05\x44" - "French tip about playing rando! 12\x02"); - break; - case LANGUAGE_GER: - strcpy(font->msgBuf, "\x05\x44" - "German tip about playing rando! 12\x02"); - break; - case LANGUAGE_ENG: - default: - strcpy(font->msgBuf, "\x05\x44" - "Don't have a weapon to kill a\x01" - "\x05\x41spider\x05\x44? Try throwing a \x05\x40pot\x01" - "\x05\x44" - "at it!\x02"); - break; - } - } - if (randNaviTip == 14) { - switch (gSaveContext.language) { - case LANGUAGE_FRA: - strcpy(font->msgBuf, "\x05\x44" - "French tip about playing rando! 12\x02"); - break; - case LANGUAGE_GER: - strcpy(font->msgBuf, "\x05\x44" - "German tip about playing rando! 12\x02"); - break; - case LANGUAGE_ENG: - default: - strcpy(font->msgBuf, "\x05\x44" - "I hear the patch of \x05\x40soft soil\x05\x44\x01" - "in \x05\x43Zora's River\x05\x44 is the only one\x01" - "that isn't home to a \x05\x41spider\x05\x44!\x02"); - break; - } - } -} \ No newline at end of file From e2ff5848391145714ec07f09bf70a49b840d1fd7 Mon Sep 17 00:00:00 2001 From: Sarge-117 Date: Tue, 9 Aug 2022 20:13:39 -0700 Subject: [PATCH 12/23] Add remaining tips All the sample hints are now working under the new message system --- .../Enhancements/randomizer/randomizer.cpp | 70 ++++++++++++++++--- soh/soh/OTRGlobals.cpp | 2 +- 2 files changed, 61 insertions(+), 11 deletions(-) diff --git a/soh/soh/Enhancements/randomizer/randomizer.cpp b/soh/soh/Enhancements/randomizer/randomizer.cpp index 7eea3f788..f3460c05a 100644 --- a/soh/soh/Enhancements/randomizer/randomizer.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer.cpp @@ -4424,7 +4424,7 @@ CustomMessageMinimal NaviMessages[]; void CreateNaviRandoMessages() { CustomMessageManager* customMessageManager = CustomMessageManager::Instance; customMessageManager->AddCustomMessageTable(Randomizer::NaviRandoMessageTableID); - for (int i = 0; i <= 3; i++) { + for (int i = 0; i <= 14; i++) { customMessageManager->CreateMessage(Randomizer::NaviRandoMessageTableID, i, { TEXTBOX_TYPE_BLACK, TEXTBOX_POS_BOTTOM, NaviMessages[i].english, NaviMessages[i].german, NaviMessages[i].french }); @@ -4475,16 +4475,66 @@ void Rando_Init(void) { } -CustomMessageMinimal NaviMessages[3] = { { "%cMissing a small key in a dungeon?&Maybe the %rboss %chas it!", - "%cGerman tip about playing rando! 0", - "%cFrench tip about playing rando! 0" }, +CustomMessageMinimal NaviMessages[15] = { + + { "%cMissing a small key in a dungeon?&Maybe the %rboss %chas it!", + "%cGerman tip about playing rando! 0", + "%cFrench tip about playing rando! 0" }, - { "%cSometimes you can use the %rMegaton &Hammer %cinstead of bombs!", - "%cGerman tip about playing rando! 1", - "%cFrench tip about playing rando! 1" }, + { "%cSometimes you can use the %rMegaton&Hammer %cinstead of bombs!", + "%cGerman tip about playing rando! 1", + "%cFrench tip about playing rando! 1" }, - { "%cThere are three %gbusiness scrubs %cin &Hyrule who sell %wmysterious items%c. Do &you know where they are?", - "%cGerman tip about playing rando! 2", - "%cFrench tip about playing rando! 2" } + { "%cThere are three %gbusiness scrubs %cin &Hyrule who sell %wmysterious items%c. Do&you know where they are?", + "%cGerman tip about playing rando! 2", + "%cFrench tip about playing rando! 2" }, + + { "%cStuck on this seed? You could &throw in the towel and check the&%wspoiler log%c...", + "%cGerman tip about playing rando! 3", + "%cFrench tip about playing rando! 3" }, + + { "%cDid you know that the %yHover&Boots %ccan be used to cross&quicksand?", + "%cGerman tip about playing rando! 4", + "%cFrench tip about playing rando! 4" }, + + { "%cYou can reach the back of %wImpa's&House %cby jumping from the&unfinished house with a %rcucco%c!", + "%cGerman tip about playing rando! 5", + "%cFrench tip about playing rando! 5" }, + + { "%cThe %ySpirit Trial %cin %pGanon's Castle&%chas a %whidden chest %csomewhere.&Did you already know that?", + "%cGerman tip about playing rando! 6", + "%cFrench tip about playing rando! 6" }, + + { "%cYou know the %wBombchu Bowling&Alley%c? I heard %wonly two of the &prizes %care worthwhile. The rest &is junk!", + "%cGerman tip about playing rando! 7", + "%cFrench tip about playing rando! 7" }, + + { "%cHave you been using %wDeku Nuts&%cenough? I've seen them blow up&a %rBombchu%c!", + "%cGerman tip about playing rando! 8", + "%cFrench tip about playing rando! 8" }, + + { "%cYou might end up with an %wextra&key %cfor the %bWater Temple %cor the&%rFire Temple%c. It's for your safety!", + "%cGerman tip about playing rando! 9", + "%cFrench tip about playing rando! 9" }, + + { "%cIf you can't pick up a %rbomb&flower %cwith your hands, you can&still detonate it with %rfire %cor&with %warrows%c!", + "%cGerman tip about playing rando! 10", + "%cFrench tip about playing rando! 10" }, + + { "%cEven an adult can't push large&blocks without some %wextra&strength%c!", + "%cGerman tip about playing rando! 11", + "%cFrench tip about playing rando! 11" }, + + { "%cI've heard that %rFlare Dancer&%cis weak to the Master Sword!&Have you tried it?", + "%cGerman tip about playing rando! 12", + "%cFrench tip about playing rando! 12" }, + + { "%cDon't have a weapon to kill a&%rspider%c? Try throwing a %wpot&%cat it!", + "%cGerman tip about playing rando! 13", + "%cFrench tip about playing rando! 13" }, + + { "%cI hear the patch of %wsoft soil&%cin %bZora's River %cis the only one&that isn't home to a %rspider%c!", + "%cGerman tip about playing rando! 14", + "%cFrench tip about playing rando! 14" }, }; diff --git a/soh/soh/OTRGlobals.cpp b/soh/soh/OTRGlobals.cpp index d79ab84d9..f45c5bc40 100644 --- a/soh/soh/OTRGlobals.cpp +++ b/soh/soh/OTRGlobals.cpp @@ -1450,7 +1450,7 @@ extern "C" CustomMessageEntry Randomizer_GetScrubMessage(u16 scrubTextId) { } extern "C" CustomMessageEntry Randomizer_GetNaviMessage() { - u16 naviTextId = rand() % 3; + u16 naviTextId = rand() % 15; return CustomMessageManager::Instance->RetrieveMessage(Randomizer::NaviRandoMessageTableID, naviTextId); } From af03a80ad359081f016e08dbd74dd5a93daa00cd Mon Sep 17 00:00:00 2001 From: Sarge-117 Date: Wed, 10 Aug 2022 11:06:38 -0700 Subject: [PATCH 13/23] Create const "NaviMsgCount" So the number of messages doesn't have to be changed in 3 places when adding new entries --- soh/soh/Enhancements/randomizer/randomizer.cpp | 5 +++-- soh/soh/OTRGlobals.cpp | 5 ++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/soh/soh/Enhancements/randomizer/randomizer.cpp b/soh/soh/Enhancements/randomizer/randomizer.cpp index f3460c05a..b89777564 100644 --- a/soh/soh/Enhancements/randomizer/randomizer.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer.cpp @@ -4420,11 +4420,12 @@ void CreateScrubMessages() { } CustomMessageMinimal NaviMessages[]; +extern const int NaviMsgCount = 15; void CreateNaviRandoMessages() { CustomMessageManager* customMessageManager = CustomMessageManager::Instance; customMessageManager->AddCustomMessageTable(Randomizer::NaviRandoMessageTableID); - for (int i = 0; i <= 14; i++) { + for (int i = 0; i <= (NaviMsgCount - 1); i++) { customMessageManager->CreateMessage(Randomizer::NaviRandoMessageTableID, i, { TEXTBOX_TYPE_BLACK, TEXTBOX_POS_BOTTOM, NaviMessages[i].english, NaviMessages[i].german, NaviMessages[i].french }); @@ -4475,7 +4476,7 @@ void Rando_Init(void) { } -CustomMessageMinimal NaviMessages[15] = { +CustomMessageMinimal NaviMessages[NaviMsgCount] = { { "%cMissing a small key in a dungeon?&Maybe the %rboss %chas it!", "%cGerman tip about playing rando! 0", diff --git a/soh/soh/OTRGlobals.cpp b/soh/soh/OTRGlobals.cpp index f45c5bc40..001ee1c0d 100644 --- a/soh/soh/OTRGlobals.cpp +++ b/soh/soh/OTRGlobals.cpp @@ -1449,8 +1449,10 @@ extern "C" CustomMessageEntry Randomizer_GetScrubMessage(u16 scrubTextId) { return CustomMessageManager::Instance->RetrieveMessage(Randomizer::scrubMessageTableID, price); } +extern const int NaviMsgCount; + extern "C" CustomMessageEntry Randomizer_GetNaviMessage() { - u16 naviTextId = rand() % 15; + u16 naviTextId = rand() % NaviMsgCount; return CustomMessageManager::Instance->RetrieveMessage(Randomizer::NaviRandoMessageTableID, naviTextId); } @@ -1547,6 +1549,7 @@ extern "C" int CustomMessage_RetrieveIfExists(GlobalContext* globalCtx) { } } else if (textId == TEXT_SCRUB_POH || textId == TEXT_SCRUB_STICK_UPGRADE || textId == TEXT_SCRUB_NUT_UPGRADE) { messageEntry = Randomizer_GetScrubMessage(textId); + // In rando, replace Navi's general overworld hints with rando-related gameplay tips } else if (textId >= 0x0140 && textId <= 0x015F) { messageEntry = Randomizer_GetNaviMessage(); } From 4be473feded067af50a24d9aa83a2ad040d6a555 Mon Sep 17 00:00:00 2001 From: Sarge-117 Date: Mon, 15 Aug 2022 14:02:48 -0700 Subject: [PATCH 14/23] Add German translations Thanks to Menzelmeister on Discord for translating to German --- .../Enhancements/randomizer/randomizer.cpp | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/soh/soh/Enhancements/randomizer/randomizer.cpp b/soh/soh/Enhancements/randomizer/randomizer.cpp index 770cf1dda..6c3f2db95 100644 --- a/soh/soh/Enhancements/randomizer/randomizer.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer.cpp @@ -4730,63 +4730,63 @@ void Rando_Init(void) { CustomMessageMinimal NaviMessages[NaviMsgCount] = { { "%cMissing a small key in a dungeon?&Maybe the %rboss %chas it!", - "%cGerman tip about playing rando! 0", + "%cFehlt dir ein kleiner Schlüssel in &einem Labyrinth? Vielleicht hat ihn&ja der %rEndgegner%c!", "%cFrench tip about playing rando! 0" }, { "%cSometimes you can use the %rMegaton&Hammer %cinstead of bombs!", - "%cGerman tip about playing rando! 1", + "%cManchmal kannst du den %rStahlhammer&%cstatt Bomben verwenden!", "%cFrench tip about playing rando! 1" }, { "%cThere are three %gbusiness scrubs %cin &Hyrule who sell %wmysterious items%c. Do&you know where they are?", - "%cGerman tip about playing rando! 2", + "%cEs gibt drei %gDeku-Händler %cin Hyrule&die mysteriöse Gegenstände&verkaufen. Weißt du wo Sie sind?", "%cFrench tip about playing rando! 2" }, { "%cStuck on this seed? You could &throw in the towel and check the&%wspoiler log%c...", - "%cGerman tip about playing rando! 3", + "%cHängst du bei diesem Seed fest?&Du könntest die Flinte ins Korn&werfen und ins %wSpoiler Log %cschauen...", "%cFrench tip about playing rando! 3" }, { "%cDid you know that the %yHover&Boots %ccan be used to cross&quicksand?", - "%cGerman tip about playing rando! 4", + "%cWusstest du, dass du mit den&%yGleitstiefeln %cTreibsand überqueren&kannst?", "%cFrench tip about playing rando! 4" }, { "%cYou can reach the back of %wImpa's&House %cby jumping from the&unfinished house with a %rcucco%c!", - "%cGerman tip about playing rando! 5", + "%cDu kannst den Balkon von %wImpas&Haus %cerreichen indem du von&der Baustelle aus mit einem %rHuhn&%cspringst!", "%cFrench tip about playing rando! 5" }, { "%cThe %ySpirit Trial %cin %pGanon's Castle&%chas a %whidden chest %csomewhere.&Did you already know that?", - "%cGerman tip about playing rando! 6", + "%cDie %yGeister-Prüfung %cin %pGanons&Schloss %chat irgendwo eine&%wversteckte Kiste%c. Weißt du schon&wo?", "%cFrench tip about playing rando! 6" }, { "%cYou know the %wBombchu Bowling&Alley%c? I heard %wonly two of the &prizes %care worthwhile. The rest &is junk!", - "%cGerman tip about playing rando! 7", + "%cKennst du die %wMinenbowlingbahn%c?&Ich habe gehört dass sich nur &%wzwei der Preise%c lohnen. Der Rest&ist Krimskrams!", "%cFrench tip about playing rando! 7" }, { "%cHave you been using %wDeku Nuts&%cenough? I've seen them blow up&a %rBombchu%c!", - "%cGerman tip about playing rando! 8", + "%cBenutzt du auch genügend %wDeku&Nüsse%c? Ich habe mal gesehen dass&man damit %rKrabbelminen %cdetonieren&kann!", "%cFrench tip about playing rando! 8" }, { "%cYou might end up with an %wextra&key %cfor the %bWater Temple %cor the&%rFire Temple%c. It's for your safety!", - "%cGerman tip about playing rando! 9", + "%cVielleicht verbleibt dir im&%bWassertempel %coder %rFeuertempel %cein&%wzusätzlicher Schlüssel%c. Dies&ist zu deiner Sicherheit!", "%cFrench tip about playing rando! 9" }, { "%cIf you can't pick up a %rbomb&flower %cwith your hands, you can&still detonate it with %rfire %cor&with %warrows%c!", - "%cGerman tip about playing rando! 10", + "%cNur weil du eine %rDonnerblume&%cnicht hochheben kannst, so kannst&du sie immernoch mit %rFeuer %coder&%wPfeilen %cdetonieren!", "%cFrench tip about playing rando! 10" }, { "%cEven an adult can't push large&blocks without some %wextra&strength%c!", - "%cGerman tip about playing rando! 11", + "%cSelbst ein Erwachsener kann ohne&etwas %wzusätzliche Kraft %ckeine&großen Blöcke verschieben!", "%cFrench tip about playing rando! 11" }, { "%cI've heard that %rFlare Dancer&%cis weak to the Master Sword!&Have you tried it?", - "%cGerman tip about playing rando! 12", + "%cIch habe gehört dass der&%rFlammenderwisch %ceine Schwäche für&das Masterschwert aufweist. Hast du&es schonmal versucht einzusetzen?", "%cFrench tip about playing rando! 12" }, { "%cDon't have a weapon to kill a&%rspider%c? Try throwing a %wpot&%cat it!", - "%cGerman tip about playing rando! 13", + "%cFehlt dir die Waffe um gegen&eine %rSkulltula %czu kämpfen? Versuch&Sie mit einem %wKrug %cabzuwerfen!", "%cFrench tip about playing rando! 13" }, { "%cI hear the patch of %wsoft soil&%cin %bZora's River %cis the only one&that isn't home to a %rspider%c!", - "%cGerman tip about playing rando! 14", + "%cIch habe gehört dass die Stelle&%wfeuchten Bodens %cim %bZora-Fluss %cals&einzige keine %rSkulltula %cbeherbergt.", "%cFrench tip about playing rando! 14" }, }; From 3fb582a02b61eae3e1614f129256cb75c1577d42 Mon Sep 17 00:00:00 2001 From: PurpleHato Date: Wed, 17 Aug 2022 20:00:20 +0200 Subject: [PATCH 15/23] ADD: BAGUETTE --- .../Enhancements/randomizer/randomizer.cpp | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/soh/soh/Enhancements/randomizer/randomizer.cpp b/soh/soh/Enhancements/randomizer/randomizer.cpp index 6c3f2db95..61ee8192a 100644 --- a/soh/soh/Enhancements/randomizer/randomizer.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer.cpp @@ -4731,62 +4731,62 @@ CustomMessageMinimal NaviMessages[NaviMsgCount] = { { "%cMissing a small key in a dungeon?&Maybe the %rboss %chas it!", "%cFehlt dir ein kleiner Schlüssel in &einem Labyrinth? Vielleicht hat ihn&ja der %rEndgegner%c!", - "%cFrench tip about playing rando! 0" }, + "%cIl te manque une %wPetite Clé %cdans&un donjon? C'est peut-être le %rboss&%cqui l'a!" }, { "%cSometimes you can use the %rMegaton&Hammer %cinstead of bombs!", "%cManchmal kannst du den %rStahlhammer&%cstatt Bomben verwenden!", - "%cFrench tip about playing rando! 1" }, + "%cParfois, tu peux utiliser la %rMasse&des Titans %cau lieu de tes bombes!" }, { "%cThere are three %gbusiness scrubs %cin &Hyrule who sell %wmysterious items%c. Do&you know where they are?", "%cEs gibt drei %gDeku-Händler %cin Hyrule&die mysteriöse Gegenstände&verkaufen. Weißt du wo Sie sind?", - "%cFrench tip about playing rando! 2" }, + "%cIl y a trois %gPestes Marchandes%c en&Hyrule qui vendent des %wobjets&mystérieux%c. Tu sais où elles sont?" }, { "%cStuck on this seed? You could &throw in the towel and check the&%wspoiler log%c...", "%cHängst du bei diesem Seed fest?&Du könntest die Flinte ins Korn&werfen und ins %wSpoiler Log %cschauen...", - "%cFrench tip about playing rando! 3" }, + "%cSi tu es coincé sur cette seed,&tu peux toujours jeter l'éponge&et regader le %wSpoiler log%c..." }, - { "%cDid you know that the %yHover&Boots %ccan be used to cross&quicksand?", - "%cWusstest du, dass du mit den&%yGleitstiefeln %cTreibsand überqueren&kannst?", - "%cFrench tip about playing rando! 4" }, + { "%cDid you know that the %yHover&Boots %ccan be used to cross&%wquicksand?", + "%cWusstest du, dass du mit den&%yGleitstiefeln %cTreibsand %wüberqueren&kannst%c?", + "%cEst-ce que tu savais que les %rBottes&des airs %cpouvaient être utilisées&pour traverser les %wsables mouvants%c?" }, { "%cYou can reach the back of %wImpa's&House %cby jumping from the&unfinished house with a %rcucco%c!", "%cDu kannst den Balkon von %wImpas&Haus %cerreichen indem du von&der Baustelle aus mit einem %rHuhn&%cspringst!", - "%cFrench tip about playing rando! 5" }, + "%cTu peux atteindre l'arrière de la&%wMaison d'Impa %cen sautant depuis la&maison en construction avec une&%rcocotte%c!" }, { "%cThe %ySpirit Trial %cin %pGanon's Castle&%chas a %whidden chest %csomewhere.&Did you already know that?", "%cDie %yGeister-Prüfung %cin %pGanons&Schloss %chat irgendwo eine&%wversteckte Kiste%c. Weißt du schon&wo?", - "%cFrench tip about playing rando! 6" }, + "%cL'%yÉpreuve de l'Esprit%c dans le %pChâteau&de Ganon %ca un coffre caché quelque&part.&Je suppose que tu&le savais déjà?" }, { "%cYou know the %wBombchu Bowling&Alley%c? I heard %wonly two of the &prizes %care worthwhile. The rest &is junk!", "%cKennst du die %wMinenbowlingbahn%c?&Ich habe gehört dass sich nur &%wzwei der Preise%c lohnen. Der Rest&ist Krimskrams!", - "%cFrench tip about playing rando! 7" }, + "%cEst-ce que tu savais qu'au %wBowling&Teigneux%c, il n'y a que les %wdeux&premiers prix %cqui sont intéréssant?" }, { "%cHave you been using %wDeku Nuts&%cenough? I've seen them blow up&a %rBombchu%c!", "%cBenutzt du auch genügend %wDeku&Nüsse%c? Ich habe mal gesehen dass&man damit %rKrabbelminen %cdetonieren&kann!", - "%cFrench tip about playing rando! 8" }, + "%cTu es sûr d'utiliser tes %wNoix Mojo &%ccorrectement? J'en ai déjà vu&exploser des %rChoux-Péteurs%c!" }, { "%cYou might end up with an %wextra&key %cfor the %bWater Temple %cor the&%rFire Temple%c. It's for your safety!", "%cVielleicht verbleibt dir im&%bWassertempel %coder %rFeuertempel %cein&%wzusätzlicher Schlüssel%c. Dies&ist zu deiner Sicherheit!", - "%cFrench tip about playing rando! 9" }, + "%cIl se peut que tu aies une %wPetite&Clé %cen trop dans le %bTemple de l'Eau&%cou le %rTemple du Feu%c. C'est pour ta&propre sécurité!" }, { "%cIf you can't pick up a %rbomb&flower %cwith your hands, you can&still detonate it with %rfire %cor&with %warrows%c!", "%cNur weil du eine %rDonnerblume&%cnicht hochheben kannst, so kannst&du sie immernoch mit %rFeuer %coder&%wPfeilen %cdetonieren!", - "%cFrench tip about playing rando! 10" }, + "%cSi tu ne peux pas ramasser&un %rChoux-Péteur %cavec tes mains, tu&peux toujours le faire exploser&avec du %rFeu %cou avec des %wflèches%c!" }, { "%cEven an adult can't push large&blocks without some %wextra&strength%c!", "%cSelbst ein Erwachsener kann ohne&etwas %wzusätzliche Kraft %ckeine&großen Blöcke verschieben!", - "%cFrench tip about playing rando! 11" }, + "%cMême un adulte ne peut pas pousser&de grands blocs sans un petit %wgain&de force%c!" }, { "%cI've heard that %rFlare Dancer&%cis weak to the Master Sword!&Have you tried it?", "%cIch habe gehört dass der&%rFlammenderwisch %ceine Schwäche für&das Masterschwert aufweist. Hast du&es schonmal versucht einzusetzen?", - "%cFrench tip about playing rando! 12" }, + "%cJ'ai entendu dire que les %rDanse-&Flammes %csont faîble face à l'%wÉpée de&Légende%c! Est-ce que tu as essayé?" }, { "%cDon't have a weapon to kill a&%rspider%c? Try throwing a %wpot&%cat it!", "%cFehlt dir die Waffe um gegen&eine %rSkulltula %czu kämpfen? Versuch&Sie mit einem %wKrug %cabzuwerfen!", - "%cFrench tip about playing rando! 13" }, + "%cSi tu n'as pas d'arme pour tuer&une %raraignée%c, pourquoi n'essayerais&-tu pas de lui jetter une %wjarre&%cà la figure?" }, { "%cI hear the patch of %wsoft soil&%cin %bZora's River %cis the only one&that isn't home to a %rspider%c!", "%cIch habe gehört dass die Stelle&%wfeuchten Bodens %cim %bZora-Fluss %cals&einzige keine %rSkulltula %cbeherbergt.", - "%cFrench tip about playing rando! 14" }, + "%cJ'ai entendu dire que la %wterre meuble&%cqui se trouve à la %bRivière Zora %cest&la seule qui ne contienne pas&d'%raraignée%c." }, }; From 907871915dbcde54984079420982c02b70f4ddd4 Mon Sep 17 00:00:00 2001 From: Sarge-117 Date: Wed, 17 Aug 2022 11:07:03 -0700 Subject: [PATCH 16/23] fix question mark --- soh/soh/Enhancements/randomizer/randomizer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/soh/soh/Enhancements/randomizer/randomizer.cpp b/soh/soh/Enhancements/randomizer/randomizer.cpp index 61ee8192a..2cbe57cf6 100644 --- a/soh/soh/Enhancements/randomizer/randomizer.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer.cpp @@ -4745,7 +4745,7 @@ CustomMessageMinimal NaviMessages[NaviMsgCount] = { "%cHängst du bei diesem Seed fest?&Du könntest die Flinte ins Korn&werfen und ins %wSpoiler Log %cschauen...", "%cSi tu es coincé sur cette seed,&tu peux toujours jeter l'éponge&et regader le %wSpoiler log%c..." }, - { "%cDid you know that the %yHover&Boots %ccan be used to cross&%wquicksand?", + { "%cDid you know that the %yHover&Boots %ccan be used to cross&%wquicksand%c?", "%cWusstest du, dass du mit den&%yGleitstiefeln %cTreibsand %wüberqueren&kannst%c?", "%cEst-ce que tu savais que les %rBottes&des airs %cpouvaient être utilisées&pour traverser les %wsables mouvants%c?" }, From 2c144c3aa61cb71f3ce3c0e4e4daa4883f3e640c Mon Sep 17 00:00:00 2001 From: Sarge-117 Date: Wed, 17 Aug 2022 11:10:37 -0700 Subject: [PATCH 17/23] Fix typo, fix Master Sword text --- soh/soh/Enhancements/randomizer/randomizer.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/soh/soh/Enhancements/randomizer/randomizer.cpp b/soh/soh/Enhancements/randomizer/randomizer.cpp index 2cbe57cf6..97940829a 100644 --- a/soh/soh/Enhancements/randomizer/randomizer.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer.cpp @@ -4777,9 +4777,9 @@ CustomMessageMinimal NaviMessages[NaviMsgCount] = { "%cSelbst ein Erwachsener kann ohne&etwas %wzusätzliche Kraft %ckeine&großen Blöcke verschieben!", "%cMême un adulte ne peut pas pousser&de grands blocs sans un petit %wgain&de force%c!" }, - { "%cI've heard that %rFlare Dancer&%cis weak to the Master Sword!&Have you tried it?", - "%cIch habe gehört dass der&%rFlammenderwisch %ceine Schwäche für&das Masterschwert aufweist. Hast du&es schonmal versucht einzusetzen?", - "%cJ'ai entendu dire que les %rDanse-&Flammes %csont faîble face à l'%wÉpée de&Légende%c! Est-ce que tu as essayé?" }, + { "%cI've heard that %rFlare Dancer&%cis weak to the %wMaster Sword%c!&Have you tried it?", + "%cIch habe gehört dass der&%rFlammenderwisch %ceine Schwäche für&das %wMasterschwert %caufweist. Hast du&es schonmal versucht einzusetzen?", + "%cJ'ai entendu dire que les %rDanse-&Flammes %csont faîbles face à l'%wÉpée de&Légende%c! Est-ce que tu as essayé?" }, { "%cDon't have a weapon to kill a&%rspider%c? Try throwing a %wpot&%cat it!", "%cFehlt dir die Waffe um gegen&eine %rSkulltula %czu kämpfen? Versuch&Sie mit einem %wKrug %cabzuwerfen!", From 584f9d16f065518a161ad074085a5114bbecd56a Mon Sep 17 00:00:00 2001 From: Sarge-117 Date: Wed, 17 Aug 2022 11:26:07 -0700 Subject: [PATCH 18/23] Fix line break --- soh/soh/Enhancements/randomizer/randomizer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/soh/soh/Enhancements/randomizer/randomizer.cpp b/soh/soh/Enhancements/randomizer/randomizer.cpp index 3a7a6dc58..b18e2df99 100644 --- a/soh/soh/Enhancements/randomizer/randomizer.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer.cpp @@ -4753,7 +4753,7 @@ CustomMessageMinimal NaviMessages[NaviMsgCount] = { { "%cThe %ySpirit Trial %cin %pGanon's Castle&%chas a %whidden chest %csomewhere.&Did you already know that?", "%cDie %yGeister-Prüfung %cin %pGanons&Schloss %chat irgendwo eine&%wversteckte Kiste%c. Weißt du schon&wo?", - "%cL'%yÉpreuve de l'Esprit%c dans le %pChâteau&de Ganon %ca un coffre caché quelque&part.&Je suppose que tu&le savais déjà?" }, + "%cL'%yÉpreuve de l'Esprit%c dans le %pChâteau&de Ganon %ca un coffre caché quelque&part. Je suppose que tu le savais&déjà?" }, { "%cYou know the %wBombchu Bowling&Alley%c? I heard %wonly two of the &prizes %care worthwhile. The rest &is junk!", "%cKennst du die %wMinenbowlingbahn%c?&Ich habe gehört dass sich nur &%wzwei der Preise%c lohnen. Der Rest&ist Krimskrams!", From d56e712d078ac0396e6dfcecaed71d96374bc76e Mon Sep 17 00:00:00 2001 From: Sarge-117 Date: Wed, 17 Aug 2022 11:27:17 -0700 Subject: [PATCH 19/23] spacing --- soh/soh/OTRGlobals.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/soh/soh/OTRGlobals.cpp b/soh/soh/OTRGlobals.cpp index 1040a3fa9..2ea662316 100644 --- a/soh/soh/OTRGlobals.cpp +++ b/soh/soh/OTRGlobals.cpp @@ -1551,7 +1551,6 @@ extern "C" int CustomMessage_RetrieveIfExists(GlobalContext* globalCtx) { } else if (textId >= 0x0140 && textId <= 0x015F) { messageEntry = Randomizer_GetNaviMessage(); } - } if (textId == TEXT_GS_NO_FREEZE || textId == TEXT_GS_FREEZE) { if (CVar_GetS32("gInjectSkulltulaCount", 0) != 0) { From bb6135fd2bea1452dd2718a80951cd8ec4e10db2 Mon Sep 17 00:00:00 2001 From: Sarge-117 Date: Wed, 17 Aug 2022 22:07:51 -0700 Subject: [PATCH 20/23] Spacing --- soh/soh/Enhancements/randomizer/randomizer.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/soh/soh/Enhancements/randomizer/randomizer.cpp b/soh/soh/Enhancements/randomizer/randomizer.cpp index b18e2df99..b8e9e614f 100644 --- a/soh/soh/Enhancements/randomizer/randomizer.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer.cpp @@ -4786,5 +4786,4 @@ CustomMessageMinimal NaviMessages[NaviMsgCount] = { { "%cI hear the patch of %wsoft soil&%cin %bZora's River %cis the only one&that isn't home to a %rspider%c!", "%cIch habe gehört dass die Stelle&%wfeuchten Bodens %cim %bZora-Fluss %cals&einzige keine %rSkulltula %cbeherbergt.", "%cJ'ai entendu dire que la %wterre meuble&%cqui se trouve à la %bRivière Zora %cest&la seule qui ne contienne pas&d'%raraignée%c." }, - }; From ccce87cb8975a6187af6ae54aab1c2b2a92bb08d Mon Sep 17 00:00:00 2001 From: Sarge-117 Date: Sat, 20 Aug 2022 11:16:46 -0700 Subject: [PATCH 21/23] Change int to u8 Jenkins plz --- soh/soh/Enhancements/randomizer/randomizer.cpp | 4 ++-- soh/soh/OTRGlobals.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/soh/soh/Enhancements/randomizer/randomizer.cpp b/soh/soh/Enhancements/randomizer/randomizer.cpp index 1bc72f8cf..6bf87348d 100644 --- a/soh/soh/Enhancements/randomizer/randomizer.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer.cpp @@ -3977,12 +3977,12 @@ void CreateScrubMessages() { } CustomMessageMinimal NaviMessages[]; -extern const int NaviMsgCount = 15; +extern const u8 NaviMsgCount = 15; void CreateNaviRandoMessages() { CustomMessageManager* customMessageManager = CustomMessageManager::Instance; customMessageManager->AddCustomMessageTable(Randomizer::NaviRandoMessageTableID); - for (int i = 0; i <= (NaviMsgCount - 1); i++) { + for (u8 i = 0; i <= (NaviMsgCount - 1); i++) { customMessageManager->CreateMessage(Randomizer::NaviRandoMessageTableID, i, { TEXTBOX_TYPE_BLACK, TEXTBOX_POS_BOTTOM, NaviMessages[i].english, NaviMessages[i].german, NaviMessages[i].french }); diff --git a/soh/soh/OTRGlobals.cpp b/soh/soh/OTRGlobals.cpp index 2ea662316..f18475ad0 100644 --- a/soh/soh/OTRGlobals.cpp +++ b/soh/soh/OTRGlobals.cpp @@ -1447,7 +1447,7 @@ extern "C" CustomMessageEntry Randomizer_GetScrubMessage(u16 scrubTextId) { return CustomMessageManager::Instance->RetrieveMessage(Randomizer::scrubMessageTableID, price); } -extern const int NaviMsgCount; +extern const u8 NaviMsgCount; extern "C" CustomMessageEntry Randomizer_GetNaviMessage() { u16 naviTextId = rand() % NaviMsgCount; From 706653624914d45af90badfdb8fefe58ee1298e1 Mon Sep 17 00:00:00 2001 From: Sarge-117 Date: Sat, 20 Aug 2022 22:17:02 -0700 Subject: [PATCH 22/23] Add #define, fix conflicting delcaration Also re-ordered randomizer.cpp a bit to have the text array above CreateNaviRandoMessages() --- .../Enhancements/randomizer/randomizer.cpp | 129 +++++++++--------- soh/soh/Enhancements/randomizer/randomizer.h | 2 + soh/soh/OTRGlobals.cpp | 4 +- 3 files changed, 66 insertions(+), 69 deletions(-) diff --git a/soh/soh/Enhancements/randomizer/randomizer.cpp b/soh/soh/Enhancements/randomizer/randomizer.cpp index 6bf87348d..5928dca86 100644 --- a/soh/soh/Enhancements/randomizer/randomizer.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer.cpp @@ -3976,13 +3976,73 @@ void CreateScrubMessages() { } } -CustomMessageMinimal NaviMessages[]; -extern const u8 NaviMsgCount = 15; +CustomMessageMinimal NaviMessages[NUM_NAVI_MESSAGES] = { + + { "%cMissing a small key in a dungeon?&Maybe the %rboss %chas it!", + "%cFehlt dir ein kleiner Schlüssel in &einem Labyrinth? Vielleicht hat ihn&ja der %rEndgegner%c!", + "%cIl te manque une %wPetite Clé %cdans&un donjon? C'est peut-être le %rboss&%cqui l'a!" }, + + { "%cSometimes you can use the %rMegaton&Hammer %cinstead of bombs!", + "%cManchmal kannst du den %rStahlhammer&%cstatt Bomben verwenden!", + "%cParfois, tu peux utiliser la %rMasse&des Titans %cau lieu de tes bombes!" }, + + { "%cThere are three %gbusiness scrubs %cin &Hyrule who sell %wmysterious items%c. Do&you know where they are?", + "%cEs gibt drei %gDeku-Händler %cin Hyrule&die mysteriöse Gegenstände&verkaufen. Weißt du wo Sie sind?", + "%cIl y a trois %gPestes Marchandes%c en&Hyrule qui vendent des %wobjets&mystérieux%c. Tu sais où elles sont?" }, + + { "%cStuck on this seed? You could &throw in the towel and check the&%wspoiler log%c...", + "%cHängst du bei diesem Seed fest?&Du könntest die Flinte ins Korn&werfen und ins %wSpoiler Log %cschauen...", + "%cSi tu es coincé sur cette seed,&tu peux toujours jeter l'éponge&et regader le %wSpoiler log%c..." }, + + { "%cDid you know that the %yHover&Boots %ccan be used to cross&%wquicksand%c?", + "%cWusstest du, dass du mit den&%yGleitstiefeln %cTreibsand %wüberqueren&kannst%c?", + "%cEst-ce que tu savais que les %rBottes&des airs %cpouvaient être utilisées&pour traverser les %wsables mouvants%c?" }, + + { "%cYou can reach the back of %wImpa's&House %cby jumping from the&unfinished house with a %rcucco%c!", + "%cDu kannst den Balkon von %wImpas&Haus %cerreichen indem du von&der Baustelle aus mit einem %rHuhn&%cspringst!", + "%cTu peux atteindre l'arrière de la&%wMaison d'Impa %cen sautant depuis la&maison en construction avec une&%rcocotte%c!" }, + + { "%cThe %ySpirit Trial %cin %pGanon's Castle&%chas a %whidden chest %csomewhere.&Did you already know that?", + "%cDie %yGeister-Prüfung %cin %pGanons&Schloss %chat irgendwo eine&%wversteckte Kiste%c. Weißt du schon&wo?", + "%cL'%yÉpreuve de l'Esprit%c dans le %pChâteau&de Ganon %ca un coffre caché quelque&part. Je suppose que tu le savais&déjà?" }, + + { "%cYou know the %wBombchu Bowling&Alley%c? I heard %wonly two of the &prizes %care worthwhile. The rest &is junk!", + "%cKennst du die %wMinenbowlingbahn%c?&Ich habe gehört dass sich nur &%wzwei der Preise%c lohnen. Der Rest&ist Krimskrams!", + "%cEst-ce que tu savais qu'au %wBowling&Teigneux%c, il n'y a que les %wdeux&premiers prix %cqui sont intéréssant?" }, + + { "%cHave you been using %wDeku Nuts&%cenough? I've seen them blow up&a %rBombchu%c!", + "%cBenutzt du auch genügend %wDeku&Nüsse%c? Ich habe mal gesehen dass&man damit %rKrabbelminen %cdetonieren&kann!", + "%cTu es sûr d'utiliser tes %wNoix Mojo &%ccorrectement? J'en ai déjà vu&exploser des %rChoux-Péteurs%c!" }, + + { "%cYou might end up with an %wextra&key %cfor the %bWater Temple %cor the&%rFire Temple%c. It's for your safety!", + "%cVielleicht verbleibt dir im&%bWassertempel %coder %rFeuertempel %cein&%wzusätzlicher Schlüssel%c. Dies&ist zu deiner Sicherheit!", + "%cIl se peut que tu aies une %wPetite&Clé %cen trop dans le %bTemple de l'Eau&%cou le %rTemple du Feu%c. C'est pour ta&propre sécurité!" }, + + { "%cIf you can't pick up a %rbomb&flower %cwith your hands, you can&still detonate it with %rfire %cor&with %warrows%c!", + "%cNur weil du eine %rDonnerblume&%cnicht hochheben kannst, so kannst&du sie immernoch mit %rFeuer %coder&%wPfeilen %cdetonieren!", + "%cSi tu ne peux pas ramasser&un %rChoux-Péteur %cavec tes mains, tu&peux toujours le faire exploser&avec du %rFeu %cou avec des %wflèches%c!" }, + + { "%cEven an adult can't push large&blocks without some %wextra&strength%c!", + "%cSelbst ein Erwachsener kann ohne&etwas %wzusätzliche Kraft %ckeine&großen Blöcke verschieben!", + "%cMême un adulte ne peut pas pousser&de grands blocs sans un petit %wgain&de force%c!" }, + + { "%cI've heard that %rFlare Dancer&%cis weak to the %wMaster Sword%c!&Have you tried it?", + "%cIch habe gehört dass der&%rFlammenderwisch %ceine Schwäche für&das %wMasterschwert %caufweist. Hast du&es schonmal versucht einzusetzen?", + "%cJ'ai entendu dire que les %rDanse-&Flammes %csont faîbles face à l'%wÉpée de&Légende%c! Est-ce que tu as essayé?" }, + + { "%cDon't have a weapon to kill a&%rspider%c? Try throwing a %wpot&%cat it!", + "%cFehlt dir die Waffe um gegen&eine %rSkulltula %czu kämpfen? Versuch&Sie mit einem %wKrug %cabzuwerfen!", + "%cSi tu n'as pas d'arme pour tuer&une %raraignée%c, pourquoi n'essayerais&-tu pas de lui jetter une %wjarre&%cà la figure?" }, + + { "%cI hear the patch of %wsoft soil&%cin %bZora's River %cis the only one&that isn't home to a %rspider%c!", + "%cIch habe gehört dass die Stelle&%wfeuchten Bodens %cim %bZora-Fluss %cals&einzige keine %rSkulltula %cbeherbergt.", + "%cJ'ai entendu dire que la %wterre meuble&%cqui se trouve à la %bRivière Zora %cest&la seule qui ne contienne pas&d'%raraignée%c." }, +}; void CreateNaviRandoMessages() { CustomMessageManager* customMessageManager = CustomMessageManager::Instance; customMessageManager->AddCustomMessageTable(Randomizer::NaviRandoMessageTableID); - for (u8 i = 0; i <= (NaviMsgCount - 1); i++) { + for (u8 i = 0; i <= (NUM_NAVI_MESSAGES - 1); i++) { customMessageManager->CreateMessage(Randomizer::NaviRandoMessageTableID, i, { TEXTBOX_TYPE_BLACK, TEXTBOX_POS_BOTTOM, NaviMessages[i].english, NaviMessages[i].german, NaviMessages[i].french }); @@ -4079,66 +4139,3 @@ void Rando_Init(void) { } } - -CustomMessageMinimal NaviMessages[NaviMsgCount] = { - - { "%cMissing a small key in a dungeon?&Maybe the %rboss %chas it!", - "%cFehlt dir ein kleiner Schlüssel in &einem Labyrinth? Vielleicht hat ihn&ja der %rEndgegner%c!", - "%cIl te manque une %wPetite Clé %cdans&un donjon? C'est peut-être le %rboss&%cqui l'a!" }, - - { "%cSometimes you can use the %rMegaton&Hammer %cinstead of bombs!", - "%cManchmal kannst du den %rStahlhammer&%cstatt Bomben verwenden!", - "%cParfois, tu peux utiliser la %rMasse&des Titans %cau lieu de tes bombes!" }, - - { "%cThere are three %gbusiness scrubs %cin &Hyrule who sell %wmysterious items%c. Do&you know where they are?", - "%cEs gibt drei %gDeku-Händler %cin Hyrule&die mysteriöse Gegenstände&verkaufen. Weißt du wo Sie sind?", - "%cIl y a trois %gPestes Marchandes%c en&Hyrule qui vendent des %wobjets&mystérieux%c. Tu sais où elles sont?" }, - - { "%cStuck on this seed? You could &throw in the towel and check the&%wspoiler log%c...", - "%cHängst du bei diesem Seed fest?&Du könntest die Flinte ins Korn&werfen und ins %wSpoiler Log %cschauen...", - "%cSi tu es coincé sur cette seed,&tu peux toujours jeter l'éponge&et regader le %wSpoiler log%c..." }, - - { "%cDid you know that the %yHover&Boots %ccan be used to cross&%wquicksand%c?", - "%cWusstest du, dass du mit den&%yGleitstiefeln %cTreibsand %wüberqueren&kannst%c?", - "%cEst-ce que tu savais que les %rBottes&des airs %cpouvaient être utilisées&pour traverser les %wsables mouvants%c?" }, - - { "%cYou can reach the back of %wImpa's&House %cby jumping from the&unfinished house with a %rcucco%c!", - "%cDu kannst den Balkon von %wImpas&Haus %cerreichen indem du von&der Baustelle aus mit einem %rHuhn&%cspringst!", - "%cTu peux atteindre l'arrière de la&%wMaison d'Impa %cen sautant depuis la&maison en construction avec une&%rcocotte%c!" }, - - { "%cThe %ySpirit Trial %cin %pGanon's Castle&%chas a %whidden chest %csomewhere.&Did you already know that?", - "%cDie %yGeister-Prüfung %cin %pGanons&Schloss %chat irgendwo eine&%wversteckte Kiste%c. Weißt du schon&wo?", - "%cL'%yÉpreuve de l'Esprit%c dans le %pChâteau&de Ganon %ca un coffre caché quelque&part. Je suppose que tu le savais&déjà?" }, - - { "%cYou know the %wBombchu Bowling&Alley%c? I heard %wonly two of the &prizes %care worthwhile. The rest &is junk!", - "%cKennst du die %wMinenbowlingbahn%c?&Ich habe gehört dass sich nur &%wzwei der Preise%c lohnen. Der Rest&ist Krimskrams!", - "%cEst-ce que tu savais qu'au %wBowling&Teigneux%c, il n'y a que les %wdeux&premiers prix %cqui sont intéréssant?" }, - - { "%cHave you been using %wDeku Nuts&%cenough? I've seen them blow up&a %rBombchu%c!", - "%cBenutzt du auch genügend %wDeku&Nüsse%c? Ich habe mal gesehen dass&man damit %rKrabbelminen %cdetonieren&kann!", - "%cTu es sûr d'utiliser tes %wNoix Mojo &%ccorrectement? J'en ai déjà vu&exploser des %rChoux-Péteurs%c!" }, - - { "%cYou might end up with an %wextra&key %cfor the %bWater Temple %cor the&%rFire Temple%c. It's for your safety!", - "%cVielleicht verbleibt dir im&%bWassertempel %coder %rFeuertempel %cein&%wzusätzlicher Schlüssel%c. Dies&ist zu deiner Sicherheit!", - "%cIl se peut que tu aies une %wPetite&Clé %cen trop dans le %bTemple de l'Eau&%cou le %rTemple du Feu%c. C'est pour ta&propre sécurité!" }, - - { "%cIf you can't pick up a %rbomb&flower %cwith your hands, you can&still detonate it with %rfire %cor&with %warrows%c!", - "%cNur weil du eine %rDonnerblume&%cnicht hochheben kannst, so kannst&du sie immernoch mit %rFeuer %coder&%wPfeilen %cdetonieren!", - "%cSi tu ne peux pas ramasser&un %rChoux-Péteur %cavec tes mains, tu&peux toujours le faire exploser&avec du %rFeu %cou avec des %wflèches%c!" }, - - { "%cEven an adult can't push large&blocks without some %wextra&strength%c!", - "%cSelbst ein Erwachsener kann ohne&etwas %wzusätzliche Kraft %ckeine&großen Blöcke verschieben!", - "%cMême un adulte ne peut pas pousser&de grands blocs sans un petit %wgain&de force%c!" }, - - { "%cI've heard that %rFlare Dancer&%cis weak to the %wMaster Sword%c!&Have you tried it?", - "%cIch habe gehört dass der&%rFlammenderwisch %ceine Schwäche für&das %wMasterschwert %caufweist. Hast du&es schonmal versucht einzusetzen?", - "%cJ'ai entendu dire que les %rDanse-&Flammes %csont faîbles face à l'%wÉpée de&Légende%c! Est-ce que tu as essayé?" }, - - { "%cDon't have a weapon to kill a&%rspider%c? Try throwing a %wpot&%cat it!", - "%cFehlt dir die Waffe um gegen&eine %rSkulltula %czu kämpfen? Versuch&Sie mit einem %wKrug %cabzuwerfen!", - "%cSi tu n'as pas d'arme pour tuer&une %raraignée%c, pourquoi n'essayerais&-tu pas de lui jetter une %wjarre&%cà la figure?" }, - - { "%cI hear the patch of %wsoft soil&%cin %bZora's River %cis the only one&that isn't home to a %rspider%c!", - "%cIch habe gehört dass die Stelle&%wfeuchten Bodens %cim %bZora-Fluss %cals&einzige keine %rSkulltula %cbeherbergt.", - "%cJ'ai entendu dire que la %wterre meuble&%cqui se trouve à la %bRivière Zora %cest&la seule qui ne contienne pas&d'%raraignée%c." }, -}; diff --git a/soh/soh/Enhancements/randomizer/randomizer.h b/soh/soh/Enhancements/randomizer/randomizer.h index eb0ef5edd..77beb6725 100644 --- a/soh/soh/Enhancements/randomizer/randomizer.h +++ b/soh/soh/Enhancements/randomizer/randomizer.h @@ -7,6 +7,8 @@ #include #include +#define NUM_NAVI_MESSAGES 15 + class Randomizer { private: std::unordered_map itemLocations; diff --git a/soh/soh/OTRGlobals.cpp b/soh/soh/OTRGlobals.cpp index f18475ad0..b8b77d336 100644 --- a/soh/soh/OTRGlobals.cpp +++ b/soh/soh/OTRGlobals.cpp @@ -1447,10 +1447,8 @@ extern "C" CustomMessageEntry Randomizer_GetScrubMessage(u16 scrubTextId) { return CustomMessageManager::Instance->RetrieveMessage(Randomizer::scrubMessageTableID, price); } -extern const u8 NaviMsgCount; - extern "C" CustomMessageEntry Randomizer_GetNaviMessage() { - u16 naviTextId = rand() % NaviMsgCount; + u16 naviTextId = rand() % NUM_NAVI_MESSAGES; return CustomMessageManager::Instance->RetrieveMessage(Randomizer::NaviRandoMessageTableID, naviTextId); } From 45873ba71de9e80f2c16e914d9e4341beb9381b1 Mon Sep 17 00:00:00 2001 From: Sarge-117 Date: Tue, 23 Aug 2022 17:16:19 -0700 Subject: [PATCH 23/23] Add CVar + Cvar check Defaults to "1" --- libultraship/libultraship/ImGuiImpl.cpp | 6 ++++++ soh/soh/OTRGlobals.cpp | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/libultraship/libultraship/ImGuiImpl.cpp b/libultraship/libultraship/ImGuiImpl.cpp index ac7ab9d73..311b559a2 100644 --- a/libultraship/libultraship/ImGuiImpl.cpp +++ b/libultraship/libultraship/ImGuiImpl.cpp @@ -452,6 +452,7 @@ namespace SohImGui { io->ConfigFlags |= ImGuiConfigFlags_DockingEnable; io->Fonts->AddFontDefault(); statsWindowOpen = CVar_GetS32("gStatsEnabled", 0); + CVar_RegisterS32("gRandoRelevantNavi", 1); #ifdef __SWITCH__ Ship::Switch::SetupFont(io->Fonts); #endif @@ -1912,6 +1913,11 @@ namespace SohImGui { "(medallions/stones/songs). Note that these fanfares\n" "are longer than usual." ); + EnhancementCheckbox("Rando-Relevant Navi Hints", "gRandoRelevantNavi"); + Tooltip( + "Replace Navi's overworld quest hints with rando-\n" + "related gameplay hints.\n" + ); ImGui::EndMenu(); } diff --git a/soh/soh/OTRGlobals.cpp b/soh/soh/OTRGlobals.cpp index b8b77d336..2b3024c6c 100644 --- a/soh/soh/OTRGlobals.cpp +++ b/soh/soh/OTRGlobals.cpp @@ -1546,7 +1546,7 @@ extern "C" int CustomMessage_RetrieveIfExists(GlobalContext* globalCtx) { } else if (textId == TEXT_SCRUB_POH || textId == TEXT_SCRUB_STICK_UPGRADE || textId == TEXT_SCRUB_NUT_UPGRADE) { messageEntry = Randomizer_GetScrubMessage(textId); // In rando, replace Navi's general overworld hints with rando-related gameplay tips - } else if (textId >= 0x0140 && textId <= 0x015F) { + } else if (CVar_GetS32("gRandoRelevantNavi", 1) && textId >= 0x0140 && textId <= 0x015F) { messageEntry = Randomizer_GetNaviMessage(); } }