1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-06-08 09:31:52 +00:00
This commit is contained in:
Jordan Longstaff 2025-06-08 00:27:20 +09:00 committed by GitHub
commit 386358ef86
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 131 additions and 82 deletions

View file

@ -52,13 +52,13 @@ void func_80AECB60(EnRu1* this, PlayState* play);
void func_80AECBB8(EnRu1* this, PlayState* play);
void func_80AECC1C(EnRu1* this, PlayState* play);
void func_80AECC84(EnRu1* this, PlayState* play);
void func_80AED304(EnRu1* this, PlayState* play);
void func_80AED324(EnRu1* this, PlayState* play);
void func_80AED344(EnRu1* this, PlayState* play);
void func_80AED374(EnRu1* this, PlayState* play);
void func_80AED3A4(EnRu1* this, PlayState* play);
void func_80AED3E0(EnRu1* this, PlayState* play);
void func_80AED414(EnRu1* this, PlayState* play);
void EnRu1_PreSpawnInBossRoom(EnRu1* this, PlayState* play);
void EnRu1_SpawnInBossRoom(EnRu1* this, PlayState* play);
void EnRu1_RiseThroughBlueWarp(EnRu1* this, PlayState* play);
void EnRu1_WaitInsideBlueWarp(EnRu1* this, PlayState* play);
void EnRu1_LinkWalksToPointInBlueWarp(EnRu1* this, PlayState* play);
void EnRu1_WhatTookYouSoLong(EnRu1* this, PlayState* play);
void EnRu1_WarpingOut(EnRu1* this, PlayState* play);
void func_80AEF29C(EnRu1* this, PlayState* play);
void func_80AEF2AC(EnRu1* this, PlayState* play);
void func_80AEF2D0(EnRu1* this, PlayState* play);
@ -154,13 +154,52 @@ static s32 sUnused = 0;
static u32 D_80AF1938 = 0;
static EnRu1ActionFunc sActionFuncs[] = {
func_80AEC0B4, func_80AEC100, func_80AEC130, func_80AEC17C, func_80AEC1D4, func_80AEC244, func_80AEC2C0,
func_80AECA94, func_80AECAB4, func_80AECAD4, func_80AECB18, func_80AECB60, func_80AECBB8, func_80AECC1C,
func_80AECC84, func_80AED304, func_80AED324, func_80AED344, func_80AED374, func_80AED3A4, func_80AED3E0,
func_80AED414, func_80AEF29C, func_80AEF2AC, func_80AEF2D0, func_80AEF354, func_80AEF3A8, func_80AEEBD4,
func_80AEEC5C, func_80AEECF0, func_80AEED58, func_80AEEDCC, func_80AEEE34, func_80AEEE9C, func_80AEEF08,
func_80AEEF5C, func_80AEF9D8, func_80AEFA2C, func_80AEFAAC, func_80AEFB04, func_80AEFB68, func_80AEFCE8,
func_80AEFBC8, func_80AEFC24, func_80AEFECC, func_80AEFF40,
func_80AEC0B4,
func_80AEC100,
func_80AEC130,
func_80AEC17C,
func_80AEC1D4,
func_80AEC244,
func_80AEC2C0,
func_80AECA94,
func_80AECAB4,
func_80AECAD4,
func_80AECB18,
func_80AECB60,
func_80AECBB8,
func_80AECC1C,
func_80AECC84,
EnRu1_PreSpawnInBossRoom,
EnRu1_SpawnInBossRoom,
EnRu1_RiseThroughBlueWarp,
EnRu1_WaitInsideBlueWarp,
EnRu1_LinkWalksToPointInBlueWarp,
EnRu1_WhatTookYouSoLong,
EnRu1_WarpingOut,
func_80AEF29C,
func_80AEF2AC,
func_80AEF2D0,
func_80AEF354,
func_80AEF3A8,
func_80AEEBD4,
func_80AEEC5C,
func_80AEECF0,
func_80AEED58,
func_80AEEDCC,
func_80AEEE34,
func_80AEEE9C,
func_80AEEF08,
func_80AEEF5C,
func_80AEF9D8,
func_80AEFA2C,
func_80AEFAAC,
func_80AEFB04,
func_80AEFB68,
func_80AEFCE8,
func_80AEFBC8,
func_80AEFC24,
func_80AEFECC,
func_80AEFF40,
};
static EnRu1PreLimbDrawFunc sPreLimbDrawFuncs[] = {
@ -830,10 +869,10 @@ void EnRu1_InitInJabuJabuHolesRoom(EnRu1* this, PlayState* play) {
}
void func_80AEC40C(EnRu1* this) {
f32 unk_26C = this->unk_26C;
f32 walkingFrame = this->walkingFrame;
if (unk_26C < 8.0f) {
this->actor.speed = (((kREG(3) * 0.01f) + 2.7f) / 8.0f) * unk_26C;
if (walkingFrame < 8.0f) {
this->actor.speed = (((kREG(3) * 0.01f) + 2.7f) / 8.0f) * walkingFrame;
} else {
this->actor.speed = (kREG(3) * 0.01f) + 2.7f;
}
@ -848,12 +887,12 @@ void func_80AEC4CC(EnRu1* this) {
void func_80AEC4F4(EnRu1* this) {
f32* speedXZ = &this->actor.speed;
f32* unk_26C = &this->unk_26C;
f32* walkingFrame = &this->walkingFrame;
if (this->unk_26C < 8.0f) {
*unk_26C += 1.0f;
*speedXZ *= (8.0f - *unk_26C) / 8.0f;
this->actor.velocity.y = -*unk_26C * (((kREG(4) * 0.01f) + 13.0f) / 8.0f);
if (this->walkingFrame < 8.0f) {
*walkingFrame += 1.0f;
*speedXZ *= (8.0f - *walkingFrame) / 8.0f;
this->actor.velocity.y = -*walkingFrame * (((kREG(4) * 0.01f) + 13.0f) / 8.0f);
} else {
*speedXZ = 0.0f;
this->actor.velocity.y = -((kREG(4) * 0.01f) + 13.0f);
@ -942,15 +981,15 @@ void func_80AEC93C(EnRu1* this, UNK_TYPE arg1) {
ANIMMODE_LOOP, -8.0f);
this->actor.world.rot.y += 0x8000;
this->action = 0xB;
this->unk_26C = 0.0f;
this->walkingFrame = 0.0f;
}
}
void func_80AEC9C4(EnRu1* this) {
this->unk_26C += 1.0f;
if (this->unk_26C >= 8.0f) {
this->walkingFrame += 1.0f;
if (this->walkingFrame >= 8.0f) {
this->action = 12;
this->unk_26C = 0.0f;
this->walkingFrame = 0.0f;
this->actor.velocity.y = -1.0f;
}
}
@ -960,7 +999,7 @@ void func_80AECA18(EnRu1* this) {
s32 pad;
this->action = 13;
this->unk_26C = 0.0f;
this->walkingFrame = 0.0f;
this->actor.velocity.y = 0.0f;
}
}
@ -1031,7 +1070,7 @@ void func_80AECC84(EnRu1* this, PlayState* play) {
}
}
void func_80AECCB0(EnRu1* this, PlayState* play) {
void EnRu1_SpawnBlueWarp(EnRu1* this, PlayState* play) {
s32 pad;
Vec3f* pos;
s16 yawTowardsPlayer;
@ -1057,25 +1096,31 @@ void EnRu1_InitInBossRoom(EnRu1* this, PlayState* play) {
EnRu1_SetMouth(this, ENRU1_MOUTH_OPEN);
}
void func_80AECE04(EnRu1* this, PlayState* play) {
/**
* Ruto rises up through the floor within the field of the blue warp.
*/
void EnRu1_Rise(EnRu1* this, PlayState* play) {
this->actor.shape.yOffset += (250.0f / 3.0f);
}
void func_80AECE20(EnRu1* this, PlayState* play) {
/**
* Ruto rises up in sync with Link as they warp out together.
*/
void EnRu1_RiseWithLink(EnRu1* this, PlayState* play) {
s32 pad2;
Player* player = GET_PLAYER(play);
Vec3f* playerPos = &player->actor.world.pos;
s16 shapeRotY = player->actor.shape.rot.y;
s32 pad;
f32 unk_27C = this->unk_27C;
f32 xzDistToPlayer = this->xzDistToPlayerInBlueWarp;
Vec3f* pos = &this->actor.world.pos;
pos->x = (Math_SinS(shapeRotY) * unk_27C) + playerPos->x;
pos->x = (Math_SinS(shapeRotY) * xzDistToPlayer) + playerPos->x;
pos->y = playerPos->y;
pos->z = (Math_CosS(shapeRotY) * unk_27C) + playerPos->z;
pos->z = (Math_CosS(shapeRotY) * xzDistToPlayer) + playerPos->z;
}
void func_80AECEB4(EnRu1* this, PlayState* play) {
void EnRu1_SetPlayerMarkInBlueWarp(EnRu1* this, PlayState* play) {
s32 pad;
Player* player = GET_PLAYER(play);
Vec3f* player_unk_450 = &player->unk_450;
@ -1086,27 +1131,31 @@ void func_80AECEB4(EnRu1* this, PlayState* play) {
player_unk_450->z = ((kREG(2) + 30.0f) * Math_CosS(shapeRotY)) + pos->z;
}
s32 func_80AECF6C(EnRu1* this, PlayState* play) {
/**
* Checks if Link is in position inside the blue warp, facing Ruto.
* This is the condition for when Ruto starts chiding him.
*/
s32 EnRu1_IsLinkInBlueWarp(EnRu1* this, PlayState* play) {
s16* shapeRotY;
Player* player = GET_PLAYER(play);
Player* otherPlayer;
s16 temp_f16;
f32 temp1;
f32 temp2;
s16 targetRotY;
f32 dx;
f32 dz;
s32 pad2[5];
this->unk_26C += 1.0f;
if ((player->actor.speed == 0.0f) && (this->unk_26C >= 3.0f)) {
this->walkingFrame += 1.0f;
if ((player->actor.speed == 0.0f) && (this->walkingFrame >= 3.0f)) {
otherPlayer = GET_PLAYER(play);
player->actor.world.pos.x = otherPlayer->unk_450.x;
player->actor.world.pos.y = otherPlayer->unk_450.y;
player->actor.world.pos.z = otherPlayer->unk_450.z;
shapeRotY = &player->actor.shape.rot.y;
temp1 = this->actor.world.pos.x - player->actor.world.pos.x;
temp2 = this->actor.world.pos.z - player->actor.world.pos.z;
temp_f16 = RAD_TO_BINANG(Math_FAtan2F(temp1, temp2));
if (*shapeRotY != temp_f16) {
Math_SmoothStepToS(shapeRotY, temp_f16, 0x14, 0x1838, 0x64);
dx = this->actor.world.pos.x - player->actor.world.pos.x;
dz = this->actor.world.pos.z - player->actor.world.pos.z;
targetRotY = RAD_TO_BINANG(Math_FAtan2F(dx, dz));
if (*shapeRotY != targetRotY) {
Math_SmoothStepToS(shapeRotY, targetRotY, 0x14, 0x1838, 0x64);
player->actor.world.rot.y = *shapeRotY;
} else {
return true;
@ -1115,102 +1164,102 @@ s32 func_80AECF6C(EnRu1* this, PlayState* play) {
return false;
}
s32 func_80AED084(EnRu1* this, s32 state) {
s32 EnRu1_CheckBlueWarpState(EnRu1* this, s32 state) {
if (this->blueWarp != NULL && this->blueWarp->rutoWarpState == state) {
return true;
}
return false;
}
void func_80AED0B0(EnRu1* this, s32 state) {
void EnRu1_SetBlueWarpState(EnRu1* this, s32 state) {
if (this->blueWarp != NULL) {
this->blueWarp->rutoWarpState = state;
}
}
void func_80AED0C8(EnRu1* this, PlayState* play) {
void EnRu1_TriggerSpawnInBossRoom(EnRu1* this, PlayState* play) {
this->action = 16;
}
void func_80AED0D8(EnRu1* this, PlayState* play) {
void EnRu1_SetupRiseThroughBlueWarp(EnRu1* this, PlayState* play) {
this->action = 17;
this->drawConfig = 1;
this->actor.world.rot.y = this->actor.yawTowardsPlayer;
this->actor.shape.rot.y = this->actor.yawTowardsPlayer;
func_80AECCB0(this, play);
EnRu1_SpawnBlueWarp(this, play);
}
void func_80AED110(EnRu1* this) {
void EnRu1_EndRise(EnRu1* this) {
if (this->actor.shape.yOffset >= 0.0f) {
this->action = 18;
this->actor.shape.yOffset = 0.0f;
func_80AED0B0(this, WARP_BLUE_RUTO_STATE_READY);
EnRu1_SetBlueWarpState(this, WARP_BLUE_RUTO_STATE_READY);
}
}
void func_80AED154(EnRu1* this, PlayState* play) {
if (func_80AED084(this, WARP_BLUE_RUTO_STATE_ENTERED)) {
void EnRu1_CheckLinkEnteredBlueWarp(EnRu1* this, PlayState* play) {
if (EnRu1_CheckBlueWarpState(this, WARP_BLUE_RUTO_STATE_ENTERED)) {
this->action = 0x13;
this->unk_26C = 0.0f;
func_80AECEB4(this, play);
this->walkingFrame = 0.0f;
EnRu1_SetPlayerMarkInBlueWarp(this, play);
}
}
void func_80AED19C(EnRu1* this, s32 cond) {
if (cond) {
void EnRu1_StartCrossingArmsAndLegs(EnRu1* this, s32 shouldStart) {
if (shouldStart) {
Animation_Change(&this->skelAnime, &gRutoChildTransitionHandsOnHipToCrossArmsAndLegsAnim, 1.0f, 0,
Animation_GetLastFrame(&gRutoChildTransitionHandsOnHipToCrossArmsAndLegsAnim), ANIMMODE_ONCE,
-8.0f);
this->action = 20;
func_80AED0B0(this, WARP_BLUE_RUTO_STATE_3);
EnRu1_SetBlueWarpState(this, WARP_BLUE_RUTO_STATE_3);
}
}
void func_80AED218(EnRu1* this, UNK_TYPE arg1) {
if (func_80AED084(this, WARP_BLUE_RUTO_STATE_TALKING)) {
if (arg1 != 0) {
void EnRu1_AdvanceAngryAnimation(EnRu1* this, s32 isTalking) {
if (EnRu1_CheckBlueWarpState(this, WARP_BLUE_RUTO_STATE_TALKING)) {
if (isTalking) {
Animation_Change(&this->skelAnime, &gRutoChildWaitSittingAnim, 1.0f, 0,
Animation_GetLastFrame(&gRutoChildWaitSittingAnim), ANIMMODE_LOOP, -8.0f);
}
} else if (func_80AED084(this, WARP_BLUE_RUTO_STATE_WARPING)) {
} else if (EnRu1_CheckBlueWarpState(this, WARP_BLUE_RUTO_STATE_WARPING)) {
Animation_Change(&this->skelAnime, &gRutoChildWaitInBlueWarpAnim, 1.0f, 0,
Animation_GetLastFrame(&gRutoChildWaitInBlueWarpAnim), ANIMMODE_ONCE, -8.0f);
this->action = 21;
this->unk_27C = this->actor.xzDistToPlayer;
this->xzDistToPlayerInBlueWarp = this->actor.xzDistToPlayer;
}
}
void func_80AED304(EnRu1* this, PlayState* play) {
func_80AED0C8(this, play);
void EnRu1_PreSpawnInBossRoom(EnRu1* this, PlayState* play) {
EnRu1_TriggerSpawnInBossRoom(this, play);
}
void func_80AED324(EnRu1* this, PlayState* play) {
func_80AED0D8(this, play);
void EnRu1_SpawnInBossRoom(EnRu1* this, PlayState* play) {
EnRu1_SetupRiseThroughBlueWarp(this, play);
}
void func_80AED344(EnRu1* this, PlayState* play) {
func_80AECE04(this, play);
void EnRu1_RiseThroughBlueWarp(EnRu1* this, PlayState* play) {
EnRu1_Rise(this, play);
EnRu1_UpdateSkelAnime(this);
func_80AED110(this);
EnRu1_EndRise(this);
}
void func_80AED374(EnRu1* this, PlayState* play) {
void EnRu1_WaitInsideBlueWarp(EnRu1* this, PlayState* play) {
EnRu1_UpdateSkelAnime(this);
func_80AED154(this, play);
EnRu1_CheckLinkEnteredBlueWarp(this, play);
}
void func_80AED3A4(EnRu1* this, PlayState* play) {
void EnRu1_LinkWalksToPointInBlueWarp(EnRu1* this, PlayState* play) {
EnRu1_UpdateSkelAnime(this);
func_80AED19C(this, func_80AECF6C(this, play));
EnRu1_StartCrossingArmsAndLegs(this, EnRu1_IsLinkInBlueWarp(this, play));
}
void func_80AED3E0(EnRu1* this, PlayState* play) {
void EnRu1_WhatTookYouSoLong(EnRu1* this, PlayState* play) {
func_80AEAECC(this, play);
func_80AED218(this, EnRu1_UpdateSkelAnime(this));
EnRu1_AdvanceAngryAnimation(this, EnRu1_UpdateSkelAnime(this));
}
void func_80AED414(EnRu1* this, PlayState* play) {
func_80AECE20(this, play);
void EnRu1_WarpingOut(EnRu1* this, PlayState* play) {
EnRu1_RiseWithLink(this, play);
func_80AEAECC(this, play);
EnRu1_UpdateSkelAnime(this);
}
@ -1668,7 +1717,7 @@ s32 func_80AEE6D0(EnRu1* this, PlayState* play) {
Animation_GetLastFrame(&gRutoChildSquirmAnim), ANIMMODE_LOOP, -8.0f);
func_80AED600(this);
this->action = 34;
this->unk_26C = 0.0f;
this->walkingFrame = 0.0f;
play->csCtx.script = gRutoFoundSapphireCs;
gSaveContext.cutsceneTrigger = 1;
}

View file

@ -26,11 +26,11 @@ typedef struct EnRu1 {
/* 0x0260 */ s16 mouth;
/* 0x0264 */ s32 action;
/* 0x0268 */ s32 drawConfig;
/* 0x026C */ f32 unk_26C;
/* 0x026C */ f32 walkingFrame;
/* 0x0270 */ f32 unk_270;
/* 0x0274 */ char unk_274[0x4];
/* 0x0278 */ DoorWarp1* blueWarp;
/* 0x027C */ f32 unk_27C;
/* 0x027C */ f32 xzDistToPlayerInBlueWarp;
/* 0x0280 */ s32 unk_280;
/* 0x0284 */ s8 roomNum1;
/* 0x0285 */ s8 roomNum2;