From 3807e5690ac06789fc3ecfb16356c85297b712fa Mon Sep 17 00:00:00 2001 From: Demur Rumed Date: Sun, 13 Apr 2025 20:49:53 +0000 Subject: [PATCH 1/2] rando: always spawn guard behind gate (also fix gaurd typos) someone had seed where they had card so couldn't be caught to pass gate in reverse wasteland --- soh/soh/Enhancements/randomizer/hook_handlers.cpp | 2 +- soh/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/soh/soh/Enhancements/randomizer/hook_handlers.cpp b/soh/soh/Enhancements/randomizer/hook_handlers.cpp index a10e8b67f..5fc9b0e33 100644 --- a/soh/soh/Enhancements/randomizer/hook_handlers.cpp +++ b/soh/soh/Enhancements/randomizer/hook_handlers.cpp @@ -982,7 +982,7 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_l break; } case VB_BIGGORON_CONSIDER_TRADE_COMPLETE: { - // This being true will prevent other biggoron trades, there are already safegaurds in place to prevent + // This being true will prevent other biggoron trades, there are already safeguards in place to prevent // claim check from being traded multiple times, so we don't really need the quest to ever be considered // "complete" *should = false; diff --git a/soh/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c b/soh/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c index 1becdcf6a..967e0470b 100644 --- a/soh/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c +++ b/soh/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c @@ -98,11 +98,8 @@ void EnGe1_Init(Actor* thisx, PlayState* play) { EnGe1* this = (EnGe1*)thisx; // When spawning the gate operator, also spawn an extra gate operator on the wasteland side - if (IS_RANDO && - (Randomizer_GetSettingValue(RSK_SHUFFLE_GERUDO_MEMBERSHIP_CARD) || - Randomizer_GetSettingValue(RSK_SHUFFLE_OVERWORLD_ENTRANCES)) && - (this->actor.params & 0xFF) == GE1_TYPE_GATE_OPERATOR) { - // Spawn the extra gaurd with params matching the custom type added (0x0300 + 0x02) + if (IS_RANDO && (this->actor.params & 0xFF) == GE1_TYPE_GATE_OPERATOR) { + // Spawn the extra guard with params matching the custom type added (0x0300 + 0x02) Actor_Spawn(&play->actorCtx, play, ACTOR_EN_GE1, -1358.0f, 88.0f, -3018.0f, 0, 0x95B0, 0, 0x0300 | GE1_TYPE_EXTRA_GATE_OPERATOR, true); } From f6a74ca37ade138fb7cd34148571c0d2787acf30 Mon Sep 17 00:00:00 2001 From: Demur Rumed Date: Sun, 13 Apr 2025 21:24:37 +0000 Subject: [PATCH 2/2] move guard spawn logic to hook --- soh/soh/Enhancements/randomizer/hook_handlers.cpp | 4 ++++ soh/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c | 13 ------------- soh/src/overlays/actors/ovl_En_Ge1/z_en_ge1.h | 1 - 3 files changed, 4 insertions(+), 14 deletions(-) diff --git a/soh/soh/Enhancements/randomizer/hook_handlers.cpp b/soh/soh/Enhancements/randomizer/hook_handlers.cpp index 5fc9b0e33..90ff6559c 100644 --- a/soh/soh/Enhancements/randomizer/hook_handlers.cpp +++ b/soh/soh/Enhancements/randomizer/hook_handlers.cpp @@ -2027,6 +2027,10 @@ void RandomizerOnActorInitHandler(void* actorRef) { if (ge1Type == GE1_TYPE_TRAINING_GROUND_GUARD && Flags_GetRandomizerInf(RAND_INF_GF_GTG_GATE_PERMANENTLY_OPEN)) { enGe1->actionFunc = (EnGe1ActionFunc)EnGe1_SetNormalText; + } else if (ge1Type == GE1_TYPE_GATE_OPERATOR && enGe1->actor.world.pos.x != -1358.0f) { + // When spawning the gate operator, also spawn an extra gate operator on the wasteland side + Actor_Spawn(&gPlayState->actorCtx, gPlayState, ACTOR_EN_GE1, -1358.0f, 88.0f, -3018.0f, 0, 0x95B0, 0, + 0x0300 | GE1_TYPE_GATE_OPERATOR, true); } } diff --git a/soh/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c b/soh/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c index 967e0470b..eadd847b5 100644 --- a/soh/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c +++ b/soh/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c @@ -97,19 +97,6 @@ void EnGe1_Init(Actor* thisx, PlayState* play) { s32 pad; EnGe1* this = (EnGe1*)thisx; - // When spawning the gate operator, also spawn an extra gate operator on the wasteland side - if (IS_RANDO && (this->actor.params & 0xFF) == GE1_TYPE_GATE_OPERATOR) { - // Spawn the extra guard with params matching the custom type added (0x0300 + 0x02) - Actor_Spawn(&play->actorCtx, play, ACTOR_EN_GE1, -1358.0f, 88.0f, -3018.0f, 0, 0x95B0, 0, - 0x0300 | GE1_TYPE_EXTRA_GATE_OPERATOR, true); - } - - // Convert the "extra" gate operator into a normal one so it matches the same params - if ((this->actor.params & 0xFF) == GE1_TYPE_EXTRA_GATE_OPERATOR) { - this->actor.params &= ~0xFF; - this->actor.params |= GE1_TYPE_GATE_OPERATOR; - } - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); SkelAnime_InitFlex(play, &this->skelAnime, &gGerudoWhiteSkel, &gGerudoWhiteIdleAnim, this->jointTable, this->morphTable, GE1_LIMB_MAX); diff --git a/soh/src/overlays/actors/ovl_En_Ge1/z_en_ge1.h b/soh/src/overlays/actors/ovl_En_Ge1/z_en_ge1.h index 2c0c6d4f9..c85b20deb 100644 --- a/soh/src/overlays/actors/ovl_En_Ge1/z_en_ge1.h +++ b/soh/src/overlays/actors/ovl_En_Ge1/z_en_ge1.h @@ -12,7 +12,6 @@ typedef void (*EnGe1ActionFunc)(struct EnGe1*, PlayState*); typedef enum { /* 0x00 */ GE1_TYPE_GATE_GUARD, /* 0x01 */ GE1_TYPE_GATE_OPERATOR, - /* 0x02 */ GE1_TYPE_EXTRA_GATE_OPERATOR, // Custom guard type for entrance randomizer to open the gate /* 0x04 */ GE1_TYPE_NORMAL = 4, /* 0x05 */ GE1_TYPE_VALLEY_FLOOR, /* 0x45 */ GE1_TYPE_HORSEBACK_ARCHERY = 0x45,