diff --git a/include/save.h b/include/save.h index 70eaff93ec..7e01047a99 100644 --- a/include/save.h +++ b/include/save.h @@ -890,14 +890,14 @@ typedef enum LinkAge { #define INFTABLE_12A 0x12A #define INFTABLE_138 0x138 #define INFTABLE_139 0x139 -#define INFTABLE_140 0x140 -#define INFTABLE_MET_RUTO_FIRST_TIME 0x141 -#define INFTABLE_LEARNED_WHY_RUTO_IN_JABU_JABU 0x142 -#define INFTABLE_BECAME_CARRIER_FOR_RUTO 0x143 -#define INFTABLE_144 0x144 +#define INFTABLE_RUTO_PLACED_ON_SWITCH 0x140 +#define INFTABLE_RUTO_MET_FIRST_TIME 0x141 +#define INFTABLE_RUTO_EXPLAINED_WHY_IN_JABU 0x142 +#define INFTABLE_RUTO_LET_LINK_CARRY 0x143 +#define INFTABLE_RUTO_BROUGHT_TO_SAPPHIRE_ROOM 0x144 #define INFTABLE_RUTO_HAS_SAPPHIRE 0x145 #define INFTABLE_RUTO_ABDUCTED 0x146 -#define INFTABLE_147 0x147 +#define INFTABLE_RUTO_BROUGHT_BACK_TO_HOLES_ROOM 0x147 #define INFTABLE_160 0x160 #define INFTABLE_161 0x161 #define INFTABLE_162 0x162 diff --git a/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c b/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c index 0ebe3a9d98..fd5e4e909d 100644 --- a/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c +++ b/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c @@ -64,15 +64,15 @@ void EnRu1_SpeakableJabu_Spawn(EnRu1* this, PlayState* play); void EnRu1_SpeakableJabu_Idle(EnRu1* this, PlayState* play); void EnRu1_SpeakableJabu_Talking(EnRu1* this, PlayState* play); void EnRu1_SpeakableJabu_TakingSeat(EnRu1* this, PlayState* play); -void func_80AEEBD4(EnRu1* this, PlayState* play); -void func_80AEEC5C(EnRu1* this, PlayState* play); -void func_80AEECF0(EnRu1* this, PlayState* play); -void func_80AEED58(EnRu1* this, PlayState* play); -void func_80AEEDCC(EnRu1* this, PlayState* play); -void func_80AEEE34(EnRu1* this, PlayState* play); -void func_80AEEE9C(EnRu1* this, PlayState* play); -void func_80AEEF08(EnRu1* this, PlayState* play); -void func_80AEEF5C(EnRu1* this, PlayState* play); +void EnRu1_Sitting_Idle(EnRu1* this, PlayState* play); +void EnRu1_Sitting_Released(EnRu1* this, PlayState* play); +void EnRu1_Sitting_EnteringWater(EnRu1* this, PlayState* play); +void EnRu1_Sitting_SinkingInWater(EnRu1* this, PlayState* play); +void EnRu1_Sitting_Carried(EnRu1* this, PlayState* play); +void EnRu1_Sitting_LosingBalance(EnRu1* this, PlayState* play); +void EnRu1_Sitting_DisappearingInWater(EnRu1* this, PlayState* play); +void EnRu1_Sitting_SeesSapphire(EnRu1* this, PlayState* play); +void EnRu1_Action_Unused(EnRu1* this, PlayState* play); void EnRu1_SapphireRoom_ThrownOntoPlatform(EnRu1* this, PlayState* play); void EnRu1_SapphireRoom_Retrieving(EnRu1* this, PlayState* play); void EnRu1_SapphireRoom_Holding(EnRu1* this, PlayState* play); @@ -173,15 +173,15 @@ static EnRu1ActionFunc sActionFuncs[] = { EnRu1_SpeakableJabu_Idle, // ENRU1_ACTION_SPEAK_JABU_IDLE EnRu1_SpeakableJabu_Talking, // ENRU1_ACTION_SPEAK_JABU_TALKING EnRu1_SpeakableJabu_TakingSeat, // ENRU1_ACTION_SPEAK_JABU_SIT_DOWN - func_80AEEBD4, // ENRU1_ACTION_27 - func_80AEEC5C, // ENRU1_ACTION_28 - func_80AEECF0, // ENRU1_ACTION_29 - func_80AEED58, // ENRU1_ACTION_30 - func_80AEEDCC, // ENRU1_ACTION_31 - func_80AEEE34, // ENRU1_ACTION_32 - func_80AEEE9C, // ENRU1_ACTION_33 - func_80AEEF08, // ENRU1_ACTION_34 - func_80AEEF5C, // ENRU1_ACTION_35 + EnRu1_Sitting_Idle, // ENRU1_ACTION_SITTING_IDLE + EnRu1_Sitting_Released, // ENRU1_ACTION_SITTING_RELEASED + EnRu1_Sitting_EnteringWater, // ENRU1_ACTION_SITTING_ENTERING_WATER + EnRu1_Sitting_SinkingInWater, // ENRU1_ACTION_SITTING_SINKING + EnRu1_Sitting_Carried, // ENRU1_ACTION_SITTING_CARRIED + EnRu1_Sitting_LosingBalance, // ENRU1_ACTION_SITTING_LOSING_BALANCE + EnRu1_Sitting_DisappearingInWater, // ENRU1_ACTION_SITTING_DISAPPEARING + EnRu1_Sitting_SeesSapphire, // ENRU1_ACTION_SITTING_SEES_SAPPHIRE + EnRu1_Action_Unused, // ENRU1_ACTION_UNUSED EnRu1_SapphireRoom_ThrownOntoPlatform, // ENRU1_ACTION_THROWN_ONTO_SAPPHIRE_PLATFORM EnRu1_SapphireRoom_Retrieving, // ENRU1_ACTION_RETRIEVING_SAPPHIRE EnRu1_SapphireRoom_Holding, // ENRU1_ACTION_HOLDING_SAPPHIRE @@ -303,7 +303,7 @@ void EnRu1_SetMouth(EnRu1* this, s16 mouth) { this->mouth = mouth; } -void func_80AEAECC(EnRu1* this, PlayState* play) { +void EnRu1_UpdateBgCheckInfo(EnRu1* this, PlayState* play) { f32* velocityY = &this->actor.velocity.y; f32 velocityYHeld = *velocityY; @@ -348,33 +348,38 @@ s32 EnRu1_CheckCueNotMatchingId(PlayState* play, u16 cueId, s32 cueChannel) { return false; } -s32 func_80AEB020(EnRu1* this, PlayState* play) { - Actor* actorIt = play->actorCtx.actorLists[ACTORCAT_NPC].head; +/** + * Checks if Ruto is assisting Link, i.e. being carried or waiting to be carried. Used to check whether Ruto should not + * be spawned waiting in places where she normally would be, such as in the holes room. + */ +s32 EnRu1_IsAssistingLink(EnRu1* this, PlayState* play) { + Actor* actorIter = play->actorCtx.actorLists[ACTORCAT_NPC].head; EnRu1* someEnRu1; - while (actorIt != NULL) { - if (actorIt->id == ACTOR_EN_RU1) { - someEnRu1 = (EnRu1*)actorIt; + while (actorIter != NULL) { + if (actorIter->id == ACTOR_EN_RU1) { + someEnRu1 = (EnRu1*)actorIter; if (someEnRu1 != this) { - if ((someEnRu1->action == ENRU1_ACTION_31) || (someEnRu1->action == ENRU1_ACTION_32) || + if ((someEnRu1->action == ENRU1_ACTION_SITTING_CARRIED) || + (someEnRu1->action == ENRU1_ACTION_SITTING_LOSING_BALANCE) || (someEnRu1->action == ENRU1_ACTION_SPEAK_JABU_IDLE)) { return true; } } } - actorIt = actorIt->next; + actorIter = actorIter->next; } return false; } BgBdanObjects* EnRu1_FindBigOctoPlatform(PlayState* play) { - Actor* actorIt = play->actorCtx.actorLists[ACTORCAT_BG].head; + Actor* actorIter = play->actorCtx.actorLists[ACTORCAT_BG].head; - while (actorIt != NULL) { - if (actorIt->id == ACTOR_BG_BDAN_OBJECTS && actorIt->params == 0) { - return (BgBdanObjects*)actorIt; + while (actorIter != NULL) { + if (actorIter->id == ACTOR_BG_BDAN_OBJECTS && actorIter->params == 0) { + return (BgBdanObjects*)actorIter; } - actorIt = actorIt->next; + actorIter = actorIter->next; } PRINTF(VT_FGCOL(RED) T("お立ち台が無い!!!!!!!!!!!!!!!!!!!!!!!!!\n", "There is no stand!!!!!!!!!!!!!!!!!!!!!!!!!\n") VT_RST); @@ -396,13 +401,13 @@ s32 EnRu1_GetPlatformCamSetting(EnRu1* this) { } Actor* func_80AEB124(PlayState* play) { - Actor* actorIt = play->actorCtx.actorLists[ACTORCAT_BOSS].head; + Actor* actorIter = play->actorCtx.actorLists[ACTORCAT_BOSS].head; - while (actorIt != NULL) { - if ((actorIt->id == ACTOR_DEMO_EFFECT) && (PARAMS_GET_U(actorIt->params, 0, 8) == DEMO_EFFECT_JEWEL_ZORA)) { - return actorIt; + while (actorIter != NULL) { + if ((actorIter->id == ACTOR_DEMO_EFFECT) && (PARAMS_GET_U(actorIter->params, 0, 8) == DEMO_EFFECT_JEWEL_ZORA)) { + return actorIter; } - actorIt = actorIt->next; + actorIter = actorIter->next; } return NULL; } @@ -458,7 +463,7 @@ void EnRu1_AnimationChange(EnRu1* this, AnimationHeader* animation, u8 mode, f32 s32 EnRu1_UpdateSkelAnime(EnRu1* this) { // why? - if (this->action != ENRU1_ACTION_32) { + if (this->action != ENRU1_ACTION_SITTING_LOSING_BALANCE) { return SkelAnime_Update(&this->skelAnime); } else { return SkelAnime_Update(&this->skelAnime); @@ -696,7 +701,7 @@ void EnRu1_EnterFountainWater(EnRu1* this, PlayState* play) { this->action = ENRU1_ACTION_FOUNTAIN_DIVING; this->drawConfig = ENRU1_DRAW_NOTHING; EnRu1_InitPositionDivingIntoFountain(this, play); - func_80AEAECC(this, play); + EnRu1_UpdateBgCheckInfo(this, play); EnRu1_SpawnSplash(this, play); EnRu1_SpawnThreeRipples(this, play); } @@ -796,14 +801,14 @@ void EnRu1_Fountain_Diving(EnRu1* this, PlayState* play) { void EnRu1_Fountain_Resurfacing(EnRu1* this, PlayState* play) { s32 animFinished = EnRu1_UpdateSkelAnime(this); - func_80AEAECC(this, play); + EnRu1_UpdateBgCheckInfo(this, play); EnRu1_PlayResurfacingSfx(this); EnRu1_ResurfaceProgress(this, play, animFinished); } void EnRu1_Fountain_TreadingWater(EnRu1* this, PlayState* play) { EnRu1_SwimTowardLink(this, play); - func_80AEAECC(this, play); + EnRu1_UpdateBgCheckInfo(this, play); EnRu1_UpdateSkelAnime(this); EnRu1_SpawnRippleTreading(this, play); EnRu1_StopTreading(this, play); @@ -812,7 +817,7 @@ void EnRu1_Fountain_TreadingWater(EnRu1* this, PlayState* play) { void EnRu1_Fountain_StartingSwimBack(EnRu1* this, PlayState* play) { s32 animFinished = EnRu1_UpdateSkelAnime(this); - func_80AEAECC(this, play); + EnRu1_UpdateBgCheckInfo(this, play); EnRu1_UpdateEyes(this); EnRu1_SpawnRippleTreading(this, play); EnRu1_StartBackSwimming(this, animFinished); @@ -824,7 +829,7 @@ void EnRu1_Fountain_SwimmingBack(EnRu1* this, PlayState* play) { s32 animFinished = EnRu1_UpdateSkelAnime(this); EnRu1_SwimAwayFromLink(this, play); - func_80AEAECC(this, play); + EnRu1_UpdateBgCheckInfo(this, play); EnRu1_UpdateEyes(this); EnRu1_SpawnRippleTreading(this, play); EnRu1_StartBackSwimming(this, animFinished); @@ -835,19 +840,20 @@ void EnRu1_Fountain_SwimmingBack(EnRu1* this, PlayState* play) { void EnRu1_Fountain_FinishingSwimBack(EnRu1* this, PlayState* play) { s32 animFinished = EnRu1_UpdateSkelAnime(this); - func_80AEAECC(this, play); + EnRu1_UpdateBgCheckInfo(this, play); EnRu1_UpdateEyes(this); EnRu1_SpawnRippleTreading(this, play); EnRu1_EndGivingSapphire(this, play, animFinished); } void EnRu1_InitInJabuJabuHolesRoom(EnRu1* this, PlayState* play) { - if (!GET_INFTABLE(INFTABLE_MET_RUTO_FIRST_TIME)) { + if (!GET_INFTABLE(INFTABLE_RUTO_MET_FIRST_TIME)) { EnRu1_AnimationChange(this, &gRutoChildWait2Anim, ANIMMODE_LOOP, 0, false); this->action = ENRU1_ACTION_MEETING_RANGE_CHECK; EnRu1_SetMouth(this, ENRU1_MOUTH_FROWNING); - } else if (GET_INFTABLE(INFTABLE_147) && !GET_INFTABLE(INFTABLE_140) && !GET_INFTABLE(INFTABLE_RUTO_HAS_SAPPHIRE)) { - if (!func_80AEB020(this, play)) { + } else if (GET_INFTABLE(INFTABLE_RUTO_BROUGHT_BACK_TO_HOLES_ROOM) && + !GET_INFTABLE(INFTABLE_RUTO_PLACED_ON_SWITCH) && !GET_INFTABLE(INFTABLE_RUTO_HAS_SAPPHIRE)) { + if (!EnRu1_IsAssistingLink(this, play)) { s8 actorRoom; EnRu1_AnimationChange(this, &gRutoChildWait2Anim, ANIMMODE_LOOP, 0, false); @@ -1016,7 +1022,7 @@ void EnRu1_CheckStartFalling(EnRu1* this) { void EnRu1_FinishFirstEncounter(EnRu1* this, PlayState* play) { if (EnRu1_CheckCueMatchingId(play, 5, 3)) { - SET_INFTABLE(INFTABLE_MET_RUTO_FIRST_TIME); + SET_INFTABLE(INFTABLE_RUTO_MET_FIRST_TIME); this->action = ENRU1_ACTION_MEETING_END; } } @@ -1032,7 +1038,7 @@ void EnRu1_Meeting_InitPosition(EnRu1* this, PlayState* play) { void EnRu1_Meeting_FacingLink(EnRu1* this, PlayState* play) { EnRu1_UpdateSkelAnime(this); EnRu1_UpdateEyes(this); - func_80AEAECC(this, play); + EnRu1_UpdateBgCheckInfo(this, play); EnRu1_CheckTurnAround(this, play); } @@ -1040,7 +1046,7 @@ void EnRu1_Meeting_TurningAround(EnRu1* this, PlayState* play) { s32 animFinished = EnRu1_UpdateSkelAnime(this); EnRu1_UpdateEyes(this); - func_80AEAECC(this, play); + EnRu1_UpdateBgCheckInfo(this, play); EnRu1_StartWalkingAway(this, animFinished); } @@ -1048,7 +1054,7 @@ void EnRu1_Meeting_WalkingAwayAccel(EnRu1* this, PlayState* play) { EnRu1_AccelerateAway(this); EnRu1_UpdateSkelAnime(this); EnRu1_UpdateEyes(this); - func_80AEAECC(this, play); + EnRu1_UpdateBgCheckInfo(this, play); EnRu1_PlayStepSfx(this); EnRu1_AdvanceWalkingAway(this); } @@ -1058,7 +1064,7 @@ void EnRu1_Meeting_WalkingAwayConstant(EnRu1* this, PlayState* play) { EnRu1_RespondToFalling(this, play); EnRu1_UpdateSkelAnime(this); EnRu1_UpdateEyes(this); - func_80AEAECC(this, play); + EnRu1_UpdateBgCheckInfo(this, play); EnRu1_PlayStepSfx(this); EnRu1_CheckStartFalling(this); } @@ -1068,7 +1074,7 @@ void EnRu1_Meeting_FallingDownHole(EnRu1* this, PlayState* play) { EnRu1_RespondToFalling(this, play); EnRu1_UpdateSkelAnime(this); EnRu1_UpdateEyes(this); - func_80AEAECC(this, play); + EnRu1_UpdateBgCheckInfo(this, play); EnRu1_PlayStepSfx(this); EnRu1_FinishFirstEncounter(this, play); } @@ -1263,20 +1269,20 @@ void EnRu1_BossRoom_LinkWalksToPointInBlueWarp(EnRu1* this, PlayState* play) { } void EnRu1_BossRoom_WhatTookYouSoLong(EnRu1* this, PlayState* play) { - func_80AEAECC(this, play); + EnRu1_UpdateBgCheckInfo(this, play); EnRu1_AdvanceAngryAnimation(this, EnRu1_UpdateSkelAnime(this)); } void EnRu1_BossRoom_WarpingOut(EnRu1* this, PlayState* play) { EnRu1_RiseWithLink(this, play); - func_80AEAECC(this, play); + EnRu1_UpdateBgCheckInfo(this, play); EnRu1_UpdateSkelAnime(this); } void EnRu1_InitInJabuJabuBasement(EnRu1* this, PlayState* play) { - if (GET_INFTABLE(INFTABLE_MET_RUTO_FIRST_TIME) && !GET_INFTABLE(INFTABLE_RUTO_HAS_SAPPHIRE) && - !GET_INFTABLE(INFTABLE_140) && !GET_INFTABLE(INFTABLE_147)) { - if (!func_80AEB020(this, play)) { + if (GET_INFTABLE(INFTABLE_RUTO_MET_FIRST_TIME) && !GET_INFTABLE(INFTABLE_RUTO_HAS_SAPPHIRE) && + !GET_INFTABLE(INFTABLE_RUTO_PLACED_ON_SWITCH) && !GET_INFTABLE(INFTABLE_RUTO_BROUGHT_BACK_TO_HOLES_ROOM)) { + if (!EnRu1_IsAssistingLink(this, play)) { s8 actorRoom; EnRu1_AnimationChange(this, &gRutoChildWait2Anim, ANIMMODE_LOOP, 0, false); @@ -1294,11 +1300,11 @@ void EnRu1_InitInJabuJabuBasement(EnRu1* this, PlayState* play) { } } -void func_80AED4FC(EnRu1* this) { +void EnRu1_PlayHittingSurfaceSfx(EnRu1* this) { Sfx_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_EV_LAND_DIRT); } -void func_80AED520(EnRu1* this, PlayState* play) { +void EnRu1_PlayLiftingSfx(EnRu1* this, PlayState* play) { Player* player = GET_PLAYER(play); SFX_PLAY_AT_POS(&player->actor.projectedPos, NA_SE_PL_PULL_UP_RUTO); @@ -1311,7 +1317,7 @@ void func_80AED57C(EnRu1* this) { } } -void func_80AED5B8(EnRu1* this) { +void EnRu1_PlayBouncingOffWallSfx(EnRu1* this) { Sfx_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_VO_RT_CRASH); } @@ -1330,11 +1336,12 @@ s32 func_80AED624(EnRu1* this, PlayState* play) { Actor_Kill(&this->actor); return false; } else if (((this->roomNum1 != curRoomNum) || (this->roomNum2 != curRoomNum)) && - (this->actor.depthInWater > kREG(16) + 50.0f) && (this->action != ENRU1_ACTION_33)) { - this->action = ENRU1_ACTION_33; + // roomNum2 is always curRoomNum here + (this->actor.depthInWater > kREG(16) + 50.0f) && (this->action != ENRU1_ACTION_SITTING_DISAPPEARING)) { + this->action = ENRU1_ACTION_SITTING_DISAPPEARING; this->drawConfig = ENRU1_DRAW_XLU; this->alpha = 0xFF; - this->unk_2A4 = 0.0f; + this->sinkTimer = 0.0f; } return true; } @@ -1346,34 +1353,34 @@ void func_80AED6DC(EnRu1* this, PlayState* play) { this->unk_288 = 0.0f; } -void func_80AED6F8(PlayState* play) { +void EnRu1_CheckIfBackInHolesRoom(PlayState* play) { s8 curRoomNum; - if (!GET_INFTABLE(INFTABLE_147)) { + if (!GET_INFTABLE(INFTABLE_RUTO_BROUGHT_BACK_TO_HOLES_ROOM)) { curRoomNum = play->roomCtx.curRoom.num; if (curRoomNum == 2) { - SET_INFTABLE(INFTABLE_147); + SET_INFTABLE(INFTABLE_RUTO_BROUGHT_BACK_TO_HOLES_ROOM); } } } -void func_80AED738(EnRu1* this, PlayState* play) { +void EnRu1_FadeWhileSinking(EnRu1* this, PlayState* play) { if (func_80AED624(this, play)) { s32 pad; - this->unk_2A4 += 1.0f; - if (this->unk_2A4 < 20.0f) { - u32 temp_v0 = ((20.0f - this->unk_2A4) * 255.0f) / 20.0f; + this->sinkTimer += 1.0f; + if (this->sinkTimer < 20.0f) { + u32 alpha = ((20.0f - this->sinkTimer) * 255.0f) / 20.0f; - this->alpha = temp_v0; - this->actor.shape.shadowAlpha = temp_v0; + this->alpha = alpha; + this->actor.shape.shadowAlpha = alpha; } else { Actor_Kill(&this->actor); } } } -void func_80AED83C(EnRu1* this) { +void EnRu1_TurnUpperBodyForward(EnRu1* this) { s32 pad[2]; Vec3s* headRot; Vec3s* torsoRot; @@ -1418,7 +1425,7 @@ void EnRu1_UpdateHeadRotation(EnRu1* this) { } } -void func_80AEDAE0(EnRu1* this, PlayState* play) { +void EnRu1_ResetBgCheckFlags(EnRu1* this, PlayState* play) { DynaPolyActor* dynaPolyActor = DynaPoly_GetActor(&play->colCtx, this->actor.floorBgId); if (dynaPolyActor == NULL || dynaPolyActor->actor.id == ACTOR_EN_BOX) { @@ -1426,7 +1433,7 @@ void func_80AEDAE0(EnRu1* this, PlayState* play) { } } -void func_80AEDB30(EnRu1* this, PlayState* play) { +void EnRu1_UpdateBouncing(EnRu1* this, PlayState* play) { f32* velocityY; f32* speedXZ; f32* gravity; @@ -1466,7 +1473,7 @@ void func_80AEDB30(EnRu1* this, PlayState* play) { *gravity = 0.0f; } } - func_80AED4FC(this); + EnRu1_PlayHittingSurfaceSfx(this); } } if (this->actor.bgCheckFlags & BGCHECKFLAG_CEILING) { @@ -1481,7 +1488,7 @@ void func_80AEDB30(EnRu1* this, PlayState* play) { } if (*velocityY >= 0.0f) { *velocityY *= -((kREG(20) * 0.01f) + 0.6f); - func_80AED4FC(this); + EnRu1_PlayHittingSurfaceSfx(this); } } if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { @@ -1489,34 +1496,34 @@ void func_80AEDB30(EnRu1* this, PlayState* play) { if (*speedXZ != 0.0f) { s16 wallYaw; s16 rotY; - s32 temp_a1_2; - s32 temp_a0; - s32 phi_v1; + s32 exitY; + s32 reflY; + s32 normalAngle; rotY = this->actor.world.rot.y; wallYaw = this->actor.wallYaw; - temp_a0 = (wallYaw * 2) - rotY; - temp_a1_2 = temp_a0 + 0x8000; - if ((s16)((temp_a0 - wallYaw) + 0x8000) >= 0) { - phi_v1 = (s16)(temp_a1_2 - wallYaw); + reflY = (wallYaw * 2) - rotY; + exitY = reflY + 0x8000; + if ((s16)((reflY - wallYaw) + 0x8000) >= 0) { + normalAngle = (s16)(exitY - wallYaw); } else { - phi_v1 = -(s16)(temp_a1_2 - wallYaw); + normalAngle = -(s16)(exitY - wallYaw); } - if (phi_v1 < 0x4001) { + if (normalAngle < 0x4001) { if (*speedXZ >= (kREG(27) * 0.01f) + 3.0f) { *speedXZ *= (kREG(21) * 0.01f) + 0.6f; } else { *speedXZ = 0.0f; } - this->actor.world.rot.y = temp_a1_2; - func_80AED4FC(this); - func_80AED5B8(this); + this->actor.world.rot.y = exitY; + EnRu1_PlayHittingSurfaceSfx(this); + EnRu1_PlayBouncingOffWallSfx(this); } } } } -void func_80AEDEF4(EnRu1* this, PlayState* play) { +void EnRu1_UpdateSpeedXZ(EnRu1* this, PlayState* play) { f32* speedXZ = &this->actor.speed; DynaPolyActor* dynaPolyActor = DynaPoly_GetActor(&play->colCtx, this->actor.floorBgId); @@ -1534,13 +1541,13 @@ void func_80AEDEF4(EnRu1* this, PlayState* play) { } } -void func_80AEDFF4(EnRu1* this, PlayState* play) { - func_80AEDB30(this, play); - func_80AEDEF4(this, play); +void EnRu1_UpdatePosition(EnRu1* this, PlayState* play) { + EnRu1_UpdateBouncing(this, play); + EnRu1_UpdateSpeedXZ(this, play); Actor_MoveXZGravity(&this->actor); } -void func_80AEE02C(EnRu1* this) { +void EnRu1_StopMoving(EnRu1* this) { this->actor.velocity.x = 0.0f; this->actor.velocity.y = 0.0f; this->actor.velocity.z = 0.0f; @@ -1559,7 +1566,7 @@ void EnRu1_UpdateWaterState(EnRu1* this) { if ((this->actor.minVelocityY == 0.0f) && (this->actor.speed == 0.0f)) { // When Ruto's velocity has been slowed enough by the water, stop her motion this->waterState = ENRU1_WATER_IMMERSED; - func_80AEE02C(this); + EnRu1_StopMoving(this); this->bobPhase = 0; this->bobDepth = (this->actor.depthInWater - 10.0f) * 0.5f; this->sinkingStartPosY = this->actor.world.pos.y + thisx->bobDepth; @@ -1583,7 +1590,7 @@ void EnRu1_UpdateWaterState(EnRu1* this) { } else { if (this->waterState == ENRU1_WATER_IMMERSED) { if (this->bobDepth <= 1.0f) { - func_80AEE02C(this); + EnRu1_StopMoving(this); this->waterState = ENRU1_WATER_BOBBING; this->isSinking = 0.0f; } else { @@ -1608,10 +1615,10 @@ void EnRu1_UpdateWaterState(EnRu1* this) { s32 EnRu1_TalkOfferAccepted(EnRu1* this, PlayState* play) { if (!Actor_TalkOfferAccepted(&this->actor, play)) { this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY; - if (GET_INFTABLE(INFTABLE_BECAME_CARRIER_FOR_RUTO)) { + if (GET_INFTABLE(INFTABLE_RUTO_LET_LINK_CARRY)) { this->actor.textId = 0x404E; Actor_OfferTalkNearColChkInfoCylinder(&this->actor, play); - } else if (GET_INFTABLE(INFTABLE_LEARNED_WHY_RUTO_IN_JABU_JABU)) { + } else if (GET_INFTABLE(INFTABLE_RUTO_EXPLAINED_WHY_IN_JABU)) { this->actor.textId = 0x404D; Actor_OfferTalkNearColChkInfoCylinder(&this->actor, play); } else { @@ -1623,7 +1630,7 @@ s32 EnRu1_TalkOfferAccepted(EnRu1* this, PlayState* play) { return true; } -void func_80AEE2F8(EnRu1* this, PlayState* play) { +void EnRu1_CheckForDoorSwitch(EnRu1* this, PlayState* play) { DynaPolyActor* dynaPolyActor; s32 floorBgId; @@ -1632,15 +1639,15 @@ void func_80AEE2F8(EnRu1* this, PlayState* play) { dynaPolyActor = DynaPoly_GetActor(&play->colCtx, floorBgId); if ((dynaPolyActor != NULL) && (dynaPolyActor->actor.id == ACTOR_BG_BDAN_SWITCH)) { if (PARAMS_GET_U(dynaPolyActor->actor.params, 8, 6) == 0x38) { - SET_INFTABLE(INFTABLE_140); + SET_INFTABLE(INFTABLE_RUTO_PLACED_ON_SWITCH); return; } } } - CLEAR_INFTABLE(INFTABLE_140); + CLEAR_INFTABLE(INFTABLE_RUTO_PLACED_ON_SWITCH); } -s32 func_80AEE394(EnRu1* this, PlayState* play) { +s32 EnRu1_IsOnSapphirePlatform(EnRu1* this, PlayState* play) { s32 pad[2]; CollisionContext* colCtx; DynaPolyActor* dynaPolyActor; @@ -1652,7 +1659,7 @@ s32 func_80AEE394(EnRu1* this, PlayState* play) { dynaPolyActor = DynaPoly_GetActor(colCtx, floorBgId); if (dynaPolyActor != NULL && dynaPolyActor->actor.id == ACTOR_BG_BDAN_OBJECTS && dynaPolyActor->actor.params == 0 && !Player_InCsMode(play) && play->msgCtx.msgLength == 0) { - func_80AEE02C(this); + EnRu1_StopMoving(this); play->csCtx.script = gRutoObtainingSapphireCs; gSaveContext.cutsceneTrigger = 1; this->action = ENRU1_ACTION_THROWN_ONTO_SAPPHIRE_PLATFORM; @@ -1665,52 +1672,54 @@ s32 func_80AEE394(EnRu1* this, PlayState* play) { return false; } -void func_80AEE488(EnRu1* this, PlayState* play) { +void EnRu1_UpdateSittingAction(EnRu1* this, PlayState* play) { s8 curRoomNum; + // Test if Link is picking Ruto up if (Actor_HasParent(&this->actor, play)) { + // Ruto has been picked up curRoomNum = play->roomCtx.curRoom.num; this->roomNum3 = curRoomNum; - this->action = ENRU1_ACTION_31; - func_80AED520(this, play); - } else if (!func_80AEE394(this, play) && !(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { + this->action = ENRU1_ACTION_SITTING_CARRIED; + EnRu1_PlayLiftingSfx(this, play); + } else if (!EnRu1_IsOnSapphirePlatform(this, play) && !(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { s32 pad; this->actor.minVelocityY = -((kREG(24) * 0.01f) + 6.8f); this->actor.gravity = -((kREG(23) * 0.01f) + 1.3f); - this->action = ENRU1_ACTION_28; + this->action = ENRU1_ACTION_SITTING_RELEASED; } } -void func_80AEE568(EnRu1* this, PlayState* play) { - if (!func_80AEE394(this, play)) { +void EnRu1_CheckLanding(EnRu1* this, PlayState* play) { + if (!EnRu1_IsOnSapphirePlatform(this, play)) { if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && (this->actor.speed == 0.0f) && (this->actor.minVelocityY == 0.0f)) { s32 pad; - func_80AEE02C(this); + EnRu1_StopMoving(this); Actor_OfferCarry(&this->actor, play); - this->action = ENRU1_ACTION_27; + this->action = ENRU1_ACTION_SITTING_IDLE; EnRu1_DisableSittingOC(this); return; } if (this->actor.depthInWater > 0.0f) { - this->action = ENRU1_ACTION_29; + this->action = ENRU1_ACTION_SITTING_ENTERING_WATER; this->waterState = ENRU1_WATER_OUTSIDE; } } } -void func_80AEE628(EnRu1* this, PlayState* play) { +void EnRu1_EndSeeingSapphireAnimation(EnRu1* this, PlayState* play) { s32 pad[2]; s8 curRoomNum = play->roomCtx.curRoom.num; if (EnRu1_IsCsStateIdle(play)) { Animation_Change(&this->skelAnime, &gRutoChildSittingAnim, 1.0f, 0, Animation_GetLastFrame(&gRutoChildSittingAnim), ANIMMODE_LOOP, -8.0f); - SET_INFTABLE(INFTABLE_144); - this->action = ENRU1_ACTION_31; + SET_INFTABLE(INFTABLE_RUTO_BROUGHT_TO_SAPPHIRE_ROOM); + this->action = ENRU1_ACTION_SITTING_CARRIED; } this->roomNum3 = curRoomNum; } @@ -1719,12 +1728,12 @@ s32 func_80AEE6D0(EnRu1* this, PlayState* play) { s32 pad; s8 curRoomNum = play->roomCtx.curRoom.num; - if (!GET_INFTABLE(INFTABLE_144) && (func_80AEB124(play) != NULL)) { + if (!GET_INFTABLE(INFTABLE_RUTO_BROUGHT_TO_SAPPHIRE_ROOM) && (func_80AEB124(play) != NULL)) { if (!Player_InCsMode(play)) { Animation_Change(&this->skelAnime, &gRutoChildSeesSapphireAnim, 1.0f, 0, Animation_GetLastFrame(&gRutoChildSquirmAnim), ANIMMODE_LOOP, -8.0f); func_80AED600(this); - this->action = ENRU1_ACTION_34; + this->action = ENRU1_ACTION_SITTING_SEES_SAPPHIRE; this->walkingFrame = 0.0f; play->csCtx.script = gRutoFoundSapphireCs; gSaveContext.cutsceneTrigger = 1; @@ -1751,7 +1760,7 @@ void EnRu1_UpdateCarriedBehavior(EnRu1* this, PlayState* play) { this->actor.minVelocityY = -((kREG(24) * 0.01f) + 6.8f); this->actor.gravity = -((kREG(23) * 0.01f) + 1.3f); func_80AED57C(this); - this->action = ENRU1_ACTION_28; + this->action = ENRU1_ACTION_SITTING_RELEASED; *carryIdleTimer = 0.0f; } else if (func_80AEE6D0(this, play)) { s32 pad; @@ -1761,7 +1770,7 @@ void EnRu1_UpdateCarriedBehavior(EnRu1* this, PlayState* play) { player = GET_PLAYER(play); if (player->stateFlags2 & PLAYER_STATE2_IDLE_FIDGET) { this->carryIdleTimer += 1.0f; - if (this->action != ENRU1_ACTION_32) { + if (this->action != ENRU1_ACTION_SITTING_LOSING_BALANCE) { if (*carryIdleTimer > 30.0f) { if (Rand_S16Offset(0, 3) == 0) { f32 frameCount = Animation_GetLastFrame(&gRutoChildSquirmAnim); @@ -1769,7 +1778,7 @@ void EnRu1_UpdateCarriedBehavior(EnRu1* this, PlayState* play) { Animation_Change(&this->skelAnime, &gRutoChildSquirmAnim, 1.0f, 0, frameCount, ANIMMODE_LOOP, -8.0f); func_80AED5DC(this); - this->action = ENRU1_ACTION_32; + this->action = ENRU1_ACTION_SITTING_LOSING_BALANCE; } *carryIdleTimer = 0.0f; } @@ -1779,7 +1788,7 @@ void EnRu1_UpdateCarriedBehavior(EnRu1* this, PlayState* play) { Animation_Change(&this->skelAnime, &gRutoChildSittingAnim, 1.0f, 0, frameCount, ANIMMODE_LOOP, -8.0f); - this->action = ENRU1_ACTION_31; + this->action = ENRU1_ACTION_SITTING_CARRIED; *carryIdleTimer = 0.0f; } } @@ -1796,9 +1805,9 @@ s32 EnRu1_CheckHitBottomUnderwater(EnRu1* this, PlayState* play) { if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { s32 pad; - func_80AEE02C(this); + EnRu1_StopMoving(this); Actor_OfferCarry(&this->actor, play); - this->action = ENRU1_ACTION_27; + this->action = ENRU1_ACTION_SITTING_IDLE; EnRu1_DisableSittingOC(this); return true; } @@ -1807,45 +1816,45 @@ s32 EnRu1_CheckHitBottomUnderwater(EnRu1* this, PlayState* play) { void EnRu1_CheckSinkingState(EnRu1* this, PlayState* play) { if ((!EnRu1_CheckHitBottomUnderwater(this, play)) && (this->waterState == ENRU1_WATER_SINKING)) { - this->action = ENRU1_ACTION_30; - func_80AEE02C(this); + this->action = ENRU1_ACTION_SITTING_SINKING; + EnRu1_StopMoving(this); this->actor.gravity = -0.1f; this->actor.minVelocityY = -((kREG(18) * 0.1f) + 0.7f); } } -void func_80AEEBB4(EnRu1* this, PlayState* play) { +void EnRu1_OfferCarry(EnRu1* this, PlayState* play) { Actor_OfferCarry(&this->actor, play); } -void func_80AEEBD4(EnRu1* this, PlayState* play) { - func_80AED83C(this); +void EnRu1_Sitting_Idle(EnRu1* this, PlayState* play) { + EnRu1_TurnUpperBodyForward(this); EnRu1_UpdateSittingOC(this, play); - func_80AEAECC(this, play); + EnRu1_UpdateBgCheckInfo(this, play); EnRu1_UpdateSkelAnime(this); EnRu1_UpdateEyes(this); - func_80AEEBB4(this, play); - func_80AEE488(this, play); + EnRu1_OfferCarry(this, play); + EnRu1_UpdateSittingAction(this, play); func_80AED624(this, play); - func_80AEDAE0(this, play); + EnRu1_ResetBgCheckFlags(this, play); } -void func_80AEEC5C(EnRu1* this, PlayState* play) { - func_80AED83C(this); +void EnRu1_Sitting_Released(EnRu1* this, PlayState* play) { + EnRu1_TurnUpperBodyForward(this); EnRu1_UpdateSittingAT(this, play); - func_80AEAECC(this, play); - func_80AEE2F8(this, play); - func_80AEDFF4(this, play); + EnRu1_UpdateBgCheckInfo(this, play); + EnRu1_CheckForDoorSwitch(this, play); + EnRu1_UpdatePosition(this, play); EnRu1_UpdateSkelAnime(this); EnRu1_UpdateEyes(this); - func_80AEE568(this, play); + EnRu1_CheckLanding(this, play); func_80AED624(this, play); - func_80AEDAE0(this, play); + EnRu1_ResetBgCheckFlags(this, play); } -void func_80AEECF0(EnRu1* this, PlayState* play) { - func_80AED83C(this); - func_80AEAECC(this, play); +void EnRu1_Sitting_EnteringWater(EnRu1* this, PlayState* play) { + EnRu1_TurnUpperBodyForward(this); + EnRu1_UpdateBgCheckInfo(this, play); EnRu1_UpdateWaterState(this); EnRu1_UpdateSkelAnime(this); EnRu1_UpdateEyes(this); @@ -1853,56 +1862,56 @@ void func_80AEECF0(EnRu1* this, PlayState* play) { func_80AED624(this, play); } -void func_80AEED58(EnRu1* this, PlayState* play) { - func_80AED83C(this); - func_80AEAECC(this, play); +void EnRu1_Sitting_SinkingInWater(EnRu1* this, PlayState* play) { + EnRu1_TurnUpperBodyForward(this); + EnRu1_UpdateBgCheckInfo(this, play); Actor_MoveXZGravity(&this->actor); EnRu1_UpdateSkelAnime(this); EnRu1_UpdateEyes(this); EnRu1_CheckHitBottomUnderwater(this, play); func_80AED624(this, play); - func_80AEDAE0(this, play); + EnRu1_ResetBgCheckFlags(this, play); } -void func_80AEEDCC(EnRu1* this, PlayState* play) { +void EnRu1_Sitting_Carried(EnRu1* this, PlayState* play) { EnRu1_UpdateHeadRotation(this); EnRu1_UpdateSkelAnime(this); - func_80AEAECC(this, play); - func_80AEE2F8(this, play); + EnRu1_UpdateBgCheckInfo(this, play); + EnRu1_CheckForDoorSwitch(this, play); EnRu1_UpdateEyes(this); - func_80AED6F8(play); + EnRu1_CheckIfBackInHolesRoom(play); EnRu1_UpdateCarriedBehavior(this, play); } -void func_80AEEE34(EnRu1* this, PlayState* play) { - func_80AED83C(this); +void EnRu1_Sitting_LosingBalance(EnRu1* this, PlayState* play) { + EnRu1_TurnUpperBodyForward(this); EnRu1_UpdateSkelAnime(this); - func_80AEAECC(this, play); - func_80AEE2F8(this, play); + EnRu1_UpdateBgCheckInfo(this, play); + EnRu1_CheckForDoorSwitch(this, play); EnRu1_UpdateEyes(this); - func_80AED6F8(play); + EnRu1_CheckIfBackInHolesRoom(play); EnRu1_UpdateCarriedBehavior(this, play); } -void func_80AEEE9C(EnRu1* this, PlayState* play) { - func_80AED83C(this); - func_80AEAECC(this, play); - func_80AEDFF4(this, play); +void EnRu1_Sitting_DisappearingInWater(EnRu1* this, PlayState* play) { + EnRu1_TurnUpperBodyForward(this); + EnRu1_UpdateBgCheckInfo(this, play); + EnRu1_UpdatePosition(this, play); EnRu1_UpdateSkelAnime(this); EnRu1_UpdateEyes(this); - func_80AED738(this, play); + EnRu1_FadeWhileSinking(this, play); func_80AED624(this, play); } -void func_80AEEF08(EnRu1* this, PlayState* play) { - func_80AED83C(this); +void EnRu1_Sitting_SeesSapphire(EnRu1* this, PlayState* play) { + EnRu1_TurnUpperBodyForward(this); EnRu1_UpdateSkelAnime(this); - func_80AEAECC(this, play); + EnRu1_UpdateBgCheckInfo(this, play); EnRu1_UpdateEyes(this); - func_80AEE628(this, play); + EnRu1_EndSeeingSapphireAnimation(this, play); } -void func_80AEEF5C(EnRu1* this, PlayState* play) { +void EnRu1_Action_Unused(EnRu1* this, PlayState* play) { } void EnRu1_TurnUpperBodyTowardPlayer(EnRu1* this, PlayState* play) { @@ -1933,7 +1942,7 @@ void EnRu1_PlaySittingSfx(EnRu1* this) { } s32 EnRu1_BecomingCarrier(EnRu1* this, PlayState* play) { - if (GET_INFTABLE(INFTABLE_LEARNED_WHY_RUTO_IN_JABU_JABU)) { + if (GET_INFTABLE(INFTABLE_RUTO_EXPLAINED_WHY_IN_JABU)) { f32 frameCount = Animation_GetLastFrame(&gRutoChildSitAnim); Animation_Change(&this->skelAnime, &gRutoChildSitAnim, 1.0f, 0, frameCount, ANIMMODE_ONCE, -8.0f); @@ -1954,7 +1963,7 @@ void EnRu1_CheckJabuTalk(EnRu1* this, PlayState* play, s32 isTalking) { void EnRu1_EndJabuTalk(EnRu1* this, PlayState* play) { if (EnRu1_MessageShouldAdvance(play) && !EnRu1_BecomingCarrier(this, play)) { Message_CloseTextbox(play); - SET_INFTABLE(INFTABLE_LEARNED_WHY_RUTO_IN_JABU_JABU); + SET_INFTABLE(INFTABLE_RUTO_EXPLAINED_WHY_IN_JABU); this->action = ENRU1_ACTION_SPEAK_JABU_IDLE; } } @@ -1964,10 +1973,10 @@ void EnRu1_HoldSittingPose(EnRu1* this, PlayState* play, s32 isFullySeated) { Animation_Change(&this->skelAnime, &gRutoChildSittingAnim, 1.0f, 0.0f, Animation_GetLastFrame(&gRutoChildSittingAnim), ANIMMODE_LOOP, 0.0f); Message_CloseTextbox(play); - SET_INFTABLE(INFTABLE_BECAME_CARRIER_FOR_RUTO); + SET_INFTABLE(INFTABLE_RUTO_LET_LINK_CARRY); func_80AED6DC(this, play); Actor_OfferCarry(&this->actor, play); - this->action = ENRU1_ACTION_27; + this->action = ENRU1_ACTION_SITTING_IDLE; EnRu1_DisableSittingOC(this); } } @@ -1989,7 +1998,7 @@ void EnRu1_SpeakableJabu_Idle(EnRu1* this, PlayState* play) { EnRu1_UpdateSkelAnime(this); EnRu1_UpdateEyes(this); EnRu1_UpdateStandingOC(this, play); - func_80AEAECC(this, play); + EnRu1_UpdateBgCheckInfo(this, play); isTalking = EnRu1_TalkOfferAccepted(this, play); func_80AED624(this, play); EnRu1_CheckJabuTalk(this, play, isTalking); @@ -1999,18 +2008,18 @@ void EnRu1_SpeakableJabu_Talking(EnRu1* this, PlayState* play) { EnRu1_TurnFullBodyTowardPlayer(this, play); EnRu1_UpdateSkelAnime(this); EnRu1_UpdateEyes(this); - func_80AEAECC(this, play); + EnRu1_UpdateBgCheckInfo(this, play); EnRu1_EndJabuTalk(this, play); } void EnRu1_SpeakableJabu_TakingSeat(EnRu1* this, PlayState* play) { s32 animFinished; - func_80AED83C(this); + EnRu1_TurnUpperBodyForward(this); animFinished = EnRu1_UpdateSkelAnime(this); EnRu1_PlaySittingSfx(this); EnRu1_UpdateEyes(this); - func_80AEAECC(this, play); + EnRu1_UpdateBgCheckInfo(this, play); EnRu1_HoldSittingPose(this, play, animFinished); } @@ -2160,7 +2169,7 @@ void EnRu1_RemoveInAbduction(EnRu1* this, PlayState* play) { } void EnRu1_SapphireRoom_ThrownOntoPlatform(EnRu1* this, PlayState* play) { - func_80AED83C(this); + EnRu1_TurnUpperBodyForward(this); EnRu1_UpdateSkelAnime(this); EnRu1_UpdateEyes(this); EnRu1_SetupRetrievingSapphireAnimation(this, play); @@ -2172,9 +2181,9 @@ void EnRu1_SapphireRoom_ThrownOntoPlatform(EnRu1* this, PlayState* play) { void EnRu1_SapphireRoom_Retrieving(EnRu1* this, PlayState* play) { s32 animFinished; - func_80AED83C(this); + EnRu1_TurnUpperBodyForward(this); EnRu1_WalkTowardSapphire(this, play); - func_80AEAECC(this, play); + EnRu1_UpdateBgCheckInfo(this, play); animFinished = EnRu1_UpdateSkelAnime(this); EnRu1_PlayLaughingSfx(this); EnRu1_LookUpAtSapphire(this); @@ -2186,8 +2195,8 @@ void EnRu1_SapphireRoom_Retrieving(EnRu1* this, PlayState* play) { } void EnRu1_SapphireRoom_Holding(EnRu1* this, PlayState* play) { - func_80AED83C(this); - func_80AEAECC(this, play); + EnRu1_TurnUpperBodyForward(this); + EnRu1_UpdateBgCheckInfo(this, play); EnRu1_UpdateSkelAnime(this); EnRu1_BringHandsDown(this, play); #if DEBUG_FEATURES @@ -2198,8 +2207,8 @@ void EnRu1_SapphireRoom_Holding(EnRu1* this, PlayState* play) { void EnRu1_SapphireRoom_DoneHolding(EnRu1* this, PlayState* play) { s32 animFinished; - func_80AED83C(this); - func_80AEAECC(this, play); + EnRu1_TurnUpperBodyForward(this); + EnRu1_UpdateBgCheckInfo(this, play); animFinished = EnRu1_UpdateSkelAnime(this); EnRu1_UpdateEyes(this); EnRu1_KeepArmsDown(this, animFinished); @@ -2209,8 +2218,8 @@ void EnRu1_SapphireRoom_DoneHolding(EnRu1* this, PlayState* play) { } void EnRu1_SapphireRoom_MissionAccomplished(EnRu1* this, PlayState* play) { - func_80AED83C(this); - func_80AEAECC(this, play); + EnRu1_TurnUpperBodyForward(this); + EnRu1_UpdateBgCheckInfo(this, play); EnRu1_UpdateSkelAnime(this); EnRu1_UpdateEyes(this); EnRu1_EndRetrievalCutscene(this, play); @@ -2220,8 +2229,8 @@ void EnRu1_SapphireRoom_MissionAccomplished(EnRu1* this, PlayState* play) { } void EnRu1_SapphireRoom_ReadyToGoHome(EnRu1* this, PlayState* play) { - func_80AED83C(this); - func_80AEAECC(this, play); + EnRu1_TurnUpperBodyForward(this); + EnRu1_UpdateBgCheckInfo(this, play); EnRu1_UpdateSkelAnime(this); EnRu1_UpdateEyes(this); EnRu1_RespondToSapphirePlatformMoving(this); @@ -2229,7 +2238,7 @@ void EnRu1_SapphireRoom_ReadyToGoHome(EnRu1* this, PlayState* play) { } void EnRu1_SapphireRoom_BeingAbducted(EnRu1* this, PlayState* play) { - func_80AED83C(this); + EnRu1_TurnUpperBodyForward(this); EnRu1_RemoveInAbduction(this, play); } @@ -2305,7 +2314,7 @@ void EnRu1_ThroneRoom_Idle(EnRu1* this, PlayState* play) { EnRu1_UpdateSkelAnime(this); EnRu1_UpdateEyes(this); EnRu1_UpdateStandingOC(this, play); - func_80AEAECC(this, play); + EnRu1_UpdateBgCheckInfo(this, play); EnRu1_StartThroneRoomTalk(this, play, EnRu1_ThroneRoomTalkOfferAccepted(this, play)); } @@ -2313,7 +2322,7 @@ void EnRu1_ThroneRoom_Talk(EnRu1* this, PlayState* play) { EnRu1_TurnFullBodyTowardPlayer(this, play); EnRu1_UpdateSkelAnime(this); EnRu1_UpdateEyes(this); - func_80AEAECC(this, play); + EnRu1_UpdateBgCheckInfo(this, play); EnRu1_EndThroneRoomTalk(this, play); } @@ -2323,8 +2332,8 @@ void EnRu1_ThroneRoom_Talk(EnRu1* this, PlayState* play) { void EnRu1_InitBesideDoorSwitch(EnRu1* this, PlayState* play) { s8 actorRoom; - if (GET_INFTABLE(INFTABLE_MET_RUTO_FIRST_TIME) && GET_INFTABLE(INFTABLE_140) && - !GET_INFTABLE(INFTABLE_RUTO_HAS_SAPPHIRE) && (!(func_80AEB020(this, play)))) { + if (GET_INFTABLE(INFTABLE_RUTO_MET_FIRST_TIME) && GET_INFTABLE(INFTABLE_RUTO_PLACED_ON_SWITCH) && + !GET_INFTABLE(INFTABLE_RUTO_HAS_SAPPHIRE) && !(EnRu1_IsAssistingLink(this, play))) { EnRu1_AnimationChange(this, &gRutoChildWait2Anim, ANIMMODE_LOOP, 0, false); actorRoom = this->actor.room; this->action = ENRU1_ACTION_SPEAK_JABU_PRE_SPAWN; diff --git a/src/overlays/actors/ovl_En_Ru1/z_en_ru1.h b/src/overlays/actors/ovl_En_Ru1/z_en_ru1.h index 47a56fee92..d3040686ae 100644 --- a/src/overlays/actors/ovl_En_Ru1/z_en_ru1.h +++ b/src/overlays/actors/ovl_En_Ru1/z_en_ru1.h @@ -43,7 +43,7 @@ typedef struct EnRu1 { /* 0x029C */ char unk_29C[0x2]; /* 0x029E */ s16 headTurnSpeed; /* 0x02A0 */ char unk_2A0[0x4]; - /* 0x02A4 */ f32 unk_2A4; + /* 0x02A4 */ f32 sinkTimer; /* 0x02A8 */ s32 alpha; /* 0x02AC */ s16 headRotTimer; /* 0x02B0 */ s32 headRotDirection; @@ -88,15 +88,15 @@ typedef enum EnRu1Action { /* 24 */ ENRU1_ACTION_SPEAK_JABU_IDLE, /* 25 */ ENRU1_ACTION_SPEAK_JABU_TALKING, /* 26 */ ENRU1_ACTION_SPEAK_JABU_SIT_DOWN, - /* 27 */ ENRU1_ACTION_27, - /* 28 */ ENRU1_ACTION_28, - /* 29 */ ENRU1_ACTION_29, - /* 30 */ ENRU1_ACTION_30, - /* 31 */ ENRU1_ACTION_31, - /* 32 */ ENRU1_ACTION_32, - /* 33 */ ENRU1_ACTION_33, - /* 34 */ ENRU1_ACTION_34, - /* 35 */ ENRU1_ACTION_35, + /* 27 */ ENRU1_ACTION_SITTING_IDLE, + /* 28 */ ENRU1_ACTION_SITTING_RELEASED, + /* 29 */ ENRU1_ACTION_SITTING_ENTERING_WATER, + /* 30 */ ENRU1_ACTION_SITTING_SINKING, + /* 31 */ ENRU1_ACTION_SITTING_CARRIED, + /* 32 */ ENRU1_ACTION_SITTING_LOSING_BALANCE, + /* 33 */ ENRU1_ACTION_SITTING_DISAPPEARING, + /* 34 */ ENRU1_ACTION_SITTING_SEES_SAPPHIRE, + /* 35 */ ENRU1_ACTION_UNUSED, /* 36 */ ENRU1_ACTION_THROWN_ONTO_SAPPHIRE_PLATFORM, /* 37 */ ENRU1_ACTION_RETRIEVING_SAPPHIRE, /* 38 */ ENRU1_ACTION_HOLDING_SAPPHIRE,