mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2024-12-22 08:08:53 -05:00
use forest enum values instead of magic numbers (#2038)
This commit is contained in:
parent
17c6a3653c
commit
06df45efc7
@ -554,7 +554,7 @@ const std::vector<PresetEntry> s6PresetEntries = {
|
||||
PRESET_ENTRY_S32("gRandomizeCuccosToReturn", 4),
|
||||
PRESET_ENTRY_S32("gRandomizeDoorOfTime", RO_DOOROFTIME_OPEN),
|
||||
PRESET_ENTRY_STRING("gRandomizeExcludedLocations", "48,"),
|
||||
PRESET_ENTRY_S32("gRandomizeForest", 1),
|
||||
PRESET_ENTRY_S32("gRandomizeForest", RO_FOREST_CLOSED_DEKU),
|
||||
PRESET_ENTRY_S32("gRandomizeGanonTrial", 0),
|
||||
PRESET_ENTRY_S32("gRandomizeGerudoFortress", RO_GF_FAST),
|
||||
PRESET_ENTRY_S32("gRandomizeIceTraps", RO_ICE_TRAPS_OFF),
|
||||
@ -590,7 +590,7 @@ const std::vector<PresetEntry> hellModePresetEntries = {
|
||||
PRESET_ENTRY_S32("gRandomizeDoorOfTime", RO_DOOROFTIME_OPEN),
|
||||
PRESET_ENTRY_S32("gRandomizeEnableBombchuDrops", 1),
|
||||
PRESET_ENTRY_S32("gRandomizeEnableGlitchCutscenes", 1),
|
||||
PRESET_ENTRY_S32("gRandomizeForest", 2),
|
||||
PRESET_ENTRY_S32("gRandomizeForest", RO_FOREST_OPEN),
|
||||
PRESET_ENTRY_S32("gRandomizeGanonTrial", 2),
|
||||
PRESET_ENTRY_S32("gRandomizeGanonTrialCount", 6),
|
||||
PRESET_ENTRY_S32("gRandomizeGerudoKeys", 3),
|
||||
|
@ -596,9 +596,9 @@ void Randomizer::ParseRandomizerSettingsFile(const char* spoilerFileName) {
|
||||
if(it.value() == "Closed") {
|
||||
gSaveContext.randoSettings[index].value = RO_FOREST_CLOSED;
|
||||
} else if(it.value() == "Open") {
|
||||
gSaveContext.randoSettings[index].value = RO_FOREST_CLOSED_DEKU;
|
||||
} else if(it.value() == "Closed Deku") {
|
||||
gSaveContext.randoSettings[index].value = RO_FOREST_OPEN;
|
||||
} else if(it.value() == "Closed Deku") {
|
||||
gSaveContext.randoSettings[index].value = RO_FOREST_CLOSED_DEKU;
|
||||
}
|
||||
break;
|
||||
case RSK_KAK_GATE:
|
||||
@ -2566,7 +2566,7 @@ void GenerateRandomizerImgui() {
|
||||
|
||||
std::unordered_map<RandomizerSettingKey, u8> cvarSettings;
|
||||
cvarSettings[RSK_LOGIC_RULES] = CVar_GetS32("gRandomizeLogicRules", 0);
|
||||
cvarSettings[RSK_FOREST] = CVar_GetS32("gRandomizeForest", 0);
|
||||
cvarSettings[RSK_FOREST] = CVar_GetS32("gRandomizeForest", RO_FOREST_CLOSED);
|
||||
cvarSettings[RSK_KAK_GATE] = CVar_GetS32("gRandomizeKakarikoGate", RO_KAK_GATE_CLOSED);
|
||||
cvarSettings[RSK_DOOR_OF_TIME] = CVar_GetS32("gRandomizeDoorOfTime", RO_DOOROFTIME_CLOSED);
|
||||
cvarSettings[RSK_ZORAS_FOUNTAIN] = CVar_GetS32("gRandomizeZorasFountain", 0);
|
||||
@ -2896,7 +2896,7 @@ void DrawRandoEditor(bool& open) {
|
||||
//Disabled when Forest is set to Closed or under very specific conditions
|
||||
//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("gRandomizeForest", RO_FOREST_CLOSED) == RO_FOREST_CLOSED) ||
|
||||
((CVar_GetS32("gRandomizeDoorOfTime", RO_DOOROFTIME_CLOSED) == RO_DOOROFTIME_CLOSED) &&
|
||||
(CVar_GetS32("gRandomizeShuffleOcarinas", 0) == 0))); // ocarinas not shuffled
|
||||
|
||||
|
@ -372,15 +372,15 @@ void Sram_InitSave(FileChooseContext* fileChooseCtx) {
|
||||
|
||||
int openForest = Randomizer_GetSettingValue(RSK_FOREST);
|
||||
switch (openForest) {
|
||||
case 0: // closed
|
||||
case RO_FOREST_CLOSED:
|
||||
break;
|
||||
case 1: // open
|
||||
case RO_FOREST_CLOSED_DEKU:
|
||||
Flags_SetEventChkInf(7);
|
||||
break;
|
||||
case RO_FOREST_OPEN:
|
||||
Flags_SetEventChkInf(7);
|
||||
gSaveContext.eventChkInf[0] |= 0x10;
|
||||
break;
|
||||
case 2: // closed deku
|
||||
Flags_SetEventChkInf(7);
|
||||
break;
|
||||
}
|
||||
|
||||
int startingAge = Randomizer_GetSettingValue(RSK_STARTING_AGE);
|
||||
|
@ -487,7 +487,6 @@ u8 EnMd_ShouldSpawn(EnMd* this, PlayState* play) {
|
||||
// if we have beaten deku tree or have open forest turned on
|
||||
// or have already shown mido we have an equipped sword/shield
|
||||
if (Flags_GetRandomizerInf(RAND_INF_DUNGEONS_DONE_DEKU_TREE) ||
|
||||
Randomizer_GetSettingValue(RSK_FOREST) == 1 ||
|
||||
gSaveContext.eventChkInf[0] & 0x10) {
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user