mirror of
https://github.com/zeldaret/oot.git
synced 2025-08-06 14:20:11 +00:00
z_message_PAL, message_data_static and surrounding doc (#996)
* Initial progress on z_message_PAL, very messy * Fix merge * Some more progress * Fix merge * More z_message_PAL * Small progress * More small progress * message_data_static files OK * Prepare z_message_tables * Matched another function, small updates * Attempt to use asm-processor static-symbols branch * Refactor text id declarations * Begin large text codes parser function * Fix merge * Refactor done * Build OK, add color and highscore names * Remove encoded text headers and automatically encode during build * Fix kanfont * Various cleanups * DISP macros * Another match aside data * Further progress * Small improvements * Deduplicate magic values for text control codes, small improvements * Tiny progress * Minor cleanups * Clean up z_message_PAL comment * Progress on large functions * Further progress on large functions * Changes to mkldscript to link .data in the .rodata section * data OK * Few improvements * Use gDPLoadTextureBlock macros where appropriate * rm z_message_tables, progress on large functions * 2 more matches * Improvements * Small progress * More progress on big function * progress * match func_80107980 * match Message_Update * match func_8010BED8 * done * Progress on remaining large functions * Small progress on largest function * Another match, extract text and move to assets, improve text build system * Small nonmatchings improvements * docs wip * Largest function maybe equivalent * Fix merge * Document do_action values, largest function is almost instruction-matching * Rename NAVI do_action to NONE, as that appears to be how that value is used in practice * Fix merge * one match * Last function is instruction-matching * Fix * Improvements thanks to engineer124 * Stack matched thanks to petrie911, now just a/v/low t regalloc issues, some cleanup * More variables labeled, use text state enum everywhere * More labels and names * Fix * Actor_IsTalking -> Actor_TalkRequested * Match func_8010C39C and remove unused asm * More docs * Mostly ocarina related docs * All msgModes named * Fix assetclean * Cleanup * Extraction fixes and headers * Suggestions * Review suggestions * Change text extraction again, only extract if the headers do not already exist * Fix * Use ast for charmap, fix assetclean for real this time * Review suggestions * BGM ids and ran formatter * Review comments * rename include_readonly to include_data_with_rodata * Remove leading 0s in number directives * Review suggestions for message_data_static * textbox pos enum comments, rename several enum names from Message to TextBox Co-authored-by: Thar0 <maximilianc64@gmail.com> Co-authored-by: Zelllll <56516451+Zelllll@users.noreply.github.com> Co-authored-by: petrie911 <pmontag@DESKTOP-LG8A167.localdomain> Co-authored-by: Roman971 <romanlasnier@hotmail.com>
This commit is contained in:
parent
03636166b3
commit
a497f33bda
216 changed files with 7052 additions and 16801 deletions
|
@ -662,7 +662,7 @@ void EnSkj_Fade(EnSkj* this, GlobalContext* globalCtx) {
|
|||
u32 alpha = this->alpha;
|
||||
|
||||
if (this->unk_2D6 == 2) {
|
||||
globalCtx->msgCtx.unk_E3EE = 0;
|
||||
globalCtx->msgCtx.ocarinaMode = OCARINA_MODE_00;
|
||||
this->unk_2D6 = 0;
|
||||
}
|
||||
|
||||
|
@ -917,7 +917,7 @@ void EnSkj_WaitInRange(EnSkj* this, GlobalContext* globalCtx) {
|
|||
player->actor.world.pos.y = sSmallStumpSkullKid.skullkid->actor.world.pos.y;
|
||||
player->actor.world.pos.z = sSmallStumpSkullKid.skullkid->actor.world.pos.z;
|
||||
EnSkj_TurnPlayer(sSmallStumpSkullKid.skullkid, player);
|
||||
func_8010BD88(globalCtx, 0x22);
|
||||
func_8010BD88(globalCtx, OCARINA_ACTION_CHECK_SARIA);
|
||||
EnSkj_SetupWaitForSong(this);
|
||||
} else if (D_80B01EA0 != 0) {
|
||||
player->actor.world.pos.x = sSmallStumpSkullKid.skullkid->actor.world.pos.x;
|
||||
|
@ -960,54 +960,54 @@ void EnSkj_WaitForSong(EnSkj* this, GlobalContext* globalCtx) {
|
|||
Player* player = GET_PLAYER(globalCtx);
|
||||
|
||||
// Played a song thats not Saria's song
|
||||
if (!(gSaveContext.itemGetInf[1] & 0x40) &&
|
||||
((globalCtx->msgCtx.msgMode == 0xE) || (globalCtx->msgCtx.msgMode == 0xF))) {
|
||||
globalCtx->msgCtx.unk_E3EE = 4;
|
||||
func_80106CCC(globalCtx);
|
||||
if (!(gSaveContext.itemGetInf[1] & 0x40) && ((globalCtx->msgCtx.msgMode == MSGMODE_OCARINA_FAIL) ||
|
||||
(globalCtx->msgCtx.msgMode == MSGMODE_OCARINA_FAIL_NO_TEXT))) {
|
||||
globalCtx->msgCtx.ocarinaMode = OCARINA_MODE_04;
|
||||
Message_CloseTextbox(globalCtx);
|
||||
player->unk_6A8 = &this->actor;
|
||||
func_8002F2CC(&this->actor, globalCtx, EnSkj_GetItemXzRange(this));
|
||||
EnSkj_SetupWrongSong(this);
|
||||
} else {
|
||||
if ((globalCtx->msgCtx.msgMode == 0xD) && (this->unk_2D6 == 0)) {
|
||||
if ((globalCtx->msgCtx.msgMode == MSGMODE_OCARINA_CORRECT_PLAYBACK) && (this->unk_2D6 == 0)) {
|
||||
this->unk_2D6 = 1;
|
||||
EnSkj_ChangeAnim(this, SKJ_ANIM_PLAY_FLUTE);
|
||||
} else if ((this->unk_2D6 != 0) && (globalCtx->msgCtx.msgMode == 0x1A)) {
|
||||
} else if ((this->unk_2D6 != 0) && (globalCtx->msgCtx.msgMode == MSGMODE_SONG_DEMONSTRATION_DONE)) {
|
||||
this->unk_2D6 = 0;
|
||||
EnSkj_ChangeAnim(this, SKJ_ANIM_WAIT);
|
||||
}
|
||||
if (globalCtx->msgCtx.unk_E3EE == 4) {
|
||||
globalCtx->msgCtx.unk_E3EE = 0;
|
||||
if (globalCtx->msgCtx.ocarinaMode == OCARINA_MODE_04) {
|
||||
globalCtx->msgCtx.ocarinaMode = OCARINA_MODE_00;
|
||||
this->unk_2D6 = 0;
|
||||
EnSkj_ChangeAnim(this, SKJ_ANIM_WAIT);
|
||||
EnSkj_SetupAction(this, SKJ_ACTION_SARIA_SONG_WAIT_IN_RANGE);
|
||||
} else if (globalCtx->msgCtx.unk_E3EE == 3) {
|
||||
} else if (globalCtx->msgCtx.ocarinaMode == OCARINA_MODE_03) {
|
||||
if (!(gSaveContext.itemGetInf[1] & 0x40)) {
|
||||
// Saria's song has been played for the first titme
|
||||
globalCtx->msgCtx.unk_E3EE = 4;
|
||||
globalCtx->msgCtx.ocarinaMode = OCARINA_MODE_04;
|
||||
func_80078884(NA_SE_SY_CORRECT_CHIME);
|
||||
player->unk_6A8 = &this->actor;
|
||||
func_8002F2CC(&this->actor, globalCtx, EnSkj_GetItemXzRange(this));
|
||||
this->textId = 0x10BB;
|
||||
EnSkj_SetupAfterSong(this);
|
||||
} else {
|
||||
globalCtx->msgCtx.unk_E3EE = 5;
|
||||
globalCtx->msgCtx.ocarinaMode = OCARINA_MODE_05;
|
||||
}
|
||||
} else if (globalCtx->msgCtx.unk_E3EE == 2) {
|
||||
} else if (globalCtx->msgCtx.ocarinaMode == OCARINA_MODE_02) {
|
||||
player->stateFlags2 &= ~0x1000000;
|
||||
Actor_Kill(&this->actor);
|
||||
} else if (globalCtx->msgCtx.unk_E3EE == 1) {
|
||||
} else if (globalCtx->msgCtx.ocarinaMode == OCARINA_MODE_01) {
|
||||
player->stateFlags2 |= 0x800000;
|
||||
} else {
|
||||
if (globalCtx->msgCtx.unk_E3EE >= 5) {
|
||||
if (globalCtx->msgCtx.ocarinaMode >= OCARINA_MODE_05) {
|
||||
gSaveContext.sunsSongState = 0;
|
||||
if (gSaveContext.itemGetInf[1] & 0x40) {
|
||||
globalCtx->msgCtx.unk_E3EE = 4;
|
||||
globalCtx->msgCtx.ocarinaMode = OCARINA_MODE_04;
|
||||
player->unk_6A8 = &this->actor;
|
||||
func_8002F2CC(&this->actor, globalCtx, EnSkj_GetItemXzRange(this));
|
||||
this->textId = 0x10BD;
|
||||
EnSkj_SetupAfterSong(this);
|
||||
} else {
|
||||
globalCtx->msgCtx.unk_E3EE = 4;
|
||||
globalCtx->msgCtx.ocarinaMode = OCARINA_MODE_04;
|
||||
player->unk_6A8 = &this->actor;
|
||||
func_8002F2CC(&this->actor, globalCtx, EnSkj_GetItemXzRange(this));
|
||||
EnSkj_SetupWrongSong(this);
|
||||
|
@ -1038,7 +1038,7 @@ void EnSkj_SetupTalk(EnSkj* this) {
|
|||
void EnSkj_SariaSongTalk(EnSkj* this, GlobalContext* globalCtx) {
|
||||
s32 pad;
|
||||
|
||||
if ((func_8010BDBC(&globalCtx->msgCtx) == 6) && (func_80106BC8(globalCtx) != 0)) {
|
||||
if ((Message_GetState(&globalCtx->msgCtx) == TEXT_STATE_DONE) && Message_ShouldAdvance(globalCtx)) {
|
||||
if (gSaveContext.itemGetInf[1] & 0x40) {
|
||||
EnSkj_SetupWaitInRange(this);
|
||||
} else {
|
||||
|
@ -1067,7 +1067,7 @@ void EnSkj_SetupPostSariasSong(EnSkj* this) {
|
|||
}
|
||||
|
||||
void EnSkj_ChangeModeAfterSong(EnSkj* this, GlobalContext* globalCtx) {
|
||||
if ((func_8010BDBC(&globalCtx->msgCtx) == 6) && (func_80106BC8(globalCtx) != 0)) {
|
||||
if ((Message_GetState(&globalCtx->msgCtx) == TEXT_STATE_DONE) && Message_ShouldAdvance(globalCtx)) {
|
||||
gSaveContext.itemGetInf[1] |= 0x40;
|
||||
EnSkj_SetNaviId(this);
|
||||
EnSkj_SetupWaitInRange(this);
|
||||
|
@ -1079,10 +1079,10 @@ void EnSkj_SetupMaskTrade(EnSkj* this) {
|
|||
}
|
||||
|
||||
void EnSkj_StartMaskTrade(EnSkj* this, GlobalContext* globalCtx) {
|
||||
u8 sp1F = func_8010BDBC(&globalCtx->msgCtx);
|
||||
u8 sp1F = Message_GetState(&globalCtx->msgCtx);
|
||||
|
||||
func_8002DF54(globalCtx, &this->actor, 1);
|
||||
if ((sp1F == 6) && (func_80106BC8(globalCtx) != 0)) {
|
||||
if ((sp1F == TEXT_STATE_DONE) && Message_ShouldAdvance(globalCtx)) {
|
||||
EnSkj_JumpFromStump(this);
|
||||
}
|
||||
}
|
||||
|
@ -1136,40 +1136,38 @@ void EnSkj_WalkToPlayer(EnSkj* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
void EnSkj_SetupAskForMask(EnSkj* this, GlobalContext* globalCtx) {
|
||||
func_8010B680(globalCtx, 0x101C, &this->actor);
|
||||
Message_StartTextbox(globalCtx, 0x101C, &this->actor);
|
||||
EnSkj_ChangeAnim(this, SKJ_ANIM_WAIT);
|
||||
EnSkj_SetupAction(this, SKJ_ACTION_SARIA_SONG_ASK_FOR_MASK);
|
||||
}
|
||||
|
||||
void EnSkj_AskForMask(EnSkj* this, GlobalContext* globalCtx) {
|
||||
if (func_8010BDBC(&globalCtx->msgCtx) == 4) {
|
||||
if (func_80106BC8(globalCtx) != 0) {
|
||||
switch (globalCtx->msgCtx.choiceIndex) {
|
||||
case 0: // Yes
|
||||
EnSkj_SetupTakeMask(this, globalCtx);
|
||||
break;
|
||||
case 1: // No
|
||||
func_8010B720(globalCtx, 0x101D);
|
||||
EnSkj_SetupWaitForMaskTextClear(this);
|
||||
break;
|
||||
}
|
||||
if (Message_GetState(&globalCtx->msgCtx) == TEXT_STATE_CHOICE && Message_ShouldAdvance(globalCtx)) {
|
||||
switch (globalCtx->msgCtx.choiceIndex) {
|
||||
case 0: // Yes
|
||||
EnSkj_SetupTakeMask(this, globalCtx);
|
||||
break;
|
||||
case 1: // No
|
||||
Message_ContinueTextbox(globalCtx, 0x101D);
|
||||
EnSkj_SetupWaitForMaskTextClear(this);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void EnSkj_SetupTakeMask(EnSkj* this, GlobalContext* globalCtx) {
|
||||
func_8010B720(globalCtx, 0x101E);
|
||||
Message_ContinueTextbox(globalCtx, 0x101E);
|
||||
EnSkj_SetupAction(this, SKJ_ACTION_SARIA_SONG_TAKE_MASK);
|
||||
}
|
||||
|
||||
void EnSkj_TakeMask(EnSkj* this, GlobalContext* globalCtx) {
|
||||
if ((func_8010BDBC(&globalCtx->msgCtx) == 6) && (func_80106BC8(globalCtx) != 0)) {
|
||||
if ((Message_GetState(&globalCtx->msgCtx) == TEXT_STATE_DONE) && Message_ShouldAdvance(globalCtx)) {
|
||||
Rupees_ChangeBy(10);
|
||||
gSaveContext.itemGetInf[3] |= 0x200;
|
||||
EnSkj_SetNaviId(this);
|
||||
Player_UnsetMask(globalCtx);
|
||||
Item_Give(globalCtx, ITEM_SOLD_OUT);
|
||||
func_8010B720(globalCtx, 0x101F);
|
||||
Message_ContinueTextbox(globalCtx, 0x101F);
|
||||
EnSkj_SetupWaitForMaskTextClear(this);
|
||||
}
|
||||
}
|
||||
|
@ -1179,7 +1177,7 @@ void EnSkj_SetupWaitForMaskTextClear(EnSkj* this) {
|
|||
}
|
||||
|
||||
void EnSkj_WaitForMaskTextClear(EnSkj* this, GlobalContext* globalCtx) {
|
||||
if ((func_8010BDBC(&globalCtx->msgCtx) == 6) && (func_80106BC8(globalCtx) != 0)) {
|
||||
if ((Message_GetState(&globalCtx->msgCtx) == TEXT_STATE_DONE) && Message_ShouldAdvance(globalCtx)) {
|
||||
func_8002DF54(globalCtx, &this->actor, 7);
|
||||
this->backfilpFlag = 1;
|
||||
EnSkj_Backflip(this);
|
||||
|
@ -1205,10 +1203,10 @@ void EnSkj_SetupWaitForTextClear(EnSkj* this) {
|
|||
}
|
||||
|
||||
void EnSkj_SariasSongWaitForTextClear(EnSkj* this, GlobalContext* globalCtx) {
|
||||
u8 state = func_8010BDBC(&globalCtx->msgCtx);
|
||||
u8 state = Message_GetState(&globalCtx->msgCtx);
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
|
||||
if (state == 6 && func_80106BC8(globalCtx)) {
|
||||
if (state == TEXT_STATE_DONE && Message_ShouldAdvance(globalCtx)) {
|
||||
EnSkj_SetupWaitInRange(this);
|
||||
player->stateFlags2 |= 0x800000;
|
||||
player->unk_6A8 = (Actor*)sSmallStumpSkullKid.skullkid;
|
||||
|
@ -1295,7 +1293,7 @@ void EnSkj_Update(Actor* thisx, GlobalContext* globalCtx) {
|
|||
s32 pad;
|
||||
EnSkj* this = THIS;
|
||||
|
||||
D_80B01EA0 = func_8002F194(&this->actor, globalCtx);
|
||||
D_80B01EA0 = Actor_ProcessTalkRequest(&this->actor, globalCtx);
|
||||
|
||||
this->timer++;
|
||||
|
||||
|
@ -1351,7 +1349,7 @@ void EnSkj_Update(Actor* thisx, GlobalContext* globalCtx) {
|
|||
void EnSkj_SariasSongShortStumpUpdate(Actor* thisx, GlobalContext* globalCtx) {
|
||||
EnSkj* this = THIS;
|
||||
|
||||
D_80B01EA0 = func_8002F194(&this->actor, globalCtx);
|
||||
D_80B01EA0 = Actor_ProcessTalkRequest(&this->actor, globalCtx);
|
||||
|
||||
if (BREG(0) != 0) {
|
||||
DebugDisplay_AddObject(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z,
|
||||
|
@ -1378,7 +1376,7 @@ void EnSkj_SetupWaitForOcarina(EnSkj* this, GlobalContext* globalCtx) {
|
|||
func_800F5BF0(4);
|
||||
EnSkj_TurnPlayer(this, player);
|
||||
player->unk_6A8 = &this->actor;
|
||||
func_8010B680(globalCtx, 0x10BE, &this->actor);
|
||||
Message_StartTextbox(globalCtx, 0x10BE, &this->actor);
|
||||
this->actionFunc = EnSkj_StartOcarinaMinigame;
|
||||
} else {
|
||||
this->actionFunc = EnSkj_WaitForOcarina;
|
||||
|
@ -1394,7 +1392,7 @@ void EnSkj_WaitForOcarina(EnSkj* this, GlobalContext* globalCtx) {
|
|||
func_800F5BF0(4);
|
||||
EnSkj_TurnPlayer(this, player);
|
||||
player->unk_6A8 = &this->actor;
|
||||
func_8010B680(globalCtx, 0x10BE, &this->actor);
|
||||
Message_StartTextbox(globalCtx, 0x10BE, &this->actor);
|
||||
this->actionFunc = EnSkj_StartOcarinaMinigame;
|
||||
} else if (EnSkj_RangeCheck(player, this)) {
|
||||
player->stateFlags2 |= 0x800000;
|
||||
|
@ -1402,13 +1400,13 @@ void EnSkj_WaitForOcarina(EnSkj* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
void EnSkj_StartOcarinaMinigame(EnSkj* this, GlobalContext* globalCtx) {
|
||||
u8 dialogState = func_8010BDBC(&globalCtx->msgCtx);
|
||||
u8 dialogState = Message_GetState(&globalCtx->msgCtx);
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
|
||||
EnSkj_TurnPlayer(this, player);
|
||||
|
||||
if (dialogState == 2) {
|
||||
func_8010BD58(globalCtx, 0x2E); // play song?
|
||||
if (dialogState == TEXT_STATE_CLOSING) {
|
||||
func_8010BD58(globalCtx, OCARINA_ACTION_MEMORY_GAME);
|
||||
if (sOcarinaMinigameSkullKids[SKULL_KID_LEFT].skullkid != NULL) {
|
||||
sOcarinaMinigameSkullKids[SKULL_KID_LEFT].skullkid->minigameState = SKULL_KID_OCARINA_PLAY_NOTES;
|
||||
}
|
||||
|
@ -1422,24 +1420,24 @@ void EnSkj_WaitForPlayback(EnSkj* this, GlobalContext* globalCtx) {
|
|||
|
||||
EnSkj_TurnPlayer(this, player);
|
||||
|
||||
if (globalCtx->msgCtx.unk_E3EE == 3) { // failed the game
|
||||
func_80106CCC(globalCtx);
|
||||
globalCtx->msgCtx.unk_E3EE = 4;
|
||||
if (globalCtx->msgCtx.ocarinaMode == OCARINA_MODE_03) { // failed the game
|
||||
Message_CloseTextbox(globalCtx);
|
||||
globalCtx->msgCtx.ocarinaMode = OCARINA_MODE_04;
|
||||
player->unk_6A8 = &this->actor;
|
||||
func_8002F2CC(&this->actor, globalCtx, 26.0f);
|
||||
this->textId = 0x102D;
|
||||
this->actionFunc = EnSkj_FailedMiniGame;
|
||||
} else if (globalCtx->msgCtx.unk_E3EE == 0xF) { // completed the game
|
||||
} else if (globalCtx->msgCtx.ocarinaMode == OCARINA_MODE_0F) { // completed the game
|
||||
func_80078884(NA_SE_SY_CORRECT_CHIME);
|
||||
func_80106CCC(globalCtx);
|
||||
globalCtx->msgCtx.unk_E3EE = 4;
|
||||
Message_CloseTextbox(globalCtx);
|
||||
globalCtx->msgCtx.ocarinaMode = OCARINA_MODE_04;
|
||||
player->unk_6A8 = &this->actor;
|
||||
func_8002F2CC(&this->actor, globalCtx, 26.0f);
|
||||
this->textId = 0x10BF;
|
||||
this->actionFunc = EnSkj_WonOcarinaMiniGame;
|
||||
} else { // playing the game
|
||||
switch (globalCtx->msgCtx.msgMode) {
|
||||
case 0x2B:
|
||||
case MSGMODE_MEMORY_GAME_LEFT_SKULLKID_WAIT:
|
||||
if (sOcarinaMinigameSkullKids[SKULL_KID_LEFT].skullkid != NULL) {
|
||||
sOcarinaMinigameSkullKids[SKULL_KID_LEFT].skullkid->minigameState = SKULL_KID_OCRAINA_WAIT;
|
||||
}
|
||||
|
@ -1448,45 +1446,42 @@ void EnSkj_WaitForPlayback(EnSkj* this, GlobalContext* globalCtx) {
|
|||
sOcarinaMinigameSkullKids[SKULL_KID_RIGHT].skullkid->minigameState =
|
||||
SKULL_KID_OCARINA_PLAY_NOTES;
|
||||
}
|
||||
func_80106AA8(globalCtx);
|
||||
Message_UpdateOcarinaGame(globalCtx);
|
||||
}
|
||||
break;
|
||||
|
||||
case 0x2D:
|
||||
case MSGMODE_MEMORY_GAME_RIGHT_SKULLKID_WAIT:
|
||||
if (sOcarinaMinigameSkullKids[SKULL_KID_RIGHT].skullkid != NULL) {
|
||||
sOcarinaMinigameSkullKids[SKULL_KID_RIGHT].skullkid->minigameState = SKULL_KID_OCRAINA_WAIT;
|
||||
}
|
||||
if (!Audio_IsSfxPlaying(NA_SE_SY_METRONOME)) {
|
||||
func_80106AA8(globalCtx);
|
||||
Message_UpdateOcarinaGame(globalCtx);
|
||||
this->songFailTimer = 160;
|
||||
}
|
||||
break;
|
||||
|
||||
case 0x2E:
|
||||
case MSGMODE_MEMORY_GAME_PLAYER_PLAYING:
|
||||
if (this->songFailTimer != 0) {
|
||||
this->songFailTimer--;
|
||||
} else { // took too long, game failed
|
||||
func_80078884(NA_SE_SY_OCARINA_ERROR);
|
||||
func_80106CCC(globalCtx);
|
||||
globalCtx->msgCtx.unk_E3EE = 4;
|
||||
Message_CloseTextbox(globalCtx);
|
||||
globalCtx->msgCtx.ocarinaMode = OCARINA_MODE_04;
|
||||
player->unk_6A8 = &this->actor;
|
||||
func_8002F2CC(&this->actor, globalCtx, 26.0f);
|
||||
this->textId = 0x102D;
|
||||
this->actionFunc = EnSkj_FailedMiniGame;
|
||||
}
|
||||
break;
|
||||
|
||||
case 0x30:
|
||||
case MSGMODE_MEMORY_GAME_START_NEXT_ROUND:
|
||||
if (!Audio_IsSfxPlaying(NA_SE_SY_METRONOME)) {
|
||||
if (sOcarinaMinigameSkullKids[SKULL_KID_LEFT].skullkid != NULL) {
|
||||
sOcarinaMinigameSkullKids[SKULL_KID_LEFT].skullkid->minigameState =
|
||||
SKULL_KID_OCARINA_PLAY_NOTES;
|
||||
}
|
||||
this->songFailTimer = 160;
|
||||
func_800ED858(6); // related instrument sound (flute?)
|
||||
func_800ED93C(0xE, 1);
|
||||
globalCtx->msgCtx.msgMode = 0x2A;
|
||||
globalCtx->msgCtx.unk_E3E7 = 2;
|
||||
Audio_OcaSetInstrument(6); // related instrument sound (flute?)
|
||||
Audio_OcaSetSongPlayback(OCARINA_SONG_MEMORY_GAME + 1, 1);
|
||||
globalCtx->msgCtx.msgMode = MSGMODE_MEMORY_GAME_LEFT_SKULLKID_PLAYING;
|
||||
globalCtx->msgCtx.stateTimer = 2;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -1502,20 +1497,20 @@ void EnSkj_FailedMiniGame(EnSkj* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
void EnSkj_WaitForNextRound(EnSkj* this, GlobalContext* globalCtx) {
|
||||
if (func_8010BDBC(&globalCtx->msgCtx) == 6 && func_80106BC8(globalCtx)) {
|
||||
if (Message_GetState(&globalCtx->msgCtx) == TEXT_STATE_DONE && Message_ShouldAdvance(globalCtx)) {
|
||||
EnSkj_OfferNextRound(this, globalCtx);
|
||||
}
|
||||
}
|
||||
|
||||
void EnSkj_OfferNextRound(EnSkj* this, GlobalContext* globalCtx) {
|
||||
func_8010B720(globalCtx, 0x102E);
|
||||
Message_ContinueTextbox(globalCtx, 0x102E);
|
||||
this->actionFunc = EnSkj_WaitForOfferResponse;
|
||||
}
|
||||
|
||||
void EnSkj_WaitForOfferResponse(EnSkj* this, GlobalContext* globalCtx) {
|
||||
Player* player;
|
||||
|
||||
if (func_8010BDBC(&globalCtx->msgCtx) == 4 && func_80106BC8(globalCtx)) {
|
||||
if (Message_GetState(&globalCtx->msgCtx) == TEXT_STATE_CHOICE && Message_ShouldAdvance(globalCtx)) {
|
||||
switch (globalCtx->msgCtx.choiceIndex) {
|
||||
case 0: // yes
|
||||
player = GET_PLAYER(globalCtx);
|
||||
|
@ -1538,8 +1533,8 @@ void EnSkj_WonOcarinaMiniGame(EnSkj* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
void EnSkj_WaitToGiveReward(EnSkj* this, GlobalContext* globalCtx) {
|
||||
if ((func_8010BDBC(&globalCtx->msgCtx) == 6) && (func_80106BC8(globalCtx))) {
|
||||
func_8002F434(&this->actor, globalCtx, sOcarinaGameRewards[gSaveContext.ocarinaGameReward], 26.0f, 26.0f);
|
||||
if ((Message_GetState(&globalCtx->msgCtx) == TEXT_STATE_DONE) && Message_ShouldAdvance(globalCtx)) {
|
||||
func_8002F434(&this->actor, globalCtx, sOcarinaGameRewards[gSaveContext.ocarinaGameRoundNum], 26.0f, 26.0f);
|
||||
this->actionFunc = EnSkj_GiveOcarinaGameReward;
|
||||
}
|
||||
}
|
||||
|
@ -1549,19 +1544,19 @@ void EnSkj_GiveOcarinaGameReward(EnSkj* this, GlobalContext* globalCtx) {
|
|||
this->actor.parent = NULL;
|
||||
this->actionFunc = EnSkj_FinishOcarinaGameRound;
|
||||
} else {
|
||||
func_8002F434(&this->actor, globalCtx, sOcarinaGameRewards[gSaveContext.ocarinaGameReward], 26.0f, 26.0f);
|
||||
func_8002F434(&this->actor, globalCtx, sOcarinaGameRewards[gSaveContext.ocarinaGameRoundNum], 26.0f, 26.0f);
|
||||
}
|
||||
}
|
||||
|
||||
void EnSkj_FinishOcarinaGameRound(EnSkj* this, GlobalContext* globalCtx) {
|
||||
if ((func_8010BDBC(&globalCtx->msgCtx) == 6) && (func_80106BC8(globalCtx))) {
|
||||
s32 ocarinaGameReward = gSaveContext.ocarinaGameReward;
|
||||
if ((Message_GetState(&globalCtx->msgCtx) == TEXT_STATE_DONE) && Message_ShouldAdvance(globalCtx)) {
|
||||
s32 ocarinaGameRoundNum = gSaveContext.ocarinaGameRoundNum;
|
||||
|
||||
if (gSaveContext.ocarinaGameReward < 3) {
|
||||
gSaveContext.ocarinaGameReward++;
|
||||
if (gSaveContext.ocarinaGameRoundNum < 3) {
|
||||
gSaveContext.ocarinaGameRoundNum++;
|
||||
}
|
||||
|
||||
if (ocarinaGameReward == 2) {
|
||||
if (ocarinaGameRoundNum == 2) {
|
||||
gSaveContext.itemGetInf[1] |= 0x80;
|
||||
this->actionFunc = EnSkj_CleanupOcarinaGame;
|
||||
} else {
|
||||
|
@ -1589,7 +1584,7 @@ void EnSkj_CleanupOcarinaGame(EnSkj* this, GlobalContext* globalCtx) {
|
|||
void EnSkj_OcarinaMinigameShortStumpUpdate(Actor* thisx, GlobalContext* globalCtx) {
|
||||
EnSkj* this = THIS;
|
||||
|
||||
D_80B01EA0 = func_8002F194(&this->actor, globalCtx);
|
||||
D_80B01EA0 = Actor_ProcessTalkRequest(&this->actor, globalCtx);
|
||||
this->timer++;
|
||||
|
||||
this->actor.focus.pos.x = 1230.0f;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue