1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2024-12-04 08:46:07 +00:00

rename animation states as sequences

https://github.com/zeldaret/oot/pull/2289#discussion_r1837274923
This commit is contained in:
feacur 2024-11-12 01:00:29 +01:00
parent 810719dac3
commit b11a9e9942
2 changed files with 119 additions and 119 deletions

View file

@ -55,20 +55,20 @@ static ColliderCylinderInit sCylinderInit = {
static CollisionCheckInfoInit2 sColChkInfoInit = { 0, 0, 0, 0, MASS_IMMOVABLE }; static CollisionCheckInfoInit2 sColChkInfoInit = { 0, 0, 0, 0, MASS_IMMOVABLE };
typedef enum EnMdAnimState { typedef enum EnMdAnimSequence {
/* 0x0 */ ENMD_ANIM_STATE_NONE, // no animation sequence /* 0x0 */ ENMD_ANIM_SEQ_NONE,
/* 0x1 */ ENMD_ANIM_STATE_AKIMBO_TO_HALT, // hands on hips -> halt gesture /* 0x1 */ ENMD_ANIM_SEQ_AKIMBO_TO_HALT, // hands on hips -> halt gesture
/* 0x2 */ ENMD_ANIM_STATE_HALT_TO_CURIOUS, // halt gesture -> tilted head /* 0x2 */ ENMD_ANIM_SEQ_HALT_TO_CURIOUS, // halt gesture -> tilted head
/* 0x3 */ ENMD_ANIM_STATE_WALK_AWAY, // stop halt gesture -> start walking -> walking /* 0x3 */ ENMD_ANIM_SEQ_WALK_AWAY, // stop halt gesture -> start walking -> walking
/* 0x4 */ ENMD_ANIM_STATE_TWITCH_AKIMBO_UNUSED, // start walking -> hands on hips; never set /* 0x4 */ ENMD_ANIM_SEQ_TWITCH_AKIMBO_UNUSED, // start walking -> hands on hips; never set
/* 0x5 */ ENMD_ANIM_STATE_HALT_TO_AKIMBO, // halt gesture -> hands on hips /* 0x5 */ ENMD_ANIM_SEQ_HALT_TO_AKIMBO, // halt gesture -> hands on hips
/* 0x6 */ ENMD_ANIM_STATE_SURPRISE_TO_ANNOYED, // slightly raise arms from hips -> look away /* 0x6 */ ENMD_ANIM_SEQ_SURPRISE_TO_ANNOYED, // slightly raise arms from hips -> look away
/* 0x7 */ ENMD_ANIM_STATE_SURPRISE_TO_AKIMBO, // lower slightly raised arms to hips -> hands on hips /* 0x7 */ ENMD_ANIM_SEQ_SURPRISE_TO_AKIMBO, // lower slightly raised arms to hips -> hands on hips
/* 0x8 */ ENMD_ANIM_STATE_CURIOUS_TO_ANNOYED, // tilted head and *slam* -> looking away /* 0x8 */ ENMD_ANIM_SEQ_CURIOUS_TO_ANNOYED, // tilted head and *slam* -> looking away
/* 0x9 */ ENMD_ANIM_STATE_ANNOYED_TO_HALT, // looking away -> halt gesture /* 0x9 */ ENMD_ANIM_SEQ_ANNOYED_TO_HALT, // looking away -> halt gesture
/* 0xA */ ENMD_ANIM_STATE_AKIMBO_TO_ANNOYED, // hands on hips -> looking away /* 0xA */ ENMD_ANIM_SEQ_AKIMBO_TO_ANNOYED, // hands on hips -> looking away
/* 0xB */ ENMD_ANIM_STATE_STOP_WALKING // stop walking -> akimbo /* 0xB */ ENMD_ANIM_SEQ_STOP_WALKING // stop walking -> akimbo
} EnMdAnimState; } EnMdAnimSequence;
typedef enum EnMdAnimIndex { typedef enum EnMdAnimIndex {
/* 0 */ ENMD_ANIM_INDEX_AKIMBO_LOOP_IDLE, // hands on hips; default idle /* 0 */ ENMD_ANIM_INDEX_AKIMBO_LOOP_IDLE, // hands on hips; default idle
@ -114,47 +114,47 @@ void EnMd_ReverseAnimation(EnMd* this) {
this->skelAnime.playSpeed = -1.0f; this->skelAnime.playSpeed = -1.0f;
} }
void EnMd_UpdateAnimState_AkimboToHalt(EnMd* this) { void EnMd_UpdateAnimSequence_AkimboToHalt(EnMd* this) {
switch (this->animEntry) { switch (this->animSequenceEntry) {
case 0: case 0:
Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_INDEX_AKIMBO_TO_HALT); Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_INDEX_AKIMBO_TO_HALT);
this->animEntry++; this->animSequenceEntry++;
FALLTHROUGH; FALLTHROUGH;
case 1: case 1:
if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_INDEX_HALT_LOOP); Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_INDEX_HALT_LOOP);
this->animEntry++; this->animSequenceEntry++;
} }
break; break;
} }
} }
void EnMd_UpdateAnimState_HaltToCurious(EnMd* this) { void EnMd_UpdateAnimSequence_HaltToCurious(EnMd* this) {
switch (this->animEntry) { switch (this->animSequenceEntry) {
case 0: case 0:
Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_INDEX_HALT_TO_CURIOUS); Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_INDEX_HALT_TO_CURIOUS);
this->animEntry++; this->animSequenceEntry++;
FALLTHROUGH; FALLTHROUGH;
case 1: case 1:
if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_INDEX_CURIOUS_LOOP); Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_INDEX_CURIOUS_LOOP);
this->animEntry++; this->animSequenceEntry++;
} }
break; break;
} }
} }
void EnMd_UpdateAnimState_WalkAway(EnMd* this) { void EnMd_UpdateAnimSequence_WalkAway(EnMd* this) {
switch (this->animEntry) { switch (this->animSequenceEntry) {
case 0: case 0:
Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_INDEX_AKIMBO_TO_HALT); Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_INDEX_AKIMBO_TO_HALT);
EnMd_ReverseAnimation(this); EnMd_ReverseAnimation(this);
this->animEntry++; this->animSequenceEntry++;
FALLTHROUGH; FALLTHROUGH;
case 1: case 1:
if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_INDEX_AKIMBO_TO_WALK); Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_INDEX_AKIMBO_TO_WALK);
this->animEntry++; this->animSequenceEntry++;
} else { } else {
break; break;
} }
@ -162,228 +162,228 @@ void EnMd_UpdateAnimState_WalkAway(EnMd* this) {
case 2: case 2:
if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_INDEX_WALK_LOOP); Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_INDEX_WALK_LOOP);
this->animEntry++; this->animSequenceEntry++;
} }
break; break;
} }
} }
void EnMd_UpdateAnimState_TwitchAkimbo_Unused(EnMd* this) { void EnMd_UpdateAnimSequence_TwitchAkimbo_Unused(EnMd* this) {
switch (this->animEntry) { switch (this->animSequenceEntry) {
case 0: case 0:
Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_INDEX_AKIMBO_TO_WALK); Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_INDEX_AKIMBO_TO_WALK);
this->animEntry++; this->animSequenceEntry++;
FALLTHROUGH; FALLTHROUGH;
case 1: case 1:
if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_INDEX_AKIMBO_LOOP); Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_INDEX_AKIMBO_LOOP);
this->animEntry++; this->animSequenceEntry++;
} }
break; break;
} }
} }
void EnMd_UpdateAnimState_HaltToAkimbo(EnMd* this) { void EnMd_UpdateAnimSequence_HaltToAkimbo(EnMd* this) {
switch (this->animEntry) { switch (this->animSequenceEntry) {
case 0: case 0:
Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_INDEX_AKIMBO_TO_HALT); Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_INDEX_AKIMBO_TO_HALT);
EnMd_ReverseAnimation(this); EnMd_ReverseAnimation(this);
this->animEntry++; this->animSequenceEntry++;
FALLTHROUGH; FALLTHROUGH;
case 1: case 1:
if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_INDEX_AKIMBO_LOOP); Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_INDEX_AKIMBO_LOOP);
this->animEntry++; this->animSequenceEntry++;
} }
break; break;
} }
} }
void EnMd_UpdateAnimState_SurpriseToAnnoyed(EnMd* this) { void EnMd_UpdateAnimSequence_SurpriseToAnnoyed(EnMd* this) {
switch (this->animEntry) { switch (this->animSequenceEntry) {
case 0: case 0:
Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_INDEX_AKIMBO_TO_SURPISE); Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_INDEX_AKIMBO_TO_SURPISE);
this->animEntry++; this->animSequenceEntry++;
FALLTHROUGH; FALLTHROUGH;
case 1: case 1:
if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_INDEX_ANNOYED_LOOP); Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_INDEX_ANNOYED_LOOP);
this->animEntry++; this->animSequenceEntry++;
} }
break; break;
} }
} }
void EnMd_UpdateAnimState_SurpriseToAkimbo(EnMd* this) { void EnMd_UpdateAnimSequence_SurpriseToAkimbo(EnMd* this) {
switch (this->animEntry) { switch (this->animSequenceEntry) {
case 0: case 0:
Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_INDEX_AKIMBO_TO_SURPISE); Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_INDEX_AKIMBO_TO_SURPISE);
EnMd_ReverseAnimation(this); EnMd_ReverseAnimation(this);
this->animEntry++; this->animSequenceEntry++;
FALLTHROUGH; FALLTHROUGH;
case 1: case 1:
if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_INDEX_AKIMBO_LOOP); Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_INDEX_AKIMBO_LOOP);
this->animEntry++; this->animSequenceEntry++;
} }
break; break;
} }
} }
void EnMd_UpdateAnimState_CuriousToAnnoyed(EnMd* this) { void EnMd_UpdateAnimSequence_CuriousToAnnoyed(EnMd* this) {
switch (this->animEntry) { switch (this->animSequenceEntry) {
case 0: case 0:
Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_INDEX_CURIOUS_TO_ANNOYED); Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_INDEX_CURIOUS_TO_ANNOYED);
this->animEntry++; this->animSequenceEntry++;
FALLTHROUGH; FALLTHROUGH;
case 1: case 1:
if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_INDEX_ANNOYED_LOOP); Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_INDEX_ANNOYED_LOOP);
this->animEntry++; this->animSequenceEntry++;
} }
break; break;
} }
} }
void EnMd_UpdateAnimState_AnnoyedToHalt(EnMd* this) { void EnMd_UpdateAnimSequence_AnnoyedToHalt(EnMd* this) {
switch (this->animEntry) { switch (this->animSequenceEntry) {
case 0: case 0:
Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_INDEX_ANNOYED_TO_HALT); Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_INDEX_ANNOYED_TO_HALT);
this->animEntry++; this->animSequenceEntry++;
FALLTHROUGH; FALLTHROUGH;
case 1: case 1:
if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_INDEX_HALT_LOOP); Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_INDEX_HALT_LOOP);
this->animEntry++; this->animSequenceEntry++;
} }
break; break;
} }
} }
void EnMd_UpdateAnimState_AkimboToAnnoyed(EnMd* this) { void EnMd_UpdateAnimSequence_AkimboToAnnoyed(EnMd* this) {
switch (this->animEntry) { switch (this->animSequenceEntry) {
case 0: case 0:
Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_INDEX_AKIMBO_TO_ANNOYED); Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_INDEX_AKIMBO_TO_ANNOYED);
this->animEntry++; this->animSequenceEntry++;
FALLTHROUGH; FALLTHROUGH;
case 1: case 1:
if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_INDEX_ANNOYED_LOOP); Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_INDEX_ANNOYED_LOOP);
this->animEntry++; this->animSequenceEntry++;
} }
break; break;
} }
} }
void EnMd_UpdateAnimState_StopWalking(EnMd* this) { void EnMd_UpdateAnimSequence_StopWalking(EnMd* this) {
switch (this->animEntry) { switch (this->animSequenceEntry) {
case 0: case 0:
Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_INDEX_AKIMBO_TO_WALK); Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_INDEX_AKIMBO_TO_WALK);
EnMd_ReverseAnimation(this); EnMd_ReverseAnimation(this);
this->animEntry++; this->animSequenceEntry++;
FALLTHROUGH; FALLTHROUGH;
case 1: case 1:
if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_INDEX_AKIMBO_LOOP); Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_INDEX_AKIMBO_LOOP);
this->animEntry++; this->animSequenceEntry++;
} }
break; break;
} }
} }
void EnMd_SetAnimState(EnMd* this, u8 state) { void EnMd_SetAnimState(EnMd* this, u8 state) {
this->animState = state; this->animSequence = state;
this->animEntry = 0; this->animSequenceEntry = 0;
} }
void EnMd_UpdateAnimState(EnMd* this) { void EnMd_UpdateAnimSequence(EnMd* this) {
switch (this->animState) { switch (this->animSequence) {
case ENMD_ANIM_STATE_AKIMBO_TO_HALT: case ENMD_ANIM_SEQ_AKIMBO_TO_HALT:
EnMd_UpdateAnimState_AkimboToHalt(this); EnMd_UpdateAnimSequence_AkimboToHalt(this);
break; break;
case ENMD_ANIM_STATE_HALT_TO_CURIOUS: case ENMD_ANIM_SEQ_HALT_TO_CURIOUS:
EnMd_UpdateAnimState_HaltToCurious(this); EnMd_UpdateAnimSequence_HaltToCurious(this);
break; break;
case ENMD_ANIM_STATE_WALK_AWAY: case ENMD_ANIM_SEQ_WALK_AWAY:
EnMd_UpdateAnimState_WalkAway(this); EnMd_UpdateAnimSequence_WalkAway(this);
break; break;
case ENMD_ANIM_STATE_TWITCH_AKIMBO_UNUSED: case ENMD_ANIM_SEQ_TWITCH_AKIMBO_UNUSED:
// unreachable // unreachable
EnMd_UpdateAnimState_TwitchAkimbo_Unused(this); EnMd_UpdateAnimSequence_TwitchAkimbo_Unused(this);
break; break;
case ENMD_ANIM_STATE_HALT_TO_AKIMBO: case ENMD_ANIM_SEQ_HALT_TO_AKIMBO:
EnMd_UpdateAnimState_HaltToAkimbo(this); EnMd_UpdateAnimSequence_HaltToAkimbo(this);
break; break;
case ENMD_ANIM_STATE_SURPRISE_TO_ANNOYED: case ENMD_ANIM_SEQ_SURPRISE_TO_ANNOYED:
EnMd_UpdateAnimState_SurpriseToAnnoyed(this); EnMd_UpdateAnimSequence_SurpriseToAnnoyed(this);
break; break;
case ENMD_ANIM_STATE_SURPRISE_TO_AKIMBO: case ENMD_ANIM_SEQ_SURPRISE_TO_AKIMBO:
EnMd_UpdateAnimState_SurpriseToAkimbo(this); EnMd_UpdateAnimSequence_SurpriseToAkimbo(this);
break; break;
case ENMD_ANIM_STATE_CURIOUS_TO_ANNOYED: case ENMD_ANIM_SEQ_CURIOUS_TO_ANNOYED:
EnMd_UpdateAnimState_CuriousToAnnoyed(this); EnMd_UpdateAnimSequence_CuriousToAnnoyed(this);
break; break;
case ENMD_ANIM_STATE_ANNOYED_TO_HALT: case ENMD_ANIM_SEQ_ANNOYED_TO_HALT:
EnMd_UpdateAnimState_AnnoyedToHalt(this); EnMd_UpdateAnimSequence_AnnoyedToHalt(this);
break; break;
case ENMD_ANIM_STATE_AKIMBO_TO_ANNOYED: case ENMD_ANIM_SEQ_AKIMBO_TO_ANNOYED:
EnMd_UpdateAnimState_AkimboToAnnoyed(this); EnMd_UpdateAnimSequence_AkimboToAnnoyed(this);
break; break;
case ENMD_ANIM_STATE_STOP_WALKING: case ENMD_ANIM_SEQ_STOP_WALKING:
EnMd_UpdateAnimState_StopWalking(this); EnMd_UpdateAnimSequence_StopWalking(this);
} }
} }
void EnMd_UpdateAnimState_WithTalking(EnMd* this) { void EnMd_UpdateAnimSequence_WithTalking(EnMd* this) {
if (this->interactInfo.talkState != NPC_TALK_STATE_IDLE) { if (this->interactInfo.talkState != NPC_TALK_STATE_IDLE) {
switch (this->actor.textId) { switch (this->actor.textId) {
case 0x102F: case 0x102F:
if ((this->messageEntry == 0) && (this->animState != ENMD_ANIM_STATE_AKIMBO_TO_HALT)) { if ((this->messageEntry == 0) && (this->animSequence != ENMD_ANIM_SEQ_AKIMBO_TO_HALT)) {
EnMd_SetAnimState(this, ENMD_ANIM_STATE_AKIMBO_TO_HALT); EnMd_SetAnimState(this, ENMD_ANIM_SEQ_AKIMBO_TO_HALT);
} }
if ((this->messageEntry == 2) && (this->animState != ENMD_ANIM_STATE_HALT_TO_CURIOUS)) { if ((this->messageEntry == 2) && (this->animSequence != ENMD_ANIM_SEQ_HALT_TO_CURIOUS)) {
EnMd_SetAnimState(this, ENMD_ANIM_STATE_HALT_TO_CURIOUS); EnMd_SetAnimState(this, ENMD_ANIM_SEQ_HALT_TO_CURIOUS);
} }
if ((this->messageEntry == 5) && (this->animState != ENMD_ANIM_STATE_CURIOUS_TO_ANNOYED)) { if ((this->messageEntry == 5) && (this->animSequence != ENMD_ANIM_SEQ_CURIOUS_TO_ANNOYED)) {
EnMd_SetAnimState(this, ENMD_ANIM_STATE_CURIOUS_TO_ANNOYED); EnMd_SetAnimState(this, ENMD_ANIM_SEQ_CURIOUS_TO_ANNOYED);
} }
if ((this->messageEntry == 11) && (this->animState != ENMD_ANIM_STATE_ANNOYED_TO_HALT)) { if ((this->messageEntry == 11) && (this->animSequence != ENMD_ANIM_SEQ_ANNOYED_TO_HALT)) {
EnMd_SetAnimState(this, ENMD_ANIM_STATE_ANNOYED_TO_HALT); EnMd_SetAnimState(this, ENMD_ANIM_SEQ_ANNOYED_TO_HALT);
} }
break; break;
case 0x1033: case 0x1033:
if ((this->messageEntry == 0) && (this->animState != ENMD_ANIM_STATE_AKIMBO_TO_HALT)) { if ((this->messageEntry == 0) && (this->animSequence != ENMD_ANIM_SEQ_AKIMBO_TO_HALT)) {
EnMd_SetAnimState(this, ENMD_ANIM_STATE_AKIMBO_TO_HALT); EnMd_SetAnimState(this, ENMD_ANIM_SEQ_AKIMBO_TO_HALT);
} }
if ((this->messageEntry == 1) && (this->animState != ENMD_ANIM_STATE_HALT_TO_CURIOUS)) { if ((this->messageEntry == 1) && (this->animSequence != ENMD_ANIM_SEQ_HALT_TO_CURIOUS)) {
EnMd_SetAnimState(this, ENMD_ANIM_STATE_HALT_TO_CURIOUS); EnMd_SetAnimState(this, ENMD_ANIM_SEQ_HALT_TO_CURIOUS);
} }
if ((this->messageEntry == 5) && (this->animState != ENMD_ANIM_STATE_AKIMBO_TO_ANNOYED)) { if ((this->messageEntry == 5) && (this->animSequence != ENMD_ANIM_SEQ_AKIMBO_TO_ANNOYED)) {
EnMd_SetAnimState(this, ENMD_ANIM_STATE_AKIMBO_TO_ANNOYED); EnMd_SetAnimState(this, ENMD_ANIM_SEQ_AKIMBO_TO_ANNOYED);
} }
if ((this->messageEntry == 7) && (this->animState != ENMD_ANIM_STATE_ANNOYED_TO_HALT)) { if ((this->messageEntry == 7) && (this->animSequence != ENMD_ANIM_SEQ_ANNOYED_TO_HALT)) {
EnMd_SetAnimState(this, ENMD_ANIM_STATE_ANNOYED_TO_HALT); EnMd_SetAnimState(this, ENMD_ANIM_SEQ_ANNOYED_TO_HALT);
} }
break; break;
case 0x1030: case 0x1030:
case 0x1034: case 0x1034:
case 0x1045: case 0x1045:
if ((this->messageEntry == 0) && (this->animState != ENMD_ANIM_STATE_AKIMBO_TO_HALT)) { if ((this->messageEntry == 0) && (this->animSequence != ENMD_ANIM_SEQ_AKIMBO_TO_HALT)) {
EnMd_SetAnimState(this, ENMD_ANIM_STATE_AKIMBO_TO_HALT); EnMd_SetAnimState(this, ENMD_ANIM_SEQ_AKIMBO_TO_HALT);
} }
break; break;
case 0x1046: case 0x1046:
if ((this->messageEntry == 0) && (this->animState != ENMD_ANIM_STATE_SURPRISE_TO_ANNOYED)) { if ((this->messageEntry == 0) && (this->animSequence != ENMD_ANIM_SEQ_SURPRISE_TO_ANNOYED)) {
EnMd_SetAnimState(this, ENMD_ANIM_STATE_SURPRISE_TO_ANNOYED); EnMd_SetAnimState(this, ENMD_ANIM_SEQ_SURPRISE_TO_ANNOYED);
} }
break; break;
} }
} else if (this->skelAnime.animation != &gMidoAkimboLoopAnim) { } else if (this->skelAnime.animation != &gMidoAkimboLoopAnim) {
Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_INDEX_AKIMBO_LOOP); Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_INDEX_AKIMBO_LOOP);
EnMd_SetAnimState(this, ENMD_ANIM_STATE_NONE); EnMd_SetAnimState(this, ENMD_ANIM_SEQ_NONE);
} }
EnMd_UpdateAnimState(this); EnMd_UpdateAnimSequence(this);
} }
s16 EnMd_TrackMessageState(EnMd* this, PlayState* play) { s16 EnMd_TrackMessageState(EnMd* this, PlayState* play) {
@ -713,18 +713,18 @@ void EnMd_Idle(EnMd* this, PlayState* play) {
if (this->skelAnime.animation == &gMidoAkimboLoopAnim) { if (this->skelAnime.animation == &gMidoAkimboLoopAnim) {
func_80034F54(play, this->unk_214, this->unk_236, ENMD_LIMB_MAX); func_80034F54(play, this->unk_214, this->unk_236, ENMD_LIMB_MAX);
} else if ((this->interactInfo.talkState == NPC_TALK_STATE_IDLE) && } else if ((this->interactInfo.talkState == NPC_TALK_STATE_IDLE) &&
(this->animState != ENMD_ANIM_STATE_SURPRISE_TO_AKIMBO)) { (this->animSequence != ENMD_ANIM_SEQ_SURPRISE_TO_AKIMBO)) {
EnMd_SetAnimState(this, ENMD_ANIM_STATE_SURPRISE_TO_AKIMBO); EnMd_SetAnimState(this, ENMD_ANIM_SEQ_SURPRISE_TO_AKIMBO);
} }
EnMd_UpdateAnimState_WithTalking(this); EnMd_UpdateAnimSequence_WithTalking(this);
} }
void EnMd_Watch(EnMd* this, PlayState* play) { void EnMd_Watch(EnMd* this, PlayState* play) {
if (this->skelAnime.animation == &gMidoAkimboLoopAnim) { if (this->skelAnime.animation == &gMidoAkimboLoopAnim) {
func_80034F54(play, this->unk_214, this->unk_236, ENMD_LIMB_MAX); func_80034F54(play, this->unk_214, this->unk_236, ENMD_LIMB_MAX);
} }
EnMd_UpdateAnimState(this); EnMd_UpdateAnimSequence(this);
} }
void EnMd_BlockPath(EnMd* this, PlayState* play) { void EnMd_BlockPath(EnMd* this, PlayState* play) {
@ -733,7 +733,7 @@ void EnMd_BlockPath(EnMd* this, PlayState* play) {
Actor* actorToBlock = &GET_PLAYER(play)->actor; Actor* actorToBlock = &GET_PLAYER(play)->actor;
s16 yaw; s16 yaw;
EnMd_UpdateAnimState_WithTalking(this); EnMd_UpdateAnimSequence_WithTalking(this);
if (this->interactInfo.talkState == NPC_TALK_STATE_IDLE) { if (this->interactInfo.talkState == NPC_TALK_STATE_IDLE) {
this->actor.world.rot.y = this->actor.yawTowardsPlayer; this->actor.world.rot.y = this->actor.yawTowardsPlayer;
@ -764,8 +764,8 @@ void EnMd_BlockPath(EnMd* this, PlayState* play) {
SET_EVENTCHKINF(EVENTCHKINF_0A); SET_EVENTCHKINF(EVENTCHKINF_0A);
} }
EnMd_SetAnimState(this, ENMD_ANIM_STATE_WALK_AWAY); EnMd_SetAnimState(this, ENMD_ANIM_SEQ_WALK_AWAY);
EnMd_UpdateAnimState(this); EnMd_UpdateAnimSequence(this);
this->waypoint = 1; this->waypoint = 1;
this->interactInfo.talkState = NPC_TALK_STATE_IDLE; this->interactInfo.talkState = NPC_TALK_STATE_IDLE;
this->actionFunc = EnMd_Walk; this->actionFunc = EnMd_Walk;
@ -813,7 +813,7 @@ void EnMd_ListenToOcarina(EnMd* this, PlayState* play) {
void EnMd_Walk(EnMd* this, PlayState* play) { void EnMd_Walk(EnMd* this, PlayState* play) {
func_80034F54(play, this->unk_214, this->unk_236, ENMD_LIMB_MAX); func_80034F54(play, this->unk_214, this->unk_236, ENMD_LIMB_MAX);
EnMd_UpdateAnimState(this); EnMd_UpdateAnimSequence(this);
if (!(EnMd_FollowPath(this, play)) || (this->waypoint != 0)) { if (!(EnMd_FollowPath(this, play)) || (this->waypoint != 0)) {
this->actor.shape.rot = this->actor.world.rot; this->actor.shape.rot = this->actor.world.rot;
@ -828,7 +828,7 @@ void EnMd_Walk(EnMd* this, PlayState* play) {
return; return;
} }
EnMd_SetAnimState(this, ENMD_ANIM_STATE_STOP_WALKING); EnMd_SetAnimState(this, ENMD_ANIM_SEQ_STOP_WALKING);
this->skelAnime.playSpeed = 0.0f; this->skelAnime.playSpeed = 0.0f;
this->actor.speed = 0.0f; this->actor.speed = 0.0f;

View file

@ -37,8 +37,8 @@ typedef struct EnMd {
/* 0x01E0 */ NpcInteractInfo interactInfo; /* 0x01E0 */ NpcInteractInfo interactInfo;
/* 0x0208 */ u8 messageEntry; // tracks message state changes, in place of `.actor.textId` /* 0x0208 */ u8 messageEntry; // tracks message state changes, in place of `.actor.textId`
/* 0x0209 */ u8 messageState; // last known result of `Message_GetState` /* 0x0209 */ u8 messageState; // last known result of `Message_GetState`
/* 0x020A */ u8 animEntry; // each one changes animation info and waits /* 0x020A */ u8 animSequenceEntry; // each one changes animation info and waits
/* 0x020B */ u8 animState; // defines a sequence of animation entries /* 0x020B */ u8 animSequence;
/* 0x020C */ s16 blinkTimer; /* 0x020C */ s16 blinkTimer;
/* 0x020E */ s16 eyeTexIndex; /* 0x020E */ s16 eyeTexIndex;
/* 0x0210 */ s16 alpha; /* 0x0210 */ s16 alpha;