mirror of
https://github.com/zeldaret/mm.git
synced 2026-05-23 06:54:14 -04:00
Document ObjWturn (#1866)
This commit is contained in:
@@ -11,14 +11,14 @@
|
||||
void ObjWturn_Init(Actor* thisx, PlayState* play);
|
||||
void ObjWturn_Update(Actor* thisx, PlayState* play);
|
||||
|
||||
void func_808A7954(ObjWturn* this);
|
||||
void func_808A7968(ObjWturn* this, PlayState* play);
|
||||
void func_808A7A24(ObjWturn* this);
|
||||
void func_808A7A5C(ObjWturn* this, PlayState* play);
|
||||
void func_808A7AAC(ObjWturn* this, PlayState* play);
|
||||
void func_808A7BA0(ObjWturn* this, PlayState* play);
|
||||
void func_808A7C04(ObjWturn* this, PlayState* play);
|
||||
void func_808A7C78(ObjWturn* this, PlayState* play);
|
||||
void ObjWturn_SetupIdle(ObjWturn* this);
|
||||
void ObjWturn_Idle(ObjWturn* this, PlayState* play);
|
||||
void ObjWturn_TriggerInversion(ObjWturn* this);
|
||||
void ObjWturn_AwaitInversion(ObjWturn* this, PlayState* play);
|
||||
void ObjWturn_SetupInversionCs(ObjWturn* this, PlayState* play);
|
||||
void ObjWturn_InversionCs(ObjWturn* this, PlayState* play);
|
||||
void ObjWturn_SetupFallingCs(ObjWturn* this, PlayState* play);
|
||||
void ObjWturn_FallingCs(ObjWturn* this, PlayState* play);
|
||||
|
||||
ActorProfile Obj_Wturn_Profile = {
|
||||
/**/ ACTOR_OBJ_WTURN,
|
||||
@@ -35,14 +35,14 @@ ActorProfile Obj_Wturn_Profile = {
|
||||
void ObjWturn_Init(Actor* thisx, PlayState* play) {
|
||||
ObjWturn* this = (ObjWturn*)thisx;
|
||||
|
||||
func_808A7954(this);
|
||||
ObjWturn_SetupIdle(this);
|
||||
}
|
||||
|
||||
void func_808A7954(ObjWturn* this) {
|
||||
this->actionFunc = func_808A7968;
|
||||
void ObjWturn_SetupIdle(ObjWturn* this) {
|
||||
this->actionFunc = ObjWturn_Idle;
|
||||
}
|
||||
|
||||
void func_808A7968(ObjWturn* this, PlayState* play) {
|
||||
void ObjWturn_Idle(ObjWturn* this, PlayState* play) {
|
||||
if ((play->msgCtx.ocarinaMode >= OCARINA_MODE_WARP_TO_GREAT_BAY_COAST) &&
|
||||
(play->msgCtx.ocarinaMode <= OCARINA_MODE_WARP_TO_ENTRANCE)) {
|
||||
Flags_UnsetSwitch(play, OBJWTURN_GET_SWITCH_FLAG(&this->actor));
|
||||
@@ -52,24 +52,24 @@ void func_808A7968(ObjWturn* this, PlayState* play) {
|
||||
|
||||
if ((Flags_GetSwitch(play, OBJWTURN_GET_SWITCH_FLAG(&this->actor)) && (play->sceneId == SCENE_F40)) ||
|
||||
(!Flags_GetSwitch(play, OBJWTURN_GET_SWITCH_FLAG(&this->actor)) && (play->sceneId == SCENE_F41))) {
|
||||
func_808A7A24(this);
|
||||
ObjWturn_TriggerInversion(this);
|
||||
}
|
||||
}
|
||||
|
||||
void func_808A7A24(ObjWturn* this) {
|
||||
void ObjWturn_TriggerInversion(ObjWturn* this) {
|
||||
CutsceneManager_Queue(this->actor.csId);
|
||||
this->actionFunc = func_808A7A5C;
|
||||
this->actionFunc = ObjWturn_AwaitInversion;
|
||||
}
|
||||
|
||||
void func_808A7A5C(ObjWturn* this, PlayState* play) {
|
||||
void ObjWturn_AwaitInversion(ObjWturn* this, PlayState* play) {
|
||||
if (CutsceneManager_IsNext(this->actor.csId)) {
|
||||
func_808A7AAC(this, play);
|
||||
ObjWturn_SetupInversionCs(this, play);
|
||||
} else {
|
||||
CutsceneManager_Queue(this->actor.csId);
|
||||
}
|
||||
}
|
||||
|
||||
void func_808A7AAC(ObjWturn* this, PlayState* play) {
|
||||
void ObjWturn_SetupInversionCs(ObjWturn* this, PlayState* play) {
|
||||
Player* player = GET_PLAYER(play);
|
||||
Vec3f subCamEye;
|
||||
Vec3f subCamAt;
|
||||
@@ -85,38 +85,38 @@ void func_808A7AAC(ObjWturn* this, PlayState* play) {
|
||||
subCamEye.z = (Math_CosS(this->actor.shape.rot.y) * 150.0f) + subCamAt.z;
|
||||
subCamEye.y = subCamAt.y + 4.0f;
|
||||
Play_SetCameraAtEye(play, this->subCamId, &subCamAt, &subCamEye);
|
||||
this->actionFunc = func_808A7BA0;
|
||||
this->actionFunc = ObjWturn_InversionCs;
|
||||
}
|
||||
|
||||
void func_808A7BA0(ObjWturn* this, PlayState* play) {
|
||||
void ObjWturn_InversionCs(ObjWturn* this, PlayState* play) {
|
||||
if (Math_ScaledStepToS(&this->actor.shape.rot.z, -0x8000, 0x200)) {
|
||||
func_808A7C04(this, play);
|
||||
ObjWturn_SetupFallingCs(this, play);
|
||||
}
|
||||
Actor_PlaySfx_FlaggedCentered2(&this->actor, NA_SE_EV_EARTHQUAKE - SFX_FLAG);
|
||||
Play_SetCameraRoll(play, this->subCamId, this->actor.shape.rot.z);
|
||||
}
|
||||
|
||||
void func_808A7C04(ObjWturn* this, PlayState* play) {
|
||||
void ObjWturn_SetupFallingCs(ObjWturn* this, PlayState* play) {
|
||||
Player* player = GET_PLAYER(play);
|
||||
|
||||
this->actor.world.pos.y += this->actor.playerHeightRel;
|
||||
player->actor.shape.shadowAlpha = 0;
|
||||
Player_SetCsActionWithHaltedActors(play, &this->actor, PLAYER_CSACTION_84);
|
||||
Player_PlaySfx(player, NA_SE_VO_NAVY_ENEMY);
|
||||
this->unk_14A = 0;
|
||||
this->fallingFrame = 0;
|
||||
Play_DisableMotionBlur();
|
||||
this->actionFunc = func_808A7C78;
|
||||
this->actionFunc = ObjWturn_FallingCs;
|
||||
}
|
||||
|
||||
void func_808A7C78(ObjWturn* this, PlayState* play) {
|
||||
void ObjWturn_FallingCs(ObjWturn* this, PlayState* play) {
|
||||
static Vec3f sSubCamUp = { 0.0f, -1.0f, 0.0f };
|
||||
Camera* subCam = Play_GetCamera(play, this->subCamId);
|
||||
Player* player = GET_PLAYER(play);
|
||||
|
||||
this->unk_14A++;
|
||||
player->actor.world.pos.y = this->actor.world.pos.y + this->unk_14A * 4.0f;
|
||||
this->fallingFrame++;
|
||||
player->actor.world.pos.y = this->actor.world.pos.y + this->fallingFrame * 4.0f;
|
||||
Play_SetCameraAtEyeUp(play, this->subCamId, &player->actor.focus.pos, &subCam->eye, &sSubCamUp);
|
||||
if (this->unk_14A == 1) {
|
||||
if (this->fallingFrame == 1) {
|
||||
play->transitionType = TRANS_TYPE_64;
|
||||
gSaveContext.nextTransitionType = TRANS_TYPE_FADE_WHITE;
|
||||
gSaveContext.nextCutsceneIndex = 0;
|
||||
|
||||
@@ -13,7 +13,7 @@ typedef struct ObjWturn {
|
||||
/* 0x000 */ Actor actor;
|
||||
/* 0x144 */ ObjWturnActionFunc actionFunc;
|
||||
/* 0x148 */ s16 subCamId;
|
||||
/* 0x14A */ s16 unk_14A;
|
||||
/* 0x14A */ s16 fallingFrame;
|
||||
} ObjWturn; // size = 0x14C
|
||||
|
||||
#endif // Z_OBJ_WTURN_H
|
||||
|
||||
@@ -5716,14 +5716,14 @@ EnSt_Update = 0x808A7840; // type:func size:0x1B8
|
||||
EnSt_OverrideLimbDraw = 0x808A79F8; // type:func size:0x90
|
||||
func_808A7478 = 0x808A7A88; // type:func size:0x118
|
||||
ObjWturn_Init = 0x808A7FE0; // type:func size:0x24
|
||||
func_808A7954 = 0x808A8004; // type:func size:0x14
|
||||
func_808A7968 = 0x808A8018; // type:func size:0xBC
|
||||
func_808A7A24 = 0x808A80D4; // type:func size:0x38
|
||||
func_808A7A5C = 0x808A810C; // type:func size:0x50
|
||||
func_808A7AAC = 0x808A815C; // type:func size:0xF4
|
||||
func_808A7BA0 = 0x808A8250; // type:func size:0x64
|
||||
func_808A7C04 = 0x808A82B4; // type:func size:0x74
|
||||
func_808A7C78 = 0x808A8328; // type:func size:0xFC
|
||||
ObjWturn_SetupIdle = 0x808A8004; // type:func size:0x14
|
||||
ObjWturn_Idle = 0x808A8018; // type:func size:0xBC
|
||||
ObjWturn_TriggerInversion = 0x808A80D4; // type:func size:0x38
|
||||
ObjWturn_AwaitInversion = 0x808A810C; // type:func size:0x50
|
||||
ObjWturn_SetupInversionCs = 0x808A815C; // type:func size:0xF4
|
||||
ObjWturn_InversionCs = 0x808A8250; // type:func size:0x64
|
||||
ObjWturn_SetupFallingCs = 0x808A82B4; // type:func size:0x74
|
||||
ObjWturn_FallingCs = 0x808A8328; // type:func size:0xFC
|
||||
ObjWturn_Update = 0x808A8424; // type:func size:0x2C
|
||||
EnRiverSound_Init = 0x808A84E0; // type:func size:0x68
|
||||
EnRiverSound_Update = 0x808A8548; // type:func size:0x118
|
||||
|
||||
@@ -5736,14 +5736,14 @@ EnSt_Update = 0x808A7230; // type:func
|
||||
EnSt_OverrideLimbDraw = 0x808A73E8; // type:func
|
||||
func_808A7478 = 0x808A7478; // type:func
|
||||
ObjWturn_Init = 0x808A7930; // type:func
|
||||
func_808A7954 = 0x808A7954; // type:func
|
||||
func_808A7968 = 0x808A7968; // type:func
|
||||
func_808A7A24 = 0x808A7A24; // type:func
|
||||
func_808A7A5C = 0x808A7A5C; // type:func
|
||||
func_808A7AAC = 0x808A7AAC; // type:func
|
||||
func_808A7BA0 = 0x808A7BA0; // type:func
|
||||
func_808A7C04 = 0x808A7C04; // type:func
|
||||
func_808A7C78 = 0x808A7C78; // type:func
|
||||
ObjWturn_SetupIdle = 0x808A7954; // type:func
|
||||
ObjWturn_Idle = 0x808A7968; // type:func
|
||||
ObjWturn_TriggerInversion = 0x808A7A24; // type:func
|
||||
ObjWturn_AwaitInversion = 0x808A7A5C; // type:func
|
||||
ObjWturn_SetupInversionCs = 0x808A7AAC; // type:func
|
||||
ObjWturn_InversionCs = 0x808A7BA0; // type:func
|
||||
ObjWturn_SetupFallingCs = 0x808A7C04; // type:func
|
||||
ObjWturn_FallingCs = 0x808A7C78; // type:func
|
||||
ObjWturn_Update = 0x808A7D74; // type:func
|
||||
EnRiverSound_Init = 0x808A7E30; // type:func
|
||||
EnRiverSound_Update = 0x808A7EB8; // type:func
|
||||
|
||||
Reference in New Issue
Block a user