mirror of
https://github.com/zeldaret/oot.git
synced 2024-11-11 03:39:59 +00:00
z_en_toryo
doc (#1441)
* `z_en_toryo` doc - named funcs and fields - clarified some values with enums - removed align bytes from struct * Update z_en_toryo.c `TalkAction` -> `Main` * Update z_en_toryo.c * Update z_en_toryo.c * Update z_en_toryo.c * Update z_en_toryo.c function name suggestions
This commit is contained in:
parent
be22b836f6
commit
1a20d0d76d
2 changed files with 34 additions and 35 deletions
|
@ -14,7 +14,7 @@ void EnToryo_Destroy(Actor* thisx, PlayState* play);
|
||||||
void EnToryo_Update(Actor* thisx, PlayState* play);
|
void EnToryo_Update(Actor* thisx, PlayState* play);
|
||||||
void EnToryo_Draw(Actor* thisx, PlayState* play);
|
void EnToryo_Draw(Actor* thisx, PlayState* play);
|
||||||
|
|
||||||
void func_80B20914(EnToryo* this, PlayState* play);
|
void EnToryo_Idle(EnToryo* this, PlayState* play);
|
||||||
s32 EnToryo_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void* thisx);
|
s32 EnToryo_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void* thisx);
|
||||||
void EnToryo_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, void* thisx);
|
void EnToryo_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, void* thisx);
|
||||||
|
|
||||||
|
@ -128,7 +128,7 @@ void EnToryo_Init(Actor* thisx, PlayState* play) {
|
||||||
sEnToryoAnimation.morphFrames);
|
sEnToryoAnimation.morphFrames);
|
||||||
this->stateFlags |= 8;
|
this->stateFlags |= 8;
|
||||||
this->actor.targetMode = 6;
|
this->actor.targetMode = 6;
|
||||||
this->actionFunc = func_80B20914;
|
this->actionFunc = EnToryo_Idle;
|
||||||
}
|
}
|
||||||
|
|
||||||
void EnToryo_Destroy(Actor* thisx, PlayState* play) {
|
void EnToryo_Destroy(Actor* thisx, PlayState* play) {
|
||||||
|
@ -137,7 +137,7 @@ void EnToryo_Destroy(Actor* thisx, PlayState* play) {
|
||||||
Collider_DestroyCylinder(play, &this->collider);
|
Collider_DestroyCylinder(play, &this->collider);
|
||||||
}
|
}
|
||||||
|
|
||||||
s32 func_80B203D8(EnToryo* this, PlayState* play) {
|
s32 EnToryo_TalkRespond(EnToryo* this, PlayState* play) {
|
||||||
s32 pad;
|
s32 pad;
|
||||||
Player* player = GET_PLAYER(play);
|
Player* player = GET_PLAYER(play);
|
||||||
s32 ret = 1;
|
s32 ret = 1;
|
||||||
|
@ -210,7 +210,7 @@ s32 func_80B203D8(EnToryo* this, PlayState* play) {
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
s32 func_80B205CC(EnToryo* this, PlayState* play) {
|
s32 EnToryo_DoneTalking(EnToryo* this, PlayState* play) {
|
||||||
s32 pad;
|
s32 pad;
|
||||||
Player* player = GET_PLAYER(play);
|
Player* player = GET_PLAYER(play);
|
||||||
s32 ret = 5;
|
s32 ret = 5;
|
||||||
|
@ -233,11 +233,11 @@ s32 func_80B205CC(EnToryo* this, PlayState* play) {
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
u32 func_80B20634(EnToryo* this, PlayState* play) {
|
u32 EnToryo_ReactToExchangeItem(EnToryo* this, PlayState* play) {
|
||||||
u32 ret;
|
u32 ret;
|
||||||
|
|
||||||
if (this->unk_1E0 != 0) {
|
if (this->exchangeItemId != EXCH_ITEM_NONE) {
|
||||||
if (this->unk_1E0 == 10) {
|
if (this->exchangeItemId == EXCH_ITEM_POACHERS_SAW) {
|
||||||
func_80078884(NA_SE_SY_TRE_BOX_APPEAR);
|
func_80078884(NA_SE_SY_TRE_BOX_APPEAR);
|
||||||
if (GET_INFTABLE(INFTABLE_171)) {
|
if (GET_INFTABLE(INFTABLE_171)) {
|
||||||
ret = 0x606E;
|
ret = 0x606E;
|
||||||
|
@ -252,7 +252,7 @@ u32 func_80B20634(EnToryo* this, PlayState* play) {
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
s32 func_80B206A0(EnToryo* this, PlayState* play) {
|
s32 EnToryo_GetTextId(EnToryo* this, PlayState* play) {
|
||||||
s32 textId = Text_GetFaceReaction(play, 0);
|
s32 textId = Text_GetFaceReaction(play, 0);
|
||||||
s32 ret = textId;
|
s32 ret = textId;
|
||||||
|
|
||||||
|
@ -281,64 +281,64 @@ s32 func_80B206A0(EnToryo* this, PlayState* play) {
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
void func_80B20768(EnToryo* this, PlayState* play) {
|
void EnToryo_HandleTalking(EnToryo* this, PlayState* play) {
|
||||||
Player* player = GET_PLAYER(play);
|
Player* player = GET_PLAYER(play);
|
||||||
s16 sp32;
|
s16 posX;
|
||||||
s16 sp30;
|
s16 posY;
|
||||||
|
|
||||||
if (this->unk_1E4 == 3) {
|
if (this->messageState == 3) {
|
||||||
Actor_ProcessTalkRequest(&this->actor, play);
|
Actor_ProcessTalkRequest(&this->actor, play);
|
||||||
Message_ContinueTextbox(play, this->actor.textId);
|
Message_ContinueTextbox(play, this->actor.textId);
|
||||||
this->unk_1E4 = 1;
|
this->messageState = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this->unk_1E4 == 1) {
|
if (this->messageState == 1) {
|
||||||
this->unk_1E4 = func_80B203D8(this, play);
|
this->messageState = EnToryo_TalkRespond(this, play);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this->unk_1E4 == 5) {
|
if (this->messageState == 5) {
|
||||||
this->unk_1E4 = func_80B205CC(this, play);
|
this->messageState = EnToryo_DoneTalking(this, play);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this->unk_1E4 == 2) {
|
if (this->messageState == 2) {
|
||||||
Message_ContinueTextbox(play, this->actor.textId);
|
Message_ContinueTextbox(play, this->actor.textId);
|
||||||
this->unk_1E4 = 1;
|
this->messageState = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this->unk_1E4 == 4) {
|
if (this->messageState == 4) {
|
||||||
if (Actor_HasParent(&this->actor, play)) {
|
if (Actor_HasParent(&this->actor, play)) {
|
||||||
this->actor.parent = NULL;
|
this->actor.parent = NULL;
|
||||||
this->unk_1E4 = 5;
|
this->messageState = 5;
|
||||||
} else {
|
} else {
|
||||||
Actor_OfferGetItem(&this->actor, play, GI_BROKEN_GORONS_SWORD, 100.0f, 10.0f);
|
Actor_OfferGetItem(&this->actor, play, GI_BROKEN_GORONS_SWORD, 100.0f, 10.0f);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this->unk_1E4 == 0) {
|
if (this->messageState == 0) {
|
||||||
if (Actor_ProcessTalkRequest(&this->actor, play)) {
|
if (Actor_ProcessTalkRequest(&this->actor, play)) {
|
||||||
this->unk_1E0 = func_8002F368(play);
|
this->exchangeItemId = func_8002F368(play);
|
||||||
if (this->unk_1E0 != 0) {
|
if (this->exchangeItemId != EXCH_ITEM_NONE) {
|
||||||
player->actor.textId = func_80B20634(this, play);
|
player->actor.textId = EnToryo_ReactToExchangeItem(this, play);
|
||||||
this->actor.textId = player->actor.textId;
|
this->actor.textId = player->actor.textId;
|
||||||
}
|
}
|
||||||
this->unk_1E4 = 1;
|
this->messageState = 1;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Actor_GetScreenPos(play, &this->actor, &sp32, &sp30);
|
Actor_GetScreenPos(play, &this->actor, &posX, &posY);
|
||||||
if ((sp32 >= 0) && (sp32 < 0x141) && (sp30 >= 0) && (sp30 < 0xF1)) {
|
if ((posX >= 0) && (posX <= SCREEN_WIDTH) && (posY >= 0) && (posY <= SCREEN_HEIGHT)) {
|
||||||
this->actor.textId = func_80B206A0(this, play);
|
this->actor.textId = EnToryo_GetTextId(this, play);
|
||||||
func_8002F298(&this->actor, play, 100.0f, EXCH_ITEM_POACHERS_SAW);
|
func_8002F298(&this->actor, play, 100.0f, EXCH_ITEM_POACHERS_SAW);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void func_80B20914(EnToryo* this, PlayState* play) {
|
void EnToryo_Idle(EnToryo* this, PlayState* play) {
|
||||||
SkelAnime_Update(&this->skelAnime);
|
SkelAnime_Update(&this->skelAnime);
|
||||||
func_80B20768(this, play);
|
EnToryo_HandleTalking(this, play);
|
||||||
if (this->unk_1E4 != 0) {
|
if (this->messageState != 0) {
|
||||||
this->stateFlags |= 0x10;
|
this->stateFlags |= 0x10;
|
||||||
} else {
|
} else {
|
||||||
this->stateFlags &= ~0x10;
|
this->stateFlags &= ~0x10;
|
||||||
|
|
|
@ -13,10 +13,9 @@ typedef struct EnToryo {
|
||||||
/* 0x014C */ SkelAnime skelAnime;
|
/* 0x014C */ SkelAnime skelAnime;
|
||||||
/* 0x0190 */ EnToryoActionFunc actionFunc;
|
/* 0x0190 */ EnToryoActionFunc actionFunc;
|
||||||
/* 0x0194 */ ColliderCylinder collider;
|
/* 0x0194 */ ColliderCylinder collider;
|
||||||
/* 0x01E0 */ s32 unk_1E0;
|
/* 0x01E0 */ s32 exchangeItemId;
|
||||||
/* 0x01E4 */ s32 unk_1E4;
|
/* 0x01E4 */ s32 messageState;
|
||||||
/* 0x01E8 */ u16 stateFlags;
|
/* 0x01E8 */ u16 stateFlags;
|
||||||
/* 0x01EA */ s16 unk_1EA;
|
|
||||||
/* 0x01EC */ NpcInteractInfo interactInfo;
|
/* 0x01EC */ NpcInteractInfo interactInfo;
|
||||||
/* 0x0214 */ Vec3s jointTable[17];
|
/* 0x0214 */ Vec3s jointTable[17];
|
||||||
/* 0x027A */ Vec3s morphTable[17];
|
/* 0x027A */ Vec3s morphTable[17];
|
||||||
|
|
Loading…
Reference in a new issue