diff options
| author | fig02 <fig02srl@gmail.com> | 2022-10-15 22:04:14 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-10-16 03:04:14 +0100 |
| commit | 29a7a6714a691a65f80768633cecf4ce7d6918b1 (patch) | |
| tree | 76168a0e6969bc58d9312c87f69cabc0d3b496a3 /src/code | |
| parent | bd373940ac7bb230b4a135a5c5675ca8f42cd700 (diff) | |
Rename elf_message to QuestHint (sync with oot) (#1124)
* rename elf_message to QuestHint
* port more things and review
* command arg name
* Update include/z64scene.h
Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com>
* Update src/code/z_scene.c
Co-authored-by: EllipticEllipsis <elliptic.ellipsis@gmail.com>
Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com>
Co-authored-by: EllipticEllipsis <elliptic.ellipsis@gmail.com>
Diffstat (limited to 'src/code')
| -rw-r--r-- | src/code/z_elf_message.c | 33 | ||||
| -rw-r--r-- | src/code/z_scene.c | 8 |
2 files changed, 37 insertions, 4 deletions
diff --git a/src/code/z_elf_message.c b/src/code/z_elf_message.c index 11e4a2743..a5a4890a7 100644 --- a/src/code/z_elf_message.c +++ b/src/code/z_elf_message.c @@ -1,62 +1,93 @@ +/** + * @file z_elf_message.c + * + * This file provides quest hints through Tatl. + * + * In Ocarina of Time, this was a more elaborate system that determined + * which hint to give based on a script. + * That system has been replaced with a single function that hardcodes the checks. + */ #include "global.h" -u16 ElfMessage_GetFirstCycleHint(PlayState* play) { +/** + * Gets the relevant text ID for Tatl hints in first cycle. + */ +u16 QuestHint_GetTatlTextId(PlayState* play) { if (INV_CONTENT(ITEM_OCARINA) == ITEM_OCARINA) { return 0; } + if (CURRENT_DAY <= 0) { return 0; } + if (gSaveContext.save.weekEventReg[88] & 0x20) { return 0; } + if (gSaveContext.save.weekEventReg[79] & 0x10) { if (gSaveContext.save.weekEventReg[8] & 0x40) { return 0; } + return 0x224; } + if (!(gSaveContext.save.weekEventReg[8] & 0x80)) { if (gSaveContext.save.weekEventReg[9] & 1) { return 0x21E; } + if (play->sceneId == SCENE_YOUSEI_IZUMI) { return 0; } + return 0x21D; } + if (gSaveContext.save.playerData.isMagicAcquired != true) { return 0x21F; } + if (INV_CONTENT(ITEM_DEED_LAND) == ITEM_DEED_LAND) { if (play->sceneId != SCENE_OKUJOU) { return 0x244; } + return 0; } + if (INV_CONTENT(ITEM_MOON_TEAR) == ITEM_MOON_TEAR) { if (gSaveContext.save.weekEventReg[86] & 4) { return 0x242; } + return 0x243; } + if (gSaveContext.save.weekEventReg[74] & 0x20) { return 0x223; } + if (gSaveContext.save.weekEventReg[73] & 0x80) { return 0x222; } + if (gSaveContext.save.weekEventReg[73] & 0x20) { return 0x221; } + if (gSaveContext.save.weekEventReg[77] & 2) { if (gSaveContext.save.weekEventReg[73] & 0x10) { return 0x240; } + return 0x241; } + if ((gSaveContext.save.weekEventReg[86] & 2) || (gSaveContext.save.weekEventReg[73] & 0x40)) { return 0x23F; } + return 0x220; } diff --git a/src/code/z_scene.c b/src/code/z_scene.c index 1167f14ab..7cb180b80 100644 --- a/src/code/z_scene.c +++ b/src/code/z_scene.c @@ -216,7 +216,9 @@ void Scene_HeaderCmdEntranceList(PlayState* play, SceneCmd* cmd) { // SceneTableEntry Header Command 0x07: Special Files void Scene_HeaderCmdSpecialFiles(PlayState* play, SceneCmd* cmd) { - static RomFile tatlMessageFiles[2] = { + // @note These quest hint files are identical to OoT's. + // They are not relevant in this game and the system to process these scripts has been removed. + static RomFile naviQuestHintFiles[2] = { { SEGMENT_ROM_START(elf_message_field), SEGMENT_ROM_END(elf_message_field) }, { SEGMENT_ROM_START(elf_message_ydan), SEGMENT_ROM_END(elf_message_ydan) }, }; @@ -227,8 +229,8 @@ void Scene_HeaderCmdSpecialFiles(PlayState* play, SceneCmd* cmd) { gSegments[0x05] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[play->objectCtx.subKeepIndex].segment); } - if (cmd->specialFiles.cUpElfMsgNum != 0) { - play->unk_18868 = Play_LoadScene(play, &tatlMessageFiles[cmd->specialFiles.cUpElfMsgNum - 1]); + if (cmd->specialFiles.naviQuestHintFileId != NAVI_QUEST_HINTS_NONE) { + play->naviQuestHints = Play_LoadScene(play, &naviQuestHintFiles[cmd->specialFiles.naviQuestHintFileId - 1]); } } |
