1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2024-12-04 16:55:56 +00:00

Document struct EnMd fields (and functions)

the list:

* `func_80AAAC78` -> `EnMd_TrackMessageState`
* `func_80AAAA24` -> `EnMd_UpdateAnimState_WithTalking`

* `func_80AAA92C` -> `EnMd_SetAnimState`
* `func_80AAA93C` -> `EnMd_UpdateAnimState`
* `func_80AAA274` -> `EnMd_UpdateAnimState1`
* `func_80AAA308` -> `EnMd_UpdateAnimState2`
* `func_80AAA39C` -> `EnMd_UpdateAnimState3`
* `func_80AAA474` -> `EnMd_UpdateAnimState4`
* `func_80AAA508` -> `EnMd_UpdateAnimState5`
* `func_80AAA5A4` -> `EnMd_UpdateAnimState6`
* `func_80AAA638` -> `EnMd_UpdateAnimState7`
* `func_80AAA6D4` -> `EnMd_UpdateAnimState8`
* `func_80AAA768` -> `EnMd_UpdateAnimState9`
* `func_80AAA7FC` -> `EnMd_UpdateAnimState10`
* `func_80AAA890` -> `EnMd_UpdateAnimState11`
This commit is contained in:
feacur 2024-11-06 21:56:41 +01:00
parent 7749b03031
commit 844543e82e
2 changed files with 139 additions and 123 deletions

View file

@ -55,6 +55,21 @@ static ColliderCylinderInit sCylinderInit = {
static CollisionCheckInfoInit2 sColChkInfoInit = { 0, 0, 0, 0, MASS_IMMOVABLE }; static CollisionCheckInfoInit2 sColChkInfoInit = { 0, 0, 0, 0, MASS_IMMOVABLE };
typedef enum EnMdAnimState {
/* 0x0 */ ENMD_ANIM_STATE_0,
/* 0x1 */ ENMD_ANIM_STATE_1,
/* 0x2 */ ENMD_ANIM_STATE_2,
/* 0x3 */ ENMD_ANIM_STATE_3,
/* 0x4 */ ENMD_ANIM_STATE_4, // never set
/* 0x5 */ ENMD_ANIM_STATE_5,
/* 0x6 */ ENMD_ANIM_STATE_6,
/* 0x7 */ ENMD_ANIM_STATE_7,
/* 0x8 */ ENMD_ANIM_STATE_8,
/* 0x9 */ ENMD_ANIM_STATE_9,
/* 0xA */ ENMD_ANIM_STATE_A,
/* 0xB */ ENMD_ANIM_STATE_B
} EnMdAnimState;
typedef enum EnMdAnimIndex { typedef enum EnMdAnimIndex {
/* 0 */ ENMD_ANIM_INDEX_HAND_ON_HIPS_IDLE_V1, /* 0 */ ENMD_ANIM_INDEX_HAND_ON_HIPS_IDLE_V1,
/* 1 */ ENMD_ANIM_INDEX_HAND_ON_HIPS_IDLE_V2, /* 1 */ ENMD_ANIM_INDEX_HAND_ON_HIPS_IDLE_V2,
@ -99,47 +114,47 @@ void EnMd_ReverseAnimation(EnMd* this) {
this->skelAnime.playSpeed = -1.0f; this->skelAnime.playSpeed = -1.0f;
} }
void func_80AAA274(EnMd* this) { void EnMd_UpdateAnimState1(EnMd* this) {
switch (this->unk_20A) { switch (this->animEntry) {
case 0: case 0:
Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_INDEX_RAISE_HAND_1); Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_INDEX_RAISE_HAND_1);
this->unk_20A++; this->animEntry++;
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); Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_INDEX_HALT);
this->unk_20A++; this->animEntry++;
} }
break; break;
} }
} }
void func_80AAA308(EnMd* this) { void EnMd_UpdateAnimState2(EnMd* this) {
switch (this->unk_20A) { switch (this->animEntry) {
case 0: case 0:
Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_INDEX_PUT_HAND_DOWN); Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_INDEX_PUT_HAND_DOWN);
this->unk_20A++; this->animEntry++;
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_POINTED_HEAD_IDLE_1); Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_INDEX_ANNOYED_POINTED_HEAD_IDLE_1);
this->unk_20A++; this->animEntry++;
} }
break; break;
} }
} }
void func_80AAA39C(EnMd* this) { void EnMd_UpdateAnimState3(EnMd* this) {
switch (this->unk_20A) { switch (this->animEntry) {
case 0: case 0:
Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_INDEX_RAISE_HAND_1); Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_INDEX_RAISE_HAND_1);
EnMd_ReverseAnimation(this); EnMd_ReverseAnimation(this);
this->unk_20A++; this->animEntry++;
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_UNKNOWN_7); Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_INDEX_UNKNOWN_7);
this->unk_20A++; this->animEntry++;
} else { } else {
break; break;
} }
@ -147,241 +162,242 @@ void func_80AAA39C(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_WALKING); Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_INDEX_WALKING);
this->unk_20A++; this->animEntry++;
} }
break; break;
} }
} }
void func_80AAA474(EnMd* this) { void EnMd_UpdateAnimState4(EnMd* this) {
switch (this->unk_20A) { switch (this->animEntry) {
case 0: case 0:
Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_INDEX_UNKNOWN_7); Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_INDEX_UNKNOWN_7);
this->unk_20A++; this->animEntry++;
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_HAND_ON_HIPS_IDLE_V3); Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_INDEX_HAND_ON_HIPS_IDLE_V3);
this->unk_20A++; this->animEntry++;
} }
break; break;
} }
} }
void func_80AAA508(EnMd* this) { void EnMd_UpdateAnimState5(EnMd* this) {
switch (this->unk_20A) { switch (this->animEntry) {
case 0: case 0:
Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_INDEX_RAISE_HAND_1); Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_INDEX_RAISE_HAND_1);
EnMd_ReverseAnimation(this); EnMd_ReverseAnimation(this);
this->unk_20A++; this->animEntry++;
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_HAND_ON_HIPS_IDLE_V3); Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_INDEX_HAND_ON_HIPS_IDLE_V3);
this->unk_20A++; this->animEntry++;
} }
break; break;
} }
} }
void func_80AAA5A4(EnMd* this) { void EnMd_UpdateAnimState6(EnMd* this) {
switch (this->unk_20A) { switch (this->animEntry) {
case 0: case 0:
Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_INDEX_HIPS_ON_HIPS_TRANSITION); Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_INDEX_HIPS_ON_HIPS_TRANSITION);
this->unk_20A++; this->animEntry++;
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_POINTED_HEAD_IDLE_2); Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_INDEX_ANNOYED_POINTED_HEAD_IDLE_2);
this->unk_20A++; this->animEntry++;
} }
break; break;
} }
} }
void func_80AAA638(EnMd* this) { void EnMd_UpdateAnimState7(EnMd* this) {
switch (this->unk_20A) { switch (this->animEntry) {
case 0: case 0:
Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_INDEX_HIPS_ON_HIPS_TRANSITION); Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_INDEX_HIPS_ON_HIPS_TRANSITION);
EnMd_ReverseAnimation(this); EnMd_ReverseAnimation(this);
this->unk_20A++; this->animEntry++;
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_HAND_ON_HIPS_IDLE_V3); Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_INDEX_HAND_ON_HIPS_IDLE_V3);
this->unk_20A++; this->animEntry++;
} }
break; break;
} }
} }
void func_80AAA6D4(EnMd* this) { void EnMd_UpdateAnimState8(EnMd* this) {
switch (this->unk_20A) { switch (this->animEntry) {
case 0: case 0:
Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_INDEX_SLAM); Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_INDEX_SLAM);
this->unk_20A++; this->animEntry++;
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_POINTED_HEAD_IDLE_2); Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_INDEX_ANNOYED_POINTED_HEAD_IDLE_2);
this->unk_20A++; this->animEntry++;
} }
break; break;
} }
} }
void func_80AAA768(EnMd* this) { void EnMd_UpdateAnimState9(EnMd* this) {
switch (this->unk_20A) { switch (this->animEntry) {
case 0: case 0:
Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_INDEX_RAISE_HAND_2); Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_INDEX_RAISE_HAND_2);
this->unk_20A++; this->animEntry++;
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); Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_INDEX_HALT);
this->unk_20A++; this->animEntry++;
} }
break; break;
} }
} }
void func_80AAA7FC(EnMd* this) { void EnMd_UpdateAnimStateA(EnMd* this) {
switch (this->unk_20A) { switch (this->animEntry) {
case 0: case 0:
Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_INDEX_ANGRY_HEAD_TURN); Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_INDEX_ANGRY_HEAD_TURN);
this->unk_20A++; this->animEntry++;
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_POINTED_HEAD_IDLE_2); Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_INDEX_ANNOYED_POINTED_HEAD_IDLE_2);
this->unk_20A++; this->animEntry++;
} }
break; break;
} }
} }
void func_80AAA890(EnMd* this) { void EnMd_UpdateAnimStateB(EnMd* this) {
switch (this->unk_20A) { switch (this->animEntry) {
case 0: case 0:
Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_INDEX_UNKNOWN_7); Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_INDEX_UNKNOWN_7);
EnMd_ReverseAnimation(this); EnMd_ReverseAnimation(this);
this->unk_20A++; this->animEntry++;
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_HAND_ON_HIPS_IDLE_V3); Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_INDEX_HAND_ON_HIPS_IDLE_V3);
this->unk_20A++; this->animEntry++;
} }
break; break;
} }
} }
void func_80AAA92C(EnMd* this, u8 arg1) { void EnMd_SetAnimState(EnMd* this, u8 state) {
this->unk_20B = arg1; this->animState = state;
this->unk_20A = 0; this->animEntry = 0;
} }
void func_80AAA93C(EnMd* this) { void EnMd_UpdateAnimState(EnMd* this) {
switch (this->unk_20B) { switch (this->animState) {
case 1: case ENMD_ANIM_STATE_1:
func_80AAA274(this); EnMd_UpdateAnimState1(this);
break; break;
case 2: case ENMD_ANIM_STATE_2:
func_80AAA308(this); EnMd_UpdateAnimState2(this);
break; break;
case 3: case ENMD_ANIM_STATE_3:
func_80AAA39C(this); EnMd_UpdateAnimState3(this);
break; break;
case 4: case ENMD_ANIM_STATE_4:
func_80AAA474(this); // unreachable
EnMd_UpdateAnimState4(this);
break; break;
case 5: case ENMD_ANIM_STATE_5:
func_80AAA508(this); EnMd_UpdateAnimState5(this);
break; break;
case 6: case ENMD_ANIM_STATE_6:
func_80AAA5A4(this); EnMd_UpdateAnimState6(this);
break; break;
case 7: case ENMD_ANIM_STATE_7:
func_80AAA638(this); EnMd_UpdateAnimState7(this);
break; break;
case 8: case ENMD_ANIM_STATE_8:
func_80AAA6D4(this); EnMd_UpdateAnimState8(this);
break; break;
case 9: case ENMD_ANIM_STATE_9:
func_80AAA768(this); EnMd_UpdateAnimState9(this);
break; break;
case 10: case ENMD_ANIM_STATE_A:
func_80AAA7FC(this); EnMd_UpdateAnimStateA(this);
break; break;
case 11: case ENMD_ANIM_STATE_B:
func_80AAA890(this); EnMd_UpdateAnimStateB(this);
} }
} }
void func_80AAAA24(EnMd* this) { void EnMd_UpdateAnimState_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->unk_208 == 0) && (this->unk_20B != 1)) { if ((this->messageEntry == 0) && (this->animState != ENMD_ANIM_STATE_1)) {
func_80AAA92C(this, 1); EnMd_SetAnimState(this, ENMD_ANIM_STATE_1);
} }
if ((this->unk_208 == 2) && (this->unk_20B != 2)) { if ((this->messageEntry == 2) && (this->animState != ENMD_ANIM_STATE_2)) {
func_80AAA92C(this, 2); EnMd_SetAnimState(this, ENMD_ANIM_STATE_2);
} }
if ((this->unk_208 == 5) && (this->unk_20B != 8)) { if ((this->messageEntry == 5) && (this->animState != ENMD_ANIM_STATE_8)) {
func_80AAA92C(this, 8); EnMd_SetAnimState(this, ENMD_ANIM_STATE_8);
} }
if ((this->unk_208 == 11) && (this->unk_20B != 9)) { if ((this->messageEntry == 11) && (this->animState != ENMD_ANIM_STATE_9)) {
func_80AAA92C(this, 9); EnMd_SetAnimState(this, ENMD_ANIM_STATE_9);
} }
break; break;
case 0x1033: case 0x1033:
if ((this->unk_208 == 0) && (this->unk_20B != 1)) { if ((this->messageEntry == 0) && (this->animState != ENMD_ANIM_STATE_1)) {
func_80AAA92C(this, 1); EnMd_SetAnimState(this, ENMD_ANIM_STATE_1);
} }
if ((this->unk_208 == 1) && (this->unk_20B != 2)) { if ((this->messageEntry == 1) && (this->animState != ENMD_ANIM_STATE_2)) {
func_80AAA92C(this, 2); EnMd_SetAnimState(this, ENMD_ANIM_STATE_2);
} }
if ((this->unk_208 == 5) && (this->unk_20B != 10)) { if ((this->messageEntry == 5) && (this->animState != ENMD_ANIM_STATE_A)) {
func_80AAA92C(this, 10); EnMd_SetAnimState(this, ENMD_ANIM_STATE_A);
} }
if ((this->unk_208 == 7) && (this->unk_20B != 9)) { if ((this->messageEntry == 7) && (this->animState != ENMD_ANIM_STATE_9)) {
func_80AAA92C(this, 9); EnMd_SetAnimState(this, ENMD_ANIM_STATE_9);
} }
break; break;
case 0x1030: case 0x1030:
case 0x1034: case 0x1034:
case 0x1045: case 0x1045:
if ((this->unk_208 == 0) && (this->unk_20B != 1)) { if ((this->messageEntry == 0) && (this->animState != ENMD_ANIM_STATE_1)) {
func_80AAA92C(this, 1); EnMd_SetAnimState(this, ENMD_ANIM_STATE_1);
} }
break; break;
case 0x1046: case 0x1046:
if ((this->unk_208 == 0) && (this->unk_20B != 6)) { if ((this->messageEntry == 0) && (this->animState != ENMD_ANIM_STATE_6)) {
func_80AAA92C(this, 6); EnMd_SetAnimState(this, ENMD_ANIM_STATE_6);
} }
break; break;
} }
} else if (this->skelAnime.animation != &gMidoHandsOnHipsIdleAnim) { } else if (this->skelAnime.animation != &gMidoHandsOnHipsIdleAnim) {
Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_INDEX_HAND_ON_HIPS_IDLE_V3); Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_INDEX_HAND_ON_HIPS_IDLE_V3);
func_80AAA92C(this, 0); EnMd_SetAnimState(this, ENMD_ANIM_STATE_0);
} }
func_80AAA93C(this); EnMd_UpdateAnimState(this);
} }
s16 func_80AAAC78(EnMd* this, PlayState* play) { s16 EnMd_TrackMessageState(EnMd* this, PlayState* play) {
s16 dialogState = Message_GetState(&play->msgCtx); s16 messageState = Message_GetState(&play->msgCtx);
if ((this->unk_209 == TEXT_STATE_AWAITING_NEXT) || (this->unk_209 == TEXT_STATE_EVENT) || if ((this->messageState == TEXT_STATE_AWAITING_NEXT) || (this->messageState == TEXT_STATE_EVENT) ||
(this->unk_209 == TEXT_STATE_CLOSING) || (this->unk_209 == TEXT_STATE_DONE_HAS_NEXT)) { (this->messageState == TEXT_STATE_CLOSING) || (this->messageState == TEXT_STATE_DONE_HAS_NEXT)) {
if (this->unk_209 != dialogState) { if (this->messageState != messageState) {
this->unk_208++; this->messageEntry++;
} }
} }
this->unk_209 = dialogState; this->messageState = messageState;
return dialogState; return messageState;
} }
u16 EnMd_GetTextIdKokiriForest(PlayState* play, EnMd* this) { u16 EnMd_GetTextIdKokiriForest(PlayState* play, EnMd* this) {
@ -391,8 +407,8 @@ u16 EnMd_GetTextIdKokiriForest(PlayState* play, EnMd* this) {
return textId; return textId;
} }
this->unk_208 = 0; this->messageEntry = 0;
this->unk_209 = TEXT_STATE_NONE; this->messageState = TEXT_STATE_NONE;
if (CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD)) { if (CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD)) {
return 0x1045; return 0x1045;
@ -415,8 +431,8 @@ u16 EnMd_GetTextIdKokiriForest(PlayState* play, EnMd* this) {
} }
u16 EnMd_GetTextIdMidosHouse(PlayState* play, EnMd* this) { u16 EnMd_GetTextIdMidosHouse(PlayState* play, EnMd* this) {
this->unk_208 = 0; this->messageEntry = 0;
this->unk_209 = TEXT_STATE_NONE; this->messageState = TEXT_STATE_NONE;
if (GET_EVENTCHKINF(EVENTCHKINF_40)) { if (GET_EVENTCHKINF(EVENTCHKINF_40)) {
return 0x1028; return 0x1028;
@ -426,8 +442,8 @@ u16 EnMd_GetTextIdMidosHouse(PlayState* play, EnMd* this) {
} }
u16 EnMd_GetTextIdLostWoods(PlayState* play, EnMd* this) { u16 EnMd_GetTextIdLostWoods(PlayState* play, EnMd* this) {
this->unk_208 = 0; this->messageEntry = 0;
this->unk_209 = TEXT_STATE_NONE; this->messageState = TEXT_STATE_NONE;
if (GET_EVENTCHKINF(EVENTCHKINF_48)) { if (GET_EVENTCHKINF(EVENTCHKINF_48)) {
if (GET_INFTABLE(INFTABLE_19)) { if (GET_INFTABLE(INFTABLE_19)) {
@ -464,7 +480,7 @@ u16 EnMd_GetTextId(PlayState* play, Actor* thisx) {
s16 EnMd_UpdateTalkState(PlayState* play, Actor* thisx) { s16 EnMd_UpdateTalkState(PlayState* play, Actor* thisx) {
EnMd* this = (EnMd*)thisx; EnMd* this = (EnMd*)thisx;
switch (func_80AAAC78(this, play)) { switch (EnMd_TrackMessageState(this, play)) {
case TEXT_STATE_NONE: case TEXT_STATE_NONE:
case TEXT_STATE_DONE_HAS_NEXT: case TEXT_STATE_DONE_HAS_NEXT:
case TEXT_STATE_DONE_FADING: case TEXT_STATE_DONE_FADING:
@ -696,18 +712,18 @@ void EnMd_Destroy(Actor* thisx, PlayState* play) {
void func_80AAB874(EnMd* this, PlayState* play) { void func_80AAB874(EnMd* this, PlayState* play) {
if (this->skelAnime.animation == &gMidoHandsOnHipsIdleAnim) { if (this->skelAnime.animation == &gMidoHandsOnHipsIdleAnim) {
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) && (this->unk_20B != 7)) { } else if ((this->interactInfo.talkState == NPC_TALK_STATE_IDLE) && (this->animState != ENMD_ANIM_STATE_7)) {
func_80AAA92C(this, 7); EnMd_SetAnimState(this, ENMD_ANIM_STATE_7);
} }
func_80AAAA24(this); EnMd_UpdateAnimState_WithTalking(this);
} }
void func_80AAB8F8(EnMd* this, PlayState* play) { void func_80AAB8F8(EnMd* this, PlayState* play) {
if (this->skelAnime.animation == &gMidoHandsOnHipsIdleAnim) { if (this->skelAnime.animation == &gMidoHandsOnHipsIdleAnim) {
func_80034F54(play, this->unk_214, this->unk_236, ENMD_LIMB_MAX); func_80034F54(play, this->unk_214, this->unk_236, ENMD_LIMB_MAX);
} }
func_80AAA93C(this); EnMd_UpdateAnimState(this);
} }
void func_80AAB948(EnMd* this, PlayState* play) { void func_80AAB948(EnMd* this, PlayState* play) {
@ -716,7 +732,7 @@ void func_80AAB948(EnMd* this, PlayState* play) {
Actor* actorToBlock = &GET_PLAYER(play)->actor; Actor* actorToBlock = &GET_PLAYER(play)->actor;
s16 yaw; s16 yaw;
func_80AAAA24(this); EnMd_UpdateAnimState_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;
@ -747,8 +763,8 @@ void func_80AAB948(EnMd* this, PlayState* play) {
SET_EVENTCHKINF(EVENTCHKINF_0A); SET_EVENTCHKINF(EVENTCHKINF_0A);
} }
func_80AAA92C(this, 3); EnMd_SetAnimState(this, ENMD_ANIM_STATE_3);
func_80AAA93C(this); EnMd_UpdateAnimState(this);
this->waypoint = 1; this->waypoint = 1;
this->interactInfo.talkState = NPC_TALK_STATE_IDLE; this->interactInfo.talkState = NPC_TALK_STATE_IDLE;
this->actionFunc = func_80AABD0C; this->actionFunc = func_80AABD0C;
@ -796,7 +812,7 @@ void func_80AABC10(EnMd* this, PlayState* play) {
void func_80AABD0C(EnMd* this, PlayState* play) { void func_80AABD0C(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);
func_80AAA93C(this); EnMd_UpdateAnimState(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;
@ -811,7 +827,7 @@ void func_80AABD0C(EnMd* this, PlayState* play) {
return; return;
} }
func_80AAA92C(this, 11); EnMd_SetAnimState(this, ENMD_ANIM_STATE_B);
this->skelAnime.playSpeed = 0.0f; this->skelAnime.playSpeed = 0.0f;
this->actor.speed = 0.0f; this->actor.speed = 0.0f;

View file

@ -35,10 +35,10 @@ typedef struct EnMd {
/* 0x0190 */ EnMdActionFunc actionFunc; /* 0x0190 */ EnMdActionFunc actionFunc;
/* 0x0194 */ ColliderCylinder collider; /* 0x0194 */ ColliderCylinder collider;
/* 0x01E0 */ NpcInteractInfo interactInfo; /* 0x01E0 */ NpcInteractInfo interactInfo;
/* 0x0208 */ u8 unk_208; /* 0x0208 */ u8 messageEntry; // tracks message state changes, in place of `.actor.textId`
/* 0x0209 */ u8 unk_209; /* 0x0209 */ u8 messageState; // last known result of `Message_GetState`
/* 0x020A */ u8 unk_20A; /* 0x020A */ u8 animEntry; // each one changes animation info and waits
/* 0x020B */ u8 unk_20B; /* 0x020B */ u8 animState; // defines a sequence of animation entries
/* 0x020C */ s16 blinkTimer; /* 0x020C */ s16 blinkTimer;
/* 0x020E */ s16 eyeIdx; /* 0x020E */ s16 eyeIdx;
/* 0x0210 */ s16 alpha; /* 0x0210 */ s16 alpha;