summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Leggett <chris@leggett.dev>2025-04-04 10:14:23 -0400
committerGitHub <noreply@github.com>2025-04-04 10:14:23 -0400
commite2bb2edb8ab0ea9d2077e4b2236bf605c98de324 (patch)
treed5f2240e49bad9f5e2593e414ef374968e92d0eb
parent9a78b04e6810afb6f05f9d10b6d5e638cbbcdf4c (diff)
Fix the start with Master Sword option (#5304)
-rw-r--r--soh/soh/Enhancements/randomizer/3drando/hints.cpp2
-rw-r--r--soh/soh/Enhancements/randomizer/savefile.cpp8
2 files changed, 9 insertions, 1 deletions
diff --git a/soh/soh/Enhancements/randomizer/3drando/hints.cpp b/soh/soh/Enhancements/randomizer/3drando/hints.cpp
index c55145fcd..8e928185f 100644
--- a/soh/soh/Enhancements/randomizer/3drando/hints.cpp
+++ b/soh/soh/Enhancements/randomizer/3drando/hints.cpp
@@ -835,7 +835,7 @@ void CreateGanondorfJoke() {
void CreateGanondorfHint() {
auto ctx = Rando::Context::GetInstance();
if (ctx->GetOption(RSK_GANONDORF_HINT) && !ctx->GetHint(RH_GANONDORF_HINT)->IsEnabled()) {
- if (ctx->GetOption(RSK_SHUFFLE_MASTER_SWORD)) {
+ if (ctx->GetOption(RSK_SHUFFLE_MASTER_SWORD) && ctx->GetOption(RSK_STARTING_MASTER_SWORD).Is(RO_GENERIC_OFF)) {
CreateStaticItemHint(
RH_GANONDORF_HINT,
{ RHT_GANONDORF_HINT_LA_ONLY, RHT_GANONDORF_HINT_MS_ONLY, RHT_GANONDORF_HINT_LA_AND_MS },
diff --git a/soh/soh/Enhancements/randomizer/savefile.cpp b/soh/soh/Enhancements/randomizer/savefile.cpp
index 4753bb4b4..cb8c7eaef 100644
--- a/soh/soh/Enhancements/randomizer/savefile.cpp
+++ b/soh/soh/Enhancements/randomizer/savefile.cpp
@@ -107,6 +107,7 @@ void GiveLinksPocketItem() {
}
void SetStartingItems() {
+ int startingAge = OTRGlobals::Instance->gRandoContext->GetOption(RSK_SELECTED_STARTING_AGE).Get();
if (Randomizer_GetSettingValue(RSK_STARTING_KOKIRI_SWORD))
Item_Give(NULL, ITEM_SWORD_KOKIRI);
if (Randomizer_GetSettingValue(RSK_STARTING_DEKU_SHIELD))
@@ -158,6 +159,13 @@ void SetStartingItems() {
if (Randomizer_GetSettingValue(RSK_STARTING_NUTS) && !Randomizer_GetSettingValue(RSK_SHUFFLE_DEKU_NUT_BAG)) {
GiveLinkDekuNuts(20);
}
+ if (Randomizer_GetSettingValue(RSK_STARTING_MASTER_SWORD)) {
+ if (startingAge == RO_AGE_ADULT) {
+ Item_Give(NULL, ITEM_SWORD_MASTER);
+ } else {
+ gSaveContext.inventory.equipment |= 1 << 1;
+ }
+ }
if (Randomizer_GetSettingValue(RSK_FULL_WALLETS)) {
GiveLinkRupees(9001);