diff --git a/include/z64save.h b/include/z64save.h index e131c8a8d3..34e8d0c2b3 100644 --- a/include/z64save.h +++ b/include/z64save.h @@ -488,6 +488,7 @@ typedef enum { #define CHECK_QUEST_ITEM(item) (GET_SAVE_INVENTORY_QUEST_ITEMS & gBitFlags[item]) #define SET_QUEST_ITEM(item) (gSaveContext.save.saveInfo.inventory.questItems = (GET_SAVE_INVENTORY_QUEST_ITEMS | gBitFlags[item])) #define REMOVE_QUEST_ITEM(item) (gSaveContext.save.saveInfo.inventory.questItems = (GET_SAVE_INVENTORY_QUEST_ITEMS & (-1 - gBitFlags[item]))) +#define TOGGLE_QUEST_ITEM(item) (gSaveContext.save.saveInfo.inventory.questItems ^= (gBitFlags[item])) #define GET_QUEST_HEART_PIECE_COUNT ((GET_SAVE_INVENTORY_QUEST_ITEMS & 0xF0000000) >> QUEST_HEART_PIECE_COUNT) #define EQ_MAX_QUEST_HEART_PIECE_COUNT ((GET_SAVE_INVENTORY_QUEST_ITEMS & 0xF0000000) == (4 << QUEST_HEART_PIECE_COUNT)) diff --git a/src/code/z_message_nes.c b/src/code/z_message_nes.c index dd64889cc2..108146d3ae 100644 --- a/src/code/z_message_nes.c +++ b/src/code/z_message_nes.c @@ -101,17 +101,17 @@ void Message_LoadPluralRupeesNES(PlayState* play, s16* decodedBufPos, s32* offse #define RUPEES_STR_SPA "Rupia(s)" char sRupeesTextLocalization[LANGUAGE_MAX - 1][8] = { - RUPEES_STR_EN, // EN - RUPEES_STR_DE, // DE - RUPEES_STR_FR, // FR - RUPEES_STR_SPA, // SPA + RUPEES_STR_EN, // LANGUAGE_ENG + RUPEES_STR_DE, // LANGUAGE_GER + RUPEES_STR_FR, // LANGUAGE_FRE + RUPEES_STR_SPA, // LANGUAGE_SPA }; u8 sRupeesTextLength[LANGUAGE_MAX - 1] = { - sizeof(RUPEES_STR_EN) - 1, - sizeof(RUPEES_STR_DE) - 1, - sizeof(RUPEES_STR_FR) - 1, - sizeof(RUPEES_STR_SPA) - 1, + sizeof(RUPEES_STR_EN) - 1, // LANGUAGE_ENG + sizeof(RUPEES_STR_DE) - 1, // LANGUAGE_GER + sizeof(RUPEES_STR_FR) - 1, // LANGUAGE_FRE + sizeof(RUPEES_STR_SPA) - 1, // LANGUAGE_SPA }; void Message_LoadLocalizedRupeesNES(PlayState* play, s16* decodedBufPos, s32* offset, f32* arg3) { diff --git a/src/code/z_parameter.c b/src/code/z_parameter.c index 7d0340e14c..af404c7aa7 100644 --- a/src/code/z_parameter.c +++ b/src/code/z_parameter.c @@ -163,16 +163,32 @@ static Gfx sScreenFillSetupDL[] = { }; s16 D_801BF9B0 = 0; -f32 D_801BF9B4[] = { 100.0f, 109.0f }; +f32 D_801BF9B4[] = { + 100.0f, // LANGUAGE_JPN + 109.0f, // LANGUAGE_ENG + // Data missing for other languages? +}; s16 D_801BF9BC[] = { 0x226, // EQUIP_SLOT_B 0x2A8, // EQUIP_SLOT_C_LEFT 0x2A8, // EQUIP_SLOT_C_DOWN 0x2A8, // EQUIP_SLOT_C_RIGHT }; -s16 D_801BF9C4[] = { 0x9E, 0x9B }; -s16 D_801BF9C8[] = { 0x17, 0x16 }; -f32 D_801BF9CC[] = { -380.0f, -350.0f }; +s16 D_801BF9C4[] = { + 0x9E, // LANGUAGE_JPN + 0x9B, // LANGUAGE_ENG + // Data missing for other languages? +}; +s16 D_801BF9C8[] = { + 0x17, // LANGUAGE_JPN + 0x16, // LANGUAGE_ENG + // Data missing for other languages? +}; +f32 D_801BF9CC[] = { + -380.0f, // LANGUAGE_JPN + -350.0f, // LANGUAGE_ENG + // Data missing for other languages? +}; s16 D_801BF9D4[] = { 0xA7, // EQUIP_SLOT_B 0xE3, // EQUIP_SLOT_C_LEFT @@ -3861,12 +3877,20 @@ void Interface_SetOrthoView(InterfaceContext* interfaceCtx) { } void Interface_DrawItemButtons(PlayState* play) { - static TexturePtr cUpLabelTextures[] = { - gTatlCUpENGTex, gTatlCUpENGTex, gTatlCUpGERTex, gTatlCUpFRATex, gTatlCUpESPTex, + static TexturePtr sCUpLabelTextures[LANGUAGE_MAX] = { + gTatlCUpENGTex, // LANGUAGE_JPN + gTatlCUpENGTex, // LANGUAGE_ENG + gTatlCUpGERTex, // LANGUAGE_GER + gTatlCUpFRATex, // LANGUAGE_FRE + gTatlCUpESPTex, // LANGUAGE_SPA }; - static s16 startButtonLeftPos[] = { + static s16 sStartButtonLeftPos[LANGUAGE_MAX] = { // Remnant of OoT - 130, 136, 136, 136, 136, + 130, // LANGUAGE_JPN + 136, // LANGUAGE_ENG + 136, // LANGUAGE_GER + 136, // LANGUAGE_FRE + 136, // LANGUAGE_SPA }; static s16 D_801BFAF4[] = { 0x1D, // EQUIP_SLOT_B @@ -3952,9 +3976,9 @@ void Interface_DrawItemButtons(PlayState* play) { gDPSetEnvColor(OVERLAY_DISP++, 0, 0, 0, 0); gDPSetCombineLERP(OVERLAY_DISP++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0); - gDPLoadTextureBlock_4b(OVERLAY_DISP++, cUpLabelTextures[gSaveContext.options.language], G_IM_FMT_IA, 32, 12, - 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, - G_TX_NOLOD, G_TX_NOLOD); + gDPLoadTextureBlock_4b(OVERLAY_DISP++, sCUpLabelTextures[gSaveContext.options.language], G_IM_FMT_IA, 32, + 12, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, + G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); gSPTextureRectangle(OVERLAY_DISP++, 0x03DC, 0x0048, 0x045C, 0x0078, G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10); } diff --git a/src/overlays/actors/ovl_Bg_Hakugin_Elvpole/z_bg_hakugin_elvpole.c b/src/overlays/actors/ovl_Bg_Hakugin_Elvpole/z_bg_hakugin_elvpole.c index 8c5bb01933..1bcd27cec6 100644 --- a/src/overlays/actors/ovl_Bg_Hakugin_Elvpole/z_bg_hakugin_elvpole.c +++ b/src/overlays/actors/ovl_Bg_Hakugin_Elvpole/z_bg_hakugin_elvpole.c @@ -71,8 +71,10 @@ void func_80ABD92C(BgHakuginElvpole* this, PlayState* play) { Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_STONEDOOR_STOP); } this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y - 120.0f; + //! FAKE: if (1) {} + this->unk_15E--; } } else if (this->unk_15E == 0) { @@ -90,6 +92,7 @@ void func_80ABD92C(BgHakuginElvpole* this, PlayState* play) { this->unk_15E = 0x64; this->unk_160 = true; } + if (sp28 || (this->unk_15C & 7)) { if (this->unk_15C & 1) { var_fv1 = 1.0f; @@ -103,6 +106,7 @@ void func_80ABD92C(BgHakuginElvpole* this, PlayState* play) { } else { this->unk_15C = 0; } + if (this->unk_160) { if (this->dyna.actor.csId == CS_ID_NONE) { this->unk_160 = false; diff --git a/src/overlays/actors/ovl_Bg_Kin2_Bombwall/z_bg_kin2_bombwall.c b/src/overlays/actors/ovl_Bg_Kin2_Bombwall/z_bg_kin2_bombwall.c index b4a1dcedbe..7e7b6c2149 100644 --- a/src/overlays/actors/ovl_Bg_Kin2_Bombwall/z_bg_kin2_bombwall.c +++ b/src/overlays/actors/ovl_Bg_Kin2_Bombwall/z_bg_kin2_bombwall.c @@ -87,7 +87,7 @@ void BgKin2Bombwall_SpawnEffects(BgKin2Bombwall* this, PlayState* play) { s16 phi_s0; s16 phi_s1; - Matrix_RotateYS(this->dyna.actor.shape.rot.y, 0); + Matrix_RotateYS(this->dyna.actor.shape.rot.y, MTXMODE_NEW); for (i = 0, k = 0; i < 6; i++) { temp_a0 = (i + 1) * 15.f; diff --git a/src/overlays/actors/ovl_Boss_06/z_boss_06.c b/src/overlays/actors/ovl_Boss_06/z_boss_06.c index 76be8c4615..544dada9cb 100644 --- a/src/overlays/actors/ovl_Boss_06/z_boss_06.c +++ b/src/overlays/actors/ovl_Boss_06/z_boss_06.c @@ -578,6 +578,7 @@ void Boss06_Draw(Actor* thisx, PlayState* play2) { gDPSetPrimColor(POLY_XLU_DISP++, 0, 255, 255, maxColor, (u8)((100.0f * sp68) + 65.0f), spD2); gSPDisplayList(POLY_XLU_DISP++, object_knight_DL_018DE0); + //! FAKE: if (1) {} } diff --git a/src/overlays/actors/ovl_Dm_Char03/z_dm_char03.c b/src/overlays/actors/ovl_Dm_Char03/z_dm_char03.c index 9ba0ea42db..9a56d0d62b 100644 --- a/src/overlays/actors/ovl_Dm_Char03/z_dm_char03.c +++ b/src/overlays/actors/ovl_Dm_Char03/z_dm_char03.c @@ -37,7 +37,7 @@ typedef enum { /* 1 */ DMCHAR03_ANIM_MAX } DmChar03Animation; -AnimationInfo sAnimationInfo[DMCHAR03_ANIM_MAX] = { +static AnimationInfo sAnimationInfo[DMCHAR03_ANIM_MAX] = { { &gDekuMaskFallOverAnim, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f }, // DMCHAR03_ANIM_FALL_OVER }; diff --git a/src/overlays/actors/ovl_En_Am/z_en_am.c b/src/overlays/actors/ovl_En_Am/z_en_am.c index 90ce1a1ba3..a2cd191a96 100644 --- a/src/overlays/actors/ovl_En_Am/z_en_am.c +++ b/src/overlays/actors/ovl_En_Am/z_en_am.c @@ -132,18 +132,6 @@ static InitChainEntry sInitChain[] = { ICHAIN_F32(targetArrowOffset, 2000, ICHAIN_STOP), }; -static Vec3f sVelocity = { 0.0f, -1.5f, 0.0f }; - -static Vec3f sAccel = { 0.0f, -(1.0f / 5.0f), 0.0f }; - -static Color_RGBA8 D_808B1118 = { 100, 100, 100, 0 }; - -static Color_RGBA8 D_808B111C = { 40, 40, 40, 0 }; - -static Color_RGBA8 D_808B1120 = { 150, 150, 150, 255 }; - -static Color_RGBA8 D_808B1124 = { 100, 100, 100, 150 }; - void EnAm_Init(Actor* thisx, PlayState* play) { EnAm* this = THIS; @@ -169,6 +157,10 @@ void EnAm_Destroy(Actor* thisx, PlayState* play) { } void EnAm_SpawnEffects(EnAm* this, PlayState* play) { + static Vec3f sVelocity = { 0.0f, -1.5f, 0.0f }; + static Vec3f sAccel = { 0.0f, -(1.0f / 5.0f), 0.0f }; + static Color_RGBA8 sPrimColor = { 100, 100, 100, 0 }; + static Color_RGBA8 sEnvColor = { 40, 40, 40, 0 }; s32 i; Vec3f effectPos; s32 pad; @@ -178,7 +170,7 @@ void EnAm_SpawnEffects(EnAm* this, PlayState* play) { effectPos.x = Rand_CenteredFloat(65.0f) + this->actor.world.pos.x; effectPos.y = Rand_CenteredFloat(10.0f) + (this->actor.world.pos.y + 40.0f); effectPos.z = Rand_CenteredFloat(65.0f) + this->actor.world.pos.z; - EffectSsKirakira_SpawnSmall(play, &effectPos, &sVelocity, &sAccel, &D_808B1118, &D_808B111C); + EffectSsKirakira_SpawnSmall(play, &effectPos, &sVelocity, &sAccel, &sPrimColor, &sEnvColor); } Actor_PlaySfx(&this->actor, NA_SE_EN_AMOS_WALK); Actor_SpawnFloorDustRing(play, &this->actor, &this->actor.world.pos, 4.0f, 3, 8.0f, 300, 15, false); @@ -397,6 +389,8 @@ void func_808B0820(EnAm* this) { } void func_808B0894(EnAm* this, PlayState* play) { + static Color_RGBA8 sPrimColor = { 150, 150, 150, 255 }; + static Color_RGBA8 sEnvColor = { 100, 100, 100, 150 }; s32 i; Vec3f dustPos; s32 pad; @@ -419,7 +413,7 @@ void func_808B0894(EnAm* this, PlayState* play) { dustPos.y = (Rand_CenteredFloat(10.0f) * 6.0f) + (this->actor.world.pos.y + 40.0f); dustPos.z = (Math_CosS(0) * 7.0f) + this->actor.world.pos.z; - func_800B0EB0(play, &dustPos, &gZeroVec3f, &gZeroVec3f, &D_808B1120, &D_808B1124, 200, 45, 12); + func_800B0EB0(play, &dustPos, &gZeroVec3f, &gZeroVec3f, &sPrimColor, &sEnvColor, 200, 45, 12); } } else if (this->explodeTimer == 0) { Actor_Kill(&this->actor); diff --git a/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c b/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c index aade607af2..2738c2d8f2 100644 --- a/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c +++ b/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c @@ -579,10 +579,10 @@ void func_8088B6B0(EnArrow* this, PlayState* play) { } void EnArrow_Update(Actor* thisx, PlayState* play) { - static Vec3f D_8088C2CC = { 0.0f, 0.5f, 0.0f }; - static Vec3f D_8088C2D8 = { 0.0f, 0.5f, 0.0f }; - static Color_RGBA8 D_8088C2E4 = { 255, 255, 100, 255 }; - static Color_RGBA8 D_8088C2E8 = { 255, 50, 0, 0 }; + static Vec3f sVelocity = { 0.0f, 0.5f, 0.0f }; + static Vec3f sAccel = { 0.0f, 0.5f, 0.0f }; + static Color_RGBA8 sPrimColor = { 255, 255, 100, 255 }; + static Color_RGBA8 sEnvColor = { 255, 50, 0, 0 }; s32 pad; EnArrow* this = THIS; Player* player = GET_PLAYER(play); @@ -606,7 +606,7 @@ void EnArrow_Update(Actor* thisx, PlayState* play) { this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 0); } } else if (this->actor.params == ARROW_TYPE_NORMAL_LIT) { - func_800B0EB0(play, &this->unk_234, &D_8088C2CC, &D_8088C2D8, &D_8088C2E4, &D_8088C2E8, 100, 0, 8); + func_800B0EB0(play, &this->unk_234, &sVelocity, &sAccel, &sPrimColor, &sEnvColor, 100, 0, 8); } Math_Vec3f_Copy(&this->actor.home.pos, &this->actor.prevPos); diff --git a/src/overlays/actors/ovl_En_Bal/z_en_bal.c b/src/overlays/actors/ovl_En_Bal/z_en_bal.c index 6ee733dfda..a28a580e64 100644 --- a/src/overlays/actors/ovl_En_Bal/z_en_bal.c +++ b/src/overlays/actors/ovl_En_Bal/z_en_bal.c @@ -1166,7 +1166,7 @@ void EnBal_Draw(Actor* thisx, PlayState* play) { OPEN_DISPS(play->state.gfxCtx); Gfx_SetupDL25_Opa(play->state.gfxCtx); - gSPSegment(POLY_OPA_DISP++, 8, SEGMENTED_TO_K0(sEyeTextures[this->eyeTexIndex])); + gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_K0(sEyeTextures[this->eyeTexIndex])); SkelAnime_DrawFlexOpa(play, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount, EnBal_OverrideLimbDraw, EnBal_PostLimbDraw, &this->picto.actor); diff --git a/src/overlays/actors/ovl_En_Bigpo/z_en_bigpo.c b/src/overlays/actors/ovl_En_Bigpo/z_en_bigpo.c index cd521d02e8..bcc8f3648d 100644 --- a/src/overlays/actors/ovl_En_Bigpo/z_en_bigpo.c +++ b/src/overlays/actors/ovl_En_Bigpo/z_en_bigpo.c @@ -1261,7 +1261,7 @@ void EnBigpo_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* ro if ((this->actionFunc == EnBigpo_BurnAwayDeath) && (this->idleTimer > 18)) { if (this->actor.scale.x != 0.0f) { Matrix_Scale(0.014f / this->actor.scale.x, 0.014f / this->actor.scale.x, 0.014f / this->actor.scale.x, - 1); + MTXMODE_APPLY); } } Matrix_Get(&this->drawMtxF); diff --git a/src/overlays/actors/ovl_En_Dnk/z_en_dnk.c b/src/overlays/actors/ovl_En_Dnk/z_en_dnk.c index f3f92604b6..bdffc71815 100644 --- a/src/overlays/actors/ovl_En_Dnk/z_en_dnk.c +++ b/src/overlays/actors/ovl_En_Dnk/z_en_dnk.c @@ -175,8 +175,8 @@ s32 EnDnk_ChangeAnim(SkelAnime* skelAnime, s16 animIndex) { s16 endFrame; s32 didAnimChange = false; - if (animIndex >= 0) { - if (animIndex < ARRAY_COUNT(sAnimationInfo)) { + if (animIndex > ENDNK_ANIM_NONE) { + if (animIndex < ENDNK_ANIM_MAX) { didAnimChange = true; endFrame = sAnimationInfo[animIndex].frameCount; if (endFrame < 0) { 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 f01cdaf7c7..497011ee81 100644 --- a/src/overlays/actors/ovl_En_Fu/z_en_fu.c +++ b/src/overlays/actors/ovl_En_Fu/z_en_fu.c @@ -127,7 +127,6 @@ void func_809616E0(EnFu* this, PlayState* play) { f32 temp_f22; s16 atan; s16 spA0 = false; - Vec3f sp94; if ((GET_PLAYER_FORM == PLAYER_FORM_DEKU) && (CURRENT_DAY == 3)) { spA0 = true; @@ -146,18 +145,19 @@ void func_809616E0(EnFu* this, PlayState* play) { } if (this->unk_546 == 1) { - Vec3f sp88 = { 0.0f, 0.0f, 0.0f }; - Vec3f sp7C = { 0.0f, 0.2f, 0.0f }; - Color_RGBA8 sp78 = { 255, 255, 255, 255 }; - Color_RGBA8 sp74 = { 198, 198, 198, 255 }; + Vec3f pos; + Vec3f velocity = { 0.0f, 0.0f, 0.0f }; + Vec3f accel = { 0.0f, 0.2f, 0.0f }; + Color_RGBA8 primColor = { 255, 255, 255, 255 }; + Color_RGBA8 envColor = { 198, 198, 198, 255 }; - sp94.x = this->pathPoints[i].x; - sp94.y = this->pathPoints[i].y; - sp94.z = this->pathPoints[i].z; - func_800B0EB0(play, &sp94, &sp88, &sp7C, &sp78, &sp74, 100, 150, 10); - sp94.x -= 0.1f * temp_f20; - sp94.z -= 0.1f * temp_f22; - func_800B3030(play, &sp94, &sp88, &sp7C, 100, 0, 3); + pos.x = this->pathPoints[i].x; + pos.y = this->pathPoints[i].y; + pos.z = this->pathPoints[i].z; + func_800B0EB0(play, &pos, &velocity, &accel, &primColor, &envColor, 100, 150, 10); + pos.x -= 0.1f * temp_f20; + pos.z -= 0.1f * temp_f22; + func_800B3030(play, &pos, &velocity, &accel, 100, 0, 3); } } } 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 0b5140e769..8b82072e4f 100644 --- a/src/overlays/actors/ovl_En_Geg/z_en_geg.c +++ b/src/overlays/actors/ovl_En_Geg/z_en_geg.c @@ -281,7 +281,7 @@ s32 func_80BB18FC(EnGeg* this, Actor* actor) { return false; } -Vec3f* func_80BB19C0(Vec3f* arg0, EnGeg* this, PlayState* play) { +Vec3f func_80BB19C0(EnGeg* this, PlayState* play) { Player* player = GET_PLAYER(play); Vec3f sp40; Vec3f sp34; @@ -302,13 +302,10 @@ Vec3f* func_80BB19C0(Vec3f* arg0, EnGeg* this, PlayState* play) { sp34.z = (Math_CosS(sp30) * 50.0f) + player->actor.world.pos.z; if (Math_Vec3f_DistXZ(&this->actor.world.pos, &sp34) < sp2C) { - // clang-format off - *arg0 = sp40; return arg0; - // clang-format on + return sp40; } else { - *arg0 = sp34; + return sp34; } - return arg0; } u8 func_80BB1B14(EnGeg* this, PlayState* play) { @@ -772,7 +769,7 @@ void func_80BB2E00(EnGeg* this, PlayState* play) { this->unk_230 |= 1; this->actor.shape.yOffset = 14.0f; if (this->unk_496 == 0xD69) { - func_80BB19C0(&this->unk_4E4, this, play); + this->unk_4E4 = func_80BB19C0(this, play); this->actionFunc = func_80BB2F7C; } else { this->actionFunc = func_80BB3318; @@ -998,7 +995,7 @@ void EnGeg_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Vec3f sp38 = { 1.0f, 5.0f, -0.5f }; Vec3f sp2C = { -1.0f, 5.0f, -0.5f }; - if (limbIndex == 17) { + if (limbIndex == GORON_LIMB_HEAD) { if (!(this->unk_230 & 0x40)) { Gfx_SetupDL25_Opa(play->state.gfxCtx); @@ -1032,7 +1029,7 @@ void EnGeg_TransformLimbDraw(PlayState* play, s32 limbIndex, Actor* thisx) { s32 phi_v1; switch (limbIndex) { - case 17: + case GORON_LIMB_HEAD: if (this->unk_230 & 2) { phi_v1 = true; } else { @@ -1057,7 +1054,7 @@ void EnGeg_TransformLimbDraw(PlayState* play, s32 limbIndex, Actor* thisx) { Matrix_Push(); break; - case 10: + case GORON_LIMB_BODY: if (this->unk_230 & 2) { phi_v1 = true; } else { @@ -1080,6 +1077,9 @@ void EnGeg_TransformLimbDraw(PlayState* play, s32 limbIndex, Actor* thisx) { Matrix_RotateZS(this->unk_490.z, MTXMODE_APPLY); Matrix_Push(); break; + + default: + break; } } 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 d0002f2e8f..808f5464f3 100644 --- a/src/overlays/actors/ovl_En_Gg/z_en_gg.c +++ b/src/overlays/actors/ovl_En_Gg/z_en_gg.c @@ -515,23 +515,19 @@ void func_80B35B44(EnGgStruct* ptr, PlayState* play) { void func_80B35C84(EnGgStruct* ptr, PlayState* play) { s32 sp74; s32 phi_s7; - f32 temp_f22; - f32 temp_f24; - f32 temp_f26; - f32 temp_f20; s32 i; - s32 temp = 10; + s32 ten = 10; if (ptr->unk_48 != 0) { - sp74 = ptr->unk_40 % temp; + sp74 = ptr->unk_40 % ten; ptr->unk_40 = sp74; - phi_s7 = 0x46; + phi_s7 = 70; } else if (ptr->animIndex == ENGG_ANIM_13) { sp74 = ptr->unk_40; - phi_s7 = 0x46; + phi_s7 = 70; } else { phi_s7 = ptr->unk_40 - ptr->unk_44; - sp74 = ptr->unk_40 % temp; + sp74 = ptr->unk_40 % ten; } if (phi_s7 <= 0) { @@ -542,15 +538,12 @@ void func_80B35C84(EnGgStruct* ptr, PlayState* play) { Matrix_Push(); - for (i = sp74; i < phi_s7; i += temp) { - temp_f20 = i * 0.14f; - temp_f22 = ptr->unk_00.x + (ptr->unk_18.x * temp_f20) + (0.5f * ptr->unk_24.x * temp_f20 * temp_f20); - temp_f24 = ptr->unk_00.y - Math_SinS((i * 0x27FFB) / 70); - temp_f26 = ptr->unk_00.z + (ptr->unk_18.z * temp_f20) + (0.5f * ptr->unk_24.z * temp_f20 * temp_f20); - temp_f20 = Rand_ZeroOne() * 0.003f; - - //! FAKE: - if (1) {} + for (i = sp74; i < phi_s7; i += ten) { + f32 temp = i * 0.14f; + f32 temp_f22 = ptr->unk_00.x + (ptr->unk_18.x * temp) + (0.5f * ptr->unk_24.x * temp * temp); + f32 temp_f24 = ptr->unk_00.y - Math_SinS((i * 0x27FFB) / 70); + f32 temp_f26 = ptr->unk_00.z + (ptr->unk_18.z * temp) + (0.5f * ptr->unk_24.z * temp * temp); + f32 temp_f20 = Rand_ZeroOne() * 0.003f; Matrix_Translate(temp_f22, temp_f24, temp_f26, MTXMODE_NEW); Matrix_Scale(temp_f20, temp_f20, temp_f20, MTXMODE_APPLY); @@ -569,12 +562,12 @@ void func_80B35C84(EnGgStruct* ptr, PlayState* play) { Matrix_Push(); - for (i = sp74; i < phi_s7; i += temp) { - temp_f20 = i * 0.14f; - temp_f22 = ptr->unk_0C.x + ((ptr->unk_18.x * temp_f20) + (0.5f * ptr->unk_24.x * temp_f20 * temp_f20)); - temp_f24 = ptr->unk_0C.y - Math_SinS((i * 0x27FFB) / 70); - temp_f26 = ptr->unk_0C.z + (ptr->unk_18.z * temp_f20) + (0.5f * ptr->unk_24.z * temp_f20 * temp_f20); - temp_f20 = Rand_ZeroOne() * 0.003f; + for (i = sp74; i < phi_s7; i += ten) { + f32 temp = i * 0.14f; + f32 temp_f22 = ptr->unk_0C.x + ((ptr->unk_18.x * temp) + (0.5f * ptr->unk_24.x * temp * temp)); + f32 temp_f24 = ptr->unk_0C.y - Math_SinS((i * 0x27FFB) / 70); + f32 temp_f26 = ptr->unk_0C.z + (ptr->unk_18.z * temp) + (0.5f * ptr->unk_24.z * temp * temp); + f32 temp_f20 = Rand_ZeroOne() * 0.003f; Matrix_Translate(temp_f22, temp_f24, temp_f26, MTXMODE_NEW); Matrix_Scale(temp_f20, temp_f20, temp_f20, MTXMODE_APPLY); 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 44edff70a6..fa0a1f3d58 100644 --- a/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c +++ b/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c @@ -649,9 +649,7 @@ void func_8093FC6C(EnGoroiwa* this, PlayState* play) { } void func_80940090(EnGoroiwa* this, PlayState* play) { - s32 pad; - s32 pad2; - s32 i; + s32 pad[3]; s32 sp120 = ENGOROIWA_GET_C000(&this->actor); s32 phi_s0; s32 phi_s3; @@ -667,76 +665,79 @@ void func_80940090(EnGoroiwa* this, PlayState* play) { s32 spD8; s16 spA8; f32 temp_f20; - s32 pad3; + s32 i; - if (this->actor.flags & ACTOR_FLAG_40) { - spEC = (this->actor.scale.x + 0.1f) * 0.5f; - sp10C.x = this->actor.world.pos.x; - sp10C.y = this->actor.world.pos.y + this->unk_1DC; - sp10C.z = this->actor.world.pos.z; - //! FAKE: - if (1) {} - spD8 = spEC * 150.0f; - spA8 = 0x10000 / spD8; + if (!(this->actor.flags & ACTOR_FLAG_40)) { + return; + } - for (i = 0, phi_s7 = 0; i < spD8; i++, phi_s7 += spA8) { - if ((i & 3) == 0) { - phi_f22 = 1.0f; - phi_s1 = D_80942E0C[sp120][2]; - phi_s2 = -0x118; + spEC = (this->actor.scale.x + 0.1f) * 0.5f; + sp10C.x = this->actor.world.pos.x; + sp10C.y = this->actor.world.pos.y + this->unk_1DC; + sp10C.z = this->actor.world.pos.z; + spD8 = spEC * 150.0f; + spA8 = 0x10000 / spD8; + + for (i = 0, phi_s7 = 0; i < spD8; i++, phi_s7 += spA8) { + if ((i & 3) == 0) { + phi_f22 = 1.0f; + phi_s1 = D_80942E0C[sp120][2]; + phi_s2 = -0x118; + phi_s3 = 0; + phi_s0 = 0x40; + } else { + phi_s2 = -0x190; + if ((i & 3) == 1) { + phi_s1 = D_80942E0C[sp120][1]; + phi_s2 = -0x154; phi_s3 = 0; - phi_s0 = 0x40; - } else { - phi_s2 = -0x190; - if ((i & 3) == 1) { - phi_s1 = D_80942E0C[sp120][1]; - phi_s2 = -0x154; - phi_s3 = 0; - phi_f22 = 0.9f; - if (Rand_ZeroOne() < 0.4f) { - phi_s0 = 0x20; - } else { - phi_s0 = 0x40; - } + phi_f22 = 0.9f; + if (Rand_ZeroOne() < 0.4f) { + phi_s0 = 0x20; } else { - phi_s1 = D_80942E0C[sp120][0]; - phi_s3 = 1; - phi_f22 = 0.8f; - if ((s32)Rand_Next() > 0) { - phi_s0 = 0x21; - } else { - phi_s0 = 0x41; - } + phi_s0 = 0x40; + } + } else { + phi_s1 = D_80942E0C[sp120][0]; + phi_s3 = 1; + phi_f22 = 0.8f; + if ((s32)Rand_Next() > 0) { + phi_s0 = 0x21; + } else { + phi_s0 = 0x41; } } - - temp_f20 = (Rand_ZeroOne() * this->actor.scale.x * 400.0f) + 20.0f; - - sp100.x = Math_SinS((s32)(Rand_ZeroOne() * spA8) + phi_s7) * temp_f20; - sp100.y = (Rand_ZeroOne() - 0.4f) * temp_f20 * 1.6666666f; - sp100.z = Math_CosS((s32)(Rand_ZeroOne() * spA8) + phi_s7) * temp_f20; - - spF4.x = sp100.x * 0.16f * phi_f22; - spF4.y = (Rand_ZeroOne() * 16.0f) + 3.0f; - spF4.z = sp100.z * 0.16f * phi_f22; - - Math_Vec3f_Sum(&sp100, &sp10C, &sp100); - EffectSsKakera_Spawn(play, &sp100, &spF4, &sp100, phi_s2, phi_s0, 30, 0, 0, - ((Rand_ZeroOne() * 150.0f) + 300.0f) * this->actor.scale.x, phi_s3, 0, 0x32, -1, - OBJECT_GOROIWA, phi_s1); - if (this->unk_1E6 == 0) { - sp100.x += ((Rand_ZeroOne() * 1200.0f) - 600.0f) * this->actor.scale.x; - sp100.y += ((Rand_ZeroOne() * 1400.0f) - 600.0f) * this->actor.scale.y; - sp100.z += ((Rand_ZeroOne() * 1200.0f) - 600.0f) * this->actor.scale.z; - - func_800B0E48(play, &sp100, &D_80942E48, &D_80942E54, &D_80942E30[sp120], &D_80942E3C[sp120], - (Rand_ZeroOne() * 50.0f) + (400.0f * spEC), (Rand_ZeroOne() * 60.0f) + (500.0f * spEC)); - } } - if (this->unk_1E6 != 0) { - func_8093FC6C(this, play); + temp_f20 = (Rand_ZeroOne() * this->actor.scale.x * 400.0f) + 20.0f; + + sp100.x = Math_SinS((s32)(Rand_ZeroOne() * spA8) + phi_s7) * temp_f20; + sp100.y = (Rand_ZeroOne() - 0.4f) * temp_f20 * 1.6666666f; + sp100.z = Math_CosS((s32)(Rand_ZeroOne() * spA8) + phi_s7) * temp_f20; + + spF4.x = sp100.x * 0.16f * phi_f22; + spF4.y = (Rand_ZeroOne() * 16.0f) + 3.0f; + spF4.z = sp100.z * 0.16f * phi_f22; + + Math_Vec3f_Sum(&sp100, &sp10C, &sp100); + EffectSsKakera_Spawn(play, &sp100, &spF4, &sp100, phi_s2, phi_s0, 30, 0, 0, + ((Rand_ZeroOne() * 150.0f) + 300.0f) * this->actor.scale.x, phi_s3, 0, 0x32, -1, + OBJECT_GOROIWA, phi_s1); + + if (this->unk_1E6) { + continue; } + + sp100.x += ((Rand_ZeroOne() * 1200.0f) - 600.0f) * this->actor.scale.x; + sp100.y += ((Rand_ZeroOne() * 1400.0f) - 600.0f) * this->actor.scale.y; + sp100.z += ((Rand_ZeroOne() * 1200.0f) - 600.0f) * this->actor.scale.z; + + func_800B0E48(play, &sp100, &D_80942E48, &D_80942E54, &D_80942E30[sp120], &D_80942E3C[sp120], + (Rand_ZeroOne() * 50.0f) + (400.0f * spEC), (Rand_ZeroOne() * 60.0f) + (500.0f * spEC)); + } + + if (this->unk_1E6) { + func_8093FC6C(this, play); } } @@ -1086,7 +1087,7 @@ s32 func_8094156C(EnGoroiwa* this, PlayState* play) { (0x80000000 | 0x800 | 0x400 | 0x100 | 0x8)))) { this->unk_1CC = 50; if ((params == ENGOROIWA_C000_2) && (this->collider.elements->info.acHitInfo->toucher.dmgFlags & 0x800)) { - this->unk_1E6 = 1; + this->unk_1E6 = true; } func_80940090(this, play); func_80941274(this, play); diff --git a/src/overlays/actors/ovl_En_Grasshopper/z_en_grasshopper.c b/src/overlays/actors/ovl_En_Grasshopper/z_en_grasshopper.c index 38766afdc5..2276920fce 100644 --- a/src/overlays/actors/ovl_En_Grasshopper/z_en_grasshopper.c +++ b/src/overlays/actors/ovl_En_Grasshopper/z_en_grasshopper.c @@ -1093,7 +1093,7 @@ void EnGrasshopper_Draw(Actor* thisx, PlayState* play) { DRAGONFLY_SHADOW_BODYPART_MAX, sShadowSizes, sParentShadowBodyParts); //! FAKE: Needed to fix some regs and stack //! https://decomp.me/scratch/4wJBW - if ((shadowTex && shadowTex) && shadowTex) {} + if (shadowTex && shadowTex && shadowTex) {} } SubS_DrawShadowTex(&this->actor, &play->state, shadowTex); diff --git a/src/overlays/actors/ovl_En_Guard_Nuts/z_en_guard_nuts.c b/src/overlays/actors/ovl_En_Guard_Nuts/z_en_guard_nuts.c index 074038db46..dcb61c9d4a 100644 --- a/src/overlays/actors/ovl_En_Guard_Nuts/z_en_guard_nuts.c +++ b/src/overlays/actors/ovl_En_Guard_Nuts/z_en_guard_nuts.c @@ -385,7 +385,7 @@ void EnGuardNuts_Draw(Actor* thisx, PlayState* play) { SkelAnime_DrawOpa(play, this->skelAnime.skeleton, this->skelAnime.jointTable, EnGuardNuts_OverrideLimbDraw, NULL, &this->actor); Matrix_Translate(this->guardPos.x, this->actor.floorHeight, this->guardPos.z, MTXMODE_NEW); - Matrix_Scale(0.015f, 0.015f, 0.015f, 1); + Matrix_Scale(0.015f, 0.015f, 0.015f, MTXMODE_APPLY); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); 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 37a0ea22b7..ad878e8e3c 100644 --- a/src/overlays/actors/ovl_En_Kaizoku/z_en_kaizoku.c +++ b/src/overlays/actors/ovl_En_Kaizoku/z_en_kaizoku.c @@ -2024,7 +2024,7 @@ void EnKaizoku_Update(Actor* thisx, PlayState* play2) { } if (this->picto.actor.bgCheckFlags & BGCHECKFLAG_GROUND) { - Matrix_RotateYS(this->picto.actor.shape.rot.y + this->unk_2F4, 0); + Matrix_RotateYS(this->picto.actor.shape.rot.y + this->unk_2F4, MTXMODE_NEW); Matrix_MultVecZ(this->unk_2F0, &sp34); this->picto.actor.world.pos.x += this->unk_3C4.x + sp34.x; this->picto.actor.world.pos.z += this->unk_3C4.z + sp34.z; diff --git a/src/overlays/actors/ovl_En_Maruta/z_en_maruta.c b/src/overlays/actors/ovl_En_Maruta/z_en_maruta.c index c85ca35c20..73378cd396 100644 --- a/src/overlays/actors/ovl_En_Maruta/z_en_maruta.c +++ b/src/overlays/actors/ovl_En_Maruta/z_en_maruta.c @@ -664,23 +664,23 @@ void func_80B3828C(Vec3f* arg0, Vec3f* arg1, s16 arg2, s16 arg3, s32 arg4) { } void func_80B382E4(PlayState* play, Vec3f arg1) { - Vec3f sp84 = arg1; - Vec3f sp78; - Vec3f sp6C; - Color_RGBA8 sp68 = { 170, 130, 90, 255 }; - Color_RGBA8 sp64 = { 100, 60, 20, 255 }; + Vec3f pos = arg1; + Vec3f velocity; + Vec3f accel; + Color_RGBA8 primColor = { 170, 130, 90, 255 }; + Color_RGBA8 envColor = { 100, 60, 20, 255 }; s32 i; - sp6C.y = 0.0f; - sp84.y += 15.0f; + accel.y = 0.0f; + pos.y += 15.0f; for (i = 0; i < 10; i++) { - sp78.x = Rand_Centered() * 10.0f; - sp78.y = 2.0f * Rand_ZeroOne(); - sp78.z = Rand_Centered() * 10.0f; - sp6C.x = -0.2f * sp78.x; - sp6C.z = -0.2f * sp78.z; - func_800B0EB0(play, &sp84, &sp78, &sp6C, &sp68, &sp64, 60, 20, 10); + velocity.x = Rand_Centered() * 10.0f; + velocity.y = 2.0f * Rand_ZeroOne(); + velocity.z = Rand_Centered() * 10.0f; + accel.x = -0.2f * velocity.x; + accel.z = -0.2f * velocity.z; + func_800B0EB0(play, &pos, &velocity, &accel, &primColor, &envColor, 60, 20, 10); } } diff --git a/src/overlays/actors/ovl_En_S_Goro/z_en_s_goro.c b/src/overlays/actors/ovl_En_S_Goro/z_en_s_goro.c index 1ab67d5212..05286801c1 100644 --- a/src/overlays/actors/ovl_En_S_Goro/z_en_s_goro.c +++ b/src/overlays/actors/ovl_En_S_Goro/z_en_s_goro.c @@ -72,28 +72,6 @@ void EnSGoro_Destroy(Actor* thisx, PlayState* play); void EnSGoro_Update(Actor* thisx, PlayState* play); void EnSGoro_Draw(Actor* thisx, PlayState* play); -typedef enum EnSGoroEyeTexture { - /* 0x0 */ EN_S_GORO_EYETEX_OPEN, - /* 0x1 */ EN_S_GORO_EYETEX_HALF, - /* 0x2 */ EN_S_GORO_EYETEX_CLOSED, - /* 0x3 */ EN_S_GORO_EYETEX_CLOSED2 -} EnSGoroEyeTexture; - -typedef enum EnSGoroAnimation { - /* 0x0 */ EN_S_GORO_ANIM_IDLE_LIEDOWN_A, - /* 0x1 */ EN_S_GORO_ANIM_IDLE_LIEDOWN_B, - /* 0x2 */ EN_S_GORO_ANIM_UNROLL_A, - /* 0x3 */ EN_S_GORO_ANIM_UNROLL_B, - /* 0x4 */ EN_S_GORO_ANIM_ROLLUP, - /* 0x5 */ EN_S_GORO_ANIM_SHIVER_A, - /* 0x6 */ EN_S_GORO_ANIM_SHIVER_B, - /* 0xB */ EN_S_GORO_ANIM_COVEREARS = 11, - /* 0xC */ EN_S_GORO_ANIM_TAISOU_CHEER, - /* 0xD */ EN_S_GORO_ANIM_STAND_HANDTAP, - /* 0xE */ EN_S_GORO_ANIM_SLEEPY, - /* 0xF */ EN_S_GORO_ANIM_IDLE_STAND -} EnSGoroAnimation; - ActorInit En_S_Goro_InitVars = { /**/ ACTOR_EN_S_GORO, /**/ ACTORCAT_NPC, @@ -163,26 +141,54 @@ static DamageTable sDamageTable = { /* Powder Keg */ DMG_ENTRY(1, 0x0), }; -static AnimationInfoS sAnimationInfo[] = { - { &gGoronLyingDownIdleAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, - { &gGoronLyingDownIdleAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, - { &gGoronUnrollAnim, 2.0f, 0, -1, ANIMMODE_ONCE, 0 }, - { &gGoronUnrollAnim, 2.0f, 0, -1, ANIMMODE_ONCE, -4 }, - { &gGoronUnrollAnim, -2.0f, 0, -1, ANIMMODE_ONCE, -4 }, - { &gGoronShiverAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, - { &gGoronShiverAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, - { &gGoronAthleticsDoubleArmSideBendAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, - { &gGoronAthleticsShakeLimbsAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, - { &gGoronAthleticsSingleArmSideBendAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, - { &gGoronAthleticsHamstringStretchStandingAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, - { &gGoronCoverEarsAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, - { &gGoronAthleticsCheerAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, - { &gGoronStandingHandTappingAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, - { &gGoronSleepyAnim, 1.0f, 0, -1, ANIMMODE_ONCE, -4 }, - { &gGoronStandingIdleAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -8 }, +typedef enum EnSGoroAnimation { + /* 0x0 */ EN_S_GORO_ANIM_IDLE_LIEDOWN_A, + /* 0x1 */ EN_S_GORO_ANIM_IDLE_LIEDOWN_B, + /* 0x2 */ EN_S_GORO_ANIM_UNROLL_A, + /* 0x3 */ EN_S_GORO_ANIM_UNROLL_B, + /* 0x4 */ EN_S_GORO_ANIM_ROLLUP, + /* 0x5 */ EN_S_GORO_ANIM_SHIVER_A, + /* 0x6 */ EN_S_GORO_ANIM_SHIVER_B, + /* 0x7 */ EN_S_GORO_ANIM_7, + /* 0x7 */ EN_S_GORO_ANIM_8, + /* 0x7 */ EN_S_GORO_ANIM_9, + /* 0x7 */ EN_S_GORO_ANIM_10, + /* 0xB */ EN_S_GORO_ANIM_COVEREARS, + /* 0xC */ EN_S_GORO_ANIM_TAISOU_CHEER, + /* 0xD */ EN_S_GORO_ANIM_STAND_HANDTAP, + /* 0xE */ EN_S_GORO_ANIM_SLEEPY, + /* 0xF */ EN_S_GORO_ANIM_IDLE_STAND, + /* 0x10 */ EN_S_GORO_ANIM_MAX +} EnSGoroAnimation; + +static AnimationInfoS sAnimationInfo[EN_S_GORO_ANIM_MAX] = { + { &gGoronLyingDownIdleAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // EN_S_GORO_ANIM_IDLE_LIEDOWN_A + { &gGoronLyingDownIdleAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, // EN_S_GORO_ANIM_IDLE_LIEDOWN_B + { &gGoronUnrollAnim, 2.0f, 0, -1, ANIMMODE_ONCE, 0 }, // EN_S_GORO_ANIM_UNROLL_A + { &gGoronUnrollAnim, 2.0f, 0, -1, ANIMMODE_ONCE, -4 }, // EN_S_GORO_ANIM_UNROLL_B + { &gGoronUnrollAnim, -2.0f, 0, -1, ANIMMODE_ONCE, -4 }, // EN_S_GORO_ANIM_ROLLUP + { &gGoronShiverAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // EN_S_GORO_ANIM_SHIVER_A + { &gGoronShiverAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, // EN_S_GORO_ANIM_SHIVER_B + { &gGoronAthleticsDoubleArmSideBendAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // EN_S_GORO_ANIM_7 + { &gGoronAthleticsShakeLimbsAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // EN_S_GORO_ANIM_8 + { &gGoronAthleticsSingleArmSideBendAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // EN_S_GORO_ANIM_9 + { &gGoronAthleticsHamstringStretchStandingAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // EN_S_GORO_ANIM_10 + { &gGoronCoverEarsAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // EN_S_GORO_ANIM_COVEREARS + { &gGoronAthleticsCheerAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, // EN_S_GORO_ANIM_TAISOU_CHEER + { &gGoronStandingHandTappingAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, // EN_S_GORO_ANIM_STAND_HANDTAP + { &gGoronSleepyAnim, 1.0f, 0, -1, ANIMMODE_ONCE, -4 }, // EN_S_GORO_ANIM_SLEEPY + { &gGoronStandingIdleAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -8 }, // EN_S_GORO_ANIM_IDLE_STAND }; -static TexturePtr sEyeTextures[] = { +typedef enum EnSGoroEyeTexture { + /* 0x0 */ EN_S_GORO_EYETEX_OPEN, + /* 0x1 */ EN_S_GORO_EYETEX_HALF, + /* 0x2 */ EN_S_GORO_EYETEX_CLOSED, + /* 0x3 */ EN_S_GORO_EYETEX_CLOSED2, + /* 0x4 */ EN_S_GORO_EYETEX_MAX +} EnSGoroEyeTexture; + +static TexturePtr sEyeTextures[EN_S_GORO_EYETEX_MAX] = { gGoronEyeOpenTex, gGoronEyeHalfTex, gGoronEyeClosedTex, @@ -758,22 +764,22 @@ void EnSGoro_UpdateSleeping(EnSGoro* this, PlayState* play) { } s32 EnSGoro_UpdateCheerAnimation(EnSGoro* this, PlayState* play) { - if (this->animInfoIndex == EN_S_GORO_ANIM_IDLE_STAND) { + if (this->animIndex == EN_S_GORO_ANIM_IDLE_STAND) { if (((EnJg*)this->otherGoron)->flags & 1) { this->objectSlot = Object_GetSlot(&play->objectCtx, OBJECT_TAISOU); if (this->objectSlot > OBJECT_SLOT_NONE) { gSegments[6] = OS_K0_TO_PHYSICAL(play->objectCtx.slots[this->objectSlot].segment); - this->animInfoIndex = EN_S_GORO_ANIM_TAISOU_CHEER; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->animInfoIndex); + this->animIndex = EN_S_GORO_ANIM_TAISOU_CHEER; + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->animIndex); return true; } } - } else if ((this->animInfoIndex == EN_S_GORO_ANIM_TAISOU_CHEER) && !(((EnJg*)this->otherGoron)->flags & 1)) { + } else if ((this->animIndex == EN_S_GORO_ANIM_TAISOU_CHEER) && !(((EnJg*)this->otherGoron)->flags & 1)) { this->objectSlot = Object_GetSlot(&play->objectCtx, OBJECT_OF1D_MAP); if (this->objectSlot > OBJECT_SLOT_NONE) { gSegments[6] = OS_K0_TO_PHYSICAL(play->objectCtx.slots[this->objectSlot].segment); - this->animInfoIndex = EN_S_GORO_ANIM_IDLE_STAND; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->animInfoIndex); + this->animIndex = EN_S_GORO_ANIM_IDLE_STAND; + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->animIndex); this->skelAnime.curFrame = this->skelAnime.endFrame; return true; } @@ -787,8 +793,8 @@ s32 EnSGoro_CheckLullaby(EnSGoro* this, PlayState* play) { if ((player->transformation == PLAYER_FORM_GORON) && (play->msgCtx.ocarinaMode == OCARINA_MODE_EVENT)) { if (play->msgCtx.lastPlayedSong == OCARINA_SONG_GORON_LULLABY) { - this->animInfoIndex = EN_S_GORO_ANIM_ROLLUP; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->animInfoIndex); + this->animIndex = EN_S_GORO_ANIM_ROLLUP; + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->animIndex); actorType = EN_S_GORO_GET_MAIN_TYPE(&this->actor); this->snorePhase = 0x400 << (actorType + 1); @@ -819,8 +825,8 @@ s32 EnSGoro_CheckGKBehavior(EnSGoro* this, PlayState* play) { ((((EnGk*)this->otherGoron)->unk_1E4 & 0x80) || CHECK_WEEKEVENTREG(WEEKEVENTREG_CALMED_GORON_ELDERS_SON))) { this->actionFlags |= EN_S_GORO_ACTIONFLAG_GKQUIET_ACKNOWLEDGED; - this->animInfoIndex = EN_S_GORO_ANIM_ROLLUP; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->animInfoIndex); + this->animIndex = EN_S_GORO_ANIM_ROLLUP; + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->animIndex); actorType = EN_S_GORO_GET_MAIN_TYPE(&this->actor); this->snorePhase = 0x400 << (actorType + 1); @@ -843,37 +849,37 @@ s32 EnSGoro_CheckGKBehavior(EnSGoro* this, PlayState* play) { void EnSGoro_UpdateToHandtapAnimation(EnSGoro* this) { s16 curFrame = this->skelAnime.curFrame; - s16 lastFrame = Animation_GetLastFrame(sAnimationInfo[this->animInfoIndex].animation); + s16 endFrame = Animation_GetLastFrame(sAnimationInfo[this->animIndex].animation); - if ((this->animInfoIndex != EN_S_GORO_ANIM_STAND_HANDTAP) && (curFrame == lastFrame)) { - this->animInfoIndex = EN_S_GORO_ANIM_STAND_HANDTAP; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->animInfoIndex); + if ((this->animIndex != EN_S_GORO_ANIM_STAND_HANDTAP) && (curFrame == endFrame)) { + this->animIndex = EN_S_GORO_ANIM_STAND_HANDTAP; + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->animIndex); } } void EnSGoro_UpdateSleepyAnimation(EnSGoro* this) { s16 curFrame = this->skelAnime.curFrame; - s16 lastFrame = Animation_GetLastFrame(sAnimationInfo[this->animInfoIndex].animation); + s16 endFrame = Animation_GetLastFrame(sAnimationInfo[this->animIndex].animation); - if (this->animInfoIndex != EN_S_GORO_ANIM_SLEEPY) { - if (curFrame == lastFrame) { - this->animInfoIndex = EN_S_GORO_ANIM_SLEEPY; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->animInfoIndex); + if (this->animIndex != EN_S_GORO_ANIM_SLEEPY) { + if (curFrame == endFrame) { + this->animIndex = EN_S_GORO_ANIM_SLEEPY; + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->animIndex); } - } else if (curFrame == lastFrame) { + } else if (curFrame == endFrame) { this->actionFlags &= ~EN_S_GORO_ACTIONFLAG_TIRED; - this->animInfoIndex = EN_S_GORO_ANIM_IDLE_STAND; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->animInfoIndex); + this->animIndex = EN_S_GORO_ANIM_IDLE_STAND; + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->animIndex); } } void EnSGoro_UpdateToIdleAnimation(EnSGoro* this) { s16 curFrame = this->skelAnime.curFrame; - s16 lastFrame = Animation_GetLastFrame(sAnimationInfo[this->animInfoIndex].animation); + s16 endFrame = Animation_GetLastFrame(sAnimationInfo[this->animIndex].animation); - if ((this->animInfoIndex != EN_S_GORO_ANIM_IDLE_STAND) && (curFrame == lastFrame)) { - this->animInfoIndex = EN_S_GORO_ANIM_IDLE_STAND; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->animInfoIndex); + if ((this->animIndex != EN_S_GORO_ANIM_IDLE_STAND) && (curFrame == endFrame)) { + this->animIndex = EN_S_GORO_ANIM_IDLE_STAND; + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->animIndex); } } @@ -1003,18 +1009,18 @@ void EnSGoro_SetupAction(EnSGoro* this, PlayState* play) { if (CHECK_WEEKEVENTREG(WEEKEVENTREG_CALMED_GORON_ELDERS_SON)) { this->actionFlags |= EN_S_GORO_ACTIONFLAG_GKQUIET_ACKNOWLEDGED; this->actionFlags |= EN_S_GORO_ACTIONFLAG_EYESOPEN; - this->animInfoIndex = EN_S_GORO_ANIM_SHIVER_A; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->animInfoIndex); + this->animIndex = EN_S_GORO_ANIM_SHIVER_A; + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->animIndex); } else { this->eyeTexIndex = EN_S_GORO_EYETEX_CLOSED2; this->actionFlags |= EN_S_GORO_ACTIONFLAG_EARSCOVERED; - this->animInfoIndex = EN_S_GORO_ANIM_COVEREARS; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->animInfoIndex); + this->animIndex = EN_S_GORO_ANIM_COVEREARS; + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->animIndex); } } else { this->actionFlags |= EN_S_GORO_ACTIONFLAG_EYESOPEN; - this->animInfoIndex = EN_S_GORO_ANIM_IDLE_STAND; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->animInfoIndex); + this->animIndex = EN_S_GORO_ANIM_IDLE_STAND; + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->animIndex); } this->scaleFactor = 0.01f; @@ -1152,8 +1158,8 @@ void EnSGoro_ShopGoron_Idle(EnSGoro* this, PlayState* play) { this->textId = EnSGoro_BombshopGoron_NextTextId(this, play); if (this->actionFlags & EN_S_GORO_ACTIONFLAG_ROLLEDUP) { this->actionFlags &= ~EN_S_GORO_ACTIONFLAG_ROLLEDUP; - this->animInfoIndex = EN_S_GORO_ANIM_UNROLL_A; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->animInfoIndex); + this->animIndex = EN_S_GORO_ANIM_UNROLL_A; + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->animIndex); this->actionFunc = EnSGoro_ShopGoron_FinishUnroll; } else { Message_StartTextbox(play, this->textId, &this->actor); @@ -1168,11 +1174,11 @@ void EnSGoro_ShopGoron_Idle(EnSGoro* this, PlayState* play) { void EnSGoro_ShopGoron_FinishUnroll(EnSGoro* this, PlayState* play) { s16 curFrame = this->skelAnime.curFrame; - s16 lastFrame = Animation_GetLastFrame(sAnimationInfo[this->animInfoIndex].animation); + s16 endFrame = Animation_GetLastFrame(sAnimationInfo[this->animIndex].animation); - if ((this->animInfoIndex == EN_S_GORO_ANIM_UNROLL_A) && (curFrame == lastFrame)) { - this->animInfoIndex = EN_S_GORO_ANIM_IDLE_STAND; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->animInfoIndex); + if ((this->animIndex == EN_S_GORO_ANIM_UNROLL_A) && (curFrame == endFrame)) { + this->animIndex = EN_S_GORO_ANIM_IDLE_STAND; + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->animIndex); Message_StartTextbox(play, this->textId, &this->actor); this->actionFunc = EnSGoro_ShopGoron_Talk; } @@ -1305,7 +1311,7 @@ void EnSGoro_Update(Actor* thisx, PlayState* play) { Actor_UpdateBgCheckInfo(play, &this->actor, 30.0f, 12.0f, 0.0f, UPDBGCHECKINFO_FLAG_1 | UPDBGCHECKINFO_FLAG_4); gSegments[6] = OS_K0_TO_PHYSICAL(play->objectCtx.slots[this->objectSlot].segment); SkelAnime_Update(&this->skelAnime); - if (this->animInfoIndex != EN_S_GORO_ANIM_SLEEPY) { + if (this->animIndex != EN_S_GORO_ANIM_SLEEPY) { EnSGoro_UpdateAttentionTarget(this, play); } EnSGoro_UpdateEyes(this); @@ -1357,7 +1363,7 @@ void EnSGoro_TransformLimbDraw(PlayState* play, s32 limbIndex, Actor* thisx) { switch (limbIndex) { case GORON_LIMB_HEAD: - if (this->animInfoIndex != EN_S_GORO_ANIM_SLEEPY) { + if (this->animIndex != EN_S_GORO_ANIM_SLEEPY) { if (this->actionFlags & EN_S_GORO_ACTIONFLAG_FACEPLAYER) { overrideRot = true; } else { @@ -1384,7 +1390,7 @@ void EnSGoro_TransformLimbDraw(PlayState* play, s32 limbIndex, Actor* thisx) { break; case GORON_LIMB_BODY: - if (this->animInfoIndex != EN_S_GORO_ANIM_SLEEPY) { + if (this->animIndex != EN_S_GORO_ANIM_SLEEPY) { if (this->actionFlags & EN_S_GORO_ACTIONFLAG_FACEPLAYER) { overrideRot = true; } else { diff --git a/src/overlays/actors/ovl_En_S_Goro/z_en_s_goro.h b/src/overlays/actors/ovl_En_S_Goro/z_en_s_goro.h index 35b71bfddf..5de57c67a8 100644 --- a/src/overlays/actors/ovl_En_S_Goro/z_en_s_goro.h +++ b/src/overlays/actors/ovl_En_S_Goro/z_en_s_goro.h @@ -38,7 +38,7 @@ typedef struct EnSGoro { /* 0x302 */ UNK_TYPE1 unk_302[2]; /* 0x304 */ u16 textId; /* 0x306 */ s16 snorePhase; - /* 0x308 */ s32 animInfoIndex; + /* 0x308 */ s32 animIndex; /* 0x30C */ s16 powderKegPrice; } EnSGoro; // size = 0x310 diff --git a/src/overlays/actors/ovl_En_Sb/z_en_sb.c b/src/overlays/actors/ovl_En_Sb/z_en_sb.c index 436fb6af9a..dbd31882f1 100644 --- a/src/overlays/actors/ovl_En_Sb/z_en_sb.c +++ b/src/overlays/actors/ovl_En_Sb/z_en_sb.c @@ -5,7 +5,6 @@ */ #include "z_en_sb.h" -#include "objects/object_sb/object_sb.h" #include "overlays/actors/ovl_En_Part/z_en_part.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_UNFRIENDLY) @@ -113,7 +112,7 @@ void EnSb_Init(Actor* thisx, PlayState* play) { this->actor.colChkInfo.mass = 10; this->actor.colChkInfo.health = 2; SkelAnime_InitFlex(play, &this->skelAnime, &object_sb_Skel_002BF0, &object_sb_Anim_000194, this->jointTable, - this->morphTable, 9); + this->morphTable, OBJECT_SB_LIMB_MAX); Collider_InitCylinder(play, &this->collider); Collider_SetCylinderType1(play, &this->collider, &this->actor, &sCylinderInit); this->isDead = false; @@ -394,11 +393,11 @@ void EnSb_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, EnSb* this = THIS; if (this->isDrawn) { - if (limbIndex < 7) { + if (limbIndex <= OBJECT_SB_LIMB_06) { partParams = (this->actor.depthInWater > 0) ? ENPART_PARAMS(ENPART_TYPE_4) : ENPART_PARAMS(ENPART_TYPE_1); Actor_SpawnBodyParts(thisx, play, partParams, dList); } - if (limbIndex == 6) { + if (limbIndex == OBJECT_SB_LIMB_06) { this->isDrawn = false; this->actor.draw = NULL; } diff --git a/src/overlays/actors/ovl_En_Sb/z_en_sb.h b/src/overlays/actors/ovl_En_Sb/z_en_sb.h index b273222269..eb2d104d66 100644 --- a/src/overlays/actors/ovl_En_Sb/z_en_sb.h +++ b/src/overlays/actors/ovl_En_Sb/z_en_sb.h @@ -2,6 +2,7 @@ #define Z_EN_SB_H #include "global.h" +#include "objects/object_sb/object_sb.h" struct EnSb; @@ -18,8 +19,8 @@ typedef enum { typedef struct EnSb { /* 0x000 */ Actor actor; /* 0x144 */ SkelAnime skelAnime; - /* 0x188 */ Vec3s jointTable[9]; - /* 0x1BE */ Vec3s morphTable[9]; + /* 0x188 */ Vec3s jointTable[OBJECT_SB_LIMB_MAX]; + /* 0x1BE */ Vec3s morphTable[OBJECT_SB_LIMB_MAX]; /* 0x1F4 */ EnSbActionFunc actionFunc; /* 0x1F8 */ ColliderCylinder collider; /* 0x244 */ s16 fireCount; 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 635c970acd..3d9975ba18 100644 --- a/src/overlays/actors/ovl_En_Scopenuts/z_en_scopenuts.c +++ b/src/overlays/actors/ovl_En_Scopenuts/z_en_scopenuts.c @@ -6,7 +6,6 @@ #include "z_en_scopenuts.h" #include "objects/gameplay_keep/gameplay_keep.h" -#include "objects/object_dnt/object_dnt.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_10 | ACTOR_FLAG_20) @@ -64,30 +63,58 @@ static ColliderCylinderInitType1 sCylinderInit = { { 27, 32, 0, { 0, 0, 0 } }, }; -static AnimationInfoS sAnimationInfo[] = { - { &gBusinessScrubStandingAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, - { &gBusinessScrubWalkAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, - { &gBusinessScrubRiseUpAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, - { &gBusinessScrubJumpAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, - { &gBusinessScrubBurrowAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, - { &gBusinessScrubExcitedStartAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, - { &gBusinessScrubExcitedLoopAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, - { &gBusinessScrubExcitedEndAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, - { &gBusinessScrubTakeOffHatAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, - { &gBusinessScrubFlyStartAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, - { &gBusinessScrubFlyLoopAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, - { &gBusinessScrubShockedStartAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, - { &gBusinessScrubShockedShakeHeadAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, - { &gBusinessScrubShockedPoundAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, - { &gBusinessScrubShockedEndAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, - { &gBusinessScrubThinkAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, - { &gBusinessScrubBobAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, - { &gBusinessScrubBurrowAnim, 1.0f, 8, -1, ANIMMODE_ONCE, 0 }, - { &gBusinessScrubBurrowAnim, 1.0f, 4, -1, ANIMMODE_ONCE, -4 }, - { &gBusinessScrubBurrowAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, - { &gBusinessScrubFlyLoopAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, - { &gBusinessScrubTakeOffHatAnim, -1.0f, 0, -1, ANIMMODE_ONCE, 0 }, - { &gBusinessScrubFlyEndAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, +typedef enum EnScopenutsAnimation { + /* -1 */ ENSCOPENUTS_ANIM_NONE = -1, + /* 0 */ ENSCOPENUTS_ANIM_0, + /* 1 */ ENSCOPENUTS_ANIM_1, + /* 2 */ ENSCOPENUTS_ANIM_2, + /* 3 */ ENSCOPENUTS_ANIM_3, + /* 4 */ ENSCOPENUTS_ANIM_4, + /* 5 */ ENSCOPENUTS_ANIM_5, + /* 6 */ ENSCOPENUTS_ANIM_6, + /* 7 */ ENSCOPENUTS_ANIM_7, + /* 8 */ ENSCOPENUTS_ANIM_8, + /* 9 */ ENSCOPENUTS_ANIM_9, + /* 10 */ ENSCOPENUTS_ANIM_10, + /* 11 */ ENSCOPENUTS_ANIM_11, + /* 12 */ ENSCOPENUTS_ANIM_12, + /* 13 */ ENSCOPENUTS_ANIM_13, + /* 14 */ ENSCOPENUTS_ANIM_14, + /* 15 */ ENSCOPENUTS_ANIM_15, + /* 16 */ ENSCOPENUTS_ANIM_16, + /* 17 */ ENSCOPENUTS_ANIM_17, + /* 18 */ ENSCOPENUTS_ANIM_18, + /* 19 */ ENSCOPENUTS_ANIM_19, + /* 20 */ ENSCOPENUTS_ANIM_20, + /* 21 */ ENSCOPENUTS_ANIM_21, + /* 22 */ ENSCOPENUTS_ANIM_22, + /* 23 */ ENSCOPENUTS_ANIM_MAX +} EnScopenutsAnimation; + +static AnimationInfoS sAnimationInfo[ENSCOPENUTS_ANIM_MAX] = { + { &gBusinessScrubStandingAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // ENSCOPENUTS_ANIM_0 + { &gBusinessScrubWalkAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // ENSCOPENUTS_ANIM_1 + { &gBusinessScrubRiseUpAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, // ENSCOPENUTS_ANIM_2 + { &gBusinessScrubJumpAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, // ENSCOPENUTS_ANIM_3 + { &gBusinessScrubBurrowAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, // ENSCOPENUTS_ANIM_4 + { &gBusinessScrubExcitedStartAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, // ENSCOPENUTS_ANIM_5 + { &gBusinessScrubExcitedLoopAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // ENSCOPENUTS_ANIM_6 + { &gBusinessScrubExcitedEndAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // ENSCOPENUTS_ANIM_7 + { &gBusinessScrubTakeOffHatAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, // ENSCOPENUTS_ANIM_8 + { &gBusinessScrubFlyStartAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, // ENSCOPENUTS_ANIM_9 + { &gBusinessScrubFlyLoopAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // ENSCOPENUTS_ANIM_10 + { &gBusinessScrubShockedStartAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, // ENSCOPENUTS_ANIM_11 + { &gBusinessScrubShockedShakeHeadAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // ENSCOPENUTS_ANIM_12 + { &gBusinessScrubShockedPoundAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // ENSCOPENUTS_ANIM_13 + { &gBusinessScrubShockedEndAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, // ENSCOPENUTS_ANIM_14 + { &gBusinessScrubThinkAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // ENSCOPENUTS_ANIM_15 + { &gBusinessScrubBobAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, // ENSCOPENUTS_ANIM_16 + { &gBusinessScrubBurrowAnim, 1.0f, 8, -1, ANIMMODE_ONCE, 0 }, // ENSCOPENUTS_ANIM_17 + { &gBusinessScrubBurrowAnim, 1.0f, 4, -1, ANIMMODE_ONCE, -4 }, // ENSCOPENUTS_ANIM_18 + { &gBusinessScrubBurrowAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, // ENSCOPENUTS_ANIM_19 + { &gBusinessScrubFlyLoopAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // ENSCOPENUTS_ANIM_20 + { &gBusinessScrubTakeOffHatAnim, -1.0f, 0, -1, ANIMMODE_ONCE, 0 }, // ENSCOPENUTS_ANIM_21 + { &gBusinessScrubFlyEndAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, // ENSCOPENUTS_ANIM_22 }; Gfx* D_80BCCCDC[] = { gKakeraLeafMiddleDL, gKakeraLeafTipDL }; @@ -175,18 +202,24 @@ s16 func_80BCAF0C(EnScopenuts* this) { return 0x1638; } return 0x162F; + case 0x162F: return 0x1630; + case 0x1630: return 0x1631; + case 0x1631: this->unk_358 = 150; return 0x1632; + case 0x1633: this->unk_358 = 100; return 0x1634; + + default: + return 0; } - return 0; } void func_80BCAFA8(EnScopenuts* this, PlayState* play) { @@ -196,8 +229,8 @@ void func_80BCAFA8(EnScopenuts* this, PlayState* play) { if ((screenPos.x >= 130.0f) && (screenPos.x < (SCREEN_WIDTH - 130.0f)) && (screenPos.y >= 90.0f)) { if (screenPos.y < (SCREEN_HEIGHT - 90.0f)) { this->actor.draw = EnScopenuts_Draw; - this->unk_348 = 10; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 10); + this->animIndex = ENSCOPENUTS_ANIM_10; + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, ENSCOPENUTS_ANIM_10); this->actionFunc = func_80BCB078; } } @@ -245,8 +278,8 @@ void func_80BCB1C8(EnScopenuts* this, PlayState* play) { } void func_80BCB230(EnScopenuts* this, PlayState* play) { - s16 sp26 = this->skelAnime.curFrame; - s16 sp24 = Animation_GetLastFrame(sAnimationInfo[this->unk_348].animation); + s16 curFrame = this->skelAnime.curFrame; + s16 endFrame = Animation_GetLastFrame(sAnimationInfo[this->animIndex].animation); Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 2, 0xE38); @@ -254,33 +287,33 @@ void func_80BCB230(EnScopenuts* this, PlayState* play) { ((this->actor.xzDistToPlayer < 200.0f) ? true : false)) { Actor_PlaySfx(&this->actor, NA_SE_EN_AKINDONUTS_HIDE); this->actionFunc = func_80BCB4DC; - this->unk_348 = 3; + this->animIndex = ENSCOPENUTS_ANIM_3; this->collider.dim.height = 64; func_80BCAC40(this, play); - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 3); - } else if (sp26 == sp24) { - if ((this->unk_348 == 4) || (this->unk_348 == 18)) { - this->unk_348 = 17; + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, ENSCOPENUTS_ANIM_3); + } else if (curFrame == endFrame) { + if ((this->animIndex == ENSCOPENUTS_ANIM_4) || (this->animIndex == ENSCOPENUTS_ANIM_18)) { + this->animIndex = ENSCOPENUTS_ANIM_17; this->collider.dim.height = 0; Actor_PlaySfx(&this->actor, NA_SE_EN_NUTS_DOWN); - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 17); - } else if (this->unk_348 == 2) { - this->unk_348 = 16; + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, ENSCOPENUTS_ANIM_17); + } else if (this->animIndex == ENSCOPENUTS_ANIM_2) { + this->animIndex = ENSCOPENUTS_ANIM_16; this->collider.dim.height = 32; Actor_PlaySfx(&this->actor, NA_SE_EN_NUTS_UP); - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 16); - } else if (this->unk_348 == 17) { + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, ENSCOPENUTS_ANIM_16); + } else if (this->animIndex == ENSCOPENUTS_ANIM_17) { if (DECR(this->unk_34E) == 0) { this->unk_34E = Rand_ZeroOne() * 10.0f; - this->unk_348 = 2; + this->animIndex = ENSCOPENUTS_ANIM_2; this->collider.dim.height = 32; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 2); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, ENSCOPENUTS_ANIM_2); } - } else if ((this->unk_348 == 16) && (DECR(this->unk_34E) == 0)) { + } else if ((this->animIndex == ENSCOPENUTS_ANIM_16) && (DECR(this->unk_34E) == 0)) { this->unk_34E = Rand_S16Offset(40, 40); - this->unk_348 = 18; + this->animIndex = ENSCOPENUTS_ANIM_18; this->collider.dim.height = 32; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 18); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, ENSCOPENUTS_ANIM_18); } } } @@ -288,7 +321,7 @@ void func_80BCB230(EnScopenuts* this, PlayState* play) { void func_80BCB4DC(EnScopenuts* this, PlayState* play) { if (this->skelAnime.curFrame == this->skelAnime.endFrame) { this->actionFunc = func_80BCB52C; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 0); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, ENSCOPENUTS_ANIM_0); } } @@ -305,8 +338,8 @@ void func_80BCB52C(EnScopenuts* this, PlayState* play) { Actor_OfferTalk(&this->actor, play, 100.0f); } else if (!(((this->actor.playerHeightRel < 50.0f) && (this->actor.playerHeightRel > -50.0f)) ? true : false) || !((this->actor.xzDistToPlayer < 200.0f) ? true : false)) { - this->unk_348 = 4; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 4); + this->animIndex = ENSCOPENUTS_ANIM_4; + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, ENSCOPENUTS_ANIM_4); this->actionFunc = func_80BCB230; } } @@ -322,8 +355,8 @@ void func_80BCB6D0(EnScopenuts* this, PlayState* play) { play->msgCtx.stateTimer = 4; this->actor.flags &= ~ACTOR_FLAG_TARGETABLE; this->unk_328 &= ~4; - this->unk_348 = 8; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 8); + this->animIndex = ENSCOPENUTS_ANIM_8; + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, ENSCOPENUTS_ANIM_8); this->actionFunc = func_80BCBA00; } else { this->unk_33C = func_80BCAF0C(this); @@ -347,6 +380,7 @@ void func_80BCB6D0(EnScopenuts* this, PlayState* play) { this->actionFunc = func_80BCB90C; } break; + case 1: Audio_PlaySfx_MessageCancel(); if (this->unk_358 == 150) { @@ -357,6 +391,9 @@ void func_80BCB6D0(EnScopenuts* this, PlayState* play) { } Message_StartTextbox(play, this->unk_33C, &this->actor); break; + + default: + break; } } } else if (talkState == TEXT_STATE_DONE) { @@ -387,10 +424,10 @@ void func_80BCB980(EnScopenuts* this, PlayState* play) { } void func_80BCBA00(EnScopenuts* this, PlayState* play) { - s16 sp26 = this->skelAnime.curFrame; - s16 sp24 = Animation_GetLastFrame(sAnimationInfo[this->unk_348].animation); + s16 curFrame = this->skelAnime.curFrame; + s16 endFrame = Animation_GetLastFrame(sAnimationInfo[this->animIndex].animation); - switch (sp26) { + switch (curFrame) { case 10: this->unk_35A = 1; this->unk_35C = 0.1f; @@ -445,6 +482,9 @@ void func_80BCBA00(EnScopenuts* this, PlayState* play) { case 24: this->unk_360 = 1.0f; break; + + default: + break; } if (this->unk_36C == 0) { @@ -460,10 +500,10 @@ void func_80BCBA00(EnScopenuts* this, PlayState* play) { } } - if (sp26 == sp24) { + if (curFrame == endFrame) { this->unk_35A = 3; - this->unk_348 = 19; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 19); + this->animIndex = ENSCOPENUTS_ANIM_19; + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, ENSCOPENUTS_ANIM_19); Actor_PlaySfx(&this->actor, NA_SE_EN_NUTS_DOWN); this->unk_328 &= ~2; this->unk_34E = 50; @@ -497,12 +537,12 @@ void func_80BCBC60(EnScopenuts* this, PlayState* play) { void func_80BCBD28(EnScopenuts* this, PlayState* play) { Vec3f sp44; - s16 sp42 = this->skelAnime.curFrame; - s16 sp40 = Animation_GetLastFrame(sAnimationInfo[this->unk_348].animation); + s16 curFrame = this->skelAnime.curFrame; + s16 endFrame = Animation_GetLastFrame(sAnimationInfo[this->animIndex].animation); Vec3s sp38; func_80BCC448(this->path, this->unk_334, &this->actor.world.pos, &sp38); - if (sp42 == sp40) { + if (curFrame == endFrame) { Math_SmoothStepToS(&this->unk_34C, 0x1C71, 3, 0x100, 0); this->unk_340 += this->unk_34C; this->actor.shape.yOffset = 1500.0f; @@ -526,8 +566,8 @@ void func_80BCBD28(EnScopenuts* this, PlayState* play) { if ((this->actor.home.pos.y + 22.5f) < this->actor.world.pos.y) { this->unk_368 = 0.3f; - this->unk_348 = 9; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 9); + this->animIndex = ENSCOPENUTS_ANIM_9; + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, ENSCOPENUTS_ANIM_9); Actor_PlaySfx(&this->actor, NA_SE_EN_AKINDONUTS_HIDE); func_80BCAC40(this, play); this->actionFunc = func_80BCBF0C; @@ -546,8 +586,8 @@ void func_80BCBF0C(EnScopenuts* this, PlayState* play) { if ((this->actor.home.pos.y + 50.0f) < this->actor.world.pos.y) { Math_ApproachF(&this->actor.velocity.y, 0.0f, 0.2f, 1.0f); - this->unk_348 = 10; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 10); + this->animIndex = ENSCOPENUTS_ANIM_10; + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, ENSCOPENUTS_ANIM_10); this->unk_328 |= 2; this->unk_36E = 0; this->actionFunc = func_80BCBFFC; @@ -693,7 +733,7 @@ void EnScopenuts_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(&this->actor, sInitChain); SkelAnime_InitFlex(play, &this->skelAnime, &gBusinessScrubSkel, &gBusinessScrubStandingAnim, this->jointTable, - this->morphTable, 28); + this->morphTable, BUSINESS_SCRUB_LIMB_MAX); Collider_InitCylinder(play, &this->collider); Collider_SetCylinderType1(play, &this->collider, &this->actor, &sCylinderInit); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 35.0f); @@ -729,9 +769,9 @@ void EnScopenuts_Init(Actor* thisx, PlayState* play) { this->csId = this->actor.csId; this->unk_33C = 0; this->unk_358 = 150; - this->unk_348 = 4; + this->animIndex = ENSCOPENUTS_ANIM_4; this->unk_35A = 0; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 4); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, ENSCOPENUTS_ANIM_4); this->actionFunc = func_80BCB230; } } else { @@ -766,34 +806,44 @@ void EnScopenuts_Update(Actor* thisx, PlayState* play) { s32 EnScopenuts_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) { EnScopenuts* this = THIS; - if (((this->unk_348 == 4) && (this->unk_35A == 0)) || ((this->unk_348 == 8) && (this->unk_35A == 0)) || - (this->unk_348 == 18) || (this->unk_348 == 2) || (this->unk_348 == 3) || (this->unk_348 == 17) || - (this->unk_348 == 16)) { - if ((limbIndex == 16) || (limbIndex == 21) || (limbIndex == 27) || (limbIndex == 23) || (limbIndex == 24) || - (limbIndex == 15)) { + if (((this->animIndex == ENSCOPENUTS_ANIM_4) && (this->unk_35A == 0)) || + ((this->animIndex == ENSCOPENUTS_ANIM_8) && (this->unk_35A == 0)) || (this->animIndex == ENSCOPENUTS_ANIM_18) || + (this->animIndex == ENSCOPENUTS_ANIM_2) || (this->animIndex == ENSCOPENUTS_ANIM_3) || + (this->animIndex == ENSCOPENUTS_ANIM_17) || (this->animIndex == ENSCOPENUTS_ANIM_16)) { + if ((limbIndex == BUSINESS_SCRUB_LIMB_RIGHT_HAND_BAG) || (limbIndex == BUSINESS_SCRUB_LIMB_LEFT_HAND_BAG) || + (limbIndex == BUSINESS_SCRUB_LIMB_LEFT_ARM_BAG) || (limbIndex == BUSINESS_SCRUB_LIMB_SCALP) || + (limbIndex == BUSINESS_SCRUB_LIMB_HAIR) || (limbIndex == BUSINESS_SCRUB_LIMB_RIGHT_HAND_HAT)) { *dList = NULL; } - } else if ((this->unk_348 == 8) || (this->unk_348 == 19)) { + } else if ((this->animIndex == ENSCOPENUTS_ANIM_8) || (this->animIndex == ENSCOPENUTS_ANIM_19)) { switch (this->unk_35A) { case 1: - if ((limbIndex == 16) || (limbIndex == 21) || (limbIndex == 27) || (limbIndex == 25)) { + if ((limbIndex == BUSINESS_SCRUB_LIMB_RIGHT_HAND_BAG) || + (limbIndex == BUSINESS_SCRUB_LIMB_LEFT_HAND_BAG) || + (limbIndex == BUSINESS_SCRUB_LIMB_LEFT_ARM_BAG) || (limbIndex == BUSINESS_SCRUB_LIMB_HAT)) { *dList = NULL; } break; case 2: case 3: - if ((limbIndex == 16) || (limbIndex == 21) || (limbIndex == 27) || (limbIndex == 15) || - (limbIndex == 25)) { + if ((limbIndex == BUSINESS_SCRUB_LIMB_RIGHT_HAND_BAG) || + (limbIndex == BUSINESS_SCRUB_LIMB_LEFT_HAND_BAG) || + (limbIndex == BUSINESS_SCRUB_LIMB_LEFT_ARM_BAG) || + (limbIndex == BUSINESS_SCRUB_LIMB_RIGHT_HAND_HAT) || (limbIndex == BUSINESS_SCRUB_LIMB_HAT)) { *dList = NULL; } break; + + default: + break; } - } else if (((this->unk_348 == 9) || (this->unk_348 == 10)) && ((limbIndex == 15) || (limbIndex == 25))) { + } else if (((this->animIndex == ENSCOPENUTS_ANIM_9) || (this->animIndex == ENSCOPENUTS_ANIM_10)) && + ((limbIndex == BUSINESS_SCRUB_LIMB_RIGHT_HAND_HAT) || (limbIndex == BUSINESS_SCRUB_LIMB_HAT))) { *dList = NULL; } - if (limbIndex == 26) { + if (limbIndex == BUSINESS_SCRUB_LIMB_EYES) { if ((this->unk_33C == 0x162F) || (this->unk_33C == 0x1630)) { *dList = gBusinessScrubEyesSquintDL; } else { @@ -810,15 +860,18 @@ void EnScopenuts_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s void EnScopenuts_TransformLimbDraw(PlayState* play, s32 limbIndex, Actor* thisx) { EnScopenuts* this = THIS; - if (((this->unk_35A == 1) || (this->unk_35A == 2)) && ((limbIndex == 23) || (limbIndex == 24))) { + if (((this->unk_35A == 1) || (this->unk_35A == 2)) && + ((limbIndex == BUSINESS_SCRUB_LIMB_SCALP) || (limbIndex == BUSINESS_SCRUB_LIMB_HAIR))) { Matrix_Scale(this->unk_35C, this->unk_360, this->unk_364, MTXMODE_APPLY); } - if ((this->unk_348 == 9) && ((limbIndex == 16) || (limbIndex == 21) || (limbIndex == 27))) { + if ((this->animIndex == ENSCOPENUTS_ANIM_9) && + ((limbIndex == BUSINESS_SCRUB_LIMB_RIGHT_HAND_BAG) || (limbIndex == BUSINESS_SCRUB_LIMB_LEFT_HAND_BAG) || + (limbIndex == BUSINESS_SCRUB_LIMB_LEFT_ARM_BAG))) { Matrix_Scale(this->unk_368, this->unk_368, this->unk_368, MTXMODE_APPLY); } - if (limbIndex == 24) { + if (limbIndex == BUSINESS_SCRUB_LIMB_HAIR) { Matrix_RotateYS(this->unk_340, MTXMODE_APPLY); } } diff --git a/src/overlays/actors/ovl_En_Scopenuts/z_en_scopenuts.h b/src/overlays/actors/ovl_En_Scopenuts/z_en_scopenuts.h index 3f1b8b84e1..b85f559eb7 100644 --- a/src/overlays/actors/ovl_En_Scopenuts/z_en_scopenuts.h +++ b/src/overlays/actors/ovl_En_Scopenuts/z_en_scopenuts.h @@ -2,6 +2,7 @@ #define Z_EN_SCOPENUTS_H #include "global.h" +#include "objects/object_dnt/object_dnt.h" struct EnScopenuts; @@ -18,8 +19,8 @@ typedef void (*EnScopenutsActionFunc)(struct EnScopenuts*, PlayState*); typedef struct EnScopenuts { /* 0x000 */ Actor actor; /* 0x144 */ SkelAnime skelAnime; - /* 0x188 */ Vec3s jointTable[28]; - /* 0x230 */ Vec3s morphTable[28]; + /* 0x188 */ Vec3s jointTable[BUSINESS_SCRUB_LIMB_MAX]; + /* 0x230 */ Vec3s morphTable[BUSINESS_SCRUB_LIMB_MAX]; /* 0x2D8 */ EnScopenutsActionFunc actionFunc; /* 0x2DC */ ColliderCylinder collider; /* 0x328 */ u16 unk_328; @@ -32,7 +33,7 @@ typedef struct EnScopenuts { /* 0x33E */ s16 unk_33E; /* 0x340 */ s16 unk_340; /* 0x342 */ UNK_TYPE1 unk342[0x6]; - /* 0x348 */ s32 unk_348; + /* 0x348 */ s32 animIndex; /* 0x34C */ s16 unk_34C; /* 0x34E */ s16 unk_34E; /* 0x350 */ f32 unk_350; diff --git a/src/overlays/actors/ovl_En_Sellnuts/z_en_sellnuts.c b/src/overlays/actors/ovl_En_Sellnuts/z_en_sellnuts.c index 402e775c04..bb8b06cdbc 100644 --- a/src/overlays/actors/ovl_En_Sellnuts/z_en_sellnuts.c +++ b/src/overlays/actors/ovl_En_Sellnuts/z_en_sellnuts.c @@ -5,7 +5,6 @@ */ #include "z_en_sellnuts.h" -#include "objects/object_dnt/object_dnt.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_10 | ACTOR_FLAG_20) @@ -80,30 +79,58 @@ static ColliderCylinderInitType1 sCylinderInit = { { 27, 32, 0, { 0, 0, 0 } }, }; -static AnimationInfoS sAnimationInfo[] = { - { &gBusinessScrubStandingAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, - { &gBusinessScrubWalkAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, - { &gBusinessScrubRiseUpAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, - { &gBusinessScrubJumpAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, - { &gBusinessScrubBurrowAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, - { &gBusinessScrubExcitedStartAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, - { &gBusinessScrubExcitedLoopAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, - { &gBusinessScrubExcitedEndAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, - { &gBusinessScrubTakeOffHatAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, - { &gBusinessScrubFlyStartAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, - { &gBusinessScrubFlyLoopAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, - { &gBusinessScrubShockedStartAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, - { &gBusinessScrubShockedShakeHeadAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, - { &gBusinessScrubShockedPoundAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, - { &gBusinessScrubShockedEndAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, - { &gBusinessScrubThinkAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, - { &gBusinessScrubBobAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, - { &gBusinessScrubBurrowAnim, 1.0f, 8, -1, ANIMMODE_ONCE, 0 }, - { &gBusinessScrubBurrowAnim, 1.0f, 4, -1, ANIMMODE_ONCE, -4 }, - { &gBusinessScrubBurrowAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, - { &gBusinessScrubFlyLoopAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, - { &gBusinessScrubTakeOffHatAnim, -1.0f, 0, -1, ANIMMODE_ONCE, 0 }, - { &gBusinessScrubFlyEndAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, +typedef enum EnSellnutsAnimation { + /* -1 */ ENSELLNUTS_ANIM_NONE = -1, + /* 0 */ ENSELLNUTS_ANIM_0, + /* 1 */ ENSELLNUTS_ANIM_1, + /* 2 */ ENSELLNUTS_ANIM_2, + /* 3 */ ENSELLNUTS_ANIM_3, + /* 4 */ ENSELLNUTS_ANIM_4, + /* 5 */ ENSELLNUTS_ANIM_5, + /* 6 */ ENSELLNUTS_ANIM_6, + /* 7 */ ENSELLNUTS_ANIM_7, + /* 8 */ ENSELLNUTS_ANIM_8, + /* 9 */ ENSELLNUTS_ANIM_9, + /* 10 */ ENSELLNUTS_ANIM_10, + /* 11 */ ENSELLNUTS_ANIM_11, + /* 12 */ ENSELLNUTS_ANIM_12, + /* 13 */ ENSELLNUTS_ANIM_13, + /* 14 */ ENSELLNUTS_ANIM_14, + /* 15 */ ENSELLNUTS_ANIM_15, + /* 16 */ ENSELLNUTS_ANIM_16, + /* 17 */ ENSELLNUTS_ANIM_17, + /* 18 */ ENSELLNUTS_ANIM_18, + /* 19 */ ENSELLNUTS_ANIM_19, + /* 20 */ ENSELLNUTS_ANIM_20, + /* 21 */ ENSELLNUTS_ANIM_21, + /* 22 */ ENSELLNUTS_ANIM_22, + /* 23 */ ENSELLNUTS_ANIM_MAX +} EnSellnutsAnimation; + +static AnimationInfoS sAnimationInfo[ENSELLNUTS_ANIM_MAX] = { + { &gBusinessScrubStandingAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // ENSELLNUTS_ANIM_0 + { &gBusinessScrubWalkAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // ENSELLNUTS_ANIM_1 + { &gBusinessScrubRiseUpAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, // ENSELLNUTS_ANIM_2 + { &gBusinessScrubJumpAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, // ENSELLNUTS_ANIM_3 + { &gBusinessScrubBurrowAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, // ENSELLNUTS_ANIM_4 + { &gBusinessScrubExcitedStartAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, // ENSELLNUTS_ANIM_5 + { &gBusinessScrubExcitedLoopAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // ENSELLNUTS_ANIM_6 + { &gBusinessScrubExcitedEndAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // ENSELLNUTS_ANIM_7 + { &gBusinessScrubTakeOffHatAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, // ENSELLNUTS_ANIM_8 + { &gBusinessScrubFlyStartAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, // ENSELLNUTS_ANIM_9 + { &gBusinessScrubFlyLoopAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // ENSELLNUTS_ANIM_10 + { &gBusinessScrubShockedStartAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, // ENSELLNUTS_ANIM_11 + { &gBusinessScrubShockedShakeHeadAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // ENSELLNUTS_ANIM_12 + { &gBusinessScrubShockedPoundAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // ENSELLNUTS_ANIM_13 + { &gBusinessScrubShockedEndAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, // ENSELLNUTS_ANIM_14 + { &gBusinessScrubThinkAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // ENSELLNUTS_ANIM_15 + { &gBusinessScrubBobAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, // ENSELLNUTS_ANIM_16 + { &gBusinessScrubBurrowAnim, 1.0f, 8, -1, ANIMMODE_ONCE, 0 }, // ENSELLNUTS_ANIM_17 + { &gBusinessScrubBurrowAnim, 1.0f, 4, -1, ANIMMODE_ONCE, -4 }, // ENSELLNUTS_ANIM_18 + { &gBusinessScrubBurrowAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, // ENSELLNUTS_ANIM_19 + { &gBusinessScrubFlyLoopAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // ENSELLNUTS_ANIM_20 + { &gBusinessScrubTakeOffHatAnim, -1.0f, 0, -1, ANIMMODE_ONCE, 0 }, // ENSELLNUTS_ANIM_21 + { &gBusinessScrubFlyEndAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, // ENSELLNUTS_ANIM_22 }; static InitChainEntry sInitChain[] = { @@ -123,9 +150,9 @@ void func_80ADADD0(EnSellnuts* this, PlayState* play) { } void func_80ADAE64(EnSellnuts* this) { - s16 currentFrame = this->skelAnime.curFrame; + s16 curFrame = this->skelAnime.curFrame; - switch (currentFrame) { + switch (curFrame) { case 10: this->unk_350 = 1; this->unk_354 = 0.1f; @@ -180,13 +207,16 @@ void func_80ADAE64(EnSellnuts* this) { case 24: this->unk_358 = 1.0f; break; + + default: + break; } } void func_80ADAFC0(EnSellnuts* this) { - s16 currentFrame = this->skelAnime.curFrame; + s16 curFrame = this->skelAnime.curFrame; - switch (currentFrame) { + switch (curFrame) { case 10: this->unk_350 = 0; break; @@ -205,6 +235,9 @@ void func_80ADAFC0(EnSellnuts* this) { this->unk_358 -= 0.1f; this->unk_35C -= 0.1f; break; + + default: + break; } } @@ -234,26 +267,26 @@ f32 func_80ADB08C(PlayState* play) { } void func_80ADB0D8(EnSellnuts* this, PlayState* play) { - s16 currentFrame = this->skelAnime.curFrame; - s16 frameCount = Animation_GetLastFrame(sAnimationInfo[this->unk_34C].animation); + s16 curFrame = this->skelAnime.curFrame; + s16 endFrame = Animation_GetLastFrame(sAnimationInfo[this->animIndex].animation); - if (currentFrame == frameCount) { + if (curFrame == endFrame) { switch (this->unk_340) { case 0x611: case 0x62A: - this->unk_34C = 0; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 0); + this->animIndex = ENSELLNUTS_ANIM_0; + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, ENSELLNUTS_ANIM_0); this->actionFunc = func_80ADBFA0; break; case 0x618: - if (this->unk_34C == 1) { - this->unk_34C = 0; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 0); + if (this->animIndex == ENSELLNUTS_ANIM_1) { + this->animIndex = ENSELLNUTS_ANIM_0; + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, ENSELLNUTS_ANIM_0); this->actionFunc = func_80ADB544; } else { - this->unk_34C = 1; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 1); + this->animIndex = ENSELLNUTS_ANIM_1; + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, ENSELLNUTS_ANIM_1); this->actionFunc = func_80ADBFA0; } break; @@ -263,8 +296,8 @@ void func_80ADB0D8(EnSellnuts* this, PlayState* play) { case 0x60F: case 0x614: case 0x628: - this->unk_34C = 0; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 0); + this->animIndex = ENSELLNUTS_ANIM_0; + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, ENSELLNUTS_ANIM_0); this->actionFunc = func_80ADB924; break; @@ -272,57 +305,60 @@ void func_80ADB0D8(EnSellnuts* this, PlayState* play) { case 0x615: case 0x616: case 0x629: - this->unk_34C = 1; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 1); + this->animIndex = ENSELLNUTS_ANIM_1; + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, ENSELLNUTS_ANIM_1); this->actionFunc = func_80ADB924; break; case 0x613: case 0x619: - this->unk_34C = 7; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 7); + this->animIndex = ENSELLNUTS_ANIM_7; + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, ENSELLNUTS_ANIM_7); this->actionFunc = func_80ADBD64; break; + + default: + break; } } } void func_80ADB254(EnSellnuts* this, PlayState* play) { - s16 currentFrame = this->skelAnime.curFrame; - s16 frameCount = Animation_GetLastFrame(sAnimationInfo[this->unk_34C].animation); + s16 curFrame = this->skelAnime.curFrame; + s16 endFrame = Animation_GetLastFrame(sAnimationInfo[this->animIndex].animation); Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 2, 0xE38); if (((this->actor.playerHeightRel < 50.0f) && (this->actor.playerHeightRel > -50.0f) ? true : false) && ((this->actor.xzDistToPlayer < 200.0f) ? true : false)) { Actor_PlaySfx(&this->actor, NA_SE_EN_AKINDONUTS_HIDE); this->actionFunc = func_80ADB4F4; - this->unk_34C = 3; + this->animIndex = ENSELLNUTS_ANIM_3; this->collider.dim.height = 64; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 3); - } else if (currentFrame == frameCount) { - if ((this->unk_34C == 4) || (this->unk_34C == 18)) { - this->unk_34C = 17; + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, ENSELLNUTS_ANIM_3); + } else if (curFrame == endFrame) { + if ((this->animIndex == ENSELLNUTS_ANIM_4) || (this->animIndex == ENSELLNUTS_ANIM_18)) { + this->animIndex = ENSELLNUTS_ANIM_17; this->collider.dim.height = 0; Actor_PlaySfx(&this->actor, NA_SE_EN_NUTS_DOWN); - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 17); - } else if (this->unk_34C == 2) { - this->unk_34C = 16; + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, ENSELLNUTS_ANIM_17); + } else if (this->animIndex == ENSELLNUTS_ANIM_2) { + this->animIndex = ENSELLNUTS_ANIM_16; this->collider.dim.height = 32; Actor_PlaySfx(&this->actor, NA_SE_EN_NUTS_UP); - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 16); - } else if (this->unk_34C == 17) { + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, ENSELLNUTS_ANIM_16); + } else if (this->animIndex == ENSELLNUTS_ANIM_17) { if (DECR(this->unk_34E) == 0) { this->unk_34E = Rand_ZeroOne() * 10.0f; - this->unk_34C = 2; + this->animIndex = ENSELLNUTS_ANIM_2; this->collider.dim.height = 32; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 2); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, ENSELLNUTS_ANIM_2); } - } else if (this->unk_34C == 16) { + } else if (this->animIndex == ENSELLNUTS_ANIM_16) { if (DECR(this->unk_34E) == 0) { this->unk_34E = Rand_S16Offset(40, 40); - this->unk_34C = 18; + this->animIndex = ENSELLNUTS_ANIM_18; this->collider.dim.height = 32; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 18); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, ENSELLNUTS_ANIM_18); } } } @@ -331,7 +367,8 @@ void func_80ADB254(EnSellnuts* this, PlayState* play) { void func_80ADB4F4(EnSellnuts* this, PlayState* play) { if (this->skelAnime.curFrame == this->skelAnime.endFrame) { this->actionFunc = func_80ADB544; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 0); + // Does not set `animIndex` + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, ENSELLNUTS_ANIM_0); } } @@ -408,8 +445,8 @@ void func_80ADB544(EnSellnuts* this, PlayState* play) { if (!(((this->actor.playerHeightRel < 50.0f) && (this->actor.playerHeightRel > -50.0f)) ? true : false) || !((this->actor.xzDistToPlayer < 200.0f) ? true : false)) { - this->unk_34C = 4; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 4); + this->animIndex = ENSELLNUTS_ANIM_4; + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, ENSELLNUTS_ANIM_4); this->actionFunc = func_80ADB254; } } @@ -454,19 +491,19 @@ void func_80ADB924(EnSellnuts* this, PlayState* play) { void func_80ADBAB8(EnSellnuts* this, PlayState* play) { u8 talkState = Message_GetState(&play->msgCtx); - s16 currentFrame = this->skelAnime.curFrame; - s16 frameCount = Animation_GetLastFrame(sAnimationInfo[this->unk_34C].animation); + s16 curFrame = this->skelAnime.curFrame; + s16 endFrame = Animation_GetLastFrame(sAnimationInfo[this->animIndex].animation); if (this->unk_368 == 0x28) { - this->unk_34C = 5; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 5); + this->animIndex = ENSELLNUTS_ANIM_5; + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, ENSELLNUTS_ANIM_5); } this->unk_368++; - if ((currentFrame == frameCount) && (this->unk_34C == 5)) { - this->unk_34C = 6; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 6); + if ((curFrame == endFrame) && (this->animIndex == ENSELLNUTS_ANIM_5)) { + this->animIndex = ENSELLNUTS_ANIM_6; + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, ENSELLNUTS_ANIM_6); } if ((talkState == TEXT_STATE_EVENT) && Message_ShouldAdvance(play)) { @@ -507,12 +544,12 @@ void func_80ADBCE4(EnSellnuts* this, PlayState* play) { void func_80ADBD64(EnSellnuts* this, PlayState* play) { u8 talkState = Message_GetState(&play->msgCtx); - s16 currentFrame = this->skelAnime.curFrame; - s16 frameCount = Animation_GetLastFrame(sAnimationInfo[this->unk_34C].animation); + s16 curFrame = this->skelAnime.curFrame; + s16 endFrame = Animation_GetLastFrame(sAnimationInfo[this->animIndex].animation); - if ((currentFrame == frameCount) && (this->unk_34C == 7)) { - this->unk_34C = 0; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 0); + if ((curFrame == endFrame) && (this->animIndex == ENSELLNUTS_ANIM_7)) { + this->animIndex = ENSELLNUTS_ANIM_0; + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, ENSELLNUTS_ANIM_0); } if ((talkState == TEXT_STATE_EVENT) && Message_ShouldAdvance(play)) { @@ -520,15 +557,15 @@ void func_80ADBD64(EnSellnuts* this, PlayState* play) { play->msgCtx.stateTimer = 4; this->unk_338 &= ~2; this->actor.flags &= ~ACTOR_FLAG_TARGETABLE; - this->unk_34C = 8; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 8); + this->animIndex = ENSELLNUTS_ANIM_8; + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, ENSELLNUTS_ANIM_8); this->actionFunc = func_80ADBE80; } } void func_80ADBE80(EnSellnuts* this, PlayState* play) { - s16 currentFrame = this->skelAnime.curFrame; - s16 frameCount = Animation_GetLastFrame(sAnimationInfo[this->unk_34C].animation); + s16 curFrame = this->skelAnime.curFrame; + s16 endFrame = Animation_GetLastFrame(sAnimationInfo[this->animIndex].animation); func_80ADAE64(this); if (this->unk_366 == 0) { @@ -544,10 +581,10 @@ void func_80ADBE80(EnSellnuts* this, PlayState* play) { } } - if (currentFrame == frameCount) { + if (curFrame == endFrame) { this->unk_350 = 4; - this->unk_34C = 19; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 19); + this->animIndex = ENSELLNUTS_ANIM_19; + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, ENSELLNUTS_ANIM_19); Actor_PlaySfx(&this->actor, NA_SE_EN_NUTS_DOWN); this->unk_338 &= ~1; this->unk_338 |= 8; @@ -560,7 +597,7 @@ void func_80ADBFA0(EnSellnuts* this, PlayState* play) { if ((Message_GetState(&play->msgCtx) == TEXT_STATE_EVENT) && Message_ShouldAdvance(play)) { play->msgCtx.msgMode = MSGMODE_TEXT_CLOSING; play->msgCtx.stateTimer = 4; - if (this->unk_34C == 0) { + if (this->animIndex == ENSELLNUTS_ANIM_0) { this->actionFunc = func_80ADB544; } else { this->actionFunc = func_80ADB0D8; @@ -580,8 +617,8 @@ void func_80ADC034(EnSellnuts* this, PlayState* play) { if ((this->actor.home.pos.y + 200.0f) < this->actor.world.pos.y) { Math_ApproachF(&this->actor.velocity.y, 0.0f, 0.2f, 1.0f); - this->unk_34C = 10; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 10); + this->animIndex = ENSELLNUTS_ANIM_10; + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, ENSELLNUTS_ANIM_10); this->unk_368 = 0; this->actionFunc = func_80ADC37C; } @@ -589,10 +626,10 @@ void func_80ADC034(EnSellnuts* this, PlayState* play) { void func_80ADC118(EnSellnuts* this, PlayState* play) { Vec3f sp34; - s16 currentFrame = this->skelAnime.curFrame; - s16 frameCount = Animation_GetLastFrame(sAnimationInfo[this->unk_34C].animation); + s16 curFrame = this->skelAnime.curFrame; + s16 endFrame = Animation_GetLastFrame(sAnimationInfo[this->animIndex].animation); - if (currentFrame == frameCount) { + if (curFrame == endFrame) { Math_SmoothStepToS(&this->unk_364, 0x1C71, 3, 0x100, 0); this->unk_344 += this->unk_364; this->actor.shape.yOffset = 1500.0f; @@ -614,9 +651,9 @@ void func_80ADC118(EnSellnuts* this, PlayState* play) { } if ((this->actor.home.pos.y + 22.5f) < this->actor.world.pos.y) { - this->unk_34C = 9; + this->animIndex = ENSELLNUTS_ANIM_9; this->unk_360 = 0.3f; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 9); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, ENSELLNUTS_ANIM_9); Actor_PlaySfx(&this->actor, NA_SE_EN_AKINDONUTS_HIDE); this->actionFunc = func_80ADC034; } @@ -790,11 +827,11 @@ void func_80ADC8C4(EnSellnuts* this, PlayState* play) { this->actor.world.rot.x = -sp30.x; if (EnSellnuts_HasReachedPoint(this, this->path, this->unk_334)) { if (this->unk_334 >= (this->path->count - 1)) { - this->unk_34C = 22; + this->animIndex = ENSELLNUTS_ANIM_22; this->actor.gravity = -1.0f; this->actor.velocity.y = -1.0f; this->actor.speed = 0.0f; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->unk_34C); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->animIndex); this->unk_338 &= ~1; this->unk_338 &= ~2; this->actionFunc = func_80ADCA64; @@ -808,10 +845,10 @@ void func_80ADC8C4(EnSellnuts* this, PlayState* play) { } void func_80ADCA64(EnSellnuts* this, PlayState* play) { - s16 currentFrame = this->skelAnime.curFrame; - s16 frameCount = Animation_GetLastFrame(sAnimationInfo[this->unk_34C].animation); + s16 curFrame = this->skelAnime.curFrame; + s16 endFrame = Animation_GetLastFrame(sAnimationInfo[this->animIndex].animation); - if (this->unk_34C == 22) { + if (this->animIndex == ENSELLNUTS_ANIM_22) { Math_SmoothStepToS(&this->unk_364, 0, 3, 0x100, 0); this->actor.shape.rot.y += 0x4000; this->unk_360 *= 0.93f; @@ -820,21 +857,21 @@ void func_80ADCA64(EnSellnuts* this, PlayState* play) { this->unk_338 &= ~8; this->unk_34E = 20; this->unk_350 = 4; - this->unk_34C = 19; + this->animIndex = ENSELLNUTS_ANIM_19; this->actor.velocity.y = 0.0f; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->unk_34C); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->animIndex); Actor_PlaySfx(&this->actor, NA_SE_EN_NUTS_DOWN); } return; } Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 2, 0xE38); - if (currentFrame == frameCount) { - if (this->unk_34C == 19) { - this->unk_34C = 17; + if (curFrame == endFrame) { + if (this->animIndex == ENSELLNUTS_ANIM_19) { + this->animIndex = ENSELLNUTS_ANIM_17; this->collider.dim.height = 0; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 17); - } else if (this->unk_34C == 17) { + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, ENSELLNUTS_ANIM_17); + } else if (this->animIndex == ENSELLNUTS_ANIM_17) { CutsceneManager_Stop(this->csId); SET_WEEKEVENTREG(WEEKEVENTREG_73_04); Actor_Kill(&this->actor); @@ -843,28 +880,28 @@ void func_80ADCA64(EnSellnuts* this, PlayState* play) { } void func_80ADCC04(EnSellnuts* this, PlayState* play) { - s16 currentFrame = this->skelAnime.curFrame; - s16 frameCount = Animation_GetLastFrame(sAnimationInfo[this->unk_34C].animation); + s16 curFrame = this->skelAnime.curFrame; + s16 endFrame = Animation_GetLastFrame(sAnimationInfo[this->animIndex].animation); - if (this->unk_34C == 3) { - if (currentFrame == frameCount) { + if (this->animIndex == ENSELLNUTS_ANIM_3) { + if (curFrame == endFrame) { this->unk_350 = 4; - this->unk_34C = 21; + this->animIndex = ENSELLNUTS_ANIM_21; this->unk_354 = 1.0f; this->unk_358 = 1.0f; this->unk_35C = 1.0f; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->unk_34C); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->animIndex); } - } else if (this->unk_34C == 21) { + } else if (this->animIndex == ENSELLNUTS_ANIM_21) { func_80ADAFC0(this); - if (currentFrame == 0) { + if (curFrame == 0) { if (func_80ADB08C(play) < 9999.0f) { this->actor.flags |= ACTOR_FLAG_10000; Actor_OfferTalk(&this->actor, play, 9999.0f); } this->unk_340 = 0x626; - this->unk_34C = 0; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->unk_34C); + this->animIndex = ENSELLNUTS_ANIM_0; + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->animIndex); this->actionFunc = func_80ADC5A4; } } @@ -882,10 +919,10 @@ void func_80ADCD3C(EnSellnuts* this, PlayState* play) { this->unk_34A = 50; this->unk_34E = Rand_ZeroOne() * 10.0f; this->collider.dim.height = 64; - this->unk_34C = 3; + this->animIndex = ENSELLNUTS_ANIM_3; this->unk_350 = 4; Actor_PlaySfx(&this->actor, NA_SE_EN_AKINDONUTS_HIDE); - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->unk_34C); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->animIndex); this->actionFunc = func_80ADCC04; } else if (D_80ADD940 != 0) { this->collider.dim.height = 64; @@ -956,7 +993,7 @@ void EnSellnuts_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(&this->actor, sInitChain); SkelAnime_InitFlex(play, &this->skelAnime, &gBusinessScrubSkel, &gBusinessScrubStandingAnim, this->jointTable, - this->morphTable, 28); + this->morphTable, BUSINESS_SCRUB_LIMB_MAX); Collider_InitCylinder(play, &this->collider); Collider_SetCylinderType1(play, &this->collider, &this->actor, &sCylinderInit); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 35.0f); @@ -991,8 +1028,8 @@ void EnSellnuts_Init(Actor* thisx, PlayState* play) { this->unk_340 = D_80ADD910[this->unk_33A]; this->actor.gravity = -1.0f; this->unk_34A = 50; - this->unk_34C = 4; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->unk_34C); + this->animIndex = ENSELLNUTS_ANIM_4; + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->animIndex); this->actionFunc = func_80ADB254; return; } @@ -1004,13 +1041,13 @@ void EnSellnuts_Init(Actor* thisx, PlayState* play) { this->unk_340 = 0x625; this->actor.gravity = 0.0f; this->actor.draw = NULL; - this->unk_34C = 20; + this->animIndex = ENSELLNUTS_ANIM_20; this->actor.flags &= ~ACTOR_FLAG_TARGETABLE; this->unk_35C = 1.0f; this->unk_358 = 1.0f; this->unk_354 = 1.0f; this->unk_360 = 1.0f; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->unk_34C); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->animIndex); this->actionFunc = func_80ADC5A4; } else { this->unk_338 |= 2; @@ -1018,10 +1055,10 @@ void EnSellnuts_Init(Actor* thisx, PlayState* play) { this->actor.flags &= ~ACTOR_FLAG_TARGETABLE; this->actor.gravity = 0.0f; this->actor.draw = NULL; - this->unk_34C = 4; + this->animIndex = ENSELLNUTS_ANIM_4; this->unk_34E = 20; this->collider.dim.height = 64; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->unk_34C); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->animIndex); this->actionFunc = func_80ADCD3C; } } @@ -1061,53 +1098,68 @@ void EnSellnuts_Update(Actor* thisx, PlayState* play) { s32 EnSellnuts_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) { EnSellnuts* this = THIS; - if (((this->unk_34C == 4) && (this->unk_350 == 0)) || ((this->unk_34C == 8) && (this->unk_350 == 0)) || - ((this->unk_34C == 21) && (this->unk_350 == 0)) || (this->unk_34C == 18) || (this->unk_34C == 2) || - ((this->unk_34C == 3) && (this->unk_350 == 0)) || ((this->unk_34C == 17) && (this->unk_350 == 0)) || - (this->unk_34C == 5) || (this->unk_34C == 6) || (this->unk_34C == 7) || (this->unk_34C == 1) || - (this->unk_34C == 0) || (this->unk_34C == 16)) { - if ((limbIndex == 16) || (limbIndex == 21) || (limbIndex == 27) || (limbIndex == 23) || (limbIndex == 24) || - (limbIndex == 15)) { + if (((this->animIndex == ENSELLNUTS_ANIM_4) && (this->unk_350 == 0)) || + ((this->animIndex == ENSELLNUTS_ANIM_8) && (this->unk_350 == 0)) || + ((this->animIndex == ENSELLNUTS_ANIM_21) && (this->unk_350 == 0)) || (this->animIndex == ENSELLNUTS_ANIM_18) || + (this->animIndex == ENSELLNUTS_ANIM_2) || ((this->animIndex == ENSELLNUTS_ANIM_3) && (this->unk_350 == 0)) || + ((this->animIndex == ENSELLNUTS_ANIM_17) && (this->unk_350 == 0)) || (this->animIndex == ENSELLNUTS_ANIM_5) || + (this->animIndex == ENSELLNUTS_ANIM_6) || (this->animIndex == ENSELLNUTS_ANIM_7) || + (this->animIndex == ENSELLNUTS_ANIM_1) || (this->animIndex == ENSELLNUTS_ANIM_0) || + (this->animIndex == ENSELLNUTS_ANIM_16)) { + if ((limbIndex == BUSINESS_SCRUB_LIMB_RIGHT_HAND_BAG) || (limbIndex == BUSINESS_SCRUB_LIMB_LEFT_HAND_BAG) || + (limbIndex == BUSINESS_SCRUB_LIMB_LEFT_ARM_BAG) || (limbIndex == BUSINESS_SCRUB_LIMB_SCALP) || + (limbIndex == BUSINESS_SCRUB_LIMB_HAIR) || (limbIndex == BUSINESS_SCRUB_LIMB_RIGHT_HAND_HAT)) { *dList = NULL; } - } else if ((this->unk_34C == 8) || (this->unk_34C == 21) || (this->unk_34C == 19) || - ((this->unk_34C == 3) && (this->unk_350 == 4)) || ((this->unk_34C == 17) && (this->unk_350 == 4))) { + } else if ((this->animIndex == ENSELLNUTS_ANIM_8) || (this->animIndex == ENSELLNUTS_ANIM_21) || + (this->animIndex == ENSELLNUTS_ANIM_19) || + ((this->animIndex == ENSELLNUTS_ANIM_3) && (this->unk_350 == 4)) || + ((this->animIndex == ENSELLNUTS_ANIM_17) && (this->unk_350 == 4))) { switch (this->unk_350) { case 1: - if ((limbIndex == 16) || (limbIndex == 21) || (limbIndex == 27) || (limbIndex == 25)) { + if ((limbIndex == BUSINESS_SCRUB_LIMB_RIGHT_HAND_BAG) || + (limbIndex == BUSINESS_SCRUB_LIMB_LEFT_HAND_BAG) || + (limbIndex == BUSINESS_SCRUB_LIMB_LEFT_ARM_BAG) || (limbIndex == BUSINESS_SCRUB_LIMB_HAT)) { *dList = NULL; } break; case 3: case 4: - if ((limbIndex == 16) || (limbIndex == 21) || (limbIndex == 27) || (limbIndex == 15) || - (limbIndex == 25)) { + if ((limbIndex == BUSINESS_SCRUB_LIMB_RIGHT_HAND_BAG) || + (limbIndex == BUSINESS_SCRUB_LIMB_LEFT_HAND_BAG) || + (limbIndex == BUSINESS_SCRUB_LIMB_LEFT_ARM_BAG) || + (limbIndex == BUSINESS_SCRUB_LIMB_RIGHT_HAND_HAT) || (limbIndex == BUSINESS_SCRUB_LIMB_HAT)) { *dList = NULL; } break; case 5: - if ((limbIndex == 15) || (limbIndex == 25)) { + if ((limbIndex == BUSINESS_SCRUB_LIMB_RIGHT_HAND_HAT) || (limbIndex == BUSINESS_SCRUB_LIMB_HAT)) { *dList = NULL; } break; + + default: + break; } - } else if ((this->unk_34C == 9) || (this->unk_34C == 10)) { - if ((limbIndex == 15) || (limbIndex == 25)) { + } else if ((this->animIndex == ENSELLNUTS_ANIM_9) || (this->animIndex == ENSELLNUTS_ANIM_10)) { + if ((limbIndex == BUSINESS_SCRUB_LIMB_RIGHT_HAND_HAT) || (limbIndex == BUSINESS_SCRUB_LIMB_HAT)) { *dList = NULL; } - } else if (((this->unk_34C == 22) || (this->unk_34C == 20)) && - ((limbIndex == 15) || (limbIndex == 25) || (limbIndex == 27))) { + } else if (((this->animIndex == ENSELLNUTS_ANIM_22) || (this->animIndex == ENSELLNUTS_ANIM_20)) && + ((limbIndex == BUSINESS_SCRUB_LIMB_RIGHT_HAND_HAT) || (limbIndex == BUSINESS_SCRUB_LIMB_HAT) || + (limbIndex == BUSINESS_SCRUB_LIMB_LEFT_ARM_BAG))) { *dList = NULL; } - if (limbIndex == 24) { + if (limbIndex == BUSINESS_SCRUB_LIMB_HAIR) { Matrix_RotateXS(this->unk_342, MTXMODE_APPLY); } - if (limbIndex == 26) { - if ((this->unk_34C == 6) || (this->unk_34C == 5) || (this->unk_34C == 7)) { + if (limbIndex == BUSINESS_SCRUB_LIMB_EYES) { + if ((this->animIndex == ENSELLNUTS_ANIM_6) || (this->animIndex == ENSELLNUTS_ANIM_5) || + (this->animIndex == ENSELLNUTS_ANIM_7)) { *dList = gBusinessScrubEyesWideDL; } else { *dList = gBusinessScrubEyesDL; @@ -1123,16 +1175,19 @@ void EnSellnuts_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* void EnSellnuts_TransformLimbDraw(PlayState* play, s32 limbIndex, Actor* thisx) { EnSellnuts* this = THIS; - if (((this->unk_350 == 1) || (this->unk_350 == 3)) && ((limbIndex == 23) || (limbIndex == 24))) { + if (((this->unk_350 == 1) || (this->unk_350 == 3)) && + ((limbIndex == BUSINESS_SCRUB_LIMB_SCALP) || (limbIndex == BUSINESS_SCRUB_LIMB_HAIR))) { Matrix_Scale(this->unk_354, this->unk_358, this->unk_35C, MTXMODE_APPLY); } - if (((this->unk_34C == 9) || (this->unk_34C == 20) || (this->unk_34C == 22)) && - ((limbIndex == 16) || (limbIndex == 21) || (limbIndex == 27))) { + if (((this->animIndex == ENSELLNUTS_ANIM_9) || (this->animIndex == ENSELLNUTS_ANIM_20) || + (this->animIndex == ENSELLNUTS_ANIM_22)) && + ((limbIndex == BUSINESS_SCRUB_LIMB_RIGHT_HAND_BAG) || (limbIndex == BUSINESS_SCRUB_LIMB_LEFT_HAND_BAG) || + (limbIndex == BUSINESS_SCRUB_LIMB_LEFT_ARM_BAG))) { Matrix_Scale(this->unk_360, this->unk_360, this->unk_360, MTXMODE_APPLY); } - if (limbIndex == 24) { + if (limbIndex == BUSINESS_SCRUB_LIMB_HAIR) { Matrix_RotateYS(this->unk_344, MTXMODE_APPLY); } } diff --git a/src/overlays/actors/ovl_En_Sellnuts/z_en_sellnuts.h b/src/overlays/actors/ovl_En_Sellnuts/z_en_sellnuts.h index d56c04f9e8..b20dd5d339 100644 --- a/src/overlays/actors/ovl_En_Sellnuts/z_en_sellnuts.h +++ b/src/overlays/actors/ovl_En_Sellnuts/z_en_sellnuts.h @@ -2,6 +2,7 @@ #define Z_EN_SELLNUTS_H #include "global.h" +#include "objects/object_dnt/object_dnt.h" struct EnSellnuts; @@ -15,8 +16,8 @@ typedef void (*EnSellnutsActionFunc)(struct EnSellnuts*, PlayState*); typedef struct EnSellnuts { /* 0x000 */ Actor actor; /* 0x144 */ SkelAnime skelAnime; - /* 0x188 */ Vec3s jointTable[28]; - /* 0x230 */ Vec3s morphTable[28]; + /* 0x188 */ Vec3s jointTable[BUSINESS_SCRUB_LIMB_MAX]; + /* 0x230 */ Vec3s morphTable[BUSINESS_SCRUB_LIMB_MAX]; /* 0x2D8 */ EnSellnutsActionFunc actionFunc; /* 0x2DC */ ColliderCylinder collider; /* 0x328 */ s16 unk_328; @@ -32,7 +33,7 @@ typedef struct EnSellnuts { /* 0x344 */ s16 unk_344; /* 0x346 */ UNK_TYPE1 unk346[0x4]; /* 0x34A */ s16 unk_34A; - /* 0x34C */ s16 unk_34C; + /* 0x34C */ s16 animIndex; /* 0x34E */ s16 unk_34E; /* 0x350 */ s16 unk_350; /* 0x354 */ f32 unk_354; diff --git a/src/overlays/actors/ovl_En_Shn/z_en_shn.c b/src/overlays/actors/ovl_En_Shn/z_en_shn.c index a82a3e27d5..53bccc2194 100644 --- a/src/overlays/actors/ovl_En_Shn/z_en_shn.c +++ b/src/overlays/actors/ovl_En_Shn/z_en_shn.c @@ -63,30 +63,41 @@ ActorInit En_Shn_InitVars = { /**/ EnShn_Draw, }; -void func_80AE6130(EnShn* this) { - this->skelAnime.playSpeed = this->playSpeed; +void EnShn_UpdateSkelAnime(EnShn* this) { + this->skelAnime.playSpeed = this->animPlaySpeed; SkelAnime_Update(&this->skelAnime); } -s32 func_80AE615C(EnShn* this, s32 animIndex) { - static AnimationInfoS sAnimationInfo[] = { - { &gBurlyGuyHandsOnTableAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, - { &gBurlyGuyHandsOnTableAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, - { &gBurlyGuyChinScratchAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, - { &gBurlyGuyChinScratchAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, - }; - s32 phi_v0 = 0; - s32 phi_v1 = 0; +typedef enum EnShnAnimation { + /* -1 */ ENSHN_ANIM_NONE = -1, + /* 0 */ ENSHN_ANIM_0, + /* 1 */ ENSHN_ANIM_1, + /* 2 */ ENSHN_ANIM_2, + /* 3 */ ENSHN_ANIM_3, + /* 4 */ ENSHN_ANIM_MAX +} EnShnAnimation; - if (animIndex != this->unk_2E8) { - phi_v0 = 1; +static AnimationInfoS sAnimationInfo[ENSHN_ANIM_MAX] = { + { &gBurlyGuyHandsOnTableAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // ENSHN_ANIM_0 + { &gBurlyGuyHandsOnTableAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, // ENSHN_ANIM_1 + { &gBurlyGuyChinScratchAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // ENSHN_ANIM_2 + { &gBurlyGuyChinScratchAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, // ENSHN_ANIM_3 +}; + +s32 EnShn_ChangeAnim(EnShn* this, s32 animIndex) { + s32 changeAnim = false; + s32 didAnimChange = false; + + if (this->animIndex != animIndex) { + changeAnim = true; } - if (phi_v0 != 0) { - this->unk_2E8 = animIndex; - phi_v1 = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, animIndex); - this->playSpeed = this->skelAnime.playSpeed; + + if (changeAnim) { + this->animIndex = animIndex; + didAnimChange = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, animIndex); + this->animPlaySpeed = this->skelAnime.playSpeed; } - return phi_v1; + return didAnimChange; } s32 EnShn_IsFacingPlayer(EnShn* this) { @@ -205,19 +216,21 @@ s32 func_80AE65F4(EnShn* this, PlayState* play) { if (this->unk_1DA != temp) { if ((this->unk_1D8 & 0x80) || (this->unk_1D8 & 0x100)) { this->unk_1D8 |= 8; - func_80AE615C(this, 1); + EnShn_ChangeAnim(this, ENSHN_ANIM_1); } if (temp == 0x9C5) { + //! FAKE: if (1) {} + this->unk_1D8 |= 8; - func_80AE615C(this, 1); + EnShn_ChangeAnim(this, ENSHN_ANIM_1); } } this->unk_1DA = temp; this->unk_1D8 |= 0x40; } else if (this->unk_1D8 & 0x40) { if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_23_08)) { - func_80AE615C(this, 3); + EnShn_ChangeAnim(this, ENSHN_ANIM_3); } this->unk_1DA = 0; this->unk_1D8 &= ~0x40; @@ -267,6 +280,9 @@ s32 func_80AE6704(Actor* thisx, PlayState* play) { gSaveContext.nextTransitionType = TRANS_TYPE_FADE_WHITE_SLOW; this->unk_2C6++; break; + + default: + break; } return ret; } @@ -348,12 +364,14 @@ void EnShn_Init(Actor* thisx, PlayState* play) { ActorShape_Init(&this->actor.shape, 0.0f, NULL, 0.0f); SkelAnime_InitFlex(play, &this->skelAnime, &gBurlyGuySkel, NULL, this->jointTable, this->morphTable, BURLY_GUY_LIMB_MAX); - this->unk_2E8 = -1; + this->animIndex = ENSHN_ANIM_NONE; + if (CHECK_WEEKEVENTREG(WEEKEVENTREG_23_08)) { - func_80AE615C(this, 0); + EnShn_ChangeAnim(this, ENSHN_ANIM_0); } else { - func_80AE615C(this, 2); + EnShn_ChangeAnim(this, ENSHN_ANIM_2); } + this->actor.targetMode = TARGET_MODE_6; Actor_SetScale(&this->actor, 0.01f); this->unk_2E0 = 0; @@ -378,7 +396,7 @@ void EnShn_Update(Actor* thisx, PlayState* play) { func_80AE68F0(this, play); this->actionFunc(this, play); func_80AE65F4(this, play); - func_80AE6130(this); + EnShn_UpdateSkelAnime(this); func_80AE63A8(this, play); this->unk_2E0 = 0; SubS_Offer(&this->actor, play, 120.0f, 40.0f, PLAYER_IA_NONE, this->unk_1D8 & SUBS_OFFER_MODE_MASK); diff --git a/src/overlays/actors/ovl_En_Shn/z_en_shn.h b/src/overlays/actors/ovl_En_Shn/z_en_shn.h index bb4740142e..e2bef2f10f 100644 --- a/src/overlays/actors/ovl_En_Shn/z_en_shn.h +++ b/src/overlays/actors/ovl_En_Shn/z_en_shn.h @@ -32,14 +32,14 @@ typedef struct EnShn { /* 0x2C6 */ s16 unk_2C6; /* 0x2C8 */ s16 unk_2C8; /* 0x2CA */ s16 unk_2CA; - /* 0x2CC */ f32 playSpeed; + /* 0x2CC */ f32 animPlaySpeed; /* 0x2D0 */ f32 unk_2D0; /* 0x2D4 */ f32 unk_2D4; /* 0x2D8 */ MsgEventFunc unk_2D8; /* 0x2DC */ s32 prevTalkState; /* 0x2E0 */ s32 unk_2E0; /* 0x2E4 */ s32 unk_2E4; - /* 0x2E8 */ s32 unk_2E8; + /* 0x2E8 */ s32 animIndex; /* 0x2EC */ s32 unk_2EC; } EnShn; // size = 0x2F0 diff --git a/src/overlays/actors/ovl_En_Skb/z_en_skb.c b/src/overlays/actors/ovl_En_Skb/z_en_skb.c index e4a38369be..62a842c76b 100644 --- a/src/overlays/actors/ovl_En_Skb/z_en_skb.c +++ b/src/overlays/actors/ovl_En_Skb/z_en_skb.c @@ -5,7 +5,6 @@ */ #include "z_en_skb.h" -#include "objects/object_skb/object_skb.h" #include "overlays/actors/ovl_En_Encount4/z_en_encount4.h" #include "overlays/actors/ovl_En_Part/z_en_part.h" #include "overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h" @@ -50,20 +49,37 @@ void func_809964A0(EnSkb* this, PlayState* play); s32 func_80996594(EnSkb* this, PlayState* play); void func_80996BEC(EnSkb* this, PlayState* play); -static AnimationInfo sAnimationInfo[] = { - { &gStalchildWalkAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -4.0 }, - { &gStalchildStandUpAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -1.0f }, - { &gStalchildAttackAnim, 0.6f, 0.0f, 0.0f, ANIMMODE_ONCE_INTERP, 4.0f }, - { &gStalchildStaggerAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -4.0 }, - { &gStalchildCollapseAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -4.0 }, - { &gStalchildSitLaughAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -4.0 }, - { &gStalchildSitTapToesAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -4.0 }, - { &gStalchildSwingOnBranchAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -4.0 }, - { &gStalchildStandUpAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -8.0f }, - { &gStalchildStandUpAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -16.0f }, - { &gStalchildStaggerAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -8.0f }, - { &gStalchildSaluteAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -4.0 }, - { &gStalchildIdleAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -4.0 }, +typedef enum StalchildAnimation { + /* 0 */ STALCHILD_ANIM_0, + /* 1 */ STALCHILD_ANIM_1, + /* 2 */ STALCHILD_ANIM_2, + /* 3 */ STALCHILD_ANIM_3, + /* 4 */ STALCHILD_ANIM_4, + /* 5 */ STALCHILD_ANIM_5, + /* 6 */ STALCHILD_ANIM_6, + /* 7 */ STALCHILD_ANIM_7, + /* 8 */ STALCHILD_ANIM_8, + /* 9 */ STALCHILD_ANIM_9, + /* 10 */ STALCHILD_ANIM_10, + /* 11 */ STALCHILD_ANIM_11, + /* 12 */ STALCHILD_ANIM_12, + /* 13 */ STALCHILD_ANIM_MAX +} StalchildAnimation; + +static AnimationInfo sAnimationInfo[STALCHILD_ANIM_MAX] = { + { &gStalchildWalkAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -4.0 }, // STALCHILD_ANIM_0 + { &gStalchildStandUpAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -1.0f }, // STALCHILD_ANIM_1 + { &gStalchildAttackAnim, 0.6f, 0.0f, 0.0f, ANIMMODE_ONCE_INTERP, 4.0f }, // STALCHILD_ANIM_2 + { &gStalchildStaggerAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -4.0 }, // STALCHILD_ANIM_3 + { &gStalchildCollapseAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -4.0 }, // STALCHILD_ANIM_4 + { &gStalchildSitLaughAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -4.0 }, // STALCHILD_ANIM_5 + { &gStalchildSitTapToesAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -4.0 }, // STALCHILD_ANIM_6 + { &gStalchildSwingOnBranchAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -4.0 }, // STALCHILD_ANIM_7 + { &gStalchildStandUpAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -8.0f }, // STALCHILD_ANIM_8 + { &gStalchildStandUpAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -16.0f }, // STALCHILD_ANIM_9 + { &gStalchildStaggerAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -8.0f }, // STALCHILD_ANIM_10 + { &gStalchildSaluteAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -4.0 }, // STALCHILD_ANIM_11 + { &gStalchildIdleAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -4.0 }, // STALCHILD_ANIM_12 }; static Vec3f D_80997468[] = { @@ -288,7 +304,7 @@ void func_80994DA8(EnSkb* this, PlayState* play) { } void func_80994E2C(EnSkb* this) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 1); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, STALCHILD_ANIM_1); this->actor.flags &= ~ACTOR_FLAG_TARGETABLE; Actor_PlaySfx(&this->actor, NA_SE_EN_STALKID_APPEAR); this->unk_3D0 = 0; @@ -343,7 +359,7 @@ void func_80995068(EnSkb* this, PlayState* play) { if (this->unk_3E0 == 1) { Message_StartTextbox(play, 0x13F8, &this->actor); if (this->unk_3DE == 2) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 11); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, STALCHILD_ANIM_11); } } else { Message_StartTextbox(play, 0x13F6, &this->actor); @@ -375,7 +391,7 @@ void func_80995190(EnSkb* this, PlayState* play) { if (Message_ShouldAdvance(play)) { Message_StartTextbox(play, 0x13F7, &this->actor); if (this->unk_3DE == 2) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 11); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, STALCHILD_ANIM_11); } } break; @@ -413,7 +429,7 @@ void func_80995244(EnSkb* this, PlayState* play) { } void func_809952D8(EnSkb* this) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 5); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, STALCHILD_ANIM_5); this->actor.colChkInfo.mass = MASS_IMMOVABLE; this->unk_3DE = 9; this->actionFunc = func_8099533C; @@ -435,7 +451,7 @@ void func_8099533C(EnSkb* this, PlayState* play) { } void func_809953E8(EnSkb* this) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 6); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, STALCHILD_ANIM_6); this->actor.colChkInfo.mass = MASS_IMMOVABLE; this->unk_3DE = 10; this->actionFunc = func_8099544C; @@ -457,7 +473,7 @@ void func_8099544C(EnSkb* this, PlayState* play) { } void func_809954F8(EnSkb* this) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 7); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, STALCHILD_ANIM_7); this->actor.colChkInfo.mass = MASS_IMMOVABLE; this->unk_3DE = 11; this->actionFunc = func_8099556C; @@ -500,14 +516,14 @@ void func_8099571C(EnSkb* this) { this->unk_3DC = 0; this->actor.shape.shadowScale = 0.0f; if (this->unk_3DE == 9) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 8); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, STALCHILD_ANIM_8); this->actor.speed = 2.4f; this->actor.gravity = -1.0f; this->actor.velocity.y = 3.0f; } else if (this->unk_3DE == 0xA) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 8); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, STALCHILD_ANIM_8); } else if (this->unk_3DE == 0xB) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 9); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, STALCHILD_ANIM_9); this->actor.speed = 3.2f; this->actor.gravity = -1.0f; this->actor.velocity.y = 2.0f; @@ -561,7 +577,7 @@ void func_8099599C(EnSkb* this, PlayState* play) { } void func_80995A30(EnSkb* this) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 0); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, STALCHILD_ANIM_0); this->actor.speed = 1.6f; this->unk_3DA = 0; this->unk_3DE = 2; @@ -574,7 +590,7 @@ void func_80995A8C(EnSkb* this, PlayState* play) { this->actor.flags |= (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY); this->actor.hintId = TATL_HINT_ID_NONE; this->actor.colChkInfo.mass = MASS_HEAVY; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 12); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, STALCHILD_ANIM_12); func_8099504C(this); return; } @@ -597,7 +613,7 @@ void func_80995A8C(EnSkb* this, PlayState* play) { } void func_80995C24(EnSkb* this) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 2); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, STALCHILD_ANIM_2); this->collider.base.atFlags &= ~AT_BOUNCED; this->actor.speed = 0.0f; this->unk_3DE = 3; @@ -683,17 +699,17 @@ void func_80995E64(EnSkb* this, PlayState* play) { void func_80995F98(EnSkb* this) { if ((this->unk_3DE == 9) || (this->unk_3DE == 0xA)) { this->actor.world.rot.y = this->actor.yawTowardsPlayer; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 8); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, STALCHILD_ANIM_8); this->actor.gravity = -1.0f; this->actor.speed = 1.0f; } else if (this->unk_3DE == 0xB) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 9); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, STALCHILD_ANIM_9); this->actor.speed = 3.2f; this->actor.velocity.y = 2.0f; this->actor.gravity = -1.0f; } else { this->actor.world.rot.y = this->actor.yawTowardsPlayer; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 3); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, STALCHILD_ANIM_3); if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->actor.speed = -4.0f; } @@ -730,7 +746,7 @@ void func_809960AC(EnSkb* this, PlayState* play) { } void func_809961E4(EnSkb* this, PlayState* play) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 4); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, STALCHILD_ANIM_4); this->unk_3D8 |= 0x40; if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->actor.speed = -6.0f; @@ -762,7 +778,7 @@ void func_8099630C(EnSkb* this, PlayState* play) { this->drawDmgEffAlpha = 0.0f; if (this->actor.colChkInfo.health != 0) { Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_OPA, 8); - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 3); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, STALCHILD_ANIM_3); this->unk_3D8 |= 1; func_80995F98(this); } else { @@ -784,7 +800,7 @@ void func_809963D8(EnSkb* this, PlayState* play) { this->drawDmgEffAlpha = 0.0f; if (this->actor.colChkInfo.health != 0) { Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_OPA, 8); - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 3); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, STALCHILD_ANIM_3); this->unk_3D8 |= 1; func_80995F98(this); } else { @@ -848,6 +864,7 @@ s32 func_80996594(EnSkb* this, PlayState* play) { j = 1; temp_s2 = func_80996544(sp60, sp58); + //! FAKE: if (1) {} do { @@ -887,19 +904,19 @@ void func_8099672C(EnSkb* this, PlayState* play) { this->collider.base.acFlags &= ~AC_HIT; if (this->actionFunc == func_8099630C) { switch (this->actor.colChkInfo.damageEffect) { - default: - if (this->drawDmgEffTimer > 1) { - func_80996BEC(this, play); - } - this->drawDmgEffTimer = 0; - break; - case 1: case 3: case 4: case 12: case 13: return; + + default: + if (this->drawDmgEffTimer > 1) { + func_80996BEC(this, play); + } + this->drawDmgEffTimer = 0; + break; } } @@ -956,7 +973,7 @@ void func_8099672C(EnSkb* this, PlayState* play) { this->drawDmgEffScale = 0.5f; Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_OPA, 8); Actor_PlaySfx(&this->actor, NA_SE_EN_STALKID_DAMAGE); - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 3); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, STALCHILD_ANIM_3); func_809963C4(this); break; @@ -974,7 +991,7 @@ void func_8099672C(EnSkb* this, PlayState* play) { case 13: Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_OPA, 8); - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 3); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, STALCHILD_ANIM_3); func_80995F98(this); break; } @@ -1076,7 +1093,7 @@ s32 EnSkb_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* p s32 pad; s16 sins; - if (limbIndex == 11) { + if (limbIndex == STALCHILD_LIMB_HEAD) { if (!(this->unk_3D8 & 2)) { OPEN_DISPS(play->state.gfxCtx); @@ -1089,11 +1106,11 @@ s32 EnSkb_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* p } else { *dList = NULL; } - } else if ((limbIndex == 12) && (this->unk_3D8 & 2)) { + } else if ((limbIndex == STALCHILD_LIMB_LOWER_JAW) && (this->unk_3D8 & 2)) { *dList = NULL; } - if (limbIndex == 10) { + if (limbIndex == STALCHILD_LIMB_RIBCAGE) { Matrix_MultZero(&this->actor.focus.pos); } @@ -1106,22 +1123,27 @@ void EnSkb_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Collider_UpdateSpheres(limbIndex, &this->collider); if ((this->unk_3D8 & 1) && !(this->unk_3D8 & 2)) { - if (limbIndex == 11) { + if (limbIndex == STALCHILD_LIMB_HEAD) { Actor_SpawnBodyParts(&this->actor, play, ENPART_PARAMS(ENPART_TYPE_1), dList); this->unk_3D8 |= 2; } - } else if ((this->unk_3D8 & 0x40) && !(this->unk_3D8 & 0x80) && ((limbIndex != 11) || !(this->unk_3D8 & 1)) && - (limbIndex != 12)) { + } else if ((this->unk_3D8 & 0x40) && !(this->unk_3D8 & 0x80) && + ((limbIndex != STALCHILD_LIMB_HEAD) || !(this->unk_3D8 & 1)) && + (limbIndex != STALCHILD_LIMB_LOWER_JAW)) { Actor_SpawnBodyParts(&this->actor, play, ENPART_PARAMS(ENPART_TYPE_1), dList); } if (this->drawDmgEffTimer != 0) { - if ((limbIndex == 2) || (limbIndex == 4) || (limbIndex == 5) || (limbIndex == 6) || (limbIndex == 7) || - (limbIndex == 8) || (limbIndex == 9) || (limbIndex == 13) || (limbIndex == 14) || (limbIndex == 15) || - (limbIndex == 16) || (limbIndex == 17) || (limbIndex == 18)) { + if ((limbIndex == STALCHILD_LIMB_PELVIS) || (limbIndex == STALCHILD_LIMB_RIGHT_THIGH) || + (limbIndex == STALCHILD_LIMB_RIGHT_SHIN) || (limbIndex == STALCHILD_LIMB_RIGHT_FOOT) || + (limbIndex == STALCHILD_LIMB_LEFT_THIGH) || (limbIndex == STALCHILD_LIMB_LEFT_SHIN) || + (limbIndex == STALCHILD_LIMB_LEFT_FOOT) || (limbIndex == STALCHILD_LIMB_RIGHT_UPPER_ARM) || + (limbIndex == STALCHILD_LIMB_RIGHT_LOWER_ARM) || (limbIndex == STALCHILD_LIMB_RIGHT_HAND) || + (limbIndex == STALCHILD_LIMB_LEFT_UPPER_ARM) || (limbIndex == STALCHILD_LIMB_LEFT_LOWER_ARM) || + (limbIndex == STALCHILD_LIMB_LEFT_HAND)) { Matrix_MultZero(&this->bodyPartsPos[this->bodyPartsCount]); this->bodyPartsCount++; - } else if ((limbIndex == 11) && !(this->unk_3D8 & 2)) { + } else if ((limbIndex == STALCHILD_LIMB_HEAD) && !(this->unk_3D8 & 2)) { Matrix_MultVec3f(&D_80997564, &this->bodyPartsPos[this->bodyPartsCount]); this->bodyPartsCount++; } diff --git a/src/overlays/actors/ovl_En_Skb/z_en_skb.h b/src/overlays/actors/ovl_En_Skb/z_en_skb.h index 983e8cc5da..4a50bfc37e 100644 --- a/src/overlays/actors/ovl_En_Skb/z_en_skb.h +++ b/src/overlays/actors/ovl_En_Skb/z_en_skb.h @@ -2,6 +2,7 @@ #define Z_EN_SKB_H #include "global.h" +#include "objects/object_skb/object_skb.h" struct EnSkb; @@ -41,8 +42,8 @@ typedef struct EnSkb { /* 0x230 */ f32 drawDmgEffScale; /* 0x234 */ Vec3f bodyPartsPos[ENSKB_BODYPART_MAX]; /* 0x2DC */ s32 bodyPartsCount; - /* 0x2E0 */ Vec3s jointTable[20]; - /* 0x358 */ Vec3s morphTable[20]; + /* 0x2E0 */ Vec3s jointTable[STALCHILD_LIMB_MAX]; + /* 0x358 */ Vec3s morphTable[STALCHILD_LIMB_MAX]; /* 0x3D0 */ s16 unk_3D0; /* 0x3D2 */ s16 drawDmgEffTimer; /* 0x3D4 */ s16 unk_3D4; diff --git a/src/overlays/actors/ovl_En_Slime/z_en_slime.c b/src/overlays/actors/ovl_En_Slime/z_en_slime.c index d091ed9253..aeb02d48d5 100644 --- a/src/overlays/actors/ovl_En_Slime/z_en_slime.c +++ b/src/overlays/actors/ovl_En_Slime/z_en_slime.c @@ -153,28 +153,6 @@ static Color_RGBA8 sBubblePrimColor = { 255, 255, 255, 255 }; static Color_RGBA8 sBubbleEnvColor = { 150, 150, 150, 0 }; static Vec3f sBubbleAccel = { 0.0f, -0.8f, 0.0f }; -static Color_RGBA8 sPrimColors[] = { - { 255, 255, 255, 255 }, // EN_SLIME_TYPE_BLUE - { 255, 255, 0, 255 }, // EN_SLIME_TYPE_GREEN - { 255, 255, 200, 255 }, // EN_SLIME_TYPE_YELLOW - { 225, 200, 255, 255 }, // EN_SLIME_TYPE_RED -}; - -static Color_RGBA8 sEnvColors[] = { - { 140, 255, 195, 255 }, // EN_SLIME_TYPE_BLUE - { 50, 255, 0, 255 }, // EN_SLIME_TYPE_GREEN - { 255, 180, 0, 255 }, // EN_SLIME_TYPE_YELLOW - { 255, 50, 155, 255 }, // EN_SLIME_TYPE_RED -}; - -static Vec3f sBodyPartPosOffsets[EN_SLIME_BODYPART_MAX] = { - { 2000.0f, 2000.0f, 0.0f }, // EN_SLIME_BODYPART_0 - { -1500.0f, 2500.0f, -500.0f }, // EN_SLIME_BODYPART_1 - { -500.0f, 1000.0f, 2500.0f }, // EN_SLIME_BODYPART_2 - { 0.0f, 4000.0f, 0.0f }, // EN_SLIME_BODYPART_3 - { 0.0f, 2000.0f, -2000.0f }, // EN_SLIME_BODYPART_4 -}; - AnimatedMaterial* sSlimeTexAnim; void EnSlime_Init(Actor* thisx, PlayState* play) { @@ -1164,6 +1142,28 @@ void EnSlime_Update(Actor* thisx, PlayState* play) { } } +static Color_RGBA8 sPrimColors[EN_SLIME_TYPE_MAX] = { + { 255, 255, 255, 255 }, // EN_SLIME_TYPE_BLUE + { 255, 255, 0, 255 }, // EN_SLIME_TYPE_GREEN + { 255, 255, 200, 255 }, // EN_SLIME_TYPE_YELLOW + { 225, 200, 255, 255 }, // EN_SLIME_TYPE_RED +}; + +static Color_RGBA8 sEnvColors[EN_SLIME_TYPE_MAX] = { + { 140, 255, 195, 255 }, // EN_SLIME_TYPE_BLUE + { 50, 255, 0, 255 }, // EN_SLIME_TYPE_GREEN + { 255, 180, 0, 255 }, // EN_SLIME_TYPE_YELLOW + { 255, 50, 155, 255 }, // EN_SLIME_TYPE_RED +}; + +static Vec3f sBodyPartPosOffsets[EN_SLIME_BODYPART_MAX] = { + { 2000.0f, 2000.0f, 0.0f }, // EN_SLIME_BODYPART_0 + { -1500.0f, 2500.0f, -500.0f }, // EN_SLIME_BODYPART_1 + { -500.0f, 1000.0f, 2500.0f }, // EN_SLIME_BODYPART_2 + { 0.0f, 4000.0f, 0.0f }, // EN_SLIME_BODYPART_3 + { 0.0f, 2000.0f, -2000.0f }, // EN_SLIME_BODYPART_4 +}; + void EnSlime_Draw(Actor* thisx, PlayState* play) { s32 i; EnSlime* this = THIS; @@ -1208,14 +1208,14 @@ void EnSlime_Draw(Actor* thisx, PlayState* play) { // Ice block is not active Scene_SetRenderModeXlu(play, 0, 1); - gSPSegment(POLY_OPA_DISP++, 9, (u32)sEyeTextures[this->eyeTexIndex]); + gSPSegment(POLY_OPA_DISP++, 0x09, sEyeTextures[this->eyeTexIndex]); gDPSetEnvColor(POLY_OPA_DISP++, 0, 30, 70, 255); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_OPA_DISP++, gChuchuEyesDL); } else { Scene_SetRenderModeXlu(play, 1, 2); - gSPSegment(POLY_XLU_DISP++, 9, (u32)sEyeTextures[this->eyeTexIndex]); + gSPSegment(POLY_XLU_DISP++, 0x09, sEyeTextures[this->eyeTexIndex]); gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_XLU_DISP++, gChuchuEyesDL); } @@ -1241,7 +1241,7 @@ void EnSlime_Draw(Actor* thisx, PlayState* play) { this->actor.world.pos.z, MTXMODE_NEW); Matrix_Scale(0.03f, 0.03f, 0.03f, MTXMODE_APPLY); - gSPSegment(POLY_OPA_DISP++, 8, (u32)this->itemDropTex); + gSPSegment(POLY_OPA_DISP++, 0x08, this->itemDropTex); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_OPA_DISP++, gItemDropDL); } diff --git a/src/overlays/actors/ovl_En_Slime/z_en_slime.h b/src/overlays/actors/ovl_En_Slime/z_en_slime.h index fbae533ea4..38723dbcb8 100644 --- a/src/overlays/actors/ovl_En_Slime/z_en_slime.h +++ b/src/overlays/actors/ovl_En_Slime/z_en_slime.h @@ -17,7 +17,8 @@ typedef enum EnSlimeType { /* 0 */ EN_SLIME_TYPE_BLUE, /* 1 */ EN_SLIME_TYPE_GREEN, /* 2 */ EN_SLIME_TYPE_YELLOW, - /* 3 */ EN_SLIME_TYPE_RED + /* 3 */ EN_SLIME_TYPE_RED, + /* 4 */ EN_SLIME_TYPE_MAX } EnSlimeType; typedef enum EnSlimeBodyPart { 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 5590bc82b7..b826a8dcab 100644 --- a/src/overlays/actors/ovl_En_Sob1/z_en_sob1.c +++ b/src/overlays/actors/ovl_En_Sob1/z_en_sob1.c @@ -157,15 +157,15 @@ static Vec3f sPosOffset[] = { }; void EnSob1_ChangeAnim(SkelAnime* skelAnime, AnimationInfoS* animations, s32 animIndex) { - f32 frameCount; + f32 endFrame; animations += animIndex; if (animations->frameCount < 0) { - frameCount = Animation_GetLastFrame(animations->animation); + endFrame = Animation_GetLastFrame(animations->animation); } else { - frameCount = animations->frameCount; + endFrame = animations->frameCount; } - Animation_Change(skelAnime, animations->animation, animations->playSpeed, animations->startFrame, frameCount, + Animation_Change(skelAnime, animations->animation, animations->playSpeed, animations->startFrame, endFrame, animations->mode, animations->morphFrames); } @@ -740,7 +740,7 @@ void EnSob1_EndWalk(EnSob1* this, PlayState* play) { s32 pad; f32 distSq; s16 curFrame = this->skelAnime.curFrame / this->skelAnime.playSpeed; - s16 animLastFrame = Animation_GetLastFrame(&gBombShopkeeperWalkAnim) / TRUNCF_BINANG(this->skelAnime.playSpeed); + s16 endFrame = Animation_GetLastFrame(&gBombShopkeeperWalkAnim) / TRUNCF_BINANG(this->skelAnime.playSpeed); Math_SmoothStepToS(&this->actor.world.rot.y, EnSob1_GetDistSqAndOrient(this->path, this->waypoint - 1, &this->actor.world.pos, &distSq), 4, @@ -749,7 +749,7 @@ void EnSob1_EndWalk(EnSob1* this, PlayState* play) { Math_ApproachF(&this->actor.speed, 0.5f, 0.2f, 1.0f); if (distSq < 12.0f) { this->actor.speed = 0.0f; - if (animLastFrame == curFrame) { + if (endFrame == curFrame) { EnSob1_ChangeAnim(&this->skelAnime, sAnimationInfoBombShopkeeper, BOMB_SHOPKEEPER_ANIM_SIT_AT_COUNTER_START); EnSob1_SetupAction(this, EnSob1_SetupIdle); @@ -760,8 +760,9 @@ void EnSob1_EndWalk(EnSob1* this, PlayState* play) { void EnSob1_SetupIdle(EnSob1* this, PlayState* play) { s16 curFrame = this->skelAnime.curFrame; + s16 endFrame = Animation_GetLastFrame(&gBombShopkeeperSitAtCounterStartAnim); - if (Animation_GetLastFrame(&gBombShopkeeperSitAtCounterStartAnim) == curFrame) { + if (endFrame == curFrame) { EnSob1_ChangeAnim(&this->skelAnime, sAnimationInfoBombShopkeeper, BOMB_SHOPKEEPER_ANIM_SIT_AT_COUNTER_LOOP); EnSob1_SetupAction(this, EnSob1_Idle); } 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 7886b1a2a4..b20a03042b 100644 --- a/src/overlays/actors/ovl_En_Ssh/z_en_ssh.c +++ b/src/overlays/actors/ovl_En_Ssh/z_en_ssh.c @@ -5,7 +5,6 @@ */ #include "z_en_ssh.h" -#include "objects/object_ssh/object_ssh.h" #include "objects/object_st/object_st.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_UNFRIENDLY | ACTOR_FLAG_10 | ACTOR_FLAG_20) @@ -207,21 +206,51 @@ void EnSsh_InitColliders(EnSsh* this, PlayState* play) { Collider_SetJntSph(play, &this->collider2, &this->actor, &sJntSphInit, this->collider2Elements); } +typedef enum EnSshAnimation { + /* 0x0 */ SSH_ANIM_0, // Unused animation. Possibly being knocked back? + /* 0x1 */ SSH_ANIM_UP, + /* 0x2 */ SSH_ANIM_WAIT, + /* 0x3 */ SSH_ANIM_LAND, + /* 0x4 */ SSH_ANIM_DROP, + /* 0x5 */ SSH_ANIM_5, // Slower version of ANIM_DROP + /* 0x6 */ SSH_ANIM_6, // Faster repeating version of + /* 0x7 */ SSH_ANIM_MAX +} EnSshAnimation; + f32 EnSsh_ChangeAnim(EnSsh* this, s32 animIndex) { - AnimationHeader* sAnimations[] = { &object_ssh_Anim_006D78, &object_ssh_Anim_001494, &object_ssh_Anim_001494, - &object_ssh_Anim_006788, &object_ssh_Anim_001494, &object_ssh_Anim_001494, - &object_ssh_Anim_006D78 }; - f32 sPlaySpeeds[] = { 1.0f, 4.0f, 1.0f, 1.0f, 8.0f, 6.0f, 2.0f }; - u8 sAnimationModes[] = { - ANIMMODE_ONCE_INTERP, ANIMMODE_ONCE_INTERP, ANIMMODE_LOOP_INTERP, ANIMMODE_ONCE_INTERP, - ANIMMODE_LOOP_INTERP, ANIMMODE_LOOP_INTERP, ANIMMODE_LOOP_INTERP, + AnimationHeader* sAnimations[SSH_ANIM_MAX] = { + &object_ssh_Anim_006D78, // SSH_ANIM_0 + &object_ssh_Anim_001494, // SSH_ANIM_UP + &object_ssh_Anim_001494, // SSH_ANIM_WAIT + &object_ssh_Anim_006788, // SSH_ANIM_LAND + &object_ssh_Anim_001494, // SSH_ANIM_DROP + &object_ssh_Anim_001494, // SSH_ANIM_5 + &object_ssh_Anim_006D78, // SSH_ANIM_6 }; - f32 frameCount = Animation_GetLastFrame(sAnimations[animIndex]); + f32 sPlaySpeeds[SSH_ANIM_MAX] = { + 1.0f, // SSH_ANIM_0 + 4.0f, // SSH_ANIM_UP + 1.0f, // SSH_ANIM_WAIT + 1.0f, // SSH_ANIM_LAND + 8.0f, // SSH_ANIM_DROP + 6.0f, // SSH_ANIM_5 + 2.0f, // SSH_ANIM_6 + }; + u8 sAnimationModes[SSH_ANIM_MAX] = { + ANIMMODE_ONCE_INTERP, // SSH_ANIM_0 + ANIMMODE_ONCE_INTERP, // SSH_ANIM_UP + ANIMMODE_LOOP_INTERP, // SSH_ANIM_WAIT + ANIMMODE_ONCE_INTERP, // SSH_ANIM_LAND + ANIMMODE_LOOP_INTERP, // SSH_ANIM_DROP + ANIMMODE_LOOP_INTERP, // SSH_ANIM_5 + ANIMMODE_LOOP_INTERP, // SSH_ANIM_6 + }; + f32 endFrame = Animation_GetLastFrame(sAnimations[animIndex]); s32 pad; - Animation_Change(&this->skelAnime, sAnimations[animIndex], sPlaySpeeds[animIndex], 0.0f, frameCount, + Animation_Change(&this->skelAnime, sAnimations[animIndex], sPlaySpeeds[animIndex], 0.0f, endFrame, sAnimationModes[animIndex], -6.0f); - return frameCount; + return endFrame; } void EnSsh_SetWaitAnimation(EnSsh* this) { @@ -631,13 +660,14 @@ void EnSsh_Init(Actor* thisx, PlayState* play) { //! @bug: object_st_Anim_000304 is similar if not idential to object_ssh_Anim_001494. //! They also shared the same offset into their respective object files in OoT. //! However since object_ssh is the one loaded, this ends up reading garbage data from within object_ssh_Tex_000190. - f32 frameCount = Animation_GetLastFrame(&object_st_Anim_000304); + f32 endFrame = Animation_GetLastFrame(&object_st_Anim_000304); s32 pad; EnSsh* this = THIS; ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); - SkelAnime_Init(play, &this->skelAnime, &object_ssh_Skel_006470, NULL, this->jointTable, this->morphTable, 30); - Animation_Change(&this->skelAnime, &object_ssh_Anim_001494, 1.0f, 0.0f, frameCount, ANIMMODE_LOOP_INTERP, 0.0f); + SkelAnime_Init(play, &this->skelAnime, &object_ssh_Skel_006470, NULL, this->jointTable, this->morphTable, + OBJECT_SSH_LIMB_MAX); + Animation_Change(&this->skelAnime, &object_ssh_Anim_001494, 1.0f, 0.0f, endFrame, ANIMMODE_LOOP_INTERP, 0.0f); this->blureIdx = EnSsh_CreateBlureEffect(play); EnSsh_InitColliders(this, play); this->stateFlags = 0; @@ -875,7 +905,7 @@ s32 EnSsh_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* p EnSsh* this = THIS; switch (limbIndex) { - case 1: + case OBJECT_SSH_LIMB_01: if ((this->spinTimer != 0) && (this->swayTimer == 0)) { if (this->spinTimer >= 2) { EnSsh_AddBlureVertex(this); @@ -885,23 +915,26 @@ s32 EnSsh_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* p } break; - case 4: + case OBJECT_SSH_LIMB_04: if (this->stateFlags & SSH_STATE_FATHER) { *dList = object_ssh_DL_005850; } break; - case 5: + case OBJECT_SSH_LIMB_05: if (this->stateFlags & SSH_STATE_FATHER) { *dList = object_ssh_DL_005210; } break; - case 8: + case OBJECT_SSH_LIMB_08: if (this->stateFlags & SSH_STATE_FATHER) { *dList = object_ssh_DL_005F78; } break; + + default: + break; } return false; } @@ -909,7 +942,7 @@ s32 EnSsh_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* p void EnSsh_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) { EnSsh* this = THIS; - if ((limbIndex == 5) && (this->stateFlags & SSH_STATE_FATHER)) { + if ((limbIndex == OBJECT_SSH_LIMB_05) && (this->stateFlags & SSH_STATE_FATHER)) { OPEN_DISPS(play->state.gfxCtx); gSPDisplayList(POLY_OPA_DISP++, object_ssh_DL_0000D8); diff --git a/src/overlays/actors/ovl_En_Ssh/z_en_ssh.h b/src/overlays/actors/ovl_En_Ssh/z_en_ssh.h index 8c95ea6288..b587a01e9d 100644 --- a/src/overlays/actors/ovl_En_Ssh/z_en_ssh.h +++ b/src/overlays/actors/ovl_En_Ssh/z_en_ssh.h @@ -2,6 +2,7 @@ #define Z_EN_SSH_H #include "global.h" +#include "objects/object_ssh/object_ssh.h" #include "overlays/actors/ovl_En_Si/z_en_si.h" #include "overlays/actors/ovl_En_Sth/z_en_sth.h" @@ -15,23 +16,13 @@ typedef void (*EnSshActionFunc)(struct EnSsh*, PlayState*); #define SSH_STATE_SPIN (1 << 4) #define SSH_STATE_FATHER (1 << 5) -typedef enum { - /* 0x0 */ SSH_ANIM_UNK0, // Unused animation. Possibly being knocked back? - /* 0x1 */ SSH_ANIM_UP, - /* 0x2 */ SSH_ANIM_WAIT, - /* 0x3 */ SSH_ANIM_LAND, - /* 0x4 */ SSH_ANIM_DROP, - /* 0x5 */ SSH_ANIM_UNK5, // Slower version of ANIM_DROP - /* 0x6 */ SSH_ANIM_UNK6 // Faster repeating version of ANIM_UNK0 -} EnSshAnimation; - #define ENSSH_IS_CHILD(thisx) ((thisx)->params & 0xF) typedef struct EnSsh { /* 0x000 */ Actor actor; /* 0x144 */ SkelAnime skelAnime; - /* 0x188 */ Vec3s jointTable[30]; - /* 0x23C */ Vec3s morphTable[30]; + /* 0x188 */ Vec3s jointTable[OBJECT_SSH_LIMB_MAX]; + /* 0x23C */ Vec3s morphTable[OBJECT_SSH_LIMB_MAX]; /* 0x2F0 */ EnSshActionFunc actionFunc; /* 0x2F4 */ ColliderCylinder collider1[6]; /* 0x4BC */ ColliderJntSph collider2; diff --git a/src/overlays/actors/ovl_En_St/z_en_st.c b/src/overlays/actors/ovl_En_St/z_en_st.c index 5096f07d50..3f22cc7fac 100644 --- a/src/overlays/actors/ovl_En_St/z_en_st.c +++ b/src/overlays/actors/ovl_En_St/z_en_st.c @@ -6,7 +6,6 @@ #include "z_en_st.h" #include "overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.h" -#include "objects/object_st/object_st.h" #include "objects/gameplay_keep/gameplay_keep.h" #define FLAGS \ @@ -155,29 +154,42 @@ static DamageTable sDamageTable = { /* Powder Keg */ DMG_ENTRY(1, 0x0), }; -static AnimationInfoS sAnimationInfo[] = { - { &object_st_Anim_000304, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, - { &object_st_Anim_005B98, 1.0f, 0, -1, ANIMMODE_ONCE, -4 }, - { &object_st_Anim_000304, 4.0f, 0, -1, ANIMMODE_ONCE, -4 }, - { &object_st_Anim_000304, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, - { &object_st_Anim_0055A8, 1.0f, 0, -1, ANIMMODE_ONCE, -4 }, - { &object_st_Anim_000304, 8.0f, 0, -1, ANIMMODE_LOOP, -4 }, - { &object_st_Anim_000304, 6.0f, 0, -1, ANIMMODE_ONCE, -4 }, - { &object_st_Anim_005B98, 2.0f, 0, -1, ANIMMODE_LOOP, -4 }, +typedef enum EnStAnimation { + /* -1 */ ENST_ANIM_NONE = -1, + /* 0 */ ENST_ANIM_0, + /* 1 */ ENST_ANIM_1, + /* 2 */ ENST_ANIM_2, + /* 3 */ ENST_ANIM_3, + /* 4 */ ENST_ANIM_4, + /* 5 */ ENST_ANIM_5, + /* 6 */ ENST_ANIM_6, + /* 7 */ ENST_ANIM_7, + /* 8 */ ENST_ANIM_MAX +} EnStAnimation; + +static AnimationInfoS sAnimationInfo[ENST_ANIM_MAX] = { + { &object_st_Anim_000304, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // ENST_ANIM_0 + { &object_st_Anim_005B98, 1.0f, 0, -1, ANIMMODE_ONCE, -4 }, // ENST_ANIM_1 + { &object_st_Anim_000304, 4.0f, 0, -1, ANIMMODE_ONCE, -4 }, // ENST_ANIM_2 + { &object_st_Anim_000304, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, // ENST_ANIM_3 + { &object_st_Anim_0055A8, 1.0f, 0, -1, ANIMMODE_ONCE, -4 }, // ENST_ANIM_4 + { &object_st_Anim_000304, 8.0f, 0, -1, ANIMMODE_LOOP, -4 }, // ENST_ANIM_5 + { &object_st_Anim_000304, 6.0f, 0, -1, ANIMMODE_ONCE, -4 }, // ENST_ANIM_6 + { &object_st_Anim_005B98, 2.0f, 0, -1, ANIMMODE_LOOP, -4 }, // ENST_ANIM_7 }; void func_808A5050(EnSt* this, PlayState* play) { - static Color_RGBA8 D_808A770C = { 170, 130, 90, 255 }; - static Color_RGBA8 D_808A7710 = { 100, 60, 20, 0 }; + static Color_RGBA8 sPrimColor = { 170, 130, 90, 255 }; + static Color_RGBA8 sEnvColor = { 100, 60, 20, 0 }; s32 i; - Vec3f spB8; - Vec3f spAC; - Vec3f spA0; + Vec3f velocity; + Vec3f accel; + Vec3f pos; Vec3f sp94; s32 rand; s16 temp_s0 = (Rand_ZeroOne() - 0.5f) * 0x10000; - spA0.y = this->actor.floorHeight; + pos.y = this->actor.floorHeight; for (i = 0; i < 16; i++, temp_s0 += 0xFFF) { rand = (Rand_ZeroOne() * 4.0f) + 8.0f; @@ -185,37 +197,37 @@ void func_808A5050(EnSt* this, PlayState* play) { sp94.x = 0.0f; sp94.y = (Rand_ZeroOne() * 0.2f) + 0.1f; sp94.z = Rand_ZeroOne() + 1.0f; - Lib_Vec3f_TranslateAndRotateY(&gZeroVec3f, temp_s0, &sp94, &spAC); + Lib_Vec3f_TranslateAndRotateY(&gZeroVec3f, temp_s0, &sp94, &accel); sp94.x = 0.0f; sp94.y = 1.0f; sp94.z = 5.0f; - Lib_Vec3f_TranslateAndRotateY(&gZeroVec3f, temp_s0, &sp94, &spB8); + Lib_Vec3f_TranslateAndRotateY(&gZeroVec3f, temp_s0, &sp94, &velocity); - spA0.x = this->actor.world.pos.x + (2.0f * spB8.x); - spA0.z = this->actor.world.pos.z + (2.0f * spB8.z); + pos.x = this->actor.world.pos.x + (2.0f * velocity.x); + pos.z = this->actor.world.pos.z + (2.0f * velocity.z); - func_800B0EB0(play, &spA0, &spB8, &spAC, &D_808A770C, &D_808A7710, 100, 40, rand); + func_800B0EB0(play, &pos, &velocity, &accel, &sPrimColor, &sEnvColor, 100, 40, rand); } - spA0.x = this->actor.world.pos.x; - spA0.z = this->actor.world.pos.z; - spA0.y = this->actor.floorHeight; - EffectSsBlast_SpawnWhiteCustomScale(play, &spA0, &gZeroVec3f, &gZeroVec3f, 100, 220, 8); + pos.x = this->actor.world.pos.x; + pos.z = this->actor.world.pos.z; + pos.y = this->actor.floorHeight; + EffectSsBlast_SpawnWhiteCustomScale(play, &pos, &gZeroVec3f, &gZeroVec3f, 100, 220, 8); } void func_808A52A8(EnSt* this, PlayState* play) { - static Color_RGBA8 D_808A7714 = { 170, 130, 90, 255 }; - static Color_RGBA8 D_808A7718 = { 100, 60, 20, 0 }; + static Color_RGBA8 sPrimColor = { 170, 130, 90, 255 }; + static Color_RGBA8 sEnvColor = { 100, 60, 20, 0 }; s32 pad; - Vec3f spB8; - Vec3f spAC; - Vec3f spA0; + Vec3f velocity; + Vec3f accel; + Vec3f pos; Vec3f sp94; s32 i; s16 temp_s0 = (Rand_ZeroOne() - 0.5f) * 0x10000; s32 rand; - spA0.y = this->actor.floorHeight; + pos.y = this->actor.floorHeight; for (i = 0; i < 8; i++, temp_s0 += 0x1FFE) { rand = (Rand_ZeroOne() * 4.0f) + 8.0f; @@ -224,17 +236,17 @@ void func_808A52A8(EnSt* this, PlayState* play) { sp94.y = (Rand_ZeroOne() * 0.2f) + 0.1f; sp94.z = Rand_ZeroOne() + 1.0f; - Lib_Vec3f_TranslateAndRotateY(&gZeroVec3f, temp_s0, &sp94, &spAC); + Lib_Vec3f_TranslateAndRotateY(&gZeroVec3f, temp_s0, &sp94, &accel); sp94.x = 0.0f; sp94.y = 1.0f; sp94.z = 4.0f; - Lib_Vec3f_TranslateAndRotateY(&gZeroVec3f, temp_s0, &sp94, &spB8); + Lib_Vec3f_TranslateAndRotateY(&gZeroVec3f, temp_s0, &sp94, &velocity); - spA0.x = this->actor.world.pos.x + (2.0f * spB8.x); - spA0.z = this->actor.world.pos.z + (2.0f * spB8.z); - func_800B0EB0(play, &spA0, &spB8, &spAC, &D_808A7714, &D_808A7718, 100, 40, rand); + pos.x = this->actor.world.pos.x + (2.0f * velocity.x); + pos.z = this->actor.world.pos.z + (2.0f * velocity.z); + func_800B0EB0(play, &pos, &velocity, &accel, &sPrimColor, &sEnvColor, 100, 40, rand); } } @@ -450,7 +462,7 @@ s32 func_808A6064(EnSt* this) { } void func_808A60E0(EnSt* this) { - s32 animIndex = (this->unk_2C8 > 0.0f) ? 2 : 6; + s32 animIndex = (this->unk_2C8 > 0.0f) ? ENST_ANIM_2 : ENST_ANIM_6; f32 sp20 = (this->unk_2C8 > 0.0f) ? 4.0f : 9.0f; f32 sp1C; u16 sfxId = (this->unk_2C8 < 0.0f) ? NA_SE_EN_STALTU_DOWN : NA_SE_EN_STALTU_UP; @@ -510,7 +522,7 @@ void func_808A6220(EnSt* this, PlayState* play) { } void func_808A63E8(EnSt* this) { - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 3); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, ENST_ANIM_3); this->unk_2C8 = 1.0f; func_808A5D7C(this); this->unk_30C = 0; @@ -523,7 +535,7 @@ void func_808A63E8(EnSt* this) { void func_808A6468(EnSt* this, PlayState* play) { func_808A5050(this, play); - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 4); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, ENST_ANIM_4); this->unk_18C |= (0x8 | 0x4); this->unk_18C &= ~(0x10 | 0x2); this->unk_2C8 = -1.0f; @@ -538,7 +550,7 @@ void func_808A6468(EnSt* this, PlayState* play) { } void func_808A650C(EnSt* this) { - s32 animIndex = (this->unk_2C8 > 0.0f) ? 2 : 6; + s32 animIndex = (this->unk_2C8 > 0.0f) ? ENST_ANIM_2 : ENST_ANIM_6; SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, animIndex); this->unk_2CC = 0.0f; @@ -610,7 +622,7 @@ s32 func_808A6580(EnSt* this, PlayState* play) { this->unk_312 = 0; Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 200, COLORFILTER_BUFFLAG_OPA, this->unk_314); - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 1); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, ENST_ANIM_1); this->unk_18C |= 8; this->actionFunc = func_808A6D84; this->unk_2C8 = -1.0f; @@ -651,7 +663,7 @@ s32 func_808A6580(EnSt* this, PlayState* play) { } if (this->drawDmgEffType != ACTOR_DRAW_DMGEFF_FROZEN_NO_SFX) { - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 7); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, ENST_ANIM_7); this->unk_2CC = 0.0f; this->unk_2D4 = 0.0f; this->actor.gravity = -1.0f; @@ -695,8 +707,9 @@ void func_808A6A78(EnSt* this, PlayState* play) { if (Object_IsLoaded(&play->objectCtx, this->objectSlot)) { ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 8.0f); - SkelAnime_Init(play, &this->skelAnime, &object_st_Skel_005298, NULL, this->jointTable, this->morphTable, 30); - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 0); + SkelAnime_Init(play, &this->skelAnime, &object_st_Skel_005298, NULL, this->jointTable, this->morphTable, + OBJECT_ST_LIMB_MAX); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, ENST_ANIM_0); Collider_InitAndSetCylinder(play, &this->collider1, &this->actor, &sCylinderInit1); Collider_InitAndSetCylinder(play, &this->collider2, &this->actor, &sCylinderInit2); @@ -727,7 +740,7 @@ void func_808A6C04(EnSt* this, PlayState* play) { Actor_MoveWithGravity(&this->actor); if ((this->unk_18C & 8) && Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 3); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, ENST_ANIM_3); this->unk_18C &= ~8; } else if ((this->unk_310 == 0) && func_808A5F28(this, play) && !func_808A6064(this)) { func_808A650C(this); @@ -769,7 +782,7 @@ void func_808A6E24(EnSt* this, PlayState* play) { } if (bodyPartsCount == ENST_BODYPART_MAX) { - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 7); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, ENST_ANIM_7); this->drawDmgEffType = ACTOR_DRAW_DMGEFF_BLUE_FIRE; this->unk_2CC = 0.0f; this->unk_2D4 = 0.0f; @@ -909,7 +922,7 @@ s32 EnSt_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* po EnSt* this = THIS; Color_RGB8 sp20; - if (limbIndex == 4) { + if (limbIndex == OBJECT_ST_LIMB_04) { func_808A5DCC(this, &sp20); gDPPipeSync((*gfx)++); diff --git a/src/overlays/actors/ovl_En_St/z_en_st.h b/src/overlays/actors/ovl_En_St/z_en_st.h index dd40a34501..1c8b4059f3 100644 --- a/src/overlays/actors/ovl_En_St/z_en_st.h +++ b/src/overlays/actors/ovl_En_St/z_en_st.h @@ -2,6 +2,7 @@ #define Z_EN_ST_H #include "global.h" +#include "objects/object_st/object_st.h" struct EnSt; @@ -59,8 +60,8 @@ typedef struct EnSt { /* 0x34C */ f32 unk_34C; /* 0x350 */ UNK_TYPE1 unk_350[0x8]; /* 0x358 */ Vec3f bodyPartsPos[ENST_BODYPART_MAX]; - /* 0x3E8 */ Vec3s jointTable[30]; - /* 0x49C */ Vec3s morphTable[30]; + /* 0x3E8 */ Vec3s jointTable[OBJECT_ST_LIMB_MAX]; + /* 0x49C */ Vec3s morphTable[OBJECT_ST_LIMB_MAX]; } EnSt; // size = 0x550 #endif // Z_EN_ST_H 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 f159accea9..21697d0925 100644 --- a/src/overlays/actors/ovl_En_Sth/z_en_sth.c +++ b/src/overlays/actors/ovl_En_Sth/z_en_sth.c @@ -61,21 +61,28 @@ static ColliderCylinderInit sCylinderInit = { { 30, 40, 0, { 0, 0, 0 } }, }; -typedef enum { - /* 0 */ STH_ANIM_SIGNALLING, // default, waving arms at you from telescope, OOT: cured happy animation - /* 1 */ STH_ANIM_BENDING_DOWN, // default anim of cured spider house, but never seen before wait overrides it - /* 2 */ STH_ANIM_TALK, - /* 3 */ STH_ANIM_WAIT, - /* 4 */ STH_ANIM_LOOK_UP, // South Clock Town, looking at moon - /* 5 */ STH_ANIM_LOOK_AROUND, // checking out Oceanside Spider House - /* 6 */ STH_ANIM_PLEAD, // wants to buy Oceanside Spider House - /* 7 */ STH_ANIM_PANIC, // after buying Oceanside Spider House, can be found at bottom of slide, - /* 8 */ STH_ANIM_START // set in init, not an actual index to the array +typedef enum EnSthAnimation { + /* -1 */ STH_ANIM_NONE = -1, + /* 0 */ STH_ANIM_SIGNALLING, // default, waving arms at you from telescope, OOT: cured happy animation + /* 1 */ STH_ANIM_BENDING_DOWN, // default anim of cured spider house, but never seen before wait overrides it + /* 2 */ STH_ANIM_TALK, + /* 3 */ STH_ANIM_WAIT, + /* 4 */ STH_ANIM_LOOK_UP, // South Clock Town, looking at moon + /* 5 */ STH_ANIM_LOOK_AROUND, // checking out Oceanside Spider House + /* 6 */ STH_ANIM_PLEAD, // wants to buy Oceanside Spider House + /* 7 */ STH_ANIM_PANIC, // after buying Oceanside Spider House, can be found at bottom of slide, + /* 8 */ STH_ANIM_MAX // set in init, not an actual index to the array } EnSthAnimation; -static AnimationHeader* sAnimationInfo[] = { - &gEnSthSignalAnim, &gEnSthBendDownAnim, &gEnSthTalkWithHandUpAnim, &gEnSthWaitAnim, - &gEnSthLookUpAnim, &gEnSthLookAroundAnim, &gEnSthPleadAnim, &gEnSthPanicAnim, +static AnimationHeader* sAnimations[STH_ANIM_MAX] = { + &gEnSthSignalAnim, // STH_ANIM_SIGNALLING + &gEnSthBendDownAnim, // STH_ANIM_BENDING_DOWN + &gEnSthTalkWithHandUpAnim, // STH_ANIM_TALK + &gEnSthWaitAnim, // STH_ANIM_WAIT + &gEnSthLookUpAnim, // STH_ANIM_LOOK_UP + &gEnSthLookAroundAnim, // STH_ANIM_LOOK_AROUND + &gEnSthPleadAnim, // STH_ANIM_PLEAD + &gEnSthPanicAnim, // STH_ANIM_PANIC }; // three slightly different variants of "Only a little time left, oh goddess please save me" @@ -125,7 +132,7 @@ void EnSth_Init(Actor* thisx, PlayState* play) { ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 36.0f); this->sthFlags = 0; // clear - this->animIndex = STH_ANIM_START; + this->animIndex = STH_ANIM_MAX; this->actor.terminalVelocity = -9.0f; this->actor.gravity = -1.0f; @@ -212,9 +219,9 @@ s32 EnSth_CanSpeakToPlayer(EnSth* this, PlayState* play) { } void EnSth_ChangeAnim(EnSth* this, s16 animIndex) { - if ((animIndex >= 0) && (animIndex < ARRAY_COUNT(sAnimationInfo)) && (animIndex != this->animIndex)) { - Animation_Change(&this->skelAnime, sAnimationInfo[animIndex], 1.0f, 0.0f, - Animation_GetLastFrame(sAnimationInfo[animIndex]), ANIMMODE_LOOP, -5.0f); + if ((animIndex > STH_ANIM_NONE) && (animIndex < STH_ANIM_MAX) && (animIndex != this->animIndex)) { + Animation_Change(&this->skelAnime, sAnimations[animIndex], 1.0f, 0.0f, + Animation_GetLastFrame(sAnimations[animIndex]), ANIMMODE_LOOP, -5.0f); this->animIndex = animIndex; } } diff --git a/src/overlays/actors/ovl_En_Stone_heishi/z_en_stone_heishi.c b/src/overlays/actors/ovl_En_Stone_heishi/z_en_stone_heishi.c index a7ab300d6f..8a60070f38 100644 --- a/src/overlays/actors/ovl_En_Stone_heishi/z_en_stone_heishi.c +++ b/src/overlays/actors/ovl_En_Stone_heishi/z_en_stone_heishi.c @@ -61,13 +61,35 @@ static ColliderCylinderInit sCylinderInit = { static u16 sEnStoneHeishiTextIds[] = { 0x1473, 0x1474, 0x1475, 0x1476, 0x1477, 0x1478, 0x1479, 0x147A, 0x1472 }; -static AnimationHeader* sAnimations[] = { - &gSoldierStandHandOnHipAnim, &gSoldierDrinkAnim, &gSoldierCheerWithSpearAnim, &gSoldierWaveAnim, - &gSoldierSitAndReachAnim, &gSoldierDrinkAnim, &gSoldierStandUpAnim, +typedef enum EnStoneHeishiAnimation { + /* 0 */ EN_STONE_HEISHI_ANIM_STAND_HAND_ON_HIP, + /* 1 */ EN_STONE_HEISHI_ANIM_DRINK_1, + /* 2 */ EN_STONE_HEISHI_ANIM_CHEER_WITH_SPEAR, + /* 3 */ EN_STONE_HEISHI_ANIM_WAVE, + /* 4 */ EN_STONE_HEISHI_ANIM_SIT_AND_REACH, + /* 5 */ EN_STONE_HEISHI_ANIM_DRINK_2, + /* 6 */ EN_STONE_HEISHI_ANIM_STAND_UP, + /* 7 */ EN_STONE_HEISHI_ANIM_MAX +} EnStoneHeishiAnimation; + +static AnimationHeader* sAnimations[EN_STONE_HEISHI_ANIM_MAX] = { + &gSoldierStandHandOnHipAnim, // EN_STONE_HEISHI_ANIM_STAND_HAND_ON_HIP + &gSoldierDrinkAnim, // EN_STONE_HEISHI_ANIM_DRINK_1 + &gSoldierCheerWithSpearAnim, // EN_STONE_HEISHI_ANIM_CHEER_WITH_SPEAR + &gSoldierWaveAnim, // EN_STONE_HEISHI_ANIM_WAVE + &gSoldierSitAndReachAnim, // EN_STONE_HEISHI_ANIM_SIT_AND_REACH + &gSoldierDrinkAnim, // EN_STONE_HEISHI_ANIM_DRINK_2 + &gSoldierStandUpAnim, // EN_STONE_HEISHI_ANIM_STAND_UP }; -static u8 sAnimationModes[] = { - ANIMMODE_LOOP, ANIMMODE_ONCE, ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_ONCE, +static u8 sAnimationModes[EN_STONE_HEISHI_ANIM_MAX] = { + ANIMMODE_LOOP, // EN_STONE_HEISHI_ANIM_STAND_HAND_ON_HIP + ANIMMODE_ONCE, // EN_STONE_HEISHI_ANIM_DRINK_1 + ANIMMODE_LOOP, // EN_STONE_HEISHI_ANIM_CHEER_WITH_SPEAR + ANIMMODE_LOOP, // EN_STONE_HEISHI_ANIM_WAVE + ANIMMODE_LOOP, // EN_STONE_HEISHI_ANIM_SIT_AND_REACH + ANIMMODE_LOOP, // EN_STONE_HEISHI_ANIM_DRINK_2 + ANIMMODE_ONCE, // EN_STONE_HEISHI_ANIM_STAND_UP }; typedef enum { @@ -93,16 +115,6 @@ typedef enum { /* 3 */ EN_STONE_BOTTLE_BLUE_POTION } EnStoneHeishiBottle; -typedef enum { - /* 0 */ EN_STONE_HEISHI_ANIM_STAND_HAND_ON_HIP, - /* 1 */ EN_STONE_HEISHI_ANIM_DRINK_1, - /* 2 */ EN_STONE_HEISHI_ANIM_CHEER_WITH_SPEAR, - /* 3 */ EN_STONE_HEISHI_ANIM_WAVE, - /* 4 */ EN_STONE_HEISHI_ANIM_SIT_AND_REACH, - /* 5 */ EN_STONE_HEISHI_ANIM_DRINK_2, - /* 6 */ EN_STONE_HEISHI_ANIM_STAND_UP -} EnStoneHeishiAnimation; - void EnStoneheishi_Init(Actor* thisx, PlayState* play) { EnStoneheishi* this = THIS; @@ -133,14 +145,14 @@ void EnStoneheishi_ChangeAnim(EnStoneheishi* this, s32 animIndex) { f32 startFrame = 0.0f; this->animIndex = animIndex; - this->endFrame = Animation_GetLastFrame(sAnimations[animIndex]); + this->animEndFrame = Animation_GetLastFrame(sAnimations[animIndex]); // This will never pass since this animation index is never used. if (animIndex == EN_STONE_HEISHI_ANIM_DRINK_2) { startFrame = 55.0f; } - Animation_Change(&this->skelAnime, sAnimations[this->animIndex], 1.0f, startFrame, this->endFrame, + Animation_Change(&this->skelAnime, sAnimations[this->animIndex], 1.0f, startFrame, this->animEndFrame, sAnimationModes[this->animIndex], -10.0f); } @@ -208,7 +220,7 @@ void func_80BC9660(EnStoneheishi* this) { } void func_80BC9680(EnStoneheishi* this, PlayState* play) { - f32 currentFrame = this->skelAnime.curFrame; + f32 curFrame = this->skelAnime.curFrame; if ((this->textIdIndex == 0) || (this->textIdIndex == 2)) { if (this->animIndex != EN_STONE_HEISHI_ANIM_SIT_AND_REACH) { @@ -223,7 +235,7 @@ void func_80BC9680(EnStoneheishi* this, PlayState* play) { EnStoneheishi_ChangeAnim(this, EN_STONE_HEISHI_ANIM_WAVE); } return; - } else if (!this->textIdSet && (this->endFrame <= currentFrame)) { + } else if (!this->textIdSet && (curFrame >= this->animEndFrame)) { Player* player = GET_PLAYER(play); this->textIdSet = true; @@ -305,7 +317,7 @@ void EnStoneheishi_SetupDrinkBottleProcess(EnStoneheishi* this) { } void EnStoneheishi_DrinkBottleProcess(EnStoneheishi* this, PlayState* play) { - f32 currentFrame = this->skelAnime.curFrame; + f32 curFrame = this->skelAnime.curFrame; Player* player = GET_PLAYER(play); SkelAnime_Update(&this->skelAnime); @@ -318,8 +330,6 @@ void EnStoneheishi_DrinkBottleProcess(EnStoneheishi* this, PlayState* play) { player->actor.textId = sEnStoneHeishiTextIds[this->textIdIndex]; this->drinkBottleState++; } - - default: break; case EN_STONE_DRINK_BOTTLE_DRINKING: @@ -355,7 +365,7 @@ void EnStoneheishi_DrinkBottleProcess(EnStoneheishi* this, PlayState* play) { break; case EN_STONE_DRINK_BOTTLE_STAND_UP: - if (this->endFrame <= currentFrame) { + if (curFrame >= this->animEndFrame) { Audio_PlayFanfare(NA_BGM_GET_ITEM | 0x900); this->bottleDisplay = EN_STONE_BOTTLE_NONE; EnStoneheishi_ChangeAnim(this, EN_STONE_HEISHI_ANIM_STAND_UP); @@ -364,7 +374,7 @@ void EnStoneheishi_DrinkBottleProcess(EnStoneheishi* this, PlayState* play) { break; case EN_STONE_DRINK_BOTTLE_STANDING: - if (this->endFrame <= currentFrame) { + if (curFrame >= this->animEndFrame) { this->textIdIndex = 5; Message_ContinueTextbox(play, sEnStoneHeishiTextIds[this->textIdIndex]); player->actor.textId = sEnStoneHeishiTextIds[this->textIdIndex]; @@ -373,6 +383,9 @@ void EnStoneheishi_DrinkBottleProcess(EnStoneheishi* this, PlayState* play) { this->actionFunc = func_80BC9680; } break; + + default: + break; } } diff --git a/src/overlays/actors/ovl_En_Stone_heishi/z_en_stone_heishi.h b/src/overlays/actors/ovl_En_Stone_heishi/z_en_stone_heishi.h index 715fc71394..c7331cf760 100644 --- a/src/overlays/actors/ovl_En_Stone_heishi/z_en_stone_heishi.h +++ b/src/overlays/actors/ovl_En_Stone_heishi/z_en_stone_heishi.h @@ -19,7 +19,7 @@ typedef struct EnStoneheishi { /* 0x264 */ s32 animIndex; /* 0x268 */ s16 timer; /* 0x26A */ s16 drinkBottleState; - /* 0x26C */ f32 endFrame; + /* 0x26C */ f32 animEndFrame; /* 0x270 */ s16 action; /* 0x272 */ s16 textIdIndex; /* 0x274 */ s16 textIdSet; diff --git a/src/overlays/actors/ovl_En_Stop_heishi/z_en_stop_heishi.c b/src/overlays/actors/ovl_En_Stop_heishi/z_en_stop_heishi.c index 66d3c5071b..67a9f817b2 100644 --- a/src/overlays/actors/ovl_En_Stop_heishi/z_en_stop_heishi.c +++ b/src/overlays/actors/ovl_En_Stop_heishi/z_en_stop_heishi.c @@ -22,18 +22,6 @@ void func_80AE7E9C(EnStopheishi* this); void func_80AE854C(EnStopheishi* this, PlayState* play); void func_80AE795C(EnStopheishi* this, PlayState* play); -typedef enum { - /* 0 */ SOLDIER_ANIM_LOOK_DOWN, - /* 1 */ SOLDIER_ANIM_COME_UP_HERE, - /* 2 */ SOLDIER_ANIM_STAND_HAND_ON_HIP, - /* 3 */ SOLDIER_ANIM_STAND_LOOK_DOWN, - /* 4 */ SOLDIER_ANIM_4, - /* 5 */ SOLDIER_ANIM_5, - /* 6 */ SOLDIER_ANIM_6, - /* 7 */ SOLDIER_ANIM_STAND_HAND_ON_CHEST, - /* 8 */ SOLDIER_ANIM_MAX -} SoldierAnimation; - ActorInit En_Stop_heishi_InitVars = { /**/ ACTOR_EN_STOP_HEISHI, /**/ ACTORCAT_NPC, @@ -84,6 +72,18 @@ static u16 sThirdDayLeaveMessages[] = { 0x053E, 0x0000, 0x053F, 0x0000, 0x053F, 0x0000, 0x053F, 0x0000, 0x053F, 0x0000, }; +typedef enum { + /* 0 */ SOLDIER_ANIM_LOOK_DOWN, + /* 1 */ SOLDIER_ANIM_COME_UP_HERE, + /* 2 */ SOLDIER_ANIM_STAND_HAND_ON_HIP, + /* 3 */ SOLDIER_ANIM_STAND_LOOK_DOWN, + /* 4 */ SOLDIER_ANIM_4, + /* 5 */ SOLDIER_ANIM_5, + /* 6 */ SOLDIER_ANIM_6, + /* 7 */ SOLDIER_ANIM_STAND_HAND_ON_CHEST, + /* 8 */ SOLDIER_ANIM_MAX +} SoldierAnimation; + static AnimationHeader* sAnimations[SOLDIER_ANIM_MAX] = { &gSoldierLookDownAnim, // SOLDIER_ANIM_LOOK_DOWN &gSoldierComeUpHereAnim, // SOLDIER_ANIM_COME_UP_HERE @@ -129,21 +129,20 @@ void EnStopheishi_Destroy(Actor* thisx, PlayState* play) { } void EnStopHeishi_ChangeAnim(EnStopheishi* this, s32 animIndex) { - s32 mode; + s32 animMode; f32 morphFrames; - this->currentAnim = animIndex; - this->currentAnimFrameCount = Animation_GetLastFrame(sAnimations[animIndex]); - mode = ANIMMODE_ONCE; + this->animIndex = animIndex; + this->animEndFrame = Animation_GetLastFrame(sAnimations[animIndex]); + animMode = ANIMMODE_ONCE; morphFrames = -10.0f; if ((animIndex >= SOLDIER_ANIM_STAND_HAND_ON_HIP) && (animIndex != SOLDIER_ANIM_4)) { - mode = ANIMMODE_LOOP; + animMode = ANIMMODE_LOOP; } if (animIndex == SOLDIER_ANIM_5) { morphFrames = 0.0f; } - Animation_Change(&this->skelAnime, sAnimations[animIndex], 1.0f, 0.0f, this->currentAnimFrameCount, mode, - morphFrames); + Animation_Change(&this->skelAnime, sAnimations[animIndex], 1.0f, 0.0f, this->animEndFrame, animMode, morphFrames); } void EnStopheishi_UpdateHeadNormal(EnStopheishi* this, PlayState* play) { @@ -218,8 +217,8 @@ void func_80AE77D4(EnStopheishi* this) { this->unk_264 = 1; } } - if ((this->currentAnim != SOLDIER_ANIM_STAND_HAND_ON_HIP) && (this->currentAnim != SOLDIER_ANIM_STAND_LOOK_DOWN) && - (this->currentAnim != SOLDIER_ANIM_STAND_HAND_ON_CHEST) && (this->unk_264 != 0)) { + if ((this->animIndex != SOLDIER_ANIM_STAND_HAND_ON_HIP) && (this->animIndex != SOLDIER_ANIM_STAND_LOOK_DOWN) && + (this->animIndex != SOLDIER_ANIM_STAND_HAND_ON_CHEST) && (this->unk_264 != 0)) { this->skelAnime.playSpeed = 1.0f; EnStopHeishi_ChangeAnim(this, SOLDIER_ANIM_STAND_HAND_ON_HIP); if ((gSaveContext.save.day != 3) && gSaveContext.save.isNight) { @@ -305,7 +304,7 @@ void func_80AE795C(EnStopheishi* this, PlayState* play) { break; case 2: - if (this->currentAnimFrameCount <= curFrame) { + if (this->animEndFrame <= curFrame) { EnStopHeishi_ChangeAnim(this, SOLDIER_ANIM_5); this->unk_274 = 3; } @@ -364,7 +363,7 @@ void func_80AE7F34(EnStopheishi* this, PlayState* play) { f32 zDiff; SkelAnime_Update(&this->skelAnime); - if ((this->currentAnim == SOLDIER_ANIM_5) && ((TRUNCF_BINANG(this->skelAnime.curFrame) % 2) != 0)) { + if ((this->animIndex == SOLDIER_ANIM_5) && ((TRUNCF_BINANG(this->skelAnime.curFrame) % 2) != 0)) { Actor_PlaySfx(&this->actor, NA_SE_EV_SOLDIER_WALK); } if (gSaveContext.save.day != 3) { @@ -408,8 +407,8 @@ void func_80AE7F34(EnStopheishi* this, PlayState* play) { } if (((phi_a2 == 1) || (phi_a2 == 2) || (phi_a2 == 3)) && - (((this->currentAnim == SOLDIER_ANIM_4)) || (this->currentAnim == SOLDIER_ANIM_5) || - (this->currentAnim == SOLDIER_ANIM_6))) { + (((this->animIndex == SOLDIER_ANIM_4)) || (this->animIndex == SOLDIER_ANIM_5) || + (this->animIndex == SOLDIER_ANIM_6))) { EnStopHeishi_ChangeAnim(this, SOLDIER_ANIM_STAND_HAND_ON_HIP); if ((gSaveContext.save.day != 3) && gSaveContext.save.isNight) { EnStopHeishi_ChangeAnim(this, SOLDIER_ANIM_STAND_LOOK_DOWN); @@ -506,7 +505,7 @@ void func_80AE7F34(EnStopheishi* this, PlayState* play) { void func_80AE854C(EnStopheishi* this, PlayState* play) { if (((this->unk_265 != 0) || CHECK_WEEKEVENTREG(WEEKEVENTREG_12_20)) && - (this->currentAnim != SOLDIER_ANIM_STAND_HAND_ON_HIP)) { + (this->animIndex != SOLDIER_ANIM_STAND_HAND_ON_HIP)) { EnStopHeishi_ChangeAnim(this, SOLDIER_ANIM_STAND_HAND_ON_HIP); } this->pitchToPlayer = 0; diff --git a/src/overlays/actors/ovl_En_Stop_heishi/z_en_stop_heishi.h b/src/overlays/actors/ovl_En_Stop_heishi/z_en_stop_heishi.h index 34cb9bf564..b27d186387 100644 --- a/src/overlays/actors/ovl_En_Stop_heishi/z_en_stop_heishi.h +++ b/src/overlays/actors/ovl_En_Stop_heishi/z_en_stop_heishi.h @@ -28,8 +28,8 @@ typedef struct EnStopheishi { /* 0x264 */ u8 unk_264; // Locking value at `0` prevents leaving the guard pose, however locking to 1 doesn't prevent guarding. /* 0x265 */ u8 unk_265; /* 0x266 */ s16 unk_266; - /* 0x268 */ s32 currentAnim; - /* 0x26C */ f32 currentAnimFrameCount; + /* 0x268 */ s32 animIndex; + /* 0x26C */ f32 animEndFrame; /* 0x270 */ s16 timer; /* 0x272 */ s16 headTurnTimer1; /* 0x274 */ s16 unk_274; diff --git a/src/overlays/actors/ovl_En_Suttari/z_en_suttari.c b/src/overlays/actors/ovl_En_Suttari/z_en_suttari.c index ddccbef647..6f639eccef 100644 --- a/src/overlays/actors/ovl_En_Suttari/z_en_suttari.c +++ b/src/overlays/actors/ovl_En_Suttari/z_en_suttari.c @@ -50,16 +50,30 @@ ActorInit En_Suttari_InitVars = { /**/ EnSuttari_Draw, }; -static AnimationInfo sAnimationInfo[] = { - { &object_boj_Anim_00071C, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f }, - { &object_boj_Anim_0128F4, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f }, - { &object_boj_Anim_011F84, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f }, - { &object_boj_Anim_012E84, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -6.0f }, - { &object_boj_Anim_01139C, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f }, - { &object_boj_Anim_00071C, 2.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f }, - { &object_boj_Anim_011F84, 2.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f }, - { &object_boj_Anim_011C38, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, 0.0f }, - { &object_boj_Anim_010BDC, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f }, +typedef enum SuttariAnimation { + /* -1 */ SUTTARI_ANIM_NONE = -1, + /* 0 */ SUTTARI_ANIM_0, + /* 1 */ SUTTARI_ANIM_1, + /* 2 */ SUTTARI_ANIM_2, + /* 3 */ SUTTARI_ANIM_3, + /* 4 */ SUTTARI_ANIM_4, + /* 5 */ SUTTARI_ANIM_5, + /* 6 */ SUTTARI_ANIM_6, + /* 7 */ SUTTARI_ANIM_7, + /* 8 */ SUTTARI_ANIM_8, + /* 9 */ SUTTARI_ANIM_MAX +} SuttariAnimation; + +static AnimationInfo sAnimationInfo[SUTTARI_ANIM_MAX] = { + { &object_boj_Anim_00071C, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f }, // SUTTARI_ANIM_0 + { &object_boj_Anim_0128F4, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f }, // SUTTARI_ANIM_1 + { &object_boj_Anim_011F84, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f }, // SUTTARI_ANIM_2 + { &object_boj_Anim_012E84, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -6.0f }, // SUTTARI_ANIM_3 + { &object_boj_Anim_01139C, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f }, // SUTTARI_ANIM_4 + { &object_boj_Anim_00071C, 2.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f }, // SUTTARI_ANIM_5 + { &object_boj_Anim_011F84, 2.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f }, // SUTTARI_ANIM_6 + { &object_boj_Anim_011C38, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, 0.0f }, // SUTTARI_ANIM_7 + { &object_boj_Anim_010BDC, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f }, // SUTTARI_ANIM_8 }; static ColliderCylinderInit sCylinderInit = { @@ -251,7 +265,7 @@ s32 func_80BAA904(EnSuttari* this, PlayState* play) { void func_80BAA9B4(EnSuttari* this) { s16 curFrame = this->skelAnime.curFrame; - s16 frameCount = Animation_GetLastFrame(sAnimationInfo[this->animIndex].animation); + s16 endFrame = Animation_GetLastFrame(sAnimationInfo[this->animIndex].animation); switch (this->textId) { case 0x1454: @@ -262,15 +276,15 @@ void func_80BAA9B4(EnSuttari* this) { case 0x1459: case 0x145A: case 0x145B: - if ((this->animIndex != 8) && (curFrame == frameCount)) { - this->animIndex = 8; + if ((this->animIndex != SUTTARI_ANIM_8) && (curFrame == endFrame)) { + this->animIndex = SUTTARI_ANIM_8; Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, this->animIndex); } break; default: - if ((this->animIndex != 1) && (curFrame == frameCount)) { - this->animIndex = 1; + if ((this->animIndex != SUTTARI_ANIM_1) && (curFrame == endFrame)) { + this->animIndex = SUTTARI_ANIM_1; Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, this->animIndex); } } @@ -279,7 +293,7 @@ void func_80BAA9B4(EnSuttari* this) { void func_80BAAA94(EnSuttari* this) { switch (this->textId) { case 0x29E5: - this->animIndex = 1; + this->animIndex = SUTTARI_ANIM_1; Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, this->animIndex); break; @@ -296,12 +310,12 @@ void func_80BAAA94(EnSuttari* this) { break; case 0x29EC: - this->animIndex = 7; + this->animIndex = SUTTARI_ANIM_7; Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, this->animIndex); break; case 0x29ED: - this->animIndex = 1; + this->animIndex = SUTTARI_ANIM_1; Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, this->animIndex); break; @@ -451,13 +465,13 @@ void func_80BAAB78(EnSuttari* this, PlayState* play) { void func_80BAAF1C(EnSuttari* this) { s16 curFrame = this->skelAnime.curFrame; - s16 frameCount = Animation_GetLastFrame(sAnimationInfo[this->animIndex].animation); + s16 endFrame = Animation_GetLastFrame(sAnimationInfo[this->animIndex].animation); - if (this->animIndex == 5) { - this->animIndex = 3; + if (this->animIndex == SUTTARI_ANIM_5) { + this->animIndex = SUTTARI_ANIM_3; Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, this->animIndex); - } else if ((this->animIndex == 3) && (curFrame == frameCount)) { - this->animIndex = 6; + } else if ((this->animIndex == SUTTARI_ANIM_3) && (curFrame == endFrame)) { + this->animIndex = SUTTARI_ANIM_6; Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, this->animIndex); this->flags1 &= ~0x100; } @@ -890,7 +904,7 @@ s32 func_80BAC220(EnSuttari* this, PlayState* play) { void func_80BAC2FC(EnSuttari* this, PlayState* play) { Player* player = GET_PLAYER(play); s16 curFrame = this->skelAnime.curFrame; - s16 frameCount = Animation_GetLastFrame(sAnimationInfo[this->animIndex].animation); + s16 endFrame = Animation_GetLastFrame(sAnimationInfo[this->animIndex].animation); switch (this->unk428) { case 12: @@ -900,8 +914,8 @@ void func_80BAC2FC(EnSuttari* this, PlayState* play) { break; case 15: - if ((this->animIndex == 1) && (curFrame == frameCount)) { - this->animIndex = 2; + if ((this->animIndex == SUTTARI_ANIM_1) && (curFrame == endFrame)) { + this->animIndex = SUTTARI_ANIM_2; Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, this->animIndex); } if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_83_04) && !(this->flags1 & 0x1000)) { @@ -936,8 +950,8 @@ void func_80BAC2FC(EnSuttari* this, PlayState* play) { this->flags1 |= 0x80; this->flags1 |= 0x20; this->enFsn->flags &= ~ENFSN_HAGGLE; - if (this->animIndex != 2) { - this->animIndex = 2; + if (this->animIndex != SUTTARI_ANIM_2) { + this->animIndex = SUTTARI_ANIM_2; Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, this->animIndex); } func_80BAC220(this, play); @@ -972,8 +986,8 @@ void func_80BAC2FC(EnSuttari* this, PlayState* play) { case 4: if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_RECOVERED_STOLEN_BOMB_BAG)) { - if ((this->animIndex == 2) || (this->animIndex == 1)) { - this->animIndex = 5; + if ((this->animIndex == SUTTARI_ANIM_2) || (this->animIndex == SUTTARI_ANIM_1)) { + this->animIndex = SUTTARI_ANIM_5; Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, this->animIndex); } this->flags1 |= 0x10; @@ -999,13 +1013,13 @@ void func_80BAC2FC(EnSuttari* this, PlayState* play) { void func_80BAC6E8(EnSuttari* this, PlayState* play) { ActorShape_Init(&this->actor.shape, 0.0f, NULL, 0.0f); SkelAnime_InitFlex(play, &this->skelAnime, &object_boj_Skel_00C240, &object_boj_Anim_00071C, this->jointTable, - this->morphTable, 16); + this->morphTable, OBJECT_BOJ_LIMB_MAX); this->actor.draw = EnSuttari_Draw; this->actor.flags |= ACTOR_FLAG_TARGETABLE; if (play->sceneId == SCENE_IKANA) { this->flags1 |= 1; if ((gSaveContext.save.day == 1) || (gSaveContext.save.day == 2)) { - this->animIndex = 2; + this->animIndex = SUTTARI_ANIM_2; Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, this->animIndex); this->flags1 |= 0x80; this->actionFunc = func_80BACA14; @@ -1014,7 +1028,7 @@ void func_80BAC6E8(EnSuttari* this, PlayState* play) { !CHECK_WEEKEVENTREG(WEEKEVENTREG_61_08) && !CHECK_WEEKEVENTREG(WEEKEVENTREG_RECOVERED_STOLEN_BOMB_BAG) && CHECK_WEEKEVENTREG(WEEKEVENTREG_51_08)) { - this->animIndex = 2; + this->animIndex = SUTTARI_ANIM_2; Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, this->animIndex); this->actionFunc = func_80BACEE0; return; @@ -1031,7 +1045,7 @@ void func_80BAC6E8(EnSuttari* this, PlayState* play) { this->csIdList[1] = CutsceneManager_GetAdditionalCsId(this->csIdList[0]); this->flags1 |= 0x80; this->flags1 |= 8; - this->animIndex = 1; + this->animIndex = SUTTARI_ANIM_1; Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, this->animIndex); this->actionFunc = func_80BAD004; return; @@ -1040,7 +1054,7 @@ void func_80BAC6E8(EnSuttari* this, PlayState* play) { Actor_Kill(&this->actor); return; } - this->animIndex = 0; + this->animIndex = SUTTARI_ANIM_0; Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, this->animIndex); this->flags1 |= 2; this->actionFunc = func_80BAD5F8; @@ -1050,7 +1064,7 @@ void func_80BAC6E8(EnSuttari* this, PlayState* play) { Actor_Kill(&this->actor); return; } - this->animIndex = 0; + this->animIndex = SUTTARI_ANIM_0; Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, this->animIndex); this->csIdList[0] = this->actor.csId; this->csIdList[1] = CutsceneManager_GetAdditionalCsId(this->csIdList[0]); @@ -1069,8 +1083,8 @@ void func_80BAC6E8(EnSuttari* this, PlayState* play) { void func_80BACA14(EnSuttari* this, PlayState* play) { Player* player = GET_PLAYER(play); - if ((this->animIndex == 1) || (this->animIndex == 8)) { - this->animIndex = 2; + if ((this->animIndex == SUTTARI_ANIM_1) || (this->animIndex == SUTTARI_ANIM_8)) { + this->animIndex = SUTTARI_ANIM_2; Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, this->animIndex); } func_80BABA90(this, 0, 0); @@ -1307,10 +1321,10 @@ void func_80BAD380(EnSuttari* this, PlayState* play) { void func_80BAD5F8(EnSuttari* this, PlayState* play) { ScheduleOutput scheduleOutput; s16 curFrame = this->skelAnime.curFrame; - s16 frameCount = Animation_GetLastFrame(sAnimationInfo[this->animIndex].animation); + s16 endFrame = Animation_GetLastFrame(sAnimationInfo[this->animIndex].animation); - if ((curFrame == frameCount) && (this->animIndex == 0) && (this->flags1 & 0x20)) { - this->animIndex = 2; + if ((curFrame == endFrame) && (this->animIndex == SUTTARI_ANIM_0) && (this->flags1 & 0x20)) { + this->animIndex = SUTTARI_ANIM_2; Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, this->animIndex); } this->timePathTimeSpeed = R_TIME_SPEED + ((void)0, gSaveContext.save.timeSpeedOffset); @@ -1342,13 +1356,13 @@ void func_80BAD5F8(EnSuttari* this, PlayState* play) { void func_80BAD7F8(EnSuttari* this, PlayState* play) { ScheduleOutput scheduleOutput; s16 curFrame = this->skelAnime.curFrame; - s16 frameCount = Animation_GetLastFrame(sAnimationInfo[this->animIndex].animation); + s16 endFrame = Animation_GetLastFrame(sAnimationInfo[this->animIndex].animation); if (this->enFsn == NULL) { this->enFsn = (EnFsn*)EnSuttari_GetActorById(play, ACTOR_EN_FSN); } else { - if ((this->flags1 & 0x2000) && (this->animIndex == 1) && (curFrame == frameCount)) { - this->animIndex = 2; + if ((this->flags1 & 0x2000) && (this->animIndex == SUTTARI_ANIM_1) && (curFrame == endFrame)) { + this->animIndex = SUTTARI_ANIM_2; Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, this->animIndex); } this->timePathTimeSpeed = R_TIME_SPEED + ((void)0, gSaveContext.save.timeSpeedOffset); @@ -1391,13 +1405,13 @@ void func_80BADA08(EnSuttari* this, PlayState* play) { void func_80BADA9C(EnSuttari* this, PlayState* play) { u8 talkstate = Message_GetState(&play->msgCtx); s16 curFrame = this->skelAnime.curFrame; - s16 frameCount = Animation_GetLastFrame(sAnimationInfo[this->animIndex].animation); + s16 endFrame = Animation_GetLastFrame(sAnimationInfo[this->animIndex].animation); if (this->flags1 & 1) { this->unk3F2 = this->headRot.y; func_80BAA9B4(this); - } else if ((this->animIndex == 7) && (curFrame == frameCount)) { - this->animIndex = 1; + } else if ((this->animIndex == SUTTARI_ANIM_7) && (curFrame == endFrame)) { + this->animIndex = SUTTARI_ANIM_1; Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, this->animIndex); } if (talkstate == TEXT_STATE_EVENT) { @@ -1548,11 +1562,11 @@ void EnSuttari_Update(Actor* thisx, PlayState* play) { EnSuttari_AdvanceTime(); } if (this->unk428 != 0) { - if ((this->animIndex == 2) || (this->animIndex == 6)) { + if ((this->animIndex == SUTTARI_ANIM_2) || (this->animIndex == SUTTARI_ANIM_6)) { if (Animation_OnFrame(&this->skelAnime, 8.0f) || Animation_OnFrame(&this->skelAnime, 16.0f)) { Actor_PlaySfx(&this->actor, NA_SE_EV_PAMERA_WALK); } - } else if ((this->animIndex == 0) || (this->animIndex == 5)) { + } else if ((this->animIndex == SUTTARI_ANIM_0) || (this->animIndex == SUTTARI_ANIM_5)) { if (Animation_OnFrame(&this->skelAnime, 8.0f) || Animation_OnFrame(&this->skelAnime, 17.0f)) { Actor_PlaySfx(&this->actor, NA_SE_EV_PAMERA_WALK); } @@ -1563,7 +1577,7 @@ void EnSuttari_Update(Actor* thisx, PlayState* play) { s32 EnSuttari_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) { EnSuttari* this = THIS; - if (limbIndex == 15) { + if (limbIndex == OBJECT_BOJ_LIMB_0F) { *dList = object_boj_DL_00AF90; if (!(this->flags1 & 4)) { Matrix_Translate(1500.0f, 0.0f, 0.0f, MTXMODE_APPLY); @@ -1572,11 +1586,11 @@ s32 EnSuttari_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3 Matrix_Translate(-1500.0f, 0.0f, 0.0f, MTXMODE_APPLY); } } - if (limbIndex == 8) { + if (limbIndex == OBJECT_BOJ_LIMB_08) { Matrix_RotateXS(-this->torsoRot.y, MTXMODE_APPLY); Matrix_RotateZS(-this->torsoRot.x, MTXMODE_APPLY); } - if ((limbIndex == 8) || (limbIndex == 9) || (limbIndex == 0xC)) { + if ((limbIndex == OBJECT_BOJ_LIMB_08) || (limbIndex == OBJECT_BOJ_LIMB_09) || (limbIndex == OBJECT_BOJ_LIMB_0C)) { rot->y += TRUNCF_BINANG(Math_SinS(this->fidgetTableY[limbIndex]) * 200.0f); rot->z += TRUNCF_BINANG(Math_CosS(this->fidgetTableZ[limbIndex]) * 200.0f); } @@ -1593,7 +1607,7 @@ void EnSuttari_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* if (((this->flags1 & 8) && (this->flags1 & 0x10)) || ((this->flags1 & 2) && !(this->flags1 & 0x20)) || ((this->flags1 & 4) && !(this->flags1 & 0x20))) { - if (limbIndex == 8) { + if (limbIndex == OBJECT_BOJ_LIMB_08) { curState = Matrix_GetCurrent(); Matrix_MultVec3f(&D_80BAE95C, &this->unk3F8); if (this->actor.child == NULL) { @@ -1616,7 +1630,7 @@ void EnSuttari_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* } } } - if (limbIndex == 15) { + if (limbIndex == OBJECT_BOJ_LIMB_0F) { Matrix_MultVec3f(&D_80BAE950, &this->actor.focus.pos); } } diff --git a/src/overlays/actors/ovl_En_Sw/z_en_sw.c b/src/overlays/actors/ovl_En_Sw/z_en_sw.c index 49e6fe3e83..6ac89a6f1f 100644 --- a/src/overlays/actors/ovl_En_Sw/z_en_sw.c +++ b/src/overlays/actors/ovl_En_Sw/z_en_sw.c @@ -6,7 +6,6 @@ #include "z_en_sw.h" #include "overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.h" -#include "objects/object_st/object_st.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_UNFRIENDLY) @@ -135,16 +134,25 @@ static DamageTable sDamageTable2 = { /* Powder Keg */ DMG_ENTRY(1, 0x0), }; -static AnimationInfoS sAnimationInfo[] = { - { &object_st_Anim_000304, 1.0f, 0, -1, ANIMMODE_ONCE_INTERP, 0 }, - { &object_st_Anim_000304, 1.0f, 0, -1, ANIMMODE_ONCE_INTERP, -4 }, - { &object_st_Anim_0055A8, 1.0f, 0, -1, ANIMMODE_LOOP_INTERP, -4 }, - { &object_st_Anim_005B98, 1.0f, 0, -1, ANIMMODE_LOOP_INTERP, -4 }, +typedef enum EnSwAnimation { + /* -1 */ ENSW_ANIM_NONE = -1, + /* 0 */ ENSW_ANIM_0, + /* 1 */ ENSW_ANIM_1, + /* 2 */ ENSW_ANIM_2, + /* 3 */ ENSW_ANIM_3, + /* 4 */ ENSW_ANIM_MAX +} EnSwAnimation; + +static AnimationInfoS sAnimationInfo[ENSW_ANIM_MAX] = { + { &object_st_Anim_000304, 1.0f, 0, -1, ANIMMODE_ONCE_INTERP, 0 }, // ENSW_ANIM_0 + { &object_st_Anim_000304, 1.0f, 0, -1, ANIMMODE_ONCE_INTERP, -4 }, // ENSW_ANIM_1 + { &object_st_Anim_0055A8, 1.0f, 0, -1, ANIMMODE_LOOP_INTERP, -4 }, // ENSW_ANIM_2 + { &object_st_Anim_005B98, 1.0f, 0, -1, ANIMMODE_LOOP_INTERP, -4 }, // ENSW_ANIM_3 }; void func_808D8940(EnSw* this, PlayState* play) { - static Color_RGBA8 D_808DBAA4 = { 170, 130, 90, 255 }; - static Color_RGBA8 D_808DBAA8 = { 100, 60, 20, 0 }; + static Color_RGBA8 sPrimColor = { 170, 130, 90, 255 }; + static Color_RGBA8 sEnvColor = { 100, 60, 20, 0 }; s32 i; Vec3f spB8; Vec3f spAC; @@ -168,7 +176,7 @@ void func_808D8940(EnSw* this, PlayState* play) { Lib_Vec3f_TranslateAndRotateY(&gZeroVec3f, temp_s0, &sp94, &spB8); spA0.x = this->actor.world.pos.x + (2.0f * spB8.x); spA0.z = this->actor.world.pos.z + (2.0f * spB8.z); - func_800B0EB0(play, &spA0, &spB8, &spAC, &D_808DBAA4, &D_808DBAA8, 60, 30, temp_f4); + func_800B0EB0(play, &spA0, &spB8, &spAC, &sPrimColor, &sEnvColor, 60, 30, temp_f4); } } @@ -676,7 +684,7 @@ s32 func_808DA08C(EnSw* this, PlayState* play) { Enemy_StartFinishingBlow(play, &this->actor); this->actor.flags &= ~ACTOR_FLAG_TARGETABLE; if (!ENSW_GET_3(&this->actor)) { - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 3); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, ENSW_ANIM_3); } switch (this->actor.colChkInfo.damageEffect) { @@ -1137,8 +1145,9 @@ void EnSw_Init(Actor* thisx, PlayState* play) { if (!func_808D9968(this, play)) { ActorShape_Init(&this->actor.shape, 0.0f, NULL, 0.0f); - SkelAnime_Init(play, &this->skelAnime, &object_st_Skel_005298, NULL, this->jointTable, this->morphTable, 30); - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 0); + SkelAnime_Init(play, &this->skelAnime, &object_st_Skel_005298, NULL, this->jointTable, this->morphTable, + OBJECT_ST_LIMB_MAX); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, ENSW_ANIM_0); this->skelAnime.playSpeed = 4.0f; Collider_InitAndSetSphere(play, &this->collider, &this->actor, &sSphereInit); @@ -1242,43 +1251,43 @@ s32 EnSw_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* po if (ENSW_GET_3(&this->actor)) { switch (limbIndex) { - case 23: + case OBJECT_ST_LIMB_17: *dList = object_st_DL_004788; break; - case 8: + case OBJECT_ST_LIMB_08: *dList = object_st_DL_0046F0; break; - case 14: + case OBJECT_ST_LIMB_0E: *dList = object_st_DL_004658; break; - case 11: + case OBJECT_ST_LIMB_0B: *dList = object_st_DL_0045C0; break; - case 26: + case OBJECT_ST_LIMB_1A: *dList = object_st_DL_004820; break; - case 20: + case OBJECT_ST_LIMB_14: *dList = object_st_DL_0048B8; break; - case 17: + case OBJECT_ST_LIMB_11: *dList = object_st_DL_004950; break; - case 29: + case OBJECT_ST_LIMB_1D: *dList = object_st_DL_0049E8; break; - case 5: + case OBJECT_ST_LIMB_05: *dList = object_st_DL_003FB0; break; - case 4: + case OBJECT_ST_LIMB_04: *dList = object_st_DL_0043D8; break; diff --git a/src/overlays/actors/ovl_En_Sw/z_en_sw.h b/src/overlays/actors/ovl_En_Sw/z_en_sw.h index 9cb68a3faf..c93ef208f8 100644 --- a/src/overlays/actors/ovl_En_Sw/z_en_sw.h +++ b/src/overlays/actors/ovl_En_Sw/z_en_sw.h @@ -2,6 +2,7 @@ #define Z_EN_SW_H #include "global.h" +#include "objects/object_st/object_st.h" struct EnSw; @@ -37,8 +38,8 @@ typedef struct EnSw { /* 0x188 */ EnSwActionFunc actionFunc; /* 0x18C */ ColliderSphere collider; /* 0x1E4 */ Path* path; - /* 0x1E8 */ Vec3s jointTable[30]; - /* 0x29C */ Vec3s morphTable[30]; + /* 0x1E8 */ Vec3s jointTable[OBJECT_ST_LIMB_MAX]; + /* 0x29C */ Vec3s morphTable[OBJECT_ST_LIMB_MAX]; /* 0x350 */ Vec3f unk_350; /* 0x35C */ Vec3f unk_35C; /* 0x368 */ Vec3f unk_368; diff --git a/src/overlays/actors/ovl_En_Syateki_Dekunuts/z_en_syateki_dekunuts.c b/src/overlays/actors/ovl_En_Syateki_Dekunuts/z_en_syateki_dekunuts.c index 6582d8b627..0893ee427a 100644 --- a/src/overlays/actors/ovl_En_Syateki_Dekunuts/z_en_syateki_dekunuts.c +++ b/src/overlays/actors/ovl_En_Syateki_Dekunuts/z_en_syateki_dekunuts.c @@ -73,17 +73,18 @@ static ColliderCylinderInit sCylinderInit = { static Cylinder16 sBonusDekuScrubColliderDimensions[] = { { 24, 40, 0, { 0, 0, 0 } } }; -typedef enum { +typedef enum ShootingGalleryDekuScrubAnimation { /* 0 */ SG_DEKU_ANIM_UP, /* 1 */ SG_DEKU_ANIM_BURROW, /* 2 */ SG_DEKU_ANIM_IDLE, // unused /* 3 */ SG_DEKU_ANIM_LOOK_AROUND, /* 4 */ SG_DEKU_ANIM_DAMAGE, /* 5 */ SG_DEKU_ANIM_DIE, - /* 6 */ SG_DEKU_ANIM_UNBURROW // unused + /* 6 */ SG_DEKU_ANIM_UNBURROW, // unused + /* 7 */ SG_DEKU_ANIM_MAX } ShootingGalleryDekuScrubAnimation; -static AnimationInfo sAnimationInfo[] = { +static AnimationInfo sAnimationInfo[SG_DEKU_ANIM_MAX] = { { &gDekuScrubUpAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -1.0f }, // SG_DEKU_ANIM_UP { &gDekuScrubBurrowAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -1.0f }, // SG_DEKU_ANIM_BURROW { &gDekuScrubIdleAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -1.0f }, // SG_DEKU_ANIM_IDLE diff --git a/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c b/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c index dcd099f02a..95fb064c79 100644 --- a/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c +++ b/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c @@ -98,13 +98,14 @@ ActorInit En_Syateki_Man_InitVars = { /**/ EnSyatekiMan_Draw, }; -typedef enum { +typedef enum ShootingGalleryManAnimation { /* 0 */ SG_MAN_ANIM_HANDS_ON_TABLE, /* 1 */ SG_MAN_ANIM_HEAD_SCRATCH_LOOP, - /* 2 */ SG_MAN_ANIM_HEAD_SCRATCH_END + /* 2 */ SG_MAN_ANIM_HEAD_SCRATCH_END, + /* 3 */ SG_MAN_ANIM_MAX } ShootingGalleryManAnimation; -static AnimationInfo sAnimationInfo[] = { +static AnimationInfo sAnimationInfo[SG_MAN_ANIM_MAX] = { { &gBurlyGuyHandsOnTableAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f }, // SG_MAN_ANIM_HANDS_ON_TABLE { &gBurlyGuyHeadScratchLoopAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f }, // SG_MAN_ANIM_HEAD_SCRATCH_LOOP { &gBurlyGuyHeadScratchEndAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -8.0f }, // SG_MAN_ANIM_HEAD_SCRATCH_END diff --git a/src/overlays/actors/ovl_En_Syateki_Okuta/z_en_syateki_okuta.c b/src/overlays/actors/ovl_En_Syateki_Okuta/z_en_syateki_okuta.c index e6762053e8..e875a88480 100644 --- a/src/overlays/actors/ovl_En_Syateki_Okuta/z_en_syateki_okuta.c +++ b/src/overlays/actors/ovl_En_Syateki_Okuta/z_en_syateki_okuta.c @@ -60,7 +60,7 @@ static ColliderCylinderInit sCylinderInit = { { 20, 40, -30, { 0, 0, 0 } }, }; -typedef enum { +typedef enum ShootingGalleryOctorokAnimation { /* 0 */ SG_OCTO_ANIM_SHOOT, // unused /* 1 */ SG_OCTO_ANIM_DIE, /* 2 */ SG_OCTO_ANIM_HIDE, @@ -70,7 +70,7 @@ typedef enum { /* 6 */ SG_OCTO_ANIM_MAX } ShootingGalleryOctorokAnimation; -static AnimationInfo sAnimationInfo[] = { +static AnimationInfo sAnimationInfo[SG_OCTO_ANIM_MAX] = { { &gOctorokShootAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -1.0f }, // SG_OCTO_ANIM_SHOOT { &gOctorokDieAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -1.0f }, // SG_OCTO_ANIM_DIE { &gOctorokHideAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -1.0f }, // SG_OCTO_ANIM_HIDE diff --git a/src/overlays/actors/ovl_En_Syateki_Wf/z_en_syateki_wf.c b/src/overlays/actors/ovl_En_Syateki_Wf/z_en_syateki_wf.c index 3e4e5074e7..01c148ab26 100644 --- a/src/overlays/actors/ovl_En_Syateki_Wf/z_en_syateki_wf.c +++ b/src/overlays/actors/ovl_En_Syateki_Wf/z_en_syateki_wf.c @@ -113,17 +113,18 @@ ActorInit En_Syateki_Wf_InitVars = { /**/ EnSyatekiWf_Draw, }; -typedef enum { +typedef enum ShootingGalleryWolfosAnimation { /* 0 */ SG_WOLFOS_ANIM_WAIT, // unused /* 1 */ SG_WOLFOS_ANIM_RUN, /* 2 */ SG_WOLFOS_ANIM_JUMP, /* 3 */ SG_WOLFOS_ANIM_LAND, /* 4 */ SG_WOLFOS_ANIM_BACKFLIP, // unused /* 5 */ SG_WOLFOS_ANIM_DAMAGED, - /* 6 */ SG_WOLFOS_ANIM_REAR_UP_FALL_OVER + /* 6 */ SG_WOLFOS_ANIM_REAR_UP_FALL_OVER, + /* 7 */ SG_WOLFOS_ANIM_MAX } ShootingGalleryWolfosAnimation; -static AnimationInfo sAnimationInfo[] = { +static AnimationInfo sAnimationInfo[SG_WOLFOS_ANIM_MAX] = { { &gWolfosWaitAnim, 2.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -1.0f }, // SG_WOLFOS_ANIM_WAIT { &gWolfosRunAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f }, // SG_WOLFOS_ANIM_RUN { &gWolfosRunAnim, 1.0f, 0.0f, 4.0f, ANIMMODE_ONCE, 1.0f }, // SG_WOLFOS_ANIM_JUMP diff --git a/src/overlays/actors/ovl_En_Zoraegg/z_en_zoraegg.c b/src/overlays/actors/ovl_En_Zoraegg/z_en_zoraegg.c index 1392bfa145..7b0224159e 100644 --- a/src/overlays/actors/ovl_En_Zoraegg/z_en_zoraegg.c +++ b/src/overlays/actors/ovl_En_Zoraegg/z_en_zoraegg.c @@ -686,6 +686,7 @@ void func_80B32F04(Actor* thisx, PlayState* play) { sp78 = -(15.0f * Math_SinS(sp60)); sp7C = -((15.0f * Math_CosS(sp62)) * Math_CosS(sp60)); + //! FAKE: temp_f2 = Matrix_Translate(this->actor.world.pos.x + sp74, this->actor.world.pos.y + sp78 + 6.0f, temp_f2 = this->actor.world.pos.z + sp7C, MTXMODE_NEW); diff --git a/src/overlays/actors/ovl_Obj_Hakaisi/z_obj_hakaisi.c b/src/overlays/actors/ovl_Obj_Hakaisi/z_obj_hakaisi.c index 85bec7f998..29e0956b3d 100644 --- a/src/overlays/actors/ovl_Obj_Hakaisi/z_obj_hakaisi.c +++ b/src/overlays/actors/ovl_Obj_Hakaisi/z_obj_hakaisi.c @@ -53,16 +53,6 @@ Vec3f D_80B155B0 = { 0.0f, 25.0f, 30.0f }; Vec3f D_80B155BC[] = { { 0.0f, 65.0f, 8.0f }, { 0.0f, 35.0f, 8.0f }, { 0.0f, 15.0f, 8.0f } }; -Vec3f D_80B155E0 = { 0.0f, 0.0f, 0.0f }; - -Vec3f D_80B155EC = { 0.0f, 0.0f, 0.0f }; - -Color_RGBA8 D_80B155F8 = { 170, 130, 90, 255 }; - -Color_RGBA8 D_80B155FC = { 100, 60, 20, 0 }; - -Vec3f D_80B15600 = { 1.0f, 0.0f, 0.0f }; - void ObjHakaisi_Init(Actor* thisx, PlayState* play) { s32 pad; ObjHakaisi* this = THIS; @@ -297,11 +287,13 @@ void func_80B14B6C(ObjHakaisi* this, PlayState* play, Vec3f vec, s16 arg3) { } void func_80B14CF8(PlayState* play, Vec3f vec, s16 arg2, s16 arg3, s32 arg4) { + static Color_RGBA8 sPrimColor = { 170, 130, 90, 255 }; + static Color_RGBA8 sEnvColor = { 100, 60, 20, 0 }; s32 i; s16 temp_s0; - Vec3f spAC; - Vec3f spA0 = D_80B155E0; - Vec3f sp94 = D_80B155EC; + Vec3f pos; + Vec3f velocity = { 0.0f, 0.0f, 0.0f }; + Vec3f accel = { 0.0f, 0.0f, 0.0f }; f32 temp_f20; f32 temp_f22; @@ -310,19 +302,19 @@ void func_80B14CF8(PlayState* play, Vec3f vec, s16 arg2, s16 arg3, s32 arg4) { temp_f22 = Rand_ZeroOne() * 1.5f; temp_s0 = Rand_Next(); - spAC.x = (Math_SinS(temp_s0) * temp_f20) + vec.x; - spAC.y = (Rand_Centered() * 4.0f) + vec.y; - spAC.z = (Math_CosS(temp_s0) * temp_f20) + vec.z; + pos.x = (Math_SinS(temp_s0) * temp_f20) + vec.x; + pos.y = (Rand_Centered() * 4.0f) + vec.y; + pos.z = (Math_CosS(temp_s0) * temp_f20) + vec.z; - spA0.x += temp_f22 * Math_SinS(temp_s0); - spA0.y += Rand_Centered() + 0.5f; - spA0.z += temp_f22 * Math_CosS(temp_s0); + velocity.x += temp_f22 * Math_SinS(temp_s0); + velocity.y += Rand_Centered() + 0.5f; + velocity.z += temp_f22 * Math_CosS(temp_s0); - sp94.x = -0.1f * spA0.x; - sp94.y = -0.1f * spA0.y; - sp94.z = -0.1f * spA0.z; + accel.x = -0.1f * velocity.x; + accel.y = -0.1f * velocity.y; + accel.z = -0.1f * velocity.z; - func_800B0EB0(play, &spAC, &spA0, &sp94, &D_80B155F8, &D_80B155FC, arg2, arg3, 10); + func_800B0EB0(play, &pos, &velocity, &accel, &sPrimColor, &sEnvColor, arg2, arg3, 10); } } @@ -383,6 +375,7 @@ void func_80B15254(Actor* thisx, PlayState* play) { } void func_80B15264(ObjHakaisi* this) { + static Vec3f D_80B15600 = { 1.0f, 0.0f, 0.0f }; s32 pad; s16 sp32 = Rand_Next(); diff --git a/src/overlays/gamestates/ovl_file_choose/z_file_choose_NES.c b/src/overlays/gamestates/ovl_file_choose/z_file_choose_NES.c index f20341c86c..0c0cd14477 100644 --- a/src/overlays/gamestates/ovl_file_choose/z_file_choose_NES.c +++ b/src/overlays/gamestates/ovl_file_choose/z_file_choose_NES.c @@ -246,7 +246,7 @@ void FileSelect_UpdateMainMenu(GameState* thisx) { this->configMode = CM_ROTATE_TO_NAME_ENTRY; this->kbdButton = FS_KBD_BTN_NONE; this->charPage = FS_CHAR_PAGE_HIRA; - if (gSaveContext.options.language != 0) { + if (gSaveContext.options.language != LANGUAGE_JPN) { this->charPage = FS_CHAR_PAGE_ENG; } this->kbdX = 0; @@ -270,7 +270,7 @@ void FileSelect_UpdateMainMenu(GameState* thisx) { this->configMode = CM_ROTATE_TO_NAME_ENTRY; this->kbdButton = FS_KBD_BTN_NONE; this->charPage = FS_CHAR_PAGE_HIRA; - if (gSaveContext.options.language != 0) { + if (gSaveContext.options.language != LANGUAGE_JPN) { this->charPage = FS_CHAR_PAGE_ENG; } this->kbdX = 0; diff --git a/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_debug.c b/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_debug.c index f8cb776249..2a1e1dda6a 100644 --- a/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_debug.c +++ b/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_debug.c @@ -1006,13 +1006,13 @@ void KaleidoScope_UpdateInventoryEditor(PlayState* play) { } else if (sCurSection == INV_EDITOR_SECTION_NOTEBOOK) { // Bombers Notebook if (CHECK_BTN_ALL(input->press.button, BTN_CUP) || CHECK_BTN_ALL(input->press.button, BTN_CLEFT)) { - gSaveContext.save.saveInfo.inventory.questItems ^= gBitFlags[QUEST_BOMBERS_NOTEBOOK]; + TOGGLE_QUEST_ITEM(QUEST_BOMBERS_NOTEBOOK); } } else if (sCurSection == INV_EDITOR_SECTION_LULLABY_INTRO) { // Goron Lullaby Intro if (CHECK_BTN_ALL(input->press.button, BTN_CUP) || CHECK_BTN_ALL(input->press.button, BTN_CLEFT)) { - gSaveContext.save.saveInfo.inventory.questItems ^= gBitFlags[QUEST_SONG_LULLABY_INTRO]; + TOGGLE_QUEST_ITEM(QUEST_SONG_LULLABY_INTRO); } } else if (sCurSection < INV_EDITOR_SECTION_LULLABY_INTRO) { @@ -1021,7 +1021,7 @@ void KaleidoScope_UpdateInventoryEditor(PlayState* play) { //! have also been taken slot = sCurSection - INV_EDITOR_SECTION_BOSS; if (CHECK_BTN_ALL(input->press.button, BTN_CUP) || CHECK_BTN_ALL(input->press.button, BTN_CLEFT)) { - gSaveContext.save.saveInfo.inventory.questItems ^= gBitFlags[slot]; + TOGGLE_QUEST_ITEM(slot); } } else if (sCurSection < INV_EDITOR_SECTION_DUNGEON_ITEMS) { diff --git a/tools/disasm/functions.txt b/tools/disasm/functions.txt index 7d14aa5f16..dd6406a380 100644 --- a/tools/disasm/functions.txt +++ b/tools/disasm/functions.txt @@ -12459,8 +12459,8 @@ 0x80AE57E8:("EnFsn_OverrideLimbDraw",), 0x80AE5910:("EnFsn_PostLimbDraw",), 0x80AE5990:("EnFsn_Draw",), - 0x80AE6130:("func_80AE6130",), - 0x80AE615C:("func_80AE615C",), + 0x80AE6130:("EnShn_UpdateSkelAnime",), + 0x80AE615C:("EnShn_ChangeAnim",), 0x80AE61C0:("EnShn_IsFacingPlayer",), 0x80AE625C:("EnShn_GetPlayer",), 0x80AE626C:("func_80AE626C",), diff --git a/tools/disasm/variables.txt b/tools/disasm/variables.txt index 15e1f25146..02ffddbc7e 100644 --- a/tools/disasm/variables.txt +++ b/tools/disasm/variables.txt @@ -1088,7 +1088,7 @@ 0x801BFAB8:("magicBorderColors","UNK_TYPE1","",0x1), 0x801BFAC4:("magicBorderIndices","UNK_TYPE1","",0x1), 0x801BFACC:("magicBorderColorTimerIndex","UNK_TYPE1","",0x1), - 0x801BFAD4:("cUpLabelTextures","UNK_TYPE1","",0x1), + 0x801BFAD4:("sCUpLabelTextures","UNK_TYPE1","",0x1), 0x801BFAF4:("D_801BFAF4","UNK_TYPE4","",0x8), 0x801BFAFC:("D_801BFAFC","UNK_TYPE4","",0x4), 0x801BFB04:("D_801BFB04","UNK_TYPE1","",0x1), @@ -5836,10 +5836,10 @@ 0x8088C27C:("D_8088C27C","EffectBlureInit2","",0x24), 0x8088C2A0:("D_8088C2A0","EffectBlureInit2","",0x24), 0x8088C2C4:("D_8088C2C4","UNK_TYPE4","",0x4), - 0x8088C2CC:("D_8088C2CC","UNK_TYPE1","",0x1), - 0x8088C2D8:("D_8088C2D8","UNK_TYPE1","",0x1), - 0x8088C2E4:("D_8088C2E4","UNK_TYPE1","",0x1), - 0x8088C2E8:("D_8088C2E8","UNK_TYPE1","",0x1), + 0x8088C2CC:("sVelocity","UNK_TYPE1","",0x1), + 0x8088C2D8:("sAccel","UNK_TYPE1","",0x1), + 0x8088C2E4:("sPrimColor","UNK_TYPE1","",0x1), + 0x8088C2E8:("sEnvColor","UNK_TYPE1","",0x1), 0x8088C2EC:("D_8088C2EC","UNK_TYPE1","",0x1), 0x8088C340:("D_8088C340","UNK_TYPE1","",0x1), 0x8088C3A0:("jtbl_8088C3A0","UNK_PTR","",0x4), @@ -6173,10 +6173,10 @@ 0x808A7660:("D_808A7660","UNK_TYPE1","",0x1), 0x808A766C:("D_808A766C","UNK_TYPE1","",0x1), 0x808A768C:("D_808A768C","UNK_PTR","",0x4), - 0x808A770C:("D_808A770C","UNK_TYPE1","",0x1), - 0x808A7710:("D_808A7710","UNK_TYPE1","",0x1), - 0x808A7714:("D_808A7714","UNK_TYPE1","",0x1), - 0x808A7718:("D_808A7718","UNK_TYPE1","",0x1), + 0x808A770C:("sPrimColor","UNK_TYPE1","",0x1), + 0x808A7710:("sEnvColor","UNK_TYPE1","",0x1), + 0x808A7714:("sPrimColor","UNK_TYPE1","",0x1), + 0x808A7718:("sEnvColor","UNK_TYPE1","",0x1), 0x808A7720:("D_808A7720","f32","",0x4), 0x808A7724:("D_808A7724","f32","",0x4), 0x808A7728:("D_808A7728","f32","",0x4), @@ -6267,10 +6267,10 @@ 0x808B10F0:("D_808B10F0","UNK_TYPE1","",0x1), 0x808B1100:("D_808B1100","UNK_TYPE1","",0x1), 0x808B110C:("D_808B110C","UNK_TYPE1","",0x1), - 0x808B1118:("D_808B1118","UNK_TYPE1","",0x1), - 0x808B111C:("D_808B111C","UNK_TYPE1","",0x1), - 0x808B1120:("D_808B1120","UNK_TYPE1","",0x1), - 0x808B1124:("D_808B1124","UNK_TYPE1","",0x1), + 0x808B1118:("sPrimColor","UNK_TYPE1","",0x1), + 0x808B111C:("sEnvColor","UNK_TYPE1","",0x1), + 0x808B1120:("sPrimColor","UNK_TYPE1","",0x1), + 0x808B1124:("sEnvColor","UNK_TYPE1","",0x1), 0x808B1128:("D_808B1128","UNK_TYPE1","",0x1), 0x808B1164:("D_808B1164","UNK_TYPE1","",0x1), 0x808B117C:("D_808B117C","UNK_TYPE1","",0x1), @@ -6747,8 +6747,8 @@ 0x808DBA38:("D_808DBA38","UNK_PTR","",0x4), 0x808DBA44:("D_808DBA44","UNK_TYPE1","",0x1), 0x808DBA64:("D_808DBA64","UNK_PTR","",0x4), - 0x808DBAA4:("D_808DBAA4","UNK_TYPE1","",0x1), - 0x808DBAA8:("D_808DBAA8","UNK_TYPE1","",0x1), + 0x808DBAA4:("sPrimColor","UNK_TYPE1","",0x1), + 0x808DBAA8:("sEnvColor","UNK_TYPE1","",0x1), 0x808DBAAC:("D_808DBAAC","UNK_TYPE1","",0x1), 0x808DBAC0:("D_808DBAC0","f32","",0x4), 0x808DBAC4:("D_808DBAC4","f32","",0x4), @@ -13599,8 +13599,8 @@ 0x80B155BC:("D_80B155BC","UNK_TYPE1","",0x1), 0x80B155E0:("D_80B155E0","UNK_TYPE4","",0x4), 0x80B155EC:("D_80B155EC","UNK_TYPE4","",0x4), - 0x80B155F8:("D_80B155F8","UNK_TYPE1","",0x1), - 0x80B155FC:("D_80B155FC","UNK_TYPE1","",0x1), + 0x80B155F8:("sPrimColor","UNK_TYPE1","",0x1), + 0x80B155FC:("sEnvColor","UNK_TYPE1","",0x1), 0x80B15600:("D_80B15600","UNK_TYPE1","",0x1), 0x80B15610:("jtbl_80B15610","UNK_PTR","",0x4), 0x80B15628:("D_80B15628","f32","",0x4),