summaryrefslogtreecommitdiff
path: root/soh/src/code
diff options
context:
space:
mode:
authorRaelCappra <rael.cappra@gmail.com>2023-04-22 22:59:34 -0300
committerGitHub <noreply@github.com>2023-04-22 21:59:34 -0400
commit25ceca0fbf9f24625fad531afe0490baf0e1c149 (patch)
treebff85b9a20cac0e40167a0dd845a4e5a6a3ef963 /soh/src/code
parentc4b90d0bfe823922f272c1d8fec3bc68d7116373 (diff)
Enhancement: Aiming reticle for the bow/slingshot (#2715)
* Bow reticle enhancement * Menu bar checkbox * fix * simplify bow/slingshot reticle logic * Comment on RETICLE_MAX * Tooltip clarity update --------- Co-authored-by: briaguya <briaguya@alice>
Diffstat (limited to 'soh/src/code')
-rw-r--r--soh/src/code/z_player_lib.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/soh/src/code/z_player_lib.c b/soh/src/code/z_player_lib.c
index 5bae84443..8df5b5a91 100644
--- a/soh/src/code/z_player_lib.c
+++ b/soh/src/code/z_player_lib.c
@@ -1391,6 +1391,11 @@ Vec3f D_801261E0[] = {
{ 200.0f, 200.0f, 0.0f },
};
+// OTRTODO: Figure out why this value works/what this value should be
+// This was originally obtained by working down from FLT_MAX until the math
+// started working out properly
+#define RETICLE_MAX 3.402823466e+12f
+
void func_80090D20(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, void* thisx) {
Player* this = (Player*)thisx;
@@ -1555,6 +1560,24 @@ void func_80090D20(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, void
play, this, ((this->heldItemAction == PLAYER_IA_HOOKSHOT) ? 38600.0f : 77600.0f) * CVarGetFloat("gCheatHookshotReachMultiplier", 1.0f));
}
}
+ } else if (CVarGetInteger("gBowReticle", 0) && (
+ (this->heldItemAction == PLAYER_IA_BOW_FIRE) ||
+ (this->heldItemAction == PLAYER_IA_BOW_ICE) ||
+ (this->heldItemAction == PLAYER_IA_BOW_LIGHT) ||
+ (this->heldItemAction == PLAYER_IA_BOW) ||
+ (this->heldItemAction == PLAYER_IA_SLINGSHOT))) {
+ if (heldActor != NULL) {
+ MtxF sp44;
+ s32 pad;
+
+ Matrix_RotateZYX(0, -15216, -17496, MTXMODE_APPLY);
+ Matrix_Get(&sp44);
+
+ if (func_8002DD78(this) != 0) {
+ Matrix_Translate(500.0f, 300.0f, 0.0f, MTXMODE_APPLY);
+ Player_DrawHookshotReticle(play, this, RETICLE_MAX);
+ }
+ }
}
if ((this->unk_862 != 0) || ((func_8002DD6C(this) == 0) && (heldActor != NULL))) {