rando: remove vanilla (#5805)

This commit is contained in:
Philip Dubé
2025-10-13 22:10:51 +00:00
committed by GitHub
parent e254c1f908
commit 73f3427ced
8 changed files with 136 additions and 196 deletions

View File

@@ -973,8 +973,7 @@ static void RandomizeDungeonRewards() {
return Rando::StaticData::RetrieveItem(i).GetItemType() == ITEMTYPE_DUNGEONREWARD; return Rando::StaticData::RetrieveItem(i).GetItemType() == ITEMTYPE_DUNGEONREWARD;
}); });
if (ctx->GetOption(RSK_LOGIC_RULES).Is(RO_LOGIC_VANILLA) || if (ctx->GetOption(RSK_SHUFFLE_DUNGEON_REWARDS)
ctx->GetOption(RSK_SHUFFLE_DUNGEON_REWARDS)
.Is(RO_DUNGEON_REWARDS_VANILLA)) { // Place dungeon rewards in vanilla locations .Is(RO_DUNGEON_REWARDS_VANILLA)) { // Place dungeon rewards in vanilla locations
for (RandomizerCheck loc : Rando::StaticData::dungeonRewardLocations) { for (RandomizerCheck loc : Rando::StaticData::dungeonRewardLocations) {
ctx->GetItemLocation(loc)->PlaceVanillaItem(); ctx->GetItemLocation(loc)->PlaceVanillaItem();

View File

@@ -65,14 +65,10 @@ int Playthrough_Init(uint32_t seed, std::set<RandomizerCheck> excludedLocations,
Random_Init(finalHash); Random_Init(finalHash);
ctx->SetHash(std::to_string(finalHash)); ctx->SetHash(std::to_string(finalHash));
if (ctx->GetOption(RSK_LOGIC_RULES).Is(RO_LOGIC_VANILLA)) {
VanillaFill(); // Just place items in their vanilla locations
} else { // Fill locations with logic
int ret = Fill(); int ret = Fill();
if (ret < 0) { if (ret < 0) {
return ret; return ret;
} }
}
GenerateHash(); GenerateHash();

View File

@@ -124,8 +124,7 @@ void Context::PlaceItemInLocation(const RandomizerCheck locKey, const Randomizer
SPDLOG_DEBUG(StaticData::RetrieveItem(item).GetName().GetEnglish() + " placed at " + SPDLOG_DEBUG(StaticData::RetrieveItem(item).GetName().GetEnglish() + " placed at " +
StaticData::GetLocation(locKey)->GetName() + "\n"); StaticData::GetLocation(locKey)->GetName() + "\n");
if (applyEffectImmediately || mOptions[RSK_LOGIC_RULES].Is(RO_LOGIC_GLITCHLESS) || if (applyEffectImmediately || mOptions[RSK_LOGIC_RULES].Is(RO_LOGIC_GLITCHLESS)) {
mOptions[RSK_LOGIC_RULES].Is(RO_LOGIC_VANILLA)) {
StaticData::RetrieveItem(item).ApplyEffect(); StaticData::RetrieveItem(item).ApplyEffect();
} }

View File

@@ -754,11 +754,7 @@ void Settings::CreateOptionDescriptions() {
"Glitchless - No glitches are required, but may require some minor tricks. Additional tricks may be enabled " "Glitchless - No glitches are required, but may require some minor tricks. Additional tricks may be enabled "
"and disabled below.\n" "and disabled below.\n"
"\n" "\n"
//"Glitched - Glitches may be required to beat the game. You can disable and enable glitches below.\n" "No logic - Item placement is completely random. MAY BE IMPOSSIBLE TO BEAT.";
//"\n"
"No logic - Item placement is completely random. MAY BE IMPOSSIBLE TO BEAT.\n"
"\n"
"Vanilla - Places all items and dungeon rewards in their vanilla locations.";
mOptionDescriptions[RSK_ALL_LOCATIONS_REACHABLE] = "When this options is enabled, the randomizer will " mOptionDescriptions[RSK_ALL_LOCATIONS_REACHABLE] = "When this options is enabled, the randomizer will "
"guarantee that every item is obtainable and every " "guarantee that every item is obtainable and every "
"location is reachable. When disabled, only " "location is reachable. When disabled, only "

View File

@@ -4009,32 +4009,24 @@ void RandomizerSettingsWindow::DrawElement() {
if (ImGui::BeginTabItem("Items")) { if (ImGui::BeginTabItem("Items")) {
ImGui::PushStyleVar(ImGuiStyleVar_CellPadding, cellPadding); ImGui::PushStyleVar(ImGuiStyleVar_CellPadding, cellPadding);
ImGui::BeginDisabled(CVarGetInteger(CVAR_RANDOMIZER_SETTING("LogicRules"), RO_LOGIC_GLITCHLESS) ==
RO_LOGIC_VANILLA);
if (mSettings->GetOptionGroup(RSG_ITEMS_IMGUI_TABLE).RenderImGui()) { if (mSettings->GetOptionGroup(RSG_ITEMS_IMGUI_TABLE).RenderImGui()) {
mNeedsUpdate = true; mNeedsUpdate = true;
} }
ImGui::EndDisabled();
ImGui::PopStyleVar(1); ImGui::PopStyleVar(1);
ImGui::EndTabItem(); ImGui::EndTabItem();
} }
if (ImGui::BeginTabItem("Gameplay")) { if (ImGui::BeginTabItem("Gameplay")) {
ImGui::BeginDisabled(CVarGetInteger(CVAR_RANDOMIZER_SETTING("LogicRules"), RO_LOGIC_GLITCHLESS) ==
RO_LOGIC_VANILLA);
ImGui::PushStyleVar(ImGuiStyleVar_CellPadding, cellPadding); ImGui::PushStyleVar(ImGuiStyleVar_CellPadding, cellPadding);
if (mSettings->GetOptionGroup(RSG_GAMEPLAY_IMGUI_TABLE).RenderImGui()) { if (mSettings->GetOptionGroup(RSG_GAMEPLAY_IMGUI_TABLE).RenderImGui()) {
mNeedsUpdate = true; mNeedsUpdate = true;
} }
ImGui::EndDisabled();
ImGui::PopStyleVar(1); ImGui::PopStyleVar(1);
ImGui::EndTabItem(); ImGui::EndTabItem();
} }
if (ImGui::BeginTabItem("Locations")) { if (ImGui::BeginTabItem("Locations")) {
ImGui::BeginDisabled(CVarGetInteger(CVAR_SETTING("DisableChanges"), 0) || disableEditingRandoSettings || ImGui::BeginDisabled(CVarGetInteger(CVAR_SETTING("DisableChanges"), 0) || disableEditingRandoSettings);
CVarGetInteger(CVAR_RANDOMIZER_SETTING("LogicRules"), RO_LOGIC_GLITCHLESS) ==
RO_LOGIC_VANILLA);
ImGui::PushStyleVar(ImGuiStyleVar_CellPadding, cellPadding); ImGui::PushStyleVar(ImGuiStyleVar_CellPadding, cellPadding);
if (!locationsTabOpen) { if (!locationsTabOpen) {
locationsTabOpen = true; locationsTabOpen = true;
@@ -4208,19 +4200,11 @@ void RandomizerSettingsWindow::DrawElement() {
mNeedsUpdate = true; mNeedsUpdate = true;
} }
} }
if (CVarGetInteger(CVAR_RANDOMIZER_SETTING("LogicRules"), RO_LOGIC_GLITCHLESS) == RO_LOGIC_VANILLA) {
ImGui::SameLine();
ImGui::TextColored(
ImVec4(1.0f, 0.0f, 0.0f, 1.0f),
"Heads up! This will disable all rando settings except for entrance shuffle and starter items");
}
ImGui::PopItemWidth(); ImGui::PopItemWidth();
ImGui::EndTable(); ImGui::EndTable();
} }
ImGui::BeginDisabled(CVarGetInteger(CVAR_SETTING("DisableChanges"), 0) || disableEditingRandoSettings || ImGui::BeginDisabled(CVarGetInteger(CVAR_SETTING("DisableChanges"), 0) || disableEditingRandoSettings);
CVarGetInteger(CVAR_RANDOMIZER_SETTING("LogicRules"), RO_LOGIC_GLITCHLESS) ==
RO_LOGIC_VANILLA);
// Tricks // Tricks
static std::unordered_map<RandomizerArea, bool> areaTreeDisabled{ static std::unordered_map<RandomizerArea, bool> areaTreeDisabled{

View File

@@ -6522,7 +6522,6 @@ typedef enum {
typedef enum { typedef enum {
RO_LOGIC_GLITCHLESS, RO_LOGIC_GLITCHLESS,
RO_LOGIC_NO_LOGIC, RO_LOGIC_NO_LOGIC,
RO_LOGIC_VANILLA,
} RandoOptionLogic; } RandoOptionLogic;
// Damage Multiplier // Damage Multiplier

View File

@@ -1554,7 +1554,7 @@ bool IsCheckShuffled(RandomizerCheck rc) {
if (loc->GetRCType() == RCTYPE_SHOP) { if (loc->GetRCType() == RCTYPE_SHOP) {
auto identity = OTRGlobals::Instance->gRandomizer->IdentifyShopItem(loc->GetScene(), loc->GetActorParams() + 1); auto identity = OTRGlobals::Instance->gRandomizer->IdentifyShopItem(loc->GetScene(), loc->GetActorParams() + 1);
} }
if (IS_RANDO && OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_LOGIC_RULES) != RO_LOGIC_VANILLA) { if (IS_RANDO) {
return (loc->GetArea() != RCAREA_INVALID) && // don't show Invalid locations return (loc->GetArea() != RCAREA_INVALID) && // don't show Invalid locations
(loc->GetRCType() != RCTYPE_GOSSIP_STONE) && // TODO: Don't show hints until tracker supports them (loc->GetRCType() != RCTYPE_GOSSIP_STONE) && // TODO: Don't show hints until tracker supports them
(loc->GetRCType() != RCTYPE_STATIC_HINT) && // TODO: Don't show hints until tracker supports them (loc->GetRCType() != RCTYPE_STATIC_HINT) && // TODO: Don't show hints until tracker supports them

View File

@@ -332,7 +332,7 @@ void Settings::CreateOptions() {
OPT_U8(RSK_STARTING_SKULLTULA_TOKEN, "Gold Skulltula Tokens", {NumOpts(0, 100)}, OptionCategory::Setting, CVAR_RANDOMIZER_SETTING("StartingSkulltulaToken"), "", WidgetType::Slider); OPT_U8(RSK_STARTING_SKULLTULA_TOKEN, "Gold Skulltula Tokens", {NumOpts(0, 100)}, OptionCategory::Setting, CVAR_RANDOMIZER_SETTING("StartingSkulltulaToken"), "", WidgetType::Slider);
OPT_U8(RSK_STARTING_HEARTS, "Starting Hearts", {NumOpts(1, 20)}, OptionCategory::Setting, CVAR_RANDOMIZER_SETTING("StartingHearts"), "", WidgetType::Slider, 2); OPT_U8(RSK_STARTING_HEARTS, "Starting Hearts", {NumOpts(1, 20)}, OptionCategory::Setting, CVAR_RANDOMIZER_SETTING("StartingHearts"), "", WidgetType::Slider, 2);
// TODO: Remainder of Starting Items // TODO: Remainder of Starting Items
OPT_U8(RSK_LOGIC_RULES, "Logic", {"Glitchless", "No Logic", "Vanilla"}, OptionCategory::Setting, CVAR_RANDOMIZER_SETTING("LogicRules"), mOptionDescriptions[RSK_LOGIC_RULES], WidgetType::Combobox, RO_LOGIC_GLITCHLESS); OPT_U8(RSK_LOGIC_RULES, "Logic", {"Glitchless", "No Logic"}, OptionCategory::Setting, CVAR_RANDOMIZER_SETTING("LogicRules"), mOptionDescriptions[RSK_LOGIC_RULES], WidgetType::Combobox, RO_LOGIC_GLITCHLESS);
OPT_BOOL(RSK_ALL_LOCATIONS_REACHABLE, "All Locations Reachable", {"Off", "On"}, OptionCategory::Setting, CVAR_RANDOMIZER_SETTING("AllLocationsReachable"), mOptionDescriptions[RSK_ALL_LOCATIONS_REACHABLE], WidgetType::Checkbox, RO_GENERIC_ON); OPT_BOOL(RSK_ALL_LOCATIONS_REACHABLE, "All Locations Reachable", {"Off", "On"}, OptionCategory::Setting, CVAR_RANDOMIZER_SETTING("AllLocationsReachable"), mOptionDescriptions[RSK_ALL_LOCATIONS_REACHABLE], WidgetType::Checkbox, RO_GENERIC_ON);
OPT_BOOL(RSK_SKULLS_SUNS_SONG, "Night Skulltula's Expect Sun's Song", CVAR_RANDOMIZER_SETTING("GsExpectSunsSong"), mOptionDescriptions[RSK_SKULLS_SUNS_SONG]); OPT_BOOL(RSK_SKULLS_SUNS_SONG, "Night Skulltula's Expect Sun's Song", CVAR_RANDOMIZER_SETTING("GsExpectSunsSong"), mOptionDescriptions[RSK_SKULLS_SUNS_SONG]);
OPT_U8(RSK_DAMAGE_MULTIPLIER, "Damage Multiplier", {"x1/2", "x1", "x2", "x4", "x8", "x16", "OHKO"}, OptionCategory::Setting, "", "", WidgetType::Slider, RO_DAMAGE_MULTIPLIER_DEFAULT); OPT_U8(RSK_DAMAGE_MULTIPLIER, "Damage Multiplier", {"x1/2", "x1", "x2", "x4", "x8", "x16", "OHKO"}, OptionCategory::Setting, "", "", WidgetType::Slider, RO_DAMAGE_MULTIPLIER_DEFAULT);
@@ -1845,34 +1845,12 @@ void Settings::UpdateOptionProperties() {
mOptions[RSK_RAINBOW_BRIDGE_REWARD_COUNT].Hide(); mOptions[RSK_RAINBOW_BRIDGE_REWARD_COUNT].Hide();
mOptions[RSK_RAINBOW_BRIDGE_DUNGEON_COUNT].Hide(); mOptions[RSK_RAINBOW_BRIDGE_DUNGEON_COUNT].Hide();
mOptions[RSK_RAINBOW_BRIDGE_TOKEN_COUNT].Hide(); mOptions[RSK_RAINBOW_BRIDGE_TOKEN_COUNT].Hide();
if (CVarGetInteger(CVAR_RANDOMIZER_SETTING("LogicRules"), RO_LOGIC_GLITCHLESS) == RO_LOGIC_VANILLA) {
mOptionGroups[RSG_AREA_ACCESS_IMGUI].Disable();
mOptions[RSK_STARTING_AGE].Disable("");
mOptions[RSK_GERUDO_FORTRESS].Disable("");
mOptions[RSK_RAINBOW_BRIDGE].Disable("");
mOptions[RSK_BRIDGE_OPTIONS].Disable("");
mOptions[RSK_RAINBOW_BRIDGE_STONE_COUNT].Disable("");
mOptions[RSK_RAINBOW_BRIDGE_MEDALLION_COUNT].Disable("");
mOptions[RSK_RAINBOW_BRIDGE_REWARD_COUNT].Disable("");
mOptions[RSK_RAINBOW_BRIDGE_DUNGEON_COUNT].Disable("");
mOptions[RSK_RAINBOW_BRIDGE_TOKEN_COUNT].Disable("");
mOptions[RSK_GANONS_TRIALS].Disable("");
mOptions[RSK_TRIAL_COUNT].Disable("");
mOptions[RSK_TRIFORCE_HUNT].Disable("");
mOptions[RSK_TRIFORCE_HUNT_PIECES_TOTAL].Disable("");
mOptions[RSK_TRIFORCE_HUNT_PIECES_REQUIRED].Disable("");
mOptionGroups[RSG_ITEMS_IMGUI_TABLE].Disable();
mOptionGroups[RSG_GAMEPLAY_IMGUI_TABLE].Disable();
mOptions[RSK_LINKS_POCKET].Disable("");
mOptions[RSK_STARTING_OCARINA].Disable("");
} else {
mOptionGroups[RSG_AREA_ACCESS_IMGUI].Enable(); mOptionGroups[RSG_AREA_ACCESS_IMGUI].Enable();
// Starting Age - Disabled when Forest is set to Closed or under very specific conditions // Starting Age - Disabled when Forest is set to Closed or under very specific conditions
if (CVarGetInteger(CVAR_RANDOMIZER_SETTING("DoorOfTime"), RO_DOOROFTIME_CLOSED) == RO_DOOROFTIME_CLOSED && if (CVarGetInteger(CVAR_RANDOMIZER_SETTING("DoorOfTime"), RO_DOOROFTIME_CLOSED) == RO_DOOROFTIME_CLOSED &&
CVarGetInteger(CVAR_RANDOMIZER_SETTING("ShuffleOcarinas"), RO_GENERIC_OFF) == CVarGetInteger(CVAR_RANDOMIZER_SETTING("ShuffleOcarinas"), RO_GENERIC_OFF) ==
RO_GENERIC_OFF) /* closed door of time with ocarina shuffle off */ { RO_GENERIC_OFF) /* closed door of time with ocarina shuffle off */ {
mOptions[RSK_STARTING_AGE].Disable( mOptions[RSK_STARTING_AGE].Disable("This option is disabled due to other options making the game unbeatable.");
"This option is disabled due to other options making the game unbeatable.");
} else { } else {
mOptions[RSK_STARTING_AGE].Enable(); mOptions[RSK_STARTING_AGE].Enable();
} }
@@ -1884,8 +1862,7 @@ void Settings::UpdateOptionProperties() {
mOptions[RSK_RAINBOW_BRIDGE_REWARD_COUNT].Enable(); mOptions[RSK_RAINBOW_BRIDGE_REWARD_COUNT].Enable();
mOptions[RSK_RAINBOW_BRIDGE_DUNGEON_COUNT].Enable(); mOptions[RSK_RAINBOW_BRIDGE_DUNGEON_COUNT].Enable();
mOptions[RSK_RAINBOW_BRIDGE_TOKEN_COUNT].Enable(); mOptions[RSK_RAINBOW_BRIDGE_TOKEN_COUNT].Enable();
const uint8_t bridgeOpt = const uint8_t bridgeOpt = CVarGetInteger(CVAR_RANDOMIZER_SETTING("BridgeRewardOptions"), RO_BRIDGE_STANDARD_REWARD);
CVarGetInteger(CVAR_RANDOMIZER_SETTING("BridgeRewardOptions"), RO_BRIDGE_STANDARD_REWARD);
switch (CVarGetInteger(CVAR_RANDOMIZER_SETTING("RainbowBridge"), RO_BRIDGE_VANILLA)) { switch (CVarGetInteger(CVAR_RANDOMIZER_SETTING("RainbowBridge"), RO_BRIDGE_VANILLA)) {
case RO_BRIDGE_STONES: case RO_BRIDGE_STONES:
// Show Bridge Options and Stone Count slider // Show Bridge Options and Stone Count slider
@@ -1996,7 +1973,6 @@ void Settings::UpdateOptionProperties() {
mOptions[RSK_LINKS_POCKET].Enable(); mOptions[RSK_LINKS_POCKET].Enable();
} }
mOptions[RSK_STARTING_OCARINA].Enable(); mOptions[RSK_STARTING_OCARINA].Enable();
}
// Don't show any MQ options if both quests aren't available // Don't show any MQ options if both quests aren't available
if (!(OTRGlobals::Instance->HasMasterQuest() && OTRGlobals::Instance->HasOriginal())) { if (!(OTRGlobals::Instance->HasMasterQuest() && OTRGlobals::Instance->HasOriginal())) {
@@ -2913,15 +2889,6 @@ void Context::FinalizeSettings(const std::set<RandomizerCheck>& excludedLocation
mLACSCondition = RO_LACS_VANILLA; mLACSCondition = RO_LACS_VANILLA;
} }
if (mOptions[RSK_LOGIC_RULES].Is(RO_LOGIC_VANILLA)) {
for (OptionValue* setting : VanillaLogicDefaults) {
// setting->SetDelayedOption();
setting->Set(0);
}
// mOptions[RSK_KEYSANITY].SetDelayedOption();
mOptions[RSK_KEYSANITY].Set(3);
}
if (!mOptions[RSK_SHUFFLE_WARP_SONGS]) { if (!mOptions[RSK_SHUFFLE_WARP_SONGS]) {
mOptions[RSK_WARP_SONG_HINTS].Set(RO_GENERIC_OFF); mOptions[RSK_WARP_SONG_HINTS].Set(RO_GENERIC_OFF);
} }