diff --git a/soh/soh/Enhancements/presets.h b/soh/soh/Enhancements/presets.h index b5c54de06..02768cb86 100644 --- a/soh/soh/Enhancements/presets.h +++ b/soh/soh/Enhancements/presets.h @@ -4,6 +4,7 @@ #include #include #include +#include "soh/Enhancements/randomizer/randomizerTypes.h" enum PresetEntryType { PRESET_ENTRY_TYPE_S32, @@ -551,7 +552,7 @@ const std::vector s6PresetEntries = { PRESET_ENTRY_S32("gMMBunnyHood", 2), PRESET_ENTRY_S32("gRandomizeBigPoeTargetCount", 1), PRESET_ENTRY_S32("gRandomizeCuccosToReturn", 4), - PRESET_ENTRY_S32("gRandomizeDoorOfTime", 2), + PRESET_ENTRY_S32("gRandomizeDoorOfTime", RO_DOOROFTIME_OPEN), PRESET_ENTRY_STRING("gRandomizeExcludedLocations", "48,"), PRESET_ENTRY_S32("gRandomizeForest", 1), PRESET_ENTRY_S32("gRandomizeGanonTrial", 0), @@ -586,7 +587,7 @@ const std::vector hellModePresetEntries = { PRESET_ENTRY_S32("gRandomizeBossKeysanity", 5), PRESET_ENTRY_S32("gRandomizeCompleteMaskQuest", 1), PRESET_ENTRY_S32("gRandomizeCuccosToReturn", 1), - PRESET_ENTRY_S32("gRandomizeDoorOfTime", 2), + PRESET_ENTRY_S32("gRandomizeDoorOfTime", RO_DOOROFTIME_OPEN), PRESET_ENTRY_S32("gRandomizeEnableBombchuDrops", 1), PRESET_ENTRY_S32("gRandomizeEnableGlitchCutscenes", 1), PRESET_ENTRY_S32("gRandomizeForest", 2), diff --git a/soh/soh/Enhancements/randomizer/randomizer.cpp b/soh/soh/Enhancements/randomizer/randomizer.cpp index d554714af..a6ebc50f9 100644 --- a/soh/soh/Enhancements/randomizer/randomizer.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer.cpp @@ -2562,7 +2562,7 @@ void GenerateRandomizerImgui() { cvarSettings[RSK_LOGIC_RULES] = CVar_GetS32("gRandomizeLogicRules", 0); cvarSettings[RSK_FOREST] = CVar_GetS32("gRandomizeForest", 0); cvarSettings[RSK_KAK_GATE] = CVar_GetS32("gRandomizeKakarikoGate", 0); - cvarSettings[RSK_DOOR_OF_TIME] = CVar_GetS32("gRandomizeDoorOfTime", 0); + cvarSettings[RSK_DOOR_OF_TIME] = CVar_GetS32("gRandomizeDoorOfTime", RO_DOOROFTIME_CLOSED); cvarSettings[RSK_ZORAS_FOUNTAIN] = CVar_GetS32("gRandomizeZorasFountain", 0); cvarSettings[RSK_STARTING_AGE] = CVar_GetS32("gRandomizeStartingAge", 0); cvarSettings[RSK_GERUDO_FORTRESS] = CVar_GetS32("gRandomizeGerudoFortress", 0); @@ -2890,7 +2890,7 @@ void DrawRandoEditor(bool& open) { //RANDOTODO: Replace magic number checks with enums bool disableRandoStartingAge = (CVar_GetS32("gRandomizeLogicRules", 0) == 0) && // glitchless logic ((CVar_GetS32("gRandomizeForest", 0) == 0) || // Closed Forest - ((CVar_GetS32("gRandomizeDoorOfTime", 0) == 0) && // Closed Door of Time + ((CVar_GetS32("gRandomizeDoorOfTime", RO_DOOROFTIME_CLOSED) == RO_DOOROFTIME_CLOSED) && (CVar_GetS32("gRandomizeShuffleOcarinas", 0) == 0))); // ocarinas not shuffled const char* disableRandoStartingAgeText = "This option is disabled due to other options making the game unbeatable."; diff --git a/soh/soh/Enhancements/randomizer/randomizerTypes.h b/soh/soh/Enhancements/randomizer/randomizerTypes.h index 9a50db4de..8af56dc70 100644 --- a/soh/soh/Enhancements/randomizer/randomizerTypes.h +++ b/soh/soh/Enhancements/randomizer/randomizerTypes.h @@ -1085,10 +1085,10 @@ typedef enum RandoOption { RO_FOREST_CLOSED_DEKU, RO_FOREST_OPEN, - //Door of Time settings (open, song only, closed) - RO_DOOROFTIME_OPEN = 0, + //Door of Time settings (closed, song only, open) + RO_DOOROFTIME_CLOSED = 0, RO_DOOROFTIME_SONGONLY, - RO_DOOROFTIME_CLOSED, + RO_DOOROFTIME_OPEN, //Zora's Fountain settings (closed, closed as child, open) RO_ZF_CLOSED = 0, diff --git a/soh/src/code/z_sram.c b/soh/src/code/z_sram.c index 9337e7ce8..797a96177 100644 --- a/soh/src/code/z_sram.c +++ b/soh/src/code/z_sram.c @@ -399,7 +399,7 @@ void Sram_InitSave(FileChooseContext* fileChooseCtx) { int doorOfTime = Randomizer_GetSettingValue(RSK_DOOR_OF_TIME); switch (doorOfTime) { - case 0: // open + case RO_DOOROFTIME_OPEN: gSaveContext.eventChkInf[4] |= 0x800; break; } diff --git a/soh/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c b/soh/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c index d61528867..3c4b769cc 100644 --- a/soh/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c +++ b/soh/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c @@ -234,7 +234,7 @@ void func_80ABF4C8(EnOkarinaTag* this, PlayState* play) { if (play->msgCtx.ocarinaMode == OCARINA_MODE_04) { this->actionFunc = func_80ABF28C; } else if (play->msgCtx.ocarinaMode == OCARINA_MODE_03) { - if (!gSaveContext.n64ddFlag || (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_DOOR_OF_TIME) != 2)) { + if (!gSaveContext.n64ddFlag || (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_DOOR_OF_TIME) != RO_DOOROFTIME_CLOSED)) { func_80078884(NA_SE_SY_CORRECT_CHIME); } if (this->switchFlag >= 0) { @@ -257,8 +257,7 @@ void func_80ABF4C8(EnOkarinaTag* this, PlayState* play) { break; case 4: if (gSaveContext.n64ddFlag) { - int doorOfTime = Randomizer_GetSettingValue(RSK_DOOR_OF_TIME); - if (doorOfTime == 2 && + if (Randomizer_GetSettingValue(RSK_DOOR_OF_TIME) == RO_DOOROFTIME_CLOSED && (INV_CONTENT(ITEM_OCARINA_FAIRY) != ITEM_OCARINA_TIME || !CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD) || !CHECK_QUEST_ITEM(QUEST_GORON_RUBY) || !CHECK_QUEST_ITEM(QUEST_ZORA_SAPPHIRE))) {