From fd368f425cb23471b75b9fddf60eac9468f2a909 Mon Sep 17 00:00:00 2001 From: DaMarkov <35939509+DaMarkov@users.noreply.github.com> Date: Tue, 22 Feb 2022 05:03:27 +0100 Subject: [PATCH] Added cheat to make the guards in Gerudo's fortress blind. (#181) Co-authored-by: DaMarkov --- GLideN64 | 2 +- src/overlays/actors/ovl_En_Ge2/z_en_ge2.cpp | 7 +++++-- src/port/options.h | 8 +++++++- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/GLideN64 b/GLideN64 index b595b9646..403658b45 160000 --- a/GLideN64 +++ b/GLideN64 @@ -1 +1 @@ -Subproject commit b595b9646cb4e160b717ec4663e98b553f28b903 +Subproject commit 403658b456e0f4792c62d7fc8ba5fa273a7811a3 diff --git a/src/overlays/actors/ovl_En_Ge2/z_en_ge2.cpp b/src/overlays/actors/ovl_En_Ge2/z_en_ge2.cpp index 3983c8135..87fd02463 100644 --- a/src/overlays/actors/ovl_En_Ge2/z_en_ge2.cpp +++ b/src/overlays/actors/ovl_En_Ge2/z_en_ge2.cpp @@ -20,6 +20,7 @@ #include "def/z_message_PAL.h" #include "def/z_rcp.h" #include "def/z_skelanime.h" +#include "../../../port/options.h" #define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_3 | ACTOR_FLAG_4) @@ -576,13 +577,15 @@ void EnGe2_Update(Actor* thisx, GlobalContext* globalCtx) { pthis->yDetectRange)) { // "Discovered!" osSyncPrintf(VT_FGCOL(GREEN) "発見!!!!!!!!!!!!\n" VT_RST); - EnGe2_SetupCapturePlayer(pthis, globalCtx); + if (!oot::config().cheats().blindGerudoGuards()) + EnGe2_SetupCapturePlayer(pthis, globalCtx); } if (((pthis->actor.params & 0xFF) == GE2_TYPE_STATIONARY) && (pthis->actor.xzDistToPlayer < 100.0f)) { // "Discovered!" osSyncPrintf(VT_FGCOL(GREEN) "発見!!!!!!!!!!!!\n" VT_RST); - EnGe2_SetupCapturePlayer(pthis, globalCtx); + if (!oot::config().cheats().blindGerudoGuards()) + EnGe2_SetupCapturePlayer(pthis, globalCtx); } } diff --git a/src/port/options.h b/src/port/options.h index 9c37e2c4a..240014087 100644 --- a/src/port/options.h +++ b/src/port/options.h @@ -125,6 +125,11 @@ namespace oot { return m_speed; } + + bool& blindGerudoGuards() + { + return m_blindGerudoGuards; + } protected: bool m_invincible; @@ -132,8 +137,9 @@ namespace oot u8 padding[2]; float m_bowserAimAssist; float m_speed; + bool m_blindGerudoGuards; - u8 junk[0x40 - (2 + 7 + 4)]; + u8 junk[0x40 - (2 + 7 + 4 + 1)]; }; static_assert(sizeof(Cheats) == 0x40, "Cheats size incorrect");