Skip to content

Commit

Permalink
clarify "in range" of what it is
Browse files Browse the repository at this point in the history
  • Loading branch information
Feacur committed Nov 14, 2024
1 parent d891107 commit 768297f
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/overlays/actors/ovl_En_Go2/z_en_go2.c
Original file line number Diff line number Diff line change
Expand Up @@ -856,7 +856,7 @@ s32 EnGo2_UpdateTalking(EnGo2* this, PlayState* play) {
EnGo2_GetTextId, EnGo2_UpdateTalkState);
}

// Biggoron is close enough; see `EnGo2_IsInRange`
// Biggoron is close enough; see `EnGo2_IsWithinInteactionRange`
if (ENGO2_GET_TYPE(this) == GORON_DMT_BIGGORON && !(this->collider.base.ocFlags2 & OC2_HIT_PLAYER)) {
return false;
}
Expand Down Expand Up @@ -1002,7 +1002,7 @@ s32 EnGo2_OrientInstant(EnGo2* this) {
return 1;
}

s32 EnGo2_IsInRange(EnGo2* this) {
s32 EnGo2_IsWithinInteactionRange(EnGo2* this) {
s16 yawDiff;
f32 xyzDist = (ENGO2_GET_TYPE(this) == GORON_DMT_BIGGORON) ? 800.0f : 200.0f;
f32 yDist = (ENGO2_GET_TYPE(this) == GORON_DMT_BIGGORON) ? 400.0f : 60.0f;
Expand Down Expand Up @@ -1206,10 +1206,10 @@ s32 EnGo2_ShouldStay(EnGo2* this, PlayState* play) {
Camera* mainCam = play->cameraPtrs[CAM_ID_MAIN];

if (ENGO2_GET_TYPE(this) == GORON_DMT_BIGGORON) {
if (EnGo2_IsInRange(this)) {
if (EnGo2_IsWithinInteactionRange(this)) {
Camera_RequestSetting(mainCam, CAM_SET_DIRECTED_YAW);
Camera_UnsetStateFlag(mainCam, CAM_STATE_CHECK_BG);
} else if (!EnGo2_IsInRange(this) && (mainCam->setting == CAM_SET_DIRECTED_YAW)) {
} else if (!EnGo2_IsWithinInteactionRange(this) && (mainCam->setting == CAM_SET_DIRECTED_YAW)) {
Camera_RequestSetting(mainCam, CAM_SET_DUNGEON1);
Camera_SetStateFlag(mainCam, CAM_STATE_CHECK_BG);
}
Expand All @@ -1229,7 +1229,7 @@ s32 EnGo2_ShouldStay(EnGo2* this, PlayState* play) {
}

void EnGo2_SetupUncurledFlags_Default(EnGo2* this) {
this->trackingMode = EnGo2_IsInRange(this) ? NPC_TRACKING_HEAD_AND_TORSO : NPC_TRACKING_NONE;
this->trackingMode = EnGo2_IsWithinInteactionRange(this) ? NPC_TRACKING_HEAD_AND_TORSO : NPC_TRACKING_NONE;

if (this->interactInfo.talkState != NPC_TALK_STATE_IDLE) {
this->trackingMode = NPC_TRACKING_FULL_BODY;
Expand All @@ -1253,7 +1253,7 @@ void EnGo2_SetupUncurledFlags_NearTracking(EnGo2* this) {
}

void EnGo2_SetupUncurledFlags_Biggoron(EnGo2* this) {
if (EnGo2_IsInRange(this) || this->interactInfo.talkState != NPC_TALK_STATE_IDLE) {
if (EnGo2_IsWithinInteactionRange(this) || this->interactInfo.talkState != NPC_TALK_STATE_IDLE) {
this->trackingMode = NPC_TRACKING_HEAD_AND_TORSO;
this->isTalkative = true;
} else {
Expand All @@ -1266,7 +1266,7 @@ void EnGo2_SetupUncurledFlags(EnGo2* this) {
switch (ENGO2_GET_TYPE(this)) {
case GORON_DMT_BOMB_FLOWER:
this->isTalkative = true;
this->trackingMode = EnGo2_IsInRange(this) ? NPC_TRACKING_HEAD_AND_TORSO : NPC_TRACKING_NONE;
this->trackingMode = EnGo2_IsWithinInteactionRange(this) ? NPC_TRACKING_HEAD_AND_TORSO : NPC_TRACKING_NONE;
break;
case GORON_FIRE_GENERIC:
EnGo2_SetupUncurledFlags_NearTracking(this);
Expand Down Expand Up @@ -1473,7 +1473,7 @@ s32 EnGo2_IsGoronFireGeneric(EnGo2* this) {

s32 EnGo2_IsGoronLinkReversing(EnGo2* this) {
if (ENGO2_GET_TYPE(this) != GORON_CITY_LINK || (this->waypoint >= this->reverseWaypoint) ||
!EnGo2_IsInRange(this)) {
!EnGo2_IsWithinInteactionRange(this)) {
return false;
}
return true;
Expand Down Expand Up @@ -1702,7 +1702,7 @@ void EnGo2_CurledUp(EnGo2* this, PlayState* play) {
this->isTalkative = false;
EnGo2_WakeUpAnimated(this, play);
}
if ((ENGO2_GET_TYPE(this) != GORON_FIRE_GENERIC) && EnGo2_IsInRange(this)) {
if ((ENGO2_GET_TYPE(this) != GORON_FIRE_GENERIC) && EnGo2_IsWithinInteactionRange(this)) {
EnGo2_WakeUpAnimated(this, play);
}
}
Expand Down Expand Up @@ -1737,7 +1737,7 @@ void EnGo2_Standing(EnGo2* this, PlayState* play) {
(s16)((height * 0.4f * (this->skelAnime.curFrame / this->skelAnime.endFrame)) + (height * 0.6f));
}
}
if ((!EnGo2_ShouldStay(this, play)) && (!EnGo2_IsInRange(this))) {
if ((!EnGo2_ShouldStay(this, play)) && (!EnGo2_IsWithinInteactionRange(this))) {
EnGo2_AnimateRolling(this, play);
}
}
Expand Down

0 comments on commit 768297f

Please sign in to comment.