fix: rando door of time enum usage (#2032)

This commit is contained in:
briaguya 2022-11-28 16:41:33 -05:00 committed by GitHub
parent 97e612b921
commit 0424c5aaf3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 11 additions and 11 deletions

View File

@ -4,6 +4,7 @@
#include <vector>
#include <variant>
#include <cstdint>
#include "soh/Enhancements/randomizer/randomizerTypes.h"
enum PresetEntryType {
PRESET_ENTRY_TYPE_S32,
@ -551,7 +552,7 @@ const std::vector<PresetEntry> 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<PresetEntry> 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),

View File

@ -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.";

View File

@ -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,

View File

@ -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;
}

View File

@ -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))) {