1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-23 07:21:19 +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

@ -403,10 +403,10 @@ void EnCs_Talk(EnCs* this, PlayState* play) {
}
this->flag |= 1;
this->npcInfo.unk_18.x = player->actor.focus.pos.x;
this->npcInfo.unk_18.y = player->actor.focus.pos.y;
this->npcInfo.unk_18.z = player->actor.focus.pos.z;
func_80034A14(&this->actor, &this->npcInfo, 0, 4);
this->interactInfo.trackPos.x = player->actor.focus.pos.x;
this->interactInfo.trackPos.y = player->actor.focus.pos.y;
this->interactInfo.trackPos.z = player->actor.focus.pos.z;
Npc_TrackPoint(&this->actor, &this->interactInfo, 0, NPC_TRACKING_FULL_BODY);
if (this->talkState == 0) {
EnCs_ChangeAnim(this, ENCS_ANIM_0, &this->currentAnimIndex);
@ -494,12 +494,12 @@ s32 EnCs_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* po
if (this->flag & 1) {
switch (limbIndex) {
case 8:
rot->x += this->npcInfo.unk_0E.y;
rot->y -= this->npcInfo.unk_0E.x;
rot->x += this->interactInfo.torsoRot.y;
rot->y -= this->interactInfo.torsoRot.x;
break;
case 15:
rot->x += this->npcInfo.unk_08.y;
rot->z += this->npcInfo.unk_08.x;
rot->x += this->interactInfo.headRot.y;
rot->z += this->interactInfo.headRot.x;
break;
}
}

View file

@ -28,7 +28,7 @@ typedef struct EnCs {
/* 0x0210 */ s32 currentAnimIndex;
/* 0x0214 */ char unk_214[4];
/* 0x0218 */ MtxF spookyMaskMtx;
/* 0x0258 */ struct_80034A14_arg1 npcInfo;
/* 0x0258 */ NpcInteractInfo interactInfo;
/* 0x0280 */ s32 flag;
/* 0x0284 */ Vec3s jointTable[16];
/* 0x02E4 */ Vec3s morphTable[16];