summaryrefslogtreecommitdiff
path: root/soh/src/code
diff options
context:
space:
mode:
authorEric Hoey <121978037+A-Green-Spoon@users.noreply.github.com>2024-12-02 11:03:47 -0500
committerGitHub <noreply@github.com>2024-12-02 09:03:47 -0700
commit19d1fd5545cc71a05311c7f295c7b67211cb323e (patch)
tree97645bd99e339b01f2209df1697fadecfd2c11cf /soh/src/code
parent9b74a09955d745f97ac7ee2b33971596cd18cfdd (diff)
Boomerang Reticle and First-Person Aiming (#3374)
* First-person, reticle, sway, menu, and presets * Put sway back behind reticle, adjust aim height for age * block vanilla + comments * new documentation method * second try formatting * Correct boomerang distance * Update for CVAR changes * Fix alignment? * Condition cleanup * Change reticle range to match bow behavior * remove magic values
Diffstat (limited to 'soh/src/code')
-rw-r--r--soh/src/code/z_player_lib.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/soh/src/code/z_player_lib.c b/soh/src/code/z_player_lib.c
index a50a49e2d..3207abaf6 100644
--- a/soh/src/code/z_player_lib.c
+++ b/soh/src/code/z_player_lib.c
@@ -887,6 +887,16 @@ s32 Player_HoldsSlingshot(Player* this) {
return this->heldItemAction == PLAYER_IA_SLINGSHOT;
}
+// #region SOH [Enhancement]
+s32 Player_HoldsBoomerang(Player* this) {
+ return this->heldItemAction == PLAYER_IA_BOOMERANG;
+}
+
+s32 Player_AimsBoomerang(Player* this) {
+ return Player_HoldsBoomerang(this) && (this->unk_834 != 0);
+}
+// #endregion
+
s32 func_8008F128(Player* this) {
return Player_HoldsHookshot(this) && (this->heldActor == NULL);
}
@@ -1789,6 +1799,9 @@ Vec3f sLeftRightFootLimbModelFootPos[] = {
void Player_PostLimbDrawGameplay(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, void* thisx) {
Player* this = (Player*)thisx;
+ const Vec3s BoomerangViewAdult = { -31200, -9200, 17000 };
+ const Vec3s BoomerangViewChild = { -31200, -8700, 17000 };
+
if (*dList != NULL) {
Matrix_MultVec3f(&sZeroVec, D_80160000);
}
@@ -1950,6 +1963,8 @@ void Player_PostLimbDrawGameplay(PlayState* play, s32 limbIndex, Gfx** dList, Ve
play, this, ((this->heldItemAction == PLAYER_IA_HOOKSHOT) ? 38600.0f : 77600.0f) * CVarGetFloat(CVAR_CHEAT("HookshotReachMultiplier"), 1.0f));
}
}
+
+ // #region SOH [Enhancement]
} else if (CVarGetInteger(CVAR_ENHANCEMENT("BowReticle"), 0) && (
(this->heldItemAction == PLAYER_IA_BOW_FIRE) ||
(this->heldItemAction == PLAYER_IA_BOW_ICE) ||
@@ -1968,6 +1983,21 @@ void Player_PostLimbDrawGameplay(PlayState* play, s32 limbIndex, Gfx** dList, Ve
Player_DrawHookshotReticle(play, this, RETICLE_MAX);
}
}
+ } else if (CVarGetInteger(CVAR_ENHANCEMENT("BoomerangReticle"), 0) && (this->heldItemAction == PLAYER_IA_BOOMERANG)) {
+ if (Player_HoldsBoomerang(this)) {
+ if (LINK_IS_ADULT) {
+ Matrix_RotateZYX(BoomerangViewAdult.x, BoomerangViewAdult.y, BoomerangViewAdult.z,
+ MTXMODE_APPLY);
+ } else {
+ Matrix_RotateZYX(BoomerangViewChild.x, BoomerangViewChild.y, BoomerangViewChild.z, MTXMODE_APPLY);
+ }
+
+ if (Player_AimsBoomerang(this)) {
+ Matrix_Translate(500.0f, 300.0f, 0.0f, MTXMODE_APPLY);
+ Player_DrawHookshotReticle(play, this, RETICLE_MAX);
+ }
+ }
+ // #endregion
}
if ((this->unk_862 != 0) || ((func_8002DD6C(this) == 0) && (heldActor != NULL))) {