summaryrefslogtreecommitdiff
path: root/src/overlays/actors/ovl_En_Hs2/z_en_hs2.c
diff options
context:
space:
mode:
authorJordan Longstaff <JordanLongstaff@users.noreply.github.com>2026-05-23 03:00:29 -0400
committerGitHub <noreply@github.com>2026-05-23 09:00:29 +0200
commit2b29808f8de9e07cd158fdef152f3613b011a68e (patch)
treeae3890cc710177350d61b0bec84fc146274a91ee /src/overlays/actors/ovl_En_Hs2/z_en_hs2.c
parent4834ec2b6913a109bca9a2249715ab08f0f6ad42 (diff)
Document `EnHs` and `EnHs2` (Carpenter's son) (#2758)
* Document `EnHs` and `EnHs2` (Carpenter's son) * focusOffset -> sFocusOffset * Rename tracking flag fields * Roll back subrepo changes * Remove comment on trackingFlags Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com> --------- Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com>
Diffstat (limited to 'src/overlays/actors/ovl_En_Hs2/z_en_hs2.c')
-rw-r--r--src/overlays/actors/ovl_En_Hs2/z_en_hs2.c48
1 files changed, 25 insertions, 23 deletions
diff --git a/src/overlays/actors/ovl_En_Hs2/z_en_hs2.c b/src/overlays/actors/ovl_En_Hs2/z_en_hs2.c
index 4eefda79d..b90c3dddf 100644
--- a/src/overlays/actors/ovl_En_Hs2/z_en_hs2.c
+++ b/src/overlays/actors/ovl_En_Hs2/z_en_hs2.c
@@ -20,11 +20,13 @@
#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY)
+#define ENHS2_TRACKING_PLAYER (1 << 0)
+
void EnHs2_Init(Actor* thisx, PlayState* play);
void EnHs2_Destroy(Actor* thisx, PlayState* play);
void EnHs2_Update(Actor* thisx, PlayState* play);
void EnHs2_Draw(Actor* thisx, PlayState* play);
-void func_80A6F1A4(EnHs2* this, PlayState* play);
+void EnHs2_Idle(EnHs2* this, PlayState* play);
ActorProfile En_Hs2_Profile = {
/**/ ACTOR_EN_HS2,
@@ -63,16 +65,16 @@ void EnHs2_Init(Actor* thisx, PlayState* play) {
s32 pad;
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 36.0f);
- SkelAnime_InitFlex(play, &this->skelAnime, &object_hs_Skel_006260, &object_hs_Anim_0005C0, this->jointTable,
+ SkelAnime_InitFlex(play, &this->skelAnime, &gCarpenterSonSkel, &gCarpenterSonSittingAnim, this->jointTable,
this->morphTable, 16);
- Animation_PlayLoop(&this->skelAnime, &object_hs_Anim_0005C0);
+ Animation_PlayLoop(&this->skelAnime, &gCarpenterSonSittingAnim);
Collider_InitCylinder(play, &this->collider);
Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit);
this->actor.colChkInfo.mass = MASS_IMMOVABLE;
Actor_SetScale(&this->actor, 0.01f);
PRINTF(VT_FGCOL(CYAN) T(" ヒヨコの店(子人の時) \n", " Chick's Shop (Children's Time) \n") VT_RST);
- this->actionFunc = func_80A6F1A4;
- this->unk_2A8 = 0;
+ this->actionFunc = EnHs2_Idle;
+ this->trackingFlags = 0;
this->actor.attentionRangeType = ATTENTION_RANGE_6;
}
@@ -82,7 +84,7 @@ void EnHs2_Destroy(Actor* thisx, PlayState* play) {
Collider_DestroyCylinder(play, &this->collider);
}
-s32 func_80A6F0B4(EnHs2* this, PlayState* play, u16 textId, EnHs2ActionFunc actionFunc) {
+s32 EnHs2_Interact(EnHs2* this, PlayState* play, u16 textId, EnHs2ActionFunc actionFunc) {
if (Actor_TalkOfferAccepted(&this->actor, play)) {
this->actionFunc = actionFunc;
return 1;
@@ -91,27 +93,27 @@ s32 func_80A6F0B4(EnHs2* this, PlayState* play, u16 textId, EnHs2ActionFunc acti
this->actor.textId = textId;
if (ABS((s16)(this->actor.yawTowardsPlayer - this->actor.shape.rot.y)) < 0x2151 &&
this->actor.xzDistToPlayer < 100.0f) {
- this->unk_2A8 |= 0x1;
+ this->trackingFlags |= ENHS2_TRACKING_PLAYER;
Actor_OfferTalk(&this->actor, play, 100.0f);
}
return 0;
}
-void func_80A6F164(EnHs2* this, PlayState* play) {
+void EnHs2_Talking(EnHs2* this, PlayState* play) {
if (Actor_TextboxIsClosing(&this->actor, play)) {
- this->actionFunc = func_80A6F1A4;
+ this->actionFunc = EnHs2_Idle;
}
- this->unk_2A8 |= 0x1;
+ this->trackingFlags |= ENHS2_TRACKING_PLAYER;
}
-void func_80A6F1A4(EnHs2* this, PlayState* play) {
+void EnHs2_Idle(EnHs2* this, PlayState* play) {
u16 textId = MaskReaction_GetTextId(play, MASK_REACTION_SET_CARPENTERS_SON);
if (textId == 0) {
textId = 0x5069;
}
- func_80A6F0B4(this, play, textId, func_80A6F164);
+ EnHs2_Interact(this, play, textId, EnHs2_Talking);
}
void EnHs2_Update(Actor* thisx, PlayState* play) {
@@ -126,14 +128,14 @@ void EnHs2_Update(Actor* thisx, PlayState* play) {
this->skelAnime.curFrame = 0.0f;
}
this->actionFunc(this, play);
- if (this->unk_2A8 & 0x1) {
- Actor_TrackPlayer(play, &this->actor, &this->unk_29C, &this->unk_2A2, this->actor.focus.pos);
- this->unk_2A8 &= ~1;
+ if (this->trackingFlags & ENHS2_TRACKING_PLAYER) {
+ Actor_TrackPlayer(play, &this->actor, &this->headRot, &this->torsoRot, this->actor.focus.pos);
+ this->trackingFlags &= ~ENHS2_TRACKING_PLAYER;
} else {
- Math_SmoothStepToS(&this->unk_29C.x, 12800, 6, 6200, 100);
- Math_SmoothStepToS(&this->unk_29C.y, 0, 6, 6200, 100);
- Math_SmoothStepToS(&this->unk_2A2.x, 0, 6, 6200, 100);
- Math_SmoothStepToS(&this->unk_2A2.y, 0, 6, 6200, 100);
+ Math_SmoothStepToS(&this->headRot.x, 12800, 6, 6200, 100);
+ Math_SmoothStepToS(&this->headRot.y, 0, 6, 6200, 100);
+ Math_SmoothStepToS(&this->torsoRot.x, 0, 6, 6200, 100);
+ Math_SmoothStepToS(&this->torsoRot.y, 0, 6, 6200, 100);
}
}
@@ -146,8 +148,8 @@ s32 EnHs2_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* p
*dList = NULL;
return false;
case 9:
- rot->x += this->unk_29C.y;
- rot->z += this->unk_29C.x;
+ rot->x += this->headRot.y;
+ rot->z += this->headRot.x;
break;
case 10:
*dList = NULL;
@@ -160,11 +162,11 @@ s32 EnHs2_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* p
}
void EnHs2_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, void* thisx) {
- static Vec3f D_80A6F4CC = { 300.0f, 1000.0f, 0.0f };
+ static Vec3f sFocusOffset = { 300.0f, 1000.0f, 0.0f };
EnHs2* this = (EnHs2*)thisx;
if (limbIndex == 9) {
- Matrix_MultVec3f(&D_80A6F4CC, &this->actor.focus.pos);
+ Matrix_MultVec3f(&sFocusOffset, &this->actor.focus.pos);
}
}