From 8476fbedef5f66c43c22906079d61f2251950573 Mon Sep 17 00:00:00 2001 From: JordanLongstaff Date: Thu, 7 Nov 2024 16:27:06 -0500 Subject: [PATCH] Rename and document Adult Ruto functions --- src/overlays/actors/ovl_En_Ru2/z_en_ru2.c | 406 ++++++++++++---------- 1 file changed, 222 insertions(+), 184 deletions(-) diff --git a/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c b/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c index 733aefd47d..f2db0219e7 100644 --- a/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c +++ b/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c @@ -16,32 +16,32 @@ void EnRu2_Destroy(Actor* thisx, PlayState* play); void EnRu2_Update(Actor* thisx, PlayState* play); void EnRu2_Draw(Actor* thisx, PlayState* play); -void func_80AF2CB4(EnRu2* this, PlayState* play); -void func_80AF2CD4(EnRu2* this, PlayState* play); -void func_80AF2CF4(EnRu2* this, PlayState* play); -void func_80AF2D2C(EnRu2* this, PlayState* play); -void func_80AF2D6C(EnRu2* this, PlayState* play); -void func_80AF2DAC(EnRu2* this, PlayState* play); -void func_80AF2DEC(EnRu2* this, PlayState* play); -void func_80AF3144(EnRu2* this, PlayState* play); -void func_80AF3174(EnRu2* this, PlayState* play); -void func_80AF31C8(EnRu2* this, PlayState* play); -void func_80AF3604(EnRu2* this, PlayState* play); -void func_80AF3624(EnRu2* this, PlayState* play); -void func_80AF366C(EnRu2* this, PlayState* play); -void func_80AF36AC(EnRu2* this, PlayState* play); -void func_80AF3BC8(EnRu2* this, PlayState* play); -void func_80AF3C04(EnRu2* this, PlayState* play); -void func_80AF3C64(EnRu2* this, PlayState* play); -void func_80AF3CB8(EnRu2* this, PlayState* play); -void func_80AF3D0C(EnRu2* this, PlayState* play); -void func_80AF3D60(EnRu2* this, PlayState* play); +void EnRu2_Action00(EnRu2* this, PlayState* play); +void EnRu2_Action01(EnRu2* this, PlayState* play); +void EnRu2_Action02(EnRu2* this, PlayState* play); +void EnRu2_Action03(EnRu2* this, PlayState* play); +void EnRu2_Action04(EnRu2* this, PlayState* play); +void EnRu2_Action05(EnRu2* this, PlayState* play); +void EnRu2_Action06(EnRu2* this, PlayState* play); +void EnRu2_Action07(EnRu2* this, PlayState* play); +void EnRu2_Action08(EnRu2* this, PlayState* play); +void EnRu2_Action09(EnRu2* this, PlayState* play); +void EnRu2_Action10(EnRu2* this, PlayState* play); +void EnRu2_Action11(EnRu2* this, PlayState* play); +void EnRu2_Action12(EnRu2* this, PlayState* play); +void EnRu2_Action13(EnRu2* this, PlayState* play); +void EnRu2_Action14(EnRu2* this, PlayState* play); +void EnRu2_Action15(EnRu2* this, PlayState* play); +void EnRu2_Action16(EnRu2* this, PlayState* play); +void EnRu2_Action17(EnRu2* this, PlayState* play); +void EnRu2_Action18(EnRu2* this, PlayState* play); +void EnRu2_Action19(EnRu2* this, PlayState* play); -void func_80AF3F14(EnRu2* this, PlayState* play); -void func_80AF3F20(EnRu2* this, PlayState* play); -void func_80AF321C(EnRu2* this, PlayState* play); +void EnRu2_DrawNothing(EnRu2* this, PlayState* play); +void EnRu2_DrawSkelAnimeOpa(EnRu2* this, PlayState* play); +void EnRu2_DrawSkelAnimeFlex(EnRu2* this, PlayState* play); -void func_80AF2AB4(EnRu2* this, PlayState* play); +void EnRu2_SetupWaterMedallionCutscene(EnRu2* this, PlayState* play); static ColliderCylinderInitType1 sCylinderInit = { { @@ -68,15 +68,15 @@ static UNK_TYPE D_80AF4118 = 0; #include "z_en_ru2_cutscene_data.inc.c" static EnRu2ActionFunc sActionFuncs[] = { - func_80AF2CB4, func_80AF2CD4, func_80AF2CF4, func_80AF2D2C, func_80AF2D6C, func_80AF2DAC, func_80AF2DEC, - func_80AF3144, func_80AF3174, func_80AF31C8, func_80AF3604, func_80AF3624, func_80AF366C, func_80AF36AC, - func_80AF3BC8, func_80AF3C04, func_80AF3C64, func_80AF3CB8, func_80AF3D0C, func_80AF3D60, + EnRu2_Action00, EnRu2_Action01, EnRu2_Action02, EnRu2_Action03, EnRu2_Action04, EnRu2_Action05, EnRu2_Action06, + EnRu2_Action07, EnRu2_Action08, EnRu2_Action09, EnRu2_Action10, EnRu2_Action11, EnRu2_Action12, EnRu2_Action13, + EnRu2_Action14, EnRu2_Action15, EnRu2_Action16, EnRu2_Action17, EnRu2_Action18, EnRu2_Action19, }; static EnRu2DrawFunc sDrawFuncs[] = { - func_80AF3F14, - func_80AF3F20, - func_80AF321C, + EnRu2_DrawNothing, + EnRu2_DrawSkelAnimeOpa, + EnRu2_DrawSkelAnimeFlex, }; ActorProfile En_Ru2_Profile = { @@ -91,14 +91,14 @@ ActorProfile En_Ru2_Profile = { /**/ EnRu2_Draw, }; -void func_80AF2550(Actor* thisx, PlayState* play) { +void EnRu2_InitCollider(Actor* thisx, PlayState* play) { EnRu2* this = (EnRu2*)thisx; Collider_InitCylinder(play, &this->collider); Collider_SetCylinderType1(play, &this->collider, &this->actor, &sCylinderInit); } -void func_80AF259C(EnRu2* this, PlayState* play) { +void EnRu2_UpdateCollider(EnRu2* this, PlayState* play) { s32 pad[5]; Collider_UpdateCylinder(&this->actor, &this->collider); @@ -111,7 +111,7 @@ void EnRu2_Destroy(Actor* thisx, PlayState* play) { Collider_DestroyCylinder(play, &this->collider); } -void func_80AF2608(EnRu2* this) { +void EnRu2_UpdateEyeTextures(EnRu2* this) { s32 pad[3]; s16* unk_2A6 = &this->unk_2A6; s16* unk_2A4 = &this->unk_2A4; @@ -126,13 +126,13 @@ void func_80AF2608(EnRu2* this) { } } -s32 func_80AF2690(EnRu2* this) { +s32 EnRu2_GetParamsHighByte(EnRu2* this) { s32 params_shift = PARAMS_GET_U(this->actor.params, 8, 8); return params_shift; } -s32 func_80AF26A0(EnRu2* this) { +s32 EnRu2_GetParamsLowByte(EnRu2* this) { s32 params = PARAMS_GET_U(this->actor.params, 0, 8); return params; @@ -168,7 +168,7 @@ void func_80AF26D0(EnRu2* this, PlayState* play) { } #endif -void func_80AF2744(EnRu2* this, PlayState* play) { +void EnRu2_UpdateBgCheckInfo(EnRu2* this, PlayState* play) { Actor_UpdateBgCheckInfo(play, &this->actor, 75.0f, 30.0f, 30.0f, UPDBGCHECKINFO_FLAG_2); } @@ -186,7 +186,7 @@ CsCmdActorCue* EnRu2_GetCue(PlayState* play, s32 cueChannel) { return NULL; } -s32 func_80AF27D0(EnRu2* this, PlayState* play, u16 cueId, s32 cueChannel) { +s32 EnRu2_CheckCueIs(EnRu2* this, PlayState* play, u16 cueId, s32 cueChannel) { CsCmdActorCue* cue = EnRu2_GetCue(play, cueChannel); if ((cue != NULL) && (cue->id == cueId)) { @@ -195,7 +195,7 @@ s32 func_80AF27D0(EnRu2* this, PlayState* play, u16 cueId, s32 cueChannel) { return false; } -s32 func_80AF281C(EnRu2* this, PlayState* play, u16 cueId, s32 cueChannel) { +s32 EnRu2_CheckCueIsNot(EnRu2* this, PlayState* play, u16 cueId, s32 cueChannel) { CsCmdActorCue* cue = EnRu2_GetCue(play, cueChannel); if ((cue != NULL) && (cue->id != cueId)) { @@ -204,7 +204,8 @@ s32 func_80AF281C(EnRu2* this, PlayState* play, u16 cueId, s32 cueChannel) { return false; } -void func_80AF2868(EnRu2* this, PlayState* play, u32 cueChannel) { +/* Checks cutscene data and, if applicable, configures Ruto's position accordingly. */ +void EnRu2_InitPositionFromCue(EnRu2* this, PlayState* play, u32 cueChannel) { CsCmdActorCue* cue = EnRu2_GetCue(play, cueChannel); Actor* thisx = &this->actor; @@ -217,7 +218,9 @@ void func_80AF2868(EnRu2* this, PlayState* play, u32 cueChannel) { } } -void func_80AF28E8(EnRu2* this, AnimationHeader* animation, u8 arg2, f32 morphFrames, s32 arg4) { +/* Changes the animation for Ruto's actor. The direction argument decides whether to play the animation + forwards (if 0) or backwards (otherwise). */ +void EnRu2_AnimationChange(EnRu2* this, AnimationHeader* animation, u8 arg2, f32 morphFrames, s32 arg4) { f32 frameCount = Animation_GetLastFrame(animation); f32 playbackSpeed; f32 unk0; @@ -236,16 +239,20 @@ void func_80AF28E8(EnRu2* this, AnimationHeader* animation, u8 arg2, f32 morphFr Animation_Change(&this->skelAnime, animation, playbackSpeed, unk0, fc, arg2, morphFrames); } -void func_80AF2978(EnRu2* this, PlayState* play) { +/* Gradually increases Ruto's Y-coordinate as she rises up through the blue warp in the Chamber of Sages.*/ +void EnRu2_Rise(EnRu2* this, PlayState* play) { this->actor.shape.yOffset += 250.0f / 3.0f; } -void func_80AF2994(EnRu2* this, PlayState* play) { - func_80AF28E8(this, &gAdultRutoIdleAnim, 0, 0.0f, 0); +/* Sets up Ruto's actor in the Chamber of Sages. Note: this gets called every time the Chamber of Sages + is loaded, regardless of story progress (or which Temple you just finished). */ +void EnRu2_InitChamberOfSages(EnRu2* this, PlayState* play) { + EnRu2_AnimationChange(this, &gAdultRutoIdleAnim, 0, 0.0f, 0); this->actor.shape.yOffset = -10000.0f; } -void func_80AF29DC(EnRu2* this, PlayState* play) { +/* Spawns the blue warp for Ruto to rise up through in the Chamber of Sages. */ +void EnRu2_SpawnBlueWarp(EnRu2* this, PlayState* play) { Actor* thisx = &this->actor; f32 posX = thisx->world.pos.x; f32 posY = thisx->world.pos.y; @@ -254,17 +261,22 @@ void func_80AF29DC(EnRu2* this, PlayState* play) { Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_DOOR_WARP1, posX, posY, posZ, 0, 0, 0, WARP_SAGES); } -void func_80AF2A38(EnRu2* this, PlayState* play) { +/* Spawns the Water Medallion. */ +void EnRu2_SpawnWaterMedallion(EnRu2* this, PlayState* play) { Player* player = GET_PLAYER(play); f32 posX = player->actor.world.pos.x; f32 posY = player->actor.world.pos.y + 50.0f; f32 posZ = player->actor.world.pos.z; Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_DEMO_EFFECT, posX, posY, posZ, 0, 0, 0, 10); + // Give Link the Water Medallion for a second time, LOL (see below) Item_Give(play, ITEM_MEDALLION_WATER); } -void func_80AF2AB4(EnRu2* this, PlayState* play) { +/* Occurs in the Chamber of Sages (regardless of which medallion you've earned). Sets up the cutscene data for + Ruto to give Link the Water Medallion, but this only happens if she should do so. Otherwise, this function + does nothing except loop endlessly until Link leaves the Chamber of Sages. */ +void EnRu2_SetupWaterMedallionCutscene(EnRu2* this, PlayState* play) { s32 pad[2]; Player* player; s16 temp; @@ -281,7 +293,8 @@ void func_80AF2AB4(EnRu2* this, PlayState* play) { } } -void func_80AF2B44(EnRu2* this, PlayState* play) { +/* Checks to see if the blue warp should be spawned for Ruto to rise up through. */ +void EnRu2_CheckBlueWarp(EnRu2* this, PlayState* play) { CutsceneContext* csCtx = &play->csCtx; CsCmdActorCue* cue; @@ -291,19 +304,21 @@ void func_80AF2B44(EnRu2* this, PlayState* play) { if ((cue != NULL) && (cue->id == 2)) { this->action = 2; this->drawConfig = 1; - func_80AF29DC(this, play); + EnRu2_SpawnBlueWarp(this, play); } } } -void func_80AF2B94(EnRu2* this) { +/* Halts Ruto's rise up through the blue warp in the Chamber of Sages once finished. */ +void EnRu2_EndRise(EnRu2* this) { if (this->actor.shape.yOffset >= 0.0f) { this->action = 3; this->actor.shape.yOffset = 0.0f; } } -void func_80AF2BC0(EnRu2* this, PlayState* play) { +/* Sets up the animation for Ruto to raise her arms to give Link the Water Medallion. */ +void EnRu2_RaiseArms(EnRu2* this, PlayState* play) { AnimationHeader* animation = &gAdultRutoRaisingArmsUpAnim; CsCmdActorCue* cue; @@ -318,13 +333,16 @@ void func_80AF2BC0(EnRu2* this, PlayState* play) { } } -void func_80AF2C54(EnRu2* this, s32 arg1) { - if (arg1 != 0) { +/* At the end of Ruto's arms-raising animation, cues the next action: spawning the + Water Medallion. */ +void EnRu2_HoldArmsUp(EnRu2* this, s32 shouldHold) { + if (shouldHold != 0) { this->action = 5; } } -void func_80AF2C68(EnRu2* this, PlayState* play) { +/* Checks to see if the Water Medallion should spawn. */ +void EnRu2_CheckWaterMedallion(EnRu2* this, PlayState* play) { CsCmdActorCue* cue; if (play->csCtx.state != CS_STATE_IDLE) { @@ -332,86 +350,91 @@ void func_80AF2C68(EnRu2* this, PlayState* play) { if ((cue != NULL) && (cue->id == 2)) { this->action = 6; - func_80AF2A38(this, play); + EnRu2_SpawnWaterMedallion(this, play); } } } -void func_80AF2CB4(EnRu2* this, PlayState* play) { - func_80AF2AB4(this, play); +void EnRu2_Action00(EnRu2* this, PlayState* play) { + EnRu2_SetupWaterMedallionCutscene(this, play); } -void func_80AF2CD4(EnRu2* this, PlayState* play) { - func_80AF2B44(this, play); +void EnRu2_Action01(EnRu2* this, PlayState* play) { + EnRu2_CheckBlueWarp(this, play); } -void func_80AF2CF4(EnRu2* this, PlayState* play) { - func_80AF2978(this, play); +void EnRu2_Action02(EnRu2* this, PlayState* play) { + EnRu2_Rise(this, play); EnRu2_UpdateSkelAnime(this); - func_80AF2608(this); - func_80AF2B94(this); + EnRu2_UpdateEyeTextures(this); + EnRu2_EndRise(this); } -void func_80AF2D2C(EnRu2* this, PlayState* play) { - func_80AF2744(this, play); +void EnRu2_Action03(EnRu2* this, PlayState* play) { + EnRu2_UpdateBgCheckInfo(this, play); EnRu2_UpdateSkelAnime(this); - func_80AF2608(this); - func_80AF2BC0(this, play); + EnRu2_UpdateEyeTextures(this); + EnRu2_RaiseArms(this, play); } -void func_80AF2D6C(EnRu2* this, PlayState* play) { - s32 something; +void EnRu2_Action04(EnRu2* this, PlayState* play) { + s32 shouldHold; - func_80AF2744(this, play); - something = EnRu2_UpdateSkelAnime(this); - func_80AF2608(this); - func_80AF2C54(this, something); + EnRu2_UpdateBgCheckInfo(this, play); + shouldHold = EnRu2_UpdateSkelAnime(this); + EnRu2_UpdateEyeTextures(this); + EnRu2_HoldArmsUp(this, shouldHold); } -void func_80AF2DAC(EnRu2* this, PlayState* play) { - func_80AF2744(this, play); +void EnRu2_Action05(EnRu2* this, PlayState* play) { + EnRu2_UpdateBgCheckInfo(this, play); EnRu2_UpdateSkelAnime(this); - func_80AF2608(this); - func_80AF2C68(this, play); + EnRu2_UpdateEyeTextures(this); + EnRu2_CheckWaterMedallion(this, play); } -void func_80AF2DEC(EnRu2* this, PlayState* play) { - func_80AF2744(this, play); +void EnRu2_Action06(EnRu2* this, PlayState* play) { + EnRu2_UpdateBgCheckInfo(this, play); EnRu2_UpdateSkelAnime(this); - func_80AF2608(this); + EnRu2_UpdateEyeTextures(this); } -void func_80AF2E1C(EnRu2* this, PlayState* play) { - func_80AF28E8(this, &gAdultRutoCrossingArmsAnim, 2, 0.0f, 0); +/* Sets up Ruto in her arms-crossing pose. Used in the Water Trial in Ganon's Castle and in the + Chamber of Sages during the "Sealing Ganon" cutscene. */ +void EnRu2_InitCrossingArms(EnRu2* this, PlayState* play) { + EnRu2_AnimationChange(this, &gAdultRutoCrossingArmsAnim, 2, 0.0f, 0); this->action = 7; this->actor.shape.shadowAlpha = 0; } -void func_80AF2E64(void) { +void EnRu2_PlayWhiteOutSound(void) { Sfx_PlaySfxCentered2(NA_SE_SY_WHITE_OUT_T); } -void func_80AF2E84(EnRu2* this, PlayState* play) { +/* Spawns the ball of light that replaces Ruto's actor in the Water Trial. */ +void EnRu2_SpawnLightBall(EnRu2* this, PlayState* play) { Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_DEMO_6K, this->actor.world.pos.x, kREG(19) + 24.0f + this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 8); } -void func_80AF2F04(EnRu2* this, PlayState* play) { - if (func_80AF27D0(this, play, 4, 3)) { +/* Checks to see if it's time for Ruto to fade in while crossing her arms. */ +void EnRu2_CheckFadeIn(EnRu2* this, PlayState* play) { + if (EnRu2_CheckCueIs(this, play, 4, 3)) { this->action = 8; this->drawConfig = 2; this->alpha = 0; this->actor.shape.shadowAlpha = 0; this->unk_2B0 = 0.0f; - func_80AF2E64(); + EnRu2_PlayWhiteOutSound(); } } -void func_80AF2F58(EnRu2* this, PlayState* play) { +/* Fades Ruto's actor in or out. Both happen during the Water Trial. */ +void EnRu2_Fade(EnRu2* this, PlayState* play) { f32* unk_2B0 = &this->unk_2B0; s32 alpha; - if (func_80AF27D0(this, play, 4, 3)) { + if (EnRu2_CheckCueIs(this, play, 4, 3)) { *unk_2B0 += 1.0f; if (*unk_2B0 >= kREG(5) + 10.0f) { this->action = 9; @@ -437,48 +460,49 @@ void func_80AF2F58(EnRu2* this, PlayState* play) { this->actor.shape.shadowAlpha = alpha; } -void func_80AF30AC(EnRu2* this, PlayState* play) { - if (func_80AF281C(this, play, 4, 3)) { +/* Checks to see if it's time for Ruto to fade out while her arms are crossed. */ +void EnRu2_CheckFadeOut(EnRu2* this, PlayState* play) { + if (EnRu2_CheckCueIsNot(this, play, 4, 3)) { this->action = 8; this->drawConfig = 2; this->unk_2B0 = kREG(5) + 10.0f; this->alpha = 255; if (this->unk_2B8 == 0) { - func_80AF2E84(this, play); + EnRu2_SpawnLightBall(this, play); this->unk_2B8 = 1; } this->actor.shape.shadowAlpha = 0xFF; } } -void func_80AF3144(EnRu2* this, PlayState* play) { - func_80AF2F04(this, play); +void EnRu2_Action07(EnRu2* this, PlayState* play) { + EnRu2_CheckFadeIn(this, play); #if OOT_DEBUG func_80AF26D0(this, play); #endif } -void func_80AF3174(EnRu2* this, PlayState* play) { - func_80AF2744(this, play); +void EnRu2_Action08(EnRu2* this, PlayState* play) { + EnRu2_UpdateBgCheckInfo(this, play); EnRu2_UpdateSkelAnime(this); - func_80AF2608(this); - func_80AF2F58(this, play); + EnRu2_UpdateEyeTextures(this); + EnRu2_Fade(this, play); #if OOT_DEBUG func_80AF26D0(this, play); #endif } -void func_80AF31C8(EnRu2* this, PlayState* play) { - func_80AF2744(this, play); +void EnRu2_Action09(EnRu2* this, PlayState* play) { + EnRu2_UpdateBgCheckInfo(this, play); EnRu2_UpdateSkelAnime(this); - func_80AF2608(this); - func_80AF30AC(this, play); + EnRu2_UpdateEyeTextures(this); + EnRu2_CheckFadeOut(this, play); #if OOT_DEBUG func_80AF26D0(this, play); #endif } -void func_80AF321C(EnRu2* this, PlayState* play) { +void EnRu2_DrawSkelAnimeFlex(EnRu2* this, PlayState* play) { s32 pad[2]; s16 temp = this->unk_2A4; void* tex = sEyeTextures[temp]; @@ -499,14 +523,16 @@ void func_80AF321C(EnRu2* this, PlayState* play) { CLOSE_DISPS(play->state.gfxCtx, "../z_en_ru2_inKenjyanomaDemo02.c", 291); } -void func_80AF3394(EnRu2* this, PlayState* play) { - func_80AF28E8(this, &gAdultRutoIdleHandsOnHipsAnim, 0, 0.0f, 0); +/* Sets up Ruto's hands-on-hips pose during the credits sequence. */ +void EnRu2_InitCredits(EnRu2* this, PlayState* play) { + EnRu2_AnimationChange(this, &gAdultRutoIdleHandsOnHipsAnim, 0, 0.0f, 0); this->action = 10; this->drawConfig = 0; this->actor.shape.shadowAlpha = 0; } -void func_80AF33E0(EnRu2* this) { +/* Fades in Ruto's actor during the credits sequence. */ +void EnRu2_FadeInCredits(EnRu2* this) { f32* unk_2B0 = &this->unk_2B0; f32 temp_f0; s32 temp_f18; @@ -524,31 +550,35 @@ void func_80AF33E0(EnRu2* this) { } } -void func_80AF346C(EnRu2* this, PlayState* play) { - func_80AF2868(this, play, 3); +void EnRu2_InitCreditsPosition(EnRu2* this, PlayState* play) { + EnRu2_InitPositionFromCue(this, play, 3); this->action = 11; this->drawConfig = 2; } -void func_80AF34A4(EnRu2* this) { +/* Checks if Ruto's actor is fully faded in during the credits sequence, and if so, proceeds to action 12. */ +void EnRu2_CheckVisibleInCredits(EnRu2* this) { if (this->unk_2B0 >= kREG(17) + 10.0f) { this->action = 12; this->drawConfig = 1; } } -void func_80AF34F0(EnRu2* this) { - func_80AF28E8(this, &gAdultRutoHeadTurnDownLeftAnim, 2, 0.0f, 0); +/* Starts Ruto's animation to look down towards Nabooru during the credits sequence. */ +void EnRu2_TurnHeadDownLeft(EnRu2* this) { + EnRu2_AnimationChange(this, &gAdultRutoHeadTurnDownLeftAnim, 2, 0.0f, 0); this->action = 13; } -void func_80AF3530(EnRu2* this, s32 arg1) { - if (arg1 != 0) { - func_80AF28E8(this, &gAdultRutoLookingDownLeftAnim, 0, 0.0f, 0); +/* Holds Ruto's pose looking down towards Nabooru during the credits sequence. */ +void EnRu2_LookingDownLeft(EnRu2* this, s32 lookingDownLeft) { + if (lookingDownLeft != 0) { + EnRu2_AnimationChange(this, &gAdultRutoLookingDownLeftAnim, 0, 0.0f, 0); } } -void func_80AF3564(EnRu2* this, PlayState* play) { +/* Advances Ruto's actions in two different places. */ +void EnRu2_NextCreditsAction(EnRu2* this, PlayState* play) { CsCmdActorCue* cue = EnRu2_GetCue(play, 3); s32 nextCueId; s32 currentCueId; @@ -560,10 +590,10 @@ void func_80AF3564(EnRu2* this, PlayState* play) { if (nextCueId != currentCueId) { switch (nextCueId) { case 7: - func_80AF346C(this, play); + EnRu2_InitCreditsPosition(this, play); break; case 8: - func_80AF34F0(this); + EnRu2_TurnHeadDownLeft(this); break; default: // "There is no such action!" @@ -575,57 +605,61 @@ void func_80AF3564(EnRu2* this, PlayState* play) { } } -void func_80AF3604(EnRu2* this, PlayState* play) { - func_80AF3564(this, play); +void EnRu2_Action10(EnRu2* this, PlayState* play) { + EnRu2_NextCreditsAction(this, play); } -void func_80AF3624(EnRu2* this, PlayState* play) { - func_80AF2744(this, play); +void EnRu2_Action11(EnRu2* this, PlayState* play) { + EnRu2_UpdateBgCheckInfo(this, play); EnRu2_UpdateSkelAnime(this); - func_80AF2608(this); - func_80AF33E0(this); - func_80AF34A4(this); + EnRu2_UpdateEyeTextures(this); + EnRu2_FadeInCredits(this); + EnRu2_CheckVisibleInCredits(this); } -void func_80AF366C(EnRu2* this, PlayState* play) { - func_80AF2744(this, play); +void EnRu2_Action12(EnRu2* this, PlayState* play) { + EnRu2_UpdateBgCheckInfo(this, play); EnRu2_UpdateSkelAnime(this); - func_80AF2608(this); - func_80AF3564(this, play); + EnRu2_UpdateEyeTextures(this); + EnRu2_NextCreditsAction(this, play); } -void func_80AF36AC(EnRu2* this, PlayState* play) { - s32 something; +void EnRu2_Action13(EnRu2* this, PlayState* play) { + s32 lookingDownLeft; - func_80AF2744(this, play); - something = EnRu2_UpdateSkelAnime(this); - func_80AF2608(this); - func_80AF3530(this, something); + EnRu2_UpdateBgCheckInfo(this, play); + lookingDownLeft = EnRu2_UpdateSkelAnime(this); + EnRu2_UpdateEyeTextures(this); + EnRu2_LookingDownLeft(this, lookingDownLeft); } -void func_80AF36EC(EnRu2* this, PlayState* play) { - Flags_SetSwitch(play, func_80AF2690(this)); +/* Sets the switch indicating that Link met Ruto in the Water Temple. */ +void EnRu2_MarkEncounterOccurred(EnRu2* this, PlayState* play) { + Flags_SetSwitch(play, EnRu2_GetParamsHighByte(this)); } -s32 func_80AF3718(EnRu2* this, PlayState* play) { - return Flags_GetSwitch(play, func_80AF2690(this)); +/* Returns whether Link met Ruto in the Water Temple. */ +s32 EnRu2_EncounterOccurred(EnRu2* this, PlayState* play) { + return Flags_GetSwitch(play, EnRu2_GetParamsHighByte(this)); } -void func_80AF3744(EnRu2* this, PlayState* play) { - if (func_80AF3718(this, play)) { +/* Initializes Ruto's actor in the Water Temple, or destroys it if the encounter already happened. */ +void EnRu2_InitWaterTempleEncounter(EnRu2* this, PlayState* play) { + if (EnRu2_EncounterOccurred(this, play)) { Actor_Kill(&this->actor); } else { - func_80AF28E8(this, &gAdultRutoIdleAnim, 0, 0.0f, 0); + EnRu2_AnimationChange(this, &gAdultRutoIdleAnim, 0, 0.0f, 0); this->action = 14; this->drawConfig = 1; } } -void func_80AF37AC(void) { +void EnRu2_PlayFanfare(void) { Audio_PlayFanfare(NA_BGM_APPEAR); } -void func_80AF37CC(EnRu2* this) { +/* Accelerates Ruto's actor upwards as she swims. */ +void EnRu2_AccelerateUp(EnRu2* this) { f32 funcFloat; this->unk_2C0++; @@ -633,7 +667,7 @@ void func_80AF37CC(EnRu2* this) { this->actor.world.pos.y = this->actor.home.pos.y + (300.0f * funcFloat); } -s32 func_80AF383C(EnRu2* this, PlayState* play) { +s32 EnRu2_IsPlayerInRange(EnRu2* this, PlayState* play) { Player* player = GET_PLAYER(play); f32 thisPosX = this->actor.world.pos.x; f32 playerPosX = player->actor.world.pos.x; @@ -644,24 +678,28 @@ s32 func_80AF383C(EnRu2* this, PlayState* play) { return 0; } -void func_80AF3878(EnRu2* this, PlayState* play) { - if (func_80AF383C(this, play) && !Play_InCsMode(play)) { +/* Checks if Link is close enough to Ruto and conditionally triggers the encounter cutscene in the Water Temple. */ +void EnRu2_TriggerEncounterInRange(EnRu2* this, PlayState* play) { + if (EnRu2_IsPlayerInRange(this, play) && !Play_InCsMode(play)) { this->action = 16; OnePointCutscene_Init(play, 3130, -99, &this->actor, CAM_ID_MAIN); } } -void func_80AF38D0(EnRu2* this, PlayState* play) { +/* Triggers the encounter cutscene in the Water Temple, unconditionally. Appears to be unused. */ +void EnRu2_TriggerEncounter(EnRu2* this, PlayState* play) { this->action = 16; OnePointCutscene_Init(play, 3130, -99, &this->actor, CAM_ID_MAIN); } -void func_80AF390C(EnRu2* this, PlayState* play) { +/* Handles the starting moments of Ruto's encounter with Link at the Water Temple. Responds to a running timer to + initiate, on cue, both the fanfare and Ruto's dialogue. */ +void EnRu2_BeginEncounter(EnRu2* this, PlayState* play) { f32* unk_2C4 = &this->unk_2C4; *unk_2C4 += 1.0f; if (*unk_2C4 == kREG(6) + 40.0f) { - func_80AF37AC(); + EnRu2_PlayFanfare(); } else if (*unk_2C4 > kREG(4) + 50.0f) { this->actor.textId = 0x403E; Message_StartTextbox(play, this->actor.textId, NULL); @@ -704,67 +742,67 @@ void func_80AF39DC(EnRu2* this, PlayState* play) { } } -void func_80AF3ADC(EnRu2* this, PlayState* play) { +void EnRu2_StartSwimmingUp(EnRu2* this, PlayState* play) { this->unk_2C4 += 1.0f; if (this->unk_2C4 > kREG(5) + 100.0f) { - func_80AF28E8(this, &gAdultRutoSwimmingUpAnim, 0, -12.0f, 0); + EnRu2_AnimationChange(this, &gAdultRutoSwimmingUpAnim, 0, -12.0f, 0); this->action = 19; - func_80AF36EC(this, play); + EnRu2_MarkEncounterOccurred(this, play); } } -void func_80AF3B74(EnRu2* this, PlayState* play) { +void EnRu2_EndSwimmingUp(EnRu2* this, PlayState* play) { if (this->unk_2C0 > ((((u16)(kREG(3) + 0x28)) + ((u16)(kREG(2) + 0x96))) & 0xFFFF)) { Actor_Kill(&this->actor); } } -void func_80AF3BC8(EnRu2* this, PlayState* play) { - func_80AF3878(this, play); +void EnRu2_Action14(EnRu2* this, PlayState* play) { + EnRu2_TriggerEncounterInRange(this, play); Actor_SetFocus(&this->actor, 50.0f); - func_80AF259C(this, play); + EnRu2_UpdateCollider(this, play); } -void func_80AF3C04(EnRu2* this, PlayState* play) { - func_80AF2744(this, play); - func_80AF259C(this, play); +void EnRu2_Action15(EnRu2* this, PlayState* play) { + EnRu2_UpdateBgCheckInfo(this, play); + EnRu2_UpdateCollider(this, play); EnRu2_UpdateSkelAnime(this); - func_80AF2608(this); + EnRu2_UpdateEyeTextures(this); Actor_SetFocus(&this->actor, 50.0f); - func_80AF38D0(this, play); + EnRu2_TriggerEncounter(this, play); } -void func_80AF3C64(EnRu2* this, PlayState* play) { - func_80AF2744(this, play); +void EnRu2_Action16(EnRu2* this, PlayState* play) { + EnRu2_UpdateBgCheckInfo(this, play); EnRu2_UpdateSkelAnime(this); - func_80AF2608(this); + EnRu2_UpdateEyeTextures(this); Actor_SetFocus(&this->actor, 50.0f); - func_80AF390C(this, play); + EnRu2_BeginEncounter(this, play); } -void func_80AF3CB8(EnRu2* this, PlayState* play) { - func_80AF2744(this, play); +void EnRu2_Action17(EnRu2* this, PlayState* play) { + EnRu2_UpdateBgCheckInfo(this, play); EnRu2_UpdateSkelAnime(this); - func_80AF2608(this); + EnRu2_UpdateEyeTextures(this); Actor_SetFocus(&this->actor, 50.0f); func_80AF39DC(this, play); } -void func_80AF3D0C(EnRu2* this, PlayState* play) { - func_80AF2744(this, play); +void EnRu2_Action18(EnRu2* this, PlayState* play) { + EnRu2_UpdateBgCheckInfo(this, play); EnRu2_UpdateSkelAnime(this); - func_80AF2608(this); + EnRu2_UpdateEyeTextures(this); Actor_SetFocus(&this->actor, 50.0f); - func_80AF3ADC(this, play); + EnRu2_StartSwimmingUp(this, play); } -void func_80AF3D60(EnRu2* this, PlayState* play) { - func_80AF37CC(this); - func_80AF2744(this, play); +void EnRu2_Action19(EnRu2* this, PlayState* play) { + EnRu2_AccelerateUp(this); + EnRu2_UpdateBgCheckInfo(this, play); EnRu2_UpdateSkelAnime(this); - func_80AF2608(this); + EnRu2_UpdateEyeTextures(this); Actor_SetFocus(&this->actor, 50.0f); - func_80AF3B74(this, play); + EnRu2_EndSwimmingUp(this, play); } void EnRu2_Update(Actor* thisx, PlayState* play) { @@ -782,21 +820,21 @@ void EnRu2_Init(Actor* thisx, PlayState* play) { EnRu2* this = (EnRu2*)thisx; ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); - func_80AF2550(thisx, play); + EnRu2_InitCollider(thisx, play); SkelAnime_InitFlex(play, &this->skelAnime, &gAdultRutoSkel, NULL, this->jointTable, this->morphTable, 23); - switch (func_80AF26A0(this)) { + switch (EnRu2_GetParamsLowByte(this)) { case 2: - func_80AF2E1C(this, play); + EnRu2_InitCrossingArms(this, play); break; case 3: - func_80AF3394(this, play); + EnRu2_InitCredits(this, play); break; case 4: - func_80AF3744(this, play); + EnRu2_InitWaterTempleEncounter(this, play); break; default: - func_80AF2994(this, play); + EnRu2_InitChamberOfSages(this, play); break; } @@ -804,10 +842,10 @@ void EnRu2_Init(Actor* thisx, PlayState* play) { this->unk_2C3 = TEXT_STATE_DONE_FADING; } -void func_80AF3F14(EnRu2* this, PlayState* play) { +void EnRu2_DrawNothing(EnRu2* this, PlayState* play) { } -void func_80AF3F20(EnRu2* this, PlayState* play) { +void EnRu2_DrawSkelAnimeOpa(EnRu2* this, PlayState* play) { s32 pad[2]; s16 temp = this->unk_2A4; void* tex = sEyeTextures[temp];