mirror of
https://github.com/zeldaret/oot.git
synced 2025-08-22 06:52:03 +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:
parent
9c35716fe2
commit
b57f2162ee
66 changed files with 936 additions and 808 deletions
|
@ -1274,10 +1274,10 @@ void func_80AED83C(EnRu1* this) {
|
|||
Vec3s* tempPtr;
|
||||
Vec3s* tempPtr2;
|
||||
|
||||
tempPtr = &this->unk_374.unk_08;
|
||||
tempPtr = &this->interactInfo.headRot;
|
||||
Math_SmoothStepToS(&tempPtr->x, 0, 0x14, 0x1838, 0x64);
|
||||
Math_SmoothStepToS(&tempPtr->y, 0, 0x14, 0x1838, 0x64);
|
||||
tempPtr2 = &this->unk_374.unk_0E;
|
||||
tempPtr2 = &this->interactInfo.torsoRot;
|
||||
Math_SmoothStepToS(&tempPtr2->x, 0, 0x14, 0x1838, 0x64);
|
||||
Math_SmoothStepToS(&tempPtr2->y, 0, 0x14, 0x1838, 0x64);
|
||||
}
|
||||
|
@ -1285,7 +1285,7 @@ void func_80AED83C(EnRu1* this) {
|
|||
void func_80AED8DC(EnRu1* this) {
|
||||
s32 temp_hi;
|
||||
s16* unk_2AC = &this->unk_2AC;
|
||||
s16* someY = &this->unk_374.unk_08.y;
|
||||
s16* someY = &this->interactInfo.headRot.y;
|
||||
s16* unk_29E = &this->unk_29E;
|
||||
s32 pad[2];
|
||||
|
||||
|
@ -1787,20 +1787,20 @@ void func_80AEEF68(EnRu1* this, PlayState* play) {
|
|||
Player* player = GET_PLAYER(play);
|
||||
s16 something;
|
||||
|
||||
this->unk_374.unk_18 = player->actor.world.pos;
|
||||
this->unk_374.unk_14 = kREG(16) - 3.0f;
|
||||
this->interactInfo.trackPos = player->actor.world.pos;
|
||||
this->interactInfo.yOffset = kREG(16) - 3.0f;
|
||||
something = kREG(17) + 0xC;
|
||||
func_80034A14(&this->actor, &this->unk_374, something, 2);
|
||||
Npc_TrackPoint(&this->actor, &this->interactInfo, something, NPC_TRACKING_HEAD_AND_TORSO);
|
||||
}
|
||||
|
||||
void func_80AEEFEC(EnRu1* this, PlayState* play) {
|
||||
Player* player = GET_PLAYER(play);
|
||||
s16 something;
|
||||
|
||||
this->unk_374.unk_18 = player->actor.world.pos;
|
||||
this->unk_374.unk_14 = kREG(16) - 3.0f;
|
||||
this->interactInfo.trackPos = player->actor.world.pos;
|
||||
this->interactInfo.yOffset = kREG(16) - 3.0f;
|
||||
something = kREG(17) + 0xC;
|
||||
func_80034A14(&this->actor, &this->unk_374, something, 4);
|
||||
Npc_TrackPoint(&this->actor, &this->interactInfo, something, NPC_TRACKING_FULL_BODY);
|
||||
this->actor.world.rot.y = this->actor.shape.rot.y;
|
||||
}
|
||||
|
||||
|
@ -2260,8 +2260,8 @@ void EnRu1_Init(Actor* thisx, PlayState* play) {
|
|||
}
|
||||
|
||||
void func_80AF0278(EnRu1* this, PlayState* play, s32 limbIndex, Vec3s* rot) {
|
||||
Vec3s* vec1 = &this->unk_374.unk_0E;
|
||||
Vec3s* vec2 = &this->unk_374.unk_08;
|
||||
Vec3s* vec1 = &this->interactInfo.torsoRot;
|
||||
Vec3s* vec2 = &this->interactInfo.headRot;
|
||||
|
||||
switch (limbIndex) {
|
||||
case RUTO_CHILD_LEFT_UPPER_ARM:
|
||||
|
|
|
@ -54,7 +54,7 @@ typedef struct EnRu1 {
|
|||
/* 0x0360 */ f32 unk_360;
|
||||
/* 0x0364 */ Vec3f unk_364;
|
||||
/* 0x0370 */ f32 unk_370;
|
||||
/* 0x0374 */ struct_80034A14_arg1 unk_374;
|
||||
/* 0x0374 */ NpcInteractInfo interactInfo;
|
||||
} EnRu1; // size = 0x039C
|
||||
|
||||
typedef enum {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue