diff --git a/soh/include/functions.h b/soh/include/functions.h index c96f3b23fb2..582aa17fb25 100644 --- a/soh/include/functions.h +++ b/soh/include/functions.h @@ -2421,8 +2421,8 @@ u8 Message_ShouldAdvanceSilent(PlayState* play); void Message_CloseTextbox(PlayState*); void Message_StartTextbox(PlayState* play, u16 textId, Actor* actor); void Message_ContinueTextbox(PlayState* play, u16 textId); -void func_8010BD58(PlayState* play, u16 arg1); -void func_8010BD88(PlayState* play, u16 arg1); +void Message_StartOcarinaWithSongEffect(PlayState* play, u16 arg1); +void Message_StartOcarinaNoSongEffect(PlayState* play, u16 arg1); u8 Message_GetState(MessageContext* msgCtx); void Message_Draw(PlayState* play); void Message_Update(PlayState* play); diff --git a/soh/include/z64.h b/soh/include/z64.h index 254b7e966a1..82cf5ec4014 100644 --- a/soh/include/z64.h +++ b/soh/include/z64.h @@ -704,7 +704,7 @@ typedef struct { /* 0xE406 */ s16 textboxColorAlphaCurrent; /* 0xE408 */ Actor* talkActor; /* 0xE40C */ s16 disableWarpSongs; // warp song flag set by scene commands - /* 0xE40E */ s16 unk_E40E; // ocarina related + /* 0xE40E */ s16 disableSongEffect; // ocarina related /* 0xE410 */ u8 lastOcaNoteIdx; } MessageContext; // size = 0xE418 diff --git a/soh/include/z64player.h b/soh/include/z64player.h index a9c466a1dbc..5b346e4989c 100644 --- a/soh/include/z64player.h +++ b/soh/include/z64player.h @@ -843,7 +843,7 @@ typedef struct Player { /* 0x069C */ char unk_69C[0x004]; /* 0x06A0 */ f32 unk_6A0; /* 0x06A4 */ f32 closestSecretDistSq; - /* 0x06A8 */ Actor* unk_6A8; + /* 0x06A8 */ Actor* ocarinaTargetActor; /* 0x06AC */ s8 idleType; /* 0x06AD */ u8 unk_6AD; // Camera related. 0 = normal, 1 = first person without weapon, 2 = first person with weapon, 3 = cutscene action, 4 = cutscene items /* 0x06AE */ u16 unk_6AE_rotFlags; // See `UNK6AE_ROT_` macros. If its flag isn't set, a rot steps to 0. diff --git a/soh/src/code/z_demo.c b/soh/src/code/z_demo.c index 717d423dc1d..554a6d78fd3 100644 --- a/soh/src/code/z_demo.c +++ b/soh/src/code/z_demo.c @@ -1647,7 +1647,7 @@ void Cutscene_Command_Textbox(PlayState* play, CutsceneContext* csCtx, CsCmdText } else { if (D_8011E1C4 != cmd->base) { D_8011E1C4 = cmd->base; - func_8010BD58(play, cmd->base); + Message_StartOcarinaWithSongEffect(play, cmd->base); return; } } @@ -1692,7 +1692,7 @@ void Cutscene_Command_Textbox(PlayState* play, CutsceneContext* csCtx, CsCmdText if (dialogState == TEXT_STATE_EVENT) { if (Message_ShouldAdvance(play)) { - func_8010BD58(play, cmd->base); + Message_StartOcarinaWithSongEffect(play, cmd->base); } } } diff --git a/soh/src/code/z_message_PAL.c b/soh/src/code/z_message_PAL.c index 881896ab0cf..4c1fc250cd1 100644 --- a/soh/src/code/z_message_PAL.c +++ b/soh/src/code/z_message_PAL.c @@ -3032,13 +3032,13 @@ void Message_StartOcarina(PlayState* play, u16 ocarinaActionId) { } } -void func_8010BD58(PlayState* play, u16 ocarinaActionId) { - play->msgCtx.unk_E40E = 0; +void Message_StartOcarinaWithSongEffect(PlayState* play, u16 ocarinaActionId) { + play->msgCtx.disableSongEffect = 0; Message_StartOcarina(play, ocarinaActionId); } -void func_8010BD88(PlayState* play, u16 ocarinaActionId) { - play->msgCtx.unk_E40E = 1; +void Message_StartOcarinaNoSongEffect(PlayState* play, u16 ocarinaActionId) { + play->msgCtx.disableSongEffect = 1; Message_StartOcarina(play, ocarinaActionId); } @@ -3875,7 +3875,7 @@ void Message_DrawMain(PlayState* play, Gfx** p) { Message_DrawText(play, &gfx); } if (Message_ShouldAdvance(play)) { - func_8010BD58(play, msgCtx->ocarinaAction); + Message_StartOcarinaWithSongEffect(play, msgCtx->ocarinaAction); } break; case MSGMODE_SCARECROW_LONG_RECORDING_START: diff --git a/soh/src/overlays/actors/ovl_En_Box/z_en_box.c b/soh/src/overlays/actors/ovl_En_Box/z_en_box.c index 9b341f462a4..921ddc5e6e0 100644 --- a/soh/src/overlays/actors/ovl_En_Box/z_en_box.c +++ b/soh/src/overlays/actors/ovl_En_Box/z_en_box.c @@ -47,7 +47,7 @@ void EnBox_Update(Actor* thisx, PlayState* play); void EnBox_Draw(Actor* thisx, PlayState* play); void EnBox_FallOnSwitchFlag(EnBox*, PlayState*); -void func_809C9700(EnBox*, PlayState*); +void EnBox_WaitForOcarina(EnBox*, PlayState*); void EnBox_AppearOnSwitchFlag(EnBox*, PlayState*); void EnBox_AppearOnRoomClear(EnBox*, PlayState*); void EnBox_AppearInit(EnBox*, PlayState*); @@ -161,7 +161,7 @@ void EnBox_Init(Actor* thisx, PlayState* play2) { this->alpha = 0; this->dyna.actor.flags |= ACTOR_FLAG_UPDATE_CULLING_DISABLED; } else if (this->type == ENBOX_TYPE_9 || this->type == ENBOX_TYPE_10) { - EnBox_SetupAction(this, func_809C9700); + EnBox_SetupAction(this, EnBox_WaitForOcarina); this->dyna.actor.flags |= ACTOR_FLAG_UPDATE_DURING_OCARINA; func_8003EBF8(play, &play->colCtx.dyna, this->dyna.bgId); this->movementFlags |= ENBOX_MOVE_IMMOBILE; @@ -305,7 +305,7 @@ void EnBox_FallOnSwitchFlag(EnBox* this, PlayState* play) { } // used for types 9, 10 -void func_809C9700(EnBox* this, PlayState* play) { +void EnBox_WaitForOcarina(EnBox* this, PlayState* play) { s32 treasureFlag = this->dyna.actor.params & 0x1F; Player* player = GET_PLAYER(play); @@ -325,7 +325,7 @@ void func_809C9700(EnBox* this, PlayState* play) { } if (this->unk_1FB == ENBOX_STATE_1) { - func_8010BD58(play, OCARINA_ACTION_FREE_PLAY); + Message_StartOcarinaWithSongEffect(play, OCARINA_ACTION_FREE_PLAY); this->unk_1FB = ENBOX_STATE_2; } else if (this->unk_1FB == ENBOX_STATE_2 && play->msgCtx.ocarinaMode == OCARINA_MODE_04) { if ((play->msgCtx.lastPlayedSong == OCARINA_SONG_LULLABY && this->type == ENBOX_TYPE_9) || diff --git a/soh/src/overlays/actors/ovl_En_Du/z_en_du.c b/soh/src/overlays/actors/ovl_En_Du/z_en_du.c index a6a282e6c5c..ed27ce77ff2 100644 --- a/soh/src/overlays/actors/ovl_En_Du/z_en_du.c +++ b/soh/src/overlays/actors/ovl_En_Du/z_en_du.c @@ -11,10 +11,10 @@ void EnDu_Update(Actor* thisx, PlayState* play); void EnDu_Draw(Actor* thisx, PlayState* play); void func_809FE3B4(EnDu* this, PlayState* play); -void func_809FE3C0(EnDu* this, PlayState* play); +void EnDu_WaitForOcarina(EnDu* this, PlayState* play); void func_809FE638(EnDu* this, PlayState* play); void func_809FE890(EnDu* this, PlayState* play); -void func_809FE4A4(EnDu* this, PlayState* play); +void EnDu_ListenToOcarina(EnDu* this, PlayState* play); void func_809FE6CC(EnDu* this, PlayState* play); void func_809FE740(EnDu* this, PlayState* play); void func_809FE798(EnDu* this, PlayState* play); @@ -336,7 +336,7 @@ void EnDu_Init(Actor* thisx, PlayState* play) { } else if (play->sceneNum == SCENE_FIRE_TEMPLE) { EnDu_SetupAction(this, func_809FE638); } else if (!LINK_IS_ADULT) { - EnDu_SetupAction(this, func_809FE3C0); + EnDu_SetupAction(this, EnDu_WaitForOcarina); } else { EnDu_SetupAction(this, func_809FE3B4); } @@ -352,14 +352,14 @@ void EnDu_Destroy(Actor* thisx, PlayState* play) { void func_809FE3B4(EnDu* this, PlayState* play) { } -void func_809FE3C0(EnDu* this, PlayState* play) { +void EnDu_WaitForOcarina(EnDu* this, PlayState* play) { Player* player = GET_PLAYER(play); if (player->stateFlags2 & PLAYER_STATE2_ATTEMPT_PLAY_FOR_ACTOR) { - func_8010BD88(play, OCARINA_ACTION_CHECK_SARIA); + Message_StartOcarinaNoSongEffect(play, OCARINA_ACTION_CHECK_SARIA); player->stateFlags2 |= PLAYER_STATE2_PLAY_FOR_ACTOR; - player->unk_6A8 = &this->actor; - EnDu_SetupAction(this, func_809FE4A4); + player->ocarinaTargetActor = &this->actor; + EnDu_SetupAction(this, EnDu_ListenToOcarina); return; } if (this->interactInfo.talkState == NPC_TALK_STATE_ACTION) { @@ -371,12 +371,12 @@ void func_809FE3C0(EnDu* this, PlayState* play) { } } -void func_809FE4A4(EnDu* this, PlayState* play) { +void EnDu_ListenToOcarina(EnDu* this, PlayState* play) { Player* player = GET_PLAYER(play); if (play->msgCtx.ocarinaMode == OCARINA_MODE_04) { play->msgCtx.ocarinaMode = OCARINA_MODE_00; - EnDu_SetupAction(this, func_809FE3C0); + EnDu_SetupAction(this, EnDu_WaitForOcarina); } else if (play->msgCtx.ocarinaMode >= OCARINA_MODE_06) { if (GameInteractor_Should(VB_PLAY_DARUNIAS_JOY_CS, true)) { play->csCtx.segment = SEGMENTED_TO_VIRTUAL(gGoronCityDaruniaWrongCs); @@ -553,7 +553,7 @@ void func_809FEB08(EnDu* this, PlayState* play) { if (this->unk_1E8 == 1) { Player_SetCsActionWithHaltedActors(play, &this->actor, 7); Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENDU_ANIM_1); - EnDu_SetupAction(this, func_809FE3C0); + EnDu_SetupAction(this, EnDu_WaitForOcarina); return; } if (GameInteractor_Should(VB_BE_ELIGIBLE_FOR_DARUNIAS_JOY_REWARD, CUR_UPG_VALUE(UPG_STRENGTH) <= 0)) { @@ -562,7 +562,7 @@ void func_809FEB08(EnDu* this, PlayState* play) { EnDu_SetupAction(this, func_809FEC14); } else { this->actor.textId = 0x301F; - EnDu_SetupAction(this, func_809FE3C0); + EnDu_SetupAction(this, EnDu_WaitForOcarina); } Message_StartTextbox(play, this->actor.textId, NULL); Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENDU_ANIM_14); @@ -591,7 +591,7 @@ void func_809FEC70(EnDu* this, PlayState* play) { void func_809FECE4(EnDu* this, PlayState* play) { if (this->interactInfo.talkState == NPC_TALK_STATE_ITEM_GIVEN) { this->interactInfo.talkState = NPC_TALK_STATE_IDLE; - EnDu_SetupAction(this, func_809FE3C0); + EnDu_SetupAction(this, EnDu_WaitForOcarina); } } @@ -621,7 +621,7 @@ void EnDu_Update(Actor* thisx, PlayState* play) { Actor_UpdateBgCheckInfo(play, &this->actor, 0.0f, 0.0f, 0.0f, 4); - if (this->actionFunc != func_809FE4A4) { + if (this->actionFunc != EnDu_ListenToOcarina) { Npc_UpdateTalking(play, &this->actor, &this->interactInfo.talkState, this->collider.dim.radius + 116.0f, EnDu_GetTextId, EnDu_UpdateTalkState); } diff --git a/soh/src/overlays/actors/ovl_En_Fr/z_en_fr.c b/soh/src/overlays/actors/ovl_En_Fr/z_en_fr.c index 67d7b3f35a4..d3e8feb8807 100644 --- a/soh/src/overlays/actors/ovl_En_Fr/z_en_fr.c +++ b/soh/src/overlays/actors/ovl_En_Fr/z_en_fr.c @@ -626,7 +626,7 @@ void EnFr_Idle(EnFr* this, PlayState* play) { this->reward = GI_NONE; this->actionFunc = EnFr_Activate; } else if (EnFr_IsAboveAndWithin30DistXZ(player, this)) { - player->unk_6A8 = &this->actor; + player->ocarinaTargetActor = &this->actor; } } @@ -673,7 +673,7 @@ void func_80A1BE98(EnFr* this, PlayState* play) { } } - func_8010BD58(play, OCARINA_ACTION_CHECK_NOWARP); + Message_StartOcarinaWithSongEffect(play, OCARINA_ACTION_CHECK_NOWARP); this->actionFunc = EnFr_ListeningToOcarinaNotes; } @@ -832,7 +832,7 @@ void EnFr_SetupFrogSong(EnFr* this, PlayState* play) { EnFr_SetupReward(this, play, false); } else { this->ocarinaNoteIndex = 0; - func_8010BD58(play, OCARINA_ACTION_FROGS); + Message_StartOcarinaWithSongEffect(play, OCARINA_ACTION_FROGS); this->ocarinaNote = EnFr_GetNextNoteFrogSong(this->ocarinaNoteIndex); EnFr_CheckOcarinaInputFrogSong(this->ocarinaNote); this->actionFunc = EnFr_ContinueFrogSong; @@ -841,7 +841,7 @@ void EnFr_SetupFrogSong(EnFr* this, PlayState* play) { } else { this->frogSongTimer = 40; this->ocarinaNoteIndex = 0; - func_8010BD58(play, OCARINA_ACTION_FROGS); + Message_StartOcarinaWithSongEffect(play, OCARINA_ACTION_FROGS); this->ocarinaNote = EnFr_GetNextNoteFrogSong(this->ocarinaNoteIndex); EnFr_CheckOcarinaInputFrogSong(this->ocarinaNote); this->actionFunc = EnFr_ContinueFrogSong; diff --git a/soh/src/overlays/actors/ovl_En_Fu/z_en_fu.c b/soh/src/overlays/actors/ovl_En_Fu/z_en_fu.c index 2abf22647ee..4a888e80a6a 100644 --- a/soh/src/overlays/actors/ovl_En_Fu/z_en_fu.c +++ b/soh/src/overlays/actors/ovl_En_Fu/z_en_fu.c @@ -202,7 +202,7 @@ void EnFu_WaitForPlayback(EnFu* this, PlayState* play) { player->stateFlags2 |= PLAYER_STATE2_NEAR_OCARINA_ACTOR; // if dialog state is 7, player has played back the song if (Message_GetState(&play->msgCtx) == TEXT_STATE_SONG_DEMO_DONE) { - func_8010BD58(play, OCARINA_ACTION_PLAYBACK_STORMS); + Message_StartOcarinaWithSongEffect(play, OCARINA_ACTION_PLAYBACK_STORMS); this->actionFunc = func_80A1DBD4; } } @@ -215,7 +215,7 @@ void EnFu_TeachSong(EnFu* this, PlayState* play) { if (Message_GetState(&play->msgCtx) == TEXT_STATE_CLOSING) { this->behaviorFlags &= ~FU_WAIT; AudioOcarina_SetInstrument(4); // seems to be related to setting instrument type - func_8010BD58(play, OCARINA_ACTION_TEACH_STORMS); + Message_StartOcarinaWithSongEffect(play, OCARINA_ACTION_TEACH_STORMS); this->actionFunc = EnFu_WaitForPlayback; } } diff --git a/soh/src/overlays/actors/ovl_En_Gs/z_en_gs.c b/soh/src/overlays/actors/ovl_En_Gs/z_en_gs.c index 782ab288acf..26b9e828f44 100644 --- a/soh/src/overlays/actors/ovl_En_Gs/z_en_gs.c +++ b/soh/src/overlays/actors/ovl_En_Gs/z_en_gs.c @@ -147,7 +147,7 @@ void func_80A4E470(EnGs* this, PlayState* play) { if (this->unk_19D == 0) { player->stateFlags2 |= PLAYER_STATE2_NEAR_OCARINA_ACTOR; if (player->stateFlags2 & PLAYER_STATE2_ATTEMPT_PLAY_FOR_ACTOR) { - func_8010BD58(play, OCARINA_ACTION_FREE_PLAY); + Message_StartOcarinaWithSongEffect(play, OCARINA_ACTION_FREE_PLAY); this->unk_19D |= 1; } } else if (GameInteractor_Should(VB_SPAWN_GOSSIP_STONE_FAIRY, this->unk_19D & 1, this)) { diff --git a/soh/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c b/soh/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c index 26dc6e8d1ca..998ea6ff8b9 100644 --- a/soh/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c +++ b/soh/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c @@ -216,7 +216,7 @@ void func_80A8F75C(EnKakasi* this, PlayState* play) { if (player->stateFlags2 & PLAYER_STATE2_ATTEMPT_PLAY_FOR_ACTOR) { this->camId = OnePointCutscene_Init(play, 2260, -99, &this->actor, CAM_ID_MAIN); - func_8010BD58(play, OCARINA_ACTION_SCARECROW_LONG_RECORDING); + Message_StartOcarinaWithSongEffect(play, OCARINA_ACTION_SCARECROW_LONG_RECORDING); this->unk_19A = 0; this->unk_1B8 = 0.0; player->stateFlags2 |= PLAYER_STATE2_NEAR_OCARINA_ACTOR; @@ -270,7 +270,7 @@ void func_80A8F9C8(EnKakasi* this, PlayState* play) { this->camId = OnePointCutscene_Init(play, 2270, -99, &this->actor, CAM_ID_MAIN); play->msgCtx.msgMode = MSGMODE_PAUSED; Player_SetCsActionWithHaltedActors(play, NULL, 8); - func_8010BD58(play, OCARINA_ACTION_SCARECROW_LONG_PLAYBACK); + Message_StartOcarinaWithSongEffect(play, OCARINA_ACTION_SCARECROW_LONG_PLAYBACK); this->actionFunc = func_80A8FAA4; } } diff --git a/soh/src/overlays/actors/ovl_En_Kakasi3/z_en_kakasi3.c b/soh/src/overlays/actors/ovl_En_Kakasi3/z_en_kakasi3.c index 2f088e5f692..c01a76104d0 100644 --- a/soh/src/overlays/actors/ovl_En_Kakasi3/z_en_kakasi3.c +++ b/soh/src/overlays/actors/ovl_En_Kakasi3/z_en_kakasi3.c @@ -270,7 +270,7 @@ void func_80A91348(EnKakasi3* this, PlayState* play) { void func_80A915B8(EnKakasi3* this, PlayState* play) { if (Message_GetState(&play->msgCtx) == TEXT_STATE_EVENT && Message_ShouldAdvance(play)) { Message_CloseTextbox(play); - func_8010BD58(play, OCARINA_ACTION_SCARECROW_RECORDING); + Message_StartOcarinaWithSongEffect(play, OCARINA_ACTION_SCARECROW_RECORDING); this->actionFunc = func_80A91620; } } @@ -313,7 +313,7 @@ void func_80A91760(EnKakasi3* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); if (this->dialogState == Message_GetState(&play->msgCtx) && Message_ShouldAdvance(play)) { play->msgCtx.msgMode = MSGMODE_PAUSED; - func_8010BD58(play, OCARINA_ACTION_SCARECROW_PLAYBACK); + Message_StartOcarinaWithSongEffect(play, OCARINA_ACTION_SCARECROW_PLAYBACK); this->actionFunc = func_80A917FC; this->camId = OnePointCutscene_Init(play, 2280, -99, &this->actor, CAM_ID_MAIN); } @@ -334,7 +334,7 @@ void func_80A917FC(EnKakasi3* this, PlayState* play) { void func_80A9187C(EnKakasi3* this, PlayState* play) { if (Message_GetState(&play->msgCtx) == TEXT_STATE_EVENT && Message_ShouldAdvance(play)) { Message_CloseTextbox(play); - func_8010BD58(play, OCARINA_ACTION_CHECK_SCARECROW); + Message_StartOcarinaWithSongEffect(play, OCARINA_ACTION_CHECK_SCARECROW); this->actionFunc = func_80A918E4; } } diff --git a/soh/src/overlays/actors/ovl_En_Ma1/z_en_ma1.c b/soh/src/overlays/actors/ovl_En_Ma1/z_en_ma1.c index 68ce9076a26..716dd5486bc 100644 --- a/soh/src/overlays/actors/ovl_En_Ma1/z_en_ma1.c +++ b/soh/src/overlays/actors/ovl_En_Ma1/z_en_ma1.c @@ -376,7 +376,7 @@ void EnMa1_IdleTeachSong(EnMa1* this, PlayState* play) { if (Flags_GetEventChkInf(EVENTCHKINF_INVITED_TO_SING_WITH_CHILD_MALON)) { if (player->stateFlags2 & PLAYER_STATE2_ATTEMPT_PLAY_FOR_ACTOR) { player->stateFlags2 |= PLAYER_STATE2_PLAY_FOR_ACTOR; - player->unk_6A8 = &this->actor; + player->ocarinaTargetActor = &this->actor; this->actor.textId = 0x2061; Message_StartTextbox(play, this->actor.textId, NULL); this->interactInfo.talkState = NPC_TALK_STATE_TALKING; @@ -392,7 +392,7 @@ void EnMa1_StartTeachSong(EnMa1* this, PlayState* play) { GET_PLAYER(play)->stateFlags2 |= PLAYER_STATE2_NEAR_OCARINA_ACTOR; if (this->interactInfo.talkState == NPC_TALK_STATE_ACTION) { AudioOcarina_SetInstrument(2); - func_8010BD58(play, OCARINA_ACTION_TEACH_EPONA); + Message_StartOcarinaWithSongEffect(play, OCARINA_ACTION_TEACH_EPONA); this->actor.flags &= ~ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED; this->actionFunc = EnMa1_TeachSong; } @@ -401,7 +401,7 @@ void EnMa1_StartTeachSong(EnMa1* this, PlayState* play) { void EnMa1_TeachSong(EnMa1* this, PlayState* play) { GET_PLAYER(play)->stateFlags2 |= PLAYER_STATE2_NEAR_OCARINA_ACTOR; if (Message_GetState(&play->msgCtx) == TEXT_STATE_SONG_DEMO_DONE) { - func_8010BD58(play, OCARINA_ACTION_PLAYBACK_EPONA); + Message_StartOcarinaWithSongEffect(play, OCARINA_ACTION_PLAYBACK_EPONA); this->actionFunc = EnMa1_WaitForPlayback; } } diff --git a/soh/src/overlays/actors/ovl_En_Ma2/z_en_ma2.c b/soh/src/overlays/actors/ovl_En_Ma2/z_en_ma2.c index 023ed0319e2..5f190c71c93 100644 --- a/soh/src/overlays/actors/ovl_En_Ma2/z_en_ma2.c +++ b/soh/src/overlays/actors/ovl_En_Ma2/z_en_ma2.c @@ -268,9 +268,9 @@ void EnMa2_WaitForOcarina(EnMa2* this, PlayState* play) { Player* player = GET_PLAYER(play); if (player->stateFlags2 & PLAYER_STATE2_ATTEMPT_PLAY_FOR_ACTOR) { - player->unk_6A8 = &this->actor; + player->ocarinaTargetActor = &this->actor; player->stateFlags2 |= PLAYER_STATE2_PLAY_FOR_ACTOR; - func_8010BD58(play, OCARINA_ACTION_CHECK_EPONA); + Message_StartOcarinaWithSongEffect(play, OCARINA_ACTION_CHECK_EPONA); this->actionFunc = EnMa2_WaitForEponasSong; } else if (this->actor.xzDistToPlayer < 30.0f + (f32)this->collider.dim.radius) { player->stateFlags2 |= PLAYER_STATE2_NEAR_OCARINA_ACTOR; diff --git a/soh/src/overlays/actors/ovl_En_Md/z_en_md.c b/soh/src/overlays/actors/ovl_En_Md/z_en_md.c index bbc4a1bfec4..5856a693805 100644 --- a/soh/src/overlays/actors/ovl_En_Md/z_en_md.c +++ b/soh/src/overlays/actors/ovl_En_Md/z_en_md.c @@ -754,8 +754,8 @@ void EnMd_BlockPath(EnMd* this, PlayState* play) { if ((this->interactInfo.talkState == NPC_TALK_STATE_IDLE) && (play->sceneNum == SCENE_LOST_WOODS)) { if (player->stateFlags2 & PLAYER_STATE2_ATTEMPT_PLAY_FOR_ACTOR) { player->stateFlags2 |= PLAYER_STATE2_PLAY_FOR_ACTOR; - player->unk_6A8 = &this->actor; - func_8010BD58(play, OCARINA_ACTION_CHECK_SARIA); + player->ocarinaTargetActor = &this->actor; + Message_StartOcarinaWithSongEffect(play, OCARINA_ACTION_CHECK_SARIA); this->actionFunc = EnMd_ListenToOcarina; return; } diff --git a/soh/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c b/soh/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c index 801bcf69f45..d5543e7eefd 100644 --- a/soh/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c +++ b/soh/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c @@ -16,12 +16,12 @@ void EnOkarinaTag_Init(Actor* thisx, PlayState* play); void EnOkarinaTag_Destroy(Actor* thisx, PlayState* play); void EnOkarinaTag_Update(Actor* thisx, PlayState* play); -void func_80ABEF2C(EnOkarinaTag* this, PlayState* play); -void func_80ABF708(EnOkarinaTag* this, PlayState* play); -void func_80ABF28C(EnOkarinaTag* this, PlayState* play); -void func_80ABF0CC(EnOkarinaTag* this, PlayState* play); -void func_80ABF4C8(EnOkarinaTag* this, PlayState* play); -void func_80ABF7CC(EnOkarinaTag* this, PlayState* play); +void EnOkarinaTag_WaitForPlayer(EnOkarinaTag* this, PlayState* play); +void EnOkarinaTag_OfferTalk(EnOkarinaTag* this, PlayState* play); +void EnOkarinaTag_WaitForOcarina(EnOkarinaTag* this, PlayState* play); +void EnOkarinaTag_WaitForPlaybackResult(EnOkarinaTag* this, PlayState* play); +void EnOkarinaTag_HandleSongEvent(EnOkarinaTag* this, PlayState* play); +void EnOkarinaTag_WaitForDialogue(EnOkarinaTag* this, PlayState* play); const ActorInit En_Okarina_Tag_InitVars = { ACTOR_EN_OKARINA_TAG, @@ -57,7 +57,7 @@ void EnOkarinaTag_Init(Actor* thisx, PlayState* play) { } if (this->ocarinaSong == 0xF) { this->ocarinaSong = 0; - this->unk_158 = 1; + this->success = 1; } this->actor.targetMode = 1; if (this->actor.world.rot.z > 0) { @@ -75,7 +75,7 @@ void EnOkarinaTag_Init(Actor* thisx, PlayState* play) { // "Processing range information" osSyncPrintf(VT_FGCOL(CYAN) "☆☆☆☆☆ 処理範囲情報\t ☆☆☆☆☆ %f\n" VT_RST, this->interactRange); // "Hit?" - osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ 当り?\t\t ☆☆☆☆☆ %d\n" VT_RST, this->unk_158); + osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ 当り?\t\t ☆☆☆☆☆ %d\n" VT_RST, this->success); osSyncPrintf("\n\n"); if (GameInteractor_Should(VB_OKARINA_TAG_COMPLETED, @@ -84,7 +84,7 @@ void EnOkarinaTag_Init(Actor* thisx, PlayState* play) { } else { switch (this->type) { case 7: - this->actionFunc = func_80ABEF2C; + this->actionFunc = EnOkarinaTag_WaitForPlayer; break; case 2: if (LINK_IS_ADULT) { @@ -94,11 +94,11 @@ void EnOkarinaTag_Init(Actor* thisx, PlayState* play) { case 1: case 4: case 6: - this->actionFunc = func_80ABF28C; + this->actionFunc = EnOkarinaTag_WaitForOcarina; break; case 5: this->actor.textId = 0x5021; - this->actionFunc = func_80ABF708; + this->actionFunc = EnOkarinaTag_OfferTalk; break; default: Actor_Kill(&this->actor); @@ -107,7 +107,7 @@ void EnOkarinaTag_Init(Actor* thisx, PlayState* play) { } } -void func_80ABEF2C(EnOkarinaTag* this, PlayState* play) { +void EnOkarinaTag_WaitForPlayer(EnOkarinaTag* this, PlayState* play) { Player* player; u16 ocarinaSong; @@ -130,23 +130,23 @@ void func_80ABEF2C(EnOkarinaTag* this, PlayState* play) { ocarinaSong = 0xA; } player->stateFlags2 |= PLAYER_STATE2_NEAR_OCARINA_ACTOR; - func_8010BD58(play, ocarinaSong + OCARINA_ACTION_CHECK_SARIA); - this->actionFunc = func_80ABF0CC; + Message_StartOcarinaWithSongEffect(play, ocarinaSong + OCARINA_ACTION_CHECK_SARIA); + this->actionFunc = EnOkarinaTag_WaitForPlaybackResult; } else if ((this->actor.xzDistToPlayer < (50.0f + this->interactRange) && ((fabsf(player->actor.world.pos.y - this->actor.world.pos.y) < 40.0f)))) { this->unk_15A = 0; - player->unk_6A8 = &this->actor; + player->ocarinaTargetActor = &this->actor; } } } } } -void func_80ABF0CC(EnOkarinaTag* this, PlayState* play) { +void EnOkarinaTag_WaitForPlaybackResult(EnOkarinaTag* this, PlayState* play) { Player* player = GET_PLAYER(play); if (play->msgCtx.ocarinaMode == OCARINA_MODE_04) { - this->actionFunc = func_80ABEF2C; + this->actionFunc = EnOkarinaTag_WaitForPlayer; } else { if (play->msgCtx.ocarinaMode == OCARINA_MODE_03) { if (GameInteractor_Should(VB_OKARINA_TAG_COMPLETE, this->switchFlag >= 0, this)) { @@ -160,10 +160,10 @@ void func_80ABF0CC(EnOkarinaTag* this, PlayState* play) { play->msgCtx.ocarinaMode = OCARINA_MODE_04; } Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME); - this->actionFunc = func_80ABEF2C; + this->actionFunc = EnOkarinaTag_WaitForPlayer; return; } - if (this->unk_158 != 0) { + if (this->success != 0) { if ((play->msgCtx.ocarinaMode == OCARINA_MODE_05) || (play->msgCtx.ocarinaMode == OCARINA_MODE_06) || (play->msgCtx.ocarinaMode == OCARINA_MODE_07) || (play->msgCtx.ocarinaMode == OCARINA_MODE_08) || (play->msgCtx.ocarinaMode == OCARINA_MODE_09) || (play->msgCtx.ocarinaMode == OCARINA_MODE_0A) || @@ -173,20 +173,20 @@ void func_80ABF0CC(EnOkarinaTag* this, PlayState* play) { } play->msgCtx.ocarinaMode = OCARINA_MODE_04; Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME); - this->actionFunc = func_80ABEF2C; + this->actionFunc = EnOkarinaTag_WaitForPlayer; return; } } if ((play->msgCtx.ocarinaMode >= OCARINA_MODE_05) && (play->msgCtx.ocarinaMode < OCARINA_MODE_0E)) { play->msgCtx.ocarinaMode = OCARINA_MODE_04; - this->actionFunc = func_80ABEF2C; + this->actionFunc = EnOkarinaTag_WaitForPlayer; } else if (play->msgCtx.ocarinaMode == OCARINA_MODE_01) { player->stateFlags2 |= PLAYER_STATE2_NEAR_OCARINA_ACTOR; } } } -void func_80ABF28C(EnOkarinaTag* this, PlayState* play) { +void EnOkarinaTag_WaitForOcarina(EnOkarinaTag* this, PlayState* play) { Player* player = GET_PLAYER(play); this->unk_15A++; @@ -203,16 +203,16 @@ void func_80ABF28C(EnOkarinaTag* this, PlayState* play) { if (player->stateFlags2 & PLAYER_STATE2_ATTEMPT_PLAY_FOR_ACTOR) { switch (this->type) { case 1: - func_8010BD58(play, OCARINA_ACTION_CHECK_LULLABY); + Message_StartOcarinaWithSongEffect(play, OCARINA_ACTION_CHECK_LULLABY); break; case 2: - func_8010BD58(play, OCARINA_ACTION_CHECK_STORMS); + Message_StartOcarinaWithSongEffect(play, OCARINA_ACTION_CHECK_STORMS); break; case 4: - func_8010BD58(play, OCARINA_ACTION_CHECK_TIME); + Message_StartOcarinaWithSongEffect(play, OCARINA_ACTION_CHECK_TIME); break; case 6: - func_8010BD58(play, OCARINA_ACTION_CHECK_LULLABY); + Message_StartOcarinaWithSongEffect(play, OCARINA_ACTION_CHECK_LULLABY); break; default: // "Ocarina Invisible-kun demo start check error source" @@ -222,7 +222,7 @@ void func_80ABF28C(EnOkarinaTag* this, PlayState* play) { break; } player->stateFlags2 |= PLAYER_STATE2_NEAR_OCARINA_ACTOR; - this->actionFunc = func_80ABF4C8; + this->actionFunc = EnOkarinaTag_HandleSongEvent; } else if ((this->actor.xzDistToPlayer < (50.0f + this->interactRange)) && (fabsf(player->actor.world.pos.y - this->actor.world.pos.y) < 40.0f)) { this->unk_15A = 0; @@ -232,11 +232,11 @@ void func_80ABF28C(EnOkarinaTag* this, PlayState* play) { } } -void func_80ABF4C8(EnOkarinaTag* this, PlayState* play) { +void EnOkarinaTag_HandleSongEvent(EnOkarinaTag* this, PlayState* play) { Player* player = GET_PLAYER(play); if (play->msgCtx.ocarinaMode == OCARINA_MODE_04) { - this->actionFunc = func_80ABF28C; + this->actionFunc = EnOkarinaTag_WaitForOcarina; } else if (play->msgCtx.ocarinaMode == OCARINA_MODE_03) { Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME); if (GameInteractor_Should(VB_OKARINA_TAG_COMPLETE, this->switchFlag >= 0, this)) { @@ -273,12 +273,12 @@ void func_80ABF4C8(EnOkarinaTag* this, PlayState* play) { break; } play->msgCtx.ocarinaMode = OCARINA_MODE_04; - this->actionFunc = func_80ABF28C; + this->actionFunc = EnOkarinaTag_WaitForOcarina; } else { if (play->msgCtx.ocarinaMode >= OCARINA_MODE_05) { if (play->msgCtx.ocarinaMode < OCARINA_MODE_0E) { play->msgCtx.ocarinaMode = OCARINA_MODE_04; - this->actionFunc = func_80ABF28C; + this->actionFunc = EnOkarinaTag_WaitForOcarina; return; } } @@ -288,12 +288,12 @@ void func_80ABF4C8(EnOkarinaTag* this, PlayState* play) { } } -void func_80ABF708(EnOkarinaTag* this, PlayState* play) { +void EnOkarinaTag_OfferTalk(EnOkarinaTag* this, PlayState* play) { s16 yawDiff; s16 yawDiffNew; if (Actor_ProcessTalkRequest(&this->actor, play)) { - this->actionFunc = func_80ABF7CC; + this->actionFunc = EnOkarinaTag_WaitForDialogue; } else { yawDiff = this->actor.yawTowardsPlayer - this->actor.world.rot.y; this->unk_15A++; @@ -310,7 +310,7 @@ void func_80ABF708(EnOkarinaTag* this, PlayState* play) { } } -void func_80ABF7CC(EnOkarinaTag* this, PlayState* play) { +void EnOkarinaTag_WaitForDialogue(EnOkarinaTag* this, PlayState* play) { // "Open sesame sesame!" osSyncPrintf(VT_FGCOL(PURPLE) "☆☆☆☆☆ 開けゴマゴマゴマ! ☆☆☆☆☆ %d\n" VT_RST, Message_GetState(&play->msgCtx)); @@ -320,7 +320,7 @@ void func_80ABF7CC(EnOkarinaTag* this, PlayState* play) { play->csCtx.segment = SEGMENTED_TO_VIRTUAL(&gSunSongGraveSunSongTeachCs); gSaveContext.cutsceneTrigger = 1; } - this->actionFunc = func_80ABF708; + this->actionFunc = EnOkarinaTag_OfferTalk; } } diff --git a/soh/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.h b/soh/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.h index 8c947c335bd..7cb3e029107 100644 --- a/soh/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.h +++ b/soh/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.h @@ -15,7 +15,7 @@ typedef struct EnOkarinaTag { /* 0x0152 */ s16 ocarinaSong; /* 0x0154 */ s16 switchFlag; /* 0x0156 */ char unk_156[0x2]; - /* 0x0158 */ s16 unk_158; + /* 0x0158 */ s16 success; /* 0x015A */ s16 unk_15A; /* 0x015C */ f32 interactRange; } EnOkarinaTag; // size = 0x0160 diff --git a/soh/src/overlays/actors/ovl_En_Skj/z_en_skj.c b/soh/src/overlays/actors/ovl_En_Skj/z_en_skj.c index 8a0e41ec433..720bb0c457e 100644 --- a/soh/src/overlays/actors/ovl_En_Skj/z_en_skj.c +++ b/soh/src/overlays/actors/ovl_En_Skj/z_en_skj.c @@ -729,7 +729,7 @@ void EnSkj_SariasSongKidIdle(EnSkj* this, PlayState* play) { if (EnSkj_RangeCheck(player, sSmallStumpSkullKid.skullkid)) { EnSkj_SetupWaitInRange(this); player->stateFlags2 |= PLAYER_STATE2_NEAR_OCARINA_ACTOR; - player->unk_6A8 = &sSmallStumpSkullKid.skullkid->actor; + player->ocarinaTargetActor = &sSmallStumpSkullKid.skullkid->actor; } } } else { @@ -913,12 +913,12 @@ void EnSkj_WaitInRange(EnSkj* this, PlayState* play) { // Link was probably supposed to be pointed towards skull kid as well if (player->stateFlags2 & PLAYER_STATE2_ATTEMPT_PLAY_FOR_ACTOR) { player->stateFlags2 |= PLAYER_STATE2_PLAY_FOR_ACTOR; - player->unk_6A8 = &sSmallStumpSkullKid.skullkid->actor; + player->ocarinaTargetActor = &sSmallStumpSkullKid.skullkid->actor; player->actor.world.pos.x = sSmallStumpSkullKid.skullkid->actor.world.pos.x; 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(play, OCARINA_ACTION_CHECK_SARIA); + Message_StartOcarinaNoSongEffect(play, OCARINA_ACTION_CHECK_SARIA); EnSkj_SetupWaitForSong(this); } else if (D_80B01EA0 != 0) { player->actor.world.pos.x = sSmallStumpSkullKid.skullkid->actor.world.pos.x; @@ -965,7 +965,7 @@ void EnSkj_WaitForSong(EnSkj* this, PlayState* play) { ((play->msgCtx.msgMode == MSGMODE_OCARINA_FAIL) || (play->msgCtx.msgMode == MSGMODE_OCARINA_FAIL_NO_TEXT))) { play->msgCtx.ocarinaMode = OCARINA_MODE_04; Message_CloseTextbox(play); - player->unk_6A8 = &this->actor; + player->ocarinaTargetActor = &this->actor; Actor_OfferTalk(&this->actor, play, EnSkj_GetItemXzRange(this)); EnSkj_SetupWrongSong(this); } else { @@ -986,7 +986,7 @@ void EnSkj_WaitForSong(EnSkj* this, PlayState* play) { // Saria's song has been played for the first titme play->msgCtx.ocarinaMode = OCARINA_MODE_04; Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME); - player->unk_6A8 = &this->actor; + player->ocarinaTargetActor = &this->actor; Actor_OfferTalk(&this->actor, play, EnSkj_GetItemXzRange(this)); this->textId = 0x10BB; EnSkj_SetupAfterSong(this); @@ -1003,13 +1003,13 @@ void EnSkj_WaitForSong(EnSkj* this, PlayState* play) { gSaveContext.sunsSongState = 0; if (Flags_GetItemGetInf(ITEMGETINF_16)) { play->msgCtx.ocarinaMode = OCARINA_MODE_04; - player->unk_6A8 = &this->actor; + player->ocarinaTargetActor = &this->actor; Actor_OfferTalk(&this->actor, play, EnSkj_GetItemXzRange(this)); this->textId = 0x10BD; EnSkj_SetupAfterSong(this); } else { play->msgCtx.ocarinaMode = OCARINA_MODE_04; - player->unk_6A8 = &this->actor; + player->ocarinaTargetActor = &this->actor; Actor_OfferTalk(&this->actor, play, EnSkj_GetItemXzRange(this)); EnSkj_SetupWrongSong(this); } @@ -1218,7 +1218,7 @@ void EnSkj_SariasSongWaitForTextClear(EnSkj* this, PlayState* play) { if (state == TEXT_STATE_DONE && Message_ShouldAdvance(play)) { EnSkj_SetupWaitInRange(this); player->stateFlags2 |= PLAYER_STATE2_NEAR_OCARINA_ACTOR; - player->unk_6A8 = (Actor*)sSmallStumpSkullKid.skullkid; + player->ocarinaTargetActor = (Actor*)sSmallStumpSkullKid.skullkid; } } @@ -1384,7 +1384,7 @@ void EnSkj_SetupWaitForOcarina(EnSkj* this, PlayState* play) { player->stateFlags2 |= PLAYER_STATE2_PLAY_FOR_ACTOR; func_800F5BF0(NATURE_ID_KOKIRI_REGION); EnSkj_TurnPlayer(this, player); - player->unk_6A8 = &this->actor; + player->ocarinaTargetActor = &this->actor; Message_StartTextbox(play, 0x10BE, &this->actor); this->actionFunc = EnSkj_StartOcarinaMinigame; } else { @@ -1400,7 +1400,7 @@ void EnSkj_WaitForOcarina(EnSkj* this, PlayState* play) { player->stateFlags2 |= PLAYER_STATE2_PLAY_FOR_ACTOR; func_800F5BF0(NATURE_ID_KOKIRI_REGION); EnSkj_TurnPlayer(this, player); - player->unk_6A8 = &this->actor; + player->ocarinaTargetActor = &this->actor; Message_StartTextbox(play, 0x10BE, &this->actor); this->actionFunc = EnSkj_StartOcarinaMinigame; } else if (EnSkj_RangeCheck(player, this)) { @@ -1423,7 +1423,7 @@ void EnSkj_StartOcarinaMinigame(EnSkj* this, PlayState* play) { this->actionFunc = EnSkj_WaitForPlayback; // #endregion } else { - func_8010BD58(play, OCARINA_ACTION_MEMORY_GAME); + Message_StartOcarinaWithSongEffect(play, OCARINA_ACTION_MEMORY_GAME); if (sOcarinaMinigameSkullKids[SKULL_KID_LEFT].skullkid != NULL) { sOcarinaMinigameSkullKids[SKULL_KID_LEFT].skullkid->minigameState = SKULL_KID_OCARINA_PLAY_NOTES; this->songFailTimer = 160; @@ -1441,7 +1441,7 @@ void EnSkj_WaitForPlayback(EnSkj* this, PlayState* play) { if (play->msgCtx.ocarinaMode == OCARINA_MODE_03) { // failed the game Message_CloseTextbox(play); play->msgCtx.ocarinaMode = OCARINA_MODE_04; - player->unk_6A8 = &this->actor; + player->ocarinaTargetActor = &this->actor; Actor_OfferTalk(&this->actor, play, 26.0f); this->textId = 0x102D; this->actionFunc = EnSkj_FailedMiniGame; @@ -1449,7 +1449,7 @@ void EnSkj_WaitForPlayback(EnSkj* this, PlayState* play) { Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME); Message_CloseTextbox(play); play->msgCtx.ocarinaMode = OCARINA_MODE_04; - player->unk_6A8 = &this->actor; + player->ocarinaTargetActor = &this->actor; Actor_OfferTalk(&this->actor, play, 26.0f); this->textId = 0x10BF; this->actionFunc = EnSkj_WonOcarinaMiniGame; @@ -1490,7 +1490,7 @@ void EnSkj_WaitForPlayback(EnSkj* this, PlayState* play) { Sfx_PlaySfxCentered(NA_SE_SY_OCARINA_ERROR); Message_CloseTextbox(play); play->msgCtx.ocarinaMode = OCARINA_MODE_04; - player->unk_6A8 = &this->actor; + player->ocarinaTargetActor = &this->actor; Actor_OfferTalk(&this->actor, play, 26.0f); this->textId = 0x102D; this->actionFunc = EnSkj_FailedMiniGame; diff --git a/soh/src/overlays/actors/ovl_Obj_Timeblock/z_obj_timeblock.c b/soh/src/overlays/actors/ovl_Obj_Timeblock/z_obj_timeblock.c index b158a686126..5b05ffc4996 100644 --- a/soh/src/overlays/actors/ovl_Obj_Timeblock/z_obj_timeblock.c +++ b/soh/src/overlays/actors/ovl_Obj_Timeblock/z_obj_timeblock.c @@ -175,7 +175,7 @@ s32 ObjTimeblock_WaitForOcarina(ObjTimeblock* this, PlayState* play) { if (ObjTimeblock_PlayerIsInRange(this, play)) { if (player->stateFlags2 & PLAYER_STATE2_ATTEMPT_PLAY_FOR_ACTOR) { - func_8010BD58(play, OCARINA_ACTION_FREE_PLAY); + Message_StartOcarinaWithSongEffect(play, OCARINA_ACTION_FREE_PLAY); this->songObserverFunc = ObjTimeblock_WaitForSong; } else { player->stateFlags2 |= PLAYER_STATE2_NEAR_OCARINA_ACTOR; diff --git a/soh/src/overlays/actors/ovl_Obj_Warp2block/z_obj_warp2block.c b/soh/src/overlays/actors/ovl_Obj_Warp2block/z_obj_warp2block.c index 435063d9fd9..1d70b66d2e6 100644 --- a/soh/src/overlays/actors/ovl_Obj_Warp2block/z_obj_warp2block.c +++ b/soh/src/overlays/actors/ovl_Obj_Warp2block/z_obj_warp2block.c @@ -19,11 +19,11 @@ void ObjWarp2block_Update(Actor* thisx, PlayState* play); void ObjWarp2block_Draw(Actor* thisx, PlayState* play); void ObjWarp2block_Spawn(ObjWarp2block* this, PlayState* play); -s32 func_80BA1ECC(ObjWarp2block* this, PlayState* play); +s32 ObjWarp2block_PlayerIsInRange(ObjWarp2block* this, PlayState* play); void ObjWarp2block_SwapWithChild(ObjWarp2block* this, PlayState* play); -s32 func_80BA2218(ObjWarp2block* this, PlayState* play); -s32 func_80BA228C(ObjWarp2block* this, PlayState* play); -s32 func_80BA2304(ObjWarp2block* this, PlayState* play); +s32 ObjWarp2block_WaitForOcarina(ObjWarp2block* this, PlayState* play); +s32 ObjWarp2block_WaitForSong(ObjWarp2block* this, PlayState* play); +s32 ObjWarp2block_UpdateSongObserver(ObjWarp2block* this, PlayState* play); void ObjWarp2block_SetInactive(ObjWarp2block* this); void ObjWarp2block_DoNothing(ObjWarp2block* this, PlayState* play); void func_80BA24E8(ObjWarp2block* this); @@ -77,7 +77,7 @@ void ObjWarp2block_Spawn(ObjWarp2block* this, PlayState* play) { sSpawnData[(this->dyna.actor.child->params >> 8) & 1].params); } -s32 func_80BA1ECC(ObjWarp2block* this, PlayState* play) { +s32 ObjWarp2block_PlayerIsInRange(ObjWarp2block* this, PlayState* play) { s32 pad; Actor* temp_a3; Player* player; @@ -157,13 +157,13 @@ void ObjWarp2block_SwapWithChild(ObjWarp2block* this, PlayState* play) { } } -s32 func_80BA2218(ObjWarp2block* this, PlayState* play) { +s32 ObjWarp2block_WaitForOcarina(ObjWarp2block* this, PlayState* play) { Player* player = GET_PLAYER(play); - if (func_80BA1ECC(this, play)) { + if (ObjWarp2block_PlayerIsInRange(this, play)) { if (player->stateFlags2 & PLAYER_STATE2_ATTEMPT_PLAY_FOR_ACTOR) { - func_8010BD58(play, OCARINA_ACTION_FREE_PLAY); - this->func_168 = func_80BA228C; + Message_StartOcarinaWithSongEffect(play, OCARINA_ACTION_FREE_PLAY); + this->songObserverFunc = ObjWarp2block_WaitForSong; } else { player->stateFlags2 |= PLAYER_STATE2_NEAR_OCARINA_ACTOR; } @@ -172,17 +172,17 @@ s32 func_80BA2218(ObjWarp2block* this, PlayState* play) { return 0; } -s32 func_80BA228C(ObjWarp2block* this, PlayState* play) { +s32 ObjWarp2block_WaitForSong(ObjWarp2block* this, PlayState* play) { if (play->msgCtx.ocarinaMode == OCARINA_MODE_04) { - this->func_168 = func_80BA2218; + this->songObserverFunc = ObjWarp2block_WaitForOcarina; } if (play->msgCtx.lastPlayedSong == OCARINA_SONG_TIME) { if (this->unk_172 == 0xFE) { - this->unk_16E = 0x6E; + this->songEndTimer = 0x6E; } else { - this->unk_16E--; - if (this->unk_16E == 0) { + this->songEndTimer--; + if (this->songEndTimer == 0) { return 1; } } @@ -190,8 +190,8 @@ s32 func_80BA228C(ObjWarp2block* this, PlayState* play) { return 0; } -s32 func_80BA2304(ObjWarp2block* this, PlayState* play) { - s32 ret = this->func_168(this, play); +s32 ObjWarp2block_UpdateSongObserver(ObjWarp2block* this, PlayState* play) { + s32 ret = this->songObserverFunc(this, play); this->unk_172 = play->msgCtx.lastPlayedSong; @@ -208,7 +208,7 @@ void ObjWarp2block_Init(Actor* thisx, PlayState* play2) { Actor_ProcessInitChain(&this->dyna.actor, sInitChain); Actor_SetScale(&this->dyna.actor, sSpawnData[(this->dyna.actor.params >> 8) & 1].scale); - this->func_168 = func_80BA2218; + this->songObserverFunc = ObjWarp2block_WaitForOcarina; Actor_SetFocus(&this->dyna.actor, sSpawnData[(this->dyna.actor.params >> 8) & 1].focus); if ((this->dyna.actor.params >> 0xF) & 1) { @@ -278,7 +278,7 @@ void func_80BA2600(ObjWarp2block* this) { } void func_80BA2610(ObjWarp2block* this, PlayState* play) { - if ((func_80BA2304(this, play) != 0) && (this->unk_16C <= 0)) { + if ((ObjWarp2block_UpdateSongObserver(this, play) != 0) && (this->unk_16C <= 0)) { ObjWarp2block_Spawn(this, play); this->unk_16C = 0xA0; if (GameInteractor_Should(VB_PLAY_TIMEBLOCK_CS, true, this)) { diff --git a/soh/src/overlays/actors/ovl_Obj_Warp2block/z_obj_warp2block.h b/soh/src/overlays/actors/ovl_Obj_Warp2block/z_obj_warp2block.h index bd4cf0a71f6..761da2af938 100644 --- a/soh/src/overlays/actors/ovl_Obj_Warp2block/z_obj_warp2block.h +++ b/soh/src/overlays/actors/ovl_Obj_Warp2block/z_obj_warp2block.h @@ -7,14 +7,14 @@ struct ObjWarp2block; typedef void (*ObjWarp2blockActionFunc)(struct ObjWarp2block*, PlayState*); -typedef s32 (*ObjWarp2blockFunc168)(struct ObjWarp2block*, PlayState*); +typedef s32 (*ObjWarp2blockSongObserverFunc)(struct ObjWarp2block*, PlayState*); typedef struct ObjWarp2block { /* 0x0000 */ DynaPolyActor dyna; /* 0x0164 */ ObjWarp2blockActionFunc actionFunc; - /* 0x0168 */ ObjWarp2blockFunc168 func_168; + /* 0x0168 */ ObjWarp2blockSongObserverFunc songObserverFunc; /* 0x016C */ s16 unk_16C; - /* 0x016E */ s16 unk_16E; + /* 0x016E */ s16 songEndTimer; /* 0x0170 */ s16 unk_170; /* 0x0172 */ u16 unk_172; /* 0x0174 */ s16 unk_174; diff --git a/soh/src/overlays/actors/ovl_Oceff_Spot/z_oceff_spot.c b/soh/src/overlays/actors/ovl_Oceff_Spot/z_oceff_spot.c index a53eda84ed8..66820354817 100644 --- a/soh/src/overlays/actors/ovl_Oceff_Spot/z_oceff_spot.c +++ b/soh/src/overlays/actors/ovl_Oceff_Spot/z_oceff_spot.c @@ -81,7 +81,7 @@ void OceffSpot_End(OceffSpot* this, PlayState* play) { this->unk_174 -= 0.05f; } else { Actor_Kill(&this->actor); - if (gTimeSpeed != 400 && play->msgCtx.unk_E40E == 0 && (gSaveContext.eventInf[0] & 0xF) != 1) { + if (gTimeSpeed != 400 && play->msgCtx.disableSongEffect == 0 && (gSaveContext.eventInf[0] & 0xF) != 1) { if (play->msgCtx.ocarinaAction != OCARINA_ACTION_CHECK_NOWARP_DONE || play->msgCtx.ocarinaMode != OCARINA_MODE_08) { gSaveContext.sunsSongState = SUNSSONG_START; diff --git a/soh/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.c b/soh/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.c index 9d37bea71fb..31de3309887 100644 --- a/soh/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.c +++ b/soh/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.c @@ -139,7 +139,7 @@ void ShotSun_UpdateFairySpawner(ShotSun* this, PlayState* play) { } } if (this->fairySpawnerState == 1) { - func_8010BD58(play, OCARINA_ACTION_FREE_PLAY); + Message_StartOcarinaWithSongEffect(play, OCARINA_ACTION_FREE_PLAY); this->fairySpawnerState = 2; } else if (this->fairySpawnerState == 2 && play->msgCtx.ocarinaMode == OCARINA_MODE_04) { if ((params == 0x40 && play->msgCtx.lastPlayedSong == OCARINA_SONG_SUNS) || 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 0dcaed48657..f026db3c5a5 100644 --- a/soh/src/overlays/actors/ovl_player_actor/z_player.c +++ b/soh/src/overlays/actors/ovl_player_actor/z_player.c @@ -6105,10 +6105,11 @@ s32 Player_ActionHandler_13(Player* this, PlayState* play) { Player_SetupActionPreserveItemAction(play, this, Player_Action_8084E3C4, 0); Player_AnimPlayOnceAdjusted(play, this, &gPlayerAnim_link_normal_okarina_start); this->stateFlags2 |= PLAYER_STATE2_OCARINA_PLAYING; - Player_SetTurnAroundCamera(play, (this->unk_6A8 != NULL) ? CAM_ITEM_TYPE_91 : CAM_ITEM_TYPE_90); - if (this->unk_6A8 != NULL) { + Player_SetTurnAroundCamera(play, (this->ocarinaTargetActor != NULL) ? CAM_ITEM_TYPE_91 + : CAM_ITEM_TYPE_90); + if (this->ocarinaTargetActor != NULL) { this->stateFlags2 |= PLAYER_STATE2_PLAY_FOR_ACTOR; - Camera_SetParam(Play_GetCamera(play, 0), 8, this->unk_6A8); + Camera_SetParam(Play_GetCamera(play, 0), 8, this->ocarinaTargetActor); } } } else if (func_8083AD4C(play, this)) { @@ -12111,7 +12112,7 @@ void Player_UpdateCommon(Player* this, PlayState* play, Input* input) { this->naviTextId = 0; if (!(this->stateFlags2 & PLAYER_STATE2_PLAY_FOR_ACTOR)) { - this->unk_6A8 = NULL; + this->ocarinaTargetActor = NULL; } this->stateFlags2 &= ~PLAYER_STATE2_NEAR_OCARINA_ACTOR; @@ -14202,7 +14203,7 @@ void Player_Action_8084E3C4(Player* this, PlayState* play) { if (this->stateFlags2 & (PLAYER_STATE2_NEAR_OCARINA_ACTOR | PLAYER_STATE2_PLAY_FOR_ACTOR)) { this->stateFlags2 |= PLAYER_STATE2_ATTEMPT_PLAY_FOR_ACTOR; } else { - func_8010BD58(play, OCARINA_ACTION_FREE_PLAY); + Message_StartOcarinaWithSongEffect(play, OCARINA_ACTION_FREE_PLAY); } return; } @@ -14214,7 +14215,7 @@ void Player_Action_8084E3C4(Player* this, PlayState* play) { if (play->msgCtx.ocarinaMode == OCARINA_MODE_04) { func_8005B1A4(Play_GetCamera(play, 0)); - if ((this->talkActor != NULL) && (this->talkActor == this->unk_6A8)) { + if ((this->talkActor != NULL) && (this->talkActor == this->ocarinaTargetActor)) { Player_StartTalking(play, this->talkActor); } else if (this->naviTextId < 0) { this->talkActor = this->naviActor; @@ -14226,7 +14227,7 @@ void Player_Action_8084E3C4(Player* this, PlayState* play) { this->stateFlags2 &= ~(PLAYER_STATE2_NEAR_OCARINA_ACTOR | PLAYER_STATE2_ATTEMPT_PLAY_FOR_ACTOR | PLAYER_STATE2_PLAY_FOR_ACTOR); - this->unk_6A8 = NULL; + this->ocarinaTargetActor = NULL; } else if (play->msgCtx.ocarinaMode == OCARINA_MODE_02) { gSaveContext.respawn[RESPAWN_MODE_RETURN].entranceIndex = sWarpSongEntrances[play->msgCtx.lastPlayedSong]; gSaveContext.respawn[RESPAWN_MODE_RETURN].playerParams = 0x5FF;