Animation Cleanup Part 2: En_A* Actors (#1322)

* en_A

* more cleanup

* more cleanup

* another one

* more cleanup

* Suggestion

* Oops
This commit is contained in:
engineer124
2023-07-12 22:08:56 -04:00
committed by GitHub
parent 913cd981c0
commit e7f3921414
14 changed files with 633 additions and 331 deletions
+65 -39
View File
@@ -81,12 +81,22 @@ static ColliderCylinderInit sCylinderInit = {
static CollisionCheckInfoInit2 sColChkInfoInit = { 0, 0, 0, 0, MASS_IMMOVABLE };
static AnimationInfoS sAnimationInfo[] = {
{ &object_ah_Anim_001860, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
{ &object_ah_Anim_001860, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
{ &object_ah_Anim_002280, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
{ &object_ah_Anim_000968, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
{ &object_ah_Anim_000DDC, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
typedef enum {
/* -1 */ ENAH_ANIM_NONE = -1,
/* 0 */ ENAH_ANIM_0,
/* 1 */ ENAH_ANIM_1,
/* 2 */ ENAH_ANIM_2,
/* 3 */ ENAH_ANIM_3,
/* 4 */ ENAH_ANIM_4,
/* 5 */ ENAH_ANIM_MAX
} EnAhAnimation;
static AnimationInfoS sAnimationInfo[ENAH_ANIM_MAX] = {
{ &object_ah_Anim_001860, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // ENAH_ANIM_0
{ &object_ah_Anim_001860, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, // ENAH_ANIM_1
{ &object_ah_Anim_002280, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, // ENAH_ANIM_2
{ &object_ah_Anim_000968, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, // ENAH_ANIM_3
{ &object_ah_Anim_000DDC, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // ENAH_ANIM_4
};
s16 D_80BD3EBC[] = { 0, 0, 1, 0 };
@@ -127,29 +137,30 @@ Actor* func_80BD2A30(EnAh* this, PlayState* play, u8 actorCat, s16 actorId) {
return foundActor;
}
void func_80BD2AE0(EnAh* this) {
this->skelAnime.playSpeed = this->unk_2DC;
void EnAh_UpdateSkelAnime(EnAh* this) {
this->skelAnime.playSpeed = this->animPlaySpeed;
SkelAnime_Update(&this->skelAnime);
}
s32 func_80BD2B0C(EnAh* this, s32 arg1) {
s32 phi_v1 = false;
s32 ret = false;
s32 EnAh_ChangeAnim(EnAh* this, s32 animIndex) {
s32 changeAnim = false;
s32 didAnimChange = false;
if ((arg1 == 0) || (arg1 == 1)) {
if ((this->unk_300 != 0) && (this->unk_300 != 1)) {
phi_v1 = true;
if ((animIndex == ENAH_ANIM_0) || (animIndex == ENAH_ANIM_1)) {
if ((this->animIndex != ENAH_ANIM_0) && (this->animIndex != ENAH_ANIM_1)) {
changeAnim = true;
}
} else if (arg1 != this->unk_300) {
phi_v1 = true;
} else if (this->animIndex != animIndex) {
changeAnim = true;
}
if (phi_v1) {
this->unk_300 = arg1;
ret = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, arg1);
this->unk_2DC = this->skelAnime.playSpeed;
if (changeAnim) {
this->animIndex = animIndex;
didAnimChange = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, animIndex);
this->animPlaySpeed = this->skelAnime.playSpeed;
}
return ret;
return didAnimChange;
}
void func_80BD2BA4(EnAh* this, PlayState* play) {
@@ -185,6 +196,9 @@ void func_80BD2C6C(EnAh* this) {
this->unk_2FA = 4;
}
break;
default:
break;
}
if (!phi_a3 && (this->unk_2FA == 4)) {
@@ -283,11 +297,14 @@ void func_80BD2FD0(EnAh* this, PlayState* play) {
s32 func_80BD30C0(EnAh* this, PlayState* play) {
switch (this->unk_1DC) {
case 1:
func_80BD2B0C(this, 0);
EnAh_ChangeAnim(this, ENAH_ANIM_0);
break;
case 2:
func_80BD2B0C(this, 4);
EnAh_ChangeAnim(this, ENAH_ANIM_4);
break;
default:
break;
}
return false;
@@ -295,10 +312,10 @@ s32 func_80BD30C0(EnAh* this, PlayState* play) {
void func_80BD3118(EnAh* this, PlayState* play) {
if (this->unk_2FE == 0) {
func_80BD2B0C(this, 2);
EnAh_ChangeAnim(this, ENAH_ANIM_2);
this->unk_2FE++;
} else if ((this->unk_2FE == 1) && Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
func_80BD2B0C(this, 3);
EnAh_ChangeAnim(this, ENAH_ANIM_3);
this->unk_2FE++;
}
}
@@ -324,6 +341,9 @@ s32 func_80BD3198(EnAh* this, PlayState* play) {
this->unk_2F6 = 2;
this->unk_2F8 = 8;
break;
default:
break;
}
}
this->unk_2DA = temp;
@@ -360,6 +380,9 @@ s32* func_80BD3294(EnAh* this, PlayState* play) {
case 2:
return D_80BD3DF8;
default:
break;
}
return NULL;
}
@@ -382,9 +405,10 @@ s32 func_80BD3374(EnAh* this, PlayState* play, ScheduleOutput* scheduleOutput) {
Math_Vec3f_Copy(&this->actor.world.pos, &D_80BD3EC4.pos);
Math_Vec3s_Copy(&this->actor.world.rot, &D_80BD3EC4.rot);
Math_Vec3s_Copy(&this->actor.shape.rot, &this->actor.world.rot);
func_80BD2B0C(this, 0);
EnAh_ChangeAnim(this, ENAH_ANIM_0);
SubS_UpdateFlags(&this->unk_2D8, 3, 7);
this->unk_2D8 |= 0x40;
return true;
}
@@ -394,9 +418,10 @@ s32 func_80BD33FC(EnAh* this, PlayState* play, ScheduleOutput* scheduleOutput) {
Math_Vec3f_Copy(&this->actor.world.pos, &D_80BD3ED8.pos);
Math_Vec3s_Copy(&this->actor.world.rot, &D_80BD3ED8.rot);
Math_Vec3s_Copy(&this->actor.shape.rot, &this->actor.world.rot);
func_80BD2B0C(this, 4);
EnAh_ChangeAnim(this, ENAH_ANIM_4);
SubS_UpdateFlags(&this->unk_2D8, 3, 7);
this->unk_2D8 |= (0x40 | 0x10);
return true;
}
@@ -409,7 +434,7 @@ s32 func_80BD3484(EnAh* this, PlayState* play, ScheduleOutput* scheduleOutput) {
Math_Vec3s_Copy(&this->actor.world.rot, &D_80BD3EEC.rot);
Math_Vec3s_Copy(&this->actor.shape.rot, &this->actor.world.rot);
}
func_80BD2B0C(this, 4);
EnAh_ChangeAnim(this, ENAH_ANIM_4);
this->unk_2D8 |= (0x40 | 0x8);
this->unk_2D8 |= 0x10;
this->unk_2D8 |= 0x80;
@@ -425,10 +450,6 @@ s32 func_80BD3548(EnAh* this, PlayState* play, ScheduleOutput* scheduleOutput) {
this->unk_2D8 = 0;
switch (scheduleOutput->result) {
default:
ret = false;
break;
case 1:
ret = func_80BD3374(this, play, scheduleOutput);
break;
@@ -440,6 +461,10 @@ s32 func_80BD3548(EnAh* this, PlayState* play, ScheduleOutput* scheduleOutput) {
case 3:
ret = func_80BD3484(this, play, scheduleOutput);
break;
default:
ret = false;
break;
}
return ret;
}
@@ -517,9 +542,10 @@ void EnAh_Init(Actor* thisx, PlayState* play) {
}
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 20.0f);
SkelAnime_InitFlex(play, &this->skelAnime, &object_ah_Skel_009E70, NULL, this->jointTable, this->morphTable, 17);
this->unk_300 = -1;
func_80BD2B0C(this, 0);
SkelAnime_InitFlex(play, &this->skelAnime, &object_ah_Skel_009E70, NULL, this->jointTable, this->morphTable,
OBJECT_AH_LIMB_MAX);
this->animIndex = ENAH_ANIM_NONE;
EnAh_ChangeAnim(this, ENAH_ANIM_0);
Collider_InitAndSetCylinder(play, &this->collider, &this->actor, &sCylinderInit);
CollisionCheck_SetInfo2(&this->actor.colChkInfo, DamageTable_Get(0x16), &sColChkInfoInit);
this->actor.targetMode = 6;
@@ -548,7 +574,7 @@ void EnAh_Update(Actor* thisx, PlayState* play) {
if (this->unk_1DC != 0) {
func_80BD3198(this, play);
func_80BD2AE0(this);
EnAh_UpdateSkelAnime(this);
func_80BD2C6C(this);
func_80BD2FD0(this, play);
radius = this->collider.dim.radius + 60;
@@ -566,7 +592,7 @@ void EnAh_Update(Actor* thisx, PlayState* play) {
void EnAh_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
EnAh* this = THIS;
if (limbIndex == 7) {
if (limbIndex == OBJECT_AH_LIMB_07) {
Matrix_MultVec3f(&D_80BD3F00, &this->actor.focus.pos);
Math_Vec3s_Copy(&this->actor.focus.rot, &this->actor.world.rot);
}
@@ -589,7 +615,7 @@ void EnAh_TransformLimbDraw(PlayState* play, s32 limbIndex, Actor* thisx) {
overrideRot = false;
}
if (limbIndex == 7) {
if (limbIndex == OBJECT_AH_LIMB_07) {
SubS_UpdateLimb(BINANG_ADD(this->unk_2EC + this->unk_2F0, 0x4000),
BINANG_ADD(this->unk_2EE + this->unk_2F2 + this->actor.shape.rot.y, 0x4000), this->unk_1E8,
this->unk_200, stepRot, overrideRot);
@@ -600,7 +626,7 @@ void EnAh_TransformLimbDraw(PlayState* play, s32 limbIndex, Actor* thisx) {
Matrix_RotateXS(this->unk_200[0].x, MTXMODE_APPLY);
Matrix_RotateZS(this->unk_200[0].z, MTXMODE_APPLY);
Matrix_Push();
} else if (limbIndex == 2) {
} else if (limbIndex == OBJECT_AH_LIMB_02) {
SubS_UpdateLimb(BINANG_ADD(this->unk_2F0, 0x4000), BINANG_ADD(this->unk_2F2 + this->actor.shape.rot.y, 0x4000),
&this->unk_1E8[1], &this->unk_200[1], stepRot, overrideRot);
Matrix_Pop();
+5 -4
View File
@@ -2,6 +2,7 @@
#define Z_EN_AH_H
#include "global.h"
#include "objects/object_ah/object_ah.h"
struct EnAh;
@@ -19,11 +20,11 @@ typedef struct EnAh {
/* 0x1E4 */ Actor* unk_1E4;
/* 0x1E8 */ Vec3f unk_1E8[2];
/* 0x200 */ Vec3s unk_200[2];
/* 0x20C */ Vec3s jointTable[17];
/* 0x272 */ Vec3s morphTable[17];
/* 0x20C */ Vec3s jointTable[OBJECT_AH_LIMB_MAX];
/* 0x272 */ Vec3s morphTable[OBJECT_AH_LIMB_MAX];
/* 0x2D8 */ u16 unk_2D8;
/* 0x2DA */ u16 unk_2DA;
/* 0x2DC */ f32 unk_2DC;
/* 0x2DC */ f32 animPlaySpeed;
/* 0x2E0 */ UNK_TYPE1 unk2E0[0xC];
/* 0x2EC */ s16 unk_2EC;
/* 0x2EE */ s16 unk_2EE;
@@ -35,7 +36,7 @@ typedef struct EnAh {
/* 0x2FA */ s16 unk_2FA;
/* 0x2FC */ s16 unk_2FC;
/* 0x2FE */ s16 unk_2FE;
/* 0x300 */ s32 unk_300;
/* 0x300 */ s32 animIndex;
} EnAh; // size = 0x304
#endif // Z_EN_AH_H
File diff suppressed because it is too large Load Diff
@@ -2,6 +2,7 @@
#define Z_EN_AKINDONUTS_H
#include "global.h"
#include "objects/object_dnt/object_dnt.h"
struct EnAkindonuts;
@@ -22,15 +23,15 @@ typedef enum {
typedef struct EnAkindonuts {
/* 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 */ EnAkindonutsActionFunc actionFunc;
/* 0x2DC */ EnAkindonutsUnkFunc unk_2DC;
/* 0x2E0 */ ColliderCylinder collider;
/* 0x32C */ u16 unk_32C;
/* 0x330 */ Path* path;
/* 0x334 */ s32 unk_334;
/* 0x338 */ s16 unk_338;
/* 0x338 */ s16 animIndex;
/* 0x33A */ s16 unk_33A;
/* 0x33C */ u16 unk_33C;
/* 0x33E */ s16 unk_33E;
+77 -38
View File
@@ -5,7 +5,6 @@
*/
#include "z_en_al.h"
#include "objects/object_al/object_al.h"
#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_10 | ACTOR_FLAG_20)
@@ -119,11 +118,28 @@ static ColliderCylinderInit sCylinderInit = {
static CollisionCheckInfoInit2 sColChkInfoInit = { 0, 0, 0, 0, MASS_IMMOVABLE };
static AnimationInfoS sAnimationInfo[] = {
{ &object_al_Anim_000C54, 1.0f, 0, -1, 0, -4 }, { &object_al_Anim_00DBE0, 1.0f, 0, -1, 0, 0 },
{ &object_al_Anim_00DBE0, 1.0f, 0, -1, 0, -4 }, { &object_al_Anim_00ACA0, 1.0f, 0, -1, 2, 0 },
{ &object_al_Anim_00ACA0, -1.0f, 0, -1, 2, 0 }, { &object_al_Anim_00CA28, 1.0f, 0, -1, 0, -4 },
{ &object_al_Anim_00BCA4, 1.0f, 0, -1, 2, 0 }, { &object_al_Anim_00A764, 1.0f, 0, -1, 0, -4 },
typedef enum {
/* -1 */ ENAL_ANIM_NONE = -1,
/* 0 */ ENAL_ANIM_0,
/* 1 */ ENAL_ANIM_1,
/* 2 */ ENAL_ANIM_2,
/* 3 */ ENAL_ANIM_3,
/* 4 */ ENAL_ANIM_4,
/* 5 */ ENAL_ANIM_5,
/* 6 */ ENAL_ANIM_6,
/* 7 */ ENAL_ANIM_7,
/* 8 */ ENAL_ANIM_MAX
} EnAlAnimation;
static AnimationInfoS sAnimationInfo[ENAL_ANIM_MAX] = {
{ &object_al_Anim_000C54, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, // ENAL_ANIM_0
{ &object_al_Anim_00DBE0, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // ENAL_ANIM_1
{ &object_al_Anim_00DBE0, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, // ENAL_ANIM_2
{ &object_al_Anim_00ACA0, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, // ENAL_ANIM_3
{ &object_al_Anim_00ACA0, -1.0f, 0, -1, ANIMMODE_ONCE, 0 }, // ENAL_ANIM_4
{ &object_al_Anim_00CA28, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, // ENAL_ANIM_5
{ &object_al_Anim_00BCA4, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, // ENAL_ANIM_6
{ &object_al_Anim_00A764, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, // ENAL_ANIM_7
};
Vec3f D_80BE0070 = { 1000.0f, 0.0f, 0.0f };
@@ -159,30 +175,30 @@ Actor* func_80BDE1A0(EnAl* this, PlayState* play, u8 arg0, s16 arg1) {
return foundActor;
}
void func_80BDE250(EnAl* this) {
this->skelAnime.playSpeed = this->unk_4C8;
void EnAl_UpdateSkelAnime(EnAl* this) {
this->skelAnime.playSpeed = this->animPlaySpeed;
SkelAnime_Update(&this->skelAnime);
}
s32 func_80BDE27C(EnAl* this, s32 arg1) {
s32 phi_v1 = false;
s32 ret = false;
s32 EnAl_ChangeAnim(EnAl* this, s32 animIndex) {
s32 changeAnim = false;
s32 didAnimChange = false;
if ((arg1 == 1) || (arg1 == 2)) {
if ((this->unk_4F8 != 1) && (this->unk_4F8 != 2)) {
phi_v1 = true;
if ((animIndex == ENAL_ANIM_1) || (animIndex == ENAL_ANIM_2)) {
if ((this->animIndex != ENAL_ANIM_1) && (this->animIndex != ENAL_ANIM_2)) {
changeAnim = true;
}
} else if (arg1 != this->unk_4F8) {
phi_v1 = true;
} else if (this->animIndex != animIndex) {
changeAnim = true;
}
if (phi_v1) {
this->unk_4F8 = arg1;
ret = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, arg1);
this->unk_4C8 = this->skelAnime.playSpeed;
if (changeAnim) {
this->animIndex = animIndex;
didAnimChange = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, animIndex);
this->animPlaySpeed = this->skelAnime.playSpeed;
}
return ret;
return didAnimChange;
}
void func_80BDE318(EnAl* this, PlayState* play) {
@@ -258,7 +274,7 @@ s32 func_80BDE4E0(EnAl* this, s16* arg1, s16 arg2) {
if (arg2 == *arg1) {
Actor_PlaySfx(&this->actor, NA_SE_EV_CHAIR_ROLL);
func_80BDE27C(this, 3);
EnAl_ChangeAnim(this, ENAL_ANIM_3);
this->unk_4E8 = 0;
(*arg1)++;
}
@@ -272,7 +288,7 @@ s32 func_80BDE4E0(EnAl* this, s16* arg1, s16 arg2) {
if ((temp != (this->actor.world.rot.y / 364)) && (this->unk_4E8 < 20)) {
Math_ApproachS(&this->actor.world.rot.y, sp42, 3, 0x2AA8);
} else {
func_80BDE27C(this, 5);
EnAl_ChangeAnim(this, ENAL_ANIM_5);
this->actor.world.rot.y = sp42;
this->unk_4E8 = 0;
(*arg1)++;
@@ -293,7 +309,7 @@ s32 func_80BDE678(EnAl* this, s16* arg1, s16 arg2) {
if (arg2 == *arg1) {
Actor_PlaySfx(&this->actor, NA_SE_EV_CHAIR_ROLL);
func_80BDE27C(this, 4);
EnAl_ChangeAnim(this, ENAL_ANIM_4);
this->unk_4E8 = 0;
(*arg1)++;
}
@@ -305,7 +321,7 @@ s32 func_80BDE678(EnAl* this, s16* arg1, s16 arg2) {
if ((temp != (this->actor.world.rot.y / 364)) && (this->unk_4E8 < 20)) {
Math_ApproachS(&this->actor.world.rot.y, sp22, 3, 0x2AA8);
} else {
func_80BDE27C(this, 2);
EnAl_ChangeAnim(this, ENAL_ANIM_2);
this->actor.world.rot.y = sp22;
this->unk_4E8 = 0;
(*arg1)++;
@@ -353,6 +369,9 @@ s32 func_80BDE7FC(EnAl* this, PlayState* play) {
this->unk_4E6++;
sp20 = true;
break;
default:
break;
}
return sp20;
}
@@ -424,6 +443,9 @@ s32 func_80BDEA14(EnAl* this, PlayState* play) {
sp18 = true;
}
break;
default:
break;
}
return sp18;
}
@@ -470,8 +492,10 @@ s32* func_80BDEABC(EnAl* this, PlayState* play) {
return D_80BDFF24;
}
return D_80BDFDF8;
default:
return NULL;
}
return NULL;
}
s32 func_80BDEC2C(EnAl* this, PlayState* play) {
@@ -548,12 +572,12 @@ void func_80BDEE5C(EnAl* this) {
void func_80BDEF3C(EnAl* this, PlayState* play) {
if (this->unk_4E4 == 0) {
func_80BDE27C(this, 7);
EnAl_ChangeAnim(this, ENAL_ANIM_7);
this->unk_4C2 &= ~0x20;
this->unk_4C2 |= 0x200;
this->unk_4E4++;
} else if ((this->unk_4E4 == 1) && Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
func_80BDE27C(this, 0);
EnAl_ChangeAnim(this, ENAL_ANIM_0);
this->unk_4C2 &= ~0x200;
this->unk_4C2 |= 0x20;
this->unk_4E4++;
@@ -562,10 +586,10 @@ void func_80BDEF3C(EnAl* this, PlayState* play) {
void func_80BDEFE4(EnAl* this, PlayState* play) {
if (this->unk_4E4 == 0) {
func_80BDE27C(this, 6);
EnAl_ChangeAnim(this, ENAL_ANIM_6);
this->unk_4E4 += 1;
} else if ((this->unk_4E4 == 1) && Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
func_80BDE27C(this, 5);
EnAl_ChangeAnim(this, ENAL_ANIM_5);
this->unk_4E4 += 1;
}
}
@@ -619,7 +643,10 @@ s32 func_80BDF064(EnAl* this, PlayState* play) {
case 0x2B19:
case 0x2B20:
case 0x2B3C:
func_80BDE27C(this, 5);
EnAl_ChangeAnim(this, ENAL_ANIM_5);
break;
default:
break;
}
}
@@ -642,7 +669,7 @@ s32 func_80BDF244(EnAl* this, PlayState* play, ScheduleOutput* scheduleOutput) {
Actor* temp_v0 = func_80BDE1A0(this, play, ACTORCAT_NPC, ACTOR_EN_TOTO);
if ((sp20 != NULL) && (sp20->update != NULL) && (temp_v0 != NULL) && (temp_v0->update != NULL)) {
func_80BDE27C(this, 0);
EnAl_ChangeAnim(this, ENAL_ANIM_0);
SubS_UpdateFlags(&this->unk_4C2, 3, 7);
this->unk_368 = sp20;
this->unk_4C2 |= 0x20;
@@ -656,13 +683,16 @@ s32 func_80BDF308(EnAl* this, PlayState* play, ScheduleOutput* scheduleOutput) {
switch (scheduleOutput->result) {
case 1:
func_80BDE27C(this, 0);
EnAl_ChangeAnim(this, ENAL_ANIM_0);
break;
case 2:
this->unk_4F0 = PLAYER_IA_NONE;
this->unk_4EA = 0;
func_80BDE27C(this, 2);
EnAl_ChangeAnim(this, ENAL_ANIM_2);
break;
default:
break;
}
return true;
@@ -741,6 +771,9 @@ void func_80BDF578(EnAl* this, PlayState* play) {
case 2:
func_80BDF414(this, play);
break;
default:
break;
}
Math_ApproachS(&this->actor.shape.rot.y, this->actor.world.rot.y, 3, 0x2AA8);
@@ -784,8 +817,8 @@ void EnAl_Init(Actor* thisx, PlayState* play) {
ActorShape_Init(&this->actor.shape, 0.0f, NULL, 0.0f);
SkelAnime_InitFlex(play, &this->skelAnime, &gMadameAromaSkel, NULL, this->jointTable, this->morphTable,
MADAME_AROMA_LIMB_MAX);
this->unk_4F8 = -1;
func_80BDE27C(this, 1);
this->animIndex = ENAL_ANIM_NONE;
EnAl_ChangeAnim(this, ENAL_ANIM_1);
Collider_InitAndSetCylinder(play, &this->unk_310, &this->actor, &sCylinderInit);
CollisionCheck_SetInfo2(&this->actor.colChkInfo, DamageTable_Get(0x16), &sColChkInfoInit);
Actor_SetScale(&this->actor, 0.01f);
@@ -811,7 +844,7 @@ void EnAl_Update(Actor* thisx, PlayState* play) {
func_80BDF064(this, play);
if (this->unk_35C != 0) {
func_80BDE250(this);
EnAl_UpdateSkelAnime(this);
func_80BDEE5C(this);
func_8013C964(&this->actor, play, this->unk_4D4, 30.0f, this->unk_4F0, this->unk_4C2 & 7);
func_80BDE318(this, play);
@@ -831,6 +864,9 @@ s32 EnAl_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* po
case MADAME_AROMA_LIMB_HEAD:
break;
default:
break;
}
return false;
}
@@ -867,6 +903,9 @@ void EnAl_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot,
Matrix_MultVec3f(&D_80BE0070, &this->actor.focus.pos);
Math_Vec3s_Copy(&this->actor.focus.rot, &this->actor.world.rot);
break;
default:
break;
}
}
@@ -887,7 +926,7 @@ void EnAl_TransformLimbDraw(PlayState* play, s32 limbIndex, Actor* thisx) {
stepRot = false;
}
if (limbIndex == 16) {
if (limbIndex == MADAME_AROMA_LIMB_HEAD) {
SubS_UpdateLimb(this->unk_4DC + 0x4000, this->unk_4DE + this->actor.shape.rot.y + 0x4000, &this->unk_36C,
&this->unk_378, stepRot, overrideRot);
Matrix_Pop();
+8 -7
View File
@@ -2,6 +2,7 @@
#define Z_EN_AL_H
#include "global.h"
#include "objects/object_al/object_al.h"
struct EnAl;
@@ -22,14 +23,14 @@ typedef struct EnAl {
/* 0x368 */ Actor* unk_368;
/* 0x36C */ Vec3f unk_36C;
/* 0x378 */ Vec3s unk_378;
/* 0x37E */ Vec3s jointTable[27];
/* 0x420 */ Vec3s morphTable[27];
/* 0x37E */ Vec3s jointTable[MADAME_AROMA_LIMB_MAX];
/* 0x420 */ Vec3s morphTable[MADAME_AROMA_LIMB_MAX];
/* 0x4C2 */ u16 unk_4C2;
/* 0x4C4 */ u16 unk_4C4;
/* 0x4C8 */ f32 unk_4C8;
/* 0x4CC */ UNK_TYPE1 unk4CC[8];
/* 0x4C8 */ f32 animPlaySpeed;
/* 0x4CC */ UNK_TYPE1 unk4CC[0x8];
/* 0x4D4 */ f32 unk_4D4;
/* 0x4D8 */ UNK_TYPE1 unk4D8[4];
/* 0x4D8 */ UNK_TYPE1 unk4D8[0x4];
/* 0x4DC */ s16 unk_4DC;
/* 0x4DE */ s16 unk_4DE;
/* 0x4E0 */ s16 unk_4E0;
@@ -41,8 +42,8 @@ typedef struct EnAl {
/* 0x4EC */ EnAlUnkFunc unk_4EC;
/* 0x4F0 */ s32 unk_4F0;
/* 0x4F4 */ s32 unk_4F4;
/* 0x4F8 */ s32 unk_4F8;
/* 0x4FC */ UNK_TYPE1 unk4FC[4];
/* 0x4F8 */ s32 animIndex;
/* 0x4FC */ UNK_TYPE1 unk4FC[0x4];
} EnAl; // size = 0x500
#endif // Z_EN_AL_H
+9 -8
View File
@@ -203,9 +203,9 @@ void EnAm_SpawnEffects(EnAm* this, PlayState* play) {
}
void func_808AFF9C(EnAm* this) {
f32 lastFrame = Animation_GetLastFrame(&gArmosPushedBackAnim);
f32 endFrame = Animation_GetLastFrame(&gArmosPushedBackAnim);
Animation_Change(&this->skelAnime, &gArmosPushedBackAnim, 0.0f, lastFrame, lastFrame, ANIMMODE_LOOP, 0.0f);
Animation_Change(&this->skelAnime, &gArmosPushedBackAnim, 0.0f, endFrame, endFrame, ANIMMODE_LOOP, 0.0f);
this->enemyCollider.info.bumper.dmgFlags = 0x80000088;
this->interactCollider.info.bumper.dmgFlags = 0x77CFFF77;
if (this->actor.colChkInfo.health != 0) {
@@ -379,8 +379,9 @@ void func_808B066C(EnAm* this, PlayState* play) {
}
void EnAm_TakeDamage(EnAm* this, PlayState* play) {
Animation_Change(&this->skelAnime, &gArmosTakeDamageAnim, 1.0f, 4.0f,
Animation_GetLastFrame(&gArmosTakeDamageAnim) - 6, ANIMMODE_ONCE, 0.0f);
f32 endFrame = Animation_GetLastFrame(&gArmosTakeDamageAnim) - 6;
Animation_Change(&this->skelAnime, &gArmosTakeDamageAnim, 1.0f, 4.0f, endFrame, ANIMMODE_ONCE, 0.0f);
func_800BE504(&this->actor, &this->enemyCollider);
this->actor.speed = 6.0f;
Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_OPA,
@@ -539,16 +540,16 @@ void EnAm_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot,
phi_s2 = 0;
phi_s1 = 0;
if (limbIndex == 4) {
if (limbIndex == OBJECT_AM_LIMB_04) {
phi_s2 = &this->limbPos[0];
phi_s1 = D_808B1128;
phi_s3 = 5;
} else if (limbIndex == 13) {
} else if (limbIndex == OBJECT_AM_LIMB_0D) {
phi_s2 = &this->limbPos[9];
phi_s1 = D_808B117C;
phi_s3 = 4;
} else if ((limbIndex == 7) || (limbIndex == 10)) {
phi_s2 = (limbIndex == 7) ? &this->limbPos[5] : &this->limbPos[7];
} else if ((limbIndex == OBJECT_AM_LIMB_07) || (limbIndex == OBJECT_AM_LIMB_0A)) {
phi_s2 = (limbIndex == OBJECT_AM_LIMB_07) ? &this->limbPos[5] : &this->limbPos[7];
phi_s1 = D_808B1164;
phi_s3 = 2;
} else {
+36 -21
View File
@@ -29,25 +29,38 @@ ActorInit En_And_InitVars = {
(ActorFunc)EnAnd_Draw,
};
static AnimationInfoS sAnimationInfo[] = {
{ &gAndStaticAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
{ &gAndIdleAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
{ &gAndWalkAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
{ &gAndRaiseHeadAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
{ &gAndRaisedHeadLoopAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
{ &gAndRaiseHandAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
{ &gAndRaisedHandLoopAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
{ &gAndRaisedHandWalkAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
typedef enum {
/* -1 */ ENAND_ANIM_NONE = -1,
/* 0 */ ENAND_ANIM_0,
/* 1 */ ENAND_ANIM_1,
/* 2 */ ENAND_ANIM_2,
/* 3 */ ENAND_ANIM_3,
/* 4 */ ENAND_ANIM_4,
/* 5 */ ENAND_ANIM_5,
/* 6 */ ENAND_ANIM_6,
/* 7 */ ENAND_ANIM_7,
/* 8 */ ENAND_ANIM_MAX
} EnAndAnimation;
static AnimationInfoS sAnimationInfo[ENAND_ANIM_MAX] = {
{ &gAndStaticAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // ENAND_ANIM_0
{ &gAndIdleAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // ENAND_ANIM_1
{ &gAndWalkAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // ENAND_ANIM_2
{ &gAndRaiseHeadAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, // ENAND_ANIM_3
{ &gAndRaisedHeadLoopAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // ENAND_ANIM_4
{ &gAndRaiseHandAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, // ENAND_ANIM_5
{ &gAndRaisedHandLoopAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // ENAND_ANIM_6
{ &gAndRaisedHandWalkAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, // ENAND_ANIM_7
};
s32 EnAnd_ChangeAnim(EnAnd* this, s32 animIndex) {
s32 ret = false;
s32 didAnimChange = false;
if (this->animIndex != animIndex) {
this->animIndex = animIndex;
ret = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, animIndex);
didAnimChange = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, animIndex);
}
return ret;
return didAnimChange;
}
void EnAnd_Blink(EnAnd* this) {
@@ -61,8 +74,10 @@ void EnAnd_Blink(EnAnd* this) {
}
void EnAnd_HandleCutscene(EnAnd* this, PlayState* play) {
s32 csAnimations[] = { 0, 1, 2, 3, 5, 7 };
u16 cueType;
s32 csAnimIndex[] = {
ENAND_ANIM_0, ENAND_ANIM_1, ENAND_ANIM_2, ENAND_ANIM_3, ENAND_ANIM_5, ENAND_ANIM_7,
};
u16 cueId;
s32 cueChannel;
if (play->csCtx.state != CS_STATE_IDLE) {
@@ -74,15 +89,15 @@ void EnAnd_HandleCutscene(EnAnd* this, PlayState* play) {
}
if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_565)) {
cueChannel = Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_565);
cueType = play->csCtx.actorCues[cueChannel]->id;
if (this->cueId != (u8)cueType) {
this->cueId = cueType;
EnAnd_ChangeAnim(this, csAnimations[cueType]);
cueId = play->csCtx.actorCues[cueChannel]->id;
if (this->cueId != (u8)cueId) {
this->cueId = cueId;
EnAnd_ChangeAnim(this, csAnimIndex[cueId]);
}
switch (this->cueId) {
case 3:
case 4:
if ((this->animIndex == 3) || (this->animIndex == 5)) {
if ((this->animIndex == ENAND_ANIM_3) || (this->animIndex == ENAND_ANIM_5)) {
if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
EnAnd_ChangeAnim(this, this->animIndex + 1);
}
@@ -106,8 +121,8 @@ void EnAnd_Init(Actor* thisx, PlayState* play) {
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 14.0f);
SkelAnime_InitFlex(play, &this->skelAnime, &gAndSkel, NULL, this->jointTable, this->morphTable,
OBJECT_AND_LIMB_MAX);
this->animIndex = -1;
EnAnd_ChangeAnim(this, 0);
this->animIndex = ENAND_ANIM_NONE;
EnAnd_ChangeAnim(this, ENAND_ANIM_0);
Actor_SetScale(&this->actor, 0.01f);
this->actor.flags &= ~ACTOR_FLAG_1;
this->flags |= 8;
+23 -22
View File
@@ -45,12 +45,13 @@ ActorInit En_Aob_01_InitVars = {
};
typedef enum {
/* 0 */ EN_AOB01_ANIM_IDLE_1,
/* 0 */ EN_AOB01_ANIM_IDLE,
/* 1 */ EN_AOB01_ANIM_LAUGH_START,
/* 2 */ EN_AOB01_ANIM_LAUGH_LOOP,
/* 3 */ EN_AOB01_ANIM_SURPRISE_START,
/* 4 */ EN_AOB01_ANIM_SURPRISE_LOOP,
/* 5 */ EN_AOB01_ANIM_IDLE_2
/* 5 */ EN_AOB01_ANIM_IDLE_MORPH,
/* 6 */ EN_AOB01_ANIM_MAX
} EnAob01Animation;
typedef enum {
@@ -60,13 +61,13 @@ typedef enum {
/* 3 */ EN_AOB01_EYE_MAX
} EnAob01EyeTexture;
static AnimationInfo sAnimationInfo[] = {
{ &gMamamuYanIdleAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f },
{ &gMamamuYanLaughStartAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, 0.0f },
{ &gMamamuYanLaughLoopAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f },
{ &gMamamuYanSurpriseStartAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, 0.0f },
{ &gMamamuYanSurpriseLoopAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f },
{ &gMamamuYanIdleAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -6.0f },
static AnimationInfo sAnimationInfo[EN_AOB01_ANIM_MAX] = {
{ &gMamamuYanIdleAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f }, // EN_AOB01_ANIM_IDLE
{ &gMamamuYanLaughStartAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, 0.0f }, // EN_AOB01_ANIM_LAUGH_START
{ &gMamamuYanLaughLoopAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f }, // EN_AOB01_ANIM_LAUGH_LOOP
{ &gMamamuYanSurpriseStartAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, 0.0f }, // EN_AOB01_ANIM_SURPRISE_START
{ &gMamamuYanSurpriseLoopAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f }, // EN_AOB01_ANIM_SURPRISE_LOOP
{ &gMamamuYanIdleAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -6.0f }, // EN_AOB01_ANIM_IDLE_MORPH
};
static ColliderCylinderInit sCylinderInit = {
@@ -182,10 +183,10 @@ void EnAob01_SpawnRacedogs(EnAob01* this, PlayState* play) {
*/
s32 EnAob01_ProcessLaughAnim(EnAob01* this) {
s16 curFrame = this->skelAnime.curFrame;
s16 lastFrame = Animation_GetLastFrame(sAnimationInfo[this->animIndex].animation);
s16 endFrame = Animation_GetLastFrame(sAnimationInfo[this->animIndex].animation);
if (this->animIndex == EN_AOB01_ANIM_LAUGH_START) {
if (curFrame == lastFrame) {
if (curFrame == endFrame) {
this->animIndex = EN_AOB01_ANIM_LAUGH_LOOP;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, EN_AOB01_ANIM_LAUGH_LOOP);
return true;
@@ -206,16 +207,16 @@ s32 EnAob01_ProcessLaughAnim(EnAob01* this) {
*/
s32 EnAob01_ProcessSurpriseAnim(EnAob01* this) {
s16 curFrame = this->skelAnime.curFrame;
s16 lastFrame = Animation_GetLastFrame(sAnimationInfo[this->animIndex].animation);
s16 endFrame = Animation_GetLastFrame(sAnimationInfo[this->animIndex].animation);
if ((this->animIndex == EN_AOB01_ANIM_IDLE_1) || (this->animIndex == EN_AOB01_ANIM_IDLE_2)) {
if (curFrame == lastFrame) {
if ((this->animIndex == EN_AOB01_ANIM_IDLE) || (this->animIndex == EN_AOB01_ANIM_IDLE_MORPH)) {
if (curFrame == endFrame) {
this->animIndex = EN_AOB01_ANIM_SURPRISE_START;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, EN_AOB01_ANIM_SURPRISE_START);
return true;
}
} else if (this->animIndex == EN_AOB01_ANIM_SURPRISE_START) {
if (curFrame == lastFrame) {
if (curFrame == endFrame) {
this->animIndex = EN_AOB01_ANIM_SURPRISE_LOOP;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, EN_AOB01_ANIM_SURPRISE_LOOP);
return true;
@@ -234,12 +235,12 @@ s32 EnAob01_ProcessSurpriseAnim(EnAob01* this) {
*/
s32 EnAob01_ProcessIdleAnim(EnAob01* this) {
s16 curFrame = this->skelAnime.curFrame;
s16 lastFrame = Animation_GetLastFrame(sAnimationInfo[this->animIndex].animation);
s16 endFrame = Animation_GetLastFrame(sAnimationInfo[this->animIndex].animation);
if ((this->animIndex != EN_AOB01_ANIM_IDLE_1) && (this->animIndex != EN_AOB01_ANIM_IDLE_2)) {
if (curFrame == lastFrame) {
this->animIndex = EN_AOB01_ANIM_IDLE_2;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, EN_AOB01_ANIM_IDLE_2);
if ((this->animIndex != EN_AOB01_ANIM_IDLE) && (this->animIndex != EN_AOB01_ANIM_IDLE_MORPH)) {
if (curFrame == endFrame) {
this->animIndex = EN_AOB01_ANIM_IDLE_MORPH;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, EN_AOB01_ANIM_IDLE_MORPH);
return true;
}
} else {
@@ -1105,8 +1106,8 @@ void EnAob01_Init(Actor* thisx, PlayState* play) {
MAMAMU_YAN_LIMB_MAX);
Collider_InitCylinder(play, &this->collider);
Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit);
this->animIndex = EN_AOB01_ANIM_IDLE_1;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, EN_AOB01_ANIM_IDLE_1);
this->animIndex = EN_AOB01_ANIM_IDLE;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, EN_AOB01_ANIM_IDLE);
Actor_SetScale(&this->actor, 0.01f);
switch (GET_EVENTINF_DOG_RACE_STATE) {
@@ -85,7 +85,7 @@ void EnArrow_Init(Actor* thisx, PlayState* play) {
if (ARROW_IS_ARROW(this->actor.params)) {
SkelAnime_Init(play, &this->arrow.skelAnime, &gameplay_keep_Skel_014560, &gameplay_keep_Anim_0128BC,
this->arrow.jointTable, this->arrow.jointTable, 5);
this->arrow.jointTable, this->arrow.jointTable, ARROW_LIMB_MAX);
if (this->actor.params < ARROW_TYPE_FIRE) {
if (this->actor.params == ARROW_TYPE_NORMAL_HORSE) {
D_8088C234.elemDuration = 4;
@@ -193,6 +193,9 @@ void func_8088A594(EnArrow* this, PlayState* play) {
case ARROW_TYPE_DEKU_BUBBLE:
Player_PlaySfx(player, NA_SE_PL_DEKUNUTS_FIRE);
break;
default:
break;
}
this->actionFunc = func_8088ACE0;
@@ -2,6 +2,7 @@
#define Z_EN_ARROW_H
#include "global.h"
#include "objects/gameplay_keep/gameplay_keep.h"
struct EnArrow;
@@ -34,7 +35,7 @@ typedef enum ArrowMagic {
typedef struct {
/* 0x144 */ SkelAnime skelAnime;
/* 0x188 */ Vec3s jointTable[5];
/* 0x188 */ Vec3s jointTable[ARROW_LIMB_MAX];
} EnArrowArrow; // size = 0x1A8
typedef struct {
File diff suppressed because it is too large Load Diff
+3 -2
View File
@@ -2,6 +2,7 @@
#define Z_EN_AZ_H
#include "global.h"
#include "objects/object_az/object_az.h"
struct EnAz;
@@ -15,8 +16,8 @@ typedef struct EnAz {
/* 0x144 */ EnAzActionFunc actionFunc;
/* 0x148 */ SkelAnime skelAnime;
/* 0x18C */ ColliderCylinder collider;
/* 0x1D8 */ Vec3s jointTable[24];
/* 0x268 */ Vec3s morphTable[24];
/* 0x1D8 */ Vec3s jointTable[BEAVER_OLDER_BROTHER_LIMB_MAX]; // Also BEAVER_YOUNGER_BROTHER_LIMB_MAX
/* 0x268 */ Vec3s morphTable[BEAVER_OLDER_BROTHER_LIMB_MAX]; // Also BEAVER_YOUNGER_BROTHER_LIMB_MAX
/* 0x2F8 */ s16 unk_2F8;
/* 0x2FA */ s16 unk_2FA; // cutscene state?
/* 0x2FC */ s32 animIndex;
+4 -4
View File
@@ -15734,8 +15734,8 @@
0x80BD2404:("EnZov_PostLimbDraw",),
0x80BD24B4:("EnZov_Draw",),
0x80BD2A30:("func_80BD2A30",),
0x80BD2AE0:("func_80BD2AE0",),
0x80BD2B0C:("func_80BD2B0C",),
0x80BD2AE0:("EnAh_UpdateSkelAnime",),
0x80BD2B0C:("EnAh_ChangeAnim",),
0x80BD2BA4:("func_80BD2BA4",),
0x80BD2BE8:("func_80BD2BE8",),
0x80BD2C6C:("func_80BD2C6C",),
@@ -16000,8 +16000,8 @@
0x80BDE090:("func_80BDE090",),
0x80BDE11C:("EnTalk_Update",),
0x80BDE1A0:("func_80BDE1A0",),
0x80BDE250:("func_80BDE250",),
0x80BDE27C:("func_80BDE27C",),
0x80BDE250:("EnAl_UpdateSkelAnime",),
0x80BDE27C:("EnAl_ChangeAnim",),
0x80BDE318:("func_80BDE318",),
0x80BDE384:("func_80BDE384",),
0x80BDE408:("func_80BDE408",),