summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJordan Longstaff <JordanLongstaff@users.noreply.github.com>2024-12-04 18:20:19 -0500
committerGitHub <noreply@github.com>2024-12-04 18:20:19 -0500
commit3a07abbfac1a3bfc7f2d5df38cce36b702366ee4 (patch)
tree970fd9bfdedd22c1fa9f0cdd62e4c793609028ff /src
parent54c4ce8ca6c0e529a95ba4989747b32ae5706fc5 (diff)
Rename and document Adult Ruto functions (#2288)
* Rename and document Adult Ruto functions * Rename struct fields also * Add enums for Ruto actions and draw configs * Proper name for Water Medallion cutscene data * Suggested changes * More suggested changes * Bring back naming consistency * Better documentation for EnRu2_CheckWaterMedallionCutscene Co-authored-by: fig02 <fig02srl@gmail.com> * Renaming suggestions * Rename EnRu2_AccelerateUp * Revert macros * Actually, fix macros * Remove extra blank line * Rename macros with GET --------- Co-authored-by: fig02 <fig02srl@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/overlays/actors/ovl_En_Ru2/z_en_ru2.c691
-rw-r--r--src/overlays/actors/ovl_En_Ru2/z_en_ru2.h16
-rw-r--r--src/overlays/actors/ovl_En_Ru2/z_en_ru2_cutscene_data.inc.c2
3 files changed, 424 insertions, 285 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 4e15ee767..c3515bf68 100644
--- a/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c
+++ b/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c
@@ -9,6 +9,9 @@
#include "overlays/actors/ovl_Door_Warp1/z_door_warp1.h"
#include "terminal.h"
+#define ENRU2_GET_SWITCH_FLAG(thisx) PARAMS_GET_U(thisx->actor.params, 8, 8)
+#define ENRU2_GET_TYPE(thisx) PARAMS_GET_U(thisx->actor.params, 0, 8)
+
#define FLAGS ACTOR_FLAG_4
void EnRu2_Init(Actor* thisx, PlayState* play);
@@ -16,32 +19,61 @@ 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 func_80AF3F14(EnRu2* this, PlayState* play);
-void func_80AF3F20(EnRu2* this, PlayState* play);
-void func_80AF321C(EnRu2* this, PlayState* play);
-
-void func_80AF2AB4(EnRu2* this, PlayState* play);
+void EnRu2_SetupWaterMedallionCutscene(EnRu2* this, PlayState* play);
+void EnRu2_AwaitBlueWarp(EnRu2* this, PlayState* play);
+void EnRu2_RiseThroughBlueWarp(EnRu2* this, PlayState* play);
+void EnRu2_SageOfWaterDialog(EnRu2* this, PlayState* play);
+void EnRu2_RaiseArms(EnRu2* this, PlayState* play);
+void EnRu2_AwaitWaterMedallion(EnRu2* this, PlayState* play);
+void EnRu2_FinishWaterMedallionCutscene(EnRu2* this, PlayState* play);
+void EnRu2_WaterTrialInvisible(EnRu2* this, PlayState* play);
+void EnRu2_WaterTrialFade(EnRu2* this, PlayState* play);
+void EnRu2_AwaitSpawnLightBall(EnRu2* this, PlayState* play);
+void EnRu2_CreditsInvisible(EnRu2* this, PlayState* play);
+void EnRu2_CreditsFadeIn(EnRu2* this, PlayState* play);
+void EnRu2_CreditsVisible(EnRu2* this, PlayState* play);
+void EnRu2_CreditsTurnHeadDownLeft(EnRu2* this, PlayState* play);
+void EnRu2_WaterTempleEncounterRangeCheck(EnRu2* this, PlayState* play);
+void EnRu2_WaterTempleEncounterUnconditional(EnRu2* this, PlayState* play);
+void EnRu2_WaterTempleEncounterBegin(EnRu2* this, PlayState* play);
+void EnRu2_WaterTempleEncounterDialog(EnRu2* this, PlayState* play);
+void EnRu2_WaterTempleEncounterEnd(EnRu2* this, PlayState* play);
+void EnRu2_WaterTempleSwimmingUp(EnRu2* this, PlayState* play);
+
+void EnRu2_DrawNothing(EnRu2* this, PlayState* play);
+void EnRu2_DrawOpa(EnRu2* this, PlayState* play);
+void EnRu2_DrawXlu(EnRu2* this, PlayState* play);
+
+void EnRu2_CheckWaterMedallionCutscene(EnRu2* this, PlayState* play);
+
+typedef enum {
+ /* 00 */ ENRU2_SETUP_WATER_MEDALLION_CS,
+ /* 01 */ ENRU2_AWAIT_BLUE_WARP,
+ /* 02 */ ENRU2_RISE_THROUGH_BLUE_WARP,
+ /* 03 */ ENRU2_SAGE_OF_WATER_DIALOG,
+ /* 04 */ ENRU2_RAISE_ARMS,
+ /* 05 */ ENRU2_AWAIT_SPAWN_WATER_MEDALLION,
+ /* 06 */ ENRU2_FINISH_WATER_MEDALLION_CS,
+ /* 07 */ ENRU2_WATER_TRIAL_INVISIBLE,
+ /* 08 */ ENRU2_WATER_TRIAL_FADE,
+ /* 09 */ ENRU2_AWAIT_SPAWN_LIGHT_BALL,
+ /* 10 */ ENRU2_CREDITS_INVISIBLE,
+ /* 11 */ ENRU2_CREDITS_FADE_IN,
+ /* 12 */ ENRU2_CREDITS_VISIBLE,
+ /* 13 */ ENRU2_CREDITS_TURN_HEAD_DOWN_LEFT,
+ /* 14 */ ENRU2_WATER_TEMPLE_ENCOUNTER_RANGE_CHECK,
+ /* 15 */ ENRU2_WATER_TEMPLE_ENCOUNTER_UNCONDITIONAL, // unused
+ /* 16 */ ENRU2_WATER_TEMPLE_ENCOUNTER_BEGINNING,
+ /* 17 */ ENRU2_WATER_TEMPLE_ENCOUNTER_DIALOG,
+ /* 18 */ ENRU2_WATER_TEMPLE_ENCOUNTER_END,
+ /* 19 */ ENRU2_WATER_TEMPLE_SWIMMING_UP,
+} EnRu2Action;
+
+typedef enum {
+ /* 00 */ ENRU2_DRAW_NOTHING,
+ /* 01 */ ENRU2_DRAW_OPA,
+ /* 02 */ ENRU2_DRAW_XLU,
+} EnRu2DrawConfig;
static ColliderCylinderInitType1 sCylinderInit = {
{
@@ -68,15 +100,32 @@ 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_SetupWaterMedallionCutscene,
+ EnRu2_AwaitBlueWarp,
+ EnRu2_RiseThroughBlueWarp,
+ EnRu2_SageOfWaterDialog,
+ EnRu2_RaiseArms,
+ EnRu2_AwaitWaterMedallion,
+ EnRu2_FinishWaterMedallionCutscene,
+ EnRu2_WaterTrialInvisible,
+ EnRu2_WaterTrialFade,
+ EnRu2_AwaitSpawnLightBall,
+ EnRu2_CreditsInvisible,
+ EnRu2_CreditsFadeIn,
+ EnRu2_CreditsVisible,
+ EnRu2_CreditsTurnHeadDownLeft,
+ EnRu2_WaterTempleEncounterRangeCheck,
+ EnRu2_WaterTempleEncounterUnconditional,
+ EnRu2_WaterTempleEncounterBegin,
+ EnRu2_WaterTempleEncounterDialog,
+ EnRu2_WaterTempleEncounterEnd,
+ EnRu2_WaterTempleSwimmingUp,
};
static EnRu2DrawFunc sDrawFuncs[] = {
- func_80AF3F14,
- func_80AF3F20,
- func_80AF321C,
+ EnRu2_DrawNothing,
+ EnRu2_DrawOpa,
+ EnRu2_DrawXlu,
};
ActorProfile En_Ru2_Profile = {
@@ -91,14 +140,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,41 +160,41 @@ void EnRu2_Destroy(Actor* thisx, PlayState* play) {
Collider_DestroyCylinder(play, &this->collider);
}
-void func_80AF2608(EnRu2* this) {
+void EnRu2_UpdateEyes(EnRu2* this) {
s32 pad[3];
- s16* unk_2A6 = &this->unk_2A6;
- s16* unk_2A4 = &this->unk_2A4;
+ s16* blinkTimer = &this->blinkTimer;
+ s16* eyeIndex = &this->eyeIndex;
- if (DECR(*unk_2A6) == 0) {
- *unk_2A6 = Rand_S16Offset(0x3C, 0x3C);
+ if (DECR(*blinkTimer) == 0) {
+ *blinkTimer = Rand_S16Offset(60, 60);
}
- *unk_2A4 = *unk_2A6;
- if (*unk_2A4 >= 3) {
- *unk_2A4 = 0;
+ *eyeIndex = *blinkTimer;
+ if (*eyeIndex >= 3) {
+ *eyeIndex = 0;
}
}
-s32 func_80AF2690(EnRu2* this) {
- s32 params_shift = PARAMS_GET_U(this->actor.params, 8, 8);
+s32 EnRu2_GetSwitchFlag(EnRu2* this) {
+ s32 switchFlag = ENRU2_GET_SWITCH_FLAG(this);
- return params_shift;
+ return switchFlag;
}
-s32 func_80AF26A0(EnRu2* this) {
- s32 params = PARAMS_GET_U(this->actor.params, 0, 8);
+s32 EnRu2_GetType(EnRu2* this) {
+ s32 type = ENRU2_GET_TYPE(this);
- return params;
+ return type;
}
#if DEBUG_FEATURES
void func_80AF26AC(EnRu2* this) {
- this->action = 7;
- this->drawConfig = 0;
+ this->action = ENRU2_WATER_TRIAL_INVISIBLE;
+ this->drawConfig = ENRU2_DRAW_NOTHING;
this->alpha = 0;
- this->unk_2B8 = 0;
+ this->isLightBall = false;
this->actor.shape.shadowAlpha = 0;
- this->unk_2B0 = 0.0f;
+ this->fadeTimer = 0.0f;
}
void func_80AF26D0(EnRu2* this, PlayState* play) {
@@ -168,7 +217,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 +235,7 @@ CsCmdActorCue* EnRu2_GetCue(PlayState* play, s32 cueChannel) {
return NULL;
}
-s32 func_80AF27D0(EnRu2* this, PlayState* play, u16 cueId, s32 cueChannel) {
+s32 EnRu2_CheckCueMatchingId(EnRu2* this, PlayState* play, u16 cueId, s32 cueChannel) {
CsCmdActorCue* cue = EnRu2_GetCue(play, cueChannel);
if ((cue != NULL) && (cue->id == cueId)) {
@@ -195,7 +244,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_CheckCueNotMatchingId(EnRu2* this, PlayState* play, u16 cueId, s32 cueChannel) {
CsCmdActorCue* cue = EnRu2_GetCue(play, cueChannel);
if ((cue != NULL) && (cue->id != cueId)) {
@@ -204,7 +253,10 @@ 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,35 +269,50 @@ 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 mode, f32 morphFrames, s32 direction) {
f32 frameCount = Animation_GetLastFrame(animation);
f32 playbackSpeed;
- f32 unk0;
- f32 fc;
+ f32 startFrame;
+ f32 endFrame;
- if (arg4 == 0) {
- unk0 = 0.0f;
- fc = frameCount;
+ if (direction == 0) {
+ startFrame = 0.0f;
+ endFrame = frameCount;
playbackSpeed = 1.0f;
} else {
- unk0 = frameCount;
- fc = 0.0f;
+ startFrame = frameCount;
+ endFrame = 0.0f;
playbackSpeed = -1.0f;
}
- Animation_Change(&this->skelAnime, animation, playbackSpeed, unk0, fc, arg2, morphFrames);
+ Animation_Change(&this->skelAnime, animation, playbackSpeed, startFrame, endFrame, mode, morphFrames);
}
-void func_80AF2978(EnRu2* this, PlayState* play) {
+/**
+ * Gradually increases Ruto's model's Y-offset 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: All sages actors are present in the Chamber of Sages, regardless of which dungeon was just completed.
+ * This function runs unconditionally, even if it is not relevant for Ruto.
+ */
+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,25 +321,34 @@ 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 the water medallion. This is redundant as it was already given in `EnRu2_CheckWaterMedallionCutscene`
Item_Give(play, ITEM_MEDALLION_WATER);
}
-void func_80AF2AB4(EnRu2* this, PlayState* play) {
+/**
+ * Sets up the Water Medallion Cutscene if coming from Water Temple.
+ * All sage actors are present in the Chamber of Sages regardless of which dungeon was just completed.
+ * This function will loop endlessly if the current sage cutscene is not for the Water Medallion.
+ */
+void EnRu2_CheckWaterMedallionCutscene(EnRu2* this, PlayState* play) {
s32 pad[2];
Player* player;
s16 temp;
if ((gSaveContext.chamberCutsceneNum == CHAMBER_CS_WATER) && !IS_CUTSCENE_LAYER) {
player = GET_PLAYER(play);
- this->action = 1;
- play->csCtx.script = D_80AF411C;
+ this->action = ENRU2_AWAIT_BLUE_WARP;
+ play->csCtx.script = gWaterMedallionCS;
gSaveContext.cutsceneTrigger = 2;
Item_Give(play, ITEM_MEDALLION_WATER);
temp = this->actor.world.rot.y + 0x8000;
@@ -281,7 +357,7 @@ void func_80AF2AB4(EnRu2* this, PlayState* play) {
}
}
-void func_80AF2B44(EnRu2* this, PlayState* play) {
+void EnRu2_CheckIfBlueWarpShouldSpawn(EnRu2* this, PlayState* play) {
CutsceneContext* csCtx = &play->csCtx;
CsCmdActorCue* cue;
@@ -289,21 +365,27 @@ void func_80AF2B44(EnRu2* this, PlayState* play) {
cue = csCtx->actorCues[3];
if ((cue != NULL) && (cue->id == 2)) {
- this->action = 2;
- this->drawConfig = 1;
- func_80AF29DC(this, play);
+ this->action = ENRU2_RISE_THROUGH_BLUE_WARP;
+ this->drawConfig = ENRU2_DRAW_OPA;
+ 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->action = ENRU2_SAGE_OF_WATER_DIALOG;
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_CheckStartRaisingArms(EnRu2* this, PlayState* play) {
AnimationHeader* animation = &gAdultRutoRaisingArmsUpAnim;
CsCmdActorCue* cue;
@@ -313,174 +395,197 @@ void func_80AF2BC0(EnRu2* this, PlayState* play) {
if ((cue != NULL) && (cue->id == 3)) {
Animation_Change(&this->skelAnime, animation, 1.0f, 0.0f, Animation_GetLastFrame(animation), ANIMMODE_ONCE,
0.0f);
- this->action = 4;
+ this->action = ENRU2_RAISE_ARMS;
}
}
}
-void func_80AF2C54(EnRu2* this, s32 arg1) {
- if (arg1 != 0) {
- this->action = 5;
+/**
+ * At the end of Ruto's arms-raising animation, cues the next action: spawning the
+ * Water Medallion.
+ */
+void EnRu2_HoldArmsUp(EnRu2* this, s32 doneRaising) {
+ if (doneRaising != 0) {
+ this->action = ENRU2_AWAIT_SPAWN_WATER_MEDALLION;
}
}
-void func_80AF2C68(EnRu2* this, PlayState* play) {
+/**
+ * Checks to see if the Water Medallion should spawn.
+ */
+void EnRu2_CheckIfWaterMedallionShouldSpawn(EnRu2* this, PlayState* play) {
CsCmdActorCue* cue;
if (play->csCtx.state != CS_STATE_IDLE) {
cue = play->csCtx.actorCues[6];
if ((cue != NULL) && (cue->id == 2)) {
- this->action = 6;
- func_80AF2A38(this, play);
+ this->action = ENRU2_FINISH_WATER_MEDALLION_CS;
+ EnRu2_SpawnWaterMedallion(this, play);
}
}
}
-void func_80AF2CB4(EnRu2* this, PlayState* play) {
- func_80AF2AB4(this, play);
+void EnRu2_SetupWaterMedallionCutscene(EnRu2* this, PlayState* play) {
+ EnRu2_CheckWaterMedallionCutscene(this, play);
}
-void func_80AF2CD4(EnRu2* this, PlayState* play) {
- func_80AF2B44(this, play);
+void EnRu2_AwaitBlueWarp(EnRu2* this, PlayState* play) {
+ EnRu2_CheckIfBlueWarpShouldSpawn(this, play);
}
-void func_80AF2CF4(EnRu2* this, PlayState* play) {
- func_80AF2978(this, play);
+void EnRu2_RiseThroughBlueWarp(EnRu2* this, PlayState* play) {
+ EnRu2_Rise(this, play);
EnRu2_UpdateSkelAnime(this);
- func_80AF2608(this);
- func_80AF2B94(this);
+ EnRu2_UpdateEyes(this);
+ EnRu2_EndRise(this);
}
-void func_80AF2D2C(EnRu2* this, PlayState* play) {
- func_80AF2744(this, play);
+void EnRu2_SageOfWaterDialog(EnRu2* this, PlayState* play) {
+ EnRu2_UpdateBgCheckInfo(this, play);
EnRu2_UpdateSkelAnime(this);
- func_80AF2608(this);
- func_80AF2BC0(this, play);
+ EnRu2_UpdateEyes(this);
+ EnRu2_CheckStartRaisingArms(this, play);
}
-void func_80AF2D6C(EnRu2* this, PlayState* play) {
- s32 something;
+void EnRu2_RaiseArms(EnRu2* this, PlayState* play) {
+ s32 animDone;
- func_80AF2744(this, play);
- something = EnRu2_UpdateSkelAnime(this);
- func_80AF2608(this);
- func_80AF2C54(this, something);
+ EnRu2_UpdateBgCheckInfo(this, play);
+ animDone = EnRu2_UpdateSkelAnime(this);
+ EnRu2_UpdateEyes(this);
+ EnRu2_HoldArmsUp(this, animDone);
}
-void func_80AF2DAC(EnRu2* this, PlayState* play) {
- func_80AF2744(this, play);
+void EnRu2_AwaitWaterMedallion(EnRu2* this, PlayState* play) {
+ EnRu2_UpdateBgCheckInfo(this, play);
EnRu2_UpdateSkelAnime(this);
- func_80AF2608(this);
- func_80AF2C68(this, play);
+ EnRu2_UpdateEyes(this);
+ EnRu2_CheckIfWaterMedallionShouldSpawn(this, play);
}
-void func_80AF2DEC(EnRu2* this, PlayState* play) {
- func_80AF2744(this, play);
+void EnRu2_FinishWaterMedallionCutscene(EnRu2* this, PlayState* play) {
+ EnRu2_UpdateBgCheckInfo(this, play);
EnRu2_UpdateSkelAnime(this);
- func_80AF2608(this);
+ EnRu2_UpdateEyes(this);
}
-void func_80AF2E1C(EnRu2* this, PlayState* play) {
- func_80AF28E8(this, &gAdultRutoCrossingArmsAnim, 2, 0.0f, 0);
- this->action = 7;
+/**
+ * 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_InitWaterTrial(EnRu2* this, PlayState* play) {
+ EnRu2_AnimationChange(this, &gAdultRutoCrossingArmsAnim, 2, 0.0f, 0);
+ this->action = ENRU2_WATER_TRIAL_INVISIBLE;
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)) {
- this->action = 8;
- this->drawConfig = 2;
+/**
+ * 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_CheckCueMatchingId(this, play, 4, 3)) {
+ this->action = ENRU2_WATER_TRIAL_FADE;
+ this->drawConfig = ENRU2_DRAW_XLU;
this->alpha = 0;
this->actor.shape.shadowAlpha = 0;
- this->unk_2B0 = 0.0f;
- func_80AF2E64();
+ this->fadeTimer = 0.0f;
+ EnRu2_PlayWhiteOutSound();
}
}
-void func_80AF2F58(EnRu2* this, PlayState* play) {
- f32* unk_2B0 = &this->unk_2B0;
+/**
+ * Fades Ruto's actor in or out. Both happen during the Water Trial.
+ */
+void EnRu2_Fade(EnRu2* this, PlayState* play) {
+ f32* fadeTimer = &this->fadeTimer;
s32 alpha;
- if (func_80AF27D0(this, play, 4, 3)) {
- *unk_2B0 += 1.0f;
- if (*unk_2B0 >= kREG(5) + 10.0f) {
- this->action = 9;
- this->drawConfig = 1;
- *unk_2B0 = kREG(5) + 10.0f;
+ if (EnRu2_CheckCueMatchingId(this, play, 4, 3)) {
+ *fadeTimer += 1.0f;
+ if (*fadeTimer >= kREG(5) + 10.0f) {
+ this->action = ENRU2_AWAIT_SPAWN_LIGHT_BALL;
+ this->drawConfig = ENRU2_DRAW_OPA;
+ *fadeTimer = kREG(5) + 10.0f;
this->alpha = 255;
this->actor.shape.shadowAlpha = 0xFF;
return;
}
} else {
- *unk_2B0 -= 1.0f;
- if (*unk_2B0 <= 0.0f) {
- this->action = 7;
- this->drawConfig = 0;
- *unk_2B0 = 0.0f;
+ *fadeTimer -= 1.0f;
+ if (*fadeTimer <= 0.0f) {
+ this->action = ENRU2_WATER_TRIAL_INVISIBLE;
+ this->drawConfig = ENRU2_DRAW_NOTHING;
+ *fadeTimer = 0.0f;
this->alpha = 0;
this->actor.shape.shadowAlpha = 0;
return;
}
}
- alpha = (*unk_2B0 / (kREG(5) + 10.0f)) * 255.0f;
+ alpha = (*fadeTimer / (kREG(5) + 10.0f)) * 255.0f;
this->alpha = alpha;
this->actor.shape.shadowAlpha = alpha;
}
-void func_80AF30AC(EnRu2* this, PlayState* play) {
- if (func_80AF281C(this, play, 4, 3)) {
- this->action = 8;
- this->drawConfig = 2;
- this->unk_2B0 = kREG(5) + 10.0f;
+/**
+ * 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_CheckCueNotMatchingId(this, play, 4, 3)) {
+ this->action = ENRU2_WATER_TRIAL_FADE;
+ this->drawConfig = ENRU2_DRAW_XLU;
+ this->fadeTimer = kREG(5) + 10.0f;
this->alpha = 255;
- if (this->unk_2B8 == 0) {
- func_80AF2E84(this, play);
- this->unk_2B8 = 1;
+ if (!this->isLightBall) {
+ EnRu2_SpawnLightBall(this, play);
+ this->isLightBall = true;
}
this->actor.shape.shadowAlpha = 0xFF;
}
}
-void func_80AF3144(EnRu2* this, PlayState* play) {
- func_80AF2F04(this, play);
+void EnRu2_WaterTrialInvisible(EnRu2* this, PlayState* play) {
+ EnRu2_CheckFadeIn(this, play);
#if DEBUG_FEATURES
func_80AF26D0(this, play);
#endif
}
-void func_80AF3174(EnRu2* this, PlayState* play) {
- func_80AF2744(this, play);
+void EnRu2_WaterTrialFade(EnRu2* this, PlayState* play) {
+ EnRu2_UpdateBgCheckInfo(this, play);
EnRu2_UpdateSkelAnime(this);
- func_80AF2608(this);
- func_80AF2F58(this, play);
+ EnRu2_UpdateEyes(this);
+ EnRu2_Fade(this, play);
#if DEBUG_FEATURES
func_80AF26D0(this, play);
#endif
}
-void func_80AF31C8(EnRu2* this, PlayState* play) {
- func_80AF2744(this, play);
+void EnRu2_AwaitSpawnLightBall(EnRu2* this, PlayState* play) {
+ EnRu2_UpdateBgCheckInfo(this, play);
EnRu2_UpdateSkelAnime(this);
- func_80AF2608(this);
- func_80AF30AC(this, play);
+ EnRu2_UpdateEyes(this);
+ EnRu2_CheckFadeOut(this, play);
#if DEBUG_FEATURES
func_80AF26D0(this, play);
#endif
}
-void func_80AF321C(EnRu2* this, PlayState* play) {
+void EnRu2_DrawXlu(EnRu2* this, PlayState* play) {
s32 pad[2];
- s16 temp = this->unk_2A4;
+ s16 temp = this->eyeIndex;
void* tex = sEyeTextures[temp];
SkelAnime* skelAnime = &this->skelAnime;
@@ -499,56 +604,74 @@ 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);
- this->action = 10;
- this->drawConfig = 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 = ENRU2_CREDITS_INVISIBLE;
+ this->drawConfig = ENRU2_DRAW_NOTHING;
this->actor.shape.shadowAlpha = 0;
}
-void func_80AF33E0(EnRu2* this) {
- f32* unk_2B0 = &this->unk_2B0;
+/**
+ * Fades in Ruto's actor during the credits sequence.
+ */
+void EnRu2_FadeInCredits(EnRu2* this) {
+ f32* fadeTimer = &this->fadeTimer;
f32 temp_f0;
s32 temp_f18;
- *unk_2B0 += 1.0f;
+ *fadeTimer += 1.0f;
temp_f0 = kREG(17) + 10.0f;
- if (temp_f0 <= *unk_2B0) {
+ if (temp_f0 <= *fadeTimer) {
this->alpha = 255;
this->actor.shape.shadowAlpha = 0xFF;
} else {
- temp_f18 = (*unk_2B0 / temp_f0) * 255.0f;
+ temp_f18 = (*fadeTimer / temp_f0) * 255.0f;
this->alpha = temp_f18;
this->actor.shape.shadowAlpha = temp_f18;
}
}
-void func_80AF346C(EnRu2* this, PlayState* play) {
- func_80AF2868(this, play, 3);
- this->action = 11;
- this->drawConfig = 2;
+void EnRu2_InitCreditsPosition(EnRu2* this, PlayState* play) {
+ EnRu2_InitPositionFromCue(this, play, 3);
+ this->action = ENRU2_CREDITS_FADE_IN;
+ this->drawConfig = ENRU2_DRAW_XLU;
}
-void func_80AF34A4(EnRu2* this) {
- if (this->unk_2B0 >= kREG(17) + 10.0f) {
- this->action = 12;
- this->drawConfig = 1;
+/**
+ * Checks for the end of Ruto's fade-in during the credits sequence.
+ */
+void EnRu2_CheckVisibleInCredits(EnRu2* this) {
+ if (this->fadeTimer >= kREG(17) + 10.0f) {
+ this->action = ENRU2_CREDITS_VISIBLE;
+ this->drawConfig = ENRU2_DRAW_OPA;
}
}
-void func_80AF34F0(EnRu2* this) {
- func_80AF28E8(this, &gAdultRutoHeadTurnDownLeftAnim, 2, 0.0f, 0);
- this->action = 13;
+/**
+ * Starts Ruto's animation to look down towards Nabooru during the credits sequence.
+ */
+void EnRu2_SetupTurnHeadDownLeftAnimation(EnRu2* this) {
+ EnRu2_AnimationChange(this, &gAdultRutoHeadTurnDownLeftAnim, 2, 0.0f, 0);
+ this->action = ENRU2_CREDITS_TURN_HEAD_DOWN_LEFT;
}
-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_HoldLookingDownLeftPose(EnRu2* this, s32 isDoneTurning) {
+ if (isDoneTurning != 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 +683,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_SetupTurnHeadDownLeftAnimation(this);
break;
default:
// "There is no such action!"
@@ -575,65 +698,71 @@ void func_80AF3564(EnRu2* this, PlayState* play) {
}
}
-void func_80AF3604(EnRu2* this, PlayState* play) {
- func_80AF3564(this, play);
+void EnRu2_CreditsInvisible(EnRu2* this, PlayState* play) {
+ EnRu2_NextCreditsAction(this, play);
}
-void func_80AF3624(EnRu2* this, PlayState* play) {
- func_80AF2744(this, play);
+void EnRu2_CreditsFadeIn(EnRu2* this, PlayState* play) {
+ EnRu2_UpdateBgCheckInfo(this, play);
EnRu2_UpdateSkelAnime(this);
- func_80AF2608(this);
- func_80AF33E0(this);
- func_80AF34A4(this);
+ EnRu2_UpdateEyes(this);
+ EnRu2_FadeInCredits(this);
+ EnRu2_CheckVisibleInCredits(this);
}
-void func_80AF366C(EnRu2* this, PlayState* play) {
- func_80AF2744(this, play);
+void EnRu2_CreditsVisible(EnRu2* this, PlayState* play) {
+ EnRu2_UpdateBgCheckInfo(this, play);
EnRu2_UpdateSkelAnime(this);
- func_80AF2608(this);
- func_80AF3564(this, play);
+ EnRu2_UpdateEyes(this);
+ EnRu2_NextCreditsAction(this, play);
}
-void func_80AF36AC(EnRu2* this, PlayState* play) {
- s32 something;
+void EnRu2_CreditsTurnHeadDownLeft(EnRu2* this, PlayState* play) {
+ s32 animDone;
- func_80AF2744(this, play);
- something = EnRu2_UpdateSkelAnime(this);
- func_80AF2608(this);
- func_80AF3530(this, something);
+ EnRu2_UpdateBgCheckInfo(this, play);
+ animDone = EnRu2_UpdateSkelAnime(this);
+ EnRu2_UpdateEyes(this);
+ EnRu2_HoldLookingDownLeftPose(this, animDone);
}
-void func_80AF36EC(EnRu2* this, PlayState* play) {
- Flags_SetSwitch(play, func_80AF2690(this));
+void EnRu2_SetEncounterSwitchFlag(EnRu2* this, PlayState* play) {
+ Flags_SetSwitch(play, EnRu2_GetSwitchFlag(this));
}
-s32 func_80AF3718(EnRu2* this, PlayState* play) {
- return Flags_GetSwitch(play, func_80AF2690(this));
+s32 EnRu2_GetEncounterSwitchFlag(EnRu2* this, PlayState* play) {
+ return Flags_GetSwitch(play, EnRu2_GetSwitchFlag(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_GetEncounterSwitchFlag(this, play)) {
Actor_Kill(&this->actor);
} else {
- func_80AF28E8(this, &gAdultRutoIdleAnim, 0, 0.0f, 0);
- this->action = 14;
- this->drawConfig = 1;
+ EnRu2_AnimationChange(this, &gAdultRutoIdleAnim, 0, 0.0f, 0);
+ this->action = ENRU2_WATER_TEMPLE_ENCOUNTER_RANGE_CHECK;
+ this->drawConfig = ENRU2_DRAW_OPA;
}
}
-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_SwimUpProgress(EnRu2* this) {
f32 funcFloat;
- this->unk_2C0++;
- funcFloat = Environment_LerpWeightAccelDecel((kREG(2) + 0x96) & 0xFFFF, 0, this->unk_2C0, 8, 0);
+ this->swimmingUpFrame++;
+ funcFloat = Environment_LerpWeightAccelDecel((kREG(2) + 0x96) & 0xFFFF, 0, this->swimmingUpFrame, 8, 0);
this->actor.world.pos.y = this->actor.home.pos.y + (300.0f * funcFloat);
}
-s32 func_80AF383C(EnRu2* this, PlayState* play) {
+s32 EnRu2_IsPlayerInRangeForEncounter(EnRu2* this, PlayState* play) {
Player* player = GET_PLAYER(play);
f32 thisPosX = this->actor.world.pos.x;
f32 playerPosX = player->actor.world.pos.x;
@@ -644,32 +773,42 @@ s32 func_80AF383C(EnRu2* this, PlayState* play) {
return 0;
}
-void func_80AF3878(EnRu2* this, PlayState* play) {
- if (func_80AF383C(this, play) && !Play_InCsMode(play)) {
- this->action = 16;
+/**
+ * Checks if Link is close enough to Ruto and conditionally triggers the encounter cutscene in the Water Temple.
+ */
+void EnRu2_CheckRangeToStartEncounter(EnRu2* this, PlayState* play) {
+ if (EnRu2_IsPlayerInRangeForEncounter(this, play) && !Play_InCsMode(play)) {
+ this->action = ENRU2_WATER_TEMPLE_ENCOUNTER_BEGINNING;
OnePointCutscene_Init(play, 3130, -99, &this->actor, CAM_ID_MAIN);
}
}
-void func_80AF38D0(EnRu2* this, PlayState* play) {
- this->action = 16;
+/**
+ * Triggers the encounter cutscene in the Water Temple, unconditionally. Appears to be unused.
+ */
+void EnRu2_StartEncounter(EnRu2* this, PlayState* play) {
+ this->action = ENRU2_WATER_TEMPLE_ENCOUNTER_BEGINNING;
OnePointCutscene_Init(play, 3130, -99, &this->actor, CAM_ID_MAIN);
}
-void func_80AF390C(EnRu2* this, PlayState* play) {
- f32* unk_2C4 = &this->unk_2C4;
+/**
+ * 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_EncounterBeginningHandler(EnRu2* this, PlayState* play) {
+ f32* encounterTimer = &this->encounterTimer;
- *unk_2C4 += 1.0f;
- if (*unk_2C4 == kREG(6) + 40.0f) {
- func_80AF37AC();
- } else if (*unk_2C4 > kREG(4) + 50.0f) {
+ *encounterTimer += 1.0f;
+ if (*encounterTimer == kREG(6) + 40.0f) {
+ EnRu2_PlayFanfare();
+ } else if (*encounterTimer > kREG(4) + 50.0f) {
this->actor.textId = 0x403E;
Message_StartTextbox(play, this->actor.textId, NULL);
- this->action = 17;
+ this->action = ENRU2_WATER_TEMPLE_ENCOUNTER_DIALOG;
}
}
-void func_80AF39DC(EnRu2* this, PlayState* play) {
+void EnRu2_DialogCameraHandler(EnRu2* this, PlayState* play) {
s32 pad;
MessageContext* msgCtx;
s32 pad2;
@@ -681,11 +820,11 @@ void func_80AF39DC(EnRu2* this, PlayState* play) {
dialogState = Message_GetState(msgCtx);
if (dialogState == TEXT_STATE_DONE_FADING) {
- if (this->unk_2C3 != TEXT_STATE_DONE_FADING) {
+ if (this->lastDialogState != TEXT_STATE_DONE_FADING) {
// "I'm Komatsu!" (cinema scene dev)
PRINTF("おれが小松だ! \n");
- this->unk_2C2++;
- if (this->unk_2C2 % 6 == 3) {
+ this->textboxCount++;
+ if (this->textboxCount % 6 == 3) {
player = GET_PLAYER(play);
// "uorya-!" (screeming sound)
PRINTF("うおりゃー! \n");
@@ -697,74 +836,74 @@ void func_80AF39DC(EnRu2* this, PlayState* play) {
}
}
- this->unk_2C3 = dialogState;
+ this->lastDialogState = dialogState;
if (Message_GetState(msgCtx) == TEXT_STATE_CLOSING) {
- this->action = 18;
+ this->action = ENRU2_WATER_TEMPLE_ENCOUNTER_END;
Camera_SetFinishedFlag(GET_ACTIVE_CAM(play));
}
}
-void func_80AF3ADC(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);
- this->action = 19;
- func_80AF36EC(this, play);
+void EnRu2_StartSwimmingUp(EnRu2* this, PlayState* play) {
+ this->encounterTimer += 1.0f;
+ if (this->encounterTimer > kREG(5) + 100.0f) {
+ EnRu2_AnimationChange(this, &gAdultRutoSwimmingUpAnim, 0, -12.0f, 0);
+ this->action = ENRU2_WATER_TEMPLE_SWIMMING_UP;
+ EnRu2_SetEncounterSwitchFlag(this, play);
}
}
-void func_80AF3B74(EnRu2* this, PlayState* play) {
- if (this->unk_2C0 > ((((u16)(kREG(3) + 0x28)) + ((u16)(kREG(2) + 0x96))) & 0xFFFF)) {
+void EnRu2_EndSwimmingUp(EnRu2* this, PlayState* play) {
+ if (this->swimmingUpFrame > ((((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_WaterTempleEncounterRangeCheck(EnRu2* this, PlayState* play) {
+ EnRu2_CheckRangeToStartEncounter(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_WaterTempleEncounterUnconditional(EnRu2* this, PlayState* play) {
+ EnRu2_UpdateBgCheckInfo(this, play);
+ EnRu2_UpdateCollider(this, play);
EnRu2_UpdateSkelAnime(this);
- func_80AF2608(this);
+ EnRu2_UpdateEyes(this);
Actor_SetFocus(&this->actor, 50.0f);
- func_80AF38D0(this, play);
+ EnRu2_StartEncounter(this, play);
}
-void func_80AF3C64(EnRu2* this, PlayState* play) {
- func_80AF2744(this, play);
+void EnRu2_WaterTempleEncounterBegin(EnRu2* this, PlayState* play) {
+ EnRu2_UpdateBgCheckInfo(this, play);
EnRu2_UpdateSkelAnime(this);
- func_80AF2608(this);
+ EnRu2_UpdateEyes(this);
Actor_SetFocus(&this->actor, 50.0f);
- func_80AF390C(this, play);
+ EnRu2_EncounterBeginningHandler(this, play);
}
-void func_80AF3CB8(EnRu2* this, PlayState* play) {
- func_80AF2744(this, play);
+void EnRu2_WaterTempleEncounterDialog(EnRu2* this, PlayState* play) {
+ EnRu2_UpdateBgCheckInfo(this, play);
EnRu2_UpdateSkelAnime(this);
- func_80AF2608(this);
+ EnRu2_UpdateEyes(this);
Actor_SetFocus(&this->actor, 50.0f);
- func_80AF39DC(this, play);
+ EnRu2_DialogCameraHandler(this, play);
}
-void func_80AF3D0C(EnRu2* this, PlayState* play) {
- func_80AF2744(this, play);
+void EnRu2_WaterTempleEncounterEnd(EnRu2* this, PlayState* play) {
+ EnRu2_UpdateBgCheckInfo(this, play);
EnRu2_UpdateSkelAnime(this);
- func_80AF2608(this);
+ EnRu2_UpdateEyes(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_WaterTempleSwimmingUp(EnRu2* this, PlayState* play) {
+ EnRu2_SwimUpProgress(this);
+ EnRu2_UpdateBgCheckInfo(this, play);
EnRu2_UpdateSkelAnime(this);
- func_80AF2608(this);
+ EnRu2_UpdateEyes(this);
Actor_SetFocus(&this->actor, 50.0f);
- func_80AF3B74(this, play);
+ EnRu2_EndSwimmingUp(this, play);
}
void EnRu2_Update(Actor* thisx, PlayState* play) {
@@ -782,34 +921,34 @@ 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_GetType(this)) {
case 2:
- func_80AF2E1C(this, play);
+ EnRu2_InitWaterTrial(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;
}
- this->unk_2C2 = 0;
- this->unk_2C3 = TEXT_STATE_DONE_FADING;
+ this->textboxCount = 0;
+ this->lastDialogState = 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_DrawOpa(EnRu2* this, PlayState* play) {
s32 pad[2];
- s16 temp = this->unk_2A4;
+ s16 temp = this->eyeIndex;
void* tex = sEyeTextures[temp];
SkelAnime* skelAnime = &this->skelAnime;
diff --git a/src/overlays/actors/ovl_En_Ru2/z_en_ru2.h b/src/overlays/actors/ovl_En_Ru2/z_en_ru2.h
index 530f0c4a5..e7b9512fa 100644
--- a/src/overlays/actors/ovl_En_Ru2/z_en_ru2.h
+++ b/src/overlays/actors/ovl_En_Ru2/z_en_ru2.h
@@ -14,18 +14,18 @@ typedef struct EnRu2 {
/* 0x014C */ SkelAnime skelAnime;
/* 0x0190 */ Vec3s jointTable[23];
/* 0x021A */ Vec3s morphTable[23];
- /* 0x02A4 */ s16 unk_2A4;
- /* 0x02A6 */ s16 unk_2A6;
+ /* 0x02A4 */ s16 eyeIndex;
+ /* 0x02A6 */ s16 blinkTimer;
/* 0x02A8 */ s32 action;
/* 0x02AC */ s32 drawConfig;
- /* 0x02B0 */ f32 unk_2B0;
+ /* 0x02B0 */ f32 fadeTimer;
/* 0x02B4 */ u32 alpha;
- /* 0x02B8 */ s32 unk_2B8;
+ /* 0x02B8 */ s32 isLightBall;
/* 0x02BC */ s32 cueId;
- /* 0x02C0 */ u16 unk_2C0;
- /* 0x02C2 */ u8 unk_2C2;
- /* 0x02C3 */ u8 unk_2C3;
- /* 0x02C4 */ f32 unk_2C4;
+ /* 0x02C0 */ u16 swimmingUpFrame;
+ /* 0x02C2 */ u8 textboxCount; // increments on advancement through dialogue in Water Temple
+ /* 0x02C3 */ u8 lastDialogState;
+ /* 0x02C4 */ f32 encounterTimer;
/* 0x02C8 */ ColliderCylinder collider;
} EnRu2; // size = 0x0314
diff --git a/src/overlays/actors/ovl_En_Ru2/z_en_ru2_cutscene_data.inc.c b/src/overlays/actors/ovl_En_Ru2/z_en_ru2_cutscene_data.inc.c
index dc324342c..2e9d4bb60 100644
--- a/src/overlays/actors/ovl_En_Ru2/z_en_ru2_cutscene_data.inc.c
+++ b/src/overlays/actors/ovl_En_Ru2/z_en_ru2_cutscene_data.inc.c
@@ -2,7 +2,7 @@
#include "z64cutscene_commands.h"
// clang-format off
-static CutsceneData D_80AF411C[] = {
+static CutsceneData gWaterMedallionCS[] = {
CS_HEADER(35, 3338),
CS_UNK_DATA_LIST(0x00000020, 1),
CS_UNK_DATA(0x00010000, 0x0BB80000, 0x00000000, 0x00000000, 0xFFFFFFFC, 0x00000002, 0x00000000, 0xFFFFFFFC, 0x00000002, 0x00000000, 0x00000000, 0x00000000),