diff --git a/src/code/z_actor.c b/src/code/z_actor.c index 63ce42cfa6..a157d3e2c1 100644 --- a/src/code/z_actor.c +++ b/src/code/z_actor.c @@ -4390,7 +4390,7 @@ void Npc_TrackPointWithLimits(Actor* actor, NpcInteractInfo* interactInfo, s16 m } temp = CLAMP(pitchTowardsTarget, minHeadPitch, (s16)(u16)maxHeadPitch); - Math_SmoothStepToS(&interactInfo->headRot.x, temp, 6, 2000, 1); + Math_SmoothStepToS(&interactInfo->headRot.x, temp, 6, 0x7D0, 1); torsoPitch = pitchTowardsTarget - interactInfo->headRot.x; diff --git a/src/code/z_camera.c b/src/code/z_camera.c index 5b58e939a8..252dc3d911 100644 --- a/src/code/z_camera.c +++ b/src/code/z_camera.c @@ -7228,7 +7228,7 @@ void Camera_EarthquakeDay3(Camera* camera) { 0x1FC, // 8 Large Earthquakes between CLOCK_TIME(4, 30) to CLOCK_TIME(6, 00) }; - if ((CURRENT_DAY == 3) && (CutsceneManager_GetCurrentCsId() == -1)) { + if ((CURRENT_DAY == 3) && (CutsceneManager_GetCurrentCsId() == CS_ID_NONE)) { time = CURRENT_TIME; timeSpeedOffset = gSaveContext.save.timeSpeedOffset; diff --git a/src/code/z_debug_display.c b/src/code/z_debug_display.c index 9dd4d86b21..63e8e91f6f 100644 --- a/src/code/z_debug_display.c +++ b/src/code/z_debug_display.c @@ -10,8 +10,8 @@ typedef struct { typedef void (*DebugDispObjectDrawFunc)(DebugDispObject*, void*, PlayState*); -void DebugDisplay_DrawSpriteI8(DebugDispObject*, void*, PlayState*); -void DebugDisplay_DrawPolygon(DebugDispObject*, void*, PlayState*); +void DebugDisplay_DrawSpriteI8(DebugDispObject* dispObj, void* texture, PlayState* play); +void DebugDisplay_DrawPolygon(DebugDispObject* dispObj, void* dList, PlayState* play); Gfx* DebugDisplay_PathDisplayList(GraphicsContext* gfxCtx, Path* path); DebugDispObject* DebugDisplay_Init(void) { diff --git a/src/code/z_demo.c b/src/code/z_demo.c index c2624dfd81..3f2bdb80d4 100644 --- a/src/code/z_demo.c +++ b/src/code/z_demo.c @@ -1644,7 +1644,7 @@ void Cutscene_ActorTranslateAndYawSmooth(Actor* actor, PlayState* play, s32 cueC VEC3F_LERPIMPDST(&actor->world.pos, &startPos, &endPos, lerp); - Math_SmoothStepToS(&actor->world.rot.y, Math_Vec3f_Yaw(&startPos, &endPos), 10, 1000, 1); + Math_SmoothStepToS(&actor->world.rot.y, Math_Vec3f_Yaw(&startPos, &endPos), 10, 0x3E8, 1); actor->shape.rot.y = actor->world.rot.y; } @@ -1669,7 +1669,7 @@ void Cutscene_ActorTranslateXZAndYawSmooth(Actor* actor, PlayState* play, s32 cu actor->world.pos.x = startPos.x + (endPos.x - startPos.x) * lerp; actor->world.pos.z = startPos.z + (endPos.z - startPos.z) * lerp; - Math_SmoothStepToS(&actor->world.rot.y, Math_Vec3f_Yaw(&startPos, &endPos), 10, 1000, 1); + Math_SmoothStepToS(&actor->world.rot.y, Math_Vec3f_Yaw(&startPos, &endPos), 10, 0x3E8, 1); actor->shape.rot.y = actor->world.rot.y; } diff --git a/src/code/z_en_item00.c b/src/code/z_en_item00.c index 88509bc01a..84638af476 100644 --- a/src/code/z_en_item00.c +++ b/src/code/z_en_item00.c @@ -333,14 +333,14 @@ void func_800A640C(EnItem00* this, PlayState* play) { } else if ((this->actor.params >= ITEM00_SHIELD_HERO) && (this->actor.params != ITEM00_DEKU_NUTS_10) && (this->actor.params < ITEM00_BOMBS_0)) { if (this->unk152 == -1) { - if (!Math_SmoothStepToS(&this->actor.shape.rot.x, this->actor.world.rot.x - 0x4000, 2, 3000, 1500)) { + if (!Math_SmoothStepToS(&this->actor.shape.rot.x, this->actor.world.rot.x - 0x4000, 2, 0xBB8, 0x5DC)) { this->unk152 = -2; } - } else if (!Math_SmoothStepToS(&this->actor.shape.rot.x, -0x4000 - this->actor.world.rot.x, 2, 3000, 1500)) { + } else if (!Math_SmoothStepToS(&this->actor.shape.rot.x, -0x4000 - this->actor.world.rot.x, 2, 0xBB8, 0x5DC)) { this->unk152 = -1; } - Math_SmoothStepToS(&this->actor.world.rot.x, 0, 2, 2500, 500); + Math_SmoothStepToS(&this->actor.world.rot.x, 0, 2, 0x9C4, 0x1F4); } else if ((this->actor.params == ITEM00_MAP) || (this->actor.params == ITEM00_COMPASS)) { this->unk152 = -1; this->actor.shape.rot.y += 0x3C0; diff --git a/src/code/z_kankyo.c b/src/code/z_kankyo.c index 506d7d3589..f58de2c6bc 100644 --- a/src/code/z_kankyo.c +++ b/src/code/z_kankyo.c @@ -2477,9 +2477,9 @@ void Environment_UpdateTimeBasedSequence(PlayState* play) { s32 pad; //! FAKE: - if (!gSaveContext.sceneLayer) {} + if (gSaveContext.sceneLayer) {} - if ((play->csCtx.state == 0) && !(play->actorCtx.flags & ACTORCTX_FLAG_TELESCOPE_ON)) { + if ((play->csCtx.state == CS_STATE_IDLE) && !(play->actorCtx.flags & ACTORCTX_FLAG_TELESCOPE_ON)) { switch (play->envCtx.timeSeqState) { case TIMESEQ_DAY_BGM: break; @@ -2539,7 +2539,7 @@ void Environment_UpdateTimeBasedSequence(PlayState* play) { if ((play->envCtx.timeSeqState != TIMESEQ_REQUEST) && (((void)0, gSaveContext.save.day) == 3) && (CURRENT_TIME < CLOCK_TIME(6, 0)) && !func_800FE5D0(play) && (play->transitionTrigger == TRANS_TRIGGER_OFF) && - (play->transitionMode == TRANS_MODE_OFF) && (play->csCtx.state == 0) && + (play->transitionMode == TRANS_MODE_OFF) && (play->csCtx.state == CS_STATE_IDLE) && ((play->sceneId != SCENE_00KEIKOKU) || (((void)0, gSaveContext.sceneLayer) != 1)) && (CutsceneManager_GetCurrentCsId() == CS_ID_NONE) && (AudioSeq_GetActiveSeqId(SEQ_PLAYER_BGM_MAIN) != NA_BGM_FINAL_HOURS) && diff --git a/src/overlays/actors/ovl_Bg_Ikana_Rotaryroom/z_bg_ikana_rotaryroom.c b/src/overlays/actors/ovl_Bg_Ikana_Rotaryroom/z_bg_ikana_rotaryroom.c index 302eb6f5b9..ddaaa70c1c 100644 --- a/src/overlays/actors/ovl_Bg_Ikana_Rotaryroom/z_bg_ikana_rotaryroom.c +++ b/src/overlays/actors/ovl_Bg_Ikana_Rotaryroom/z_bg_ikana_rotaryroom.c @@ -594,9 +594,9 @@ void func_80B81234(BgIkanaRotaryroom* this, PlayState* play) { sp58.y = ptr->unk_4C.y + 50.0f; sp58.z = ptr->unk_4C.z; - sp64 = Math_ScaledStepToS(&player->actor.shape.rot.x, ptr->unk_40.x, 2000) & 1; - sp64 &= Math_ScaledStepToS(&player->actor.shape.rot.y, ptr->unk_40.y, 2000); - sp64 &= Math_ScaledStepToS(&player->actor.shape.rot.z, ptr->unk_40.z, 2000); + sp64 = Math_ScaledStepToS(&player->actor.shape.rot.x, ptr->unk_40.x, 0x7D0) & 1; + sp64 &= Math_ScaledStepToS(&player->actor.shape.rot.y, ptr->unk_40.y, 0x7D0); + sp64 &= Math_ScaledStepToS(&player->actor.shape.rot.z, ptr->unk_40.z, 0x7D0); ptr->unk_48 -= 2.1f; ptr->unk_48 *= 0.98f; diff --git a/src/overlays/actors/ovl_Bg_Iknv_Obj/z_bg_iknv_obj.c b/src/overlays/actors/ovl_Bg_Iknv_Obj/z_bg_iknv_obj.c index d8a0fd6127..286fa17e59 100644 --- a/src/overlays/actors/ovl_Bg_Iknv_Obj/z_bg_iknv_obj.c +++ b/src/overlays/actors/ovl_Bg_Iknv_Obj/z_bg_iknv_obj.c @@ -141,7 +141,7 @@ s32 func_80BD7E0C(BgIknvObj* this, s16 targetRotation, PlayState* play) { this->dyna.actor.shape.yOffset = 0.0f; CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); if (targetRotation != this->dyna.actor.shape.rot.y) { - Math_SmoothStepToS(&this->dyna.actor.shape.rot.y, targetRotation, 2, 100, 100); + Math_SmoothStepToS(&this->dyna.actor.shape.rot.y, targetRotation, 2, 0x64, 0x64); this->dyna.actor.world.rot.y = this->dyna.actor.shape.rot.y; if ((play->gameplayFrames % 2) != 0) { this->dyna.actor.shape.yOffset = 5.0f; diff --git a/src/overlays/actors/ovl_Boss_01/z_boss_01.c b/src/overlays/actors/ovl_Boss_01/z_boss_01.c index 26ce0eda7f..50037a4ba5 100644 --- a/src/overlays/actors/ovl_Boss_01/z_boss_01.c +++ b/src/overlays/actors/ovl_Boss_01/z_boss_01.c @@ -996,7 +996,7 @@ void Boss01_IntroCutscene(Boss01* this, PlayState* play) { switch (this->cutsceneState) { case ODOLWA_INTRO_CS_STATE_WAITING_FOR_PLAYER_OR_DONE: - if ((CutsceneManager_GetCurrentCsId() != -1) || !(player->actor.world.pos.z < 590.0f)) { + if ((CutsceneManager_GetCurrentCsId() != CS_ID_NONE) || !(player->actor.world.pos.z < 590.0f)) { break; } @@ -1184,7 +1184,7 @@ void Boss01_SummonBugsCutscene(Boss01* this, PlayState* play) { switch (this->cutsceneState) { case ODOLWA_BUG_SUMMONING_CS_STATE_STARTED: - if (CutsceneManager_GetCurrentCsId() != -1) { + if (CutsceneManager_GetCurrentCsId() != CS_ID_NONE) { break; } @@ -2130,7 +2130,7 @@ void Boss01_DeathCutscene(Boss01* this, PlayState* play) { switch (this->cutsceneState) { case ODOLWA_DEATH_CS_STATE_STARTED: - if (CutsceneManager_GetCurrentCsId() != -1) { + if (CutsceneManager_GetCurrentCsId() != CS_ID_NONE) { break; } diff --git a/src/overlays/actors/ovl_En_Ah/z_en_ah.c b/src/overlays/actors/ovl_En_Ah/z_en_ah.c index 5ab6a9040c..96882ab526 100644 --- a/src/overlays/actors/ovl_En_Ah/z_en_ah.c +++ b/src/overlays/actors/ovl_En_Ah/z_en_ah.c @@ -16,7 +16,6 @@ void EnAh_Destroy(Actor* thisx, PlayState* play); void EnAh_Update(Actor* thisx, PlayState* play); void EnAh_Draw(Actor* thisx, PlayState* play); -void func_80BD36B8(EnAh* this, PlayState* play); void func_80BD3768(EnAh* this, PlayState* play); static u8 D_80BD3DB0[] = { diff --git a/src/overlays/actors/ovl_En_Akindonuts/z_en_akindonuts.c b/src/overlays/actors/ovl_En_Akindonuts/z_en_akindonuts.c index 78f8b161b5..d44653cda6 100644 --- a/src/overlays/actors/ovl_En_Akindonuts/z_en_akindonuts.c +++ b/src/overlays/actors/ovl_En_Akindonuts/z_en_akindonuts.c @@ -1311,7 +1311,7 @@ void func_80BEEDC0(EnAkindonuts* this, PlayState* play) { } void func_80BEEE10(EnAkindonuts* this, PlayState* play) { - Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 3, 2000, 0); + Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 3, 0x7D0, 0); this->actor.world.rot.y = this->actor.shape.rot.y; if (Actor_TalkOfferAccepted(&this->actor, &play->state)) { @@ -1569,7 +1569,7 @@ void func_80BEF83C(EnAkindonuts* this, PlayState* play) { this->actor.shape.yOffset = 1500.0f; } - Math_SmoothStepToS(&this->actor.shape.rot.y, this->unk_368, 3, 2000, 0); + Math_SmoothStepToS(&this->actor.shape.rot.y, this->unk_368, 3, 0x7D0, 0); this->actor.world.rot.y = this->actor.shape.rot.y; if (DECR(this->unk_33A) == 0) { @@ -1630,9 +1630,9 @@ void func_80BEFAF0(EnAkindonuts* this, PlayState* play) { } if (ENAKINDONUTS_GET_3(&this->actor) == ENAKINDONUTS_3_1) { - Math_SmoothStepToS(&this->actor.world.rot.y, sp38.y, 10, 1000, 0); + Math_SmoothStepToS(&this->actor.world.rot.y, sp38.y, 10, 0x3E8, 0); } else { - Math_SmoothStepToS(&this->actor.world.rot.y, sp38.y, 10, 300, 0); + Math_SmoothStepToS(&this->actor.world.rot.y, sp38.y, 10, 0x12C, 0); } this->actor.shape.rot.y = this->actor.world.rot.y; diff --git a/src/overlays/actors/ovl_En_Al/z_en_al.c b/src/overlays/actors/ovl_En_Al/z_en_al.c index 5d88e54d6b..87ddc54d8f 100644 --- a/src/overlays/actors/ovl_En_Al/z_en_al.c +++ b/src/overlays/actors/ovl_En_Al/z_en_al.c @@ -15,7 +15,6 @@ void EnAl_Destroy(Actor* thisx, PlayState* play); void EnAl_Update(Actor* thisx, PlayState* play); void EnAl_Draw(Actor* thisx, PlayState* play); -void func_80BDF5E8(EnAl* this, PlayState* play); void func_80BDF6C4(EnAl* this, PlayState* play); static u8 D_80BDFC70[] = { diff --git a/src/overlays/actors/ovl_En_Ani/z_en_ani.c b/src/overlays/actors/ovl_En_Ani/z_en_ani.c index 854b2b9823..6c68d1c288 100644 --- a/src/overlays/actors/ovl_En_Ani/z_en_ani.c +++ b/src/overlays/actors/ovl_En_Ani/z_en_ani.c @@ -294,13 +294,13 @@ void EnAni_Update(Actor* thisx, PlayState* play) { Actor_UpdateBgCheckInfo(play, &this->actor, 0.0f, 0.0f, 0.0f, UPDBGCHECKINFO_FLAG_4); this->actionFunc(this, play); if (this->actor.xzDistToPlayer < 100.0f && !(this->stateFlags & ANI_STATE_CLIMBING)) { - Actor_TrackPlayer(play, &this->actor, &this->headRot, &this->chestRot, this->actor.focus.pos); - this->chestRot.x = this->chestRot.y = this->chestRot.z = 0; + Actor_TrackPlayer(play, &this->actor, &this->headRot, &this->torsoRot, this->actor.focus.pos); + this->torsoRot.x = this->torsoRot.y = this->torsoRot.z = 0; } else { Math_SmoothStepToS(&this->headRot.x, 0, 0x6, 0x1838, 0x64); Math_SmoothStepToS(&this->headRot.y, 0, 0x6, 0x1838, 0x64); - Math_SmoothStepToS(&this->chestRot.x, 0, 0x6, 0x1838, 0x64); - Math_SmoothStepToS(&this->chestRot.y, 0, 0x6, 0x1838, 0x64); + Math_SmoothStepToS(&this->torsoRot.x, 0, 0x6, 0x1838, 0x64); + Math_SmoothStepToS(&this->torsoRot.y, 0, 0x6, 0x1838, 0x64); } this->blinkFunc(this); diff --git a/src/overlays/actors/ovl_En_Ani/z_en_ani.h b/src/overlays/actors/ovl_En_Ani/z_en_ani.h index d0f2e6a124..fb091a64ad 100644 --- a/src/overlays/actors/ovl_En_Ani/z_en_ani.h +++ b/src/overlays/actors/ovl_En_Ani/z_en_ani.h @@ -18,7 +18,7 @@ typedef struct EnAni { /* 0x220 */ Vec3s jointTable[ANI_LIMB_MAX]; /* 0x280 */ Vec3s morphTable[ANI_LIMB_MAX]; /* 0x2E0 */ Vec3s headRot; - /* 0x2E6 */ Vec3s chestRot; // unused + /* 0x2E6 */ Vec3s torsoRot; // unused /* 0x2EC */ u16 stateFlags; /* 0x2EE */ s16 unk2EE; // assigned to zero in init, never used after /* 0x2F0 */ s16 treeReachTimer; diff --git a/src/overlays/actors/ovl_En_Aob_01/z_en_aob_01.c b/src/overlays/actors/ovl_En_Aob_01/z_en_aob_01.c index a003b099c8..9a7078c783 100644 --- a/src/overlays/actors/ovl_En_Aob_01/z_en_aob_01.c +++ b/src/overlays/actors/ovl_En_Aob_01/z_en_aob_01.c @@ -604,7 +604,7 @@ void EnAob01_BeforeRace_Idle(EnAob01* this, PlayState* play) { void EnAob01_BeforeRace_Talk(EnAob01* this, PlayState* play) { u8 talkState = Message_GetState(&play->msgCtx); - Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 4, 4000, 1); + Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 4, 0xFA0, 1); //! @bug: This block of code acts as a failsafe for when the player triggered this conversation by //! bumping into the racetrack owner while holding the dog and, at the same time, threw or dropped @@ -971,7 +971,7 @@ void EnAob01_AfterRace_AskToPlayAgain(EnAob01* this, PlayState* play) { void EnAob01_AfterRace_Talk(EnAob01* this, PlayState* play) { u8 talkState = Message_GetState(&play->msgCtx); - Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 4, 4000, 1); + Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 4, 0xFA0, 1); if (this->stateFlags & ENAOB01_FLAG_LAUGH) { if (!EnAob01_ProcessLaughAnim(this)) { diff --git a/src/overlays/actors/ovl_En_Baguo/z_en_baguo.c b/src/overlays/actors/ovl_En_Baguo/z_en_baguo.c index 490f2932e8..f3e9deb784 100644 --- a/src/overlays/actors/ovl_En_Baguo/z_en_baguo.c +++ b/src/overlays/actors/ovl_En_Baguo/z_en_baguo.c @@ -195,14 +195,14 @@ void EnBaguo_Idle(EnBaguo* this, PlayState* play) { if (this->timer != 0) { // Depending on how the last roll ended, this actor may be "sitting" on // something other than its legs. This slowly corrects that. - Math_SmoothStepToS(&this->actor.world.rot.x, 0, 10, 100, 1000); - Math_SmoothStepToS(&this->actor.world.rot.z, 0, 10, 100, 1000); + Math_SmoothStepToS(&this->actor.world.rot.x, 0, 10, 0x64, 0x3E8); + Math_SmoothStepToS(&this->actor.world.rot.z, 0, 10, 0x64, 0x3E8); // If this actor isn't mostly facing the player, do a discrete turn towards // them. It takes 8 frames to turn, and we must wait 8 frames to do another. if ((this->timer & 8) != 0) { if (fabsf(this->actor.world.rot.y - this->actor.yawTowardsPlayer) > 200.0f) { - Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 30, 300, 1000); + Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 30, 0x12C, 0x3E8); if ((play->gameplayFrames % 8) == 0) { Actor_SpawnFloorDustRing(play, &this->actor, &this->actor.world.pos, this->actor.shape.shadowScale - 20.0f, 10, 8.0f, 500, 10, true); diff --git a/src/overlays/actors/ovl_En_Bom/z_en_bom.c b/src/overlays/actors/ovl_En_Bom/z_en_bom.c index f7794b767c..96759b331a 100644 --- a/src/overlays/actors/ovl_En_Bom/z_en_bom.c +++ b/src/overlays/actors/ovl_En_Bom/z_en_bom.c @@ -320,7 +320,7 @@ void EnBom_WaitForRelease(EnBom* this, PlayState* play) { gSaveContext.powderKegTimer = this->timer; } } - Math_ScaledStepToS(&this->unk_1FA, 0, 2000); + Math_ScaledStepToS(&this->unk_1FA, 0, 0x7D0); } void EnBom_Explode(EnBom* this, PlayState* play) { diff --git a/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c b/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c index 824b5e7afb..a852b3afff 100644 --- a/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c +++ b/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c @@ -268,7 +268,7 @@ void func_809C4BC4(EnBomBowlMan* this, PlayState* play) { } void func_809C4DA4(EnBomBowlMan* this, PlayState* play) { - Math_SmoothStepToS(&this->unk_290, this->unk_2D4, 1, 5000, 0); + Math_SmoothStepToS(&this->unk_290, this->unk_2D4, 1, 0x1388, 0); if (this->unk_2B8 == 0) { Player* player = GET_PLAYER(play); @@ -537,7 +537,7 @@ void func_809C5738(EnBomBowlMan* this, PlayState* play) { EnBomBowlMan_ChangeAnim(this, ENBOMBOWLMAN_ANIM_18, 1.0f); } } else { - Math_SmoothStepToS(&this->actor.world.rot.y, yaw, 1, 2000, 10); + Math_SmoothStepToS(&this->actor.world.rot.y, yaw, 1, 0x7D0, 0xA); Math_ApproachF(&this->actor.world.pos.x, this->unk_2A0.x, 0.5f, 6.0f); Math_ApproachF(&this->actor.world.pos.z, this->unk_2A0.z, 0.5f, 6.0f); if ((sqrtf(SQ(this->actor.world.pos.x - this->unk_2A0.x) + SQ(this->actor.world.pos.z - this->unk_2A0.z)) < diff --git a/src/overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.c b/src/overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.c index a4aff3da4d..3577c6296a 100644 --- a/src/overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.c +++ b/src/overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.c @@ -507,7 +507,7 @@ void EnBomChu_Update(Actor* thisx, PlayState* play) { if (this->isMoving) { this->visualJitter = - (5.0f + (Rand_ZeroOne() * 3.0f)) * Math_SinS((((s32)(Rand_ZeroOne() * 0x200) + 0x3000) * this->timer)); + (5.0f + (Rand_ZeroOne() * 3.0f)) * Math_SinS(((s32)(Rand_ZeroOne() * 0x200) + 0x3000) * this->timer); EnBomChu_ActorCoordsToWorld(this, &sBlureP1Offset, &blureP1); EnBomChu_ActorCoordsToWorld(this, &sBlureP2LeftOffset, &blureP2); diff --git a/src/overlays/actors/ovl_En_Bombal/z_en_bombal.c b/src/overlays/actors/ovl_En_Bombal/z_en_bombal.c index 5e705af2a6..42fed02864 100644 --- a/src/overlays/actors/ovl_En_Bombal/z_en_bombal.c +++ b/src/overlays/actors/ovl_En_Bombal/z_en_bombal.c @@ -24,7 +24,7 @@ void func_80C05DE8(EnBombal* this, PlayState* play); void func_80C05B24(EnBombal* this); void EnBombal_InitEffects(EnBombal* this, Vec3f* pos, s16 fadeDelay); void EnBombal_UpdateEffects(EnBombal* this, PlayState* play); -void EnBombal_DrawEffects(EnBombal*, PlayState*); +void EnBombal_DrawEffects(EnBombal* this, PlayState* play); ActorInit En_Bombal_InitVars = { /**/ ACTOR_EN_BOMBAL, diff --git a/src/overlays/actors/ovl_En_Bombal/z_en_bombal.h b/src/overlays/actors/ovl_En_Bombal/z_en_bombal.h index 67550c59ba..3eabd60b7c 100644 --- a/src/overlays/actors/ovl_En_Bombal/z_en_bombal.h +++ b/src/overlays/actors/ovl_En_Bombal/z_en_bombal.h @@ -10,7 +10,7 @@ typedef void (*EnBombalActionFunc)(struct EnBombal*, PlayState*); typedef struct EnBombalEffect { /* 0x00 */ u8 isEnabled; /* 0x04 */ Vec3f pos; - /* 0x10 */ UNK_TYPE4 unk10; + /* 0x10 */ UNK_TYPE1 unk10[0x4]; /* 0x14 */ s16 alpha; /* 0x16 */ s16 alphaFadeDelay; /* 0x18 */ Vec3f velocity; diff --git a/src/overlays/actors/ovl_En_Bombers2/z_en_bombers2.c b/src/overlays/actors/ovl_En_Bombers2/z_en_bombers2.c index 9b168c5ad5..d3710e5219 100644 --- a/src/overlays/actors/ovl_En_Bombers2/z_en_bombers2.c +++ b/src/overlays/actors/ovl_En_Bombers2/z_en_bombers2.c @@ -119,7 +119,7 @@ void EnBombers2_Init(Actor* thisx, PlayState* play) { if (CHECK_WEEKEVENTREG(WEEKEVENTREG_73_80) || (gSaveContext.save.entrance == ENTRANCE(EAST_CLOCK_TOWN, 2))) { this->actor.world.pos.x += Math_SinS(this->actor.home.rot.y + 0xC100) * 50.0f; cos = Math_CosS(this->actor.home.rot.y + 0xC100) * 50.0f; - this->unk_2AC = 1; + this->unk_2AC = true; this->actor.world.pos.z += cos; } this->csId = this->actor.csId; @@ -146,7 +146,7 @@ void EnBombers2_ChangeAnim(EnBombers2* this, s32 animIndex, f32 playSpeed) { } void func_80C04B40(EnBombers2* this) { - if (this->unk_2AC == 0) { + if (!this->unk_2AC) { EnBombers2_ChangeAnim(this, ENBOMBERS_ANIM_4, 1.0f); } else { EnBombers2_ChangeAnim(this, ENBOMBERS_ANIM_0, 1.0f); @@ -180,7 +180,7 @@ void func_80C04BA0(EnBombers2* this, PlayState* play) { default: break; } - if (this->unk_2AC != 0) { + if (this->unk_2AC) { this->textIdIndex = 7; } this->actor.textId = sTextIds[this->textIdIndex]; @@ -208,7 +208,7 @@ void func_80C04D00(EnBombers2* this) { } this->unk_2A8 = 0; - if (this->unk_2AC != 0) { + if (this->unk_2AC) { EnBombers2_ChangeAnim(this, ENBOMBERS_ANIM_6, 1.0f); } this->unk_2C0 = 1; @@ -219,7 +219,7 @@ void func_80C04D8C(EnBombers2* this, PlayState* play) { Player* player = GET_PLAYER(play); f32 curFrame = this->skelAnime.curFrame; - if ((this->unk_2AC == 0) && (curFrame >= this->lastAnimFrame)) { + if (!this->unk_2AC && (curFrame >= this->lastAnimFrame)) { if (!(this->unk_2A8 & 1)) { EnBombers2_ChangeAnim(this, ENBOMBERS_ANIM_1, 1.0f); } else { @@ -367,7 +367,7 @@ void func_80C0520C(EnBombers2* this, PlayState* play) { this->unk_2C0 = 1; SET_WEEKEVENTREG(WEEKEVENTREG_73_80); CutsceneManager_Stop(this->csId); - this->unk_2AC = 1; + this->unk_2AC = true; this->actor.textId = sTextIds[this->textIdIndex]; Message_StartTextbox(play, this->actor.textId, &this->actor); this->actionFunc = func_80C04D8C; @@ -380,8 +380,8 @@ void func_80C0520C(EnBombers2* this, PlayState* play) { } void EnBombers2_Update(Actor* thisx, PlayState* play) { + s32 pad; EnBombers2* this = (EnBombers2*)thisx; - f32 temp_f4; Vec3f sp34; s32 yawDiffAbs; @@ -422,10 +422,9 @@ void EnBombers2_Update(Actor* thisx, PlayState* play) { } } Math_Vec3f_Copy(&sp34, &this->actor.world.pos); - if (this->unk_2AC == 0) { - this->actor.world.pos.x = (Math_SinS((this->actor.world.rot.y + 0x8000)) * 26.0f) + sp34.x; - temp_f4 = Math_CosS(this->actor.world.rot.y + 0x8000) * 26.0f; - this->actor.world.pos.z = temp_f4 + sp34.z; + if (!this->unk_2AC) { + this->actor.world.pos.x = sp34.x + Math_SinS(this->actor.world.rot.y + 0x8000) * 26.0f; + this->actor.world.pos.z = sp34.z + Math_CosS(this->actor.world.rot.y + 0x8000) * 26.0f; this->collider.dim.radius = 35; this->collider.dim.height = 30; } else { @@ -434,7 +433,7 @@ void EnBombers2_Update(Actor* thisx, PlayState* play) { } Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); - if (this->unk_2AC == 0) { + if (!this->unk_2AC) { Actor_UpdateBgCheckInfo(play, &this->actor, 20.0f, 20.0f, 50.0f, UPDBGCHECKINFO_FLAG_1 | UPDBGCHECKINFO_FLAG_4 | UPDBGCHECKINFO_FLAG_8 | UPDBGCHECKINFO_FLAG_10); diff --git a/src/overlays/actors/ovl_En_Bomjima/z_en_bomjima.c b/src/overlays/actors/ovl_En_Bomjima/z_en_bomjima.c index f1ef0527c7..3a8dc9cfbb 100644 --- a/src/overlays/actors/ovl_En_Bomjima/z_en_bomjima.c +++ b/src/overlays/actors/ovl_En_Bomjima/z_en_bomjima.c @@ -318,7 +318,7 @@ void func_80BFE67C(EnBomjima* this, PlayState* play) { s32 sp4C; this->unk_2DC = Math_Vec3f_Yaw(&this->actor.world.pos, &this->unk_2A4); - Math_SmoothStepToS(&this->actor.world.rot.y, this->unk_2DC, 1, 5000, 0); + Math_SmoothStepToS(&this->actor.world.rot.y, this->unk_2DC, 1, 0x1388, 0); switch (this->unk_2A2) { case 0: @@ -342,7 +342,7 @@ void func_80BFE67C(EnBomjima* this, PlayState* play) { case 1: if (curFrame >= 0.0f) { this->unk_2DC = Math_Vec3f_Yaw(&this->actor.world.pos, &this->unk_2A4); - Math_SmoothStepToS(&this->actor.world.rot.y, this->unk_2DC, 10, 2000, 20); + Math_SmoothStepToS(&this->actor.world.rot.y, this->unk_2DC, 10, 0x7D0, 0x14); } abs2 = BINANG_SUB(this->actor.world.rot.y, this->unk_2DC); @@ -510,7 +510,7 @@ void func_80BFEB64(EnBomjima* this, PlayState* play) { break; } - Math_SmoothStepToS(&this->actor.world.rot.y, this->unk_2DC, 1, 5000, 0); + Math_SmoothStepToS(&this->actor.world.rot.y, this->unk_2DC, 1, 0x1388, 0); } void func_80BFEFF0(EnBomjima* this) { @@ -567,7 +567,7 @@ void func_80BFF174(EnBomjima* this, PlayState* play) { return; } - Math_SmoothStepToS(&this->actor.world.rot.y, this->unk_2DC, 1, 5000, 0); + Math_SmoothStepToS(&this->actor.world.rot.y, this->unk_2DC, 1, 0x1388, 0); if ((curFrame >= this->animEndFrame) && (this->unk_2BC < 5)) { this->unk_2BC++; @@ -824,7 +824,7 @@ void func_80BFFBC4(EnBomjima* this, PlayState* play) { this->unk_2DC = -10000; } - Math_SmoothStepToS(&this->unk_290, this->unk_2DC, 1, 5000, 0); + Math_SmoothStepToS(&this->unk_290, this->unk_2DC, 1, 0x1388, 0); if (D_80C009F0 >= 104) { D_80C009F0 = 0; Message_CloseTextbox(play); @@ -848,7 +848,7 @@ void func_80BFFD48(EnBomjima* this, PlayState* play) { s32 pad[2]; this->unk_2DC = Math_Vec3f_Yaw(&this->actor.world.pos, &this->unk_2A4); - Math_SmoothStepToS(&this->actor.world.rot.y, this->unk_2DC, 1, 5000, 0); + Math_SmoothStepToS(&this->actor.world.rot.y, this->unk_2DC, 1, 0x1388, 0); Math_ApproachF(&this->actor.world.pos.x, this->unk_2A4.x, 0.3f, 4.0f); Math_ApproachF(&this->actor.world.pos.z, this->unk_2A4.z, 0.3f, 4.0f); if (sqrtf(SQ(this->actor.world.pos.x - this->unk_2A4.x) + SQ(this->actor.world.pos.z - this->unk_2A4.z)) < 4.0f) { @@ -860,7 +860,7 @@ void func_80BFFD48(EnBomjima* this, PlayState* play) { } void func_80BFFE48(EnBomjima* this, PlayState* play) { - Math_SmoothStepToS(&this->actor.world.rot.y, this->unk_2DC, 1, 5000, 0); + Math_SmoothStepToS(&this->actor.world.rot.y, this->unk_2DC, 1, 0x1388, 0); Math_ApproachF(&this->actor.world.pos.x, this->unk_2A4.x, 0.3f, 4.0f); Math_ApproachF(&this->actor.world.pos.z, this->unk_2A4.z, 0.3f, 4.0f); @@ -871,7 +871,7 @@ void func_80BFFE48(EnBomjima* this, PlayState* play) { func_80BFE65C(this); this->actionFunc = func_80BFFF54; } else { - Math_SmoothStepToS(&this->unk_290, 10000, 1, 5000, 0); + Math_SmoothStepToS(&this->unk_290, 10000, 1, 0x1388, 0); if (D_80C009F0 >= 103) { this->unk_2DC = 0; EnBomjima_ChangeAnim(this, ENBOMJIMA_ANIM_15, 1.0f); @@ -885,7 +885,7 @@ void func_80BFFE48(EnBomjima* this, PlayState* play) { void func_80BFFF54(EnBomjima* this, PlayState* play) { f32 curFrame = this->skelAnime.curFrame; - Math_SmoothStepToS(&this->unk_290, this->unk_2DC, 1, 5000, 0); + Math_SmoothStepToS(&this->unk_290, this->unk_2DC, 1, 0x1388, 0); if ((D_80C009F4 != 0) && (this->unk_2C2 == 0)) { this->unk_2C2 = Rand_S16Offset(5, 5); @@ -964,7 +964,7 @@ void func_80C00284(EnBomjima* this, PlayState* play) { Player* player = GET_PLAYER(play); f32 curFrame = this->skelAnime.curFrame; - Math_SmoothStepToS(&this->actor.world.rot.y, this->unk_2DC, 1, 5000, 0); + Math_SmoothStepToS(&this->actor.world.rot.y, this->unk_2DC, 1, 0x1388, 0); if (((this->action == EN_BOMJIMA_ACTION_0) || (this->unk_2C8 == 10) || (this->unk_2C8 == 11) || (this->unk_2CA == 1)) && (curFrame >= this->animEndFrame)) { @@ -1097,9 +1097,9 @@ void EnBomjima_Update(Actor* thisx, PlayState* play) { Actor_SetFocus(&this->actor, 20.0f); this->actionFunc(this, play); Actor_MoveWithGravity(&this->actor); - Math_SmoothStepToS(&this->unk_28A, this->unk_290, 1, 5000, 0); - Math_SmoothStepToS(&this->unk_288, this->unk_28E, 1, 1000, 0); - Math_SmoothStepToS(&this->unk_294, this->unk_29A, 1, 1000, 0); + Math_SmoothStepToS(&this->unk_28A, this->unk_290, 1, 0x1388, 0); + Math_SmoothStepToS(&this->unk_288, this->unk_28E, 1, 0x3E8, 0); + Math_SmoothStepToS(&this->unk_294, this->unk_29A, 1, 0x3E8, 0); if (this->unk_2E2 == 0) { this->unk_2E0++; diff --git a/src/overlays/actors/ovl_En_Bomjimb/z_en_bomjimb.c b/src/overlays/actors/ovl_En_Bomjimb/z_en_bomjimb.c index e8b235a5bd..916094ac64 100644 --- a/src/overlays/actors/ovl_En_Bomjimb/z_en_bomjimb.c +++ b/src/overlays/actors/ovl_En_Bomjimb/z_en_bomjimb.c @@ -355,7 +355,7 @@ void func_80C014E4(EnBomjimb* this, PlayState* play) { case 1: if (curFrame >= 0.0f) { this->unk_2D6 = Math_Vec3f_Yaw(&this->actor.world.pos, &this->unk_294); - Math_SmoothStepToS(&this->actor.world.rot.y, this->unk_2D6, 10, 2000, 20); + Math_SmoothStepToS(&this->actor.world.rot.y, this->unk_2D6, 10, 0x7D0, 0x14); } if ((s16)ABS_ALT(BINANG_SUB(this->actor.world.rot.y, this->unk_2D6)) < 0x100) { @@ -503,7 +503,7 @@ void func_80C01CD0(EnBomjimb* this, PlayState* play) { } if (this->animIndex != ENBOMJIMB_ANIM_7) { - Math_SmoothStepToS(&this->actor.world.rot.y, Math_Vec3f_Yaw(&this->actor.world.pos, &this->unk_294), 1, 3000, + Math_SmoothStepToS(&this->actor.world.rot.y, Math_Vec3f_Yaw(&this->actor.world.pos, &this->unk_294), 1, 0xBB8, 0); Math_ApproachF(&this->actor.world.pos.x, this->unk_294.x, 0.3f, 2.0f); Math_ApproachF(&this->actor.world.pos.z, this->unk_294.z, 0.3f, 2.0f); @@ -605,7 +605,7 @@ void func_80C0217C(EnBomjimb* this, PlayState* play) { } if (player->stateFlags3 == PLAYER_STATE3_1000000) { - Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 1, 3000, 0); + Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 1, 0xBB8, 0); func_80C01494(this); return; } @@ -691,14 +691,14 @@ void func_80C02570(EnBomjimb* this, PlayState* play) { return; } - Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 1, 5000, 0); + Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 1, 0x1388, 0); if (this->actor.xzDistToPlayer < 200.0f) { this->unk_2D6 = BINANG_ROT180(this->actor.yawTowardsPlayer); EnBomjimb_ChangeAnim(this, ENBOMJIMB_ANIM_19, 2.0f); this->actionFunc = func_80C0217C; } else if ((player->stateFlags3 == PLAYER_STATE3_1000000) || (this->actor.xzDistToPlayer > 410.0f)) { - Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 1, 3000, 0); + Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 1, 0xBB8, 0); func_80C01494(this); } } @@ -845,7 +845,7 @@ void func_80C02A14(EnBomjimb* this, PlayState* play) { void func_80C02BCC(EnBomjimb* this, PlayState* play) { Player* player = GET_PLAYER(play); - Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 1, 5000, 0); + Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 1, 0x1388, 0); if (this->unk_2C0 == 0) { player->actor.freezeTimer = 3; if ((Message_GetState(&play->msgCtx) == TEXT_STATE_5) && Message_ShouldAdvance(play)) { @@ -918,7 +918,7 @@ void EnBomjimb_Update(Actor* thisx, PlayState* play2) { } } - Math_SmoothStepToS(&this->unk_28A, this->unk_290, 1, 5000, 0); + Math_SmoothStepToS(&this->unk_28A, this->unk_290, 1, 0x1388, 0); if (this->unk_2C4 == 0) { this->unk_2C2++; diff --git a/src/overlays/actors/ovl_En_Boom/z_en_boom.c b/src/overlays/actors/ovl_En_Boom/z_en_boom.c index 7779d59647..cea78dc9e3 100644 --- a/src/overlays/actors/ovl_En_Boom/z_en_boom.c +++ b/src/overlays/actors/ovl_En_Boom/z_en_boom.c @@ -203,7 +203,7 @@ void func_808A2918(EnBoom* this, PlayState* play) { } Math_ScaledStepToS(&this->actor.world.rot.y, sp72, - (this->unk_1CF > 0) ? 1000 : (s16)(ABS_ALT(sp70) * sp64)); + (this->unk_1CF > 0) ? 0x3E8 : (s16)(ABS_ALT(sp70) * sp64)); } Math_ScaledStepToS(&this->actor.world.rot.x, sp6E, ABS_ALT(sp6C) * sp64); diff --git a/src/overlays/actors/ovl_En_Cow/z_en_cow.c b/src/overlays/actors/ovl_En_Cow/z_en_cow.c index a5094ed1e3..f8fba4887e 100644 --- a/src/overlays/actors/ovl_En_Cow/z_en_cow.c +++ b/src/overlays/actors/ovl_En_Cow/z_en_cow.c @@ -381,8 +381,8 @@ void EnCow_Update(Actor* thisx, PlayState* play2) { targetX = targetY = 0; } - Math_SmoothStepToS(&this->headTilt.x, targetX, 10, 200, 10); - Math_SmoothStepToS(&this->headTilt.y, targetY, 10, 200, 10); + Math_SmoothStepToS(&this->headTilt.x, targetX, 10, 0xC8, 0xA); + Math_SmoothStepToS(&this->headTilt.y, targetY, 10, 0xC8, 0xA); } void EnCow_UpdateTail(Actor* thisx, PlayState* play) { diff --git a/src/overlays/actors/ovl_En_Daiku2/z_en_daiku2.c b/src/overlays/actors/ovl_En_Daiku2/z_en_daiku2.c index 1dfafe8dff..b1f5645299 100644 --- a/src/overlays/actors/ovl_En_Daiku2/z_en_daiku2.c +++ b/src/overlays/actors/ovl_En_Daiku2/z_en_daiku2.c @@ -249,7 +249,7 @@ void func_80BE66E4(EnDaiku2* this, PlayState* play) { s32 pad[2]; s16 temp_v0; - Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.home.rot.y, 1, 0xBB8, 0x0); + Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.home.rot.y, 1, 0xBB8, 0); if (sp98 != 2) { if ((this->switchFlag > SWITCH_FLAG_NONE) && Flags_GetSwitch(play, this->switchFlag)) { this->unk_28A = 5; @@ -332,7 +332,7 @@ void func_80BE6B40(EnDaiku2* this, PlayState* play) { } void func_80BE6BC0(EnDaiku2* this, PlayState* play) { - Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 1, 0xBB8, 0x0); + Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 1, 0xBB8, 0); if ((Message_GetState(&play->msgCtx) == TEXT_STATE_5) && Message_ShouldAdvance(play)) { s32 day = gSaveContext.save.day - 1; @@ -413,7 +413,7 @@ void func_80BE6EF0(EnDaiku2* this, PlayState* play) { return; } - Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.home.rot.y, 1, 0xBB8, 0x0); + Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.home.rot.y, 1, 0xBB8, 0); if (curFrame >= this->animEndFrame) { this->unk_274 = 1; } diff --git a/src/overlays/actors/ovl_En_Dnp/z_en_dnp.c b/src/overlays/actors/ovl_En_Dnp/z_en_dnp.c index 673dcb036e..2955c2c076 100644 --- a/src/overlays/actors/ovl_En_Dnp/z_en_dnp.c +++ b/src/overlays/actors/ovl_En_Dnp/z_en_dnp.c @@ -212,7 +212,7 @@ s32 func_80B3CDA4(EnDnp* this, PlayState* play) { temp_s0 = CLAMP(temp_s0, -0x3FFC, 0x3FFC); - Math_SmoothStepToS(&this->unk_332, temp_s0, 3, 0x2AA8, 0x1); + Math_SmoothStepToS(&this->unk_332, temp_s0, 3, 0x2AA8, 1); sp30 = player->actor.world.pos; sp30.y = player->bodyPartsPos[PLAYER_BODYPART_HEAD].y + 3.0f; sp3C = this->actor.world.pos; @@ -222,7 +222,7 @@ s32 func_80B3CDA4(EnDnp* this, PlayState* play) { //! FAKE if (1) {} - Math_SmoothStepToS(&this->unk_330, pitch, 3, 0x2AA8, 0x1); + Math_SmoothStepToS(&this->unk_330, pitch, 3, 0x2AA8, 1); return 1; } diff --git a/src/overlays/actors/ovl_En_Door/z_en_door.c b/src/overlays/actors/ovl_En_Door/z_en_door.c index 73e08c4d57..58a8e8d2a8 100644 --- a/src/overlays/actors/ovl_En_Door/z_en_door.c +++ b/src/overlays/actors/ovl_En_Door/z_en_door.c @@ -28,13 +28,13 @@ void EnDoor_Destroy(Actor* thisx, PlayState* play); void EnDoor_Update(Actor* thisx, PlayState* play); void EnDoor_Draw(Actor* thisx, PlayState* play); -void func_80866B20(EnDoor*, PlayState*); -void func_8086704C(EnDoor*, PlayState*); -void func_80866F94(EnDoor*, PlayState*); -void func_80867080(EnDoor*, PlayState*); -void func_80867144(EnDoor*, PlayState*); -void func_808670F0(EnDoor*, PlayState*); -void func_80866A5C(EnDoor*, PlayState*); +void func_80866B20(EnDoor* this, PlayState* play); +void func_8086704C(EnDoor* this, PlayState* play); +void func_80866F94(EnDoor* this, PlayState* play); +void func_80867080(EnDoor* this, PlayState* play); +void func_80867144(EnDoor* this, PlayState* play); +void func_808670F0(EnDoor* this, PlayState* play); +void func_80866A5C(EnDoor* this, PlayState* play); u8 D_808675D0[] = { /* 0x00 */ SCHEDULE_CMD_CHECK_NOT_IN_DAY_S(3, 0x12 - 0x04), diff --git a/src/overlays/actors/ovl_En_Dragon/z_en_dragon.c b/src/overlays/actors/ovl_En_Dragon/z_en_dragon.c index 5bfcc29784..f495b5e034 100644 --- a/src/overlays/actors/ovl_En_Dragon/z_en_dragon.c +++ b/src/overlays/actors/ovl_En_Dragon/z_en_dragon.c @@ -685,9 +685,9 @@ void EnDragon_Dead(EnDragon* this, PlayState* play) { sNumPythonsDead++; if (sNumPythonsDead >= (BREG(39) + 8)) { Math_Vec3f_Copy(&seahorsePos, &this->actor.parent->world.pos); - seahorsePos.x += (Math_SinS((this->actor.parent->world.rot.y + 0x8000)) * (500.0f + BREG(38))); + seahorsePos.x += Math_SinS(this->actor.parent->world.rot.y + 0x8000) * (500.0f + BREG(38)); seahorsePos.y += -100.0f + BREG(33); - seahorsePos.z += (Math_CosS((this->actor.parent->world.rot.y + 0x8000)) * (500.0f + BREG(38))); + seahorsePos.z += Math_CosS(this->actor.parent->world.rot.y + 0x8000) * (500.0f + BREG(38)); if (Actor_SpawnAsChildAndCutscene(&play->actorCtx, play, ACTOR_EN_OT, seahorsePos.x, seahorsePos.y, seahorsePos.z, 0, this->actor.shape.rot.y, 0, SEAHORSE_PARAMS(SEAHORSE_TYPE_1, 0, 0), this->actor.csId, diff --git a/src/overlays/actors/ovl_En_Ds2n/z_en_ds2n.c b/src/overlays/actors/ovl_En_Ds2n/z_en_ds2n.c index f6c1b69310..a2e29fb74d 100644 --- a/src/overlays/actors/ovl_En_Ds2n/z_en_ds2n.c +++ b/src/overlays/actors/ovl_En_Ds2n/z_en_ds2n.c @@ -88,7 +88,7 @@ void EnDs2n_Update(Actor* thisx, PlayState* play) { Actor_MoveWithGravity(&this->actor); SkelAnime_Update(&this->skelAnime); - Actor_TrackPlayer(play, &this->actor, &this->headRot, &this->chestRot, this->actor.focus.pos); + Actor_TrackPlayer(play, &this->actor, &this->headRot, &this->torsoRot, this->actor.focus.pos); EnDs2n_UpdateEyes(this); } diff --git a/src/overlays/actors/ovl_En_Ds2n/z_en_ds2n.h b/src/overlays/actors/ovl_En_Ds2n/z_en_ds2n.h index 4e759be0b0..363f4e4d5f 100644 --- a/src/overlays/actors/ovl_En_Ds2n/z_en_ds2n.h +++ b/src/overlays/actors/ovl_En_Ds2n/z_en_ds2n.h @@ -16,7 +16,7 @@ typedef struct EnDs2n { /* 0x1D8 */ s16 fidgetTableY[DS2N_LIMB_MAX]; /* 0x1FE */ s16 fidgetTableZ[DS2N_LIMB_MAX]; /* 0x224 */ Vec3s headRot; - /* 0x22A */ Vec3s chestRot; // set by function, but not applied in limbdraw + /* 0x22A */ Vec3s torsoRot; // set by function, but not applied in limbdraw /* 0x230 */ s16 blinkState; /* 0x232 */ s16 blinkTimer; diff --git a/src/overlays/actors/ovl_En_Elforg/z_en_elforg.c b/src/overlays/actors/ovl_En_Elforg/z_en_elforg.c index 75bf60891a..2072963867 100644 --- a/src/overlays/actors/ovl_En_Elforg/z_en_elforg.c +++ b/src/overlays/actors/ovl_En_Elforg/z_en_elforg.c @@ -232,7 +232,7 @@ void EnElforg_MoveToTargetFairyFountain(EnElforg* this, Vec3f* homePos) { } targetAngle += angleAdjustment; - Math_SmoothStepToS(&this->actor.world.rot.y, targetAngle, 2, 4000, 1000); + Math_SmoothStepToS(&this->actor.world.rot.y, targetAngle, 2, 0xFA0, 0x3E8); EnElforg_ApproachTargetSpeedXZ(this); Actor_MoveWithGravity(&this->actor); } diff --git a/src/overlays/actors/ovl_En_Encount2/z_en_encount2.h b/src/overlays/actors/ovl_En_Encount2/z_en_encount2.h index 12eb624284..3b3bd8ba10 100644 --- a/src/overlays/actors/ovl_En_Encount2/z_en_encount2.h +++ b/src/overlays/actors/ovl_En_Encount2/z_en_encount2.h @@ -14,7 +14,7 @@ typedef void (*EnEncount2ActionFunc)(struct EnEncount2*, PlayState*); typedef struct EnEncount2Effect{ /* 0x00 */ u8 isEnabled; /* 0x04 */ Vec3f pos; - /* 0x10 */ UNK_TYPE4 unk10; + /* 0x10 */ UNK_TYPE1 unk10[0x4]; /* 0x14 */ s16 alpha; /* 0x16 */ s16 alphaFadeDelay; // frame count before alpha fade starts /* 0x18 */ Vec3f velocity; diff --git a/src/overlays/actors/ovl_En_Fish2/z_en_fish2.c b/src/overlays/actors/ovl_En_Fish2/z_en_fish2.c index 69ff37fe10..f365942b62 100644 --- a/src/overlays/actors/ovl_En_Fish2/z_en_fish2.c +++ b/src/overlays/actors/ovl_En_Fish2/z_en_fish2.c @@ -983,7 +983,7 @@ void EnFish2_Update(Actor* thisx, PlayState* play2) { Vec3f sp5C; if (this->actor.params == 0) { - Math_SmoothStepToS(&this->actor.world.rot.x, this->unk_348, 1, this->unk_34C + 200, 0); + Math_SmoothStepToS(&this->actor.world.rot.x, this->unk_348, 1, this->unk_34C + 0xC8, 0); if (this->actionFunc != func_80B297FC) { Math_SmoothStepToS(&this->actor.world.rot.y, this->unk_34A, 1, 0xBB8, 0); } diff --git a/src/overlays/actors/ovl_En_Fsn/z_en_fsn.c b/src/overlays/actors/ovl_En_Fsn/z_en_fsn.c index ffdc553775..e4ef831099 100644 --- a/src/overlays/actors/ovl_En_Fsn/z_en_fsn.c +++ b/src/overlays/actors/ovl_En_Fsn/z_en_fsn.c @@ -1510,7 +1510,7 @@ void EnFsn_Update(Actor* thisx, PlayState* play) { this->actionFunc(this, play); Actor_MoveWithGravity(&this->actor); - Actor_TrackPlayer(play, &this->actor, &this->headRot, &this->unk27A, this->actor.focus.pos); + Actor_TrackPlayer(play, &this->actor, &this->headRot, &this->torsoRot, this->actor.focus.pos); SubS_UpdateFidgetTables(play, this->fidgetTableY, this->fidgetTableZ, ENFSN_LIMB_MAX); EnFsn_Blink(this); if (ENFSN_IS_SHOP(&this->actor) && EnFsn_HasItemsToSell()) { diff --git a/src/overlays/actors/ovl_En_Fsn/z_en_fsn.h b/src/overlays/actors/ovl_En_Fsn/z_en_fsn.h index 22133322e8..c1ba92cf6d 100644 --- a/src/overlays/actors/ovl_En_Fsn/z_en_fsn.h +++ b/src/overlays/actors/ovl_En_Fsn/z_en_fsn.h @@ -29,7 +29,7 @@ typedef struct EnFsn { /* 0x228 */ s16 fidgetTableY[ENFSN_LIMB_MAX]; /* 0x24E */ s16 fidgetTableZ[ENFSN_LIMB_MAX]; /* 0x274 */ Vec3s headRot; - /* 0x27A */ Vec3s unk27A; // Set but never used + /* 0x27A */ Vec3s torsoRot; // Set but never used /* 0x280 */ Vec3s jointTable[ENFSN_LIMB_MAX]; /* 0x2F2 */ Vec3s morphTable[ENFSN_LIMB_MAX]; /* 0x364 */ s16 eyeTexIndex; diff --git a/src/overlays/actors/ovl_En_Fu/z_en_fu.c b/src/overlays/actors/ovl_En_Fu/z_en_fu.c index 9e92690349..8178417920 100644 --- a/src/overlays/actors/ovl_En_Fu/z_en_fu.c +++ b/src/overlays/actors/ovl_En_Fu/z_en_fu.c @@ -328,13 +328,13 @@ void func_80961F38(PlayState* play, Vec3f* arg1, s16* arg2, s16 arg3, s16 arg4, sp40 = Math_Vec3f_Yaw(arg1, &sp34) - arg3; if (arg5 < ABS_ALT(sp40)) { - Math_SmoothStepToS(&arg2[0], 0, 6, 6200, 100); - Math_SmoothStepToS(&arg2[1], 0, 6, 6200, 100); + Math_SmoothStepToS(&arg2[0], 0, 6, 0x1838, 0x64); + Math_SmoothStepToS(&arg2[1], 0, 6, 0x1838, 0x64); } else { sp42 = Math_Vec3f_Pitch(arg1, &sp34); - Math_SmoothStepToS(&arg2[0], sp42, 6, 6200, 100); - Math_SmoothStepToS(&arg2[1], sp40, 6, 6200, 100); + Math_SmoothStepToS(&arg2[0], sp42, 6, 0x1838, 0x64); + Math_SmoothStepToS(&arg2[1], sp40, 6, 0x1838, 0x64); } if (arg4 < ABS_ALT(arg2[1])) { @@ -345,7 +345,7 @@ void func_80961F38(PlayState* play, Vec3f* arg1, s16* arg2, s16 arg3, s16 arg4, } } - Math_SmoothStepToS(&arg2[2], 0, 6, 2000, 100); + Math_SmoothStepToS(&arg2[2], 0, 6, 0x7D0, 0x64); } void func_8096209C(EnFu* this, PlayState* play) { @@ -354,9 +354,9 @@ void func_8096209C(EnFu* this, PlayState* play) { if (this->unk_53C & 1) { func_80961F38(play, &this->unk_508, this->unk_524, this->actor.shape.rot.y, 0x38E3, 0x6AAA); } else { - Math_SmoothStepToS(&this->unk_524[0], 0, 6, 6000, 100); - Math_SmoothStepToS(&this->unk_524[1], 0, 6, 6000, 100); - Math_SmoothStepToS(&this->unk_524[2], 0, 6, 6000, 100); + Math_SmoothStepToS(&this->unk_524[0], 0, 6, 0x1770, 0x64); + Math_SmoothStepToS(&this->unk_524[1], 0, 6, 0x1770, 0x64); + Math_SmoothStepToS(&this->unk_524[2], 0, 6, 0x1770, 0x64); } if (this->unk_53C & 2) { @@ -364,9 +364,9 @@ void func_8096209C(EnFu* this, PlayState* play) { func_80961F38(play, &this->unk_514, this->unk_52A, rotY, 0x38E3, 0x5555); } else { - Math_SmoothStepToS(&this->unk_52A[0], 0, 6, 6000, 100); - Math_SmoothStepToS(&this->unk_52A[1], 0, 6, 6000, 100); - Math_SmoothStepToS(&this->unk_52A[2], 0, 6, 6000, 100); + Math_SmoothStepToS(&this->unk_52A[0], 0, 6, 0x1770, 0x64); + Math_SmoothStepToS(&this->unk_52A[1], 0, 6, 0x1770, 0x64); + Math_SmoothStepToS(&this->unk_52A[2], 0, 6, 0x1770, 0x64); } if ((this->unk_53C & 1) && (this->unk_53C & 2)) { @@ -440,7 +440,7 @@ void func_80962340(EnFu* this, PlayState* play) { } else { Actor_OfferTalk(&this->actor, play, 100.0f); } - Math_SmoothStepToS(&this->actor.shape.rot.y, BINANG_SUB(this->actor.child->shape.rot.y, 0x4000), 10, 3000, 100); + Math_SmoothStepToS(&this->actor.shape.rot.y, BINANG_SUB(this->actor.child->shape.rot.y, 0x4000), 10, 3000, 0x64); } void func_80962588(EnFu* this, PlayState* play) { @@ -1238,7 +1238,7 @@ void func_809640D8(EnFu* this, PlayState* play) { } void func_8096413C(EnFu* this, PlayState* play) { - Math_SmoothStepToS(&this->actor.shape.rot.y, BINANG_SUB(this->actor.yawTowardsPlayer, 0x4000), 5, 1000, 100); + Math_SmoothStepToS(&this->actor.shape.rot.y, BINANG_SUB(this->actor.yawTowardsPlayer, 0x4000), 5, 0x3E8, 0x64); this->actor.world.rot.y = this->actor.shape.rot.y; } diff --git a/src/overlays/actors/ovl_En_Fz/z_en_fz.c b/src/overlays/actors/ovl_En_Fz/z_en_fz.c index c4ae08bd34..0fc40b57cf 100644 --- a/src/overlays/actors/ovl_En_Fz/z_en_fz.c +++ b/src/overlays/actors/ovl_En_Fz/z_en_fz.c @@ -465,7 +465,7 @@ void func_80933014(EnFz* this) { } } } - Math_SmoothStepToS(&this->actor.shape.rot.y, temp_a1, 10, 2000, 0); + Math_SmoothStepToS(&this->actor.shape.rot.y, temp_a1, 10, 0x7D0, 0); this->actor.world.rot.y = this->actor.shape.rot.y; } diff --git a/src/overlays/actors/ovl_En_Gb2/z_en_gb2.c b/src/overlays/actors/ovl_En_Gb2/z_en_gb2.c index b40127aaa8..6c50296c6d 100644 --- a/src/overlays/actors/ovl_En_Gb2/z_en_gb2.c +++ b/src/overlays/actors/ovl_En_Gb2/z_en_gb2.c @@ -995,7 +995,7 @@ void EnGb2_Update(Actor* thisx, PlayState* play) { if (!(this->unk_26C & 0x100)) { func_80B0F5E0(this, play); } - Actor_TrackPlayer(play, &this->actor, &this->unk_270, &this->unk_276, this->actor.focus.pos); + Actor_TrackPlayer(play, &this->actor, &this->headRot, &this->torsoRot, this->actor.focus.pos); } s32 EnGb2_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx, @@ -1003,7 +1003,7 @@ s32 EnGb2_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* p EnGb2* this = THIS; if (limbIndex == OBJECT_PS_LIMB_07) { - Matrix_RotateYS(this->unk_270.y, MTXMODE_APPLY); + Matrix_RotateYS(this->headRot.y, MTXMODE_APPLY); } if (limbIndex == OBJECT_PS_LIMB_01) { diff --git a/src/overlays/actors/ovl_En_Gb2/z_en_gb2.h b/src/overlays/actors/ovl_En_Gb2/z_en_gb2.h index e59eecee08..63532b93f4 100644 --- a/src/overlays/actors/ovl_En_Gb2/z_en_gb2.h +++ b/src/overlays/actors/ovl_En_Gb2/z_en_gb2.h @@ -27,8 +27,8 @@ typedef struct EnGb2 { /* 0x268 */ Actor* unk_268; /* 0x26C */ u16 unk_26C; /* 0x26E */ u16 unk_26E; - /* 0x270 */ Vec3s unk_270; - /* 0x276 */ Vec3s unk_276; + /* 0x270 */ Vec3s headRot; + /* 0x276 */ Vec3s torsoRot; /* 0x27C */ s16 unk_27C; /* 0x27E */ s16 unk_27E; /* 0x280 */ s16 unk_280; diff --git a/src/overlays/actors/ovl_En_Geg/z_en_geg.c b/src/overlays/actors/ovl_En_Geg/z_en_geg.c index 761604144c..5154482d6d 100644 --- a/src/overlays/actors/ovl_En_Geg/z_en_geg.c +++ b/src/overlays/actors/ovl_En_Geg/z_en_geg.c @@ -784,7 +784,7 @@ void func_80BB2E00(EnGeg* this, PlayState* play) { } void func_80BB2F7C(EnGeg* this, PlayState* play) { - Math_SmoothStepToS(&this->actor.world.rot.y, Math_Vec3f_Yaw(&this->actor.world.pos, &this->unk_4E4), 4, 1000, 1); + Math_SmoothStepToS(&this->actor.world.rot.y, Math_Vec3f_Yaw(&this->actor.world.pos, &this->unk_4E4), 4, 0x3E8, 1); this->actor.shape.rot.y = this->actor.world.rot.y; if ((this->actor.xzDistToPlayer < 150.0f) && (fabsf(this->actor.playerHeightRel) < 10.0f) && @@ -877,7 +877,7 @@ void func_80BB3318(EnGeg* this, PlayState* play) { if (this->unk_4D8 < 2) { sp46 = Math_Vec3f_Yaw(&this->actor.world.pos, &D_80BB4044[this->unk_4D8]); sp40 = Math_Vec3f_DistXZ(&this->actor.world.pos, &D_80BB4044[this->unk_4D8]); - Math_SmoothStepToS(&this->actor.world.rot.y, sp46, 4, 1000, 1); + Math_SmoothStepToS(&this->actor.world.rot.y, sp46, 4, 0x3E8, 1); if (sp40 < 20.0f) { this->unk_4D8++; } diff --git a/src/overlays/actors/ovl_En_Gg/z_en_gg.c b/src/overlays/actors/ovl_En_Gg/z_en_gg.c index f46b0c3748..ef86d5f550 100644 --- a/src/overlays/actors/ovl_En_Gg/z_en_gg.c +++ b/src/overlays/actors/ovl_En_Gg/z_en_gg.c @@ -763,7 +763,7 @@ void EnGg_Update(Actor* thisx, PlayState* play) { } func_80B35634(this, play); - Actor_TrackPlayer(play, &this->actor, &this->unk_1D8, &this->unk_1DE, this->actor.focus.pos); + Actor_TrackPlayer(play, &this->actor, &this->headRot, &this->torsoRot, this->actor.focus.pos); func_80B351A4(this); } diff --git a/src/overlays/actors/ovl_En_Gg/z_en_gg.h b/src/overlays/actors/ovl_En_Gg/z_en_gg.h index 436d5a4ab1..f6a2d5bf75 100644 --- a/src/overlays/actors/ovl_En_Gg/z_en_gg.h +++ b/src/overlays/actors/ovl_En_Gg/z_en_gg.h @@ -29,8 +29,8 @@ typedef struct EnGg { /* 0x144 */ ColliderCylinder collider; /* 0x190 */ SkelAnime skelAnime; /* 0x1D4 */ EnGgActionFunc actionFunc; - /* 0x1D8 */ Vec3s unk_1D8; - /* 0x1DE */ Vec3s unk_1DE; + /* 0x1D8 */ Vec3s headRot; + /* 0x1DE */ Vec3s torsoRot; /* 0x1E4 */ Vec3s jointTable[OBJECT_GG_LIMB_MAX]; /* 0x25C */ Vec3s morphTable[OBJECT_GG_LIMB_MAX]; /* 0x2D4 */ UNK_TYPE1 unk_2D4[0x6]; diff --git a/src/overlays/actors/ovl_En_Gg2/z_en_gg2.c b/src/overlays/actors/ovl_En_Gg2/z_en_gg2.c index 70eaf95530..3629839b4f 100644 --- a/src/overlays/actors/ovl_En_Gg2/z_en_gg2.c +++ b/src/overlays/actors/ovl_En_Gg2/z_en_gg2.c @@ -468,7 +468,7 @@ void EnGg2_Update(Actor* thisx, PlayState* play) { Actor_MoveWithoutGravity(&this->actor); SkelAnime_Update(&this->skelAnime); func_80B3B8A4(this); - Actor_TrackPlayer(play, &this->actor, &this->unk_1E0, &this->unk_1E6, this->actor.focus.pos); + Actor_TrackPlayer(play, &this->actor, &this->headRot, &this->torsoRot, this->actor.focus.pos); if ((this->animIndex == ENGG2_ANIM_5) || (this->animIndex == ENGG2_ANIM_7)) { Actor_PlaySfx_Flagged(&this->actor, NA_SE_EN_SHARP_FLOAT - SFX_FLAG); diff --git a/src/overlays/actors/ovl_En_Gg2/z_en_gg2.h b/src/overlays/actors/ovl_En_Gg2/z_en_gg2.h index dd68c20b12..8ac96df3b6 100644 --- a/src/overlays/actors/ovl_En_Gg2/z_en_gg2.h +++ b/src/overlays/actors/ovl_En_Gg2/z_en_gg2.h @@ -19,8 +19,8 @@ typedef struct EnGg2 { /* 0x1D4 */ EnGg2ActionFunc actionFunc; /* 0x1D8 */ Path* path; /* 0x1DC */ s32 unk_1DC; - /* 0x1E0 */ Vec3s unk_1E0; - /* 0x1E6 */ Vec3s unk_1E6; + /* 0x1E0 */ Vec3s headRot; + /* 0x1E6 */ Vec3s torsoRot; /* 0x1EC */ Vec3s jointTable[OBJECT_GG_LIMB_MAX]; /* 0x264 */ Vec3s morphTable[OBJECT_GG_LIMB_MAX]; /* 0x2DC */ UNK_TYPE1 unk2DC[0x8]; diff --git a/src/overlays/actors/ovl_En_Ginko_Man/z_en_ginko_man.c b/src/overlays/actors/ovl_En_Ginko_Man/z_en_ginko_man.c index c1ae66cf25..48768f7709 100644 --- a/src/overlays/actors/ovl_En_Ginko_Man/z_en_ginko_man.c +++ b/src/overlays/actors/ovl_En_Ginko_Man/z_en_ginko_man.c @@ -646,9 +646,9 @@ void EnGinkoMan_SwitchAnimation(EnGinkoMan* this, PlayState* play) { void EnGinkoMan_FacePlayer(EnGinkoMan* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); if (this->skelAnime.animation != &object_boj_Anim_004A7C) { - Actor_TrackPlayer(play, &this->actor, &this->limb15Rot, &this->limb8Rot, this->actor.focus.pos); + Actor_TrackPlayer(play, &this->actor, &this->headRot, &this->torsoRot, this->actor.focus.pos); } else { - Actor_TrackNone(&this->limb15Rot, &this->limb8Rot); + Actor_TrackNone(&this->headRot, &this->torsoRot); } } @@ -670,12 +670,12 @@ s32 EnGinkoMan_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec if (limbIndex == OBJECT_BOJ_LIMB_0F) { Matrix_Translate(1500.0f, 0.0f, 0.0f, MTXMODE_APPLY); - Matrix_RotateXS(this->limb15Rot.y, MTXMODE_APPLY); - Matrix_RotateZS(this->limb15Rot.x, MTXMODE_APPLY); + Matrix_RotateXS(this->headRot.y, MTXMODE_APPLY); + Matrix_RotateZS(this->headRot.x, MTXMODE_APPLY); Matrix_Translate(-1500.0f, 0.0f, 0.0f, MTXMODE_APPLY); } else if (limbIndex == OBJECT_BOJ_LIMB_08) { - Matrix_RotateXS(-this->limb8Rot.y, MTXMODE_APPLY); - Matrix_RotateZS(-this->limb8Rot.x, MTXMODE_APPLY); + Matrix_RotateXS(-this->torsoRot.y, MTXMODE_APPLY); + Matrix_RotateZS(-this->torsoRot.x, MTXMODE_APPLY); } return false; diff --git a/src/overlays/actors/ovl_En_Ginko_Man/z_en_ginko_man.h b/src/overlays/actors/ovl_En_Ginko_Man/z_en_ginko_man.h index 48ef4bdb1e..f22f63c8b9 100644 --- a/src/overlays/actors/ovl_En_Ginko_Man/z_en_ginko_man.h +++ b/src/overlays/actors/ovl_En_Ginko_Man/z_en_ginko_man.h @@ -14,8 +14,8 @@ typedef struct EnGinkoMan { /* 0x188 */ EnGinkoManActionFunc actionFunc; /* 0x18C */ Vec3s jointTable[OBJECT_BOJ_LIMB_MAX]; /* 0x1EC */ Vec3s morphTable[OBJECT_BOJ_LIMB_MAX]; - /* 0x24C */ Vec3s limb15Rot; - /* 0x252 */ Vec3s limb8Rot; + /* 0x24C */ Vec3s headRot; + /* 0x252 */ Vec3s torsoRot; /* 0x258 */ s16 curTextId; /* 0x25A */ s16 serviceFee; /* 0x25C */ s16 choiceDepositWithdrawl; diff --git a/src/overlays/actors/ovl_En_Gk/z_en_gk.c b/src/overlays/actors/ovl_En_Gk/z_en_gk.c index 32946818ac..c41064a29e 100644 --- a/src/overlays/actors/ovl_En_Gk/z_en_gk.c +++ b/src/overlays/actors/ovl_En_Gk/z_en_gk.c @@ -1130,7 +1130,7 @@ void EnGk_Update(Actor* thisx, PlayState* play) { ((ENGK_GET_F(&this->actor) == ENGK_F_0) && !CHECK_WEEKEVENTREG(WEEKEVENTREG_CALMED_GORON_ELDERS_SON))) { func_80B507A0(this, play); SkelAnime_Update(&this->skelAnime); - Actor_TrackPlayer(play, &this->actor, &this->unk_1D8, &this->unk_1DE, this->actor.focus.pos); + Actor_TrackPlayer(play, &this->actor, &this->headRot, &this->torsoRot, this->actor.focus.pos); if (ENGK_GET_F(&this->actor) == ENGK_F_1) { func_80B5123C(this, play); } diff --git a/src/overlays/actors/ovl_En_Gk/z_en_gk.h b/src/overlays/actors/ovl_En_Gk/z_en_gk.h index b9d237cd54..d61c9574d1 100644 --- a/src/overlays/actors/ovl_En_Gk/z_en_gk.h +++ b/src/overlays/actors/ovl_En_Gk/z_en_gk.h @@ -28,8 +28,8 @@ typedef struct EnGk { /* 0x144 */ ColliderCylinder collider; /* 0x190 */ SkelAnime skelAnime; /* 0x1D4 */ EnGkActionFunc actionFunc; - /* 0x1D8 */ Vec3s unk_1D8; - /* 0x1DE */ Vec3s unk_1DE; + /* 0x1D8 */ Vec3s headRot; + /* 0x1DE */ Vec3s torsoRot; /* 0x1E4 */ u16 unk_1E4; /* 0x1E8 */ Path* path; /* 0x1EC */ s32 unk_1EC; diff --git a/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c b/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c index c759e3b0d9..44edff70a6 100644 --- a/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c +++ b/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c @@ -342,8 +342,8 @@ void func_8093F198(PlayState* play, Vec3f* arg1, f32 arg2) { temp_lo = 0x10000 / temp_f16; for (i = 0, phi_s0 = 0; i < temp_f16; i++, phi_s0 += temp_lo) { - sp74.x = (Math_SinS((s32)(Rand_ZeroOne() * temp_lo) + phi_s0) * temp_f20) + arg1->x; - sp74.z = (Math_CosS((s32)(Rand_ZeroOne() * temp_lo) + phi_s0) * temp_f20) + arg1->z; + sp74.x = arg1->x + (Math_SinS((s32)(Rand_ZeroOne() * temp_lo) + phi_s0) * temp_f20); + sp74.z = arg1->z + (Math_CosS((s32)(Rand_ZeroOne() * temp_lo) + phi_s0) * temp_f20); EffectSsGSplash_Spawn(play, &sp74, NULL, NULL, 0, 0x15E); } diff --git a/src/overlays/actors/ovl_En_Guruguru/z_en_guruguru.c b/src/overlays/actors/ovl_En_Guruguru/z_en_guruguru.c index be346d62fe..1761d622e0 100644 --- a/src/overlays/actors/ovl_En_Guruguru/z_en_guruguru.c +++ b/src/overlays/actors/ovl_En_Guruguru/z_en_guruguru.c @@ -378,8 +378,8 @@ void EnGuruguru_Update(Actor* thisx, PlayState* play) { Actor_SetScale(&this->actor, 0.01f); Actor_SetFocus(&this->actor, 50.0f); Actor_MoveWithGravity(&this->actor); - Math_SmoothStepToS(&this->headXRot, this->headXRotTarget, 1, 3000, 0); - Math_SmoothStepToS(&this->headZRot, this->headZRotTarget, 1, 1000, 0); + Math_SmoothStepToS(&this->headXRot, this->headXRotTarget, 1, 0xBB8, 0); + Math_SmoothStepToS(&this->headZRot, this->headZRotTarget, 1, 0x3E8, 0); Actor_UpdateBgCheckInfo(play, &this->actor, 20.0f, 20.0f, 50.0f, UPDBGCHECKINFO_FLAG_1 | UPDBGCHECKINFO_FLAG_4 | UPDBGCHECKINFO_FLAG_8 | UPDBGCHECKINFO_FLAG_10); diff --git a/src/overlays/actors/ovl_En_Heishi/z_en_heishi.c b/src/overlays/actors/ovl_En_Heishi/z_en_heishi.c index 2cd56d7963..c694033f6d 100644 --- a/src/overlays/actors/ovl_En_Heishi/z_en_heishi.c +++ b/src/overlays/actors/ovl_En_Heishi/z_en_heishi.c @@ -174,8 +174,8 @@ void EnHeishi_Update(Actor* thisx, PlayState* play) { } Actor_SetFocus(&this->actor, 60.0f); - Math_SmoothStepToS(&this->headRotX, this->headRotXTarget, 1, 3000, 0); - Math_SmoothStepToS(&this->headRotY, this->headRotYTarget, 1, 1000, 0); + Math_SmoothStepToS(&this->headRotX, this->headRotXTarget, 1, 0xBB8, 0); + Math_SmoothStepToS(&this->headRotY, this->headRotYTarget, 1, 0x3E8, 0); Collider_UpdateCylinder(&this->actor, &this->colliderCylinder); CollisionCheck_SetOC(play, &play->colChkCtx, &this->colliderCylinder.base); } diff --git a/src/overlays/actors/ovl_En_Hint_Skb/z_en_hint_skb.c b/src/overlays/actors/ovl_En_Hint_Skb/z_en_hint_skb.c index b1d66f71ba..c67d448e1a 100644 --- a/src/overlays/actors/ovl_En_Hint_Skb/z_en_hint_skb.c +++ b/src/overlays/actors/ovl_En_Hint_Skb/z_en_hint_skb.c @@ -207,7 +207,7 @@ void func_80C1FE80(EnHintSkb* this, PlayState* play) { if (Animation_OnFrame(&this->skelAnime, 8.0f) || Animation_OnFrame(&this->skelAnime, 15.0f)) { Actor_PlaySfx(&this->actor, NA_SE_EN_STALKID_WALK); } - Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 1, 750, 0); + Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 1, 0x2EE, 0); this->actor.world.rot.y = this->actor.shape.rot.y; if (Actor_IsFacingPlayer(&this->actor, 0x11C7) && (this->actor.xzDistToPlayer < 60.0f)) { func_80C1FF30(this); @@ -321,10 +321,10 @@ void func_80C20334(EnHintSkb* this, PlayState* play) { } else if (this->actor.speed != 0.0f) { this->actor.speed -= 0.05f; } - Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 1, 2500, 0); + Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 1, 0x9C4, 0); } - Math_SmoothStepToS(&this->actor.shape.rot.x, 0, 16, 2000, 100); + Math_SmoothStepToS(&this->actor.shape.rot.x, 0, 16, 0x7D0, 0x64); if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame) && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { diff --git a/src/overlays/actors/ovl_En_Horse/z_en_horse.c b/src/overlays/actors/ovl_En_Horse/z_en_horse.c index f7f2cb1a2e..d9d746b683 100644 --- a/src/overlays/actors/ovl_En_Horse/z_en_horse.c +++ b/src/overlays/actors/ovl_En_Horse/z_en_horse.c @@ -4018,7 +4018,7 @@ void func_80886C00(EnHorse* this, PlayState* play) { if (((this->action == ENHORSE_ACTION_MOUNTED_WALK) || (this->action == ENHORSE_ACTION_MOUNTED_TROT) || (this->action == ENHORSE_ACTION_MOUNTED_GALLOP)) && (CHECK_BTN_ALL(input->press.button, BTN_A) || (AudioVoice_GetWord() == VOICE_WORD_ID_HIYA)) && - (play->interfaceCtx.unk_212 == 8) && !(this->stateFlags & ENHORSE_BOOST) && + (play->interfaceCtx.unk_212 == DO_ACTION_FASTER) && !(this->stateFlags & ENHORSE_BOOST) && !(this->stateFlags & ENHORSE_FLAG_8) && !(this->stateFlags & ENHORSE_FLAG_9)) { if (this->numBoosts > 0) { Rumble_Request(0.0f, 180, 20, 100); diff --git a/src/overlays/actors/ovl_En_Hs/z_en_hs.c b/src/overlays/actors/ovl_En_Hs/z_en_hs.c index e8c16c5df8..cf40d44ee5 100644 --- a/src/overlays/actors/ovl_En_Hs/z_en_hs.c +++ b/src/overlays/actors/ovl_En_Hs/z_en_hs.c @@ -294,15 +294,15 @@ void EnHs_Update(Actor* thisx, PlayState* play) { if (this->stateFlags & 4) { Math_SmoothStepToS(&this->headRot.x, 0, 6, 0x1838, 0x64); - Math_SmoothStepToS(&this->unusedRot.x, 0, 6, 0x1838, 0x64); - Math_SmoothStepToS(&this->unusedRot.y, 0, 6, 0x1838, 0x64); + Math_SmoothStepToS(&this->torsoRot.x, 0, 6, 0x1838, 0x64); + Math_SmoothStepToS(&this->torsoRot.y, 0, 6, 0x1838, 0x64); } else if (this->stateFlags & 1) { - Actor_TrackPlayer(play, &this->actor, &this->headRot, &this->unusedRot, this->actor.focus.pos); + Actor_TrackPlayer(play, &this->actor, &this->headRot, &this->torsoRot, this->actor.focus.pos); } else { Math_SmoothStepToS(&this->headRot.x, 0x3200, 6, 0x1838, 0x64); Math_SmoothStepToS(&this->headRot.y, 0, 6, 0x1838, 0x64); - Math_SmoothStepToS(&this->unusedRot.x, 0, 6, 0x1838, 0x64); - Math_SmoothStepToS(&this->unusedRot.y, 0, 6, 0x1838, 0x64); + Math_SmoothStepToS(&this->torsoRot.x, 0, 6, 0x1838, 0x64); + Math_SmoothStepToS(&this->torsoRot.y, 0, 6, 0x1838, 0x64); } } diff --git a/src/overlays/actors/ovl_En_Hs/z_en_hs.h b/src/overlays/actors/ovl_En_Hs/z_en_hs.h index 79f94fd4ba..de87fa97ad 100644 --- a/src/overlays/actors/ovl_En_Hs/z_en_hs.h +++ b/src/overlays/actors/ovl_En_Hs/z_en_hs.h @@ -27,7 +27,7 @@ typedef struct EnHs { /* 0x1D4 */ Vec3s jointTable[OBJECT_HS_LIMB_MAX]; /* 0x234 */ Vec3s morphTable[OBJECT_HS_LIMB_MAX]; /* 0x294 */ Vec3s headRot; - /* 0x29A */ Vec3s unusedRot; // probably not chest, as chest is same limb as lower body + /* 0x29A */ Vec3s torsoRot; // Set but unused /* 0x2A0 */ u16 stateFlags; /* 0x2A2 */ s16 stateTimer; // reused for different actionFunc /* 0x2A4 */ Vec3f nwcPos[20]; // actual chick position are even values, odd values seem to be extra values for smoother chain diff --git a/src/overlays/actors/ovl_En_Ik/z_en_ik.c b/src/overlays/actors/ovl_En_Ik/z_en_ik.c index d2af5d3ed0..a5fd7f8a3f 100644 --- a/src/overlays/actors/ovl_En_Ik/z_en_ik.c +++ b/src/overlays/actors/ovl_En_Ik/z_en_ik.c @@ -487,8 +487,8 @@ void EnIk_VerticalAttack(EnIk* this, PlayState* play) { Actor_PlaySfx(&this->actor, NA_SE_EN_IRONNACK_SWING_AXE); } else if (Animation_OnFrame(&this->skelAnime, 21.0f)) { - particlePos.x = (Math_SinS((this->actor.shape.rot.y + 0x6A4)) * 70.0f) + this->actor.world.pos.x; - particlePos.z = (Math_CosS((this->actor.shape.rot.y + 0x6A4)) * 70.0f) + this->actor.world.pos.z; + particlePos.x = this->actor.world.pos.x + (Math_SinS(this->actor.shape.rot.y + 0x6A4) * 70.0f); + particlePos.z = this->actor.world.pos.z + (Math_CosS(this->actor.shape.rot.y + 0x6A4) * 70.0f); particlePos.y = this->actor.world.pos.y; Actor_PlaySfx(&this->actor, NA_SE_EN_IRONNACK_HIT_GND); Camera_AddQuake(GET_ACTIVE_CAM(play), 2, 25, 5); @@ -750,9 +750,9 @@ void EnIk_PlayCutscene(EnIk* this, PlayState* play) { if (this->actor.csId != CS_ID_NONE) { CutsceneManager_StartWithPlayerCsAndSetFlag(this->actor.csId, &this->actor); this->subCamId = CutsceneManager_GetCurrentSubCamId(this->actor.csId); - subCamEye.x = (Math_SinS((this->actor.shape.rot.y - 0x2000)) * 120.0f) + this->actor.focus.pos.x; + subCamEye.x = this->actor.focus.pos.x + (Math_SinS(this->actor.shape.rot.y - 0x2000) * 120.0f); subCamEye.y = this->actor.focus.pos.y + 20.0f; - subCamEye.z = (Math_CosS((this->actor.shape.rot.y - 0x2000)) * 120.0f) + this->actor.focus.pos.z; + subCamEye.z = this->actor.focus.pos.z + (Math_CosS(this->actor.shape.rot.y - 0x2000) * 120.0f); Play_SetCameraAtEye(play, this->subCamId, &this->actor.focus.pos, &subCamEye); } if (this->actor.colChkInfo.health != 0) { diff --git a/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c b/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c index 94ab471f68..408af34902 100644 --- a/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c +++ b/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c @@ -623,8 +623,8 @@ void func_8095EBDC(EnIshi* this, PlayState* play) { sp58.y = this->actor.world.pos.y + this->actor.depthInWater; for (phi_s0 = 0, i = 0; i < 11; i++, phi_s0 += 0x1746) { - sp58.x = (Math_SinS((s32)(Rand_ZeroOne() * 2000.0f) + phi_s0) * 50.0f) + this->actor.world.pos.x; - sp58.z = (Math_CosS((s32)(Rand_ZeroOne() * 2000.0f) + phi_s0) * 50.0f) + this->actor.world.pos.z; + sp58.x = this->actor.world.pos.x + (Math_SinS((s32)(Rand_ZeroOne() * 2000.0f) + phi_s0) * 50.0f); + sp58.z = this->actor.world.pos.z + (Math_CosS((s32)(Rand_ZeroOne() * 2000.0f) + phi_s0) * 50.0f); EffectSsGSplash_Spawn(play, &sp58, NULL, NULL, 0, 350); } diff --git a/src/overlays/actors/ovl_En_Jg/z_en_jg.c b/src/overlays/actors/ovl_En_Jg/z_en_jg.c index 56d322575d..e97e616400 100644 --- a/src/overlays/actors/ovl_En_Jg/z_en_jg.c +++ b/src/overlays/actors/ovl_En_Jg/z_en_jg.c @@ -6,6 +6,7 @@ #include "z_en_jg.h" #include "overlays/actors/ovl_En_S_Goro/z_en_s_goro.h" +#include "overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_10) @@ -553,9 +554,10 @@ void EnJg_Freeze(EnJg* this, PlayState* play) { this->action = EN_JG_ACTION_FROZEN_OR_NON_FIRST_THAW; this->freezeTimer = 1000; this->skelAnime.curFrame = endFrame; - this->icePoly = Actor_Spawn(&play->actorCtx, play, ACTOR_OBJ_ICE_POLY, this->actor.world.pos.x, - this->actor.world.pos.y, this->actor.world.pos.z, this->actor.world.rot.x, - this->actor.world.rot.y, this->actor.world.rot.z, 0xFF50); + this->icePoly = + Actor_Spawn(&play->actorCtx, play, ACTOR_OBJ_ICE_POLY, this->actor.world.pos.x, this->actor.world.pos.y, + this->actor.world.pos.z, this->actor.world.rot.x, this->actor.world.rot.y, + this->actor.world.rot.z, OBJICEPOLY_PARAMS(80, OBJICEPOLY_SWITCH_FLAG_NONE)); this->animIndex = EN_JG_ANIM_FROZEN_LOOP; SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->animIndex); this->actionFunc = EnJg_FrozenIdle; @@ -563,9 +565,10 @@ void EnJg_Freeze(EnJg* this, PlayState* play) { this->action = EN_JG_ACTION_FROZEN_OR_NON_FIRST_THAW; if (curFrame == endFrame) { this->freezeTimer = 1000; - this->icePoly = Actor_Spawn(&play->actorCtx, play, ACTOR_OBJ_ICE_POLY, this->actor.world.pos.x, - this->actor.world.pos.y, this->actor.world.pos.z, this->actor.world.rot.x, - this->actor.world.rot.y, this->actor.world.rot.z, 0xFF50); + this->icePoly = + Actor_Spawn(&play->actorCtx, play, ACTOR_OBJ_ICE_POLY, this->actor.world.pos.x, this->actor.world.pos.y, + this->actor.world.pos.z, this->actor.world.rot.x, this->actor.world.rot.y, + this->actor.world.rot.z, OBJICEPOLY_PARAMS(80, OBJICEPOLY_SWITCH_FLAG_NONE)); this->animIndex = EN_JG_ANIM_FROZEN_LOOP; SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->animIndex); this->actionFunc = EnJg_FrozenIdle; @@ -995,7 +998,7 @@ void EnJg_Update(Actor* thisx, PlayState* play) { EnJg_SpawnBreath(this, play); } - Actor_TrackPlayer(play, &this->actor, &this->unusedRotation1, &this->unusedRotation2, this->actor.focus.pos); + Actor_TrackPlayer(play, &this->actor, &this->headRot, &this->torsoRot, this->actor.focus.pos); } this->actionFunc(this, play); } diff --git a/src/overlays/actors/ovl_En_Jg/z_en_jg.h b/src/overlays/actors/ovl_En_Jg/z_en_jg.h index 30c84973c9..b5dd61614d 100644 --- a/src/overlays/actors/ovl_En_Jg/z_en_jg.h +++ b/src/overlays/actors/ovl_En_Jg/z_en_jg.h @@ -23,8 +23,8 @@ typedef struct EnJg { /* 0x1E0 */ Path* path; /* 0x1E4 */ s32 currentPoint; /* 0x1E8 */ Actor* drum; - /* 0x1EC */ Vec3s unusedRotation1; // probably meant to be a head rotation to look at the player - /* 0x1F2 */ Vec3s unusedRotation2; // probably meant to be a body rotation to look at the player + /* 0x1EC */ Vec3s headRot; // set but unused + /* 0x1F2 */ Vec3s torsoRot; // set but unused /* 0x1F8 */ Vec3s jointTable[GORON_ELDER_LIMB_MAX]; /* 0x2CA */ Vec3s morphTable[GORON_ELDER_LIMB_MAX]; /* 0x39C */ s16 rootRotationWhenTalking; diff --git a/src/overlays/actors/ovl_En_Jgame_Tsn/z_en_jgame_tsn.c b/src/overlays/actors/ovl_En_Jgame_Tsn/z_en_jgame_tsn.c index 1f3c675a54..0515a0ac8b 100644 --- a/src/overlays/actors/ovl_En_Jgame_Tsn/z_en_jgame_tsn.c +++ b/src/overlays/actors/ovl_En_Jgame_Tsn/z_en_jgame_tsn.c @@ -601,7 +601,7 @@ void func_80C14D14(EnJgameTsn* this, PlayState* play) { } void func_80C14D58(EnJgameTsn* this, PlayState* play) { - Actor_TrackPlayer(play, &this->actor, &this->unk_2EC, &this->unk_2F2, this->actor.focus.pos); + Actor_TrackPlayer(play, &this->actor, &this->headRot, &this->torsoRot, this->actor.focus.pos); if (DECR(this->unk_2FA) == 0) { this->unk_2FA = Rand_S16Offset(60, 60); @@ -626,13 +626,13 @@ void EnJgameTsn_Update(Actor* thisx, PlayState* play) { s32 EnJgamesTsn_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) { EnJgameTsn* this = THIS; - s16 temp_v0 = this->unk_2EC.x >> 1; + s16 temp_v0 = this->headRot.x >> 1; if (limbIndex == OBJECT_TSN_LIMB_0F) { - rot->x += this->unk_2EC.y; + rot->x += this->headRot.y; rot->z += temp_v0; } else if (limbIndex == OBJECT_TSN_LIMB_08) { - rot->x += this->unk_2F2.y; + rot->x += this->torsoRot.y; rot->z += temp_v0; } return false; diff --git a/src/overlays/actors/ovl_En_Jgame_Tsn/z_en_jgame_tsn.h b/src/overlays/actors/ovl_En_Jgame_Tsn/z_en_jgame_tsn.h index 2cb22b2d5a..0d7ebd625a 100644 --- a/src/overlays/actors/ovl_En_Jgame_Tsn/z_en_jgame_tsn.h +++ b/src/overlays/actors/ovl_En_Jgame_Tsn/z_en_jgame_tsn.h @@ -28,8 +28,8 @@ typedef struct EnJgameTsn { /* 0x21C */ s32 unk_21C; /* 0x220 */ Vec3s jointTable[OBJECT_TSN_LIMB_MAX]; /* 0x286 */ Vec3s morphTable[OBJECT_TSN_LIMB_MAX]; - /* 0x2EC */ Vec3s unk_2EC; - /* 0x2F2 */ Vec3s unk_2F2; + /* 0x2EC */ Vec3s headRot; + /* 0x2F2 */ Vec3s torsoRot; /* 0x2F8 */ s16 unk_2F8; /* 0x2FA */ s16 unk_2FA; /* 0x2FC */ s16 unk_2FC; diff --git a/src/overlays/actors/ovl_En_Kaizoku/z_en_kaizoku.c b/src/overlays/actors/ovl_En_Kaizoku/z_en_kaizoku.c index e960100df5..f556bb8db9 100644 --- a/src/overlays/actors/ovl_En_Kaizoku/z_en_kaizoku.c +++ b/src/overlays/actors/ovl_En_Kaizoku/z_en_kaizoku.c @@ -689,7 +689,7 @@ void func_80B86804(EnKaizoku* this, PlayState* play) { void func_80B868B8(EnKaizoku* this, PlayState* play) { f32 curFrame = this->skelAnime.curFrame; - Math_SmoothStepToS(&this->picto.actor.shape.rot.y, this->picto.actor.yawTowardsPlayer, 1, 4000, 1); + Math_SmoothStepToS(&this->picto.actor.shape.rot.y, this->picto.actor.yawTowardsPlayer, 1, 0xFA0, 1); this->subCamEye.x = Math_SinS(this->picto.actor.yawTowardsPlayer) * 155.0f + this->picto.actor.world.pos.x; this->subCamEye.y = this->picto.actor.world.pos.y + 10.0f; this->subCamEye.z = Math_CosS(this->picto.actor.yawTowardsPlayer) * 115.0f + this->picto.actor.world.pos.z; @@ -1485,7 +1485,7 @@ void func_80B88D6C(EnKaizoku* this, PlayState* play) { if (this->picto.actor.speed < -8.0f) { this->picto.actor.speed = -8.0f; } - } else if (Math_SinS((sp2A - this->picto.actor.shape.rot.y)) < 0.0f) { + } else if (Math_SinS(sp2A - this->picto.actor.shape.rot.y) < 0.0f) { this->picto.actor.speed += 0.25f; if (this->picto.actor.speed > 8.0f) { this->picto.actor.speed = 8.0f; @@ -1645,7 +1645,7 @@ void func_80B893CC(EnKaizoku* this, PlayState* play) { void func_80B894C0(EnKaizoku* this, PlayState* play) { s16 temp_v0; - Math_SmoothStepToS(&this->picto.actor.shape.rot.y, this->picto.actor.yawTowardsPlayer, 1, 4500, 0); + Math_SmoothStepToS(&this->picto.actor.shape.rot.y, this->picto.actor.yawTowardsPlayer, 1, 0x1194, 0); if (!func_80B85858(this, play) && !func_80B85A00(this, play, false) && (this->unk_3C4.x < 1.0f) && (this->unk_3C4.z < 1.0f)) { temp_v0 = this->picto.actor.wallYaw - this->picto.actor.shape.rot.y; diff --git a/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c b/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c index 893ddc9ca1..647c4f713f 100644 --- a/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c +++ b/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c @@ -260,7 +260,7 @@ void EnKakasi_CheckPlayerPosition(EnKakasi* this, PlayState* play) { player->actor.world.pos.z = -190.0f; } - Math_SmoothStepToS(&player->actor.shape.rot.y, (this->picto.actor.yawTowardsPlayer + 0x8000), 5, 1000, 0); + Math_SmoothStepToS(&player->actor.shape.rot.y, (this->picto.actor.yawTowardsPlayer + 0x8000), 5, 0x3E8, 0); } /* @@ -403,7 +403,7 @@ void EnKakasi_RegularDialogue(EnKakasi* this, PlayState* play) { u32 day = gSaveContext.save.day; f32 curFrame = this->skelAnime.curFrame; - Math_SmoothStepToS(&this->picto.actor.shape.rot.y, this->picto.actor.yawTowardsPlayer, 5, 2000, 0); + Math_SmoothStepToS(&this->picto.actor.shape.rot.y, this->picto.actor.yawTowardsPlayer, 5, 0x7D0, 0); // if first dialogue if ((this->picto.actor.textId != 0x1644) && (curFrame >= this->animEndFrame) && (this->animIndex == ENKAKASI_ANIM_SLOWROLL)) { @@ -599,7 +599,7 @@ void EnKakasi_TeachingSong(EnKakasi* this, PlayState* play) { Vec3f tempVec; EnKakasi_CheckPlayerPosition(this, play); - Math_SmoothStepToS(&this->picto.actor.shape.rot.y, this->picto.actor.home.rot.y, 1, 3000, 0); + Math_SmoothStepToS(&this->picto.actor.shape.rot.y, this->picto.actor.home.rot.y, 1, 0xBB8, 0); if (this->unkState1A8 == 0) { if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { CutsceneManager_Stop(CS_ID_GLOBAL_TALK); @@ -684,8 +684,8 @@ void EnKakasi_PostSongLearnDialogue(EnKakasi* this, PlayState* play) { f32 curFrame = this->skelAnime.curFrame; Vec3f vec3fCopy; - Math_SmoothStepToS(&this->picto.actor.shape.rot.y, this->picto.actor.home.rot.y, 1, 3000, 0); - Math_SmoothStepToS(&player->actor.shape.rot.y, this->picto.actor.yawTowardsPlayer + 0x8000, 5, 1000, 0); + Math_SmoothStepToS(&this->picto.actor.shape.rot.y, this->picto.actor.home.rot.y, 1, 0xBB8, 0); + Math_SmoothStepToS(&player->actor.shape.rot.y, this->picto.actor.yawTowardsPlayer + 0x8000, 5, 0x3E8, 0); if (this->unk190 == 0) { Message_CloseTextbox(play); @@ -837,7 +837,7 @@ void EnKakasi_DancingNightAway(EnKakasi* this, PlayState* play) { Player* player; EnKakasi_CheckPlayerPosition(this, play); - Math_SmoothStepToS(&this->picto.actor.shape.rot.y, this->picto.actor.home.rot.y, 1, 3000, 0); + Math_SmoothStepToS(&this->picto.actor.shape.rot.y, this->picto.actor.home.rot.y, 1, 0xBB8, 0); this->unk22C.y = this->picto.actor.home.pos.y + 50.0f; this->subCamEyeNext.x = D_80971E38[this->unk190].x; @@ -945,7 +945,7 @@ void EnKakasi_DancingNightAway(EnKakasi* this, PlayState* play) { case 14: // goes off once for some camera changes, // otherwise it's the end when camera is back to normal and Player is confused - Math_SmoothStepToS(&this->picto.actor.shape.rot.y, this->picto.actor.yawTowardsPlayer, 5, 1000, 0); + Math_SmoothStepToS(&this->picto.actor.shape.rot.y, this->picto.actor.yawTowardsPlayer, 5, 0x3E8, 0); if (this->unk204 == 0) { player = GET_PLAYER(play); @@ -1109,7 +1109,7 @@ void EnKakasi_SetupIdleRisen(EnKakasi* this) { } void EnKakasi_IdleRisen(EnKakasi* this, PlayState* play) { - Math_SmoothStepToS(&this->picto.actor.shape.rot.y, this->picto.actor.yawTowardsPlayer, 5, 1000, 0); + Math_SmoothStepToS(&this->picto.actor.shape.rot.y, this->picto.actor.yawTowardsPlayer, 5, 0x3E8, 0); if (Actor_TalkOfferAccepted(&this->picto.actor, &play->state)) { this->actionFunc = EnKakasi_RisenDialogue; } else { @@ -1118,7 +1118,7 @@ void EnKakasi_IdleRisen(EnKakasi* this, PlayState* play) { } void EnKakasi_RisenDialogue(EnKakasi* this, PlayState* play) { - Math_SmoothStepToS(&this->picto.actor.shape.rot.y, this->picto.actor.yawTowardsPlayer, 5, 1000, 0); + Math_SmoothStepToS(&this->picto.actor.shape.rot.y, this->picto.actor.yawTowardsPlayer, 5, 0x3E8, 0); if ((Message_GetState(&play->msgCtx) == TEXT_STATE_5) && Message_ShouldAdvance(play)) { Message_CloseTextbox(play); diff --git a/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c b/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c index f488007763..c5ae6ca9bd 100644 --- a/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c +++ b/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c @@ -776,7 +776,7 @@ void EnKendoJs_Update(Actor* thisx, PlayState* play) { this->actionFunc(this, play); SkelAnime_Update(&this->skelAnime); - Actor_TrackPlayer(play, &this->actor, &this->unk_278, &this->unk_27E, this->actor.focus.pos); + Actor_TrackPlayer(play, &this->actor, &this->headRot, &this->torsoRot, this->actor.focus.pos); func_80B279AC(this, play); func_80B27880(this, play); } @@ -785,7 +785,7 @@ s32 EnKendoJs_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3 EnKendoJs* this = THIS; if (limbIndex == OBJECT_JS_LIMB_0C) { - rot->y -= this->unk_278.y; + rot->y -= this->headRot.y; } return false; } diff --git a/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.h b/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.h index b15e3f9a1c..2efd79af47 100644 --- a/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.h +++ b/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.h @@ -21,8 +21,8 @@ typedef struct EnKendoJs { /* 0x1D8 */ Vec3s jointTable[OBJECT_JS_LIMB_MAX]; /* 0x226 */ Vec3s morphTable[OBJECT_JS_LIMB_MAX]; /* 0x274 */ Vec3s* pathPoints; - /* 0x278 */ Vec3s unk_278; - /* 0x27E */ Vec3s unk_27E; + /* 0x278 */ Vec3s headRot; + /* 0x27E */ Vec3s torsoRot; /* 0x284 */ s16 unk_284; /* 0x286 */ s16 unk_286; /* 0x288 */ s16 unk_288; diff --git a/src/overlays/actors/ovl_En_Kgy/z_en_kgy.c b/src/overlays/actors/ovl_En_Kgy/z_en_kgy.c index 363aff660a..44bcaad707 100644 --- a/src/overlays/actors/ovl_En_Kgy/z_en_kgy.c +++ b/src/overlays/actors/ovl_En_Kgy/z_en_kgy.c @@ -1133,17 +1133,17 @@ void func_80B42D28(EnKgy* this, PlayState* play) { void EnKgy_Update(Actor* thisx, PlayState* play) { EnKgy* this = THIS; s32 pad; - Vec3s sp30; + Vec3s torsoRot; this->actionFunc(this, play); if (this->animIndex == ENKGY_ANIM_2) { - sp30.z = 0; - sp30.y = 0; - sp30.x = 0; - Actor_TrackPlayer(play, &this->actor, &this->unk_2CC, &sp30, this->actor.focus.pos); + torsoRot.z = 0; + torsoRot.y = 0; + torsoRot.x = 0; + Actor_TrackPlayer(play, &this->actor, &this->headRot, &torsoRot, this->actor.focus.pos); } else { - Math_SmoothStepToS(&this->unk_2CC.x, 0, 6, 6200, 100); - Math_SmoothStepToS(&this->unk_2CC.y, 0, 6, 6200, 100); + Math_SmoothStepToS(&this->headRot.x, 0, 6, 0x1838, 0x64); + Math_SmoothStepToS(&this->headRot.y, 0, 6, 0x1838, 0x64); } } @@ -1159,7 +1159,7 @@ s32 EnKgy_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* p } if (limbIndex == OBJECT_KGY_LIMB_0B) { - rot->x += this->unk_2CC.y; + rot->x += this->headRot.y; } return false; diff --git a/src/overlays/actors/ovl_En_Kgy/z_en_kgy.h b/src/overlays/actors/ovl_En_Kgy/z_en_kgy.h index 9cd6f68481..c8055e086c 100644 --- a/src/overlays/actors/ovl_En_Kgy/z_en_kgy.h +++ b/src/overlays/actors/ovl_En_Kgy/z_en_kgy.h @@ -24,7 +24,7 @@ typedef struct EnKgy { /* 0x2A8 */ Vec3f unk_2A8; /* 0x2B4 */ Vec3f unk_2B4; /* 0x2C0 */ Vec3f unk_2C0; - /* 0x2CC */ Vec3s unk_2CC; + /* 0x2CC */ Vec3s headRot; /* 0x2D2 */ s16 animIndex; /* 0x2D4 */ s16 csIdList[6]; /* 0x2E0 */ s16 csIdIndex; diff --git a/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c b/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c index c5c1422c27..59442b0146 100644 --- a/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c +++ b/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c @@ -581,9 +581,9 @@ void EnKusa_Fall(EnKusa* this, PlayState* play) { contactPos.y = this->actor.world.pos.y + this->actor.depthInWater; for (angleOffset = 0, i = 0; i < 4; i++, angleOffset += 0x4000) { contactPos.x = - (Math_SinS((s32)(Rand_ZeroOne() * 7200.0f) + angleOffset) * 15.0f) + this->actor.world.pos.x; + this->actor.world.pos.x + (Math_SinS((s32)(Rand_ZeroOne() * 7200.0f) + angleOffset) * 15.0f); contactPos.z = - (Math_CosS((s32)(Rand_ZeroOne() * 7200.0f) + angleOffset) * 15.0f) + this->actor.world.pos.z; + this->actor.world.pos.z + (Math_CosS((s32)(Rand_ZeroOne() * 7200.0f) + angleOffset) * 15.0f); EffectSsGSplash_Spawn(play, &contactPos, NULL, NULL, 0, 190); } contactPos.x = this->actor.world.pos.x; diff --git a/src/overlays/actors/ovl_En_Kusa2/z_en_kusa2.c b/src/overlays/actors/ovl_En_Kusa2/z_en_kusa2.c index df03abf515..7a482c2087 100644 --- a/src/overlays/actors/ovl_En_Kusa2/z_en_kusa2.c +++ b/src/overlays/actors/ovl_En_Kusa2/z_en_kusa2.c @@ -338,8 +338,8 @@ void func_80A5BDB0(EnKusa2* this, PlayState* play) { sp50.y = this->actor.world.pos.y + this->actor.depthInWater; for (phi_s0 = 0, i = 0; i < 4; i++, phi_s0 += 0x4000) { - sp50.x = (Math_SinS((s32)(Rand_ZeroOne() * 7200.0f) + phi_s0) * 15.0f) + this->actor.world.pos.x; - sp50.z = (Math_CosS((s32)(Rand_ZeroOne() * 7200.0f) + phi_s0) * 15.0f) + this->actor.world.pos.z; + sp50.x = this->actor.world.pos.x + (Math_SinS((s32)(Rand_ZeroOne() * 7200.0f) + phi_s0) * 15.0f); + sp50.z = this->actor.world.pos.z + (Math_CosS((s32)(Rand_ZeroOne() * 7200.0f) + phi_s0) * 15.0f); EffectSsGSplash_Spawn(play, &sp50, NULL, NULL, 0, 190); } @@ -575,7 +575,7 @@ void func_80A5C70C(EnKusa2UnkBssSubStruct* arg0) { } void func_80A5C718(EnKusa2UnkBssSubStruct* arg0) { - Math_ScaledStepToS(&arg0->unk_20, arg0->unk_22, 1200); + Math_ScaledStepToS(&arg0->unk_20, arg0->unk_22, 0x4B0); if ((arg0->unk_1C > 0.0f) && (Rand_ZeroOne() < 0.05f)) { arg0->unk_1C = -arg0->unk_1C; diff --git a/src/overlays/actors/ovl_En_Look_Nuts/z_en_look_nuts.c b/src/overlays/actors/ovl_En_Look_Nuts/z_en_look_nuts.c index 25b0988158..75ff9c0ec9 100644 --- a/src/overlays/actors/ovl_En_Look_Nuts/z_en_look_nuts.c +++ b/src/overlays/actors/ovl_En_Look_Nuts/z_en_look_nuts.c @@ -56,7 +56,7 @@ static ColliderCylinderInit sCylinderInit = { { 20, 50, 0, { 0, 0, 0 } }, }; -s32 D_80A6862C = 0; +s32 D_80A6862C = false; static DamageTable sDamageTable = { /* Deku Nut */ DMG_ENTRY(1, 0xF), @@ -160,7 +160,7 @@ void EnLookNuts_Patrol(EnLookNuts* this, PlayState* play) { Actor_PlaySfx(&this->actor, NA_SE_EN_NUTS_WALK); } - if (D_80A6862C != 0) { + if (D_80A6862C) { Math_ApproachZeroF(&this->actor.speed, 0.3f, 1.0f); return; } @@ -208,7 +208,7 @@ void EnLookNuts_StandAndWait(EnLookNuts* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); Math_ApproachZeroF(&this->actor.speed, 0.3f, 1.0f); - if (!Play_InCsMode(play) && (D_80A6862C == 0) && (this->eventTimer == 0)) { + if (!Play_InCsMode(play) && !D_80A6862C && (this->eventTimer == 0)) { this->eventTimer = 10; switch (this->waitTimer) { case 0: @@ -228,7 +228,7 @@ void EnLookNuts_StandAndWait(EnLookNuts* this, PlayState* play) { break; case 6: - if (fabsf(this->headRotTarget.y - this->headRotation.y) < 10.0f) { + if (fabsf(this->headRotTarget.y - this->headRot.y) < 10.0f) { this->waitTimer = 10; this->headRotTarget.x = 4000.0f; this->eventTimer = 5; @@ -236,7 +236,7 @@ void EnLookNuts_StandAndWait(EnLookNuts* this, PlayState* play) { break; case 7: - if (fabsf(this->headRotTarget.y - this->headRotation.y) < 10.0f) { + if (fabsf(this->headRotTarget.y - this->headRot.y) < 10.0f) { this->headRotTarget.z = 4000.0f; this->waitTimer++; } @@ -254,8 +254,8 @@ void EnLookNuts_StandAndWait(EnLookNuts* this, PlayState* play) { break; case 11: - if ((fabsf(this->headRotation.x) < 30.0f) && (fabsf(this->headRotation.y) < 30.0f) && - (fabsf(this->headRotation.z) < 30.0f)) { + if ((fabsf(this->headRot.x) < 30.0f) && (fabsf(this->headRot.y) < 30.0f) && + (fabsf(this->headRot.z) < 30.0f)) { this->waitTimer = 12; } break; @@ -313,14 +313,9 @@ void EnLookNuts_SendPlayerToSpawn(EnLookNuts* this, PlayState* play) { } } -static Vec3f sEffectVecInitialize = { 0.0f, 0.0f, 0.0f }; - void EnLookNuts_Update(Actor* thisx, PlayState* play) { s32 pad; EnLookNuts* this = THIS; - Vec3f effectVelOffset; - Vec3f effectPos; - Vec3f effectVel; if (this->blinkTimer == 0) { this->eyeState++; @@ -337,17 +332,20 @@ void EnLookNuts_Update(Actor* thisx, PlayState* play) { this->eventTimer--; } Actor_MoveWithGravity(&this->actor); - if (D_80A6862C == 0) { + if (!D_80A6862C) { if ((this->state < 2) && (this->actor.xzDistToPlayer < 320.0f) && (this->actor.playerHeightRel < 80.0f)) { - effectVelOffset = sEffectVecInitialize; + Vec3f effectVelocityOffset = { 0.0f, 0.0f, 0.0f }; + Vec3f effectPos; + Vec3f effectVelocity; + Math_Vec3f_Copy(&effectPos, &this->actor.world.pos); - effectPos.x += Math_SinS((this->actor.world.rot.y + (s16)this->headRotation.y)) * 10.0f; + effectPos.x += Math_SinS(this->actor.world.rot.y + (s16)this->headRot.y) * 10.0f; effectPos.y += 30.0f; - effectPos.z += Math_CosS((this->actor.world.rot.y + (s16)this->headRotation.y)) * 10.0f; + effectPos.z += Math_CosS(this->actor.world.rot.y + (s16)this->headRot.y) * 10.0f; Matrix_Push(); Matrix_RotateYS(this->actor.shape.rot.y, MTXMODE_NEW); - effectVelOffset.z = 20.0f; - Matrix_MultVec3f(&effectVelOffset, &effectVel); + effectVelocityOffset.z = 20.0f; + Matrix_MultVec3f(&effectVelocityOffset, &effectVelocity); Matrix_Pop(); if (!this->isPlayerDetected) { s16 effectFlags = SOLDERSRCHBALL_INVISIBLE; @@ -356,8 +354,8 @@ void EnLookNuts_Update(Actor* thisx, PlayState* play) { effectFlags = 0; } if (Player_GetMask(play) != PLAYER_MASK_STONE) { - EffectSsSolderSrchBall_Spawn(play, &effectPos, &effectVel, &gZeroVec3f, 50, &this->isPlayerDetected, - effectFlags); + EffectSsSolderSrchBall_Spawn(play, &effectPos, &effectVelocity, &gZeroVec3f, 50, + &this->isPlayerDetected, effectFlags); } } @@ -369,7 +367,7 @@ void EnLookNuts_Update(Actor* thisx, PlayState* play) { this->state = PALACE_GUARD_RUNNING_TO_PLAYER; Audio_PlaySfx(NA_SE_SY_FOUND); Player_SetCsActionWithHaltedActors(play, &this->actor, PLAYER_CSACTION_26); - D_80A6862C = 1; + D_80A6862C = true; this->actor.flags |= (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_10); this->actor.gravity = 0.0f; EnLookNuts_DetectedPlayer(this, play); @@ -378,9 +376,9 @@ void EnLookNuts_Update(Actor* thisx, PlayState* play) { } } } - Math_ApproachF(&this->headRotation.x, this->headRotTarget.x, 1.0f, 3000.0f); - Math_ApproachF(&this->headRotation.y, this->headRotTarget.y, 1.0f, 6000.0f); - Math_ApproachF(&this->headRotation.z, this->headRotTarget.z, 1.0f, 2000.0f); + Math_ApproachF(&this->headRot.x, this->headRotTarget.x, 1.0f, 3000.0f); + Math_ApproachF(&this->headRot.y, this->headRotTarget.y, 1.0f, 6000.0f); + Math_ApproachF(&this->headRot.z, this->headRotTarget.z, 1.0f, 2000.0f); this->actor.shape.rot.y = this->actor.world.rot.y; Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base); diff --git a/src/overlays/actors/ovl_En_Look_Nuts/z_en_look_nuts.h b/src/overlays/actors/ovl_En_Look_Nuts/z_en_look_nuts.h index 1cce177d4f..6f600f1e84 100644 --- a/src/overlays/actors/ovl_En_Look_Nuts/z_en_look_nuts.h +++ b/src/overlays/actors/ovl_En_Look_Nuts/z_en_look_nuts.h @@ -32,8 +32,8 @@ typedef struct EnLookNuts { /* 0x222 */ s16 isPlayerDetected; /* 0x224 */ s16 waitTimer; // Timer for how long the deku guard will take a break for /* 0x226 */ s16 spawnIndex; - /* 0x228 */ UNK_TYPE4 pad228; // Unused necessary padding - /* 0x22C */ Vec3f headRotation; + /* 0x228 */ UNK_TYPE1 pad228[0x4]; + /* 0x22C */ Vec3f headRot; /* 0x238 */ Vec3f headRotTarget; // Target value for head rotation /* 0x244 */ ColliderCylinder collider; } EnLookNuts; // size = 0x290 diff --git a/src/overlays/actors/ovl_En_Ma4/z_en_ma4.c b/src/overlays/actors/ovl_En_Ma4/z_en_ma4.c index 5a2bf494af..e58c6e536b 100644 --- a/src/overlays/actors/ovl_En_Ma4/z_en_ma4.c +++ b/src/overlays/actors/ovl_En_Ma4/z_en_ma4.c @@ -686,7 +686,7 @@ void EnMa4_DialogueHandler(EnMa4* this, PlayState* play) { } if (this->type != MA4_TYPE_ALIENS_WON) { - Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 5, 2000, 1000); + Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 5, 0x7D0, 0x3E8); } } diff --git a/src/overlays/actors/ovl_En_Mk/z_en_mk.c b/src/overlays/actors/ovl_En_Mk/z_en_mk.c index e6339d197e..95a0201fb3 100644 --- a/src/overlays/actors/ovl_En_Mk/z_en_mk.c +++ b/src/overlays/actors/ovl_En_Mk/z_en_mk.c @@ -457,7 +457,7 @@ void func_80959E18(EnMk* this, PlayState* play) { void EnMk_Update(Actor* thisx, PlayState* play) { s32 pad; EnMk* this = THIS; - Vec3s sp38; + Vec3s torsoRot; Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); @@ -467,10 +467,10 @@ void EnMk_Update(Actor* thisx, PlayState* play) { this->actionFunc(this, play); if ((this->unk_27A & 1) && !Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_127)) { - Actor_TrackPlayer(play, &this->actor, &this->unk_270, &sp38, this->actor.focus.pos); + Actor_TrackPlayer(play, &this->actor, &this->headRot, &torsoRot, this->actor.focus.pos); } else { - Math_SmoothStepToS(&this->unk_270.x, 0, 6, 0x1838, 0x64); - Math_SmoothStepToS(&this->unk_270.y, 0, 6, 0x1838, 0x64); + Math_SmoothStepToS(&this->headRot.x, 0, 6, 0x1838, 0x64); + Math_SmoothStepToS(&this->headRot.y, 0, 6, 0x1838, 0x64); } } @@ -478,8 +478,8 @@ s32 EnMk_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* po EnMk* this = THIS; if (limbIndex == MARINE_RESEARCHER_LIMB_HEAD) { - rot->y -= this->unk_270.y; - rot->z += this->unk_270.x; + rot->y -= this->headRot.y; + rot->z += this->headRot.x; } return false; } diff --git a/src/overlays/actors/ovl_En_Mk/z_en_mk.h b/src/overlays/actors/ovl_En_Mk/z_en_mk.h index d41ad811ad..245b32b88a 100644 --- a/src/overlays/actors/ovl_En_Mk/z_en_mk.h +++ b/src/overlays/actors/ovl_En_Mk/z_en_mk.h @@ -14,7 +14,7 @@ typedef struct EnMk { /* 0x190 */ SkelAnime skelAnime; /* 0x1D4 */ Vec3s jointTable[MARINE_RESEARCHER_LIMB_MAX]; /* 0x222 */ Vec3s morphTable[MARINE_RESEARCHER_LIMB_MAX]; - /* 0x270 */ Vec3s unk_270; + /* 0x270 */ Vec3s headRot; /* 0x276 */ s16 csIdList[2]; /* 0x27A */ u16 unk_27A; /* 0x27C */ s16 animIndex; diff --git a/src/overlays/actors/ovl_En_Mm/z_en_mm.c b/src/overlays/actors/ovl_En_Mm/z_en_mm.c index b4987c6635..20afd77ccc 100644 --- a/src/overlays/actors/ovl_En_Mm/z_en_mm.c +++ b/src/overlays/actors/ovl_En_Mm/z_en_mm.c @@ -193,7 +193,7 @@ void func_8096611C(EnMm* this, PlayState* play) { } else { Math_Vec3f_ToVec3s(&this->actor.home.rot, &this->actor.parent->world.pos); } - Math_ScaledStepToS(&this->unk_190, 0, 2000); + Math_ScaledStepToS(&this->unk_190, 0, 0x7D0); } void EnMm_Update(Actor* thisx, PlayState* play) { diff --git a/src/overlays/actors/ovl_En_Mm3/z_en_mm3.c b/src/overlays/actors/ovl_En_Mm3/z_en_mm3.c index cdaec2a4b9..cd177b8084 100644 --- a/src/overlays/actors/ovl_En_Mm3/z_en_mm3.c +++ b/src/overlays/actors/ovl_En_Mm3/z_en_mm3.c @@ -147,10 +147,10 @@ void func_80A6F2C8(EnMm3* this, PlayState* play) { Actor_OfferTalk(&this->actor, play, 100.0f); } - Math_SmoothStepToS(&this->unk_2A0.x, 0, 5, 0x1000, 0x100); - Math_SmoothStepToS(&this->unk_2A0.y, 0, 5, 0x1000, 0x100); - Math_SmoothStepToS(&this->unk_2A6.x, 0, 5, 0x1000, 0x100); - Math_SmoothStepToS(&this->unk_2A6.y, 0, 5, 0x1000, 0x100); + Math_SmoothStepToS(&this->headRot.x, 0, 5, 0x1000, 0x100); + Math_SmoothStepToS(&this->headRot.y, 0, 5, 0x1000, 0x100); + Math_SmoothStepToS(&this->torsoRot.x, 0, 5, 0x1000, 0x100); + Math_SmoothStepToS(&this->torsoRot.y, 0, 5, 0x1000, 0x100); } void func_80A6F3B4(EnMm3* this, PlayState* play) { @@ -551,7 +551,7 @@ void EnMm3_Update(Actor* thisx, PlayState* play) { SkelAnime_Update(&this->skelAnime); if (this->unk_2B0 & 1) { - Actor_TrackPlayer(play, &this->actor, &this->unk_2A0, &this->unk_2A6, this->actor.focus.pos); + Actor_TrackPlayer(play, &this->actor, &this->headRot, &this->torsoRot, this->actor.focus.pos); } Collider_UpdateCylinder(&this->actor, &this->collider); @@ -562,11 +562,11 @@ s32 EnMm3_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* p EnMm3* this = THIS; if (limbIndex == OBJECT_MM_LIMB_08) { - rot->x += this->unk_2A6.y; - rot->y -= this->unk_2A6.x; + rot->x += this->torsoRot.y; + rot->y -= this->torsoRot.x; } else if (limbIndex == OBJECT_MM_LIMB_0F) { - rot->x += this->unk_2A0.y; - rot->z += this->unk_2A0.x; + rot->x += this->headRot.y; + rot->z += this->headRot.x; if ((this->unk_2B0 & 2) && ((play->gameplayFrames % 3) == 0)) { Matrix_Translate(40.0f, 0.0f, 0.0f, MTXMODE_APPLY); } diff --git a/src/overlays/actors/ovl_En_Mm3/z_en_mm3.h b/src/overlays/actors/ovl_En_Mm3/z_en_mm3.h index 42528fdf4d..5e0e8e70e8 100644 --- a/src/overlays/actors/ovl_En_Mm3/z_en_mm3.h +++ b/src/overlays/actors/ovl_En_Mm3/z_en_mm3.h @@ -22,8 +22,8 @@ typedef struct EnMm3 { /* 0x1DC */ s32 unk_1DC; /* 0x1E0 */ Vec3s jointTable[OBJECT_MM_LIMB_MAX]; /* 0x240 */ Vec3s morphTable[OBJECT_MM_LIMB_MAX]; - /* 0x2A0 */ Vec3s unk_2A0; - /* 0x2A6 */ Vec3s unk_2A6; + /* 0x2A0 */ Vec3s headRot; + /* 0x2A6 */ Vec3s torsoRot; /* 0x2AC */ s16 unk_2AC; /* 0x2AE */ s16 unk_2AE; /* 0x2B0 */ u16 unk_2B0; diff --git a/src/overlays/actors/ovl_En_Muto/z_en_muto.c b/src/overlays/actors/ovl_En_Muto/z_en_muto.c index 082d19d29a..305badbef0 100644 --- a/src/overlays/actors/ovl_En_Muto/z_en_muto.c +++ b/src/overlays/actors/ovl_En_Muto/z_en_muto.c @@ -135,17 +135,17 @@ void EnMuto_SetHeadRotation(EnMuto* this) { } void EnMuto_SetupIdle(EnMuto* this) { - EnMuto_ChangeAnim(this, 0); + EnMuto_ChangeAnim(this, ENMUTO_ANIM_0); this->isInDialogue = false; this->actionFunc = EnMuto_Idle; } void EnMuto_Idle(EnMuto* this, PlayState* play) { - Player* player; this->actor.textId = sTextIds[this->textIdIndex]; if (!this->isInMayorsRoom) { - player = GET_PLAYER(play); + Player* player = GET_PLAYER(play); + if (player->transformation == PLAYER_FORM_DEKU) { if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_88_08)) { this->actor.textId = 0x62C; @@ -155,9 +155,6 @@ void EnMuto_Idle(EnMuto* this, PlayState* play) { } } - //! FAKE: - if (1) {} - if (!this->isInMayorsRoom && (Player_GetMask(play) == PLAYER_MASK_KAFEIS_MASK)) { this->actor.textId = 0x2363; } diff --git a/src/overlays/actors/ovl_En_Nb/z_en_nb.c b/src/overlays/actors/ovl_En_Nb/z_en_nb.c index 7427112866..04a76a05de 100644 --- a/src/overlays/actors/ovl_En_Nb/z_en_nb.c +++ b/src/overlays/actors/ovl_En_Nb/z_en_nb.c @@ -16,15 +16,8 @@ void EnNb_Destroy(Actor* thisx, PlayState* play); void EnNb_Update(Actor* thisx, PlayState* play); void EnNb_Draw(Actor* thisx, PlayState* play); -void EnNb_FollowSchedule(EnNb* this, PlayState* play); void func_80BC0EAC(EnNb* this, PlayState* play); -void func_80BC08E0(EnNb* this, PlayState* play); -void func_80BC0978(EnNb* this, PlayState* play); - -s32 func_80BC00AC(Actor* thisx, PlayState* play); -s32 func_80BC01DC(Actor* thisx, PlayState* play); - #define EN_NB_FLAG_NONE (0) #define EN_NB_FLAG_8 (1 << 3) #define EN_NB_FLAG_10 (1 << 4) diff --git a/src/overlays/actors/ovl_En_Nimotsu/z_en_nimotsu.c b/src/overlays/actors/ovl_En_Nimotsu/z_en_nimotsu.c index bb6e1d004c..eb7654a5bc 100644 --- a/src/overlays/actors/ovl_En_Nimotsu/z_en_nimotsu.c +++ b/src/overlays/actors/ovl_En_Nimotsu/z_en_nimotsu.c @@ -16,8 +16,6 @@ void EnNimotsu_Destroy(Actor* thisx, PlayState* play); void EnNimotsu_Update(Actor* thisx, PlayState* play); void EnNimotsu_Draw(Actor* thisx, PlayState* play); -void EnNimotsu_UpdateCollision(EnNimotsu* this, PlayState* play); - ActorInit En_Nimotsu_InitVars = { /**/ ACTOR_EN_NIMOTSU, /**/ ACTORCAT_PROP, diff --git a/src/overlays/actors/ovl_En_Niw/z_en_niw.c b/src/overlays/actors/ovl_En_Niw/z_en_niw.c index 6b07f8e06d..2d2b4e4b94 100644 --- a/src/overlays/actors/ovl_En_Niw/z_en_niw.c +++ b/src/overlays/actors/ovl_En_Niw/z_en_niw.c @@ -15,22 +15,18 @@ void EnNiw_Init(Actor* thisx, PlayState* play); void EnNiw_Destroy(Actor* thisx, PlayState* play); void EnNiw_Update(Actor* thisx, PlayState* play2); void EnNiw_Draw(Actor* thisx, PlayState* play); + void EnNiw_SetupIdle(EnNiw* this); void EnNiw_Idle(EnNiw* this, PlayState* play); void EnNiw_Thrown(EnNiw* this, PlayState* play); void EnNiw_SetupRunAway(EnNiw* this); void EnNiw_RunAway(EnNiw* this, PlayState* play); -void EnNiw_Swimming(EnNiw* this, PlayState* play); -void EnNiw_Trigger(EnNiw* this, PlayState* play); void EnNiw_Upset(EnNiw* this, PlayState* play); void EnNiw_SetupCuccoStorm(EnNiw* this, PlayState* play); void EnNiw_CuccoStorm(EnNiw* this, PlayState* play); -void EnNiw_SpawnAttackNiw(EnNiw* this, PlayState* play); void EnNiw_Held(EnNiw* this, PlayState* play); void EnNiw_UpdateFeather(EnNiw* this, PlayState* play); void EnNiw_DrawFeathers(EnNiw* this, PlayState* play); -void EnNiw_CheckRage(EnNiw* this, PlayState* play); -void EnNiw_AnimateWingHead(EnNiw* this, PlayState* play, s16 animationState); void EnNiw_SpawnFeather(EnNiw* this, Vec3f* pos, Vec3f* velocity, Vec3f* accel, f32 scale); s16 sCuccoStormActive = false; diff --git a/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c b/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c index 2ae1df1a4c..6694cef89b 100644 --- a/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c +++ b/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c @@ -21,10 +21,8 @@ void EnOssan_Update(Actor* thisx, PlayState* play); void EnOssan_CuriosityShopMan_Draw(Actor* thisx, PlayState* play); void EnOssan_PartTimer_Draw(Actor* thisx, PlayState* play); -void EnOssan_CuriosityShopMan_Init(EnOssan* this, PlayState* play); u16 EnOssan_CuriosityShopMan_GetWelcome(EnOssan* this, PlayState* play); -void EnOssan_PartTimer_Init(EnOssan* this, PlayState* play); u16 EnOssan_PartTimer_GetWelcome(EnOssan* this, PlayState* play); void EnOssan_InitShop(EnOssan* this, PlayState* play); @@ -240,11 +238,11 @@ void EnOssan_RotateHead(EnOssan* this, PlayState* play) { if (this->actor.params == ENOSSAN_PART_TIME_WORKER) { if (player->transformation == PLAYER_FORM_ZORA) { - Math_SmoothStepToS(&this->partTimerHeadRot.y, this->headRot.y, 3, 2000, 0); + Math_SmoothStepToS(&this->partTimerHeadRot.y, this->headRot.y, 3, 0x7D0, 0); } else if (this->flags & LOOKED_AT_PLAYER) { - Math_SmoothStepToS(&this->partTimerHeadRot.y, 8000, 3, 2000, 0); + Math_SmoothStepToS(&this->partTimerHeadRot.y, 0x1F40, 3, 0x7D0, 0); } else { - Math_SmoothStepToS(&this->partTimerHeadRot.y, this->headRot.y, 3, 2000, 0); + Math_SmoothStepToS(&this->partTimerHeadRot.y, this->headRot.y, 3, 0x7D0, 0); if (ABS_ALT(this->partTimerHeadRot.y - this->headRot.y) < 16) { this->flags |= LOOKED_AT_PLAYER; } @@ -387,7 +385,7 @@ void EnOssan_Idle(EnOssan* this, PlayState* play) { Actor_OfferTalk(&this->actor, play, 100.0f); } if (this->actor.params == ENOSSAN_PART_TIME_WORKER) { - Math_SmoothStepToS(&this->partTimerHeadRot.y, 8000, 3, 2000, 0); + Math_SmoothStepToS(&this->partTimerHeadRot.y, 0x1F40, 3, 0x7D0, 0); } } } @@ -672,7 +670,7 @@ void EnOssan_FaceShopkeeper(EnOssan* this, PlayState* play) { } } if ((this->actor.params == ENOSSAN_PART_TIME_WORKER) && (player->transformation != PLAYER_FORM_ZORA)) { - Math_SmoothStepToS(&this->partTimerHeadRot.y, 8000, 3, 2000, 0); + Math_SmoothStepToS(&this->partTimerHeadRot.y, 0x1F40, 3, 0x7D0, 0); } } } @@ -1600,7 +1598,7 @@ void EnOssan_Update(Actor* thisx, PlayState* play) { EnOssan_UpdateItemSelectedProperty(this); EnOssan_UpdateStickDirectionPromptAnim(this); EnOssan_UpdateCursorAnim(this); - Actor_TrackPlayer(play, &this->actor, &this->headRot, &this->unk2CC, this->actor.focus.pos); + Actor_TrackPlayer(play, &this->actor, &this->headRot, &this->torsoRot, this->actor.focus.pos); this->actionFunc(this, play); Actor_SetFocus(&this->actor, 90.0f); SkelAnime_Update(&this->skelAnime); diff --git a/src/overlays/actors/ovl_En_Ossan/z_en_ossan.h b/src/overlays/actors/ovl_En_Ossan/z_en_ossan.h index 02c44818f1..4c298cfc20 100644 --- a/src/overlays/actors/ovl_En_Ossan/z_en_ossan.h +++ b/src/overlays/actors/ovl_En_Ossan/z_en_ossan.h @@ -51,7 +51,7 @@ typedef struct EnOssan { /* 0x2C2 */ s16 cutsceneState; /* 0x2C4 */ u16 textId; /* 0x2C6 */ Vec3s headRot; - /* 0x2CC */ Vec3s unk2CC; // Set but never used + /* 0x2CC */ Vec3s torsoRot; // Set but never used /* 0x2D2 */ s16 fidgetTableY[ENOSSAN_LIMB_MAX]; /* 0x2F8 */ s16 fidgetTableZ[ENOSSAN_LIMB_MAX]; /* 0x31E */ Vec3s jointTable[ENOSSAN_LIMB_MAX]; diff --git a/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c b/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c index b7c3b465ca..eee28d1639 100644 --- a/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c +++ b/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c @@ -336,7 +336,7 @@ void func_808976DC(EnPeehat* this, PlayState* play) { Math_StepToF(&this->actor.shape.yOffset, 0.0f, 50.0f); - if (Math_ScaledStepToS(&this->unk_2B2, 4000, 800)) { + if (Math_ScaledStepToS(&this->unk_2B2, 0xFA0, 0x320)) { if (this->unk_2B0 != 0) { this->unk_2B0--; if ((this->unk_2B0 == 0) && (this->skelAnime.playSpeed < 0.5f)) { @@ -383,13 +383,13 @@ void func_80897910(EnPeehat* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); if (!gSaveContext.save.isNight && (Math_Vec3f_DistXZ(&this->actor.home.pos, &player->actor.world.pos) < 1200.0f)) { - Math_ScaledStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 1000); + Math_ScaledStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 0x3E8); this->actor.shape.rot.y += (s16)(this->unk_2AD * 450); } else { func_80898124(this); } - Math_ScaledStepToS(&this->unk_2B2, 4000, 500); + Math_ScaledStepToS(&this->unk_2B2, 0xFA0, 0x1F4); this->unk_2B4 += this->unk_2B2; Math_StepToF(&this->unk_2C4, 0.075f, 0.005f); Actor_PlaySfx_Flagged(&this->actor, NA_SE_EN_PIHAT_FLY - SFX_FLAG); @@ -425,7 +425,7 @@ void func_80897A94(EnPeehat* this, PlayState* play) { this->actor.shape.rot.y += 0x15E; SkelAnime_Update(&this->skelAnime); - Math_ScaledStepToS(&this->unk_2B2, 4000, 500); + Math_ScaledStepToS(&this->unk_2B2, 0xFA0, 0x1F4); this->unk_2B4 += this->unk_2B2; Math_StepToF(&this->unk_2C4, 0.075f, 0.005f); Actor_PlaySfx_Flagged(&this->actor, NA_SE_EN_PIHAT_SM_FLY - SFX_FLAG); @@ -472,7 +472,7 @@ void func_80897D48(EnPeehat* this, PlayState* play) { Math_StepToF(&this->actor.shape.yOffset, -1000.0f, 50.0f); Math_StepToF(&this->actor.speed, 0.0f, 1.0f); - Math_ScaledStepToS(&this->actor.shape.rot.x, 0, 50); + Math_ScaledStepToS(&this->actor.shape.rot.x, 0, 0x32); if (SkelAnime_Update(&this->skelAnime)) { func_80897498(this); @@ -487,7 +487,7 @@ void func_80897D48(EnPeehat* this, PlayState* play) { func_80897258(play, this, &sp34, 75.0f, 2.0f); } } - Math_ScaledStepToS(&this->unk_2B2, 0, 100); + Math_ScaledStepToS(&this->unk_2B2, 0, 0x64); this->unk_2B4 += this->unk_2B2; } @@ -531,7 +531,7 @@ void func_80897F44(EnPeehat* this, PlayState* play) { func_80898124(this); } - Math_ScaledStepToS(&this->unk_2B2, 4000, 500); + Math_ScaledStepToS(&this->unk_2B2, 0xFA0, 0x1F4); this->unk_2B4 += this->unk_2B2; Math_StepToF(&this->unk_2C4, 0.075f, 0.005f); Actor_PlaySfx_Flagged(&this->actor, NA_SE_EN_PIHAT_FLY - SFX_FLAG); @@ -626,7 +626,7 @@ void func_80898454(EnPeehat* this, PlayState* play) { void func_808984E0(EnPeehat* this) { Animation_MorphToPlayOnce(&this->skelAnime, &object_ph_Anim_000844, -4.0f); Actor_PlaySfx(&this->actor, NA_SE_EN_PIHAT_DAMAGE); - this->unk_2B2 = 4000; + this->unk_2B2 = 0xFA0; this->unk_2B0 = 14; this->actor.speed = 10.0f; Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_OPA, 14); @@ -641,7 +641,7 @@ void func_808984E0(EnPeehat* this) { void func_80898594(EnPeehat* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); this->unk_2B4 += this->unk_2B2; - Math_ScaledStepToS(&this->unk_2B2, 4000, 250); + Math_ScaledStepToS(&this->unk_2B2, 0xFA0, 0xFA); Math_StepToF(&this->actor.world.pos.y, this->actor.floorHeight + 88.5f, 3.0f); Math_StepToF(&this->actor.speed, 0.0f, 0.5f); this->unk_2B0--; @@ -765,9 +765,9 @@ void EnPeehat_Update(Actor* thisx, PlayState* play2) { this->unk_2BC += this->unk_2C0; if (thisx->params == 0) { if (this->actionFunc == func_80897910) { - Math_ScaledStepToS(&thisx->shape.rot.x, 6000, 300); + Math_ScaledStepToS(&thisx->shape.rot.x, 0x1770, 0x12C); } else { - Math_ScaledStepToS(&thisx->shape.rot.x, 0, 300); + Math_ScaledStepToS(&thisx->shape.rot.x, 0, 0x12C); } } else { Actor_SetFocus(thisx, 0.0f); diff --git a/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c b/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c index 728e925152..ca8cc4deee 100644 --- a/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c +++ b/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c @@ -680,12 +680,12 @@ void EnPoSisters_DeathStage1(EnPoSisters* this, PlayState* play) { this->firePos[end] = this->firePos[end - 1]; } - this->firePos[0].x = (Math_SinS((this->actor.shape.rot.y + (this->deathTimer * 0x3000)) - 0x4000) * - (3000.0f * this->actor.scale.x)) + - this->actor.world.pos.x; - this->firePos[0].z = (Math_CosS((this->actor.shape.rot.y + (this->deathTimer * 0x3000)) - 0x4000) * - (3000.0f * this->actor.scale.x)) + - this->actor.world.pos.z; + this->firePos[0].x = + this->actor.world.pos.x + + (Math_SinS((this->actor.shape.rot.y + (this->deathTimer * 0x3000)) - 0x4000) * (3000.0f * this->actor.scale.x)); + this->firePos[0].z = + this->actor.world.pos.z + + (Math_CosS((this->actor.shape.rot.y + (this->deathTimer * 0x3000)) - 0x4000) * (3000.0f * this->actor.scale.x)); if (this->deathTimer < 8) { this->firePos[0].y = this->firePos[1].y - 9.0f; diff --git a/src/overlays/actors/ovl_En_Pr/z_en_pr.c b/src/overlays/actors/ovl_En_Pr/z_en_pr.c index 9cfccb8ba6..4f0b4e69cf 100644 --- a/src/overlays/actors/ovl_En_Pr/z_en_pr.c +++ b/src/overlays/actors/ovl_En_Pr/z_en_pr.c @@ -366,7 +366,7 @@ void func_80A32B20(EnPr* this, PlayState* play) { Player* player = GET_PLAYER(play); this->actor.speed = BREG(57) + 3.0f; - Math_SmoothStepToS(&this->unk_22C, this->actor.yawTowardsPlayer, BREG(49) + 1, BREG(50) + 1000, BREG(51)); + Math_SmoothStepToS(&this->unk_22C, this->actor.yawTowardsPlayer, 1 + BREG(49), 0x3E8 + BREG(50), BREG(51)); this->unk_2B8 = D_80A338C0[GET_PLAYER_FORM] + player->actor.world.pos.y; func_80A324E0(this, play); @@ -402,7 +402,7 @@ void func_80A32D28(EnPr* this, PlayState* play) { this->actor.speed = 1.0f; func_80A32854(this); } else { - Math_SmoothStepToS(&this->unk_22C, this->actor.yawTowardsPlayer, BREG(49) + 1, BREG(50) + 1000, BREG(51)); + Math_SmoothStepToS(&this->unk_22C, this->actor.yawTowardsPlayer, 1 + BREG(49), 0x3E8 + BREG(50), BREG(51)); func_80A325E4(this); this->unk_2B8 = D_80A338C0[GET_PLAYER_FORM] + player->actor.world.pos.y; func_80A324E0(this, play); @@ -552,9 +552,9 @@ void EnPr_Update(Actor* thisx, PlayState* play) { pitch = Math_Vec3f_Pitch(&this->actor.world.pos, &sp50) * 0.3f; if (fabsf(this->actor.world.pos.y - this->unk_2B8) > 8.0f) { - Math_SmoothStepToS(&this->actor.world.rot.x, pitch, 1, BREG(48) + 500, 0); + Math_SmoothStepToS(&this->actor.world.rot.x, pitch, 1, 0x1F4 + BREG(48), 0); } else { - Math_SmoothStepToS(&this->actor.world.rot.x, 0, 1, BREG(52) + 500, 0); + Math_SmoothStepToS(&this->actor.world.rot.x, 0, 1, 0x1F4 + BREG(52), 0); } } diff --git a/src/overlays/actors/ovl_En_Pr2/z_en_pr2.c b/src/overlays/actors/ovl_En_Pr2/z_en_pr2.c index a3b96c367f..8eb362aaa5 100644 --- a/src/overlays/actors/ovl_En_Pr2/z_en_pr2.c +++ b/src/overlays/actors/ovl_En_Pr2/z_en_pr2.c @@ -239,9 +239,9 @@ void func_80A7436C(EnPr2* this, s16 arg1) { if (fabsf(this->actor.world.pos.y - this->unk_21C.y) > 10.0f) { Math_SmoothStepToS(&this->actor.world.rot.x, Math_Vec3f_Pitch(&this->actor.world.pos, &this->unk_21C) * 0.3f, - 20, 5000, 500); + 20, 0x1388, 0x1F4); } else { - Math_SmoothStepToS(&this->actor.world.rot.x, 0, 20, 5000, 500); + Math_SmoothStepToS(&this->actor.world.rot.x, 0, 20, 0x1388, 0x1F4); } if (fabsf(this->actor.world.rot.y - arg1) < 30.0f) { @@ -250,7 +250,7 @@ void func_80A7436C(EnPr2* this, s16 arg1) { Math_ApproachF(&this->unk_1FC, sp2E, 0.5f, 3000.0f); } - Math_SmoothStepToS(&this->actor.world.rot.y, arg1, 1, 2000, 300); + Math_SmoothStepToS(&this->actor.world.rot.y, arg1, 1, 0x7D0, 300); } void EnPr2_ChangeAnim(EnPr2* this, s32 animIndex) { @@ -298,9 +298,9 @@ void func_80A745FC(EnPr2* this, PlayState* play) { if (fabsf(this->actor.world.pos.y - this->unk_21C.y) > 10.0f) { Math_SmoothStepToS(&this->actor.world.rot.x, Math_Vec3f_Pitch(&this->actor.world.pos, &this->unk_21C) * 0.3f, - 20, 5000, 500); + 20, 0x1388, 0x1F4); } else { - Math_SmoothStepToS(&this->actor.world.rot.x, 0, 20, 5000, 500); + Math_SmoothStepToS(&this->actor.world.rot.x, 0, 20, 0x1388, 0x1F4); } x = this->actor.world.pos.x - this->unk_21C.x; @@ -424,7 +424,7 @@ void func_80A748E8(EnPr2* this, PlayState* play) { this->unk_1F0 += 0x2000; } } else { - Math_SmoothStepToS(&this->unk_1F0, 0, 1, 1000, 100); + Math_SmoothStepToS(&this->unk_1F0, 0, 1, 0x3E8, 0x64); this->unk_1F2 = 0; } } @@ -583,9 +583,9 @@ void func_80A75310(EnPr2* this, PlayState* play) { Vec3f sp64; temp = false; - Math_SmoothStepToS(&this->actor.shape.rot.x, 0, 5, 10000, 1000); - Math_SmoothStepToS(&this->actor.shape.rot.z, this->unk_1E4, 5, 10000, 1000); - Math_SmoothStepToS(&this->actor.shape.rot.y, this->unk_1E6, 5, 10000, 1000); + Math_SmoothStepToS(&this->actor.shape.rot.x, 0, 5, 0x2710, 0x3E8); + Math_SmoothStepToS(&this->actor.shape.rot.z, this->unk_1E4, 5, 0x2710, 0x3E8); + Math_SmoothStepToS(&this->actor.shape.rot.y, this->unk_1E6, 5, 0x2710, 0x3E8); if ((Rand_ZeroOne() < 0.3f) && !this->unk_1D6) { this->unk_1D6 = true; diff --git a/src/overlays/actors/ovl_En_Railgibud/z_en_railgibud.c b/src/overlays/actors/ovl_En_Railgibud/z_en_railgibud.c index 036a074c13..87136e51b1 100644 --- a/src/overlays/actors/ovl_En_Railgibud/z_en_railgibud.c +++ b/src/overlays/actors/ovl_En_Railgibud/z_en_railgibud.c @@ -50,29 +50,6 @@ void EnRailgibud_DoNothing(EnRailgibud* this, PlayState* play); void EnRailgibud_SinkIntoGround(EnRailgibud* this, PlayState* play); void EnRailgibud_Cutscene_Update(Actor* thisx, PlayState* play); -typedef enum { - /* 0 */ EN_RAILGIBUD_ANIM_GRAB_ATTACK, - /* 1 */ EN_RAILGIBUD_ANIM_GRAB_END, - /* 2 */ EN_RAILGIBUD_ANIM_GRAB_START, - /* 3 */ EN_RAILGIBUD_ANIM_LOOK_BACK, - /* 4 */ EN_RAILGIBUD_ANIM_CROUCH_WIPING_TEARS, - /* 5 */ EN_RAILGIBUD_ANIM_CROUCH_CRYING, - /* 6 */ EN_RAILGIBUD_ANIM_DEATH, - /* 7 */ EN_RAILGIBUD_ANIM_DAMAGE, - /* 8 */ EN_RAILGIBUD_ANIM_CROUCH_END, - /* 9 */ EN_RAILGIBUD_ANIM_IDLE, - /* 10 */ EN_RAILGIBUD_ANIM_WALK, - /* 11 */ EN_RAILGIBUD_ANIM_DANCE_SQUAT, - /* 12 */ EN_RAILGIBUD_ANIM_DANCE_PIROUETTE, - /* 13 */ EN_RAILGIBUD_ANIM_DANCE_CLAP, - /* 14 */ EN_RAILGIBUD_ANIM_CROUCH_END_2, - /* 15 */ EN_RAILGIBUD_ANIM_SLUMP_START, - /* 16 */ EN_RAILGIBUD_ANIM_SLUMP_LOOP, - /* 17 */ EN_RAILGIBUD_ANIM_CONVULSION, - /* 18 */ EN_RAILGIBUD_ANIM_ARMS_UP_START, - /* 19 */ EN_RAILGIBUD_ANIM_ARMS_UP_LOOP -} EnRailgibudAnimation; - typedef enum { /* 0 */ EN_RAILGIBUD_TYPE_GIBDO, /* 1 */ EN_RAILGIBUD_TYPE_REDEAD @@ -96,27 +73,51 @@ ActorInit En_Railgibud_InitVars = { /**/ EnRailgibud_Draw, }; -static AnimationInfo sAnimationInfo[] = { - { &gGibdoRedeadGrabAttackAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f }, - { &gGibdoRedeadGrabEndAnim, 0.5f, 0.0f, 0.0f, ANIMMODE_ONCE_INTERP, 0.0f }, - { &gGibdoRedeadGrabStartAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -8.0f }, - { &gGibdoRedeadLookBackAnim, 0.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -8.0f }, - { &gGibdoRedeadWipingTearsAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -8.0f }, - { &gGibdoRedeadSobbingAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f }, - { &gGibdoRedeadDeathAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -8.0f }, - { &gGibdoRedeadDamageAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -8.0f }, - { &gGibdoRedeadStandUpAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -8.0f }, - { &gGibdoRedeadIdleAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f }, - { &gGibdoRedeadWalkAnim, 0.4f, 0.0f, 0.0f, ANIMMODE_LOOP_INTERP, -8.0f }, - { &gGibdoRedeadSquattingDanceAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f }, - { &gGibdoRedeadPirouetteAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f }, - { &gGibdoRedeadClappingDanceAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f }, - { &gGibdoRedeadStandUpAnim, 3.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -6.0f }, - { &gGibdoRedeadSlumpStartAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -8.0f }, - { &gGibdoRedeadSlumpLoopAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f }, - { &gGibdoRedeadConvulsionAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f }, - { &gGibdoRedeadArmsUpStartAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -8.0f }, - { &gGibdoRedeadArmsUpLoopAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f }, +typedef enum EnRailgibudAnimation { + /* 0 */ EN_RAILGIBUD_ANIM_GRAB_ATTACK, + /* 1 */ EN_RAILGIBUD_ANIM_GRAB_END, + /* 2 */ EN_RAILGIBUD_ANIM_GRAB_START, + /* 3 */ EN_RAILGIBUD_ANIM_LOOK_BACK, + /* 4 */ EN_RAILGIBUD_ANIM_CROUCH_WIPING_TEARS, + /* 5 */ EN_RAILGIBUD_ANIM_CROUCH_CRYING, + /* 6 */ EN_RAILGIBUD_ANIM_DEATH, + /* 7 */ EN_RAILGIBUD_ANIM_DAMAGE, + /* 8 */ EN_RAILGIBUD_ANIM_CROUCH_END, + /* 9 */ EN_RAILGIBUD_ANIM_IDLE, + /* 10 */ EN_RAILGIBUD_ANIM_WALK, + /* 11 */ EN_RAILGIBUD_ANIM_DANCE_SQUAT, + /* 12 */ EN_RAILGIBUD_ANIM_DANCE_PIROUETTE, + /* 13 */ EN_RAILGIBUD_ANIM_DANCE_CLAP, + /* 14 */ EN_RAILGIBUD_ANIM_CROUCH_END_2, + /* 15 */ EN_RAILGIBUD_ANIM_SLUMP_START, + /* 16 */ EN_RAILGIBUD_ANIM_SLUMP_LOOP, + /* 17 */ EN_RAILGIBUD_ANIM_CONVULSION, + /* 18 */ EN_RAILGIBUD_ANIM_ARMS_UP_START, + /* 19 */ EN_RAILGIBUD_ANIM_ARMS_UP_LOOP, + /* 20 */ EN_RAILGIBUD_ANIM_MAX +} EnRailgibudAnimation; + +static AnimationInfo sAnimationInfo[EN_RAILGIBUD_ANIM_MAX] = { + { &gGibdoRedeadGrabAttackAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f }, // EN_RAILGIBUD_ANIM_GRAB_ATTACK + { &gGibdoRedeadGrabEndAnim, 0.5f, 0.0f, 0.0f, ANIMMODE_ONCE_INTERP, 0.0f }, // EN_RAILGIBUD_ANIM_GRAB_END + { &gGibdoRedeadGrabStartAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -8.0f }, // EN_RAILGIBUD_ANIM_GRAB_START + { &gGibdoRedeadLookBackAnim, 0.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -8.0f }, // EN_RAILGIBUD_ANIM_LOOK_BACK + { &gGibdoRedeadWipingTearsAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -8.0f }, // EN_RAILGIBUD_ANIM_CROUCH_WIPING_TEARS + { &gGibdoRedeadSobbingAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f }, // EN_RAILGIBUD_ANIM_CROUCH_CRYING + { &gGibdoRedeadDeathAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -8.0f }, // EN_RAILGIBUD_ANIM_DEATH + { &gGibdoRedeadDamageAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -8.0f }, // EN_RAILGIBUD_ANIM_DAMAGE + { &gGibdoRedeadStandUpAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -8.0f }, // EN_RAILGIBUD_ANIM_CROUCH_END + { &gGibdoRedeadIdleAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f }, // EN_RAILGIBUD_ANIM_IDLE + { &gGibdoRedeadWalkAnim, 0.4f, 0.0f, 0.0f, ANIMMODE_LOOP_INTERP, -8.0f }, // EN_RAILGIBUD_ANIM_WALK + { &gGibdoRedeadSquattingDanceAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f }, // EN_RAILGIBUD_ANIM_DANCE_SQUAT + { &gGibdoRedeadPirouetteAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f }, // EN_RAILGIBUD_ANIM_DANCE_PIROUETTE + { &gGibdoRedeadClappingDanceAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f }, // EN_RAILGIBUD_ANIM_DANCE_CLAP + { &gGibdoRedeadStandUpAnim, 3.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -6.0f }, // EN_RAILGIBUD_ANIM_CROUCH_END_2 + { &gGibdoRedeadSlumpStartAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -8.0f }, // EN_RAILGIBUD_ANIM_SLUMP_START + { &gGibdoRedeadSlumpLoopAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f }, // EN_RAILGIBUD_ANIM_SLUMP_LOOP + { &gGibdoRedeadConvulsionAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f }, // EN_RAILGIBUD_ANIM_CONVULSION + { &gGibdoRedeadArmsUpStartAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -8.0f }, // EN_RAILGIBUD_ANIM_ARMS_UP_START + { &gGibdoRedeadArmsUpLoopAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f }, // EN_RAILGIBUD_ANIM_ARMS_UP_LOOP }; static ColliderCylinderInit sCylinderInit = { @@ -139,7 +140,7 @@ static ColliderCylinderInit sCylinderInit = { { 20, 70, 0, { 0, 0, 0 } }, }; -typedef enum { +typedef enum EnRailgibudDamageEffect { /* 0x0 */ EN_RAILGIBUD_DMGEFF_NONE, // Does not interact with the Gibdo/Redead at all /* 0x1 */ EN_RAILGIBUD_DMGEFF_STUN, // Stuns without applying any effect /* 0x2 */ EN_RAILGIBUD_DMGEFF_FIRE_ARROW, // Damages, applies a fire effect, and changes a Gibdo into a Redead @@ -193,29 +194,29 @@ static CollisionCheckInfoInit2 sColChkInfoInit = { 8, 0, 0, 0, MASS_IMMOVABLE }; * point along the path up to a maximum of nine additional Gibdos (not counting itself). */ void EnRailgibud_SpawnOtherGibdosAndSetPositionAndRotation(EnRailgibud* this, PlayState* play) { - static s32 currentGibdoIndex = 0; + static s32 sCurrentGibdoIndex = 0; s32 nextPoint; Vec3f targetPos; Path* path = &play->setupPathList[ENRAILGIBUD_GET_PATH_INDEX(&this->actor)]; this->pathPoints = Lib_SegmentedToVirtual(path->points); - this->currentPoint = currentGibdoIndex; + this->currentPoint = sCurrentGibdoIndex; this->pathCount = path->count; // This branch will only be taken for the first, "main" Gibdo. The subsequent // Gibdos created by Actor_SpawnAsChild will go through this function to set // their position and rotation, but they will not be able to spawn any more - // Gibdos themselves because currentGibdoIndex will be non-zero. - if (currentGibdoIndex == 0) { + // Gibdos themselves because sCurrentGibdoIndex will be non-zero. + if (sCurrentGibdoIndex == 0) { s32 i; - for (i = 1; i < this->pathCount && i < 10; i++) { - currentGibdoIndex++; + for (i = 1; (i < this->pathCount) && (i < 10); i++) { + sCurrentGibdoIndex++; Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_EN_RAILGIBUD, 0.0f, 0.0f, 0.0f, 0, 0, 0, this->actor.params); } - currentGibdoIndex = 0; + sCurrentGibdoIndex = 0; } this->actor.world.pos.x = this->pathPoints[this->currentPoint].x; @@ -305,8 +306,8 @@ void EnRailgibud_WalkInCircles(EnRailgibud* this, PlayState* play) { EnRailgibud_SetupAttemptPlayerFreeze(this); } - Math_SmoothStepToS(&this->headRotation.y, 0, 1, 0x64, 0); - Math_SmoothStepToS(&this->upperBodyRotation.y, 0, 1, 0x64, 0); + Math_SmoothStepToS(&this->headRot.y, 0, 1, 0x64, 0); + Math_SmoothStepToS(&this->torsoRot.y, 0, 1, 0x64, 0); // If we're not supposed to walk forward, then stop here; // don't rotate the Gibdo or move it around. @@ -342,7 +343,7 @@ void EnRailgibud_SetupAttemptPlayerFreeze(EnRailgibud* this) { void EnRailgibud_AttemptPlayerFreeze(EnRailgibud* this, PlayState* play) { Player* player = GET_PLAYER(play); - s16 rot = this->actor.shape.rot.y + this->headRotation.y + this->upperBodyRotation.y; + s16 rot = this->actor.shape.rot.y + this->headRot.y + this->torsoRot.y; s16 yaw = BINANG_SUB(this->actor.yawTowardsPlayer, rot); if (ABS_ALT(yaw) < 0x2008) { @@ -375,8 +376,8 @@ void EnRailgibud_WalkToPlayer(EnRailgibud* this, PlayState* play) { Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0xFA); this->actor.world.rot = this->actor.shape.rot; - Math_SmoothStepToS(&this->headRotation.y, 0, 1, 0x64, 0); - Math_SmoothStepToS(&this->upperBodyRotation.y, 0, 1, 0x64, 0); + Math_SmoothStepToS(&this->headRot.y, 0, 1, 0x64, 0); + Math_SmoothStepToS(&this->torsoRot.y, 0, 1, 0x64, 0); if (EnRailgibud_PlayerInRangeWithCorrectState(this, play) && Actor_IsFacingPlayer(&this->actor, 0x38E3)) { if ((this->grabWaitTimer == 0) && (this->actor.xzDistToPlayer <= 45.0f)) { @@ -500,8 +501,8 @@ void EnRailgibud_GrabFail(EnRailgibud* this, PlayState* play) { } this->actor.world.rot.y = this->actor.yawTowardsPlayer; - Math_SmoothStepToS(&this->headRotation.y, 0, 1, 0x12C, 0); - Math_SmoothStepToS(&this->upperBodyRotation.y, 0, 1, 0x12C, 0); + Math_SmoothStepToS(&this->headRot.y, 0, 1, 0x12C, 0); + Math_SmoothStepToS(&this->torsoRot.y, 0, 1, 0x12C, 0); if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { this->actor.world.rot.y = this->actor.shape.rot.y; EnRailgibud_SetupTurnAwayAndShakeHead(this); @@ -515,14 +516,13 @@ void EnRailgibud_SetupTurnAwayAndShakeHead(EnRailgibud* this) { } void EnRailgibud_TurnAwayAndShakeHead(EnRailgibud* this, PlayState* play) { - Math_SmoothStepToS(&this->actor.world.rot.y, BINANG_ROT180(this->actor.yawTowardsPlayer), 5, 3500, 200); + Math_SmoothStepToS(&this->actor.world.rot.y, BINANG_ROT180(this->actor.yawTowardsPlayer), 5, 0xDAC, 0xC8); this->actor.shape.rot.y = this->actor.world.rot.y; if (this->headShakeTimer > 60) { EnRailgibud_SetupWalkToHome(this); this->playerStunWaitTimer = 0; } else { - this->headRotation.y = - Math_SinS(this->headShakeTimer * 4000) * (0x256F * ((60 - this->headShakeTimer) / 60.0f)); + this->headRot.y = Math_SinS(this->headShakeTimer * 4000) * (0x256F * ((60 - this->headShakeTimer) / 60.0f)); this->headShakeTimer++; } } @@ -534,8 +534,8 @@ void EnRailgibud_SetupWalkToHome(EnRailgibud* this) { } void EnRailgibud_WalkToHome(EnRailgibud* this, PlayState* play) { - Math_SmoothStepToS(&this->headRotation.y, 0, 1, 100, 0); - Math_SmoothStepToS(&this->upperBodyRotation.y, 0, 1, 100, 0); + Math_SmoothStepToS(&this->headRot.y, 0, 1, 0x64, 0); + Math_SmoothStepToS(&this->torsoRot.y, 0, 1, 0x64, 0); if (Actor_WorldDistXZToPoint(&this->actor, &this->actor.home.pos) < 5.0f) { if (this->actor.speed > 0.2f) { this->actor.speed -= 0.2f; @@ -543,7 +543,7 @@ void EnRailgibud_WalkToHome(EnRailgibud* this, PlayState* play) { this->actor.speed = 0.0f; } - Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.home.rot.y, 1, 200, 10); + Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.home.rot.y, 1, 0xC8, 0xA); this->actor.world.rot.y = this->actor.shape.rot.y; if (this->actor.world.rot.y == this->actor.home.rot.y) { EnRailgibud_SetupWalkInCircles(this); @@ -647,8 +647,8 @@ void EnRailgibud_Dead(EnRailgibud* this, PlayState* play) { } } } else { - Math_SmoothStepToS(&this->headRotation.y, 0, 1, 250, 0); - Math_SmoothStepToS(&this->upperBodyRotation.y, 0, 1, 250, 0); + Math_SmoothStepToS(&this->headRot.y, 0, 1, 0xFA, 0); + Math_SmoothStepToS(&this->torsoRot.y, 0, 1, 0xFA, 0); this->deathTimer++; } @@ -725,22 +725,22 @@ void EnRailgibud_UpdateWalkForwardState(EnRailgibud* this) { } void EnRailgibud_TurnTowardsPlayer(EnRailgibud* this, PlayState* play) { - s16 headAngle = (this->actor.yawTowardsPlayer - this->actor.shape.rot.y) - this->upperBodyRotation.y; + s16 headAngle = this->actor.yawTowardsPlayer - this->actor.shape.rot.y - this->torsoRot.y; s16 upperBodyAngle = CLAMP(headAngle, -500, 500); - headAngle -= this->headRotation.y; + headAngle -= this->headRot.y; headAngle = CLAMP(headAngle, -500, 500); if (BINANG_SUB(this->actor.yawTowardsPlayer, this->actor.shape.rot.y) >= 0) { - this->upperBodyRotation.y += ABS_ALT(upperBodyAngle); - this->headRotation.y += ABS_ALT(headAngle); + this->torsoRot.y += ABS_ALT(upperBodyAngle); + this->headRot.y += ABS_ALT(headAngle); } else { - this->upperBodyRotation.y -= ABS_ALT(upperBodyAngle); - this->headRotation.y -= ABS_ALT(headAngle); + this->torsoRot.y -= ABS_ALT(upperBodyAngle); + this->headRot.y -= ABS_ALT(headAngle); } - this->upperBodyRotation.y = CLAMP(this->upperBodyRotation.y, -0x495F, 0x495F); - this->headRotation.y = CLAMP(this->headRotation.y, -0x256F, 0x256F); + this->torsoRot.y = CLAMP(this->torsoRot.y, -0x495F, 0x495F); + this->headRot.y = CLAMP(this->headRot.y, -0x256F, 0x256F); } s32 EnRailgibud_PlayerInRangeWithCorrectState(EnRailgibud* this, PlayState* play) { @@ -1048,9 +1048,9 @@ s32 EnRailgibud_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Ve EnRailgibud* this = THIS; if (limbIndex == GIBDO_LIMB_UPPER_BODY_ROOT) { - rot->y += this->upperBodyRotation.y; + rot->y += this->torsoRot.y; } else if (limbIndex == GIBDO_LIMB_HEAD_ROOT) { - rot->y += this->headRotation.y; + rot->y += this->headRot.y; } return false; diff --git a/src/overlays/actors/ovl_En_Railgibud/z_en_railgibud.h b/src/overlays/actors/ovl_En_Railgibud/z_en_railgibud.h index 1c3304ee08..271206a10b 100644 --- a/src/overlays/actors/ovl_En_Railgibud/z_en_railgibud.h +++ b/src/overlays/actors/ovl_En_Railgibud/z_en_railgibud.h @@ -46,8 +46,8 @@ typedef struct EnRailgibud { /* 0x2A4 */ f32 drawDmgEffScale; /* 0x2A8 */ Vec3s jointTable[GIBDO_LIMB_MAX]; /* 0x344 */ Vec3s morphTable[GIBDO_LIMB_MAX]; - /* 0x3E0 */ Vec3s headRotation; - /* 0x3E6 */ Vec3s upperBodyRotation; + /* 0x3E0 */ Vec3s headRot; + /* 0x3E6 */ Vec3s torsoRot; /* 0x3EC */ s16 shouldWalkForward; // Only used by the "main" Gibdo /* 0x3EE */ s16 shouldWalkForwardNextFrame; // Only used by the "main" Gibdo /* 0x3F0 */ union { diff --git a/src/overlays/actors/ovl_En_Rd/z_en_rd.c b/src/overlays/actors/ovl_En_Rd/z_en_rd.c index 1ec240e41b..5cedc705b2 100644 --- a/src/overlays/actors/ovl_En_Rd/z_en_rd.c +++ b/src/overlays/actors/ovl_En_Rd/z_en_rd.c @@ -25,6 +25,7 @@ #include "z_en_rd.h" #include "z64rumble.h" #include "objects/object_rd/object_rd.h" +#include "overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_UNFRIENDLY | ACTOR_FLAG_10 | ACTOR_FLAG_400) @@ -191,7 +192,7 @@ void EnRd_Init(Actor* thisx, PlayState* play) { this->actor.targetMode = TARGET_MODE_0; this->actor.colChkInfo.damageTable = &sDamageTable; ActorShape_Init(&this->actor.shape, 0.0f, NULL, 0.0f); - this->upperBodyYRotation = this->headYRotation = 0; + this->torsoRotY = this->headRotY = 0; this->actor.focus.pos = this->actor.world.pos; this->actor.focus.pos.y += 50.0f; this->actor.colChkInfo.mass = MASS_HEAVY; @@ -274,7 +275,8 @@ void EnRd_Init(Actor* thisx, PlayState* play) { Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_OBJ_ICE_POLY, this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, this->actor.world.rot.x, - this->actor.world.rot.y, this->actor.world.rot.z, 0xFF4B); + this->actor.world.rot.y, this->actor.world.rot.z, + OBJICEPOLY_PARAMS(75, OBJICEPOLY_SWITCH_FLAG_NONE)); } } @@ -363,8 +365,8 @@ void EnRd_SetupIdle(EnRd* this) { void EnRd_Idle(EnRd* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); - Math_SmoothStepToS(&this->headYRotation, 0, 1, 100, 0); - Math_SmoothStepToS(&this->upperBodyYRotation, 0, 1, 100, 0); + Math_SmoothStepToS(&this->headRotY, 0, 1, 0x64, 0); + Math_SmoothStepToS(&this->torsoRotY, 0, 1, 0x64, 0); if ((EN_RD_GET_TYPE(&this->actor) == EN_RD_TYPE_CRYING) && Animation_OnFrame(&this->skelAnime, 0.0f)) { if (Rand_ZeroOne() >= 0.5f) { @@ -426,8 +428,8 @@ void EnRd_SetupSquattingDance(EnRd* this) { void EnRd_SquattingDance(EnRd* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); - Math_SmoothStepToS(&this->headYRotation, 0, 1, 100, 0); - Math_SmoothStepToS(&this->upperBodyYRotation, 0, 1, 100, 0); + Math_SmoothStepToS(&this->headRotY, 0, 1, 0x64, 0); + Math_SmoothStepToS(&this->torsoRotY, 0, 1, 0x64, 0); if (this->isMourning) { EnRd_SetupAttemptPlayerFreeze(this); @@ -470,8 +472,8 @@ void EnRd_SetupClappingDance(EnRd* this) { void EnRd_ClappingDance(EnRd* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); - Math_SmoothStepToS(&this->headYRotation, 0, 1, 100, 0); - Math_SmoothStepToS(&this->upperBodyYRotation, 0, 1, 100, 0); + Math_SmoothStepToS(&this->headRotY, 0, 1, 0x64, 0); + Math_SmoothStepToS(&this->torsoRotY, 0, 1, 0x64, 0); if (this->isMourning) { EnRd_SetupAttemptPlayerFreeze(this); @@ -531,8 +533,8 @@ void EnRd_SetupPirouette(EnRd* this) { void EnRd_Pirouette(EnRd* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); - Math_SmoothStepToS(&this->headYRotation, 0, 1, 100, 0); - Math_SmoothStepToS(&this->upperBodyYRotation, 0, 1, 100, 0); + Math_SmoothStepToS(&this->headRotY, 0, 1, 0x64, 0); + Math_SmoothStepToS(&this->torsoRotY, 0, 1, 0x64, 0); if (this->isMourning) { EnRd_SetupAttemptPlayerFreeze(this); @@ -628,9 +630,9 @@ void EnRd_RiseFromCoffin(EnRd* this, PlayState* play) { } void EnRd_SetupWalkToPlayer(EnRd* this, PlayState* play) { - f32 frameCount = Animation_GetLastFrame(&gGibdoRedeadWalkAnim); + f32 endFrame = Animation_GetLastFrame(&gGibdoRedeadWalkAnim); - Animation_Change(&this->skelAnime, &gGibdoRedeadWalkAnim, 1.0f, 4.0f, frameCount, ANIMMODE_LOOP_INTERP, -4.0f); + Animation_Change(&this->skelAnime, &gGibdoRedeadWalkAnim, 1.0f, 4.0f, endFrame, ANIMMODE_LOOP_INTERP, -4.0f); this->actor.speed = 0.4f; this->action = EN_RD_ACTION_WALKING_TO_PLAYER_OR_RELEASING_GRAB; this->actionFunc = EnRd_WalkToPlayer; @@ -639,13 +641,12 @@ void EnRd_SetupWalkToPlayer(EnRd* this, PlayState* play) { void EnRd_WalkToPlayer(EnRd* this, PlayState* play) { Player* player = GET_PLAYER(play); s32 pad; - s16 yaw = - ((this->actor.yawTowardsPlayer - this->actor.shape.rot.y) - this->headYRotation) - this->upperBodyYRotation; + s16 yaw = this->actor.yawTowardsPlayer - this->actor.shape.rot.y - this->headRotY - this->torsoRotY; this->skelAnime.playSpeed = this->actor.speed; - Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 1, 250, 0); - Math_SmoothStepToS(&this->headYRotation, 0, 1, 100, 0); - Math_SmoothStepToS(&this->upperBodyYRotation, 0, 1, 100, 0); + Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 1, 0xFA, 0); + Math_SmoothStepToS(&this->headRotY, 0, 1, 0x64, 0); + Math_SmoothStepToS(&this->torsoRotY, 0, 1, 0x64, 0); this->actor.world.rot.y = this->actor.shape.rot.y; SkelAnime_Update(&this->skelAnime); @@ -716,13 +717,13 @@ void EnRd_SetupWalkToHome(EnRd* this, PlayState* play) { void EnRd_WalkToHome(EnRd* this, PlayState* play) { Player* player = GET_PLAYER(play); s32 pad; - s16 sp36 = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos); + s16 yaw = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos); if (Actor_WorldDistXYZToPoint(&this->actor, &this->actor.home.pos) >= 5.0f) { - Math_SmoothStepToS(&this->actor.shape.rot.y, sp36, 1, 450, 0); + Math_SmoothStepToS(&this->actor.shape.rot.y, yaw, 1, 0x1C2, 0); } else { this->actor.speed = 0.0f; - if (!Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.home.rot.y, 1, 450, 0)) { + if (!Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.home.rot.y, 1, 0x1C2, 0)) { if (EN_RD_GET_TYPE(&this->actor) != EN_RD_TYPE_CRYING) { EnRd_SetupIdle(this); } else { @@ -731,8 +732,8 @@ void EnRd_WalkToHome(EnRd* this, PlayState* play) { } } - Math_SmoothStepToS(&this->headYRotation, 0, 1, 100, 0); - Math_SmoothStepToS(&this->upperBodyYRotation, 0, 1, 100, 0); + Math_SmoothStepToS(&this->headRotY, 0, 1, 0x64, 0); + Math_SmoothStepToS(&this->torsoRotY, 0, 1, 0x64, 0); this->actor.world.rot.y = this->actor.shape.rot.y; SkelAnime_Update(&this->skelAnime); @@ -759,9 +760,9 @@ void EnRd_WalkToHome(EnRd* this, PlayState* play) { } void EnRd_SetupWalkToParent(EnRd* this) { - f32 frameCount = Animation_GetLastFrame(&gGibdoRedeadWalkAnim); + f32 endFrame = Animation_GetLastFrame(&gGibdoRedeadWalkAnim); - Animation_Change(&this->skelAnime, &gGibdoRedeadWalkAnim, 0.5f, 0.0f, frameCount, ANIMMODE_LOOP_INTERP, -4.0f); + Animation_Change(&this->skelAnime, &gGibdoRedeadWalkAnim, 0.5f, 0.0f, endFrame, ANIMMODE_LOOP_INTERP, -4.0f); this->action = EN_RD_ACTION_WALKING_TO_PARENT; this->isMourning = true; this->actionFunc = EnRd_WalkToParent; @@ -782,7 +783,7 @@ void EnRd_WalkToParent(EnRd* this, PlayState* play) { parentPos = this->actor.parent->world.pos; yaw = Actor_WorldYawTowardPoint(&this->actor, &parentPos); - Math_SmoothStepToS(&this->actor.shape.rot.y, yaw, 1, 250, 0); + Math_SmoothStepToS(&this->actor.shape.rot.y, yaw, 1, 0xFA, 0); if (Actor_WorldDistXYZToPoint(&this->actor, &parentPos) >= 45.0f) { this->actor.speed = 0.4f; } else { @@ -793,8 +794,8 @@ void EnRd_WalkToParent(EnRd* this, PlayState* play) { EnRd_SetupCrouch(this); } } - Math_SmoothStepToS(&this->headYRotation, 0, 1, 100, 0); - Math_SmoothStepToS(&this->upperBodyYRotation, 0, 1, 100, 0); + Math_SmoothStepToS(&this->headRotY, 0, 1, 0x64, 0); + Math_SmoothStepToS(&this->torsoRotY, 0, 1, 0x64, 0); } else { EnRd_SetupWalkToPlayer(this, play); } @@ -836,8 +837,8 @@ void EnRd_Grab(EnRd* this, PlayState* play) { this->grabDamageTimer = 20; case EN_RD_GRAB_START: - Math_SmoothStepToS(&this->headYRotation, 0, 1, 1500, 0); - Math_SmoothStepToS(&this->upperBodyYRotation, 0, 1, 1500, 0); + Math_SmoothStepToS(&this->headRotY, 0, 1, 0x5DC, 0); + Math_SmoothStepToS(&this->torsoRotY, 0, 1, 0x5DC, 0); case EN_RD_GRAB_ATTACK: if (!(player->stateFlags2 & PLAYER_STATE2_80) || (player->unk_B62 != 0)) { @@ -853,14 +854,15 @@ void EnRd_Grab(EnRd* this, PlayState* play) { } switch (player->transformation) { + case PLAYER_FORM_HUMAN: + Math_SmoothStepToF(&this->actor.shape.yOffset, -1500.0f, 1.0f, 150.0f, 0.0f); + break; + case PLAYER_FORM_FIERCE_DEITY: case PLAYER_FORM_GORON: case PLAYER_FORM_ZORA: case PLAYER_FORM_DEKU: - break; - - case PLAYER_FORM_HUMAN: - Math_SmoothStepToF(&this->actor.shape.yOffset, -1500.0f, 1.0f, 150.0f, 0.0f); + default: break; } @@ -871,7 +873,7 @@ void EnRd_Grab(EnRd* this, PlayState* play) { Math_SmoothStepToF(&this->actor.world.pos.z, (Math_CosS(player->actor.shape.rot.y) * -25.0f) + player->actor.world.pos.z, 1.0f, 10.0f, 0.0f); - Math_SmoothStepToS(&this->actor.shape.rot.y, player->actor.shape.rot.y, 1, 6000, 0); + Math_SmoothStepToS(&this->actor.shape.rot.y, player->actor.shape.rot.y, 1, 0x1770, 0); if (Animation_OnFrame(&this->skelAnime, 0.0f)) { Actor_PlaySfx(&this->actor, NA_SE_EN_REDEAD_ATTACK); @@ -902,6 +904,9 @@ void EnRd_Grab(EnRd* this, PlayState* play) { this->grabWaitTimer = 15; EnRd_SetupWalkToPlayer(this, play); break; + + default: + break; } } @@ -914,8 +919,7 @@ void EnRd_SetupAttemptPlayerFreeze(EnRd* this) { void EnRd_AttemptPlayerFreeze(EnRd* this, PlayState* play) { Player* player = GET_PLAYER(play); - s16 yaw = - ((this->actor.yawTowardsPlayer - this->actor.shape.rot.y) - this->headYRotation) - this->upperBodyYRotation; + s16 yaw = this->actor.yawTowardsPlayer - this->actor.shape.rot.y - this->headRotY - this->torsoRotY; if (ABS_ALT(yaw) < 0x2008) { if (!(this->flags & EN_RD_FLAG_CANNOT_FREEZE_PLAYER)) { @@ -943,8 +947,8 @@ void EnRd_GrabFail(EnRd* this, PlayState* play) { } this->actor.world.rot.y = this->actor.yawTowardsPlayer; - Math_SmoothStepToS(&this->headYRotation, 0, 1, 300, 0); - Math_SmoothStepToS(&this->upperBodyYRotation, 0, 1, 300, 0); + Math_SmoothStepToS(&this->headRotY, 0, 1, 0x12C, 0); + Math_SmoothStepToS(&this->torsoRotY, 0, 1, 0x12C, 0); if (SkelAnime_Update(&this->skelAnime)) { this->actor.world.rot.y = this->actor.shape.rot.y; EnRd_SetupTurnAwayAndShakeHead(this); @@ -952,22 +956,22 @@ void EnRd_GrabFail(EnRd* this, PlayState* play) { } void EnRd_SetupTurnAwayAndShakeHead(EnRd* this) { - f32 frameCount = Animation_GetLastFrame(&gGibdoRedeadWalkAnim); + f32 endFrame = Animation_GetLastFrame(&gGibdoRedeadWalkAnim); - Animation_Change(&this->skelAnime, &gGibdoRedeadWalkAnim, 0.5f, 0.0f, frameCount, ANIMMODE_LOOP_INTERP, -4.0f); + Animation_Change(&this->skelAnime, &gGibdoRedeadWalkAnim, 0.5f, 0.0f, endFrame, ANIMMODE_LOOP_INTERP, -4.0f); this->action = EN_RD_ACTION_TURNING_AWAY_AND_SHAKING_HEAD; this->headShakeTimer = 0; this->actionFunc = EnRd_TurnAwayAndShakeHead; } void EnRd_TurnAwayAndShakeHead(EnRd* this, PlayState* play) { - Math_SmoothStepToS(&this->actor.world.rot.y, BINANG_ROT180(this->actor.yawTowardsPlayer), 5, 3500, 200); + Math_SmoothStepToS(&this->actor.world.rot.y, BINANG_ROT180(this->actor.yawTowardsPlayer), 5, 0xDAC, 0xC8); this->actor.shape.rot.y = this->actor.world.rot.y; if (this->headShakeTimer > 60) { EnRd_SetupWalkToHome(this, play); this->headShakeTimer = 0; } else { - this->headYRotation = Math_SinS(this->headShakeTimer * 4000) * (0x256F * ((60 - this->headShakeTimer) / 60.0f)); + this->headRotY = Math_SinS(this->headShakeTimer * 4000) * (0x256F * ((60 - this->headShakeTimer) / 60.0f)); SkelAnime_Update(&this->skelAnime); this->headShakeTimer++; } @@ -1023,8 +1027,8 @@ void EnRd_Damage(EnRd* this, PlayState* play) { } this->actor.world.rot.y = this->actor.yawTowardsPlayer; - Math_SmoothStepToS(&this->headYRotation, 0, 1, 300, 0); - Math_SmoothStepToS(&this->upperBodyYRotation, 0, 1, 300, 0); + Math_SmoothStepToS(&this->headRotY, 0, 1, 0x12C, 0); + Math_SmoothStepToS(&this->torsoRotY, 0, 1, 0x12C, 0); if (SkelAnime_Update(&this->skelAnime)) { this->actor.world.rot.y = this->actor.shape.rot.y; @@ -1054,8 +1058,8 @@ void EnRd_Dead(EnRd* this, PlayState* play) { Actor_ChangeCategory(play, &play->actorCtx, &this->actor, ACTORCAT_PROP); } - Math_SmoothStepToS(&this->headYRotation, 0, 1, 2000, 0); - Math_SmoothStepToS(&this->upperBodyYRotation, 0, 1, 2000, 0); + Math_SmoothStepToS(&this->headRotY, 0, 1, 0x7D0, 0); + Math_SmoothStepToS(&this->torsoRotY, 0, 1, 0x7D0, 0); if (SkelAnime_Update(&this->skelAnime)) { if (this->deathTimer == 0) { @@ -1131,22 +1135,22 @@ void EnRd_Stunned(EnRd* this, PlayState* play) { } void EnRd_TurnTowardsPlayer(EnRd* this, PlayState* play) { - s16 headAngle = (this->actor.yawTowardsPlayer - this->actor.shape.rot.y) - this->upperBodyYRotation; - s16 upperBodyAngle = CLAMP(headAngle, -500, 500); + s16 headAngle = this->actor.yawTowardsPlayer - this->actor.shape.rot.y - this->torsoRotY; + s16 upperBodyAngle = CLAMP(headAngle, -0x1F4, 0x1F4); - headAngle -= this->headYRotation; - headAngle = CLAMP(headAngle, -500, 500); + headAngle -= this->headRotY; + headAngle = CLAMP(headAngle, -0x1F4, 0x1F4); if (BINANG_SUB(this->actor.yawTowardsPlayer, this->actor.shape.rot.y) >= 0) { - this->upperBodyYRotation += ABS_ALT(upperBodyAngle); - this->headYRotation += ABS_ALT(headAngle); + this->torsoRotY += ABS_ALT(upperBodyAngle); + this->headRotY += ABS_ALT(headAngle); } else { - this->upperBodyYRotation -= ABS_ALT(upperBodyAngle); - this->headYRotation -= ABS_ALT(headAngle); + this->torsoRotY -= ABS_ALT(upperBodyAngle); + this->headRotY -= ABS_ALT(headAngle); } - this->upperBodyYRotation = CLAMP(this->upperBodyYRotation, -0x495F, 0x495F); - this->headYRotation = CLAMP(this->headYRotation, -0x256F, 0x256F); + this->torsoRotY = CLAMP(this->torsoRotY, -0x495F, 0x495F); + this->headRotY = CLAMP(this->headRotY, -0x256F, 0x256F); } void EnRd_UpdateDamage(EnRd* this, PlayState* play) { @@ -1304,9 +1308,9 @@ s32 EnRd_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* po EnRd* this = THIS; if (limbIndex == REDEAD_LIMB_HEAD_ROOT) { - rot->y += this->headYRotation; + rot->y += this->headRotY; } else if (limbIndex == REDEAD_LIMB_UPPER_BODY_ROOT) { - rot->y += this->upperBodyYRotation; + rot->y += this->torsoRotY; } return false; } diff --git a/src/overlays/actors/ovl_En_Rd/z_en_rd.h b/src/overlays/actors/ovl_En_Rd/z_en_rd.h index 578515a285..c4d32ce47a 100644 --- a/src/overlays/actors/ovl_En_Rd/z_en_rd.h +++ b/src/overlays/actors/ovl_En_Rd/z_en_rd.h @@ -68,8 +68,8 @@ typedef struct EnRd { s16 deathTimer; s16 coffinRiseForwardAccelTimer; }; - /* 0x3D8 */ s16 headYRotation; - /* 0x3DA */ s16 upperBodyYRotation; + /* 0x3D8 */ s16 headRotY; + /* 0x3DA */ s16 torsoRotY; /* 0x3DC */ s16 flags; /* 0x3DE */ s16 alpha; /* 0x3E0 */ s16 sunsSongStunTimer; diff --git a/src/overlays/actors/ovl_En_Recepgirl/z_en_recepgirl.c b/src/overlays/actors/ovl_En_Recepgirl/z_en_recepgirl.c index cfec129e72..c02fe7cfe7 100644 --- a/src/overlays/actors/ovl_En_Recepgirl/z_en_recepgirl.c +++ b/src/overlays/actors/ovl_En_Recepgirl/z_en_recepgirl.c @@ -5,7 +5,6 @@ */ #include "z_en_recepgirl.h" -#include "objects/object_bg/object_bg.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY) @@ -33,8 +32,12 @@ ActorInit En_Recepgirl_InitVars = { /**/ EnRecepgirl_Draw, }; -static TexturePtr sEyeTextures[] = { object_bg_Tex_00F8F0, object_bg_Tex_00FCF0, object_bg_Tex_0100F0, - object_bg_Tex_00FCF0 }; +static TexturePtr sEyeTextures[] = { + object_bg_Tex_00F8F0, + object_bg_Tex_00FCF0, + object_bg_Tex_0100F0, + object_bg_Tex_00FCF0, +}; static InitChainEntry sInitChain[] = { ICHAIN_U8(targetMode, TARGET_MODE_6, ICHAIN_CONTINUE), @@ -50,7 +53,7 @@ void EnRecepgirl_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(&this->actor, sInitChain); ActorShape_Init(&this->actor.shape, -60.0f, NULL, 0.0f); SkelAnime_InitFlex(play, &this->skelAnime, &object_bg_Skel_011B60, &object_bg_Anim_009890, this->jointTable, - this->morphTable, 24); + this->morphTable, OBJECT_BG_2_LIMB_MAX); if (!sTexturesDesegmented) { for (i = 0; i < ARRAY_COUNT(sEyeTextures); i++) { @@ -92,7 +95,7 @@ void EnRecepgirl_SetupWait(EnRecepgirl* this) { } void EnRecepgirl_Wait(EnRecepgirl* this, PlayState* play) { - if (SkelAnime_Update(&this->skelAnime) != 0) { + if (SkelAnime_Update(&this->skelAnime)) { if (this->skelAnime.animation == &object_bg_Anim_00A280) { Animation_MorphToPlayOnce(&this->skelAnime, &object_bg_Anim_00AD98, 5.0f); } else { @@ -175,17 +178,17 @@ void EnRecepgirl_Talk(EnRecepgirl* this, PlayState* play) { void EnRecepgirl_Update(Actor* thisx, PlayState* play) { s32 pad; EnRecepgirl* this = THIS; - Vec3s sp30; + Vec3s torsoRot; this->actionFunc(this, play); - Actor_TrackPlayer(play, &this->actor, &this->headRot, &sp30, this->actor.focus.pos); + Actor_TrackPlayer(play, &this->actor, &this->headRot, &torsoRot, this->actor.focus.pos); EnRecepgirl_UpdateEyes(this); } s32 EnRecepgirl_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) { EnRecepgirl* this = THIS; - if (limbIndex == 5) { + if (limbIndex == OBJECT_BG_2_LIMB_05) { rot->x += this->headRot.y; } return false; @@ -194,7 +197,7 @@ s32 EnRecepgirl_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Ve void EnRecepgirl_TransformLimbDraw(PlayState* play, s32 limbIndex, Actor* thisx) { EnRecepgirl* this = THIS; - if (limbIndex == 5) { + if (limbIndex == OBJECT_BG_2_LIMB_05) { Matrix_RotateYS(0x400 - this->headRot.x, MTXMODE_APPLY); Matrix_MultVecX(500.0f, &this->actor.focus.pos); } diff --git a/src/overlays/actors/ovl_En_Recepgirl/z_en_recepgirl.h b/src/overlays/actors/ovl_En_Recepgirl/z_en_recepgirl.h index 96ad7522a7..9c070594cb 100644 --- a/src/overlays/actors/ovl_En_Recepgirl/z_en_recepgirl.h +++ b/src/overlays/actors/ovl_En_Recepgirl/z_en_recepgirl.h @@ -2,6 +2,7 @@ #define Z_EN_RECEPGIRL_H #include "global.h" +#include "objects/object_bg/object_bg.h" struct EnRecepgirl; @@ -12,8 +13,8 @@ typedef void (*EnRecepgirlActionFunc)(struct EnRecepgirl*, PlayState*); typedef struct EnRecepgirl { /* 0x000 */ Actor actor; /* 0x144 */ SkelAnime skelAnime; - /* 0x188 */ Vec3s jointTable[24]; - /* 0x218 */ Vec3s morphTable[24]; + /* 0x188 */ Vec3s jointTable[OBJECT_BG_2_LIMB_MAX]; + /* 0x218 */ Vec3s morphTable[OBJECT_BG_2_LIMB_MAX]; /* 0x2A8 */ EnRecepgirlActionFunc actionFunc; /* 0x2AC */ u8 eyeTexIndex; /* 0x2AE */ Vec3s headRot; diff --git a/src/overlays/actors/ovl_En_Rg/z_en_rg.c b/src/overlays/actors/ovl_En_Rg/z_en_rg.c index 9d8b157ba8..8bf9663e42 100644 --- a/src/overlays/actors/ovl_En_Rg/z_en_rg.c +++ b/src/overlays/actors/ovl_En_Rg/z_en_rg.c @@ -6,7 +6,6 @@ #include "z_en_rg.h" #include "objects/gameplay_keep/gameplay_keep.h" -#include "objects/object_oF1d_map/object_oF1d_map.h" #define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_80000000) @@ -17,7 +16,6 @@ void EnRg_Destroy(Actor* thisx, PlayState* play); void EnRg_Update(Actor* thisx, PlayState* play); void EnRg_Draw(Actor* thisx, PlayState* play); -void func_80BF4EBC(EnRg* this, PlayState* play); void func_80BF4FC4(EnRg* this, PlayState* play); s32 D_80BF5C10; @@ -118,9 +116,16 @@ s32 D_80BF57E4[][4] = { { 56, 34, 44, 41 }, { 60, 38, 50, 45 }, { 67, 42, 55, 49 }, { 74, 47, 61, 54 }, }; -AnimationInfoS D_80BF5914[] = { - { &gGoronUnrollAnim, 2.0f, 0, -1, ANIMMODE_ONCE, 0 }, - { &gGoronUnrollAnim, -2.0f, 0, -1, ANIMMODE_ONCE, 0 }, +typedef enum EnRgAnimation { + /* -1 */ RG_ANIM_NONE = -1, + /* 0 */ RG_ANIM_0, + /* 1 */ RG_ANIM_1, + /* 2 */ RG_ANIM_MAX +} EnRgAnimation; + +static AnimationInfoS sAnimationInfo[RG_ANIM_MAX] = { + { &gGoronUnrollAnim, 2.0f, 0, -1, ANIMMODE_ONCE, 0 }, // RG_ANIM_0 + { &gGoronUnrollAnim, -2.0f, 0, -1, ANIMMODE_ONCE, 0 }, // RG_ANIM_1 }; static TexturePtr sDustTextures[] = { @@ -139,62 +144,45 @@ Color_RGBA8 D_80BF5960[] = { { 0, 0, 0, 0 }, }; -Vec3f D_80BF596C[] = { - { -2473.0f, 39.0f, 7318.0f }, { -2223.0f, 142.0f, 7184.0f }, { -2281.0f, 41.0f, 7718.0f }, - { -2136.0f, 96.0f, 7840.0f }, { -2432.0f, 6.0f, 7857.0f }, { -2412.0f, 139.0f, 6872.0f }, - { -2719.0f, 39.0f, 7110.0f }, { -2289.0f, 67.0f, 7463.0f }, { -2820.0f, 85.0f, 6605.0f }, - { -2088.0f, 160.0f, 7584.0f }, { -2503.0f, 1.0f, 7643.0f }, -}; - -EffectTireMarkInit D_80BF59F0 = { - 0, - 62, - { 0, 0, 15, 100 }, -}; - -TexturePtr D_80BF59F8[] = { - gGoronEyeOpenTex, gGoronEyeHalfTex, gGoronEyeClosedTex, gGoronEyeHalfTex, gGoronEyeClosed2Tex, -}; - -void func_80BF3920(EnRgStruct* ptr, PlayState* play) { +void func_80BF3920(EnRgStruct* ptr, PlayState* play2) { + PlayState* play = play2; f32 temp_f20; u8 phi_fp = false; s32 i; - s32 idx; OPEN_DISPS(play->state.gfxCtx); Gfx_SetupDL25_Xlu(play->state.gfxCtx); for (i = 0; i < 32; i++, ptr++) { - if ((ptr->unk_00 >= 4) && (ptr->unk_00 < 7)) { - if (!phi_fp) { - POLY_XLU_DISP = Gfx_SetupDL(POLY_XLU_DISP, SETUPDL_0); - gSPDisplayList(POLY_XLU_DISP++, gGoronDustMaterialDL); - phi_fp = true; - } - - Matrix_Push(); - - if (play) {} - temp_f20 = (f32)ptr->unk_02 / ptr->unk_01; - - gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, D_80BF5954[ptr->unk_00 - 4].r, D_80BF5954[ptr->unk_00 - 4].g, - D_80BF5954[ptr->unk_00 - 4].b, (u8)(temp_f20 * 255.0f)); - gDPSetEnvColor(POLY_XLU_DISP++, D_80BF5960[ptr->unk_00 - 4].r, D_80BF5960[ptr->unk_00 - 4].g, - D_80BF5960[ptr->unk_00 - 4].b, 0); - - Matrix_Translate(ptr->unk_10.x, ptr->unk_10.y, ptr->unk_10.z, MTXMODE_NEW); - Matrix_Scale(ptr->unk_34, ptr->unk_34, 1.0f, MTXMODE_APPLY); - Matrix_ReplaceRotation(&play->billboardMtxF); - - gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - idx = temp_f20 * 7.0f; - gSPSegment(POLY_XLU_DISP++, 0x08, Lib_SegmentedToVirtual(sDustTextures[idx])); - gSPDisplayList(POLY_XLU_DISP++, gGoronDustModelDL); - - Matrix_Pop(); + if ((ptr->unk_00 < 4) || (ptr->unk_00 >= 7)) { + continue; } + + if (!phi_fp) { + POLY_XLU_DISP = Gfx_SetupDL(POLY_XLU_DISP, SETUPDL_0); + gSPDisplayList(POLY_XLU_DISP++, gGoronDustMaterialDL); + phi_fp = true; + } + + Matrix_Push(); + + temp_f20 = (f32)ptr->unk_02 / ptr->unk_01; + + gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, D_80BF5954[ptr->unk_00 - 4].r, D_80BF5954[ptr->unk_00 - 4].g, + D_80BF5954[ptr->unk_00 - 4].b, (u8)(temp_f20 * 255.0f)); + gDPSetEnvColor(POLY_XLU_DISP++, D_80BF5960[ptr->unk_00 - 4].r, D_80BF5960[ptr->unk_00 - 4].g, + D_80BF5960[ptr->unk_00 - 4].b, 0); + + Matrix_Translate(ptr->unk_10.x, ptr->unk_10.y, ptr->unk_10.z, MTXMODE_NEW); + Matrix_Scale(ptr->unk_34, ptr->unk_34, 1.0f, MTXMODE_APPLY); + Matrix_ReplaceRotation(&play->billboardMtxF); + + gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + gSPSegment(POLY_XLU_DISP++, 0x08, Lib_SegmentedToVirtual(sDustTextures[(s32)(temp_f20 * 7.0f)])); + gSPDisplayList(POLY_XLU_DISP++, gGoronDustModelDL); + + Matrix_Pop(); } CLOSE_DISPS(play->state.gfxCtx); @@ -277,13 +265,13 @@ s32 func_80BF3F14(EnRg* this, PlayState* play) { return false; } -void func_80BF3FF8(EnRg* this) { - this->skelAnime.playSpeed = this->unk_314; +void EnRg_UpdateSkelAnime(EnRg* this) { + this->skelAnime.playSpeed = this->animPlaySpeed; SkelAnime_Update(&this->skelAnime); } s32 func_80BF4024(EnRg* this, PlayState* play) { - if ((play->csCtx.state == CS_STATE_IDLE) && (this->unk_334 == 1)) { + if ((play->csCtx.state == CS_STATE_IDLE) && (this->animIndex == RG_ANIM_1)) { if (Animation_OnFrame(&this->skelAnime, 2.0f)) { Actor_PlaySfx(&this->actor, NA_SE_EN_GOLON_CIRCLE); } @@ -296,15 +284,15 @@ s32 func_80BF4024(EnRg* this, PlayState* play) { return false; } -s32 func_80BF409C(EnRg* this, s32 arg1) { - s32 ret = false; +s32 EnRg_ChangeAnim(EnRg* this, s32 animIndex) { + s32 didAnimChange = false; - if (arg1 != this->unk_334) { - this->unk_334 = arg1; - ret = SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80BF5914, arg1); - this->unk_314 = this->skelAnime.playSpeed; + if (this->animIndex != animIndex) { + this->animIndex = animIndex; + didAnimChange = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, animIndex); + this->animPlaySpeed = this->skelAnime.playSpeed; } - return ret; + return didAnimChange; } void func_80BF40F4(EnRg* this) { @@ -354,8 +342,8 @@ s32 func_80BF42BC(EnRg* this, f32 arg1) { sp24 = 5460.0f * sp2C; this->actor.scale.x = 0.01f - (Math_SinS(sp24) * 0.01f); - this->actor.scale.y = (Math_SinS(sp24) * 0.01f) + 0.01f; - this->actor.scale.z = (Math_SinS(sp24) * 0.01f) + 0.01f; + this->actor.scale.y = 0.01f + (Math_SinS(sp24) * 0.01f); + this->actor.scale.z = 0.01f + (Math_SinS(sp24) * 0.01f); this->actor.shape.yOffset = this->actor.scale.y * 100.0f * 14.0f; if (!(this->unk_310 & 0x1000)) { @@ -396,12 +384,12 @@ s32 func_80BF43FC(EnRg* this) { } s32 func_80BF4560(EnRg* this, PlayState* play) { - s32 temp_v0 = SurfaceType_GetSceneExitIndex(&play->colCtx, this->actor.floorPoly, this->actor.floorBgId); + s32 sceneExitIndex = SurfaceType_GetSceneExitIndex(&play->colCtx, this->actor.floorPoly, this->actor.floorBgId); - if ((temp_v0 < 4) || (temp_v0 >= 19)) { - temp_v0 = -1; + if ((sceneExitIndex < 4) || (sceneExitIndex >= 19)) { + sceneExitIndex = -1; } - return temp_v0; + return sceneExitIndex; } s32 func_80BF45B4(EnRg* this) { @@ -447,7 +435,7 @@ s32 func_80BF45B4(EnRg* this) { this->unk_310 &= ~0x800; this->unk_310 &= ~0x40; if ((this->unk_18C != NULL) && (this->unk_18C->id == ACTOR_PLAYER)) { - D_80BF5C10 = 0; + D_80BF5C10 = false; } this->unk_18C = NULL; this->unk_324 = 0; @@ -483,7 +471,7 @@ s32 func_80BF47AC(EnRg* this, PlayState* play) { } else if (this->numCheckpointsAheadOfPlayer == -1) { phi_f0 = phi_f2 * 1.6f; } else { - phi_f0 = 2.0f * phi_f2; + phi_f0 = phi_f2 * 2.0f; } if (phi_f0 > 0.0f) { @@ -564,16 +552,15 @@ void func_80BF4AB8(EnRg* this, PlayState* play) { } while (phi_s0 != NULL); } - if ((phi_s0 == NULL) && (D_80BF5C10 == 0) && (this->unk_326 == 0) && - (player->stateFlags3 & PLAYER_STATE3_80000) && (player->invincibilityTimer == 0) && - func_80BF4220(this, play, &player->actor)) { + if ((phi_s0 == NULL) && !D_80BF5C10 && (this->unk_326 == 0) && (player->stateFlags3 & PLAYER_STATE3_80000) && + (player->invincibilityTimer == 0) && func_80BF4220(this, play, &player->actor)) { this->unk_18C = &player->actor; this->unk_310 |= 0x800; - D_80BF5C10 = 1; + D_80BF5C10 = true; } } else if ((this->unk_18C != NULL) && !func_80BF4220(this, play, this->unk_18C)) { if (this->unk_18C->id == ACTOR_PLAYER) { - D_80BF5C10 = 0; + D_80BF5C10 = false; } this->unk_18C = NULL; this->unk_310 &= ~0x800; @@ -603,7 +590,7 @@ void func_80BF4AB8(EnRg* this, PlayState* play) { } if ((this->unk_18C != NULL) && (this->unk_18C->id == ACTOR_PLAYER)) { - D_80BF5C10 = 0; + D_80BF5C10 = false; } } } @@ -613,10 +600,21 @@ void func_80BF4AB8(EnRg* this, PlayState* play) { } } -s32 func_80BF4D64(Vec3f* arg0) { - return Math3D_XZBoundCheck(-1261.0f, -901.0f, -1600.0f, -1520.0f, arg0->x, arg0->z); +/** + * Returns true if the specified position is in the finish line. + * The range extends a little bit beyond the finish line's in-game visual. + */ +s32 EnRg_IsInFinishLine(Vec3f* pos) { + return Math3D_XZBoundCheck(-1261.0f, -901.0f, -1600.0f, -1520.0f, pos->x, pos->z); } +Vec3f D_80BF596C[] = { + { -2473.0f, 39.0f, 7318.0f }, { -2223.0f, 142.0f, 7184.0f }, { -2281.0f, 41.0f, 7718.0f }, + { -2136.0f, 96.0f, 7840.0f }, { -2432.0f, 6.0f, 7857.0f }, { -2412.0f, 139.0f, 6872.0f }, + { -2719.0f, 39.0f, 7110.0f }, { -2289.0f, 67.0f, 7463.0f }, { -2820.0f, 85.0f, 6605.0f }, + { -2088.0f, 160.0f, 7584.0f }, { -2503.0f, 1.0f, 7643.0f }, +}; + s32 func_80BF4DA8(EnRg* this) { s32 pad[4]; s32 ret = false; @@ -639,7 +637,7 @@ s32 func_80BF4DA8(EnRg* this) { this->unk_310 &= ~0x800; if ((this->unk_18C != NULL) && (this->unk_18C->id == ACTOR_PLAYER)) { - D_80BF5C10 = 0; + D_80BF5C10 = false; } this->unk_18C = NULL; @@ -661,7 +659,7 @@ void func_80BF4EBC(EnRg* this, PlayState* play) { } } else if (CHECK_WEEKEVENTREG(WEEKEVENTREG_12_02)) { if (DECR(this->unk_318) == 0) { - func_80BF409C(this, 1); + EnRg_ChangeAnim(this, RG_ANIM_1); this->unk_310 &= ~8; this->unk_310 &= ~0x10; this->unk_310 |= 0x100; @@ -689,7 +687,7 @@ void func_80BF4FC4(EnRg* this, PlayState* play) { } } } else if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && !(this->unk_310 & 0x1000) && - func_80BF4D64(&this->actor.world.pos)) { + EnRg_IsInFinishLine(&this->actor.world.pos)) { this->unk_310 |= 0x1000; } @@ -722,6 +720,12 @@ void func_80BF4FC4(EnRg* this, PlayState* play) { } } +EffectTireMarkInit D_80BF59F0 = { + 0, + 62, + { 0, 0, 15, 100 }, +}; + void EnRg_Init(Actor* thisx, PlayState* play) { EnRg* this = THIS; @@ -730,8 +734,8 @@ void EnRg_Init(Actor* thisx, PlayState* play) { SkelAnime_InitFlex(play, &this->skelAnime, &gGoronSkel, NULL, this->jointTable, this->morphTable, GORON_LIMB_MAX); - this->unk_334 = -1; - func_80BF409C(this, 0); + this->animIndex = RG_ANIM_NONE; + EnRg_ChangeAnim(this, RG_ANIM_0); this->skelAnime.curFrame = this->skelAnime.endFrame; Collider_InitAndSetSphere(play, &this->collider2, &this->actor, &sSphereInit); @@ -786,7 +790,7 @@ void EnRg_Update(Actor* thisx, PlayState* play) { if (!(this->unk_310 & 0x10)) { func_80BF40F4(this); - func_80BF3FF8(this); + EnRg_UpdateSkelAnime(this); func_80BF4024(this, play); } @@ -829,15 +833,15 @@ s32 EnRg_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* po s32 fidgetIndex; switch (limbIndex) { - case 10: + case GORON_LIMB_BODY: fidgetIndex = 0; break; - case 11: + case GORON_LIMB_LEFT_UPPER_ARM: fidgetIndex = 1; break; - case 14: + case GORON_LIMB_RIGHT_UPPER_ARM: fidgetIndex = 2; break; @@ -854,6 +858,10 @@ s32 EnRg_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* po return false; } +static TexturePtr sEyeTextures[] = { + gGoronEyeOpenTex, gGoronEyeHalfTex, gGoronEyeClosedTex, gGoronEyeHalfTex, gGoronEyeClosed2Tex, +}; + void EnRg_Draw(Actor* thisx, PlayState* play) { EnRg* this = THIS; @@ -862,7 +870,7 @@ void EnRg_Draw(Actor* thisx, PlayState* play) { Gfx_SetupDL25_Opa(play->state.gfxCtx); - gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(D_80BF59F8[this->unk_31E])); + gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(sEyeTextures[this->unk_31E])); SkelAnime_DrawFlexOpa(play, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount, EnRg_OverrideLimbDraw, NULL, &this->actor); diff --git a/src/overlays/actors/ovl_En_Rg/z_en_rg.h b/src/overlays/actors/ovl_En_Rg/z_en_rg.h index a29e0a5f70..a6a1304cf3 100644 --- a/src/overlays/actors/ovl_En_Rg/z_en_rg.h +++ b/src/overlays/actors/ovl_En_Rg/z_en_rg.h @@ -2,6 +2,7 @@ #define Z_EN_RG_H #include "global.h" +#include "objects/object_oF1d_map/object_oF1d_map.h" struct EnRg; @@ -33,10 +34,10 @@ typedef struct EnRg { /* 0x190 */ ColliderCylinder collider1; /* 0x1DC */ ColliderSphere collider2; /* 0x234 */ Path* path; - /* 0x238 */ Vec3s jointTable[18]; - /* 0x2A4 */ Vec3s morphTable[18]; + /* 0x238 */ Vec3s jointTable[GORON_LIMB_MAX]; + /* 0x2A4 */ Vec3s morphTable[GORON_LIMB_MAX]; /* 0x310 */ u16 unk_310; - /* 0x314 */ f32 unk_314; + /* 0x314 */ f32 animPlaySpeed; /* 0x318 */ s16 unk_318; /* 0x31A */ UNK_TYPE1 unk31A[2]; /* 0x31C */ s16 unk_31C; @@ -47,7 +48,7 @@ typedef struct EnRg { /* 0x326 */ s16 unk_326; /* 0x328 */ s16 fidgetTableZ[ENRG_FIDGET_TABLE_LEN]; /* 0x32E */ s16 fidgetTableY[ENRG_FIDGET_TABLE_LEN]; - /* 0x334 */ s32 unk_334; + /* 0x334 */ s32 animIndex; /* 0x338 */ UNK_TYPE1 unk338[4]; /* 0x33C */ s32 unk_33C; /* 0x340 */ s32 unk_340; diff --git a/src/overlays/actors/ovl_En_Rr/z_en_rr.c b/src/overlays/actors/ovl_En_Rr/z_en_rr.c index 0eeda231de..f5bd09def5 100644 --- a/src/overlays/actors/ovl_En_Rr/z_en_rr.c +++ b/src/overlays/actors/ovl_En_Rr/z_en_rr.c @@ -570,7 +570,7 @@ void func_808FAE50(EnRr* this, PlayState* play) { void func_808FAF94(EnRr* this, PlayState* play) { Player* player = GET_PLAYER(play); - Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 10, 500, 0); + Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 10, 0x1F4, 0); this->actor.world.rot.y = this->actor.shape.rot.y; if ((this->unk_1E6 == 0) && !(player->stateFlags2 & PLAYER_STATE2_80) && (Player_GetMask(play) != PLAYER_MASK_STONE) && @@ -582,7 +582,7 @@ void func_808FAF94(EnRr* this, PlayState* play) { } void func_808FB088(EnRr* this, PlayState* play) { - Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 10, 500, 0); + Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 10, 0x1F4, 0); this->actor.world.rot.y = this->actor.shape.rot.y; if (Player_GetMask(play) == PLAYER_MASK_STONE) { func_808FA344(this); @@ -625,6 +625,9 @@ void func_808FB088(EnRr* this, PlayState* play) { func_808FA344(this); } break; + + default: + break; } } @@ -741,7 +744,7 @@ void func_808FB680(EnRr* this, PlayState* play) { if (this->unk_1E6 == 0) { this->actionFunc = func_808FAF94; } else { - Math_SmoothStepToS(&this->actor.shape.rot.y, BINANG_ROT180(this->actor.yawTowardsPlayer), 10, 1000, 0); + Math_SmoothStepToS(&this->actor.shape.rot.y, BINANG_ROT180(this->actor.yawTowardsPlayer), 10, 0x3E8, 0); this->actor.world.rot.y = this->actor.shape.rot.y; if (this->actor.speed == 0.0f) { func_808FA238(this, 2.0f); @@ -854,8 +857,8 @@ void EnRr_Update(Actor* thisx, PlayState* play) { for (i = 0; i < ARRAY_COUNT(this->unk_324); i++) { ptr = &this->unk_324[i]; - Math_SmoothStepToS(&ptr->unk_1A.x, ptr->unk_14, 5, this->unk_210 * 1000.0f, 0); - Math_SmoothStepToS(&ptr->unk_1A.z, ptr->unk_18, 5, this->unk_210 * 1000.0f, 0); + Math_SmoothStepToS(&ptr->unk_1A.x, ptr->unk_14, 5, this->unk_210 * 0x3E8, 0); + Math_SmoothStepToS(&ptr->unk_1A.z, ptr->unk_18, 5, this->unk_210 * 0x3E8, 0); Math_StepToF(&ptr->unk_08, ptr->unk_0C, this->unk_210 * 0.2f); Math_StepToF(&ptr->unk_00, ptr->unk_04, this->unk_210 * 300.0f); } @@ -938,9 +941,9 @@ void EnRr_Draw(Actor* thisx, PlayState* play2) { } Matrix_MultZero(&this->unk_228); - this->collider2.dim.pos.x = ((this->unk_228.x - spA4.x) * 0.85f) + spA4.x; - this->collider2.dim.pos.y = ((this->unk_228.y - spA4.y) * 0.85f) + spA4.y; - this->collider2.dim.pos.z = ((this->unk_228.z - spA4.z) * 0.85f) + spA4.z; + this->collider2.dim.pos.x = LERPIMP(spA4.x, this->unk_228.x, 0.85f); + this->collider2.dim.pos.y = LERPIMP(spA4.y, this->unk_228.y, 0.85f); + this->collider2.dim.pos.z = LERPIMP(spA4.z, this->unk_228.z, 0.85f); gSPDisplayList(POLY_OPA_DISP++, gLikeLikeDL); diff --git a/src/overlays/actors/ovl_En_Rsn/z_en_rsn.c b/src/overlays/actors/ovl_En_Rsn/z_en_rsn.c index f7e345d658..e51f6f659c 100644 --- a/src/overlays/actors/ovl_En_Rsn/z_en_rsn.c +++ b/src/overlays/actors/ovl_En_Rsn/z_en_rsn.c @@ -16,7 +16,7 @@ void EnRsn_Destroy(Actor* thisx, PlayState* play); void EnRsn_Update(Actor* thisx, PlayState* play); void EnRsn_Draw(Actor* thisx, PlayState* play); -void func_80C25D84(EnRsn* this, PlayState* play); +void EnRsn_DoNothing(EnRsn* this, PlayState* play); ActorInit En_Rsn_InitVars = { /**/ ACTOR_EN_RSN, @@ -30,14 +30,21 @@ ActorInit En_Rsn_InitVars = { /**/ EnRsn_Draw, }; -static AnimationInfo sAnimationInfo[] = { { &gBombShopkeeperSwayAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f } }; +typedef enum RsnAnimation { + /* 0 */ RSN_ANIM_SWAY, + /* 1 */ RSN_ANIM_MAX +} RsnAnimation; + +static AnimationInfo sAnimationInfo[RSN_ANIM_MAX] = { + { &gBombShopkeeperSwayAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f }, // RSN_ANIM_SWAY +}; void func_80C25D40(EnRsn* this) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 0); - this->actionFunc = func_80C25D84; + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, RSN_ANIM_SWAY); + this->actionFunc = EnRsn_DoNothing; } -void func_80C25D84(EnRsn* this, PlayState* play) { +void EnRsn_DoNothing(EnRsn* this, PlayState* play) { } void EnRsn_Init(Actor* thisx, PlayState* play) { @@ -61,14 +68,14 @@ void EnRsn_Update(Actor* thisx, PlayState* play) { this->actionFunc(this, play); Actor_MoveWithGravity(&this->actor); SkelAnime_Update(&this->skelAnime); - Actor_TrackPlayer(play, &this->actor, &this->unk1D8, &this->unk1DE, this->actor.focus.pos); + Actor_TrackPlayer(play, &this->actor, &this->headRot, &this->torsoRot, this->actor.focus.pos); } s32 EnRsn_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) { EnRsn* this = THIS; if (limbIndex == BOMB_SHOPKEEPER_LIMB_RIGHT_HAND) { - Matrix_RotateXS(this->unk1D8.y, MTXMODE_APPLY); + Matrix_RotateXS(this->headRot.y, MTXMODE_APPLY); } return false; } diff --git a/src/overlays/actors/ovl_En_Rsn/z_en_rsn.h b/src/overlays/actors/ovl_En_Rsn/z_en_rsn.h index 438a49b1e5..12bdbbfc2e 100644 --- a/src/overlays/actors/ovl_En_Rsn/z_en_rsn.h +++ b/src/overlays/actors/ovl_En_Rsn/z_en_rsn.h @@ -12,8 +12,8 @@ typedef struct EnRsn { /* 0x144 */ UNK_TYPE1 unk144[0x4C]; /* 0x190 */ SkelAnime skelAnime; /* 0x1D4 */ EnRsnActionFunc actionFunc; - /* 0x1D8 */ Vec3s unk1D8; - /* 0x1DE */ Vec3s unk1DE; + /* 0x1D8 */ Vec3s headRot; + /* 0x1DE */ Vec3s torsoRot; } EnRsn; // size = 0x1E4 #endif // Z_EN_RSN_H diff --git a/src/overlays/actors/ovl_En_Ru/z_en_ru.c b/src/overlays/actors/ovl_En_Ru/z_en_ru.c index fffd0e26bc..16fc48e69e 100644 --- a/src/overlays/actors/ovl_En_Ru/z_en_ru.c +++ b/src/overlays/actors/ovl_En_Ru/z_en_ru.c @@ -15,8 +15,6 @@ void EnRu_Destroy(Actor* thisx, PlayState* play); void EnRu_Update(Actor* thisx, PlayState* play); void EnRu_Draw(Actor* thisx, PlayState* play); -void EnRu_DoNothing(EnRu* this, PlayState* play); - ActorInit En_Ru_InitVars = { /**/ ACTOR_EN_RU, /**/ ACTORCAT_NPC, @@ -86,15 +84,28 @@ static DamageTable sDamageTable = { /* Powder Keg */ DMG_ENTRY(0, 0x0), }; -static AnimationInfoS sAnimationInfo[] = { - { &gAdultRutoIdleAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, - { &gAdultRutoIdleAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, - { &gAdultRutoRaisingArmsUpAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, - { &gAdultRutoCrossingArmsAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, - { &gAdultRutoLookingDownLeftAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, - { &gAdultRutoIdleHandsOnHipsAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, - { &gAdultRutoHeadTurnDownLeftAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, - { &gAdultRutoSwimmingUpAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, +typedef enum AdultRutoAnimation { + /* -1 */ ADULT_RUTO_ANIM_NONE = -1, + /* 0 */ ADULT_RUTO_ANIM_IDLE, + /* 1 */ ADULT_RUTO_ANIM_IDLE_MORPH, + /* 2 */ ADULT_RUTO_ANIM_RAISING_ARMS_UP, + /* 3 */ ADULT_RUTO_ANIM_CROSSING_ARMS, + /* 4 */ ADULT_RUTO_ANIM_LOOKING_DOWN_LEFT, + /* 5 */ ADULT_RUTO_ANIM_HANDS_ON_HIPS, + /* 6 */ ADULT_RUTO_ANIM_TURN_DOWN_LEFT, + /* 7 */ ADULT_RUTO_ANIM_SWIMMING_UP, + /* 8 */ ADULT_RUTO_ANIM_MAX +} AdultRutoAnimation; + +static AnimationInfoS sAnimationInfo[ADULT_RUTO_ANIM_MAX] = { + { &gAdultRutoIdleAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // ADULT_RUTO_ANIM_IDLE + { &gAdultRutoIdleAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, // ADULT_RUTO_ANIM_IDLE_MORPH + { &gAdultRutoRaisingArmsUpAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, // ADULT_RUTO_ANIM_RAISING_ARMS_UP + { &gAdultRutoCrossingArmsAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, // ADULT_RUTO_ANIM_CROSSING_ARMS + { &gAdultRutoLookingDownLeftAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, // ADULT_RUTO_ANIM_LOOKING_DOWN_LEFT + { &gAdultRutoIdleHandsOnHipsAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, // ADULT_RUTO_ANIM_HANDS_ON_HIPS + { &gAdultRutoHeadTurnDownLeftAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, // ADULT_RUTO_ANIM_TURN_DOWN_LEFT + { &gAdultRutoSwimmingUpAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, // ADULT_RUTO_ANIM_SWIMMING_UP }; static s8 sLimbToBodyParts[RU2_LIMB_MAX] = { @@ -159,28 +170,24 @@ static u8 sShadowSizes[RU_BODYPART_MAX] = { 0, // RU_BODYPART_14 }; -static TrackOptionsSet sTrackOptions = { - { 0xFA0, 4, 1, 3 }, { 0x1770, 4, 1, 6 }, { 0xFA0, 4, 1, 3 }, { 0x1770, 4, 1, 6 } -}; - s32 EnRu_ChangeAnim(SkelAnime* skelAnime, s16 animIndex) { - s16 lastFrame; - s32 ret = false; + s16 endFrame; + s32 didAnimChange = false; - if ((animIndex >= 0) && (animIndex < ARRAY_COUNT(sAnimationInfo))) { - lastFrame = sAnimationInfo[animIndex].frameCount; + if ((animIndex > ADULT_RUTO_ANIM_NONE) && (animIndex < ADULT_RUTO_ANIM_MAX)) { + endFrame = sAnimationInfo[animIndex].frameCount; - ret = true; - if (lastFrame < 0) { - lastFrame = Animation_GetLastFrame(sAnimationInfo[animIndex].animation); + didAnimChange = true; + if (endFrame < 0) { + endFrame = Animation_GetLastFrame(sAnimationInfo[animIndex].animation); } Animation_Change(skelAnime, sAnimationInfo[animIndex].animation, sAnimationInfo[animIndex].playSpeed, - sAnimationInfo[animIndex].startFrame, lastFrame, sAnimationInfo[animIndex].mode, + sAnimationInfo[animIndex].startFrame, endFrame, sAnimationInfo[animIndex].mode, sAnimationInfo[animIndex].morphFrames); } - return ret; + return didAnimChange; } // En_Zo has a copy of this function @@ -241,6 +248,10 @@ void EnRu_UpdateCollider(EnRu* this, PlayState* play) { CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); } +static TrackOptionsSet sTrackOptions = { + { 0xFA0, 4, 1, 3 }, { 0x1770, 4, 1, 6 }, { 0xFA0, 4, 1, 3 }, { 0x1770, 4, 1, 6 } +}; + void EnRu_UpdateModel(EnRu* this, PlayState* play) { Player* player = GET_PLAYER(play); @@ -279,7 +290,7 @@ void EnRu_Init(Actor* thisx, PlayState* play) { ActorShape_Init(&this->actor.shape, 0.0f, NULL, 0.0f); SkelAnime_InitFlex(play, &this->skelAnime, &gAdultRutoSkel, NULL, this->jointTable, this->morphTable, RU2_LIMB_MAX); - EnRu_ChangeAnim(&this->skelAnime, 0); + EnRu_ChangeAnim(&this->skelAnime, ADULT_RUTO_ANIM_IDLE); Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); CollisionCheck_SetInfo2(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit); @@ -300,6 +311,7 @@ void EnRu_Update(Actor* thisx, PlayState* play) { EnRu* this = THIS; this->actionFunc(this, play); + Actor_UpdateBgCheckInfo(play, &this->actor, 0.0f, 0.0f, 0.0f, UPDBGCHECKINFO_FLAG_4); EnRu_UpdateModel(this, play); EnRu_UpdateCollider(this, play); diff --git a/src/overlays/actors/ovl_En_Ruppecrow/z_en_ruppecrow.c b/src/overlays/actors/ovl_En_Ruppecrow/z_en_ruppecrow.c index 9301d344ee..dcb7c14df1 100644 --- a/src/overlays/actors/ovl_En_Ruppecrow/z_en_ruppecrow.c +++ b/src/overlays/actors/ovl_En_Ruppecrow/z_en_ruppecrow.c @@ -11,7 +11,7 @@ #define THIS ((EnRuppecrow*)thisx) -typedef enum { +typedef enum EnRuppecrowEffect { /* 0x00 */ ENRUPPECROW_EFFECT_NONE = 0, /* 0x0A */ ENRUPPECROW_EFFECT_ICE = 10, /* 0x14 */ ENRUPPECROW_EFFECT_LIGHT = 20 @@ -21,24 +21,11 @@ void EnRuppecrow_Init(Actor* thisx, PlayState* play2); void EnRuppecrow_Destroy(Actor* thisx, PlayState* play); void EnRuppecrow_Update(Actor* thisx, PlayState* play); void EnRuppecrow_Draw(Actor* thisx, PlayState* play); -void EnRuppecrow_HandleSong(EnRuppecrow*, PlayState*); -s32 EnRuppecrow_UpdateCollision(EnRuppecrow*, PlayState*); -void EnRuppecrow_UpdateRupees(EnRuppecrow*); -void EnRuppecrow_UpdateDamage(EnRuppecrow*, PlayState*); -void EnRuppecrow_HandleDeath(EnRuppecrow*); -void EnRuppecrow_FallToDespawn(EnRuppecrow*, PlayState*); -void EnRuppecrow_ShatterIce(EnRuppecrow*, PlayState*); -void EnRuppecrow_UpdatePosition(EnRuppecrow*, PlayState*); -s32 EnRuppecrow_CheckPlayedMatchingSong(PlayState*); -void EnRuppecrow_HandleSongCutscene(EnRuppecrow*, PlayState*); -s32 EnRuppecrow_HasReachedPointClockwise(EnRuppecrow*, Path*, s32); -s32 EnRuppecrow_HasReachedPointCounterClockwise(EnRuppecrow*, Path*, s32); -f32 EnRuppecrow_GetPointDirection(Path*, s32, PosRot*, Vec3s*); -s32 EnRuppecrow_CanSpawnBlueRupees(PlayState*); -void EnRuppecrow_SpawnRupee(EnRuppecrow*, PlayState*); -void EnRuppecrow_FlyWhileDroppingRupees(EnRuppecrow*, PlayState*); -void EnRuppecrow_UpdateSpeed(EnRuppecrow*, PlayState*); -void EnRuppecrow_FlyToDespawn(EnRuppecrow*, PlayState*); + +void EnRuppecrow_FallToDespawn(EnRuppecrow* this, PlayState* play); +void EnRuppecrow_HandleSongCutscene(EnRuppecrow* this, PlayState* play); +void EnRuppecrow_FlyWhileDroppingRupees(EnRuppecrow* this, PlayState* play); +void EnRuppecrow_FlyToDespawn(EnRuppecrow* this, PlayState* play); ActorInit En_Ruppecrow_InitVars = { /**/ ACTOR_EN_RUPPECROW, @@ -280,8 +267,7 @@ void EnRuppecrow_SpawnRupee(EnRuppecrow* this, PlayState* play) { if (EnRuppecrow_CanSpawnBlueRupees(play) && (this->rupeeIndex % 5) == 4) { if (this->rupeeIndex == 19) { rupee = (EnItem00*)Actor_Spawn(&play->actorCtx, play, ACTOR_EN_ITEM00, this->actor.world.pos.x + xOffset, - this->actor.world.pos.y, this->actor.world.pos.z, 0x0, 0x0, 0x0, - ITEM00_RUPEE_RED); + this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, ITEM00_RUPEE_RED); this->rupees[rupeeIndex] = rupee; this->rupees[rupeeIndex]->actor.gravity = -5.0f; this->rupees[rupeeIndex]->actor.velocity.y = 0.0f; @@ -290,9 +276,9 @@ void EnRuppecrow_SpawnRupee(EnRuppecrow* this, PlayState* play) { rupee->unk152 = 60; this->rupees[rupeeIndex]->actor.flags |= ACTOR_FLAG_10; } else { - rupee = (EnItem00*)Actor_Spawn(&play->actorCtx, play, ACTOR_EN_ITEM00, this->actor.world.pos.x + xOffset, - this->actor.world.pos.y, this->actor.world.pos.z, 0x0, 0x0, 0x0, - ITEM00_RUPEE_BLUE); + rupee = + (EnItem00*)Actor_Spawn(&play->actorCtx, play, ACTOR_EN_ITEM00, this->actor.world.pos.x + xOffset, + this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, ITEM00_RUPEE_BLUE); this->rupees[rupeeIndex] = rupee; this->rupees[rupeeIndex]->actor.gravity = -5.0f; this->rupees[rupeeIndex]->actor.velocity.y = 0.0f; @@ -302,9 +288,8 @@ void EnRuppecrow_SpawnRupee(EnRuppecrow* this, PlayState* play) { this->rupees[rupeeIndex]->actor.flags |= ACTOR_FLAG_10; } } else if (this->rupeeIndex == 19) { - rupee = - (EnItem00*)Actor_Spawn(&play->actorCtx, play, ACTOR_EN_ITEM00, this->actor.world.pos.x + xOffset, - this->actor.world.pos.y, this->actor.world.pos.z, 0x0, 0x0, 0x0, ITEM00_RUPEE_RED); + rupee = (EnItem00*)Actor_Spawn(&play->actorCtx, play, ACTOR_EN_ITEM00, this->actor.world.pos.x + xOffset, + this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, ITEM00_RUPEE_RED); this->rupees[rupeeIndex] = rupee; this->rupees[rupeeIndex]->actor.gravity = -5.0f; this->rupees[rupeeIndex]->actor.velocity.y = 0.0f; @@ -313,9 +298,8 @@ void EnRuppecrow_SpawnRupee(EnRuppecrow* this, PlayState* play) { rupee->unk152 = 60; this->rupees[rupeeIndex]->actor.flags |= ACTOR_FLAG_10; } else { - rupee = - (EnItem00*)Actor_Spawn(&play->actorCtx, play, ACTOR_EN_ITEM00, this->actor.world.pos.x + xOffset, - this->actor.world.pos.y, this->actor.world.pos.z, 0x0, 0x0, 0x0, ITEM00_RUPEE_GREEN); + rupee = (EnItem00*)Actor_Spawn(&play->actorCtx, play, ACTOR_EN_ITEM00, this->actor.world.pos.x + xOffset, + this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, ITEM00_RUPEE_GREEN); this->rupees[rupeeIndex] = rupee; this->rupees[rupeeIndex]->actor.gravity = -5.0f; this->rupees[rupeeIndex]->actor.velocity.y = 0.0f; @@ -348,7 +332,7 @@ void EnRuppecrow_UpdatePosition(EnRuppecrow* this, PlayState* play) { this->currentPoint--; } - if (this->actionFunc == EnRuppecrow_FlyWhileDroppingRupees && + if ((this->actionFunc == EnRuppecrow_FlyWhileDroppingRupees) && (!EnRuppecrow_CanSpawnBlueRupees(play) || (this->currentPoint % -2) == 0)) { EnRuppecrow_SpawnRupee(this, play); } @@ -360,7 +344,7 @@ void EnRuppecrow_UpdatePosition(EnRuppecrow* this, PlayState* play) { this->currentPoint++; } - if (this->actionFunc == EnRuppecrow_FlyWhileDroppingRupees && + if ((this->actionFunc == EnRuppecrow_FlyWhileDroppingRupees) && (!EnRuppecrow_CanSpawnBlueRupees(play) || (this->currentPoint % -2) == 0)) { EnRuppecrow_SpawnRupee(this, play); } @@ -591,17 +575,18 @@ void EnRuppecrow_FlyToDespawn(EnRuppecrow* this, PlayState* play) { Math_ApproachF(&this->actor.speed, this->speedModifier, 0.1f, 0.1f); Math_ApproachF(&this->actor.velocity.y, 3.0f, 0.2f, 0.5f); - if (this->actor.world.pos.y > 1000.0f || this->actor.xzDistToPlayer > 2000.0f) { + if ((this->actor.world.pos.y > 1000.0f) || (this->actor.xzDistToPlayer > 2000.0f)) { Actor_Kill(&this->actor); - } else { - this->yOffset += 0x800; - this->actor.shape.yOffset = Math_SinS(this->yOffset) * 500.0f; + return; + } - Actor_MoveWithGravity(&this->actor); + this->yOffset += 0x800; + this->actor.shape.yOffset = Math_SinS(this->yOffset) * 500.0f; - if ((play->state.frames % 43) == 0) { - Actor_PlaySfx(&this->actor, NA_SE_EN_KAICHO_CRY); - } + Actor_MoveWithGravity(&this->actor); + + if ((play->state.frames % 43) == 0) { + Actor_PlaySfx(&this->actor, NA_SE_EN_KAICHO_CRY); } } @@ -625,8 +610,8 @@ void EnRuppecrow_FallToDespawn(EnRuppecrow* this, PlayState* play) { if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || (this->actor.floorHeight == BGCHECK_Y_MIN)) { EnRuppecrow_ShatterIce(this, play); - func_800B3030(play, &this->actor.world.pos, &gZeroVec3f, &gZeroVec3f, (this->actor.scale.x * 10000.0f), 0x0, - 0x0); + func_800B3030(play, &this->actor.world.pos, &gZeroVec3f, &gZeroVec3f, (this->actor.scale.x * 10000.0f), 0, + 0); SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 0xB, NA_SE_EN_EXTINCT); Actor_Kill(&this->actor); diff --git a/src/overlays/actors/ovl_En_Ruppecrow/z_en_ruppecrow.h b/src/overlays/actors/ovl_En_Ruppecrow/z_en_ruppecrow.h index 40eee81024..61a97f8156 100644 --- a/src/overlays/actors/ovl_En_Ruppecrow/z_en_ruppecrow.h +++ b/src/overlays/actors/ovl_En_Ruppecrow/z_en_ruppecrow.h @@ -27,7 +27,7 @@ typedef struct EnRuppecrow { /* 0x144 */ EnItem00* rupees[ENRUPPECROW_RUPEE_COUNT]; /* 0x194 */ SkelAnime skelAnime; /* 0x1D8 */ EnRuppecrowActionFunc actionFunc; - /* 0x1DC */ UNK_TYPE4 unk_1DC; // unused + /* 0x1DC */ UNK_TYPE1 unk_1DC[0x4]; /* 0x1E0 */ Vec3s jointTable[OBJECT_CROW_LIMB_MAX]; /* 0x216 */ Vec3s morphTable[OBJECT_CROW_LIMB_MAX]; /* 0x24C */ Path* path; @@ -38,7 +38,7 @@ typedef struct EnRuppecrow { /* 0x2B8 */ f32 speedModifier; /* 0x2BC */ s16 rupeeIndex; /* 0x2BE */ s16 yOffset; - /* 0x2C0 */ UNK_TYPE4 unk_2C0; // unused + /* 0x2C0 */ UNK_TYPE1 unk_2C0[0x4]; /* 0x2C4 */ u8 currentEffect; /* 0x2C8 */ f32 unk_2C8; // set but not used /* 0x2CC */ f32 unk_2CC; // set but not used diff --git a/src/overlays/actors/ovl_En_Rz/z_en_rz.c b/src/overlays/actors/ovl_En_Rz/z_en_rz.c index 5fe348b22d..aff281f9ed 100644 --- a/src/overlays/actors/ovl_En_Rz/z_en_rz.c +++ b/src/overlays/actors/ovl_En_Rz/z_en_rz.c @@ -17,9 +17,9 @@ void EnRz_Update(Actor* thisx, PlayState* play); void EnRz_Draw(Actor* thisx, PlayState* play); void EnRz_ActorShadowFunc(Actor* thisx, Lights* mapper, PlayState* play); -void EnRz_ChangeAnim(PlayState*, EnRz*, s16 animIndex, u8 animMode, f32 morphFrames); +void EnRz_ChangeAnim(PlayState* play, EnRz* this, s16 animIndex, u8 animMode, f32 morphFrames); s32 EnRz_SetupPath(EnRz* this, PlayState* play); -EnRz* EnRz_FindSister(EnRz* this, PlayState*); +EnRz* EnRz_FindSister(EnRz* this, PlayState* play); void func_80BFC058(EnRz* this, PlayState* play); void func_80BFC078(EnRz* this, PlayState* play); void func_80BFC3F8(EnRz* this, PlayState* play); @@ -196,17 +196,26 @@ void EnRz_ActorShadowFunc(Actor* thisx, Lights* mapper, PlayState* play) { void EnRz_ChangeAnim(PlayState* play, EnRz* this, s16 animIndex, u8 animMode, f32 morphFrames) { // N.B. both of these arrays must be the same length due to how the animations are chosen static AnimationHeader* sJudoAnimations[] = { - &gRosaSistersThinkingAnim, &gRosaSistersStandingAnim, &gRosaSistersWalkingWhileThinkingAnim, - &gRosaSistersSittingAnim, &gRosaSistersApplaudingAnim, &gRosaSistersOnKneesAnim, - &gRosaSistersDancingAnim, + &gRosaSistersThinkingAnim, // EN_RZ_ANIM_THINKING + &gRosaSistersStandingAnim, // EN_RZ_ANIM_STANDING + &gRosaSistersWalkingWhileThinkingAnim, // EN_RZ_ANIM_WALKING + &gRosaSistersSittingAnim, // EN_RZ_ANIM_SITTING + &gRosaSistersApplaudingAnim, // EN_RZ_ANIM_APPLAUDING + &gRosaSistersOnKneesAnim, // EN_RZ_ANIM_ON_KNEES + &gRosaSistersDancingAnim, // EN_RZ_ANIM_DANCE }; static AnimationHeader* sMarillaAnimations[] = { - &gRosaSistersStandingAnim, &gRosaSistersStandingAnim, &gRosaSistersWalkingAnim, &gRosaSistersSittingAnim, - &gRosaSistersApplaudingAnim, &gRosaSistersOnKneesAnim, &gRosaSistersDancingAnim, + &gRosaSistersStandingAnim, // EN_RZ_ANIM_THINKING + &gRosaSistersStandingAnim, // EN_RZ_ANIM_STANDING + &gRosaSistersWalkingAnim, // EN_RZ_ANIM_WALKING + &gRosaSistersSittingAnim, // EN_RZ_ANIM_SITTING + &gRosaSistersApplaudingAnim, // EN_RZ_ANIM_APPLAUDING + &gRosaSistersOnKneesAnim, // EN_RZ_ANIM_ON_KNEES + &gRosaSistersDancingAnim, // EN_RZ_ANIM_DANCE }; static PlayerAnimationHeader* sPlayerAnimations[] = { - &gPlayerAnim_link_normal_wait_free, - &gPlayerAnim_alink_dance_loop, + &gPlayerAnim_link_normal_wait_free, // EN_RZ_ANIM_LINK_NORMAL_WAIT_FREE + &gPlayerAnim_alink_dance_loop, // EN_RZ_ANIM_LINK_DANCE }; f32 endFrame; AnimationHeader** animationPtr; @@ -239,11 +248,11 @@ void EnRz_ChangeAnim(PlayState* play, EnRz* this, s16 animIndex, u8 animMode, f3 } } -void func_80BFB9E4(PlayState* play, EnRz* this, s16 animIndex) { +void EnRz_ChangeAnimLoopMorph(PlayState* play, EnRz* this, s16 animIndex) { EnRz_ChangeAnim(play, this, animIndex, ANIMMODE_LOOP, -5.0f); } -void func_80BFBA1C(PlayState* play, EnRz* this, s16 animIndex) { +void EnRz_ChangeAnimLoop(PlayState* play, EnRz* this, s16 animIndex) { EnRz_ChangeAnim(play, this, animIndex, ANIMMODE_LOOP, 0.0f); } @@ -286,7 +295,7 @@ EnRzPathStatus EnRz_GetPathStatus(EnRz* this) { diffX = curPoint->x - this->actor.world.pos.x; diffZ = curPoint->z - this->actor.world.pos.z; this->actor.world.rot.y = Math_Atan2S(diffX, diffZ); - Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.world.rot.y, 2, 0x07D0, 0xC8); + Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.world.rot.y, 2, 0x7D0, 0xC8); if ((SQ(diffX) + SQ(diffZ)) < SQ(10.0f)) { if (this->stateFlags & EN_RZ_STATE_1) { @@ -373,19 +382,22 @@ s32 func_80BFBE70(EnRz* this, PlayState* play) { this->cueId = cueId; switch (this->cueId) { case 1: - func_80BFBA1C(play, this, EN_RZ_ANIM_STANDING); + EnRz_ChangeAnimLoop(play, this, EN_RZ_ANIM_STANDING); break; case 2: - func_80BFBA1C(play, this, EN_RZ_ANIM_ON_KNEES); + EnRz_ChangeAnimLoop(play, this, EN_RZ_ANIM_ON_KNEES); break; case 3: - func_80BFBA1C(play, this, EN_RZ_ANIM_APPLAUDING); + EnRz_ChangeAnimLoop(play, this, EN_RZ_ANIM_APPLAUDING); break; case 4: - func_80BFBA1C(play, this, EN_RZ_ANIM_LINK_DANCE); + EnRz_ChangeAnimLoop(play, this, EN_RZ_ANIM_LINK_DANCE); + break; + + default: break; } } @@ -434,9 +446,9 @@ void func_80BFC078(EnRz* this, PlayState* play) { Message_CloseTextbox(play); this->actionFunc = func_80BFC3F8; if (this->animIndex != EN_RZ_ANIM_LINK_DANCE) { - func_80BFB9E4(play, this, EN_RZ_ANIM_DANCE); + EnRz_ChangeAnimLoopMorph(play, this, EN_RZ_ANIM_DANCE); if (this->sister != NULL) { - func_80BFB9E4(play, this->sister, EN_RZ_ANIM_DANCE); + EnRz_ChangeAnimLoopMorph(play, this->sister, EN_RZ_ANIM_DANCE); } } break; @@ -455,9 +467,9 @@ void func_80BFC19C(EnRz* this, PlayState* play) { EnRz_UpdateSkelAnime(this, play); if (!func_80BFBE70(this, play)) { this->actionFunc = func_80BFC3F8; - func_80BFBA1C(play, this, EN_RZ_ANIM_LINK_DANCE); + EnRz_ChangeAnimLoop(play, this, EN_RZ_ANIM_LINK_DANCE); if (this->sister != NULL) { - func_80BFBA1C(play, this->sister, EN_RZ_ANIM_LINK_DANCE); + EnRz_ChangeAnimLoop(play, this->sister, EN_RZ_ANIM_LINK_DANCE); } } } @@ -601,12 +613,12 @@ void func_80BFC7E0(EnRz* this, PlayState* play) { this->timer--; } else { this->actionFunc = EnRz_Walk; - func_80BFB9E4(play, this, EN_RZ_ANIM_WALKING); + EnRz_ChangeAnimLoopMorph(play, this, EN_RZ_ANIM_WALKING); } if (Actor_TalkOfferAccepted(&this->actor, &play->state)) { this->actionFunc = func_80BFC728; - func_80BFB9E4(play, this, EN_RZ_ANIM_THINKING); + EnRz_ChangeAnimLoopMorph(play, this, EN_RZ_ANIM_THINKING); this->actor.speed = 0.0f; func_80BFBDFC(play); } else if (EnRz_CanTalk(this, play)) { @@ -618,7 +630,7 @@ void EnRz_StopToThink(EnRz* this, PlayState* play) { this->timer = 100; this->actionFunc = func_80BFC7E0; this->actor.speed = 0.0f; - func_80BFB9E4(play, this, EN_RZ_ANIM_THINKING); + EnRz_ChangeAnimLoopMorph(play, this, EN_RZ_ANIM_THINKING); } void EnRz_Walk(EnRz* this, PlayState* play) { @@ -641,7 +653,7 @@ void EnRz_Walk(EnRz* this, PlayState* play) { if (Actor_TalkOfferAccepted(&this->actor, &play->state)) { this->actionFunc = func_80BFC728; - func_80BFB9E4(play, this, EN_RZ_ANIM_THINKING); + EnRz_ChangeAnimLoopMorph(play, this, EN_RZ_ANIM_THINKING); this->actor.speed = 0.0f; func_80BFBDFC(play); } else if (EnRz_CanTalk(this, play)) { diff --git a/src/overlays/actors/ovl_En_Scopenuts/z_en_scopenuts.c b/src/overlays/actors/ovl_En_Scopenuts/z_en_scopenuts.c index f1a3dc763a..ea8dab25a3 100644 --- a/src/overlays/actors/ovl_En_Scopenuts/z_en_scopenuts.c +++ b/src/overlays/actors/ovl_En_Scopenuts/z_en_scopenuts.c @@ -211,7 +211,7 @@ void func_80BCB078(EnScopenuts* this, PlayState* play) { if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { sp30.y = this->actor.wallYaw; } - Math_SmoothStepToS(&this->actor.world.rot.y, sp30.y, 10, 300, 0); + Math_SmoothStepToS(&this->actor.world.rot.y, sp30.y, 10, 0x12C, 0); this->actor.shape.rot.y = this->actor.world.rot.y; this->unk_33E = 0x1000; this->unk_340 += 0x1C71; @@ -293,7 +293,7 @@ void func_80BCB4DC(EnScopenuts* this, PlayState* play) { } void func_80BCB52C(EnScopenuts* this, PlayState* play) { - Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 3, 2000, 0); + Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 3, 0x7D0, 0); this->actor.world.rot.y = this->actor.shape.rot.y; if (Actor_TalkOfferAccepted(&this->actor, &play->state)) { this->unk_33C = func_80BCAF0C(this); @@ -508,7 +508,7 @@ void func_80BCBD28(EnScopenuts* this, PlayState* play) { this->actor.shape.yOffset = 1500.0f; } - Math_SmoothStepToS(&this->actor.shape.rot.y, this->unk_372, 3, 2000, 0); + Math_SmoothStepToS(&this->actor.shape.rot.y, this->unk_372, 3, 0x7D0, 0); this->actor.world.rot.y = this->actor.shape.rot.y; if (DECR(this->unk_34E) == 0) { @@ -569,9 +569,9 @@ void func_80BCBFFC(EnScopenuts* this, PlayState* play) { } if (this->unk_334 < 6) { - Math_SmoothStepToS(&this->actor.world.rot.y, sp38.y, 10, 300, 0); + Math_SmoothStepToS(&this->actor.world.rot.y, sp38.y, 10, 0x12C, 0); } else { - Math_SmoothStepToS(&this->actor.world.rot.y, sp38.y, 10, 1500, 0); + Math_SmoothStepToS(&this->actor.world.rot.y, sp38.y, 10, 0x5DC, 0); } this->actor.shape.rot.y = this->actor.world.rot.y; diff --git a/src/overlays/actors/ovl_En_Sob1/z_en_sob1.c b/src/overlays/actors/ovl_En_Sob1/z_en_sob1.c index b0d7a2f8e9..a34d57308a 100644 --- a/src/overlays/actors/ovl_En_Sob1/z_en_sob1.c +++ b/src/overlays/actors/ovl_En_Sob1/z_en_sob1.c @@ -743,7 +743,7 @@ void EnSob1_EndWalk(EnSob1* this, PlayState* play) { Math_SmoothStepToS(&this->actor.world.rot.y, EnSob1_GetDistSqAndOrient(this->path, this->waypoint - 1, &this->actor.world.pos, &distSq), 4, - 1000, 1); + 0x3E8, 1); this->actor.shape.rot.y = this->actor.world.rot.y; Math_ApproachF(&this->actor.speed, 0.5f, 0.2f, 1.0f); if (distSq < 12.0f) { @@ -782,7 +782,7 @@ void EnSob1_Walk(EnSob1* this, PlayState* play) { if (this->path != NULL) { Math_SmoothStepToS(&this->actor.world.rot.y, EnSob1_GetDistSqAndOrient(this->path, this->waypoint, &this->actor.world.pos, &distSq), 4, - 1000, 1); + 0x3E8, 1); this->actor.shape.rot.y = this->actor.world.rot.y; this->actor.speed = 2.0f; if (distSq < SQ(5.0f)) { diff --git a/src/overlays/actors/ovl_En_Ssh/z_en_ssh.c b/src/overlays/actors/ovl_En_Ssh/z_en_ssh.c index 6d8d2af62e..af407d897a 100644 --- a/src/overlays/actors/ovl_En_Ssh/z_en_ssh.c +++ b/src/overlays/actors/ovl_En_Ssh/z_en_ssh.c @@ -287,7 +287,7 @@ s32 EnSsh_Damaged(EnSsh* this) { } if (DECR(this->stunTimer) != 0) { - Math_SmoothStepToS(&this->maxTurnRate, 10000, 10, 1000, 1); + Math_SmoothStepToS(&this->maxTurnRate, 0x2710, 10, 0x3E8, 1); return false; } @@ -310,9 +310,9 @@ void EnSsh_Turn(EnSsh* this, PlayState* play) { } if (DECR(this->spinTimer) != 0) { - this->actor.world.rot.y += (s16)(10000.0f * (this->spinTimer / 30.0f)); + this->actor.world.rot.y += (s16)(0x2710 * (this->spinTimer / 30.0f)); } else if ((this->swayTimer == 0) && (this->stunTimer == 0)) { - Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 4, 10000, 1); + Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 4, 0x2710, 1); } this->actor.shape.rot.y = this->actor.world.rot.y; } diff --git a/src/overlays/actors/ovl_En_Sth/z_en_sth.c b/src/overlays/actors/ovl_En_Sth/z_en_sth.c index 40d9269d2c..1ac8d5b42a 100644 --- a/src/overlays/actors/ovl_En_Sth/z_en_sth.c +++ b/src/overlays/actors/ovl_En_Sth/z_en_sth.c @@ -689,8 +689,8 @@ void EnSth_Update(Actor* thisx, PlayState* play) { Actor_TrackPlayer(play, &this->actor, &this->headRot, &torsoRot, this->actor.focus.pos); } else { - Math_SmoothStepToS(&this->headRot.x, 0, 6, 6200, 100); - Math_SmoothStepToS(&this->headRot.y, 0, 6, 6200, 100); + Math_SmoothStepToS(&this->headRot.x, 0, 6, 0x1838, 0x64); + Math_SmoothStepToS(&this->headRot.y, 0, 6, 0x1838, 0x64); } } diff --git a/src/overlays/actors/ovl_En_Sth2/z_en_sth2.c b/src/overlays/actors/ovl_En_Sth2/z_en_sth2.c index 9859a3054d..232dffc5c1 100644 --- a/src/overlays/actors/ovl_En_Sth2/z_en_sth2.c +++ b/src/overlays/actors/ovl_En_Sth2/z_en_sth2.c @@ -85,8 +85,8 @@ s32 EnSth2_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* } if ((limbIndex == STH_LIMB_CHEST) || (limbIndex == STH_LIMB_LEFT_FOREARM) || (limbIndex == STH_LIMB_RIGHT_FOREARM)) { - rot->y += (s16)(Math_SinS((play->state.frames * ((limbIndex * 50) + 0x814))) * 200.0f); - rot->z += (s16)(Math_CosS((play->state.frames * ((limbIndex * 50) + 0x940))) * 200.0f); + rot->y += (s16)(Math_SinS(play->state.frames * ((limbIndex * 50) + 0x814)) * 200.0f); + rot->z += (s16)(Math_CosS(play->state.frames * ((limbIndex * 50) + 0x940)) * 200.0f); } return false; } diff --git a/src/overlays/actors/ovl_En_Talk_Gibud/z_en_talk_gibud.c b/src/overlays/actors/ovl_En_Talk_Gibud/z_en_talk_gibud.c index 4866c7d7fd..2b5d2c9f54 100644 --- a/src/overlays/actors/ovl_En_Talk_Gibud/z_en_talk_gibud.c +++ b/src/overlays/actors/ovl_En_Talk_Gibud/z_en_talk_gibud.c @@ -55,13 +55,13 @@ typedef struct { /* 0xC */ s16 isBottledItem; } EnTalkGibudRequestedItem; // size = 0x10 -typedef enum { +typedef enum EnTalkGibudRequestedItemState { /* 0 */ EN_TALK_GIBUD_REQUESTED_ITEM_MET, /* 1 */ EN_TALK_GIBUD_REQUESTED_ITEM_NOT_ENOUGH_AMMO, /* 2 */ EN_TALK_GIBUD_REQUESTED_ITEM_NOT_MET } EnTalkGibudRequestedItemState; -typedef enum { +typedef enum EnTalkGibudRequestedItemIndex { /* 0 */ EN_TALK_GIBUD_REQUESTED_ITEM_INDEX_BLUE_POTION, /* 1 */ EN_TALK_GIBUD_REQUESTED_ITEM_INDEX_BEANS, /* 2 */ EN_TALK_GIBUD_REQUESTED_ITEM_INDEX_SPRING_WATER, @@ -74,7 +74,7 @@ typedef enum { /* 9 */ EN_TALK_GIBUD_REQUESTED_ITEM_INDEX_MILK } EnTalkGibudRequestedItemIndex; -typedef enum { +typedef enum EnTalkGibudAnimation { /* 0 */ EN_TALK_GIBUD_ANIM_GRAB_ATTACK, /* 1 */ EN_TALK_GIBUD_ANIM_GRAB_END, /* 2 */ EN_TALK_GIBUD_ANIM_GRAB_START, @@ -91,12 +91,12 @@ typedef enum { /* 13 */ EN_TALK_GIBUD_ANIM_DANCE_CLAP } EnTalkGibudAnimation; -typedef enum { +typedef enum EnTalkGibudType { /* 0 */ EN_TALK_GIBUD_TYPE_GIBDO, /* 1 */ EN_TALK_GIBUD_TYPE_REDEAD } EnTalkGibudType; -typedef enum { +typedef enum EnTalkGibudGrabState { /* 0 */ EN_TALK_GIBUD_GRAB_START, /* 1 */ EN_TALK_GIBUD_GRAB_ATTACK, /* 2 */ EN_TALK_GIBUD_GRAB_RELEASE @@ -295,8 +295,8 @@ void EnTalkGibud_Idle(EnTalkGibud* this, PlayState* play) { EnTalkGibud_SetupAttemptPlayerFreeze(this); } - Math_SmoothStepToS(&this->headRotation.y, 0, 1, 0x64, 0); - Math_SmoothStepToS(&this->upperBodyRotation.y, 0, 1, 0x64, 0); + Math_SmoothStepToS(&this->headRot.y, 0, 1, 0x64, 0); + Math_SmoothStepToS(&this->torsoRot.y, 0, 1, 0x64, 0); } void EnTalkGibud_SetupAttemptPlayerFreeze(EnTalkGibud* this) { @@ -306,7 +306,7 @@ void EnTalkGibud_SetupAttemptPlayerFreeze(EnTalkGibud* this) { void EnTalkGibud_AttemptPlayerFreeze(EnTalkGibud* this, PlayState* play) { Player* player = GET_PLAYER(play); - s16 rot = this->actor.shape.rot.y + this->headRotation.y + this->upperBodyRotation.y; + s16 rot = this->actor.shape.rot.y + this->headRot.y + this->torsoRot.y; s16 yaw = BINANG_SUB(this->actor.yawTowardsPlayer, rot); if (ABS_ALT(yaw) < 0x2008) { @@ -339,8 +339,8 @@ void EnTalkGibud_WalkToPlayer(EnTalkGibud* this, PlayState* play) { Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0xFA); this->actor.world.rot = this->actor.shape.rot; - Math_SmoothStepToS(&this->headRotation.y, 0, 1, 0x64, 0); - Math_SmoothStepToS(&this->upperBodyRotation.y, 0, 1, 0x64, 0); + Math_SmoothStepToS(&this->headRot.y, 0, 1, 0x64, 0); + Math_SmoothStepToS(&this->torsoRot.y, 0, 1, 0x64, 0); if (EnTalkGibud_PlayerInRangeWithCorrectState(this, play) && Actor_IsFacingPlayer(&this->actor, 0x38E3)) { if ((this->grabWaitTimer == 0) && (this->actor.xzDistToPlayer <= 45.0f)) { @@ -459,8 +459,8 @@ void EnTalkGibud_GrabFail(EnTalkGibud* this, PlayState* play) { } this->actor.world.rot.y = this->actor.yawTowardsPlayer; - Math_SmoothStepToS(&this->headRotation.y, 0, 1, 0x12C, 0); - Math_SmoothStepToS(&this->upperBodyRotation.y, 0, 1, 0x12C, 0); + Math_SmoothStepToS(&this->headRot.y, 0, 1, 0x12C, 0); + Math_SmoothStepToS(&this->torsoRot.y, 0, 1, 0x12C, 0); if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { this->actor.world.rot.y = this->actor.shape.rot.y; EnTalkGibud_SetupTurnAwayAndShakeHead(this); @@ -474,14 +474,13 @@ void EnTalkGibud_SetupTurnAwayAndShakeHead(EnTalkGibud* this) { } void EnTalkGibud_TurnAwayAndShakeHead(EnTalkGibud* this, PlayState* play) { - Math_SmoothStepToS(&this->actor.world.rot.y, BINANG_ROT180(this->actor.yawTowardsPlayer), 5, 3500, 200); + Math_SmoothStepToS(&this->actor.world.rot.y, BINANG_ROT180(this->actor.yawTowardsPlayer), 5, 0xDAC, 0xC8); this->actor.shape.rot.y = this->actor.world.rot.y; if (this->headShakeTimer > 60) { EnTalkGibud_SetupWalkToHome(this); this->playerStunWaitTimer = 0; } else { - this->headRotation.y = - Math_SinS(this->headShakeTimer * 4000) * (0x256F * ((60 - this->headShakeTimer) / 60.0f)); + this->headRot.y = Math_SinS(this->headShakeTimer * 4000) * (0x256F * ((60 - this->headShakeTimer) / 60.0f)); this->headShakeTimer++; } } @@ -493,8 +492,8 @@ void EnTalkGibud_SetupWalkToHome(EnTalkGibud* this) { } void EnTalkGibud_WalkToHome(EnTalkGibud* this, PlayState* play) { - Math_SmoothStepToS(&this->headRotation.y, 0, 1, 100, 0); - Math_SmoothStepToS(&this->upperBodyRotation.y, 0, 1, 100, 0); + Math_SmoothStepToS(&this->headRot.y, 0, 1, 0x64, 0); + Math_SmoothStepToS(&this->torsoRot.y, 0, 1, 0x64, 0); if (Actor_WorldDistXZToPoint(&this->actor, &this->actor.home.pos) < 5.0f) { if (this->actor.speed > 0.2f) { this->actor.speed -= 0.2f; @@ -502,14 +501,14 @@ void EnTalkGibud_WalkToHome(EnTalkGibud* this, PlayState* play) { this->actor.speed = 0.0f; } - Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.home.rot.y, 1, 200, 10); + Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.home.rot.y, 1, 0xC8, 0xA); this->actor.world.rot.y = this->actor.shape.rot.y; if (this->actor.world.rot.y == this->actor.home.rot.y) { EnTalkGibud_SetupIdle(this); } } else { Math_ScaledStepToS(&this->actor.shape.rot.y, Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos), - 450); + 0x1C2); this->actor.world.rot = this->actor.shape.rot; } if (EnTalkGibud_PlayerInRangeWithCorrectState(this, play)) { @@ -596,8 +595,8 @@ void EnTalkGibud_Dead(EnTalkGibud* this, PlayState* play) { if (this->deathTimer > 300) { EnTalkGibud_SetupRevive(this); } else { - Math_SmoothStepToS(&this->headRotation.y, 0, 1, 250, 0); - Math_SmoothStepToS(&this->upperBodyRotation.y, 0, 1, 250, 0); + Math_SmoothStepToS(&this->headRot.y, 0, 1, 0xFA, 0); + Math_SmoothStepToS(&this->torsoRot.y, 0, 1, 0xFA, 0); this->deathTimer++; } @@ -786,12 +785,12 @@ void EnTalkGibud_PassiveIdle(EnTalkGibud* this, PlayState* play) { this->textId = 0x1388; Actor_PlaySfx(&this->actor, NA_SE_EN_REDEAD_AIM); EnTalkGibud_SetupTalk(this); - } else if (this->actor.xzDistToPlayer < 100.0f && !(this->collider.base.acFlags & AC_HIT)) { - Actor_TrackPlayer(play, &this->actor, &this->headRotation, &this->upperBodyRotation, this->actor.focus.pos); + } else if ((this->actor.xzDistToPlayer < 100.0f) && !(this->collider.base.acFlags & AC_HIT)) { + Actor_TrackPlayer(play, &this->actor, &this->headRot, &this->torsoRot, this->actor.focus.pos); Actor_OfferTalk(&this->actor, play, 100.0f); } else { - Math_SmoothStepToS(&this->headRotation.y, 0, 1, 100, 0); - Math_SmoothStepToS(&this->upperBodyRotation.y, 0, 1, 100, 0); + Math_SmoothStepToS(&this->headRot.y, 0, 1, 0x64, 0); + Math_SmoothStepToS(&this->torsoRot.y, 0, 1, 0x64, 0); } } @@ -895,9 +894,9 @@ void EnTalkGibud_FacePlayerWhenTalking(EnTalkGibud* this, PlayState* play) { Math_ScaledStepToS(&this->actor.shape.rot.y, target, 0x320); target -= this->actor.shape.rot.y; this->actor.world.rot.y = this->actor.shape.rot.y; - Math_ScaledStepToS(&this->upperBodyRotation.y, target, 0x258); - target -= this->upperBodyRotation.y; - Math_ScaledStepToS(&this->headRotation.y, target, 0x190); + Math_ScaledStepToS(&this->torsoRot.y, target, 0x258); + target -= this->torsoRot.y; + Math_ScaledStepToS(&this->headRot.y, target, 0x190); } s32 EnTalkGibud_PlayerInRangeWithCorrectState(EnTalkGibud* this, PlayState* play) { @@ -955,22 +954,22 @@ void EnTalkGibud_CheckForGibdoMask(EnTalkGibud* this, PlayState* play) { } void EnTalkGibud_TurnTowardsPlayer(EnTalkGibud* this, PlayState* play) { - s16 headAngle = (this->actor.yawTowardsPlayer - this->actor.shape.rot.y) - this->upperBodyRotation.y; + s16 headAngle = this->actor.yawTowardsPlayer - this->actor.shape.rot.y - this->torsoRot.y; s16 upperBodyAngle = CLAMP(headAngle, -500, 500); - headAngle -= this->headRotation.y; + headAngle -= this->headRot.y; headAngle = CLAMP(headAngle, -500, 500); if (BINANG_SUB(this->actor.yawTowardsPlayer, this->actor.shape.rot.y) >= 0) { - this->upperBodyRotation.y += ABS_ALT(upperBodyAngle); - this->headRotation.y += ABS_ALT(headAngle); + this->torsoRot.y += ABS_ALT(upperBodyAngle); + this->headRot.y += ABS_ALT(headAngle); } else { - this->upperBodyRotation.y -= ABS_ALT(upperBodyAngle); - this->headRotation.y -= ABS_ALT(headAngle); + this->torsoRot.y -= ABS_ALT(upperBodyAngle); + this->headRot.y -= ABS_ALT(headAngle); } - this->upperBodyRotation.y = CLAMP(this->upperBodyRotation.y, -0x495F, 0x495F); - this->headRotation.y = CLAMP(this->headRotation.y, -0x256F, 0x256F); + this->torsoRot.y = CLAMP(this->torsoRot.y, -0x495F, 0x495F); + this->headRot.y = CLAMP(this->headRot.y, -0x256F, 0x256F); } /** @@ -1169,9 +1168,9 @@ s32 EnTalkGibud_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Ve EnTalkGibud* this = THIS; if (limbIndex == GIBDO_LIMB_UPPER_BODY_ROOT) { - rot->y += this->upperBodyRotation.y; + rot->y += this->torsoRot.y; } else if (limbIndex == GIBDO_LIMB_HEAD_ROOT) { - rot->y += this->headRotation.y; + rot->y += this->headRot.y; } return false; diff --git a/src/overlays/actors/ovl_En_Talk_Gibud/z_en_talk_gibud.h b/src/overlays/actors/ovl_En_Talk_Gibud/z_en_talk_gibud.h index eb11218017..ccb141112c 100644 --- a/src/overlays/actors/ovl_En_Talk_Gibud/z_en_talk_gibud.h +++ b/src/overlays/actors/ovl_En_Talk_Gibud/z_en_talk_gibud.h @@ -47,8 +47,8 @@ typedef struct EnTalkGibud { /* 0x2A4 */ Vec3s jointTable[GIBDO_LIMB_MAX]; /* 0x340 */ Vec3s morphTable[GIBDO_LIMB_MAX]; /* 0x3DC */ s16 textId; - /* 0x3DE */ Vec3s headRotation; - /* 0x3E4 */ Vec3s upperBodyRotation; + /* 0x3DE */ Vec3s headRot; + /* 0x3E4 */ Vec3s torsoRot; /* 0x3EA */ union { s16 playerStunWaitTimer; // Cannot stun the player if this is non-zero s16 grabDamageTimer; diff --git a/src/overlays/actors/ovl_En_Tite/z_en_tite.c b/src/overlays/actors/ovl_En_Tite/z_en_tite.c index 3fa739f616..ad6f8ed060 100644 --- a/src/overlays/actors/ovl_En_Tite/z_en_tite.c +++ b/src/overlays/actors/ovl_En_Tite/z_en_tite.c @@ -318,7 +318,7 @@ void func_80894024(EnTite* this, PlayState* play) { func_8089408C(this, play); } else { func_80893B70(this); - Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 1000); + Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0x3E8); this->actor.world.rot.y = this->actor.shape.rot.y; } } @@ -411,7 +411,7 @@ void func_80894454(EnTite* this, PlayState* play) { func_80893A9C(this, play); } } else { - Math_ScaledStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 1500); + Math_ScaledStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 0x5DC); func_80893B70(this); } } @@ -518,7 +518,7 @@ void func_80894910(EnTite* this, PlayState* play) { (func_80893ADC(this) && (this->actor.depthInWater > 0.0f))) && (this->actor.velocity.y <= 0.0f)) { this->actor.speed = 0.0f; - Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 4000); + Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0xFA0); this->actor.world.rot.y = this->actor.shape.rot.y; if (func_80893ADC(this)) { @@ -537,7 +537,7 @@ void func_80894910(EnTite* this, PlayState* play) { func_8089484C(this); } } else { - Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 1000); + Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0x3E8); } } @@ -701,7 +701,7 @@ void func_808952EC(EnTite* this) { } void func_80895424(EnTite* this, PlayState* play) { - Math_ScaledStepToS(&this->actor.shape.rot.z, -0x8000, 4000); + Math_ScaledStepToS(&this->actor.shape.rot.z, -0x8000, 0xFA0); if (this->unk_2B8 != 0) { this->unk_2B8--; } else { @@ -738,7 +738,7 @@ void func_808955E4(EnTite* this) { } void func_80895640(EnTite* this, PlayState* play) { - Math_ScaledStepToS(&this->actor.shape.rot.z, 0, 4000); + Math_ScaledStepToS(&this->actor.shape.rot.z, 0, 0xFA0); SkelAnime_Update(&this->skelAnime); if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->collider.base.acFlags |= AC_ON; @@ -1073,9 +1073,9 @@ void EnTite_Update(Actor* thisx, PlayState* play) { this->actor.shape.rot.z = BINANG_ROT180(this->actor.shape.rot.z); } } else { - Math_ScaledStepToS(&this->actor.shape.rot.x, 0, 1000); + Math_ScaledStepToS(&this->actor.shape.rot.x, 0, 0x3E8); if (this->unk_2B9 == 0) { - Math_ScaledStepToS(&this->actor.shape.rot.z, 0, 1000); + Math_ScaledStepToS(&this->actor.shape.rot.z, 0, 0x3E8); if (this->actor.shape.yOffset > 0.0f) { this->actor.shape.yOffset -= 400.0f; } diff --git a/src/overlays/actors/ovl_En_Toto/z_en_toto.c b/src/overlays/actors/ovl_En_Toto/z_en_toto.c index f13d0d0c1e..d3c5c07dba 100644 --- a/src/overlays/actors/ovl_En_Toto/z_en_toto.c +++ b/src/overlays/actors/ovl_En_Toto/z_en_toto.c @@ -302,7 +302,7 @@ void func_80BA3BFC(EnToto* this, PlayState* play) { } void func_80BA3C88(EnToto* this) { - Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 4, 4000, 800); + Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 4, 0xFA0, 0x320); } void func_80BA3CC4(EnToto* this, PlayState* play) { diff --git a/src/overlays/actors/ovl_En_Trt2/z_en_trt2.c b/src/overlays/actors/ovl_En_Trt2/z_en_trt2.c index f7a316b49d..8d1435f8d3 100644 --- a/src/overlays/actors/ovl_En_Trt2/z_en_trt2.c +++ b/src/overlays/actors/ovl_En_Trt2/z_en_trt2.c @@ -168,7 +168,7 @@ void func_80AD3530(EnTrt2* this, PlayState* play) { if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { phi_a1 = this->actor.wallYaw; } - Math_SmoothStepToS(&this->actor.world.rot.y, phi_a1, 4, 1000, 1); + Math_SmoothStepToS(&this->actor.world.rot.y, phi_a1, 4, 0x3E8, 1); this->actor.shape.rot.y = this->actor.world.rot.y; if (EnTrt2_HasReachedPoint(this, this->path, this->unk_1E4)) { if (this->unk_1E4 >= (this->path->count - 1)) { @@ -257,9 +257,9 @@ void func_80AD38B8(EnTrt2* this, PlayState* play) { if (this->path != NULL) { func_80AD49B8(this->path, this->unk_1E4, &this->actor.world.pos, &sp30); - Math_SmoothStepToS(&this->actor.world.rot.y, sp30.y, 4, 1000, 1); + Math_SmoothStepToS(&this->actor.world.rot.y, sp30.y, 4, 0x3E8, 1); this->actor.shape.rot.y = this->actor.world.rot.y; - Math_SmoothStepToS(&this->actor.shape.rot.x, sp30.x, 4, 1000, 1); + Math_SmoothStepToS(&this->actor.shape.rot.x, sp30.x, 4, 0x3E8, 1); this->actor.world.rot.x = -this->actor.shape.rot.x; if (EnTrt2_HasReachedPoint(this, this->path, this->unk_1E4)) { if (this->unk_1E4 >= (this->path->count - 1)) { @@ -320,8 +320,8 @@ void func_80AD3B6C(EnTrt2* this, PlayState* play) { void func_80AD3BE4(EnTrt2* this, PlayState* play) { s16 sp2E = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; - Math_ScaledStepToS(&this->unk_3C0, sp2E, 400); - Math_SmoothStepToS(&this->unk_3C0, sp2E, 4, 10000, 0); + Math_ScaledStepToS(&this->unk_3C0, sp2E, 0x190); + Math_SmoothStepToS(&this->unk_3C0, sp2E, 4, 0x2710, 0); this->actor.world.rot.y += this->unk_3C0; this->actor.shape.rot.y = this->actor.world.rot.y; if (this->actor.world.pos.y < 5.0f) { diff --git a/src/overlays/actors/ovl_En_Tru_Mt/z_en_tru_mt.c b/src/overlays/actors/ovl_En_Tru_Mt/z_en_tru_mt.c index 8ecc2a1ddf..d54c585b45 100644 --- a/src/overlays/actors/ovl_En_Tru_Mt/z_en_tru_mt.c +++ b/src/overlays/actors/ovl_En_Tru_Mt/z_en_tru_mt.c @@ -315,7 +315,7 @@ void func_80B7679C(EnTruMt* this, PlayState* play) { Vec3f sp40; Vec3f sp34; - Math_SmoothStepToS(&this->unk_34A, (this->actor.yawTowardsPlayer - this->actor.shape.rot.y) - 0x4000, 4, 0x38E0, 1); + Math_SmoothStepToS(&this->unk_34A, this->actor.yawTowardsPlayer - this->actor.shape.rot.y - 0x4000, 4, 0x38E0, 1); this->unk_34A = CLAMP(this->unk_34A, -0x38E0, 0x38E0); sp40 = player->actor.world.pos; diff --git a/src/overlays/actors/ovl_En_Tsn/z_en_tsn.c b/src/overlays/actors/ovl_En_Tsn/z_en_tsn.c index 5740b90f9e..2b6b27459d 100644 --- a/src/overlays/actors/ovl_En_Tsn/z_en_tsn.c +++ b/src/overlays/actors/ovl_En_Tsn/z_en_tsn.c @@ -574,12 +574,12 @@ void EnTsn_Update(Actor* thisx, PlayState* play) { SkelAnime_Update(&this->skelAnime); if (this->unk_220 & 1) { - Actor_TrackPlayer(play, &this->actor, &this->unk_222, &this->unk_228, this->actor.focus.pos); + Actor_TrackPlayer(play, &this->actor, &this->headRot, &this->torsoRot, this->actor.focus.pos); } else { - Math_SmoothStepToS(&this->unk_222.x, 0, 6, 0x1838, 0x64); - Math_SmoothStepToS(&this->unk_222.y, 0, 6, 0x1838, 0x64); - Math_SmoothStepToS(&this->unk_228.x, 0, 6, 0x1838, 0x64); - Math_SmoothStepToS(&this->unk_228.y, 0, 6, 0x1838, 0x64); + Math_SmoothStepToS(&this->headRot.x, 0, 6, 0x1838, 0x64); + Math_SmoothStepToS(&this->headRot.y, 0, 6, 0x1838, 0x64); + Math_SmoothStepToS(&this->torsoRot.x, 0, 6, 0x1838, 0x64); + Math_SmoothStepToS(&this->torsoRot.y, 0, 6, 0x1838, 0x64); } if (DECR(this->unk_230) == 0) { @@ -601,15 +601,15 @@ void func_80AE0F84(Actor* thisx, PlayState* play) { s32 EnTsn_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) { EnTsn* this = THIS; - s16 shifted = this->unk_222.x >> 1; + s16 shifted = this->headRot.x >> 1; if (limbIndex == 15) { - rot->x += this->unk_222.y; + rot->x += this->headRot.y; rot->z += shifted; } if (limbIndex == 8) { - rot->x += this->unk_228.y; + rot->x += this->torsoRot.y; rot->z += shifted; } return false; diff --git a/src/overlays/actors/ovl_En_Tsn/z_en_tsn.h b/src/overlays/actors/ovl_En_Tsn/z_en_tsn.h index ff0b6bcbf2..5ab8b1239d 100644 --- a/src/overlays/actors/ovl_En_Tsn/z_en_tsn.h +++ b/src/overlays/actors/ovl_En_Tsn/z_en_tsn.h @@ -23,8 +23,8 @@ typedef struct EnTsn { /* 0x1D8 */ struct EnTsn* unk_1D8; /* 0x1DC */ UNK_TYPE1 unk1DC[0x44]; /* 0x220 */ u16 unk_220; - /* 0x222 */ Vec3s unk_222; - /* 0x228 */ Vec3s unk_228; + /* 0x222 */ Vec3s headRot; + /* 0x228 */ Vec3s torsoRot; /* 0x22E */ s16 unk_22E; /* 0x230 */ s16 unk_230; } EnTsn; // size = 0x234 diff --git a/src/overlays/actors/ovl_En_Vm/z_en_vm.c b/src/overlays/actors/ovl_En_Vm/z_en_vm.c index fad445ea42..469568c831 100644 --- a/src/overlays/actors/ovl_En_Vm/z_en_vm.c +++ b/src/overlays/actors/ovl_En_Vm/z_en_vm.c @@ -245,10 +245,10 @@ void func_808CC610(EnVm* this, PlayState* play) { sp38 = Math_Vec3f_Pitch(&this->actor.focus.pos, &player->actor.world.pos); sp38 = CLAMP_MAX(sp38, 0x1B91); - sp3A = BINANG_ADD((s32)((this->unk_21C - this->actor.xzDistToPlayer) * 60.0f), 4000); + sp3A = BINANG_ADD((s32)((this->unk_21C - this->actor.xzDistToPlayer) * 60.0f), 0xFA0); sp3A = CLAMP_MAX(sp3A, 0x1000); - Math_SmoothStepToS(&this->unk_216, sp38, 10, 4000, 0); + Math_SmoothStepToS(&this->unk_216, sp38, 10, 0xFA0, 0); if ((sp38 < 0xAAA) || (sp3A <= 0)) { func_808CC420(this); diff --git a/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c b/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c index cf43eeff6f..470182d9d3 100644 --- a/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c +++ b/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c @@ -7,6 +7,7 @@ #include "z_en_wallmas.h" #include "overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.h" #include "overlays/actors/ovl_En_Encount1/z_en_encount1.h" +#include "overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.h" #include "objects/gameplay_keep/gameplay_keep.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_UNFRIENDLY | ACTOR_FLAG_10 | ACTOR_FLAG_400) @@ -161,7 +162,8 @@ void EnWallmas_Init(Actor* thisx, PlayState* play) { if (WALLMASTER_IS_FROZEN(&this->actor)) { Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_OBJ_ICE_POLY, this->actor.world.pos.x, this->actor.world.pos.y - 15.0f, this->actor.world.pos.z, this->actor.world.rot.x, - (this->actor.world.rot.y + 0x5900), this->actor.world.rot.z, 0xFF50); + (this->actor.world.rot.y + 0x5900), this->actor.world.rot.z, + OBJICEPOLY_PARAMS(80, OBJICEPOLY_SWITCH_FLAG_NONE)); this->actor.params &= ~0x80; EnWallmas_SetupReturnToCeiling(this); return; diff --git a/src/overlays/actors/ovl_En_Wf/z_en_wf.c b/src/overlays/actors/ovl_En_Wf/z_en_wf.c index 7580d01af8..098f9c54c8 100644 --- a/src/overlays/actors/ovl_En_Wf/z_en_wf.c +++ b/src/overlays/actors/ovl_En_Wf/z_en_wf.c @@ -294,9 +294,9 @@ void EnWf_Init(Actor* thisx, PlayState* play) { temp_s0 = CLAMP(temp_s0, 1, 255); this->actor.shape.rot.z = 0; this->actor.world.rot.z = 0; - this->actor.child = - Actor_Spawn(&play->actorCtx, play, ACTOR_OBJ_ICE_POLY, this->actor.world.pos.x, this->actor.world.pos.y, - this->actor.world.pos.z, 0, this->actor.shape.rot.y, 0, temp_s0 | 0xFF00); + this->actor.child = Actor_Spawn(&play->actorCtx, play, ACTOR_OBJ_ICE_POLY, this->actor.world.pos.x, + this->actor.world.pos.y, this->actor.world.pos.z, 0, this->actor.shape.rot.y, 0, + OBJICEPOLY_PARAMS_ALT(temp_s0, OBJICEPOLY_SWITCH_FLAG_NONE)); if (this->actor.child != NULL) { Player* player = GET_PLAYER(play); @@ -607,7 +607,7 @@ void func_80991280(EnWf* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); if (this->unk_298 != 0) { - temp_v0 = (this->actor.yawTowardsPlayer - this->actor.shape.rot.y) - this->unk_29E; + temp_v0 = this->actor.yawTowardsPlayer - this->actor.shape.rot.y - this->unk_29E; if (ABS_ALT(temp_v0) > 0x2000) { this->unk_298--; return; @@ -658,7 +658,7 @@ void func_8099149C(EnWf* this, PlayState* play) { Player* player = GET_PLAYER(play); if (!func_8099408C(play, this)) { - Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 500); + Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0x1F4); this->actor.world.rot.y = this->actor.shape.rot.y; if (Actor_OtherIsTargeted(play, &this->actor)) { sp2C = 150.0f; @@ -776,7 +776,7 @@ void func_809919F4(EnWf* this, PlayState* play) { Player* player = GET_PLAYER(play); s16 temp_v0; - Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer + this->unk_29A, 2500); + Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer + this->unk_29A, 0x9C4); if (!func_8099408C(play, this) && !func_80990948(play, this, 0)) { this->actor.world.rot.y = this->actor.shape.rot.y; sp26 = BINANG_ROT180(player->actor.shape.rot.y + this->unk_29A); @@ -998,7 +998,7 @@ void func_809924EC(EnWf* this, PlayState* play) { this->actor.speed += 0.05f; } - Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 3000); + Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0xBB8); if (SkelAnime_Update(&this->skelAnime)) { sp26 = this->actor.wallYaw - this->actor.shape.rot.y; @@ -1037,7 +1037,7 @@ void func_809926D0(EnWf* this) { } void func_80992784(EnWf* this, PlayState* play) { - Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 2500); + Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0x9C4); if (SkelAnime_Update(&this->skelAnime) && (this->actor.bgCheckFlags & (BGCHECKFLAG_GROUND | BGCHECKFLAG_GROUND_TOUCH))) { this->actor.shape.rot.x = 0; @@ -1120,7 +1120,7 @@ void func_80992B8C(EnWf* this, PlayState* play) { s32 sp2C; Player* player = GET_PLAYER(play); - Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer + this->unk_29A, 2000); + Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer + this->unk_29A, 0x7D0); if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { sp2C = BINANG_SUB((this->actor.wallYaw - this->actor.yawTowardsPlayer), this->unk_29A); if (ABS_ALT(sp2C) > 0x2EE0) { @@ -1351,7 +1351,7 @@ void func_8099357C(EnWf* this, PlayState* play) { } } - Math_SmoothStepToS(&this->actor.shape.rot.y, sp2E, 10, 0x800, 16); + Math_SmoothStepToS(&this->actor.shape.rot.y, sp2E, 10, 0x800, 0x10); this->actor.world.rot.y = this->actor.shape.rot.y; if (Actor_WorldDistXZToActor(&this->actor, this->actor.child) < (this->unk_2A4 + 10.0f)) { @@ -1363,7 +1363,7 @@ void func_8099357C(EnWf* this, PlayState* play) { } } else { Math_SmoothStepToS(&this->actor.shape.rot.y, Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos), 10, - 0x800, 16); + 0x800, 0x10); this->actor.world.rot.y = this->actor.shape.rot.y; if (Actor_WorldDistXZToPoint(&this->actor, &this->actor.home.pos) < 40.0f) { func_809910F0(this); @@ -1380,9 +1380,9 @@ void func_80993738(EnWf* this, PlayState* play) { this->unk_29E = Math_SinS(this->unk_298 * 4200) * 8920.0f; } else if ((this->actionFunc == func_80991C80) || (this->actionFunc == func_8099357C) || (this->actionFunc == func_80991040) || (this->actionFunc == func_80991174)) { - Math_ScaledStepToS(&this->unk_29E, 0, 1000); + Math_ScaledStepToS(&this->unk_29E, 0, 0x3E8); } else if (this->actionFunc != func_809923E4) { - Math_ScaledStepToS(&this->unk_29E, this->actor.yawTowardsPlayer - this->actor.shape.rot.y, 1000); + Math_ScaledStepToS(&this->unk_29E, this->actor.yawTowardsPlayer - this->actor.shape.rot.y, 0x3E8); this->unk_29E = CLAMP(this->unk_29E, -0x3127, 0x3127); } } @@ -1497,8 +1497,8 @@ void EnWf_Update(Actor* thisx, PlayState* play) { if (this->actor.bgCheckFlags & (BGCHECKFLAG_GROUND | BGCHECKFLAG_GROUND_TOUCH)) { func_800BE3D0(&this->actor, this->actor.shape.rot.y, &this->actor.shape.rot); } else { - Math_ScaledStepToS(&this->actor.shape.rot.x, 0, 600); - Math_ScaledStepToS(&this->actor.shape.rot.z, 0, 600); + Math_ScaledStepToS(&this->actor.shape.rot.x, 0, 0x258); + Math_ScaledStepToS(&this->actor.shape.rot.z, 0, 0x258); } if (this->actionFunc != func_80990F50) { @@ -1616,7 +1616,7 @@ s32 func_8099408C(PlayState* play, EnWf* this) { s16 temp_v1; if (temp_v0 != NULL) { - temp_v1 = (Actor_WorldYawTowardActor(&this->actor, temp_v0) - this->actor.shape.rot.y) - this->unk_29E; + temp_v1 = Actor_WorldYawTowardActor(&this->actor, temp_v0) - this->actor.shape.rot.y - this->unk_29E; if (ABS_ALT(temp_v1) < 0x3000) { if (Rand_ZeroOne() < 0.5f) { func_8099223C(this); diff --git a/src/overlays/actors/ovl_En_Zo/z_en_zo.c b/src/overlays/actors/ovl_En_Zo/z_en_zo.c index 63e545ce90..953eded8ee 100644 --- a/src/overlays/actors/ovl_En_Zo/z_en_zo.c +++ b/src/overlays/actors/ovl_En_Zo/z_en_zo.c @@ -247,14 +247,14 @@ void EnZo_LookAtPlayer(EnZo* this, PlayState* play) { SubS_TrackPoint(&point, &this->actor.focus.pos, &this->actor.shape.rot, &this->trackTarget, &this->headRot, &this->upperBodyRot, &sTrackOptions); } else { - Math_SmoothStepToS(&this->trackTarget.x, 0, 4, 1000, 1); - Math_SmoothStepToS(&this->trackTarget.y, 0, 4, 1000, 1); + Math_SmoothStepToS(&this->trackTarget.x, 0, 4, 0x3E8, 1); + Math_SmoothStepToS(&this->trackTarget.y, 0, 4, 0x3E8, 1); - Math_SmoothStepToS(&this->headRot.x, 0, 4, 1000, 1); - Math_SmoothStepToS(&this->headRot.y, 0, 4, 1000, 1); + Math_SmoothStepToS(&this->headRot.x, 0, 4, 0x3E8, 1); + Math_SmoothStepToS(&this->headRot.y, 0, 4, 0x3E8, 1); - Math_SmoothStepToS(&this->upperBodyRot.x, 0, 4, 1000, 1); - Math_SmoothStepToS(&this->upperBodyRot.y, 0, 4, 1000, 1); + Math_SmoothStepToS(&this->upperBodyRot.x, 0, 4, 0x3E8, 1); + Math_SmoothStepToS(&this->upperBodyRot.y, 0, 4, 0x3E8, 1); } EnZo_Blink(this, 3); diff --git a/src/overlays/actors/ovl_En_Zob/z_en_zob.c b/src/overlays/actors/ovl_En_Zob/z_en_zob.c index bb7851fc64..2888a811e1 100644 --- a/src/overlays/actors/ovl_En_Zob/z_en_zob.c +++ b/src/overlays/actors/ovl_En_Zob/z_en_zob.c @@ -727,12 +727,12 @@ void EnZob_Update(Actor* thisx, PlayState* play) { } if (this->unk_2F4 & 1) { - Actor_TrackPlayer(play, &this->actor, &this->unk_2F6, &this->unk_2FC, this->actor.focus.pos); + Actor_TrackPlayer(play, &this->actor, &this->headRot, &this->torsoRot, this->actor.focus.pos); } else { - Math_SmoothStepToS(&this->unk_2F6.x, 0, 6, 6200, 100); - Math_SmoothStepToS(&this->unk_2F6.y, 0, 6, 6200, 100); - Math_SmoothStepToS(&this->unk_2FC.x, 0, 6, 6200, 100); - Math_SmoothStepToS(&this->unk_2FC.y, 0, 6, 6200, 100); + Math_SmoothStepToS(&this->headRot.x, 0, 6, 0x1838, 0x64); + Math_SmoothStepToS(&this->headRot.y, 0, 6, 0x1838, 0x64); + Math_SmoothStepToS(&this->torsoRot.x, 0, 6, 0x1838, 0x64); + Math_SmoothStepToS(&this->torsoRot.y, 0, 6, 0x1838, 0x64); } } @@ -740,8 +740,8 @@ s32 EnZob_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* p EnZob* this = THIS; if (limbIndex == 9) { - rot->x += this->unk_2F6.y; - rot->y += this->unk_2F6.x; + rot->x += this->headRot.y; + rot->y += this->headRot.x; } return false; } diff --git a/src/overlays/actors/ovl_En_Zob/z_en_zob.h b/src/overlays/actors/ovl_En_Zob/z_en_zob.h index 6e6c8e7a8b..5c708b2690 100644 --- a/src/overlays/actors/ovl_En_Zob/z_en_zob.h +++ b/src/overlays/actors/ovl_En_Zob/z_en_zob.h @@ -21,8 +21,8 @@ typedef struct EnZob { /* 0x218 */ Vec3s morphTable[24]; /* 0x2A8 */ ColliderCylinder collider; /* 0x2F4 */ u16 unk_2F4; - /* 0x2F6 */ Vec3s unk_2F6; - /* 0x2FC */ Vec3s unk_2FC; + /* 0x2F6 */ Vec3s headRot; + /* 0x2FC */ Vec3s torsoRot; /* 0x302 */ s16 unk_302; /* 0x304 */ u16 unk_304; /* 0x306 */ s16 csIdList[4]; diff --git a/src/overlays/actors/ovl_En_Zot/z_en_zot.c b/src/overlays/actors/ovl_En_Zot/z_en_zot.c index 45ec32a269..87b45aa506 100644 --- a/src/overlays/actors/ovl_En_Zot/z_en_zot.c +++ b/src/overlays/actors/ovl_En_Zot/z_en_zot.c @@ -299,7 +299,7 @@ s32 func_80B96E5C(EnZot* this) { temp_f12 = points->x - this->actor.world.pos.x; temp_f14 = points->z - this->actor.world.pos.z; this->actor.world.rot.y = Math_Atan2S(temp_f12, temp_f14); - Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.world.rot.y, 2, 2000, 200); + Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.world.rot.y, 2, 0x7D0, 0xC8); phi_f2 = SQ(this->actor.speed) * SQ(3.0f); if (this->unk_2D4 == 0) { @@ -332,7 +332,7 @@ s32 func_80B96FB0(EnZot* this) { temp_f12 = points->x - this->actor.world.pos.x; temp_f14 = points->z - this->actor.world.pos.z; this->actor.world.rot.y = Math_Atan2S(temp_f12, temp_f14); - Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.world.rot.y, 2, 2000, 200); + Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.world.rot.y, 2, 0x7D0, 0xC8); if ((SQ(temp_f12) + SQ(temp_f14)) < SQ(10.0f)) { if (this->unk_2F2 & 0x20) { @@ -913,15 +913,15 @@ void func_80B98348(EnZot* this, PlayState* play) { this->unk_2F2 &= ~8; } else { this->unk_2F2 |= 8; - Math_SmoothStepToS(&this->unk_2C4.x, 0, 6, 6200, 100); - Math_SmoothStepToS(&this->unk_2CA.x, 0, 6, 6200, 100); + Math_SmoothStepToS(&this->headRot.x, 0, 6, 0x1838, 0x64); + Math_SmoothStepToS(&this->torsoRot.x, 0, 6, 0x1838, 0x64); y = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; if (y > 0) { - Math_SmoothStepToS(&this->unk_2C4.y, 0x3000, 6, 6200, 100); - Math_SmoothStepToS(&this->unk_2CA.y, 0x1000, 6, 6200, 100); + Math_SmoothStepToS(&this->headRot.y, 0x3000, 6, 0x1838, 0x64); + Math_SmoothStepToS(&this->torsoRot.y, 0x1000, 6, 0x1838, 0x64); } else { - Math_SmoothStepToS(&this->unk_2C4.y, -0x3000, 6, 6200, 100); - Math_SmoothStepToS(&this->unk_2CA.y, -0x1000, 6, 6200, 100); + Math_SmoothStepToS(&this->headRot.y, -0x3000, 6, 0x1838, 0x64); + Math_SmoothStepToS(&this->torsoRot.y, -0x1000, 6, 0x1838, 0x64); } } } @@ -1330,12 +1330,12 @@ void EnZot_Update(Actor* thisx, PlayState* play) { this->actionFunc(this, play); if (!(this->unk_2F2 & 8)) { if (!(this->unk_2F2 & 4) && func_80B96DF0(this, play)) { - Actor_TrackPlayer(play, &this->actor, &this->unk_2C4, &this->unk_2CA, this->actor.focus.pos); + Actor_TrackPlayer(play, &this->actor, &this->headRot, &this->torsoRot, this->actor.focus.pos); } else { - Math_SmoothStepToS(&this->unk_2C4.x, 0, 6, 6200, 100); - Math_SmoothStepToS(&this->unk_2C4.y, 0, 6, 6200, 100); - Math_SmoothStepToS(&this->unk_2CA.x, 0, 6, 6200, 100); - Math_SmoothStepToS(&this->unk_2CA.y, 0, 6, 6200, 100); + Math_SmoothStepToS(&this->headRot.x, 0, 6, 0x1838, 0x64); + Math_SmoothStepToS(&this->headRot.y, 0, 6, 0x1838, 0x64); + Math_SmoothStepToS(&this->torsoRot.x, 0, 6, 0x1838, 0x64); + Math_SmoothStepToS(&this->torsoRot.y, 0, 6, 0x1838, 0x64); } } @@ -1364,14 +1364,14 @@ s32 EnZot_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* p if (limbIndex == 15) { Matrix_Translate(1500.0f, 0.0f, 0.0f, MTXMODE_APPLY); - Matrix_RotateXS(this->unk_2C4.y, MTXMODE_APPLY); - Matrix_RotateZS(this->unk_2C4.x, MTXMODE_APPLY); + Matrix_RotateXS(this->headRot.y, MTXMODE_APPLY); + Matrix_RotateZS(this->headRot.x, MTXMODE_APPLY); Matrix_Translate(-1500.0f, 0.0f, 0.0f, MTXMODE_APPLY); } if (limbIndex == 8) { - Matrix_RotateXS(this->unk_2CA.y * -1, MTXMODE_APPLY); - Matrix_RotateZS(this->unk_2CA.x * -1, MTXMODE_APPLY); + Matrix_RotateXS(this->torsoRot.y * -1, MTXMODE_APPLY); + Matrix_RotateZS(this->torsoRot.x * -1, MTXMODE_APPLY); } if (((this->unk_2F0 == 8) || (this->unk_2F0 == 9)) && diff --git a/src/overlays/actors/ovl_En_Zot/z_en_zot.h b/src/overlays/actors/ovl_En_Zot/z_en_zot.h index b6b67abb49..2bdb95eb10 100644 --- a/src/overlays/actors/ovl_En_Zot/z_en_zot.h +++ b/src/overlays/actors/ovl_En_Zot/z_en_zot.h @@ -19,8 +19,8 @@ typedef struct EnZot { /* 0x188 */ ColliderCylinder collider; /* 0x1D4 */ Vec3s jointTable[20]; /* 0x24C */ Vec3s morphTable[20]; - /* 0x2C4 */ Vec3s unk_2C4; - /* 0x2CA */ Vec3s unk_2CA; + /* 0x2C4 */ Vec3s headRot; + /* 0x2CA */ Vec3s torsoRot; /* 0x2D0 */ Path* path; /* 0x2D4 */ s32 unk_2D4; /* 0x2D8 */ Actor* unk_2D8[5]; diff --git a/src/overlays/actors/ovl_En_Zov/z_en_zov.c b/src/overlays/actors/ovl_En_Zov/z_en_zov.c index 311e9b9055..38fbf2b8b5 100644 --- a/src/overlays/actors/ovl_En_Zov/z_en_zov.c +++ b/src/overlays/actors/ovl_En_Zov/z_en_zov.c @@ -484,16 +484,16 @@ void EnZov_Update(Actor* thisx, PlayState* play) { } if ((this->unk_320 & 1) && func_80BD15A4(this, play)) { - Actor_TrackPlayer(play, &this->picto.actor, &this->unk_2F0, &this->unk_2F6, this->picto.actor.focus.pos); + Actor_TrackPlayer(play, &this->picto.actor, &this->headRot, &this->torsoRot, this->picto.actor.focus.pos); } else { if ((this->unk_320 & 0x10) && (this->unk_322 == 0)) { - Math_SmoothStepToS(&this->unk_2F0.x, -0x1B58, 6, 0x1838, 0x64); + Math_SmoothStepToS(&this->headRot.x, -0x1B58, 6, 0x1838, 0x64); } else { - Math_SmoothStepToS(&this->unk_2F0.x, 0, 6, 0x1838, 0x64); + Math_SmoothStepToS(&this->headRot.x, 0, 6, 0x1838, 0x64); } - Math_SmoothStepToS(&this->unk_2F0.y, 0, 6, 0x1838, 0x64); - Math_SmoothStepToS(&this->unk_2F6.x, 0, 6, 0x1838, 0x64); - Math_SmoothStepToS(&this->unk_2F6.y, 0, 6, 0x1838, 0x64); + Math_SmoothStepToS(&this->headRot.y, 0, 6, 0x1838, 0x64); + Math_SmoothStepToS(&this->torsoRot.x, 0, 6, 0x1838, 0x64); + Math_SmoothStepToS(&this->torsoRot.y, 0, 6, 0x1838, 0x64); } if (DECR(this->unk_2EE) == 0) { @@ -521,14 +521,14 @@ s32 EnZov_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* p EnZov* this = THIS; if (limbIndex == LULU_LIMB_HEAD) { - rot->x += this->unk_2F0.y; + rot->x += this->headRot.y; if ((this->unk_320 & 0x10) && (this->unk_322 == 0)) { - rot->z += this->unk_2F0.x; + rot->z += this->headRot.x; } } if (limbIndex == LULU_LIMB_TORSO) { - rot->x += this->unk_2F6.y; + rot->x += this->torsoRot.y; } return false; } diff --git a/src/overlays/actors/ovl_En_Zov/z_en_zov.h b/src/overlays/actors/ovl_En_Zov/z_en_zov.h index 7637bb53e5..c228cab161 100644 --- a/src/overlays/actors/ovl_En_Zov/z_en_zov.h +++ b/src/overlays/actors/ovl_En_Zov/z_en_zov.h @@ -23,8 +23,8 @@ typedef struct EnZov { /* 0x2A0 */ ColliderCylinder collider; /* 0x2EC */ s16 unk_2EC; /* 0x2EE */ s16 unk_2EE; - /* 0x2F0 */ Vec3s unk_2F0; - /* 0x2F6 */ Vec3s unk_2F6; + /* 0x2F0 */ Vec3s headRot; + /* 0x2F6 */ Vec3s torsoRot; /* 0x2FC */ Vec3f unk_2FC; /* 0x308 */ Vec3f unk_308; /* 0x314 */ Vec3f unk_314; diff --git a/src/overlays/actors/ovl_Obj_Aqua/z_obj_aqua.c b/src/overlays/actors/ovl_Obj_Aqua/z_obj_aqua.c index 17c146da3e..cb2aeea09d 100644 --- a/src/overlays/actors/ovl_Obj_Aqua/z_obj_aqua.c +++ b/src/overlays/actors/ovl_Obj_Aqua/z_obj_aqua.c @@ -93,8 +93,8 @@ void func_80ACB7F4(ObjAqua* this, PlayState* play) { effectPos.y = this->actor.floorHeight; for (i = 0; i < 4; i++) { - effectPos.x = (this->actor.world.pos.x + Math_SinS((s32)(Rand_ZeroOne() * 7200.0f) + angleOffset) * 8.0f); - effectPos.z = (this->actor.world.pos.z + Math_CosS((s32)(Rand_ZeroOne() * 7200.0f) + angleOffset) * 8.0f); + effectPos.x = this->actor.world.pos.x + Math_SinS((s32)(Rand_ZeroOne() * 7200.0f) + angleOffset) * 8.0f; + effectPos.z = this->actor.world.pos.z + Math_CosS((s32)(Rand_ZeroOne() * 7200.0f) + angleOffset) * 8.0f; EffectSsGSplash_Spawn(play, &effectPos, NULL, NULL, 0, 120); angleOffset += 0x4000; } @@ -247,7 +247,7 @@ void ObjAqua_Update(Actor* thisx, PlayState* play) { this->counter--; } this->actionFunc(this, play); - if (this->actor.update) { + if (this->actor.update != NULL) { if (this->actionFunc == func_80ACBC8C) { Math_Vec3f_StepTo(&this->actor.scale, &D_80ACC308, 0.00006f); } else if (this->actionFunc == func_80ACBD48) { diff --git a/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c b/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c index 292e3aa47b..f5cca739ba 100644 --- a/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c +++ b/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c @@ -203,7 +203,7 @@ void func_80937160(ObjBean* this) { this->dyna.actor.scale.x = this->dyna.actor.scale.z = Math_SinS(this->unk_1AE) * 0.10700001f; Math_StepToF(&this->unk_1CC, 0.0f, 0.1f); Math_StepToF(&this->unk_1D0, 0.0f, 0.1f); - Math_ScaledStepToS(&this->dyna.actor.shape.rot.y, this->dyna.actor.home.rot.y, 100); + Math_ScaledStepToS(&this->dyna.actor.shape.rot.y, this->dyna.actor.home.rot.y, 0x64); } void func_80937238(ObjBean* this) { diff --git a/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c b/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c index 25b25e778d..6bc2823a5d 100644 --- a/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c +++ b/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c @@ -252,8 +252,8 @@ void func_8098D6E0(ObjComb* this, PlayState* play) { for (temp = 0, i = 0; i < 8; i++, temp += 0x2000) { temp_f0 = Rand_ZeroOne(); temp_f20 = ((1.0f - SQ(temp_f0)) * 14.0f) + 4.0f; - sp70.x = (Math_SinS((s32)(Rand_ZeroOne() * 8000.0f) + temp) * temp_f20) + this->actor.world.pos.x; - sp70.z = (Math_CosS((s32)(Rand_ZeroOne() * 8000.0f) + temp) * temp_f20) + this->actor.world.pos.z; + sp70.x = this->actor.world.pos.x + (Math_SinS((s32)(Rand_ZeroOne() * 8000.0f) + temp) * temp_f20); + sp70.z = this->actor.world.pos.z + (Math_CosS((s32)(Rand_ZeroOne() * 8000.0f) + temp) * temp_f20); EffectSsGSplash_Spawn(play, &sp70, NULL, NULL, 0, 200); } diff --git a/src/overlays/actors/ovl_Obj_Flowerpot/z_obj_flowerpot.c b/src/overlays/actors/ovl_Obj_Flowerpot/z_obj_flowerpot.c index b864df840f..67c42f57ec 100644 --- a/src/overlays/actors/ovl_Obj_Flowerpot/z_obj_flowerpot.c +++ b/src/overlays/actors/ovl_Obj_Flowerpot/z_obj_flowerpot.c @@ -303,8 +303,8 @@ void func_80A1BD80(ObjFlowerpot* this, PlayState* play) { spBC.y = this->actor.world.pos.y + this->actor.depthInWater; for (phi_s1 = 0, i = 0; i < 4; i++, phi_s1 += 0x4000) { - spBC.x = (Math_SinS((s32)(Rand_ZeroOne() * 7200.0f) + phi_s1) * 15.0f) + this->actor.world.pos.x; - spBC.z = (Math_CosS((s32)(Rand_ZeroOne() * 7200.0f) + phi_s1) * 15.0f) + this->actor.world.pos.z; + spBC.x = this->actor.world.pos.x + (Math_SinS((s32)(Rand_ZeroOne() * 7200.0f) + phi_s1) * 15.0f); + spBC.z = this->actor.world.pos.z + (Math_CosS((s32)(Rand_ZeroOne() * 7200.0f) + phi_s1) * 15.0f); EffectSsGSplash_Spawn(play, &spBC, NULL, NULL, 0, 200); } diff --git a/src/overlays/actors/ovl_Obj_Grass_Carry/z_obj_grass_carry.c b/src/overlays/actors/ovl_Obj_Grass_Carry/z_obj_grass_carry.c index 4c937b2f99..51846d51dc 100644 --- a/src/overlays/actors/ovl_Obj_Grass_Carry/z_obj_grass_carry.c +++ b/src/overlays/actors/ovl_Obj_Grass_Carry/z_obj_grass_carry.c @@ -307,8 +307,8 @@ void ObjGrassCarry_Fall(ObjGrassCarry* this, PlayState* play) { pos.y = this->actor.world.pos.y + this->actor.depthInWater; for (angle = 0, i = 0; i < 4; i++, angle += 0x4000) { - pos.x = (Math_SinS((s32)(Rand_ZeroOne() * 7200.0f) + angle) * 15.0f) + this->actor.world.pos.x; - pos.z = (Math_CosS((s32)(Rand_ZeroOne() * 7200.0f) + angle) * 15.0f) + this->actor.world.pos.z; + pos.x = this->actor.world.pos.x + (Math_SinS((s32)(Rand_ZeroOne() * 7200.0f) + angle) * 15.0f); + pos.z = this->actor.world.pos.z + (Math_CosS((s32)(Rand_ZeroOne() * 7200.0f) + angle) * 15.0f); EffectSsGSplash_Spawn(play, &pos, NULL, NULL, 0, 190); } diff --git a/src/overlays/actors/ovl_Obj_Grass_Unit/z_obj_grass_unit.c b/src/overlays/actors/ovl_Obj_Grass_Unit/z_obj_grass_unit.c index 4b6d995ac6..8cbe9aacf3 100644 --- a/src/overlays/actors/ovl_Obj_Grass_Unit/z_obj_grass_unit.c +++ b/src/overlays/actors/ovl_Obj_Grass_Unit/z_obj_grass_unit.c @@ -148,9 +148,9 @@ void ObjGrassUnit_Init(Actor* this, PlayState* play2) { grassElem = &grassGroup->elements[grassGroup->count]; grassPos = &grassPattern->positions[i]; - grassElem->pos.x = (Math_CosS((this->home.rot.y + grassPos->angle)) * grassPos->distance) + this->home.pos.x; + grassElem->pos.x = this->home.pos.x + (Math_CosS(this->home.rot.y + grassPos->angle) * grassPos->distance); grassElem->pos.y = this->home.pos.y + 100.0f; - grassElem->pos.z = (Math_SinS((this->home.rot.y + grassPos->angle)) * grassPos->distance) + this->home.pos.z; + grassElem->pos.z = this->home.pos.z + (Math_SinS(this->home.rot.y + grassPos->angle) * grassPos->distance); grassElem->pos.y = BgCheck_EntityRaycastFloor5(&play->colCtx, &poly, &bgId, this, &grassElem->pos); tmp = grassElem->pos.y - this->home.pos.y; diff --git a/src/overlays/actors/ovl_Obj_Hariko/z_obj_hariko.c b/src/overlays/actors/ovl_Obj_Hariko/z_obj_hariko.c index 9486f177c0..411bc3325d 100644 --- a/src/overlays/actors/ovl_Obj_Hariko/z_obj_hariko.c +++ b/src/overlays/actors/ovl_Obj_Hariko/z_obj_hariko.c @@ -39,9 +39,9 @@ void ObjHariko_Init(Actor* thisx, PlayState* play) { ObjHariko* this = THIS; Actor_SetScale(&this->actor, 0.1f); - this->headRotation.x = 0; - this->headRotation.y = 0; - this->headRotation.z = 0; + this->headRot.x = 0; + this->headRot.y = 0; + this->headRot.z = 0; this->headOffset = 0; this->bobbleStep = 0.0f; ObjHariko_SetupWait(this); @@ -65,8 +65,8 @@ void ObjHariko_SetupBobHead(ObjHariko* this) { void ObjHariko_BobHead(ObjHariko* this, PlayState* play) { this->headOffset += 0x1555; - this->headRotation.x = Math_SinS(this->headOffset) * this->bobbleStep; - this->headRotation.y = Math_CosS(this->headOffset) * this->bobbleStep; + this->headRot.x = Math_SinS(this->headOffset) * this->bobbleStep; + this->headRot.y = Math_CosS(this->headOffset) * this->bobbleStep; Math_SmoothStepToF(&this->bobbleStep, 0, 0.5f, 18.0f, 18.0f); if (this->bobbleStep < 182.0f) { ObjHariko_SetupWait(this); @@ -94,8 +94,8 @@ void ObjHariko_Draw(Actor* thisx, PlayState* play) { Gfx_SetupDL25_Opa(play->state.gfxCtx); Matrix_Push(); - Matrix_RotateXS(this->headRotation.x, MTXMODE_APPLY); - Matrix_RotateYS(this->headRotation.y, MTXMODE_APPLY); + Matrix_RotateXS(this->headRot.x, MTXMODE_APPLY); + Matrix_RotateYS(this->headRot.y, MTXMODE_APPLY); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_OPA_DISP++, gHarikoBodyDL); diff --git a/src/overlays/actors/ovl_Obj_Hariko/z_obj_hariko.h b/src/overlays/actors/ovl_Obj_Hariko/z_obj_hariko.h index 88a51a83f5..eccc56bd88 100644 --- a/src/overlays/actors/ovl_Obj_Hariko/z_obj_hariko.h +++ b/src/overlays/actors/ovl_Obj_Hariko/z_obj_hariko.h @@ -11,7 +11,7 @@ typedef struct ObjHariko { /* 0x000 */ Actor actor; /* 0x144 */ ObjHarikoActionFunc actionFunc; /* 0x148 */ f32 bobbleStep; - /* 0x14C */ Vec3s headRotation; + /* 0x14C */ Vec3s headRot; /* 0x152 */ s16 headOffset; /* 0x154 */ s16 unk154; // Set but not used } ObjHariko; // size = 0x158 diff --git a/src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.c b/src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.c index d6927792e0..5d4036cfd9 100644 --- a/src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.c +++ b/src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.c @@ -6,6 +6,7 @@ #include "z_obj_hsblock.h" #include "objects/object_d_hsblock/object_d_hsblock.h" +#include "overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.h" #define FLAGS 0x00000000 @@ -60,7 +61,8 @@ void func_8093DEAC(ObjHsblock* this, PlayState* play) { if (OBJHSBLOCK_GET_5(&this->dyna.actor) != 0) { Actor_SpawnAsChild(&play->actorCtx, &this->dyna.actor, play, ACTOR_OBJ_ICE_POLY, this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y, this->dyna.actor.world.pos.z, this->dyna.actor.world.rot.x, - this->dyna.actor.world.rot.y, this->dyna.actor.world.rot.z, 0xFF64); + this->dyna.actor.world.rot.y, this->dyna.actor.world.rot.z, + OBJICEPOLY_PARAMS(100, OBJICEPOLY_SWITCH_FLAG_NONE)); } } diff --git a/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.c b/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.c index 15dddae990..b67e9b779f 100644 --- a/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.c +++ b/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.c @@ -82,7 +82,7 @@ void ObjIcePoly_Init(Actor* thisx, PlayState* play) { s32 i; this->switchFlag = OBJICEPOLY_GET_SWITCH_FLAG(thisx); - thisx->params &= 0xFF; + thisx->params = OBJICEPOLY_GET_SCALE(thisx); thisx->uncullZoneForward = 5600.0f; Actor_SetScale(thisx, thisx->params * 0.01f); diff --git a/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.h b/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.h index acf62bb91b..32ce65620d 100644 --- a/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.h +++ b/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.h @@ -8,6 +8,10 @@ struct ObjIcePoly; typedef void (*ObjIcePolyActionFunc)(struct ObjIcePoly*, PlayState*); #define OBJICEPOLY_GET_SWITCH_FLAG(thisx) (((thisx)->params >> 8) & 0xFF) +#define OBJICEPOLY_GET_SCALE(thisx) (((thisx)->params) & 0xFF) + +#define OBJICEPOLY_PARAMS(scale, switchFlag) (((scale) & 0xFF) | (((switchFlag) & 0xFF) << 8)) +#define OBJICEPOLY_PARAMS_ALT(scale, switchFlag) ((scale) | (((switchFlag) & 0xFF) << 8)) #define OBJICEPOLY_SWITCH_FLAG_NONE 0xFF diff --git a/src/overlays/actors/ovl_Obj_Iceblock/z_obj_iceblock.c b/src/overlays/actors/ovl_Obj_Iceblock/z_obj_iceblock.c index dd05941342..c696a3c6be 100644 --- a/src/overlays/actors/ovl_Obj_Iceblock/z_obj_iceblock.c +++ b/src/overlays/actors/ovl_Obj_Iceblock/z_obj_iceblock.c @@ -243,8 +243,8 @@ void func_80A23938(ObjIceblock* this) { Actor* thisx = &this->dyna.actor; if (this->unk_1B0 & 0x80) { - Math_ScaledStepToS(&thisx->shape.rot.x, 0, 400); - Math_ScaledStepToS(&thisx->shape.rot.z, 0, 400); + Math_ScaledStepToS(&thisx->shape.rot.x, 0, 0x190); + Math_ScaledStepToS(&thisx->shape.rot.z, 0, 0x190); } else { ObjIceBlockUnkStruct4* ptr = &this->unk_27C; f32 phi_f0; @@ -694,8 +694,8 @@ void func_80A24BDC(ObjIceblock* this, PlayState* play, f32 arg2, f32 arg3, s32 a for (i = 0, phi_s0 = 0; i < arg4; i++, phi_s0 += temp_f22) { temp_f20 = ((Rand_ZeroOne() * 5.0f) + 40.0f) * arg2; - sp88.x = (Math_SinS((s32)(Rand_ZeroOne() * temp_f22) + phi_s0) * temp_f20) + this->dyna.actor.world.pos.x; - sp88.z = (Math_CosS((s32)(Rand_ZeroOne() * temp_f22) + phi_s0) * temp_f20) + this->dyna.actor.world.pos.z; + sp88.x = this->dyna.actor.world.pos.x + (Math_SinS((s32)(Rand_ZeroOne() * temp_f22) + phi_s0) * temp_f20); + sp88.z = this->dyna.actor.world.pos.z + (Math_CosS((s32)(Rand_ZeroOne() * temp_f22) + phi_s0) * temp_f20); EffectSsGSplash_Spawn(play, &sp88, NULL, NULL, 0, ((Rand_ZeroOne() * 60.0f) + 320.0f) * arg3); } } diff --git a/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c b/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c index a42fd5a879..96e7a2c5a6 100644 --- a/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c +++ b/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c @@ -214,8 +214,8 @@ void ObjKibako_WaterBreak(ObjKibako* this, PlayState* play) { pos.y = worldPos->y + this->actor.depthInWater; for (angle = 0, i = 0; i < 5; i++, angle += 0x3333) { - pos.x = (Math_SinS(((s32)(Rand_ZeroOne() * 6000.0f)) + angle) * 15.0f) + worldPos->x; - pos.z = (Math_CosS(((s32)(Rand_ZeroOne() * 6000.0f)) + angle) * 15.0f) + worldPos->z; + pos.x = worldPos->x + (Math_SinS(((s32)(Rand_ZeroOne() * 6000.0f)) + angle) * 15.0f); + pos.z = worldPos->z + (Math_CosS(((s32)(Rand_ZeroOne() * 6000.0f)) + angle) * 15.0f); EffectSsGSplash_Spawn(play, &pos, NULL, NULL, 0, 350); } pos.x = worldPos->x; diff --git a/src/overlays/actors/ovl_Obj_Moon_Stone/z_obj_moon_stone.c b/src/overlays/actors/ovl_Obj_Moon_Stone/z_obj_moon_stone.c index 30d4dfc2fa..e7452cc9dd 100644 --- a/src/overlays/actors/ovl_Obj_Moon_Stone/z_obj_moon_stone.c +++ b/src/overlays/actors/ovl_Obj_Moon_Stone/z_obj_moon_stone.c @@ -111,7 +111,7 @@ void func_80C06768(ObjMoonStone* this, PlayState* play) { this->actor.world.pos.z, 0, 0, 0, -1); } } - if (this->actor.draw) { + if (this->actor.draw != NULL) { if (Actor_HasParent(&this->actor, play)) { this->actor.parent = NULL; this->actor.draw = NULL; diff --git a/src/overlays/actors/ovl_Obj_Snowball2/z_obj_snowball2.c b/src/overlays/actors/ovl_Obj_Snowball2/z_obj_snowball2.c index 264fd76d3a..ce2507b397 100644 --- a/src/overlays/actors/ovl_Obj_Snowball2/z_obj_snowball2.c +++ b/src/overlays/actors/ovl_Obj_Snowball2/z_obj_snowball2.c @@ -198,8 +198,8 @@ void func_80B39470(Actor* thisx, PlayState* play) { sp58.y = this->actor.world.pos.y + this->actor.depthInWater; for (phi_s0 = 0, i = 0; i < 5; i++, phi_s0 += (0x10000 / 5)) { - sp58.x = (Math_SinS((s32)(Rand_ZeroOne() * 7200.0f) + phi_s0) * 15.0f) + this->actor.world.pos.x; - sp58.z = (Math_CosS((s32)(Rand_ZeroOne() * 7200.0f) + phi_s0) * 15.0f) + this->actor.world.pos.z; + sp58.x = this->actor.world.pos.x + (Math_SinS((s32)(Rand_ZeroOne() * 7200.0f) + phi_s0) * 15.0f); + sp58.z = this->actor.world.pos.z + (Math_CosS((s32)(Rand_ZeroOne() * 7200.0f) + phi_s0) * 15.0f); EffectSsGSplash_Spawn(play, &sp58, NULL, NULL, 0, 200); } diff --git a/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c b/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c index 5acb3458aa..0385b27898 100644 --- a/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c +++ b/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c @@ -6,6 +6,7 @@ #include "z_obj_switch.h" #include "z64rumble.h" +#include "overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.h" #include "objects/gameplay_dangeon_keep/gameplay_dangeon_keep.h" #define FLAGS (ACTOR_FLAG_10) @@ -232,7 +233,9 @@ void ObjSwitch_InitTrisCollider(ObjSwitch* this, PlayState* play, ColliderTrisIn this->dyna.actor.world.pos.z, &this->dyna.actor.shape.rot); for (i = 0; i < ARRAY_COUNT(this->colliderTrisElements); i++) { + //! FAKE: if (this) {} + for (j = 0; j < ARRAY_COUNT(vtx); j++) { Matrix_MultVec3f(&init->elements[i].dim.vtx[j], &vtx[j]); } @@ -245,7 +248,7 @@ Actor* ObjSwitch_SpawnIce(ObjSwitch* this, PlayState* play) { return Actor_SpawnAsChild(&play->actorCtx, &this->dyna.actor, play, ACTOR_OBJ_ICE_POLY, this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y - 25.0f, this->dyna.actor.world.pos.z, this->dyna.actor.world.rot.x, this->dyna.actor.world.rot.y, - this->dyna.actor.world.rot.z, 0xFF32); + this->dyna.actor.world.rot.z, OBJICEPOLY_PARAMS(50, OBJICEPOLY_SWITCH_FLAG_NONE)); } void ObjSwitch_SetSwitchFlagState(ObjSwitch* this, PlayState* play, s32 setFlag) { diff --git a/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c b/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c index 979484bccd..db45b7a79e 100644 --- a/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c +++ b/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c @@ -307,8 +307,8 @@ void ObjTsubo_PotBreak2(ObjTsubo* this, PlayState* play2) { pos.y = worldPos->y + this->actor.depthInWater; for (rot = 0, i = 0; i < 5; i++, rot += 0x10000 / 5) { - pos.x = Math_SinS((s32)(Rand_ZeroOne() * 6000) + rot) * 15.0f + worldPos->x; - pos.z = Math_CosS((s32)(Rand_ZeroOne() * 6000) + rot) * 15.0f + worldPos->z; + pos.x = worldPos->x + Math_SinS((s32)(Rand_ZeroOne() * 6000) + rot) * 15.0f; + pos.z = worldPos->z + Math_CosS((s32)(Rand_ZeroOne() * 6000) + rot) * 15.0f; EffectSsGSplash_Spawn(play, &pos, NULL, NULL, 0, 350); } pos.x = worldPos->x; @@ -352,8 +352,8 @@ void ObjTsubo_MagicPotBreak2(ObjTsubo* this, PlayState* play2) { pos.y = this->actor.world.pos.y + this->actor.depthInWater; for (rot = 0, i = 0; i < 5; i++, rot += 0x10000 / 5) { - pos.x = Math_SinS((s32)(Rand_ZeroOne() * 6000) + rot) * 30.0f + worldPos->x; - pos.z = Math_CosS((s32)(Rand_ZeroOne() * 6000) + rot) * 30.0f + worldPos->z; + pos.x = worldPos->x + Math_SinS((s32)(Rand_ZeroOne() * 6000) + rot) * 30.0f; + pos.z = worldPos->z + Math_CosS((s32)(Rand_ZeroOne() * 6000) + rot) * 30.0f; EffectSsGSplash_Spawn(play, &pos, NULL, NULL, 0, 350); } pos.x = worldPos->x; diff --git a/src/overlays/actors/ovl_Obj_Um/z_obj_um.c b/src/overlays/actors/ovl_Obj_Um/z_obj_um.c index 4137d5f057..1addb6a46a 100644 --- a/src/overlays/actors/ovl_Obj_Um/z_obj_um.c +++ b/src/overlays/actors/ovl_Obj_Um/z_obj_um.c @@ -1911,9 +1911,10 @@ void ObjUm_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Vec3s sp80; s32 i; f32 sp70[] = { 2000.0f, 0.0f, -2000.0f }; + s32 pad; - //! FAKE - if (!i) {} + //! FAKE: + if (i) {} sp80.x = 0; sp80.z = 0; @@ -1948,23 +1949,23 @@ void ObjUm_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, } Matrix_Pop(); - if (mtx_s3 != NULL) { - if (play) {} - gSPMatrix(POLY_OPA_DISP++, mtx_s3, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - - if (spFC[this->potsLife[i]] != NULL) { - s32 pad; - - gSPDisplayList(POLY_OPA_DISP++, spFC[this->potsLife[i]]); - - if (spE4[this->potsLife[i]] != NULL) { - gSPDisplayList(POLY_OPA_DISP++, spE4[this->potsLife[i]]); - } - } - } else { + if (mtx_s3 == NULL) { //! @bug skips CLOSE_DISPS return; } + + //! FAKE: + if (play) {} + + gSPMatrix(POLY_OPA_DISP++, mtx_s3, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + + if (spFC[this->potsLife[i]] != NULL) { + gSPDisplayList(POLY_OPA_DISP++, spFC[this->potsLife[i]]); + + if (spE4[this->potsLife[i]] != NULL) { + gSPDisplayList(POLY_OPA_DISP++, spE4[this->potsLife[i]]); + } + } } CLOSE_DISPS(gfxCtx); diff --git a/src/overlays/actors/ovl_Obj_Wturn/z_obj_wturn.c b/src/overlays/actors/ovl_Obj_Wturn/z_obj_wturn.c index ba576b3b42..071b564f23 100644 --- a/src/overlays/actors/ovl_Obj_Wturn/z_obj_wturn.c +++ b/src/overlays/actors/ovl_Obj_Wturn/z_obj_wturn.c @@ -91,7 +91,7 @@ void func_808A7AAC(ObjWturn* this, PlayState* play) { } void func_808A7BA0(ObjWturn* this, PlayState* play) { - if (Math_ScaledStepToS(&this->actor.shape.rot.z, -0x8000, 0x0200)) { + if (Math_ScaledStepToS(&this->actor.shape.rot.z, -0x8000, 0x200)) { func_808A7C04(this, play); } Actor_PlaySfx_FlaggedCentered3(&this->actor, NA_SE_EV_EARTHQUAKE - SFX_FLAG); diff --git a/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.c b/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.c index 66d6505646..b35c8b6320 100644 --- a/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.c +++ b/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.c @@ -27,7 +27,7 @@ ActorInit Oceff_Wipe_InitVars = { /**/ OceffWipe_Draw, }; -UNK_TYPE4 D_80977200; +static s32 sBssPad; void OceffWipe_Init(Actor* thisx, PlayState* play) { OceffWipe* this = THIS; diff --git a/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2.c b/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2.c index f87f4b8efd..11b33bd41f 100644 --- a/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2.c +++ b/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2.c @@ -29,7 +29,7 @@ ActorInit Oceff_Wipe2_InitVars = { #include "assets/overlays/ovl_Oceff_Wipe2/ovl_Oceff_Wipe2.c" -s32 D_809879D0; +static s32 sBssPad; void OceffWipe2_Init(Actor* thisx, PlayState* play) { OceffWipe2* this = THIS; diff --git a/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.c b/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.c index d1564d7e12..4a93ede09c 100644 --- a/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.c +++ b/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.c @@ -30,7 +30,7 @@ ActorInit Oceff_Wipe3_InitVars = { #include "assets/overlays/ovl_Oceff_Wipe3/ovl_Oceff_Wipe3.c" -s32 D_80989130; +static s32 sBssPad; void OceffWipe3_Init(Actor* thisx, PlayState* play) { OceffWipe3* this = THIS; diff --git a/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4.c b/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4.c index 7f5f43fee5..5d142c2299 100644 --- a/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4.c +++ b/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4.c @@ -29,7 +29,7 @@ ActorInit Oceff_Wipe4_InitVars = { #include "assets/overlays/ovl_Oceff_Wipe4/ovl_Oceff_Wipe4.c" -s32 D_8099E780; +static s32 sBssPad; void OceffWipe4_Init(Actor* thisx, PlayState* play) { OceffWipe4* this = THIS; diff --git a/src/overlays/actors/ovl_Oceff_Wipe5/z_oceff_wipe5.c b/src/overlays/actors/ovl_Oceff_Wipe5/z_oceff_wipe5.c index 43542180a4..068a7d8f94 100644 --- a/src/overlays/actors/ovl_Oceff_Wipe5/z_oceff_wipe5.c +++ b/src/overlays/actors/ovl_Oceff_Wipe5/z_oceff_wipe5.c @@ -27,7 +27,7 @@ ActorInit Oceff_Wipe5_InitVars = { /**/ OceffWipe5_Draw, }; -UNK_TYPE4 D_80BC9260; +static s32 sBssPad; void OceffWipe5_Init(Actor* thisx, PlayState* play) { OceffWipe5* this = THIS; diff --git a/src/overlays/actors/ovl_Oceff_Wipe7/z_oceff_wipe7.c b/src/overlays/actors/ovl_Oceff_Wipe7/z_oceff_wipe7.c index 81c32a5e54..0af01be10b 100644 --- a/src/overlays/actors/ovl_Oceff_Wipe7/z_oceff_wipe7.c +++ b/src/overlays/actors/ovl_Oceff_Wipe7/z_oceff_wipe7.c @@ -29,7 +29,7 @@ ActorInit Oceff_Wipe7_InitVars = { #include "assets/overlays/ovl_Oceff_Wipe7/ovl_Oceff_Wipe7.c" -s32 D_80BCEB10; +static s32 sBssPad; void OceffWipe7_Init(Actor* thisx, PlayState* play) { OceffWipe7* this = THIS; diff --git a/src/overlays/actors/ovl_player_actor/z_player.c b/src/overlays/actors/ovl_player_actor/z_player.c index 00f5c4ad41..6f7e02c744 100644 --- a/src/overlays/actors/ovl_player_actor/z_player.c +++ b/src/overlays/actors/ovl_player_actor/z_player.c @@ -8816,7 +8816,7 @@ void func_8083C6E8(Player* this, PlayState* play) { } if (sPlayerFloorType == FLOOR_TYPE_11) { - Math_SmoothStepToS(&this->actor.focus.rot.x, -20000, 10, 4000, 800); + Math_SmoothStepToS(&this->actor.focus.rot.x, -0x4E20, 10, 0xFA0, 0x320); } else { s16 sp46 = 0; f32 yIntersect; @@ -8826,17 +8826,17 @@ void func_8083C6E8(Player* this, PlayState* play) { yIntersect = func_80835D2C(play, this, &D_8085D218, &pos); if (yIntersect > BGCHECK_Y_MIN) { temp_v0 = Math_Atan2S_XY(40.0f, this->actor.world.pos.y - yIntersect); - sp46 = CLAMP(temp_v0, -4000, 4000); + sp46 = CLAMP(temp_v0, -0xFA0, 0xFA0); } this->actor.focus.rot.y = this->actor.shape.rot.y; - Math_SmoothStepToS(&this->actor.focus.rot.x, sp46, 14, 4000, 30); + Math_SmoothStepToS(&this->actor.focus.rot.x, sp46, 14, 0xFA0, 30); } func_80832754(this, func_800B7128(this) || func_8082EF20(this)); } void func_8083C85C(Player* this) { - Math_ScaledStepToS(&this->upperLimbRot.x, D_80862B3C * -500.0f, 900); + Math_ScaledStepToS(&this->upperLimbRot.x, D_80862B3C * -500.0f, 0x384); this->headLimbRot.x = (-(f32)this->upperLimbRot.x * 0.5f); this->unk_AA6 |= 0x48; } @@ -12851,7 +12851,7 @@ void func_8084748C(Player* this, f32* speed, f32 speedTarget, s16 yawTarget) { } Math_AsymStepToF(speed, speedTarget * 0.8f, incrStep, (fabsf(*speed) * 0.02f) + 0.05f); - Math_ScaledStepToS(&this->currentYaw, yawTarget, 1600); // 1 ESS turn, also one frame of first-person rotation + Math_ScaledStepToS(&this->currentYaw, yawTarget, 0x640); // 1 ESS turn, also one frame of first-person rotation } void func_808475B4(Player* this) { diff --git a/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_collect.c b/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_collect.c index 6c3af45690..4c49f5b45f 100644 --- a/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_collect.c +++ b/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_collect.c @@ -623,7 +623,7 @@ void KaleidoScope_UpdateQuestCursor(PlayState* play) { if (nextCursorPoint == CURSOR_TO_LEFT) { KaleidoScope_MoveCursorToSpecialPos(play, PAUSE_CURSOR_PAGE_LEFT); pauseCtx->mainState = PAUSE_MAIN_STATE_IDLE; - if (interfaceCtx->unk_212 == 6) { + if (interfaceCtx->unk_212 == DO_ACTION_DECIDE) { func_8011552C(play, DO_ACTION_INFO); } return; @@ -807,7 +807,7 @@ void KaleidoScope_UpdateQuestCursor(PlayState* play) { pauseCtx->mainState = PAUSE_MAIN_STATE_IDLE_CURSOR_ON_SONG; - if (interfaceCtx->unk_212 != 6) { + if (interfaceCtx->unk_212 != DO_ACTION_DECIDE) { func_8011552C(play, DO_ACTION_DECIDE); } @@ -820,7 +820,7 @@ void KaleidoScope_UpdateQuestCursor(PlayState* play) { Interface_SetHudVisibility(HUD_VISIBILITY_ALL); } } else { - if (interfaceCtx->unk_212 != 6) { + if (interfaceCtx->unk_212 != DO_ACTION_DECIDE) { func_8011552C(play, DO_ACTION_DECIDE); } if (gSaveContext.buttonStatus[EQUIP_SLOT_A] != BTN_DISABLED) { @@ -831,11 +831,11 @@ void KaleidoScope_UpdateQuestCursor(PlayState* play) { } } else { if ((cursor == QUEST_BOMBERS_NOTEBOOK) && (pauseCtx->cursorItem[PAUSE_QUEST] != PAUSE_ITEM_NONE)) { - if (interfaceCtx->unk_212 != 6) { + if (interfaceCtx->unk_212 != DO_ACTION_DECIDE) { func_8011552C(play, DO_ACTION_DECIDE); } pauseCtx->cursorColorSet = PAUSE_CURSOR_COLOR_SET_BLUE; - } else if (interfaceCtx->unk_212 == 6) { + } else if (interfaceCtx->unk_212 == DO_ACTION_DECIDE) { func_8011552C(play, DO_ACTION_INFO); } diff --git a/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope_NES.c b/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope_NES.c index 7e741194de..4ab7fbdfd9 100644 --- a/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope_NES.c +++ b/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope_NES.c @@ -352,8 +352,8 @@ void KaleidoScope_HandlePageToggles(PlayState* play, Input* input) { if (CHECK_BTN_ALL(input->cur.button, BTN_DRIGHT) || CHECK_BTN_ALL(input->press.button, BTN_R)) { // Switch the page to the right regardless of where the cursor is - if (interfaceCtx->unk_212 == 6) { - func_8011552C(play, 0x15); + if (interfaceCtx->unk_212 == DO_ACTION_DECIDE) { + func_8011552C(play, DO_ACTION_INFO); } KaleidoScope_SwitchPage(pauseCtx, SWITCH_PAGE_RIGHT); return; @@ -361,8 +361,8 @@ void KaleidoScope_HandlePageToggles(PlayState* play, Input* input) { if (CHECK_BTN_ALL(input->cur.button, BTN_DLEFT) || CHECK_BTN_ALL(input->press.button, BTN_Z)) { // Switch the page to the left regardless of where the cursor is - if (interfaceCtx->unk_212 == 6) { - func_8011552C(play, 0x15); + if (interfaceCtx->unk_212 == DO_ACTION_DECIDE) { + func_8011552C(play, DO_ACTION_INFO); } KaleidoScope_SwitchPage(pauseCtx, SWITCH_PAGE_LEFT); return; diff --git a/tools/disasm/functions.txt b/tools/disasm/functions.txt index 11341ea5bd..9c6541ae54 100644 --- a/tools/disasm/functions.txt +++ b/tools/disasm/functions.txt @@ -16326,9 +16326,9 @@ 0x80BF3E88:("func_80BF3E88",), 0x80BF3ED4:("func_80BF3ED4",), 0x80BF3F14:("func_80BF3F14",), - 0x80BF3FF8:("func_80BF3FF8",), + 0x80BF3FF8:("EnRg_UpdateSkelAnime",), 0x80BF4024:("func_80BF4024",), - 0x80BF409C:("func_80BF409C",), + 0x80BF409C:("EnRg_ChangeAnim",), 0x80BF40F4:("func_80BF40F4",), 0x80BF416C:("func_80BF416C",), 0x80BF4220:("func_80BF4220",), @@ -16340,7 +16340,7 @@ 0x80BF4934:("func_80BF4934",), 0x80BF4964:("func_80BF4964",), 0x80BF4AB8:("func_80BF4AB8",), - 0x80BF4D64:("func_80BF4D64",), + 0x80BF4D64:("EnRg_IsInFinishLine",), 0x80BF4DA8:("func_80BF4DA8",), 0x80BF4EBC:("func_80BF4EBC",), 0x80BF4FC4:("func_80BF4FC4",), @@ -16401,8 +16401,8 @@ 0x80BFB480:("EnRz_Init",), 0x80BFB780:("EnRz_ActorShadowFunc",), 0x80BFB864:("EnRz_ChangeAnim",), - 0x80BFB9E4:("func_80BFB9E4",), - 0x80BFBA1C:("func_80BFBA1C",), + 0x80BFB9E4:("EnRz_ChangeAnimLoopMorph",), + 0x80BFBA1C:("EnRz_ChangeAnimLoop",), 0x80BFBA50:("EnRz_SetupPath",), 0x80BFBB44:("EnRz_GetPathStatus",), 0x80BFBC78:("EnRz_CanTalk",), @@ -17138,7 +17138,7 @@ 0x80C25C34:("ObjEnding_Update",), 0x80C25C44:("ObjEnding_Draw",), 0x80C25D40:("func_80C25D40",), - 0x80C25D84:("func_80C25D84",), + 0x80C25D84:("EnRsn_DoNothing",), 0x80C25D94:("EnRsn_Init",), 0x80C25E14:("EnRsn_Destroy",), 0x80C25E38:("EnRsn_Update",), diff --git a/tools/disasm/variables.txt b/tools/disasm/variables.txt index 2b63c95b0f..6252780ed1 100644 --- a/tools/disasm/variables.txt +++ b/tools/disasm/variables.txt @@ -15966,13 +15966,13 @@ 0x80BF57B8:("D_80BF57B8","UNK_TYPE1","",0x1), 0x80BF57C4:("D_80BF57C4","UNK_TYPE1","",0x1), 0x80BF57E4:("D_80BF57E4","UNK_TYPE1","",0x1), - 0x80BF5914:("D_80BF5914","UNK_TYPE1","",0x1), + 0x80BF5914:("sAnimationInfo","UNK_TYPE1","",0x1), 0x80BF5934:("D_80BF5934","UNK_TYPE1","",0x1), 0x80BF5954:("D_80BF5954","UNK_TYPE1","",0x1), 0x80BF5960:("D_80BF5960","UNK_TYPE1","",0x1), 0x80BF596C:("D_80BF596C","UNK_TYPE1","",0x1), 0x80BF59F0:("D_80BF59F0","EffectTireMarkInit","",0x8), - 0x80BF59F8:("D_80BF59F8","UNK_TYPE1","",0x1), + 0x80BF59F8:("sEyeTextures","UNK_TYPE1","",0x1), 0x80BF5A10:("D_80BF5A10","f32","",0x4), 0x80BF5A14:("D_80BF5A14","f32","",0x4), 0x80BF5A18:("D_80BF5A18","f32","",0x4),