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>
This commit is contained in:
fig02
2022-10-15 22:04:14 -04:00
committed by GitHub
parent bd373940ac
commit 29a7a6714a
7 changed files with 55 additions and 14 deletions
+32 -1
View File
@@ -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;
}
+5 -3
View File
@@ -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]);
}
}