1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-21 06:21:16 +00:00

Document NPC talking and player tracking (#1426)

* Rename npc dialog state variable

* Rename and doc NPC actor talking funtion

* Introduce NpcTalkState enum

* Rename NPC_TALK_STATE enum values

* Document NpcPlayerInteractionState and related functions

* Rename player tracking opt enum variants

* Rename npc functions, interact info

* Minor npc actor function tweaks

* Minor comment fixes for npc

* Generalize NPC player tracking to point tracking

* Change unused NpcInteractInfo field type and name

Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com>

* Rename headRot and torsoRot

* Rename GetTalkState to UpdateTalkState

* Minor comment fixes

* Rename rotateActorShape and clarify related comments

* Remove unneeded parentheses in z_en_heishi4.c

* Reformat

* Remove unclear comment

* Rename yPosOffset to yOffset

Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com>
This commit is contained in:
Lauri Koskela 2022-11-25 19:52:28 +02:00 committed by GitHub
parent 9c35716fe2
commit b57f2162ee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
66 changed files with 936 additions and 808 deletions

View file

@ -15,7 +15,7 @@ void EnMu_Update(Actor* thisx, PlayState* play);
void EnMu_Draw(Actor* thisx, PlayState* play);
void EnMu_Pose(EnMu* this, PlayState* play);
s16 EnMu_CheckDialogState(PlayState* play, Actor* thisx);
s16 EnMu_UpdateTalkState(PlayState* play, Actor* thisx);
static ColliderCylinderInit D_80AB0BD0 = {
{
@ -108,7 +108,7 @@ u16 EnMu_GetFaceReaction(PlayState* play, Actor* thisx) {
return this->defFaceReaction;
}
s16 EnMu_CheckDialogState(PlayState* play, Actor* thisx) {
s16 EnMu_UpdateTalkState(PlayState* play, Actor* thisx) {
EnMu* this = (EnMu*)thisx;
switch (Message_GetState(&play->msgCtx)) {
@ -121,12 +121,12 @@ s16 EnMu_CheckDialogState(PlayState* play, Actor* thisx) {
case TEXT_STATE_SONG_DEMO_DONE:
case TEXT_STATE_8:
case TEXT_STATE_9:
return 1;
return NPC_TALK_STATE_TALKING;
case TEXT_STATE_CLOSING:
EnMu_Interact(this, play);
return 0;
return NPC_TALK_STATE_IDLE;
default:
return 1;
return NPC_TALK_STATE_TALKING;
}
}
@ -172,7 +172,8 @@ void EnMu_Update(Actor* thisx, PlayState* play) {
Actor_UpdateBgCheckInfo(play, &this->actor, 0.0f, 0.0f, 0.0f, UPDBGCHECKINFO_FLAG_2);
this->actionFunc(this, play);
talkDist = this->collider.dim.radius + 30.0f;
func_800343CC(play, &this->actor, &this->npcInfo.unk_00, talkDist, EnMu_GetFaceReaction, EnMu_CheckDialogState);
Npc_UpdateTalking(play, &this->actor, &this->npcInfo.talkState, talkDist, EnMu_GetFaceReaction,
EnMu_UpdateTalkState);
this->actor.focus.pos = this->actor.world.pos;
this->actor.focus.pos.y += 60.0f;

View file

@ -13,7 +13,7 @@ typedef struct EnMu {
/* 0x014C */ SkelAnime skelAnime;
/* 0x0190 */ EnMuActionFunc actionFunc;
/* 0x0194 */ ColliderCylinder collider;
/* 0x01E0 */ struct_80034A14_arg1 npcInfo;
/* 0x01E0 */ NpcInteractInfo npcInfo;
/* 0x0208 */ u16 defFaceReaction;
/* 0x020A */ s16 unk_20A[16];
/* 0x022A */ s16 unk_22A[17];