func_$hex renaming from upstream (#6498)

This commit is contained in:
Philip Dubé 2026-04-19 18:56:01 +00:00 committed by GitHub
parent 80de5cc179
commit c7ef690bc2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
57 changed files with 1311 additions and 1306 deletions

View file

@ -890,13 +890,13 @@ void SkelCurve_SetAnim(SkelAnimeCurve* skelCurve, TransformUpdateIndex* transUpd
s32 SkelCurve_Update(PlayState* play, SkelAnimeCurve* skelCurve);
void SkelCurve_Draw(Actor* actor, PlayState* play, SkelAnimeCurve* skelCurve,
OverrideCurveLimbDraw overrideLimbDraw, PostCurveLimbDraw postLimbDraw, s32 lod, void* data);
s32 func_8006CFC0(s32 scene);
void func_8006D074(PlayState* play);
void func_8006D0AC(PlayState* play);
void func_8006D0EC(PlayState* play, Player* player);
void func_8006D684(PlayState* play, Player* player);
void func_8006DC68(PlayState* play, Player* player);
void func_8006DD9C(Actor* actor, Vec3f* arg1, s16 arg2);
s32 Horse_CanSpawn(s32 scene);
void Horse_ResetHorseData(PlayState* play);
void Horse_FixLakeHyliaPosition(PlayState* play);
void Horse_SetupInGameplay(PlayState* play, Player* player);
void Horse_SetupInCutscene(PlayState* play, Player* player);
void Horse_InitPlayerHorse(PlayState* play, Player* player);
void Horse_RotateToPoint(Actor* actor, Vec3f* arg1, s16 arg2);
s32 Jpeg_Decode(void* data, void* zbuffer, void* workBuff, u32 workSize);
void KaleidoSetup_Update(PlayState* play);
void KaleidoSetup_Init(PlayState* play);

View file

@ -29,7 +29,7 @@ void EnCow_MoveForRandomizer(EnCow* enCow, PlayState* play) {
if (moved) {
// Reposition collider
func_809DEE9C(enCow);
EnCow_SetColliderPos(enCow);
}
}

View file

@ -1658,7 +1658,7 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_l
Flags_SetInfTable(INFTABLE_191);
gSaveContext.dogParams = 0;
gSaveContext.dogIsLost = false;
enHy->actionFunc = func_80A7127C;
enHy->actionFunc = EnHy_Fidget;
*should = false;
break;
}

View file

@ -59,7 +59,7 @@ void EnMa1_EndTeachSong(EnMa1* enMa1, PlayState* play) {
Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME);
enMa1->actor.flags &= ~ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED;
play->msgCtx.ocarinaMode = OCARINA_MODE_04;
enMa1->actionFunc = func_80AA0D88;
enMa1->actionFunc = EnMa1_Idle;
enMa1->singingDisabled = 1;
enMa1->interactInfo.talkState = NPC_TALK_STATE_IDLE;
return;
@ -917,14 +917,14 @@ void TimeSaverOnActorInitHandler(void* actorRef) {
if (innerActor->id == ACTOR_EN_MA1 &&
(CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.LearnSong"), IS_RANDO) || IS_RANDO)) {
EnMa1* enMa1 = static_cast<EnMa1*>(innerActorRef);
if (enMa1->actionFunc == func_80AA106C) {
if (enMa1->actionFunc == EnMa1_StartTeachSong) {
enMa1->actionFunc = EnMa1_EndTeachSong;
GameInteractor::Instance->UnregisterGameHook<GameInteractor::OnActorUpdate>(enMa1UpdateHook);
GameInteractor::Instance->UnregisterGameHook<GameInteractor::OnSceneInit>(enMa1KillHook);
enMa1UpdateHook = 0;
enMa1KillHook = 0;
// They've already learned the song
} else if (enMa1->actionFunc == func_80AA0D88) {
} else if (enMa1->actionFunc == EnMa1_Idle) {
GameInteractor::Instance->UnregisterGameHook<GameInteractor::OnActorUpdate>(enMa1UpdateHook);
GameInteractor::Instance->UnregisterGameHook<GameInteractor::OnSceneInit>(enMa1KillHook);
enMa1UpdateHook = 0;

View file

@ -38,7 +38,7 @@ extern MapData* gMapData;
void func_8086ED70(BgBombwall* bgBombwall, PlayState* play);
void BgBreakwall_Wait(BgBreakwall* bgBreakwall, PlayState* play);
void func_80883000(BgHakaZou* bgHakaZou, PlayState* play);
void BgHakaZou_WaitForHit(BgHakaZou* bgHakaZou, PlayState* play);
void func_808887C4(BgHidanHamstep* bgHidanHamstep, PlayState* play);
void func_808896B8(BgHidanHrock* bgHidanHrock, PlayState* play);
void BgIceShelter_Idle(BgIceShelter* bgIceShelter, PlayState* play);
@ -217,7 +217,7 @@ void Anchor::RegisterHooks() {
COND_ID_HOOK(ShouldActorUpdate, ACTOR_BG_HAKA_ZOU, isConnected, [&](void* refActor, bool* should) {
BgHakaZou* actor = static_cast<BgHakaZou*>(refActor);
if (actor->actionFunc == func_80883000 && Flags_GetSwitch(gPlayState, actor->switchFlag)) {
if (actor->actionFunc == BgHakaZou_WaitForHit && Flags_GetSwitch(gPlayState, actor->switchFlag)) {
actor->collider.base.acFlags |= AC_HIT;
}
});

View file

@ -1472,7 +1472,7 @@ s32 func_8002DEEC(Player* player) {
}
void func_8002DF18(PlayState* play, Player* player) {
func_8006DC68(play, player);
Horse_InitPlayerHorse(play, player);
}
s32 func_8002DF38(PlayState* play, Actor* actor, u8 csAction) {

View file

@ -4,7 +4,7 @@
#include "soh/Enhancements/game-interactor/GameInteractor.h"
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
s32 func_8006CFC0(s32 scene) {
s32 Horse_CanSpawn(s32 scene) {
s32 validScenes[] = { SCENE_HYRULE_FIELD, SCENE_LAKE_HYLIA, SCENE_GERUDO_VALLEY, SCENE_GERUDOS_FORTRESS,
SCENE_LON_LON_RANCH };
s32 i;
@ -18,7 +18,7 @@ s32 func_8006CFC0(s32 scene) {
return 0;
}
void func_8006D074(PlayState* play) {
void Horse_ResetHorseData(PlayState* play) {
gSaveContext.horseData.scene = SCENE_HYRULE_FIELD;
gSaveContext.horseData.pos.x = -1840;
gSaveContext.horseData.pos.y = 72;
@ -26,7 +26,7 @@ void func_8006D074(PlayState* play) {
gSaveContext.horseData.angle = -27353;
}
void func_8006D0AC(PlayState* play) {
void Horse_FixLakeHyliaPosition(PlayState* play) {
if (gSaveContext.horseData.scene == SCENE_LAKE_HYLIA) {
gSaveContext.horseData.scene = SCENE_LAKE_HYLIA;
gSaveContext.horseData.pos.x = -2065;
@ -43,7 +43,7 @@ typedef struct {
/* 0x0A */ s16 type;
} HorseSpawn;
void func_8006D0EC(PlayState* play, Player* player) {
void Horse_SetupInGameplay(PlayState* play, Player* player) {
s32 i;
HorseSpawn horseSpawns[] = {
{ SCENE_HYRULE_FIELD, -460, 100, 6640, 0, 2 }, { SCENE_LAKE_HYLIA, -1929, -1025, 768, 0, 2 },
@ -87,7 +87,7 @@ void func_8006D0EC(PlayState* play, Player* player) {
osSyncPrintf("馬存在によるセット %d %d %d\n", gSaveContext.horseData.scene,
Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED), DREG(1));
if (func_8006CFC0(gSaveContext.horseData.scene)) {
if (Horse_CanSpawn(gSaveContext.horseData.scene)) {
Actor* horseActor = Actor_Spawn(&play->actorCtx, play, ACTOR_EN_HORSE, gSaveContext.horseData.pos.x,
gSaveContext.horseData.pos.y, gSaveContext.horseData.pos.z, 0,
gSaveContext.horseData.angle, 0, 1);
@ -100,7 +100,7 @@ void func_8006D0EC(PlayState* play, Player* player) {
// "Horse_SetNormal():%d set spot is no good."
osSyncPrintf("Horse_SetNormal():%d セットスポットまずいです。\n", gSaveContext.horseData.scene);
osSyncPrintf(VT_RST);
func_8006D074(play);
Horse_ResetHorseData(play);
}
} else if ((play->sceneNum == SCENE_LON_LON_RANCH) && !Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED) &&
(DREG(1) == 0)) {
@ -136,7 +136,7 @@ typedef struct {
/* 0x10 */ s16 type;
} struct_8011F9B8;
void func_8006D684(PlayState* play, Player* player) {
void Horse_SetupInCutscene(PlayState* play, Player* player) {
s32 pad;
s32 i;
Vec3s spawnPos;
@ -247,17 +247,17 @@ void func_8006D684(PlayState* play, Player* player) {
}
}
void func_8006DC68(PlayState* play, Player* player) {
void Horse_InitPlayerHorse(PlayState* play, Player* player) {
if (LINK_IS_ADULT) {
if (!func_8006CFC0(gSaveContext.horseData.scene)) {
if (!Horse_CanSpawn(gSaveContext.horseData.scene)) {
osSyncPrintf(VT_COL(RED, WHITE));
// "Horse_Set_Check():%d set spot is no good."
osSyncPrintf("Horse_Set_Check():%d セットスポットまずいです。\n", gSaveContext.horseData.scene);
osSyncPrintf(VT_RST);
func_8006D074(play);
Horse_ResetHorseData(play);
}
if (func_8006CFC0(play->sceneNum)) {
if (Horse_CanSpawn(play->sceneNum)) {
if ((gSaveContext.sceneSetupIndex > 3) ||
((gSaveContext.entranceIndex == ENTR_HYRULE_FIELD_11 ||
gSaveContext.entranceIndex == ENTR_HYRULE_FIELD_12 ||
@ -266,15 +266,15 @@ void func_8006DC68(PlayState* play, Player* player) {
(gSaveContext.respawnFlag == 0)) ||
((play->sceneNum == SCENE_LON_LON_RANCH) && ((gSaveContext.eventInf[0] & 0xF) == 6) &&
!Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED) && (DREG(1) == 0))) {
func_8006D684(play, player);
Horse_SetupInCutscene(play, player);
} else {
func_8006D0EC(play, player);
Horse_SetupInGameplay(play, player);
}
}
}
}
void func_8006DD9C(Actor* actor, Vec3f* arg1, s16 arg2) {
void Horse_RotateToPoint(Actor* actor, Vec3f* arg1, s16 arg2) {
s16 x = Math_Vec3f_Yaw(&actor->world.pos, arg1) - actor->world.rot.y;
if (x > arg2) {

View file

@ -1912,7 +1912,7 @@ u8 Item_Give(PlayState* play, u8 item) {
osSyncPrintf(VT_RST);
if (item == ITEM_MEDALLION_WATER) {
func_8006D0AC(play);
Horse_FixLakeHyliaPosition(play);
}
return Return_Item(item, MOD_NONE, ITEM_NONE);

View file

@ -95,7 +95,7 @@ void ArmsHook_Wait(ArmsHook* this, PlayState* play) {
}
}
void func_80865044(ArmsHook* this) {
void ArmsHook_PullPlayer(ArmsHook* this) {
this->actor.child = this->actor.parent;
this->actor.parent->parent = &this->actor;
}
@ -178,7 +178,7 @@ void ArmsHook_Shoot(ArmsHook* this, PlayState* play) {
if (this->collider.info.atHitInfo->bumperFlags & BUMP_HOOKABLE) {
ArmsHook_AttachHookToActor(this, touchedActor);
if (CHECK_FLAG_ALL(touchedActor->flags, ACTOR_FLAG_HOOKSHOT_PULLS_PLAYER)) {
func_80865044(this);
ArmsHook_PullPlayer(this);
}
}
}
@ -279,7 +279,7 @@ void ArmsHook_Shoot(ArmsHook* this, PlayState* play) {
ArmsHook_AttachHookToActor(this, &dynaPolyActor->actor);
}
}
func_80865044(this);
ArmsHook_PullPlayer(this);
Audio_PlaySoundGeneral(NA_SE_IT_HOOKSHOT_STICK_OBJ, &this->actor.projectedPos, 4,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
} else {

View file

@ -14,22 +14,22 @@ void BgBdanObjects_Destroy(Actor* thisx, PlayState* play);
void BgBdanObjects_Update(Actor* thisx, PlayState* play);
void BgBdanObjects_Draw(Actor* thisx, PlayState* play);
void func_8086C054(BgBdanObjects* this, PlayState* play);
void func_8086C1A0(BgBdanObjects* this, PlayState* play);
void func_8086C29C(BgBdanObjects* this, PlayState* play);
void func_8086C55C(BgBdanObjects* this, PlayState* play);
void func_8086C5BC(BgBdanObjects* this, PlayState* play);
void func_8086C618(BgBdanObjects* this, PlayState* play);
void func_8086C6EC(BgBdanObjects* this, PlayState* play);
void func_8086C76C(BgBdanObjects* this, PlayState* play);
void func_8086C7D0(BgBdanObjects* this, PlayState* play);
void BgBdanObjects_OctoPlatform_WaitForRutoToStartCutscene(BgBdanObjects* this, PlayState* play);
void BgBdanObjects_OctoPlatform_RaiseToUpperPosition(BgBdanObjects* this, PlayState* play);
void BgBdanObjects_OctoPlatform_WaitForRutoToAdvanceCutscene(BgBdanObjects* this, PlayState* play);
void BgBdanObjects_OctoPlatform_PauseBeforeDescending(BgBdanObjects* this, PlayState* play);
void BgBdanObjects_OctoPlatform_WaitForBigOctoToStartBattle(BgBdanObjects* this, PlayState* play);
void BgBdanObjects_OctoPlatform_BattleInProgress(BgBdanObjects* this, PlayState* play);
void BgBdanObjects_SinkToFloorHeight(BgBdanObjects* this, PlayState* play);
void BgBdanObjects_WaitForPlayerInRange(BgBdanObjects* this, PlayState* play);
void BgBdanObjects_RaiseToUpperPosition(BgBdanObjects* this, PlayState* play);
void BgBdanObjects_DoNothing(BgBdanObjects* this, PlayState* play);
void func_8086C874(BgBdanObjects* this, PlayState* play);
void func_8086C9A8(BgBdanObjects* this, PlayState* play);
void func_8086C9F0(BgBdanObjects* this, PlayState* play);
void func_8086CABC(BgBdanObjects* this, PlayState* play);
void func_8086CB10(BgBdanObjects* this, PlayState* play);
void func_8086CB8C(BgBdanObjects* this, PlayState* play);
void BgBdanObjects_ElevatorOscillate(BgBdanObjects* this, PlayState* play);
void BgBdanObjects_WaitForSwitch(BgBdanObjects* this, PlayState* play);
void BgBdanObjects_ChangeWaterBoxLevel(BgBdanObjects* this, PlayState* play);
void BgBdanObjects_WaitForTimerExpired(BgBdanObjects* this, PlayState* play);
void BgBdanObjects_WaitForPlayerOnTop(BgBdanObjects* this, PlayState* play);
void BgBdanObjects_FallToLowerPos(BgBdanObjects* this, PlayState* play);
const ActorInit Bg_Bdan_Objects_InitVars = {
ACTOR_BG_BDAN_OBJECTS,
@ -117,7 +117,7 @@ void BgBdanObjects_Init(Actor* thisx, PlayState* play) {
if (thisx->params == 2) {
thisx->flags |= ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_DRAW_CULLING_DISABLED;
play->colCtx.colHeader->waterBoxes[7].ySurface = thisx->world.pos.y;
this->actionFunc = func_8086C9A8;
this->actionFunc = BgBdanObjects_WaitForSwitch;
return;
}
if (thisx->params == 0) {
@ -127,7 +127,7 @@ void BgBdanObjects_Init(Actor* thisx, PlayState* play) {
thisx->world.pos.y += -79.0f;
if (Flags_GetClear(play, thisx->room)) {
Flags_SetSwitch(play, this->switchFlag);
this->actionFunc = func_8086C6EC;
this->actionFunc = BgBdanObjects_SinkToFloorHeight;
} else {
if (BgBdanObjects_GetContactRu1(this, 4)) {
if (Actor_SpawnAsChild(&play->actorCtx, &this->dyna.actor, play, ACTOR_EN_BIGOKUTA, thisx->home.pos.x,
@ -136,12 +136,12 @@ void BgBdanObjects_Init(Actor* thisx, PlayState* play) {
thisx->child->world.pos.z = thisx->child->home.pos.z + 263.0f;
}
thisx->world.rot.y = 0;
this->actionFunc = func_8086C618;
this->actionFunc = BgBdanObjects_OctoPlatform_BattleInProgress;
thisx->world.pos.y = thisx->home.pos.y + -70.0f;
} else {
Flags_SetSwitch(play, this->switchFlag);
this->timer = 0;
this->actionFunc = func_8086C054;
this->actionFunc = BgBdanObjects_OctoPlatform_WaitForRutoToStartCutscene;
}
}
} else {
@ -149,14 +149,14 @@ void BgBdanObjects_Init(Actor* thisx, PlayState* play) {
CollisionHeader_GetVirtual(&gJabuElevatorCol, &colHeader);
this->timer = 512;
this->switchFlag = 0;
this->actionFunc = func_8086C874;
this->actionFunc = BgBdanObjects_ElevatorOscillate;
} else {
CollisionHeader_GetVirtual(&gJabuLoweringPlatformCol, &colHeader);
if (Flags_GetSwitch(play, this->switchFlag)) {
this->actionFunc = BgBdanObjects_DoNothing;
thisx->world.pos.y = thisx->home.pos.y - 400.0f;
} else {
this->actionFunc = func_8086CB10;
this->actionFunc = BgBdanObjects_WaitForPlayerOnTop;
}
}
}
@ -172,7 +172,7 @@ void BgBdanObjects_Destroy(Actor* thisx, PlayState* play) {
}
}
void func_8086C054(BgBdanObjects* this, PlayState* play) {
void BgBdanObjects_OctoPlatform_WaitForRutoToStartCutscene(BgBdanObjects* this, PlayState* play) {
Player* player = GET_PLAYER(play);
if (BgBdanObjects_GetContactRu1(this, 0)) {
@ -190,7 +190,7 @@ void func_8086C054(BgBdanObjects* this, PlayState* play) {
this->timer--;
}
if (this->timer == 0) {
this->actionFunc = func_8086C1A0;
this->actionFunc = BgBdanObjects_OctoPlatform_RaiseToUpperPosition;
}
}
@ -201,11 +201,11 @@ void func_8086C054(BgBdanObjects* this, PlayState* play) {
}
}
void func_8086C1A0(BgBdanObjects* this, PlayState* play) {
void BgBdanObjects_OctoPlatform_RaiseToUpperPosition(BgBdanObjects* this, PlayState* play) {
if (Math_SmoothStepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y + 500.0f, 0.5f, 7.5f, 1.0f) <
0.1f) {
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BUYOSTAND_STOP_A);
this->actionFunc = func_8086C29C;
this->actionFunc = BgBdanObjects_OctoPlatform_WaitForRutoToAdvanceCutscene;
this->timer = 30;
BgBdanObjects_SetContactRu1(this, 2);
func_800AA000(0.0f, 0xFF, 0x14, 0x96);
@ -221,7 +221,7 @@ void func_8086C1A0(BgBdanObjects* this, PlayState* play) {
}
}
void func_8086C29C(BgBdanObjects* this, PlayState* play) {
void BgBdanObjects_OctoPlatform_WaitForRutoToAdvanceCutscene(BgBdanObjects* this, PlayState* play) {
s32 temp;
if (this->timer != 0) {
@ -240,12 +240,12 @@ void func_8086C29C(BgBdanObjects* this, PlayState* play) {
this->dyna.actor.shape.rot.y + 0x8000, 0, 0);
BgBdanObjects_SetContactRu1(this, 4);
this->timer = 10;
this->actionFunc = func_8086C55C;
this->actionFunc = BgBdanObjects_OctoPlatform_PauseBeforeDescending;
func_8005B1A4(GET_ACTIVE_CAM(play));
}
}
void func_8086C3D8(BgBdanObjects* this, PlayState* play) {
void BgBdanObjects_OctoPlatform_DescendWithBigOcto(BgBdanObjects* this, PlayState* play) {
Player* player = GET_PLAYER(play);
this->dyna.actor.velocity.y += 0.5f;
@ -255,7 +255,7 @@ void func_8086C3D8(BgBdanObjects* this, PlayState* play) {
this->timer = 60;
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BUYOSTAND_STOP_U);
this->dyna.actor.child->world.pos.y = this->dyna.actor.world.pos.y + 140.0f;
this->actionFunc = func_8086C5BC;
this->actionFunc = BgBdanObjects_OctoPlatform_WaitForBigOctoToStartBattle;
OnePointCutscene_Init(play, 3080, -99, this->dyna.actor.child, MAIN_CAM);
player->actor.world.pos.x = -1130.0f;
player->actor.world.pos.y = -1025.0f;
@ -278,63 +278,63 @@ void func_8086C3D8(BgBdanObjects* this, PlayState* play) {
}
}
void func_8086C55C(BgBdanObjects* this, PlayState* play) {
void BgBdanObjects_OctoPlatform_PauseBeforeDescending(BgBdanObjects* this, PlayState* play) {
this->timer--;
if (this->timer == 0) {
Flags_UnsetSwitch(play, this->switchFlag);
} else if (this->timer == -40) {
this->timer = 0;
this->actionFunc = func_8086C3D8;
this->actionFunc = BgBdanObjects_OctoPlatform_DescendWithBigOcto;
}
}
void func_8086C5BC(BgBdanObjects* this, PlayState* play) {
void BgBdanObjects_OctoPlatform_WaitForBigOctoToStartBattle(BgBdanObjects* this, PlayState* play) {
if (this->timer != 0) {
this->timer--;
}
if ((this->timer == 0) && (this->dyna.actor.child != NULL)) {
if (this->dyna.actor.child->params == 2) {
this->actionFunc = func_8086C618;
this->actionFunc = BgBdanObjects_OctoPlatform_BattleInProgress;
} else if (this->dyna.actor.child->params == 0) {
this->dyna.actor.child->params = 1;
}
}
}
void func_8086C618(BgBdanObjects* this, PlayState* play) {
void BgBdanObjects_OctoPlatform_BattleInProgress(BgBdanObjects* this, PlayState* play) {
Collider_UpdateCylinder(&this->dyna.actor, &this->collider);
CollisionCheck_SetAT(play, &play->colChkCtx, &this->collider.base);
if (Flags_GetClear(play, this->dyna.actor.room)) {
Flags_SetSwitch(play, this->switchFlag);
this->dyna.actor.home.rot.y = (s16)(this->dyna.actor.shape.rot.y + 0x2000) & 0xC000;
this->actionFunc = func_8086C6EC;
this->actionFunc = BgBdanObjects_SinkToFloorHeight;
} else {
this->dyna.actor.shape.rot.y += this->dyna.actor.world.rot.y;
func_800F436C(&this->dyna.actor.projectedPos, 0x2063, ABS(this->dyna.actor.world.rot.y) / 512.0f);
}
}
void func_8086C6EC(BgBdanObjects* this, PlayState* play) {
void BgBdanObjects_SinkToFloorHeight(BgBdanObjects* this, PlayState* play) {
s32 cond = Math_ScaledStepToS(&this->dyna.actor.shape.rot.y, this->dyna.actor.home.rot.y, 0x200);
if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y + -125.0f, 3.0f)) {
if (cond) {
this->actionFunc = func_8086C76C;
this->actionFunc = BgBdanObjects_WaitForPlayerInRange;
}
}
}
void func_8086C76C(BgBdanObjects* this, PlayState* play) {
void BgBdanObjects_WaitForPlayerInRange(BgBdanObjects* this, PlayState* play) {
if (DynaPolyActor_IsPlayerOnTop(&this->dyna)) {
if (this->dyna.actor.xzDistToPlayer < 120.0f) {
this->actionFunc = func_8086C7D0;
this->actionFunc = BgBdanObjects_RaiseToUpperPosition;
OnePointCutscene_Init(play, 3090, -99, &this->dyna.actor, MAIN_CAM);
}
}
}
void func_8086C7D0(BgBdanObjects* this, PlayState* play) {
void BgBdanObjects_RaiseToUpperPosition(BgBdanObjects* this, PlayState* play) {
if (Math_SmoothStepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y + 965.0f, 0.5f, 15.0f, 0.2f) <
0.01f) {
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BUYOSTAND_STOP_A);
@ -347,7 +347,7 @@ void func_8086C7D0(BgBdanObjects* this, PlayState* play) {
void BgBdanObjects_DoNothing(BgBdanObjects* this, PlayState* play) {
}
void func_8086C874(BgBdanObjects* this, PlayState* play) {
void BgBdanObjects_ElevatorOscillate(BgBdanObjects* this, PlayState* play) {
if (this->timer != 0) {
this->timer--;
}
@ -377,50 +377,50 @@ void func_8086C874(BgBdanObjects* this, PlayState* play) {
}
}
void func_8086C9A8(BgBdanObjects* this, PlayState* play) {
void BgBdanObjects_WaitForSwitch(BgBdanObjects* this, PlayState* play) {
if (Flags_GetSwitch(play, this->switchFlag)) {
this->timer = 100;
this->actionFunc = func_8086C9F0;
this->actionFunc = BgBdanObjects_ChangeWaterBoxLevel;
}
}
void func_8086C9F0(BgBdanObjects* this, PlayState* play) {
void BgBdanObjects_ChangeWaterBoxLevel(BgBdanObjects* this, PlayState* play) {
if (this->timer == 0) {
if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y, 0.5f)) {
Flags_UnsetSwitch(play, this->switchFlag);
this->actionFunc = func_8086C9A8;
this->actionFunc = BgBdanObjects_WaitForSwitch;
}
func_8002F948(&this->dyna.actor, NA_SE_EV_WATER_LEVEL_DOWN - SFX_FLAG);
} else {
if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y + 75.0f, 0.5f)) {
this->actionFunc = func_8086CABC;
this->actionFunc = BgBdanObjects_WaitForTimerExpired;
}
func_8002F948(&this->dyna.actor, NA_SE_EV_WATER_LEVEL_DOWN - SFX_FLAG);
}
play->colCtx.colHeader->waterBoxes[7].ySurface = this->dyna.actor.world.pos.y;
}
void func_8086CABC(BgBdanObjects* this, PlayState* play) {
void BgBdanObjects_WaitForTimerExpired(BgBdanObjects* this, PlayState* play) {
if (this->timer != 0) {
this->timer--;
}
func_8002F994(&this->dyna.actor, this->timer);
if (this->timer == 0) {
this->actionFunc = func_8086C9F0;
this->actionFunc = BgBdanObjects_ChangeWaterBoxLevel;
}
}
void func_8086CB10(BgBdanObjects* this, PlayState* play) {
void BgBdanObjects_WaitForPlayerOnTop(BgBdanObjects* this, PlayState* play) {
if (DynaPolyActor_IsPlayerOnTop(&this->dyna)) {
Flags_SetSwitch(play, this->switchFlag);
this->timer = 50;
this->actionFunc = func_8086CB8C;
this->actionFunc = BgBdanObjects_FallToLowerPos;
this->dyna.actor.home.pos.y -= 200.0f;
OnePointCutscene_Init(play, 3100, 51, &this->dyna.actor, MAIN_CAM);
}
}
void func_8086CB8C(BgBdanObjects* this, PlayState* play) {
void BgBdanObjects_FallToLowerPos(BgBdanObjects* this, PlayState* play) {
if (this->timer != 0) {
this->timer--;
}
@ -447,7 +447,7 @@ void BgBdanObjects_Draw(Actor* thisx, PlayState* play) {
BgBdanObjects* this = (BgBdanObjects*)thisx;
if (thisx->params == 0) {
if (this->actionFunc == func_8086C054) {
if (this->actionFunc == BgBdanObjects_OctoPlatform_WaitForRutoToStartCutscene) {
if (((thisx->home.pos.y + -79.0f) - 5.0f) < thisx->world.pos.y) {
Matrix_Translate(0.0f, -50.0f, 0.0f, MTXMODE_APPLY);
}

View file

@ -15,11 +15,11 @@ void BgHaka_Destroy(Actor* thisx, PlayState* play);
void BgHaka_Update(Actor* thisx, PlayState* play);
void BgHaka_Draw(Actor* thisx, PlayState* play);
void func_8087B758(BgHaka* this, Player* player);
void func_8087B7E8(BgHaka* this, PlayState* play);
void func_8087B938(BgHaka* this, PlayState* play);
void func_8087BAAC(BgHaka* this, PlayState* play);
void func_8087BAE4(BgHaka* this, PlayState* play);
void BgHaka_CheckPlayerOnDirtPatch(BgHaka* this, Player* player);
void BgHaka_IdleClosed(BgHaka* this, PlayState* play);
void BgHaka_Pull(BgHaka* this, PlayState* play);
void BgHaka_IdleOpened(BgHaka* this, PlayState* play);
void BgHaka_IdleLockedClosed(BgHaka* this, PlayState* play);
const ActorInit Bg_Haka_InitVars = {
ACTOR_BG_HAKA,
@ -48,7 +48,7 @@ void BgHaka_Init(Actor* thisx, PlayState* play) {
DynaPolyActor_Init(&this->dyna, DPM_UNK);
CollisionHeader_GetVirtual(&gGravestoneCol, &colHeader);
this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader);
this->actionFunc = func_8087B7E8;
this->actionFunc = BgHaka_IdleClosed;
}
void BgHaka_Destroy(Actor* thisx, PlayState* play) {
@ -57,7 +57,7 @@ void BgHaka_Destroy(Actor* thisx, PlayState* play) {
DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId);
}
void func_8087B758(BgHaka* this, Player* player) {
void BgHaka_CheckPlayerOnDirtPatch(BgHaka* this, Player* player) {
Vec3f sp1C;
Actor_WorldToActorCoords(&this->dyna.actor, &sp1C, &player->actor.world.pos);
@ -66,7 +66,7 @@ void func_8087B758(BgHaka* this, Player* player) {
}
}
void func_8087B7E8(BgHaka* this, PlayState* play) {
void BgHaka_IdleClosed(BgHaka* this, PlayState* play) {
Player* player = GET_PLAYER(play);
if (this->dyna.unk_150 != 0.0f) {
@ -77,7 +77,7 @@ void func_8087B7E8(BgHaka* this, PlayState* play) {
if (!Play_InCsMode(play)) {
Message_StartTextbox(play, 0x5073, NULL);
this->dyna.actor.params = 100;
this->actionFunc = func_8087BAE4;
this->actionFunc = BgHaka_IdleLockedClosed;
}
} else if (0.0f < this->dyna.unk_150 ||
(play->sceneNum == SCENE_LAKE_HYLIA && !LINK_IS_ADULT && !Flags_GetSwitch(play, 0x23))) {
@ -85,13 +85,13 @@ void func_8087B7E8(BgHaka* this, PlayState* play) {
player->stateFlags2 &= ~PLAYER_STATE2_MOVING_DYNAPOLY;
} else {
this->dyna.actor.world.rot.y = this->dyna.actor.shape.rot.y + 0x8000;
this->actionFunc = func_8087B938;
this->actionFunc = BgHaka_Pull;
}
}
func_8087B758(this, player);
BgHaka_CheckPlayerOnDirtPatch(this, player);
}
void func_8087B938(BgHaka* this, PlayState* play) {
void BgHaka_Pull(BgHaka* this, PlayState* play) {
Player* player = GET_PLAYER(play);
s32 sp38;
@ -137,12 +137,12 @@ void func_8087B938(BgHaka* this, PlayState* play) {
}
}
this->actionFunc = func_8087BAAC;
this->actionFunc = BgHaka_IdleOpened;
}
func_8002F974(&this->dyna.actor, NA_SE_EV_ROCK_SLIDE - SFX_FLAG);
}
void func_8087BAAC(BgHaka* this, PlayState* play) {
void BgHaka_IdleOpened(BgHaka* this, PlayState* play) {
Player* player = GET_PLAYER(play);
if (this->dyna.unk_150 != 0.0f) {
@ -151,7 +151,7 @@ void func_8087BAAC(BgHaka* this, PlayState* play) {
}
}
void func_8087BAE4(BgHaka* this, PlayState* play) {
void BgHaka_IdleLockedClosed(BgHaka* this, PlayState* play) {
Player* player = GET_PLAYER(play);
s32 pad;
@ -163,9 +163,9 @@ void func_8087BAE4(BgHaka* this, PlayState* play) {
player->stateFlags2 &= ~PLAYER_STATE2_MOVING_DYNAPOLY;
}
if (this->dyna.actor.params == 0) {
this->actionFunc = func_8087B7E8;
this->actionFunc = BgHaka_IdleClosed;
}
func_8087B758(this, player);
BgHaka_CheckPlayerOnDirtPatch(this, player);
}
void BgHaka_Update(Actor* thisx, PlayState* play) {

View file

@ -15,8 +15,8 @@ void BgHakaMegane_Destroy(Actor* thisx, PlayState* play);
void BgHakaMegane_Update(Actor* thisx, PlayState* play);
void BgHakaMegane_Draw(Actor* thisx, PlayState* play);
void func_8087DB24(BgHakaMegane* this, PlayState* play);
void func_8087DBF0(BgHakaMegane* this, PlayState* play);
void BgHakaMegane_WaitForObject(BgHakaMegane* this, PlayState* play);
void BgHakaMegane_UpdateState(BgHakaMegane* this, PlayState* play);
void BgHakaMegane_DoNothing(BgHakaMegane* this, PlayState* play);
const ActorInit Bg_Haka_Megane_InitVars = {
@ -75,7 +75,7 @@ void BgHakaMegane_Init(Actor* thisx, PlayState* play) {
if (this->objBankIndex < 0) {
Actor_Kill(thisx);
} else {
this->actionFunc = func_8087DB24;
this->actionFunc = BgHakaMegane_WaitForObject;
}
}
@ -85,7 +85,7 @@ void BgHakaMegane_Destroy(Actor* thisx, PlayState* play) {
DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId);
}
void func_8087DB24(BgHakaMegane* this, PlayState* play) {
void BgHakaMegane_WaitForObject(BgHakaMegane* this, PlayState* play) {
CollisionHeader* colHeader;
CollisionHeader* collision;
@ -94,7 +94,7 @@ void func_8087DB24(BgHakaMegane* this, PlayState* play) {
this->dyna.actor.draw = BgHakaMegane_Draw;
Actor_SetObjectDependency(play, &this->dyna.actor);
if (play->roomCtx.curRoom.lensMode != LENS_MODE_HIDE_ACTORS) {
this->actionFunc = func_8087DBF0;
this->actionFunc = BgHakaMegane_UpdateState;
collision = sCollisionHeaders[this->dyna.actor.params];
if (collision != NULL) {
CollisionHeader_GetVirtual(collision, &colHeader);
@ -106,7 +106,7 @@ void func_8087DB24(BgHakaMegane* this, PlayState* play) {
}
}
void func_8087DBF0(BgHakaMegane* this, PlayState* play) {
void BgHakaMegane_UpdateState(BgHakaMegane* this, PlayState* play) {
Actor* thisx = &this->dyna.actor;
if (play->actorCtx.lensActive) {

View file

@ -14,14 +14,14 @@ void BgHakaMeganeBG_Destroy(Actor* thisx, PlayState* play);
void BgHakaMeganeBG_Update(Actor* thisx, PlayState* play);
void BgHakaMeganeBG_Draw(Actor* thisx, PlayState* play);
void func_8087DFF8(BgHakaMeganeBG* this, PlayState* play);
void func_8087E040(BgHakaMeganeBG* this, PlayState* play);
void func_8087E10C(BgHakaMeganeBG* this, PlayState* play);
void func_8087E1E0(BgHakaMeganeBG* this, PlayState* play);
void func_8087E258(BgHakaMeganeBG* this, PlayState* play);
void func_8087E288(BgHakaMeganeBG* this, PlayState* play);
void func_8087E2D8(BgHakaMeganeBG* this, PlayState* play);
void func_8087E34C(BgHakaMeganeBG* this, PlayState* play);
void BgHakaMeganeBG_HiddenMovingPlatform_Idle(BgHakaMeganeBG* this, PlayState* play);
void BgHakaMeganeBG_HiddenMovingPlatform_Move(BgHakaMeganeBG* this, PlayState* play);
void BgHakaMeganeBG_ElevatorPlatform_Drop(BgHakaMeganeBG* this, PlayState* play);
void BgHakaMeganeBG_ElevatorPlatform_Raise(BgHakaMeganeBG* this, PlayState* play);
void BgHakaMeganeBG_RotatingPlatform_Spin(BgHakaMeganeBG* this, PlayState* play);
void BgHakaMeganeBG_Gate_WaitForSwitchFlag(BgHakaMeganeBG* this, PlayState* play);
void BgHakaMeganeBG_Gate_Open(BgHakaMeganeBG* this, PlayState* play);
void BgHakaMeganeBG_DoNothing(BgHakaMeganeBG* this, PlayState* play);
const ActorInit Bg_Haka_MeganeBG_InitVars = {
ACTOR_BG_HAKA_MEGANEBG,
@ -67,7 +67,7 @@ void BgHakaMeganeBG_Init(Actor* thisx, PlayState* play) {
DynaPolyActor_Init(&this->dyna, DPM_UNK3);
thisx->flags |= ACTOR_FLAG_UPDATE_CULLING_DISABLED;
CollisionHeader_GetVirtual(&object_haka_objects_Col_005334, &colHeader);
this->actionFunc = func_8087E258;
this->actionFunc = BgHakaMeganeBG_RotatingPlatform_Spin;
} else {
DynaPolyActor_Init(&this->dyna, DPM_PLAYER);
@ -75,22 +75,22 @@ void BgHakaMeganeBG_Init(Actor* thisx, PlayState* play) {
CollisionHeader_GetVirtual(&object_haka_objects_Col_009168, &colHeader);
thisx->flags |= ACTOR_FLAG_REACT_TO_LENS;
this->timer = 20;
this->actionFunc = func_8087DFF8;
this->actionFunc = BgHakaMeganeBG_HiddenMovingPlatform_Idle;
} else if (thisx->params == 3) {
CollisionHeader_GetVirtual(&object_haka_objects_Col_000118, &colHeader);
thisx->home.pos.y += 100.0f;
if (Flags_GetSwitch(play, this->switchFlag)) {
this->actionFunc = func_8087E34C;
this->actionFunc = BgHakaMeganeBG_DoNothing;
thisx->world.pos.y = thisx->home.pos.y;
} else {
thisx->flags |= ACTOR_FLAG_UPDATE_CULLING_DISABLED;
this->actionFunc = func_8087E288;
this->actionFunc = BgHakaMeganeBG_Gate_WaitForSwitchFlag;
}
} else {
CollisionHeader_GetVirtual(&object_haka_objects_Col_00A7F4, &colHeader);
this->timer = 80;
this->actionFunc = func_8087E10C;
this->actionFunc = BgHakaMeganeBG_ElevatorPlatform_Drop;
thisx->uncullZoneScale = 3000.0f;
thisx->uncullZoneDownward = 3000.0f;
}
@ -105,7 +105,7 @@ void BgHakaMeganeBG_Destroy(Actor* thisx, PlayState* play) {
DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId);
}
void func_8087DFF8(BgHakaMeganeBG* this, PlayState* play) {
void BgHakaMeganeBG_HiddenMovingPlatform_Idle(BgHakaMeganeBG* this, PlayState* play) {
if (this->timer != 0) {
this->timer--;
}
@ -113,11 +113,11 @@ void func_8087DFF8(BgHakaMeganeBG* this, PlayState* play) {
if (this->timer == 0) {
this->timer = 40;
this->dyna.actor.world.rot.y += 0x8000;
this->actionFunc = func_8087E040;
this->actionFunc = BgHakaMeganeBG_HiddenMovingPlatform_Move;
}
}
void func_8087E040(BgHakaMeganeBG* this, PlayState* play) {
void BgHakaMeganeBG_HiddenMovingPlatform_Move(BgHakaMeganeBG* this, PlayState* play) {
f32 xSub;
if (this->timer != 0) {
@ -134,11 +134,11 @@ void func_8087E040(BgHakaMeganeBG* this, PlayState* play) {
if (this->timer == 0) {
this->timer = 20;
this->actionFunc = func_8087DFF8;
this->actionFunc = BgHakaMeganeBG_HiddenMovingPlatform_Idle;
}
}
void func_8087E10C(BgHakaMeganeBG* this, PlayState* play) {
void BgHakaMeganeBG_ElevatorPlatform_Drop(BgHakaMeganeBG* this, PlayState* play) {
this->dyna.actor.velocity.y += 1.0f;
if (this->dyna.actor.velocity.y > 20.0f) {
@ -158,12 +158,12 @@ void func_8087E10C(BgHakaMeganeBG* this, PlayState* play) {
if (this->timer == 0) {
this->timer = 120;
this->actionFunc = func_8087E1E0;
this->actionFunc = BgHakaMeganeBG_ElevatorPlatform_Raise;
this->dyna.actor.velocity.y = 0.0f;
}
}
void func_8087E1E0(BgHakaMeganeBG* this, PlayState* play) {
void BgHakaMeganeBG_ElevatorPlatform_Raise(BgHakaMeganeBG* this, PlayState* play) {
Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y, 16.0f / 3.0f);
func_8002F974(&this->dyna.actor, NA_SE_EV_BRIDGE_CLOSE - SFX_FLAG);
@ -173,34 +173,34 @@ void func_8087E1E0(BgHakaMeganeBG* this, PlayState* play) {
if (this->timer == 0) {
this->timer = 80;
this->actionFunc = func_8087E10C;
this->actionFunc = BgHakaMeganeBG_ElevatorPlatform_Drop;
}
}
void func_8087E258(BgHakaMeganeBG* this, PlayState* play) {
void BgHakaMeganeBG_RotatingPlatform_Spin(BgHakaMeganeBG* this, PlayState* play) {
this->dyna.actor.shape.rot.y += 0x180;
func_8002F974(&this->dyna.actor, NA_SE_EV_ELEVATOR_MOVE - SFX_FLAG);
}
void func_8087E288(BgHakaMeganeBG* this, PlayState* play) {
void BgHakaMeganeBG_Gate_WaitForSwitchFlag(BgHakaMeganeBG* this, PlayState* play) {
if (Flags_GetSwitch(play, this->switchFlag)) {
OnePointCutscene_Attention(play, &this->dyna.actor);
this->actionFunc = func_8087E2D8;
this->actionFunc = BgHakaMeganeBG_Gate_Open;
}
}
void func_8087E2D8(BgHakaMeganeBG* this, PlayState* play) {
void BgHakaMeganeBG_Gate_Open(BgHakaMeganeBG* this, PlayState* play) {
Math_StepToF(&this->dyna.actor.speedXZ, 30.0f, 2.0f);
if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y, this->dyna.actor.speedXZ)) {
Actor_SetFocus(&this->dyna.actor, 50.0f);
this->actionFunc = func_8087E34C;
this->actionFunc = BgHakaMeganeBG_DoNothing;
} else {
func_8002F974(&this->dyna.actor, NA_SE_EV_METALDOOR_OPEN);
}
}
void func_8087E34C(BgHakaMeganeBG* this, PlayState* play) {
void BgHakaMeganeBG_DoNothing(BgHakaMeganeBG* this, PlayState* play) {
}
void BgHakaMeganeBG_Update(Actor* thisx, PlayState* play) {

View file

@ -15,18 +15,18 @@ void BgHakaTrap_Update(Actor* thisx, PlayState* play);
void BgHakaTrap_Draw(Actor* thisx, PlayState* play);
void BgHakaTrap_Reset(void);
void func_8087FFC0(BgHakaTrap* this, PlayState* play);
void func_808801B8(BgHakaTrap* this, PlayState* play);
void func_808802D8(BgHakaTrap* this, PlayState* play);
void func_80880484(BgHakaTrap* this, PlayState* play);
void func_808805C0(BgHakaTrap* this, PlayState* play);
void func_808806BC(BgHakaTrap* this, PlayState* play);
void func_808808F4(BgHakaTrap* this, PlayState* play);
void func_808809B0(BgHakaTrap* this, PlayState* play);
void func_808809E4(BgHakaTrap* this, PlayState* play, s16 arg2);
void func_80880AE8(BgHakaTrap* this, PlayState* play);
void func_80880C0C(BgHakaTrap* this, PlayState* play);
void func_80880D68(BgHakaTrap* this);
void BgHakaTrap_UpdateBodyColliderPos(BgHakaTrap* this, PlayState* play);
void BgHakaTrap_SpikedWall_CloseIn(BgHakaTrap* this, PlayState* play);
void BgHakaTrap_SpikedWall_Burn(BgHakaTrap* this, PlayState* play);
void BgHakaTrap_Guillotine_Fall(BgHakaTrap* this, PlayState* play);
void BgHakaTrap_Guillotine_Lift(BgHakaTrap* this, PlayState* play);
void BgHakaTrap_SpikedCrusher_Fall(BgHakaTrap* this, PlayState* play);
void BgHakaTrap_SpikedCrusher_Lift(BgHakaTrap* this, PlayState* play);
void BgHakaTrap_FanBlade_Idle(BgHakaTrap* this, PlayState* play);
void BgHakaTrap_FanBlade_UpdateFanRotation(BgHakaTrap* this, PlayState* play, s16 arg2);
void BgHakaTrap_FireBarrier_Idle(BgHakaTrap* this, PlayState* play);
void BgHakaTrap_FireBarrier_UpdateLayout(BgHakaTrap* this, PlayState* play);
void BgHakaTrap_GetSwitchFlag(BgHakaTrap* this);
UNK_TYPE D_80880F30 = 0;
@ -130,7 +130,7 @@ void BgHakaTrap_Init(Actor* thisx, PlayState* play) {
this->unk_16A = 1;
}
this->actionFunc = func_80880484;
this->actionFunc = BgHakaTrap_Guillotine_Fall;
} else {
DynaPolyActor_Init(&this->dyna, DPM_PLAYER);
thisx->flags |= ACTOR_FLAG_UPDATE_CULLING_DISABLED;
@ -140,11 +140,11 @@ void BgHakaTrap_Init(Actor* thisx, PlayState* play) {
this->timer = 30;
if (D_80881014 != 0) {
this->actionFunc = func_808808F4;
this->actionFunc = BgHakaTrap_SpikedCrusher_Lift;
D_80881014 = 0;
} else {
D_80881014 = 1;
this->actionFunc = func_808806BC;
this->actionFunc = BgHakaTrap_SpikedCrusher_Fall;
thisx->velocity.y = 0.5f;
}
@ -171,14 +171,14 @@ void BgHakaTrap_Init(Actor* thisx, PlayState* play) {
this->colliderCylinder.info.toucherFlags = this->colliderCylinder.info.toucherFlags;
this->colliderCylinder.info.toucherFlags |= TOUCH_SFX_WOOD;
this->actionFunc = func_808801B8;
this->actionFunc = BgHakaTrap_SpikedWall_CloseIn;
}
this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, thisx, colHeader);
}
} else {
this->timer = 40;
this->actionFunc = func_808809B0;
this->actionFunc = BgHakaTrap_FanBlade_Idle;
thisx->uncullZoneScale = 500.0f;
}
@ -203,7 +203,7 @@ void BgHakaTrap_Destroy(Actor* thisx, PlayState* play) {
Audio_StopSfxByPos(&this->chainLiftSfxPos);
}
void func_8087FFC0(BgHakaTrap* this, PlayState* play) {
void BgHakaTrap_UpdateBodyColliderPos(BgHakaTrap* this, PlayState* play) {
f32 cosine;
Vec3f sp28;
f32 sine;
@ -229,7 +229,7 @@ void func_8087FFC0(BgHakaTrap* this, PlayState* play) {
}
static UNK_TYPE D_80881018 = 0;
void func_808801B8(BgHakaTrap* this, PlayState* play) {
void BgHakaTrap_SpikedWall_CloseIn(BgHakaTrap* this, PlayState* play) {
Player* player = GET_PLAYER(play);
if ((D_80880F30 == 0) && (!Player_InCsMode(play))) {
@ -242,19 +242,19 @@ void func_808801B8(BgHakaTrap* this, PlayState* play) {
}
}
func_8087FFC0(this, play);
BgHakaTrap_UpdateBodyColliderPos(this, play);
if (this->colliderSpikes.base.acFlags & AC_HIT) {
this->timer = 20;
D_80880F30 = 1;
this->actionFunc = func_808802D8;
this->actionFunc = BgHakaTrap_SpikedWall_Burn;
} else if (D_80881018 == 3) {
D_80881018 = 4;
player->actor.bgCheckFlags |= 0x100;
}
}
void func_808802D8(BgHakaTrap* this, PlayState* play) {
void BgHakaTrap_SpikedWall_Burn(BgHakaTrap* this, PlayState* play) {
static Vec3f zeroVec = { 0.0f, 0.0f, 0.0f };
Vec3f vector;
f32 xScale;
@ -284,7 +284,7 @@ void func_808802D8(BgHakaTrap* this, PlayState* play) {
}
}
void func_80880484(BgHakaTrap* this, PlayState* play) {
void BgHakaTrap_Guillotine_Fall(BgHakaTrap* this, PlayState* play) {
s32 sp24;
s32 timer;
@ -310,17 +310,17 @@ void func_80880484(BgHakaTrap* this, PlayState* play) {
this->dyna.actor.velocity.y = 0.0f;
this->timer = (this->unk_16A) ? 10 : 40;
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_GUILLOTINE_UP);
this->actionFunc = func_808805C0;
this->actionFunc = BgHakaTrap_Guillotine_Lift;
}
func_8087FFC0(this, play);
BgHakaTrap_UpdateBodyColliderPos(this, play);
if (sp24 == 0) {
CollisionCheck_SetAT(play, &play->colChkCtx, &this->colliderCylinder.base);
}
}
void func_808805C0(BgHakaTrap* this, PlayState* play) {
void BgHakaTrap_Guillotine_Lift(BgHakaTrap* this, PlayState* play) {
if (this->timer != 0) {
this->timer--;
}
@ -343,13 +343,13 @@ void func_808805C0(BgHakaTrap* this, PlayState* play) {
this->timer = 20;
this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y;
this->dyna.actor.velocity.y = 0.1f;
this->actionFunc = func_80880484;
this->actionFunc = BgHakaTrap_Guillotine_Fall;
}
func_8087FFC0(this, play);
BgHakaTrap_UpdateBodyColliderPos(this, play);
}
void func_808806BC(BgHakaTrap* this, PlayState* play) {
void BgHakaTrap_SpikedCrusher_Fall(BgHakaTrap* this, PlayState* play) {
Vec3f vector;
f32 tempf20;
f32 temp;
@ -396,11 +396,11 @@ void func_808806BC(BgHakaTrap* this, PlayState* play) {
this->unk_16A = (s16)this->dyna.actor.world.pos.y + 50.0f;
this->unk_16A = CLAMP_MAX(this->unk_16A, this->dyna.actor.home.pos.y);
this->actionFunc = func_808808F4;
this->actionFunc = BgHakaTrap_SpikedCrusher_Lift;
}
}
void func_808808F4(BgHakaTrap* this, PlayState* play) {
void BgHakaTrap_SpikedCrusher_Lift(BgHakaTrap* this, PlayState* play) {
if (this->timer != 0) {
this->timer--;
}
@ -416,21 +416,21 @@ void func_808808F4(BgHakaTrap* this, PlayState* play) {
this->timer = 30;
this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y;
this->dyna.actor.velocity.y = 0.5f;
this->actionFunc = func_808806BC;
this->actionFunc = BgHakaTrap_SpikedCrusher_Fall;
}
}
void func_808809B0(BgHakaTrap* this, PlayState* play) {
void BgHakaTrap_FanBlade_Idle(BgHakaTrap* this, PlayState* play) {
if (this->timer != 0) {
this->timer -= 1;
}
if (this->timer == 0) {
this->actionFunc = func_80880AE8;
this->actionFunc = BgHakaTrap_FireBarrier_Idle;
}
}
void func_808809E4(BgHakaTrap* this, PlayState* play, s16 arg2) {
void BgHakaTrap_FanBlade_UpdateFanRotation(BgHakaTrap* this, PlayState* play, s16 arg2) {
Player* player = GET_PLAYER(play);
Vec3f sp18;
@ -443,16 +443,16 @@ void func_808809E4(BgHakaTrap* this, PlayState* play, s16 arg2) {
}
}
void func_80880AE8(BgHakaTrap* this, PlayState* play) {
void BgHakaTrap_FireBarrier_Idle(BgHakaTrap* this, PlayState* play) {
if (this->timer != 0) {
if (Math_ScaledStepToS(&this->dyna.actor.world.rot.z, 0, this->dyna.actor.world.rot.z * 0.03f + 5.0f)) {
this->timer = 40;
this->actionFunc = func_808809B0;
this->actionFunc = BgHakaTrap_FanBlade_Idle;
}
} else {
if (Math_ScaledStepToS(&this->dyna.actor.world.rot.z, 0x3A00, this->dyna.actor.world.rot.z * 0.03f + 5.0f)) {
this->timer = 100;
this->actionFunc = func_80880C0C;
this->actionFunc = BgHakaTrap_FireBarrier_UpdateLayout;
}
}
@ -461,10 +461,10 @@ void func_80880AE8(BgHakaTrap* this, PlayState* play) {
func_8002F974(&this->dyna.actor, NA_SE_EV_WIND_TRAP - SFX_FLAG);
}
func_808809E4(this, play, this->dyna.actor.world.rot.z);
BgHakaTrap_FanBlade_UpdateFanRotation(this, play, this->dyna.actor.world.rot.z);
}
void func_80880C0C(BgHakaTrap* this, PlayState* play) {
void BgHakaTrap_FireBarrier_UpdateLayout(BgHakaTrap* this, PlayState* play) {
if (this->timer != 0) {
this->timer--;
}
@ -473,11 +473,11 @@ void func_80880C0C(BgHakaTrap* this, PlayState* play) {
if (this->timer == 0) {
this->timer = 1;
this->actionFunc = func_80880AE8;
this->actionFunc = BgHakaTrap_FireBarrier_Idle;
}
this->dyna.actor.shape.rot.z += this->dyna.actor.world.rot.z;
func_808809E4(this, play, this->dyna.actor.world.rot.z);
BgHakaTrap_FanBlade_UpdateFanRotation(this, play, this->dyna.actor.world.rot.z);
}
void BgHakaTrap_Update(Actor* thisx, PlayState* play) {
@ -493,7 +493,7 @@ void BgHakaTrap_Update(Actor* thisx, PlayState* play) {
CollisionCheck_SetAC(play, &play->colChkCtx, &this->colliderCylinder.base);
CollisionCheck_SetOC(play, &play->colChkCtx, &this->colliderCylinder.base);
} else {
if (this->actionFunc == func_808801B8) {
if (this->actionFunc == BgHakaTrap_SpikedWall_CloseIn) {
CollisionCheck_SetAC(play, &play->colChkCtx, &this->colliderSpikes.base);
}
@ -502,7 +502,7 @@ void BgHakaTrap_Update(Actor* thisx, PlayState* play) {
}
}
void func_80880D68(BgHakaTrap* this) {
void BgHakaTrap_GetSwitchFlag(BgHakaTrap* this) {
Vec3f vec3;
Vec3f vec2;
Vec3f vec1;
@ -526,21 +526,21 @@ void BgHakaTrap_Draw(Actor* thisx, PlayState* play) {
s32 pad;
Vec3f sp2C;
if (this->actionFunc == func_808802D8) {
if (this->actionFunc == BgHakaTrap_SpikedWall_Burn) {
func_80026230(play, &D_8088103C, this->timer + 20, 0x28);
}
Gfx_DrawDListOpa(play, sDLists[this->dyna.actor.params]);
if (this->actionFunc == func_808801B8) {
func_80880D68(this);
if (this->actionFunc == BgHakaTrap_SpikedWall_CloseIn) {
BgHakaTrap_GetSwitchFlag(this);
}
if (this->actionFunc == func_808802D8) {
if (this->actionFunc == BgHakaTrap_SpikedWall_Burn) {
func_80026608(play);
}
if ((this->actionFunc == func_808808F4) && !this->isSpikedCrusherStationary) {
if ((this->actionFunc == BgHakaTrap_SpikedCrusher_Lift) && !this->isSpikedCrusherStationary) {
sp2C.x = this->dyna.actor.world.pos.x;
sp2C.z = this->dyna.actor.world.pos.z;
sp2C.y = this->dyna.actor.world.pos.y + 110.0f;

View file

@ -23,13 +23,13 @@ void BgHakaZou_Update(Actor* thisx, PlayState* play);
void BgHakaZou_Draw(Actor* thisx, PlayState* play);
void BgHakaZou_Wait(BgHakaZou* this, PlayState* play);
void func_80882BDC(BgHakaZou* this, PlayState* play);
void func_80883000(BgHakaZou* this, PlayState* play);
void func_80883104(BgHakaZou* this, PlayState* play);
void func_80883144(BgHakaZou* this, PlayState* play);
void func_80883254(BgHakaZou* this, PlayState* play);
void func_80883328(BgHakaZou* this, PlayState* play);
void func_808834D8(BgHakaZou* this, PlayState* play);
void BgHakaZou_CrumbleSkullWall(BgHakaZou* this, PlayState* play);
void BgHakaZou_WaitForHit(BgHakaZou* this, PlayState* play);
void BgHakaZou_IdleKill(BgHakaZou* this, PlayState* play);
void BgHakaZou_BirdStatueAnim_Explode(BgHakaZou* this, PlayState* play);
void BgHakaZou_BirdStatueAnim_Shear(BgHakaZou* this, PlayState* play);
void BgHakaZou_BirdStatueAnim_Topple(BgHakaZou* this, PlayState* play);
void BgHakaZou_BirdStatueAnim_Settle(BgHakaZou* this, PlayState* play);
void BgHakaZou_DoNothing(BgHakaZou* this, PlayState* play);
static ColliderCylinderInit sCylinderInit = {
@ -164,7 +164,7 @@ void BgHakaZou_Wait(BgHakaZou* this, PlayState* play) {
this->dyna.actor.draw = BgHakaZou_Draw;
if (this->dyna.actor.params == STA_UNKNOWN) {
this->actionFunc = func_80882BDC;
this->actionFunc = BgHakaZou_CrumbleSkullWall;
} else {
Actor_SetObjectDependency(play, &this->dyna.actor);
@ -192,12 +192,12 @@ void BgHakaZou_Wait(BgHakaZou* this, PlayState* play) {
if ((this->dyna.actor.params == STA_GIANT_BIRD_STATUE) && Flags_GetSwitch(play, this->switchFlag)) {
this->actionFunc = BgHakaZou_DoNothing;
} else {
this->actionFunc = func_80883000;
this->actionFunc = BgHakaZou_WaitForHit;
}
}
}
}
void func_80882BDC(BgHakaZou* this, PlayState* play) {
void BgHakaZou_CrumbleSkullWall(BgHakaZou* this, PlayState* play) {
if (this->timer != 0) {
this->timer--;
}
@ -221,7 +221,7 @@ void func_80882BDC(BgHakaZou* this, PlayState* play) {
}
}
void func_80882CC4(BgHakaZou* this, PlayState* play) {
void BgHakaZou_SpawnSkullWallRubble(BgHakaZou* this, PlayState* play) {
s32 i;
s32 j;
Vec3f actorSpawnPos;
@ -245,7 +245,7 @@ void func_80882CC4(BgHakaZou* this, PlayState* play) {
}
}
void func_80882E54(BgHakaZou* this, PlayState* play) {
void BgHakaZou_SpawnRubbleParticles(BgHakaZou* this, PlayState* play) {
Vec3f fragmentPos;
s32 i;
s32 j;
@ -267,32 +267,32 @@ void func_80882E54(BgHakaZou* this, PlayState* play) {
}
}
void func_80883000(BgHakaZou* this, PlayState* play) {
void BgHakaZou_WaitForHit(BgHakaZou* this, PlayState* play) {
if (this->collider.base.acFlags & AC_HIT) {
Flags_SetSwitch(play, this->switchFlag);
if (this->dyna.actor.params == STA_GIANT_BIRD_STATUE) {
this->timer = 20;
this->actionFunc = func_80883144;
this->actionFunc = BgHakaZou_BirdStatueAnim_Explode;
OnePointCutscene_Init(play, 3400, 999, &this->dyna.actor, MAIN_CAM);
} else if (this->dyna.actor.params == 2) {
func_80882E54(this, play);
BgHakaZou_SpawnRubbleParticles(this, play);
this->dyna.actor.draw = NULL;
this->timer = 1;
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_EXPLOSION);
this->actionFunc = func_80883104;
this->actionFunc = BgHakaZou_IdleKill;
} else {
func_80882CC4(this, play);
BgHakaZou_SpawnSkullWallRubble(this, play);
this->timer = 1;
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_WALL_BROKEN);
this->actionFunc = func_80883104;
this->actionFunc = BgHakaZou_IdleKill;
}
} else {
CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base);
}
}
void func_80883104(BgHakaZou* this, PlayState* play) {
void BgHakaZou_IdleKill(BgHakaZou* this, PlayState* play) {
if (this->timer != 0) {
this->timer--;
}
@ -302,7 +302,7 @@ void func_80883104(BgHakaZou* this, PlayState* play) {
}
}
void func_80883144(BgHakaZou* this, PlayState* play) {
void BgHakaZou_BirdStatueAnim_Explode(BgHakaZou* this, PlayState* play) {
Vec3f explosionPos;
if (this->timer != 0) {
@ -320,11 +320,11 @@ void func_80883144(BgHakaZou* this, PlayState* play) {
if (this->timer == 0) {
this->timer = 20;
this->actionFunc = func_80883254;
this->actionFunc = BgHakaZou_BirdStatueAnim_Shear;
}
}
void func_80883254(BgHakaZou* this, PlayState* play) {
void BgHakaZou_BirdStatueAnim_Shear(BgHakaZou* this, PlayState* play) {
f32 moveDist = (Rand_ZeroOne() * 0.5f) + 0.5f;
Math_StepToF(&this->dyna.actor.world.pos.z, this->dyna.actor.home.pos.z - 80.0f, 2.0f * moveDist);
@ -337,14 +337,14 @@ void func_80883254(BgHakaZou* this, PlayState* play) {
if (this->timer == 0) {
this->timer = 60;
this->dyna.actor.world.rot.x = 8;
this->actionFunc = func_80883328;
this->actionFunc = BgHakaZou_BirdStatueAnim_Topple;
}
} else {
func_808828F4(this, play);
}
}
void func_80883328(BgHakaZou* this, PlayState* play) {
void BgHakaZou_BirdStatueAnim_Topple(BgHakaZou* this, PlayState* play) {
Vec3f effectPos;
s32 i;
s32 j;
@ -368,11 +368,11 @@ void func_80883328(BgHakaZou* this, PlayState* play) {
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_STONE_BOUND);
this->timer = 25;
this->actionFunc = func_808834D8;
this->actionFunc = BgHakaZou_BirdStatueAnim_Settle;
}
}
void func_808834D8(BgHakaZou* this, PlayState* play) {
void BgHakaZou_BirdStatueAnim_Settle(BgHakaZou* this, PlayState* play) {
f32 moveDist;
if (this->timer != 0) {

View file

@ -14,9 +14,9 @@ void BgHidanFslift_Destroy(Actor* thisx, PlayState* play);
void BgHidanFslift_Update(Actor* thisx, PlayState* play);
void BgHidanFslift_Draw(Actor* thisx, PlayState* play);
void func_80886FCC(BgHidanFslift* this, PlayState* play);
void func_8088706C(BgHidanFslift* this, PlayState* play);
void func_808870D8(BgHidanFslift* this, PlayState* play);
void BgHidanFslift_Idle(BgHidanFslift* this, PlayState* play);
void BgHidanFslift_Descend(BgHidanFslift* this, PlayState* play);
void BgHidanFslift_Ascend(BgHidanFslift* this, PlayState* play);
const ActorInit Bg_Hidan_Fslift_InitVars = {
ACTOR_BG_HIDAN_FSLIFT,
@ -54,10 +54,10 @@ void BgHidanFslift_Init(Actor* thisx, PlayState* play) {
Actor_Kill(&this->dyna.actor);
return;
}
this->actionFunc = func_80886FCC;
this->actionFunc = BgHidanFslift_Idle;
}
void func_80886F24(BgHidanFslift* this) {
void BgHidanFslift_SetHookshotTargetPos(BgHidanFslift* this) {
if (this->dyna.actor.child != NULL && this->dyna.actor.child->update != NULL) {
this->dyna.actor.child->world.pos.x = this->dyna.actor.world.pos.x;
this->dyna.actor.child->world.pos.y = this->dyna.actor.world.pos.y + 40.0f;
@ -73,12 +73,12 @@ void BgHidanFslift_Destroy(Actor* thisx, PlayState* play) {
DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId);
}
void func_80886FB4(BgHidanFslift* this) {
void BgHidanFslift_SetupIdle(BgHidanFslift* this) {
this->timer = 40;
this->actionFunc = func_80886FCC;
this->actionFunc = BgHidanFslift_Idle;
}
void func_80886FCC(BgHidanFslift* this, PlayState* play) {
void BgHidanFslift_Idle(BgHidanFslift* this, PlayState* play) {
s32 heightBool;
if (this->timer) {
@ -91,35 +91,35 @@ void func_80886FCC(BgHidanFslift* this, PlayState* play) {
heightBool = true;
}
if (DynaPolyActor_IsPlayerAbove(&this->dyna) && (heightBool)) {
this->actionFunc = func_808870D8;
this->actionFunc = BgHidanFslift_Ascend;
} else if (!heightBool) {
this->actionFunc = func_8088706C;
this->actionFunc = BgHidanFslift_Descend;
}
}
}
void func_8088706C(BgHidanFslift* this, PlayState* play) {
void BgHidanFslift_Descend(BgHidanFslift* this, PlayState* play) {
if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y, 4.0f)) {
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND);
func_80886FB4(this);
BgHidanFslift_SetupIdle(this);
} else {
func_8002F974(&this->dyna.actor, NA_SE_EV_ELEVATOR_MOVE3 - SFX_FLAG);
}
func_80886F24(this);
BgHidanFslift_SetHookshotTargetPos(this);
}
void func_808870D8(BgHidanFslift* this, PlayState* play) {
void BgHidanFslift_Ascend(BgHidanFslift* this, PlayState* play) {
if (DynaPolyActor_IsPlayerAbove(&this->dyna)) {
if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y + 790.0f, 4.0f)) {
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND);
func_80886FB4(this);
BgHidanFslift_SetupIdle(this);
} else {
func_8002F974(&this->dyna.actor, NA_SE_EV_ELEVATOR_MOVE3 - SFX_FLAG);
}
} else {
func_80886FB4(this);
BgHidanFslift_SetupIdle(this);
}
func_80886F24(this);
BgHidanFslift_SetHookshotTargetPos(this);
}
void BgHidanFslift_Update(Actor* thisx, PlayState* play) {

View file

@ -21,9 +21,9 @@ void BgMizuMovebg_Destroy(Actor* thisx, PlayState* play);
void BgMizuMovebg_Update(Actor* thisx, PlayState* play);
void BgMizuMovebg_Draw(Actor* thisx, PlayState* play);
void func_8089E318(BgMizuMovebg* this, PlayState* play);
void func_8089E650(BgMizuMovebg* this, PlayState* play);
s32 func_8089E108(Path* pathList, Vec3f* pos, s32 pathId, s32 pointId);
void BgMizuMovebg_UpdateMain(BgMizuMovebg* this, PlayState* play);
void BgMizuMovebg_UpdateHookshotPlatform(BgMizuMovebg* this, PlayState* play);
s32 BgMizuMovebg_SetPosFromPath(Path* pathList, Vec3f* pos, s32 pathId, s32 pointId);
const ActorInit Bg_Mizu_Movebg_InitVars = {
ACTOR_BG_MIZU_MOVEBG,
@ -64,7 +64,7 @@ static Vec3f D_8089EBAC = { 0.0f, 80.0f, 23.0f };
static u8 D_8089EE40;
s32 func_8089DC30(PlayState* play) {
s32 BgMizuMovebg_GetDragonStatueBossRoomOffsetIndex(PlayState* play) {
s32 result;
if (Flags_GetSwitch(play, WATER_TEMPLE_WATER_F1_FLAG)) {
@ -103,7 +103,7 @@ void BgMizuMovebg_Init(Actor* thisx, PlayState* play) {
} else {
thisx->world.pos.y = temp;
}
((BgMizuMovebg*)thisx)->actionFunc = func_8089E318;
((BgMizuMovebg*)thisx)->actionFunc = BgMizuMovebg_UpdateMain;
break;
case 1:
temp = waterBoxes[2].ySurface + 15.0f;
@ -112,7 +112,7 @@ void BgMizuMovebg_Init(Actor* thisx, PlayState* play) {
} else {
thisx->world.pos.y = temp;
}
((BgMizuMovebg*)thisx)->actionFunc = func_8089E318;
((BgMizuMovebg*)thisx)->actionFunc = BgMizuMovebg_UpdateMain;
break;
case 2:
temp = waterBoxes[2].ySurface + 15.0f;
@ -121,11 +121,12 @@ void BgMizuMovebg_Init(Actor* thisx, PlayState* play) {
} else {
thisx->world.pos.y = temp;
}
((BgMizuMovebg*)thisx)->actionFunc = func_8089E318;
((BgMizuMovebg*)thisx)->actionFunc = BgMizuMovebg_UpdateMain;
break;
case 3:
thisx->world.pos.y = ((BgMizuMovebg*)thisx)->homeY + D_8089EB40[func_8089DC30(play)];
((BgMizuMovebg*)thisx)->actionFunc = func_8089E318;
thisx->world.pos.y =
((BgMizuMovebg*)thisx)->homeY + D_8089EB40[BgMizuMovebg_GetDragonStatueBossRoomOffsetIndex(play)];
((BgMizuMovebg*)thisx)->actionFunc = BgMizuMovebg_UpdateMain;
break;
case 4:
case 5:
@ -135,7 +136,7 @@ void BgMizuMovebg_Init(Actor* thisx, PlayState* play) {
} else {
thisx->world.pos.y = ((BgMizuMovebg*)thisx)->homeY;
}
((BgMizuMovebg*)thisx)->actionFunc = func_8089E318;
((BgMizuMovebg*)thisx)->actionFunc = BgMizuMovebg_UpdateMain;
break;
case 7:
((BgMizuMovebg*)thisx)->scrollAlpha1 = 160;
@ -144,8 +145,9 @@ void BgMizuMovebg_Init(Actor* thisx, PlayState* play) {
((BgMizuMovebg*)thisx)->scrollAlpha4 = 160;
waypointId = MOVEBG_POINT_ID(thisx->params);
((BgMizuMovebg*)thisx)->waypointId = waypointId;
func_8089E108(play->setupPathList, &thisx->world.pos, MOVEBG_PATH_ID(thisx->params), waypointId);
((BgMizuMovebg*)thisx)->actionFunc = func_8089E650;
BgMizuMovebg_SetPosFromPath(play->setupPathList, &thisx->world.pos, MOVEBG_PATH_ID(thisx->params),
waypointId);
((BgMizuMovebg*)thisx)->actionFunc = BgMizuMovebg_UpdateHookshotPlatform;
break;
}
@ -188,7 +190,7 @@ void BgMizuMovebg_Destroy(Actor* thisx, PlayState* play) {
}
}
s32 func_8089E108(Path* pathList, Vec3f* pos, s32 pathId, s32 pointId) {
s32 BgMizuMovebg_SetPosFromPath(Path* pathList, Vec3f* pos, s32 pathId, s32 pointId) {
Path* path = pathList;
Vec3s* point;
@ -202,7 +204,7 @@ s32 func_8089E108(Path* pathList, Vec3f* pos, s32 pathId, s32 pointId) {
return 0;
}
void func_8089E198(BgMizuMovebg* this, PlayState* play) {
void BgMizuMovebg_SetScrollAlphas(BgMizuMovebg* this, PlayState* play) {
f32 waterLevel = play->colCtx.colHeader->waterBoxes[2].ySurface;
if (waterLevel < WATER_TEMPLE_WATER_F1_Y) {
@ -235,13 +237,13 @@ void func_8089E198(BgMizuMovebg* this, PlayState* play) {
this->scrollAlpha4 = this->scrollAlpha3;
}
void func_8089E318(BgMizuMovebg* this, PlayState* play) {
void BgMizuMovebg_UpdateMain(BgMizuMovebg* this, PlayState* play) {
WaterBox* waterBoxes = play->colCtx.colHeader->waterBoxes;
f32 phi_f0;
s32 type;
Vec3f sp28;
func_8089E198(this, play);
BgMizuMovebg_SetScrollAlphas(this, play);
type = MOVEBG_TYPE(this->dyna.actor.params);
switch (type) {
@ -263,7 +265,7 @@ void func_8089E318(BgMizuMovebg* this, PlayState* play) {
}
break;
case 3:
phi_f0 = this->homeY + D_8089EB40[func_8089DC30(play)];
phi_f0 = this->homeY + D_8089EB40[BgMizuMovebg_GetDragonStatueBossRoomOffsetIndex(play)];
if (!Math_StepToF(&this->dyna.actor.world.pos.y, phi_f0, 1.0f)) {
if (!(D_8089EE40 & 2) && MOVEBG_SPEED(this->dyna.actor.params) != 0) {
D_8089EE40 |= 2;
@ -316,7 +318,7 @@ void func_8089E318(BgMizuMovebg* this, PlayState* play) {
}
}
void func_8089E650(BgMizuMovebg* this, PlayState* play) {
void BgMizuMovebg_UpdateHookshotPlatform(BgMizuMovebg* this, PlayState* play) {
Vec3f waypoint;
f32 dist;
f32 dx;
@ -324,7 +326,8 @@ void func_8089E650(BgMizuMovebg* this, PlayState* play) {
f32 dz;
this->dyna.actor.speedXZ = MOVEBG_SPEED(this->dyna.actor.params) * 0.1f;
func_8089E108(play->setupPathList, &waypoint, MOVEBG_PATH_ID(this->dyna.actor.params), this->waypointId);
BgMizuMovebg_SetPosFromPath(play->setupPathList, &waypoint, MOVEBG_PATH_ID(this->dyna.actor.params),
this->waypointId);
dist = Actor_WorldDistXYZToPoint(&this->dyna.actor, &waypoint);
if (dist < this->dyna.actor.speedXZ) {
this->dyna.actor.speedXZ = dist;
@ -338,7 +341,8 @@ void func_8089E650(BgMizuMovebg* this, PlayState* play) {
this->waypointId++;
if (this->waypointId >= play->setupPathList[MOVEBG_PATH_ID(this->dyna.actor.params)].count) {
this->waypointId = 0;
func_8089E108(play->setupPathList, &this->dyna.actor.world.pos, MOVEBG_PATH_ID(this->dyna.actor.params), 0);
BgMizuMovebg_SetPosFromPath(play->setupPathList, &this->dyna.actor.world.pos,
MOVEBG_PATH_ID(this->dyna.actor.params), 0);
}
}
if (!(D_8089EE40 & 1) && MOVEBG_SPEED(this->dyna.actor.params) != 0) {

View file

@ -71,7 +71,7 @@ void func_808B3960(BgSpot15Rrbox* this, PlayState* play, CollisionHeader* collis
}
}
void func_808B39E8(Vec3f* arg0, Vec3f* arg1, f32 arg2, f32 arg3) {
void BgSpot15Rrbox_RotatePoint(Vec3f* arg0, Vec3f* arg1, f32 arg2, f32 arg3) {
arg0->x = (arg1->z * arg2) + (arg1->x * arg3);
arg0->y = arg1->y;
arg0->z = (arg1->z * arg3) - (arg1->x * arg2);
@ -141,7 +141,7 @@ void BgSpot15Rrbox_Destroy(Actor* thisx, PlayState* play) {
D_808B4590 = 0;
}
s32 func_808B3CA0(BgSpot15Rrbox* this, PlayState* play, s32 arg2) {
s32 BgSpot15Rrbox_TrySnapToCheckedPoint(BgSpot15Rrbox* this, PlayState* play, s32 arg2) {
f32 chkDist = 0.0f;
Vec3f actorPosition;
Vec3f actorScale;
@ -152,7 +152,7 @@ s32 func_808B3CA0(BgSpot15Rrbox* this, PlayState* play, s32 arg2) {
actorScale.y = D_808B45DC[arg2].y * (this->dyna.actor.scale.y * 10.0f);
actorScale.z = D_808B45DC[arg2].z * (this->dyna.actor.scale.z * 10.0f);
func_808B39E8(&actorPosition, &actorScale, this->unk_16C, this->unk_170);
BgSpot15Rrbox_RotatePoint(&actorPosition, &actorScale, this->unk_16C, this->unk_170);
actorPosition.x += this->dyna.actor.world.pos.x;
actorPosition.y += this->dyna.actor.prevPos.y;
@ -168,7 +168,7 @@ s32 func_808B3CA0(BgSpot15Rrbox* this, PlayState* play, s32 arg2) {
return false;
}
f32 func_808B3DDC(BgSpot15Rrbox* this, PlayState* play) {
f32 BgSpot15Rrbox_GetFloorHeight(BgSpot15Rrbox* this, PlayState* play) {
s32 i;
Vec3f position;
Vec3f scale;
@ -183,7 +183,7 @@ f32 func_808B3DDC(BgSpot15Rrbox* this, PlayState* play) {
scale.y = D_808B45DC[i].y * (actor->scale.y * 10.0f);
scale.z = D_808B45DC[i].z * (actor->scale.z * 10.0f);
func_808B39E8(&position, &scale, this->unk_16C, this->unk_170);
BgSpot15Rrbox_RotatePoint(&position, &scale, this->unk_16C, this->unk_170);
position.x += actor->world.pos.x;
position.y += actor->prevPos.y;
@ -199,20 +199,20 @@ f32 func_808B3DDC(BgSpot15Rrbox* this, PlayState* play) {
return returnValue;
}
s32 func_808B3F58(BgSpot15Rrbox* this, PlayState* play) {
if (func_808B3CA0(this, play, 0)) {
s32 BgSpot15Rrbox_TrySnapToFloor(BgSpot15Rrbox* this, PlayState* play) {
if (BgSpot15Rrbox_TrySnapToCheckedPoint(this, play, 0)) {
return true;
}
if (func_808B3CA0(this, play, 1)) {
if (BgSpot15Rrbox_TrySnapToCheckedPoint(this, play, 1)) {
return true;
}
if (func_808B3CA0(this, play, 2)) {
if (BgSpot15Rrbox_TrySnapToCheckedPoint(this, play, 2)) {
return true;
}
if (func_808B3CA0(this, play, 3)) {
if (BgSpot15Rrbox_TrySnapToCheckedPoint(this, play, 3)) {
return true;
}
if (func_808B3CA0(this, play, 4)) {
if (BgSpot15Rrbox_TrySnapToCheckedPoint(this, play, 4)) {
return true;
}
return false;
@ -272,7 +272,7 @@ void func_808B4194(BgSpot15Rrbox* this, PlayState* play) {
actor->world.pos.x = actor->home.pos.x + (tempUnk178 * this->unk_16C);
actor->world.pos.z = actor->home.pos.z + (tempUnk178 * this->unk_170);
if (!func_808B3F58(this, play)) {
if (!BgSpot15Rrbox_TrySnapToFloor(this, play)) {
actor->home.pos.x = actor->world.pos.x;
actor->home.pos.z = actor->world.pos.z;
player->stateFlags2 &= ~PLAYER_STATE2_MOVING_DYNAPOLY;
@ -305,7 +305,7 @@ void func_808B4380(BgSpot15Rrbox* this, PlayState* play) {
this->dyna.actor.velocity.y = 0.0f;
this->dyna.actor.velocity.z = 0.0f;
this->dyna.actor.gravity = -1.0f;
this->dyna.actor.floorHeight = func_808B3DDC(this, play);
this->dyna.actor.floorHeight = BgSpot15Rrbox_GetFloorHeight(this, play);
this->actionFunc = func_808B43D0;
}

View file

@ -11,18 +11,18 @@ void BgSpot18Basket_Update(Actor* thisx, PlayState* play);
void BgSpot18Basket_Draw(Actor* thisx, PlayState* play);
void BgSpot18Basket_Reset(void);
void func_808B7BCC(BgSpot18Basket* this, PlayState* play);
void func_808B7AEC(BgSpot18Basket* this);
void func_808B7B58(BgSpot18Basket* this);
void func_808B7BB0(BgSpot18Basket* this);
void func_808B7D38(BgSpot18Basket* this);
void func_808B7F74(BgSpot18Basket* this);
void func_808B818C(BgSpot18Basket* this);
void func_808B7AFC(BgSpot18Basket* this, PlayState* play);
void func_808B7B6C(BgSpot18Basket* this, PlayState* play);
void func_808B7D50(BgSpot18Basket* this, PlayState* play);
void func_808B7FC0(BgSpot18Basket* this, PlayState* play);
void func_808B81A0(BgSpot18Basket* this, PlayState* play);
void BgSpot18Basket_Spinning(BgSpot18Basket* this, PlayState* play);
void BgSpot18Basket_SetupInactive(BgSpot18Basket* this);
void BgSpot18Basket_SetupActivation(BgSpot18Basket* this);
void BgSpot18Basket_SetupSpinning(BgSpot18Basket* this);
void BgSpot18Basket_SetupExplosionCs(BgSpot18Basket* this);
void BgSpot18Basket_SetupStopping(BgSpot18Basket* this);
void BgSpot18Basket_SetupGivingPrize(BgSpot18Basket* this);
void BgSpot18Basket_Inactive(BgSpot18Basket* this, PlayState* play);
void BgSpot18Basket_Activation(BgSpot18Basket* this, PlayState* play);
void BgSpot18Basket_ExplosionCs(BgSpot18Basket* this, PlayState* play);
void BgSpot18Basket_Stopping(BgSpot18Basket* this, PlayState* play);
void BgSpot18Basket_GivingPrize(BgSpot18Basket* this, PlayState* play);
const ActorInit Bg_Spot18_Basket_InitVars = {
ACTOR_BG_SPOT18_BASKET,
@ -77,7 +77,7 @@ static ColliderJntSphInit sJntSphInit = {
static s16 D_808B85C8[] = { 0x8000, 0x2AAA, 0xD555, 0x0000 };
void func_808B7710(Actor* thisx, PlayState* play) {
void BgSpot18Basket_InitColliderJntSph(Actor* thisx, PlayState* play) {
BgSpot18Basket* this = (BgSpot18Basket*)thisx;
Collider_InitJntSph(play, &this->colliderJntSph);
@ -86,7 +86,7 @@ void func_808B7710(Actor* thisx, PlayState* play) {
}
s16 D_808B85D0 = 0;
void func_808B7770(BgSpot18Basket* this, PlayState* play, f32 arg2) {
void BgSpot18Basket_SpawnDustClouds(BgSpot18Basket* this, PlayState* play, f32 arg2) {
Vec3f acceleration;
Vec3f velocity;
Vec3f position;
@ -137,7 +137,7 @@ void BgSpot18Basket_Init(Actor* thisx, PlayState* play) {
CollisionHeader* colHeader = NULL;
DynaPolyActor_Init(&this->dyna, DPM_UNK3);
func_808B7710(&this->dyna.actor, play);
BgSpot18Basket_InitColliderJntSph(&this->dyna.actor, play);
CollisionHeader_GetVirtual(&gGoronCityVaseCol, &colHeader);
this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader);
@ -148,11 +148,11 @@ void BgSpot18Basket_Init(Actor* thisx, PlayState* play) {
this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y;
if (Flags_GetSwitch(play, (this->dyna.actor.params >> 8) & 0x3F)) {
func_808B7BB0(this);
BgSpot18Basket_SetupSpinning(this);
return;
}
func_808B7AEC(this);
BgSpot18Basket_SetupInactive(this);
Actor_SpawnAsChild(&play->actorCtx, &this->dyna.actor, play, ACTOR_BG_SPOT18_FUTA, this->dyna.actor.world.pos.x,
this->dyna.actor.world.pos.y, this->dyna.actor.world.pos.z, this->dyna.actor.shape.rot.x,
this->dyna.actor.shape.rot.y + 0x1555, this->dyna.actor.shape.rot.z, -1);
@ -172,36 +172,36 @@ void BgSpot18Basket_Destroy(Actor* thisx, PlayState* play) {
Collider_DestroyJntSph(play, &this->colliderJntSph);
}
void func_808B7AEC(BgSpot18Basket* this) {
this->actionFunc = func_808B7AFC;
void BgSpot18Basket_SetupInactive(BgSpot18Basket* this) {
this->actionFunc = BgSpot18Basket_Inactive;
}
void func_808B7AFC(BgSpot18Basket* this, PlayState* play) {
void BgSpot18Basket_Inactive(BgSpot18Basket* this, PlayState* play) {
if (Flags_GetSwitch(play, (this->dyna.actor.params >> 8) & 0x3F)) {
OnePointCutscene_Init(play, 4220, 80, &this->dyna.actor, MAIN_CAM);
func_808B7B58(this);
BgSpot18Basket_SetupActivation(this);
}
}
void func_808B7B58(BgSpot18Basket* this) {
this->actionFunc = func_808B7B6C;
void BgSpot18Basket_SetupActivation(BgSpot18Basket* this) {
this->actionFunc = BgSpot18Basket_Activation;
this->timer = 0;
}
void func_808B7B6C(BgSpot18Basket* this, PlayState* play) {
void BgSpot18Basket_Activation(BgSpot18Basket* this, PlayState* play) {
if (this->timer > 20) {
func_808B7BB0(this);
BgSpot18Basket_SetupSpinning(this);
this->dyna.actor.child->parent = NULL;
this->dyna.actor.child = NULL;
}
}
void func_808B7BB0(BgSpot18Basket* this) {
this->actionFunc = func_808B7BCC;
void BgSpot18Basket_SetupSpinning(BgSpot18Basket* this) {
this->actionFunc = BgSpot18Basket_Spinning;
this->spinRate = this->circleRate = 0;
}
void func_808B7BCC(BgSpot18Basket* this, PlayState* play) {
void BgSpot18Basket_Spinning(BgSpot18Basket* this, PlayState* play) {
f32 positionDiff;
Actor* colliderBaseAc;
@ -229,7 +229,7 @@ void func_808B7BCC(BgSpot18Basket* this, PlayState* play) {
if (Math3D_Dist2DSq(colliderBaseAc->world.pos.z, this->colliderJntSph.base.ac->world.pos.x,
this->dyna.actor.world.pos.z, this->dyna.actor.world.pos.x) < SQ(32.0f)) {
OnePointCutscene_Init(play, 4210, 240, &this->dyna.actor, MAIN_CAM);
func_808B7D38(this);
BgSpot18Basket_SetupExplosionCs(this);
func_8003EBF8(play, &play->colCtx.dyna, this->dyna.bgId);
}
}
@ -238,13 +238,13 @@ void func_808B7BCC(BgSpot18Basket* this, PlayState* play) {
func_8002F974(&this->dyna.actor, NA_SE_EV_ELEVATOR_MOVE - SFX_FLAG);
}
void func_808B7D38(BgSpot18Basket* this) {
this->actionFunc = func_808B7D50;
void BgSpot18Basket_SetupExplosionCs(BgSpot18Basket* this) {
this->actionFunc = BgSpot18Basket_ExplosionCs;
this->timer = 0;
this->pivotAltitude = 0;
}
void func_808B7D50(BgSpot18Basket* this, PlayState* play) {
void BgSpot18Basket_ExplosionCs(BgSpot18Basket* this, PlayState* play) {
f32 tempValue2;
f32 tempValue;
@ -279,13 +279,13 @@ void func_808B7D50(BgSpot18Basket* this, PlayState* play) {
this->dyna.actor.shape.rot.z = -Math_SinS(this->pivotAzimuth) * this->pivotAltitude;
if (this->timer > 140) {
func_808B7F74(this);
BgSpot18Basket_SetupStopping(this);
}
if (this->timer < 80) {
func_808B7770(this, play, 1.0f);
BgSpot18Basket_SpawnDustClouds(this, play, 1.0f);
} else {
func_808B7770(this, play, 0.8f);
BgSpot18Basket_SpawnDustClouds(this, play, 0.8f);
}
tempValue2 = (this->spinRate - 500) * 0.0006f;
@ -295,11 +295,11 @@ void func_808B7D50(BgSpot18Basket* this, PlayState* play) {
func_800F436C(&this->dyna.actor.projectedPos, NA_SE_EV_WALL_MOVE_SP - SFX_FLAG, tempValue);
}
void func_808B7F74(BgSpot18Basket* this) {
void BgSpot18Basket_SetupStopping(BgSpot18Basket* this) {
s16 shapeRotY;
shapeRotY = this->dyna.actor.shape.rot.y;
this->actionFunc = func_808B7FC0;
this->actionFunc = BgSpot18Basket_Stopping;
if (GameInteractor_Should(VB_WIN_GORON_POT, (shapeRotY < -0x2E93) || (shapeRotY >= 0x7C19))) {
this->prize = 2;
@ -312,7 +312,7 @@ void func_808B7F74(BgSpot18Basket* this) {
this->timer = 0;
}
void func_808B7FC0(BgSpot18Basket* this, PlayState* play) {
void BgSpot18Basket_Stopping(BgSpot18Basket* this, PlayState* play) {
s32 pad;
s32 tempUnk214;
f32 tempUnk210;
@ -339,15 +339,15 @@ void func_808B7FC0(BgSpot18Basket* this, PlayState* play) {
if ((s16)(this->dyna.actor.shape.rot.y - arrayValue) >= 0) {
this->dyna.actor.shape.rot.y = arrayValue;
func_808B818C(this);
BgSpot18Basket_SetupGivingPrize(this);
func_8003EC50(play, &play->colCtx.dyna, this->dyna.bgId);
}
}
if (this->timer < 30) {
func_808B7770(this, play, 0.5f);
BgSpot18Basket_SpawnDustClouds(this, play, 0.5f);
} else {
func_808B7770(this, play, 0.3f);
BgSpot18Basket_SpawnDustClouds(this, play, 0.3f);
}
tempUnk210 = (this->spinRate - 500) * 0.0006f;
@ -357,14 +357,14 @@ void func_808B7FC0(BgSpot18Basket* this, PlayState* play) {
func_800F436C(&this->dyna.actor.projectedPos, NA_SE_EV_WALL_MOVE_SP - SFX_FLAG, clampedTempUnk210);
}
void func_808B818C(BgSpot18Basket* this) {
this->actionFunc = func_808B81A0;
void BgSpot18Basket_SetupGivingPrize(BgSpot18Basket* this) {
this->actionFunc = BgSpot18Basket_GivingPrize;
this->timer = 0;
}
static s16 D_808B85E4[] = { -0x0FA0, 0x0320, 0x0FA0 };
void func_808B81A0(BgSpot18Basket* this, PlayState* play) {
void BgSpot18Basket_GivingPrize(BgSpot18Basket* this, PlayState* play) {
s32 i;
Actor* actor = &this->dyna.actor;
Vec3f tempVector;
@ -427,7 +427,7 @@ void func_808B81A0(BgSpot18Basket* this, PlayState* play) {
Sfx_PlaySfxCentered(NA_SE_SY_TRE_BOX_APPEAR);
}
} else if (this->timer == 200) {
func_808B7BB0(this);
BgSpot18Basket_SetupSpinning(this);
}
}
@ -440,9 +440,9 @@ void BgSpot18Basket_Update(Actor* thisx, PlayState* play) {
this->actionFunc(this, play);
this->dyna.actor.floorHeight = BgCheck_EntityRaycastFloor4(&play->colCtx, &this->dyna.actor.floorPoly, &bgId,
&this->dyna.actor, &this->dyna.actor.world.pos);
if (this->actionFunc != func_808B7AFC) {
if (this->actionFunc != BgSpot18Basket_Inactive) {
CollisionCheck_SetOC(play, &play->colChkCtx, &this->colliderJntSph.base);
if (this->actionFunc != func_808B7B6C) {
if (this->actionFunc != BgSpot18Basket_Activation) {
this->colliderJntSph.base.acFlags &= ~AC_HIT;
CollisionCheck_SetAC(play, &play->colChkCtx, &this->colliderJntSph.base);
}

View file

@ -36,8 +36,8 @@ void func_80900580(BossGanon2* this, PlayState* play);
void func_80900650(BossGanon2* this, PlayState* play);
void func_80900890(BossGanon2* this, PlayState* play);
void func_8090120C(BossGanon2* this, PlayState* play);
void func_80905DA8(BossGanon2* this, PlayState* play);
void func_809060E8(PlayState* play);
void BossGanon2_UpdateEffects(BossGanon2* this, PlayState* play);
void BossGanon2_DrawEffects(PlayState* play);
void BossGanon2_GenShadowTexture(void* shadowTexture, BossGanon2* this, PlayState* play);
void BossGanon2_DrawShadowTexture(void* shadowTexture, BossGanon2* this, PlayState* play);
@ -1930,7 +1930,7 @@ void func_80902348(BossGanon2* this, PlayState* play) {
}
}
void func_80902524(BossGanon2* this, PlayState* play) {
void BossGanon2_CollisionCheck(BossGanon2* this, PlayState* play) {
s8 temp_v0_4;
ColliderInfo* acHitInfo;
s16 i;
@ -2117,7 +2117,7 @@ void BossGanon2_Update(Actor* thisx, PlayState* play) {
func_80902348(this, play);
CollisionCheck_SetOC(play, &play->colChkCtx, &this->unk_424.base);
if (this->actionFunc != func_8090120C) {
func_80902524(this, play);
BossGanon2_CollisionCheck(this, play);
CollisionCheck_SetAC(play, &play->colChkCtx, &this->unk_424.base);
CollisionCheck_SetOC(play, &play->colChkCtx, &this->unk_444.base);
CollisionCheck_SetAC(play, &play->colChkCtx, &this->unk_444.base);
@ -2241,7 +2241,7 @@ void BossGanon2_Update(Actor* thisx, PlayState* play) {
}
}
this->unk_388 += 0.15f;
func_80905DA8(this, play);
BossGanon2_UpdateEffects(this, play);
}
void func_809034E4(Vec3f* arg0, Vec3f* arg1) {
@ -2869,10 +2869,10 @@ void BossGanon2_Draw(Actor* thisx, PlayState* play) {
CLOSE_DISPS(play->state.gfxCtx);
func_809060E8(play);
BossGanon2_DrawEffects(play);
}
void func_80905DA8(BossGanon2* this, PlayState* play) {
void BossGanon2_UpdateEffects(BossGanon2* this, PlayState* play) {
s32 pad[5];
Player* player = GET_PLAYER(play);
BossGanon2Effect* effect = play->specialEffects;
@ -2939,7 +2939,7 @@ void func_80905DA8(BossGanon2* this, PlayState* play) {
}
}
void func_809060E8(PlayState* play) {
void BossGanon2_DrawEffects(PlayState* play) {
s16 alpha;
u8 usingObjectGEff = false;
BossGanon2Effect* effect;

View file

@ -21,7 +21,7 @@ void Demo6K_Destroy(Actor* thisx, PlayState* play);
void Demo6K_Update(Actor* thisx, PlayState* play);
void Demo6K_Reset(void);
void func_80966DB0(Demo6K* this, PlayState* play);
void Demo6K_WaitForObject(Demo6K* this, PlayState* play);
void func_80966E04(Demo6K* this, PlayState* play);
void func_80966E98(Demo6K* this, PlayState* play);
void func_80966F84(Demo6K* this, PlayState* play);
@ -93,7 +93,7 @@ void Demo6K_Init(Actor* thisx, PlayState* play) {
this->objBankIndex = objBankIndex;
}
Demo6K_SetupAction(this, func_80966DB0);
Demo6K_SetupAction(this, Demo6K_WaitForObject);
this->timer1 = 0;
this->flags = 0;
this->timer2 = 0;
@ -202,7 +202,7 @@ void Demo6K_Destroy(Actor* thisx, PlayState* play) {
LightContext_RemoveLight(play, &play->lightCtx, this->lightNode);
}
void func_80966DB0(Demo6K* this, PlayState* play) {
void Demo6K_WaitForObject(Demo6K* this, PlayState* play) {
if (Object_IsLoaded(&play->objectCtx, this->objBankIndex)) {
this->actor.objBankIndex = this->objBankIndex;
this->actor.draw = this->drawFunc;

View file

@ -50,7 +50,7 @@ const ActorInit Demo_Go_InitVars = {
NULL,
};
s32 func_8097C870(DemoGo* this) {
s32 DemoGo_GetCueChannel(DemoGo* this) {
s32 ret;
switch (this->actor.params) {
@ -134,7 +134,7 @@ void func_8097CB0C(DemoGo* this, PlayState* play) {
Vec3f endPos;
if (play->csCtx.state != CS_STATE_IDLE) {
npcAction = csCtx->npcActions[func_8097C870(this)];
npcAction = csCtx->npcActions[DemoGo_GetCueChannel(this)];
if (npcAction != NULL) {
temp_ret = Environment_LerpWeight(npcAction->endFrame, npcAction->startFrame, csCtx->frames);
startPos.x = npcAction->startPos.x;
@ -174,7 +174,7 @@ void func_8097CCE0(DemoGo* this, PlayState* play) {
s32 thisRotY;
if (play->csCtx.state != CS_STATE_IDLE) {
npcAction = play->csCtx.npcActions[func_8097C870(this)];
npcAction = play->csCtx.npcActions[DemoGo_GetCueChannel(this)];
if (npcAction != NULL) {
thisRotY = thisx->world.rot.y;
rotYDelta = npcAction->rot.y - thisRotY;
@ -197,7 +197,7 @@ s32 DemoGo_UpdateSkelAnime(DemoGo* this) {
s32 func_8097CDB0(DemoGo* this, PlayState* play, u16 npcAction) {
CutsceneContext* csCtx = &play->csCtx;
s32 actionIdx = func_8097C870(this);
s32 actionIdx = DemoGo_GetCueChannel(this);
if ((csCtx->state != CS_STATE_IDLE) && (csCtx->npcActions[actionIdx] != NULL) &&
(csCtx->npcActions[actionIdx]->action == npcAction)) {
@ -224,7 +224,7 @@ void func_8097CE78(DemoGo* this, PlayState* play) {
CsCmdActorCue* npcAction;
if (play->csCtx.state != CS_STATE_IDLE) {
npcAction = csCtx->npcActions[func_8097C870(this)];
npcAction = csCtx->npcActions[DemoGo_GetCueChannel(this)];
if (npcAction != NULL && csCtx->frames >= npcAction->endFrame) {
func_8097CA78(this, play);
this->action = 3;

View file

@ -287,7 +287,7 @@ void func_8097E454(PlayState* play, Vec3f* spawnerPos, Vec3f* velocity, Vec3f* a
}
}
u8 func_8097E69C(PlayState* play) {
u8 DemoGt_IsCutsceneIdle(PlayState* play) {
if (play->csCtx.state == CS_STATE_IDLE) {
return true;
} else {
@ -299,7 +299,7 @@ CsCmdActorCue* DemoGt_GetNpcAction(PlayState* play, u32 actionIdx) {
s32 pad[2];
CsCmdActorCue* ret = NULL;
if (!func_8097E69C(play)) {
if (!DemoGt_IsCutsceneIdle(play)) {
ret = play->csCtx.npcActions[actionIdx];
}
@ -433,7 +433,7 @@ void func_8097ED64(DemoGt* this, PlayState* play, s32 actionIdx) {
func_8097E824(this, actionIdx);
}
u8 func_8097ED94() {
u8 DemoGt_IsCutsceneLayer() {
if (kREG(2) != 0) {
return true;
} else if (gSaveContext.sceneSetupIndex < 4) {
@ -462,7 +462,7 @@ void func_8097EDD8(DemoGt* this, PlayState* play, CollisionHeader* collision) {
u8 func_8097EE44(DemoGt* this, PlayState* play, s32 updateMode, s32 drawConfig, CollisionHeader* colHeader) {
if (func_8097ED94()) {
if (DemoGt_IsCutsceneLayer()) {
this->updateMode = updateMode;
this->drawConfig = drawConfig;
func_8097EDD8(this, play, colHeader);

View file

@ -32,21 +32,21 @@ void DoorShutter_Destroy(Actor* thisx, PlayState* play);
void DoorShutter_Update(Actor* thisx, PlayState* play);
void DoorShutter_Draw(Actor* thisx, PlayState* play);
void func_8099803C(PlayState* play, s16 y, s16 countdown, s16 arg3);
void DoorShutter_RequestQuakeAndRumble(PlayState* play, s16 y, s16 countdown, s16 arg3);
void DoorShutter_SetupType(DoorShutter* this, PlayState* play);
void func_80996A54(DoorShutter* this, PlayState* play);
void func_80996B00(DoorShutter* this, PlayState* play);
void func_80996B0C(DoorShutter* this, PlayState* play);
void func_80996EE8(DoorShutter* this, PlayState* play);
void func_80996F98(DoorShutter* this, PlayState* play);
void func_80997004(DoorShutter* this, PlayState* play);
void func_80997150(DoorShutter* this, PlayState* play);
void func_809973E8(DoorShutter* this, PlayState* play);
void func_80997528(DoorShutter* this, PlayState* play);
void func_80997568(DoorShutter* this, PlayState* play);
void func_809975C0(DoorShutter* this, PlayState* play);
void func_809976B8(DoorShutter* this, PlayState* play);
void func_80997744(DoorShutter* this, PlayState* play);
void DoorShutter_WaitClear(DoorShutter* this, PlayState* play);
void DoorShutter_Unopenable(DoorShutter* this, PlayState* play);
void DoorShutter_Idle(DoorShutter* this, PlayState* play);
void DoorShutter_BarAndWaitSwitchFlag(DoorShutter* this, PlayState* play);
void DoorShutter_UnbarredCheckSwitchFlag(DoorShutter* this, PlayState* play);
void DoorShutter_Open(DoorShutter* this, PlayState* play);
void DoorShutter_Unbar(DoorShutter* this, PlayState* play);
void DoorShutter_Close(DoorShutter* this, PlayState* play);
void DoorShutter_JabuDoorClose(DoorShutter* this, PlayState* play);
void DoorShutter_WaitPlayerSurprised(DoorShutter* this, PlayState* play);
void DoorShutter_GohmaBlockFall(DoorShutter* this, PlayState* play);
void DoorShutter_GohmaBlockBounce(DoorShutter* this, PlayState* play);
void DoorShutter_PhantomGanonBarsRaise(DoorShutter* this, PlayState* play);
const ActorInit Door_Shutter_InitVars = {
ACTOR_DOOR_SHUTTER,
@ -211,23 +211,23 @@ s32 DoorShutter_SetupDoor(DoorShutter* this, PlayState* play) {
if (doorType == SHUTTER_FRONT_CLEAR) {
if (!Flags_GetClear(play, this->dyna.actor.room)) {
DoorShutter_SetupAction(this, func_80996A54);
DoorShutter_SetupAction(this, DoorShutter_WaitClear);
this->barsClosedAmount = 1.0f;
return true;
}
} else if (doorType == SHUTTER_FRONT_SWITCH || doorType == SHUTTER_FRONT_SWITCH_BACK_CLEAR) {
if (!Flags_GetSwitch(play, this->dyna.actor.params & 0x3F)) {
DoorShutter_SetupAction(this, func_80996EE8);
DoorShutter_SetupAction(this, DoorShutter_BarAndWaitSwitchFlag);
this->barsClosedAmount = 1.0f;
return true;
}
DoorShutter_SetupAction(this, func_80996F98);
DoorShutter_SetupAction(this, DoorShutter_UnbarredCheckSwitchFlag);
return false;
} else if (doorType == SHUTTER_BACK_LOCKED) {
DoorShutter_SetupAction(this, func_80996B00);
DoorShutter_SetupAction(this, DoorShutter_Unopenable);
return false;
}
DoorShutter_SetupAction(this, func_80996B0C);
DoorShutter_SetupAction(this, DoorShutter_Idle);
return false;
}
@ -314,9 +314,9 @@ void DoorShutter_SetupType(DoorShutter* this, PlayState* play) {
this->dyna.actor.velocity.y = 0.0f;
this->dyna.actor.gravity = -2.0f;
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_SLIDE_DOOR_CLOSE);
DoorShutter_SetupAction(this, func_809975C0);
DoorShutter_SetupAction(this, DoorShutter_GohmaBlockFall);
} else {
DoorShutter_SetupAction(this, func_80997744);
DoorShutter_SetupAction(this, DoorShutter_PhantomGanonBarsRaise);
this->unk_164 = 7;
}
} else {
@ -325,7 +325,7 @@ void DoorShutter_SetupType(DoorShutter* this, PlayState* play) {
}
}
f32 func_80996840(PlayState* play, DoorShutter* this, f32 arg2, f32 arg3, f32 arg4) {
f32 DoorShutter_GetPlayerDistance(PlayState* play, DoorShutter* this, f32 arg2, f32 arg3, f32 arg4) {
s32 pad;
Vec3f sp28;
Vec3f sp1C;
@ -342,12 +342,13 @@ f32 func_80996840(PlayState* play, DoorShutter* this, f32 arg2, f32 arg3, f32 ar
}
}
s32 func_809968D4(DoorShutter* this, PlayState* play) {
s32 DoorShutter_GetPlayerSide(DoorShutter* this, PlayState* play) {
Player* player = GET_PLAYER(play);
if (!Player_InCsMode(play)) {
ShutterInfo* temp_v1 = &sShutterInfo[this->gfxType];
f32 temp_f2 = func_80996840(play, this, (this->gfxType != 3) ? 0.0f : 80.0f, temp_v1->e, temp_v1->f);
f32 temp_f2 =
DoorShutter_GetPlayerDistance(play, this, (this->gfxType != 3) ? 0.0f : 80.0f, temp_v1->e, temp_v1->f);
if (fabsf(temp_f2) < 50.0f) {
s16 phi_v0 = player->actor.shape.rot.y - this->dyna.actor.shape.rot.y;
@ -363,28 +364,28 @@ s32 func_809968D4(DoorShutter* this, PlayState* play) {
return 0.0f;
}
void func_80996A54(DoorShutter* this, PlayState* play) {
void DoorShutter_WaitClear(DoorShutter* this, PlayState* play) {
if (Flags_GetClear(play, this->dyna.actor.room) || Flags_GetTempClear(play, this->dyna.actor.room)) {
Flags_SetClear(play, this->dyna.actor.room);
DoorShutter_SetupAction(this, func_80997150);
DoorShutter_SetupAction(this, DoorShutter_Unbar);
if (GameInteractor_Should(VB_PLAY_ONEPOINT_ACTOR_CS, true, this)) {
OnePointCutscene_Attention(play, &this->dyna.actor);
OnePointCutscene_Attention(play, &GET_PLAYER(play)->actor);
this->actionTimer = -100;
}
} else if (func_809968D4(this, play) != 0) {
} else if (DoorShutter_GetPlayerSide(this, play) != 0) {
Player* player = GET_PLAYER(play);
player->naviTextId = -0x202;
}
}
void func_80996B00(DoorShutter* this, PlayState* play) {
void DoorShutter_Unopenable(DoorShutter* this, PlayState* play) {
}
void func_80996B0C(DoorShutter* this, PlayState* play) {
void DoorShutter_Idle(DoorShutter* this, PlayState* play) {
if (this->unk_164 != 0) {
DoorShutter_SetupAction(this, func_80997004);
DoorShutter_SetupAction(this, DoorShutter_Open);
this->dyna.actor.velocity.y = 0.0f;
if (this->unlockTimer != 0) {
Flags_SetSwitch(play, this->dyna.actor.params & 0x3F);
@ -397,7 +398,7 @@ void func_80996B0C(DoorShutter* this, PlayState* play) {
}
}
} else {
s32 doorDirection = func_809968D4(this, play);
s32 doorDirection = DoorShutter_GetPlayerSide(this, play);
if (doorDirection != 0) {
Player* player = GET_PLAYER(play);
@ -421,7 +422,7 @@ void func_80996B0C(DoorShutter* this, PlayState* play) {
}
}
void func_80996C60(DoorShutter* this, PlayState* play) {
void DoorShutter_InitOpeningDoorCam(DoorShutter* this, PlayState* play) {
if (this->dyna.actor.category == ACTORCAT_DOOR) {
Player* player = GET_PLAYER(play);
s32 sp38 = this->gfxType;
@ -430,7 +431,7 @@ void func_80996C60(DoorShutter* this, PlayState* play) {
if (DoorShutter_SetupDoor(this, play)) {
sp34 = 0x20;
}
DoorShutter_SetupAction(this, func_80997004);
DoorShutter_SetupAction(this, DoorShutter_Open);
this->gfxType = sp38;
this->barsClosedAmount = 0.0f;
Camera_ChangeDoorCam(play->cameraPtrs[MAIN_CAM], &this->dyna.actor, player->cv.slidingDoorBgCamIndex, 0.0f, 12,
@ -438,11 +439,11 @@ void func_80996C60(DoorShutter* this, PlayState* play) {
}
}
s32 func_80996D14(DoorShutter* this, PlayState* play) {
s32 DoorShutter_UpdateOpening(DoorShutter* this, PlayState* play) {
if (this->gfxType != 3) {
if (this->dyna.actor.velocity.y == 0.0f) {
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_SLIDE_DOOR_OPEN);
func_80996C60(this, play);
DoorShutter_InitOpeningDoorCam(this, play);
}
Math_StepToF(&this->dyna.actor.velocity.y, 15.0f, 3.0f);
if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y + 200.0f,
@ -452,7 +453,7 @@ s32 func_80996D14(DoorShutter* this, PlayState* play) {
} else {
if (this->jabuDoorClosedAmount == 100) {
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BUYODOOR_OPEN);
func_80996C60(this, play);
DoorShutter_InitOpeningDoorCam(this, play);
}
if (Math_StepToS(&this->jabuDoorClosedAmount, 0, 10)) {
return true;
@ -461,7 +462,7 @@ s32 func_80996D14(DoorShutter* this, PlayState* play) {
return false;
}
s32 func_80996E08(DoorShutter* this, PlayState* play, f32 arg2) {
s32 DoorShutter_UpdateBarsClosed(DoorShutter* this, PlayState* play, f32 arg2) {
if (this->barsClosedAmount == 1.0f - arg2) {
if (this->gfxType != 3) {
if (arg2 == 1.0f) {
@ -483,15 +484,15 @@ s32 func_80996E08(DoorShutter* this, PlayState* play, f32 arg2) {
return false;
}
void func_80996EE8(DoorShutter* this, PlayState* play) {
if (func_80996E08(this, play, 1.0f)) {
void DoorShutter_BarAndWaitSwitchFlag(DoorShutter* this, PlayState* play) {
if (DoorShutter_UpdateBarsClosed(this, play, 1.0f)) {
if (Flags_GetSwitch(play, this->dyna.actor.params & 0x3F)) {
DoorShutter_SetupAction(this, func_80997150);
DoorShutter_SetupAction(this, DoorShutter_Unbar);
if (GameInteractor_Should(VB_PLAY_ONEPOINT_ACTOR_CS, true, this)) {
OnePointCutscene_Attention(play, &this->dyna.actor);
this->actionTimer = -100;
}
} else if (func_809968D4(this, play)) {
} else if (DoorShutter_GetPlayerSide(this, play)) {
Player* player = GET_PLAYER(play);
// Jabu navi text for switch doors is different
player->naviTextId = (play->sceneNum == SCENE_JABU_JABU) ? -0x20B : -0x202;
@ -499,36 +500,36 @@ void func_80996EE8(DoorShutter* this, PlayState* play) {
}
}
void func_80996F98(DoorShutter* this, PlayState* play) {
void DoorShutter_UnbarredCheckSwitchFlag(DoorShutter* this, PlayState* play) {
if (this->unk_164 == 0 && !Flags_GetSwitch(play, this->dyna.actor.params & 0x3F)) {
DoorShutter_SetupAction(this, func_80996EE8);
DoorShutter_SetupAction(this, DoorShutter_BarAndWaitSwitchFlag);
} else {
func_80996B0C(this, play);
DoorShutter_Idle(this, play);
}
}
void func_80997004(DoorShutter* this, PlayState* play) {
if (DECR(this->unlockTimer) == 0 && play->roomCtx.status == 0 && func_80996D14(this, play) != 0) {
void DoorShutter_Open(DoorShutter* this, PlayState* play) {
if (DECR(this->unlockTimer) == 0 && play->roomCtx.status == 0 && DoorShutter_UpdateOpening(this, play) != 0) {
if (((this->doorType == SHUTTER_BOSS) ? 20.0f : 50.0f) < this->dyna.actor.xzDistToPlayer) {
if (DoorShutter_SetupDoor(this, play)) {
this->dyna.actor.velocity.y = 30.0f;
}
if (this->gfxType != 3) {
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_SLIDE_DOOR_CLOSE);
DoorShutter_SetupAction(this, func_809973E8);
DoorShutter_SetupAction(this, DoorShutter_Close);
} else {
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BUYODOOR_CLOSE);
if ((this->doorType == SHUTTER_FRONT_SWITCH || this->doorType == SHUTTER_FRONT_SWITCH_BACK_CLEAR) &&
!Flags_GetSwitch(play, this->dyna.actor.params & 0x3F)) {
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BUYOSHUTTER_CLOSE);
}
DoorShutter_SetupAction(this, func_80997528);
DoorShutter_SetupAction(this, DoorShutter_JabuDoorClose);
}
}
}
}
void func_80997150(DoorShutter* this, PlayState* play) {
void DoorShutter_Unbar(DoorShutter* this, PlayState* play) {
if (this->actionTimer != 0) {
if (this->actionTimer < 0) {
if (play->state.frames % 2 != 0) {
@ -540,17 +541,17 @@ void func_80997150(DoorShutter* this, PlayState* play) {
} else {
this->actionTimer--;
}
} else if (func_80996E08(this, play, 0.0f)) {
} else if (DoorShutter_UpdateBarsClosed(this, play, 0.0f)) {
if (!(this->doorType == SHUTTER || this->doorType == SHUTTER_FRONT_CLEAR)) {
DoorShutter_SetupAction(this, func_80996F98);
DoorShutter_SetupAction(this, DoorShutter_UnbarredCheckSwitchFlag);
} else {
DoorShutter_SetupAction(this, func_80996B0C);
DoorShutter_SetupAction(this, DoorShutter_Idle);
}
func_800F5B58();
}
}
void func_80997220(DoorShutter* this, PlayState* play) {
void DoorShutter_SetupClosed(DoorShutter* this, PlayState* play) {
Player* player = GET_PLAYER(play);
s8 room = this->dyna.actor.room;
@ -573,12 +574,12 @@ void func_80997220(DoorShutter* this, PlayState* play) {
this->unk_164 = 0;
this->dyna.actor.velocity.y = 0.0f;
if (DoorShutter_SetupDoor(this, play) && !(player->stateFlags1 & PLAYER_STATE1_CARRYING_ACTOR)) {
DoorShutter_SetupAction(this, func_80997568);
DoorShutter_SetupAction(this, DoorShutter_WaitPlayerSurprised);
Player_SetCsActionWithHaltedActors(play, NULL, 2);
}
}
void func_809973E8(DoorShutter* this, PlayState* play) {
void DoorShutter_Close(DoorShutter* this, PlayState* play) {
s32 quakeId;
if (this->dyna.actor.velocity.y < 20.0f) {
@ -596,41 +597,41 @@ void func_809973E8(DoorShutter* this, PlayState* play) {
Quake_SetQuakeValues(quakeId, 2, 0, 0, 0);
Quake_SetCountdown(quakeId, 10);
func_800AA000(this->dyna.actor.xyzDistToPlayerSq, 0xB4, 0x14, 0x64);
func_80997220(this, play);
DoorShutter_SetupClosed(this, play);
}
}
void func_80997528(DoorShutter* this, PlayState* play) {
void DoorShutter_JabuDoorClose(DoorShutter* this, PlayState* play) {
if (Math_StepToS(&this->jabuDoorClosedAmount, 0x64, 0xA)) {
func_80997220(this, play);
DoorShutter_SetupClosed(this, play);
}
}
void func_80997568(DoorShutter* this, PlayState* play) {
void DoorShutter_WaitPlayerSurprised(DoorShutter* this, PlayState* play) {
if (this->actionTimer++ > 30) {
Player_SetCsActionWithHaltedActors(play, NULL, 7);
DoorShutter_SetupDoor(this, play);
}
}
void func_809975C0(DoorShutter* this, PlayState* play) {
void DoorShutter_GohmaBlockFall(DoorShutter* this, PlayState* play) {
Actor_MoveXZGravity(&this->dyna.actor);
Actor_UpdateBgCheckInfo(play, &this->dyna.actor, 0.0f, 0.0f, 0.0f, 4);
if (this->dyna.actor.bgCheckFlags & 1) {
DoorShutter_SetupAction(this, func_809976B8);
DoorShutter_SetupAction(this, DoorShutter_GohmaBlockBounce);
if (!Flags_GetEventChkInf(EVENTCHKINF_BEGAN_GOHMA_BATTLE)) {
BossGoma* parent = (BossGoma*)this->dyna.actor.parent;
this->unk_164 = 10;
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_STONE_BOUND);
func_8099803C(play, 2, 10, parent->subCameraId);
DoorShutter_RequestQuakeAndRumble(play, 2, 10, parent->subCameraId);
Actor_SpawnFloorDustRing(play, &this->dyna.actor, &this->dyna.actor.world.pos, 70.0f, 20, 8.0f, 500, 10,
true);
}
}
}
void func_809976B8(DoorShutter* this, PlayState* play) {
void DoorShutter_GohmaBlockBounce(DoorShutter* this, PlayState* play) {
f32 mult;
if (this->unk_164 != 0) {
@ -640,7 +641,7 @@ void func_809976B8(DoorShutter* this, PlayState* play) {
}
}
void func_80997744(DoorShutter* this, PlayState* play) {
void DoorShutter_PhantomGanonBarsRaise(DoorShutter* this, PlayState* play) {
f32 phi_f0;
osSyncPrintf("FHG SAKU START !!\n");
@ -690,7 +691,7 @@ Gfx* func_80997838(PlayState* play, DoorShutter* this, Gfx* p) {
return p;
}
s32 func_80997A34(DoorShutter* this, PlayState* play) {
s32 DoorShutter_ShouldDraw(DoorShutter* this, PlayState* play) {
s32 phi_a1;
s32 phi_a0;
@ -723,7 +724,7 @@ void DoorShutter_Draw(Actor* thisx, PlayState* play) {
//! the init vars for the actor, and only set draw after initialization is complete.
if (this->dyna.actor.objBankIndex == this->requiredObjBankIndex &&
(this->styleType == 0 || func_80997A34(this, play) != 0)) {
(this->styleType == 0 || DoorShutter_ShouldDraw(this, play) != 0)) {
s32 pad[2];
ShutterInfo* sp70 = &sShutterInfo[this->gfxType];
@ -783,7 +784,7 @@ void DoorShutter_Draw(Actor* thisx, PlayState* play) {
}
}
void func_8099803C(PlayState* play, s16 y, s16 countdown, s16 camId) {
void DoorShutter_RequestQuakeAndRumble(PlayState* play, s16 y, s16 countdown, s16 camId) {
s16 quakeId = Quake_Add(Play_GetCamera(play, camId), 3);
func_800A9F6C(0.0f, 180, 20, 100);

View file

@ -14,10 +14,10 @@ void EnBird_Destroy(Actor* thisx, PlayState* play);
void EnBird_Update(Actor* thisx, PlayState* play);
void EnBird_Draw(Actor* thisx, PlayState* play);
void func_809C1E00(EnBird* this, s16 params);
void func_809C1E40(EnBird* this, PlayState* play);
void func_809C1D60(EnBird* this, PlayState* play);
void func_809C1CAC(EnBird* this, s16 params);
void EnBird_SetupMove(EnBird* this, s16 params);
void EnBird_Move(EnBird* this, PlayState* play);
void EnBird_Idle(EnBird* this, PlayState* play);
void EnBird_SetupIdle(EnBird* this, s16 params);
const ActorInit En_Bird_InitVars = {
ACTOR_EN_BIRD,
@ -58,7 +58,7 @@ void EnBird_Init(Actor* thisx, PlayState* play) {
this->posYPhaseStep = 0.0f;
this->flightDistance = 40.0f;
this->unk_1BC = 70.0f;
func_809C1CAC(this, this->actor.params);
EnBird_SetupIdle(this, this->actor.params);
}
void EnBird_Destroy(Actor* thisx, PlayState* play) {
@ -67,17 +67,17 @@ void EnBird_Destroy(Actor* thisx, PlayState* play) {
SkelAnime_Free(&this->skelAnime, play);
}
void func_809C1CAC(EnBird* this, s16 params) {
void EnBird_SetupIdle(EnBird* this, s16 params) {
f32 frameCount = Animation_GetLastFrame(&gBirdFlyAnim);
f32 playbackSpeed = this->scaleAnimSpeed ? 0.0f : 1.0f;
AnimationHeader* anim = &gBirdFlyAnim;
this->timer = Rand_S16Offset(5, 0x23);
Animation_Change(&this->skelAnime, anim, playbackSpeed, 0.0f, frameCount, ANIMMODE_LOOP, 0.0f);
EnBird_SetupAction(this, func_809C1D60);
EnBird_SetupAction(this, EnBird_Idle);
}
void func_809C1D60(EnBird* this, PlayState* play) {
void EnBird_Idle(EnBird* this, PlayState* play) {
f32 fVar2 = sinf(this->posYPhase);
this->actor.shape.yOffset = this->actor.shape.yOffset + fVar2 * this->posYMag;
@ -91,16 +91,16 @@ void func_809C1D60(EnBird* this, PlayState* play) {
this->timer -= 1;
if (this->timer <= 0) {
func_809C1E00(this, this->actor.params);
EnBird_SetupMove(this, this->actor.params);
}
}
void func_809C1E00(EnBird* this, s16 params) {
void EnBird_SetupMove(EnBird* this, s16 params) {
this->timer = Rand_S16Offset(0x14, 0x2D);
EnBird_SetupAction(this, func_809C1E40);
EnBird_SetupAction(this, EnBird_Move);
}
void func_809C1E40(EnBird* this, PlayState* play) {
void EnBird_Move(EnBird* this, PlayState* play) {
f32 fVar4 = sinf(this->posYPhase);
this->actor.shape.yOffset += fVar4 * this->posYMag;
@ -118,7 +118,7 @@ void func_809C1E40(EnBird* this, PlayState* play) {
SkelAnime_Update(&this->skelAnime);
this->timer -= 1;
if (this->timer < 0) {
func_809C1CAC(this, this->actor.params);
EnBird_SetupIdle(this, this->actor.params);
}
}

View file

@ -15,13 +15,13 @@ void EnBrob_Destroy(Actor* thisx, PlayState* play);
void EnBrob_Update(Actor* thisx, PlayState* play);
void EnBrob_Draw(Actor* thisx, PlayState* play);
void func_809CADDC(EnBrob* this, PlayState* play);
void func_809CB054(EnBrob* this, PlayState* play);
void func_809CB114(EnBrob* this, PlayState* play);
void func_809CB218(EnBrob* this, PlayState* play);
void func_809CB2B8(EnBrob* this, PlayState* play);
void func_809CB354(EnBrob* this, PlayState* play);
void func_809CB458(EnBrob* this, PlayState* play);
void EnBrob_SetupIdle(EnBrob* this, PlayState* play);
void EnBrob_Idle(EnBrob* this, PlayState* play);
void EnBrob_MoveUp(EnBrob* this, PlayState* play);
void EnBrob_Wobble(EnBrob* this, PlayState* play);
void EnBrob_Stunned(EnBrob* this, PlayState* play);
void EnBrob_MoveDown(EnBrob* this, PlayState* play);
void EnBrob_Shock(EnBrob* this, PlayState* play);
const ActorInit En_Brob_InitVars = {
ACTOR_EN_BROB,
@ -94,7 +94,7 @@ void EnBrob_Init(Actor* thisx, PlayState* play) {
this->colliders[1].dim.yShift *= thisx->scale.y;
this->actionFunc = NULL;
thisx->flags &= ~ACTOR_FLAG_ATTENTION_ENABLED;
func_809CADDC(this, play);
EnBrob_SetupIdle(this, play);
}
void EnBrob_Destroy(Actor* thisx, PlayState* play) {
@ -107,69 +107,69 @@ void EnBrob_Destroy(Actor* thisx, PlayState* play) {
ResourceMgr_UnregisterSkeleton(&this->skelAnime);
}
void func_809CADDC(EnBrob* this, PlayState* play) {
void EnBrob_SetupIdle(EnBrob* this, PlayState* play) {
func_8003EC50(play, &play->colCtx.dyna, this->dyna.bgId);
this->timer = this->actionFunc == func_809CB2B8 ? 200 : 0;
this->timer = this->actionFunc == EnBrob_Stunned ? 200 : 0;
this->modelOffsetY = 0;
this->actionFunc = func_809CB054;
this->actionFunc = EnBrob_Idle;
}
void func_809CAE44(EnBrob* this, PlayState* play) {
void EnBrob_SetupMoveUp(EnBrob* this, PlayState* play) {
Animation_PlayOnce(&this->skelAnime, &object_brob_Anim_001750);
func_8003EBF8(play, &play->colCtx.dyna, this->dyna.bgId);
this->modelOffsetY = 1000;
this->actionFunc = func_809CB114;
this->actionFunc = EnBrob_MoveUp;
}
void func_809CAEA0(EnBrob* this) {
void EnBrob_SetupWobble(EnBrob* this) {
Animation_MorphToLoop(&this->skelAnime, &object_brob_Anim_001958, -5.0f);
this->modelOffsetY = 8000;
this->timer = 1200;
this->actionFunc = func_809CB218;
this->actionFunc = EnBrob_Wobble;
}
void func_809CAEF4(EnBrob* this) {
void EnBrob_SetupStunned(EnBrob* this) {
Animation_MorphToPlayOnce(&this->skelAnime, &object_brob_Anim_000290, -5.0f);
this->modelOffsetY -= 125.0f;
Actor_SetColorFilter(&this->dyna.actor, 0, 0xFF, 0, 0x50);
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EN_GOMA_JR_FREEZE);
this->actionFunc = func_809CB2B8;
this->actionFunc = EnBrob_Stunned;
}
void func_809CAF88(EnBrob* this) {
void EnBrob_SetupMoveDown(EnBrob* this) {
Animation_Change(&this->skelAnime, &object_brob_Anim_001750, -1.0f,
Animation_GetLastFrame(&object_brob_Anim_001750), 0.0f, ANIMMODE_ONCE, -5.0f);
this->modelOffsetY = 8250;
this->actionFunc = func_809CB354;
this->actionFunc = EnBrob_MoveDown;
}
void func_809CB008(EnBrob* this) {
void EnBrob_SetupShock(EnBrob* this) {
Animation_MorphToLoop(&this->skelAnime, &object_brob_Anim_001678, -5.0f);
this->timer = 10;
this->actionFunc = func_809CB458;
this->actionFunc = EnBrob_Shock;
}
void func_809CB054(EnBrob* this, PlayState* play) {
void EnBrob_Idle(EnBrob* this, PlayState* play) {
if (this->timer != 0) {
this->timer--;
}
if (this->timer == 0) {
if (DynaPolyActor_IsPlayerOnTop(&this->dyna) != 0) {
func_8002F71C(play, &this->dyna.actor, 5.0f, this->dyna.actor.yawTowardsPlayer, 1.0f);
func_809CAE44(this, play);
EnBrob_SetupMoveUp(this, play);
} else if (this->dyna.actor.xzDistToPlayer < 300.0f) {
func_809CAE44(this, play);
EnBrob_SetupMoveUp(this, play);
}
} else if (this->timer >= 81) {
this->dyna.actor.colorFilterTimer = 80;
}
}
void func_809CB114(EnBrob* this, PlayState* play) {
void EnBrob_MoveUp(EnBrob* this, PlayState* play) {
f32 curFrame;
if (SkelAnime_Update(&this->skelAnime)) {
func_809CAEA0(this);
EnBrob_SetupWobble(this);
} else {
curFrame = this->skelAnime.curFrame;
if (curFrame < 8.0f) {
@ -182,7 +182,7 @@ void func_809CB114(EnBrob* this, PlayState* play) {
}
}
void func_809CB218(EnBrob* this, PlayState* play) {
void EnBrob_Wobble(EnBrob* this, PlayState* play) {
SkelAnime_Update(&this->skelAnime);
if (Animation_OnFrame(&this->skelAnime, 6.0f) || Animation_OnFrame(&this->skelAnime, 15.0f)) {
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EN_BROB_WAVE);
@ -191,24 +191,24 @@ void func_809CB218(EnBrob* this, PlayState* play) {
this->timer--;
}
if ((this->timer == 0) && (this->dyna.actor.xzDistToPlayer > 500.0f)) {
func_809CAF88(this);
EnBrob_SetupMoveDown(this);
}
}
void func_809CB2B8(EnBrob* this, PlayState* play) {
void EnBrob_Stunned(EnBrob* this, PlayState* play) {
if (SkelAnime_Update(&this->skelAnime)) {
func_809CADDC(this, play);
EnBrob_SetupIdle(this, play);
} else if (this->skelAnime.curFrame < 8.0f) {
this->modelOffsetY -= 1250.0f;
}
this->dyna.actor.colorFilterTimer = 0x50;
}
void func_809CB354(EnBrob* this, PlayState* play) {
void EnBrob_MoveDown(EnBrob* this, PlayState* play) {
f32 curFrame;
if (SkelAnime_Update(&this->skelAnime)) {
func_809CADDC(this, play);
EnBrob_SetupIdle(this, play);
} else {
curFrame = this->skelAnime.curFrame;
if (curFrame < 8.0f) {
@ -221,7 +221,7 @@ void func_809CB354(EnBrob* this, PlayState* play) {
}
}
void func_809CB458(EnBrob* this, PlayState* play) {
void EnBrob_Shock(EnBrob* this, PlayState* play) {
Vec3f pos;
f32 dist1;
f32 dist2;
@ -254,7 +254,7 @@ void func_809CB458(EnBrob* this, PlayState* play) {
}
if (this->timer == 0) {
func_809CAEA0(this);
EnBrob_SetupWobble(this);
}
}
@ -274,16 +274,16 @@ void EnBrob_Update(Actor* thisx, PlayState* play2) {
this->colliders[i].base.acFlags &= ~AC_HIT;
}
func_809CAEF4(this);
EnBrob_SetupStunned(this);
} else if ((this->colliders[0].base.atFlags & AT_HIT) || (this->colliders[1].base.atFlags & AT_HIT) ||
(acHits[0] && (this->colliders[0].info.acHitInfo->toucher.dmgFlags & 0x100)) ||
(acHits[1] && (this->colliders[1].info.acHitInfo->toucher.dmgFlags & 0x100))) {
if (this->actionFunc == func_809CB114 && !(this->colliders[0].base.atFlags & AT_BOUNCED) &&
if (this->actionFunc == EnBrob_MoveUp && !(this->colliders[0].base.atFlags & AT_BOUNCED) &&
!(this->colliders[1].base.atFlags & AT_BOUNCED)) {
func_8002F71C(play, &this->dyna.actor, 5.0f, this->dyna.actor.yawTowardsPlayer, 1.0f);
} else if (this->actionFunc != func_809CB114) {
func_809CB008(this);
} else if (this->actionFunc != EnBrob_MoveUp) {
EnBrob_SetupShock(this);
}
for (i = 0; i < 2; i++) {
@ -292,11 +292,11 @@ void EnBrob_Update(Actor* thisx, PlayState* play2) {
}
}
this->actionFunc(this, play);
if (this->actionFunc != func_809CB054 && this->actionFunc != func_809CB354) {
if (this->actionFunc != func_809CB2B8) {
if (this->actionFunc != EnBrob_Idle && this->actionFunc != EnBrob_MoveDown) {
if (this->actionFunc != EnBrob_Stunned) {
CollisionCheck_SetAT(play, &play->colChkCtx, &this->colliders[0].base);
CollisionCheck_SetAT(play, &play->colChkCtx, &this->colliders[1].base);
if (this->actionFunc != func_809CB114) {
if (this->actionFunc != EnBrob_MoveUp) {
CollisionCheck_SetAC(play, &play->colChkCtx, &this->colliders[0].base);
CollisionCheck_SetAC(play, &play->colChkCtx, &this->colliders[1].base);
}

View file

@ -15,17 +15,17 @@ void EnCow_Init(Actor* thisx, PlayState* play);
void EnCow_Destroy(Actor* thisx, PlayState* play);
void EnCow_Update(Actor* thisx, PlayState* play);
void EnCow_Draw(Actor* thisx, PlayState* play);
void func_809DFE98(Actor* thisx, PlayState* play);
void func_809E0070(Actor* thisx, PlayState* play);
void EnCow_UpdateTail(Actor* thisx, PlayState* play);
void EnCow_DrawTail(Actor* thisx, PlayState* play);
void func_809DF494(EnCow* this, PlayState* play);
void func_809DF6BC(EnCow* this, PlayState* play);
void func_809DF778(EnCow* this, PlayState* play);
void func_809DF7D8(EnCow* this, PlayState* play);
void func_809DF870(EnCow* this, PlayState* play);
void func_809DF8FC(EnCow* this, PlayState* play);
void func_809DF96C(EnCow* this, PlayState* play);
void func_809DFA84(EnCow* this, PlayState* play);
void EnCow_UpdateAnimation(EnCow* this, PlayState* play);
void EnCow_TalkEnd(EnCow* this, PlayState* play);
void EnCow_GiveMilkWait(EnCow* this, PlayState* play);
void EnCow_GiveMilk(EnCow* this, PlayState* play);
void EnCow_CheckForEmptyBottle(EnCow* this, PlayState* play);
void EnCow_Talk(EnCow* this, PlayState* play);
void EnCow_Idle(EnCow* this, PlayState* play);
void EnCow_IdleTail(EnCow* this, PlayState* play);
const ActorInit En_Cow_InitVars = {
ACTOR_EN_COW,
@ -62,7 +62,7 @@ static ColliderCylinderInit sCylinderInit = {
static Vec3f D_809E010C = { 0.0f, -1300.0f, 1100.0f };
void func_809DEE00(Vec3f* vec, s16 rotY) {
void EnCow_RotateY(Vec3f* vec, s16 rotY) {
f32 xCalc;
f32 rotCalcTemp;
@ -73,13 +73,13 @@ void func_809DEE00(Vec3f* vec, s16 rotY) {
vec->x = xCalc;
}
void func_809DEE9C(EnCow* this) {
void EnCow_SetColliderPos(EnCow* this) {
Vec3f vec;
vec.y = 0.0f;
vec.x = 0.0f;
vec.z = 30.0f;
func_809DEE00(&vec, this->actor.shape.rot.y);
EnCow_RotateY(&vec, this->actor.shape.rot.y);
this->colliders[0].dim.pos.x = this->actor.world.pos.x + vec.x;
this->colliders[0].dim.pos.y = this->actor.world.pos.y;
this->colliders[0].dim.pos.z = this->actor.world.pos.z + vec.z;
@ -87,18 +87,18 @@ void func_809DEE9C(EnCow* this) {
vec.x = 0.0f;
vec.y = 0.0f;
vec.z = -20.0f;
func_809DEE00(&vec, this->actor.shape.rot.y);
EnCow_RotateY(&vec, this->actor.shape.rot.y);
this->colliders[1].dim.pos.x = this->actor.world.pos.x + vec.x;
this->colliders[1].dim.pos.y = this->actor.world.pos.y;
this->colliders[1].dim.pos.z = this->actor.world.pos.z + vec.z;
}
void func_809DEF94(EnCow* this) {
void EnCow_SetTailPos(EnCow* this) {
Vec3f vec;
VEC_SET(vec, 0.0f, 57.0f, -36.0f);
func_809DEE00(&vec, this->actor.shape.rot.y);
EnCow_RotateY(&vec, this->actor.shape.rot.y);
this->actor.world.pos.x += vec.x;
this->actor.world.pos.y += vec.y;
this->actor.world.pos.z += vec.z;
@ -117,8 +117,8 @@ void EnCow_Init(Actor* thisx, PlayState* play) {
Collider_SetCylinder(play, &this->colliders[0], &this->actor, &sCylinderInit);
Collider_InitCylinder(play, &this->colliders[1]);
Collider_SetCylinder(play, &this->colliders[1], &this->actor, &sCylinderInit);
func_809DEE9C(this);
this->actionFunc = func_809DF96C;
EnCow_SetColliderPos(this);
this->actionFunc = EnCow_Idle;
if (GameInteractor_Should(VB_DESPAWN_HORSE_RACE_COW,
(play->sceneNum == SCENE_LINKS_HOUSE &&
(!LINK_IS_ADULT || !Flags_GetEventChkInf(EVENTCHKINF_WON_COW_IN_MALONS_RACE))),
@ -137,10 +137,10 @@ void EnCow_Init(Actor* thisx, PlayState* play) {
case 1:
SkelAnime_InitFlex(play, &this->skelAnime, &gCowTailSkel, NULL, this->jointTable, this->morphTable, 6);
Animation_PlayLoop(&this->skelAnime, &gCowTailIdleAnim);
this->actor.update = func_809DFE98;
this->actor.draw = func_809E0070;
this->actionFunc = func_809DFA84;
func_809DEF94(this);
this->actor.update = EnCow_UpdateTail;
this->actor.draw = EnCow_DrawTail;
this->actionFunc = EnCow_IdleTail;
EnCow_SetTailPos(this);
this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED;
this->animationTimer = ((u32)(Rand_ZeroFloat(1000.0f)) & 0xFFFF) + 40.0f;
break;
@ -161,7 +161,7 @@ void EnCow_Destroy(Actor* thisx, PlayState* play) {
ResourceMgr_UnregisterSkeleton(&this->skelAnime);
}
void func_809DF494(EnCow* this, PlayState* play) {
void EnCow_UpdateAnimation(EnCow* this, PlayState* play) {
if (this->animationTimer > 0) {
this->animationTimer -= 1;
} else {
@ -196,63 +196,63 @@ void func_809DF494(EnCow* this, PlayState* play) {
}
}
void func_809DF6BC(EnCow* this, PlayState* play) {
void EnCow_TalkEnd(EnCow* this, PlayState* play) {
if ((Message_GetState(&play->msgCtx) == TEXT_STATE_EVENT) && Message_ShouldAdvance(play)) {
this->actor.flags &= ~ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED;
Message_CloseTextbox(play);
this->actionFunc = func_809DF96C;
this->actionFunc = EnCow_Idle;
}
}
void func_809DF730(EnCow* this, PlayState* play) {
void EnCow_GiveMilkEnd(EnCow* this, PlayState* play) {
if (Actor_TextboxIsClosing(&this->actor, play)) {
this->actor.flags &= ~ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED;
this->actionFunc = func_809DF96C;
this->actionFunc = EnCow_Idle;
}
}
void func_809DF778(EnCow* this, PlayState* play) {
void EnCow_GiveMilkWait(EnCow* this, PlayState* play) {
if (Actor_HasParent(&this->actor, play)) {
this->actor.parent = NULL;
this->actionFunc = func_809DF730;
this->actionFunc = EnCow_GiveMilkEnd;
} else {
Actor_OfferGetItem(&this->actor, play, GI_MILK, 10000.0f, 100.0f);
}
}
void func_809DF7D8(EnCow* this, PlayState* play) {
void EnCow_GiveMilk(EnCow* this, PlayState* play) {
if ((Message_GetState(&play->msgCtx) == TEXT_STATE_EVENT) && Message_ShouldAdvance(play)) {
this->actor.flags &= ~ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED;
Message_CloseTextbox(play);
this->actionFunc = func_809DF778;
this->actionFunc = EnCow_GiveMilkWait;
Actor_OfferGetItem(&this->actor, play, GI_MILK, 10000.0f, 100.0f);
}
}
void func_809DF870(EnCow* this, PlayState* play) {
void EnCow_CheckForEmptyBottle(EnCow* this, PlayState* play) {
if ((Message_GetState(&play->msgCtx) == TEXT_STATE_EVENT) && Message_ShouldAdvance(play)) {
if (Inventory_HasEmptyBottle()) {
Message_ContinueTextbox(play, 0x2007);
this->actionFunc = func_809DF7D8;
this->actionFunc = EnCow_GiveMilk;
} else {
Message_ContinueTextbox(play, 0x2013);
this->actionFunc = func_809DF6BC;
this->actionFunc = EnCow_TalkEnd;
}
}
}
void func_809DF8FC(EnCow* this, PlayState* play) {
void EnCow_Talk(EnCow* this, PlayState* play) {
if (Actor_ProcessTalkRequest(&this->actor, play)) {
this->actionFunc = func_809DF870;
this->actionFunc = EnCow_CheckForEmptyBottle;
} else {
this->actor.flags |= ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED;
func_8002F2CC(&this->actor, play, 170.0f);
this->actor.textId = 0x2006;
}
func_809DF494(this, play);
EnCow_UpdateAnimation(this, play);
}
void func_809DF96C(EnCow* this, PlayState* play) {
void EnCow_Idle(EnCow* this, PlayState* play) {
if ((play->msgCtx.ocarinaMode == OCARINA_MODE_00) || (play->msgCtx.ocarinaMode == OCARINA_MODE_04)) {
if (DREG(53) != 0) {
if (this->cowFlags & 4) {
@ -263,7 +263,7 @@ void func_809DF96C(EnCow* this, PlayState* play) {
(ABS((s16)(this->actor.yawTowardsPlayer - this->actor.shape.rot.y)) < 0x61A8)) {
DREG(53) = 0;
if (GameInteractor_Should(VB_GIVE_ITEM_FROM_COW, true, this)) {
this->actionFunc = func_809DF8FC;
this->actionFunc = EnCow_Talk;
this->actor.flags |= ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED;
func_8002F2CC(&this->actor, play, 170.0f);
this->actor.textId = 0x2006;
@ -278,10 +278,10 @@ void func_809DF96C(EnCow* this, PlayState* play) {
this->cowFlags &= ~0x4;
}
}
func_809DF494(this, play);
EnCow_UpdateAnimation(this, play);
}
void func_809DFA84(EnCow* this, PlayState* play) {
void EnCow_IdleTail(EnCow* this, PlayState* play) {
if (this->animationTimer > 0) {
this->animationTimer--;
} else {
@ -346,7 +346,7 @@ void EnCow_Update(Actor* thisx, PlayState* play2) {
Math_SmoothStepToS(&this->someRot.y, targetY, 0xA, 0xC8, 0xA);
}
void func_809DFE98(Actor* thisx, PlayState* play) {
void EnCow_UpdateTail(Actor* thisx, PlayState* play) {
EnCow* this = (EnCow*)thisx;
s32 pad;
@ -390,7 +390,7 @@ void EnCow_Draw(Actor* thisx, PlayState* play) {
SkelAnime_DrawSkeletonOpa(play, &this->skelAnime, EnCow_OverrideLimbDraw, EnCow_PostLimbDraw, this);
}
void func_809E0070(Actor* thisx, PlayState* play) {
void EnCow_DrawTail(Actor* thisx, PlayState* play) {
EnCow* this = (EnCow*)thisx;
Gfx_SetupDL_37Opa(play->state.gfxCtx);

View file

@ -21,6 +21,6 @@ typedef struct EnCow {
/* 0x027C */ EnCowActionFunc actionFunc;
} EnCow; // size = 0x0280
void func_809DEE9C(EnCow* enCow);
void EnCow_SetColliderPos(EnCow* enCow);
#endif

View file

@ -17,21 +17,21 @@ void EnDodojr_Destroy(Actor* thisx, PlayState* play);
void EnDodojr_Update(Actor* thisx, PlayState* play);
void EnDodojr_Draw(Actor* thisx, PlayState* play);
void func_809F73AC(EnDodojr* this, PlayState* play);
void func_809F7BE4(EnDodojr* this, PlayState* play);
void func_809F74C4(EnDodojr* this, PlayState* play);
void func_809F758C(EnDodojr* this, PlayState* play);
void func_809F786C(EnDodojr* this, PlayState* play);
void func_809F799C(EnDodojr* this, PlayState* play);
void func_809F78EC(EnDodojr* this, PlayState* play);
void func_809F773C(EnDodojr* this, PlayState* play);
void func_809F77AC(EnDodojr* this, PlayState* play);
void func_809F784C(EnDodojr* this, PlayState* play);
void func_809F7AB8(EnDodojr* this, PlayState* play);
void func_809F7A00(EnDodojr* this, PlayState* play);
void func_809F7B3C(EnDodojr* this, PlayState* play);
void func_809F7C48(EnDodojr* this, PlayState* play);
void func_809F768C(EnDodojr* this, PlayState* play);
void EnDodojr_WaitUnderground(EnDodojr* this, PlayState* play);
void EnDodojr_DropItem(EnDodojr* this, PlayState* play);
void EnDodojr_EmergeFromGround(EnDodojr* this, PlayState* play);
void EnDodojr_CrawlTowardsTarget(EnDodojr* this, PlayState* play);
void EnDodojr_StunnedBounce(EnDodojr* this, PlayState* play);
void EnDodojr_JumpAttackBounce(EnDodojr* this, PlayState* play);
void EnDodojr_Stunned(EnDodojr* this, PlayState* play);
void EnDodojr_SwallowBomb(EnDodojr* this, PlayState* play);
void EnDodojr_SwallowedBombDeathBounce(EnDodojr* this, PlayState* play);
void EnDodojr_SwallowedBombDeathSequence(EnDodojr* this, PlayState* play);
void EnDodojr_StandardDeathBounce(EnDodojr* this, PlayState* play);
void EnDodojr_Despawn(EnDodojr* this, PlayState* play);
void EnDodojr_DeathSequence(EnDodojr* this, PlayState* play);
void EnDodojr_WaitFreezeFrames(EnDodojr* this, PlayState* play);
void EnDodojr_EatBomb(EnDodojr* this, PlayState* play);
const ActorInit En_Dodojr_InitVars = {
ACTOR_EN_DODOJR,
@ -83,7 +83,7 @@ void EnDodojr_Init(Actor* thisx, PlayState* play) {
Actor_SetScale(&this->actor, 0.02f);
this->actionFunc = func_809F73AC;
this->actionFunc = EnDodojr_WaitUnderground;
}
void EnDodojr_Destroy(Actor* thisx, PlayState* play) {
@ -94,12 +94,12 @@ void EnDodojr_Destroy(Actor* thisx, PlayState* play) {
ResourceMgr_UnregisterSkeleton(&this->skelAnime);
}
void func_809F64D0(EnDodojr* this) {
void EnDodojr_DoSwallowedBombEffects(EnDodojr* this) {
Audio_PlayActorSound2(&this->actor, NA_SE_IT_BOMB_EXPLOSION);
Actor_SetColorFilter(&this->actor, 0x4000, 200, 0, 8);
}
void func_809F6510(EnDodojr* this, PlayState* play, s32 count) {
void EnDodojr_SpawnLargeDust(EnDodojr* this, PlayState* play, s32 count) {
Color_RGBA8 prim = { 170, 130, 90, 255 };
Color_RGBA8 env = { 100, 60, 20, 0 };
Vec3f velocity = { 0.0f, 0.0f, 0.0f };
@ -121,7 +121,7 @@ void func_809F6510(EnDodojr* this, PlayState* play, s32 count) {
}
}
void func_809F6730(EnDodojr* this, PlayState* play, Vec3f* arg2) {
void EnDodojr_SpawnSmallDust(EnDodojr* this, PlayState* play, Vec3f* arg2) {
Color_RGBA8 prim = { 170, 130, 90, 255 };
Color_RGBA8 env = { 100, 60, 20, 0 };
Vec3f velocity = { 0.0f, 0.0f, 0.0f };
@ -140,7 +140,7 @@ void func_809F6730(EnDodojr* this, PlayState* play, Vec3f* arg2) {
func_8002836C(play, &pos, &velocity, &accel, &prim, &env, 100, 60, 8);
}
s32 func_809F68B0(EnDodojr* this, PlayState* play) {
s32 EnDodojr_UpdateBounces(EnDodojr* this, PlayState* play) {
if (this->actor.velocity.y >= 0.0f) {
return 0;
}
@ -152,7 +152,7 @@ s32 func_809F68B0(EnDodojr* this, PlayState* play) {
if (this->actor.bgCheckFlags & 1) {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_DODO_M_GND);
this->dustPos = this->actor.world.pos;
func_809F6510(this, play, 10);
EnDodojr_SpawnLargeDust(this, play, 10);
this->actor.velocity.y = 10.0f / (4 - this->counter);
this->counter--;
@ -165,7 +165,7 @@ s32 func_809F68B0(EnDodojr* this, PlayState* play) {
return 0;
}
void func_809F6994(EnDodojr* this) {
void EnDodojr_SetupCrawlTowardsTarget(EnDodojr* this) {
f32 lastFrame = Animation_GetLastFrame(&object_dodojr_Anim_000860);
Animation_Change(&this->skelAnime, &object_dodojr_Anim_000860, 1.8f, 0.0f, lastFrame, ANIMMODE_LOOP_INTERP, -10.0f);
@ -174,7 +174,7 @@ void func_809F6994(EnDodojr* this) {
this->actor.gravity = -0.8f;
}
void func_809F6A20(EnDodojr* this) {
void EnDodojr_SetupFlipBounce(EnDodojr* this) {
f32 lastFrame = Animation_GetLastFrame(&object_dodojr_Anim_0004A0);
Animation_Change(&this->skelAnime, &object_dodojr_Anim_0004A0, 1.0f, 0.0f, lastFrame, ANIMMODE_ONCE, -10.0f);
@ -190,7 +190,7 @@ void func_809F6A20(EnDodojr* this) {
GameInteractor_ExecuteOnEnemyDefeat(&this->actor);
}
void func_809F6AC4(EnDodojr* this) {
void EnDodojr_SetupSwallowedBombDeathSequence(EnDodojr* this) {
f32 lastFrame = Animation_GetLastFrame(&object_dodojr_Anim_0005F0);
Animation_Change(&this->skelAnime, &object_dodojr_Anim_0005F0, 1.0f, 0.0f, lastFrame, ANIMMODE_LOOP, 0.0f);
@ -198,7 +198,7 @@ void func_809F6AC4(EnDodojr* this) {
this->actor.gravity = -0.8f;
}
void func_809F6B38(EnDodojr* this) {
void EnDodojr_SetupJumpAttackBounce(EnDodojr* this) {
f32 lastFrame = Animation_GetLastFrame(&object_dodojr_Anim_000724);
Animation_Change(&this->skelAnime, &object_dodojr_Anim_000724, 1.0f, 0.0f, lastFrame, ANIMMODE_LOOP, -10.0f);
@ -207,7 +207,7 @@ void func_809F6B38(EnDodojr* this) {
this->actor.velocity.y = 10.0f;
}
void func_809F6BBC(EnDodojr* this) {
void EnDodojr_SetupDespawn(EnDodojr* this) {
this->actor.shape.shadowDraw = NULL;
this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED;
this->actor.home.pos = this->actor.world.pos;
@ -217,7 +217,7 @@ void func_809F6BBC(EnDodojr* this) {
this->dustPos = this->actor.world.pos;
}
void func_809F6C24(EnDodojr* this) {
void EnDodojr_SetupEatBomb(EnDodojr* this) {
Animation_Change(&this->skelAnime, &object_dodojr_Anim_000724, 1.0f, 8.0f, 12.0f, ANIMMODE_ONCE, 0.0f);
Audio_PlayActorSound2(&this->actor, NA_SE_EN_DODO_M_EAT);
this->actor.speedXZ = 0.0f;
@ -226,7 +226,7 @@ void func_809F6C24(EnDodojr* this) {
this->actor.gravity = -0.8f;
}
s32 func_809F6CA4(EnDodojr* this, PlayState* play) {
s32 EnDodojr_CheckNearbyBombs(EnDodojr* this, PlayState* play) {
Actor* bomb;
Vec3f unkVec = { 99999.0f, 99999.0f, 99999.0f };
s32 retVar = 0;
@ -267,7 +267,7 @@ s32 func_809F6CA4(EnDodojr* this, PlayState* play) {
return retVar;
}
s32 func_809F6DD0(EnDodojr* this) {
s32 EnDodojr_TryEatBomb(EnDodojr* this) {
if (this->bomb == NULL) {
return 0;
} else if (this->bomb->parent != NULL) {
@ -280,7 +280,7 @@ s32 func_809F6DD0(EnDodojr* this) {
}
}
void func_809F6E54(EnDodojr* this, PlayState* play) {
void EnDodojr_UpdateCrawl(EnDodojr* this, PlayState* play) {
f32 angles[] = { 0.0f, 210.0f, 60.0f, 270.0f, 120.0f, 330.0f, 180.0f, 30.0f, 240.0f, 90.0f, 300.0f, 150.0f };
s32 pad;
Player* player = GET_PLAYER(play);
@ -289,7 +289,7 @@ void func_809F6E54(EnDodojr* this, PlayState* play) {
if ((this->bomb == NULL) || (this->bomb->update == NULL) ||
((this->bomb != NULL) && (this->bomb->parent != NULL))) {
func_809F6CA4(this, play);
EnDodojr_CheckNearbyBombs(this, play);
}
if (this->bomb != NULL) {
@ -311,7 +311,7 @@ void func_809F6E54(EnDodojr* this, PlayState* play) {
this->actor.shape.rot.y = this->actor.world.rot.y;
}
s32 func_809F706C(EnDodojr* this) {
s32 EnDodojr_IsPlayerWithinAttackRange(EnDodojr* this) {
if (this->actor.xzDistToPlayer > 40.0f) {
return 0;
} else {
@ -319,28 +319,28 @@ s32 func_809F706C(EnDodojr* this) {
}
}
void func_809F709C(EnDodojr* this) {
void EnDodojr_SetupStandardDeathBounce(EnDodojr* this) {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_DODO_M_DEAD);
this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED;
func_809F6A20(this);
this->actionFunc = func_809F7AB8;
EnDodojr_SetupFlipBounce(this);
this->actionFunc = EnDodojr_StandardDeathBounce;
}
s32 func_809F70E8(EnDodojr* this, PlayState* play) {
if ((this->actionFunc == func_809F773C) || (this->actionFunc == func_809F77AC) ||
(this->actionFunc == func_809F784C) || (this->actionFunc == func_809F7A00) ||
(this->actionFunc == func_809F7AB8) || (this->actionFunc == func_809F7B3C) ||
(this->actionFunc == func_809F7BE4)) {
s32 EnDodojr_CheckDamaged(EnDodojr* this, PlayState* play) {
if ((this->actionFunc == EnDodojr_SwallowBomb) || (this->actionFunc == EnDodojr_SwallowedBombDeathBounce) ||
(this->actionFunc == EnDodojr_SwallowedBombDeathSequence) || (this->actionFunc == EnDodojr_Despawn) ||
(this->actionFunc == EnDodojr_StandardDeathBounce) || (this->actionFunc == EnDodojr_DeathSequence) ||
(this->actionFunc == EnDodojr_DropItem)) {
return 0;
}
if (play->actorCtx.unk_02 != 0) {
if (this->actionFunc != func_809F73AC) {
if (this->actionFunc == func_809F74C4) {
if (this->actionFunc != EnDodojr_WaitUnderground) {
if (this->actionFunc == EnDodojr_EmergeFromGround) {
this->actor.shape.shadowDraw = ActorShadow_DrawCircle;
}
func_809F709C(this);
EnDodojr_SetupStandardDeathBounce(this);
}
return 0;
}
@ -350,42 +350,42 @@ s32 func_809F70E8(EnDodojr* this, PlayState* play) {
} else {
this->collider.base.acFlags &= ~2;
if ((this->actionFunc == func_809F73AC) || (this->actionFunc == func_809F74C4)) {
if ((this->actionFunc == EnDodojr_WaitUnderground) || (this->actionFunc == EnDodojr_EmergeFromGround)) {
this->actor.shape.shadowDraw = ActorShadow_DrawCircle;
}
if ((this->actor.colChkInfo.damageEffect == 0) && (this->actor.colChkInfo.damage != 0)) {
Enemy_StartFinishingBlow(play, &this->actor);
this->timer2 = 2;
this->actionFunc = func_809F7C48;
this->actionFunc = EnDodojr_WaitFreezeFrames;
return 1;
}
if ((this->actor.colChkInfo.damageEffect == 1) && (this->actionFunc != func_809F78EC) &&
(this->actionFunc != func_809F786C)) {
if ((this->actor.colChkInfo.damageEffect == 1) && (this->actionFunc != EnDodojr_Stunned) &&
(this->actionFunc != EnDodojr_StunnedBounce)) {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_GOMA_JR_FREEZE);
this->timer1 = 120;
Actor_SetColorFilter(&this->actor, 0, 200, 0, 120);
func_809F6A20(this);
this->actionFunc = func_809F786C;
EnDodojr_SetupFlipBounce(this);
this->actionFunc = EnDodojr_StunnedBounce;
}
return 0;
}
}
void func_809F72A4(EnDodojr* this, PlayState* play) {
void EnDodojr_UpdateCollider(EnDodojr* this, PlayState* play) {
Collider_UpdateCylinder(&this->actor, &this->collider);
if ((this->actionFunc != func_809F73AC) && (this->actionFunc != func_809F7BE4)) {
if ((this->actionFunc == func_809F74C4) || (this->actionFunc == func_809F758C) ||
(this->actionFunc == func_809F799C)) {
if ((this->actionFunc != EnDodojr_WaitUnderground) && (this->actionFunc != EnDodojr_DropItem)) {
if ((this->actionFunc == EnDodojr_EmergeFromGround) || (this->actionFunc == EnDodojr_CrawlTowardsTarget) ||
(this->actionFunc == EnDodojr_JumpAttackBounce)) {
CollisionCheck_SetAT(play, &play->colChkCtx, &this->collider.base);
}
if ((this->actionFunc == func_809F74C4) || (this->actionFunc == func_809F758C) ||
(this->actionFunc == func_809F786C) || (this->actionFunc == func_809F78EC) ||
(this->actionFunc == func_809F799C)) {
if ((this->actionFunc == EnDodojr_EmergeFromGround) || (this->actionFunc == EnDodojr_CrawlTowardsTarget) ||
(this->actionFunc == EnDodojr_StunnedBounce) || (this->actionFunc == EnDodojr_Stunned) ||
(this->actionFunc == EnDodojr_JumpAttackBounce)) {
CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base);
}
@ -393,7 +393,7 @@ void func_809F72A4(EnDodojr* this, PlayState* play) {
}
}
void func_809F73AC(EnDodojr* this, PlayState* play) {
void EnDodojr_WaitUnderground(EnDodojr* this, PlayState* play) {
f32 lastFrame = Animation_GetLastFrame(&object_dodojr_Anim_000860);
Player* player = GET_PLAYER(play);
f32 dist;
@ -411,59 +411,59 @@ void func_809F73AC(EnDodojr* this, PlayState* play) {
this->actor.shape.rot.x = this->actor.world.rot.x;
this->dustPos = this->actor.world.pos;
this->dustPos.y = this->actor.floorHeight;
this->actionFunc = func_809F74C4;
this->actionFunc = EnDodojr_EmergeFromGround;
}
}
}
void func_809F74C4(EnDodojr* this, PlayState* play) {
void EnDodojr_EmergeFromGround(EnDodojr* this, PlayState* play) {
f32 sp2C;
Math_SmoothStepToS(&this->actor.shape.rot.x, 0, 4, 0x3E8, 0x64);
sp2C = this->actor.shape.rot.x;
sp2C /= 16384.0f;
this->actor.world.pos.y = this->actor.home.pos.y + (60.0f * sp2C);
func_809F6510(this, play, 3);
EnDodojr_SpawnLargeDust(this, play, 3);
if (sp2C == 0.0f) {
this->actor.shape.shadowDraw = ActorShadow_DrawCircle;
this->actor.world.rot.x = this->actor.shape.rot.x;
this->actor.speedXZ = 2.6f;
this->actionFunc = func_809F758C;
this->actionFunc = EnDodojr_CrawlTowardsTarget;
}
}
void func_809F758C(EnDodojr* this, PlayState* play) {
void EnDodojr_CrawlTowardsTarget(EnDodojr* this, PlayState* play) {
Actor_UpdateVelocityXZGravity(&this->actor);
func_809F6730(this, play, &this->actor.world.pos);
EnDodojr_SpawnSmallDust(this, play, &this->actor.world.pos);
if (DECR(this->timer4) == 0) {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_DODO_M_MOVE);
this->timer4 = 5;
}
if (func_809F6DD0(this) != 0) {
func_809F6C24(this);
this->actionFunc = func_809F768C;
if (EnDodojr_TryEatBomb(this) != 0) {
EnDodojr_SetupEatBomb(this);
this->actionFunc = EnDodojr_EatBomb;
return;
}
func_809F6E54(this, play);
EnDodojr_UpdateCrawl(this, play);
if (func_809F706C(this) != 0) {
if (EnDodojr_IsPlayerWithinAttackRange(this) != 0) {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_DODO_M_CRY);
func_809F6B38(this);
this->actionFunc = func_809F799C;
EnDodojr_SetupJumpAttackBounce(this);
this->actionFunc = EnDodojr_JumpAttackBounce;
}
if (this->actor.bgCheckFlags & 8) {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_DODO_M_DOWN);
func_809F6BBC(this);
this->actionFunc = func_809F7A00;
EnDodojr_SetupDespawn(this);
this->actionFunc = EnDodojr_Despawn;
}
}
void func_809F768C(EnDodojr* this, PlayState* play) {
void EnDodojr_EatBomb(EnDodojr* this, PlayState* play) {
EnBom* bomb;
if (((s16)this->skelAnime.curFrame - 8) < 4) {
@ -475,42 +475,42 @@ void func_809F768C(EnDodojr* this, PlayState* play) {
Actor_Kill(this->bomb);
this->timer3 = 24;
this->counter = 0;
this->actionFunc = func_809F773C;
this->actionFunc = EnDodojr_SwallowBomb;
}
}
void func_809F773C(EnDodojr* this, PlayState* play) {
void EnDodojr_SwallowBomb(EnDodojr* this, PlayState* play) {
if (DECR(this->timer3) == 0) {
func_809F64D0(this);
EnDodojr_DoSwallowedBombEffects(this);
this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED;
func_809F6A20(this);
this->actionFunc = func_809F77AC;
EnDodojr_SetupFlipBounce(this);
this->actionFunc = EnDodojr_SwallowedBombDeathBounce;
}
}
void func_809F77AC(EnDodojr* this, PlayState* play) {
void EnDodojr_SwallowedBombDeathBounce(EnDodojr* this, PlayState* play) {
this->rootScale = 1.2f;
this->rootScale *= ((f32)this->actor.colorFilterTimer / 8);
Actor_UpdateVelocityXZGravity(&this->actor);
if (func_809F68B0(this, play) != 0) {
if (EnDodojr_UpdateBounces(this, play) != 0) {
this->timer3 = 60;
func_809F6AC4(this);
EnDodojr_SetupSwallowedBombDeathSequence(this);
this->counter = 7;
this->actionFunc = func_809F784C;
this->actionFunc = EnDodojr_SwallowedBombDeathSequence;
}
}
void func_809F784C(EnDodojr* this, PlayState* play) {
func_809F7B3C(this, play);
void EnDodojr_SwallowedBombDeathSequence(EnDodojr* this, PlayState* play) {
EnDodojr_DeathSequence(this, play);
}
void func_809F786C(EnDodojr* this, PlayState* play) {
void EnDodojr_StunnedBounce(EnDodojr* this, PlayState* play) {
Actor_UpdateVelocityXZGravity(&this->actor);
if (func_809F68B0(this, play) != 0) {
func_809F6AC4(this);
this->actionFunc = func_809F78EC;
if (EnDodojr_UpdateBounces(this, play) != 0) {
EnDodojr_SetupSwallowedBombDeathSequence(this);
this->actionFunc = EnDodojr_Stunned;
}
Math_SmoothStepToS(&this->actor.shape.rot.y, 0, 4, 1000, 10);
@ -518,7 +518,7 @@ void func_809F786C(EnDodojr* this, PlayState* play) {
this->actor.colorFilterTimer = this->timer1;
}
void func_809F78EC(EnDodojr* this, PlayState* play) {
void EnDodojr_Stunned(EnDodojr* this, PlayState* play) {
if (DECR(this->timer1) != 0) {
if (this->timer1 < 30) {
if ((this->timer1 & 1) != 0) {
@ -532,22 +532,22 @@ void func_809F78EC(EnDodojr* this, PlayState* play) {
return;
}
} else {
func_809F6994(this);
this->actionFunc = func_809F758C;
EnDodojr_SetupCrawlTowardsTarget(this);
this->actionFunc = EnDodojr_CrawlTowardsTarget;
}
}
void func_809F799C(EnDodojr* this, PlayState* play) {
void EnDodojr_JumpAttackBounce(EnDodojr* this, PlayState* play) {
this->actor.flags |= ACTOR_FLAG_SFX_FOR_PLAYER_BODY_HIT;
Actor_UpdateVelocityXZGravity(&this->actor);
if (func_809F68B0(this, play) != 0) {
func_809F6994(this);
this->actionFunc = func_809F758C;
if (EnDodojr_UpdateBounces(this, play) != 0) {
EnDodojr_SetupCrawlTowardsTarget(this);
this->actionFunc = EnDodojr_CrawlTowardsTarget;
}
}
void func_809F7A00(EnDodojr* this, PlayState* play) {
void EnDodojr_Despawn(EnDodojr* this, PlayState* play) {
f32 tmp;
Math_SmoothStepToS(&this->actor.shape.rot.x, 0x4000, 4, 1000, 100);
@ -559,23 +559,23 @@ void func_809F7A00(EnDodojr* this, PlayState* play) {
Actor_Kill(&this->actor);
}
func_809F6510(this, play, 3);
EnDodojr_SpawnLargeDust(this, play, 3);
}
void func_809F7AB8(EnDodojr* this, PlayState* play) {
void EnDodojr_StandardDeathBounce(EnDodojr* this, PlayState* play) {
Actor_UpdateVelocityXZGravity(&this->actor);
Math_SmoothStepToS(&this->actor.shape.rot.y, 0, 4, 1000, 10);
this->actor.world.rot.x = this->actor.shape.rot.x;
if (func_809F68B0(this, play) != 0) {
if (EnDodojr_UpdateBounces(this, play) != 0) {
this->timer3 = 60;
func_809F6AC4(this);
EnDodojr_SetupSwallowedBombDeathSequence(this);
this->counter = 7;
this->actionFunc = func_809F7B3C;
this->actionFunc = EnDodojr_DeathSequence;
}
}
void func_809F7B3C(EnDodojr* this, PlayState* play) {
void EnDodojr_DeathSequence(EnDodojr* this, PlayState* play) {
EnBom* bomb;
if (this->counter != 0) {
@ -592,20 +592,20 @@ void func_809F7B3C(EnDodojr* this, PlayState* play) {
}
this->timer3 = 8;
this->actionFunc = func_809F7BE4;
this->actionFunc = EnDodojr_DropItem;
}
}
void func_809F7BE4(EnDodojr* this, PlayState* play) {
void EnDodojr_DropItem(EnDodojr* this, PlayState* play) {
if (DECR(this->timer3) == 0) {
Item_DropCollectibleRandom(play, NULL, &this->actor.world.pos, 0x40);
Actor_Kill(&this->actor);
}
}
void func_809F7C48(EnDodojr* this, PlayState* play) {
void EnDodojr_WaitFreezeFrames(EnDodojr* this, PlayState* play) {
if (DECR(this->timer2) == 0) {
func_809F709C(this);
EnDodojr_SetupStandardDeathBounce(this);
}
}
@ -614,18 +614,18 @@ void EnDodojr_Update(Actor* thisx, PlayState* play) {
SkelAnime_Update(&this->skelAnime);
Actor_MoveXZGravity(&this->actor);
func_809F70E8(this, play);
EnDodojr_CheckDamaged(this, play);
if (this->actionFunc != func_809F73AC) {
if (this->actionFunc != EnDodojr_WaitUnderground) {
Actor_UpdateBgCheckInfo(play, &this->actor, this->collider.dim.radius, this->collider.dim.height, 0.0f, 5);
}
this->actionFunc(this, play);
Actor_SetFocus(&this->actor, 10.0f);
func_809F72A4(this, play);
EnDodojr_UpdateCollider(this, play);
}
s32 func_809F7D50(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void* thisx) {
s32 EnDodojr_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void* thisx) {
EnDodojr* this = (EnDodojr*)thisx;
Vec3f D_809F7F64 = { 480.0f, 620.0f, 0.0f };
@ -641,14 +641,15 @@ s32 func_809F7D50(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s
return false;
}
void func_809F7DFC(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, void* thisx) {
void EnDodojr_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, void* thisx) {
}
void EnDodojr_Draw(Actor* thisx, PlayState* play) {
EnDodojr* this = (EnDodojr*)thisx;
if ((this->actionFunc != func_809F73AC) && (this->actionFunc != func_809F7BE4)) {
if ((this->actionFunc != EnDodojr_WaitUnderground) && (this->actionFunc != EnDodojr_DropItem)) {
Gfx_SetupDL_25Opa(play->state.gfxCtx);
SkelAnime_DrawSkeletonOpa(play, &this->skelAnime, func_809F7D50, func_809F7DFC, &this->actor);
SkelAnime_DrawSkeletonOpa(play, &this->skelAnime, EnDodojr_OverrideLimbDraw, EnDodojr_PostLimbDraw,
&this->actor);
}
}

View file

@ -120,7 +120,7 @@ void EnDu_SetupAction(EnDu* this, EnDuActionFunc actionFunc) {
this->actionFunc = actionFunc;
}
u16 func_809FDC38(PlayState* play, Actor* actor) {
u16 EnDu_GetTextId(PlayState* play, Actor* actor) {
u16 reaction = Text_GetFaceReaction(play, 0x21);
if (reaction != 0) {
@ -140,7 +140,7 @@ u16 func_809FDC38(PlayState* play, Actor* actor) {
}
}
s16 func_809FDCDC(PlayState* play, Actor* actor) {
s16 EnDu_UpdateTalkState(PlayState* play, Actor* actor) {
switch (Message_GetState(&play->msgCtx)) {
case TEXT_STATE_NONE:
case TEXT_STATE_DONE_HAS_NEXT:
@ -623,7 +623,7 @@ void EnDu_Update(Actor* thisx, PlayState* play) {
if (this->actionFunc != func_809FE4A4) {
Npc_UpdateTalking(play, &this->actor, &this->interactInfo.talkState, this->collider.dim.radius + 116.0f,
func_809FDC38, func_809FDCDC);
EnDu_GetTextId, EnDu_UpdateTalkState);
}
this->actionFunc(this, play);
}

View file

@ -234,7 +234,7 @@ void EnGe1_KickPlayer(EnGe1* this, PlayState* play) {
if (this->cutsceneTimer > 0) {
this->cutsceneTimer--;
} else {
func_8006D074(play);
Horse_ResetHorseData(play);
if ((INV_CONTENT(ITEM_HOOKSHOT) == ITEM_NONE) || (INV_CONTENT(ITEM_LONGSHOT) == ITEM_NONE)) {
play->nextEntranceIndex = ENTR_GERUDO_VALLEY_1;

View file

@ -243,7 +243,7 @@ void EnGe2_CaptureClose(EnGe2* this, PlayState* play) {
if (this->timer > 0) {
this->timer--;
} else {
func_8006D074(play);
Horse_ResetHorseData(play);
if ((INV_CONTENT(ITEM_HOOKSHOT) == ITEM_NONE) || (INV_CONTENT(ITEM_LONGSHOT) == ITEM_NONE)) {
play->nextEntranceIndex = ENTR_GERUDO_VALLEY_1;
@ -273,7 +273,7 @@ void EnGe2_CaptureCharge(EnGe2* this, PlayState* play) {
if (this->timer > 0) {
this->timer--;
} else {
func_8006D074(play);
Horse_ResetHorseData(play);
if ((INV_CONTENT(ITEM_HOOKSHOT) == ITEM_NONE) || (INV_CONTENT(ITEM_LONGSHOT) == ITEM_NONE)) {
play->nextEntranceIndex = ENTR_GERUDO_VALLEY_1;

View file

@ -532,7 +532,7 @@ void EnHorse_RaceWaypointPos(RaceWaypoint* waypoints, s32 idx, Vec3f* pos) {
}
void EnHorse_RotateToPoint(EnHorse* this, PlayState* play, Vec3f* pos, s16 turnAmount) {
func_8006DD9C(&this->actor, pos, turnAmount);
Horse_RotateToPoint(&this->actor, pos, turnAmount);
}
void EnHorse_UpdateIngoRaceInfo(EnHorse* this, PlayState* play, RaceInfo* raceInfo) {

View file

@ -453,7 +453,7 @@ void func_80A6A5A4(EnHorseLinkChild* this, PlayState* play) {
yawDiff = Actor_WorldYawTowardActor(&this->actor, &GET_PLAYER(play)->actor) - this->actor.world.rot.y;
// 0.7071 = cos(pi/4)
if ((Math_CosS(yawDiff) < 0.7071f) && (this->animationIdx == 2)) {
func_8006DD9C(&this->actor, &GET_PLAYER(play)->actor.world.pos, 300);
Horse_RotateToPoint(&this->actor, &GET_PLAYER(play)->actor.world.pos, 300);
}
if (SkelAnime_Update(&this->skin.skelAnime)) {
@ -490,9 +490,9 @@ void func_80A6A7D0(EnHorseLinkChild* this, PlayState* play) {
if ((this->animationIdx == 4) || (this->animationIdx == 3) || (this->animationIdx == 2)) {
if (!this->unk_1E8) {
func_8006DD9C(&this->actor, &player->actor.world.pos, 300);
Horse_RotateToPoint(&this->actor, &player->actor.world.pos, 300);
} else {
func_8006DD9C(&this->actor, &this->actor.home.pos, 300);
Horse_RotateToPoint(&this->actor, &this->actor.home.pos, 300);
}
}

View file

@ -14,9 +14,9 @@ void EnHorseZelda_Destroy(Actor* thisx, PlayState* play);
void EnHorseZelda_Update(Actor* thisx, PlayState* play);
void EnHorseZelda_Draw(Actor* thisx, PlayState* play);
void func_80A6DCCC(EnHorseZelda* this, PlayState* play);
void func_80A6DDFC(EnHorseZelda* this, PlayState* play);
void func_80A6DC7C(EnHorseZelda* this);
void EnHorseZelda_Stop(EnHorseZelda* this, PlayState* play);
void EnHorseZelda_Gallop(EnHorseZelda* this, PlayState* play);
void EnHorseZelda_SetupStop(EnHorseZelda* this);
const ActorInit En_Horse_Zelda_InitVars = {
ACTOR_EN_HORSE_ZELDA,
@ -101,27 +101,27 @@ static InitChainEntry sInitChain[] = {
};
static EnHorseZeldaActionFunc sActionFuncs[] = {
func_80A6DCCC,
func_80A6DDFC,
EnHorseZelda_Stop,
EnHorseZelda_Gallop,
};
void func_80A6D8D0(unknownStruct* data, s32 index, Vec3f* vec) {
void EnHorseZelda_GetFieldPosition(unknownStruct* data, s32 index, Vec3f* vec) {
vec->x = data[index].unk_0.x;
vec->y = data[index].unk_0.y;
vec->z = data[index].unk_0.z;
}
void func_80A6D918(EnHorseZelda* this, PlayState* play) {
void EnHorseZelda_Move(EnHorseZelda* this, PlayState* play) {
s32 pad;
Vec3f sp28;
s16 yawDiff;
func_80A6D8D0(D_80A6E240, this->fieldPosIndex, &sp28);
EnHorseZelda_GetFieldPosition(D_80A6E240, this->fieldPosIndex, &sp28);
if (Math3D_Vec3f_DistXYZ(&sp28, &this->actor.world.pos) <= 400.0f) {
this->fieldPosIndex++;
if (this->fieldPosIndex >= 14) {
this->fieldPosIndex = 0;
func_80A6D8D0(D_80A6E240, 0, &sp28);
EnHorseZelda_GetFieldPosition(D_80A6E240, 0, &sp28);
}
}
yawDiff = Math_Vec3f_Yaw(&this->actor.world.pos, &sp28) - this->actor.world.rot.y;
@ -167,7 +167,7 @@ void EnHorseZelda_Init(Actor* thisx, PlayState* play) {
Collider_SetJntSph(play, &this->colliderSphere, &this->actor, &sJntSphInit, &this->colliderSphereItem);
CollisionCheck_SetInfo(&this->actor.colChkInfo, NULL, &sColChkInfoInit);
this->animationIndex = 0;
func_80A6DC7C(this);
EnHorseZelda_SetupStop(this);
}
void EnHorseZelda_Destroy(Actor* thisx, PlayState* play) {
@ -178,7 +178,7 @@ void EnHorseZelda_Destroy(Actor* thisx, PlayState* play) {
Skin_Free(play, &this->skin);
}
void func_80A6DC7C(EnHorseZelda* this) {
void EnHorseZelda_SetupStop(EnHorseZelda* this) {
this->action = 0;
this->animationIndex++;
if (this->animationIndex > 0) {
@ -187,14 +187,14 @@ void func_80A6DC7C(EnHorseZelda* this) {
Animation_PlayOnce(&this->skin.skelAnime, sAnimationHeaders[this->animationIndex]);
}
void func_80A6DCCC(EnHorseZelda* this, PlayState* play) {
void EnHorseZelda_Stop(EnHorseZelda* this, PlayState* play) {
this->actor.speedXZ = 0.0f;
if (SkelAnime_Update(&this->skin.skelAnime)) {
func_80A6DC7C(this);
EnHorseZelda_SetupStop(this);
}
}
void func_80A6DD14(EnHorseZelda* this) {
void EnHorseZelda_Spur(EnHorseZelda* this) {
f32 sp34;
this->action = 1;
@ -207,14 +207,14 @@ void func_80A6DD14(EnHorseZelda* this) {
Animation_GetLastFrame(sAnimationHeaders[this->animationIndex]), ANIMMODE_ONCE, 0.0f);
}
void func_80A6DDFC(EnHorseZelda* this, PlayState* play) {
func_80A6D918(this, play);
void EnHorseZelda_Gallop(EnHorseZelda* this, PlayState* play) {
EnHorseZelda_Move(this, play);
if (SkelAnime_Update(&this->skin.skelAnime)) {
func_80A6DD14(this);
EnHorseZelda_Spur(this);
}
}
void func_80A6DE38(EnHorseZelda* this, PlayState* play) {
void EnHorseZelda_SetRotate(EnHorseZelda* this, PlayState* play) {
s32 pad;
CollisionPoly* poly;
s32 pad2;
@ -270,7 +270,7 @@ void EnHorseZelda_PostDraw(Actor* thisx, PlayState* play, Skin* skin) {
void EnHorseZelda_Draw(Actor* thisx, PlayState* play) {
EnHorseZelda* this = (EnHorseZelda*)thisx;
func_80A6DE38(this, play);
EnHorseZelda_SetRotate(this, play);
Gfx_SetupDL_25Opa(play->state.gfxCtx);
func_800A6330(&this->actor, play, &this->skin, EnHorseZelda_PostDraw, true);
}

View file

@ -25,14 +25,14 @@ void EnHy_Update(Actor* thisx, PlayState* play);
void EnHy_Draw(Actor* thisx, PlayState* play);
void EnHy_InitImpl(EnHy* this, PlayState* play);
void func_80A7134C(EnHy* this, PlayState* play);
void func_80A71530(EnHy* this, PlayState* play);
void func_80A711B4(EnHy* this, PlayState* play);
void func_80A712C0(EnHy* this, PlayState* play);
void func_80A710F8(EnHy* this, PlayState* play);
void func_80A7127C(EnHy* this, PlayState* play);
void EnHy_Pace(EnHy* this, PlayState* play);
void EnHy_FinishGivingDogFoundReward(EnHy* this, PlayState* play);
void EnHy_Walk(EnHy* this, PlayState* play);
void EnHy_SetupPace(EnHy* this, PlayState* play);
void EnHy_WatchDog(EnHy* this, PlayState* play);
void EnHy_Fidget(EnHy* this, PlayState* play);
void EnHy_DoNothing(EnHy* this, PlayState* play);
void func_80A714C4(EnHy* this, PlayState* play);
void EnHy_WaitDogFoundRewardGiven(EnHy* this, PlayState* play);
const ActorInit En_Hy_InitVars = {
ACTOR_EN_HY,
@ -411,13 +411,13 @@ s32 EnHy_IsOsAnimeObjectLoaded(EnHy* this, PlayState* play) {
return true;
}
void func_80A6F7CC(EnHy* this, PlayState* play, s32 getItemId) {
void EnHy_GiveItem(EnHy* this, PlayState* play, s32 getItemId) {
this->unkGetItemId = getItemId;
Actor_OfferGetItem(&this->actor, play, getItemId, this->actor.xzDistToPlayer + 1.0f,
fabsf(this->actor.yDistToPlayer) + 1.0f);
}
u16 func_80A6F810(PlayState* play, Actor* thisx) {
u16 EnHy_GetTextId(PlayState* play, Actor* thisx) {
Player* player = GET_PLAYER(play);
EnHy* this = (EnHy*)thisx;
u16 textId = Text_GetFaceReaction(play, (this->actor.params & 0x7F) + 37);
@ -569,7 +569,7 @@ u16 func_80A6F810(PlayState* play, Actor* thisx) {
}
}
s16 func_80A70058(PlayState* play, Actor* thisx) {
s16 EnHy_UpdateTalkState(PlayState* play, Actor* thisx) {
EnHy* this = (EnHy*)thisx;
s16 beggarItems[] = { ITEM_BLUE_FIRE, ITEM_FISH, ITEM_BUG, ITEM_FAIRY };
s16 beggarRewards[] = { 150, 100, 50, 25 };
@ -679,8 +679,8 @@ s16 func_80A70058(PlayState* play, Actor* thisx) {
break;
case 0x709F:
if (GameInteractor_Should(VB_GIVE_ITEM_FROM_LOST_DOG, true, this)) {
func_80A6F7CC(this, play, Flags_GetInfTable(INFTABLE_191) ? GI_RUPEE_BLUE : GI_HEART_PIECE);
this->actionFunc = func_80A714C4;
EnHy_GiveItem(this, play, Flags_GetInfTable(INFTABLE_191) ? GI_RUPEE_BLUE : GI_HEART_PIECE);
this->actionFunc = EnHy_WaitDogFoundRewardGiven;
}
break;
}
@ -740,7 +740,7 @@ void EnHy_UpdateCollider(EnHy* this, PlayState* play) {
CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base);
}
void func_80A70834(EnHy* this, PlayState* play) {
void EnHy_OfferBuyBottledItem(EnHy* this, PlayState* play) {
Player* player = GET_PLAYER(play);
if ((this->actor.params & 0x7F) == ENHY_TYPE_BOJ_5) {
@ -781,7 +781,7 @@ void func_80A70834(EnHy* this, PlayState* play) {
}
}
void func_80A70978(EnHy* this, PlayState* play) {
void EnHy_UpdateNPC(EnHy* this, PlayState* play) {
Player* player = GET_PLAYER(play);
s16 trackingMode;
@ -821,9 +821,9 @@ void func_80A70978(EnHy* this, PlayState* play) {
Npc_TrackPoint(&this->actor, &this->interactInfo, sInit1Info[this->actor.params & 0x7F].unkPresetIndex,
trackingMode);
if (Npc_UpdateTalking(play, &this->actor, &this->interactInfo.talkState, this->unkRange, func_80A6F810,
func_80A70058)) {
func_80A70834(this, play);
if (Npc_UpdateTalking(play, &this->actor, &this->interactInfo.talkState, this->unkRange, EnHy_GetTextId,
EnHy_UpdateTalkState)) {
EnHy_OfferBuyBottledItem(this, play);
}
}
@ -953,15 +953,15 @@ void EnHy_InitImpl(EnHy* this, PlayState* play) {
if (this->path != NULL) {
this->actor.speedXZ = 3.0f;
}
this->actionFunc = func_80A711B4;
this->actionFunc = EnHy_Walk;
break;
case ENHY_TYPE_BJI_7:
this->pathReverse = false;
this->actionFunc = func_80A712C0;
this->actionFunc = EnHy_SetupPace;
break;
case ENHY_TYPE_AOB:
if (play->sceneNum == SCENE_MARKET_DAY) {
this->actionFunc = func_80A710F8;
this->actionFunc = EnHy_WatchDog;
break;
}
// fall-through
@ -978,7 +978,7 @@ void EnHy_InitImpl(EnHy* this, PlayState* play) {
case ENHY_TYPE_BOB_18:
case ENHY_TYPE_BJI_19:
case ENHY_TYPE_AHG_20:
this->actionFunc = func_80A7127C;
this->actionFunc = EnHy_Fidget;
break;
case ENHY_TYPE_BOJ_5:
case ENHY_TYPE_BOJ_9:
@ -994,7 +994,7 @@ void EnHy_InitImpl(EnHy* this, PlayState* play) {
}
}
void func_80A710F8(EnHy* this, PlayState* play) {
void EnHy_WatchDog(EnHy* this, PlayState* play) {
if (this->interactInfo.talkState != NPC_TALK_STATE_IDLE) {
if (this->skelAnime.animation != &gObjOsAnim_0BFC) {
Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENHY_ANIM_26);
@ -1008,7 +1008,7 @@ void func_80A710F8(EnHy* this, PlayState* play) {
}
}
void func_80A711B4(EnHy* this, PlayState* play) {
void EnHy_Walk(EnHy* this, PlayState* play) {
s16 yaw;
f32 distSq;
@ -1024,24 +1024,24 @@ void func_80A711B4(EnHy* this, PlayState* play) {
}
}
void func_80A7127C(EnHy* this, PlayState* play) {
void EnHy_Fidget(EnHy* this, PlayState* play) {
func_80034F54(play, this->fidgetTableY, this->fidgetTableZ, 16);
}
void EnHy_DoNothing(EnHy* this, PlayState* play) {
}
void func_80A712C0(EnHy* this, PlayState* play) {
void EnHy_SetupPace(EnHy* this, PlayState* play) {
if ((this->actor.xzDistToPlayer <= 100.0f) && (this->path != NULL)) {
Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENHY_ANIM_7);
this->actor.speedXZ = 0.4f;
this->actionFunc = func_80A7134C;
this->actionFunc = EnHy_Pace;
}
func_80034F54(play, this->fidgetTableY, this->fidgetTableZ, 16);
}
void func_80A7134C(EnHy* this, PlayState* play) {
void EnHy_Pace(EnHy* this, PlayState* play) {
s16 yaw;
f32 distSq;
@ -1075,16 +1075,16 @@ void func_80A7134C(EnHy* this, PlayState* play) {
}
}
void func_80A714C4(EnHy* this, PlayState* play) {
void EnHy_WaitDogFoundRewardGiven(EnHy* this, PlayState* play) {
if (Actor_HasParent(&this->actor, play)) {
this->actionFunc = func_80A71530;
this->actionFunc = EnHy_FinishGivingDogFoundReward;
} else {
Actor_OfferGetItem(&this->actor, play, this->unkGetItemId, this->actor.xzDistToPlayer + 1.0f,
fabsf(this->actor.yDistToPlayer) + 1.0f);
}
}
void func_80A71530(EnHy* this, PlayState* play) {
void EnHy_FinishGivingDogFoundReward(EnHy* this, PlayState* play) {
if ((Message_GetState(&play->msgCtx) == TEXT_STATE_DONE) && Message_ShouldAdvance(play)) {
switch (this->unkGetItemId) {
case GI_HEART_PIECE:
@ -1099,7 +1099,7 @@ void func_80A71530(EnHy* this, PlayState* play) {
break;
}
this->actionFunc = func_80A7127C;
this->actionFunc = EnHy_Fidget;
}
}
@ -1119,7 +1119,7 @@ void EnHy_Update(Actor* thisx, PlayState* play) {
}
this->actionFunc(this, play);
func_80A70978(this, play);
EnHy_UpdateNPC(this, play);
EnHy_UpdateCollider(this, play);
}

View file

@ -62,6 +62,6 @@ typedef struct EnHy {
/* */ GetItemEntry getItemEntry;
} EnHy; // size = 0x0334
void func_80A7127C(EnHy* enHy, PlayState* play);
void EnHy_Fidget(EnHy* enHy, PlayState* play);
#endif

View file

@ -11,7 +11,7 @@ void EnIn_Update(Actor* thisx, PlayState* play);
void EnIn_Draw(Actor* thisx, PlayState* play);
void EnIn_Reset(void);
void func_80A79FB0(EnIn* this, PlayState* play);
void EnIn_WaitForObject(EnIn* this, PlayState* play);
void func_80A7A304(EnIn* this, PlayState* play);
void func_80A7A4C8(EnIn* this, PlayState* play);
void func_80A7A568(EnIn* this, PlayState* play);
@ -112,7 +112,7 @@ static Gfx* sAdultEraDLs[] = {
gIngoAdultEraMustacheDL,
};
u16 func_80A78FB0(PlayState* play) {
u16 EnIn_GetTextIdChild(PlayState* play) {
if (Flags_GetEventChkInf(EVENTCHKINF_TALON_RETURNED_FROM_CASTLE)) {
if (Flags_GetInfTable(INFTABLE_97)) {
return 0x2046;
@ -127,7 +127,7 @@ u16 func_80A78FB0(PlayState* play) {
}
}
u16 func_80A79010(PlayState* play) {
u16 EnIn_GetTextIdAdult(PlayState* play) {
Player* player = GET_PLAYER(play);
u16 temp_v0 = Text_GetFaceReaction(play, 25);
@ -180,20 +180,20 @@ u16 func_80A79010(PlayState* play) {
}
}
u16 func_80A79168(PlayState* play, Actor* thisx) {
u16 EnIn_GetTextId(PlayState* play, Actor* thisx) {
u16 temp_v0 = Text_GetFaceReaction(play, 25);
if (temp_v0 != 0) {
return temp_v0;
}
if (!LINK_IS_ADULT) {
return func_80A78FB0(play);
return EnIn_GetTextIdChild(play);
} else {
return func_80A79010(play);
return EnIn_GetTextIdAdult(play);
}
}
s16 func_80A791CC(PlayState* play, Actor* thisx) {
s16 EnIn_UpdateTalkStateOnClosing(PlayState* play, Actor* thisx) {
s32 ret = NPC_TALK_STATE_IDLE;
switch (thisx->textId) {
@ -211,7 +211,7 @@ s16 func_80A791CC(PlayState* play, Actor* thisx) {
return ret;
}
s16 func_80A7924C(PlayState* play, Actor* thisx) {
s16 EnIn_UpdateTalkStateOnChoice(PlayState* play, Actor* thisx) {
EnIn* this = (EnIn*)thisx;
s32 sp18 = NPC_TALK_STATE_TALKING;
@ -272,7 +272,7 @@ s16 func_80A7924C(PlayState* play, Actor* thisx) {
return sp18;
}
s16 func_80A7949C(PlayState* play, Actor* thisx) {
s16 EnIn_UpdateTalkStateOnEvent(PlayState* play, Actor* thisx) {
s32 phi_v1 = NPC_TALK_STATE_TALKING;
if (thisx->textId == 0x2035) {
@ -285,7 +285,7 @@ s16 func_80A7949C(PlayState* play, Actor* thisx) {
return phi_v1;
}
s16 func_80A79500(PlayState* play, Actor* thisx) {
s16 EnIn_UpdateTalkState(PlayState* play, Actor* thisx) {
s16 sp1E = NPC_TALK_STATE_TALKING;
osSyncPrintf("message_check->(%d[%x])\n", Message_GetState(&play->msgCtx), thisx->textId);
@ -294,18 +294,18 @@ s16 func_80A79500(PlayState* play, Actor* thisx) {
case TEXT_STATE_DONE_HAS_NEXT:
break;
case TEXT_STATE_CLOSING:
sp1E = func_80A791CC(play, thisx);
sp1E = EnIn_UpdateTalkStateOnClosing(play, thisx);
break;
case TEXT_STATE_DONE_FADING:
break;
case TEXT_STATE_CHOICE:
if (Message_ShouldAdvance(play)) {
sp1E = func_80A7924C(play, thisx);
sp1E = EnIn_UpdateTalkStateOnChoice(play, thisx);
}
break;
case TEXT_STATE_EVENT:
if (Message_ShouldAdvance(play)) {
sp1E = func_80A7949C(play, thisx);
sp1E = EnIn_UpdateTalkStateOnEvent(play, thisx);
}
break;
case TEXT_STATE_DONE:
@ -365,7 +365,7 @@ s32 func_80A7975C(EnIn* this, PlayState* play) {
return 1;
}
s32 func_80A79830(EnIn* this, PlayState* play) {
s32 EnIn_GetStartMode(EnIn* this, PlayState* play) {
if (play->sceneNum == SCENE_LON_LON_RANCH && LINK_IS_CHILD && IS_DAY && this->actor.shape.rot.z == 1 &&
!Flags_GetEventChkInf(EVENTCHKINF_TALON_RETURNED_FROM_CASTLE)) {
return 1;
@ -496,20 +496,20 @@ void EnIn_Init(Actor* thisx, PlayState* play) {
gSaveContext.eventInf[0] = 0;
D_80A7B998 = 1;
}
this->actionFunc = func_80A79FB0;
this->actionFunc = EnIn_WaitForObject;
}
void EnIn_Destroy(Actor* thisx, PlayState* play) {
EnIn* this = (EnIn*)thisx;
if (this->actionFunc != NULL && this->actionFunc != func_80A79FB0) {
if (this->actionFunc != NULL && this->actionFunc != EnIn_WaitForObject) {
Collider_DestroyCylinder(play, &this->collider);
ResourceMgr_UnregisterSkeleton(&this->skelAnime);
}
}
void func_80A79FB0(EnIn* this, PlayState* play) {
void EnIn_WaitForObject(EnIn* this, PlayState* play) {
s32 sp3C = 0;
if (Object_IsLoaded(&play->objectCtx, this->ingoObjBankIndex) || this->actor.params <= 0) {
@ -527,7 +527,7 @@ void func_80A79FB0(EnIn* this, PlayState* play) {
this->interactInfo.talkState = NPC_TALK_STATE_IDLE;
this->actionFunc = func_80A7A4BC;
switch (func_80A79830(this, play)) {
switch (EnIn_GetStartMode(this, play)) {
case 1:
EnIn_ChangeAnim(this, ENIN_ANIM_9);
this->actionFunc = func_80A7A4BC;
@ -913,7 +913,7 @@ void EnIn_Update(Actor* thisx, PlayState* play) {
ColliderCylinder* collider;
EnIn* this = (EnIn*)thisx;
if (this->actionFunc == func_80A79FB0) {
if (this->actionFunc == EnIn_WaitForObject) {
this->actionFunc(this, play);
return;
}
@ -937,7 +937,7 @@ void EnIn_Update(Actor* thisx, PlayState* play) {
} else {
Npc_UpdateTalking(play, &this->actor, &this->interactInfo.talkState,
((this->actor.targetMode == 6) ? 80.0f : 320.0f) + this->collider.dim.radius,
func_80A79168, func_80A79500);
EnIn_GetTextId, EnIn_UpdateTalkState);
if (this->interactInfo.talkState != NPC_TALK_STATE_IDLE) {
this->unk_1FA = this->unk_1F8;
this->unk_1F8 = Message_GetState(&play->msgCtx);
@ -1001,7 +1001,7 @@ void EnIn_Draw(Actor* thisx, PlayState* play) {
EnIn* this = (EnIn*)thisx;
OPEN_DISPS(play->state.gfxCtx);
if (this->actionFunc != func_80A79FB0) {
if (this->actionFunc != EnIn_WaitForObject) {
Gfx_SetupDL_25Opa(play->state.gfxCtx);
gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(eyeTextures[this->eyeIndex]));
gSPSegment(POLY_OPA_DISP++, 0x09, SEGMENTED_TO_VIRTUAL(gIngoHeadGradient2Tex));

View file

@ -17,21 +17,21 @@ void EnInsect_Update(Actor* thisx, PlayState* play);
void EnInsect_Draw(Actor* thisx, PlayState* play);
void EnInsect_Reset(void);
void func_80A7C3A0(EnInsect* this);
void func_80A7C3F4(EnInsect* this, PlayState* play);
void func_80A7C598(EnInsect* this);
void func_80A7C5EC(EnInsect* this, PlayState* play);
void func_80A7C818(EnInsect* this);
void func_80A7C86C(EnInsect* this, PlayState* play);
void func_80A7CAD0(EnInsect* this, PlayState* play);
void func_80A7CBC8(EnInsect* this);
void func_80A7CC3C(EnInsect* this, PlayState* play);
void func_80A7CE60(EnInsect* this);
void func_80A7CEC0(EnInsect* this, PlayState* play);
void func_80A7D1F4(EnInsect* this);
void func_80A7D26C(EnInsect* this, PlayState* play);
void func_80A7D39C(EnInsect* this);
void func_80A7D460(EnInsect* this, PlayState* play);
void EnInsect_SetupSlowDown(EnInsect* this);
void EnInsect_SlowDown(EnInsect* this, PlayState* play);
void EnInsect_SetupCrawl(EnInsect* this);
void EnInsect_Crawl(EnInsect* this, PlayState* play);
void EnInsect_SetupRunFromPlayer(EnInsect* this);
void EnInsect_RunFromPlayer(EnInsect* this, PlayState* play);
void EnInsect_Caught(EnInsect* this, PlayState* play);
void EnInsect_SetupDig(EnInsect* this);
void EnInsect_Dig(EnInsect* this, PlayState* play);
void EnInsect_SetupWalkOnWater(EnInsect* this);
void EnInsect_WalkOnWater(EnInsect* this, PlayState* play);
void EnInsect_SetupDrown(EnInsect* this);
void EnInsect_Drown(EnInsect* this, PlayState* play);
void EnInsect_SetupDropped(EnInsect* this);
void EnInsect_Dropped(EnInsect* this, PlayState* play);
f32 D_80A7DEB0 = 0.0f;
s16 D_80A7DEB4 = 0;
@ -86,7 +86,7 @@ static InitChainEntry sInitChain[] = {
ICHAIN_F32(uncullZoneDownward, 600, ICHAIN_STOP),
};
void func_80A7BE20(EnInsect* this) {
void EnInsect_InitFlags(EnInsect* this) {
this->insectFlags = D_80A7DF10[this->actor.params & 3];
}
@ -115,7 +115,7 @@ s32 EnInsect_InBottleRange(EnInsect* this, PlayState* play) {
return false;
}
void func_80A7BF58(EnInsect* this) {
void EnInsect_SetCrawlAnim(EnInsect* this) {
Animation_Change(&this->skelAnime, &gBugCrawlAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP_INTERP, 0.0f);
}
@ -151,7 +151,7 @@ s32 EnInsect_FoundNearbySoil(EnInsect* this, PlayState* play) {
return ret;
}
void func_80A7C058(EnInsect* this) {
void EnInsect_UpdateCrawlSfx(EnInsect* this) {
if (this->crawlSoundDelay > 0) {
this->crawlSoundDelay--;
return;
@ -173,7 +173,7 @@ void EnInsect_Init(Actor* thisx, PlayState* play2) {
s32 count;
Actor_ProcessInitChain(&this->actor, sInitChain);
func_80A7BE20(this);
EnInsect_InitFlags(this);
temp_s2 = this->actor.params & 3;
@ -210,18 +210,18 @@ void EnInsect_Init(Actor* thisx, PlayState* play2) {
}
}
func_80A7D39C(this);
EnInsect_SetupDropped(this);
D_80A7DEB8++;
} else {
rand = Rand_ZeroOne();
if (rand < 0.3f) {
func_80A7C3A0(this);
EnInsect_SetupSlowDown(this);
} else if (rand < 0.4f) {
func_80A7C598(this);
EnInsect_SetupCrawl(this);
} else {
func_80A7C818(this);
EnInsect_SetupRunFromPlayer(this);
}
}
}
@ -239,14 +239,14 @@ void EnInsect_Destroy(Actor* thisx, PlayState* play) {
ResourceMgr_UnregisterSkeleton(&this->skelAnime);
}
void func_80A7C3A0(EnInsect* this) {
void EnInsect_SetupSlowDown(EnInsect* this) {
this->actionTimer = Rand_S16Offset(5, 35);
func_80A7BF58(this);
this->actionFunc = func_80A7C3F4;
EnInsect_SetCrawlAnim(this);
this->actionFunc = EnInsect_SlowDown;
this->insectFlags |= 0x100;
}
void func_80A7C3F4(EnInsect* this, PlayState* play) {
void EnInsect_SlowDown(EnInsect* this, PlayState* play) {
s32 pad[2];
s16 sp2E;
f32 playSpeed;
@ -261,27 +261,27 @@ void func_80A7C3F4(EnInsect* this, PlayState* play) {
SkelAnime_Update(&this->skelAnime);
this->actor.shape.rot.y = this->actor.world.rot.y;
if (this->actionTimer <= 0) {
func_80A7C598(this);
EnInsect_SetupCrawl(this);
}
if (((this->insectFlags & 4) && this->lifeTimer <= 0) ||
((sp2E == 2 || sp2E == 3) && (this->insectFlags & 1) && (this->actor.bgCheckFlags & 1) && D_80A7DEB8 >= 4)) {
func_80A7CBC8(this);
EnInsect_SetupDig(this);
} else if ((this->insectFlags & 1) && (this->actor.bgCheckFlags & 0x40)) {
func_80A7CE60(this);
EnInsect_SetupWalkOnWater(this);
} else if (this->actor.xzDistToPlayer < 40.0f) {
func_80A7C818(this);
EnInsect_SetupRunFromPlayer(this);
}
}
void func_80A7C598(EnInsect* this) {
void EnInsect_SetupCrawl(EnInsect* this) {
this->actionTimer = Rand_S16Offset(10, 45);
func_80A7BF58(this);
this->actionFunc = func_80A7C5EC;
EnInsect_SetCrawlAnim(this);
this->actionFunc = EnInsect_Crawl;
this->insectFlags |= 0x100;
}
void func_80A7C5EC(EnInsect* this, PlayState* play) {
void EnInsect_Crawl(EnInsect* this, PlayState* play) {
s32 pad1;
s32 pad2;
s16 yaw;
@ -304,27 +304,27 @@ void func_80A7C5EC(EnInsect* this, PlayState* play) {
SkelAnime_Update(&this->skelAnime);
if (this->actionTimer <= 0) {
func_80A7C3A0(this);
EnInsect_SetupSlowDown(this);
}
if (((this->insectFlags & 4) && this->lifeTimer <= 0) ||
((sp34 == 2 || sp34 == 3) && (this->insectFlags & 1) && (this->actor.bgCheckFlags & 1) && D_80A7DEB8 >= 4)) {
func_80A7CBC8(this);
EnInsect_SetupDig(this);
} else if ((this->insectFlags & 1) && (this->actor.bgCheckFlags & 0x40)) {
func_80A7CE60(this);
EnInsect_SetupWalkOnWater(this);
} else if (this->actor.xzDistToPlayer < 40.0f) {
func_80A7C818(this);
EnInsect_SetupRunFromPlayer(this);
}
}
void func_80A7C818(EnInsect* this) {
void EnInsect_SetupRunFromPlayer(EnInsect* this) {
this->actionTimer = Rand_S16Offset(10, 40);
func_80A7BF58(this);
this->actionFunc = func_80A7C86C;
EnInsect_SetCrawlAnim(this);
this->actionFunc = EnInsect_RunFromPlayer;
this->insectFlags |= 0x100;
}
void func_80A7C86C(EnInsect* this, PlayState* play) {
void EnInsect_RunFromPlayer(EnInsect* this, PlayState* play) {
s32 pad1;
s32 pad2;
s16 pad3;
@ -358,13 +358,13 @@ void func_80A7C86C(EnInsect* this, PlayState* play) {
SkelAnime_Update(&this->skelAnime);
if (this->actionTimer <= 0 || !sp38) {
func_80A7C3A0(this);
EnInsect_SetupSlowDown(this);
} else if ((this->insectFlags & 1) && (this->actor.bgCheckFlags & 0x40)) {
func_80A7CE60(this);
EnInsect_SetupWalkOnWater(this);
}
}
void func_80A7CA64(EnInsect* this) {
void EnInsect_SetupCaught(EnInsect* this) {
this->actionTimer = 200;
Actor_SetScale(&this->actor, 0.001f);
@ -372,14 +372,14 @@ void func_80A7CA64(EnInsect* this) {
this->actor.draw = NULL;
this->actor.speedXZ = 0.0f;
func_80A7BF58(this);
EnInsect_SetCrawlAnim(this);
this->skelAnime.playSpeed = 0.3f;
this->actionFunc = func_80A7CAD0;
this->actionFunc = EnInsect_Caught;
this->insectFlags &= ~0x100;
}
void func_80A7CAD0(EnInsect* this, PlayState* play) {
void EnInsect_Caught(EnInsect* this, PlayState* play) {
if (this->actionTimer == 20 && !(this->insectFlags & 4)) {
this->actor.draw = EnInsect_Draw;
} else if (this->actionTimer == 0) {
@ -387,7 +387,7 @@ void func_80A7CAD0(EnInsect* this, PlayState* play) {
Actor_Kill(&this->actor);
} else {
Actor_SetScale(&this->actor, 0.01f);
func_80A7C3A0(this);
EnInsect_SetupSlowDown(this);
}
} else if (this->actionTimer < 20) {
Actor_SetScale(&this->actor, CLAMP_MAX(this->actor.scale.x + 0.001f, 0.01f));
@ -395,18 +395,18 @@ void func_80A7CAD0(EnInsect* this, PlayState* play) {
}
}
void func_80A7CBC8(EnInsect* this) {
void EnInsect_SetupDig(EnInsect* this) {
this->actionTimer = 60;
func_80A7BF58(this);
EnInsect_SetCrawlAnim(this);
this->skelAnime.playSpeed = 1.9f;
Audio_PlayActorSound2(&this->actor, NA_SE_EN_MUSI_SINK);
Math_Vec3f_Copy(&this->actor.home.pos, &this->actor.world.pos);
this->actionFunc = func_80A7CC3C;
this->actionFunc = EnInsect_Dig;
this->insectFlags &= ~0x100;
this->insectFlags |= 0x8;
}
void func_80A7CC3C(EnInsect* this, PlayState* play) {
void EnInsect_Dig(EnInsect* this, PlayState* play) {
static Vec3f accel = { 0.0f, 0.0f, 0.0f };
static Vec3f unused = { 0.0f, 0.0f, 0.0f };
s32 pad[2];
@ -440,15 +440,15 @@ void func_80A7CC3C(EnInsect* this, PlayState* play) {
}
}
void func_80A7CE60(EnInsect* this) {
void EnInsect_SetupWalkOnWater(EnInsect* this) {
this->actionTimer = Rand_S16Offset(120, 50);
func_80A7BF58(this);
EnInsect_SetCrawlAnim(this);
this->unk_316 = this->unk_318 = 0;
this->actionFunc = func_80A7CEC0;
this->actionFunc = EnInsect_WalkOnWater;
this->insectFlags &= ~0x100;
}
void func_80A7CEC0(EnInsect* this, PlayState* play) {
void EnInsect_WalkOnWater(EnInsect* this, PlayState* play) {
f32 temp_f0;
s16 temp_v1;
s16 pad;
@ -515,30 +515,30 @@ void func_80A7CEC0(EnInsect* this, PlayState* play) {
if (this->actionTimer <= 0 || ((this->insectFlags & 4) && this->lifeTimer <= 0) ||
((sp4E == 2 || sp4E == 3) && (this->insectFlags & 1) && D_80A7DEB8 >= 4)) {
func_80A7D1F4(this);
EnInsect_SetupDrown(this);
} else if (!(this->actor.bgCheckFlags & 0x40)) {
if (this->insectFlags & 0x10) {
func_80A7D39C(this);
EnInsect_SetupDropped(this);
} else {
func_80A7C3A0(this);
EnInsect_SetupSlowDown(this);
}
}
}
void func_80A7D1F4(EnInsect* this) {
void EnInsect_SetupDrown(EnInsect* this) {
this->actionTimer = 100;
func_80A7BF58(this);
EnInsect_SetCrawlAnim(this);
this->actor.velocity.y = 0.0f;
this->actor.speedXZ = 0.0f;
this->actor.minVelocityY = -0.8f;
this->actor.gravity = -0.04f;
this->insectFlags &= ~0x3;
this->actionFunc = func_80A7D26C;
this->actionFunc = EnInsect_Drown;
this->insectFlags &= ~0x100;
this->insectFlags |= 8;
}
void func_80A7D26C(EnInsect* this, PlayState* play) {
void EnInsect_Drown(EnInsect* this, PlayState* play) {
this->actor.shape.rot.x -= 500;
this->actor.shape.rot.y += 200;
Actor_SetScale(&this->actor, CLAMP_MIN(this->actor.scale.x - 0.00005f, 0.001f));
@ -552,19 +552,19 @@ void func_80A7D26C(EnInsect* this, PlayState* play) {
}
}
void func_80A7D39C(EnInsect* this) {
func_80A7BF58(this);
void EnInsect_SetupDropped(EnInsect* this) {
EnInsect_SetCrawlAnim(this);
this->actionTimer = 100;
this->unk_324 = 1.5f;
this->unk_328 = Rand_ZeroOne() * (0xFFFF + 0.5f);
this->unk_316 = (Rand_ZeroOne() - 0.5f) * 1500.0f;
this->actor.world.rot.y = Rand_ZeroOne() * (0xFFFF + 0.5f);
Actor_SetScale(&this->actor, 0.003f);
this->actionFunc = func_80A7D460;
this->actionFunc = EnInsect_Dropped;
this->insectFlags |= 0x100;
}
void func_80A7D460(EnInsect* this, PlayState* play) {
void EnInsect_Dropped(EnInsect* this, PlayState* play) {
s32 temp_a0;
s32 sp50;
f32 phi_f0;
@ -688,14 +688,14 @@ void func_80A7D460(EnInsect* this, PlayState* play) {
}
if ((this->insectFlags & 1) && (this->actor.bgCheckFlags & 0x40)) {
func_80A7CE60(this);
EnInsect_SetupWalkOnWater(this);
} else if (this->insectFlags & 0x10) {
if (sp40 < 9.0f) {
func_80A7CBC8(this);
EnInsect_SetupDig(this);
} else if (this->actionTimer <= 0 || this->lifeTimer <= 0 ||
((this->insectFlags & 1) && (this->actor.bgCheckFlags & 1) && D_80A7DEB8 >= 4 &&
(sp3A == 2 || sp3A == 3))) {
func_80A7CBC8(this);
EnInsect_SetupDig(this);
} else {
if (sp40 < 900.0f) {
this->lifeTimer++;
@ -705,7 +705,7 @@ void func_80A7D460(EnInsect* this, PlayState* play) {
}
}
} else if (sp50 != 0) {
func_80A7C3A0(this);
EnInsect_SetupSlowDown(this);
} else if ((sp3A == 2 || sp3A == 3) && (this->insectFlags & 1) && this->lifeTimer <= 0 && this->actionTimer <= 0 &&
this->actor.floorHeight < BGCHECK_Y_MIN + 10.0f) {
osSyncPrintf(VT_COL(YELLOW, BLACK));
@ -743,10 +743,10 @@ void EnInsect_Update(Actor* thisx, PlayState* play) {
if (this->insectFlags & 0x100) {
if (this->insectFlags & 1) {
if (this->actor.bgCheckFlags & 1) {
func_80A7C058(this);
EnInsect_UpdateCrawlSfx(this);
}
} else {
func_80A7C058(this);
EnInsect_UpdateCrawlSfx(this);
}
}
@ -772,9 +772,9 @@ void EnInsect_Update(Actor* thisx, PlayState* play) {
if (phi_v0 == 2 || phi_v0 == 3) {
Actor_Kill(&this->actor);
} else {
func_80A7CA64(this);
EnInsect_SetupCaught(this);
}
} else if (this->actor.xzDistToPlayer < 50.0f && this->actionFunc != func_80A7CAD0) {
} else if (this->actor.xzDistToPlayer < 50.0f && this->actionFunc != EnInsect_Caught) {
if (!(this->insectFlags & 0x20) && this->lifeTimer < 180) {
CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base);
}

View file

@ -8,9 +8,9 @@ void EnMThunder_Destroy(Actor* thisx, PlayState* play);
void EnMThunder_Update(Actor* thisx, PlayState* play);
void EnMThunder_Draw(Actor* thisx, PlayState* play);
void func_80A9F314(PlayState* play, f32 arg1);
void func_80A9F408(EnMThunder* this, PlayState* play);
void func_80A9F9B4(EnMThunder* this, PlayState* play);
void EnMThunder_AdjustEnvLights(PlayState* play, f32 intensity);
void EnMThunder_ChargingSpinAttack(EnMThunder* this, PlayState* play);
void EnMThunder_SpinAttacking(EnMThunder* this, PlayState* play);
const ActorInit En_M_Thunder_InitVars = {
ACTOR_EN_M_THUNDER,
@ -25,7 +25,7 @@ const ActorInit En_M_Thunder_InitVars = {
NULL,
};
static ColliderCylinderInit D_80AA0420 = {
static ColliderCylinderInit sCylinderInit = {
{
COLTYPE_NONE,
AT_ON | AT_TYPE_PLAYER,
@ -45,8 +45,8 @@ static ColliderCylinderInit D_80AA0420 = {
{ 200, 200, 0, { 0, 0, 0 } },
};
static u32 D_80AA044C[] = { 0x01000000, 0x00400000, 0x00800000 };
static u32 D_80AA0458[] = { 0x08000000, 0x02000000, 0x04000000 };
static u32 sSpinAttackDmgFlags[] = { 0x01000000, 0x00400000, 0x00800000 };
static u32 sJumpAttackDmgFlags[] = { 0x08000000, 0x02000000, 0x04000000 };
static u16 sSfxIds[] = {
NA_SE_IT_ROLLING_CUT_LV2,
@ -55,8 +55,7 @@ static u16 sSfxIds[] = {
NA_SE_IT_ROLLING_CUT_LV1,
};
// Setup action
void func_80A9EFE0(EnMThunder* this, EnMThunderActionFunc actionFunc) {
void EnMThunder_SetupAction(EnMThunder* this, EnMThunderActionFunc actionFunc) {
this->actionFunc = actionFunc;
}
@ -66,7 +65,7 @@ void EnMThunder_Init(Actor* thisx, PlayState* play2) {
Player* player = GET_PLAYER(play);
Collider_InitCylinder(play, &this->collider);
Collider_SetCylinder(play, &this->collider, &this->actor, &D_80AA0420);
Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit);
this->swordType = (this->actor.params & 0xFF) - 1;
Lights_PointNoGlowSetInfo(&this->lightInfo, this->actor.world.pos.x, this->actor.world.pos.y,
this->actor.world.pos.z, 255, 255, 255, 0);
@ -98,16 +97,16 @@ void EnMThunder_Init(Actor* thisx, PlayState* play2) {
player->stateFlags2 &= ~PLAYER_STATE2_SPIN_ATTACKING;
this->isUsingMagic = 1;
this->collider.info.toucher.dmgFlags = D_80AA044C[this->swordType];
this->collider.info.toucher.dmgFlags = sSpinAttackDmgFlags[this->swordType];
this->attackStrength = 1;
this->targetScale = ((this->swordType == 1) ? 2 : 4);
func_80A9EFE0(this, func_80A9F9B4);
EnMThunder_SetupAction(this, EnMThunder_SpinAttacking);
this->followPlayerTimer = 8;
Audio_PlaySoundGeneral(NA_SE_IT_ROLLING_CUT_LV1, &player->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
this->spinAttackTimer = 1.0f;
} else {
func_80A9EFE0(this, func_80A9F408);
EnMThunder_SetupAction(this, EnMThunder_ChargingSpinAttack);
}
this->actor.child = NULL;
}
@ -120,15 +119,15 @@ void EnMThunder_Destroy(Actor* thisx, PlayState* play) {
}
Collider_DestroyCylinder(play, &this->collider);
func_80A9F314(play, 0.0f);
EnMThunder_AdjustEnvLights(play, 0.0f);
LightContext_RemoveLight(play, &play->lightCtx, this->lightNode);
}
void func_80A9F314(PlayState* play, f32 arg1) {
Environment_AdjustLights(play, arg1, 850.0f, 0.2f, 0.0f);
void EnMThunder_AdjustEnvLights(PlayState* play, f32 intensity) {
Environment_AdjustLights(play, intensity, 850.0f, 0.2f, 0.0f);
}
void func_80A9F350(EnMThunder* this, PlayState* play) {
void EnMThunder_EmptySpinAttack(EnMThunder* this, PlayState* play) {
Player* player = GET_PLAYER(play);
if (player->stateFlags2 & PLAYER_STATE2_SPIN_ATTACKING) {
@ -148,7 +147,7 @@ void func_80A9F350(EnMThunder* this, PlayState* play) {
}
}
void func_80A9F408(EnMThunder* this, PlayState* play) {
void EnMThunder_ChargingSpinAttack(EnMThunder* this, PlayState* play) {
Player* player = GET_PLAYER(play);
Actor* child = this->actor.child;
@ -161,8 +160,8 @@ void func_80A9F408(EnMThunder* this, PlayState* play) {
if ((gSaveContext.magicState != MAGIC_STATE_IDLE) ||
(((this->actor.params & 0xFF00) >> 8) &&
!(Magic_RequestChange(play, (this->actor.params & 0xFF00) >> 8, MAGIC_CONSUME_WAIT_PREVIEW)))) {
func_80A9F350(this, play);
func_80A9EFE0(this, func_80A9F350);
EnMThunder_EmptySpinAttack(this, play);
EnMThunder_SetupAction(this, EnMThunder_EmptySpinAttack);
this->chargeAlpha = 0;
this->dimmingIntensity = 0.0;
this->spinAttackTimer = 0.0f;
@ -197,16 +196,16 @@ void func_80A9F408(EnMThunder* this, PlayState* play) {
gSaveContext.magicState = MAGIC_STATE_CONSUME_SETUP;
}
if (player->unk_858 < 0.85f) {
this->collider.info.toucher.dmgFlags = D_80AA044C[this->swordType];
this->collider.info.toucher.dmgFlags = sSpinAttackDmgFlags[this->swordType];
this->attackStrength = 1;
this->targetScale = ((this->swordType == 1) ? 2 : 4);
} else {
this->collider.info.toucher.dmgFlags = D_80AA0458[this->swordType];
this->collider.info.toucher.dmgFlags = sJumpAttackDmgFlags[this->swordType];
this->attackStrength = 0;
this->targetScale = ((this->swordType == 1) ? 4 : 8);
}
func_80A9EFE0(this, func_80A9F9B4);
EnMThunder_SetupAction(this, EnMThunder_SpinAttacking);
this->followPlayerTimer = 8;
Audio_PlaySoundGeneral(sSfxIds[this->attackStrength], &player->actor.projectedPos, 4,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
@ -252,7 +251,7 @@ void func_80A9F408(EnMThunder* this, PlayState* play) {
}
}
void func_80A9F938(EnMThunder* this, PlayState* play) {
void EnMThunder_UpdateSpinAttack(EnMThunder* this, PlayState* play) {
if (this->followPlayerTimer < 2) {
if (this->chargeAlpha < 40) {
this->chargeAlpha = 0;
@ -270,7 +269,7 @@ void func_80A9F938(EnMThunder* this, PlayState* play) {
}
}
void func_80A9F9B4(EnMThunder* this, PlayState* play) {
void EnMThunder_SpinAttacking(EnMThunder* this, PlayState* play) {
Player* player = GET_PLAYER(play);
if (Math_StepToF(&this->spinAttackTimer, 0.0f, 1 / 16.0f)) {
@ -295,7 +294,7 @@ void func_80A9F9B4(EnMThunder* this, PlayState* play) {
this->spinAttackAlpha = this->spinAttackTimer * (5.0f / 3.0f);
}
func_80A9F938(this, play);
EnMThunder_UpdateSpinAttack(this, play);
if (Play_InCsMode(play)) {
Actor_Kill(&this->actor);
@ -308,7 +307,7 @@ void EnMThunder_Update(Actor* thisx, PlayState* play) {
s32 redGreen;
this->actionFunc(this, play);
func_80A9F314(play, this->dimmingIntensity);
EnMThunder_AdjustEnvLights(play, this->dimmingIntensity);
blueRadius = this->spinAttackTimer;
redGreen = (u32)(blueRadius * 255.0f) & 0xFF;
Lights_PointNoGlowSetInfo(&this->lightInfo, this->actor.world.pos.x, this->actor.world.pos.y,
@ -317,7 +316,7 @@ void EnMThunder_Update(Actor* thisx, PlayState* play) {
}
void EnMThunder_Draw(Actor* thisx, PlayState* play2) {
static f32 D_80AA046C[] = { 0.1f, 0.15f, 0.2f, 0.25f, 0.3f, 0.25f, 0.2f, 0.15f };
static f32 sSpinChargeScale[] = { 0.1f, 0.15f, 0.2f, 0.25f, 0.3f, 0.25f, 0.2f, 0.15f };
PlayState* play = play2;
EnMThunder* this = (EnMThunder*)thisx;
Player* player = GET_PLAYER(play);
@ -385,7 +384,7 @@ void EnMThunder_Draw(Actor* thisx, PlayState* play2) {
}
if (this->spinChargePercent >= 0.85f) {
phi_f14 = (D_80AA046C[(play->gameplayFrames & 7)] * 6.0f) + 1.0f;
phi_f14 = (sSpinChargeScale[(play->gameplayFrames & 7)] * 6.0f) + 1.0f;
if (CVarGetInteger(CVAR_COSMETIC("SpinAttack.Level2Primary.Changed"), 0)) {
Color_RGB8 color =
CVarGetColor24(CVAR_COSMETIC("SpinAttack.Level2Primary.Value"), (Color_RGB8){ 255, 255, 170 });
@ -402,7 +401,7 @@ void EnMThunder_Draw(Actor* thisx, PlayState* play2) {
}
phi_t1 = 0x28;
} else {
phi_f14 = (D_80AA046C[play->gameplayFrames & 7] * 2.0f) + 1.0f;
phi_f14 = (sSpinChargeScale[play->gameplayFrames & 7] * 2.0f) + 1.0f;
if (CVarGetInteger(CVAR_COSMETIC("SpinAttack.Level1Primary.Changed"), 0)) {
Color_RGB8 color =
CVarGetColor24(CVAR_COSMETIC("SpinAttack.Level1Primary.Value"), (Color_RGB8){ 170, 255, 255 });

View file

@ -18,15 +18,15 @@ void EnMa1_Update(Actor* thisx, PlayState* play);
void EnMa1_Draw(Actor* thisx, PlayState* play);
u16 EnMa1_GetText(PlayState* play, Actor* this);
s16 func_80AA0778(PlayState* play, Actor* this);
s16 EnMa1_UpdateTalkState(PlayState* play, Actor* this);
void func_80AA0D88(EnMa1* this, PlayState* play);
void func_80AA0EA0(EnMa1* this, PlayState* play);
void func_80AA0EFC(EnMa1* this, PlayState* play);
void func_80AA0F44(EnMa1* this, PlayState* play);
void func_80AA106C(EnMa1* this, PlayState* play);
void func_80AA10EC(EnMa1* this, PlayState* play);
void func_80AA1150(EnMa1* this, PlayState* play);
void EnMa1_Idle(EnMa1* this, PlayState* play);
void EnMa1_GiveWeirdEgg(EnMa1* this, PlayState* play);
void EnMa1_FinishGivingWeirdEgg(EnMa1* this, PlayState* play);
void EnMa1_IdleTeachSong(EnMa1* this, PlayState* play);
void EnMa1_StartTeachSong(EnMa1* this, PlayState* play);
void EnMa1_TeachSong(EnMa1* this, PlayState* play);
void EnMa1_WaitForPlayback(EnMa1* this, PlayState* play);
void EnMa1_DoNothing(EnMa1* this, PlayState* play);
const ActorInit En_Ma1_InitVars = {
@ -131,7 +131,7 @@ u16 EnMa1_GetText(PlayState* play, Actor* thisx) {
return 0x2041;
}
s16 func_80AA0778(PlayState* play, Actor* thisx) {
s16 EnMa1_UpdateTalkState(PlayState* play, Actor* thisx) {
s16 ret = NPC_TALK_STATE_TALKING;
switch (Message_GetState(&play->msgCtx)) {
@ -188,7 +188,7 @@ s16 func_80AA0778(PlayState* play, Actor* thisx) {
return ret;
}
s32 func_80AA08C4(EnMa1* this, PlayState* play) {
s32 EnMa1_ShouldSpawn(EnMa1* this, PlayState* play) {
bool malonReturnedFromCastle = GameInteractor_Should(VB_MALON_RETURN_FROM_CASTLE,
Flags_GetEventChkInf(EVENTCHKINF_TALON_RETURNED_FROM_CASTLE));
@ -240,7 +240,7 @@ void EnMa1_ChangeAnim(EnMa1* this, s32 index) {
sAnimationInfo[index].mode, sAnimationInfo[index].morphFrames);
}
void func_80AA0AF4(EnMa1* this, PlayState* play) {
void EnMa1_UpdateTracking(EnMa1* this, PlayState* play) {
Player* player = GET_PLAYER(play);
s16 trackingMode;
@ -256,7 +256,7 @@ void func_80AA0AF4(EnMa1* this, PlayState* play) {
Npc_TrackPoint(&this->actor, &this->interactInfo, 0, trackingMode);
}
void func_80AA0B74(EnMa1* this) {
void EnMa1_UpdateSinging(EnMa1* this) {
if (this->skelAnime.animation == &gMalonChildSingAnim) {
if (this->interactInfo.talkState == NPC_TALK_STATE_IDLE) {
if (this->singingDisabled != 0) {
@ -286,7 +286,7 @@ void EnMa1_Init(Actor* thisx, PlayState* play) {
Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit);
CollisionCheck_SetInfo2(&this->actor.colChkInfo, DamageTable_Get(22), &sColChkInfoInit);
if (!func_80AA08C4(this, play)) {
if (!EnMa1_ShouldSpawn(this, play)) {
Actor_Kill(&this->actor);
return;
}
@ -297,10 +297,10 @@ void EnMa1_Init(Actor* thisx, PlayState* play) {
this->interactInfo.talkState = NPC_TALK_STATE_IDLE;
if (!malonReturnedFromCastle || malonTaughtEponasSong) {
this->actionFunc = func_80AA0D88;
this->actionFunc = EnMa1_Idle;
EnMa1_ChangeAnim(this, ENMA1_ANIM_2);
} else {
this->actionFunc = func_80AA0F44;
this->actionFunc = EnMa1_IdleTeachSong;
EnMa1_ChangeAnim(this, ENMA1_ANIM_2);
}
}
@ -312,7 +312,7 @@ void EnMa1_Destroy(Actor* thisx, PlayState* play) {
Collider_DestroyCylinder(play, &this->collider);
}
void func_80AA0D88(EnMa1* this, PlayState* play) {
void EnMa1_Idle(EnMa1* this, PlayState* play) {
bool malonReturnedFromCastle = GameInteractor_Should(VB_MALON_RETURN_FROM_CASTLE,
Flags_GetEventChkInf(EVENTCHKINF_TALON_RETURNED_FROM_CASTLE));
bool malonTaughtEponasSong =
@ -334,33 +334,33 @@ void func_80AA0D88(EnMa1* this, PlayState* play) {
}
} else if (!malonReturnedFromCastle || malonTaughtEponasSong) {
if (this->interactInfo.talkState == NPC_TALK_STATE_ACTION) {
this->actionFunc = func_80AA0EA0;
this->actionFunc = EnMa1_GiveWeirdEgg;
play->msgCtx.stateTimer = 4;
play->msgCtx.msgMode = MSGMODE_TEXT_CLOSING;
}
}
}
void func_80AA0EA0(EnMa1* this, PlayState* play) {
void EnMa1_GiveWeirdEgg(EnMa1* this, PlayState* play) {
if (Actor_HasParent(&this->actor, play) || !GameInteractor_Should(VB_GIVE_ITEM_WEIRD_EGG, true)) {
this->actor.parent = NULL;
this->actionFunc = func_80AA0EFC;
this->actionFunc = EnMa1_FinishGivingWeirdEgg;
} else {
Actor_OfferGetItem(&this->actor, play, GI_WEIRD_EGG, 120.0f, 10.0f);
}
}
void func_80AA0EFC(EnMa1* this, PlayState* play) {
void EnMa1_FinishGivingWeirdEgg(EnMa1* this, PlayState* play) {
if (this->interactInfo.talkState == NPC_TALK_STATE_ITEM_GIVEN ||
!GameInteractor_Should(VB_GIVE_ITEM_WEIRD_EGG, true)) {
this->interactInfo.talkState = NPC_TALK_STATE_IDLE;
this->actionFunc = func_80AA0D88;
this->actionFunc = EnMa1_Idle;
Flags_SetEventChkInf(EVENTCHKINF_OBTAINED_POCKET_EGG);
play->msgCtx.msgMode = MSGMODE_TEXT_CLOSING;
}
}
void func_80AA0F44(EnMa1* this, PlayState* play) {
void EnMa1_IdleTeachSong(EnMa1* this, PlayState* play) {
Player* player = GET_PLAYER(play);
if (this->interactInfo.talkState != NPC_TALK_STATE_IDLE) {
@ -381,32 +381,32 @@ void func_80AA0F44(EnMa1* this, PlayState* play) {
Message_StartTextbox(play, this->actor.textId, NULL);
this->interactInfo.talkState = NPC_TALK_STATE_TALKING;
this->actor.flags |= ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED;
this->actionFunc = func_80AA106C;
this->actionFunc = EnMa1_StartTeachSong;
} else if (this->actor.xzDistToPlayer < 30.0f + (f32)this->collider.dim.radius) {
player->stateFlags2 |= PLAYER_STATE2_NEAR_OCARINA_ACTOR;
}
}
}
void func_80AA106C(EnMa1* this, PlayState* play) {
void EnMa1_StartTeachSong(EnMa1* this, PlayState* play) {
GET_PLAYER(play)->stateFlags2 |= PLAYER_STATE2_NEAR_OCARINA_ACTOR;
if (this->interactInfo.talkState == NPC_TALK_STATE_ACTION) {
Audio_OcaSetInstrument(2);
func_8010BD58(play, OCARINA_ACTION_TEACH_EPONA);
this->actor.flags &= ~ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED;
this->actionFunc = func_80AA10EC;
this->actionFunc = EnMa1_TeachSong;
}
}
void func_80AA10EC(EnMa1* this, PlayState* play) {
void EnMa1_TeachSong(EnMa1* this, PlayState* play) {
GET_PLAYER(play)->stateFlags2 |= PLAYER_STATE2_NEAR_OCARINA_ACTOR;
if (Message_GetState(&play->msgCtx) == TEXT_STATE_SONG_DEMO_DONE) {
func_8010BD58(play, OCARINA_ACTION_PLAYBACK_EPONA);
this->actionFunc = func_80AA1150;
this->actionFunc = EnMa1_WaitForPlayback;
}
}
void func_80AA1150(EnMa1* this, PlayState* play) {
void EnMa1_WaitForPlayback(EnMa1* this, PlayState* play) {
GET_PLAYER(play)->stateFlags2 |= PLAYER_STATE2_NEAR_OCARINA_ACTOR;
if (play->msgCtx.ocarinaMode == OCARINA_MODE_03) {
@ -433,10 +433,10 @@ void EnMa1_Update(Actor* thisx, PlayState* play) {
this->actionFunc(this, play);
if (this->actionFunc != EnMa1_DoNothing) {
Npc_UpdateTalking(play, &this->actor, &this->interactInfo.talkState, (f32)this->collider.dim.radius + 30.0f,
EnMa1_GetText, func_80AA0778);
EnMa1_GetText, EnMa1_UpdateTalkState);
}
func_80AA0B74(this);
func_80AA0AF4(this, play);
EnMa1_UpdateSinging(this);
EnMa1_UpdateTracking(this, play);
}
s32 EnMa1_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void* thisx) {

View file

@ -20,7 +20,7 @@ typedef struct EnMa1 {
/* 0x01E8 */ NpcInteractInfo interactInfo;
} EnMa1; // size = 0x0210
void func_80AA106C(EnMa1* enMa1, PlayState* play);
void func_80AA0D88(EnMa1* enMa1, PlayState* play);
void EnMa1_StartTeachSong(EnMa1* enMa1, PlayState* play);
void EnMa1_Idle(EnMa1* enMa1, PlayState* play);
#endif

View file

@ -10,17 +10,17 @@ void EnMa2_Destroy(Actor* thisx, PlayState* play);
void EnMa2_Update(Actor* thisx, PlayState* play);
void EnMa2_Draw(Actor* thisx, PlayState* play);
u16 func_80AA19A0(PlayState* play, Actor* this);
s16 func_80AA1A38(PlayState* play, Actor* this);
u16 EnMa2_GetTextId(PlayState* play, Actor* this);
s16 EnMa2_UpdateTalkState(PlayState* play, Actor* this);
void func_80AA1AE4(EnMa2* this, PlayState* play);
s32 func_80AA1C68(EnMa2* this);
void EnMa2_UpdateTracking(EnMa2* this, PlayState* play);
s32 EnMa2_IsSinging(EnMa2* this);
void EnMa2_UpdateEyes(EnMa2* this);
void func_80AA1DB4(EnMa2* this, PlayState* play);
void func_80AA2018(EnMa2* this, PlayState* play);
void func_80AA204C(EnMa2* this, PlayState* play);
void func_80AA20E4(EnMa2* this, PlayState* play);
void func_80AA21C8(EnMa2* this, PlayState* play);
void EnMa2_UpdateSinging(EnMa2* this, PlayState* play);
void EnMa2_WaitToEndTalk(EnMa2* this, PlayState* play);
void EnMa2_WaitForOcarina(EnMa2* this, PlayState* play);
void EnMa2_WaitForEponasSong(EnMa2* this, PlayState* play);
void EnMa2_ForceTalkAfterSong(EnMa2* this, PlayState* play);
const ActorInit En_Ma2_InitVars = {
ACTOR_EN_MA2,
@ -71,7 +71,7 @@ static AnimationFrameCountInfo sAnimationInfo[] = {
{ &gMalonAdultSingAnim, 1.0f, ANIMMODE_LOOP, -10.0f },
};
u16 func_80AA19A0(PlayState* play, Actor* thisx) {
u16 EnMa2_GetTextId(PlayState* play, Actor* thisx) {
u16 faceReaction = Text_GetFaceReaction(play, 23);
if (faceReaction != 0) {
@ -92,7 +92,7 @@ u16 func_80AA19A0(PlayState* play, Actor* thisx) {
return 0x204C;
}
s16 func_80AA1A38(PlayState* play, Actor* thisx) {
s16 EnMa2_UpdateTalkState(PlayState* play, Actor* thisx) {
s16 ret = NPC_TALK_STATE_TALKING;
switch (Message_GetState(&play->msgCtx)) {
@ -124,7 +124,7 @@ s16 func_80AA1A38(PlayState* play, Actor* thisx) {
return ret;
}
void func_80AA1AE4(EnMa2* this, PlayState* play) {
void EnMa2_UpdateTracking(EnMa2* this, PlayState* play) {
Player* player = GET_PLAYER(play);
s16 trackingMode;
@ -140,7 +140,7 @@ void func_80AA1AE4(EnMa2* this, PlayState* play) {
Npc_TrackPoint(&this->actor, &this->interactInfo, 0, trackingMode);
}
u16 func_80AA1B58(EnMa2* this, PlayState* play) {
u16 EnMa2_GetSpawnIndex(EnMa2* this, PlayState* play) {
if (LINK_IS_CHILD) {
return 0;
}
@ -164,7 +164,7 @@ u16 func_80AA1B58(EnMa2* this, PlayState* play) {
return 0;
}
s32 func_80AA1C68(EnMa2* this) {
s32 EnMa2_IsSinging(EnMa2* this) {
if (this->skelAnime.animation != &gMalonAdultSingAnim) {
return 0;
}
@ -180,7 +180,7 @@ s32 func_80AA1C68(EnMa2* this) {
}
void EnMa2_UpdateEyes(EnMa2* this) {
if ((!func_80AA1C68(this)) && (DECR(this->blinkTimer) == 0)) {
if ((!EnMa2_IsSinging(this)) && (DECR(this->blinkTimer) == 0)) {
this->eyeIndex += 1;
if (this->eyeIndex >= 3) {
this->blinkTimer = Rand_S16Offset(30, 30);
@ -196,7 +196,7 @@ void EnMa2_ChangeAnim(EnMa2* this, s32 index) {
sAnimationInfo[index].mode, sAnimationInfo[index].morphFrames);
}
void func_80AA1DB4(EnMa2* this, PlayState* play) {
void EnMa2_UpdateSinging(EnMa2* this, PlayState* play) {
if (this->skelAnime.animation == &gMalonAdultSingAnim) {
if (this->interactInfo.talkState == NPC_TALK_STATE_IDLE) {
if (this->singingDisabled != 0) {
@ -222,14 +222,14 @@ void EnMa2_Init(Actor* thisx, PlayState* play) {
Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit);
CollisionCheck_SetInfo2(&this->actor.colChkInfo, DamageTable_Get(22), &sColChkInfoInit);
switch (func_80AA1B58(this, play)) {
switch (EnMa2_GetSpawnIndex(this, play)) {
case 1:
EnMa2_ChangeAnim(this, ENMA2_ANIM_2);
this->actionFunc = func_80AA2018;
this->actionFunc = EnMa2_WaitToEndTalk;
break;
case 2:
EnMa2_ChangeAnim(this, ENMA2_ANIM_3);
this->actionFunc = func_80AA204C;
this->actionFunc = EnMa2_WaitForOcarina;
break;
case 3:
if (Flags_GetInfTable(INFTABLE_8D)) {
@ -237,7 +237,7 @@ void EnMa2_Init(Actor* thisx, PlayState* play) {
} else {
EnMa2_ChangeAnim(this, ENMA2_ANIM_3);
}
this->actionFunc = func_80AA2018;
this->actionFunc = EnMa2_WaitToEndTalk;
break;
case 0:
Actor_Kill(&this->actor);
@ -257,45 +257,45 @@ void EnMa2_Destroy(Actor* thisx, PlayState* play) {
Collider_DestroyCylinder(play, &this->collider);
}
void func_80AA2018(EnMa2* this, PlayState* play) {
void EnMa2_WaitToEndTalk(EnMa2* this, PlayState* play) {
if (this->interactInfo.talkState == NPC_TALK_STATE_ACTION) {
this->actor.flags &= ~ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED;
this->interactInfo.talkState = NPC_TALK_STATE_IDLE;
}
}
void func_80AA204C(EnMa2* this, PlayState* play) {
void EnMa2_WaitForOcarina(EnMa2* this, PlayState* play) {
Player* player = GET_PLAYER(play);
if (player->stateFlags2 & PLAYER_STATE2_ATTEMPT_PLAY_FOR_ACTOR) {
player->unk_6A8 = &this->actor;
player->stateFlags2 |= PLAYER_STATE2_PLAY_FOR_ACTOR;
func_8010BD58(play, OCARINA_ACTION_CHECK_EPONA);
this->actionFunc = func_80AA20E4;
this->actionFunc = EnMa2_WaitForEponasSong;
} else if (this->actor.xzDistToPlayer < 30.0f + (f32)this->collider.dim.radius) {
player->stateFlags2 |= PLAYER_STATE2_NEAR_OCARINA_ACTOR;
}
}
void func_80AA20E4(EnMa2* this, PlayState* play) {
void EnMa2_WaitForEponasSong(EnMa2* this, PlayState* play) {
Player* player = GET_PLAYER(play);
if (play->msgCtx.ocarinaMode >= OCARINA_MODE_04) {
this->actionFunc = func_80AA204C;
this->actionFunc = EnMa2_WaitForOcarina;
play->msgCtx.ocarinaMode = OCARINA_MODE_04;
} else if (play->msgCtx.ocarinaMode == OCARINA_MODE_03) {
Audio_PlaySoundGeneral(NA_SE_SY_CORRECT_CHIME, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
this->timer = 0x1E;
Flags_SetInfTable(INFTABLE_8E);
this->actionFunc = func_80AA21C8;
this->actionFunc = EnMa2_ForceTalkAfterSong;
play->msgCtx.ocarinaMode = OCARINA_MODE_04;
} else {
player->stateFlags2 |= PLAYER_STATE2_NEAR_OCARINA_ACTOR;
}
}
void func_80AA21C8(EnMa2* this, PlayState* play) {
void EnMa2_ForceTalkAfterSong(EnMa2* this, PlayState* play) {
Player* player = GET_PLAYER(play);
if (DECR(this->timer)) {
@ -306,7 +306,7 @@ void func_80AA21C8(EnMa2* this, PlayState* play) {
Message_CloseTextbox(play);
} else {
this->actor.flags &= ~ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED;
this->actionFunc = func_80AA2018;
this->actionFunc = EnMa2_WaitToEndTalk;
}
}
}
@ -320,11 +320,11 @@ void EnMa2_Update(Actor* thisx, PlayState* play) {
SkelAnime_Update(&this->skelAnime);
EnMa2_UpdateEyes(this);
this->actionFunc(this, play);
func_80AA1DB4(this, play);
func_80AA1AE4(this, play);
if (this->actionFunc != func_80AA20E4) {
EnMa2_UpdateSinging(this, play);
EnMa2_UpdateTracking(this, play);
if (this->actionFunc != EnMa2_WaitForEponasSong) {
Npc_UpdateTalking(play, &this->actor, &this->interactInfo.talkState, (f32)this->collider.dim.radius + 30.0f,
func_80AA19A0, func_80AA1A38);
EnMa2_GetTextId, EnMa2_UpdateTalkState);
}
}

View file

@ -16,8 +16,8 @@ void EnMa3_Destroy(Actor* thisx, PlayState* play);
void EnMa3_Update(Actor* thisx, PlayState* play);
void EnMa3_Draw(Actor* thisx, PlayState* play);
u16 func_80AA2AA0(PlayState* play, Actor* this);
s16 func_80AA2BD4(PlayState* play, Actor* this);
u16 EnMa3_GetTextId(PlayState* play, Actor* this);
s16 EnMa3_UpdateTalkState(PlayState* play, Actor* this);
void func_80AA2E54(EnMa3* this, PlayState* play);
s32 func_80AA2EC8(EnMa3* this, PlayState* play);
@ -74,7 +74,7 @@ static AnimationFrameCountInfo sAnimationInfo[] = {
{ &gMalonAdultSingAnim, 1.0f, ANIMMODE_LOOP, -10.0f },
};
u16 func_80AA2AA0(PlayState* play, Actor* thisx) {
u16 EnMa3_GetTextId(PlayState* play, Actor* thisx) {
Player* player = GET_PLAYER(play);
s16* timerSecondsPtr; // weirdness with this necessary to match
@ -111,7 +111,7 @@ u16 func_80AA2AA0(PlayState* play, Actor* thisx) {
}
}
s16 func_80AA2BD4(PlayState* play, Actor* thisx) {
s16 EnMa3_UpdateTalkState(PlayState* play, Actor* thisx) {
s16 ret = NPC_TALK_STATE_TALKING;
switch (Message_GetState(&play->msgCtx)) {
@ -295,7 +295,7 @@ void EnMa3_Update(Actor* thisx, PlayState* play) {
this->actionFunc(this, play);
func_80AA2E54(this, play);
Npc_UpdateTalking(play, &this->actor, &this->interactInfo.talkState, (f32)this->collider.dim.radius + 150.0f,
func_80AA2AA0, func_80AA2BD4);
EnMa3_GetTextId, EnMa3_UpdateTalkState);
if (this->interactInfo.talkState == NPC_TALK_STATE_IDLE) {
if (this->isNotSinging != 0) {
func_800F6584(0);

View file

@ -12,26 +12,26 @@ void EnRd_Destroy(Actor* thisx, PlayState* play);
void EnRd_Update(Actor* thisx, PlayState* play);
void EnRd_Draw(Actor* thisx, PlayState* play);
void func_80AE269C(EnRd* this);
void func_80AE2744(EnRd* this, PlayState* play);
void func_80AE2970(EnRd* this);
void func_80AE2A10(EnRd* this, PlayState* play);
void func_80AE2C1C(EnRd* this, PlayState* play);
void func_80AE2F50(EnRd* this, PlayState* play);
void func_80AE2FD0(EnRd* this, PlayState* play);
void func_80AE31DC(EnRd* this);
void func_80AE3260(EnRd* this, PlayState* play);
void func_80AE33F0(EnRd* this);
void func_80AE392C(EnRd* this);
void func_80AE39D4(EnRd* this);
void func_80AE3454(EnRd* this, PlayState* play);
void func_80AE37BC(EnRd* this);
void func_80AE3834(EnRd* this, PlayState* play);
void func_80AE3978(EnRd* this, PlayState* play);
void func_80AE3A54(EnRd* this, PlayState* play);
void func_80AE3B18(EnRd* this, PlayState* play);
void func_80AE3C98(EnRd* this, PlayState* play);
void func_80AE3ECC(EnRd* this, PlayState* play);
void EnRd_SetupIdle(EnRd* this);
void EnRd_Idle(EnRd* this, PlayState* play);
void EnRd_SetupRiseFromCoffin(EnRd* this);
void EnRd_RiseFromCoffin(EnRd* this, PlayState* play);
void EnRd_WalkToPlayer(EnRd* this, PlayState* play);
void EnRd_SetupWalkToHome(EnRd* this, PlayState* play);
void EnRd_WalkToHome(EnRd* this, PlayState* play);
void EnRd_SetupWalkToParent(EnRd* this);
void EnRd_WalkToParent(EnRd* this, PlayState* play);
void EnRd_SetupGrab(EnRd* this);
void EnRd_SetupStandUp(EnRd* this);
void EnRd_SetupCrouch(EnRd* this);
void EnRd_Grab(EnRd* this, PlayState* play);
void EnRd_SetupAttemptPlayerFreeze(EnRd* this);
void EnRd_AttemptPlayerFreeze(EnRd* this, PlayState* play);
void EnRd_StandUp(EnRd* this, PlayState* play);
void EnRd_Crouch(EnRd* this, PlayState* play);
void EnRd_Damaged(EnRd* this, PlayState* play);
void EnRd_Dead(EnRd* this, PlayState* play);
void EnRd_Stunned(EnRd* this, PlayState* play);
const ActorInit En_Rd_InitVars = {
ACTOR_EN_RD,
@ -160,9 +160,9 @@ void EnRd_Init(Actor* thisx, PlayState* play) {
Collider_SetCylinder(play, &this->collider, thisx, &sCylinderInit);
if (thisx->params >= -2) {
func_80AE269C(this);
EnRd_SetupIdle(this);
} else {
func_80AE2970(this);
EnRd_SetupRiseFromCoffin(this);
}
SkelAnime_Update(&this->skelAnime);
@ -183,7 +183,7 @@ void EnRd_Destroy(Actor* thisx, PlayState* play) {
ResourceMgr_UnregisterSkeleton(&this->skelAnime);
}
void func_80AE2630(PlayState* play, Actor* thisx, s32 arg2) {
void EnRd_UpdateMourningTarget(PlayState* play, Actor* thisx, s32 arg2) {
Actor* enemyIt = play->actorCtx.actorLists[ACTORCAT_ENEMY].head;
while (enemyIt != NULL) {
@ -201,7 +201,7 @@ void func_80AE2630(PlayState* play, Actor* thisx, s32 arg2) {
}
}
void func_80AE269C(EnRd* this) {
void EnRd_SetupIdle(EnRd* this) {
if (this->actor.params != 2) {
Animation_MorphToLoop(&this->skelAnime, &gGibdoRedeadIdleAnim, -6.0f);
} else {
@ -212,10 +212,10 @@ void func_80AE269C(EnRd* this) {
this->timer = (Rand_ZeroOne() * 10.0f) + 5.0f;
this->actor.speedXZ = 0.0f;
this->actor.world.rot.y = this->actor.shape.rot.y;
EnRd_SetupAction(this, func_80AE2744);
EnRd_SetupAction(this, EnRd_Idle);
}
void func_80AE2744(EnRd* this, PlayState* play) {
void EnRd_Idle(EnRd* this, PlayState* play) {
SkelAnime_Update(&this->skelAnime);
Math_SmoothStepToS(&this->headYRotation, 0, 1, 0x64, 0);
Math_SmoothStepToS(&this->upperBodyYRotation, 0, 1, 0x64, 0);
@ -237,17 +237,17 @@ void func_80AE2744(EnRd* this, PlayState* play) {
if (this->actor.parent != NULL) {
if (this->isMourning == 0) {
if (this->actor.params != 2) {
func_80AE31DC(this);
EnRd_SetupWalkToParent(this);
} else {
func_80AE392C(this);
EnRd_SetupStandUp(this);
}
}
} else {
if (this->isMourning != 0) {
if (this->actor.params != 2) {
func_80AE37BC(this);
EnRd_SetupAttemptPlayerFreeze(this);
} else {
func_80AE392C(this);
EnRd_SetupStandUp(this);
}
}
@ -262,9 +262,9 @@ void func_80AE2744(EnRd* this, PlayState* play) {
if (!enemyRandoCCActive ||
(enemyRandoCCActive && this->actor.yDistToPlayer <= 100.0f && this->actor.yDistToPlayer >= -100.0f)) {
if ((this->actor.params != 2) && (this->isMourning == 0)) {
func_80AE37BC(this);
EnRd_SetupAttemptPlayerFreeze(this);
} else {
func_80AE392C(this);
EnRd_SetupStandUp(this);
}
}
}
@ -275,7 +275,7 @@ void func_80AE2744(EnRd* this, PlayState* play) {
}
}
void func_80AE2970(EnRd* this) {
void EnRd_SetupRiseFromCoffin(EnRd* this) {
Animation_Change(&this->skelAnime, &gGibdoRedeadIdleAnim, 0, 0, Animation_GetLastFrame(&gGibdoRedeadIdleAnim),
ANIMMODE_LOOP, -6.0f);
this->action = 11;
@ -284,16 +284,16 @@ void func_80AE2970(EnRd* this) {
this->actor.gravity = 0.0f;
this->actor.shape.yOffset = 0.0f;
this->actor.speedXZ = 0.0f;
EnRd_SetupAction(this, func_80AE2A10);
EnRd_SetupAction(this, EnRd_RiseFromCoffin);
}
// Rising out of coffin
void func_80AE2A10(EnRd* this, PlayState* play) {
void EnRd_RiseFromCoffin(EnRd* this, PlayState* play) {
if (this->actor.shape.rot.x != -0x4000) {
Math_SmoothStepToS(&this->actor.shape.rot.x, 0, 1, 0x7D0, 0);
if (Math_SmoothStepToF(&this->actor.world.pos.y, this->actor.home.pos.y, 0.3f, 2.0f, 0.3f) == 0.0f) {
this->actor.gravity = -3.5f;
func_80AE269C(this);
EnRd_SetupIdle(this);
}
} else {
if (this->actor.world.pos.y == this->actor.home.pos.y) {
@ -310,15 +310,15 @@ void func_80AE2A10(EnRd* this, PlayState* play) {
}
}
void func_80AE2B90(EnRd* this, PlayState* play) {
void EnRd_SetupWalkToPlayer(EnRd* this, PlayState* play) {
Animation_Change(&this->skelAnime, &gGibdoRedeadWalkAnim, 1.0f, 4.0f, Animation_GetLastFrame(&gGibdoRedeadWalkAnim),
ANIMMODE_LOOP_INTERP, -4.0f);
this->actor.speedXZ = 0.4f;
this->action = 4;
EnRd_SetupAction(this, func_80AE2C1C);
EnRd_SetupAction(this, EnRd_WalkToPlayer);
}
void func_80AE2C1C(EnRd* this, PlayState* play) {
void EnRd_WalkToPlayer(EnRd* this, PlayState* play) {
Vec3f sp44 = D_80AE4918;
Color_RGBA8 sp40 = D_80AE4924;
Color_RGBA8 sp3C = D_80AE4928;
@ -334,7 +334,7 @@ void func_80AE2C1C(EnRd* this, PlayState* play) {
SkelAnime_Update(&this->skelAnime);
if (Actor_WorldDistXYZToPoint(&player->actor, &this->actor.home.pos) >= 150.0f) {
func_80AE2F50(this, play);
EnRd_SetupWalkToHome(this, play);
}
if ((ABS(sp32) < 0x1554) && (Actor_WorldDistXYZToActor(&this->actor, &player->actor) <= 150.0f)) {
@ -354,7 +354,7 @@ void func_80AE2C1C(EnRd* this, PlayState* play) {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_REDEAD_AIM);
}
} else {
func_80AE2F50(this, play);
EnRd_SetupWalkToHome(this, play);
}
}
@ -367,11 +367,11 @@ void func_80AE2C1C(EnRd* this, PlayState* play) {
player->actor.freezeTimer = 0;
if (play->grabPlayer(play, player)) {
this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED;
func_80AE33F0(this);
EnRd_SetupGrab(this);
}
} else if (this->actor.params > 0) {
if (this->actor.parent != NULL) {
func_80AE31DC(this);
EnRd_SetupWalkToParent(this);
} else {
this->isMourning = 0;
}
@ -384,14 +384,14 @@ void func_80AE2C1C(EnRd* this, PlayState* play) {
}
}
void func_80AE2F50(EnRd* this, PlayState* play) {
void EnRd_SetupWalkToHome(EnRd* this, PlayState* play) {
Animation_Change(&this->skelAnime, &gGibdoRedeadWalkAnim, 0.5f, 0, Animation_GetLastFrame(&gGibdoRedeadWalkAnim),
ANIMMODE_LOOP_INTERP, -4.0f);
this->action = 2;
EnRd_SetupAction(this, func_80AE2FD0);
EnRd_SetupAction(this, EnRd_WalkToHome);
}
void func_80AE2FD0(EnRd* this, PlayState* play) {
void EnRd_WalkToHome(EnRd* this, PlayState* play) {
Player* player = GET_PLAYER(play);
s32 pad;
s16 targetY = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos);
@ -402,9 +402,9 @@ void func_80AE2FD0(EnRd* this, PlayState* play) {
this->actor.speedXZ = 0.0f;
if (Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.home.rot.y, 1, 0x1C2, 0) == 0) {
if (this->actor.params != 2) {
func_80AE269C(this);
EnRd_SetupIdle(this);
} else {
func_80AE39D4(this);
EnRd_SetupCrouch(this);
}
}
}
@ -419,10 +419,10 @@ void func_80AE2FD0(EnRd* this, PlayState* play) {
!(player->stateFlags2 & PLAYER_STATE2_GRABBED_BY_ENEMY) &&
(Actor_WorldDistXYZToPoint(&player->actor, &this->actor.home.pos) < 150.0f)) {
this->actor.targetMode = 0;
func_80AE2B90(this, play);
EnRd_SetupWalkToPlayer(this, play);
} else if (this->actor.params > 0) {
if (this->actor.parent != NULL) {
func_80AE31DC(this);
EnRd_SetupWalkToParent(this);
} else {
this->isMourning = 0;
}
@ -435,15 +435,15 @@ void func_80AE2FD0(EnRd* this, PlayState* play) {
}
}
void func_80AE31DC(EnRd* this) {
void EnRd_SetupWalkToParent(EnRd* this) {
Animation_Change(&this->skelAnime, &gGibdoRedeadWalkAnim, 0.5f, 0, Animation_GetLastFrame(&gGibdoRedeadWalkAnim),
ANIMMODE_LOOP_INTERP, -4.0f);
this->action = 3;
this->isMourning = 1;
EnRd_SetupAction(this, func_80AE3260);
EnRd_SetupAction(this, EnRd_WalkToParent);
}
void func_80AE3260(EnRd* this, PlayState* play) {
void EnRd_WalkToParent(EnRd* this, PlayState* play) {
if (this->actor.parent != NULL) {
s32 pad;
s16 targetY;
@ -459,16 +459,16 @@ void func_80AE3260(EnRd* this, PlayState* play) {
this->actor.speedXZ = 0.0f;
if (this->actor.params != 2) {
func_80AE269C(this);
EnRd_SetupIdle(this);
} else {
func_80AE39D4(this);
EnRd_SetupCrouch(this);
}
}
Math_SmoothStepToS(&this->headYRotation, 0, 1, 0x64, 0);
Math_SmoothStepToS(&this->upperBodyYRotation, 0, 1, 0x64, 0);
} else {
func_80AE2B90(this, play);
EnRd_SetupWalkToPlayer(this, play);
}
this->actor.world.rot.y = this->actor.shape.rot.y;
@ -481,16 +481,16 @@ void func_80AE3260(EnRd* this, PlayState* play) {
}
}
void func_80AE33F0(EnRd* this) {
void EnRd_SetupGrab(EnRd* this) {
Animation_PlayOnce(&this->skelAnime, &gGibdoRedeadGrabStartAnim);
this->timer = this->grabState = 0;
this->grabDamageTimer = 200;
this->action = 8;
this->actor.speedXZ = 0.0f;
EnRd_SetupAction(this, func_80AE3454);
EnRd_SetupAction(this, EnRd_Grab);
}
void func_80AE3454(EnRd* this, PlayState* play) {
void EnRd_Grab(EnRd* this, PlayState* play) {
s32 pad;
Player* player = GET_PLAYER(play);
@ -555,19 +555,19 @@ void func_80AE3454(EnRd* this, PlayState* play) {
this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED;
this->playerStunWaitTimer = 0xA;
this->grabWaitTimer = 0xF;
func_80AE2B90(this, play);
EnRd_SetupWalkToPlayer(this, play);
break;
}
}
void func_80AE37BC(EnRd* this) {
void EnRd_SetupAttemptPlayerFreeze(EnRd* this) {
Animation_Change(&this->skelAnime, &gGibdoRedeadLookBackAnim, 0.0f, 0.0f,
Animation_GetLastFrame(&gGibdoRedeadLookBackAnim), ANIMMODE_ONCE, 0.0f);
this->action = 7;
EnRd_SetupAction(this, func_80AE3834);
EnRd_SetupAction(this, EnRd_AttemptPlayerFreeze);
}
void func_80AE3834(EnRd* this, PlayState* play) {
void EnRd_AttemptPlayerFreeze(EnRd* this, PlayState* play) {
Vec3f sp34 = D_80AE492C;
Color_RGBA8 sp30 = D_80AE4938;
Color_RGBA8 sp2C = D_80AE493C;
@ -582,40 +582,40 @@ void func_80AE3834(EnRd* this, PlayState* play) {
Player_SetAutoLockOnActor(play, &this->actor);
}
Audio_PlayActorSound2(&this->actor, NA_SE_EN_REDEAD_AIM);
func_80AE2B90(this, play);
EnRd_SetupWalkToPlayer(this, play);
}
}
void func_80AE392C(EnRd* this) {
void EnRd_SetupStandUp(EnRd* this) {
Animation_MorphToPlayOnce(&this->skelAnime, &gGibdoRedeadStandUpAnim, -4.0f);
this->action = 5;
EnRd_SetupAction(this, func_80AE3978);
EnRd_SetupAction(this, EnRd_StandUp);
}
void func_80AE3978(EnRd* this, PlayState* play) {
void EnRd_StandUp(EnRd* this, PlayState* play) {
if (SkelAnime_Update(&this->skelAnime)) {
if (this->actor.parent != NULL) {
func_80AE31DC(this);
EnRd_SetupWalkToParent(this);
} else {
func_80AE37BC(this);
EnRd_SetupAttemptPlayerFreeze(this);
}
}
}
void func_80AE39D4(EnRd* this) {
void EnRd_SetupCrouch(EnRd* this) {
Animation_Change(&this->skelAnime, &gGibdoRedeadStandUpAnim, -1.0f,
Animation_GetLastFrame(&gGibdoRedeadStandUpAnim), 0.0f, ANIMMODE_ONCE, -4.0f);
this->action = 6;
EnRd_SetupAction(this, func_80AE3A54);
EnRd_SetupAction(this, EnRd_Crouch);
}
void func_80AE3A54(EnRd* this, PlayState* play) {
void EnRd_Crouch(EnRd* this, PlayState* play) {
if (SkelAnime_Update(&this->skelAnime)) {
func_80AE269C(this);
EnRd_SetupIdle(this);
}
}
void func_80AE3A8C(EnRd* this) {
void EnRd_SetupDamaged(EnRd* this) {
Animation_MorphToPlayOnce(&this->skelAnime, &gGibdoRedeadDamageAnim, -6.0f);
if (this->actor.bgCheckFlags & 1) {
@ -625,10 +625,10 @@ void func_80AE3A8C(EnRd* this) {
this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED;
Audio_PlayActorSound2(&this->actor, NA_SE_EN_REDEAD_DAMAGE);
this->action = 9;
EnRd_SetupAction(this, func_80AE3B18);
EnRd_SetupAction(this, EnRd_Damaged);
}
void func_80AE3B18(EnRd* this, PlayState* play) {
void EnRd_Damaged(EnRd* this, PlayState* play) {
Player* player = GET_PLAYER(play);
if (this->actor.speedXZ < 0.0f) {
@ -642,29 +642,29 @@ void func_80AE3B18(EnRd* this, PlayState* play) {
this->actor.world.rot.y = this->actor.shape.rot.y;
if (this->actor.parent != NULL) {
func_80AE31DC(this);
EnRd_SetupWalkToParent(this);
} else if (Actor_WorldDistXYZToPoint(&player->actor, &this->actor.home.pos) >= 150.0f) {
func_80AE2F50(this, play);
EnRd_SetupWalkToHome(this, play);
} else {
func_80AE2B90(this, play);
EnRd_SetupWalkToPlayer(this, play);
}
this->unk_31D = 0xFF;
}
}
void func_80AE3C20(EnRd* this) {
void EnRd_SetupDead(EnRd* this) {
Animation_MorphToPlayOnce(&this->skelAnime, &gGibdoRedeadDeathAnim, -1.0f);
this->action = 10;
this->timer = 300;
this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED;
this->actor.speedXZ = 0.0f;
Audio_PlayActorSound2(&this->actor, NA_SE_EN_REDEAD_DEAD);
EnRd_SetupAction(this, func_80AE3C98);
EnRd_SetupAction(this, EnRd_Dead);
GameInteractor_ExecuteOnEnemyDefeat(&this->actor);
}
void func_80AE3C98(EnRd* this, PlayState* play) {
void EnRd_Dead(EnRd* this, PlayState* play) {
if (this->actor.category != ACTORCAT_PROP) {
Actor_ChangeCategory(play, &play->actorCtx, &this->actor, ACTORCAT_PROP);
}
@ -682,7 +682,7 @@ void func_80AE3C98(EnRd* this, PlayState* play) {
}
if (this->alpha != 0) {
if (this->alpha == 0xB4) {
func_80AE2630(play, &this->actor, 0);
EnRd_UpdateMourningTarget(play, &this->actor, 0);
}
this->actor.scale.y -= 0.000075f;
this->alpha -= 5;
@ -697,7 +697,7 @@ void func_80AE3C98(EnRd* this, PlayState* play) {
}
}
void func_80AE3DE4(EnRd* this) {
void EnRd_SetupStunned(EnRd* this) {
this->action = 1;
this->actor.speedXZ = 0.0f;
this->actor.world.rot.y = this->actor.shape.rot.y;
@ -712,10 +712,10 @@ void func_80AE3DE4(EnRd* this) {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_LIGHT_ARROW_HIT);
Actor_SetColorFilter(&this->actor, -0x8000, 0xC8, 0, 0x50);
}
EnRd_SetupAction(this, func_80AE3ECC);
EnRd_SetupAction(this, EnRd_Stunned);
}
void func_80AE3ECC(EnRd* this, PlayState* play) {
void EnRd_Stunned(EnRd* this, PlayState* play) {
if ((this->stunnedBySunsSong != 0) && (this->sunsSongStunTimer != 0)) {
this->sunsSongStunTimer--;
if (this->sunsSongStunTimer >= 0xFF) {
@ -729,16 +729,16 @@ void func_80AE3ECC(EnRd* this, PlayState* play) {
if (this->actor.colorFilterTimer == 0) {
if (this->actor.colChkInfo.health == 0) {
func_80AE2630(play, &this->actor, 1);
func_80AE3C20(this);
EnRd_UpdateMourningTarget(play, &this->actor, 1);
EnRd_SetupDead(this);
Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0x90);
} else {
func_80AE3A8C(this);
EnRd_SetupDamaged(this);
}
}
}
void func_80AE3F9C(EnRd* this, PlayState* play) {
void EnRd_TurnTowardsPlayer(EnRd* this, PlayState* play) {
s16 temp1;
s16 temp2;
s16 temp3;
@ -761,13 +761,13 @@ void func_80AE3F9C(EnRd* this, PlayState* play) {
this->headYRotation = CLAMP(this->headYRotation, -9583, 9583);
}
void func_80AE4114(EnRd* this, PlayState* play) {
void EnRd_UpdateDamage(EnRd* this, PlayState* play) {
s32 pad;
Player* player = GET_PLAYER(play);
if ((gSaveContext.sunsSongState != SUNSSONG_INACTIVE) && (this->actor.shape.rot.x == 0) &&
(this->stunnedBySunsSong == 0) && (this->action != 9) && (this->action != 10) && (this->action != 1)) {
func_80AE3DE4(this);
EnRd_SetupStunned(this);
return;
}
@ -784,7 +784,7 @@ void func_80AE4114(EnRd* this, PlayState* play) {
if ((this->damageReaction != 0) && (this->damageReaction != 6)) {
if (((this->damageReaction == 1) || (this->damageReaction == 13)) && (this->action != 1)) {
Actor_ApplyDamage(&this->actor);
func_80AE3DE4(this);
EnRd_SetupStunned(this);
return;
}
@ -800,11 +800,11 @@ void func_80AE4114(EnRd* this, PlayState* play) {
Actor_ApplyDamage(&this->actor);
if (this->actor.colChkInfo.health == 0) {
func_80AE2630(play, &this->actor, 1);
func_80AE3C20(this);
EnRd_UpdateMourningTarget(play, &this->actor, 1);
EnRd_SetupDead(this);
Item_DropCollectibleRandom(play, 0, &this->actor.world.pos, 0x90);
} else {
func_80AE3A8C(this);
EnRd_SetupDamaged(this);
}
}
}
@ -817,7 +817,7 @@ void EnRd_Update(Actor* thisx, PlayState* play) {
Player* player = GET_PLAYER(play);
s32 pad2;
func_80AE4114(this, play);
EnRd_UpdateDamage(this, play);
if (gSaveContext.sunsSongState != SUNSSONG_INACTIVE && this->stunnedBySunsSong == 0) {
gSaveContext.sunsSongState = SUNSSONG_INACTIVE;
@ -838,7 +838,7 @@ void EnRd_Update(Actor* thisx, PlayState* play) {
}
if (this->action == 7) {
func_80AE3F9C(this, play);
EnRd_TurnTowardsPlayer(this, play);
}
}

View file

@ -21,18 +21,18 @@ void EnReeba_Destroy(Actor* thisx, PlayState* play);
void EnReeba_Update(Actor* thisx, PlayState* play);
void EnReeba_Draw(Actor* thisx, PlayState* play);
void func_80AE4F40(EnReeba* this, PlayState* play);
void func_80AE5054(EnReeba* this, PlayState* play);
void func_80AE5270(EnReeba* this, PlayState* play);
void func_80AE5688(EnReeba* this, PlayState* play);
void func_80AE56E0(EnReeba* this, PlayState* play);
void func_80AE538C(EnReeba* this, PlayState* play);
void func_80AE53AC(EnReeba* this, PlayState* play);
void func_80AE5E48(EnReeba* this, PlayState* play);
void func_80AE5854(EnReeba* this, PlayState* play);
void func_80AE5C38(EnReeba* this, PlayState* play);
void func_80AE5938(EnReeba* this, PlayState* play);
void func_80AE5A9C(EnReeba* this, PlayState* play);
void EnReeba_SetupSurface(EnReeba* this, PlayState* play);
void EnReeba_Surface(EnReeba* this, PlayState* play);
void EnReeba_Move(EnReeba* this, PlayState* play);
void EnReeba_SetupSink(EnReeba* this, PlayState* play);
void EnReeba_Sink(EnReeba* this, PlayState* play);
void EnReeba_SetupMoveBig(EnReeba* this, PlayState* play);
void EnReeba_MoveBig(EnReeba* this, PlayState* play);
void EnReeba_StunRecover(EnReeba* this, PlayState* play);
void EnReeba_Damaged(EnReeba* this, PlayState* play);
void EnReeba_Die(EnReeba* this, PlayState* play);
void EnReeba_Stunned(EnReeba* this, PlayState* play);
void EnReeba_StunDie(EnReeba* this, PlayState* play);
static DamageTable sDamageTable = {
/* Deku nut */ DMG_ENTRY(0, 0x0),
@ -143,7 +143,7 @@ void EnReeba_Init(Actor* thisx, PlayState* play) {
return;
}
this->actionfunc = func_80AE4F40;
this->actionfunc = EnReeba_SetupSurface;
}
void EnReeba_Destroy(Actor* thisx, PlayState* play) {
@ -169,7 +169,7 @@ void EnReeba_Destroy(Actor* thisx, PlayState* play) {
ResourceMgr_UnregisterSkeleton(&this->skelanime);
}
void func_80AE4F40(EnReeba* this, PlayState* play) {
void EnReeba_SetupSurface(EnReeba* this, PlayState* play) {
f32 frames = Animation_GetLastFrame(&object_reeba_Anim_0001E4);
Player* player = GET_PLAYER(play);
s16 playerSpeed;
@ -194,10 +194,10 @@ void func_80AE4F40(EnReeba* this, PlayState* play) {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_RIVA_APPEAR);
}
this->actionfunc = func_80AE5054;
this->actionfunc = EnReeba_Surface;
}
void func_80AE5054(EnReeba* this, PlayState* play) {
void EnReeba_Surface(EnReeba* this, PlayState* play) {
Player* player = GET_PLAYER(play);
f32 playerLinearVel;
@ -237,17 +237,17 @@ void func_80AE5054(EnReeba* this, PlayState* play) {
}
if (this->isBig) {
this->actionfunc = func_80AE538C;
this->actionfunc = EnReeba_SetupMoveBig;
} else {
this->moveTimer = 130;
this->actor.speedXZ = Rand_ZeroFloat(4.0f) + 6.0f;
this->actionfunc = func_80AE5270;
this->actionfunc = EnReeba_Move;
}
}
}
}
void func_80AE5270(EnReeba* this, PlayState* play) {
void EnReeba_Move(EnReeba* this, PlayState* play) {
s32 surfaceType;
SkelAnime_Update(&this->skelanime);
@ -260,22 +260,22 @@ void func_80AE5270(EnReeba* this, PlayState* play) {
if ((surfaceType != 4) && (surfaceType != 7)) {
this->actor.speedXZ = 0.0f;
this->actionfunc = func_80AE5688;
this->actionfunc = EnReeba_SetupSink;
} else if ((this->moveTimer == 0) || (this->actor.xzDistToPlayer < 30.0f) ||
(this->actor.xzDistToPlayer > 400.0f) || (this->actor.bgCheckFlags & 8)) {
this->actionfunc = func_80AE5688;
this->actionfunc = EnReeba_SetupSink;
} else if (this->sfxTimer == 0) {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_RIVA_MOVE);
this->sfxTimer = 10;
}
}
void func_80AE538C(EnReeba* this, PlayState* play) {
void EnReeba_SetupMoveBig(EnReeba* this, PlayState* play) {
this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE;
this->actionfunc = func_80AE53AC;
this->actionfunc = EnReeba_MoveBig;
}
void func_80AE53AC(EnReeba* this, PlayState* play) {
void EnReeba_MoveBig(EnReeba* this, PlayState* play) {
f32 speed;
s16 yawDiff;
s16 yaw;
@ -291,7 +291,7 @@ void func_80AE53AC(EnReeba* this, PlayState* play) {
if (((surfaceType != 4) && (surfaceType != 7)) || (this->actor.xzDistToPlayer > 400.0f) ||
(this->actor.bgCheckFlags & 8)) {
this->actionfunc = func_80AE5688;
this->actionfunc = EnReeba_SetupSink;
} else {
if ((this->actor.xzDistToPlayer < 70.0f) && (this->bigLeeverTimer == 0)) {
this->bigLeeverTimer = 30;
@ -318,27 +318,27 @@ void func_80AE53AC(EnReeba* this, PlayState* play) {
}
}
void func_80AE561C(EnReeba* this, PlayState* play) {
void EnReeba_Recoiled(EnReeba* this, PlayState* play) {
Math_ApproachZeroF(&this->actor.speedXZ, 1.0f, 0.3f);
if (this->moveTimer == 0) {
if (this->isBig) {
this->actionfunc = func_80AE538C;
this->actionfunc = EnReeba_SetupMoveBig;
} else {
this->actionfunc = func_80AE5688;
this->actionfunc = EnReeba_SetupSink;
}
}
}
void func_80AE5688(EnReeba* this, PlayState* play) {
void EnReeba_SetupSink(EnReeba* this, PlayState* play) {
this->stunType = 0;
Audio_PlayActorSound2(&this->actor, NA_SE_EN_AKINDONUTS_HIDE);
this->actor.flags |= ACTOR_FLAG_LOCK_ON_DISABLED;
this->actor.flags &= ~(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE);
this->actionfunc = func_80AE56E0;
this->actionfunc = EnReeba_Sink;
}
void func_80AE56E0(EnReeba* this, PlayState* play) {
void EnReeba_Sink(EnReeba* this, PlayState* play) {
Math_ApproachZeroF(&this->actor.shape.shadowScale, 1.0f, 0.3f);
Math_ApproachZeroF(&this->actor.speedXZ, 0.1f, 0.3f);
SkelAnime_Update(&this->skelanime);
@ -356,15 +356,15 @@ void func_80AE56E0(EnReeba* this, PlayState* play) {
}
}
void func_80AE57F0(EnReeba* this, PlayState* play) {
void EnReeba_SetupDamaged(EnReeba* this, PlayState* play) {
this->damagedTimer = 14;
this->actor.speedXZ = -8.0f;
this->actor.world.rot.y = this->actor.yawTowardsPlayer;
Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0, 8);
this->actionfunc = func_80AE5854;
this->actionfunc = EnReeba_Damaged;
}
void func_80AE5854(EnReeba* this, PlayState* play) {
void EnReeba_Damaged(EnReeba* this, PlayState* play) {
SkelAnime_Update(&this->skelanime);
if (this->actor.speedXZ < 0.0f) {
@ -374,23 +374,23 @@ void func_80AE5854(EnReeba* this, PlayState* play) {
if (this->damagedTimer == 0) {
if (this->isBig) {
this->bigLeeverTimer = 30;
this->actionfunc = func_80AE538C;
this->actionfunc = EnReeba_SetupMoveBig;
} else {
this->actionfunc = func_80AE5688;
this->actionfunc = EnReeba_SetupSink;
}
}
}
void func_80AE58EC(EnReeba* this, PlayState* play) {
void EnReeba_SetupStunned(EnReeba* this, PlayState* play) {
this->waitTimer = 14;
this->actor.world.rot.y = this->actor.yawTowardsPlayer;
this->actor.speedXZ = -8.0f;
this->actor.flags |= ACTOR_FLAG_LOCK_ON_DISABLED;
this->actor.flags &= ~(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE);
this->actionfunc = func_80AE5938;
this->actionfunc = EnReeba_Stunned;
}
void func_80AE5938(EnReeba* this, PlayState* play) {
void EnReeba_Stunned(EnReeba* this, PlayState* play) {
Vec3f pos;
f32 scale;
@ -416,15 +416,15 @@ void func_80AE5938(EnReeba* this, PlayState* play) {
}
this->waitTimer = 66;
this->actionfunc = func_80AE5E48;
this->actionfunc = EnReeba_StunRecover;
} else {
this->waitTimer = 30;
this->actionfunc = func_80AE5A9C;
this->actionfunc = EnReeba_StunDie;
}
}
}
void func_80AE5A9C(EnReeba* this, PlayState* play) {
void EnReeba_StunDie(EnReeba* this, PlayState* play) {
Vec3f pos;
f32 scale;
@ -444,21 +444,21 @@ void func_80AE5A9C(EnReeba* this, PlayState* play) {
} else {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_RIVA_DEAD);
Enemy_StartFinishingBlow(play, &this->actor);
this->actionfunc = func_80AE5C38;
this->actionfunc = EnReeba_Die;
GameInteractor_ExecuteOnEnemyDefeat(&this->actor);
}
}
void func_80AE5BC4(EnReeba* this, PlayState* play) {
void EnReeba_SetupDie(EnReeba* this, PlayState* play) {
this->actor.speedXZ = -8.0f;
this->actor.world.rot.y = this->actor.yawTowardsPlayer;
Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0, 8);
this->waitTimer = 14;
this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED;
this->actionfunc = func_80AE5C38;
this->actionfunc = EnReeba_Die;
}
void func_80AE5C38(EnReeba* this, PlayState* play) {
void EnReeba_Die(EnReeba* this, PlayState* play) {
Vec3f pos;
Vec3f accel = { 0.0f, 0.0f, 0.0f };
Vec3f velocity = { 0.0f, 0.0f, 0.0f };
@ -506,26 +506,26 @@ void func_80AE5C38(EnReeba* this, PlayState* play) {
}
}
void func_80AE5E48(EnReeba* this, PlayState* play) {
void EnReeba_StunRecover(EnReeba* this, PlayState* play) {
if (this->waitTimer < 37) {
this->actor.shape.rot.x = Rand_CenteredFloat(3000.0f);
this->actor.shape.rot.z = Rand_CenteredFloat(3000.0f);
if (this->waitTimer == 0) {
if (this->isBig) {
this->actionfunc = func_80AE538C;
this->actionfunc = EnReeba_SetupMoveBig;
} else {
this->actionfunc = func_80AE5688;
this->actionfunc = EnReeba_SetupSink;
}
}
}
}
void func_80AE5EDC(EnReeba* this, PlayState* play) {
void EnReeba_CheckDamage(EnReeba* this, PlayState* play) {
if (this->collider.base.acFlags & AC_HIT) {
this->collider.base.acFlags &= ~AC_HIT;
if ((this->actionfunc != func_80AE5C38) && (this->actionfunc != func_80AE5854)) {
if ((this->actionfunc != EnReeba_Die) && (this->actionfunc != EnReeba_Damaged)) {
this->actor.shape.rot.x = this->actor.shape.rot.z = 0;
this->stunType = 0;
@ -536,7 +536,7 @@ void func_80AE5EDC(EnReeba* this, PlayState* play) {
this->stunType = 4;
Audio_PlayActorSound2(&this->actor, NA_SE_EN_GOMA_JR_FREEZE);
Actor_SetColorFilter(&this->actor, 0, 0xFF, 0, 0x50);
this->actionfunc = func_80AE58EC;
this->actionfunc = EnReeba_SetupStunned;
break;
}
case 13: // hookshot/longshot
@ -544,7 +544,7 @@ void func_80AE5EDC(EnReeba* this, PlayState* play) {
this->stunType = 4;
Actor_SetColorFilter(&this->actor, 0, 0xFF, 0, 0x50);
Audio_PlayActorSound2(&this->actor, NA_SE_EN_GOMA_JR_FREEZE);
this->actionfunc = func_80AE58EC;
this->actionfunc = EnReeba_SetupStunned;
break;
}
case 14:
@ -553,13 +553,13 @@ void func_80AE5EDC(EnReeba* this, PlayState* play) {
if (this->actor.colChkInfo.health == 0) {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_RIVA_DEAD);
Enemy_StartFinishingBlow(play, &this->actor);
this->actionfunc = func_80AE5BC4;
this->actionfunc = EnReeba_SetupDie;
} else {
if (this->actionfunc == func_80AE5E48) {
if (this->actionfunc == EnReeba_StunRecover) {
this->actor.shape.rot.x = this->actor.shape.rot.z = 0;
}
Audio_PlayActorSound2(&this->actor, NA_SE_EN_RIVA_DAMAGE);
this->actionfunc = func_80AE57F0;
this->actionfunc = EnReeba_SetupDamaged;
}
break;
case 3: // ice arrows/ice magic
@ -567,13 +567,13 @@ void func_80AE5EDC(EnReeba* this, PlayState* play) {
this->unkDamageField = 2;
this->stunType = 2;
Actor_SetColorFilter(&this->actor, 0, 0xFF, 0, 80);
this->actionfunc = func_80AE58EC;
this->actionfunc = EnReeba_SetupStunned;
break;
case 1: // unknown
if (this->stunType != 4) {
this->stunType = 4;
Actor_SetColorFilter(&this->actor, 0, 0xFF, 0, 80);
this->actionfunc = func_80AE58EC;
this->actionfunc = EnReeba_SetupStunned;
}
break;
}
@ -586,7 +586,7 @@ void EnReeba_Update(Actor* thisx, PlayState* play2) {
EnReeba* this = (EnReeba*)thisx;
Player* player = GET_PLAYER(play);
func_80AE5EDC(this, play);
EnReeba_CheckDamage(this, play);
this->actionfunc(this, play);
Actor_SetScale(&this->actor, this->scale);
@ -616,19 +616,19 @@ void EnReeba_Update(Actor* thisx, PlayState* play2) {
if (this->collider.base.atFlags & AT_BOUNCED) {
this->collider.base.atFlags &= ~AT_BOUNCED;
if ((this->actionfunc == func_80AE5270) || (this->actionfunc == func_80AE53AC)) {
if ((this->actionfunc == EnReeba_Move) || (this->actionfunc == EnReeba_MoveBig)) {
this->actor.speedXZ = 8.0f;
this->actor.world.rot.y *= -1.0f;
this->moveTimer = 14;
this->actionfunc = func_80AE561C;
this->actionfunc = EnReeba_Recoiled;
return;
}
}
if (this->collider.base.atFlags & AT_HIT) {
this->collider.base.atFlags &= ~AT_HIT;
if ((this->collider.base.at == &player->actor) && !this->isBig && (this->actionfunc != func_80AE56E0)) {
this->actionfunc = func_80AE5688;
if ((this->collider.base.at == &player->actor) && !this->isBig && (this->actionfunc != EnReeba_Sink)) {
this->actionfunc = EnReeba_SetupSink;
}
}
@ -643,13 +643,13 @@ void EnReeba_Update(Actor* thisx, PlayState* play2) {
Collider_UpdateCylinder(&this->actor, &this->collider);
if ((this->actor.shape.yOffset >= -700.0f) && (this->actor.colChkInfo.health > 0) &&
(this->actionfunc != func_80AE56E0)) {
(this->actionfunc != EnReeba_Sink)) {
CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base);
if (!(this->actor.shape.yOffset < 0.0f)) {
CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base);
if ((this->actionfunc == func_80AE5270) || (this->actionfunc == func_80AE53AC)) {
if ((this->actionfunc == EnReeba_Move) || (this->actionfunc == EnReeba_MoveBig)) {
CollisionCheck_SetAT(play, &play->colChkCtx, &this->collider.base);
}
}

View file

@ -58,7 +58,7 @@ void EnRiverSound_Destroy(Actor* thisx, PlayState* play) {
}
}
s32 func_80AE6A54(Vec3f* arg0, Vec3f* arg1, Vec3f* arg2, Vec3f* arg3) {
s32 EnRiverSound_FindClosestPointOnLineSegment(Vec3f* arg0, Vec3f* arg1, Vec3f* arg2, Vec3f* arg3) {
Vec3f vec[3];
f32 temp;
@ -132,18 +132,18 @@ s32 EnRiverSound_GetSoundPos(Vec3s* points, s32 numPoints, Vec3f* hearPos, Vec3f
vec.x = point[-1].x;
vec.y = point[-1].y;
vec.z = point[-1].z;
sp78[0] = func_80AE6A54(&vec, &pointLoc, hearPos, &sp54);
sp78[0] = EnRiverSound_FindClosestPointOnLineSegment(&vec, &pointLoc, hearPos, &sp54);
}
if (pointIdx + 1 != numPoints) {
vec.x = point[1].x;
vec.y = point[1].y;
vec.z = point[1].z;
sp78[1] = func_80AE6A54(&pointLoc, &vec, hearPos, &sp60);
sp78[1] = EnRiverSound_FindClosestPointOnLineSegment(&pointLoc, &vec, hearPos, &sp60);
}
if (sp78[0] && sp78[1]) {
if (!func_80AE6A54(&sp54, &sp60, hearPos, soundPos)) {
if (!EnRiverSound_FindClosestPointOnLineSegment(&sp54, &sp60, hearPos, soundPos)) {
soundPos->x = (sp54.x + sp60.x) * 0.5f;
soundPos->y = (sp54.y + sp60.y) * 0.5f;
soundPos->z = (sp54.z + sp60.z) * 0.5f;

View file

@ -81,7 +81,7 @@ void func_80AE744C(EnRl* this, PlayState* play) {
Actor_UpdateBgCheckInfo(play, &this->actor, 75.0f, 30.0f, 30.0f, 5);
}
s32 func_80AE7494(EnRl* this) {
s32 EnRl_UpdateSkelAnime(EnRl* this) {
return SkelAnime_Update(&this->skelAnime);
}
@ -169,7 +169,7 @@ void func_80AE7798(EnRl* this, PlayState* play) {
void func_80AE77B8(EnRl* this, PlayState* play) {
func_80AE744C(this, play);
func_80AE7494(this);
EnRl_UpdateSkelAnime(this);
func_80AE72D0(this);
func_80AE7698(this, play);
}
@ -178,14 +178,14 @@ void func_80AE77F8(EnRl* this, PlayState* play) {
s32 temp;
func_80AE744C(this, play);
temp = func_80AE7494(this);
temp = EnRl_UpdateSkelAnime(this);
func_80AE72D0(this);
func_80AE772C(this, temp);
}
void func_80AE7838(EnRl* this, PlayState* play) {
func_80AE744C(this, play);
func_80AE7494(this);
EnRl_UpdateSkelAnime(this);
func_80AE72D0(this);
func_80AE7590(this, play);
}
@ -274,7 +274,7 @@ void func_80AE7C64(EnRl* this, PlayState* play) {
void func_80AE7C94(EnRl* this, PlayState* play) {
func_80AE744C(this, play);
func_80AE7494(this);
EnRl_UpdateSkelAnime(this);
func_80AE72D0(this);
func_80AE79A4(this, play);
func_80AE73D8(this, play);
@ -284,7 +284,7 @@ void func_80AE7CE8(EnRl* this, PlayState* play) {
s32 temp;
func_80AE744C(this, play);
temp = func_80AE7494(this);
temp = EnRl_UpdateSkelAnime(this);
func_80AE72D0(this);
func_80AE7BF8(this, temp);
func_80AE73D8(this, play);
@ -292,7 +292,7 @@ void func_80AE7CE8(EnRl* this, PlayState* play) {
void func_80AE7D40(EnRl* this, PlayState* play) {
func_80AE744C(this, play);
func_80AE7494(this);
EnRl_UpdateSkelAnime(this);
func_80AE72D0(this);
func_80AE7AF8(this, play);
func_80AE73D8(this, play);

View file

@ -144,7 +144,7 @@ s16 func_80AF5560(EnSa* this, PlayState* play) {
return textState;
}
u16 func_80AF55E0(PlayState* play, Actor* thisx) {
u16 EnSa_GetTextId(PlayState* play, Actor* thisx) {
EnSa* this = (EnSa*)thisx;
u16 reaction = Text_GetFaceReaction(play, 0x10);
@ -187,7 +187,7 @@ u16 func_80AF55E0(PlayState* play, Actor* thisx) {
return 0x1001;
}
s16 func_80AF56F4(PlayState* play, Actor* thisx) {
s16 EnSa_UpdateTalkState(PlayState* play, Actor* thisx) {
s16 ret = NPC_TALK_STATE_TALKING;
EnSa* this = (EnSa*)thisx;
@ -230,7 +230,7 @@ void func_80AF57D8(EnSa* this, PlayState* play) {
ABS((s16)(this->actor.yawTowardsPlayer - this->actor.shape.rot.y)) < 0x1555 ||
this->interactInfo.talkState != NPC_TALK_STATE_IDLE) {
Npc_UpdateTalking(play, &this->actor, &this->interactInfo.talkState, this->collider.dim.radius + 30.0f,
func_80AF55E0, func_80AF56F4);
EnSa_GetTextId, EnSa_UpdateTalkState);
}
}

View file

@ -17,16 +17,16 @@ void EnSyatekiNiw_Destroy(Actor* thisx, PlayState* play);
void EnSyatekiNiw_Update(Actor* thisx, PlayState* play);
void EnSyatekiNiw_Draw(Actor* thisx, PlayState* play);
void func_80B11DEC(EnSyatekiNiw* this, PlayState* play);
void func_80B132A8(EnSyatekiNiw* this, PlayState* play);
void func_80B129EC(EnSyatekiNiw* this, PlayState* play);
void func_80B13464(EnSyatekiNiw* this, PlayState* play);
void func_80B123A8(EnSyatekiNiw* this, PlayState* play);
void func_80B11E78(EnSyatekiNiw* this, PlayState* play);
void func_80B12460(EnSyatekiNiw* this, PlayState* play);
void func_80B128D8(EnSyatekiNiw* this, PlayState* play);
void EnSyatekiNiw_SetupDefault(EnSyatekiNiw* this, PlayState* play);
void EnSyatekiNiw_UpdateEffects(EnSyatekiNiw* this, PlayState* play);
void EnSyatekiNiw_Remove(EnSyatekiNiw* this, PlayState* play);
void EnSyatekiNiw_DrawEffects(EnSyatekiNiw* this, PlayState* play);
void EnSyatekiNiw_SetupArchery(EnSyatekiNiw* this, PlayState* play);
void EnSyatekiNiw_Default(EnSyatekiNiw* this, PlayState* play);
void EnSyatekiNiw_Archery(EnSyatekiNiw* this, PlayState* play);
void EnSyatekiNiw_ExitArchery(EnSyatekiNiw* this, PlayState* play);
void func_80B131B8(EnSyatekiNiw* this, Vec3f* arg1, Vec3f* arg2, Vec3f* arg3, f32 arg4);
void EnSyatekiNiw_SpawnFeather(EnSyatekiNiw* this, Vec3f* arg1, Vec3f* arg2, Vec3f* arg3, f32 arg4);
const ActorInit En_Syateki_Niw_InitVars = {
ACTOR_EN_SYATEKI_NIW,
@ -97,7 +97,7 @@ void EnSyatekiNiw_Init(Actor* thisx, PlayState* play) {
this->initPos = this->actor.world.pos;
this->targetPos = this->actor.world.pos;
this->actionFunc = func_80B11DEC;
this->actionFunc = EnSyatekiNiw_SetupDefault;
}
void EnSyatekiNiw_Destroy(Actor* thisx, PlayState* play) {
@ -108,7 +108,7 @@ void EnSyatekiNiw_Destroy(Actor* thisx, PlayState* play) {
ResourceMgr_UnregisterSkeleton(&this->skelAnime);
}
void func_80B11A94(EnSyatekiNiw* this, PlayState* play, s16 arg2) {
void EnSyatekiNiw_UpdateRotations(EnSyatekiNiw* this, PlayState* play, s16 arg2) {
if (this->peckTimer == 0) {
if (arg2 == 0) {
this->headRotXTarget = 0.0f;
@ -211,17 +211,17 @@ void func_80B11A94(EnSyatekiNiw* this, PlayState* play, s16 arg2) {
}
}
void func_80B11DEC(EnSyatekiNiw* this, PlayState* play) {
void EnSyatekiNiw_SetupDefault(EnSyatekiNiw* this, PlayState* play) {
Animation_Change(&this->skelAnime, &gCuccoAnim, 1.0f, 0.0f, Animation_GetLastFrame(&gCuccoAnim), ANIMMODE_LOOP,
-10.0f);
if (this->minigameType != 0) {
Actor_SetScale(&this->actor, this->scale);
}
this->actionFunc = func_80B11E78;
this->actionFunc = EnSyatekiNiw_Default;
}
void func_80B11E78(EnSyatekiNiw* this, PlayState* play) {
void EnSyatekiNiw_Default(EnSyatekiNiw* this, PlayState* play) {
Vec3f dustVelocity = { 0.0f, 0.0f, 0.0f };
Vec3f dustAccel = { 0.0f, 0.2f, 0.0f };
Color_RGBA8 dustPrimColor = { 0, 0, 0, 255 };
@ -235,7 +235,7 @@ void func_80B11E78(EnSyatekiNiw* this, PlayState* play) {
if ((this->archeryState != 0) && (this->minigameType == 0) && (this->actor.bgCheckFlags & 1)) {
this->archeryState = 0;
this->actionFunc = func_80B123A8;
this->actionFunc = EnSyatekiNiw_SetupArchery;
return;
}
@ -339,7 +339,7 @@ void func_80B11E78(EnSyatekiNiw* this, PlayState* play) {
}
if (this->sootTimer == 0) {
func_80B11A94(this, play, sp4A);
EnSyatekiNiw_UpdateRotations(this, play, sp4A);
return;
}
@ -351,14 +351,14 @@ void func_80B11E78(EnSyatekiNiw* this, PlayState* play) {
}
}
void func_80B123A8(EnSyatekiNiw* this, PlayState* play) {
void EnSyatekiNiw_SetupArchery(EnSyatekiNiw* this, PlayState* play) {
Animation_Change(&this->skelAnime, &gCuccoAnim, 1.0f, 0.0f, Animation_GetLastFrame(&gCuccoAnim), ANIMMODE_LOOP,
-10.0f);
this->rightWingRotZTarget = 6000.0f;
this->unkArcheryFloat = -10000.0f;
this->rightWingRot.z = 6000.0f;
this->rightWingRot.y = 10000.0f;
this->actionFunc = func_80B12460;
this->actionFunc = EnSyatekiNiw_Archery;
this->leftWingRot.z = 6000.0f;
this->leftWingRotZTarget = 6000.0f;
this->rightWingRot.x = -10000.0f;
@ -368,7 +368,7 @@ void func_80B123A8(EnSyatekiNiw* this, PlayState* play) {
this->leftWingRotXTarget = -10000.0f;
}
void func_80B12460(EnSyatekiNiw* this, PlayState* play) {
void EnSyatekiNiw_Archery(EnSyatekiNiw* this, PlayState* play) {
Player* player = GET_PLAYER(play);
f32 phi_f16 = 0.0f;
@ -474,7 +474,7 @@ void func_80B12460(EnSyatekiNiw* this, PlayState* play) {
play->shootingGalleryStatus = 0;
player->actor.freezeTimer = 20;
this->movementTimer = 0x14;
this->actionFunc = func_80B128D8;
this->actionFunc = EnSyatekiNiw_ExitArchery;
}
break;
}
@ -491,16 +491,16 @@ void func_80B12460(EnSyatekiNiw* this, PlayState* play) {
this->peckTimer = this->timer1;
}
func_80B11A94(this, play, this->archeryAnimationType);
EnSyatekiNiw_UpdateRotations(this, play, this->archeryAnimationType);
}
void func_80B128D8(EnSyatekiNiw* this, PlayState* play) {
void EnSyatekiNiw_ExitArchery(EnSyatekiNiw* this, PlayState* play) {
if (this->movementTimer == 1) {
gSaveContext.timerState = TIMER_STATE_OFF;
}
}
void func_80B128F8(EnSyatekiNiw* this, PlayState* play) {
void EnSyatekiNiw_SetupRemove(EnSyatekiNiw* this, PlayState* play) {
s16 sp26;
s16 sp24;
@ -513,11 +513,11 @@ void func_80B128F8(EnSyatekiNiw* this, PlayState* play) {
this->removeStateYaw = Rand_CenteredFloat(8000.0f) + -10000.0f;
this->cluckTimer = 0x1E;
this->movementTimer = 0x64;
this->actionFunc = func_80B129EC;
this->actionFunc = EnSyatekiNiw_Remove;
}
}
void func_80B129EC(EnSyatekiNiw* this, PlayState* play) {
void EnSyatekiNiw_Remove(EnSyatekiNiw* this, PlayState* play) {
s32 pad;
f32 phi_f2;
s16 sp2E;
@ -546,10 +546,10 @@ void func_80B129EC(EnSyatekiNiw* this, PlayState* play) {
tmpf2 = this->removeStateYaw + phi_f2;
Math_SmoothStepToS(&this->actor.world.rot.y, tmpf2, 3, this->posRotStep.y, 0);
Math_ApproachF(&this->posRotStep.y, 3000.0f, 1.0f, 500.0f);
func_80B11A94(this, play, 2);
EnSyatekiNiw_UpdateRotations(this, play, 2);
}
void func_80B12BA4(EnSyatekiNiw* this, PlayState* play) {
void EnSyatekiNiw_CheckHit(EnSyatekiNiw* this, PlayState* play) {
if (this->collider.base.acFlags & AC_HIT) {
this->collider.base.acFlags &= ~AC_HIT;
switch (this->minigameType) {
@ -559,7 +559,7 @@ void func_80B12BA4(EnSyatekiNiw* this, PlayState* play) {
Audio_PlayActorSound2(&this->actor, NA_SE_EV_CHICKEN_CRY_A);
this->archeryState = 1;
this->spawnFeathers = 1;
this->actionFunc = func_80B123A8;
this->actionFunc = EnSyatekiNiw_SetupArchery;
this->actor.gravity = -3.0f;
}
break;
@ -586,7 +586,7 @@ void EnSyatekiNiw_Update(Actor* thisx, PlayState* play) {
Vec3f sp6C;
Vec3f sp60;
func_80B132A8(this, play);
EnSyatekiNiw_UpdateEffects(this, play);
this->lifetime++;
if (this->peckTimer != 0) {
this->peckTimer--;
@ -633,15 +633,15 @@ void EnSyatekiNiw_Update(Actor* thisx, PlayState* play) {
sp6C.z = Rand_CenteredFloat(3.0f);
sp60.z = sp60.x = 0.0f;
sp60.y = -0.15f;
func_80B131B8(this, &sp78, &sp6C, &sp60, Rand_ZeroFloat(8.0f) + 8.0f);
EnSyatekiNiw_SpawnFeather(this, &sp78, &sp6C, &sp60, Rand_ZeroFloat(8.0f) + 8.0f);
}
this->spawnFeathers = 0;
}
func_80B12BA4(this, play);
EnSyatekiNiw_CheckHit(this, play);
if (this->cluckTimer == 0) {
if (this->actionFunc == func_80B11E78) {
if (this->actionFunc == EnSyatekiNiw_Default) {
this->cluckTimer = 0x12C;
Audio_PlayActorSound2(&this->actor, NA_SE_EV_CHICKEN_CRY_N);
} else {
@ -697,7 +697,7 @@ void EnSyatekiNiw_Draw(Actor* thisx, PlayState* play) {
EnSyatekiNiw* this = (EnSyatekiNiw*)thisx;
Color_RGBA8 sp30 = { 0, 0, 0, 255 };
if (this->actionFunc != func_80B128F8) {
if (this->actionFunc != EnSyatekiNiw_SetupRemove) {
Gfx_SetupDL_25Opa(play->state.gfxCtx);
if (this->sootTimer != 0) {
func_80026230(play, &sp30, 0, 0x14);
@ -705,11 +705,11 @@ void EnSyatekiNiw_Draw(Actor* thisx, PlayState* play) {
SkelAnime_DrawSkeletonOpa(play, &this->skelAnime, SyatekiNiw_OverrideLimbDraw, NULL, this);
func_80026608(play);
func_80B13464(this, play);
EnSyatekiNiw_DrawEffects(this, play);
}
}
void func_80B131B8(EnSyatekiNiw* this, Vec3f* arg1, Vec3f* arg2, Vec3f* arg3, f32 arg4) {
void EnSyatekiNiw_SpawnFeather(EnSyatekiNiw* this, Vec3f* arg1, Vec3f* arg2, Vec3f* arg3, f32 arg4) {
s16 i;
EnSyatekiNiw_1* ptr = &this->effects[0];
@ -729,7 +729,7 @@ void func_80B131B8(EnSyatekiNiw* this, Vec3f* arg1, Vec3f* arg2, Vec3f* arg3, f3
}
}
void func_80B132A8(EnSyatekiNiw* this, PlayState* play) {
void EnSyatekiNiw_UpdateEffects(EnSyatekiNiw* this, PlayState* play) {
s16 i;
EnSyatekiNiw_1* ptr = &this->effects[0];
@ -759,7 +759,7 @@ void func_80B132A8(EnSyatekiNiw* this, PlayState* play) {
}
}
void func_80B13464(EnSyatekiNiw* this, PlayState* play) {
void EnSyatekiNiw_DrawEffects(EnSyatekiNiw* this, PlayState* play) {
GraphicsContext* gfxCtx = play->state.gfxCtx;
s16 i;
EnSyatekiNiw_1* ptr = &this->effects[0];

View file

@ -72,7 +72,7 @@ void EnTa_SetupAction(EnTa* this, EnTaActionFunc arg1, EnTaUnkFunc arg2) {
this->animFunc = arg2;
}
void func_80B13AAC(EnTa* this, PlayState* play) {
void EnTa_SetTextForTalkInLonLonHouse(EnTa* this, PlayState* play) {
u16 faceReaction = Text_GetFaceReaction(play, 24);
if (gSaveContext.eventInf[0] & 0x400) {
@ -194,7 +194,7 @@ void EnTa_Init(Actor* thisx, PlayState* play2) {
this->superCuccos[2] = (EnNiw*)Actor_Spawn(
&play->actorCtx, play, ACTOR_EN_NIW, this->actor.world.pos.x + 20.0f,
this->actor.world.pos.y + 40.0f, this->actor.world.pos.z - 30.0f, 0, 0, 0, 0xD);
func_80B13AAC(this, play);
EnTa_SetTextForTalkInLonLonHouse(this, play);
if (gSaveContext.eventInf[0] & 0x400) {
EnTa_SetupAction(this, EnTa_IdleAfterCuccoGameFinished, EnTa_AnimRunToEnd);
@ -227,7 +227,7 @@ void EnTa_Init(Actor* thisx, PlayState* play2) {
}
}
void func_80B14248(EnTa* this) {
void EnTa_DecreaseShadowSize(EnTa* this) {
if (this->actor.shape.shadowScale > 36.0f) {
this->actor.shape.shadowScale -= 0.8f;
}
@ -249,7 +249,7 @@ void EnTa_Destroy(Actor* thisx, PlayState* play) {
ResourceMgr_UnregisterSkeleton(&this->skelAnime);
}
s32 func_80B142F4(EnTa* this, PlayState* play, u16 textId) {
s32 EnTa_RequestTalk(EnTa* this, PlayState* play, u16 textId) {
if (Actor_ProcessTalkRequest(&this->actor, play)) {
return true;
}
@ -264,19 +264,19 @@ s32 func_80B142F4(EnTa* this, PlayState* play, u16 textId) {
return false;
}
void func_80B14398(EnTa* this, PlayState* play) {
void EnTa_SleepTalkInKakariko(EnTa* this, PlayState* play) {
if (Actor_TextboxIsClosing(&this->actor, play)) {
EnTa_SetupAction(this, EnTa_IdleAsleepInKakariko, EnTa_AnimSleeping);
}
}
void func_80B143D4(EnTa* this, PlayState* play) {
void EnTa_SleepTalkInLonLonHouse(EnTa* this, PlayState* play) {
if (Actor_TextboxIsClosing(&this->actor, play)) {
EnTa_SetupAction(this, EnTa_IdleAsleepInLonLonHouse, EnTa_AnimSleeping);
}
}
void func_80B14410(EnTa* this) {
void EnTa_SetupAwake(EnTa* this) {
if (!LINK_IS_ADULT) {
EnTa_SetupAction(this, EnTa_IdleAwakeInCastle, EnTa_AnimRepeatCurrent);
Flags_SetEventChkInf(EVENTCHKINF_TALON_WOKEN_IN_CASTLE);
@ -286,34 +286,34 @@ void func_80B14410(EnTa* this) {
}
}
void func_80B1448C(EnTa* this, PlayState* play) {
void EnTa_TalkWakingUp2(EnTa* this, PlayState* play) {
if (Actor_TextboxIsClosing(&this->actor, play)) {
func_80B14410(this);
EnTa_SetupAwake(this);
}
func_80B14248(this);
EnTa_DecreaseShadowSize(this);
this->stateFlags |= 0x4;
}
void func_80B144D8(EnTa* this, PlayState* play) {
void EnTa_TalkWakingUp1(EnTa* this, PlayState* play) {
if (Actor_TextboxIsClosing(&this->actor, play)) {
func_80B14410(this);
EnTa_SetupAwake(this);
this->blinkTimer = 1;
this->blinkFunc = EnTa_BlinkAdvanceState;
}
if (Message_GetState(&play->msgCtx) == TEXT_STATE_DONE) {
this->eyeIndex = 1;
EnTa_SetupAction(this, func_80B1448C, EnTa_AnimRepeatCurrent);
EnTa_SetupAction(this, EnTa_TalkWakingUp2, EnTa_AnimRepeatCurrent);
}
func_80B14248(this);
EnTa_DecreaseShadowSize(this);
this->stateFlags |= 4;
}
void func_80B14570(EnTa* this, PlayState* play) {
void EnTa_WakeUp(EnTa* this, PlayState* play) {
this->stateFlags |= 4;
if (this->timer == 0) {
EnTa_SetupAction(this, func_80B144D8, EnTa_AnimRepeatCurrent);
EnTa_SetupAction(this, EnTa_TalkWakingUp1, EnTa_AnimRepeatCurrent);
this->rapidBlinks = 3;
this->timer = 60;
Animation_PlayOnce(&this->skelAnime, &gTalonWakeUpAnim);
@ -322,7 +322,7 @@ void func_80B14570(EnTa* this, PlayState* play) {
}
}
void func_80B145F8(EnTa* this, PlayState* play) {
void EnTa_SleepTalkInCastle(EnTa* this, PlayState* play) {
if (Actor_TextboxIsClosing(&this->actor, play)) {
EnTa_SetupAction(this, EnTa_IdleAsleepInCastle, EnTa_AnimSleeping);
}
@ -337,14 +337,14 @@ void EnTa_IdleAsleepInCastle(EnTa* this, PlayState* play) {
switch (exchangeItemId) {
case EXCH_ITEM_CHICKEN:
player->actor.textId = 0x702B;
EnTa_SetupAction(this, func_80B14570, EnTa_AnimRepeatCurrent);
EnTa_SetupAction(this, EnTa_WakeUp, EnTa_AnimRepeatCurrent);
this->timer = 40;
break;
default:
if (exchangeItemId != EXCH_ITEM_NONE) {
player->actor.textId = 0x702A;
}
EnTa_SetupAction(this, func_80B145F8, EnTa_AnimSleeping);
EnTa_SetupAction(this, EnTa_SleepTalkInCastle, EnTa_AnimSleeping);
break;
}
} else {
@ -355,7 +355,7 @@ void EnTa_IdleAsleepInCastle(EnTa* this, PlayState* play) {
void EnTa_IdleAsleepInLonLonHouse(EnTa* this, PlayState* play) {
if (Actor_ProcessTalkRequest(&this->actor, play)) {
EnTa_SetupAction(this, func_80B143D4, EnTa_AnimSleeping);
EnTa_SetupAction(this, EnTa_SleepTalkInLonLonHouse, EnTa_AnimSleeping);
}
this->actor.textId = 0x204B;
func_8002F2CC(&this->actor, play, 100.0f);
@ -370,14 +370,14 @@ void EnTa_IdleAsleepInKakariko(EnTa* this, PlayState* play) {
switch (exchangeItemId) {
case EXCH_ITEM_POCKET_CUCCO:
player->actor.textId = 0x702B;
EnTa_SetupAction(this, func_80B14570, EnTa_AnimRepeatCurrent);
EnTa_SetupAction(this, EnTa_WakeUp, EnTa_AnimRepeatCurrent);
this->timer = 40;
break;
default:
if (exchangeItemId != EXCH_ITEM_NONE) {
player->actor.textId = 0x5015;
}
EnTa_SetupAction(this, func_80B14398, EnTa_AnimSleeping);
EnTa_SetupAction(this, EnTa_SleepTalkInKakariko, EnTa_AnimSleeping);
break;
}
} else {
@ -386,7 +386,7 @@ void EnTa_IdleAsleepInKakariko(EnTa* this, PlayState* play) {
}
}
void func_80B14818(EnTa* this, PlayState* play) {
void EnTa_RunWithAccelerationAndSfx(EnTa* this, PlayState* play) {
s32 framesMod12 = (s32)play->state.frames % 12;
if (framesMod12 == 0 || framesMod12 == 6) {
@ -398,74 +398,74 @@ void func_80B14818(EnTa* this, PlayState* play) {
Actor_MoveXZGravity(&this->actor);
}
void func_80B14898(EnTa* this, PlayState* play) {
void EnTa_RunAwayRunOutOfGate(EnTa* this, PlayState* play) {
func_80033480(play, &this->actor.world.pos, 50.0f, 2, 250, 20, 1);
func_80B14818(this, play);
EnTa_RunWithAccelerationAndSfx(this, play);
if (this->timer == 0) {
Actor_Kill(&this->actor);
}
}
void func_80B1490C(EnTa* this, PlayState* play) {
void EnTa_RunAwayTurnTowardsGate(EnTa* this, PlayState* play) {
this->actor.world.rot.y += 0xC00;
this->actor.shape.rot.y += 0xC00;
if (this->timer == 0) {
EnTa_SetupAction(this, func_80B14898, EnTa_AnimRepeatCurrent);
EnTa_SetupAction(this, EnTa_RunAwayRunOutOfGate, EnTa_AnimRepeatCurrent);
this->timer = 60;
}
}
void func_80B1496C(EnTa* this, PlayState* play) {
void EnTa_RunAwayRunWest(EnTa* this, PlayState* play) {
func_80033480(play, &this->actor.world.pos, 50.0f, 2, 250, 20, 1);
func_80B14818(this, play);
EnTa_RunWithAccelerationAndSfx(this, play);
if (this->timer == 0) {
EnTa_SetupAction(this, func_80B1490C, EnTa_AnimRepeatCurrent);
EnTa_SetupAction(this, EnTa_RunAwayTurnTowardsGate, EnTa_AnimRepeatCurrent);
this->timer = 5;
}
}
void func_80B149F4(EnTa* this, PlayState* play) {
void EnTa_RunAwayTurnWest(EnTa* this, PlayState* play) {
this->actor.world.rot.y -= 0xD00;
this->actor.shape.rot.y -= 0xD00;
if (this->timer == 0) {
EnTa_SetupAction(this, func_80B1496C, EnTa_AnimRepeatCurrent);
EnTa_SetupAction(this, EnTa_RunAwayRunWest, EnTa_AnimRepeatCurrent);
this->timer = 65;
}
}
void func_80B14A54(EnTa* this, PlayState* play) {
void EnTa_RunAwayRunSouth(EnTa* this, PlayState* play) {
func_80033480(play, &this->actor.world.pos, 50.0f, 2, 250, 20, 1);
func_80B14818(this, play);
EnTa_RunWithAccelerationAndSfx(this, play);
if (this->timer == 20) {
Message_CloseTextbox(play);
}
if (this->timer == 0) {
this->timer = 5;
EnTa_SetupAction(this, func_80B149F4, EnTa_AnimRepeatCurrent);
EnTa_SetupAction(this, EnTa_RunAwayTurnWest, EnTa_AnimRepeatCurrent);
}
}
void func_80B14AF4(EnTa* this, PlayState* play) {
void EnTa_RunAwayStart(EnTa* this, PlayState* play) {
this->actor.world.rot.y -= 0xC00;
this->actor.shape.rot.y -= 0xC00;
if (this->timer == 0) {
Audio_PlayActorSound2(&this->actor, NA_SE_VO_TA_CRY_1);
EnTa_SetupAction(this, func_80B14A54, EnTa_AnimRepeatCurrent);
EnTa_SetupAction(this, EnTa_RunAwayRunSouth, EnTa_AnimRepeatCurrent);
this->timer = 65;
this->actor.flags |= ACTOR_FLAG_UPDATE_CULLING_DISABLED;
}
}
void func_80B14B6C(EnTa* this, PlayState* play) {
void EnTa_TalkAwakeInCastle(EnTa* this, PlayState* play) {
if (Message_GetState(&play->msgCtx) == TEXT_STATE_EVENT) {
s16 csCamIdx = OnePointCutscene_Init(play, 4175, -99, &this->actor, MAIN_CAM);
EnTa_SetupAction(this, func_80B14AF4, EnTa_AnimRepeatCurrent);
EnTa_SetupAction(this, EnTa_RunAwayStart, EnTa_AnimRepeatCurrent);
this->timer = 5;
Flags_SetEventChkInf(EVENTCHKINF_TALON_RETURNED_FROM_CASTLE);
if (GameInteractor_Should(VB_PLAY_ONEPOINT_ACTOR_CS, true, this)) {
@ -478,13 +478,13 @@ void func_80B14B6C(EnTa* this, PlayState* play) {
}
void EnTa_IdleAwakeInCastle(EnTa* this, PlayState* play) {
if (func_80B142F4(this, play, 0x702C)) {
EnTa_SetupAction(this, func_80B14B6C, EnTa_AnimRepeatCurrent);
if (EnTa_RequestTalk(this, play, 0x702C)) {
EnTa_SetupAction(this, EnTa_TalkAwakeInCastle, EnTa_AnimRepeatCurrent);
}
func_80B14248(this);
EnTa_DecreaseShadowSize(this);
}
void func_80B14C60(EnTa* this, PlayState* play) {
void EnTa_TalkAwakeInKakariko(EnTa* this, PlayState* play) {
if (Actor_TextboxIsClosing(&this->actor, play)) {
EnTa_SetupAction(this, EnTa_IdleAwakeInKakariko, EnTa_AnimRepeatCurrent);
}
@ -493,17 +493,17 @@ void func_80B14C60(EnTa* this, PlayState* play) {
void EnTa_IdleAwakeInKakariko(EnTa* this, PlayState* play) {
if (Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED)) {
if (func_80B142F4(this, play, 0x5017)) {
EnTa_SetupAction(this, func_80B14C60, EnTa_AnimRepeatCurrent);
if (EnTa_RequestTalk(this, play, 0x5017)) {
EnTa_SetupAction(this, EnTa_TalkAwakeInKakariko, EnTa_AnimRepeatCurrent);
Flags_SetEventChkInf(EVENTCHKINF_TALON_RETURNED_FROM_KAKARIKO);
}
} else if (func_80B142F4(this, play, 0x5016)) {
EnTa_SetupAction(this, func_80B14C60, EnTa_AnimRepeatCurrent);
} else if (EnTa_RequestTalk(this, play, 0x5016)) {
EnTa_SetupAction(this, EnTa_TalkAwakeInKakariko, EnTa_AnimRepeatCurrent);
}
func_80B14248(this);
EnTa_DecreaseShadowSize(this);
}
void func_80B14D4C(EnTa* this, PlayState* play) {
void EnTa_TalkAtRanch(EnTa* this, PlayState* play) {
if (Actor_TextboxIsClosing(&this->actor, play)) {
EnTa_SetupAction(this, EnTa_IdleAtRanch, EnTa_AnimRepeatCurrent);
}
@ -511,12 +511,12 @@ void func_80B14D4C(EnTa* this, PlayState* play) {
}
void EnTa_IdleAtRanch(EnTa* this, PlayState* play) {
if (func_80B142F4(this, play, 0x2055)) {
EnTa_SetupAction(this, func_80B14D4C, EnTa_AnimRepeatCurrent);
if (EnTa_RequestTalk(this, play, 0x2055)) {
EnTa_SetupAction(this, EnTa_TalkAtRanch, EnTa_AnimRepeatCurrent);
}
}
s32 func_80B14DD8(void) {
s32 EnTa_CheckCanBuyMilk(void) {
if (gSaveContext.rupees < 30) {
return 0;
} else if (!Inventory_HasEmptyBottle()) {
@ -526,7 +526,7 @@ s32 func_80B14DD8(void) {
}
}
void func_80B14E28(EnTa* this, PlayState* play) {
void EnTa_CreateFloorCamera(EnTa* this, PlayState* play) {
Vec3f b;
Vec3f a;
@ -546,12 +546,12 @@ void func_80B14E28(EnTa* this, PlayState* play) {
Play_CameraSetAtEye(play, this->subCamId, &a, &b);
}
void func_80B14EDC(EnTa* this, PlayState* play) {
void EnTa_RemoveFloorCamera(EnTa* this, PlayState* play) {
Play_ChangeCameraStatus(play, this->returnToCamId, CAM_STAT_ACTIVE);
Play_ClearCamera(play, this->subCamId);
}
void func_80B14F20(EnTa* this, EnTaActionFunc arg1) {
void EnTa_SetupActionWithSleepAnimation(EnTa* this, EnTaActionFunc arg1) {
EnTa_SetupAction(this, arg1, EnTa_AnimSitSleeping);
this->eyeIndex = 2;
Animation_Change(&this->skelAnime, &gTalonSitSleepingAnim, 1.0f, 0.0f,
@ -560,7 +560,7 @@ void func_80B14F20(EnTa* this, EnTaActionFunc arg1) {
this->currentAnimation = &gTalonSitSleepingAnim;
}
void func_80B14FAC(EnTa* this, EnTaActionFunc arg1) {
void EnTa_SetupActionWithWakeUpAnimation(EnTa* this, EnTaActionFunc arg1) {
this->eyeIndex = 1;
EnTa_SetupAction(this, arg1, EnTa_AnimRunToEnd);
this->stateFlags &= ~0x10;
@ -568,16 +568,16 @@ void func_80B14FAC(EnTa* this, EnTaActionFunc arg1) {
ANIMMODE_ONCE, -5.0f);
}
void func_80B15034(EnTa* this, PlayState* play) {
void EnTa_TalkNotEnoughRupees(EnTa* this, PlayState* play) {
if ((Message_GetState(&play->msgCtx) == TEXT_STATE_EVENT) && Message_ShouldAdvance(play)) {
Message_CloseTextbox(play);
func_80B14F20(this, EnTa_IdleSittingInLonLonHouse);
func_80B13AAC(this, play);
EnTa_SetupActionWithSleepAnimation(this, EnTa_IdleSittingInLonLonHouse);
EnTa_SetTextForTalkInLonLonHouse(this, play);
}
this->stateFlags |= 1;
}
s32 func_80B150AC(EnTa* this, PlayState* play, s32 idx) {
s32 EnTa_IsPlayerHoldingSuperCucco(EnTa* this, PlayState* play, s32 idx) {
Player* player = GET_PLAYER(play);
Actor* interactRangeActor;
@ -591,7 +591,7 @@ s32 func_80B150AC(EnTa* this, PlayState* play, s32 idx) {
return false;
}
void func_80B15100(EnTa* this, PlayState* play) {
void EnTa_TalkFoundSuperCucco(EnTa* this, PlayState* play) {
Player* player = GET_PLAYER(play);
if ((Message_GetState(&play->msgCtx) == TEXT_STATE_EVENT) && Message_ShouldAdvance(play)) {
@ -621,9 +621,9 @@ void func_80B15100(EnTa* this, PlayState* play) {
this->stateFlags |= 1;
}
void func_80B15260(EnTa* this, PlayState* play) {
void EnTa_IdleFoundSuperCucco(EnTa* this, PlayState* play) {
if (Actor_ProcessTalkRequest(&this->actor, play)) {
this->actionFunc = func_80B15100;
this->actionFunc = EnTa_TalkFoundSuperCucco;
this->actor.flags &= ~ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED;
} else {
func_8002F2CC(&this->actor, play, 1000.0f);
@ -643,7 +643,7 @@ s32 EnTa_GetSuperCuccosCount(EnTa* this, PlayState* play) {
return count;
}
void func_80B15308(EnTa* this) {
void EnTa_AnimateHandsUpDown(EnTa* this) {
if (this->stateFlags & 0x10) {
if (this->stateFlags & 0x100) {
Animation_Change(&this->skelAnime, &gTalonSitHandsUpAnim, 1.0f, 17.0f, 22.0f, ANIMMODE_ONCE, 0.0f);
@ -656,19 +656,19 @@ void func_80B15308(EnTa* this) {
}
}
void func_80B153D4(EnTa* this, PlayState* play) {
func_80B15308(this);
void EnTa_TransitionToPostCuccoGame(EnTa* this, PlayState* play) {
EnTa_AnimateHandsUpDown(this);
if (this->timer == 0) {
if (this->stateFlags & 0x80) {
this->stateFlags &= ~0x80;
func_80B14EDC(this, play);
EnTa_RemoveFloorCamera(this, play);
}
}
}
void func_80B15424(EnTa* this, PlayState* play) {
func_80B15308(this);
void EnTa_TalkCuccoGameEnd(EnTa* this, PlayState* play) {
EnTa_AnimateHandsUpDown(this);
if ((Message_GetState(&play->msgCtx) == TEXT_STATE_EVENT) && Message_ShouldAdvance(play)) {
play->nextEntranceIndex = ENTR_LON_LON_BUILDINGS_2;
@ -683,7 +683,7 @@ void func_80B15424(EnTa* this, PlayState* play) {
play->transitionTrigger = TRANS_TRIGGER_START;
gSaveContext.eventInf[0] |= 0x400;
this->actionFunc = func_80B153D4;
this->actionFunc = EnTa_TransitionToPostCuccoGame;
this->timer = 22;
}
}
@ -697,7 +697,7 @@ void EnTa_RunCuccoGame(EnTa* this, PlayState* play) {
this->superCuccos[i]->actor.gravity -= 0.03f;
}
if (!GameInteractor_Should(VB_PREVENT_STRENGTH, !func_80B150AC(this, play, i))) {
if (!GameInteractor_Should(VB_PREVENT_STRENGTH, !EnTa_IsPlayerHoldingSuperCucco(this, play, i))) {
if (this->superCuccoTimers[i] > 0) {
this->superCuccoTimers[i]--;
} else {
@ -711,7 +711,7 @@ void EnTa_RunCuccoGame(EnTa* this, PlayState* play) {
Player_SetCsActionWithHaltedActors(play, &this->actor, 1);
Message_StartTextbox(play, 0x2084, &this->actor);
this->actionFunc = func_80B15424;
this->actionFunc = EnTa_TalkCuccoGameEnd;
Animation_Change(&this->skelAnime, &gTalonSitHandsUpAnim, 1.0f, 8.0f, 29.0f, ANIMMODE_ONCE,
-10.0f);
this->stateFlags &= ~0x10;
@ -730,7 +730,7 @@ void EnTa_RunCuccoGame(EnTa* this, PlayState* play) {
Audio_PlayActorSound2(&this->actor, NA_SE_VO_TA_SURPRISE);
break;
}
this->actionFunc = func_80B15260;
this->actionFunc = EnTa_IdleFoundSuperCucco;
this->actor.flags |= ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED;
func_8002F2CC(&this->actor, play, 1000.0f);
return;
@ -752,8 +752,8 @@ void EnTa_RunCuccoGame(EnTa* this, PlayState* play) {
gSaveContext.timerState = TIMER_STATE_OFF;
Player_SetCsActionWithHaltedActors(play, &this->actor, 1);
Message_StartTextbox(play, 0x2081, &this->actor);
this->actionFunc = func_80B15424;
func_80B14E28(this, play);
this->actionFunc = EnTa_TalkCuccoGameEnd;
EnTa_CreateFloorCamera(this, play);
gSaveContext.eventInf[0] &= ~0x100;
this->stateFlags |= 0x80;
Animation_Change(&this->skelAnime, &gTalonSitHandsUpAnim, 1.0f, 8.0f, 29.0f, ANIMMODE_ONCE, -10.0f);
@ -764,7 +764,7 @@ void EnTa_RunCuccoGame(EnTa* this, PlayState* play) {
this->stateFlags |= 1;
}
void func_80B1585C(EnTa* this, PlayState* play) {
void EnTa_ThrowSuperCuccos(EnTa* this, PlayState* play) {
s32 i;
if (this->timer > 35) {
@ -807,9 +807,9 @@ void func_80B1585C(EnTa* this, PlayState* play) {
}
}
void func_80B15AD4(EnTa* this, PlayState* play) {
void EnTa_StartingCuccoGame3(EnTa* this, PlayState* play) {
if (this->timer == 0 && this->stateFlags & 0x20) {
EnTa_SetupAction(this, func_80B1585C, EnTa_AnimRunToEnd);
EnTa_SetupAction(this, EnTa_ThrowSuperCuccos, EnTa_AnimRunToEnd);
this->stateFlags &= ~0x10;
Animation_Change(&this->skelAnime, &gTalonSitHandsUpAnim, 1.0f, 1.0f,
Animation_GetLastFrame(&gTalonSitHandsUpAnim), ANIMMODE_ONCE, 0.0f);
@ -828,9 +828,9 @@ void func_80B15AD4(EnTa* this, PlayState* play) {
this->stateFlags |= 1;
}
void func_80B15BF8(EnTa* this, PlayState* play) {
void EnTa_StartingCuccoGame2(EnTa* this, PlayState* play) {
if (this->stateFlags & 0x10) {
EnTa_SetupAction(this, func_80B15AD4, EnTa_AnimRunToEnd);
EnTa_SetupAction(this, EnTa_StartingCuccoGame3, EnTa_AnimRunToEnd);
this->stateFlags &= ~0x10;
Animation_Change(&this->skelAnime, &gTalonSitHandsUpAnim, 1.0f, 0.0f, 1.0f, ANIMMODE_ONCE, 0.0f);
this->timer = 5;
@ -841,9 +841,9 @@ void func_80B15BF8(EnTa* this, PlayState* play) {
this->stateFlags |= 1;
}
void func_80B15CC8(EnTa* this, PlayState* play) {
void EnTa_StartingCuccoGame1(EnTa* this, PlayState* play) {
if (this->stateFlags & 0x10) {
EnTa_SetupAction(this, func_80B15BF8, EnTa_AnimRunToEnd);
EnTa_SetupAction(this, EnTa_StartingCuccoGame2, EnTa_AnimRunToEnd);
this->stateFlags &= ~0x10;
Animation_Change(&this->skelAnime, &gTalonSitHandsUpAnim, -1.0f, 29.0f, 0.0f, ANIMMODE_ONCE, 10.0f);
}
@ -853,8 +853,8 @@ void func_80B15CC8(EnTa* this, PlayState* play) {
this->stateFlags |= 1;
}
void func_80B15D90(EnTa* this, PlayState* play) {
EnTa_SetupAction(this, func_80B15CC8, EnTa_AnimRunToEnd);
void EnTa_StartCuccoGame(EnTa* this, PlayState* play) {
EnTa_SetupAction(this, EnTa_StartingCuccoGame1, EnTa_AnimRunToEnd);
this->stateFlags &= ~0x10;
Animation_Change(&this->skelAnime, &gTalonSitHandsUpAnim, 1.0f, 8.0f, 29.0f, ANIMMODE_ONCE, -10.0f);
Message_ContinueTextbox(play, 0x2080);
@ -863,8 +863,8 @@ void func_80B15D90(EnTa* this, PlayState* play) {
void EnTa_TalkGeneralInLonLonHouse(EnTa* this, PlayState* play) {
if (Actor_TextboxIsClosing(&this->actor, play)) {
func_80B14F20(this, EnTa_IdleSittingInLonLonHouse);
func_80B13AAC(this, play);
EnTa_SetupActionWithSleepAnimation(this, EnTa_IdleSittingInLonLonHouse);
EnTa_SetTextForTalkInLonLonHouse(this, play);
}
this->stateFlags |= 1;
}
@ -899,14 +899,14 @@ void EnTa_TalkAfterCuccoGameFirstWon(EnTa* this, PlayState* play) {
}
}
void func_80B15FE8(EnTa* this, PlayState* play) {
void EnTa_WaitBuyMilkOrPlayCuccoGameResponse(EnTa* this, PlayState* play) {
if ((Message_GetState(&play->msgCtx) == TEXT_STATE_CHOICE) && Message_ShouldAdvance(play)) {
switch (play->msgCtx.choiceIndex) {
case 0:
switch (func_80B14DD8()) {
switch (EnTa_CheckCanBuyMilk()) {
case 0:
Message_ContinueTextbox(play, 0x85);
EnTa_SetupAction(this, func_80B15034, EnTa_AnimRunToEnd);
EnTa_SetupAction(this, EnTa_TalkNotEnoughRupees, EnTa_AnimRunToEnd);
break;
case 1:
Message_ContinueTextbox(play, 0x208A);
@ -926,15 +926,15 @@ void func_80B15FE8(EnTa* this, PlayState* play) {
case 1:
if (gSaveContext.rupees < 10) {
Message_ContinueTextbox(play, 0x85);
EnTa_SetupAction(this, func_80B15034, EnTa_AnimRunToEnd);
EnTa_SetupAction(this, EnTa_TalkNotEnoughRupees, EnTa_AnimRunToEnd);
} else {
Rupees_ChangeBy(-10);
func_80B15D90(this, play);
EnTa_StartCuccoGame(this, play);
}
break;
case 2:
func_80B14F20(this, EnTa_IdleSittingInLonLonHouse);
func_80B13AAC(this, play);
EnTa_SetupActionWithSleepAnimation(this, EnTa_IdleSittingInLonLonHouse);
EnTa_SetTextForTalkInLonLonHouse(this, play);
break;
}
}
@ -944,7 +944,7 @@ void func_80B15FE8(EnTa* this, PlayState* play) {
}
}
void func_80B161C0(EnTa* this, PlayState* play) {
void EnTa_WaitForPlayCuccoGameResponse(EnTa* this, PlayState* play) {
s32 price;
if (this->actor.textId == 0x2085) {
@ -958,15 +958,15 @@ void func_80B161C0(EnTa* this, PlayState* play) {
case 0:
if (gSaveContext.rupees < price) {
Message_ContinueTextbox(play, 0x85);
EnTa_SetupAction(this, func_80B15034, EnTa_AnimRunToEnd);
EnTa_SetupAction(this, EnTa_TalkNotEnoughRupees, EnTa_AnimRunToEnd);
} else {
Rupees_ChangeBy(-price);
func_80B15D90(this, play);
EnTa_StartCuccoGame(this, play);
}
break;
case 1:
func_80B14F20(this, EnTa_IdleSittingInLonLonHouse);
func_80B13AAC(this, play);
EnTa_SetupActionWithSleepAnimation(this, EnTa_IdleSittingInLonLonHouse);
EnTa_SetTextForTalkInLonLonHouse(this, play);
break;
}
}
@ -976,7 +976,7 @@ void func_80B161C0(EnTa* this, PlayState* play) {
}
}
void func_80B162E8(EnTa* this, PlayState* play) {
void EnTa_WaitForMarryMalonResponse(EnTa* this, PlayState* play) {
if ((Message_GetState(&play->msgCtx) == TEXT_STATE_CHOICE) && Message_ShouldAdvance(play)) {
Message_ContinueTextbox(play, 0x2087);
EnTa_SetupAction(this, EnTa_TalkAfterCuccoGameFirstWon, EnTa_AnimRunToEnd);
@ -987,15 +987,15 @@ void func_80B162E8(EnTa* this, PlayState* play) {
}
}
void func_80B16364(EnTa* this, PlayState* play) {
void EnTa_ContinueTalkInLonLonHouse(EnTa* this, PlayState* play) {
if ((Message_GetState(&play->msgCtx) == TEXT_STATE_EVENT) && Message_ShouldAdvance(play)) {
Flags_SetInfTable(INFTABLE_TALKED_TO_TALON_IN_RANCH_HOUSE);
if (Flags_GetItemGetInf(ITEMGETINF_TALON_BOTTLE)) {
Message_ContinueTextbox(play, 0x208B);
EnTa_SetupAction(this, func_80B15FE8, EnTa_AnimRunToEnd);
EnTa_SetupAction(this, EnTa_WaitBuyMilkOrPlayCuccoGameResponse, EnTa_AnimRunToEnd);
} else {
Message_ContinueTextbox(play, 0x207F);
EnTa_SetupAction(this, func_80B161C0, EnTa_AnimRunToEnd);
EnTa_SetupAction(this, EnTa_WaitForPlayCuccoGameResponse, EnTa_AnimRunToEnd);
}
}
@ -1004,7 +1004,7 @@ void func_80B16364(EnTa* this, PlayState* play) {
}
}
void func_80B1642C(EnTa* this, PlayState* play) {
void EnTa_TalkAfterCuccoGameWon(EnTa* this, PlayState* play) {
if ((Message_GetState(&play->msgCtx) == TEXT_STATE_EVENT) && Message_ShouldAdvance(play)) {
if (Inventory_HasEmptyBottle()) {
Message_CloseTextbox(play);
@ -1021,26 +1021,26 @@ void func_80B1642C(EnTa* this, PlayState* play) {
void EnTa_IdleSittingInLonLonHouse(EnTa* this, PlayState* play) {
u16 faceReaction = Text_GetFaceReaction(play, 0x18);
func_80B13AAC(this, play);
EnTa_SetTextForTalkInLonLonHouse(this, play);
if (func_80B142F4(this, play, this->actor.textId)) {
if (EnTa_RequestTalk(this, play, this->actor.textId)) {
Audio_PlayActorSound2(&this->actor, NA_SE_VO_TA_SURPRISE);
if (faceReaction != 0) {
func_80B14FAC(this, EnTa_TalkGeneralInLonLonHouse);
EnTa_SetupActionWithWakeUpAnimation(this, EnTa_TalkGeneralInLonLonHouse);
} else {
Flags_SetInfTable(INFTABLE_TALKED_TO_TALON_IN_RANCH_HOUSE);
switch (this->actor.textId) {
case 0x207E:
case 0x207F:
func_80B14FAC(this, func_80B161C0);
EnTa_SetupActionWithWakeUpAnimation(this, EnTa_WaitForPlayCuccoGameResponse);
break;
case 0x208B:
func_80B14FAC(this, func_80B15FE8);
EnTa_SetupActionWithWakeUpAnimation(this, EnTa_WaitBuyMilkOrPlayCuccoGameResponse);
break;
default:
func_80B14FAC(this, func_80B16364);
EnTa_SetupActionWithWakeUpAnimation(this, EnTa_ContinueTalkInLonLonHouse);
break;
}
}
@ -1052,13 +1052,13 @@ void EnTa_IdleAfterCuccoGameFinished(EnTa* this, PlayState* play) {
if (Actor_ProcessTalkRequest(&this->actor, play)) {
switch (this->actor.textId) {
case 0x2085:
this->actionFunc = func_80B161C0;
this->actionFunc = EnTa_WaitForPlayCuccoGameResponse;
break;
case 0x2086:
this->actionFunc = func_80B162E8;
this->actionFunc = EnTa_WaitForMarryMalonResponse;
break;
case 0x2088:
this->actionFunc = func_80B1642C;
this->actionFunc = EnTa_TalkAfterCuccoGameWon;
break;
}
this->actor.flags &= ~ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED;

View file

@ -334,7 +334,7 @@ s32 EnTk_Orient(EnTk* this, PlayState* play) {
}
}
u16 func_80B1C54C(PlayState* play, Actor* thisx) {
u16 EnTk_GetTextId(PlayState* play, Actor* thisx) {
u16 ret;
ret = Text_GetFaceReaction(play, 14);
@ -351,7 +351,7 @@ u16 func_80B1C54C(PlayState* play, Actor* thisx) {
}
}
s16 func_80B1C5A0(PlayState* play, Actor* thisx) {
s16 EnTk_UpdateTalkState(PlayState* play, Actor* thisx) {
s32 ret = NPC_TALK_STATE_TALKING;
switch (Message_GetState(&play->msgCtx)) {
@ -537,7 +537,7 @@ void EnTk_Rest(EnTk* this, PlayState* play) {
}
Npc_UpdateTalking(play, &this->actor, &this->interactInfo.talkState, this->collider.dim.radius + 30.0f,
func_80B1C54C, func_80B1C5A0);
EnTk_GetTextId, EnTk_UpdateTalkState);
} else if (EnTk_CheckFacingPlayer(this)) {
v1 = this->actor.shape.rot.y;
v1 -= this->h_21E;
@ -545,7 +545,7 @@ void EnTk_Rest(EnTk* this, PlayState* play) {
this->actionCountdown = 0;
Npc_UpdateTalking(play, &this->actor, &this->interactInfo.talkState, this->collider.dim.radius + 30.0f,
func_80B1C54C, func_80B1C5A0);
EnTk_GetTextId, EnTk_UpdateTalkState);
} else if (Actor_ProcessTalkRequest(&this->actor, play)) {
v1 = this->actor.shape.rot.y;
v1 -= this->h_21E;

View file

@ -16,7 +16,7 @@ void EnToryo_Destroy(Actor* thisx, PlayState* play);
void EnToryo_Update(Actor* thisx, PlayState* play);
void EnToryo_Draw(Actor* thisx, PlayState* play);
void func_80B20914(EnToryo* this, PlayState* play);
void EnToryo_Idle(EnToryo* this, PlayState* play);
s32 EnToryo_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void* thisx);
void EnToryo_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, void* thisx);
@ -131,7 +131,7 @@ void EnToryo_Init(Actor* thisx, PlayState* play) {
sEnToryoAnimation.morphFrames);
this->stateFlags |= 8;
this->actor.targetMode = 6;
this->actionFunc = func_80B20914;
this->actionFunc = EnToryo_Idle;
}
void EnToryo_Destroy(Actor* thisx, PlayState* play) {
@ -142,7 +142,7 @@ void EnToryo_Destroy(Actor* thisx, PlayState* play) {
ResourceMgr_UnregisterSkeleton(&this->skelAnime);
}
s32 func_80B203D8(EnToryo* this, PlayState* play) {
s32 EnToryo_TalkRespond(EnToryo* this, PlayState* play) {
s32 pad;
Player* player = GET_PLAYER(play);
s32 ret = 1;
@ -215,7 +215,7 @@ s32 func_80B203D8(EnToryo* this, PlayState* play) {
return ret;
}
s32 func_80B205CC(EnToryo* this, PlayState* play) {
s32 EnToryo_DoneTalking(EnToryo* this, PlayState* play) {
s32 pad;
Player* player = GET_PLAYER(play);
s32 ret = 5;
@ -238,7 +238,7 @@ s32 func_80B205CC(EnToryo* this, PlayState* play) {
return ret;
}
u32 func_80B20634(EnToryo* this, PlayState* play) {
u32 EnToryo_ReactToExchangeItem(EnToryo* this, PlayState* play) {
u32 ret;
if (this->exchangeItemId != 0) {
@ -257,7 +257,7 @@ u32 func_80B20634(EnToryo* this, PlayState* play) {
return ret;
}
s32 func_80B206A0(EnToryo* this, PlayState* play) {
s32 EnToryo_GetTextId(EnToryo* this, PlayState* play) {
s32 textId = Text_GetFaceReaction(play, 0);
s32 ret = textId;
@ -286,7 +286,7 @@ s32 func_80B206A0(EnToryo* this, PlayState* play) {
return ret;
}
void func_80B20768(EnToryo* this, PlayState* play) {
void EnToryo_HandleTalking(EnToryo* this, PlayState* play) {
Player* player = GET_PLAYER(play);
s16 sp32;
s16 sp30;
@ -298,11 +298,11 @@ void func_80B20768(EnToryo* this, PlayState* play) {
}
if (this->messageState == 1) {
this->messageState = func_80B203D8(this, play);
this->messageState = EnToryo_TalkRespond(this, play);
}
if (this->messageState == 5) {
this->messageState = func_80B205CC(this, play);
this->messageState = EnToryo_DoneTalking(this, play);
return;
}
@ -326,7 +326,7 @@ void func_80B20768(EnToryo* this, PlayState* play) {
if (Actor_ProcessTalkRequest(&this->actor, play)) {
this->exchangeItemId = func_8002F368(play);
if (this->exchangeItemId != 0) {
player->actor.textId = func_80B20634(this, play);
player->actor.textId = EnToryo_ReactToExchangeItem(this, play);
this->actor.textId = player->actor.textId;
}
this->messageState = 1;
@ -335,15 +335,15 @@ void func_80B20768(EnToryo* this, PlayState* play) {
Actor_GetScreenPos(play, &this->actor, &sp32, &sp30);
if ((sp32 >= 0) && (sp32 < 0x141) && (sp30 >= 0) && (sp30 < 0xF1)) {
this->actor.textId = func_80B206A0(this, play);
this->actor.textId = EnToryo_GetTextId(this, play);
func_8002F298(&this->actor, play, 100.0f, 10);
}
}
}
void func_80B20914(EnToryo* this, PlayState* play) {
void EnToryo_Idle(EnToryo* this, PlayState* play) {
SkelAnime_Update(&this->skelAnime);
func_80B20768(this, play);
EnToryo_HandleTalking(this, play);
if (this->messageState != 0) {
this->stateFlags |= 0x10;
} else {

View file

@ -16,17 +16,17 @@ void EnWeiyer_Destroy(Actor* thisx, PlayState* play);
void EnWeiyer_Update(Actor* thisx, PlayState* play);
void EnWeiyer_Draw(Actor* thisx, PlayState* play);
void func_80B32804(EnWeiyer* this, PlayState* play);
void func_80B328E8(EnWeiyer* this, PlayState* play);
void func_80B32C2C(EnWeiyer* this, PlayState* play);
void func_80B32D30(EnWeiyer* this, PlayState* play);
void func_80B32E34(EnWeiyer* this, PlayState* play);
void func_80B33018(EnWeiyer* this, PlayState* play);
void func_80B331CC(EnWeiyer* this, PlayState* play);
void func_80B333B8(EnWeiyer* this, PlayState* play);
void func_80B332B4(EnWeiyer* this, PlayState* play);
void func_80B33338(EnWeiyer* this, PlayState* play);
void func_80B3349C(EnWeiyer* this, PlayState* play);
void EnWeiyer_InitInsideWaterBox(EnWeiyer* this, PlayState* play);
void EnWeiyer_FreeSwim(EnWeiyer* this, PlayState* play);
void EnWeiyer_TurnAround(EnWeiyer* this, PlayState* play);
void EnWeiyer_StuckOnFloor(EnWeiyer* this, PlayState* play);
void EnWeiyer_Attack(EnWeiyer* this, PlayState* play);
void EnWeiyer_Inactive(EnWeiyer* this, PlayState* play);
void EnWeiyer_Hurt(EnWeiyer* this, PlayState* play);
void EnWeiyer_Stunned(EnWeiyer* this, PlayState* play);
void EnWeiyer_Die(EnWeiyer* this, PlayState* play);
void EnWeiyer_Dead(EnWeiyer* this, PlayState* play);
void EnWeiyer_OutOfWater(EnWeiyer* this, PlayState* play);
const ActorInit En_Weiyer_InitVars = {
ACTOR_EN_WEIYER,
@ -112,7 +112,7 @@ void EnWeiyer_Init(Actor* thisx, PlayState* play) {
Collider_InitCylinder(play, &this->collider);
Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit);
CollisionCheck_SetInfo(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit);
this->actionFunc = func_80B32804;
this->actionFunc = EnWeiyer_InitInsideWaterBox;
}
void EnWeiyer_Destroy(Actor* thisx, PlayState* play) {
@ -123,7 +123,7 @@ void EnWeiyer_Destroy(Actor* thisx, PlayState* play) {
ResourceMgr_UnregisterSkeleton(&this->skelAnime);
}
void func_80B32384(EnWeiyer* this) {
void EnWeiyer_SetupFreeSwim(EnWeiyer* this) {
this->targetYaw = this->actor.shape.rot.y;
this->swimHeight = (cosf(-M_PI / 8) * 3.0f) + this->actor.world.pos.y;
Animation_MorphToLoop(&this->skelAnime, &gStingerHitAnim, -5.0f);
@ -131,42 +131,42 @@ void func_80B32384(EnWeiyer* this) {
this->actor.speedXZ = CLAMP_MAX(this->actor.speedXZ, 2.5f);
this->collider.base.atFlags &= ~AT_ON;
this->targetSwimHeight = this->actor.floorHeight;
this->actionFunc = func_80B328E8;
this->actionFunc = EnWeiyer_FreeSwim;
}
void func_80B32434(EnWeiyer* this) {
void EnWeiyer_SetupTurnAround(EnWeiyer* this) {
Animation_MorphToLoop(&this->skelAnime, &gStingerHitAnim, -5.0f);
this->collider.base.atFlags |= AT_ON;
this->timer = 0;
this->actor.speedXZ = 5.0f;
this->actionFunc = func_80B32C2C;
this->actionFunc = EnWeiyer_TurnAround;
}
void func_80B32494(EnWeiyer* this) {
void EnWeiyer_SetupStuckOnFloor(EnWeiyer* this) {
Animation_Change(&this->skelAnime, &gStingerPopOutAnim, 2.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f);
this->timer = 40;
this->collider.base.atFlags |= AT_ON;
this->actionFunc = func_80B32D30;
this->actionFunc = EnWeiyer_StuckOnFloor;
}
void func_80B32508(EnWeiyer* this) {
void EnWeiyer_SetupAttack(EnWeiyer* this) {
this->timer = 200;
this->collider.base.atFlags |= AT_ON;
this->skelAnime.playSpeed = 3.0f;
this->actionFunc = func_80B32E34;
this->actionFunc = EnWeiyer_Attack;
}
void func_80B32538(EnWeiyer* this) {
void EnWeiyer_SetupInactive(EnWeiyer* this) {
this->timer = 200;
this->targetYaw = this->actor.yawTowardsPlayer + 0x8000;
this->swimHeight = this->actor.world.pos.y;
this->actor.speedXZ = CLAMP_MAX(this->actor.speedXZ, 4.0f);
this->collider.base.atFlags &= ~AT_ON;
this->skelAnime.playSpeed = 1.0f;
this->actionFunc = func_80B33018;
this->actionFunc = EnWeiyer_Inactive;
}
void func_80B325A0(EnWeiyer* this) {
void EnWeiyer_SetupHurt(EnWeiyer* this) {
Animation_Change(&this->skelAnime, &gStingerHitAnim, 2.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -3.0f);
this->timer = 40;
this->collider.base.atFlags &= ~AT_ON;
@ -176,10 +176,10 @@ void func_80B325A0(EnWeiyer* this) {
this->actor.speedXZ = 3.0f;
Actor_SetColorFilter(&this->actor, 0x4000, 0xC8, 0, 0x28);
this->collider.dim.height = sCylinderInit.dim.height;
this->actionFunc = func_80B331CC;
this->actionFunc = EnWeiyer_Hurt;
}
void func_80B32660(EnWeiyer* this) {
void EnWeiyer_SetupStunned(EnWeiyer* this) {
Animation_Change(&this->skelAnime, &gStingerPopOutAnim, 2.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f);
this->timer = 80;
this->actor.speedXZ = 0.0f;
@ -189,34 +189,34 @@ void func_80B32660(EnWeiyer* this) {
Actor_SetColorFilter(&this->actor, 0, 0xC8, 0, 0x50);
this->collider.base.atFlags &= ~AT_ON;
Audio_PlayActorSound2(&this->actor, NA_SE_EN_GOMA_JR_FREEZE);
this->actionFunc = func_80B333B8;
this->actionFunc = EnWeiyer_Stunned;
}
void func_80B32724(EnWeiyer* this) {
void EnWeiyer_SetupDie(EnWeiyer* this) {
Animation_MorphToLoop(&this->skelAnime, &gStingerHitAnim, -5.0f);
this->timer = 20;
Actor_SetColorFilter(&this->actor, 0x4000, 0xC8, 0, 0x28);
this->collider.base.atFlags &= ~AT_ON;
this->collider.base.acFlags &= ~AC_ON;
this->actor.speedXZ = 3.0f;
this->actionFunc = func_80B332B4;
this->actionFunc = EnWeiyer_Die;
}
void func_80B327B0(EnWeiyer* this) {
void EnWeiyer_SetupDead(EnWeiyer* this) {
this->actor.colorFilterParams |= 0x2000;
this->actor.speedXZ = 0.0f;
this->actor.velocity.y = 0.0f;
this->actionFunc = func_80B33338;
this->actionFunc = EnWeiyer_Dead;
}
void func_80B327D8(EnWeiyer* this) {
void EnWeiyer_SetupOutOfWater(EnWeiyer* this) {
this->actor.shape.rot.x = -0x2000;
this->timer = -1;
this->actor.speedXZ = 5.0f;
this->actionFunc = func_80B3349C;
this->actionFunc = EnWeiyer_OutOfWater;
}
void func_80B32804(EnWeiyer* this, PlayState* play) {
void EnWeiyer_InitInsideWaterBox(EnWeiyer* this, PlayState* play) {
WaterBox* waterBox;
s32 bgId;
@ -231,11 +231,11 @@ void func_80B32804(EnWeiyer* this, PlayState* play) {
} else {
this->actor.home.pos.y -= 5.0f;
this->actor.world.pos.y = (this->actor.home.pos.y + this->actor.floorHeight) / 2.0f;
func_80B32384(this);
EnWeiyer_SetupFreeSwim(this);
}
}
void func_80B328E8(EnWeiyer* this, PlayState* play) {
void EnWeiyer_FreeSwim(EnWeiyer* this, PlayState* play) {
s32 sp34;
f32 curFrame;
@ -275,7 +275,7 @@ void func_80B328E8(EnWeiyer* this, PlayState* play) {
if (this->actor.home.pos.y < this->actor.world.pos.y) {
if (this->actor.home.pos.y < this->actor.floorHeight) {
func_80B32434(this);
EnWeiyer_SetupTurnAround(this);
} else {
this->actor.world.pos.y = this->actor.home.pos.y;
this->targetSwimHeight =
@ -294,12 +294,12 @@ void func_80B328E8(EnWeiyer* this, PlayState* play) {
if ((this->actor.xzDistToPlayer < 400.0f) && (fabsf(this->actor.yDistToPlayer) < 250.0f) &&
(player->actor.world.pos.y < (this->actor.home.pos.y + 20.0f))) {
func_80B32508(this);
EnWeiyer_SetupAttack(this);
}
}
}
void func_80B32C2C(EnWeiyer* this, PlayState* play) {
void EnWeiyer_TurnAround(EnWeiyer* this, PlayState* play) {
SkelAnime_Update(&this->skelAnime);
if (this->timer == 0) {
@ -319,14 +319,14 @@ void func_80B32C2C(EnWeiyer* this, PlayState* play) {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_OCTAROCK_SINK);
}
func_80B32538(this);
EnWeiyer_SetupInactive(this);
} else if (this->actor.bgCheckFlags & 1) {
func_80B32494(this);
EnWeiyer_SetupStuckOnFloor(this);
}
}
}
void func_80B32D30(EnWeiyer* this, PlayState* play) {
void EnWeiyer_StuckOnFloor(EnWeiyer* this, PlayState* play) {
SkelAnime_Update(&this->skelAnime);
if (Animation_OnFrame(&this->skelAnime, 0.0f)) {
@ -341,13 +341,13 @@ void func_80B32D30(EnWeiyer* this, PlayState* play) {
}
if (this->timer == 0) {
func_80B32434(this);
EnWeiyer_SetupTurnAround(this);
} else if (this->actor.world.pos.y < this->actor.home.pos.y) {
func_80B32384(this);
EnWeiyer_SetupFreeSwim(this);
}
}
s16 func_80B32DEC(EnWeiyer* this, PlayState* play) {
s16 EnWeiyer_PitchTowardPlayer(EnWeiyer* this, PlayState* play) {
Player* player = GET_PLAYER(play);
Vec3f vec;
@ -358,7 +358,7 @@ s16 func_80B32DEC(EnWeiyer* this, PlayState* play) {
return Actor_WorldPitchTowardPoint(&this->actor, &vec);
}
void func_80B32E34(EnWeiyer* this, PlayState* play) {
void EnWeiyer_Attack(EnWeiyer* this, PlayState* play) {
Player* player = GET_PLAYER(play);
SkelAnime_Update(&this->skelAnime);
@ -369,7 +369,7 @@ void func_80B32E34(EnWeiyer* this, PlayState* play) {
if ((this->timer == 0) || ((this->actor.home.pos.y + 20.0f) <= player->actor.world.pos.y) ||
(this->collider.base.atFlags & AT_HIT)) {
func_80B32538(this);
EnWeiyer_SetupInactive(this);
} else {
if (Actor_IsFacingPlayer(&this->actor, 0x2800)) {
Math_StepToF(&this->actor.speedXZ, 4.0f, 0.2f);
@ -380,26 +380,26 @@ void func_80B32E34(EnWeiyer* this, PlayState* play) {
if (this->actor.home.pos.y < this->actor.world.pos.y) {
if (this->actor.home.pos.y < this->actor.floorHeight) {
this->actor.shape.rot.x = 0;
func_80B32434(this);
EnWeiyer_SetupTurnAround(this);
return;
}
this->actor.world.pos.y = this->actor.home.pos.y;
Math_SmoothStepToS(&this->actor.shape.rot.x, 0x1000, 2, 0x100, 0x40);
} else {
Math_SmoothStepToS(&this->actor.shape.rot.x, func_80B32DEC(this, play), 2, 0x100, 0x40);
Math_SmoothStepToS(&this->actor.shape.rot.x, EnWeiyer_PitchTowardPlayer(this, play), 2, 0x100, 0x40);
}
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 2, 0x200, 0x80);
if ((player->actor.yDistToWater < 50.0f) && (this->actor.yDistToWater < 20.0f) &&
Actor_IsFacingPlayer(&this->actor, 0x2000)) {
func_80B327D8(this);
EnWeiyer_SetupOutOfWater(this);
}
}
}
void func_80B33018(EnWeiyer* this, PlayState* play) {
void EnWeiyer_Inactive(EnWeiyer* this, PlayState* play) {
f32 curFrame;
SkelAnime_Update(&this->skelAnime);
@ -429,18 +429,18 @@ void func_80B33018(EnWeiyer* this, PlayState* play) {
if (this->actor.home.pos.y < this->actor.world.pos.y) {
if (this->actor.home.pos.y < this->actor.floorHeight) {
func_80B32434(this);
EnWeiyer_SetupTurnAround(this);
} else {
this->actor.world.pos.y = this->actor.home.pos.y;
}
}
if (this->timer == 0) {
func_80B32384(this);
EnWeiyer_SetupFreeSwim(this);
}
}
void func_80B331CC(EnWeiyer* this, PlayState* play) {
void EnWeiyer_Hurt(EnWeiyer* this, PlayState* play) {
SkelAnime_Update(&this->skelAnime);
if (this->timer != 0) {
@ -460,11 +460,11 @@ void func_80B331CC(EnWeiyer* this, PlayState* play) {
if (this->timer == 0) {
this->actor.shape.rot.z = 0;
this->collider.base.acFlags |= AC_ON;
func_80B32384(this);
EnWeiyer_SetupFreeSwim(this);
}
}
void func_80B332B4(EnWeiyer* this, PlayState* play) {
void EnWeiyer_Die(EnWeiyer* this, PlayState* play) {
SkelAnime_Update(&this->skelAnime);
Math_ScaledStepToS(&this->actor.shape.rot.x, -0x4000, 0x400);
this->actor.shape.rot.z += 0x1000;
@ -474,11 +474,11 @@ void func_80B332B4(EnWeiyer* this, PlayState* play) {
}
if ((this->timer == 0) || (this->actor.bgCheckFlags & 0x10)) {
func_80B327B0(this);
EnWeiyer_SetupDead(this);
}
}
void func_80B33338(EnWeiyer* this, PlayState* play) {
void EnWeiyer_Dead(EnWeiyer* this, PlayState* play) {
this->actor.shape.shadowAlpha = CLAMP_MIN((s16)(this->actor.shape.shadowAlpha - 5), 0);
this->actor.world.pos.y -= 2.0f;
@ -488,7 +488,7 @@ void func_80B33338(EnWeiyer* this, PlayState* play) {
}
}
void func_80B333B8(EnWeiyer* this, PlayState* play) {
void EnWeiyer_Stunned(EnWeiyer* this, PlayState* play) {
if (this->timer != 0) {
this->timer--;
}
@ -511,11 +511,11 @@ void func_80B333B8(EnWeiyer* this, PlayState* play) {
this->actor.gravity = 0.0f;
this->actor.velocity.y = 0.0f;
this->collider.dim.height = sCylinderInit.dim.height;
func_80B32384(this);
EnWeiyer_SetupFreeSwim(this);
}
}
void func_80B3349C(EnWeiyer* this, PlayState* play) {
void EnWeiyer_OutOfWater(EnWeiyer* this, PlayState* play) {
Player* player = GET_PLAYER(play);
s16 phi_a1;
s32 phi_a0;
@ -526,7 +526,7 @@ void func_80B3349C(EnWeiyer* this, PlayState* play) {
if (this->timer == -1) {
if (phi_a0 || (this->collider.base.atFlags & AT_HIT)) {
func_80B32538(this);
EnWeiyer_SetupInactive(this);
} else if (this->actor.yDistToWater < 0.0f) {
this->timer = 10;
EffectSsGSplash_Spawn(play, &this->actor.world.pos, NULL, NULL, 1, 400);
@ -542,7 +542,7 @@ void func_80B3349C(EnWeiyer* this, PlayState* play) {
if (this->timer == 0) {
phi_a1 = 0x1800;
} else {
phi_a1 = func_80B32DEC(this, play);
phi_a1 = EnWeiyer_PitchTowardPlayer(this, play);
phi_a1 = CLAMP_MIN(phi_a1, 0);
}
@ -551,35 +551,35 @@ void func_80B3349C(EnWeiyer* this, PlayState* play) {
}
if (this->actor.bgCheckFlags & 1) {
func_80B32434(this);
EnWeiyer_SetupTurnAround(this);
} else if ((this->actor.bgCheckFlags & 0x20) && (this->actor.shape.rot.x > 0)) {
EffectSsGSplash_Spawn(play, &this->actor.world.pos, NULL, NULL, 1, 400);
Audio_PlayActorSound2(&this->actor, NA_SE_EN_OCTAROCK_SINK);
func_80B32538(this);
EnWeiyer_SetupInactive(this);
} else {
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 8, 0x100, 0x80);
}
}
}
void func_80B3368C(EnWeiyer* this, PlayState* play) {
void EnWeiyer_UpdateDamage(EnWeiyer* this, PlayState* play) {
if (this->collider.base.acFlags & AC_HIT) {
this->collider.base.acFlags &= ~AC_HIT;
Actor_SetDropFlag(&this->actor, &this->collider.info, 1);
if ((this->actor.colChkInfo.damageEffect != 0) || (this->actor.colChkInfo.damage != 0)) {
if (this->actor.colChkInfo.damageEffect == 1) {
if (this->actionFunc != func_80B333B8) {
func_80B32660(this);
if (this->actionFunc != EnWeiyer_Stunned) {
EnWeiyer_SetupStunned(this);
}
} else if (Actor_ApplyDamage(&this->actor) == 0) {
Enemy_StartFinishingBlow(play, &this->actor);
Audio_PlayActorSound2(&this->actor, NA_SE_EN_EIER_DEAD);
this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED;
func_80B32724(this);
EnWeiyer_SetupDie(this);
GameInteractor_ExecuteOnEnemyDefeat(&this->actor);
} else {
func_80B325A0(this);
EnWeiyer_SetupHurt(this);
}
}
}
@ -590,12 +590,12 @@ void EnWeiyer_Update(Actor* thisx, PlayState* play) {
s32 pad;
this->actor.home.pos.y = this->actor.yDistToWater + this->actor.world.pos.y - 5.0f;
func_80B3368C(this, play);
EnWeiyer_UpdateDamage(this, play);
this->actionFunc(this, play);
this->actor.world.rot.y = this->actor.shape.rot.y;
this->actor.world.rot.x = -this->actor.shape.rot.x;
if ((this->actor.world.rot.x == 0) || (this->actionFunc == func_80B333B8)) {
if ((this->actor.world.rot.x == 0) || (this->actionFunc == EnWeiyer_Stunned)) {
Actor_MoveXZGravity(&this->actor);
} else {
Actor_MoveXYZ(&this->actor);
@ -636,7 +636,7 @@ void EnWeiyer_Draw(Actor* thisx, PlayState* play) {
OPEN_DISPS(play->state.gfxCtx);
if (this->actionFunc != func_80B33338) {
if (this->actionFunc != EnWeiyer_Dead) {
Gfx_SetupDL_25Opa(play->state.gfxCtx);
gSPSegment(POLY_OPA_DISP++, 0x08, &D_80116280[2]);
gDPSetEnvColor(POLY_OPA_DISP++, 255, 255, 255, 255);

View file

@ -15,7 +15,7 @@ void ItemEtcetera_Update(Actor* thisx, PlayState* play);
void ItemEtcetera_DrawThroughLens(Actor* thisx, PlayState* play);
void ItemEtcetera_Draw(Actor* thisx, PlayState* play);
void func_80B857D0(ItemEtcetera* this, PlayState* play);
void ItemEtcetera_WaitForObject(ItemEtcetera* this, PlayState* play);
void func_80B85824(ItemEtcetera* this, PlayState* play);
void func_80B858B4(ItemEtcetera* this, PlayState* play);
void ItemEtcetera_SpawnSparkles(ItemEtcetera* this, PlayState* play);
@ -78,7 +78,7 @@ void ItemEtcetera_Init(Actor* thisx, PlayState* play) {
this->futureActionFunc = func_80B85824;
this->drawFunc = ItemEtcetera_Draw;
Actor_SetScale(&this->actor, 0.25f);
ItemEtcetera_SetupAction(this, func_80B857D0);
ItemEtcetera_SetupAction(this, ItemEtcetera_WaitForObject);
switch (type) {
case ITEM_ETC_LETTER:
Actor_SetScale(&this->actor, 0.5f);
@ -110,7 +110,7 @@ void ItemEtcetera_Init(Actor* thisx, PlayState* play) {
void ItemEtcetera_Destroy(Actor* thisx, PlayState* play) {
}
void func_80B857D0(ItemEtcetera* this, PlayState* play) {
void ItemEtcetera_WaitForObject(ItemEtcetera* this, PlayState* play) {
if (Object_IsLoaded(&play->objectCtx, this->objBankIndex)) {
this->actor.objBankIndex = this->objBankIndex;
this->actor.draw = this->drawFunc;

View file

@ -15,13 +15,13 @@ void ObjLift_Destroy(Actor* thisx, PlayState* play);
void ObjLift_Update(Actor* thisx, PlayState* play);
void ObjLift_Draw(Actor* thisx, PlayState* play);
void func_80B9651C(ObjLift* this);
void func_80B9664C(ObjLift* this);
void func_80B967C0(ObjLift* this);
void ObjLift_SetupWait(ObjLift* this);
void ObjLift_SetupShake(ObjLift* this);
void ObjLift_SetupFall(ObjLift* this);
void func_80B96560(ObjLift* this, PlayState* play);
void func_80B96678(ObjLift* this, PlayState* play);
void func_80B96840(ObjLift* this, PlayState* play);
void ObjLift_Wait(ObjLift* this, PlayState* play);
void ObjLift_Shake(ObjLift* this, PlayState* play);
void ObjLift_Fall(ObjLift* this, PlayState* play);
const ActorInit Obj_Lift_InitVars = {
ACTOR_OBJ_LIFT,
@ -76,7 +76,7 @@ void ObjLift_InitDynaPoly(ObjLift* this, PlayState* play, CollisionHeader* colli
}
}
void func_80B96160(ObjLift* this, PlayState* play) {
void ObjLift_SpawnFragments(ObjLift* this, PlayState* play) {
Vec3f pos;
Vec3f velocity;
Vec3f* temp_s3;
@ -119,7 +119,7 @@ void ObjLift_Init(Actor* thisx, PlayState* play) {
this->shakeOrientation.x = Rand_ZeroOne() * 65535.5f;
this->shakeOrientation.y = Rand_ZeroOne() * 65535.5f;
this->shakeOrientation.z = Rand_ZeroOne() * 65535.5f;
func_80B9651C(this);
ObjLift_SetupWait(this);
osSyncPrintf("(Dungeon Lift)(arg_data 0x%04x)\n", this->dyna.actor.params);
}
@ -129,25 +129,25 @@ void ObjLift_Destroy(Actor* thisx, PlayState* play) {
DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId);
}
void func_80B9651C(ObjLift* this) {
void ObjLift_SetupWait(ObjLift* this) {
this->timer = sFallTimerDurations[(this->dyna.actor.params >> 8) & 7];
ObjLift_SetupAction(this, func_80B96560);
ObjLift_SetupAction(this, ObjLift_Wait);
}
void func_80B96560(ObjLift* this, PlayState* play) {
void ObjLift_Wait(ObjLift* this, PlayState* play) {
s32 pad;
s32 quakeIndex;
if (DynaPolyActor_IsPlayerOnTop(&this->dyna)) {
if (this->timer <= 0) {
if (((this->dyna.actor.params >> 8) & 7) == 7) {
func_80B967C0(this);
ObjLift_SetupFall(this);
} else {
quakeIndex = Quake_Add(GET_ACTIVE_CAM(play), 1);
Quake_SetSpeed(quakeIndex, 10000);
Quake_SetQuakeValues(quakeIndex, 2, 0, 0, 0);
Quake_SetCountdown(quakeIndex, 20);
func_80B9664C(this);
ObjLift_SetupShake(this);
}
}
} else {
@ -155,14 +155,14 @@ void func_80B96560(ObjLift* this, PlayState* play) {
}
}
void func_80B9664C(ObjLift* this) {
void ObjLift_SetupShake(ObjLift* this) {
this->timer = 20;
ObjLift_SetupAction(this, func_80B96678);
ObjLift_SetupAction(this, ObjLift_Shake);
}
void func_80B96678(ObjLift* this, PlayState* play) {
void ObjLift_Shake(ObjLift* this, PlayState* play) {
if (this->timer <= 0) {
func_80B967C0(this);
ObjLift_SetupFall(this);
} else {
this->shakeOrientation.x += 10000;
this->dyna.actor.world.rot.x =
@ -183,13 +183,13 @@ void func_80B96678(ObjLift* this, PlayState* play) {
}
}
void func_80B967C0(ObjLift* this) {
ObjLift_SetupAction(this, func_80B96840);
void ObjLift_SetupFall(ObjLift* this) {
ObjLift_SetupAction(this, ObjLift_Fall);
Math_Vec3f_Copy(&this->dyna.actor.world.pos, &this->dyna.actor.home.pos);
this->dyna.actor.shape.rot = this->dyna.actor.world.rot = this->dyna.actor.home.rot;
}
void func_80B96840(ObjLift* this, PlayState* play) {
void ObjLift_Fall(ObjLift* this, PlayState* play) {
s32 pad;
s32 bgId;
Vec3f sp2C;
@ -202,7 +202,7 @@ void func_80B96840(ObjLift* this, PlayState* play) {
if ((this->dyna.actor.floorHeight - this->dyna.actor.world.pos.y) >=
(sMaxFallDistances[(this->dyna.actor.params >> 1) & 1] - 0.001f)) {
func_80B96160(this, play);
ObjLift_SpawnFragments(this, play);
SoundSource_PlaySfxAtFixedWorldPos(play, &this->dyna.actor.world.pos, 20, NA_SE_EV_BOX_BREAK);
Flags_SetSwitch(play, (this->dyna.actor.params >> 2) & 0x3F);
Actor_Kill(&this->dyna.actor);

View file

@ -18,7 +18,7 @@ void ShotSun_Update(Actor* thisx, PlayState* play);
void ShotSun_SpawnFairy(ShotSun* this, PlayState* play);
void ShotSun_TriggerFairy(ShotSun* this, PlayState* play);
void func_80BADF0C(ShotSun* this, PlayState* play);
void ShotSun_UpdateFairySpawner(ShotSun* this, PlayState* play);
void ShotSun_UpdateHyliaSun(ShotSun* this, PlayState* play);
const ActorInit Shot_Sun_InitVars = {
@ -65,7 +65,7 @@ void ShotSun_Init(Actor* thisx, PlayState* play) {
this->fairySpawnerState = 0;
this->actor.flags |= ACTOR_FLAG_UPDATE_CULLING_DISABLED;
this->actor.flags |= ACTOR_FLAG_UPDATE_DURING_OCARINA;
this->actionFunc = func_80BADF0C;
this->actionFunc = ShotSun_UpdateFairySpawner;
this->actor.flags |= ACTOR_FLAG_LOCK_ON_DISABLED;
} else {
Collider_InitCylinder(play, &this->collider);
@ -122,7 +122,7 @@ void ShotSun_TriggerFairy(ShotSun* this, PlayState* play) {
}
}
void func_80BADF0C(ShotSun* this, PlayState* play) {
void ShotSun_UpdateFairySpawner(ShotSun* this, PlayState* play) {
Player* player = GET_PLAYER(play);
s32 pad;
s32 params = this->actor.params & 0xFF;