Make names related to animations more consistent (#998)

* Make names related to animations more consistent

* Standardize on sAnimationInfo

* Respond to hensldm's review

* Standardize on ChangeAnim

* Respond to hensldm's review

* Small formatting thing

* Consistency after merging master

* A few more things I missed

* Respond to Elliptic's review

* Some more stuff that was requested
This commit is contained in:
Tom Overton
2022-08-15 11:51:38 -07:00
committed by GitHub
parent 132dd6a373
commit 78684187fe
134 changed files with 2115 additions and 2100 deletions
+1 -1
View File
@@ -110,7 +110,7 @@ After naming the animations, the end result will look something like this:
Once again, we can run `./extract_assets.py -s objects/object_dns` to extract the object, and we can update the animation names in `z_en_dns.c` to use our new names like so:
```c
static AnimationInfoS sAnimations[] = {
static AnimationInfoS sAnimationInfo[] = {
{ &gKingsChamberDekuGuardIdleAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
{ &gKingsChamberDekuGuardIdleAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
{ &gKingsChamberDekuGuardWalkAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+2 -2
View File
@@ -757,7 +757,7 @@ s32 func_800BD2B4(PlayState* play, Actor* actor, s16* arg2, f32 arg3, u16 (*text
void func_800BD888(Actor* actor, struct_800BD888_arg1* arg1, s16 arg2, s16 arg3);
void func_800BD9E0(PlayState* play, SkelAnime* skelAnime, OverrideLimbDraw overrideLimbDraw, PostLimbDraw postLimbDraw, Actor* actor, s16 alpha);
void func_800BDAA0(PlayState* play, SkelAnime* skelAnime, OverrideLimbDraw overrideLimbDraw, PostLimbDraw postLimbDraw, Actor* actor, s16 alpha);
void Actor_ChangeAnimationByInfo(SkelAnime* skelAnime, AnimationInfo* animation, s32 index);
void Actor_ChangeAnimationByInfo(SkelAnime* skelAnime, AnimationInfo* animationInfo, s32 animIndex);
void Actor_Noop(Actor* actor, PlayState* play);
void Gfx_DrawDListOpa(PlayState* play, Gfx* dlist);
@@ -2219,7 +2219,7 @@ s16 SkelAnime_GetFrameDataLegacy(LegacyAnimationHeader* animation, s32 frame, Ve
s16 Animation_GetLimbCount2(LegacyAnimationHeader* animation);
s16 Animation_GetLength2(LegacyAnimationHeader* animation);
s16 Animation_GetLastFrame2(LegacyAnimationHeader* animation);
void SkelAnime_InterpFrameTable(s32 limbCount, Vec3s* dst, Vec3s* vec2, Vec3s* vec3, f32 unkf);
void SkelAnime_InterpFrameTable(s32 limbCount, Vec3s* dst, Vec3s* start, Vec3s* target, f32 weight);
void AnimationContext_Reset(AnimationContext* animationCtx);
void AnimationContext_SetNextQueue(PlayState* play);
void AnimationContext_DisableQueue(PlayState* play);
+2 -2
View File
@@ -104,7 +104,7 @@ Path* SubS_GetAdditionalPath(struct PlayState* play, u8 pathIndex, s32 max);
Actor* SubS_FindNearestActor(Actor* actor, struct PlayState* play, u8 actorCategory, s16 actorId);
s32 SubS_ChangeAnimationByInfoS(SkelAnime* skelAnime, AnimationInfoS* animations, s32 index);
s32 SubS_ChangeAnimationByInfoS(SkelAnime* skelAnime, AnimationInfoS* animationInfo, s32 animIndex);
s32 SubS_HasReachedPoint(Actor* actor, Path* path, s32 pointIndex);
@@ -151,7 +151,7 @@ s32 SubS_ActorPathing_MoveWithGravity(struct PlayState* play, ActorPathing* acto
s32 SubS_ActorPathing_MoveWithoutGravityReverse(struct PlayState* play, ActorPathing* actorPath);
s32 SubS_ActorPathing_SetNextPoint(struct PlayState* play, ActorPathing* actorPath);
void SubS_ChangeAnimationBySpeedInfo(SkelAnime* skelAnime, AnimationSpeedInfo* animations, s32 nextIndex, s32* curIndex);
void SubS_ChangeAnimationBySpeedInfo(SkelAnime* skelAnime, AnimationSpeedInfo* animationInfo, s32 nextAnimIndex, s32* curAnimIndex);
s32 SubS_StartActorCutscene(Actor* actor, s16 nextCutscene, s16 curCutscene, s32 type);
s32 SubS_FillCutscenesList(Actor* actor, s16 cutscenes[], s16 numCutscenes);
+22 -22
View File
@@ -10,28 +10,28 @@ struct EnHy;
//! TODO: Better animaion enum names when animations are documented
typedef enum {
/* 0 */ ENHY_ANIMATION_AOB_0,
/* 1 */ ENHY_ANIMATION_BOJ_1,
/* 2 */ ENHY_ANIMATION_BOJ_2,
/* 3 */ ENHY_ANIMATION_BOJ_3,
/* 4 */ ENHY_ANIMATION_BOJ_4,
/* 5 */ ENHY_ANIMATION_BOJ_5,
/* 6 */ ENHY_ANIMATION_BBA_6,
/* 7 */ ENHY_ANIMATION_BJI_7,
/* 8 */ ENHY_ANIMATION_BJI_8,
/* 9 */ ENHY_ANIMATION_BJI_9,
/* 10 */ ENHY_ANIMATION_BOJ_10,
/* 11 */ ENHY_ANIMATION_OS_ANIME_11,
/* 12 */ ENHY_ANIMATION_BOJ_12,
/* 13 */ ENHY_ANIMATION_BOJ_13,
/* 14 */ ENHY_ANIMATION_BOJ_14,
/* 15 */ ENHY_ANIMATION_BOJ_15,
/* 16 */ ENHY_ANIMATION_BOJ_16,
/* 17 */ ENHY_ANIMATION_BOJ_17,
/* 18 */ ENHY_ANIMATION_BOJ_18,
/* 19 */ ENHY_ANIMATION_BOJ_19,
/* 20 */ ENHY_ANIMATION_BOJ_20,
/* 21 */ ENHY_ANIMATION_MAX
/* 0 */ ENHY_ANIM_AOB_0,
/* 1 */ ENHY_ANIM_BOJ_1,
/* 2 */ ENHY_ANIM_BOJ_2,
/* 3 */ ENHY_ANIM_BOJ_3,
/* 4 */ ENHY_ANIM_BOJ_4,
/* 5 */ ENHY_ANIM_BOJ_5,
/* 6 */ ENHY_ANIM_BBA_6,
/* 7 */ ENHY_ANIM_BJI_7,
/* 8 */ ENHY_ANIM_BJI_8,
/* 9 */ ENHY_ANIM_BJI_9,
/* 10 */ ENHY_ANIM_BOJ_10,
/* 11 */ ENHY_ANIM_OS_ANIME_11,
/* 12 */ ENHY_ANIM_BOJ_12,
/* 13 */ ENHY_ANIM_BOJ_13,
/* 14 */ ENHY_ANIM_BOJ_14,
/* 15 */ ENHY_ANIM_BOJ_15,
/* 16 */ ENHY_ANIM_BOJ_16,
/* 17 */ ENHY_ANIM_BOJ_17,
/* 18 */ ENHY_ANIM_BOJ_18,
/* 19 */ ENHY_ANIM_BOJ_19,
/* 20 */ ENHY_ANIM_BOJ_20,
/* 21 */ ENHY_ANIM_MAX
} EnHyAnimation;
typedef void (*EnHyActionFunc)(struct EnHy*, PlayState*);
+7 -7
View File
@@ -4293,18 +4293,18 @@ s16 func_800BDB6C(Actor* actor, PlayState* play, s16 arg2, f32 arg3) {
return arg2;
}
void Actor_ChangeAnimationByInfo(SkelAnime* skelAnime, AnimationInfo* animation, s32 index) {
void Actor_ChangeAnimationByInfo(SkelAnime* skelAnime, AnimationInfo* animationInfo, s32 animIndex) {
f32 frameCount;
animation += index;
if (animation->frameCount > 0.0f) {
frameCount = animation->frameCount;
animationInfo += animIndex;
if (animationInfo->frameCount > 0.0f) {
frameCount = animationInfo->frameCount;
} else {
frameCount = Animation_GetLastFrame(&animation->animation->common);
frameCount = Animation_GetLastFrame(&animationInfo->animation->common);
}
Animation_Change(skelAnime, animation->animation, animation->playSpeed, animation->startFrame, frameCount,
animation->mode, animation->morphFrames);
Animation_Change(skelAnime, animationInfo->animation, animationInfo->playSpeed, animationInfo->startFrame,
frameCount, animationInfo->mode, animationInfo->morphFrames);
}
// Unused
+7 -7
View File
@@ -11,7 +11,7 @@
#include "objects/object_boj/object_boj.h"
#include "objects/object_os_anime/object_os_anime.h"
static AnimationInfoS sAnimations[] = {
static AnimationInfoS sAnimationInfo[] = {
{ &gMamamuYanUnusedIdleAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
{ &object_boj_Anim_001494, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
{ &object_boj_Anim_001494, 1.0f, 0, -1, ANIMMODE_LOOP, -8 },
@@ -45,15 +45,15 @@ s32 EnHy_ChangeAnim(SkelAnime* skelAnime, s16 animIndex) {
s16 frameCount;
s32 isChanged = false;
if (animIndex >= ENHY_ANIMATION_AOB_0 && animIndex < ENHY_ANIMATION_MAX) {
if (animIndex >= ENHY_ANIM_AOB_0 && animIndex < ENHY_ANIM_MAX) {
isChanged = true;
frameCount = sAnimations[animIndex].frameCount;
frameCount = sAnimationInfo[animIndex].frameCount;
if (frameCount < 0) {
frameCount = Animation_GetLastFrame(&sAnimations[animIndex].animation->common);
frameCount = Animation_GetLastFrame(&sAnimationInfo[animIndex].animation->common);
}
Animation_Change(skelAnime, sAnimations[animIndex].animation, sAnimations[animIndex].playSpeed,
sAnimations[animIndex].startFrame, frameCount, sAnimations[animIndex].mode,
sAnimations[animIndex].morphFrames);
Animation_Change(skelAnime, sAnimationInfo[animIndex].animation, sAnimationInfo[animIndex].playSpeed,
sAnimationInfo[animIndex].startFrame, frameCount, sAnimationInfo[animIndex].mode,
sAnimationInfo[animIndex].morphFrames);
}
return isChanged;
}
+10 -10
View File
@@ -924,30 +924,30 @@ s16 Animation_GetLastFrame2(LegacyAnimationHeader* animation) {
}
/**
* Linearly interpolates the start and tactoret frame tables with the given weight, putting the result in dst
* Linearly interpolates the start and target frame tables with the given weight, putting the result in dst
*/
void SkelAnime_InterpFrameTable(s32 limbCount, Vec3s* dst, Vec3s* start, Vec3s* tactoret, f32 weight) {
void SkelAnime_InterpFrameTable(s32 limbCount, Vec3s* dst, Vec3s* start, Vec3s* target, f32 weight) {
s32 i;
s16 diff;
s16 base;
if (weight < 1.0f) {
for (i = 0; i < limbCount; i++, dst++, start++, tactoret++) {
for (i = 0; i < limbCount; i++, dst++, start++, target++) {
base = start->x;
diff = tactoret->x - base;
diff = target->x - base;
dst->x = (s16)(diff * weight) + base;
base = start->y;
diff = tactoret->y - base;
diff = target->y - base;
dst->y = (s16)(diff * weight) + base;
base = start->z;
diff = tactoret->z - base;
diff = target->z - base;
dst->z = (s16)(diff * weight) + base;
}
} else {
for (i = 0; i < limbCount; i++, dst++, tactoret++) {
dst->x = tactoret->x;
dst->y = tactoret->y;
dst->z = tactoret->z;
for (i = 0; i < limbCount; i++, dst++, target++) {
dst->x = target->x;
dst->y = target->y;
dst->z = target->z;
}
}
}
+16 -16
View File
@@ -531,24 +531,24 @@ Actor* SubS_FindNearestActor(Actor* actor, PlayState* play, u8 actorCategory, s1
return closestActor;
}
s32 SubS_ChangeAnimationByInfoS(SkelAnime* skelAnime, AnimationInfoS* animations, s32 index) {
s32 SubS_ChangeAnimationByInfoS(SkelAnime* skelAnime, AnimationInfoS* animationInfo, s32 animIndex) {
s32 endFrame;
s32 startFrame;
animations += index;
endFrame = animations->frameCount;
if (animations->frameCount < 0) {
endFrame = Animation_GetLastFrame(&animations->animation->common);
animationInfo += animIndex;
endFrame = animationInfo->frameCount;
if (animationInfo->frameCount < 0) {
endFrame = Animation_GetLastFrame(&animationInfo->animation->common);
}
startFrame = animations->startFrame;
startFrame = animationInfo->startFrame;
if (startFrame >= endFrame || startFrame < 0) {
return false;
}
if (animations->playSpeed < 0.0f) {
if (animationInfo->playSpeed < 0.0f) {
SWAP(s32, endFrame, startFrame);
}
Animation_Change(skelAnime, animations->animation, animations->playSpeed, startFrame, endFrame, animations->mode,
animations->morphFrames);
Animation_Change(skelAnime, animationInfo->animation, animationInfo->playSpeed, startFrame, endFrame,
animationInfo->mode, animationInfo->morphFrames);
return true;
}
@@ -1357,21 +1357,21 @@ s32 SubS_ActorPathing_SetNextPoint(PlayState* play, ActorPathing* actorPath) {
return reupdate;
}
void SubS_ChangeAnimationBySpeedInfo(SkelAnime* skelAnime, AnimationSpeedInfo* animations, s32 nextIndex,
s32* curIndex) {
AnimationSpeedInfo* animation = &animations[nextIndex];
void SubS_ChangeAnimationBySpeedInfo(SkelAnime* skelAnime, AnimationSpeedInfo* animationInfo, s32 nextAnimIndex,
s32* curAnimIndex) {
AnimationSpeedInfo* animation = &animationInfo[nextAnimIndex];
f32 startFrame = skelAnime->curFrame;
f32 endFrame;
f32 morphFrames;
if ((*curIndex < 0) || (nextIndex == *curIndex)) {
if ((*curAnimIndex < 0) || (nextAnimIndex == *curAnimIndex)) {
morphFrames = 0.0f;
if (*curIndex < 0) {
if (*curAnimIndex < 0) {
startFrame = 0.0f;
}
} else {
morphFrames = animation->morphFrames;
if (nextIndex != *curIndex) {
if (nextAnimIndex != *curAnimIndex) {
startFrame = 0.0f;
}
}
@@ -1383,7 +1383,7 @@ void SubS_ChangeAnimationBySpeedInfo(SkelAnime* skelAnime, AnimationSpeedInfo* a
}
Animation_Change(skelAnime, animation->animation, animation->playSpeed, startFrame, endFrame, animation->mode,
morphFrames);
*curIndex = nextIndex;
*curAnimIndex = nextAnimIndex;
}
s32 SubS_StartActorCutscene(Actor* actor, s16 nextCutscene, s16 curCutscene, s32 type) {
+15 -10
View File
@@ -27,16 +27,21 @@ const ActorInit Dm_Al_InitVars = {
(ActorFunc)DmAl_Draw,
};
static AnimationInfoS sAnimationInfos[] = {
typedef enum {
/* 0 */ MADAME_AROMA_ANIM_0,
/* 1 */ MADAME_AROMA_ANIM_1
} DmAlAnimation;
static AnimationInfoS sAnimationInfo[] = {
{ &object_al_Anim_00DBE0, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
};
s32 DmAl_ChangeAnimation(DmAl* this, s32 animationIndex) {
s32 DmAl_ChangeAnim(DmAl* this, s32 animIndex) {
s32 didAnimationChange = false;
if (animationIndex != this->animationIndex) {
this->animationIndex = animationIndex;
didAnimationChange = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfos, animationIndex);
if (animIndex != this->animIndex) {
this->animIndex = animIndex;
didAnimationChange = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, animIndex);
}
return didAnimationChange;
}
@@ -50,20 +55,20 @@ void func_80C1BDD8(DmAl* this, PlayState* play) {
if (!this->unk_45C) {
this->action = 0xFF;
this->unk_45C = true;
this->animationIndex2 = this->animationIndex;
this->animIndex2 = this->animIndex;
}
if (Cutscene_CheckActorAction(play, 0x232)) {
actionIndex = Cutscene_GetActorActionIndex(play, 0x232);
csAction = play->csCtx.actorActions[actionIndex]->action;
if (this->action != (u8)csAction) {
this->action = csAction;
DmAl_ChangeAnimation(this, D_80C1C280[csAction]);
DmAl_ChangeAnim(this, D_80C1C280[csAction]);
}
Cutscene_ActorTranslateAndYaw(&this->actor, play, actionIndex);
}
} else if (this->unk_45C) {
this->unk_45C = false;
DmAl_ChangeAnimation(this, this->animationIndex2);
DmAl_ChangeAnim(this, this->animIndex2);
}
}
@@ -73,8 +78,8 @@ void DmAl_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->animationIndex = -1;
DmAl_ChangeAnimation(this, MADAME_AROMA_ANIMATION_0);
this->animIndex = -1;
DmAl_ChangeAnim(this, MADAME_AROMA_ANIM_0);
this->actor.flags &= ~ACTOR_FLAG_1;
Actor_SetScale(&this->actor, 0.01f);
this->actionFunc = func_80C1BDD8;
+2 -7
View File
@@ -16,16 +16,11 @@ typedef struct DmAl {
/* 0x30C */ Vec3s jointTable[MADAME_AROMA_LIMB_MAX];
/* 0x3AE */ Vec3s morphTable[MADAME_AROMA_LIMB_MAX];
/* 0x450 */ u8 action;
/* 0x454 */ s32 animationIndex;
/* 0x458 */ s32 animationIndex2;
/* 0x454 */ s32 animIndex;
/* 0x458 */ s32 animIndex2;
/* 0x45C */ s32 unk_45C;
} DmAl; // size = 0x460
typedef enum {
/* 0x0 */ MADAME_AROMA_ANIMATION_0,
/* 0x1 */ MADAME_AROMA_ANIMATION_1
} DmAlAnimations;
extern const ActorInit Dm_Al_InitVars;
#endif // Z_DM_AL_H
+2 -2
View File
@@ -33,7 +33,7 @@ const ActorInit Dm_An_InitVars = {
(ActorFunc)NULL,
};
static AnimationInfoS sAnimations[] = {
static AnimationInfoS sAnimationInfo[] = {
{ &object_an1_Anim_007E08, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
{ &object_an1_Anim_0071E8, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
{ &object_an4_Anim_006CC0, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
@@ -83,7 +83,7 @@ s32 func_80C1C4D8(DmAn* this, PlayState* play, s32 arg2) {
if ((objectIndex2 >= 0) && (arg2 != this->unk_2C8)) {
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[objectIndex2].segment);
this->unk_2C8 = arg2;
ret = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, arg2);
ret = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, arg2);
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[objectIndex].segment);
}
return ret;
+4 -4
View File
@@ -30,7 +30,7 @@ const ActorInit Dm_Bal_InitVars = {
(ActorFunc)DmBal_Draw,
};
static AnimationInfo D_80C1F170[] = {
static AnimationInfo sAnimationInfo[] = {
{ &object_bal_Anim_0005FC, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f },
{ &object_bal_Anim_000840, 1.5f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f },
{ &object_bal_Anim_000840, 1.5f, 0.0f, 0.0f, ANIMMODE_ONCE, -4.0f },
@@ -86,14 +86,14 @@ void func_80C1EAE8(DmBal* this, PlayState* play) {
case 1:
this->unk_336 = 0;
this->eyeIndex = 0;
Actor_ChangeAnimationByInfo(&this->skelAnime, D_80C1F170, 0);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 0);
break;
case 2:
this->unk_336 = 1;
Actor_ChangeAnimationByInfo(&this->skelAnime, D_80C1F170, 12);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 12);
break;
case 3:
Actor_ChangeAnimationByInfo(&this->skelAnime, D_80C1F170, 13);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 13);
break;
}
} else if (D_80C1F2C0 == 3) {
+10 -10
View File
@@ -32,7 +32,7 @@ const ActorInit Dm_Char00_InitVars = {
(ActorFunc)DmChar00_Draw,
};
static AnimationInfo sAnimations[] = {
static AnimationInfo sAnimationInfo[] = {
{ &gameplay_keep_Anim_02B2E8, 1.0f, 0.0f, -1.0f, 0, 0.0f },
{ &gameplay_keep_Anim_029140, 1.0f, 0.0f, -1.0f, 0, 0.0f },
{ &object_delf_Anim_004FF4, 1.0f, 0.0f, -1.0f, 2, 0.0f },
@@ -542,7 +542,7 @@ void DmChar00_Init(Actor* thisx, PlayState* play) {
SkelAnime_Init(play, &this->skelAnime, &gameplay_keep_Skel_02AF58.sh, &gameplay_keep_Anim_029140, this->jointTable,
this->morphTable, 7);
ActorShape_Init(&thisx->shape, 0.0f, NULL, 15.0f);
func_80AA5580(&this->skelAnime, sAnimations, 0);
func_80AA5580(&this->skelAnime, sAnimationInfo, 0);
Actor_SetScale(thisx, 0.01f);
this->actionFunc = func_80AA67F8;
}
@@ -783,7 +783,7 @@ void func_80AA62FC(DmChar00* this, PlayState* play) {
this->unk_261 = 0;
break;
}
func_80AA5580(&this->skelAnime, &sAnimations[this->unk_261], 0);
func_80AA5580(&this->skelAnime, &sAnimationInfo[this->unk_261], 0);
}
}
Cutscene_ActorTranslateAndYaw(&this->actor, play, temp_v0);
@@ -796,7 +796,7 @@ void func_80AA62FC(DmChar00* this, PlayState* play) {
case 0x4:
case 0x5:
this->unk_261 += 4;
func_80AA5580(&this->skelAnime, &sAnimations[this->unk_261], 0);
func_80AA5580(&this->skelAnime, &sAnimationInfo[this->unk_261], 0);
this->skelAnime.curFrame = 37.0f;
break;
@@ -805,7 +805,7 @@ void func_80AA62FC(DmChar00* this, PlayState* play) {
case 0x14:
case 0x15:
this->unk_261 += 2;
func_80AA5580(&this->skelAnime, &sAnimations[this->unk_261], 0);
func_80AA5580(&this->skelAnime, &sAnimationInfo[this->unk_261], 0);
break;
case 0xA:
@@ -833,18 +833,18 @@ void func_80AA62FC(DmChar00* this, PlayState* play) {
case 0x50:
case 0x53:
this->unk_261 += 1;
func_80AA5580(&this->skelAnime, &sAnimations[this->unk_261], 0);
func_80AA5580(&this->skelAnime, &sAnimationInfo[this->unk_261], 0);
break;
case 0x2D:
this->unk_261 = 19;
func_80AA5580(&this->skelAnime, &sAnimations[this->unk_261], 0);
func_80AA5580(&this->skelAnime, &sAnimationInfo[this->unk_261], 0);
break;
case 0x46:
case 0x4D:
this->unk_261 = 0;
func_80AA5580(&this->skelAnime, &sAnimations[this->unk_261], 0);
func_80AA5580(&this->skelAnime, &sAnimationInfo[this->unk_261], 0);
break;
}
}
@@ -856,7 +856,7 @@ void func_80AA67F8(DmChar00* this, PlayState* play) {
if ((play->csCtx.state == 0) && (gSaveContext.sceneSetupIndex == 0) && (play->csCtx.currentCsIndex == 1)) {
if (this->unk_261 != 42) {
this->unk_261 = 42;
func_80AA5580(&this->skelAnime, &sAnimations[this->unk_261], 0);
func_80AA5580(&this->skelAnime, &sAnimationInfo[this->unk_261], 0);
}
Math_SmoothStepToF(&this->actor.world.pos.x, 0.0f, 0.5f, 0.5f, 0.001f);
@@ -865,7 +865,7 @@ void func_80AA67F8(DmChar00* this, PlayState* play) {
if (player->actor.world.pos.z < -625.0f) {
this->unk_261 = 43;
func_80AA5580(&this->skelAnime, &sAnimations[this->unk_261], 0);
func_80AA5580(&this->skelAnime, &sAnimationInfo[this->unk_261], 0);
this->actionFunc = func_80AA695C;
this->skelAnime.playSpeed = 1.5f;
}
+22 -22
View File
@@ -32,32 +32,32 @@ const ActorInit Dm_Char02_InitVars = {
};
typedef enum {
/* 0 */ DMCHAR02_ANIMATION_HIT_GROUND,
/* 1 */ DMCHAR02_ANIMATION_TURN_AROUND,
/* 2 */ DMCHAR02_ANIMATION_JUGGLE,
/* 3 */ DMCHAR02_ANIMATION_FALL,
} DmChar02AnimationIndex;
/* 0 */ DMCHAR02_ANIM_HIT_GROUND,
/* 1 */ DMCHAR02_ANIM_TURN_AROUND,
/* 2 */ DMCHAR02_ANIM_JUGGLE,
/* 3 */ DMCHAR02_ANIM_FALL,
} DmChar02Animation;
static AnimationInfo sAnimations[] = {
static AnimationInfo sAnimationInfo[] = {
{ &gClockTowerOcarinaOfTimeHitGroundAnim, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f },
{ &gClockTowerOcarinaOfTimeTurnAroundAnim, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f },
{ &gClockTowerOcarinaOfTimeJuggleAnim, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f },
{ &gClockTowerOcarinaOfTimeFallAnim, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f },
};
void DmChar02_ChangeAnimation(SkelAnime* skelAnime, AnimationInfo* animation, u16 index) {
void DmChar02_ChangeAnim(SkelAnime* skelAnime, AnimationInfo* animationInfo, u16 animIndex) {
f32 frameCount;
animation += index;
animationInfo += animIndex;
if (animation->frameCount < 0.0f) {
frameCount = Animation_GetLastFrame(animation->animation);
if (animationInfo->frameCount < 0.0f) {
frameCount = Animation_GetLastFrame(animationInfo->animation);
} else {
frameCount = animation->frameCount;
frameCount = animationInfo->frameCount;
}
Animation_Change(skelAnime, animation->animation, animation->playSpeed, animation->startFrame, frameCount,
animation->mode, animation->morphFrames);
Animation_Change(skelAnime, animationInfo->animation, animationInfo->playSpeed, animationInfo->startFrame,
frameCount, animationInfo->mode, animationInfo->morphFrames);
}
void DmChar02_PlaySfxForDroppingOcarinaCutscene(DmChar02* this, PlayState* play) {
@@ -84,11 +84,11 @@ void DmChar02_Init(Actor* thisx, PlayState* play) {
DmChar02* this = THIS;
if (gSaveContext.save.inventory.items[SLOT_OCARINA] == ITEM_NONE) {
this->animIndex = DMCHAR02_ANIMATION_HIT_GROUND;
this->animIndex = DMCHAR02_ANIM_HIT_GROUND;
this->actor.targetArrowOffset = 3000.0f;
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 24.0f);
SkelAnime_InitFlex(play, &this->skelAnime, &gClockTowerOcarinaOfTimeSkel, NULL, NULL, NULL, 0);
DmChar02_ChangeAnimation(&this->skelAnime, sAnimations, 0);
DmChar02_ChangeAnim(&this->skelAnime, sAnimationInfo, 0);
Actor_SetScale(&this->actor, 0.01f);
this->actionFunc = DmChar02_PerformCutsceneActions;
} else {
@@ -108,25 +108,25 @@ void DmChar02_PerformCutsceneActions(DmChar02* this, PlayState* play) {
if (play->csCtx.frames == play->csCtx.actorActions[actionIndex]->startFrame) {
switch (play->csCtx.actorActions[actionIndex]->action) {
default:
this->animIndex = DMCHAR02_ANIMATION_HIT_GROUND;
this->animIndex = DMCHAR02_ANIM_HIT_GROUND;
shouldChangeAnimation = false;
break;
case 1:
this->animIndex = DMCHAR02_ANIMATION_HIT_GROUND;
this->animIndex = DMCHAR02_ANIM_HIT_GROUND;
break;
case 2:
this->animIndex = DMCHAR02_ANIMATION_TURN_AROUND;
this->animIndex = DMCHAR02_ANIM_TURN_AROUND;
break;
case 4:
this->animIndex = DMCHAR02_ANIMATION_FALL;
this->animIndex = DMCHAR02_ANIM_FALL;
break;
}
if (shouldChangeAnimation) {
DmChar02_ChangeAnimation(&this->skelAnime, &sAnimations[this->animIndex], 0);
DmChar02_ChangeAnim(&this->skelAnime, &sAnimationInfo[this->animIndex], 0);
}
}
@@ -134,9 +134,9 @@ void DmChar02_PerformCutsceneActions(DmChar02* this, PlayState* play) {
}
if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
if (this->animIndex == DMCHAR02_ANIMATION_TURN_AROUND) {
if (this->animIndex == DMCHAR02_ANIM_TURN_AROUND) {
this->animIndex++;
DmChar02_ChangeAnimation(&this->skelAnime, &sAnimations[this->animIndex], 0);
DmChar02_ChangeAnim(&this->skelAnime, &sAnimationInfo[this->animIndex], 0);
}
}
}
+10 -10
View File
@@ -32,20 +32,20 @@ const ActorInit Dm_Char03_InitVars = {
(ActorFunc)DmChar03_Draw,
};
AnimationInfo sAnimations[] = { { &object_osn_Anim_020530, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f } };
AnimationInfo sAnimationInfo[] = { { &object_osn_Anim_020530, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f } };
void DmChar03_ChangeAnimation(SkelAnime* skelAnime, AnimationInfo* animInfo, u16 index) {
void DmChar03_ChangeAnim(SkelAnime* skelAnime, AnimationInfo* animationInfo, u16 animIndex) {
f32 frame;
animInfo += index;
animationInfo += animIndex;
if (animInfo->frameCount < 0.0f) {
frame = Animation_GetLastFrame(animInfo->animation);
if (animationInfo->frameCount < 0.0f) {
frame = Animation_GetLastFrame(animationInfo->animation);
} else {
frame = animInfo->frameCount;
frame = animationInfo->frameCount;
}
Animation_Change(skelAnime, animInfo->animation, animInfo->playSpeed, animInfo->startFrame, frame, animInfo->mode,
animInfo->morphFrames);
Animation_Change(skelAnime, animationInfo->animation, animationInfo->playSpeed, animationInfo->startFrame, frame,
animationInfo->mode, animationInfo->morphFrames);
}
void DmChar03_Init(Actor* thisx, PlayState* play) {
@@ -56,7 +56,7 @@ void DmChar03_Init(Actor* thisx, PlayState* play) {
this->unk_18E = false;
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 24.0f);
SkelAnime_InitFlex(play, &this->skelAnime, &gDekuMaskSkel, NULL, NULL, NULL, 0);
DmChar03_ChangeAnimation(&this->skelAnime, sAnimations, 0);
DmChar03_ChangeAnim(&this->skelAnime, sAnimationInfo, 0);
Actor_SetScale(&this->actor, 0.01f);
this->actionFunc = DmChar03_DoNothing;
}
@@ -119,7 +119,7 @@ void func_80AAB710(DmChar03* this, PlayState* play) {
}
if (shouldChangeAnim) {
DmChar03_ChangeAnimation(&this->skelAnime, &sAnimations[this->animIndex], 0);
DmChar03_ChangeAnim(&this->skelAnime, &sAnimationInfo[this->animIndex], 0);
}
}
Cutscene_ActorTranslateAndYaw(&this->actor, play, index);
@@ -30,10 +30,10 @@ const ActorInit Dm_Char04_InitVars = {
(ActorFunc)DmChar04_Draw,
};
void DmChar04_ChangeAnim(SkelAnime* skelAnime, AnimationInfo* animation, u16 index) {
void DmChar04_ChangeAnim(SkelAnime* skelAnime, AnimationInfo* animation, u16 animIndex) {
f32 endFrame;
animation += index;
animation += animIndex;
if (animation->frameCount < 0.0f) {
endFrame = Animation_GetLastFrame(animation->animation);
@@ -44,7 +44,7 @@ void DmChar04_ChangeAnim(SkelAnime* skelAnime, AnimationInfo* animation, u16 ind
animation->mode, animation->morphFrames);
}
static AnimationInfo sAnimations[] = {
static AnimationInfo sAnimationInfo[] = {
{ &gameplay_keep_Anim_02B2E8, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f },
{ &gameplay_keep_Anim_029140, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f },
};
@@ -72,7 +72,7 @@ void DmChar04_Init(Actor* thisx, PlayState* play) {
SkelAnime_Init(play, &this->skelAnime, &gameplay_keep_Skel_02AF58.sh, &gameplay_keep_Anim_029140, this->jointTable,
this->morphTable, 7);
ActorShape_Init(&this->actor.shape, 0.0f, NULL, 15.0f);
DmChar04_ChangeAnim(&this->skelAnime, sAnimations, 0);
DmChar04_ChangeAnim(&this->skelAnime, sAnimationInfo, 0);
Actor_SetScale(&this->actor, 0.01f);
this->actionFunc = func_80AABE34;
}
@@ -90,11 +90,11 @@ void func_80AABE34(DmChar04* this, PlayState* play) {
if (this->csAction != play->csCtx.actorActions[actionIndex]->action) {
this->csAction = play->csCtx.actorActions[actionIndex]->action;
if (play->csCtx.actorActions[actionIndex]->action == 1) {
this->animationIndex = 0;
this->animIndex = 0;
} else {
this->animationIndex = 0;
this->animIndex = 0;
}
DmChar04_ChangeAnim(&this->skelAnime, &sAnimations[this->animationIndex], 0);
DmChar04_ChangeAnim(&this->skelAnime, &sAnimationInfo[this->animIndex], 0);
}
}
Cutscene_ActorTranslateAndYaw(&this->actor, play, actionIndex);
@@ -16,7 +16,7 @@ typedef struct DmChar04 {
/* 0x240 */ Color_RGBAf primColors;
/* 0x250 */ Color_RGBAf envColors;
/* 0x260 */ u8 csAction;
/* 0x261 */ u8 animationIndex;
/* 0x261 */ u8 animIndex;
/* 0x262 */ u16 timer;
} DmChar04; // size = 0x264
+11 -11
View File
@@ -47,7 +47,7 @@ const ActorInit Dm_Char05_InitVars = {
(ActorFunc)DmChar05_Draw,
};
static AnimationInfo sAnimations[] = {
static AnimationInfo sAnimationInfo[] = {
{ &object_dmask_Anim_001090, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f },
{ &object_dmask_Anim_004288, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f },
{ &object_dmask_Anim_0001A8, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f },
@@ -76,9 +76,9 @@ void func_80AAC63C(Actor* thisx, PlayState* play) {
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 24.0f);
SkelAnime_Init(play, &this->skelAnime, &object_dmask_Skel_010B0, NULL, NULL, NULL, 0);
if (DMCHAR05_GET(&this->actor) == DMCHAR05_0) {
func_80AAC5A0(&this->skelAnime, &sAnimations[0], 0);
func_80AAC5A0(&this->skelAnime, &sAnimationInfo[0], 0);
} else {
func_80AAC5A0(&this->skelAnime, &sAnimations[1], 0);
func_80AAC5A0(&this->skelAnime, &sAnimationInfo[1], 0);
}
this->actionFunc = func_80AACC48;
}
@@ -88,7 +88,7 @@ void func_80AAC6E4(Actor* thisx, PlayState* play) {
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 24.0f);
SkelAnime_Init(play, &this->skelAnime, &object_dmask_Skel_042B0, NULL, NULL, NULL, 0);
func_80AAC5A0(&this->skelAnime, &sAnimations[1], 0);
func_80AAC5A0(&this->skelAnime, &sAnimationInfo[1], 0);
this->actionFunc = func_80AACC48;
}
@@ -97,7 +97,7 @@ void func_80AAC770(Actor* thisx, PlayState* play) {
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 24.0f);
SkelAnime_InitFlex(play, &this->skelAnime, &object_dmask_Skel_001D0, NULL, NULL, NULL, 0);
func_80AAC5A0(&this->skelAnime, &sAnimations[3], 0);
func_80AAC5A0(&this->skelAnime, &sAnimationInfo[3], 0);
this->actionFunc = func_80AACC48;
}
@@ -106,7 +106,7 @@ void func_80AAC7FC(Actor* thisx, PlayState* play) {
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 24.0f);
SkelAnime_Init(play, &this->skelAnime, &object_dmask_Skel_013D0, NULL, NULL, NULL, 0);
func_80AAC5A0(&this->skelAnime, &sAnimations[4], 0);
func_80AAC5A0(&this->skelAnime, &sAnimationInfo[4], 0);
this->actionFunc = func_80AACC48;
}
@@ -347,7 +347,7 @@ void func_80AACF04(DmChar05* this, PlayState* play) {
}
if (sp2F) {
func_80AAC5A0(&this->skelAnime, &sAnimations[this->unk_18C], 0);
func_80AAC5A0(&this->skelAnime, &sAnimationInfo[this->unk_18C], 0);
}
}
@@ -391,7 +391,7 @@ void func_80AACF04(DmChar05* this, PlayState* play) {
}
if (sp2F) {
func_80AAC5A0(&this->skelAnime, &sAnimations[this->unk_18C], 0);
func_80AAC5A0(&this->skelAnime, &sAnimationInfo[this->unk_18C], 0);
}
}
@@ -434,7 +434,7 @@ void func_80AACF04(DmChar05* this, PlayState* play) {
}
if (sp2F) {
func_80AAC5A0(&this->skelAnime, &sAnimations[this->unk_18C], 0);
func_80AAC5A0(&this->skelAnime, &sAnimationInfo[this->unk_18C], 0);
}
}
@@ -470,7 +470,7 @@ void func_80AACF04(DmChar05* this, PlayState* play) {
}
if (sp2F) {
func_80AAC5A0(&this->skelAnime, &sAnimations[this->unk_18C], 0);
func_80AAC5A0(&this->skelAnime, &sAnimationInfo[this->unk_18C], 0);
}
}
@@ -484,7 +484,7 @@ void func_80AACF04(DmChar05* this, PlayState* play) {
if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
if (this->unk_18C == 4) {
this->unk_18C++;
func_80AAC5A0(&this->skelAnime, &sAnimations[this->unk_18C], 0);
func_80AAC5A0(&this->skelAnime, &sAnimationInfo[this->unk_18C], 0);
}
}
break;
+2 -2
View File
@@ -33,7 +33,7 @@ const ActorInit Dm_Gm_InitVars = {
(ActorFunc)NULL,
};
static AnimationInfoS sAnimations[] = {
static AnimationInfoS sAnimationInfo[] = {
{ &object_an1_Anim_007E08, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
{ &object_an1_Anim_0071E8, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
{ &object_an4_Anim_006CC0, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
@@ -83,7 +83,7 @@ s32 func_80C24428(DmGm* this, PlayState* play, s32 arg2) {
if ((objectIndex2 >= 0) && (arg2 != this->unk_2C8)) {
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[objectIndex2].segment);
this->unk_2C8 = arg2;
ret = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, arg2);
ret = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, arg2);
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[objectIndex].segment);
}
return ret;
+2 -2
View File
@@ -28,14 +28,14 @@ const ActorInit Dm_Nb_InitVars = {
(ActorFunc)DmNb_Draw,
};
static AnimationInfoS D_80C1E200[] = { { &object_nb_Anim_000990, 1.0f, 0, -1, ANIMMODE_LOOP, 0 } };
static AnimationInfoS sAnimationInfo[] = { { &object_nb_Anim_000990, 1.0f, 0, -1, ANIMMODE_LOOP, 0 } };
s32 func_80C1DED0(DmNb* this, s32 arg1) {
s32 ret = false;
if (arg1 != this->unk1F0) {
this->unk1F0 = arg1;
ret = SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80C1E200, arg1);
ret = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, arg1);
}
return ret;
}
+2 -2
View File
@@ -30,7 +30,7 @@ const ActorInit Dm_Sa_InitVars = {
(ActorFunc)DmSa_Draw,
};
static AnimationInfo D_80A2ED00[] = { { &gSkullKidTPoseAnim, 1.0f, 0, -1.0f, ANIMMODE_LOOP, 0 } };
static AnimationInfo sAnimationInfo[] = { { &gSkullKidTPoseAnim, 1.0f, 0, -1.0f, ANIMMODE_LOOP, 0 } };
void func_80A2E960(SkelAnime* arg0, AnimationInfo* animations, u16 index) {
f32 frameCount;
@@ -53,7 +53,7 @@ void DmSa_Init(Actor* thisx, PlayState* play) {
this->actor.targetArrowOffset = 3000.0f;
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 24.0f);
SkelAnime_InitFlex(play, &this->skelAnime, &gSkullKidSkel, NULL, NULL, NULL, 0);
func_80A2E960(&this->skelAnime, D_80A2ED00, 0);
func_80A2E960(&this->skelAnime, sAnimationInfo, 0);
Actor_SetScale(&this->actor, 0.01f);
this->actionFunc = DmSa_DoNothing;
}
+202 -205
View File
@@ -37,79 +37,79 @@ void DmStk_ClockTower_IdleWithOcarina(DmStk* this, PlayState* play);
void DmStk_ClockTower_Idle(DmStk* this, PlayState* play);
typedef enum {
/* 0 */ SK_ANIMATION_SHAKE_HEAD,
/* 1 */ SK_ANIMATION_WALK,
/* 2 */ SK_ANIMATION_LOOK_AROUND, // Not used in the final game
/* 3 */ SK_ANIMATION_IDLE,
/* 4 */ SK_ANIMATION_UNUSED_IDLE, // Unused duplicate of SK_ANIMATION_IDLE
/* 5 */ SK_ANIMATION_BENT_OVER_HEAD_TWITCH,
/* 6 */ SK_ANIMATION_GLITCHY_HORSE_RIDE_START, // Not used in the final game
/* 7 */ SK_ANIMATION_RECLINING_FLOAT,
/* 8 */ SK_ANIMATION_CURSE_START,
/* 9 */ SK_ANIMATION_CURSE_LOOP,
/* 10 */ SK_ANIMATION_LAUGH_START,
/* 11 */ SK_ANIMATION_LAUGH_LOOP,
/* 12 */ SK_ANIMATION_HIDE_OCARINA_START,
/* 13 */ SK_ANIMATION_HIDE_OCARINA_LOOP,
/* 14 */ SK_ANIMATION_PICK_UP_OCARINA_AND_START_PLAYING,
/* 15 */ SK_ANIMATION_PLAY_OCARINA_AND_LAUGH,
/* 16 */ SK_ANIMATION_PICK_UP_OCARINA, // Not used in the final game
/* 17 */ SK_ANIMATION_LOOK_AT_OCARINA, // Not used in the final game
/* 18 */ SK_ANIMATION_KICK_OVER_LINK,
/* 19 */ SK_ANIMATION_SEARCH_LINK,
/* 20 */ SK_ANIMATION_UNUSED_KICK_OVER_LINK, // Unused duplicate of SK_ANIMATION_KICK_OVER_LINK
/* 21 */ SK_ANIMATION_UNUSED_SEARCH_LINK, // Unused duplicate of SK_ANIMATION_SEARCH_LINK
/* 22 */ SK_ANIMATION_HORSE_RIDE_START,
/* 23 */ SK_ANIMATION_HORSE_RIDE_LOOP,
/* 24 */ SK_ANIMATION_RAISE_MASK_START,
/* 25 */ SK_ANIMATION_RAISE_MASK_LOOP,
/* 26 */ SK_ANIMATION_LOWER_MASK,
/* 27 */ SK_ANIMATION_JUMP_WHILE_HIDING_OCARINA,
/* 28 */ SK_ANIMATION_HORSE_RIDE_AND_ROTATE, // Used when Link gets thrown off his horse
/* 29 */ SK_ANIMATION_PLAY_OCARINA_WHILE_FLOATING,
/* 30 */ SK_ANIMATION_FLOATING_TURN_AROUND,
/* 31 */ SK_ANIMATION_OCARINA_JUGGLE,
/* 32 */ SK_ANIMATION_CALL_DOWN_MOON_START,
/* 33 */ SK_ANIMATION_CALL_DOWN_MOON_LOOP,
/* 34 */ SK_ANIMATION_SMACK_FAIRY_START,
/* 35 */ SK_ANIMATION_SMACK_FAIRY_LOOP,
/* 36 */ SK_ANIMATION_HIT_BY_BUBBLE,
/* 37 */ SK_ANIMATION_DROP_OCARINA,
/* 38 */ SK_ANIMATION_FLOATING_ARMS_CROSSED,
/* 39 */ SK_ANIMATION_DEFLECT_ATTACK,
/* 40 */ SK_ANIMATION_TELESCOPE_LOOK_UP_START,
/* 41 */ SK_ANIMATION_TELESCOPE_LOOK_UP_LOOP,
/* 42 */ SK_ANIMATION_SURPRISE_START,
/* 43 */ SK_ANIMATION_SURPRISE_LOOP,
/* 44 */ SK_ANIMATION_LOOK_AROUND_FOR_GIANTS_START,
/* 45 */ SK_ANIMATION_LOOK_AROUND_FOR_GIANTS_LOOP,
/* 46 */ SK_ANIMATION_HOLD_HEAD_AND_SHAKE_START,
/* 47 */ SK_ANIMATION_HOLD_HEAD_AND_SHAKE_LOOP,
/* 48 */ SK_ANIMATION_HOLD_HEAD_AND_SCREAM_START,
/* 49 */ SK_ANIMATION_HOLD_HEAD_AND_SCREAM_LOOP,
/* 50 */ SK_ANIMATION_HUDDLE_WITH_FAIRIES,
/* 51 */ SK_ANIMATION_SEARCH_MASK_SALESMAN,
/* 52 */ SK_ANIMATION_HOLD_UP_MASK_START,
/* 53 */ SK_ANIMATION_HOLD_UP_MASK_LOOP,
/* 54 */ SK_ANIMATION_SHIVER,
/* 55 */ SK_ANIMATION_DRAW,
/* 56 */ SK_ANIMATION_BENT_OVER_LOOK_UP,
/* 57 */ SK_ANIMATION_SPANK,
/* 58 */ SK_ANIMATION_HIP_SHAKE_AND_JUMP,
/* 59 */ SK_ANIMATION_PLAY_FLUTE,
/* 60 */ SK_ANIMATION_CARTWHEEL,
/* 61 */ SK_ANIMATION_LIE_FLAT,
/* 62 */ SK_ANIMATION_DANGLE_FROM_MASK_START,
/* 63 */ SK_ANIMATION_DANGLE_FROM_MASK_LOOP,
/* 64 */ SK_ANIMATION_DROPPED_FROM_MASK,
/* 65 */ SK_ANIMATION_LOOK_UP_AT_GIANTS,
/* 66 */ SK_ANIMATION_ASHAMED_START,
/* 67 */ SK_ANIMATION_ASHAMED_LOOP,
/* 68 */ SK_ANIMATION_LOOK_LEFT_START,
/* 69 */ SK_ANIMATION_LOOK_LEFT_LOOP,
/* 70 */ SK_ANIMATION_SNIFF,
/* 71 */ SK_ANIMATION_LAUGH_AFTER_SNIFF,
} SkullKidAnimationIndex;
/* 0 */ SK_ANIM_SHAKE_HEAD,
/* 1 */ SK_ANIM_WALK,
/* 2 */ SK_ANIM_LOOK_AROUND, // Not used in the final game
/* 3 */ SK_ANIM_IDLE,
/* 4 */ SK_ANIM_UNUSED_IDLE, // Unused duplicate of SK_ANIM_IDLE
/* 5 */ SK_ANIM_BENT_OVER_HEAD_TWITCH,
/* 6 */ SK_ANIM_GLITCHY_HORSE_RIDE_START, // Not used in the final game
/* 7 */ SK_ANIM_RECLINING_FLOAT,
/* 8 */ SK_ANIM_CURSE_START,
/* 9 */ SK_ANIM_CURSE_LOOP,
/* 10 */ SK_ANIM_LAUGH_START,
/* 11 */ SK_ANIM_LAUGH_LOOP,
/* 12 */ SK_ANIM_HIDE_OCARINA_START,
/* 13 */ SK_ANIM_HIDE_OCARINA_LOOP,
/* 14 */ SK_ANIM_PICK_UP_OCARINA_AND_START_PLAYING,
/* 15 */ SK_ANIM_PLAY_OCARINA_AND_LAUGH,
/* 16 */ SK_ANIM_PICK_UP_OCARINA, // Not used in the final game
/* 17 */ SK_ANIM_LOOK_AT_OCARINA, // Not used in the final game
/* 18 */ SK_ANIM_KICK_OVER_LINK,
/* 19 */ SK_ANIM_SEARCH_LINK,
/* 20 */ SK_ANIM_UNUSED_KICK_OVER_LINK, // Unused duplicate of SK_ANIM_KICK_OVER_LINK
/* 21 */ SK_ANIM_UNUSED_SEARCH_LINK, // Unused duplicate of SK_ANIM_SEARCH_LINK
/* 22 */ SK_ANIM_HORSE_RIDE_START,
/* 23 */ SK_ANIM_HORSE_RIDE_LOOP,
/* 24 */ SK_ANIM_RAISE_MASK_START,
/* 25 */ SK_ANIM_RAISE_MASK_LOOP,
/* 26 */ SK_ANIM_LOWER_MASK,
/* 27 */ SK_ANIM_JUMP_WHILE_HIDING_OCARINA,
/* 28 */ SK_ANIM_HORSE_RIDE_AND_ROTATE, // Used when Link gets thrown off his horse
/* 29 */ SK_ANIM_PLAY_OCARINA_WHILE_FLOATING,
/* 30 */ SK_ANIM_FLOATING_TURN_AROUND,
/* 31 */ SK_ANIM_OCARINA_JUGGLE,
/* 32 */ SK_ANIM_CALL_DOWN_MOON_START,
/* 33 */ SK_ANIM_CALL_DOWN_MOON_LOOP,
/* 34 */ SK_ANIM_SMACK_FAIRY_START,
/* 35 */ SK_ANIM_SMACK_FAIRY_LOOP,
/* 36 */ SK_ANIM_HIT_BY_BUBBLE,
/* 37 */ SK_ANIM_DROP_OCARINA,
/* 38 */ SK_ANIM_FLOATING_ARMS_CROSSED,
/* 39 */ SK_ANIM_DEFLECT_ATTACK,
/* 40 */ SK_ANIM_TELESCOPE_LOOK_UP_START,
/* 41 */ SK_ANIM_TELESCOPE_LOOK_UP_LOOP,
/* 42 */ SK_ANIM_SURPRISE_START,
/* 43 */ SK_ANIM_SURPRISE_LOOP,
/* 44 */ SK_ANIM_LOOK_AROUND_FOR_GIANTS_START,
/* 45 */ SK_ANIM_LOOK_AROUND_FOR_GIANTS_LOOP,
/* 46 */ SK_ANIM_HOLD_HEAD_AND_SHAKE_START,
/* 47 */ SK_ANIM_HOLD_HEAD_AND_SHAKE_LOOP,
/* 48 */ SK_ANIM_HOLD_HEAD_AND_SCREAM_START,
/* 49 */ SK_ANIM_HOLD_HEAD_AND_SCREAM_LOOP,
/* 50 */ SK_ANIM_HUDDLE_WITH_FAIRIES,
/* 51 */ SK_ANIM_SEARCH_MASK_SALESMAN,
/* 52 */ SK_ANIM_HOLD_UP_MASK_START,
/* 53 */ SK_ANIM_HOLD_UP_MASK_LOOP,
/* 54 */ SK_ANIM_SHIVER,
/* 55 */ SK_ANIM_DRAW,
/* 56 */ SK_ANIM_BENT_OVER_LOOK_UP,
/* 57 */ SK_ANIM_SPANK,
/* 58 */ SK_ANIM_HIP_SHAKE_AND_JUMP,
/* 59 */ SK_ANIM_PLAY_FLUTE,
/* 60 */ SK_ANIM_CARTWHEEL,
/* 61 */ SK_ANIM_LIE_FLAT,
/* 62 */ SK_ANIM_DANGLE_FROM_MASK_START,
/* 63 */ SK_ANIM_DANGLE_FROM_MASK_LOOP,
/* 64 */ SK_ANIM_DROPPED_FROM_MASK,
/* 65 */ SK_ANIM_LOOK_UP_AT_GIANTS,
/* 66 */ SK_ANIM_ASHAMED_START,
/* 67 */ SK_ANIM_ASHAMED_LOOP,
/* 68 */ SK_ANIM_LOOK_LEFT_START,
/* 69 */ SK_ANIM_LOOK_LEFT_LOOP,
/* 70 */ SK_ANIM_SNIFF,
/* 71 */ SK_ANIM_LAUGH_AFTER_SNIFF,
} SkullKidAnimation;
typedef enum {
/* 0 */ SK_MASK_TYPE_NO_MASK,
@@ -219,7 +219,7 @@ static DamageTable sDamageTable = {
/* Powder Keg */ DMG_ENTRY(1, 0xF),
};
static AnimationInfo sAnimations[] = {
static AnimationInfo sAnimationInfo[] = {
{ &gSkullKidShakeHeadAnim, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f },
{ &gSkullKidWalkAnim, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f },
{ &gSkullKidLookAroundAnim, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f },
@@ -300,13 +300,11 @@ static AnimationInfo sAnimations[] = {
void DmStk_LoadObjectForAnimation(DmStk* this, PlayState* play) {
s32 objectIndex;
if (((this->animIndex >= SK_ANIMATION_SHAKE_HEAD) && (this->animIndex <= SK_ANIMATION_BENT_OVER_HEAD_TWITCH)) ||
(this->animIndex == SK_ANIMATION_CALL_DOWN_MOON_START) ||
(this->animIndex == SK_ANIMATION_CALL_DOWN_MOON_LOOP) ||
(this->animIndex == SK_ANIMATION_TELESCOPE_LOOK_UP_START) ||
(this->animIndex == SK_ANIMATION_TELESCOPE_LOOK_UP_LOOP)) {
if (((this->animIndex >= SK_ANIM_SHAKE_HEAD) && (this->animIndex <= SK_ANIM_BENT_OVER_HEAD_TWITCH)) ||
(this->animIndex == SK_ANIM_CALL_DOWN_MOON_START) || (this->animIndex == SK_ANIM_CALL_DOWN_MOON_LOOP) ||
(this->animIndex == SK_ANIM_TELESCOPE_LOOK_UP_START) || (this->animIndex == SK_ANIM_TELESCOPE_LOOK_UP_LOOP)) {
objectIndex = this->objectStkObjectIndex;
} else if (this->animIndex >= SK_ANIMATION_LOOK_UP_AT_GIANTS) {
} else if (this->animIndex >= SK_ANIM_LOOK_UP_AT_GIANTS) {
objectIndex = this->objectStk3ObjectIndex;
} else {
objectIndex = this->objectStk2ObjectIndex;
@@ -320,16 +318,16 @@ void DmStk_LoadObjectForAnimation(DmStk* this, PlayState* play) {
/**
* This function is always called with unusedExtraOffset = 0.
*/
void DmStk_ChangeAnimation(DmStk* this, PlayState* play, SkelAnime* skelAnime, AnimationInfo* animation,
u16 unusedExtraOffset) {
void DmStk_ChangeAnim(DmStk* this, PlayState* play, SkelAnime* skelAnime, AnimationInfo* animationInfo,
u16 unusedExtraOffset) {
DmStk_LoadObjectForAnimation(this, play);
animation += unusedExtraOffset;
animationInfo += unusedExtraOffset;
Animation_Change(skelAnime, animation->animation, animation->playSpeed, animation->startFrame,
(animation->frameCount < 0.0f) ? Animation_GetLastFrame(&animation->animation->common)
: animation->frameCount,
animation->mode, animation->morphFrames);
Animation_Change(skelAnime, animationInfo->animation, animationInfo->playSpeed, animationInfo->startFrame,
(animationInfo->frameCount < 0.0f) ? Animation_GetLastFrame(animationInfo->animation)
: animationInfo->frameCount,
animationInfo->mode, animationInfo->morphFrames);
}
/**
@@ -596,7 +594,7 @@ void DmStk_PlaySfxForClockTowerIntroCutsceneVersion1(DmStk* this, PlayState* pla
break;
}
if ((this->animIndex == SK_ANIMATION_OCARINA_JUGGLE) && (play->csCtx.frames < 700)) {
if ((this->animIndex == SK_ANIM_OCARINA_JUGGLE) && (play->csCtx.frames < 700)) {
if (Animation_OnFrame(&this->skelAnime, 5.0f) || Animation_OnFrame(&this->skelAnime, 25.0f)) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_OTEDAMA1);
} else if (Animation_OnFrame(&this->skelAnime, 17.0f) || Animation_OnFrame(&this->skelAnime, 40.0f)) {
@@ -735,7 +733,7 @@ void DmStk_PlaySfxForEndingCutsceneSecondPart(DmStk* this, PlayState* play) {
break;
}
if (this->animIndex == SK_ANIMATION_SHAKE_HEAD) {
if (this->animIndex == SK_ANIM_SHAKE_HEAD) {
if (Animation_OnFrame(&this->skelAnime, 8.0f) || Animation_OnFrame(&this->skelAnime, 17.0f)) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_MASK_OFF);
}
@@ -743,12 +741,12 @@ void DmStk_PlaySfxForEndingCutsceneSecondPart(DmStk* this, PlayState* play) {
if (Animation_OnFrame(&this->skelAnime, 28.0f)) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_RIDE);
}
} else if (this->animIndex == SK_ANIMATION_LAUGH_AFTER_SNIFF) {
} else if (this->animIndex == SK_ANIM_LAUGH_AFTER_SNIFF) {
if (Animation_OnFrame(&this->skelAnime, 2.0f) || Animation_OnFrame(&this->skelAnime, 6.0f) ||
Animation_OnFrame(&this->skelAnime, 12.0f) || Animation_OnFrame(&this->skelAnime, 18.0f)) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_MASK_OFF);
}
} else if ((this->animIndex == SK_ANIMATION_SNIFF) &&
} else if ((this->animIndex == SK_ANIM_SNIFF) &&
(Animation_OnFrame(&this->skelAnime, 16.0f) || Animation_OnFrame(&this->skelAnime, 23.0f))) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_NOSE);
}
@@ -984,20 +982,20 @@ void DmStk_PlaySfxForCutscenes(DmStk* this, PlayState* play) {
}
}
if (this->animIndex == SK_ANIMATION_WALK) {
if (this->animIndex == SK_ANIM_WALK) {
if (Animation_OnFrame(&this->skelAnime, 2.0f) || Animation_OnFrame(&this->skelAnime, 6.0f)) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_WALK);
}
} else if (this->animIndex == SK_ANIMATION_SEARCH_LINK) {
} else if (this->animIndex == SK_ANIM_SEARCH_LINK) {
if (Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 13.0f) ||
Animation_OnFrame(&this->skelAnime, 20.0f) || Animation_OnFrame(&this->skelAnime, 27.0f)) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_PL_CALM_HIT);
}
} else if (this->animIndex == SK_ANIMATION_PICK_UP_OCARINA_AND_START_PLAYING) {
} else if (this->animIndex == SK_ANIM_PICK_UP_OCARINA_AND_START_PLAYING) {
if (Animation_OnFrame(&this->skelAnime, 3.0f)) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_PL_PUT_OUT_ITEM);
}
} else if (this->animIndex == SK_ANIMATION_PLAY_OCARINA_AND_LAUGH) {
} else if (this->animIndex == SK_ANIM_PLAY_OCARINA_AND_LAUGH) {
if (Animation_OnFrame(&this->skelAnime, 14.0f)) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_UNSKILLFUL_OCARINA);
}
@@ -1025,7 +1023,7 @@ void DmStk_Init(Actor* thisx, PlayState* play) {
this->tatlMessageTimer = 0;
this->deflectCount = 0;
this->maskType = SK_MASK_TYPE_NORMAL;
this->animIndex = SK_ANIMATION_IDLE;
this->animIndex = SK_ANIM_IDLE;
this->fogR = play->lightCtx.unk7;
this->fogG = play->lightCtx.unk8;
this->fogB = play->lightCtx.unk9;
@@ -1063,7 +1061,7 @@ void DmStk_Init(Actor* thisx, PlayState* play) {
}
} else if (gSaveContext.sceneSetupIndex == 3) {
this->animIndex = SK_ANIMATION_FLOATING_ARMS_CROSSED;
this->animIndex = SK_ANIM_FLOATING_ARMS_CROSSED;
if (gSaveContext.unk_3DD0[3] == 0) {
// This code is called when the Giants fail to stop the moon.
// Starts a 1 minute (60 second) timer until the moon falls.
@@ -1076,12 +1074,12 @@ void DmStk_Init(Actor* thisx, PlayState* play) {
sCylinderInit.base.colType = COLTYPE_WOOD;
this->actionFunc = DmStk_ClockTower_Idle;
} else {
this->animIndex = SK_ANIMATION_FLOATING_ARMS_CROSSED;
this->animIndex = SK_ANIM_FLOATING_ARMS_CROSSED;
this->actionFunc = DmStk_ClockTower_DoNothing;
}
} else {
this->dekuPipesCutsceneState = SK_DEKU_PIPES_CS_STATE_READY;
this->animIndex = SK_ANIMATION_FLOATING_ARMS_CROSSED;
this->animIndex = SK_ANIM_FLOATING_ARMS_CROSSED;
this->actor.world.pos.y = 120.0f;
sCylinderInit.base.colType = COLTYPE_WOOD;
this->actionFunc = DmStk_ClockTower_Idle;
@@ -1100,7 +1098,7 @@ void DmStk_Init(Actor* thisx, PlayState* play) {
this->fogN = 996;
this->fogF = 1000;
this->fogScale = 0.7f;
this->animIndex = SK_ANIMATION_BENT_OVER_HEAD_TWITCH;
this->animIndex = SK_ANIM_BENT_OVER_HEAD_TWITCH;
this->actionFunc = DmStk_WaitForTelescope;
} else {
if ((play->sceneNum == SCENE_LOST_WOODS) && !Cutscene_IsPlaying(play)) {
@@ -1124,7 +1122,7 @@ void DmStk_Init(Actor* thisx, PlayState* play) {
this->csAction = 99;
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 24.0f);
SkelAnime_InitFlex(play, &this->skelAnime, &gSkullKidSkel, NULL, NULL, NULL, 0);
DmStk_ChangeAnimation(this, play, &this->skelAnime, &sAnimations[this->animIndex], 0);
DmStk_ChangeAnim(this, play, &this->skelAnime, &sAnimationInfo[this->animIndex], 0);
}
Actor_SetScale(&this->actor, 0.01f);
@@ -1202,9 +1200,9 @@ void DmStk_ClockTower_StartIntroCutsceneVersion1(DmStk* this, PlayState* play) {
void DmStk_ClockTower_WaitForIntroCutsceneVersion1ToEnd(DmStk* this, PlayState* play) {
if (play->csCtx.state == 0) {
this->animIndex = SK_ANIMATION_CALL_DOWN_MOON_LOOP;
this->animIndex = SK_ANIM_CALL_DOWN_MOON_LOOP;
this->handType = SK_HAND_TYPE_HOLDING_OCARINA;
DmStk_ChangeAnimation(this, play, &this->skelAnime, &sAnimations[this->animIndex], 0);
DmStk_ChangeAnim(this, play, &this->skelAnime, &sAnimationInfo[this->animIndex], 0);
this->actionFunc = DmStk_ClockTower_IdleWithOcarina;
}
}
@@ -1220,8 +1218,8 @@ void DmStk_ClockTower_StartIntroCutsceneVersion2(DmStk* this, PlayState* play) {
void DmStk_ClockTower_WaitForIntroCutsceneVersion2ToEnd(DmStk* this, PlayState* play) {
if (play->csCtx.state == 0) {
this->animIndex = SK_ANIMATION_FLOATING_ARMS_CROSSED;
DmStk_ChangeAnimation(this, play, &this->skelAnime, &sAnimations[this->animIndex], 0);
this->animIndex = SK_ANIM_FLOATING_ARMS_CROSSED;
DmStk_ChangeAnim(this, play, &this->skelAnime, &sAnimationInfo[this->animIndex], 0);
this->actionFunc = DmStk_ClockTower_Idle;
}
}
@@ -1281,8 +1279,8 @@ void DmStk_ClockTower_DeflectHit(DmStk* this, PlayState* play) {
}
}
this->animIndex = SK_ANIMATION_DEFLECT_ATTACK;
DmStk_ChangeAnimation(this, play, &this->skelAnime, &sAnimations[this->animIndex], 0);
this->animIndex = SK_ANIM_DEFLECT_ATTACK;
DmStk_ChangeAnim(this, play, &this->skelAnime, &sAnimationInfo[this->animIndex], 0);
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_DOWN_K);
this->actionFunc = DmStk_ClockTower_WaitForDeflectionToEnd;
}
@@ -1294,8 +1292,8 @@ void DmStk_ClockTower_DeflectHit(DmStk* this, PlayState* play) {
void DmStk_ClockTower_WaitForDeflectionToEnd(DmStk* this, PlayState* play) {
DmStk_ClockTower_AdjustHeightAndRotation(this, play);
if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
this->animIndex = SK_ANIMATION_FLOATING_ARMS_CROSSED;
DmStk_ChangeAnimation(this, play, &this->skelAnime, &sAnimations[this->animIndex], 0);
this->animIndex = SK_ANIM_FLOATING_ARMS_CROSSED;
DmStk_ChangeAnim(this, play, &this->skelAnime, &sAnimationInfo[this->animIndex], 0);
this->actionFunc = DmStk_ClockTower_Idle;
}
@@ -1327,96 +1325,96 @@ void DmStk_UpdateCutscenes(DmStk* this, PlayState* play) {
switch (play->csCtx.actorActions[actorActionIndex]->action) {
case 0:
case 1:
this->animIndex = SK_ANIMATION_IDLE;
this->animIndex = SK_ANIM_IDLE;
break;
case 2:
this->animIndex = SK_ANIMATION_WALK;
this->animIndex = SK_ANIM_WALK;
break;
case 3:
this->animIndex = SK_ANIMATION_UNUSED_KICK_OVER_LINK;
this->animIndex = SK_ANIM_UNUSED_KICK_OVER_LINK;
break;
case 4:
this->animIndex = SK_ANIMATION_KICK_OVER_LINK;
this->animIndex = SK_ANIM_KICK_OVER_LINK;
break;
case 6:
this->animIndex = SK_ANIMATION_PICK_UP_OCARINA;
this->animIndex = SK_ANIM_PICK_UP_OCARINA;
this->handType = SK_HAND_TYPE_HOLDING_OCARINA;
break;
case 7:
this->animIndex = SK_ANIMATION_PICK_UP_OCARINA_AND_START_PLAYING;
this->animIndex = SK_ANIM_PICK_UP_OCARINA_AND_START_PLAYING;
this->handType = SK_HAND_TYPE_HOLDING_OCARINA;
break;
case 8:
this->animIndex = SK_ANIMATION_SHAKE_HEAD;
this->animIndex = SK_ANIM_SHAKE_HEAD;
break;
case 9:
this->animIndex = SK_ANIMATION_IDLE;
this->animIndex = SK_ANIM_IDLE;
this->fadeInState = SK_FADE_IN_STATE_START;
break;
case 12:
this->animIndex = SK_ANIMATION_HIDE_OCARINA_START;
this->animIndex = SK_ANIM_HIDE_OCARINA_START;
this->handType = SK_HAND_TYPE_HOLDING_OCARINA;
break;
case 13:
this->animIndex = SK_ANIMATION_JUMP_WHILE_HIDING_OCARINA;
this->animIndex = SK_ANIM_JUMP_WHILE_HIDING_OCARINA;
this->handType = SK_HAND_TYPE_HOLDING_OCARINA;
break;
case 14:
this->animIndex = SK_ANIMATION_HORSE_RIDE_START;
this->animIndex = SK_ANIM_HORSE_RIDE_START;
break;
case 15:
this->animIndex = SK_ANIMATION_HORSE_RIDE_LOOP;
this->animIndex = SK_ANIM_HORSE_RIDE_LOOP;
break;
case 16:
this->animIndex = SK_ANIMATION_HORSE_RIDE_AND_ROTATE;
this->animIndex = SK_ANIM_HORSE_RIDE_AND_ROTATE;
break;
case 17:
this->animIndex = SK_ANIMATION_RECLINING_FLOAT;
this->animIndex = SK_ANIM_RECLINING_FLOAT;
break;
case 18:
this->animIndex = SK_ANIMATION_CURSE_START;
this->animIndex = SK_ANIM_CURSE_START;
break;
case 19:
this->animIndex = SK_ANIMATION_LAUGH_START;
this->animIndex = SK_ANIM_LAUGH_START;
break;
case 20:
this->animIndex = SK_ANIMATION_RAISE_MASK_START;
this->animIndex = SK_ANIM_RAISE_MASK_START;
break;
case 21:
this->animIndex = SK_ANIMATION_LOWER_MASK;
this->animIndex = SK_ANIM_LOWER_MASK;
break;
case 22:
this->animIndex = SK_ANIMATION_PLAY_OCARINA_WHILE_FLOATING;
this->animIndex = SK_ANIM_PLAY_OCARINA_WHILE_FLOATING;
if (gSaveContext.save.inventory.items[SLOT_OCARINA] == ITEM_NONE) {
this->handType = SK_HAND_TYPE_HOLDING_OCARINA;
}
break;
case 23:
this->animIndex = SK_ANIMATION_FLOATING_TURN_AROUND;
this->animIndex = SK_ANIM_FLOATING_TURN_AROUND;
this->handType = SK_HAND_TYPE_JUGGLING_OR_DROPPING_OCARINA;
break;
case 24:
this->animIndex = SK_ANIMATION_CALL_DOWN_MOON_START;
this->animIndex = SK_ANIM_CALL_DOWN_MOON_START;
if (gSaveContext.save.inventory.items[SLOT_OCARINA] == ITEM_NONE) {
this->handType = SK_HAND_TYPE_HOLDING_OCARINA;
}
@@ -1427,148 +1425,148 @@ void DmStk_UpdateCutscenes(DmStk* this, PlayState* play) {
break;
case 26:
this->animIndex = SK_ANIMATION_SMACK_FAIRY_START;
this->animIndex = SK_ANIM_SMACK_FAIRY_START;
if (gSaveContext.save.inventory.items[SLOT_OCARINA] == ITEM_NONE) {
this->handType = SK_HAND_TYPE_HOLDING_OCARINA;
}
break;
case 27:
this->animIndex = SK_ANIMATION_HIT_BY_BUBBLE;
this->animIndex = SK_ANIM_HIT_BY_BUBBLE;
if (gSaveContext.save.inventory.items[SLOT_OCARINA] == ITEM_NONE) {
this->handType = SK_HAND_TYPE_HOLDING_OCARINA;
}
break;
case 28:
this->animIndex = SK_ANIMATION_DROP_OCARINA;
this->animIndex = SK_ANIM_DROP_OCARINA;
this->handType = SK_HAND_TYPE_JUGGLING_OR_DROPPING_OCARINA;
break;
case 30:
this->animIndex = SK_ANIMATION_FLOATING_ARMS_CROSSED;
this->animIndex = SK_ANIM_FLOATING_ARMS_CROSSED;
break;
case 31:
this->animIndex = SK_ANIMATION_DEFLECT_ATTACK;
this->animIndex = SK_ANIM_DEFLECT_ATTACK;
break;
case 32:
this->animIndex = SK_ANIMATION_SURPRISE_START;
this->animIndex = SK_ANIM_SURPRISE_START;
break;
case 33:
this->animIndex = SK_ANIMATION_LOOK_AROUND_FOR_GIANTS_START;
this->animIndex = SK_ANIM_LOOK_AROUND_FOR_GIANTS_START;
break;
case 34:
this->animIndex = SK_ANIMATION_HOLD_HEAD_AND_SHAKE_START;
this->animIndex = SK_ANIM_HOLD_HEAD_AND_SHAKE_START;
break;
case 35:
this->animIndex = SK_ANIMATION_HOLD_HEAD_AND_SCREAM_START;
this->animIndex = SK_ANIM_HOLD_HEAD_AND_SCREAM_START;
break;
case 36:
this->animIndex = SK_ANIMATION_HUDDLE_WITH_FAIRIES;
this->animIndex = SK_ANIM_HUDDLE_WITH_FAIRIES;
break;
case 37:
this->animIndex = SK_ANIMATION_SEARCH_MASK_SALESMAN;
this->animIndex = SK_ANIM_SEARCH_MASK_SALESMAN;
break;
case 38:
this->animIndex = SK_ANIMATION_HOLD_UP_MASK_START;
this->animIndex = SK_ANIM_HOLD_UP_MASK_START;
break;
case 39:
this->animIndex = SK_ANIMATION_SHIVER;
this->animIndex = SK_ANIM_SHIVER;
break;
case 40:
this->animIndex = SK_ANIMATION_DRAW;
this->animIndex = SK_ANIM_DRAW;
break;
case 41:
this->animIndex = SK_ANIMATION_TELESCOPE_LOOK_UP_START;
this->animIndex = SK_ANIM_TELESCOPE_LOOK_UP_START;
break;
case 42:
this->animIndex = SK_ANIMATION_BENT_OVER_HEAD_TWITCH;
this->animIndex = SK_ANIM_BENT_OVER_HEAD_TWITCH;
break;
case 43:
this->animIndex = SK_ANIMATION_BENT_OVER_LOOK_UP;
this->animIndex = SK_ANIM_BENT_OVER_LOOK_UP;
break;
case 44:
this->animIndex = SK_ANIMATION_SPANK;
this->animIndex = SK_ANIM_SPANK;
break;
case 45:
this->animIndex = SK_ANIMATION_HIP_SHAKE_AND_JUMP;
this->animIndex = SK_ANIM_HIP_SHAKE_AND_JUMP;
this->fadeOutState = SK_FADE_OUT_STATE_FADING_OUT;
break;
case 46:
this->handType = SK_HAND_TYPE_HOLDING_FLUTE;
this->animIndex = SK_ANIMATION_PLAY_FLUTE;
this->animIndex = SK_ANIM_PLAY_FLUTE;
break;
case 47:
this->animIndex = SK_ANIMATION_CARTWHEEL;
this->animIndex = SK_ANIM_CARTWHEEL;
break;
case 48:
this->animIndex = SK_ANIMATION_CARTWHEEL;
this->animIndex = SK_ANIM_CARTWHEEL;
break;
case 49:
this->animIndex = SK_ANIMATION_LOOK_UP_AT_GIANTS;
this->animIndex = SK_ANIM_LOOK_UP_AT_GIANTS;
break;
case 50:
this->animIndex = SK_ANIMATION_ASHAMED_START;
this->animIndex = SK_ANIM_ASHAMED_START;
break;
case 51:
this->animIndex = SK_ANIMATION_LOOK_LEFT_START;
this->animIndex = SK_ANIM_LOOK_LEFT_START;
break;
case 52:
this->animIndex = SK_ANIMATION_SNIFF;
this->animIndex = SK_ANIM_SNIFF;
break;
case 53:
this->animIndex = SK_ANIMATION_CARTWHEEL;
this->animIndex = SK_ANIM_CARTWHEEL;
break;
case 54:
this->animIndex = SK_ANIMATION_LIE_FLAT;
this->animIndex = SK_ANIM_LIE_FLAT;
break;
case 55:
this->animIndex = SK_ANIMATION_DANGLE_FROM_MASK_START;
this->animIndex = SK_ANIM_DANGLE_FROM_MASK_START;
break;
case 56:
this->animIndex = SK_ANIMATION_DROPPED_FROM_MASK;
this->animIndex = SK_ANIM_DROPPED_FROM_MASK;
break;
case 57:
this->animIndex = SK_ANIMATION_LOOK_UP_AT_GIANTS;
this->animIndex = SK_ANIM_LOOK_UP_AT_GIANTS;
break;
case 58:
this->animIndex = SK_ANIMATION_ASHAMED_START;
this->animIndex = SK_ANIM_ASHAMED_START;
break;
case 59:
this->animIndex = SK_ANIMATION_LOOK_LEFT_START;
this->animIndex = SK_ANIM_LOOK_LEFT_START;
break;
case 60:
this->animIndex = SK_ANIMATION_SNIFF;
this->animIndex = SK_ANIM_SNIFF;
break;
case 5:
@@ -1576,11 +1574,11 @@ void DmStk_UpdateCutscenes(DmStk* this, PlayState* play) {
break;
default:
this->animIndex = SK_ANIMATION_SHAKE_HEAD;
this->animIndex = SK_ANIM_SHAKE_HEAD;
break;
}
DmStk_ChangeAnimation(this, play, &this->skelAnime, &sAnimations[this->animIndex], 0);
DmStk_ChangeAnim(this, play, &this->skelAnime, &sAnimationInfo[this->animIndex], 0);
}
}
@@ -1645,57 +1643,56 @@ void DmStk_UpdateCutscenes(DmStk* this, PlayState* play) {
if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
switch (this->animIndex) {
case SK_ANIMATION_LOOK_AROUND:
case SK_ANIMATION_CURSE_START:
case SK_ANIMATION_LAUGH_START:
case SK_ANIMATION_HIDE_OCARINA_START:
case SK_ANIMATION_PICK_UP_OCARINA_AND_START_PLAYING:
case SK_ANIMATION_PICK_UP_OCARINA:
case SK_ANIMATION_KICK_OVER_LINK:
case SK_ANIMATION_UNUSED_KICK_OVER_LINK:
case SK_ANIMATION_HORSE_RIDE_START:
case SK_ANIMATION_RAISE_MASK_START:
case SK_ANIMATION_FLOATING_TURN_AROUND:
case SK_ANIMATION_CALL_DOWN_MOON_START:
case SK_ANIMATION_SMACK_FAIRY_START:
case SK_ANIMATION_TELESCOPE_LOOK_UP_START:
case SK_ANIMATION_SURPRISE_START:
case SK_ANIMATION_LOOK_AROUND_FOR_GIANTS_START:
case SK_ANIMATION_HOLD_HEAD_AND_SHAKE_START:
case SK_ANIMATION_HOLD_HEAD_AND_SCREAM_START:
case SK_ANIMATION_HOLD_UP_MASK_START:
case SK_ANIMATION_DANGLE_FROM_MASK_START:
case SK_ANIMATION_ASHAMED_START:
case SK_ANIMATION_LOOK_LEFT_START:
case SK_ANIMATION_SNIFF:
case SK_ANIM_LOOK_AROUND:
case SK_ANIM_CURSE_START:
case SK_ANIM_LAUGH_START:
case SK_ANIM_HIDE_OCARINA_START:
case SK_ANIM_PICK_UP_OCARINA_AND_START_PLAYING:
case SK_ANIM_PICK_UP_OCARINA:
case SK_ANIM_KICK_OVER_LINK:
case SK_ANIM_UNUSED_KICK_OVER_LINK:
case SK_ANIM_HORSE_RIDE_START:
case SK_ANIM_RAISE_MASK_START:
case SK_ANIM_FLOATING_TURN_AROUND:
case SK_ANIM_CALL_DOWN_MOON_START:
case SK_ANIM_SMACK_FAIRY_START:
case SK_ANIM_TELESCOPE_LOOK_UP_START:
case SK_ANIM_SURPRISE_START:
case SK_ANIM_LOOK_AROUND_FOR_GIANTS_START:
case SK_ANIM_HOLD_HEAD_AND_SHAKE_START:
case SK_ANIM_HOLD_HEAD_AND_SCREAM_START:
case SK_ANIM_HOLD_UP_MASK_START:
case SK_ANIM_DANGLE_FROM_MASK_START:
case SK_ANIM_ASHAMED_START:
case SK_ANIM_LOOK_LEFT_START:
case SK_ANIM_SNIFF:
this->animIndex++;
DmStk_ChangeAnimation(this, play, &this->skelAnime, &sAnimations[this->animIndex], 0);
DmStk_ChangeAnim(this, play, &this->skelAnime, &sAnimationInfo[this->animIndex], 0);
break;
case SK_ANIMATION_LOWER_MASK:
this->animIndex = SK_ANIMATION_IDLE;
case SK_ANIM_LOWER_MASK:
this->animIndex = SK_ANIM_IDLE;
this->maskType = SK_MASK_TYPE_NORMAL;
this->handType = SK_HAND_TYPE_DEFAULT;
DmStk_ChangeAnimation(this, play, &this->skelAnime, &sAnimations[this->animIndex], 0);
DmStk_ChangeAnim(this, play, &this->skelAnime, &sAnimationInfo[this->animIndex], 0);
break;
}
}
if (((this->animIndex == SK_ANIMATION_RAISE_MASK_START) && (this->skelAnime.curFrame >= 16.0f)) ||
(this->animIndex == SK_ANIMATION_RAISE_MASK_LOOP) || (this->animIndex == SK_ANIMATION_LOWER_MASK)) {
if (((this->animIndex == SK_ANIM_RAISE_MASK_START) && (this->skelAnime.curFrame >= 16.0f)) ||
(this->animIndex == SK_ANIM_RAISE_MASK_LOOP) || (this->animIndex == SK_ANIM_LOWER_MASK)) {
this->maskType = SK_MASK_TYPE_RAISED;
this->handType = SK_HAND_TYPE_HOLDING_MAJORAS_MASK;
} else if (((this->animIndex >= SK_ANIMATION_HUDDLE_WITH_FAIRIES) && (this->animIndex <= SK_ANIMATION_DRAW)) ||
((this->animIndex >= SK_ANIMATION_PLAY_FLUTE) && (this->animIndex <= SK_ANIMATION_CARTWHEEL)) ||
} else if (((this->animIndex >= SK_ANIM_HUDDLE_WITH_FAIRIES) && (this->animIndex <= SK_ANIM_DRAW)) ||
((this->animIndex >= SK_ANIM_PLAY_FLUTE) && (this->animIndex <= SK_ANIM_CARTWHEEL)) ||
((play->sceneNum == SCENE_00KEIKOKU) && (gSaveContext.sceneSetupIndex == 7))) {
this->maskType = SK_MASK_TYPE_NO_MASK;
if ((this->animIndex == SK_ANIMATION_HOLD_UP_MASK_START) ||
(this->animIndex == SK_ANIMATION_HOLD_UP_MASK_LOOP)) {
if ((this->animIndex == SK_ANIM_HOLD_UP_MASK_START) || (this->animIndex == SK_ANIM_HOLD_UP_MASK_LOOP)) {
this->handType = SK_HAND_TYPE_HOLDING_MAJORAS_MASK_AND_FLUTE;
}
}
if (this->animIndex == SK_ANIMATION_DROPPED_FROM_MASK) {
if (this->animIndex == SK_ANIM_DROPPED_FROM_MASK) {
this->maskType = SK_MASK_TYPE_NO_MASK;
}
}
@@ -1747,7 +1744,7 @@ void DmStk_ClockTower_Idle(DmStk* this, PlayState* play) {
DmStk_ClockTower_AdjustHeightAndRotation(this, play);
this->actor.flags |= ACTOR_FLAG_1;
if (this->animIndex == SK_ANIMATION_CALL_DOWN_MOON_LOOP) {
if (this->animIndex == SK_ANIM_CALL_DOWN_MOON_LOOP) {
this->actor.targetArrowOffset = 3100.0f;
} else {
this->actor.targetArrowOffset = 200.0f;
@@ -1764,7 +1761,7 @@ void DmStk_Update(Actor* thisx, PlayState* play) {
DmStk* this = THIS;
if (DM_STK_GET_TYPE(&this->actor) != DM_STK_TYPE_MAJORAS_MASK) {
if (this->animIndex == SK_ANIMATION_CALL_DOWN_MOON_LOOP) {
if (this->animIndex == SK_ANIM_CALL_DOWN_MOON_LOOP) {
Actor_SetFocus(&this->actor, 40.0f);
} else {
Actor_SetFocus(&this->actor, 6.0f);
@@ -1772,7 +1769,7 @@ void DmStk_Update(Actor* thisx, PlayState* play) {
DmStk_LoadObjectForAnimation(this, play);
if (this->animIndex != SK_ANIMATION_LIE_FLAT) {
if (this->animIndex != SK_ANIM_LIE_FLAT) {
SkelAnime_Update(&this->skelAnime);
}
@@ -1876,8 +1873,8 @@ void DmStk_PostLimbDraw2(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
if ((this->animIndex == SK_ANIMATION_LOOK_LEFT_LOOP) || (this->animIndex == SK_ANIMATION_LAUGH_LOOP) ||
(this->animIndex == SK_ANIMATION_LAUGH_AFTER_SNIFF)) {
if ((this->animIndex == SK_ANIM_LOOK_LEFT_LOOP) || (this->animIndex == SK_ANIM_LAUGH_LOOP) ||
(this->animIndex == SK_ANIM_LAUGH_AFTER_SNIFF)) {
gSPDisplayList(POLY_OPA_DISP++, gSkullKidLaughingHeadDL);
gSPDisplayList(POLY_OPA_DISP++, gSkullKidLaughingEyesDL);
} else {
+22 -22
View File
@@ -29,7 +29,7 @@ const ActorInit Dm_Zl_InitVars = {
(ActorFunc)DmZl_Draw,
};
static AnimationInfo sAnimations[] = {
static AnimationInfo sAnimationInfo[] = {
{ &gDmZl4FacingAwayHandsOverEmblemLoop, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, -10.0f },
{ &gDmZl4TurningAround2Anim, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, -10.0f },
{ &gDmZl4HandsOverEmblemLoopAnim, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, -10.0f },
@@ -48,7 +48,7 @@ typedef enum {
/* 5 */ ZELDA_ANIM_PLAYING_OCARINA_START,
/* 6 */ ZELDA_ANIM_PLAYING_OCARINA,
/* 7 */ ZELDA_ANIM_MAX,
} DmZlAnimations;
} DmZlAnimation;
static TexturePtr sMouthTextures[] = {
gZl4MouthNeutralTex,
@@ -98,27 +98,28 @@ typedef enum {
/**
* This function is always called with unusedExtraOffset = 0.
*/
void DmZl_ChangeAnimation(SkelAnime* skelAnime, AnimationInfo animation[], u16 unusedExtraOffset) {
void DmZl_ChangeAnimation(SkelAnime* skelAnime, AnimationInfo animationInfo[], u16 unusedExtraOffset) {
f32 endFrame;
animation += unusedExtraOffset;
endFrame = (animation->frameCount < 0.0f) ? Animation_GetLastFrame(animation->animation) : animation->frameCount;
animationInfo += unusedExtraOffset;
endFrame = (animationInfo->frameCount < 0.0f) ? Animation_GetLastFrame(animationInfo->animation)
: animationInfo->frameCount;
Animation_Change(skelAnime, animation->animation, animation->playSpeed, animation->startFrame, endFrame,
animation->mode, animation->morphFrames);
Animation_Change(skelAnime, animationInfo->animation, animationInfo->playSpeed, animationInfo->startFrame, endFrame,
animationInfo->mode, animationInfo->morphFrames);
}
void DmZl_Init(Actor* thisx, PlayState* play) {
s32 pad;
DmZl* this = THIS;
this->animationIndex = ZELDA_ANIM_FACING_AWAY;
this->animIndex = ZELDA_ANIM_FACING_AWAY;
this->unk_2BA = 0;
this->actor.targetArrowOffset = 1000.0f;
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 24.0f);
// these three set to NULL should mean they are dynamically allocated
SkelAnime_InitFlex(play, &this->skelAnime, &gZl4Skeleton, NULL, NULL, NULL, 0);
DmZl_ChangeAnimation(&this->skelAnime, &sAnimations[this->animationIndex], 0);
DmZl_ChangeAnimation(&this->skelAnime, &sAnimationInfo[this->animIndex], 0);
Actor_SetScale(&this->actor, 0.01f);
this->actionFunc = DmZl_DoNothing;
}
@@ -135,26 +136,26 @@ void DmZl_UpdateCutscene(DmZl* this, PlayState* play) {
if (Cutscene_CheckActorAction(play, 0x66)) {
actionIndex = Cutscene_GetActorActionIndex(play, 0x66);
if (play->csCtx.frames == play->csCtx.actorActions[actionIndex]->startFrame) {
s16 nextAnimationIndex = ZELDA_ANIM_FACING_AWAY;
s16 nextAnimIndex = ZELDA_ANIM_FACING_AWAY;
switch (play->csCtx.actorActions[actionIndex]->action) {
default:
case 1:
break;
case 2:
nextAnimationIndex = ZELDA_ANIM_TURNING_TOWARD_PLAYER;
nextAnimIndex = ZELDA_ANIM_TURNING_TOWARD_PLAYER;
break;
case 3:
nextAnimationIndex = ZELDA_ANIM_GIVING_OCARINA_START;
nextAnimIndex = ZELDA_ANIM_GIVING_OCARINA_START;
break;
case 4:
nextAnimationIndex = ZELDA_ANIM_PLAYING_OCARINA_START;
nextAnimIndex = ZELDA_ANIM_PLAYING_OCARINA_START;
break;
}
if (nextAnimationIndex != this->animationIndex) {
this->animationIndex = nextAnimationIndex;
DmZl_ChangeAnimation(&this->skelAnime, &sAnimations[this->animationIndex], 0);
if (nextAnimIndex != this->animIndex) {
this->animIndex = nextAnimIndex;
DmZl_ChangeAnimation(&this->skelAnime, &sAnimationInfo[this->animIndex], 0);
}
}
@@ -162,13 +163,13 @@ void DmZl_UpdateCutscene(DmZl* this, PlayState* play) {
}
if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
actionIndex = this->animationIndex;
actionIndex = this->animIndex;
if ((actionIndex == ZELDA_ANIM_TURNING_TOWARD_PLAYER) || (actionIndex == ZELDA_ANIM_GIVING_OCARINA_START) ||
(actionIndex == ZELDA_ANIM_PLAYING_OCARINA_START)) {
// these animations don't loop at the end, they lead into the next animation
this->animationIndex++;
DmZl_ChangeAnimation(&this->skelAnime, &sAnimations[this->animationIndex], 0);
this->animIndex++;
DmZl_ChangeAnimation(&this->skelAnime, &sAnimationInfo[this->animIndex], 0);
}
}
}
@@ -245,7 +246,7 @@ void DmZl_UpdateFace(DmZl* this) {
break;
}
if (this->animationIndex == ZELDA_ANIM_PLAYING_OCARINA) {
if (this->animIndex == ZELDA_ANIM_PLAYING_OCARINA) {
this->eyeTextureIndexLeft = this->eyeTextureIndexRight = ZELDA_EYE_CLOSED;
}
}
@@ -267,8 +268,7 @@ void DmZl_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot,
DmZl* this = THIS;
if (limbIndex == ZL4_LIMB_RIGHT_HAND) {
if ((this->animationIndex >= ZELDA_ANIM_GIVING_OCARINA_START) &&
(this->animationIndex <= ZELDA_ANIM_PLAYING_OCARINA)) {
if ((this->animIndex >= ZELDA_ANIM_GIVING_OCARINA_START) && (this->animIndex <= ZELDA_ANIM_PLAYING_OCARINA)) {
OPEN_DISPS(play->state.gfxCtx);
gSPDisplayList(POLY_OPA_DISP++, gDmZl4OcarinaDL);
+1 -1
View File
@@ -15,7 +15,7 @@ typedef struct DmZl {
/* 0x1F4 */ Vec3s morphTable[ZL4_LIMB_MAX];
/* 0x260 */ DmZlActionFunc actionFunc;
/* 0x264 */ ColliderCylinder collider; // unused, assumed to be here based on OoT documentation
/* 0x2B0 */ s16 animationIndex;
/* 0x2B0 */ s16 animIndex;
/* 0x2B2 */ u8 eyeTextureIndexLeft;
/* 0x2B3 */ u8 eyeTextureIndexRight;
/* 0x2B4 */ u8 mouthTextureIndex;
+2 -2
View File
@@ -81,7 +81,7 @@ static ColliderCylinderInit sCylinderInit = {
static CollisionCheckInfoInit2 sColChkInfoInit = { 0, 0, 0, 0, MASS_IMMOVABLE };
static AnimationInfoS sAnimations[] = {
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 },
@@ -146,7 +146,7 @@ s32 func_80BD2B0C(EnAh* this, s32 arg1) {
if (phi_v1) {
this->unk_300 = arg1;
ret = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, arg1);
ret = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, arg1);
this->unk_2DC = this->skelAnime.playSpeed;
}
return ret;
@@ -62,7 +62,7 @@ static ColliderCylinderInitType1 sCylinderInit = {
{ 27, 32, 0, { 0, 0, 0 } },
};
static AnimationInfoS sAnimations[] = {
static AnimationInfoS sAnimationInfo[] = {
{ &object_dnt_Anim_005488, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
{ &object_dnt_Anim_00B0B4, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
{ &object_dnt_Anim_004AA0, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
@@ -1154,7 +1154,7 @@ void func_80BEE938(EnAkindonuts* this, PlayState* play) {
void func_80BEEB20(EnAkindonuts* this, PlayState* play) {
s16 sp26 = this->skelAnime.curFrame;
s16 sp24 = Animation_GetLastFrame(&sAnimations[this->unk_338].animation->common);
s16 sp24 = Animation_GetLastFrame(&sAnimationInfo[this->unk_338].animation->common);
s16 phi_v0;
Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 2, 0xE38);
@@ -1177,7 +1177,7 @@ void func_80BEEB20(EnAkindonuts* this, PlayState* play) {
this->actionFunc = func_80BEEDC0;
this->unk_338 = 3;
this->collider.dim.height = 64;
SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 3);
SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 3);
return;
}
}
@@ -1187,19 +1187,19 @@ void func_80BEEB20(EnAkindonuts* this, PlayState* play) {
this->unk_338 = 17;
this->collider.dim.height = 0;
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_DOWN);
SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 17);
SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 17);
} else if (this->unk_338 == 2) {
this->unk_338 = 16;
this->collider.dim.height = 32;
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_UP);
SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 16);
SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 16);
} else if (this->unk_338 == 17) {
phi_v0 = DECR(this->unk_33A);
if (phi_v0 == 0) {
this->unk_33A = Rand_ZeroOne() * 10.0f;
this->unk_338 = 2;
this->collider.dim.height = 32;
SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 2);
SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 2);
}
} else if (this->unk_338 == 16) {
phi_v0 = DECR(this->unk_33A);
@@ -1207,7 +1207,7 @@ void func_80BEEB20(EnAkindonuts* this, PlayState* play) {
this->unk_33A = Rand_S16Offset(40, 40);
this->unk_338 = 18;
this->collider.dim.height = 32;
SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 18);
SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 18);
}
}
}
@@ -1216,7 +1216,7 @@ void func_80BEEB20(EnAkindonuts* this, PlayState* play) {
void func_80BEEDC0(EnAkindonuts* this, PlayState* play) {
if (this->skelAnime.curFrame == this->skelAnime.endFrame) {
this->actionFunc = func_80BEEE10;
SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 0);
SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 0);
}
}
@@ -1234,7 +1234,7 @@ void func_80BEEE10(EnAkindonuts* this, PlayState* play) {
} else if (!(((this->actor.playerHeightRel < 50.0f) && (this->actor.playerHeightRel > -50.0f)) ? true : false) ||
!((this->actor.xzDistToPlayer < 200.0f) ? true : false)) {
this->unk_338 = 4;
SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 4);
SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 4);
this->actionFunc = func_80BEEB20;
}
}
@@ -1258,7 +1258,7 @@ void func_80BEEFA8(EnAkindonuts* this, PlayState* play) {
play->msgCtx.stateTimer = 4;
this->unk_338 = 8;
this->unk_33C = 0;
SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->unk_338);
SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->unk_338);
this->actionFunc = func_80BEF518;
} else {
this->unk_2DC(this, play);
@@ -1296,18 +1296,18 @@ void func_80BEF18C(EnAkindonuts* this, PlayState* play) {
void func_80BEF20C(EnAkindonuts* this, PlayState* play) {
u8 talkState = Message_GetState(&play->msgCtx);
s16 sp24 = this->skelAnime.curFrame;
s16 sp22 = Animation_GetLastFrame(&sAnimations[this->unk_338].animation->common);
s16 sp22 = Animation_GetLastFrame(&sAnimationInfo[this->unk_338].animation->common);
if (this->unk_356 == 40) {
this->unk_338 = 5;
SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 5);
SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 5);
}
this->unk_356++;
if ((sp24 == sp22) && (this->unk_338 == 5)) {
this->unk_338 = 6;
SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 6);
SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 6);
}
if ((talkState == TEXT_STATE_5) && Message_ShouldAdvance(play)) {
@@ -1358,7 +1358,7 @@ void func_80BEF4B8(EnAkindonuts* this, PlayState* play) {
void func_80BEF518(EnAkindonuts* this, PlayState* play) {
s16 sp26 = this->skelAnime.curFrame;
s16 sp24 = Animation_GetLastFrame(&sAnimations[this->unk_338].animation->common);
s16 sp24 = Animation_GetLastFrame(&sAnimationInfo[this->unk_338].animation->common);
switch (sp26) {
case 10:
@@ -1432,7 +1432,7 @@ void func_80BEF518(EnAkindonuts* this, PlayState* play) {
if (sp26 == sp24) {
this->unk_33E = 3;
this->unk_338 = 19;
SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->unk_338);
SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->unk_338);
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_DOWN);
this->unk_32C &= ~2;
this->unk_32C |= 0x80;
@@ -1465,7 +1465,7 @@ void func_80BEF770(EnAkindonuts* this, PlayState* play) {
void func_80BEF83C(EnAkindonuts* this, PlayState* play) {
Vec3f sp34;
s16 sp32 = this->skelAnime.curFrame;
s16 sp30 = Animation_GetLastFrame(&sAnimations[this->unk_338].animation->common);
s16 sp30 = Animation_GetLastFrame(&sAnimationInfo[this->unk_338].animation->common);
if (sp32 == sp30) {
Math_SmoothStepToS(&this->unk_362, 0x1C71, 3, 0x100, 0);
@@ -1491,7 +1491,7 @@ void func_80BEF83C(EnAkindonuts* this, PlayState* play) {
if ((this->actor.home.pos.y + 22.5f) < this->actor.world.pos.y) {
this->unk_34C = 0.3f;
this->unk_338 = 9;
SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->unk_338);
SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->unk_338);
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_AKINDONUTS_HIDE);
this->actionFunc = func_80BEF9F0;
}
@@ -1510,7 +1510,7 @@ void func_80BEF9F0(EnAkindonuts* 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_338 = 10;
SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->unk_338);
SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->unk_338);
if (ENAKINDONUTS_GET_3(&this->actor) == ENAKINDONUTS_3_2) {
this->unk_32C |= 0x2;
}
@@ -1613,7 +1613,7 @@ void EnAkindonuts_Init(Actor* thisx, PlayState* play) {
}
}
SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 4);
SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 4);
this->unk_32C |= 0x2;
this->unk_32C |= 0x4;
this->unk_338 = 4;
+2 -2
View File
@@ -119,7 +119,7 @@ static ColliderCylinderInit sCylinderInit = {
static CollisionCheckInfoInit2 sColChkInfoInit = { 0, 0, 0, 0, MASS_IMMOVABLE };
static AnimationInfoS sAnimations[] = {
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 },
@@ -178,7 +178,7 @@ s32 func_80BDE27C(EnAl* this, s32 arg1) {
if (phi_v1) {
this->unk_4F8 = arg1;
ret = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, arg1);
ret = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, arg1);
this->unk_4C8 = this->skelAnime.playSpeed;
}
+16 -16
View File
@@ -44,7 +44,7 @@ const ActorInit En_Aob_01_InitVars = {
(ActorFunc)EnAob01_Draw,
};
static AnimationInfo D_809C3790[6] = {
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 },
@@ -144,12 +144,12 @@ void func_809C1304(EnAob01* this, PlayState* play) {
s32 func_809C1424(EnAob01* this) {
s16 curFrame = this->skelAnime.curFrame;
s16 lastFrame = Animation_GetLastFrame(D_809C3790[this->unk_43C].animation);
s16 lastFrame = Animation_GetLastFrame(sAnimationInfo[this->unk_43C].animation);
if (this->unk_43C == 1) {
if (curFrame == lastFrame) {
this->unk_43C = 2;
Actor_ChangeAnimationByInfo(&this->skelAnime, D_809C3790, 2);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 2);
return true;
}
} else if (this->unk_43C == 2) {
@@ -160,18 +160,18 @@ s32 func_809C1424(EnAob01* this) {
s32 func_809C14D0(EnAob01* this) {
s16 curFrame = this->skelAnime.curFrame;
s16 lastFrame = Animation_GetLastFrame(D_809C3790[this->unk_43C].animation);
s16 lastFrame = Animation_GetLastFrame(sAnimationInfo[this->unk_43C].animation);
if ((this->unk_43C == 0) || (this->unk_43C == 5)) {
if (curFrame == lastFrame) {
this->unk_43C = 3;
Actor_ChangeAnimationByInfo(&this->skelAnime, D_809C3790, 3);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 3);
return true;
}
} else if (this->unk_43C == 3) {
if (curFrame == lastFrame) {
this->unk_43C = 4;
Actor_ChangeAnimationByInfo(&this->skelAnime, D_809C3790, 4);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 4);
return true;
}
} else if (this->unk_43C == 4) {
@@ -182,12 +182,12 @@ s32 func_809C14D0(EnAob01* this) {
s32 func_809C15BC(EnAob01* this) {
s16 curFrame = this->skelAnime.curFrame;
s16 lastFrame = Animation_GetLastFrame(D_809C3790[this->unk_43C].animation);
s16 lastFrame = Animation_GetLastFrame(sAnimationInfo[this->unk_43C].animation);
if ((this->unk_43C != 0) && (this->unk_43C != 5)) {
if (curFrame == lastFrame) {
this->unk_43C = 5;
Actor_ChangeAnimationByInfo(&this->skelAnime, D_809C3790, 5);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 5);
return true;
}
} else {
@@ -329,7 +329,7 @@ void func_809C16DC(EnAob01* this, PlayState* play) {
this->unk_2D2 |= 0x40;
this->unk_2D2 |= 0x10;
this->unk_43C = 1;
Actor_ChangeAnimationByInfo(&this->skelAnime, D_809C3790, 1);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 1);
break;
case 0x3525:
@@ -344,7 +344,7 @@ void func_809C16DC(EnAob01* this, PlayState* play) {
this->unk_2D2 |= 0x40;
this->unk_2D2 |= 0x10;
this->unk_43C = 1;
Actor_ChangeAnimationByInfo(&this->skelAnime, D_809C3790, 1);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 1);
break;
}
@@ -359,7 +359,7 @@ void func_809C16DC(EnAob01* this, PlayState* play) {
this->unk_2D2 |= 4;
this->unk_2D2 |= 0x10;
this->unk_43C = 1;
Actor_ChangeAnimationByInfo(&this->skelAnime, D_809C3790, 1);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 1);
break;
case 0x3527:
@@ -371,7 +371,7 @@ void func_809C16DC(EnAob01* this, PlayState* play) {
this->unk_210 = 0x3536;
this->unk_2D2 |= 0x40;
this->unk_43C = 1;
Actor_ChangeAnimationByInfo(&this->skelAnime, D_809C3790, 1);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 1);
break;
}
@@ -379,7 +379,7 @@ void func_809C16DC(EnAob01* this, PlayState* play) {
this->unk_210 = 0x3537;
this->unk_2D2 |= 0x40;
this->unk_43C = 1;
Actor_ChangeAnimationByInfo(&this->skelAnime, D_809C3790, 1);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 1);
break;
}
@@ -556,7 +556,7 @@ void func_809C21E0(EnAob01* this, PlayState* play) {
this->unk_2D2 |= 0x10;
this->unk_2D2 |= 0x40;
this->unk_43C = 1;
Actor_ChangeAnimationByInfo(&this->skelAnime, D_809C3790, 1);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 1);
Message_StartTextbox(play, 0x354B, &this->actor);
}
this->unk_2D2 &= ~8;
@@ -734,7 +734,7 @@ void func_809C28B8(EnAob01* this, PlayState* play) {
this->unk_210 = 0x352D;
this->unk_2D2 |= 0x40;
this->unk_43C = 1;
Actor_ChangeAnimationByInfo(&this->skelAnime, D_809C3790, 1);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 1);
break;
}
@@ -930,7 +930,7 @@ void EnAob01_Init(Actor* thisx, PlayState* play) {
Collider_InitCylinder(play, &this->collider);
Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit);
this->unk_43C = 0;
Actor_ChangeAnimationByInfo(&this->skelAnime, D_809C3790, 0);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 0);
Actor_SetScale(&this->actor, 0.01f);
switch (gSaveContext.eventInf[0] & 7) {
@@ -103,12 +103,12 @@ void EnAttackNiw_AnimateWingHead(EnAttackNiw* this, PlayState* play, s16 animati
this->unkToggle28A &= 1;
switch (animationState) { // only case 2 and 5 are ever called in AttackNiw
case NIW_ANIMATION_STILL:
case NIW_ANIM_STILL:
this->targetLeftWingRotZ = 0.0f;
this->targetRightWingRotZ = 0.0f;
break;
case NIW_ANIMATION_HEAD_PECKING:
case NIW_ANIM_HEAD_PECKING:
this->unkTimer250 = 3;
this->targetLeftWingRotZ = 7000.0f;
this->targetRightWingRotZ = 7000.0f;
@@ -118,7 +118,7 @@ void EnAttackNiw_AnimateWingHead(EnAttackNiw* this, PlayState* play, s16 animati
}
break;
case NIW_ANIMATION_PECKING_AND_WAVING:
case NIW_ANIM_PECKING_AND_WAVING:
this->unkTimer250 = 2;
this->targetLeftWingRotZ = -10000.0f;
this->targetRightWingRotZ = -10000.0f;
@@ -132,7 +132,7 @@ void EnAttackNiw_AnimateWingHead(EnAttackNiw* this, PlayState* play, s16 animati
}
break;
case NIW_ANIMATION_PECKING_AND_FORFLAPPING:
case NIW_ANIM_PECKING_AND_FORFLAPPING:
this->unkTimer250 = 2;
this->targetRightWingRotY = 10000.0f;
this->targetLeftWingRotY = 10000.0f;
@@ -142,12 +142,12 @@ void EnAttackNiw_AnimateWingHead(EnAttackNiw* this, PlayState* play, s16 animati
}
break;
case NIW_ANIMATION_FREEZE:
case NIW_ANIM_FREEZE:
this->unusedTimer24E = 5;
this->unkTimer24C = this->unusedTimer24E;
break;
case NIW_ANIMATION_PECKING_SLOW_FORFLAPPING:
case NIW_ANIM_PECKING_SLOW_FORFLAPPING:
this->unkTimer250 = 5;
this->targetRightWingRotY = 14000.0f;
this->targetLeftWingRotY = 14000.0f;
@@ -276,7 +276,7 @@ void EnAttackNiw_EnterViewFromOffscreen(EnAttackNiw* this, PlayState* play) {
this->unkTimer24C = 10;
this->targetBodyRotY = -10000.0f;
this->targetHeadRotZ = -3000.0f;
EnAttackNiw_AnimateWingHead(this, play, NIW_ANIMATION_PECKING_AND_WAVING);
EnAttackNiw_AnimateWingHead(this, play, NIW_ANIM_PECKING_AND_WAVING);
}
}
@@ -325,10 +325,10 @@ void EnAttackNiw_AimAtPlayer(EnAttackNiw* this, PlayState* play) {
this->actionFunc = EnAttackNiw_FlyAway;
} else if (this->actor.bgCheckFlags & 1) { // touching floor
EnAttackNiw_AnimateWingHead(this, play, NIW_ANIMATION_PECKING_SLOW_FORFLAPPING);
EnAttackNiw_AnimateWingHead(this, play, NIW_ANIM_PECKING_SLOW_FORFLAPPING);
} else {
EnAttackNiw_AnimateWingHead(this, play, NIW_ANIMATION_PECKING_AND_WAVING);
EnAttackNiw_AnimateWingHead(this, play, NIW_ANIM_PECKING_AND_WAVING);
}
}
@@ -341,7 +341,7 @@ void EnAttackNiw_FlyAway(EnAttackNiw* this, PlayState* play) {
Math_SmoothStepToS(&this->actor.world.rot.x, this->targetRotX, 5, this->rotStep, 0);
Math_ApproachF(&this->rotStep, 5000.0f, 1.0f, 100.0f);
Math_ApproachF(&this->actor.velocity.y, 5.0f, 0.3f, 1.0f);
EnAttackNiw_AnimateWingHead(this, play, NIW_ANIMATION_PECKING_AND_WAVING);
EnAttackNiw_AnimateWingHead(this, play, NIW_ANIM_PECKING_AND_WAVING);
}
void EnAttackNiw_Update(Actor* thisx, PlayState* play) {
+10 -10
View File
@@ -62,7 +62,7 @@ const ActorInit En_Baba_InitVars = {
(ActorFunc)EnBaba_Draw,
};
static AnimationInfo sAnimations[] = {
static AnimationInfo sAnimationInfo[] = {
{ &gBbaIdleHoldingBagAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f },
{ &gBbaIdleAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f },
{ &gBbaWalkingHoldingBagAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f },
@@ -488,7 +488,7 @@ void EnBaba_HandleSchedule(EnBaba* this, PlayState* play) {
this->actor.speedXZ = 0.0f;
Enemy_StartFinishingBlow(play, &this->actor);
this->stateFlags |= BOMB_SHOP_LADY_STATE_KNOCKED_OVER;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animIndex);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, this->animIndex);
this->actionFunc = EnBaba_KnockedOver;
break;
}
@@ -506,7 +506,7 @@ void EnBaba_FinishInit(EnBaba* this, PlayState* play) {
if (play->sceneNum == SCENE_BOMYA) {
this->stateFlags |= BOMB_SHOP_LADY_STATE_VISIBLE;
this->animIndex = BOMB_SHOP_LADY_ANIM_IDLE;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animIndex);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, this->animIndex);
this->actionFunc = EnBaba_Idle;
} else if (play->sceneNum == SCENE_BACKTOWN) {
if ((BOMB_SHOP_LADY_GET_TYPE(&this->actor) == BOMB_SHOP_LADY_TYPE_FOLLOW_SCHEDULE) &&
@@ -520,7 +520,7 @@ void EnBaba_FinishInit(EnBaba* this, PlayState* play) {
this->sakonDeadTimer = 50;
this->animIndex = BOMB_SHOP_LADY_ANIM_WALKING_HOLDING_BAG;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animIndex);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, this->animIndex);
this->actionFunc = EnBaba_FollowSchedule;
} else if ((BOMB_SHOP_LADY_GET_TYPE(&this->actor) == BOMB_SHOP_LADY_TYPE_IDLE) &&
(gSaveContext.save.entrance == ENTRANCE(NORTH_CLOCK_TOWN, 7))) {
@@ -536,7 +536,7 @@ void EnBaba_FinishInit(EnBaba* this, PlayState* play) {
this->animIndex = BOMB_SHOP_LADY_ANIM_IDLE;
}
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animIndex);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, this->animIndex);
this->stateFlags |= BOMB_SHOP_LADY_STATE_AUTOTALK;
this->actionFunc = EnBaba_Idle;
} else {
@@ -548,15 +548,15 @@ void EnBaba_FinishInit(EnBaba* this, PlayState* play) {
if (BOMB_SHOP_LADY_GET_TYPE(&this->actor) == BOMB_SHOP_LADY_TYPE_SWAY) {
this->actor.flags &= ~ACTOR_FLAG_1;
this->animIndex = BOMB_SHOP_LADY_ANIM_SWAY;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animIndex);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, this->animIndex);
this->actionFunc = EnBaba_DoNothing;
} else if (BOMB_SHOP_LADY_GET_PATH_INDEX(&this->actor) != 0x3F) {
this->animIndex = BOMB_SHOP_LADY_ANIM_WALKING_HOLDING_BAG;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animIndex);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, this->animIndex);
this->actionFunc = EnBaba_Walk;
} else {
this->animIndex = BOMB_SHOP_LADY_ANIM_IDLE_HOLDING_BAG;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animIndex);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, this->animIndex);
this->actionFunc = EnBaba_FaceForward;
}
}
@@ -683,7 +683,7 @@ void EnBaba_FollowSchedule(EnBaba* this, PlayState* play) {
void EnBaba_KnockedOver(EnBaba* this, PlayState* play) {
s16 curFrame = this->skelAnime.curFrame;
s16 endFrame = Animation_GetLastFrame(sAnimations[this->animIndex].animation);
s16 endFrame = Animation_GetLastFrame(sAnimationInfo[this->animIndex].animation);
this->collider.dim.height = 37;
this->collider.dim.radius = 23;
@@ -695,7 +695,7 @@ void EnBaba_KnockedOver(EnBaba* this, PlayState* play) {
if (curFrame == endFrame) {
this->animIndex = BOMB_SHOP_LADY_ANIM_LYING_DOWN;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animIndex);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, this->animIndex);
}
} else {
if ((gSaveContext.save.weekEventReg[79] & 0x40) && (DECR(this->sakonDeadTimer) == 0)) {
+12 -12
View File
@@ -57,9 +57,9 @@ static ColliderCylinderInit sCylinderInit = {
static u16 sTextIds[] = { 0x2ABD, 0x2ABB, 0x2AD5, 0x2AD6, 0x2AD7, 0x2AD8, 0x2AC6 };
static AnimationHeader* D_80BE8E4C[] = { &object_bai_Anim_0011C0, &object_bai_Anim_0008B4, &object_bai_Anim_008198 };
static AnimationHeader* sAnimations[] = { &object_bai_Anim_0011C0, &object_bai_Anim_0008B4, &object_bai_Anim_008198 };
static u8 sAnimModes[] = { ANIMMODE_LOOP, ANIMMODE_LOOP };
static u8 sAnimationModes[] = { ANIMMODE_LOOP, ANIMMODE_LOOP };
void EnBaisen_Init(Actor* thisx, PlayState* play) {
EnBaisen* this = THIS;
@@ -100,11 +100,11 @@ void EnBaisen_Destroy(Actor* thisx, PlayState* play) {
Collider_DestroyCylinder(play, &this->collider);
}
void EnBaisen_ChangeAnimation(EnBaisen* this, s32 animIndex) {
void EnBaisen_ChangeAnim(EnBaisen* this, s32 animIndex) {
this->animIndex = animIndex;
this->frameCount = Animation_GetLastFrame(D_80BE8E4C[animIndex]);
Animation_Change(&this->skelAnime, D_80BE8E4C[this->animIndex], 1.0f, 0.0f, this->frameCount,
sAnimModes[this->animIndex], -10.0f);
this->frameCount = Animation_GetLastFrame(sAnimations[animIndex]);
Animation_Change(&this->skelAnime, sAnimations[this->animIndex], 1.0f, 0.0f, this->frameCount,
sAnimationModes[this->animIndex], -10.0f);
}
void func_80BE871C(EnBaisen* this) {
@@ -138,10 +138,10 @@ void func_80BE87B0(EnBaisen* this, PlayState* play) {
void func_80BE87FC(EnBaisen* this) {
if (this->paramCopy == 0) {
this->textIdIndex = 2;
EnBaisen_ChangeAnimation(this, 2);
EnBaisen_ChangeAnim(this, 2);
this->unk29E = this->actor.world.rot.y;
} else {
EnBaisen_ChangeAnimation(this, 0);
EnBaisen_ChangeAnim(this, 0);
}
this->actor.textId = sTextIds[this->textIdIndex];
@@ -190,12 +190,12 @@ void func_80BE89D8(EnBaisen* this, PlayState* play) {
if (&this->actor == this->unk2A4) {
this->unk29E = this->actor.world.rot.y;
if (this->animIndex == 0) {
EnBaisen_ChangeAnimation(this, 1);
EnBaisen_ChangeAnim(this, 1);
}
} else {
this->unk29E = Math_Vec3f_Yaw(&this->actor.world.pos, &this->unk2A4->world.pos);
if (this->animIndex != 0) {
EnBaisen_ChangeAnimation(this, 0);
EnBaisen_ChangeAnim(this, 0);
}
}
if ((play->msgCtx.currentTextId == 0x2AC6) || (play->msgCtx.currentTextId == 0x2AC7) ||
@@ -212,14 +212,14 @@ void func_80BE8AAC(EnBaisen* this, PlayState* play) {
if ((this->textIdIndex % 2) != 0) {
this->unk29E = this->actor.world.rot.y;
if (this->animIndex == 0) {
EnBaisen_ChangeAnimation(this, 1);
EnBaisen_ChangeAnim(this, 1);
}
} else {
if (this->unk2A4 != NULL) {
this->unk29E = Math_Vec3f_Yaw(&this->actor.world.pos, &this->unk2A4->world.pos);
}
if (this->animIndex != 0) {
EnBaisen_ChangeAnimation(this, 0);
EnBaisen_ChangeAnim(this, 0);
}
}
if ((Message_GetState(&play->msgCtx) == TEXT_STATE_5) && Message_ShouldAdvance(play)) {
@@ -158,7 +158,7 @@ s32 func_809CC270(EnBba01* this, PlayState* play) {
void EnBba01_FinishInit(EnHy* this, PlayState* play) {
//! @bug: gBbaSkel does not match EnHy's skeleton assumptions.
//! Since gBbaSkel has more limbs than expected, joint and morph tables will overflow
if (EnHy_Init(this, play, &gBbaSkel, ENHY_ANIMATION_BBA_6)) {
if (EnHy_Init(this, play, &gBbaSkel, ENHY_ANIM_BBA_6)) {
this->actor.flags |= ACTOR_FLAG_1;
this->actor.draw = EnBba01_Draw;
this->waitingOnInit = false;
@@ -62,7 +62,7 @@ static ColliderCylinderInit sCylinderInit = {
};
/* Animations struct */
static AnimationSpeedInfo D_809CDC7C[] = {
static AnimationSpeedInfo sAnimationInfo[] = {
{ &object_bji_Anim_000FDC, 1.0f, ANIMMODE_LOOP, 0.0f }, /* Looking through telescope */
{ &object_bji_Anim_005B58, 1.0f, ANIMMODE_LOOP, 10.0f }, /* Breathing? Unused? */
{ &object_bji_Anim_000AB0, 1.0f, ANIMMODE_LOOP, 0.0f }, /* Talking */
@@ -82,7 +82,7 @@ void func_809CCDE0(EnBji01* this, PlayState* play) {
}
void func_809CCE98(EnBji01* this, PlayState* play) {
SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, D_809CDC7C, 0, &this->animationIndex);
SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimationInfo, 0, &this->animIndex);
this->actor.textId = 0;
this->actionFunc = func_809CCEE8;
}
@@ -191,7 +191,7 @@ void func_809CD028(EnBji01* this, PlayState* play) {
}
break;
}
SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, D_809CDC7C, 2, &this->animationIndex);
SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimationInfo, 2, &this->animIndex);
this->actionFunc = EnBji01_DialogueHandler;
}
@@ -237,7 +237,7 @@ void EnBji01_DialogueHandler(EnBji01* this, PlayState* play) {
this->actor.flags &= ~ACTOR_FLAG_10000;
switch (play->msgCtx.currentTextId) {
case 0x5DE:
SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, D_809CDC7C, 3, &this->animationIndex);
SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimationInfo, 3, &this->animIndex);
func_80151938(play, 0x5DF);
break;
case 0x5E4:
@@ -287,8 +287,8 @@ void EnBji01_DialogueHandler(EnBji01* this, PlayState* play) {
func_809CCE98(this, play);
break;
}
if ((this->animationIndex == 3) && (this->skelAnime.curFrame == this->skelAnime.endFrame)) {
SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, D_809CDC7C, 2, &this->animationIndex);
if ((this->animIndex == 3) && (this->skelAnime.curFrame == this->skelAnime.endFrame)) {
SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimationInfo, 2, &this->animIndex);
}
}
@@ -307,7 +307,7 @@ void EnBji01_DoNothing(EnBji01* this, PlayState* play) {
}
void func_809CD6C0(EnBji01* this, PlayState* play) {
SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, D_809CDC7C, 2, &this->animationIndex);
SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimationInfo, 2, &this->animIndex);
this->actionFunc = func_809CD70C;
}
@@ -337,7 +337,7 @@ void EnBji01_Init(Actor* thisx, PlayState* play) {
this->actor.colChkInfo.mass = MASS_IMMOVABLE;
this->actor.targetMode = 0;
this->actor.child = NULL;
this->animationIndex = -1;
this->animIndex = -1;
Actor_SetScale(&this->actor, 0.01f);
SubS_FillCutscenesList(&this->actor, this->cutscenes, ARRAY_COUNT(this->cutscenes));
@@ -22,7 +22,7 @@ typedef struct EnBji01 {
/* 0x18C */ ColliderCylinder collider;
/* 0x1D8 */ Vec3s jointTable[SHIKASHI_LIMB_MAX];
/* 0x238 */ Vec3s morphTable[SHIKASHI_LIMB_MAX];
/* 0x298 */ s32 animationIndex;
/* 0x298 */ s32 animIndex;
/* 0x29C */ s16 eyeTexIndex;
/* 0x29E */ s16 blinkSeqIndex;
/* 0x2A0 */ s16 blinkTimer;
+15 -16
View File
@@ -88,9 +88,9 @@ typedef enum {
/* 3 */ TOILET_HAND_ANIM_THUMBS_UP, // Right
/* 4 */ TOILET_HAND_ANIM_OPEN_HAND,
/* 5 */ TOILET_HAND_ANIM_FIST // i.e. holding the reward
} ToiletHandAnimations;
} ToiletHandAnimation;
static AnimationInfoS sAnimationInfos[] = {
static AnimationInfoS sAnimationInfo[] = {
/* 0 */ { &gToiletHandWaitingAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
/* 1 */ { &gToiletHandWaitingAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
/* 2 */ { &gToiletHandWaggingFingerAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
@@ -104,22 +104,21 @@ void EnBjt_UpdateSkelAnime(EnBjt* this) {
SkelAnime_Update(&this->skelAnime);
}
s32 EnBjt_ChangeAnimation(EnBjt* this, s32 animIndex) {
s32 EnBjt_ChangeAnim(EnBjt* this, s32 animIndex) {
s32 changeAnim = false;
s32 changed = false;
if ((animIndex == TOILET_HAND_ANIM_WAITING) || (animIndex == TOILET_HAND_ANIM_WAITING_MORPH)) {
if (!((this->curAnimIndex == TOILET_HAND_ANIM_WAITING) ||
(this->curAnimIndex == TOILET_HAND_ANIM_WAITING_MORPH))) {
if (!((this->animIndex == TOILET_HAND_ANIM_WAITING) || (this->animIndex == TOILET_HAND_ANIM_WAITING_MORPH))) {
changeAnim = true;
}
} else if (this->curAnimIndex != animIndex) {
} else if (this->animIndex != animIndex) {
changeAnim = true;
}
if (changeAnim) {
this->curAnimIndex = animIndex;
changed = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfos, animIndex);
this->animIndex = animIndex;
changed = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, animIndex);
this->animPlaySpeed = this->skelAnime.playSpeed;
}
@@ -254,7 +253,7 @@ s32 EnBjt_ChooseBehaviour(Actor* thisx, PlayState* play) {
if ((itemAP == EXCH_ITEM_DEED_LAND) || (itemAP == EXCH_ITEM_LETTER_TO_KAFEI) ||
(itemAP == EXCH_ITEM_DEED_SWAMP) || (itemAP == EXCH_ITEM_DEED_MOUNTAIN) ||
(itemAP == EXCH_ITEM_DEED_OCEAN) || (itemAP == EXCH_ITEM_LETTER_MAMA)) {
EnBjt_ChangeAnimation(this, TOILET_HAND_ANIM_WAITING_MORPH);
EnBjt_ChangeAnim(this, TOILET_HAND_ANIM_WAITING_MORPH);
this->playedSfx = false;
this->behaviour++;
scriptBranch = 1; // Right item
@@ -288,7 +287,7 @@ s32 EnBjt_ChooseBehaviour(Actor* thisx, PlayState* play) {
case TOILET_HAND_BEHAVIOUR_USE_ITEM:
if (DECR(this->timer) == 0) {
EnBjt_ChangeAnimation(this, TOILET_HAND_ANIM_FIST); // change while not visible
EnBjt_ChangeAnim(this, TOILET_HAND_ANIM_FIST); // change while not visible
this->playedSfx = false;
this->behaviour++;
} else if (this->timer == 10) {
@@ -304,7 +303,7 @@ s32 EnBjt_ChooseBehaviour(Actor* thisx, PlayState* play) {
break;
case TOILET_HAND_BEHAVIOUR_REWARD_GIVEN:
EnBjt_ChangeAnimation(this, TOILET_HAND_ANIM_OPEN_HAND);
EnBjt_ChangeAnim(this, TOILET_HAND_ANIM_OPEN_HAND);
this->behaviour++;
scriptBranch = 1; // Right item
break;
@@ -339,11 +338,11 @@ s32 EnBjt_ChooseAnimation(EnBjt* this, PlayState* play) {
if (this->textId != curTextId) {
switch (curTextId) {
case 0x2949: // Wrong item
EnBjt_ChangeAnimation(this, TOILET_HAND_ANIM_WAGGING_FINGER);
EnBjt_ChangeAnim(this, TOILET_HAND_ANIM_WAGGING_FINGER);
break;
case 0x294A: // Right item
EnBjt_ChangeAnimation(this, TOILET_HAND_ANIM_THUMBS_UP);
EnBjt_ChangeAnim(this, TOILET_HAND_ANIM_THUMBS_UP);
break;
default:
@@ -353,7 +352,7 @@ s32 EnBjt_ChooseAnimation(EnBjt* this, PlayState* play) {
this->textId = curTextId;
} else if (this->stateFlags & TOILET_HAND_STATE_TEXTBOX) {
this->stateFlags &= ~TOILET_HAND_STATE_TEXTBOX;
EnBjt_ChangeAnimation(this, TOILET_HAND_ANIM_WAITING);
EnBjt_ChangeAnim(this, TOILET_HAND_ANIM_WAITING);
}
return 0;
}
@@ -422,8 +421,8 @@ void EnBjt_Init(Actor* thisx, PlayState* play) {
SkelAnime_InitFlex(play, &this->skelAnime, &gToiletHandSkel, NULL, this->jointTable, this->morphTable,
TOILET_HAND_LIMB_MAX);
this->curAnimIndex = TOILET_HAND_ANIM_NONE;
EnBjt_ChangeAnimation(this, TOILET_HAND_ANIM_WAITING);
this->animIndex = TOILET_HAND_ANIM_NONE;
EnBjt_ChangeAnim(this, TOILET_HAND_ANIM_WAITING);
Collider_InitAndSetCylinder(play, &this->collider, &this->actor, &sCylinderInit);
CollisionCheck_SetInfo2(&this->actor.colChkInfo, DamageTable_Get(0x16), &sColChkInfoInit);
+1 -1
View File
@@ -27,7 +27,7 @@ typedef struct EnBjt {
/* 0x244 */ UNK_TYPE1 unk_244[4];
/* 0x248 */ s32 playedSfx; // to only play once
/* 0x24C */ MsgEventFunc msgEventCallback;
/* 0x250 */ s32 curAnimIndex;
/* 0x250 */ s32 animIndex;
/* 0x254 */ UNK_TYPE1 pad_254[8];
} EnBjt; // size = 0x25C
@@ -64,7 +64,7 @@ static AnimationHeader* sAnimations[] = {
&object_cs_Anim_0060E8, &object_cs_Anim_005DC4, &object_cs_Anim_0026B0,
};
static u8 sAnimModes[] = {
static u8 sAnimationModes[] = {
ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_ONCE,
ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_ONCE, ANIMMODE_LOOP,
};
@@ -120,7 +120,7 @@ void EnBombers2_ChangeAnim(EnBombers2* this, s32 animIndex, f32 playSpeed) {
lastFrame = Animation_GetLastFrame(sAnimations[this->animIndex]);
this->lastAnimFrame = lastFrame;
Animation_Change(&this->skelAnime, sAnimations[this->animIndex], playSpeed, 0.0f, lastFrame,
sAnimModes[this->animIndex], -10.0f);
sAnimationModes[this->animIndex], -10.0f);
}
void func_80C04B40(EnBombers2* this) {
@@ -81,7 +81,7 @@ static AnimationHeader* sAnimations[] = {
&object_cs_Anim_0031C4, &object_cs_Anim_010B68,
};
static u8 sAnimModes[] = {
static u8 sAnimationModes[] = {
ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_LOOP,
ANIMMODE_ONCE, ANIMMODE_ONCE, ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_LOOP,
ANIMMODE_ONCE, ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_ONCE, ANIMMODE_LOOP,
@@ -177,8 +177,8 @@ void EnBomjimb_Destroy(Actor* thisx, PlayState* play) {
void func_80C0113C(EnBomjimb* this, s32 arg1, f32 arg2) {
this->unk_2DC = arg1;
this->unk_2B8 = Animation_GetLastFrame(sAnimations[arg1]);
Animation_Change(&this->skelAnime, sAnimations[this->unk_2DC], arg2, 0.0f, this->unk_2B8, sAnimModes[this->unk_2DC],
-4.0f);
Animation_Change(&this->skelAnime, sAnimations[this->unk_2DC], arg2, 0.0f, this->unk_2B8,
sAnimationModes[this->unk_2DC], -4.0f);
}
void func_80C011CC(EnBomjimb* this) {
@@ -148,7 +148,7 @@ s32 func_809CB4A0(EnCne01* this, PlayState* play) {
}
void EnCne01_FinishInit(EnHy* this, PlayState* play) {
if (EnHy_Init(this, play, &gCneSkel, ENHY_ANIMATION_OS_ANIME_11)) {
if (EnHy_Init(this, play, &gCneSkel, ENHY_ANIM_OS_ANIME_11)) {
this->actor.flags |= ACTOR_FLAG_1;
this->actor.draw = EnCne01_Draw;
this->waitingOnInit = false;
+2 -2
View File
@@ -128,7 +128,7 @@ s32 func_80B3E5B4(EnDai* this, PlayState* play) {
}
s32 func_80B3E5DC(EnDai* this, s32 arg1) {
static AnimationInfoS D_80B3FBFC[] = {
static AnimationInfoS sAnimationInfo[] = {
{ &object_dai_Anim_0079E4, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
{ &object_dai_Anim_0079E4, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
{ &object_dai_Anim_007354, 1.0f, 0, -1, ANIMMODE_ONCE, -4 },
@@ -167,7 +167,7 @@ s32 func_80B3E5DC(EnDai* this, s32 arg1) {
if (phi_v1) {
this->unk_A70 = arg1;
ret = SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80B3FBFC, arg1);
ret = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, arg1);
}
return ret;
@@ -63,7 +63,7 @@ static AnimationHeader* sAnimations[] = {
&object_daiku_Anim_001114, &object_daiku_Anim_00B690, &object_daiku_Anim_00BEAC,
};
static u8 sAnimModes[] = {
static u8 sAnimationModes[] = {
ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_ONCE,
ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_ONCE, ANIMMODE_ONCE,
};
@@ -131,7 +131,7 @@ void EnDaiku_Destroy(Actor* thisx, PlayState* play) {
void func_8094373C(EnDaiku* this, s32 arg1) {
this->unk_284 = Animation_GetLastFrame(sAnimations[arg1]);
Animation_Change(&this->skelAnime, sAnimations[arg1], 1.0f, 0.0f, this->unk_284, sAnimModes[arg1], -4.0f);
Animation_Change(&this->skelAnime, sAnimations[arg1], 1.0f, 0.0f, this->unk_284, sAnimationModes[arg1], -4.0f);
}
void func_809437C8(EnDaiku* this) {
@@ -15,7 +15,7 @@ void EnDemoheishi_Destroy(Actor* thisx, PlayState* play);
void EnDemoheishi_Update(Actor* thisx, PlayState* play);
void EnDemoheishi_Draw(Actor* thisx, PlayState* play);
void EnDemoheishi_ChangeAnimation(EnDemoheishi* this, s32 animIndex);
void EnDemoheishi_ChangeAnim(EnDemoheishi* this, s32 animIndex);
void EnDemoheishi_SetupIdle(EnDemoheishi* this);
void EnDemoheishi_Idle(EnDemoheishi* this, PlayState* play);
void EnDemoheishi_SetupTalk(EnDemoheishi* this);
@@ -23,12 +23,12 @@ void EnDemoheishi_Talk(EnDemoheishi* this, PlayState* play);
s32 EnDemoheishi_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx);
typedef enum {
/* 0 */ DEMOHEISHI_ANIMATION_STAND_HAND_ON_HIP,
/* 1 */ DEMOHEISHI_ANIMATION_CHEER_WITH_SPEAR,
/* 2 */ DEMOHEISHI_ANIMATION_WAVE,
/* 3 */ DEMOHEISHI_ANIMATION_SIT_AND_REACH,
/* 4 */ DEMOHEISHI_ANIMATION_STAND_UP
} EnDemoheishiAnimationIndex;
/* 0 */ DEMOHEISHI_ANIM_STAND_HAND_ON_HIP,
/* 1 */ DEMOHEISHI_ANIM_CHEER_WITH_SPEAR,
/* 2 */ DEMOHEISHI_ANIM_WAVE,
/* 3 */ DEMOHEISHI_ANIM_SIT_AND_REACH,
/* 4 */ DEMOHEISHI_ANIM_STAND_UP
} EnDemoheishiAnimation;
const ActorInit En_Demo_heishi_InitVars = {
ACTOR_EN_DEMO_HEISHI,
@@ -83,19 +83,19 @@ void EnDemoheishi_Destroy(Actor* thisx, PlayState* play) {
Collider_DestroyCylinder(play, &this->colliderCylinder);
}
void EnDemoheishi_ChangeAnimation(EnDemoheishi* this, s32 animIndex) {
void EnDemoheishi_ChangeAnim(EnDemoheishi* this, s32 animIndex) {
static AnimationHeader* sAnimations[] = {
&gSoldierStandHandOnHip, &gSoldierCheerWithSpear, &gSoldierWave, &gSoldierSitAndReach, &gSoldierStandUp,
};
static u8 sAnimModes[] = {
static u8 sAnimationModes[] = {
ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_ONCE, ANIMMODE_LOOP,
ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_LOOP
ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_LOOP,
};
this->animIndex = animIndex;
this->frameCount = Animation_GetLastFrame(sAnimations[animIndex]);
Animation_Change(&this->skelAnime, sAnimations[this->animIndex], 1.0f, 0.0f, this->frameCount,
sAnimModes[this->animIndex], -10.0f);
sAnimationModes[this->animIndex], -10.0f);
}
void EnDemoheishi_SetHeadRotation(EnDemoheishi* this) {
@@ -114,7 +114,7 @@ void EnDemoheishi_SetHeadRotation(EnDemoheishi* this) {
}
void EnDemoheishi_SetupIdle(EnDemoheishi* this) {
EnDemoheishi_ChangeAnimation(this, DEMOHEISHI_ANIMATION_STAND_HAND_ON_HIP);
EnDemoheishi_ChangeAnim(this, DEMOHEISHI_ANIM_STAND_HAND_ON_HIP);
this->textIdIndex = 0;
this->actor.textId = sTextIds[this->textIdIndex];
this->isTalking = false;
+58 -58
View File
@@ -165,26 +165,26 @@ static DamageTable sDamageTable = {
};
typedef enum {
/* 0 */ DOG_ANIMATION_WALK_AFTER_TALKING,
/* 1 */ DOG_ANIMATION_WALK,
/* 2 */ DOG_ANIMATION_RUN,
/* 3 */ DOG_ANIMATION_BARK,
/* 4 */ DOG_ANIMATION_SIT_DOWN_ONCE, // unused
/* 5 */ DOG_ANIMATION_SIT_DOWN,
/* 6 */ DOG_ANIMATION_LYING_DOWN_START_1, // unused
/* 7 */ DOG_ANIMATION_LYING_DOWN_LOOP, // unused
/* 8 */ DOG_ANIMATION_LYING_DOWN_START_2, // unused
/* 9 */ DOG_ANIMATION_LYING_DOWN_START_3, // unused
/* 10 */ DOG_ANIMATION_LYING_DOWN_START_4, // unused
/* 11 */ DOG_ANIMATION_WALK_BACKWARDS,
/* 12 */ DOG_ANIMATION_JUMP,
/* 13 */ DOG_ANIMATION_LONG_JUMP, // unused
/* 14 */ DOG_ANIMATION_JUMP_ATTACK,
/* 15 */ DOG_ANIMATION_SWIM,
/* 16 */ DOG_ANIMATION_MAX
} DogAnimationIndex;
/* 0 */ DOG_ANIM_WALK_AFTER_TALKING,
/* 1 */ DOG_ANIM_WALK,
/* 2 */ DOG_ANIM_RUN,
/* 3 */ DOG_ANIM_BARK,
/* 4 */ DOG_ANIM_SIT_DOWN_ONCE, // unused
/* 5 */ DOG_ANIM_SIT_DOWN,
/* 6 */ DOG_ANIM_LYING_DOWN_START_1, // unused
/* 7 */ DOG_ANIM_LYING_DOWN_LOOP, // unused
/* 8 */ DOG_ANIM_LYING_DOWN_START_2, // unused
/* 9 */ DOG_ANIM_LYING_DOWN_START_3, // unused
/* 10 */ DOG_ANIM_LYING_DOWN_START_4, // unused
/* 11 */ DOG_ANIM_WALK_BACKWARDS,
/* 12 */ DOG_ANIM_JUMP,
/* 13 */ DOG_ANIM_LONG_JUMP, // unused
/* 14 */ DOG_ANIM_JUMP_ATTACK,
/* 15 */ DOG_ANIM_SWIM,
/* 16 */ DOG_ANIM_MAX
} DogAnimation;
static AnimationInfoS sAnimations[] = {
static AnimationInfoS sAnimationInfo[] = {
{ &gDogWalkAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, { &gDogWalkAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -6 },
{ &gDogRunAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, { &gDogBarkAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -6 },
{ &gDogSitAnim, 1.0f, 0, -1, ANIMMODE_ONCE, -6 }, { &gDogSitAnim, 1.0f, 0, -1, ANIMMODE_LOOP_PARTIAL, -6 },
@@ -199,10 +199,10 @@ static InitChainEntry sInitChain[] = {
ICHAIN_F32(uncullZoneForward, 1000, ICHAIN_STOP),
};
void EnDg_ChangeAnimation(SkelAnime* skelAnime, AnimationInfoS* animationInfo, s32 index) {
void EnDg_ChangeAnim(SkelAnime* skelAnime, AnimationInfoS* animationInfo, s32 animIndex) {
f32 frameCount;
animationInfo += index;
animationInfo += animIndex;
if (animationInfo->frameCount < 0) {
frameCount = Animation_GetLastFrame(animationInfo->animation);
} else {
@@ -398,15 +398,15 @@ void EnDg_SetupIdleMove(EnDg* this, PlayState* play) {
if (!(this->actor.bgCheckFlags & 0x20)) {
if ((this->index == ENDG_INDEX_SWAMP_SPIDER_HOUSE) ||
((this->index == ENDG_INDEX_ROMANI_RANCH) && (play->sceneNum == SCENE_OMOYA))) {
EnDg_ChangeAnimation(&this->skelAnime, sAnimations, DOG_ANIMATION_WALK);
EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_WALK);
} else if (this->index == ENDG_INDEX_ROMANI_RANCH) {
EnDg_ChangeAnimation(&this->skelAnime, sAnimations, DOG_ANIMATION_RUN);
EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_RUN);
} else if (play->sceneNum == SCENE_CLOCKTOWER) {
EnDg_ChangeAnimation(&this->skelAnime, sAnimations, DOG_ANIMATION_RUN);
EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_RUN);
} else if (sRacetrackDogInfo[this->index].textId & 0x11) {
EnDg_ChangeAnimation(&this->skelAnime, sAnimations, DOG_ANIMATION_WALK);
EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_WALK);
} else {
EnDg_ChangeAnimation(&this->skelAnime, sAnimations, DOG_ANIMATION_RUN);
EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_RUN);
}
this->actionFunc = EnDg_IdleMove;
@@ -488,7 +488,7 @@ void EnDg_TryPickUp(EnDg* this, PlayState* play) {
this->dogFlags |= DOG_FLAG_HELD;
}
EnDg_ChangeAnimation(&this->skelAnime, sAnimations, DOG_ANIMATION_SIT_DOWN);
EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_SIT_DOWN);
this->actor.flags &= ~ACTOR_FLAG_1;
this->actor.speedXZ = 0.0f;
if (Player_GetMask(play) == PLAYER_MASK_TRUTH) {
@@ -555,7 +555,7 @@ void EnDg_CheckForBremenMaskMarch(EnDg* this, PlayState* play) {
if (this->index == sBremenMaskFollowerIndex) {
if (!(this->dogFlags & DOG_FLAG_FOLLOWING_BREMEN_MASK)) {
this->dogFlags |= DOG_FLAG_FOLLOWING_BREMEN_MASK;
EnDg_ChangeAnimation(&this->skelAnime, sAnimations, DOG_ANIMATION_WALK);
EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_WALK);
this->actionFunc = EnDg_SetupBremenMaskApproachPlayer;
} else if ((this->actionFunc == EnDg_ApproachPlayer) || (this->actionFunc == EnDg_SitNextToPlayer)) {
if (DECR(this->bremenBarkTimer) == 0) {
@@ -620,7 +620,7 @@ void EnDg_ChooseActionForForm(EnDg* this, PlayState* play) {
this->dogFlags &= ~DOG_FLAG_JUMP_ATTACKING;
if ((this->behavior != DOG_BEHAVIOR_ZORA) && (player->actor.speedXZ > 1.0f)) {
this->behavior = DOG_BEHAVIOR_ZORA;
EnDg_ChangeAnimation(&this->skelAnime, sAnimations, DOG_ANIMATION_RUN);
EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_RUN);
this->actionFunc = EnDg_ApproachPlayer;
}
@@ -634,7 +634,7 @@ void EnDg_ChooseActionForForm(EnDg* this, PlayState* play) {
this->dogFlags &= ~DOG_FLAG_JUMP_ATTACKING;
if ((this->behavior != DOG_BEHAVIOR_GORON) && (player->actor.speedXZ > 1.0f)) {
this->behavior = DOG_BEHAVIOR_GORON;
EnDg_ChangeAnimation(&this->skelAnime, sAnimations, DOG_ANIMATION_WALK_BACKWARDS);
EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_WALK_BACKWARDS);
this->timer = 50;
this->actionFunc = EnDg_BackAwayFromGoron;
}
@@ -649,7 +649,7 @@ void EnDg_ChooseActionForForm(EnDg* this, PlayState* play) {
this->dogFlags &= ~DOG_FLAG_JUMP_ATTACKING;
if ((this->behavior != DOG_BEHAVIOR_DEKU) && (player->actor.speedXZ > 1.0f)) {
this->behavior = DOG_BEHAVIOR_DEKU;
EnDg_ChangeAnimation(&this->skelAnime, sAnimations, DOG_ANIMATION_RUN);
EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_RUN);
this->actionFunc = EnDg_ApproachPlayerToAttack;
}
@@ -684,7 +684,7 @@ void EnDg_IdleMove(EnDg* this, PlayState* play) {
if (DECR(this->timer) == 0) {
this->timer = Rand_S16Offset(20, 20);
EnDg_ChangeAnimation(&this->skelAnime, sAnimations, DOG_ANIMATION_BARK);
EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_BARK);
this->actionFunc = EnDg_IdleBark;
}
}
@@ -722,7 +722,7 @@ void EnDg_BackAwayFromGoron(EnDg* this, PlayState* play) {
if (DECR(this->timer) == 0) {
this->timer = 50;
EnDg_ChangeAnimation(&this->skelAnime, sAnimations, DOG_ANIMATION_RUN);
EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_RUN);
this->actionFunc = EnDg_RunAwayFromGoron;
} else {
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 4, 0x3E8, 1);
@@ -764,7 +764,7 @@ void EnDg_RunAwayFromGoron(EnDg* this, PlayState* play) {
Math_ApproachF(&this->actor.speedXZ, 3.5f, 0.2f, 1.0f);
}
} else {
EnDg_ChangeAnimation(&this->skelAnime, sAnimations, DOG_ANIMATION_BARK);
EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_BARK);
this->actionFunc = EnDg_BarkAtGoron;
}
@@ -789,7 +789,7 @@ void EnDg_BarkAtGoron(EnDg* this, PlayState* play) {
Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 4, 0xC00);
this->actor.world.rot.y = this->actor.shape.rot.y;
if (this->actor.xzDistToPlayer < 250.0f) {
EnDg_ChangeAnimation(&this->skelAnime, sAnimations, DOG_ANIMATION_WALK_BACKWARDS);
EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_WALK_BACKWARDS);
this->timer = 50;
this->actionFunc = EnDg_BackAwayFromGoron;
}
@@ -815,11 +815,11 @@ void EnDg_ApproachPlayerToAttack(EnDg* this, PlayState* play) {
this->attackTimer = 20;
if (yawDiff < 0x4000) {
EnDg_ChangeAnimation(&this->skelAnime, sAnimations, DOG_ANIMATION_JUMP_ATTACK);
EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_JUMP_ATTACK);
this->actionFunc = EnDg_JumpAttack;
} else {
EnDg_ChangeAnimation(&this->skelAnime, sAnimations, DOG_ANIMATION_WALK_BACKWARDS);
sAnimations[DOG_ANIMATION_WALK_BACKWARDS].playSpeed = -1.0f;
EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_WALK_BACKWARDS);
sAnimationInfo[DOG_ANIM_WALK_BACKWARDS].playSpeed = -1.0f;
this->actionFunc = EnDg_SlowlyBackUpBeforeAttacking;
}
}
@@ -866,9 +866,9 @@ void EnDg_SitNextToPlayer(EnDg* this, PlayState* play) {
this->actor.world.rot.y = this->actor.shape.rot.y;
} else {
if (player->stateFlags3 & 0x20000000) { // bremen mask march
EnDg_ChangeAnimation(&this->skelAnime, sAnimations, DOG_ANIMATION_WALK);
EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_WALK);
} else {
EnDg_ChangeAnimation(&this->skelAnime, sAnimations, DOG_ANIMATION_RUN);
EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_RUN);
}
this->actionFunc = EnDg_ApproachPlayer;
@@ -892,7 +892,7 @@ void EnDg_JumpAttack(EnDg* this, PlayState* play) {
this->dogFlags |= DOG_FLAG_BOUNCED;
this->collider.base.atFlags &= ~AT_BOUNCED;
this->actor.speedXZ *= -1.0f;
EnDg_ChangeAnimation(&this->skelAnime, sAnimations, DOG_ANIMATION_RUN);
EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_RUN);
this->actionFunc = EnDg_RunAfterAttacking;
return;
}
@@ -900,13 +900,13 @@ void EnDg_JumpAttack(EnDg* this, PlayState* play) {
if (DECR(this->attackTimer) == 0) {
this->attackTimer = 60;
this->dogFlags &= ~DOG_FLAG_JUMP_ATTACKING;
EnDg_ChangeAnimation(&this->skelAnime, sAnimations, DOG_ANIMATION_RUN);
EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_RUN);
this->actionFunc = EnDg_RunAfterAttacking;
}
if (curFrame < 9) {
if (Animation_OnFrame(&this->skelAnime, 0.0f)) {
sAnimations[DOG_ANIMATION_JUMP_ATTACK].playSpeed = randPlusMinusPoint5Scaled(1.0f) + 3.0f;
sAnimationInfo[DOG_ANIM_JUMP_ATTACK].playSpeed = randPlusMinusPoint5Scaled(1.0f) + 3.0f;
}
EnDg_SpawnFloorDustRing(this, play);
@@ -915,7 +915,7 @@ void EnDg_JumpAttack(EnDg* this, PlayState* play) {
if (Animation_OnFrame(&this->skelAnime, 9.0f)) {
f32 rand = randPlusMinusPoint5Scaled(1.5f);
sAnimations[DOG_ANIMATION_JUMP_ATTACK].playSpeed = 1.2f;
sAnimationInfo[DOG_ANIM_JUMP_ATTACK].playSpeed = 1.2f;
this->actor.velocity.y = 2.0f * rand + 3.0f;
this->actor.speedXZ = 8.0f + rand;
} else if (curFrame > 20) {
@@ -939,10 +939,10 @@ void EnDg_JumpAttack(EnDg* this, PlayState* play) {
*/
void EnDg_WalkToPlayer(EnDg* this, PlayState* play) {
if (this->actor.xzDistToPlayer < 150.0f) {
EnDg_ChangeAnimation(&this->skelAnime, sAnimations, DOG_ANIMATION_WALK_BACKWARDS);
EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_WALK_BACKWARDS);
this->actionFunc = EnDg_BackAwayFromPlayer;
} else if (this->actor.xzDistToPlayer < 200.0f) {
EnDg_ChangeAnimation(&this->skelAnime, sAnimations, DOG_ANIMATION_BARK);
EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_BARK);
this->actionFunc = EnDg_BarkAtPlayer;
} else {
Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 4, 0xC00);
@@ -965,7 +965,7 @@ void EnDg_SetupBremenMaskApproachPlayer(EnDg* this, PlayState* play) {
void EnDg_Fall(EnDg* this, PlayState* play) {
if (this->actor.bgCheckFlags & 1) {
EnDg_ChangeAnimation(&this->skelAnime, sAnimations, DOG_ANIMATION_RUN);
EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_RUN);
this->actionFunc = EnDg_IdleMove;
}
@@ -990,7 +990,7 @@ void EnDg_ApproachPlayer(EnDg* this, PlayState* play) {
this->actor.world.rot.y = this->actor.shape.rot.y;
if (this->actor.xzDistToPlayer < 40.0f) {
EnDg_ChangeAnimation(&this->skelAnime, sAnimations, DOG_ANIMATION_SIT_DOWN);
EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_SIT_DOWN);
this->actionFunc = EnDg_SitNextToPlayer;
} else if (player->stateFlags3 & 0x20000000) { // bremen mask march
if ((this->actor.xzDistToPlayer > 40.0f) && (player->linearVelocity == 0.0f)) {
@@ -1019,14 +1019,14 @@ void EnDg_ApproachPlayer(EnDg* this, PlayState* play) {
*/
void EnDg_SlowlyBackUpBeforeAttacking(EnDg* this, PlayState* play) {
if (this->actor.xzDistToPlayer > 72.0f) {
EnDg_ChangeAnimation(&this->skelAnime, sAnimations, DOG_ANIMATION_JUMP_ATTACK);
EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_JUMP_ATTACK);
this->actionFunc = EnDg_JumpAttack;
}
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 4, 0x3E8, 1);
if (this->actor.bgCheckFlags & 8) {
this->actor.shape.rot.y = this->actor.wallYaw;
EnDg_ChangeAnimation(&this->skelAnime, sAnimations, DOG_ANIMATION_JUMP_ATTACK);
EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_JUMP_ATTACK);
this->actionFunc = EnDg_JumpAttack;
}
@@ -1045,10 +1045,10 @@ void EnDg_SlowlyBackUpBeforeAttacking(EnDg* this, PlayState* play) {
*/
void EnDg_BackAwayFromPlayer(EnDg* this, PlayState* play) {
if (this->actor.xzDistToPlayer > 200.0f) {
EnDg_ChangeAnimation(&this->skelAnime, sAnimations, DOG_ANIMATION_WALK);
EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_WALK);
this->actionFunc = EnDg_WalkToPlayer;
} else if (this->actor.xzDistToPlayer > 150.0f) {
EnDg_ChangeAnimation(&this->skelAnime, sAnimations, DOG_ANIMATION_BARK);
EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_BARK);
this->actionFunc = EnDg_BarkAtPlayer;
} else {
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 4, 0x3E8, 1);
@@ -1073,10 +1073,10 @@ void EnDg_BackAwayFromPlayer(EnDg* this, PlayState* play) {
*/
void EnDg_BarkAtPlayer(EnDg* this, PlayState* play) {
if (this->actor.xzDistToPlayer < 150.0f) {
EnDg_ChangeAnimation(&this->skelAnime, sAnimations, DOG_ANIMATION_WALK_BACKWARDS);
EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_WALK_BACKWARDS);
this->actionFunc = EnDg_BackAwayFromPlayer;
} else if (this->actor.xzDistToPlayer > 200.0f) {
EnDg_ChangeAnimation(&this->skelAnime, sAnimations, DOG_ANIMATION_WALK);
EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_WALK);
this->actionFunc = EnDg_WalkToPlayer;
}
@@ -1180,7 +1180,7 @@ void EnDg_Swim(EnDg* this, PlayState* play) {
this->behavior = DOG_BEHAVIOR_DEFAULT;
this->timer = Rand_S16Offset(60, 60);
Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_OUT_OF_WATER);
EnDg_ChangeAnimation(&this->skelAnime, sAnimations, DOG_ANIMATION_RUN);
EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_RUN);
Math_ApproachF(&this->actor.speedXZ, 3.5f, 0.2f, 1.0f);
this->actionFunc = EnDg_IdleMove;
}
@@ -1226,7 +1226,7 @@ void EnDg_JumpOutOfWater(EnDg* this, PlayState* play) {
this->actor.gravity = -3.0f;
this->timer = Rand_S16Offset(60, 60);
Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_OUT_OF_WATER);
EnDg_ChangeAnimation(&this->skelAnime, sAnimations, DOG_ANIMATION_RUN);
EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_RUN);
this->actionFunc = EnDg_IdleMove;
Math_ApproachF(&this->actor.speedXZ, 3.5f, 0.2f, 1.0f);
} else {
@@ -1292,7 +1292,7 @@ void EnDg_SetupTalk(EnDg* this, PlayState* play) {
void EnDg_Talk(EnDg* this, PlayState* play) {
if (Message_GetState(&play->msgCtx) == TEXT_STATE_CLOSING) {
EnDg_ChangeAnimation(&this->skelAnime, sAnimations, DOG_ANIMATION_WALK_AFTER_TALKING);
EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_WALK_AFTER_TALKING);
this->actionFunc = EnDg_Held;
}
}
@@ -1349,7 +1349,7 @@ void EnDg_Update(Actor* thisx, PlayState* play) {
}
if ((this->actor.bgCheckFlags & 0x40) && Actor_HasNoParent(&this->actor, play)) {
EnDg_ChangeAnimation(&this->skelAnime, sAnimations, DOG_ANIMATION_SWIM);
EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_SWIM);
this->actionFunc = EnDg_SetupSwim;
}
+7 -7
View File
@@ -93,7 +93,7 @@ static DamageTable sDamageTable = {
/* Powder Keg */ DMG_ENTRY(1, 0x0),
};
static AnimationInfoS sAnimations[] = {
static AnimationInfoS sAnimationInfo[] = {
{ &gDekuPalaceGuardStartAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
{ &gDekuPalaceGuardStartAnim, 1.0f, 0, -1, ANIMMODE_ONCE, -4 },
{ &gDekuPalaceGuardWaitAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
@@ -138,18 +138,18 @@ s32 func_80A514F0(SkelAnime* skelAnime, s16 animIndex) {
s32 sp30 = false;
if (animIndex >= 0) {
if (animIndex < ARRAY_COUNT(sAnimations)) {
if (animIndex < ARRAY_COUNT(sAnimationInfo)) {
sp30 = true;
frameCount = sAnimations[animIndex].frameCount;
frameCount = sAnimationInfo[animIndex].frameCount;
if (frameCount < 0) {
frameCount = Animation_GetLastFrame(sAnimations[animIndex].animation);
frameCount = Animation_GetLastFrame(sAnimationInfo[animIndex].animation);
}
frame = sAnimations[animIndex].startFrame;
frame = sAnimationInfo[animIndex].startFrame;
if (frame < 0) {
frame = frameCount;
}
Animation_Change(skelAnime, sAnimations[animIndex].animation, sAnimations[animIndex].playSpeed, frame,
frameCount, sAnimations[animIndex].mode, sAnimations[animIndex].morphFrames);
Animation_Change(skelAnime, sAnimationInfo[animIndex].animation, sAnimationInfo[animIndex].playSpeed, frame,
frameCount, sAnimationInfo[animIndex].mode, sAnimationInfo[animIndex].morphFrames);
}
}
return sp30;
+2 -2
View File
@@ -56,7 +56,7 @@ static ColliderCylinderInit sCylinderInit = {
static CollisionCheckInfoInit2 sColChkInfoInit = { 0, 0, 0, 0, MASS_IMMOVABLE };
static AnimationInfoS sAnimations[] = {
static AnimationInfoS sAnimationInfo[] = {
{ &object_dnp_Anim_0007D8, 1.0f, 0, -1, ANIMMODE_ONCE, -4 },
{ &object_dnp_Anim_0021DC, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
{ &object_dnp_Anim_0021DC, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
@@ -135,7 +135,7 @@ s32 func_80B3CC38(EnDnp* this, s32 arg1) {
if (arg1 != this->unk_340) {
this->unk_340 = arg1;
ret = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, arg1);
ret = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, arg1);
}
return ret;
+2 -2
View File
@@ -57,7 +57,7 @@ static ColliderCylinderInit sCylinderInit = {
static CollisionCheckInfoInit2 sColChkInfoInit = { 1, 0, 0, 0, MASS_IMMOVABLE };
static AnimationInfoS D_80A5349C[] = {
static AnimationInfoS sAnimationInfo[] = {
{ &object_dnq_Anim_008328, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
{ &object_dnq_Anim_008328, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
{ &object_dnq_Anim_007528, 1.0f, 0, -1, ANIMMODE_ONCE, -4 },
@@ -105,7 +105,7 @@ s32 func_80A5257C(EnDnq* this, s32 arg1) {
if (phi_v1) {
this->unk_398 = arg1;
ret = SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80A5349C, arg1);
ret = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, arg1);
}
return ret;
+38 -41
View File
@@ -20,18 +20,18 @@ void EnDns_DoNothing(EnDns* this, PlayState* play);
void func_8092D4D8(EnDns* this, PlayState* play);
typedef enum {
/* 0 */ EN_DNS_ANIMATION_IDLE_1,
/* 1 */ EN_DNS_ANIMATION_IDLE_2,
/* 2 */ EN_DNS_ANIMATION_WALK_1,
/* 3 */ EN_DNS_ANIMATION_WALK_2,
/* 4 */ EN_DNS_ANIMATION_SURPRISE_START,
/* 5 */ EN_DNS_ANIMATION_SURPRISE_LOOP,
/* 6 */ EN_DNS_ANIMATION_RUN_START,
/* 7 */ EN_DNS_ANIMATION_RUN_LOOP,
/* 8 */ EN_DNS_ANIMATION_DANCE,
/* 9 */ EN_DNS_ANIMATION_FLIP,
/* 10 */ EN_DNS_ANIMATION_MAX,
} EnDnsAnimationIndex;
/* 0 */ EN_DNS_ANIM_IDLE_1,
/* 1 */ EN_DNS_ANIM_IDLE_2,
/* 2 */ EN_DNS_ANIM_WALK_1,
/* 3 */ EN_DNS_ANIM_WALK_2,
/* 4 */ EN_DNS_ANIM_SURPRISE_START,
/* 5 */ EN_DNS_ANIM_SURPRISE_LOOP,
/* 6 */ EN_DNS_ANIM_RUN_START,
/* 7 */ EN_DNS_ANIM_RUN_LOOP,
/* 8 */ EN_DNS_ANIM_DANCE,
/* 9 */ EN_DNS_ANIM_FLIP,
/* 10 */ EN_DNS_ANIM_MAX,
} EnDnsAnimation;
static s32 D_8092DCB0[] = {
0x00172000, 0x050E082F, 0x0C100E08, 0x200C1000, 0x00172000, 0x050E0830, 0x0C100E08, 0x210C1000,
@@ -73,7 +73,7 @@ static ColliderCylinderInit sCylinderInit = {
static CollisionCheckInfoInit2 sColChkInfoInit = { 1, 0, 0, 0, MASS_IMMOVABLE };
static AnimationInfoS sAnimations[] = {
static AnimationInfoS sAnimationInfo[] = {
{ &gKingsChamberDekuGuardIdleAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
{ &gKingsChamberDekuGuardIdleAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
{ &gKingsChamberDekuGuardWalkAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
@@ -89,8 +89,8 @@ static AnimationInfoS sAnimations[] = {
void func_8092C5C0(EnDns* this) {
s32 pad;
if (((this->animationIndex == EN_DNS_ANIMATION_WALK_1) || (this->animationIndex == EN_DNS_ANIMATION_WALK_2) ||
(this->animationIndex == EN_DNS_ANIMATION_RUN_START) || (this->animationIndex == EN_DNS_ANIMATION_RUN_LOOP)) &&
if (((this->animIndex == EN_DNS_ANIM_WALK_1) || (this->animIndex == EN_DNS_ANIM_WALK_2) ||
(this->animIndex == EN_DNS_ANIM_RUN_START) || (this->animIndex == EN_DNS_ANIM_RUN_LOOP)) &&
(Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 3.0f))) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_WALK);
}
@@ -101,31 +101,29 @@ s32 func_8092C63C(EnDns* this, s32 arg1) {
s32 ret = false;
switch (arg1) {
case EN_DNS_ANIMATION_IDLE_1:
case EN_DNS_ANIMATION_IDLE_2:
if ((this->animationIndex != EN_DNS_ANIMATION_IDLE_1) &&
(this->animationIndex != EN_DNS_ANIMATION_IDLE_2)) {
case EN_DNS_ANIM_IDLE_1:
case EN_DNS_ANIM_IDLE_2:
if ((this->animIndex != EN_DNS_ANIM_IDLE_1) && (this->animIndex != EN_DNS_ANIM_IDLE_2)) {
phi_v1 = true;
}
break;
case EN_DNS_ANIMATION_WALK_1:
case EN_DNS_ANIMATION_WALK_2:
if ((this->animationIndex != EN_DNS_ANIMATION_WALK_1) &&
(this->animationIndex != EN_DNS_ANIMATION_WALK_2)) {
case EN_DNS_ANIM_WALK_1:
case EN_DNS_ANIM_WALK_2:
if ((this->animIndex != EN_DNS_ANIM_WALK_1) && (this->animIndex != EN_DNS_ANIM_WALK_2)) {
phi_v1 = true;
}
break;
default:
if (this->animationIndex != arg1) {
if (this->animIndex != arg1) {
phi_v1 = true;
}
}
if (phi_v1) {
this->animationIndex = arg1;
ret = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, arg1);
this->animIndex = arg1;
ret = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, arg1);
}
return ret;
@@ -236,7 +234,7 @@ s32 func_8092CAD0(EnDns* this, PlayState* play) {
this->unk_2F0 = 0.0f;
if (this->unk_2D2 != 0) {
this->unk_2F0 = this->skelAnime.curFrame;
func_8092C63C(this, EN_DNS_ANIMATION_WALK_1);
func_8092C63C(this, EN_DNS_ANIM_WALK_1);
}
this->unk_2DA = this->actor.world.rot.y;
}
@@ -306,7 +304,7 @@ s32 func_8092CCEC(EnDns* this, PlayState* play) {
}
s32 func_8092CE38(EnDns* this) {
static s32 D_8092DE00[] = { EN_DNS_ANIMATION_DANCE, EN_DNS_ANIMATION_DANCE, EN_DNS_ANIMATION_FLIP };
static s32 D_8092DE00[] = { EN_DNS_ANIM_DANCE, EN_DNS_ANIM_DANCE, EN_DNS_ANIM_FLIP };
s16 frame;
s32 pad;
Vec3f sp2C;
@@ -406,11 +404,11 @@ void func_8092D1B8(EnDns* this, PlayState* play) {
play_sound(NA_SE_SY_FOUND);
gSaveContext.eventInf[1] |= 0x20;
this->unk_2F4 = func_8092CCEC;
func_8092C63C(this, EN_DNS_ANIMATION_WALK_1);
func_8092C63C(this, EN_DNS_ANIM_WALK_1);
this->actionFunc = EnDns_DoNothing;
} else if (gSaveContext.eventInf[1] & 0x40) {
func_8092CCEC(this, play);
func_8092C63C(this, EN_DNS_ANIMATION_WALK_1);
func_8092C63C(this, EN_DNS_ANIM_WALK_1);
this->actionFunc = func_8092D330;
}
Math_ApproachS(&this->actor.shape.rot.y, sp22, 3, 0x2AA8);
@@ -452,7 +450,7 @@ void func_8092D4D8(EnDns* this, PlayState* play) {
if (ENDNS_GET_4000(&this->actor) && (this->unk_2D2 == 0)) {
if (func_8092CE38(this)) {
func_8092C63C(this, EN_DNS_ANIMATION_WALK_1);
func_8092C63C(this, EN_DNS_ANIM_WALK_1);
}
} else if (func_8010BF58(&this->actor, play, this->unk_1E0, this->unk_2F4, &this->unk_1DC)) {
SubS_UpdateFlags(&this->unk_2C6, 3, 7);
@@ -461,7 +459,7 @@ void func_8092D4D8(EnDns* this, PlayState* play) {
if (!(gSaveContext.eventInf[1] & 0x20)) {
this->skelAnime.curFrame = this->unk_2F0;
this->actor.world.rot.y = this->unk_2DA;
func_8092C63C(this, EN_DNS_ANIMATION_DANCE);
func_8092C63C(this, EN_DNS_ANIM_DANCE);
}
this->unk_2CC = 0;
this->unk_2CE = 0;
@@ -475,10 +473,10 @@ void func_8092D4D8(EnDns* this, PlayState* play) {
void func_8092D5E8(EnDns* this, PlayState* play) {
static s32 D_8092DE0C[] = {
EN_DNS_ANIMATION_IDLE_1,
EN_DNS_ANIMATION_IDLE_1,
EN_DNS_ANIMATION_SURPRISE_START,
EN_DNS_ANIMATION_RUN_START,
EN_DNS_ANIM_IDLE_1,
EN_DNS_ANIM_IDLE_1,
EN_DNS_ANIM_SURPRISE_START,
EN_DNS_ANIM_RUN_START,
};
s32 temp_v0;
u32 temp_v1;
@@ -491,10 +489,9 @@ void func_8092D5E8(EnDns* this, PlayState* play) {
this->unk_1D8 = temp_v1;
}
if (((this->animationIndex == EN_DNS_ANIMATION_SURPRISE_START) ||
(this->animationIndex == EN_DNS_ANIMATION_RUN_START)) &&
if (((this->animIndex == EN_DNS_ANIM_SURPRISE_START) || (this->animIndex == EN_DNS_ANIM_RUN_START)) &&
Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
func_8092C63C(this, this->animationIndex + 1);
func_8092C63C(this, this->animIndex + 1);
}
Cutscene_ActorTranslateAndYaw(&this->actor, play, temp_v0);
@@ -512,8 +509,8 @@ void EnDns_Init(Actor* thisx, PlayState* play) {
ActorShape_Init(&this->actor.shape, 0.0f, NULL, 18.0f);
SkelAnime_Init(play, &this->skelAnime, &gKingsChamberDekuGuardSkel, NULL, this->jointTable, this->morphTable,
KINGS_CHAMBER_DEKU_GUARD_LIMB_MAX);
this->animationIndex = -1;
func_8092C63C(this, EN_DNS_ANIMATION_WALK_1);
this->animIndex = -1;
func_8092C63C(this, EN_DNS_ANIM_WALK_1);
Collider_InitAndSetCylinder(play, &this->collider, &this->actor, &sCylinderInit);
CollisionCheck_SetInfo2(&this->actor.colChkInfo, DamageTable_Get(0x16), &sColChkInfoInit);
Actor_SetScale(&this->actor, 0.01f);
+1 -1
View File
@@ -53,7 +53,7 @@ typedef struct EnDns {
/* 0x2EC */ f32 unk_2EC;
/* 0x2F0 */ f32 unk_2F0;
/* 0x2F4 */ EnDnsFunc unk_2F4;
/* 0x2F8 */ s32 animationIndex;
/* 0x2F8 */ s32 animIndex;
/* 0x2FC */ s32 unk_2FC;
} EnDns; // size = 0x300
+22 -22
View File
@@ -25,11 +25,11 @@ void EnDragon_Attack(EnDragon* this, PlayState* play);
void EnDragon_Dead(EnDragon* this, PlayState* play);
typedef enum {
/* 0 */ DEEP_PYTHON_ANIMATION_SMALL_SIDE_SWAY,
/* 1 */ DEEP_PYTHON_ANIMATION_LARGE_SIDE_SWAY,
/* 2 */ DEEP_PYTHON_ANIMATION_VERTICAL_SWAY,
/* 3 */ DEEP_PYTHON_ANIMATION_IDLE
} DeepPythonAnimationIndex;
/* 0 */ DEEP_PYTHON_ANIM_SMALL_SIDE_SWAY,
/* 1 */ DEEP_PYTHON_ANIM_LARGE_SIDE_SWAY,
/* 2 */ DEEP_PYTHON_ANIM_VERTICAL_SWAY,
/* 3 */ DEEP_PYTHON_ANIM_IDLE
} DeepPythonAnimation;
typedef enum {
/* 0 */ DEEP_PYTHON_EXTEND_STATE_NOT_FULLY_EXTENDED,
@@ -264,18 +264,18 @@ static AnimationHeader* sAnimations[] = {
static u8 sAnimationModes[] = { ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_ONCE, ANIMMODE_ONCE };
void EnDragon_ChangeAnimation(EnDragon* this, s32 animationIndex) {
void EnDragon_ChangeAnim(EnDragon* this, s32 animIndex) {
f32 startFrame;
this->animationIndex = animationIndex;
this->endFrame = Animation_GetLastFrame(sAnimations[animationIndex]);
this->animIndex = animIndex;
this->endFrame = Animation_GetLastFrame(sAnimations[animIndex]);
startFrame = 0.0f;
if (this->animationIndex == DEEP_PYTHON_ANIMATION_IDLE) {
if (this->animIndex == DEEP_PYTHON_ANIM_IDLE) {
startFrame = this->endFrame;
}
Animation_Change(&this->skelAnime, sAnimations[animationIndex], 1.0f, startFrame, this->endFrame,
sAnimationModes[this->animationIndex], -4.0f);
Animation_Change(&this->skelAnime, sAnimations[animIndex], 1.0f, startFrame, this->endFrame,
sAnimationModes[this->animIndex], -4.0f);
}
static Color_RGBA8 sBubblePrimColors[] = {
@@ -329,7 +329,7 @@ void EnDragon_RetreatOnceTimerEnds(EnDragon* this, PlayState* play) {
}
void EnDragon_SetupRetreatOrIdle(EnDragon* this) {
EnDragon_ChangeAnimation(this, DEEP_PYTHON_ANIMATION_IDLE);
EnDragon_ChangeAnim(this, DEEP_PYTHON_ANIM_IDLE);
this->state = 0;
this->unk_2CC = 0;
this->hasGrabbedPlayer = false;
@@ -397,8 +397,8 @@ void EnDragon_Extend(EnDragon* this, PlayState* play) {
Math_ApproachF(&this->actor.world.pos.z, extendedPos.z, 0.3f, 50.0f);
if ((fabsf(this->actor.world.pos.x - extendedPos.x) < 4.0f) &&
(fabsf(this->actor.world.pos.z - extendedPos.z) < 4.0f)) {
if (this->animationIndex != DEEP_PYTHON_ANIMATION_LARGE_SIDE_SWAY) {
EnDragon_ChangeAnimation(this, DEEP_PYTHON_ANIMATION_LARGE_SIDE_SWAY);
if (this->animIndex != DEEP_PYTHON_ANIM_LARGE_SIDE_SWAY) {
EnDragon_ChangeAnim(this, DEEP_PYTHON_ANIM_LARGE_SIDE_SWAY);
}
this->state = DEEP_PYTHON_EXTEND_STATE_FULLY_EXTENDED;
@@ -419,8 +419,8 @@ void EnDragon_Extend(EnDragon* this, PlayState* play) {
if (yaw < 0x5000) {
// Player is in front of the jaw
if ((this->endFrame <= currentFrame) && (this->largeSwayWaitTimer == 0)) {
if (this->animationIndex != DEEP_PYTHON_ANIMATION_LARGE_SIDE_SWAY) {
EnDragon_ChangeAnimation(this, DEEP_PYTHON_ANIMATION_LARGE_SIDE_SWAY);
if (this->animIndex != DEEP_PYTHON_ANIM_LARGE_SIDE_SWAY) {
EnDragon_ChangeAnim(this, DEEP_PYTHON_ANIM_LARGE_SIDE_SWAY);
}
this->state = DEEP_PYTHON_EXTEND_STATE_REPEAT_LARGE_SWAY;
@@ -430,7 +430,7 @@ void EnDragon_Extend(EnDragon* this, PlayState* play) {
} else {
// Player is in behind the jaw
if (this->state == DEEP_PYTHON_EXTEND_STATE_REPEAT_LARGE_SWAY) {
EnDragon_ChangeAnimation(this, DEEP_PYTHON_ANIMATION_SMALL_SIDE_SWAY);
EnDragon_ChangeAnim(this, DEEP_PYTHON_ANIM_SMALL_SIDE_SWAY);
this->largeSwayWaitTimer = Rand_ZeroFloat(20.0f) + this->endFrame;
this->state = DEEP_PYTHON_EXTEND_STATE_REPEAT_SMALL_SWAY;
}
@@ -471,7 +471,7 @@ void EnDragon_SetupGrab(EnDragon* this, PlayState* play) {
this->state = DEEP_PYTHON_GRAB_STATE_START;
this->grabTimer = 0;
this->hasGrabbedPlayer = false;
EnDragon_ChangeAnimation(this, DEEP_PYTHON_ANIMATION_IDLE);
EnDragon_ChangeAnim(this, DEEP_PYTHON_ANIM_IDLE);
this->actionFunc = EnDragon_Grab;
}
}
@@ -548,8 +548,8 @@ void EnDragon_Grab(EnDragon* this, PlayState* play) {
}
void EnDragon_SetupAttack(EnDragon* this) {
if (this->animationIndex != DEEP_PYTHON_ANIMATION_LARGE_SIDE_SWAY) {
EnDragon_ChangeAnimation(this, DEEP_PYTHON_ANIMATION_LARGE_SIDE_SWAY);
if (this->animIndex != DEEP_PYTHON_ANIM_LARGE_SIDE_SWAY) {
EnDragon_ChangeAnim(this, DEEP_PYTHON_ANIM_LARGE_SIDE_SWAY);
}
this->behindJawRetreatTimer = 0;
@@ -603,8 +603,8 @@ void EnDragon_Attack(EnDragon* this, PlayState* play) {
if ((this->state <= DEEP_PYTHON_ATTACK_STATE_START) && (this->endFrame <= currentFrame)) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_UTSUBO_BITE);
if (this->animationIndex != DEEP_PYTHON_ANIMATION_LARGE_SIDE_SWAY) {
EnDragon_ChangeAnimation(this, DEEP_PYTHON_ANIMATION_LARGE_SIDE_SWAY);
if (this->animIndex != DEEP_PYTHON_ANIM_LARGE_SIDE_SWAY) {
EnDragon_ChangeAnim(this, DEEP_PYTHON_ANIM_LARGE_SIDE_SWAY);
}
this->state++;
@@ -26,7 +26,7 @@ typedef struct EnDragon {
/* 0x188 */ Vec3s jointTable[DEEP_PYTHON_LIMB_MAX];
/* 0x1E8 */ Vec3s morphTable[DEEP_PYTHON_LIMB_MAX];
/* 0x248 */ EnDragonActionFunc actionFunc;
/* 0x24C */ s32 animationIndex;
/* 0x24C */ s32 animIndex;
/* 0x250 */ s32 pythonIndex;
/* 0x254 */ Vec3f jawPos;
/* 0x260 */ Vec3f burrowEntrancePos; // Vertically and horizontally centered on the burrow opening. Set by Bg_Sinkai_Kabe
+2 -2
View File
@@ -51,7 +51,7 @@ static ColliderCylinderInit sCylinderInit = {
static CollisionCheckInfoInit2 sColChkInfoInit = { 0, 0, 0, 0, MASS_IMMOVABLE };
static AnimationInfoS sAnimations = { &gWeddingDressMannequinIdleAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 };
static AnimationInfoS sAnimationInfo = { &gWeddingDressMannequinIdleAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 };
void EnDrs_CollisionUpdate(EnDrs* this, PlayState* play) {
Collider_UpdateCylinder(&this->actor, &this->collider);
@@ -65,7 +65,7 @@ void EnDrs_Setup(EnDrs* this, PlayState* play) {
ActorShape_Init(&this->actor.shape, 0.0f, NULL, 0.0f);
SkelAnime_InitFlex(play, &this->skelAnime, &gWeddingDressMannequinSkel, NULL, this->jointTable,
this->morphTable, WEDDING_DRESS_MANNEQUIN_LIMB_MAX);
SubS_ChangeAnimationByInfoS(&this->skelAnime, &sAnimations, 0);
SubS_ChangeAnimationByInfoS(&this->skelAnime, &sAnimationInfo, 0);
Collider_InitAndSetCylinder(play, &this->collider, &this->actor, &sCylinderInit);
CollisionCheck_SetInfo2(&this->actor.colChkInfo, DamageTable_Get(0x16), &sColChkInfoInit);
Actor_SetScale(&this->actor, 0.01f);
+2 -2
View File
@@ -32,7 +32,7 @@ const ActorInit En_Ds2n_InitVars = {
(ActorFunc)EnDs2n_Draw,
};
static AnimationInfo sAnimations[] = {
static AnimationInfo sAnimationInfo[] = {
{ &gDs2nIdleAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f },
};
@@ -43,7 +43,7 @@ static TexturePtr sEyeTextures[] = { gDs2nEyeOpenTex, gDs2nEyeHalfTex, gDs2nEyeC
void EnDs2n_SetupIdle(EnDs2n* this) {
this->blinkTimer = 20;
this->blinkState = 0;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 0);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 0);
this->actionFunc = EnDs2n_Idle;
}
+11 -11
View File
@@ -95,27 +95,27 @@ static DamageTable sDamageTable = {
/* Powder Keg */ DMG_ENTRY(0, 0x0),
};
static AnimationInfoS sAnimations[] = {
static AnimationInfoS sAnimationInfo[] = {
{ &object_fr_Anim_001534, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
{ &object_fr_Anim_001534, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
{ &object_fr_Anim_0011C0, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
{ &object_fr_Anim_0007BC, 1.0f, 0, -1, ANIMMODE_ONCE, -4 },
};
s32 EnFg_UpdateAnimation(SkelAnime* skelAnime, s16 animIndex) {
s32 EnFg_ChangeAnim(SkelAnime* skelAnime, s16 animIndex) {
s16 frameCount;
s32 ret;
ret = false;
if (animIndex >= 0 && animIndex < 4) {
ret = true;
frameCount = sAnimations[animIndex].frameCount;
frameCount = sAnimationInfo[animIndex].frameCount;
if (frameCount < 0) {
frameCount = Animation_GetLastFrame(sAnimations[animIndex].animation);
frameCount = Animation_GetLastFrame(sAnimationInfo[animIndex].animation);
}
Animation_Change(skelAnime, sAnimations[animIndex].animation, sAnimations[animIndex].playSpeed,
sAnimations[animIndex].startFrame, frameCount, sAnimations[animIndex].mode,
sAnimations[animIndex].morphFrames);
Animation_Change(skelAnime, sAnimationInfo[animIndex].animation, sAnimationInfo[animIndex].playSpeed,
sAnimationInfo[animIndex].startFrame, frameCount, sAnimationInfo[animIndex].mode,
sAnimationInfo[animIndex].morphFrames);
}
return ret;
}
@@ -221,7 +221,7 @@ void EnFg_Idle(EnFg* this, PlayState* play) {
default:
if (DECR(this->timer) == 0) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_FROG_JUMP);
EnFg_UpdateAnimation(&this->skelAnime, 3);
EnFg_ChangeAnim(&this->skelAnime, 3);
this->actor.velocity.y = 10.0f;
this->timer = Rand_S16Offset(30, 30);
this->actionFunc = EnFg_Jump;
@@ -256,7 +256,7 @@ void EnFg_Jump(EnFg* this, PlayState* play) {
case FG_DMGEFFECT_EXPLOSION:
this->actor.flags &= ~ACTOR_FLAG_1;
Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_FROG_CRY_0);
EnFg_UpdateAnimation(&this->skelAnime, 0);
EnFg_ChangeAnim(&this->skelAnime, 0);
this->actor.params = FG_BLACK;
this->skelAnime.playSpeed = 0.0f;
ac = this->collider.base.ac;
@@ -276,7 +276,7 @@ void EnFg_Jump(EnFg* this, PlayState* play) {
}
if ((this->actor.velocity.y <= 0.0f) && (this->actor.bgCheckFlags & 1)) {
EnFg_UpdateAnimation(&this->skelAnime, 0);
EnFg_ChangeAnim(&this->skelAnime, 0);
this->actionFunc = EnFg_Idle;
this->actor.velocity.y = 0.0f;
} else {
@@ -316,7 +316,7 @@ void EnFg_Init(Actor* thisx, PlayState* play) {
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 10.0f);
SkelAnime_InitFlex(play, &this->skelAnime, &object_fr_Skel_00B538, NULL, this->jointTable, this->morphTable, 24);
EnFg_UpdateAnimation(&this->skelAnime, 0);
EnFg_ChangeAnim(&this->skelAnime, 0);
Collider_InitCylinder(play, &this->collider);
Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit);
CollisionCheck_SetInfo2(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit2);
+20 -20
View File
@@ -81,7 +81,7 @@ const ActorInit En_Fsn_InitVars = {
(ActorFunc)EnFsn_Draw,
};
static AnimationInfoS sAnimations[] = {
static AnimationInfoS sAnimationInfo[] = {
{ &gFsnIdleAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
{ &gFsnScratchBackAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
{ &gFsnTurnAroundAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
@@ -711,21 +711,21 @@ void EnFsn_InitShop(EnFsn* this, PlayState* play) {
this->stickAnimTween = this->arrowAnimTween = 0.0f;
}
this->blinkTimer = 20;
this->animationIndex = FSN_ANIM_HANDS_ON_COUNTER_START;
this->animIndex = FSN_ANIM_HANDS_ON_COUNTER_START;
this->eyeTextureIdx = 0;
SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIndex);
SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->animIndex);
this->actionFunc = EnFsn_Idle;
}
void EnFsn_Idle(EnFsn* this, PlayState* play) {
Player* player = GET_PLAYER(play);
if (this->animationIndex == FSN_ANIM_HANDS_ON_COUNTER_START) {
if (this->animIndex == FSN_ANIM_HANDS_ON_COUNTER_START) {
s16 curFrame = this->skelAnime.curFrame;
s16 frameCount = Animation_GetLastFrame(sAnimations[this->animationIndex].animation);
s16 frameCount = Animation_GetLastFrame(sAnimationInfo[this->animIndex].animation);
if (curFrame == frameCount) {
this->animationIndex = FSN_ANIM_HANDS_ON_COUNTER_LOOP;
SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIndex);
this->animIndex = FSN_ANIM_HANDS_ON_COUNTER_LOOP;
SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->animIndex);
}
return;
}
@@ -758,29 +758,29 @@ void EnFsn_Idle(EnFsn* this, PlayState* play) {
void EnFsn_Haggle(EnFsn* this, PlayState* play) {
s16 curFrame = this->skelAnime.curFrame;
s16 frameCount = Animation_GetLastFrame(sAnimations[this->animationIndex].animation);
s16 frameCount = Animation_GetLastFrame(sAnimationInfo[this->animIndex].animation);
if (this->flags & ENFSN_ANGRY) {
this->flags &= ~ENFSN_ANGRY;
this->animationIndex = FSN_ANIM_SLAM_COUNTER_LOOP;
SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIndex);
this->animIndex = FSN_ANIM_SLAM_COUNTER_LOOP;
SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->animIndex);
} else {
if (this->animationIndex == FSN_ANIM_SLAM_COUNTER_LOOP && Animation_OnFrame(&this->skelAnime, 18.0f)) {
if (this->animIndex == FSN_ANIM_SLAM_COUNTER_LOOP && Animation_OnFrame(&this->skelAnime, 18.0f)) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_HANKO);
}
if (this->flags & ENFSN_CALM_DOWN) {
this->flags &= ~ENFSN_CALM_DOWN;
this->animationIndex = FSN_ANIM_HANDS_ON_COUNTER_LOOP;
SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIndex);
this->animIndex = FSN_ANIM_HANDS_ON_COUNTER_LOOP;
SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->animIndex);
} else if (this->flags & ENFSN_OFFER_FINAL_PRICE) {
this->flags &= ~ENFSN_OFFER_FINAL_PRICE;
this->animationIndex = FSN_ANIM_MAKE_OFFER;
SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIndex);
this->animIndex = FSN_ANIM_MAKE_OFFER;
SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->animIndex);
} else {
if (this->animationIndex == FSN_ANIM_MAKE_OFFER) {
if (this->animIndex == FSN_ANIM_MAKE_OFFER) {
if (curFrame == frameCount) {
this->animationIndex = FSN_ANIM_HANDS_ON_COUNTER_LOOP;
SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIndex);
this->animIndex = FSN_ANIM_HANDS_ON_COUNTER_LOOP;
SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->animIndex);
} else {
if (Animation_OnFrame(&this->skelAnime, 28.0f)) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_HANKO);
@@ -1430,8 +1430,8 @@ void EnFsn_Init(Actor* thisx, PlayState* play) {
this->eyeTextureIdx = 0;
this->actor.flags |= ACTOR_FLAG_1;
this->actor.targetMode = 0;
this->animationIndex = FSN_ANIM_IDLE;
SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIndex);
this->animIndex = FSN_ANIM_IDLE;
SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->animIndex);
this->actionFunc = EnFsn_IdleBackroom;
}
}
+1 -1
View File
@@ -64,7 +64,7 @@ typedef struct EnFsn {
/* 0x444 */ u8 arrowAnimState;
/* 0x445 */ u8 stickAnimState;
/* 0x448 */ f32 shopItemSelectedTween;
/* 0x44C */ s16 animationIndex;
/* 0x44C */ s16 animIndex;
/* 0x44E */ u16 flags;
} EnFsn; // size = 0x450
+8 -8
View File
@@ -73,7 +73,7 @@ static Vec3f D_80964B0C = { 0.0f, 60.0f, -8.0f };
static Vec3f D_80964B18 = { 0.0f, 55.0f, 12.0f };
static Vec3f D_80964B24 = { 0.0f, 60.0f, 0.0f };
static AnimationInfo sAnimations[] = {
static AnimationInfo sAnimationInfo[] = {
{ &object_mu_Anim_0053E0, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -4.0f },
{ &object_mu_Anim_001F74, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -4.0f },
{ &object_mu_Anim_002F64, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -4.0f },
@@ -371,7 +371,7 @@ void func_8096209C(EnFu* this, PlayState* play) {
}
void func_809622FC(EnFu* this) {
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 1);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 1);
this->actionFunc = func_80962340;
}
@@ -536,7 +536,7 @@ void func_80962660(EnFu* this, PlayState* play) {
func_801477B4(play);
player->stateFlags1 |= 0x20;
this->unk_53C = 0;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 3);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 3);
func_801A2BB8(NA_BGM_MINI_GAME_2);
if (this->unk_542 == 0) {
if (this->unk_546 == 1) {
@@ -1214,7 +1214,7 @@ void func_80964190(EnFu* this, PlayState* play) {
case 0x2842:
case 0x2844:
case 0x2848:
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 1);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 1);
break;
case 0x2840:
@@ -1240,21 +1240,21 @@ void func_80964190(EnFu* this, PlayState* play) {
case 0x286B:
case 0x286D:
case 0x2871:
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 4);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 4);
break;
case 0x2860:
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 5);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 5);
break;
case 0x285F:
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 6);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 6);
break;
case 0x287E:
case 0x2880:
case 0x2883:
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 2);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 2);
break;
}
}
+22 -22
View File
@@ -72,7 +72,7 @@ typedef enum {
/* 9 */ GERUDO_WHITE_ANIM_BLOWN_AWAY,
} GerudoWhiteAnimations;
void EnGe1_SetAnimation(EnGe1* this, s16 index, u8 mode, f32 morphFrames);
void EnGe1_ChangeAnim(EnGe1* this, s16 animIndex, u8 mode, f32 morphFrames);
void EnGe1_ShadowDraw(Actor* actor, Lights* lights, PlayState* play);
void EnGe1_Wait(EnGe1* this, PlayState* play);
void EnGe1_PerformCutsceneActions(EnGe1* this, PlayState* play);
@@ -88,9 +88,9 @@ void EnGe1_Init(Actor* thisx, PlayState* play) {
this->picto.actor.colChkInfo.mass = MASS_IMMOVABLE;
this->picto.actor.targetMode = 6;
Actor_SetScale(&this->picto.actor, 0.01f);
this->curAnim = this->csAction = -1; // GERUDO_WHITE_ANIM_NONE
this->animIndex = this->csAction = -1; // GERUDO_WHITE_ANIM_NONE
this->stateFlags = 0;
EnGe1_SetAnimation(this, GERUDO_WHITE_ANIM_ARMS_FOLDED, ANIMMODE_LOOP, 0.0f);
EnGe1_ChangeAnim(this, GERUDO_WHITE_ANIM_ARMS_FOLDED, ANIMMODE_LOOP, 0.0f);
this->actionFunc = EnGe1_Wait;
this->picto.validationFunc = EnGe1_ValidatePictograph;
@@ -127,7 +127,7 @@ void EnGe1_Destroy(Actor* thisx, PlayState* play) {
Collider_DestroyCylinder(play, &this->collider);
}
void EnGe1_SetAnimation(EnGe1* this, s16 index, u8 mode, f32 morphFrames) {
void EnGe1_ChangeAnim(EnGe1* this, s16 animIndex, u8 mode, f32 morphFrames) {
static AnimationHeader* sAnimations[] = {
&gGerudoWhiteArmsFoldedAnim, // GERUDO_WHITE_ANIM_ARMS_FOLDED,
&gGerudoWhiteUnfoldingArmsAnim, // GERUDO_WHITE_ANIM_UNFOLDING_ARMS
@@ -143,22 +143,22 @@ void EnGe1_SetAnimation(EnGe1* this, s16 index, u8 mode, f32 morphFrames) {
// The GERUDO_WHITE_ANIM_LEADING_BOAT / GERUDO_WHITE_ANIM_BLOWN_AWAY cases are single frames of an "animation" used
// as static poses.
switch (index) {
switch (animIndex) {
case GERUDO_WHITE_ANIM_LEADING_BOAT:
Animation_Change(&this->skelAnime, sAnimations[index], 0.0f, 0.0f, 0.0f, ANIMMODE_ONCE, 0.0f);
Animation_Change(&this->skelAnime, sAnimations[animIndex], 0.0f, 0.0f, 0.0f, ANIMMODE_ONCE, 0.0f);
break;
case GERUDO_WHITE_ANIM_BLOWN_AWAY:
Animation_Change(&this->skelAnime, sAnimations[index], 0.0f, 1.0f, 1.0f, ANIMMODE_ONCE, 0.0f);
Animation_Change(&this->skelAnime, sAnimations[animIndex], 0.0f, 1.0f, 1.0f, ANIMMODE_ONCE, 0.0f);
break;
default:
Animation_Change(&this->skelAnime, sAnimations[index], 1.0f, 0.0f,
Animation_GetLastFrame(sAnimations[index]), mode, morphFrames);
Animation_Change(&this->skelAnime, sAnimations[animIndex], 1.0f, 0.0f,
Animation_GetLastFrame(sAnimations[animIndex]), mode, morphFrames);
break;
}
this->curAnim = index;
this->animIndex = animIndex;
}
void EnGe1_LookAtPlayer(EnGe1* this, PlayState* play) {
@@ -257,7 +257,7 @@ void EnGe1_PerformCutsceneActions(EnGe1* this, PlayState* play) {
s16 csAction;
if (SkelAnime_Update(&this->skelAnime) && (this->csAction == 3)) {
EnGe1_SetAnimation(this, GERUDO_WHITE_ANIM_STIFF_SHIVERING, ANIMMODE_LOOP, 0.0f);
EnGe1_ChangeAnim(this, GERUDO_WHITE_ANIM_STIFF_SHIVERING, ANIMMODE_LOOP, 0.0f);
}
if (Cutscene_CheckActorAction(play, 0x79)) {
@@ -284,27 +284,27 @@ void EnGe1_PerformCutsceneActions(EnGe1* this, PlayState* play) {
switch (this->csAction) {
// Aveil cutscene
case 1:
EnGe1_SetAnimation(this, GERUDO_WHITE_ANIM_ARMS_FOLDED, ANIMMODE_LOOP, 0.0f);
EnGe1_ChangeAnim(this, GERUDO_WHITE_ANIM_ARMS_FOLDED, ANIMMODE_LOOP, 0.0f);
break;
case 2:
EnGe1_SetAnimation(this, GERUDO_WHITE_ANIM_STANDING_HEAD_BOWED, ANIMMODE_LOOP, 0.0f);
EnGe1_ChangeAnim(this, GERUDO_WHITE_ANIM_STANDING_HEAD_BOWED, ANIMMODE_LOOP, 0.0f);
break;
case 3:
EnGe1_SetAnimation(this, GERUDO_WHITE_ANIM_STIFFENING, ANIMMODE_ONCE, 0.0f);
EnGe1_ChangeAnim(this, GERUDO_WHITE_ANIM_STIFFENING, ANIMMODE_ONCE, 0.0f);
break;
case 4:
EnGe1_SetAnimation(this, GERUDO_WHITE_ANIM_TRUDGING_OFF, ANIMMODE_ONCE, 0.0f);
EnGe1_ChangeAnim(this, GERUDO_WHITE_ANIM_TRUDGING_OFF, ANIMMODE_ONCE, 0.0f);
break;
case 5:
EnGe1_SetAnimation(this, GERUDO_WHITE_ANIM_EXCITED_CLAPPING, ANIMMODE_LOOP, 0.0f);
EnGe1_ChangeAnim(this, GERUDO_WHITE_ANIM_EXCITED_CLAPPING, ANIMMODE_LOOP, 0.0f);
break;
case 6:
EnGe1_SetAnimation(this, GERUDO_WHITE_ANIM_SALUTE, ANIMMODE_ONCE, 0.0f);
EnGe1_ChangeAnim(this, GERUDO_WHITE_ANIM_SALUTE, ANIMMODE_ONCE, 0.0f);
break;
case 7:
@@ -313,11 +313,11 @@ void EnGe1_PerformCutsceneActions(EnGe1* this, PlayState* play) {
// Twister cutscene
case 8:
EnGe1_SetAnimation(this, GERUDO_WHITE_ANIM_LEADING_BOAT, ANIMMODE_ONCE, 0.0f);
EnGe1_ChangeAnim(this, GERUDO_WHITE_ANIM_LEADING_BOAT, ANIMMODE_ONCE, 0.0f);
break;
case 9:
EnGe1_SetAnimation(this, GERUDO_WHITE_ANIM_BLOWN_AWAY, ANIMMODE_ONCE, 0.0f);
EnGe1_ChangeAnim(this, GERUDO_WHITE_ANIM_BLOWN_AWAY, ANIMMODE_ONCE, 0.0f);
EnGe1_SetupPath(this, play);
this->stateFlags |= GERUDO_WHITE_STATE_DISABLE_MOVEMENT;
this->screamTimer = (s32)(Rand_ZeroFloat(10.0f) + 20.0f);
@@ -327,12 +327,12 @@ void EnGe1_PerformCutsceneActions(EnGe1* this, PlayState* play) {
SkelAnime_Update(&this->skelAnime);
}
if ((this->curAnim == GERUDO_WHITE_ANIM_TRUDGING_OFF) &&
if ((this->animIndex == GERUDO_WHITE_ANIM_TRUDGING_OFF) &&
(Animation_OnFrame(&this->skelAnime, 12.0f) || Animation_OnFrame(&this->skelAnime, 25.0f))) {
Actor_PlaySfxAtPos(&this->picto.actor, NA_SE_EV_PIRATE_WALK);
}
if ((this->curAnim == GERUDO_WHITE_ANIM_SALUTE) && Animation_OnFrame(&this->skelAnime, 14.0f)) {
if ((this->animIndex == GERUDO_WHITE_ANIM_SALUTE) && Animation_OnFrame(&this->skelAnime, 14.0f)) {
Actor_PlaySfxAtPos(&this->picto.actor, NA_SE_EV_PIRATE_WALK);
}
} else {
@@ -401,7 +401,7 @@ s32 EnGe1_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* p
rot->x += this->headRot.y;
rot->z += this->headRot.x;
}
if (this->curAnim == GERUDO_WHITE_ANIM_ARMS_FOLDED) {
if (this->animIndex == GERUDO_WHITE_ANIM_ARMS_FOLDED) {
// Make small fidgeting movements if in standing animation.
if ((limbIndex == GERUDO_WHITE_LIMB_TORSO) || (limbIndex == GERUDO_WHITE_LIMB_LEFT_FOREARM) ||
(limbIndex == GERUDO_WHITE_LIMB_RIGHT_FOREARM)) {
+1 -1
View File
@@ -33,7 +33,7 @@ typedef struct EnGe1 {
/* 0x2B8 */ s16 eyeIndex;
/* 0x2BA */ s16 blinkTimer;
/* 0x2BC */ u16 stateFlags;
/* 0x2BE */ s16 curAnim; // Index
/* 0x2BE */ s16 animIndex;
/* 0x2C0 */ s16 csAction;
/* 0x2C2 */ s16 screamTimer;
/* 0x2C4 */ u8 hairstyle;
+4 -4
View File
@@ -126,7 +126,7 @@ static DamageTable sDamageTable = {
/* Powder Keg */ DMG_ENTRY(1, 0x0),
};
static AnimationInfoS sAnimations[] = {
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 },
@@ -379,7 +379,7 @@ void func_80BB1FCC(EnGeg* this, PlayState* play) {
void func_80BB2020(EnGeg* this, PlayState* play) {
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[this->unk_248].segment);
SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->unk_4AC);
SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->unk_4AC);
}
s32 func_80BB2088(EnGeg* this, PlayState* play) {
@@ -609,7 +609,7 @@ void func_80BB27D4(EnGeg* this, PlayState* play) {
void func_80BB2944(EnGeg* this, PlayState* play) {
u8 talkState = Message_GetState(&play->msgCtx);
s16 curFrame = this->skelAnime.curFrame;
s16 lastFrame = Animation_GetLastFrame(sAnimations[this->unk_4AC].animation);
s16 lastFrame = Animation_GetLastFrame(sAnimationInfo[this->unk_4AC].animation);
if (this->unk_4AC == 19) {
if (curFrame == lastFrame) {
@@ -705,7 +705,7 @@ void func_80BB2B1C(EnGeg* this, PlayState* play) {
void func_80BB2E00(EnGeg* this, PlayState* play) {
s16 sp2E = this->skelAnime.curFrame;
s16 sp2C = Animation_GetLastFrame(sAnimations[this->unk_4AC].animation);
s16 sp2C = Animation_GetLastFrame(sAnimationInfo[this->unk_4AC].animation);
if (this->unk_4AC == 2) {
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 5, 0x1000, 0x100);
+13 -13
View File
@@ -95,7 +95,7 @@ static DamageTable sDamageTable = {
/* Powder Keg */ DMG_ENTRY(0, 0x0),
};
static AnimationInfo sAnimations[] = {
static AnimationInfo sAnimationInfo[] = {
{ &object_gg_Anim_00F578, 1.0f, 0.0f, 0.0f, 0, -10.0f }, { &object_gg_Anim_00D528, 1.0f, 0.0f, 0.0f, 2, -10.0f },
{ &object_gg_Anim_00D174, 1.0f, 0.0f, 0.0f, 2, -10.0f }, { &object_gg_Anim_00ECC0, 1.0f, 0.0f, 0.0f, 2, -10.0f },
{ &object_gg_Anim_00BAF0, 1.0f, 0.0f, 0.0f, 0, -10.0f }, { &object_gg_Anim_00AF40, 1.0f, 0.0f, 0.0f, 0, -10.0f },
@@ -170,46 +170,46 @@ void func_80B35250(EnGg* this) {
this->unk_2E4 = 20;
this->unk_2E2 = 0;
this->unk_2E6 = 0;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 0);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 0);
this->actionFunc = func_80B35450;
}
void func_80B352A4(EnGg* this, PlayState* play) {
s16 sp26 = this->skelAnime.curFrame;
s16 lastFrame = Animation_GetLastFrame(sAnimations[this->unk_2E6].animation);
s16 lastFrame = Animation_GetLastFrame(sAnimationInfo[this->unk_2E6].animation);
if (sp26 == lastFrame) {
switch (this->actor.textId) {
case 0xCE5:
this->unk_2E6 = 1;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 1);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 1);
break;
case 0xCE6:
case 0xCEC:
this->unk_2E6 = 0;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 0);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 0);
break;
case 0xCE8:
this->unk_2E6 = 2;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 2);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 2);
break;
case 0xCE9:
this->unk_2E6 = 3;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 3);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 3);
break;
case 0xCED:
case 0xCEE:
this->unk_2E6 = 4;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 4);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 4);
break;
default:
this->unk_2E6 = 0;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 0);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 0);
break;
}
gSaveContext.save.weekEventReg[19] |= 0x80;
@@ -219,7 +219,7 @@ void func_80B352A4(EnGg* this, PlayState* play) {
this->skelAnime.playSpeed = 2.0f;
} else {
this->unk_2E6 = 4;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 4);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 4);
}
}
}
@@ -326,7 +326,7 @@ void func_80B35634(EnGg* this, PlayState* play) {
this->unk_2DA = 0;
break;
}
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->unk_2DA);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, this->unk_2DA);
}
if (this->unk_2DA == 14) {
@@ -366,11 +366,11 @@ void func_80B3584C(EnGg* this) {
void func_80B358D8(EnGg* this, PlayState* play) {
s16 sp1E = this->skelAnime.curFrame;
s16 lastFrame = Animation_GetLastFrame(sAnimations[this->unk_2DA].animation);
s16 lastFrame = Animation_GetLastFrame(sAnimationInfo[this->unk_2DA].animation);
if ((this->unk_2E6 == 14) && (sp1E == lastFrame)) {
this->unk_2E6 = 15;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 15);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 15);
}
}
+63 -63
View File
@@ -32,23 +32,23 @@ void EnGiant_PerformCutsceneActions(EnGiant* this, PlayState* play);
* These values are used to index into sAnimations to pick the appropriate animation.
*/
typedef enum {
/* 0 */ GIANT_ANIMATION_LOOK_UP_START,
/* 1 */ GIANT_ANIMATION_LOOK_UP_LOOP,
/* 2 */ GIANT_ANIMATION_FALLING_OVER,
/* 3 */ GIANT_ANIMATION_RAISED_ARMS_START,
/* 4 */ GIANT_ANIMATION_RAISED_ARMS_LOOP,
/* 5 */ GIANT_ANIMATION_STRUGGLE_START,
/* 6 */ GIANT_ANIMATION_STRUGGLE_LOOP,
/* 7 */ GIANT_ANIMATION_IDLE_LOOP,
/* 8 */ GIANT_ANIMATION_WALKING_LOOP,
/* 9 */ GIANT_ANIMATION_BIG_CALL_START,
/* 10 */ GIANT_ANIMATION_BIG_CALL_LOOP,
/* 11 */ GIANT_ANIMATION_BIG_CALL_END,
/* 12 */ GIANT_ANIMATION_SMALL_CALL_START,
/* 13 */ GIANT_ANIMATION_SMALL_CALL_LOOP,
/* 14 */ GIANT_ANIMATION_SMALL_CALL_END,
/* 15 */ GIANT_ANIMATION_MAX
} GiantAnimationIndex;
/* 0 */ GIANT_ANIM_LOOK_UP_START,
/* 1 */ GIANT_ANIM_LOOK_UP_LOOP,
/* 2 */ GIANT_ANIM_FALLING_OVER,
/* 3 */ GIANT_ANIM_RAISED_ARMS_START,
/* 4 */ GIANT_ANIM_RAISED_ARMS_LOOP,
/* 5 */ GIANT_ANIM_STRUGGLE_START,
/* 6 */ GIANT_ANIM_STRUGGLE_LOOP,
/* 7 */ GIANT_ANIM_IDLE_LOOP,
/* 8 */ GIANT_ANIM_WALKING_LOOP,
/* 9 */ GIANT_ANIM_BIG_CALL_START,
/* 10 */ GIANT_ANIM_BIG_CALL_LOOP,
/* 11 */ GIANT_ANIM_BIG_CALL_END,
/* 12 */ GIANT_ANIM_SMALL_CALL_START,
/* 13 */ GIANT_ANIM_SMALL_CALL_LOOP,
/* 14 */ GIANT_ANIM_SMALL_CALL_END,
/* 15 */ GIANT_ANIM_MAX
} GiantAnimation;
/**
* Used as values for csAction. The UNKNOWN ones are never used in-game.
@@ -91,16 +91,16 @@ static AnimationHeader* sAnimations[] = {
&gGiantSmallCallStartAnim, &gGiantSmallCallLoopAnim, &gGiantSmallCallEndAnim,
};
void EnGiant_ChangeAnimation(EnGiant* this, s16 newAnimationId) {
if (newAnimationId >= GIANT_ANIMATION_LOOK_UP_START && newAnimationId < GIANT_ANIMATION_MAX) {
if ((this->animationId == GIANT_ANIMATION_WALKING_LOOP && newAnimationId != GIANT_ANIMATION_WALKING_LOOP) ||
(newAnimationId == GIANT_ANIMATION_WALKING_LOOP && this->animationId != GIANT_ANIMATION_WALKING_LOOP)) {
Animation_Change(&this->skelAnime, sAnimations[newAnimationId], 1.0f, 0.0f,
Animation_GetLastFrame(&sAnimations[newAnimationId]->common), ANIMMODE_ONCE, 10.0f);
void EnGiant_ChangeAnim(EnGiant* this, s16 animIndex) {
if (animIndex >= GIANT_ANIM_LOOK_UP_START && animIndex < GIANT_ANIM_MAX) {
if (((this->animIndex == GIANT_ANIM_WALKING_LOOP) && (animIndex != GIANT_ANIM_WALKING_LOOP)) ||
((animIndex == GIANT_ANIM_WALKING_LOOP) && (this->animIndex != GIANT_ANIM_WALKING_LOOP))) {
Animation_Change(&this->skelAnime, sAnimations[animIndex], 1.0f, 0.0f,
Animation_GetLastFrame(&sAnimations[animIndex]->common), ANIMMODE_ONCE, 10.0f);
} else {
Animation_PlayOnce(&this->skelAnime, sAnimations[newAnimationId]);
Animation_PlayOnce(&this->skelAnime, sAnimations[animIndex]);
}
this->animationId = newAnimationId;
this->animIndex = animIndex;
}
}
@@ -153,7 +153,7 @@ void EnGiant_Init(Actor* thisx, PlayState* play) {
Actor_SetScale(&this->actor, 0.32f);
SkelAnime_InitFlex(play, &this->skelAnime, &gGiantSkel, &gGiantLargeStrideAnim, this->jointTable, this->morphTable,
GIANT_LIMB_MAX);
EnGiant_ChangeAnimation(this, GIANT_ANIMATION_IDLE_LOOP);
EnGiant_ChangeAnim(this, GIANT_ANIM_IDLE_LOOP);
this->csAction = GIANT_CS_ACTION_NONE;
this->actionFunc = EnGiant_PerformCutsceneActions;
this->actor.draw = NULL;
@@ -246,14 +246,14 @@ void EnGiant_Destroy(Actor* thisx, PlayState* play) {
* this function is to play the requested start animation if it has not been
* played yet and play the respetive looping animation otherwise.
*/
void EnGiant_ChangeToStartOrLoopAnimation(EnGiant* this, s16 requestedAnimationId) {
s16 nextAnimationId = requestedAnimationId + 1;
void EnGiant_ChangeToStartOrLoopAnimation(EnGiant* this, s16 requestedAnimIndex) {
s16 nextAnimIndex = requestedAnimIndex + 1;
if (this->animationId != nextAnimationId) {
if (this->animationId != requestedAnimationId) {
EnGiant_ChangeAnimation(this, requestedAnimationId);
if (this->animIndex != nextAnimIndex) {
if (this->animIndex != requestedAnimIndex) {
EnGiant_ChangeAnim(this, requestedAnimIndex);
} else {
EnGiant_ChangeAnimation(this, nextAnimationId);
EnGiant_ChangeAnim(this, nextAnimIndex);
}
}
}
@@ -261,45 +261,45 @@ void EnGiant_ChangeToStartOrLoopAnimation(EnGiant* this, s16 requestedAnimationI
/**
* Immediately switches to the specified animation for this cutscene action.
*/
void EnGiant_ChangeAnimationBasedOnCsAction(EnGiant* this) {
void EnGiant_ChangeAnimBasedOnCsAction(EnGiant* this) {
switch (this->csAction) {
case GIANT_CS_ACTION_IDLE:
EnGiant_ChangeAnimation(this, GIANT_ANIMATION_IDLE_LOOP);
EnGiant_ChangeAnim(this, GIANT_ANIM_IDLE_LOOP);
break;
case GIANT_CS_ACTION_WALKING:
EnGiant_ChangeAnimation(this, GIANT_ANIMATION_WALKING_LOOP);
EnGiant_ChangeAnim(this, GIANT_ANIM_WALKING_LOOP);
break;
case GIANT_CS_ACTION_STRUGGLING:
EnGiant_ChangeAnimation(this, GIANT_ANIMATION_STRUGGLE_START);
EnGiant_ChangeAnim(this, GIANT_ANIM_STRUGGLE_START);
break;
case GIANT_CS_ACTION_FALLING_OVER:
EnGiant_ChangeAnimation(this, GIANT_ANIMATION_FALLING_OVER);
EnGiant_ChangeAnim(this, GIANT_ANIM_FALLING_OVER);
break;
case GIANT_CS_ACTION_IDLE_FADE_IN:
EnGiant_ChangeAnimation(this, GIANT_ANIMATION_IDLE_LOOP);
EnGiant_ChangeAnim(this, GIANT_ANIM_IDLE_LOOP);
this->alpha = 0;
break;
case GIANT_CS_ACTION_TALKING:
EnGiant_ChangeAnimation(this, GIANT_ANIMATION_BIG_CALL_START);
EnGiant_ChangeAnim(this, GIANT_ANIM_BIG_CALL_START);
break;
case GIANT_CS_ACTION_DONE_TALKING:
EnGiant_ChangeAnimation(this, GIANT_ANIMATION_BIG_CALL_END);
EnGiant_ChangeAnim(this, GIANT_ANIM_BIG_CALL_END);
break;
case GIANT_CS_ACTION_TEACHING_OATH_TO_ORDER:
EnGiant_ChangeAnimation(this, GIANT_ANIMATION_SMALL_CALL_START);
EnGiant_ChangeAnim(this, GIANT_ANIM_SMALL_CALL_START);
break;
case GIANT_CS_ACTION_PLAYER_LEARNED_OATH_TO_ORDER:
EnGiant_ChangeAnimation(this, GIANT_ANIMATION_SMALL_CALL_END);
EnGiant_ChangeAnim(this, GIANT_ANIM_SMALL_CALL_END);
break;
case GIANT_CS_ACTION_UNKNOWN_12:
EnGiant_ChangeAnimation(this, GIANT_ANIMATION_IDLE_LOOP);
EnGiant_ChangeAnim(this, GIANT_ANIM_IDLE_LOOP);
break;
case GIANT_CS_ACTION_UNKNOWN_13:
EnGiant_ChangeAnimation(this, GIANT_ANIMATION_WALKING_LOOP);
EnGiant_ChangeAnim(this, GIANT_ANIM_WALKING_LOOP);
break;
case GIANT_CS_ACTION_UNKNOWN_14:
if (this->animationId != GIANT_ANIMATION_WALKING_LOOP) {
EnGiant_ChangeAnimation(this, GIANT_ANIMATION_WALKING_LOOP);
if (this->animIndex != GIANT_ANIM_WALKING_LOOP) {
EnGiant_ChangeAnim(this, GIANT_ANIM_WALKING_LOOP);
}
break;
case GIANT_CS_ACTION_HOLDING_UP_MOON_IN_CLOCK_TOWER:
@@ -336,31 +336,31 @@ void EnGiant_UpdateAlpha(EnGiant* this) {
*/
void EnGiant_PlayAndUpdateAnimation(EnGiant* this) {
if (SkelAnime_Update(&this->skelAnime) &&
(this->animationId != GIANT_ANIMATION_FALLING_OVER || this->csAction != GIANT_CS_ACTION_FALLING_OVER)) {
EnGiant_ChangeAnimation(this, this->animationId);
(this->animIndex != GIANT_ANIM_FALLING_OVER || this->csAction != GIANT_CS_ACTION_FALLING_OVER)) {
EnGiant_ChangeAnim(this, this->animIndex);
switch (this->csAction) {
case GIANT_CS_ACTION_LOOKING_UP:
EnGiant_ChangeToStartOrLoopAnimation(this, GIANT_ANIMATION_LOOK_UP_START);
EnGiant_ChangeToStartOrLoopAnimation(this, GIANT_ANIM_LOOK_UP_START);
break;
case GIANT_CS_ACTION_RAISING_ARMS:
EnGiant_ChangeToStartOrLoopAnimation(this, GIANT_ANIMATION_RAISED_ARMS_START);
EnGiant_ChangeToStartOrLoopAnimation(this, GIANT_ANIM_RAISED_ARMS_START);
break;
case GIANT_CS_ACTION_STRUGGLING:
EnGiant_ChangeToStartOrLoopAnimation(this, GIANT_ANIMATION_STRUGGLE_START);
EnGiant_ChangeToStartOrLoopAnimation(this, GIANT_ANIM_STRUGGLE_START);
break;
case GIANT_CS_ACTION_FALLING_OVER:
// Unused
EnGiant_ChangeToStartOrLoopAnimation(this, GIANT_ANIMATION_FALLING_OVER);
EnGiant_ChangeToStartOrLoopAnimation(this, GIANT_ANIM_FALLING_OVER);
break;
case GIANT_CS_ACTION_TALKING:
EnGiant_ChangeAnimation(this, GIANT_ANIMATION_BIG_CALL_LOOP);
EnGiant_ChangeAnim(this, GIANT_ANIM_BIG_CALL_LOOP);
break;
case GIANT_CS_ACTION_DONE_TALKING:
case GIANT_CS_ACTION_PLAYER_LEARNED_OATH_TO_ORDER:
EnGiant_ChangeAnimation(this, GIANT_ANIMATION_IDLE_LOOP);
EnGiant_ChangeAnim(this, GIANT_ANIM_IDLE_LOOP);
break;
case GIANT_CS_ACTION_TEACHING_OATH_TO_ORDER:
EnGiant_ChangeAnimation(this, GIANT_ANIMATION_SMALL_CALL_LOOP);
EnGiant_ChangeAnim(this, GIANT_ANIM_SMALL_CALL_LOOP);
break;
}
SkelAnime_Update(&this->skelAnime);
@@ -369,20 +369,20 @@ void EnGiant_PlayAndUpdateAnimation(EnGiant* this) {
void EnGiant_PlaySound(EnGiant* this) {
if (this->actor.draw != NULL && this->alpha > 0) {
if (this->animationId == GIANT_ANIMATION_WALKING_LOOP &&
if (this->animIndex == GIANT_ANIM_WALKING_LOOP &&
(Animation_OnFrame(&this->skelAnime, 40.0f) || Animation_OnFrame(&this->skelAnime, 100.0f))) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_KYOJIN_WALK);
}
if (this->animationId == GIANT_ANIMATION_FALLING_OVER && Animation_OnFrame(&this->skelAnime, 40.0f)) {
if (this->animIndex == GIANT_ANIM_FALLING_OVER && Animation_OnFrame(&this->skelAnime, 40.0f)) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_KYOJIN_VOICE_FAIL);
}
if (this->sfxId != 0xFFFF &&
((this->animationId == GIANT_ANIMATION_BIG_CALL_START && this->skelAnime.curFrame >= 18.0f) ||
this->animationId == GIANT_ANIMATION_BIG_CALL_LOOP)) {
((this->animIndex == GIANT_ANIM_BIG_CALL_START && this->skelAnime.curFrame >= 18.0f) ||
this->animIndex == GIANT_ANIM_BIG_CALL_LOOP)) {
func_800B9010(&this->actor, this->sfxId);
}
if ((this->animationId == GIANT_ANIMATION_SMALL_CALL_START && this->skelAnime.curFrame >= 18.0f) ||
this->animationId == GIANT_ANIMATION_SMALL_CALL_LOOP) {
if ((this->animIndex == GIANT_ANIM_SMALL_CALL_START && this->skelAnime.curFrame >= 18.0f) ||
this->animIndex == GIANT_ANIM_SMALL_CALL_LOOP) {
func_800B9010(&this->actor, NA_SE_EV_KYOJIN_SIGN - SFX_FLAG);
}
}
@@ -405,7 +405,7 @@ void EnGiant_PerformClockTowerSuccessActions(EnGiant* this, PlayState* play) {
play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, this->actorActionCommand)]->action) {
this->csAction =
play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, this->actorActionCommand)]->action;
EnGiant_ChangeAnimationBasedOnCsAction(this);
EnGiant_ChangeAnimBasedOnCsAction(this);
}
EnGiant_UpdateAlpha(this);
}
@@ -430,7 +430,7 @@ void EnGiant_PerformCutsceneActions(EnGiant* this, PlayState* play) {
play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, this->actorActionCommand)]->action) {
this->csAction =
play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, this->actorActionCommand)]->action;
EnGiant_ChangeAnimationBasedOnCsAction(this);
EnGiant_ChangeAnimBasedOnCsAction(this);
}
EnGiant_UpdateAlpha(this);
}
@@ -47,7 +47,7 @@ typedef struct EnGiant {
/* 0x144 */ SkelAnime skelAnime;
/* 0x188 */ Vec3s jointTable[GIANT_LIMB_MAX];
/* 0x1E8 */ Vec3s morphTable[GIANT_LIMB_MAX];
/* 0x248 */ s16 animationId;
/* 0x248 */ s16 animIndex;
/* 0x24A */ u16 actorActionCommand;
/* 0x24C */ u16 csAction;
/* 0x24E */ s16 alpha;
@@ -42,7 +42,15 @@ const ActorInit En_Ginko_Man_InitVars = {
(ActorFunc)EnGinkoMan_Draw,
};
static AnimationInfo sAnimations[] = {
typedef enum {
/* 0 */ GINKO_ANIM_LEGSMACKING,
/* 1 */ GINKO_ANIM_SITTING,
/* 2 */ GINKO_ANIM_REACHING,
/* 3 */ GINKO_ANIM_AMAZED,
/* 4 */ GINKO_ANIM_ADVERTISING,
} GinkoAnimation;
static AnimationInfo sAnimationInfo[] = {
{ &object_boj_Anim_0008C0, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -4.0f },
{ &object_boj_Anim_0043F0, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -4.0f },
{ &object_boj_Anim_004F40, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -4.0f },
@@ -72,7 +80,7 @@ void EnGinkoMan_Destroy(Actor* thisx, PlayState* play) {
void EnGinkoMan_SetupIdle(EnGinkoMan* this) {
this->actor.flags |= ACTOR_FLAG_1; // targetable
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_SITTING);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, GINKO_ANIM_SITTING);
this->actionFunc = EnGinkoMan_Idle;
}
@@ -82,11 +90,11 @@ void EnGinkoMan_Idle(EnGinkoMan* this, PlayState* play) {
EnGinkoMan_SwitchAnimation(this, play);
if (Actor_ProcessTalkRequest(&this->actor, &play->state)) {
if ((gSaveContext.save.bankRupees & 0xFFFF) == 0) {
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_FLOORSMACKING);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, GINKO_ANIM_LEGSMACKING);
Message_StartTextbox(play, 0x44C, &this->actor);
this->curTextId = 0x44C; // would you like to make an account
} else {
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_SITTING);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, GINKO_ANIM_SITTING);
if ((CURRENT_DAY == 3) && (gSaveContext.save.isNight == true)) {
Message_StartTextbox(play, 0x467, &this->actor);
this->curTextId = 0x467; // "What's this? You need somethin' on a day like this?
@@ -109,7 +117,7 @@ void EnGinkoMan_DepositDialogue(EnGinkoMan* this, PlayState* play) {
switch (this->curTextId) {
case 0x44C: // "Hey there, little guy! Won't you deposit some Rupees? (first dialogue)
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_SITTING);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, GINKO_ANIM_SITTING);
if (gSaveContext.save.weekEventReg[10] & 8) {
Message_StartTextbox(play, 0x44E, &this->actor);
this->curTextId = 0x44E; //" ...So, what'll it be? Deposit Rupees Don't deposit Rupees"
@@ -124,7 +132,7 @@ void EnGinkoMan_DepositDialogue(EnGinkoMan* this, PlayState* play) {
this->curTextId = 0x44E; //" ...So, what'll it be? Deposit Rupees Don't deposit Rupees"
break;
case 0x44F: // "...So, what'll it be? Deposit Rupees Don't deposit Rupees"
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_FLOORSMACKING);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, GINKO_ANIM_LEGSMACKING);
Message_StartTextbox(play, 0x450, &this->actor);
this->curTextId = 0x450; // "How much? How much? [rupee prompt]
break;
@@ -135,14 +143,14 @@ void EnGinkoMan_DepositDialogue(EnGinkoMan* this, PlayState* play) {
if (this->isNewAccount == true) {
this->isNewAccount = false;
if (this->curTextId != 0x453) { // "That's it? That ain't nothing at all, big spender!
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_SITTING);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, GINKO_ANIM_SITTING);
}
Message_StartTextbox(play, 0x461, &this->actor);
this->curTextId = 0x461; // So, little guy, what's your name?
} else {
if (this->curTextId == 0x453) { // "That's it? That ain't nothing at all, big spender!
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_FLOORSMACKING);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, GINKO_ANIM_LEGSMACKING);
}
play->msgCtx.bankRupees = gSaveContext.save.bankRupees & 0xFFFF;
@@ -172,17 +180,17 @@ void EnGinkoMan_DepositDialogue(EnGinkoMan* this, PlayState* play) {
Message_StartTextbox(play, 0x45D, &this->actor);
this->curTextId = 0x45D; // "What's this? You've already saved up 5000 Rupees?!
} else if (this->previousBankValue < (s16)(gSaveContext.save.bankRupees & 0xFFFF)) {
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_SITTING);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, GINKO_ANIM_SITTING);
Message_StartTextbox(play, 0x45E, &this->actor);
this->curTextId =
0x45E; // "...Hang on there, little guy. I can't take any more deposits. Sorry..."
} else {
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_FLOORSMACKING);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, GINKO_ANIM_LEGSMACKING);
Message_StartTextbox(play, 0x460, &this->actor);
this->curTextId = 0x460; // "Come back and deposit some after you save up a bunch!"
}
} else {
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_FLOORSMACKING);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, GINKO_ANIM_LEGSMACKING);
Message_StartTextbox(play, 0x460, &this->actor);
this->curTextId = 0x460; // "Come back and deposit some after you save up a bunch!"
}
@@ -212,7 +220,7 @@ void EnGinkoMan_DepositDialogue(EnGinkoMan* this, PlayState* play) {
EnGinkoMan_SetupStamp(this); // stamp player
break;
case 0x465: // "There! Now I'll know you when I see you!"
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_FLOORSMACKING);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, GINKO_ANIM_LEGSMACKING);
play->msgCtx.bankRupees = gSaveContext.save.bankRupees & 0xFFFF;
Message_StartTextbox(play, 0x45A, &this->actor);
this->curTextId = 0x45A; // "All right, little guy, now I've got a total of [rupees] from you!"
@@ -269,7 +277,7 @@ void EnGinkoMan_DepositDialogue(EnGinkoMan* this, PlayState* play) {
break;
case 0x476: // "...You haven't deposited that many Rupees, so that much isn't available for withdrawal. Do the
// math!
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_SITTING);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, GINKO_ANIM_SITTING);
case 0x475: // "What's this? Look, little guy, you can't hold this many rupees! You got that?"
case 0x47C: // "Is that so? Think it over, little guy! So what are you gonna do?"
case 0x47D: // duplicate of 48
@@ -336,7 +344,7 @@ void EnGinkoMan_WaitForDialogueInput(EnGinkoMan* this, PlayState* play) {
if (play->msgCtx.choiceIndex == GINKOMAN_CHOICE_YES) {
if (gSaveContext.save.playerData.rupees < play->msgCtx.bankRupeesSelected) {
play_sound(NA_SE_SY_ERROR);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_SITTING);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, GINKO_ANIM_SITTING);
Message_StartTextbox(play, 0x459, &this->actor);
this->curTextId = 0x459; // HEY you dont have that much
} else {
@@ -348,7 +356,7 @@ void EnGinkoMan_WaitForDialogueInput(EnGinkoMan* this, PlayState* play) {
Message_StartTextbox(play, 0x454, &this->actor);
this->curTextId = 0x454; // Seriously? that's a lot. A lot!
} else {
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_SITTING);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, GINKO_ANIM_SITTING);
Message_StartTextbox(play, 0x453, &this->actor);
this->curTextId = 0x453; // That's it? That aint nothing at all
}
@@ -365,7 +373,7 @@ void EnGinkoMan_WaitForDialogueInput(EnGinkoMan* this, PlayState* play) {
}
} else { // GINKOMAN_CHOICE_NO
func_8019F230();
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_SITTING);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, GINKO_ANIM_SITTING);
if ((gSaveContext.save.bankRupees & 0xFFFF) == 0) {
Message_StartTextbox(play, 0x456, &this->actor);
this->curTextId = 0x456; // Is that so? think about it
@@ -398,7 +406,7 @@ void EnGinkoMan_WaitForDialogueInput(EnGinkoMan* this, PlayState* play) {
if ((s32)((gSaveContext.save.bankRupees & 0xFFFF)) <
((s32)(play->msgCtx.bankRupeesSelected + this->serviceFee))) {
play_sound(NA_SE_SY_ERROR);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_FLOORSMACKING);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, GINKO_ANIM_LEGSMACKING);
Message_StartTextbox(play, 0x476, &this->actor);
this->curTextId = 0x476; // you dont have enough deposited to withdrawl
} else if (CUR_CAPACITY(UPG_WALLET) <
@@ -441,7 +449,7 @@ void EnGinkoMan_WaitForRupeeCount(EnGinkoMan* this, PlayState* play) {
switch (this->curTextId) {
case 0x450: // "How much? How much?" [rupee prompt] Set the amount with [Control Stick] and
if (play->msgCtx.bankRupeesSelected == 0) {
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_SITTING);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, GINKO_ANIM_SITTING);
Message_StartTextbox(play, 0x457, &this->actor);
this->curTextId = 0x457; // Zero Rupees? Cruel joke!
} else {
@@ -545,7 +553,7 @@ void EnGinkoMan_BankAward2(EnGinkoMan* this, PlayState* play) {
Message_StartTextbox(play, 0x47A, &this->actor);
this->curTextId = 0x47A; // Message after receiving reward for depositing 200 rupees.
} else {
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_SITTING);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, GINKO_ANIM_SITTING);
Message_StartTextbox(play, 0x47B, &this->actor);
this->curTextId = 0x47B; // Message after receiving reward for depositing 1000 rupees.
}
@@ -564,7 +572,7 @@ void EnGinkoMan_BankAward2(EnGinkoMan* this, PlayState* play) {
}
void EnGinkoMan_SetupStamp(EnGinkoMan* this) {
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_REACHING);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, GINKO_ANIM_REACHING);
this->actionFunc = EnGinkoMan_Stamp;
}
@@ -577,12 +585,12 @@ void EnGinkoMan_Stamp(EnGinkoMan* this, PlayState* play) {
if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
switch (this->curTextId) {
case 0x464: // "Hey, relax! It doesn't leave any marks, and it's not gonna hurt."
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_SITTING);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, GINKO_ANIM_SITTING);
Message_StartTextbox(play, 0x465, &this->actor);
this->curTextId = 0x465; // "There! Now I'll know you when I see you!"
break;
case 0x469: // "Excuse me, but let me take a look at you..."
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_SITTING);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, GINKO_ANIM_SITTING);
play->msgCtx.bankRupees = (gSaveContext.save.bankRupees & 0xFFFF);
if ((CURRENT_DAY == 3) && (gSaveContext.save.isNight == true)) {
Message_StartTextbox(play, 0x46C, &this->actor);
@@ -603,12 +611,12 @@ void EnGinkoMan_SwitchAnimation(EnGinkoMan* this, PlayState* play) {
if (this->animTimer == 0) {
if (this->skelAnime.animation != &object_boj_Anim_004A7C) {
this->animTimer = 40;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_ADVERTISING);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, GINKO_ANIM_ADVERTISING);
}
}
} else if ((this->animTimer == 0) && (this->skelAnime.animation != &object_boj_Anim_000AC4)) {
this->animTimer = 40;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_AMAZED);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, GINKO_ANIM_AMAZED);
}
DECR(this->animTimer);
@@ -34,12 +34,4 @@ extern const ActorInit En_Ginko_Man_InitVars;
#define GINKOMAN_CHOICE_YES 0
#define GINKOMAN_CHOICE_NO 1
typedef enum {
/* 0 */ GINKO_FLOORSMACKING,
/* 1 */ GINKO_SITTING,
/* 2 */ GINKO_REACHING,
/* 3 */ GINKO_AMAZED,
/* 4 */ GINKO_ADVERTISING,
} GinkoAnimationIndex;
#endif // Z_EN_GINKO_MAN_H
+22 -22
View File
@@ -102,7 +102,7 @@ static DamageTable sDamageTable = {
/* Powder Keg */ DMG_ENTRY(0, 0x0),
};
static AnimationInfo sAnimations[] = {
static AnimationInfo sAnimationInfo[] = {
{ &object_gk_Anim_00787C, 1.0f, 0.0f, 0.0f, 0, 0.0f }, { &object_gk_Anim_007DC4, 1.0f, 0.0f, 0.0f, 2, 0.0f },
{ &object_gk_Anim_0092C0, 1.0f, 0.0f, 0.0f, 0, 0.0f }, { &object_gk_Anim_005EDC, 1.0f, 0.0f, 0.0f, 0, 0.0f },
{ &object_gk_Anim_009638, 1.0f, 0.0f, 0.0f, 0, 0.0f }, { &object_gk_Anim_008774, 1.0f, 0.0f, 0.0f, 0, 0.0f },
@@ -259,7 +259,7 @@ s32 func_80B50854(EnGk* this, PlayState* play) {
(play->msgCtx.lastPlayedSong == OCARINA_SONG_GORON_LULLABY)) {
Flags_SetSwitch(play, ENGK_GET_3F00(&this->actor));
this->unk_2E4 = 3;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 3);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 3);
this->actionFunc = func_80B521E8;
return true;
}
@@ -483,21 +483,21 @@ s32 func_80B5123C(EnGk* this, PlayState* play) {
void func_80B51308(EnGk* this, PlayState* play) {
s16 sp1E = this->skelAnime.curFrame;
s16 lastFrame = Animation_GetLastFrame(sAnimations[this->unk_31A].animation);
s16 lastFrame = Animation_GetLastFrame(sAnimationInfo[this->unk_31A].animation);
if ((this->unk_2E4 == 7) && (sp1E == lastFrame)) {
this->unk_2E4 = 8;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 8);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 8);
}
}
void func_80B51398(EnGk* this, PlayState* play) {
s16 sp1E = this->skelAnime.curFrame;
s16 lastFrame = Animation_GetLastFrame(sAnimations[9].animation);
s16 lastFrame = Animation_GetLastFrame(sAnimationInfo[9].animation);
if ((this->unk_2E4 == 9) && (sp1E == lastFrame)) {
this->unk_2E4 = 10;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 10);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 10);
}
}
@@ -577,7 +577,7 @@ void func_80B51510(EnGk* this, PlayState* play) {
Flags_SetSwitch(play, ENGK_GET_3F00(&this->actor));
break;
}
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->unk_31A);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, this->unk_31A);
}
if (this->unk_31A == 7) {
@@ -593,19 +593,19 @@ void func_80B51510(EnGk* this, PlayState* play) {
void func_80B51698(EnGk* this, PlayState* play) {
s16 sp26 = this->skelAnime.curFrame;
s16 lastFrame = Animation_GetLastFrame(sAnimations[this->unk_2E4].animation);
s16 lastFrame = Animation_GetLastFrame(sAnimationInfo[this->unk_2E4].animation);
if (sp26 == lastFrame) {
switch (this->unk_2E4) {
case 0:
this->unk_2E4 = 2;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 2);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 2);
this->actionFunc = func_80B5216C;
break;
case 2:
this->unk_2E4 = 0;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 0);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 0);
this->actionFunc = func_80B5202C;
break;
}
@@ -617,16 +617,16 @@ void func_80B51760(EnGk* this, PlayState* play) {
s16 lastFrame;
if (this->unk_2E4 == 11) {
lastFrame = Animation_GetLastFrame(sAnimations[this->unk_2E4].animation);
lastFrame = Animation_GetLastFrame(sAnimationInfo[this->unk_2E4].animation);
if (sp2E == lastFrame) {
this->unk_2E4 = 5;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->unk_2E4);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, this->unk_2E4);
}
} else if (this->unk_2E4 == 10) {
lastFrame = Animation_GetLastFrame(sAnimations[this->unk_2E4].animation);
lastFrame = Animation_GetLastFrame(sAnimationInfo[this->unk_2E4].animation);
if (sp2E == lastFrame) {
this->unk_2E4 = 11;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->unk_2E4);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, this->unk_2E4);
}
} else {
if (Flags_GetSwitch(play, ENGK_GET_3F00(&this->actor))) {
@@ -692,7 +692,7 @@ void func_80B51970(EnGk* this, PlayState* play) {
if (this->unk_2E4 != 10) {
if (this->unk_2E4 != 9) {
this->unk_2E4 = 9;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 9);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 9);
} else {
func_80B51398(this, play);
}
@@ -759,7 +759,7 @@ void func_80B51B40(EnGk* this, PlayState* play) {
if (this->unk_2E4 != 10) {
if (this->unk_2E4 != 9) {
this->unk_2E4 = 9;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 9);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 9);
} else {
func_80B51398(this, play);
}
@@ -778,7 +778,7 @@ void func_80B51D9C(EnGk* this, PlayState* play) {
if (this->unk_1E4 & 4) {
this->unk_1E4 &= ~4;
this->unk_2E4 = 6;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 6);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 6);
this->actionFunc = func_80B51EA4;
} else {
this->unk_1E4 |= 4;
@@ -879,18 +879,18 @@ void func_80B5216C(EnGk* this, PlayState* play) {
void func_80B521E8(EnGk* this, PlayState* play) {
s16 sp1E = this->skelAnime.curFrame;
s16 lastFrame = Animation_GetLastFrame(sAnimations[this->unk_2E4].animation);
s16 lastFrame = Animation_GetLastFrame(sAnimationInfo[this->unk_2E4].animation);
if (sp1E == lastFrame) {
this->unk_2E4 = 1;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 1);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 1);
this->actionFunc = func_80B5227C;
}
}
void func_80B5227C(EnGk* this, PlayState* play) {
s16 sp26 = this->skelAnime.curFrame;
s16 lastFrame = Animation_GetLastFrame(sAnimations[this->unk_2E4].animation);
s16 lastFrame = Animation_GetLastFrame(sAnimationInfo[this->unk_2E4].animation);
if ((sp26 + 1) == lastFrame) {
func_800B14D4(play, 20.0f, &this->actor.home.pos);
@@ -1018,7 +1018,7 @@ void EnGk_Init(Actor* thisx, PlayState* play) {
if (ENGK_GET_F(&this->actor) == ENGK_F_1) {
this->unk_2E4 = 5;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 5);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 5);
if (play->sceneNum == SCENE_17SETUGEN2) {
if (Flags_GetSwitch(play, ENGK_GET_3F00(&this->actor))) {
Actor_MarkForDeath(&this->actor);
@@ -1056,7 +1056,7 @@ void EnGk_Init(Actor* thisx, PlayState* play) {
this->unk_318 = this->actor.cutscene;
this->actor.flags |= ACTOR_FLAG_10;
this->actor.flags |= ACTOR_FLAG_2000000;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 0);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 0);
this->actionFunc = func_80B5202C;
} else {
this->actionFunc = func_80B52654;
+2 -2
View File
@@ -209,7 +209,7 @@ static ColliderSphereInit sSphereInit = {
static CollisionCheckInfoInit2 sColChkInfoInit = { 0, 0, 0, 0, MASS_IMMOVABLE };
static AnimationInfoS D_80951CC0[] = {
static AnimationInfoS sAnimationInfo[] = {
{ &object_in2_Anim_009CDC, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
{ &object_in2_Anim_009CDC, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
{ &object_in2_Anim_00A5E0, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
@@ -317,7 +317,7 @@ s32 func_8094E054(EnGm* this, PlayState* play, s32 arg2) {
if (phi_v1) {
if (tmp >= 0) {
this->unk_3E8 = arg2;
ret = SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80951CC0, arg2);
ret = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, arg2);
this->unk_3A8 = this->skelAnime.playSpeed;
}
}
+2 -2
View File
@@ -186,7 +186,7 @@ static DamageTable sDamageTable = {
/* Powder Keg */ DMG_ENTRY(1, 0x0),
};
static AnimationInfoS sAnimations[] = {
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 },
@@ -793,7 +793,7 @@ s32 func_80A12C48(EnGo* this, PlayState* play, s32 arg2) {
if (objIdx2 >= 0) {
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[objIdx2].segment);
this->unk_3DC = arg2;
ret = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, arg2);
ret = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, arg2);
this->unk_398 = this->skelAnime.playSpeed;
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[objIdx].segment);
}
@@ -16,7 +16,7 @@ void EnGuardNuts_Destroy(Actor* thisx, PlayState* play);
void EnGuardNuts_Update(Actor* thisx, PlayState* play);
void EnGuardNuts_Draw(Actor* thisx, PlayState* play);
void EnGuardNuts_ChangeAnim(EnGuardNuts* this, s32 index);
void EnGuardNuts_ChangeAnim(EnGuardNuts* this, s32 animIndex);
void EnGuardNuts_SetupWait(EnGuardNuts* this);
void EnGuardNuts_Wait(EnGuardNuts* this, PlayState* play);
void func_80ABB540(EnGuardNuts* this);
@@ -72,7 +72,7 @@ static AnimationHeader* sAnimations[] = {
&gDekuPalaceGuardWalkAnim,
};
static u8 sAnimModes[] = { ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_ONCE, ANIMMODE_ONCE };
static u8 sAnimationModes[] = { ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_ONCE, ANIMMODE_ONCE };
static TexturePtr sEyeTextures[] = {
gDekuPalaceGuardEyeOpenTex,
@@ -126,13 +126,13 @@ void EnGuardNuts_Destroy(Actor* thisx, PlayState* play) {
* @brief Changes the animation to the provided index. Updates animIndex and animFrameCount for the animation.
*
* @param this
* @param index the index of sAnimations to change to
* @param animIndex the index of sAnimations to change to
*/
void EnGuardNuts_ChangeAnim(EnGuardNuts* this, s32 index) {
this->animIndex = index;
void EnGuardNuts_ChangeAnim(EnGuardNuts* this, s32 animIndex) {
this->animIndex = animIndex;
this->animFrameCount = Animation_GetLastFrame(sAnimations[this->animIndex]);
Animation_Change(&this->skelAnime, sAnimations[this->animIndex], 1.0f, 0.0f, this->animFrameCount,
sAnimModes[this->animIndex], -2.0f);
sAnimationModes[this->animIndex], -2.0f);
}
void EnGuardNuts_SetupWait(EnGuardNuts* this) {
@@ -62,9 +62,9 @@ static ColliderCylinderInit sCylinderInit = {
{ 15, 20, 0, { 0, 0, 0 } },
};
static AnimationHeader* D_80BC79CC[] = { &object_fu_Anim_000B04, &object_fu_Anim_00057C };
static u8 D_80BC79D4[] = { ANIMMODE_LOOP, ANIMMODE_LOOP };
static f32 D_80BC79D8[] = { 1.0f, 1.0f };
static AnimationHeader* sAnimations[] = { &object_fu_Anim_000B04, &object_fu_Anim_00057C };
static u8 sAnimationModes[] = { ANIMMODE_LOOP, ANIMMODE_LOOP };
static f32 sPlaySpeeds[] = { 1.0f, 1.0f };
static TexturePtr sEyeTextures[] = { object_fu_Tex_005F20, object_fu_Tex_006320 };
static TexturePtr sMouthTextures[] = { object_fu_Tex_006720, object_fu_Tex_006920 };
@@ -105,17 +105,17 @@ void EnGuruguru_Destroy(Actor* thisx, PlayState* play) {
}
}
void EnGuruguru_ChangeAnimation(EnGuruguru* this, s32 arg1) {
this->frameCount = Animation_GetLastFrame(D_80BC79CC[arg1]);
Animation_Change(&this->skelAnime, D_80BC79CC[arg1], D_80BC79D8[arg1], 0.0f, this->frameCount, D_80BC79D4[arg1],
-4.0f);
void EnGuruguru_ChangeAnim(EnGuruguru* this, s32 animIndex) {
this->frameCount = Animation_GetLastFrame(sAnimations[animIndex]);
Animation_Change(&this->skelAnime, sAnimations[animIndex], sPlaySpeeds[animIndex], 0.0f, this->frameCount,
sAnimationModes[animIndex], -4.0f);
}
void EnGuruguru_DoNothing(EnGuruguru* this, PlayState* play) {
}
void func_80BC6E10(EnGuruguru* this) {
EnGuruguru_ChangeAnimation(this, 0);
EnGuruguru_ChangeAnim(this, 0);
this->textIdIndex = 0;
this->unk270 = 0;
if (this->actor.params == 0) {
+12 -12
View File
@@ -15,18 +15,18 @@ void EnHeishi_Destroy(Actor* thisx, PlayState* play);
void EnHeishi_Update(Actor* thisx, PlayState* play);
void EnHeishi_Draw(Actor* thisx, PlayState* play);
void EnHeishi_ChangeAnimation(EnHeishi* this, s32 animIndex);
void EnHeishi_ChangeAnim(EnHeishi* this, s32 animIndex);
void EnHeishi_SetHeadRotation(EnHeishi* this);
void EnHeishi_SetupIdle(EnHeishi* this);
void EnHeishi_Idle(EnHeishi* this, PlayState* play);
typedef enum {
/* 0 */ HEISHI_ANIMATION_STAND_HAND_ON_HIP,
/* 1 */ HEISHI_ANIMATION_CHEER_WITH_SPEAR,
/* 2 */ HEISHI_ANIMATION_WAVE,
/* 3 */ HEISHI_ANIMATION_SIT_AND_REACH,
/* 4 */ HEISHI_ANIMATION_STAND_UP
} EnHeishiAnimationIndex;
/* 0 */ HEISHI_ANIM_STAND_HAND_ON_HIP,
/* 1 */ HEISHI_ANIM_CHEER_WITH_SPEAR,
/* 2 */ HEISHI_ANIM_WAVE,
/* 3 */ HEISHI_ANIM_SIT_AND_REACH,
/* 4 */ HEISHI_ANIM_STAND_UP
} EnHeishiAnimation;
const ActorInit En_Heishi_InitVars = {
ACTOR_EN_HEISHI,
@@ -99,11 +99,11 @@ void EnHeishi_Destroy(Actor* thisx, PlayState* play) {
Collider_DestroyCylinder(play, &this->colliderCylinder);
}
void EnHeishi_ChangeAnimation(EnHeishi* this, s32 animIndex) {
void EnHeishi_ChangeAnim(EnHeishi* this, s32 animIndex) {
static AnimationHeader* sAnimations[] = {
&gSoldierStandHandOnHip, &gSoldierCheerWithSpear, &gSoldierWave, &gSoldierSitAndReach, &gSoldierStandUp,
};
static u8 sAnimModes[] = {
static u8 sAnimationModes[] = {
ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_ONCE, ANIMMODE_LOOP,
ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_LOOP,
ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_LOOP,
@@ -112,7 +112,7 @@ void EnHeishi_ChangeAnimation(EnHeishi* this, s32 animIndex) {
this->animIndex = animIndex;
this->frameCount = Animation_GetLastFrame(sAnimations[this->animIndex]);
Animation_Change(&this->skelAnime, sAnimations[this->animIndex], 1.0f, 0.0f, this->frameCount,
sAnimModes[this->animIndex], -10.0f);
sAnimationModes[this->animIndex], -10.0f);
}
void EnHeishi_SetHeadRotation(EnHeishi* this) {
@@ -131,9 +131,9 @@ void EnHeishi_SetHeadRotation(EnHeishi* this) {
}
void EnHeishi_SetupIdle(EnHeishi* this) {
s8 animIndex = HEISHI_ANIMATION_STAND_HAND_ON_HIP;
s8 animIndex = HEISHI_ANIM_STAND_HAND_ON_HIP;
EnHeishi_ChangeAnimation(this, animIndex);
EnHeishi_ChangeAnim(this, animIndex);
this->unk278 = animIndex;
this->actionFunc = EnHeishi_Idle;
}
+21 -21
View File
@@ -101,7 +101,7 @@ static CollisionCheckInfoInit2 sColChkInfoInit2 = {
0, 0, 0, 0, 0x80,
};
static AnimationInfo sAnimations[] = {
static AnimationInfo sAnimationInfo[] = {
{ &object_harfgibud_Anim_00260C, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -4.0f },
{ &object_harfgibud_Anim_009D44, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -4.0f },
{ &object_harfgibud_Anim_00A164, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -4.0f },
@@ -148,7 +148,7 @@ void EnHg_Destroy(Actor* thisx, PlayState* play) {
}
void func_80BCF354(EnHg* this) {
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 0);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 0);
this->actionFunc = func_80BCF398;
}
@@ -166,7 +166,7 @@ void func_80BCF398(EnHg* this, PlayState* play) {
}
void func_80BCF468(EnHg* this) {
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 1);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 1);
this->actionFunc = func_80BCF4AC;
}
@@ -190,7 +190,7 @@ void func_80BCF4AC(EnHg* this, PlayState* play) {
}
void func_80BCF5F0(EnHg* this) {
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 0);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 0);
this->actionFunc = func_80BCF634;
}
@@ -203,7 +203,7 @@ void func_80BCF634(EnHg* this, PlayState* play) {
}
void func_80BCF68C(EnHg* this) {
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 2);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 2);
this->actionFunc = func_80BCF6D0;
}
@@ -277,30 +277,30 @@ void func_80BCF95C(EnHg* this, PlayState* play) {
this->cutscenes[3] = play->csCtx.actorActions[actionIndex]->action;
switch (play->csCtx.actorActions[actionIndex]->action) {
case 1:
this->currentAnimation = 0;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 0);
this->animIndex = 0;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 0);
break;
case 2:
this->cutscenes[2] = 0;
this->currentAnimation = 3;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 3);
this->animIndex = 3;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 3);
break;
case 3:
this->cutscenes[2] = 0;
this->currentAnimation = 5;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 5);
this->animIndex = 5;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 5);
break;
case 4:
this->cutscenes[2] = 0;
this->currentAnimation = 7;
this->animIndex = 7;
if ((this->unk218 == 1) || (this->unk218 == 3)) {
func_8019F128(NA_SE_EN_HALF_REDEAD_TRANS);
}
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 7);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 7);
break;
case 5:
this->currentAnimation = 1;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 1);
this->animIndex = 1;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 1);
break;
case 6:
gSaveContext.save.weekEventReg[75] |= 0x20;
@@ -309,19 +309,19 @@ void func_80BCF95C(EnHg* this, PlayState* play) {
}
} else {
if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
switch (this->currentAnimation) {
switch (this->animIndex) {
case 3:
this->currentAnimation = 4;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 4);
this->animIndex = 4;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 4);
break;
case 5:
this->currentAnimation = 6;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 6);
this->animIndex = 6;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 6);
break;
}
}
}
switch (this->currentAnimation) {
switch (this->animIndex) {
case 3:
case 4:
func_800B9010(&this->actor, NA_SE_EN_HALF_REDEAD_LOOP - SFX_FLAG);
+1 -1
View File
@@ -16,7 +16,7 @@ typedef struct EnHg {
/* 0x1D4 */ EnHgActionFunc actionFunc;
/* 0x1D8 */ MtxF unk1D8;
/* 0x218 */ s32 unk218;
/* 0x21C */ s32 currentAnimation;
/* 0x21C */ s32 animIndex;
/* 0x220 */ Vec3s jointTable[HARFGIBUD_GIBDO_LIMB_MAX];
/* 0x292 */ Vec3s morphTable[HARFGIBUD_GIBDO_LIMB_MAX];
/* 0x304 */ UNK_TYPE1 pad304[0xC];
+10 -10
View File
@@ -39,7 +39,7 @@ const ActorInit En_Hgo_InitVars = {
(ActorFunc)EnHgo_Draw,
};
static AnimationInfo sAnimations[] = {
static AnimationInfo sAnimationInfo[] = {
{ &object_harfgibud_Anim_00B644, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -4.0f },
{ &object_harfgibud_Anim_013684, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f },
{ &object_harfgibud_Anim_0152EC, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, 0.0f },
@@ -127,7 +127,7 @@ void func_80BD0434(EnHgo* this, PlayState* play) {
}
void func_80BD049C(EnHgo* this) {
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 0);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 0);
this->actionFunc = func_80BD04E0;
}
@@ -258,28 +258,28 @@ s32 func_80BD0898(EnHgo* this, PlayState* play) {
switch (play->csCtx.actorActions[actionIndex]->action) {
case 1:
this->unk_218 = 0;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 0);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 0);
break;
case 2:
this->actor.draw = EnHgo_Draw;
this->unk_218 = 1;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 1);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 1);
break;
case 3:
this->unk_218 = 2;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 2);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 2);
break;
case 4:
this->unk_218 = 3;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 3);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 3);
break;
case 5:
this->unk_218 = 4;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 4);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 4);
break;
case 6:
this->unk_218 = 5;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 5);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 5);
break;
}
} else if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
@@ -295,11 +295,11 @@ s32 func_80BD0898(EnHgo* this, PlayState* play) {
break;
case 2:
this->unk_218 = 3;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 3);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 3);
break;
case 5:
this->unk_218 = 6;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 6);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 6);
}
}
@@ -126,7 +126,7 @@ static DamageTable sDamageTable = {
/* Powder Keg */ DMG_ENTRY(1, 0xF),
};
static AnimationInfo sAnimations[] = {
static AnimationInfo sAnimationInfo[] = {
{ &object_skb_Anim_0064E0, 0.96f, 0.0f, 0.0f, ANIMMODE_LOOP, -4.0f },
{ &object_skb_Anim_003584, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -1.0f },
{ &object_skb_Anim_002190, 0.6f, 0.0f, 0.0f, ANIMMODE_ONCE_INTERP, 4.0f },
@@ -181,7 +181,7 @@ void func_80C1FE20(EnHintSkb* this, PlayState* play) {
}
void func_80C1FE30(EnHintSkb* this) {
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 0);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 0);
this->actor.speedXZ = 1.6f;
this->actionFunc = func_80C1FE80;
}
@@ -200,7 +200,7 @@ void func_80C1FE80(EnHintSkb* this, PlayState* play) {
void func_80C1FF30(EnHintSkb* this) {
this->collider.base.atFlags &= ~AT_BOUNCED;
this->actor.speedXZ = 0.0f;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 2);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 2);
this->actionFunc = func_80C1FF88;
}
@@ -274,12 +274,12 @@ void func_80C2016C(EnHintSkb* this, PlayState* play) {
void func_80C20274(EnHintSkb* this) {
if (this->skelAnime.animation == &object_skb_Anim_00697C) {
this->actor.world.rot.y = this->actor.yawTowardsPlayer;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 8);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 8);
this->actor.gravity = -1.0f;
this->actor.speedXZ = 1.0f;
} else {
this->actor.world.rot.y = this->actor.yawTowardsPlayer;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 3);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 3);
if (this->actor.bgCheckFlags & 1) {
this->actor.speedXZ = -4.0f;
}
@@ -316,7 +316,7 @@ void func_80C20334(EnHintSkb* this, PlayState* play) {
}
void func_80C20484(EnHintSkb* this) {
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 4);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 4);
this->unk_3E8 |= 4;
if (this->actor.bgCheckFlags & 1) {
this->actor.speedXZ = -6.0f;
@@ -348,7 +348,7 @@ void func_80C20590(EnHintSkb* this, PlayState* play) {
this->drawDmgEffAlpha = 0.0f;
if (this->actor.colChkInfo.health != 0) {
Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 8);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 3);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 3);
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_DAMAGE);
this->unk_3E8 |= 1;
func_80C20274(this);
@@ -375,7 +375,7 @@ void func_80C2069C(EnHintSkb* this, PlayState* play) {
this->drawDmgEffAlpha = 0.0f;
if (this->actor.colChkInfo.health != 0) {
Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 8);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 3);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 3);
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_DAMAGE);
this->unk_3E8 |= 1;
func_80C20274(this);
@@ -404,10 +404,10 @@ void func_80C2077C(EnHintSkb* this, PlayState* play) {
this->actor.speedXZ = 2.4f;
this->actor.gravity = -1.0f;
this->actor.velocity.y = 3.0f;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 8);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 8);
}
} else {
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 11);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 11);
Message_StartTextbox(play, 0x1148, &this->actor);
this->unk_3E6 = 0x1148;
}
@@ -466,7 +466,7 @@ void func_80C208D0(EnHintSkb* this, PlayState* play) {
Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
Message_StartTextbox(play, 0x1147, &this->actor);
this->unk_3E6 = 0x1147;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 0);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 0);
}
}
@@ -541,7 +541,7 @@ void func_80C20C24(EnHintSkb* this, PlayState* play) {
case 0x1147:
Message_StartTextbox(play, 0x1148, &this->actor);
this->unk_3E6 = 0x1148;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 11);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 11);
break;
case 0x1148:
@@ -590,7 +590,7 @@ void func_80C20D64(EnHintSkb* this, PlayState* play) {
this->actor.hintId = 255;
this->actor.textId = 0;
if (this->actionFunc == func_80C1FE80) {
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 12);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 12);
}
func_80C2075C(this);
}
@@ -700,7 +700,7 @@ void func_80C20E90(EnHintSkb* this, PlayState* play) {
this->drawDmgEffScale = 0.5f;
Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 8);
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_DAMAGE);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 3);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 3);
func_80C2066C(this);
break;
@@ -719,7 +719,7 @@ void func_80C20E90(EnHintSkb* this, PlayState* play) {
case 13:
Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 8);
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_DAMAGE);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 3);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 3);
func_80C20274(this);
break;
File diff suppressed because it is too large Load Diff
+2 -14
View File
@@ -53,7 +53,7 @@ typedef enum {
/* 3 */ ENHORSE_ACT_FOLLOW_PLAYER,
/* 4 */ ENHORSE_ACT_INGO_RACE,
/* 5 */ ENHORSE_ACT_MOUNTED_IDLE,
/* 6 */ ENHORSE_ACT_MOUNTED_IDLE_WHINNEYING,
/* 6 */ ENHORSE_ACT_MOUNTED_IDLE_WHINNYING,
/* 7 */ ENHORSE_ACT_MOUNTED_TURN,
/* 8 */ ENHORSE_ACT_MOUNTED_WALK,
/* 9 */ ENHORSE_ACT_MOUNTED_TROT,
@@ -84,18 +84,6 @@ typedef enum {
/* 5 */ PLAYER_DIR_SIDE_L
} EnHorsePlayerDir;
typedef enum {
/* 0 */ ENHORSE_ANIM_IDLE,
/* 1 */ ENHORSE_ANIM_WHINNEY,
/* 2 */ ENHORSE_ANIM_STOPPING,
/* 3 */ ENHORSE_ANIM_REARING,
/* 4 */ ENHORSE_ANIM_WALK,
/* 5 */ ENHORSE_ANIM_TROT,
/* 6 */ ENHORSE_ANIM_GALLOP,
/* 7 */ ENHORSE_ANIM_LOW_JUMP,
/* 8 */ ENHORSE_ANIM_HIGH_JUMP
} EnHorseAnimationIndex;
typedef enum {
/* 0 */ HORSE_TYPE_EPONA,
/* 1 */ HORSE_TYPE_HNI,
@@ -157,7 +145,7 @@ typedef struct EnHorse {
/* 0x200 */ s32 curRaceWaypoint;
/* 0x204 */ s32 boostSpeed;
/* 0x208 */ s32 playerControlled;
/* 0x20C */ s32 animationIdx;
/* 0x20C */ s32 animIndex;
/* 0x210 */ f32 curFrame;
/* 0x214 */ s32 soundTimer;
/* 0x218 */ Vec3f unk_218;
+2 -2
View File
@@ -143,7 +143,7 @@ static ColliderSphereInit sSphereInit = {
static CollisionCheckInfoInit2 sColChkInfoInit = { 0, 0, 0, 0, MASS_IMMOVABLE };
static AnimationInfoS sAnimations[] = {
static AnimationInfoS sAnimationInfo[] = {
{ &object_dai_Anim_0048B4, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
{ &object_dai_Anim_0048B4, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
{ &object_dai_Anim_005100, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
@@ -237,7 +237,7 @@ s32 func_80BF1284(EnIg* this, s32 arg1) {
if (phi_v1) {
this->unk_3FC = arg1;
ret = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, arg1);
ret = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, arg1);
this->unk_3D4 = this->skelAnime.playSpeed;
}
+22 -22
View File
@@ -118,7 +118,7 @@ static DamageTable sDamageTable = {
/* Powder Keg */ DMG_ENTRY(0, 0x0),
};
static AnimationInfoS sAnimations[] = {
static AnimationInfoS sAnimationInfo[] = {
{ &object_in_Anim_001D10, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
{ &object_in_Anim_001D10, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
{ &object_in_Anim_014F8C, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
@@ -146,19 +146,19 @@ static TrackOptionsSet sTrackOptions = {
{ 0x1770, 4, 1, 6 },
};
s32 func_808F30B0(SkelAnime* skelAnime, s16 animIndex) {
s32 EnIn_ChangeAnim(SkelAnime* skelAnime, s16 animIndex) {
s16 frameCount;
s32 ret = false;
if (animIndex >= 0 && animIndex < 18) {
ret = true;
frameCount = sAnimations[animIndex].frameCount;
frameCount = sAnimationInfo[animIndex].frameCount;
if (frameCount < 0) {
frameCount = Animation_GetLastFrame(sAnimations[animIndex].animation);
frameCount = Animation_GetLastFrame(sAnimationInfo[animIndex].animation);
}
Animation_Change(skelAnime, sAnimations[animIndex].animation, sAnimations[animIndex].playSpeed,
sAnimations[animIndex].startFrame, frameCount, sAnimations[animIndex].mode,
sAnimations[animIndex].morphFrames);
Animation_Change(skelAnime, sAnimationInfo[animIndex].animation, sAnimationInfo[animIndex].playSpeed,
sAnimationInfo[animIndex].startFrame, frameCount, sAnimationInfo[animIndex].mode,
sAnimationInfo[animIndex].morphFrames);
}
return ret;
}
@@ -274,7 +274,7 @@ void EnIn_DoNothing(EnIn* this, PlayState* play) {
void func_808F3618(EnIn* this, PlayState* play) {
if (ENIN_GET_PATH(&this->actor) != 0x3F) {
func_808F30B0(&this->skelAnime, 9);
EnIn_ChangeAnim(&this->skelAnime, ENIN_ANIM_9);
}
if (ENIN_GET_PATH(&this->actor) != 0x3F) {
this->actionFunc = func_808F3690;
@@ -871,8 +871,8 @@ s32 func_808F4414(PlayState* play, EnIn* this, s32 arg2) {
break;
case 0x3476:
Actor_ContinueText(play, &this->actor, 0x3477);
func_808F30B0(&this->skelAnime, 1);
func_808F30B0(&this->unk4A4->skelAnime, 7);
EnIn_ChangeAnim(&this->skelAnime, ENIN_ANIM_1);
EnIn_ChangeAnim(&this->unk4A4->skelAnime, ENIN_ANIM_7);
ret = false;
break;
case 0x3477:
@@ -881,8 +881,8 @@ s32 func_808F4414(PlayState* play, EnIn* this, s32 arg2) {
ret = false;
break;
case 0x347A:
func_808F30B0(&this->skelAnime, 1);
func_808F30B0(&this->unk4A4->skelAnime, 7);
EnIn_ChangeAnim(&this->skelAnime, ENIN_ANIM_1);
EnIn_ChangeAnim(&this->unk4A4->skelAnime, ENIN_ANIM_7);
if (INV_CONTENT(ITEM_MASK_GARO) == ITEM_MASK_GARO) {
Actor_ContinueText(play, &this->actor, 0x347E);
ret = false;
@@ -1072,8 +1072,8 @@ s32 func_808F4414(PlayState* play, EnIn* this, s32 arg2) {
gSaveContext.save.weekEventReg[57] |= 1;
break;
case 0x349D:
func_808F30B0(&this->skelAnime, 1);
func_808F30B0(&this->unk4A4->skelAnime, 7);
EnIn_ChangeAnim(&this->skelAnime, ENIN_ANIM_1);
EnIn_ChangeAnim(&this->unk4A4->skelAnime, ENIN_ANIM_7);
if (INV_CONTENT(ITEM_MASK_GARO) == ITEM_MASK_GARO) {
Actor_ContinueText(play, &this->actor, 0x34A1);
ret = false;
@@ -1118,8 +1118,8 @@ s32 func_808F4414(PlayState* play, EnIn* this, s32 arg2) {
break;
case 0x3499:
Actor_ContinueText(play, &this->actor, 0x349A);
func_808F30B0(&this->skelAnime, 1);
func_808F30B0(&this->unk4A4->skelAnime, 7);
EnIn_ChangeAnim(&this->skelAnime, ENIN_ANIM_1);
EnIn_ChangeAnim(&this->unk4A4->skelAnime, ENIN_ANIM_7);
ret = false;
break;
case 0x349A:
@@ -1358,7 +1358,7 @@ void EnIn_Init(Actor* thisx, PlayState* play) {
Actor_ProcessInitChain(&this->actor, sInitChain);
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f);
SkelAnime_InitFlex(play, &this->skelAnime, &object_in_Skel_014EA8, NULL, this->jointTable, this->morphTable, 20);
func_808F30B0(&this->skelAnime, 0);
EnIn_ChangeAnim(&this->skelAnime, ENIN_ANIM_0);
Collider_InitCylinder(play, &this->colliderCylinder);
Collider_SetCylinder(play, &this->colliderCylinder, &this->actor, &sCylinderInit);
CollisionCheck_SetInfo2(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit2);
@@ -1395,9 +1395,9 @@ void EnIn_Init(Actor* thisx, PlayState* play) {
this->unk23C = 0;
D_801BDAA0 = 0;
if (GET_RACE_FLAGS == RACE_FLAG_2) {
func_808F30B0(&this->skelAnime, 6);
EnIn_ChangeAnim(&this->skelAnime, ENIN_ANIM_6);
} else {
func_808F30B0(&this->skelAnime, 4);
EnIn_ChangeAnim(&this->skelAnime, ENIN_ANIM_4);
}
if (GET_RACE_FLAGS == RACE_FLAG_2) {
this->skelAnime.curFrame = ((Rand_ZeroOne() * 0.6f) + 0.2f) * this->skelAnime.endFrame;
@@ -1414,7 +1414,7 @@ void EnIn_Init(Actor* thisx, PlayState* play) {
this->unk4AC |= 2;
if (type == ENIN_BLUE_SHIRT) {
if (func_808F33B8()) {
func_808F30B0(&this->skelAnime, 0);
EnIn_ChangeAnim(&this->skelAnime, ENIN_ANIM_0);
this->actionFunc = func_808F5A94;
} else {
if (gSaveContext.save.weekEventReg[52] & 1) {
@@ -1423,7 +1423,7 @@ void EnIn_Init(Actor* thisx, PlayState* play) {
this->actor.shape.rot.y, this->actor.shape.rot.z, 0xF);
Actor_MarkForDeath(&this->actor);
} else {
func_808F30B0(&this->skelAnime, 0);
EnIn_ChangeAnim(&this->skelAnime, ENIN_ANIM_0);
this->actionFunc = func_808F5A94;
}
}
@@ -1431,7 +1431,7 @@ void EnIn_Init(Actor* thisx, PlayState* play) {
if (gSaveContext.save.weekEventReg[52] & 1) {
Actor_MarkForDeath(&this->actor);
} else {
func_808F30B0(&this->skelAnime, 7);
EnIn_ChangeAnim(&this->skelAnime, ENIN_ANIM_7);
this->actionFunc = func_808F5B58;
}
}
+21
View File
@@ -15,6 +15,27 @@ typedef enum {
/* 4 */ ENIN_BLUE_SHIRT
} EnInType;
typedef enum {
/* 0 */ ENIN_ANIM_0,
/* 1 */ ENIN_ANIM_1,
/* 2 */ ENIN_ANIM_2,
/* 3 */ ENIN_ANIM_3,
/* 4 */ ENIN_ANIM_4,
/* 5 */ ENIN_ANIM_5,
/* 6 */ ENIN_ANIM_6,
/* 7 */ ENIN_ANIM_7,
/* 8 */ ENIN_ANIM_8,
/* 9 */ ENIN_ANIM_9,
/* 10 */ ENIN_ANIM_10,
/* 11 */ ENIN_ANIM_11,
/* 12 */ ENIN_ANIM_12,
/* 13 */ ENIN_ANIM_13,
/* 14 */ ENIN_ANIM_14,
/* 15 */ ENIN_ANIM_15,
/* 16 */ ENIN_ANIM_16,
/* 17 */ ENIN_ANIM_17,
} EnInAnimation;
#define ENIN_GET_TYPE(thisx) ((thisx)->params & 0x1FF)
#define ENIN_GET_PATH(thisx) (((thisx)->params & 0x7E00) >> 9) // Only used with ENIN_UNK_TYPE
+2 -2
View File
@@ -89,7 +89,7 @@ static ColliderCylinderInit sCylinderInit = {
static CollisionCheckInfoInit2 sColChkInfoInit = { 0, 0, 0, 0, MASS_IMMOVABLE };
static AnimationInfoS sAnimations[] = {
static AnimationInfoS sAnimationInfo[] = {
{ &object_boj_Anim_002734, 1.0f, 0, -1, 0, 0 }, { &object_boj_Anim_0033B0, 1.0f, 0, -1, 0, 0 },
{ &object_boj_Anim_002734, 1.0f, 0, -1, 0, -4 }, { &object_boj_Anim_0033B0, 1.0f, 0, -1, 0, -4 },
{ &object_boj_Anim_004078, 1.0f, 0, -1, 0, 0 }, { &object_boj_Anim_005CE4, 1.0f, 0, -1, 0, 0 },
@@ -105,7 +105,7 @@ s32 func_80BC192C(EnJa* this, s32 arg1) {
if (arg1 != this->unk_36C) {
this->unk_36C = arg1;
ret = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, arg1);
ret = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, arg1);
this->unk_344 = this->skelAnime.playSpeed;
}
+85 -85
View File
@@ -35,27 +35,27 @@ s32 EnJg_GetStartingConversationTextId(EnJg* this, PlayState* play);
void EnJg_CheckIfTalkingToPlayerAndHandleFreezeTimer(EnJg* this, PlayState* play);
typedef enum {
/* 0 */ EN_JG_ANIMATION_IDLE,
/* 1 */ EN_JG_ANIMATION_WALK,
/* 2 */ EN_JG_ANIMATION_WAVING,
/* 3 */ EN_JG_ANIMATION_SHAKING_HEAD,
/* 4 */ EN_JG_ANIMATION_SURPRISE_START,
/* 5 */ EN_JG_ANIMATION_SURPRISE_LOOP,
/* 6 */ EN_JG_ANIMATION_ANGRY,
/* 7 */ EN_JG_ANIMATION_FROZEN_START,
/* 8 */ EN_JG_ANIMATION_FROZEN_LOOP,
/* 9 */ EN_JG_ANIMATION_WALK_2,
/* 10 */ EN_JG_ANIMATION_TAKING_OUT_DRUM,
/* 11 */ EN_JG_ANIMATION_DRUM_IDLE,
/* 12 */ EN_JG_ANIMATION_PLAYING_DRUM,
/* 13 */ EN_JG_ANIMATION_THINKING,
/* 14 */ EN_JG_ANIMATION_REMEMBERING,
/* 15 */ EN_JG_ANIMATION_STRONG_REMEMBERING,
/* 16 */ EN_JG_ANIMATION_DEPRESSED,
/* 17 */ EN_JG_ANIMATION_CUTSCENE_IDLE,
/* 18 */ EN_JG_ANIMATION_CRADLE,
/* 19 */ EN_JG_ANIMATION_MAX,
} EnJgAnimationIndex;
/* 0 */ EN_JG_ANIM_IDLE,
/* 1 */ EN_JG_ANIM_WALK,
/* 2 */ EN_JG_ANIM_WAVING,
/* 3 */ EN_JG_ANIM_SHAKING_HEAD,
/* 4 */ EN_JG_ANIM_SURPRISE_START,
/* 5 */ EN_JG_ANIM_SURPRISE_LOOP,
/* 6 */ EN_JG_ANIM_ANGRY,
/* 7 */ EN_JG_ANIM_FROZEN_START,
/* 8 */ EN_JG_ANIM_FROZEN_LOOP,
/* 9 */ EN_JG_ANIM_WALK_2,
/* 10 */ EN_JG_ANIM_TAKING_OUT_DRUM,
/* 11 */ EN_JG_ANIM_DRUM_IDLE,
/* 12 */ EN_JG_ANIM_PLAYING_DRUM,
/* 13 */ EN_JG_ANIM_THINKING,
/* 14 */ EN_JG_ANIM_REMEMBERING,
/* 15 */ EN_JG_ANIM_STRONG_REMEMBERING,
/* 16 */ EN_JG_ANIM_DEPRESSED,
/* 17 */ EN_JG_ANIM_CUTSCENE_IDLE,
/* 18 */ EN_JG_ANIM_CRADLE,
/* 19 */ EN_JG_ANIM_MAX,
} EnJgAnimation;
typedef enum {
/* 0x0 */ EN_JG_ACTION_FIRST_THAW,
@@ -133,7 +133,7 @@ static DamageTable sDamageTable = {
/* Powder Keg */ DMG_ENTRY(0, 0x0),
};
static AnimationInfoS sAnimations[] = {
static AnimationInfoS sAnimationInfo[] = {
{ &gGoronElderIdleAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -10 },
{ &gGoronElderWalkAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -10 },
{ &gGoronElderWavingAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -10 },
@@ -296,20 +296,20 @@ void EnJg_SetupGoronShrineCheer(EnJg* this) {
void EnJg_SetupTalk(EnJg* this, PlayState* play) {
switch (this->textId) {
case 0xDAC: // What was I doing?
this->animationIndex = EN_JG_ANIMATION_SHAKING_HEAD;
SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIndex);
this->animIndex = EN_JG_ANIM_SHAKING_HEAD;
SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->animIndex);
this->actionFunc = EnJg_Talk;
break;
case 0xDAD: // I must hurry!
this->animationIndex = EN_JG_ANIMATION_SURPRISE_START;
SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIndex);
this->animIndex = EN_JG_ANIM_SURPRISE_START;
SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->animIndex);
this->actionFunc = EnJg_AlternateTalkOrWalkInPlace;
break;
case 0xDB7: // You're Darmani!
this->animationIndex = EN_JG_ANIMATION_SURPRISE_START;
SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIndex);
this->animIndex = EN_JG_ANIM_SURPRISE_START;
SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->animIndex);
this->actionFunc = EnJg_Talk;
break;
@@ -319,8 +319,8 @@ void EnJg_SetupTalk(EnJg* this, PlayState* play) {
case 0xDBA: // I've been made a fool of!
case 0xDBD: // "...What?"
case 0xDC4: // It's so cold I can't play
this->animationIndex = EN_JG_ANIMATION_IDLE;
SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIndex);
this->animIndex = EN_JG_ANIM_IDLE;
SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->animIndex);
this->actionFunc = EnJg_Talk;
break;
@@ -328,15 +328,15 @@ void EnJg_SetupTalk(EnJg* this, PlayState* play) {
case 0xDBB: // If I can see past the illusion, you'll vanish
case 0xDBC: // Following me won't do you any good
case 0xDC6: // I am counting on you
this->animationIndex = EN_JG_ANIMATION_ANGRY;
SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIndex);
this->animIndex = EN_JG_ANIM_ANGRY;
SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->animIndex);
this->actionFunc = EnJg_Talk;
break;
case 0xDB4: // This is our problem (first)
case 0xDB5: // This is our problem (repeat)
this->animationIndex = EN_JG_ANIMATION_WAVING;
SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIndex);
this->animIndex = EN_JG_ANIM_WAVING;
SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->animIndex);
this->actionFunc = EnJg_Talk;
break;
}
@@ -417,23 +417,23 @@ void EnJg_GoronShrineCheer(EnJg* this, PlayState* play) {
void EnJg_AlternateTalkOrWalkInPlace(EnJg* this, PlayState* play) {
u8 talkState = Message_GetState(&play->msgCtx);
s16 currentFrame = this->skelAnime.curFrame;
s16 lastFrame = Animation_GetLastFrame(sAnimations[this->animationIndex].animation);
s16 lastFrame = Animation_GetLastFrame(sAnimationInfo[this->animIndex].animation);
if (this->animationIndex == EN_JG_ANIMATION_SURPRISE_START) {
if (this->animIndex == EN_JG_ANIM_SURPRISE_START) {
if (currentFrame == lastFrame) {
this->animationIndex = EN_JG_ANIMATION_SURPRISE_LOOP;
SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIndex);
this->animIndex = EN_JG_ANIM_SURPRISE_LOOP;
SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->animIndex);
}
} else if (this->animationIndex == EN_JG_ANIMATION_SURPRISE_LOOP) {
} else if (this->animIndex == EN_JG_ANIM_SURPRISE_LOOP) {
if ((talkState == TEXT_STATE_5) && Message_ShouldAdvance(play)) {
play->msgCtx.msgMode = 0x43;
play->msgCtx.stateTimer = 4;
this->flags &= ~FLAG_LOOKING_AT_PLAYER;
this->animationIndex = EN_JG_ANIMATION_WALK;
SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIndex);
this->animIndex = EN_JG_ANIM_WALK;
SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->animIndex);
this->actionFunc = EnJg_Walk;
}
} else if (this->animationIndex == EN_JG_ANIMATION_WALK) {
} else if (this->animIndex == EN_JG_ANIM_WALK) {
Math_ApproachF(&this->actor.speedXZ, 0.0f, 0.2f, 1.0f);
EnJg_CheckIfTalkingToPlayerAndHandleFreezeTimer(this, play);
}
@@ -455,7 +455,7 @@ void EnJg_Walk(EnJg* this, PlayState* play) {
if (EnJg_ReachedPoint(this, this->path, this->currentPoint)) {
if (this->currentPoint >= (this->path->count - 1)) {
// Force the elder to walk in place
this->animationIndex = EN_JG_ANIMATION_WALK;
this->animIndex = EN_JG_ANIM_WALK;
this->actionFunc = EnJg_AlternateTalkOrWalkInPlace;
} else {
this->currentPoint++;
@@ -472,12 +472,12 @@ void EnJg_Walk(EnJg* this, PlayState* play) {
void EnJg_Talk(EnJg* this, PlayState* play) {
u8 talkState = Message_GetState(&play->msgCtx);
s16 currentFrame = this->skelAnime.curFrame;
s16 lastFrame = Animation_GetLastFrame(sAnimations[this->animationIndex].animation);
s16 lastFrame = Animation_GetLastFrame(sAnimationInfo[this->animIndex].animation);
u16 temp;
if ((this->animationIndex == EN_JG_ANIMATION_SURPRISE_START) && (currentFrame == lastFrame)) {
this->animationIndex = EN_JG_ANIMATION_SURPRISE_LOOP;
SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIndex);
if ((this->animIndex == EN_JG_ANIM_SURPRISE_START) && (currentFrame == lastFrame)) {
this->animIndex = EN_JG_ANIM_SURPRISE_LOOP;
SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->animIndex);
}
if ((talkState == TEXT_STATE_5) && Message_ShouldAdvance(play)) {
@@ -529,10 +529,10 @@ void EnJg_Talk(EnJg* this, PlayState* play) {
}
void EnJg_SetupWalk(EnJg* this, PlayState* play) {
if (this->animationIndex != EN_JG_ANIMATION_WALK) {
this->animationIndex = EN_JG_ANIMATION_WALK;
if (this->animIndex != EN_JG_ANIM_WALK) {
this->animIndex = EN_JG_ANIM_WALK;
this->freezeTimer = 1000;
SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIndex);
SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->animIndex);
this->actionFunc = EnJg_Walk;
} else {
this->freezeTimer = 1000;
@@ -542,7 +542,7 @@ void EnJg_SetupWalk(EnJg* this, PlayState* play) {
void EnJg_Freeze(EnJg* this, PlayState* play) {
s16 currentFrame = this->skelAnime.curFrame;
s16 lastFrame = Animation_GetLastFrame(sAnimations[this->animationIndex].animation);
s16 lastFrame = Animation_GetLastFrame(sAnimationInfo[this->animIndex].animation);
if (this->action == EN_JG_ACTION_SPAWNING) {
this->action = EN_JG_ACTION_FROZEN_OR_NON_FIRST_THAW;
@@ -551,18 +551,18 @@ void EnJg_Freeze(EnJg* this, PlayState* play) {
this->icePoly = Actor_Spawn(&play->actorCtx, play, ACTOR_OBJ_ICE_POLY, this->actor.world.pos.x,
this->actor.world.pos.y, this->actor.world.pos.z, this->actor.world.rot.x,
this->actor.world.rot.y, this->actor.world.rot.z, 0xFF50);
this->animationIndex = EN_JG_ANIMATION_FROZEN_LOOP;
SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIndex);
this->animIndex = EN_JG_ANIM_FROZEN_LOOP;
SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->animIndex);
this->actionFunc = EnJg_FrozenIdle;
} else if (this->animationIndex == EN_JG_ANIMATION_FROZEN_START) {
} else if (this->animIndex == EN_JG_ANIM_FROZEN_START) {
this->action = EN_JG_ACTION_FROZEN_OR_NON_FIRST_THAW;
if (currentFrame == lastFrame) {
this->freezeTimer = 1000;
this->icePoly = Actor_Spawn(&play->actorCtx, play, ACTOR_OBJ_ICE_POLY, this->actor.world.pos.x,
this->actor.world.pos.y, this->actor.world.pos.z, this->actor.world.rot.x,
this->actor.world.rot.y, this->actor.world.rot.z, 0xFF50);
this->animationIndex = EN_JG_ANIMATION_FROZEN_LOOP;
SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIndex);
this->animIndex = EN_JG_ANIM_FROZEN_LOOP;
SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->animIndex);
this->actionFunc = EnJg_FrozenIdle;
}
}
@@ -571,20 +571,20 @@ void EnJg_Freeze(EnJg* this, PlayState* play) {
void EnJg_FrozenIdle(EnJg* this, PlayState* play) {
if (this->icePoly->update == NULL) {
this->icePoly = NULL;
if (this->animationIndex == EN_JG_ANIMATION_FROZEN_LOOP) {
if (this->animIndex == EN_JG_ANIM_FROZEN_LOOP) {
if (Animation_OnFrame(&this->skelAnime, 0.0f)) {
this->animationIndex = EN_JG_ANIMATION_IDLE;
this->animIndex = EN_JG_ANIM_IDLE;
// If you've never talked to the elder before, he stands
// around idle until you've talked to him at least once.
// Otherwise, he immediately begins walking after being
// thawed out.
if (this->textId == 0xDAC) {
SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIndex);
SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->animIndex);
this->actionFunc = EnJg_Idle;
} else {
this->freezeTimer = 1000;
SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIndex);
SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->animIndex);
this->actionFunc = EnJg_Walk;
}
}
@@ -630,7 +630,7 @@ void EnJg_LullabyIntroCutsceneAction(EnJg* this, PlayState* play) {
switch (play->csCtx.actorActions[actionIndex]->action) {
case 1:
this->cutsceneAnimationIndex = EN_JG_ANIMATION_CUTSCENE_IDLE;
this->cutsceneAnimIndex = EN_JG_ANIM_CUTSCENE_IDLE;
if (this->drum != NULL) {
Actor_MarkForDeath(this->drum);
this->drum = NULL;
@@ -638,50 +638,50 @@ void EnJg_LullabyIntroCutsceneAction(EnJg* this, PlayState* play) {
break;
case 2:
this->cutsceneAnimationIndex = EN_JG_ANIMATION_TAKING_OUT_DRUM;
this->cutsceneAnimIndex = EN_JG_ANIM_TAKING_OUT_DRUM;
break;
case 3:
this->cutsceneAnimationIndex = EN_JG_ANIMATION_DRUM_IDLE;
this->cutsceneAnimIndex = EN_JG_ANIM_DRUM_IDLE;
break;
case 4:
this->cutsceneAnimationIndex = EN_JG_ANIMATION_PLAYING_DRUM;
this->cutsceneAnimIndex = EN_JG_ANIM_PLAYING_DRUM;
break;
case 5:
this->cutsceneAnimationIndex = EN_JG_ANIMATION_THINKING;
this->cutsceneAnimIndex = EN_JG_ANIM_THINKING;
break;
case 6:
this->cutsceneAnimationIndex = EN_JG_ANIMATION_REMEMBERING;
this->cutsceneAnimIndex = EN_JG_ANIM_REMEMBERING;
break;
case 7:
this->cutsceneAnimationIndex = EN_JG_ANIMATION_STRONG_REMEMBERING;
this->cutsceneAnimIndex = EN_JG_ANIM_STRONG_REMEMBERING;
break;
case 8:
this->cutsceneAnimationIndex = EN_JG_ANIMATION_DEPRESSED;
this->cutsceneAnimIndex = EN_JG_ANIM_DEPRESSED;
break;
case 9:
this->cutsceneAnimationIndex = EN_JG_ANIMATION_CRADLE;
this->cutsceneAnimIndex = EN_JG_ANIM_CRADLE;
break;
default:
this->cutsceneAnimationIndex = EN_JG_ANIMATION_IDLE;
this->cutsceneAnimIndex = EN_JG_ANIM_IDLE;
break;
}
SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->cutsceneAnimationIndex);
SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->cutsceneAnimIndex);
}
if ((!(this->flags & FLAG_DRUM_SPAWNED)) &&
(((this->cutsceneAnimationIndex == EN_JG_ANIMATION_TAKING_OUT_DRUM) &&
(Animation_OnFrame(&this->skelAnime, 14.0f)) && (this->action != EN_JG_ACTION_LULLABY_INTRO_CS)) ||
(((this->cutsceneAnimationIndex == EN_JG_ANIMATION_DRUM_IDLE) ||
(this->cutsceneAnimationIndex == EN_JG_ANIMATION_PLAYING_DRUM)) &&
(((this->cutsceneAnimIndex == EN_JG_ANIM_TAKING_OUT_DRUM) && (Animation_OnFrame(&this->skelAnime, 14.0f)) &&
(this->action != EN_JG_ACTION_LULLABY_INTRO_CS)) ||
(((this->cutsceneAnimIndex == EN_JG_ANIM_DRUM_IDLE) ||
(this->cutsceneAnimIndex == EN_JG_ANIM_PLAYING_DRUM)) &&
(this->action == EN_JG_ACTION_LULLABY_INTRO_CS)))) {
this->flags |= FLAG_DRUM_SPAWNED;
this->drum = Actor_SpawnAsChildAndCutscene(
@@ -690,7 +690,7 @@ void EnJg_LullabyIntroCutsceneAction(EnJg* this, PlayState* play) {
this->actor.params, this->actor.cutscene, this->actor.unk20, NULL);
}
if (this->cutsceneAnimationIndex == EN_JG_ANIMATION_TAKING_OUT_DRUM) {
if (this->cutsceneAnimIndex == EN_JG_ANIM_TAKING_OUT_DRUM) {
if (Animation_OnFrame(&this->skelAnime, 23.0f)) {
Audio_PlaySfxAtPos(&sSfxPos, NA_SE_EV_WOOD_BOUND_S);
} else if (Animation_OnFrame(&this->skelAnime, 38.0f)) {
@@ -899,7 +899,7 @@ void EnJg_SpawnBreath(EnJg* this, PlayState* play) {
*/
void EnJg_CheckIfTalkingToPlayerAndHandleFreezeTimer(EnJg* this, PlayState* play) {
s16 currentFrame = this->skelAnime.curFrame;
s16 lastFrame = Animation_GetLastFrame(sAnimations[this->animationIndex].animation);
s16 lastFrame = Animation_GetLastFrame(sAnimationInfo[this->animIndex].animation);
if (Actor_ProcessTalkRequest(&this->actor, &play->state)) {
this->flags |= FLAG_LOOKING_AT_PLAYER;
@@ -925,8 +925,8 @@ void EnJg_CheckIfTalkingToPlayerAndHandleFreezeTimer(EnJg* this, PlayState* play
this->freezeTimer--;
if ((this->freezeTimer <= 0) && (currentFrame == lastFrame)) {
this->animationIndex = EN_JG_ANIMATION_FROZEN_START;
SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIndex);
this->animIndex = EN_JG_ANIM_FROZEN_START;
SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->animIndex);
Audio_PlaySfxAtPos(&sSfxPos, NA_SE_EV_FREEZE_S);
this->actionFunc = EnJg_Freeze;
}
@@ -951,25 +951,25 @@ void EnJg_Init(Actor* thisx, PlayState* play) {
if ((play->sceneNum == SCENE_SPOT00) && (gSaveContext.sceneSetupIndex == 7) &&
(play->csCtx.currentCsIndex == 0)) {
// This is the elder that appears in the cutscene for learning the full Goron Lullaby.
this->animationIndex = EN_JG_ANIMATION_IDLE;
this->animIndex = EN_JG_ANIM_IDLE;
this->action = EN_JG_ACTION_LULLABY_INTRO_CS;
SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIndex);
SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->animIndex);
this->actionFunc = EnJg_LullabyIntroCutsceneAction;
} else {
// This is the elder that appears in Mountain Village or the Path to Goron Village in winter.
this->path = SubS_GetPathByIndex(play, EN_JG_GET_PATH(thisx), 0x3F);
this->animationIndex = EN_JG_ANIMATION_SURPRISE_START;
this->animIndex = EN_JG_ANIM_SURPRISE_START;
this->action = EN_JG_ACTION_SPAWNING;
this->freezeTimer = 1000;
this->textId = 0xDAC; // What was I doing?
SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIndex);
SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->animIndex);
this->actionFunc = EnJg_Freeze;
}
} else {
// This is the elder that appears in Goron Shrine in spring.
this->animationIndex = EN_JG_ANIMATION_IDLE;
this->animIndex = EN_JG_ANIM_IDLE;
this->cutscene = this->actor.cutscene;
SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIndex);
SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->animIndex);
this->actionFunc = EnJg_GoronShrineIdle;
}
}
+2 -2
View File
@@ -26,14 +26,14 @@ typedef struct EnJg {
/* 0x1F8 */ Vec3s jointTable[GORON_ELDER_LIMB_MAX];
/* 0x2CA */ Vec3s morphTable[GORON_ELDER_LIMB_MAX];
/* 0x39C */ s16 rootRotationWhenTalking;
/* 0x39E */ s16 animationIndex;
/* 0x39E */ s16 animIndex;
/* 0x3A0 */ s16 action;
/* 0x3A2 */ s16 freezeTimer;
/* 0x3A4 */ Vec3f breathPos;
/* 0x3B0 */ Vec3f breathVelocity;
/* 0x3BC */ Vec3f breathAccel;
/* 0x3C8 */ s16 cutscene;
/* 0x3CA */ u8 cutsceneAnimationIndex;
/* 0x3CA */ u8 cutsceneAnimIndex;
/* 0x3CB */ u8 csAction;
/* 0x3CC */ u16 flags;
/* 0x3CE */ u16 textId;
@@ -48,7 +48,7 @@ const ActorInit En_Jgame_Tsn_InitVars = {
(ActorFunc)EnJgameTsn_Draw,
};
static AnimationInfo sAnimations[] = {
static AnimationInfo sAnimationInfo[] = {
{ &object_tsn_Anim_0092FC, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -6.0f },
{ &object_tsn_Anim_000964, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -6.0f },
{ &object_tsn_Anim_001198, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -6.0f },
@@ -145,7 +145,7 @@ void EnJgameTsn_Destroy(Actor* thisx, PlayState* play) {
}
void func_80C13B74(EnJgameTsn* this) {
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 0);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 0);
this->actionFunc = func_80C13BB8;
}
@@ -156,15 +156,15 @@ void func_80C13BB8(EnJgameTsn* this, PlayState* play) {
if (this->actor.flags & ACTOR_FLAG_10000) {
this->actor.flags &= ~ACTOR_FLAG_10000;
if (gSaveContext.unk_3DE0[4] > 0) {
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 1);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 1);
Message_StartTextbox(play, 0x10A2, &this->actor);
this->unk_300 = 0x10A2;
} else if (gSaveContext.minigameScore < 20) {
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 1);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 1);
Message_StartTextbox(play, 0x10A2, &this->actor);
this->unk_300 = 0x10A2;
} else {
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 2);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 2);
Message_StartTextbox(play, 0x10A3, &this->actor);
this->unk_300 = 0x10A3;
}
@@ -174,11 +174,11 @@ void func_80C13BB8(EnJgameTsn* this, PlayState* play) {
this->unk_300 = 0x1094;
} else if (this->unk_2F8 == 0) {
this->unk_2F8 = 1;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 1);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 1);
Message_StartTextbox(play, 0x1095, &this->actor);
this->unk_300 = 0x1095;
} else {
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 1);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 1);
Message_StartTextbox(play, 0x1096, &this->actor);
this->unk_300 = 0x1096;
}
@@ -211,11 +211,11 @@ void func_80C13E90(EnJgameTsn* this, PlayState* play) {
this->actor.flags &= ~ACTOR_FLAG_10000;
if (((gSaveContext.save.time > CLOCK_TIME(4, 0)) && (gSaveContext.save.time < CLOCK_TIME(7, 0))) ||
((gSaveContext.save.time > CLOCK_TIME(16, 0)) && (gSaveContext.save.time < CLOCK_TIME(19, 0)))) {
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 2);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 2);
Message_StartTextbox(play, 0x1094, &this->actor);
this->unk_300 = 0x1094;
} else {
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 1);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 1);
Message_StartTextbox(play, 0x1098, &this->actor);
this->unk_300 = 0x1098;
}
@@ -335,7 +335,7 @@ void func_80C14230(EnJgameTsn* this, PlayState* play) {
this->unk_2FC++;
if ((player->actor.bgCheckFlags & 2) && func_80C149B0(play, &this->unk_200)) {
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 2);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 2);
Message_StartTextbox(play, 0x109F, &this->actor);
this->unk_300 = 0x109F;
player->stateFlags1 |= 0x20;
@@ -343,7 +343,7 @@ void func_80C14230(EnJgameTsn* this, PlayState* play) {
func_801A2C20();
func_80C14030(this);
} else if ((player->actor.bgCheckFlags & 0x40) || (player->actor.bgCheckFlags & 0x20)) {
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 2);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 2);
Message_StartTextbox(play, 0x10A0, &this->actor);
this->unk_300 = 0x10A0;
player->stateFlags1 |= 0x20;
@@ -412,12 +412,12 @@ void func_80C14684(EnJgameTsn* this, PlayState* play) {
this->unk_300 = 0x109E;
Rupees_ChangeBy(-20);
} else {
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 2);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 2);
Message_StartTextbox(play, 0x109D, &this->actor);
this->unk_300 = 0x109D;
}
} else {
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 2);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 2);
Message_StartTextbox(play, 0x109C, &this->actor);
this->unk_300 = 0x109C;
}
@@ -460,7 +460,7 @@ void func_80C147B4(EnJgameTsn* this, PlayState* play) {
break;
case 0x109A:
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 0);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 0);
Message_StartTextbox(play, 0x109B, &this->actor);
this->unk_300 = 0x109B;
break;
+38 -38
View File
@@ -122,15 +122,15 @@ typedef enum {
/* 0x6 */ ENKAKASI_ANIM_WAVE, // "wave" short sideways shake, stops early, partial? unused?
/* 0x7 */ ENKAKASI_ANIM_SLOWROLL, // partial bounch, ends looking left, OFFER anim takes over
/* 0x8 */ ENKAKASI_ANIM_IDLE, // slow stretching wiggle, ends in regular position
} EnKakasi_Animations;
} EnKakasiAnimation;
static AnimationHeader* kakasiAnimations[] = {
static AnimationHeader* sAnimations[] = {
&object_ka_Anim_007444, &object_ka_Anim_00686C, &object_ka_Anim_0081A4,
&object_ka_Anim_007B90, &object_ka_Anim_0071EC, &object_ka_Anim_007444,
&object_ka_Anim_00686C, &object_ka_Anim_0081A4, &object_ka_Anim_000214,
};
static u8 sAnimModes[] = {
static u8 sAnimationModes[] = {
ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_ONCE, ANIMMODE_ONCE,
ANIMMODE_ONCE, ANIMMODE_ONCE, ANIMMODE_ONCE, ANIMMODE_ONCE,
};
@@ -195,12 +195,12 @@ void EnKakasi_Init(Actor* thisx, PlayState* play) {
}
}
void EnKakasi_SetAnimation(EnKakasi* this, s32 index) {
this->animIndex = index;
this->animeFrameCount = Animation_GetLastFrame(&kakasiAnimations[this->animIndex]->common);
void EnKakasi_ChangeAnim(EnKakasi* this, s32 animIndex) {
this->animIndex = animIndex;
this->animeFrameCount = Animation_GetLastFrame(&sAnimations[this->animIndex]->common);
// 1: regular playback speed, 0: starting frame
Animation_Change(&this->skelanime, kakasiAnimations[this->animIndex], 1.0f, 0.0f, this->animeFrameCount,
sAnimModes[this->animIndex], -4.0f);
Animation_Change(&this->skelanime, sAnimations[this->animIndex], 1.0f, 0.0f, this->animeFrameCount,
sAnimationModes[this->animIndex], -4.0f);
}
s32 EnKakasi_ValidatePictograph(PlayState* play, Actor* thisx) {
@@ -280,7 +280,7 @@ void func_8096FBB8(EnKakasi* this, PlayState* play) {
this->unk190++;
}
if (this->unk190 != 0 && this->animIndex != ENKAKASI_ANIM_SIDEWAYS_SHAKING) {
EnKakasi_SetAnimation(this, ENKAKASI_ANIM_SIDEWAYS_SHAKING);
EnKakasi_ChangeAnim(this, ENKAKASI_ANIM_SIDEWAYS_SHAKING);
}
if (this->unk190 > 8) {
this->unk190 = 8;
@@ -292,7 +292,7 @@ void func_8096FBB8(EnKakasi* this, PlayState* play) {
}
void EnKakasi_InitTimeSkipDialogue(EnKakasi* this) {
EnKakasi_SetAnimation(this, ENKAKASI_ANIM_SLOWROLL);
EnKakasi_ChangeAnim(this, ENKAKASI_ANIM_SLOWROLL);
this->actionFunc = EnKakasi_TimeSkipDialogue;
}
@@ -351,21 +351,21 @@ void EnKakasi_IdleStanding(EnKakasi* this, PlayState* play) {
if (this->picto.actor.projectedPos.z > -20.0f && x > 0 && x < SCREEN_WIDTH && y > 0 && y < SCREEN_HEIGHT &&
this->animIndex != ENKAKASI_ANIM_SIDEWAYS_SHAKING) {
// faster shaking
EnKakasi_SetAnimation(this, ENKAKASI_ANIM_SIDEWAYS_SHAKING);
EnKakasi_ChangeAnim(this, ENKAKASI_ANIM_SIDEWAYS_SHAKING);
this->skelanime.playSpeed = 2.0f;
}
} else if (Player_GetMask(play) == PLAYER_MASK_KAMARO) {
if (this->animIndex != ENKAKASI_ANIM_SIDEWAYS_SHAKING) {
EnKakasi_SetAnimation(this, ENKAKASI_ANIM_SIDEWAYS_SHAKING);
EnKakasi_ChangeAnim(this, ENKAKASI_ANIM_SIDEWAYS_SHAKING);
this->skelanime.playSpeed = 2.0f;
}
} else if (saveContextDay == 3 && gSaveContext.save.isNight) {
this->skelanime.playSpeed = 1.0f;
if (this->animIndex != ENKAKASI_ANIM_SIDEWAYS_SHAKING) {
EnKakasi_SetAnimation(this, 1);
EnKakasi_ChangeAnim(this, 1);
}
} else if (this->animIndex != ENKAKASI_ANIM_IDLE) {
EnKakasi_SetAnimation(this, ENKAKASI_ANIM_IDLE);
EnKakasi_ChangeAnim(this, ENKAKASI_ANIM_IDLE);
}
if (this->picto.actor.xzDistToPlayer < 120.0f) {
func_800B8614(&this->picto.actor, play, 100.0f);
@@ -376,12 +376,12 @@ void EnKakasi_IdleStanding(EnKakasi* this, PlayState* play) {
void EnKakasi_SetupDialogue(EnKakasi* this) {
// bug? starts one animation then changes it a few lines down?
if (this->animIndex != ENKAKASI_ANIM_SIDEWAYS_SHAKING) {
EnKakasi_SetAnimation(this, ENKAKASI_ANIM_SIDEWAYS_SHAKING);
EnKakasi_ChangeAnim(this, ENKAKASI_ANIM_SIDEWAYS_SHAKING);
}
this->talkState = TEXT_STATE_5;
this->unkState196 = 1;
EnKakasi_SetAnimation(this, ENKAKASI_ANIM_SPIN_REACH_OFFER);
EnKakasi_ChangeAnim(this, ENKAKASI_ANIM_SPIN_REACH_OFFER);
this->actionFunc = EnKakasi_RegularDialogue;
}
@@ -394,7 +394,7 @@ void EnKakasi_RegularDialogue(EnKakasi* this, PlayState* play) {
if (this->picto.actor.textId != 0x1644 && this->animeFrameCount <= currentAnimeFrame &&
this->animIndex == ENKAKASI_ANIM_SLOWROLL) {
EnKakasi_SetAnimation(this, ENKAKASI_ANIM_SPIN_REACH_OFFER);
EnKakasi_ChangeAnim(this, ENKAKASI_ANIM_SPIN_REACH_OFFER);
this->unkCounter1A4 = 0;
}
@@ -403,7 +403,7 @@ void EnKakasi_RegularDialogue(EnKakasi* this, PlayState* play) {
if (this->animeFrameCount <= currentAnimeFrame && this->animIndex != ENKAKASI_ANIM_SPIN_REACH_OFFER) {
if (++this->unkCounter1A4 >= 2) {
this->unkCounter1A4 = 0;
EnKakasi_SetAnimation(this, ENKAKASI_ANIM_SPIN_REACH_OFFER);
EnKakasi_ChangeAnim(this, ENKAKASI_ANIM_SPIN_REACH_OFFER);
}
}
}
@@ -426,7 +426,7 @@ void EnKakasi_RegularDialogue(EnKakasi* this, PlayState* play) {
u32 saveContextDay2 = gSaveContext.save.day;
if (this->animIndex != ENKAKASI_ANIM_SIDEWAYS_SHAKING) {
EnKakasi_SetAnimation(this, ENKAKASI_ANIM_SIDEWAYS_SHAKING);
EnKakasi_ChangeAnim(this, ENKAKASI_ANIM_SIDEWAYS_SHAKING);
}
if (saveContextDay2 == 3 && gSaveContext.save.isNight) {
@@ -465,13 +465,13 @@ void EnKakasi_RegularDialogue(EnKakasi* this, PlayState* play) {
} else if (this->picto.actor.textId == 0x1645 || this->picto.actor.textId == 0x164E) {
this->picto.actor.textId = 0x1650; // "Shall we dance? No Yes"
if (this->animIndex != ENKAKASI_ANIM_SIDEWAYS_SHAKING) {
EnKakasi_SetAnimation(this, ENKAKASI_ANIM_SIDEWAYS_SHAKING);
EnKakasi_ChangeAnim(this, ENKAKASI_ANIM_SIDEWAYS_SHAKING);
}
this->talkState = TEXT_STATE_CHOICE;
} else if (this->picto.actor.textId == 0x1644) {
if (this->animIndex != ENKAKASI_ANIM_SIDEWAYS_SHAKING) {
EnKakasi_SetAnimation(this, ENKAKASI_ANIM_SIDEWAYS_SHAKING);
EnKakasi_ChangeAnim(this, ENKAKASI_ANIM_SIDEWAYS_SHAKING);
}
if (gSaveContext.save.isNight) {
this->picto.actor.textId = 0x164E;
@@ -481,12 +481,12 @@ void EnKakasi_RegularDialogue(EnKakasi* this, PlayState* play) {
} else if (this->picto.actor.textId == 0x164F) {
if (this->animIndex != ENKAKASI_ANIM_SIDEWAYS_SHAKING) {
EnKakasi_SetAnimation(this, ENKAKASI_ANIM_SIDEWAYS_SHAKING);
EnKakasi_ChangeAnim(this, ENKAKASI_ANIM_SIDEWAYS_SHAKING);
}
this->picto.actor.textId = 0x165A;
} else if (this->picto.actor.textId == 0x1651) {
if (this->animIndex != ENKAKASI_ANIM_SIDEWAYS_SHAKING) {
EnKakasi_SetAnimation(this, ENKAKASI_ANIM_SIDEWAYS_SHAKING);
EnKakasi_ChangeAnim(this, ENKAKASI_ANIM_SIDEWAYS_SHAKING);
}
this->picto.actor.textId = 0x1654;
} else if (this->picto.actor.textId == 0x1654) {
@@ -522,7 +522,7 @@ void EnKakasi_RegularDialogue(EnKakasi* this, PlayState* play) {
} else {
this->picto.actor.textId = 0x1652;
}
EnKakasi_SetAnimation(this, ENKAKASI_ANIM_HOPPING_REGULAR);
EnKakasi_ChangeAnim(this, ENKAKASI_ANIM_HOPPING_REGULAR);
} else {
func_8019F230();
if (this->picto.actor.textId == 0x1656) { // would you like to learn a song? yes/no
@@ -534,7 +534,7 @@ void EnKakasi_RegularDialogue(EnKakasi* this, PlayState* play) {
}
this->unkCounter1A4 = 0;
if (this->animIndex != ENKAKASI_ANIM_ARMS_CROSSED_ROCKING) {
EnKakasi_SetAnimation(this, ENKAKASI_ANIM_ARMS_CROSSED_ROCKING);
EnKakasi_ChangeAnim(this, ENKAKASI_ANIM_ARMS_CROSSED_ROCKING);
}
}
}
@@ -548,7 +548,7 @@ void EnKakasi_SetupSongTeach(EnKakasi* this, PlayState* play) {
this->subCamId = SUB_CAM_ID_DONE;
this->subCamFov = 0.0f;
this->subCamFovNext = 60.0f;
EnKakasi_SetAnimation(this, ENKAKASI_ANIM_TWIRL);
EnKakasi_ChangeAnim(this, ENKAKASI_ANIM_TWIRL);
this->unkState196 = 2;
this->actionFunc = EnKakasi_OcarinaRemark;
}
@@ -627,13 +627,13 @@ void EnKakasi_TeachingSong(EnKakasi* this, PlayState* play) {
this->picto.actor.textId = 0x1647;
this->unkState1A8 = 2;
this->talkState = TEXT_STATE_5;
EnKakasi_SetAnimation(this, ENKAKASI_ANIM_ARMS_CROSSED_ROCKING);
EnKakasi_ChangeAnim(this, ENKAKASI_ANIM_ARMS_CROSSED_ROCKING);
this->actionFunc = EnKakasi_RegularDialogue;
} else if (play->msgCtx.ocarinaMode == 3) { // song success
this->postTeachTimer = 30;
this->skelanime.playSpeed = 2.0f;
EnKakasi_SetAnimation(this, ENKAKASI_ANIM_HOPPING_REGULAR);
EnKakasi_ChangeAnim(this, ENKAKASI_ANIM_HOPPING_REGULAR);
this->actionFunc = EnKakasi_PostSongLearnTwirl;
}
}
@@ -643,7 +643,7 @@ void EnKakasi_PostSongLearnTwirl(EnKakasi* this, PlayState* play) {
f32 animeFrame = this->skelanime.curFrame;
if (this->postTeachTimer == 0 && this->animIndex != ENKAKASI_ANIM_TWIRL) {
EnKakasi_SetAnimation(this, ENKAKASI_ANIM_TWIRL);
EnKakasi_ChangeAnim(this, ENKAKASI_ANIM_TWIRL);
this->skelanime.playSpeed = 2.0f;
}
if (this->postTeachTimer == 0 && this->animIndex == ENKAKASI_ANIM_TWIRL && this->animeFrameCount <= animeFrame) {
@@ -656,7 +656,7 @@ void EnKakasi_SetupPostSongLearnDialogue(EnKakasi* this, PlayState* play) {
play->msgCtx.ocarinaMode = 4;
this->unk190 = 0;
this->unkCounter1A4 = 0;
EnKakasi_SetAnimation(this, ENKAKASI_ANIM_HOPPING_REGULAR);
EnKakasi_ChangeAnim(this, ENKAKASI_ANIM_HOPPING_REGULAR);
this->subCamId = SUB_CAM_ID_DONE;
this->talkState = TEXT_STATE_5;
this->unkState1A8 = 1;
@@ -686,7 +686,7 @@ void EnKakasi_PostSongLearnDialogue(EnKakasi* this, PlayState* play) {
this->animeFrameCount <= tempAnimFrame) {
this->unkCounter1A4++;
if (this->unkCounter1A4 >= 2) {
EnKakasi_SetAnimation(this, ENKAKASI_ANIM_ARMS_CROSSED_ROCKING);
EnKakasi_ChangeAnim(this, ENKAKASI_ANIM_ARMS_CROSSED_ROCKING);
}
}
@@ -694,7 +694,7 @@ void EnKakasi_PostSongLearnDialogue(EnKakasi* this, PlayState* play) {
this->animeFrameCount <= tempAnimFrame) {
this->unkCounter1A4++;
if (this->unkCounter1A4 >= 2) {
EnKakasi_SetAnimation(this, ENKAKASI_ANIM_SPIN_REACH_OFFER);
EnKakasi_ChangeAnim(this, ENKAKASI_ANIM_SPIN_REACH_OFFER);
}
}
@@ -747,7 +747,7 @@ void EnKakasi_PostSongLearnDialogue(EnKakasi* this, PlayState* play) {
func_800B7298(play, &this->picto.actor, 7);
this->picto.actor.textId = 0x1649;
if (this->animIndex != ENKAKASI_ANIM_ARMS_CROSSED_ROCKING) {
EnKakasi_SetAnimation(this, ENKAKASI_ANIM_ARMS_CROSSED_ROCKING);
EnKakasi_ChangeAnim(this, ENKAKASI_ANIM_ARMS_CROSSED_ROCKING);
}
} else if (this->picto.actor.textId == 0x1649) {
@@ -759,7 +759,7 @@ void EnKakasi_PostSongLearnDialogue(EnKakasi* this, PlayState* play) {
} else if (this->picto.actor.textId == 0x164B) {
this->picto.actor.textId = 0x164C;
EnKakasi_SetAnimation(this, ENKAKASI_ANIM_TWIRL);
EnKakasi_ChangeAnim(this, ENKAKASI_ANIM_TWIRL);
} else {
if (this->picto.actor.textId == 0x164C || this->picto.actor.textId == 0x1661) {
@@ -811,7 +811,7 @@ void EnKakasi_SetupDanceNightAway(EnKakasi* this) {
this->unkCounter1A4 = 0;
this->subCamFov = 0.0f;
this->subCamFovNext = 60.0f;
EnKakasi_SetAnimation(this, ENKAKASI_ANIM_TWIRL);
EnKakasi_ChangeAnim(this, ENKAKASI_ANIM_TWIRL);
Math_Vec3f_Copy(&this->unk22C, &this->picto.actor.home.pos);
func_8016566C(0xB4);
this->actionFunc = EnKakasi_DancingNightAway;
@@ -859,7 +859,7 @@ void EnKakasi_DancingNightAway(EnKakasi* this, PlayState* play) {
if (this->unk204 == 0 && this->animeFrameCount <= currentFrame) {
this->unk204 = 0x14;
this->unk190++;
EnKakasi_SetAnimation(this, ENKAKASI_ANIM_SIDEWAYS_SHAKING);
EnKakasi_ChangeAnim(this, ENKAKASI_ANIM_SIDEWAYS_SHAKING);
}
return;
case 2:
@@ -954,7 +954,7 @@ void EnKakasi_DoNothing(EnKakasi* this, PlayState* play) {
void EnKakasi_SetupDigAway(EnKakasi* this) {
if (this->animIndex != ENKAKASI_ANIM_SIDEWAYS_SHAKING) {
EnKakasi_SetAnimation(this, ENKAKASI_ANIM_SIDEWAYS_SHAKING);
EnKakasi_ChangeAnim(this, ENKAKASI_ANIM_SIDEWAYS_SHAKING);
}
this->unk190 = 0;
this->unkCounter1A4 = 0;
@@ -1065,7 +1065,7 @@ void EnKakasi_RisingOutOfGround(EnKakasi* this, PlayState* play) {
this->picto.actor.shape.rot.y += 0x3000;
if (this->animIndex != ENKAKASI_ANIM_SIDEWAYS_SHAKING) {
EnKakasi_SetAnimation(this, ENKAKASI_ANIM_SIDEWAYS_SHAKING);
EnKakasi_ChangeAnim(this, ENKAKASI_ANIM_SIDEWAYS_SHAKING);
}
if (this->picto.actor.shape.yOffset < -10.0f) {
if ((play->gameplayFrames % 8) == 0) {
@@ -71,10 +71,12 @@ static ColliderCylinderInit sCylinderInit = {
static CollisionCheckInfoInit2 sColChkInfoInit = { 0, 0, 0, 0, MASS_IMMOVABLE };
static AnimationInfo sAnimations[] = {
{ &object_js_Anim_000C7C, 1.0f, 0.0f, 0.0f, 0, -8.0f }, { &object_js_Anim_000F4C, 1.0f, 0.0f, 0.0f, 0, -8.0f },
{ &object_js_Anim_00016C, 1.0f, 0.0f, 0.0f, 0, -8.0f }, { &object_js_Anim_0003DC, 1.0f, 0.0f, 0.0f, 2, -8.0f },
{ &object_js_Anim_000AD4, 1.0f, 0.0f, 0.0f, 0, -8.0f },
static AnimationInfo sAnimationInfo[] = {
{ &object_js_Anim_000C7C, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f },
{ &object_js_Anim_000F4C, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f },
{ &object_js_Anim_00016C, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f },
{ &object_js_Anim_0003DC, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -8.0f },
{ &object_js_Anim_000AD4, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f },
};
s16 D_80B27CE0[][3] = {
@@ -117,7 +119,7 @@ void EnKendoJs_Init(Actor* thisx, PlayState* play) {
this->actor.home.rot.z, 0x10);
Actor_MarkForDeath(&this->actor);
} else {
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 4);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 4);
}
} else if (ENKENDOJS_GET_FF(&this->actor) == ENKENDOJS_FF_1) {
Actor_MarkForDeath(&this->actor);
@@ -220,7 +222,7 @@ void func_80B26758(EnKendoJs* this, PlayState* play) {
play_sound(NA_SE_SY_ERROR);
Message_StartTextbox(play, 0x272C, &this->actor);
this->unk_288 = 0x272C;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 2);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 2);
} else if (gSaveContext.save.playerData.rupees < play->msgCtx.unk1206C) {
play_sound(NA_SE_SY_ERROR);
Message_StartTextbox(play, 0x2718, &this->actor);
@@ -238,7 +240,7 @@ void func_80B26758(EnKendoJs* this, PlayState* play) {
play_sound(NA_SE_SY_ERROR);
Message_StartTextbox(play, 0x272C, &this->actor);
this->unk_288 = 0x272C;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 2);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 2);
} else if (gSaveContext.save.playerData.rupees < play->msgCtx.unk12070) {
play_sound(NA_SE_SY_ERROR);
Message_StartTextbox(play, 0x2718, &this->actor);
@@ -328,7 +330,7 @@ void func_80B26AFC(EnKendoJs* this, PlayState* play) {
case TEXT_STATE_DONE:
if (Message_ShouldAdvance(play)) {
if (this->unk_288 == 0x272C) {
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 3);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 3);
}
if ((this->unk_288 == 0x272E) || (this->unk_288 == 0x272F) || (this->unk_288 == 0x2730)) {
@@ -514,7 +516,7 @@ void func_80B27188(EnKendoJs* this, PlayState* play) {
func_80B26F14(this, play);
} else if (!func_80B26F6C(this, play)) {
if (this->skelAnime.animation == &object_js_Anim_00016C) {
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 3);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 3);
}
this->unk_286 = 2;
func_801477B4(play);
@@ -539,7 +541,7 @@ void func_80B27188(EnKendoJs* this, PlayState* play) {
player->stateFlags1 |= 0x20;
Message_StartTextbox(play, 0x2729, &this->actor);
this->unk_288 = 0x2729;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 2);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 2);
break;
default:
@@ -555,7 +557,7 @@ void func_80B27188(EnKendoJs* this, PlayState* play) {
if ((this->skelAnime.animation == &object_js_Anim_0003DC) &&
Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 1);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 1);
}
if (this->unk_284 == 7) {
+3 -3
View File
@@ -17,7 +17,7 @@ void EnKgy_Destroy(Actor* thisx, PlayState* play);
void EnKgy_Update(Actor* thisx, PlayState* play);
void EnKgy_Draw(Actor* thisx, PlayState* play);
void EnKgy_ChangeAnim(EnKgy* this, s16 arg1, u8 arg2, f32 arg3);
void EnKgy_ChangeAnim(EnKgy* this, s16 animIndex, u8 mode, f32 morphFrames);
EnKbt* EnKgy_FindZubora(PlayState* play);
ObjIcePoly* EnKgy_FindIceBlock(PlayState* play);
void func_80B40D30(PlayState* play);
@@ -108,7 +108,7 @@ void EnKgy_Destroy(Actor* thisx, PlayState* play) {
LightContext_RemoveLight(play, &play->lightCtx, this->lightNode);
}
void EnKgy_ChangeAnim(EnKgy* this, s16 animIndex, u8 mode, f32 transitionRate) {
void EnKgy_ChangeAnim(EnKgy* this, s16 animIndex, u8 mode, f32 morphFrames) {
static AnimationHeader* sAnimations[] = {
&object_kgy_Anim_004B98, &object_kgy_Anim_0008FC, &object_kgy_Anim_00292C, &object_kgy_Anim_0042E4,
&object_kgy_Anim_0101F0, &object_kgy_Anim_001764, &object_kgy_Anim_003334, &object_kgy_Anim_010B84,
@@ -116,7 +116,7 @@ void EnKgy_ChangeAnim(EnKgy* this, s16 animIndex, u8 mode, f32 transitionRate) {
};
Animation_Change(&this->skelAnime, sAnimations[animIndex], 1.0f, 0.0f,
Animation_GetLastFrame(sAnimations[animIndex]), mode, transitionRate);
Animation_GetLastFrame(sAnimations[animIndex]), mode, morphFrames);
this->unk_2D2 = animIndex;
}
+11 -11
View File
@@ -134,10 +134,10 @@ static AnimationSpeedInfo sAnimationInfo[] = {
{ &gRomaniSittingLookDownAnim, 1.0f, ANIMMODE_LOOP, -6.0f },
};
void EnMa4_ChangeAnim(EnMa4* this, s32 index) {
Animation_Change(&this->skelAnime, sAnimationInfo[index].animation, 1.0f, 0.0f,
Animation_GetLastFrame(sAnimationInfo[index].animation), sAnimationInfo[index].mode,
sAnimationInfo[index].morphFrames);
void EnMa4_ChangeAnim(EnMa4* this, s32 animIndex) {
Animation_Change(&this->skelAnime, sAnimationInfo[animIndex].animation, 1.0f, 0.0f,
Animation_GetLastFrame(sAnimationInfo[animIndex].animation), sAnimationInfo[animIndex].mode,
sAnimationInfo[animIndex].morphFrames);
}
void func_80ABDD9C(EnMa4* this, PlayState* play) {
@@ -243,30 +243,30 @@ void EnMa4_Destroy(Actor* thisx, PlayState* play) {
// Running in circles in the ranch
void EnMa4_RunInCircles(EnMa4* this, PlayState* play) {
static s32 sCurrentAnim = 9;
static s32 sAnimIndex = 9;
static s32 D_80AC0250 = 0;
static s16 D_80AC0254 = 10;
Vec3f sp34;
s32 pad;
s16 sp2E;
if (sCurrentAnim != 9 && Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
if (sCurrentAnim == 3) {
if (sAnimIndex != 9 && Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
if (sAnimIndex == 3) {
if (D_80AC0250 < 3) {
D_80AC0250++;
} else {
D_80AC0250 = 0;
EnMa4_ChangeAnim(this, 13);
sCurrentAnim = 13;
sAnimIndex = 13;
}
} else {
this->actor.speedXZ = 2.7f;
EnMa4_ChangeAnim(this, 9);
sCurrentAnim = 9;
sAnimIndex = 9;
}
}
if (sCurrentAnim == 13 && Animation_OnFrame(&this->skelAnime, 37.0f)) {
if (sAnimIndex == 13 && Animation_OnFrame(&this->skelAnime, 37.0f)) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_ROMANI_BOW_FLICK);
}
@@ -282,7 +282,7 @@ void EnMa4_RunInCircles(EnMa4* this, PlayState* play) {
this->actor.speedXZ = 0.0f;
D_80AC0254 = 2;
EnMa4_ChangeAnim(this, 3);
sCurrentAnim = 3;
sAnimIndex = 3;
} else {
if (D_80AC0254 > 0) {
D_80AC0254--;
@@ -59,7 +59,7 @@ void EnMaYto_PostMilkRunEnd(EnMaYto* this, PlayState* play);
void EnMaYto_DefaultStartDialogue(EnMaYto* this, PlayState* play);
void EnMaYto_DinnerStartDialogue(EnMaYto* this, PlayState* play);
void EnMaYto_BarnStartDialogue(EnMaYto* this, PlayState* play);
void EnMaYto_ChangeAnim(EnMaYto* this, s32 index);
void EnMaYto_ChangeAnim(EnMaYto* this, s32 animIndex);
void EnMaYto_UpdateEyes(EnMaYto* this);
void func_80B90E50(EnMaYto* this, s16);
void EnMaYto_SetRomaniFaceExpression(EnMaYto* this, s16 overrideEyeTexIndex, s16 mouthTexIndex);
@@ -380,10 +380,10 @@ void EnMaYto_KeepLookingForRomani(EnMaYto* this, PlayState* play) {
void EnMaYto_SetupDefaultWait(EnMaYto* this) {
if (this->actor.shape.rot.y == this->actor.home.rot.y) {
this->currentAnim = 11;
this->animIndex = 11;
EnMaYto_ChangeAnim(this, 11);
} else {
this->currentAnim = 1;
this->animIndex = 1;
EnMaYto_ChangeAnim(this, 1);
}
@@ -398,8 +398,8 @@ void EnMaYto_DefaultWait(EnMaYto* this, PlayState* play) {
direction = rotY - this->actor.yawTowardsPlayer;
if (Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.home.rot.y, 5, 0x3000, 0x100) == 0 &&
this->currentAnim == 1) {
this->currentAnim = 11;
this->animIndex == 1) {
this->animIndex = 11;
EnMaYto_ChangeAnim(this, 11);
}
@@ -1268,10 +1268,10 @@ void EnMaYto_BarnStartDialogue(EnMaYto* this, PlayState* play) {
}
}
void EnMaYto_ChangeAnim(EnMaYto* this, s32 index) {
Animation_Change(&this->skelAnime, sAnimationInfo[index].animation, 1.0f, 0.0f,
Animation_GetLastFrame(sAnimationInfo[index].animation), sAnimationInfo[index].mode,
sAnimationInfo[index].morphFrames);
void EnMaYto_ChangeAnim(EnMaYto* this, s32 animIndex) {
Animation_Change(&this->skelAnime, sAnimationInfo[animIndex].animation, 1.0f, 0.0f,
Animation_GetLastFrame(sAnimationInfo[animIndex].animation), sAnimationInfo[animIndex].mode,
sAnimationInfo[animIndex].morphFrames);
}
void func_80B90C78(EnMaYto* this, PlayState* play) {
@@ -20,7 +20,7 @@ typedef struct EnMaYto {
/* 0x28C */ Vec3s morphTable[CREMIA_LIMB_MAX];
/* 0x310 */ s16 unk310; // state?
/* 0x312 */ UNK_TYPE1 unk_312[0x2];
/* 0x314 */ s16 currentAnim; // Used only in DefaultWait
/* 0x314 */ s16 animIndex; // Used only in DefaultWait
/* 0x316 */ s16 overrideEyeTexIndex; // If non-zero, then this index will be used instead of eyeTexIndex
/* 0x318 */ s16 mouthTexIndex;
/* 0x31A */ s16 eyeTexIndex;
@@ -113,10 +113,10 @@ static TexturePtr sEyeTextures[] = {
gRomaniEyeOpenTex, gRomaniEyeHalfTex, gRomaniEyeClosedTex, gRomaniEyeHappyTex, gRomaniEyeSadTex,
};
void EnMaYts_ChangeAnim(EnMaYts* this, s32 index) {
Animation_Change(&this->skelAnime, sAnimationInfo[index].animation, 1.0f, 0.0f,
Animation_GetLastFrame(sAnimationInfo[index].animation), sAnimationInfo[index].mode,
sAnimationInfo[index].morphFrames);
void EnMaYts_ChangeAnim(EnMaYts* this, s32 animIndex) {
Animation_Change(&this->skelAnime, sAnimationInfo[animIndex].animation, 1.0f, 0.0f,
Animation_GetLastFrame(sAnimationInfo[animIndex].animation), sAnimationInfo[animIndex].mode,
sAnimationInfo[animIndex].morphFrames);
}
void func_80B8D12C(EnMaYts* this, PlayState* play) {
+12 -8
View File
@@ -63,11 +63,15 @@ static ColliderCylinderInit sCylinderInit = {
static CollisionCheckInfoInit2 sColChkInfoInit = { 0, 0, 0, 0, MASS_IMMOVABLE };
static AnimationInfo sAnimations[] = {
{ &object_mm_Anim_002238, 1.0f, 0.0f, 0.0f, 0, -7.0f }, { &object_mm_Anim_00A4E0, -1.0f, 0.0f, 0.0f, 2, -7.0f },
{ &object_mm_Anim_00C640, 1.0f, 0.0f, 0.0f, 0, -7.0f }, { &object_mm_Anim_00A4E0, 1.0f, 0.0f, 0.0f, 2, -7.0f },
{ &object_mm_Anim_000468, 1.0f, 0.0f, 0.0f, 0, -7.0f }, { &object_mm_Anim_00CD90, 1.0f, 0.0f, 0.0f, 0, -12.0f },
{ &object_mm_Anim_00DA50, 1.0f, 0.0f, 0.0f, 0, -12.0f }, { &object_mm_Anim_00DA50, 1.0f, 0.0f, 10.0f, 2, -10.0f },
static AnimationInfo sAnimationInfo[] = {
{ &object_mm_Anim_002238, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -7.0f },
{ &object_mm_Anim_00A4E0, -1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -7.0f },
{ &object_mm_Anim_00C640, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -7.0f },
{ &object_mm_Anim_00A4E0, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -7.0f },
{ &object_mm_Anim_000468, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -7.0f },
{ &object_mm_Anim_00CD90, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -12.0f },
{ &object_mm_Anim_00DA50, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -12.0f },
{ &object_mm_Anim_00DA50, 1.0f, 0.0f, 10.0f, ANIMMODE_ONCE, -10.0f },
};
#include "overlays/ovl_En_Mm3/ovl_En_Mm3.c"
@@ -119,7 +123,7 @@ s32 func_80A6F22C(EnMm3* this) {
void func_80A6F270(EnMm3* this) {
this->unk_1DC = 1;
this->unk_2B0 &= ~1;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 5);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 5);
this->actionFunc = func_80A6F2C8;
}
@@ -211,7 +215,7 @@ void func_80A6F5E4(EnMm3* this, PlayState* play) {
}
this->unk_1DC = 0;
this->unk_2B0 |= 1;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 7);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 7);
break;
case 0x278B:
@@ -355,7 +359,7 @@ void func_80A6F9DC(EnMm3* this, PlayState* play) {
}
if ((this->skelAnime.mode == 2) && Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 2);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 2);
}
if (((this->unk_2B4 == 0x279D) || (this->unk_2B4 == 0x27A0) || (this->unk_2B4 == 0x278B)) &&
+1 -1
View File
@@ -16,7 +16,7 @@ void EnMuto_Destroy(Actor* thisx, PlayState* play);
void EnMuto_Update(Actor* thisx, PlayState* play);
void EnMuto_Draw(Actor* thisx, PlayState* play);
void EnMuto_ChangeAnim(EnMuto* this, s32 arg1);
void EnMuto_ChangeAnim(EnMuto* this, s32 animIndex);
void EnMuto_SetHeadRotation(EnMuto* this);
void EnMuto_SetupIdle(EnMuto* this);
void EnMuto_Idle(EnMuto* this, PlayState* play);
+22 -22
View File
@@ -187,7 +187,7 @@ void EnNiw_AnimateWingHead(EnNiw* this, PlayState* play, s16 animationState) {
if (this->unkTimer24C == 0) {
// targetLimbRots[0] is bodyRotY
if (animationState == NIW_ANIMATION_STILL) {
if (animationState == NIW_ANIM_STILL) {
this->targetLimbRots[0] = 0.0f;
} else {
this->targetLimbRots[0] = -10000.0f * tempOne;
@@ -197,7 +197,7 @@ void EnNiw_AnimateWingHead(EnNiw* this, PlayState* play, s16 animationState) {
this->unkTimer24C = 3;
if ((this->unk292 % 2) == 0) {
this->targetLimbRots[0] = 0.0f;
if (animationState == NIW_ANIMATION_STILL) {
if (animationState == NIW_ANIM_STILL) {
this->unkTimer24C = Rand_ZeroFloat(30.0f);
}
}
@@ -208,11 +208,11 @@ void EnNiw_AnimateWingHead(EnNiw* this, PlayState* play, s16 animationState) {
this->unkToggle296 &= 1;
switch (animationState) {
case NIW_ANIMATION_STILL:
case NIW_ANIM_STILL:
this->targetLimbRots[2] = 0.0f; // both wingRotZ
this->targetLimbRots[1] = 0.0f;
break;
case NIW_ANIMATION_HEAD_PECKING:
case NIW_ANIM_HEAD_PECKING:
this->unkTimer24E = 3;
this->targetLimbRots[2] = 7000.0f * tempOne; // both wingRotZ
this->targetLimbRots[1] = 7000.0f * tempOne;
@@ -222,7 +222,7 @@ void EnNiw_AnimateWingHead(EnNiw* this, PlayState* play, s16 animationState) {
}
break;
case NIW_ANIMATION_PECKING_AND_WAVING:
case NIW_ANIM_PECKING_AND_WAVING:
this->unkTimer24E = 2;
this->targetLimbRots[2] = -10000.0f; // both wingRotZ
this->targetLimbRots[1] = -10000.0f;
@@ -236,7 +236,7 @@ void EnNiw_AnimateWingHead(EnNiw* this, PlayState* play, s16 animationState) {
}
break;
case NIW_ANIMATION_PECKING_AND_FORFLAPPING:
case NIW_ANIM_PECKING_AND_FORFLAPPING:
this->unkTimer24E = 2;
this->targetLimbRots[5] = 10000.0f; // both wingRotY
this->targetLimbRots[7] = 10000.0f;
@@ -246,11 +246,11 @@ void EnNiw_AnimateWingHead(EnNiw* this, PlayState* play, s16 animationState) {
}
break;
case NIW_ANIMATION_FREEZE:
case NIW_ANIM_FREEZE:
this->unkTimer24C = 5;
break;
case NIW_ANIMATION_PECKING_SLOW_FORFLAPPING:
case NIW_ANIM_PECKING_SLOW_FORFLAPPING:
this->unkTimer24E = 5;
this->targetLimbRots[5] = 14000.0f; // both wingRotY
this->targetLimbRots[7] = 14000.0f;
@@ -348,7 +348,7 @@ void EnNiw_UpdateRunning(EnNiw* this, PlayState* play, s32 isStormCucco) {
targetRotY = this->yawTowardsPlayer + runningDirection;
Math_SmoothStepToS(&this->actor.world.rot.y, targetRotY, 3, this->unk300, 0);
Math_ApproachF(&this->unk300, 3000.0f, 1.0f, 500.0f);
EnNiw_AnimateWingHead(this, play, NIW_ANIMATION_PECKING_SLOW_FORFLAPPING);
EnNiw_AnimateWingHead(this, play, NIW_ANIM_PECKING_SLOW_FORFLAPPING);
}
void EnNiw_SetupIdle(EnNiw* this) {
@@ -363,7 +363,7 @@ void EnNiw_Idle(EnNiw* this, PlayState* play) {
f32 posZ2;
f32 posX1 = randPlusMinusPoint5Scaled(100.0f);
f32 posZ1 = randPlusMinusPoint5Scaled(100.0f);
s16 nextAnimation;
s16 nextAnimIndex;
if (this->niwType == NIW_TYPE_REGULAR) {
if (Actor_HasParent(&this->actor, play)) { // picked up
@@ -382,7 +382,7 @@ void EnNiw_Idle(EnNiw* this, PlayState* play) {
this->unkIdleTimer2 = 10;
}
nextAnimation = NIW_ANIMATION_STILL; // probably a scoped variable here, where their scope was different
nextAnimIndex = NIW_ANIM_STILL; // probably a scoped variable here, where their scope was different
if (this->unkIdleTimer2 != 0) {
if (Rand_ZeroFloat(3.99f) < 1.0f) {
this->headRotationToggle++;
@@ -423,7 +423,7 @@ void EnNiw_Idle(EnNiw* this, PlayState* play) {
if (this->unkIdleTimer != 0) {
Math_ApproachZeroF(&this->targetLimbRots[9], 0.5f, 4000.0f); // head rot
nextAnimation = NIW_ANIMATION_HEAD_PECKING;
nextAnimIndex = NIW_ANIM_HEAD_PECKING;
Math_ApproachF(&this->actor.world.pos.x, this->unk2B0.x, 1.0f, this->unk300);
Math_ApproachF(&this->actor.world.pos.z, this->unk2B0.z, 1.0f, this->unk300);
Math_ApproachF(&this->unk300, 3.0f, 1.0f, 0.3f);
@@ -447,7 +447,7 @@ void EnNiw_Idle(EnNiw* this, PlayState* play) {
Math_ApproachF(&this->unk304, 10000.0f, 1.0f, 1000.0f);
}
EnNiw_AnimateWingHead(this, play, nextAnimation);
EnNiw_AnimateWingHead(this, play, nextAnimIndex);
}
void EnNiw_Held(EnNiw* this, PlayState* play) {
@@ -489,7 +489,7 @@ void EnNiw_Held(EnNiw* this, PlayState* play) {
this->actionFunc = EnNiw_Thrown;
}
EnNiw_AnimateWingHead(this, play, NIW_ANIMATION_PECKING_AND_WAVING);
EnNiw_AnimateWingHead(this, play, NIW_ANIM_PECKING_AND_WAVING);
}
void EnNiw_Thrown(EnNiw* this, PlayState* play) {
@@ -531,7 +531,7 @@ void EnNiw_Thrown(EnNiw* this, PlayState* play) {
if (this->hoppingTimer > 5) {
Actor_LiftActor(&this->actor, play);
}
EnNiw_AnimateWingHead(this, play, NIW_ANIMATION_PECKING_AND_WAVING);
EnNiw_AnimateWingHead(this, play, NIW_ANIM_PECKING_AND_WAVING);
}
}
@@ -585,7 +585,7 @@ void EnNiw_Swimming(EnNiw* this, PlayState* play) {
}
}
EnNiw_AnimateWingHead(this, play, NIW_ANIMATION_PECKING_AND_WAVING);
EnNiw_AnimateWingHead(this, play, NIW_ANIM_PECKING_AND_WAVING);
}
void EnNiw_Trigger(EnNiw* this, PlayState* play) {
@@ -597,7 +597,7 @@ void EnNiw_Trigger(EnNiw* this, PlayState* play) {
}
this->cuccoStormTimer = 10;
this->niwState = this->nextAnimation = state; // NIW_ANIMATION_HEAD_PECKING
this->niwState = this->nextAnimIndex = state; // NIW_ANIM_HEAD_PECKING
this->actionFunc = EnNiw_Upset;
}
@@ -607,12 +607,12 @@ void EnNiw_Upset(EnNiw* this, PlayState* play) {
if (this->cuccoStormTimer == 0) {
this->cuccoStormTimer = 60;
this->unkTimer24C = 10;
this->nextAnimation = NIW_ANIMATION_FREEZE;
this->nextAnimIndex = NIW_ANIM_FREEZE;
this->niwState = NIW_STATE_ANGRY2;
this->actionFunc = EnNiw_SetupCuccoStorm;
}
EnNiw_AnimateWingHead(this, play, this->nextAnimation);
EnNiw_AnimateWingHead(this, play, this->nextAnimIndex);
}
// the long crow with head back before they descend
@@ -640,7 +640,7 @@ void EnNiw_SetupCuccoStorm(EnNiw* this, PlayState* play) {
this->actionFunc = EnNiw_CuccoStorm;
}
EnNiw_AnimateWingHead(this, play, this->nextAnimation);
EnNiw_AnimateWingHead(this, play, this->nextAnimIndex);
}
void EnNiw_CuccoStorm(EnNiw* this, PlayState* play) {
@@ -697,7 +697,7 @@ void EnNiw_RunAway(EnNiw* this, PlayState* play) {
}
this->yawTowardsPlayer = Math_Atan2S(dX, dZ);
EnNiw_UpdateRunning(this, play, false);
EnNiw_AnimateWingHead(this, play, NIW_ANIMATION_PECKING_AND_WAVING);
EnNiw_AnimateWingHead(this, play, NIW_ANIM_PECKING_AND_WAVING);
}
}
@@ -877,7 +877,7 @@ void EnNiw_Update(Actor* thisx, PlayState* play) {
this->headRotY = 0.0f;
// clang-format off
this->isStormActive = this->unusedCounter28C = this->unk292 = this->unk29E = this->unk298 = this->isRunningRight = this->nextAnimation = 0;
this->isStormActive = this->unusedCounter28C = this->unk292 = this->unk29E = this->unk298 = this->isRunningRight = this->nextAnimIndex = 0;
// clang-format on
for (i = 0; i < 10; i++) {
+7 -8
View File
@@ -61,7 +61,7 @@ typedef struct EnNiw {
/* 0x296 */ s16 unkToggle296;
/* 0x298 */ s16 unk298;
/* 0x29C */ s16 isRunningRight; // toggle (direction cucco is turning while running)
/* 0x29C */ u16 nextAnimation;
/* 0x29C */ u16 nextAnimIndex;
/* 0x29E */ s16 unk29E; // three states 0/1/2
/* 0x2A0 */ s16 isStormActive; // we have a data value shared between all cucco, this shouldn't need to exist
/* 0x2A2 */ s16 niwType;
@@ -100,13 +100,12 @@ typedef struct EnNiw {
// the attacking cuccos are not here, they are a different actor: [ ovl_En_Attack_Niw ]
typedef enum {
/* 0 */ NIW_ANIMATION_STILL,
/* 1 */ NIW_ANIMATION_HEAD_PECKING, // forward and backward, feeding
/* 2 */ NIW_ANIMATION_PECKING_AND_WAVING, // wings move along their axis, like human hand waving
/* 3 */ NIW_ANIMATION_PECKING_AND_FORFLAPPING, // (unused) low (yaw based) flapping, forward and back
/* 4 */ NIW_ANIMATION_FREEZE, // used during Cucco Storm
/* 5 */ NIW_ANIMATION_PECKING_SLOW_FORFLAPPING, // wing speed half that of 3
/* 0 */ NIW_ANIM_STILL,
/* 1 */ NIW_ANIM_HEAD_PECKING, // forward and backward, feeding
/* 2 */ NIW_ANIM_PECKING_AND_WAVING, // wings move along their axis, like human hand waving
/* 3 */ NIW_ANIM_PECKING_AND_FORFLAPPING, // (unused) low (yaw based) flapping, forward and back
/* 4 */ NIW_ANIM_FREEZE, // used during Cucco Storm
/* 5 */ NIW_ANIM_PECKING_SLOW_FORFLAPPING, // wing speed half that of 3
} EnNiwHeadAndWingAnimationState;
+10 -10
View File
@@ -28,7 +28,7 @@ const ActorInit En_Osn_InitVars = {
(ActorFunc)EnOsn_Draw,
};
static AnimationInfo sAnimations[] = {
static AnimationInfo sAnimationInfo[] = {
{ &object_osn_Anim_0201BC, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f },
{ &object_osn_Anim_002F74, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f },
{ &object_osn_Anim_0037C4, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f },
@@ -179,27 +179,27 @@ s32 func_80AD08B0(PlayState* play) {
void func_80AD0998(EnOsn* this) {
s16 curFrame = this->skelAnime.curFrame;
s16 lastFrame = Animation_GetLastFrame(sAnimations[this->unk_1EC].animation);
s16 lastFrame = Animation_GetLastFrame(sAnimationInfo[this->unk_1EC].animation);
if (this->unk_1EC == 0x12 && curFrame == lastFrame) {
this->unk_1EC = 0x13;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 0x13);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 0x13);
}
}
void func_80AD0A24(EnOsn* this) {
s16 curFrame = this->skelAnime.curFrame;
s16 lastFrame = Animation_GetLastFrame(sAnimations[this->unk_1EC].animation);
s16 lastFrame = Animation_GetLastFrame(sAnimationInfo[this->unk_1EC].animation);
if (this->unk_1EC == 0x15 && curFrame == lastFrame) {
this->unk_1EC = 0x16;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 0x16);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 0x16);
}
}
void func_80AD0AB0(EnOsn* this) {
s16 curFrame = this->skelAnime.curFrame;
s16 lastFrame = Animation_GetLastFrame(sAnimations[this->unk_1EC].animation);
s16 lastFrame = Animation_GetLastFrame(sAnimationInfo[this->unk_1EC].animation);
if (curFrame == lastFrame) {
this->unk_1FA -= 8;
@@ -608,7 +608,7 @@ void func_80AD144C(EnOsn* this, PlayState* play) {
u32 sp1C = Flags_GetSwitch(play, 0);
this->cutscene = this->actor.cutscene;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 0);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 0);
if (sp1C == 0) {
this->actionFunc = func_80AD16A8;
} else {
@@ -728,7 +728,7 @@ void func_80AD16A8(EnOsn* this, PlayState* play) {
this->unk_1EC = 0;
break;
}
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->unk_1EC);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, this->unk_1EC);
}
if ((this->unk_1EC == 5) && (play->sceneNum == SCENE_SPOT00) && (gSaveContext.sceneSetupIndex == 0xB) &&
@@ -814,13 +814,13 @@ void EnOsn_Init(Actor* thisx, PlayState* play) {
case 1:
this->unk_1EC = 0xF;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->unk_1EC);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, this->unk_1EC);
this->actionFunc = EnOsn_Idle;
break;
case 2:
this->unk_1EC = 0x10;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->unk_1EC);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, this->unk_1EC);
this->actionFunc = EnOsn_Idle;
break;
+77 -77
View File
@@ -60,36 +60,36 @@ typedef enum {
} EnOssanCutsceneState;
typedef enum {
/* 00 */ FSN_ANIMATION_IDLE,
/* 01 */ FSN_ANIMATION_SCRATCH_BACK,
/* 02 */ FSN_ANIMATION_TURN_AROUND_FORWARD,
/* 03 */ FSN_ANIMATION_TURN_AROUND_REVERSE,
/* 04 */ FSN_ANIMATION_HANDS_ON_COUNTER_START,
/* 05 */ FSN_ANIMATION_HANDS_ON_COUNTER_LOOP,
/* 06 */ FSN_ANIMATION_HAND_ON_FACE_START,
/* 07 */ FSN_ANIMATION_HAND_ON_FACE_LOOP,
/* 08 */ FSN_ANIMATION_LEAN_FORWARD_START,
/* 09 */ FSN_ANIMATION_LEAN_FORWARD_LOOP,
/* 10 */ FSN_ANIMATION_SLAM_COUNTER_START,
/* 11 */ FSN_ANIMATION_SLAM_COUNTER_LOOP,
/* 12 */ FSN_ANIMATION_MAKE_OFFER,
/* 13 */ FSN_ANIMATION_MAX
/* 0 */ FSN_ANIM_IDLE,
/* 1 */ FSN_ANIM_SCRATCH_BACK,
/* 2 */ FSN_ANIM_TURN_AROUND_FORWARD,
/* 3 */ FSN_ANIM_TURN_AROUND_REVERSE,
/* 4 */ FSN_ANIM_HANDS_ON_COUNTER_START,
/* 5 */ FSN_ANIM_HANDS_ON_COUNTER_LOOP,
/* 6 */ FSN_ANIM_HAND_ON_FACE_START,
/* 7 */ FSN_ANIM_HAND_ON_FACE_LOOP,
/* 8 */ FSN_ANIM_LEAN_FORWARD_START,
/* 9 */ FSN_ANIM_LEAN_FORWARD_LOOP,
/* 10 */ FSN_ANIM_SLAM_COUNTER_START,
/* 11 */ FSN_ANIM_SLAM_COUNTER_LOOP,
/* 12 */ FSN_ANIM_MAKE_OFFER,
/* 13 */ FSN_ANIM_MAX
} FsnAnimation;
typedef enum {
/* 00 */ ANI_ANIMATION_STANDING_NORMAL_LOOP_1,
/* 01 */ ANI_ANIMATION_STANDING_NORMAL_LOOP_2,
/* 02 */ ANI_ANIMATION_STANDING_NORMAL_ONCE_FORWARD_1,
/* 03 */ ANI_ANIMATION_STANDING_NORMAL_ONCE_REVERSE,
/* 04 */ ANI_ANIMATION_STANDING_NORMAL_ONCE_FORWARD_2,
/* 05 */ ANI_ANIMATION_STANDING_NORMAL_LOOP_3,
/* 06 */ ANI_ANIMATION_STANDING_NORMAL_ONCE_FORWARD_3,
/* 07 */ ANI_ANIMATION_STANDING_NORMAL_LOOP_4,
/* 08 */ ANI_ANIMATION_APOLOGY_START,
/* 09 */ ANI_ANIMATION_APOLOGY_LOOP,
/* 10 */ ANI_ANIMATION_STANDING_NORMAL_ONCE_FORWARD_4,
/* 11 */ ANI_ANIMATION_STANDING_NORMAL_LOOP_5,
/* 12 */ ANI_ANIMATION_MAX
/* 0 */ ANI_ANIM_STANDING_NORMAL_LOOP_1,
/* 1 */ ANI_ANIM_STANDING_NORMAL_LOOP_2,
/* 2 */ ANI_ANIM_STANDING_NORMAL_ONCE_FORWARD_1,
/* 3 */ ANI_ANIM_STANDING_NORMAL_ONCE_REVERSE,
/* 4 */ ANI_ANIM_STANDING_NORMAL_ONCE_FORWARD_2,
/* 5 */ ANI_ANIM_STANDING_NORMAL_LOOP_3,
/* 6 */ ANI_ANIM_STANDING_NORMAL_ONCE_FORWARD_3,
/* 7 */ ANI_ANIM_STANDING_NORMAL_LOOP_4,
/* 8 */ ANI_ANIM_APOLOGY_START,
/* 9 */ ANI_ANIM_APOLOGY_LOOP,
/* 10 */ ANI_ANIM_STANDING_NORMAL_ONCE_FORWARD_4,
/* 11 */ ANI_ANIM_STANDING_NORMAL_LOOP_5,
/* 12 */ ANI_ANIM_MAX
} AniAnimation;
const ActorInit En_Ossan_InitVars = {
@@ -104,7 +104,7 @@ const ActorInit En_Ossan_InitVars = {
(ActorFunc)NULL,
};
static AnimationInfoS sCuriosityShopManAnimations[] = {
static AnimationInfoS sCuriosityShopManAnimationInfo[] = {
{ &gFsnIdleAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
{ &gFsnScratchBackAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
{ &gFsnTurnAroundAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
@@ -120,7 +120,7 @@ static AnimationInfoS sCuriosityShopManAnimations[] = {
{ &gFsnMakeOfferAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
};
static AnimationInfoS sPartTimerAnimations[] = {
static AnimationInfoS sPartTimerAnimationInfo[] = {
{ &gAniStandingNormalAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -10 },
{ &gAniStandingNormalAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -10 },
{ &gAniStandingNormalAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
@@ -137,7 +137,7 @@ static AnimationInfoS sPartTimerAnimations[] = {
static s16 sObjectIds[] = { OBJECT_FSN, OBJECT_ANI };
static AnimationInfoS* sAnimations[] = { sCuriosityShopManAnimations, sPartTimerAnimations };
static AnimationInfoS* sAnimationInfo[] = { sCuriosityShopManAnimationInfo, sPartTimerAnimationInfo };
static f32 sActorScales[] = { 0.01f, 0.01f };
@@ -389,11 +389,11 @@ void EnOssan_Idle(EnOssan* this, PlayState* play) {
}
void EnOssan_BeginInteraction(EnOssan* this, PlayState* play) {
AnimationInfoS* animations = sAnimations[this->actor.params];
AnimationInfoS* animationInfo = sAnimationInfo[this->actor.params];
s16 curFrame = this->skelAnime.curFrame;
s16 frameCount = Animation_GetLastFrame(animations[this->animationIndex].animation);
s16 frameCount = Animation_GetLastFrame(animationInfo[this->animIndex].animation);
if (this->animationIndex == FSN_ANIMATION_TURN_AROUND_REVERSE) {
if (this->animIndex == FSN_ANIM_TURN_AROUND_REVERSE) {
frameCount = 0;
}
if (this->cutsceneState == ENOSSAN_CUTSCENESTATE_WAITING) {
@@ -406,40 +406,40 @@ void EnOssan_BeginInteraction(EnOssan* this, PlayState* play) {
}
if (this->actor.params == ENOSSAN_CURIOSITY_SHOP_MAN) {
if (curFrame == frameCount) {
switch (this->animationIndex) {
case FSN_ANIMATION_SCRATCH_BACK:
this->animationIndex = FSN_ANIMATION_TURN_AROUND_FORWARD;
SubS_ChangeAnimationByInfoS(&this->skelAnime, animations, FSN_ANIMATION_TURN_AROUND_FORWARD);
switch (this->animIndex) {
case FSN_ANIM_SCRATCH_BACK:
this->animIndex = FSN_ANIM_TURN_AROUND_FORWARD;
SubS_ChangeAnimationByInfoS(&this->skelAnime, animationInfo, FSN_ANIM_TURN_AROUND_FORWARD);
break;
case FSN_ANIMATION_TURN_AROUND_FORWARD:
case FSN_ANIM_TURN_AROUND_FORWARD:
EnOssan_SetHaveMet(this);
this->textId = EnOssan_CuriosityShopMan_GetWelcome(this, play);
SubS_ChangeAnimationByInfoS(&this->skelAnime, animations, this->animationIndex);
SubS_ChangeAnimationByInfoS(&this->skelAnime, animationInfo, this->animIndex);
break;
case FSN_ANIMATION_HANDS_ON_COUNTER_START:
case FSN_ANIMATION_HAND_ON_FACE_START:
case FSN_ANIMATION_LEAN_FORWARD_START:
case FSN_ANIMATION_SLAM_COUNTER_START:
this->animationIndex++;
SubS_ChangeAnimationByInfoS(&this->skelAnime, animations, this->animationIndex);
case FSN_ANIM_HANDS_ON_COUNTER_START:
case FSN_ANIM_HAND_ON_FACE_START:
case FSN_ANIM_LEAN_FORWARD_START:
case FSN_ANIM_SLAM_COUNTER_START:
this->animIndex++;
SubS_ChangeAnimationByInfoS(&this->skelAnime, animationInfo, this->animIndex);
Message_StartTextbox(play, this->textId, &this->actor);
EnOssan_SetupStartShopping(play, this, false);
break;
case FSN_ANIMATION_HANDS_ON_COUNTER_LOOP:
case FSN_ANIMATION_HAND_ON_FACE_LOOP:
case FSN_ANIMATION_LEAN_FORWARD_LOOP:
case FSN_ANIMATION_SLAM_COUNTER_LOOP:
this->animationIndex = FSN_ANIMATION_TURN_AROUND_REVERSE;
SubS_ChangeAnimationByInfoS(&this->skelAnime, animations, FSN_ANIMATION_TURN_AROUND_REVERSE);
case FSN_ANIM_HANDS_ON_COUNTER_LOOP:
case FSN_ANIM_HAND_ON_FACE_LOOP:
case FSN_ANIM_LEAN_FORWARD_LOOP:
case FSN_ANIM_SLAM_COUNTER_LOOP:
this->animIndex = FSN_ANIM_TURN_AROUND_REVERSE;
SubS_ChangeAnimationByInfoS(&this->skelAnime, animationInfo, FSN_ANIM_TURN_AROUND_REVERSE);
break;
case FSN_ANIMATION_TURN_AROUND_REVERSE:
this->animationIndex = FSN_ANIMATION_SCRATCH_BACK;
SubS_ChangeAnimationByInfoS(&this->skelAnime, animations, FSN_ANIMATION_SCRATCH_BACK);
case FSN_ANIM_TURN_AROUND_REVERSE:
this->animIndex = FSN_ANIM_SCRATCH_BACK;
SubS_ChangeAnimationByInfoS(&this->skelAnime, animationInfo, FSN_ANIM_SCRATCH_BACK);
EnOssan_SetupAction(this, EnOssan_Idle);
break;
default:
this->animationIndex = FSN_ANIMATION_SCRATCH_BACK;
SubS_ChangeAnimationByInfoS(&this->skelAnime, animations, FSN_ANIMATION_SCRATCH_BACK);
this->animIndex = FSN_ANIM_SCRATCH_BACK;
SubS_ChangeAnimationByInfoS(&this->skelAnime, animationInfo, FSN_ANIM_SCRATCH_BACK);
EnOssan_SetupAction(this, EnOssan_Idle);
break;
}
@@ -557,16 +557,16 @@ u8 EnOssan_CursorLeft(EnOssan* this, u8 cursorIdx, u8 shelfSlotMax) {
}
void EnOssan_Hello(EnOssan* this, PlayState* play) {
AnimationInfoS* animations = sAnimations[this->actor.params];
AnimationInfoS* animationInfo = sAnimationInfo[this->actor.params];
u8 talkState = Message_GetState(&play->msgCtx);
s32 pad;
Player* player = GET_PLAYER(play);
EnOssan_RotateHead(this, play);
if ((talkState == TEXT_STATE_5) && Message_ShouldAdvance(play)) {
if ((this->animationIndex == ANI_ANIMATION_APOLOGY_LOOP) && (this->actor.params == ENOSSAN_PART_TIME_WORKER)) {
this->animationIndex = ANI_ANIMATION_STANDING_NORMAL_LOOP_2;
SubS_ChangeAnimationByInfoS(&this->skelAnime, animations, 1);
if ((this->animIndex == ANI_ANIM_APOLOGY_LOOP) && (this->actor.params == ENOSSAN_PART_TIME_WORKER)) {
this->animIndex = ANI_ANIM_STANDING_NORMAL_LOOP_2;
SubS_ChangeAnimationByInfoS(&this->skelAnime, animationInfo, 1);
}
this->flags &= ~LOOKED_AT_PLAYER;
if (player->transformation == PLAYER_FORM_DEKU) {
@@ -582,24 +582,24 @@ void EnOssan_Hello(EnOssan* this, PlayState* play) {
}
if ((talkState == TEXT_STATE_10) && (this->actor.params == ENOSSAN_PART_TIME_WORKER) &&
(player->transformation == PLAYER_FORM_ZORA) && Message_ShouldAdvance(play)) {
this->animationIndex = ANI_ANIMATION_APOLOGY_LOOP;
SubS_ChangeAnimationByInfoS(&this->skelAnime, animations, ANI_ANIMATION_APOLOGY_LOOP);
this->animIndex = ANI_ANIM_APOLOGY_LOOP;
SubS_ChangeAnimationByInfoS(&this->skelAnime, animationInfo, ANI_ANIM_APOLOGY_LOOP);
}
if ((this->animationIndex == FSN_ANIMATION_SLAM_COUNTER_LOOP) && Animation_OnFrame(&this->skelAnime, 18.0f)) {
if ((this->animIndex == FSN_ANIM_SLAM_COUNTER_LOOP) && Animation_OnFrame(&this->skelAnime, 18.0f)) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_HANKO);
}
}
s32 EnOssan_FacingShopkeeperDialogResult(EnOssan* this, PlayState* play) {
AnimationInfoS* animations = sAnimations[this->actor.params];
AnimationInfoS* animationInfo = sAnimationInfo[this->actor.params];
Player* player = GET_PLAYER(play);
switch (play->msgCtx.choiceIndex) {
case 0:
func_8019F208();
if ((this->actor.params == ENOSSAN_PART_TIME_WORKER) && (player->transformation == PLAYER_FORM_ZORA)) {
this->animationIndex = ANI_ANIMATION_APOLOGY_LOOP;
SubS_ChangeAnimationByInfoS(&this->skelAnime, animations, 9);
this->animIndex = ANI_ANIM_APOLOGY_LOOP;
SubS_ChangeAnimationByInfoS(&this->skelAnime, animationInfo, 9);
}
EnOssan_SetupAction(this, EnOssan_TalkToShopkeeper);
func_80151938(play, sTalkOptionTextIds[this->actor.params]);
@@ -663,12 +663,12 @@ void EnOssan_FaceShopkeeper(EnOssan* this, PlayState* play) {
}
void EnOssan_TalkToShopkeeper(EnOssan* this, PlayState* play) {
AnimationInfoS* animations = sAnimations[this->actor.params];
AnimationInfoS* animationInfo = sAnimationInfo[this->actor.params];
if ((Message_GetState(&play->msgCtx) == TEXT_STATE_5) && Message_ShouldAdvance(play)) {
if ((this->animationIndex == ANI_ANIMATION_APOLOGY_LOOP) && (this->actor.params == ENOSSAN_PART_TIME_WORKER)) {
this->animationIndex = ANI_ANIMATION_STANDING_NORMAL_LOOP_2;
SubS_ChangeAnimationByInfoS(&this->skelAnime, animations, 1);
if ((this->animIndex == ANI_ANIM_APOLOGY_LOOP) && (this->actor.params == ENOSSAN_PART_TIME_WORKER)) {
this->animIndex = ANI_ANIM_STANDING_NORMAL_LOOP_2;
SubS_ChangeAnimationByInfoS(&this->skelAnime, animationInfo, 1);
}
EnOssan_StartShopping(play, this);
}
@@ -1379,31 +1379,31 @@ u16 EnOssan_CuriosityShopMan_GetWelcome(EnOssan* this, PlayState* play) {
u16 textId = Text_GetFaceReaction(play, 0x2F);
if (textId != 0) {
this->animationIndex = FSN_ANIMATION_HANDS_ON_COUNTER_START;
this->animIndex = FSN_ANIM_HANDS_ON_COUNTER_START;
this->flags |= END_INTERACTION;
return textId;
}
switch (player->transformation) {
case PLAYER_FORM_DEKU:
this->animationIndex = FSN_ANIMATION_SLAM_COUNTER_START;
this->animIndex = FSN_ANIM_SLAM_COUNTER_START;
if (gSaveContext.save.weekEventReg[18] & 0x10) {
return sWelcomeDekuTextIds[ENOSSAN_CURIOSITY_SHOP_MAN];
}
return sWelcomeDekuFirstTimeTextIds[ENOSSAN_CURIOSITY_SHOP_MAN];
case PLAYER_FORM_ZORA:
this->animationIndex = FSN_ANIMATION_LEAN_FORWARD_START;
this->animIndex = FSN_ANIM_LEAN_FORWARD_START;
if (gSaveContext.save.weekEventReg[18] & 8) {
return sWelcomeZoraTextIds[ENOSSAN_CURIOSITY_SHOP_MAN];
}
return sWelcomeZoraFirstTimeTextIds[ENOSSAN_CURIOSITY_SHOP_MAN];
case PLAYER_FORM_GORON:
this->animationIndex = FSN_ANIMATION_HAND_ON_FACE_START;
this->animIndex = FSN_ANIM_HAND_ON_FACE_START;
if (gSaveContext.save.weekEventReg[18] & 4) {
return sWelcomeGoronTextIds[ENOSSAN_CURIOSITY_SHOP_MAN];
}
return sWelcomeGoronFirstTimeTextIds[ENOSSAN_CURIOSITY_SHOP_MAN];
}
this->animationIndex = FSN_ANIMATION_HANDS_ON_COUNTER_START;
this->animIndex = FSN_ANIM_HANDS_ON_COUNTER_START;
return sWelcomeHumanTextIds[ENOSSAN_CURIOSITY_SHOP_MAN];
}
@@ -1526,8 +1526,8 @@ void EnOssan_InitShop(EnOssan* this, PlayState* play) {
this->shopItemSelectedTween = 0.0f;
Actor_SetScale(&this->actor, sActorScales[this->actor.params]);
this->animationIndex = 1; // FSN_ANIMATION_SCRATCH_BACK and ANI_ANIMATION_STANDING_NORMAL_LOOP_2
SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations[this->actor.params], 1);
this->animIndex = 1; // FSN_ANIM_SCRATCH_BACK and ANI_ANIM_STANDING_NORMAL_LOOP_2
SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo[this->actor.params], 1);
EnOssan_SpawnShopItems(this, play, shopItems);
this->blinkTimer = 20;
this->eyeTexIndex = 0;
@@ -56,7 +56,7 @@ typedef struct EnOssan {
/* 0x2F8 */ s16 limbRotTableZ[19];
/* 0x31E */ Vec3s jointTable[ENOSSAN_LIMB_MAX];
/* 0x390 */ Vec3s morphTable[ENOSSAN_LIMB_MAX];
/* 0x402 */ s16 animationIndex;
/* 0x402 */ s16 animIndex;
/* 0x404 */ Vec3s partTimerHeadRot;
/* 0x40A */ u16 flags;
} EnOssan; // size = 0x40C
+12 -12
View File
@@ -163,7 +163,7 @@ void EnOt_Init(Actor* thisx, PlayState* play) {
this->actor.colChkInfo.mass = MASS_IMMOVABLE;
this->actor.gravity = 0.0f;
SubS_FillCutscenesList(&this->actor, this->cutscenes, ARRAY_COUNT(this->cutscenes));
SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 0, &this->animIdx);
SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 0, &this->animIndex);
this->skelAnime.curFrame = Rand_ZeroOne() * this->skelAnime.endFrame;
this->lightNode = LightContext_InsertLight(play, &play->lightCtx, &this->lightInfo);
this->unk_744.r = 255;
@@ -300,7 +300,7 @@ void func_80B5BB38(Color_RGB8* arg0, Color_RGB8* arg1, f32 arg2) {
}
void func_80B5BDA8(EnOt* this, PlayState* play) {
SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 1, &this->animIdx);
SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 1, &this->animIndex);
SubS_FillCutscenesList(&this->actor, this->cutscenes, ARRAY_COUNT(this->cutscenes));
this->actionFunc = func_80B5BE04;
}
@@ -322,7 +322,7 @@ void func_80B5BE04(EnOt* this, PlayState* play) {
}
void func_80B5BE88(EnOt* this, PlayState* play) {
SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 1, &this->animIdx);
SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 1, &this->animIndex);
this->actionFunc = func_80B5BED4;
}
@@ -337,7 +337,7 @@ void func_80B5BED4(EnOt* this, PlayState* play) {
void func_80B5BF60(EnOt* this, PlayState* play) {
this->unk_32C |= 0x40;
SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 0, &this->animIdx);
SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 0, &this->animIndex);
this->actionFunc = func_80B5BFB8;
}
@@ -410,8 +410,8 @@ void func_80B5C25C(EnOt* this, PlayState* play) {
if ((this->unk_33C == 2) && (this->unk_32C & 0x80) && (this->unk_360->unk_32C & 0x80)) {
this->unk_32C |= 0x100;
this->unk_360->unk_32C |= 0x100;
SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 2, &this->animIdx);
SubS_ChangeAnimationBySpeedInfo(&this->unk_360->skelAnime, sAnimations, 2, &this->unk_360->animIdx);
SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 2, &this->animIndex);
SubS_ChangeAnimationBySpeedInfo(&this->unk_360->skelAnime, sAnimations, 2, &this->unk_360->animIndex);
this->actor.flags |= ACTOR_FLAG_8000000;
this->actor.flags &= ~(ACTOR_FLAG_1 | ACTOR_FLAG_8);
this->unk_360->actor.flags |= ACTOR_FLAG_8000000;
@@ -489,7 +489,7 @@ void func_80B5C64C(EnOt* this, PlayState* play) {
void func_80B5C684(EnOt* this, PlayState* play) {
this->actor.speedXZ = 0.0f;
SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 0, &this->animIdx);
SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 0, &this->animIndex);
this->actionFunc = func_80B5C6DC;
}
@@ -635,7 +635,7 @@ void func_80B5CCA0(EnOt* this, PlayState* play) {
}
void func_80B5CCF4(EnOt* this, PlayState* play) {
SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 0, &this->animIdx);
SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 0, &this->animIndex);
this->actionFunc = func_80B5CD40;
}
@@ -676,7 +676,7 @@ void func_80B5CD40(EnOt* this, PlayState* play) {
void func_80B5CE6C(EnOt* this, PlayState* play) {
this->unk_384 = 0;
this->unk_32C |= 0x20;
SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 0, &this->animIdx);
SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 0, &this->animIndex);
this->actionFunc = func_80B5CEC8;
}
@@ -731,7 +731,7 @@ void func_80B5CEC8(EnOt* this, PlayState* play) {
}
void func_80B5D114(EnOt* this, PlayState* play) {
SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 0, &this->animIdx);
SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 0, &this->animIndex);
this->actionFunc = func_80B5D160;
}
@@ -886,7 +886,7 @@ void func_80B5D648(EnOt* this, PlayState* play) {
this->actorPath.pointOffset.z = 0.0f;
this->actor.gravity = 0.0f;
this->actor.speedXZ = 0.0f;
SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 1, &this->animIdx);
SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 1, &this->animIndex);
this->actor.flags |= ACTOR_FLAG_8000000;
this->actor.flags &= ~(ACTOR_FLAG_1 | ACTOR_FLAG_8);
Flags_SetSwitch(play, ENOT_GET_3F80(&this->actor));
@@ -929,7 +929,7 @@ void EnOt_Update(Actor* thisx, PlayState* play) {
s32 pad;
EnOt* this = THIS;
if ((this->animIdx == 1) && Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
if ((this->animIndex == 1) && Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_SEAHORSE_SWIM);
}
+1 -1
View File
@@ -35,7 +35,7 @@ typedef struct EnOt {
/* 0x18C */ ColliderCylinder collider;
/* 0x1D8 */ Vec3s jointTable[19];
/* 0x24A */ Vec3s morphTable[19];
/* 0x2BC */ s32 animIdx;
/* 0x2BC */ s32 animIndex;
/* 0x2C0 */ ActorPathing actorPath;
/* 0x32C */ u16 unk_32C;
/* 0x330 */ Vec3f unk_330;
+22 -22
View File
@@ -105,7 +105,7 @@ static CollisionCheckInfoInit2 sColChkInfoInit2 = {
0, 0, 0, 0, MASS_IMMOVABLE,
};
static AnimationInfo sAnimations[] = {
static AnimationInfo sAnimationInfo[] = {
{ &object_pamera_Anim_0005BC, 1.0f, 0, 0.0f, ANIMMODE_LOOP, -4.0f },
{ &object_pamera_Anim_008AE0, 1.0f, 0, 0.0f, ANIMMODE_LOOP, -4.0f },
{ &object_pamera_Anim_008E38, 1.0f, 0, 0.0f, ANIMMODE_LOOP, -4.0f },
@@ -234,7 +234,7 @@ void EnPamera_Destroy(Actor* thisx, PlayState* play) {
void func_80BD8700(EnPamera* this) {
this->hideInisdeTimer = 0;
this->actor.flags &= ~ACTOR_FLAG_1;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 0);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 0);
this->actionFunc = func_80BD8758;
}
@@ -245,7 +245,7 @@ void func_80BD8758(EnPamera* this, PlayState* play) {
Camera_SetToTrackActor(Play_GetCamera(play, ActorCutscene_GetCurrentSubCamId(this->cutscenes[0])),
&this->actor);
this->actor.speedXZ = 1.5f;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 1);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 1);
this->actor.shape.rot.y = this->actor.home.rot.y;
this->actor.world.rot.y = this->actor.home.rot.y;
func_80BD9338(this, play);
@@ -254,7 +254,7 @@ void func_80BD8758(EnPamera* this, PlayState* play) {
ActorCutscene_SetIntentToPlay(this->cutscenes[0]);
} else {
this->actor.speedXZ = 1.5f;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 1);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 1);
this->actor.shape.rot.y = this->actor.home.rot.y;
this->actor.world.rot.y = this->actor.home.rot.y;
func_80BD9338(this, play);
@@ -276,7 +276,7 @@ void func_80BD8758(EnPamera* this, PlayState* play) {
void func_80BD8908(EnPamera* this) {
this->actor.draw = EnPamera_Draw;
this->actor.flags |= ACTOR_FLAG_1;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 1);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 1);
this->actionFunc = func_80BD8964;
}
@@ -289,14 +289,14 @@ void func_80BD8964(EnPamera* this, PlayState* play) {
if (Math_Vec3f_StepTo(&this->actor.world.pos, &vec, 1.0f) < 5.0f) {
this->actor.speedXZ = 1.5f;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 1);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 1);
gSaveContext.save.weekEventReg[59] |= 1;
func_80BD8B50(this);
}
}
void func_80BD8A38(EnPamera* this) {
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 1);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 1);
this->actionFunc = func_80BD8A7C;
}
@@ -343,14 +343,14 @@ void func_80BD8B70(EnPamera* this, PlayState* play) {
void func_80BD8CCC(EnPamera* this) {
this->hideInisdeTimer = 0;
this->actor.speedXZ = 0.0f;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 3);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 3);
this->actionFunc = func_80BD8D1C;
}
void func_80BD8D1C(EnPamera* this, PlayState* play) {
if (this->hideInisdeTimer++ > 200) {
this->actor.speedXZ = 1.5f;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 1);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 1);
func_80BD8D80(this);
}
}
@@ -386,14 +386,14 @@ void func_80BD8DB0(EnPamera* this, PlayState* play) {
void EnPamera_LookDownWell(EnPamera* this) {
func_80BD93CC(this, 1, 1);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 4);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 4);
this->actionFunc = func_80BD8F60;
}
void func_80BD8F60(EnPamera* this, PlayState* play) {
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0xA, 0x3000, 0x1000);
if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 2);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 2);
this->actor.speedXZ = 3.0f;
func_80BD93CC(this, 0, 0);
func_80BD8D80(this);
@@ -410,7 +410,7 @@ void func_80BD8FF0(EnPamera* this) {
pameraYaw = Math_Vec3f_Yaw(&pameraPos, &this->actor.world.pos);
this->actor.shape.rot.y = pameraYaw;
this->actor.world.rot.y = pameraYaw;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 3);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 3);
this->actionFunc = func_80BD909C;
}
@@ -749,7 +749,7 @@ void func_80BD9E78(EnPamera* this, PlayState* play) {
}
void func_80BD9E88(EnPamera* this) {
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 0);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 0);
this->unk_31E = 0;
this->setupFunc = func_80BD9ED0;
}
@@ -758,7 +758,7 @@ void func_80BD9ED0(EnPamera* this, PlayState* play) {
}
void func_80BD9EE0(EnPamera* this) {
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 5);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 5);
func_80BD93CC(this, 1, 0);
this->unk_31E = 1;
this->setupFunc = func_80BD9F3C;
@@ -775,14 +775,14 @@ void func_80BD9F3C(EnPamera* this, PlayState* play) {
if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
this->unk_31E = 0;
func_80BD93CC(this, 0, 0);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 6);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 6);
}
}
}
void func_80BDA038(EnPamera* this) {
func_80BD93CC(this, 0, 1);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 7);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 7);
this->unk_31E = 0;
this->setupFunc = func_80BDA090;
}
@@ -792,7 +792,7 @@ void func_80BDA090(EnPamera* this, PlayState* play) {
void func_80BDA0A0(EnPamera* this) {
func_80BD93CC(this, 0, 1);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 8);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 8);
this->unk_31E = 1;
this->setupFunc = func_80BDA0FC;
}
@@ -802,7 +802,7 @@ void func_80BDA0FC(EnPamera* this, PlayState* play) {
if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
this->unk_31E = 0;
func_80BD93CC(this, 0, 0);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 6);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 6);
}
}
}
@@ -810,7 +810,7 @@ void func_80BDA0FC(EnPamera* this, PlayState* play) {
void func_80BDA170(EnPamera* this) {
this->unk_31E = 1;
func_80BD93CC(this, 0, 1);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 9);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 9);
this->setupFunc = func_80BDA1C8;
}
@@ -823,7 +823,7 @@ void func_80BDA1C8(EnPamera* this, PlayState* play) {
if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
this->unk_31E = 0;
func_80BD93CC(this, 0, 0);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 10);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 10);
}
}
}
@@ -831,7 +831,7 @@ void func_80BDA1C8(EnPamera* this, PlayState* play) {
void func_80BDA288(EnPamera* this) {
this->unk_31E = 1;
func_80BD93CC(this, 0, 0);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 11);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 11);
this->setupFunc = func_80BDA2E0;
}
@@ -839,7 +839,7 @@ void func_80BDA2E0(EnPamera* this, PlayState* play) {
if (this->unk_31E == 1) {
if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
this->unk_31E = 0;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 12);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 12);
}
}
}

Some files were not shown because too many files have changed in this diff Show More