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

Clean up NPC player interaction usages (#1458)

* Clean up player tracking related things in NPCs

* Cleanup Npc_UpdateTalking usages and related things

* Reformat

* Minor fixes based on review comments

* Remove unneeded declarations

* More consistent function names
This commit is contained in:
Lauri Koskela 2022-12-19 02:11:16 +02:00 committed by GitHub
parent 934d488420
commit 2ae64683a5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
34 changed files with 471 additions and 487 deletions

View file

@ -198,10 +198,10 @@ void EnZl4_SetActiveCamMove(PlayState* play, s16 index) {
sCamMove[index].relativeToPlayer);
}
u16 EnZl4_GetText(PlayState* play, Actor* thisx) {
u16 EnZl4_GetTextId(PlayState* play, Actor* thisx) {
u16 faceReaction = Text_GetFaceReaction(play, 22);
u16 stoneCount;
s16 ret;
s16 textId;
if (faceReaction != 0) {
return faceReaction;
@ -219,14 +219,14 @@ u16 EnZl4_GetText(PlayState* play, Actor* thisx) {
}
if (stoneCount > 1) {
ret = 0x703D;
textId = 0x703D;
} else {
ret = 0x703C;
textId = 0x703C;
}
return ret;
return textId;
}
s16 func_80B5B9B0(PlayState* play, Actor* thisx) {
s16 EnZl4_UpdateTalkState(PlayState* play, Actor* thisx) {
if (Message_GetState(&play->msgCtx) == TEXT_STATE_CLOSING) {
return NPC_TALK_STATE_IDLE;
}
@ -1210,7 +1210,7 @@ void EnZl4_Cutscene(EnZl4* this, PlayState* play) {
void EnZl4_Idle(EnZl4* this, PlayState* play) {
Npc_UpdateTalking(play, &this->actor, &this->interactInfo.talkState, this->collider.dim.radius + 60.0f,
EnZl4_GetText, func_80B5B9B0);
EnZl4_GetTextId, EnZl4_UpdateTalkState);
func_80B5BB78(this, play);
}
@ -1266,19 +1266,19 @@ void EnZl4_Update(Actor* thisx, PlayState* play) {
s32 EnZl4_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void* thisx) {
EnZl4* this = (EnZl4*)thisx;
Vec3s sp1C;
Vec3s limbRot;
if (limbIndex == 17) {
sp1C = this->interactInfo.headRot;
limbRot = this->interactInfo.headRot;
Matrix_Translate(900.0f, 0.0f, 0.0f, MTXMODE_APPLY);
Matrix_RotateX(BINANG_TO_RAD_ALT(sp1C.y), MTXMODE_APPLY);
Matrix_RotateZ(BINANG_TO_RAD_ALT(sp1C.x), MTXMODE_APPLY);
Matrix_RotateX(BINANG_TO_RAD_ALT(limbRot.y), MTXMODE_APPLY);
Matrix_RotateZ(BINANG_TO_RAD_ALT(limbRot.x), MTXMODE_APPLY);
Matrix_Translate(-900.0f, 0.0f, 0.0f, MTXMODE_APPLY);
}
if (limbIndex == 10) {
sp1C = this->interactInfo.torsoRot;
Matrix_RotateY(BINANG_TO_RAD_ALT(sp1C.y), MTXMODE_APPLY);
Matrix_RotateX(BINANG_TO_RAD_ALT(sp1C.x), MTXMODE_APPLY);
limbRot = this->interactInfo.torsoRot;
Matrix_RotateY(BINANG_TO_RAD_ALT(limbRot.y), MTXMODE_APPLY);
Matrix_RotateX(BINANG_TO_RAD_ALT(limbRot.x), MTXMODE_APPLY);
}
if ((limbIndex >= 3) && (limbIndex < 7)) {
*dList = NULL;