Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions source/fill.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -871,6 +871,17 @@ int Fill() {
//Then place dungeon items that are assigned to restrictive location pools
RandomizeDungeonItems();

//If Ocarina is shuffled place that first
if (StartingOcarina.Value<u8>() == 0) {
//Get acceptable Ocarina Locations
std::vector<LocationKey> ocarinaLocations = FilterFromPool(allLocations, []( const LocationKey loc) {return Location(loc)->IsCategory(Category::cNoOcarinaStart);});
std::vector<ItemKey> ocarinaItem = FilterAndEraseFromPool(ItemPool, [](const ItemKey i) { return ItemTable(i).GetItemId()==(u32)GetItemID::GI_OCARINA_OF_TIME; });
//reuse NoRepeatOnTokens variable because making a new one is stupid
NoRepeatOnTokens = true;
AssumedFill(ocarinaItem, ocarinaLocations, true);
NoRepeatOnTokens = false;
}

if (ShuffleGFRewards.Is((u8)GreatFairyRewardShuffleSetting::GFREWARDSHUFFLE_ALL_GREAT_FARIES)){
//get GF locations
std::vector<LocationKey> gfLocations = FilterFromPool(allLocations, [](const LocationKey loc) {return Location(loc)->IsCategory(Category::cFairyFountain);});
Expand Down
1 change: 1 addition & 0 deletions source/include/category.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ enum class Category {
cMoonItems,
cFDM,
cMainInventory,
cNoOcarinaStart,
};

enum class OptionCategory {
Expand Down
480 changes: 240 additions & 240 deletions source/item_location.cpp

Large diffs are not rendered by default.

9 changes: 8 additions & 1 deletion source/item_pool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -889,7 +889,6 @@ void GenerateItemPool() {

//Fixed Item Locations
PlaceItemInLocation(MAJORA, MAJORAS_MASK, true);
PlaceItemInLocation(CLOCK_TOWER_OCARINA_OF_TIME, OCARINA_OF_TIME, true);
PlaceItemInLocation(WOODFALL_TEMPLE_DEKU_PRINCESS, DEKU_PRINCESS);
PlaceItemInLocation(W_CLOCK_TOWN_BOMB_BAG_BUY, PROGRESSIVE_BOMB_BAG);
PlaceItemInLocation(W_CLOCK_TOWN_BIG_BOMB_BAG_BUY, PROGRESSIVE_BOMB_BAG);
Expand All @@ -913,6 +912,14 @@ void GenerateItemPool() {
PlaceItemInLocation(SWAMP_TOURIST_CENTER_ROOF_CLEAR, BLUE_RUPEE);
//Check Non Dungeon Settings

//OCARINA SHUFFLE
if(StartingOcarina.Value<u8>() == 0) {//If starting without ocarina add it to pool
AddItemToMainPool(OCARINA_OF_TIME, 1);
}
else { //else place it vanilla cause we start with it
PlaceItemInLocation(CLOCK_TOWER_OCARINA_OF_TIME, OCARINA_OF_TIME, true);
}

//KOKIRISWORD SHUFFLE
if(StartingKokiriSword.Value<u8>() == (u8)StartingSwordSetting::STARTINGSWORD_NONE) {//if starting with no sword we need to add an extra to the pool
AddItemToMainPool(PROGRESSIVE_SWORD, 1);
Expand Down
39 changes: 22 additions & 17 deletions source/settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,9 @@ namespace Settings {
Option StartingConsumables = Option::Bool("Start with Consumables", { "No", "Yes" }, { startWithConsumablesDesc });
Option StartingMaxRupees = Option::Bool("Start with Max Rupees", { "No", "Yes" }, { startWithMaxRupeesDesc });
Option StartingInventoryToggle = Option::U8("Inventory", { "All Off", "All On", "Choose" }, { "" });
Option StartingNutCapacity = Option::U8("Deku Nuts", { "None", "20 Deku Nuts", "30 Deku Nuts", "40 Deku Nuts" }, { "" });
Option StartingOcarina = Option::U8("Ocarina", { "Ocarina of Time", "Ocarina of Time" }, { "" }, OptionCategory::Toggle, 1);
Option StartingNotebook = Option::U8("Bomber's Notebook", { "None", "B. Notebook"}, { "" });
Option StartingNutCapacity = Option::U8("Deku Nuts", { "None", "20 Deku Nuts", "30 Deku Nuts", "40 Deku Nuts" }, { "" });
Option StartingOcarina = Option::U8("Ocarina", { "None", "Ocarina of Time" }, { "" }, OptionCategory::Setting, 1);
Option StartingNotebook = Option::U8("Bomber's Notebook", { "None", "B. Notebook"}, { "" });
Option StartingBombBag = Option::U8("Bomb Bag", { "None", "Bomb Bag 20", "Bomb Bag 30", "Bomb Bag 40" }, { "" });
Option StartingBombchus = Option::U8("Bombchus", { "None", "Bombchus" }, { "" });
Option StartingHookshot = Option::U8("Hookshot", { "None", "Hookshot" }, { "" });
Expand Down Expand Up @@ -153,8 +153,8 @@ namespace Settings {
Option StartingGohtRemains = Option::U8("Goht's Remains", { "None", "Goht's R." }, { "" });
Option StartingGyorgRemains = Option::U8("Gyorg's Remains", { "None", "Gyorg's R." }, { "" });
Option StartingTwinmoldRemains = Option::U8("Twinmold's Remains", { "None", "TwinMold's R." }, { "" });
Option StartingSwampToken = Option::U8("Swamp Skulltula Tokens", {/*Options 0-30 defined in InitSettings()*/ }, { "" }, OptionCategory::Setting, 0, false);
Option StartingOceanToken = Option::U8("Ocean Skulltula Tokens", {/*Options 0-30 defined in InitSettings()*/ }, { "" }, OptionCategory::Setting, 0, false);
Option StartingSwampToken = Option::U8("Swamp Skulltula Tokens", {/*Options 0-30 defined in InitSettings()*/ }, { "" }, OptionCategory::Setting, 0);
Option StartingOceanToken = Option::U8("Ocean Skulltula Tokens", {/*Options 0-30 defined in InitSettings()*/ }, { "" }, OptionCategory::Setting, 0);
//Starting Masks
Option StartingMaskToggle = Option::U8("Masks", { "All Off", "All On", "Choose" }, { "" });
Option StartingDekuMask = Option::U8("Deku Mask", { "None", "Deku M." }, { "" });
Expand Down Expand Up @@ -276,9 +276,8 @@ namespace Settings {
};

std::vector<Option*> startingInventoryTokensFairys = {
//&StartingSwampToken,
//&StartingOceanToken,

&StartingSwampToken,
&StartingOceanToken,
};

//Excluded Locations (Individual definitions made in ItemLocation class)
Expand Down Expand Up @@ -379,7 +378,7 @@ namespace Settings {
&ClearerHints,
&HintDistribution,
&CompassShowWoTH,
//&DamageMultiplier,
&DamageMultiplier,
//&ChestAnimations,
&ChestSize,
//&ChangeOverworldItems,
Expand All @@ -391,7 +390,7 @@ namespace Settings {

Option BlastMaskCooldown = Option::U8("Blast Mask Cooldown", {"Default", "Short", "Very Short", "Instant"}, { blastDefault, blastShort, blastVeryShort, blastInstant });
Option UnderwaterOcarina = Option::Bool("Underwater Ocarina", { "No","Yes" }, { underwaterOcarinaDesc }, OptionCategory::Toggle);
Option FierceDeityAnywhere = Option::Bool("Fierce Deity Anywhere", { "No","Yes" }, { fierceDeityAnywhereDesc }, OptionCategory::Toggle);
Option FierceDeityAnywhere = Option::Bool("Fierce Deity Anywhere", { "No","Yes" }, { fierceDeityAnywhereDesc });
Option ProgressiveGildedSword = Option::Bool("Progressive Gilded Sword", { "Off", "On" }, { progressiveGildedSwordDesc });
Option StartingSpin = Option::Bool("Starting Spin", { "Vanilla", "Upgraded" }, { startingSpinDesc });
Option AmmoDrops = Option::U8("Ammo Drops", { "Off", "On" }, { ammoDropDesc });
Expand All @@ -405,7 +404,7 @@ namespace Settings {
&FastMasks,
&NotebookAnimations,
// &UnderwaterOcarina,
// &FierceDeityAnywhere,
&FierceDeityAnywhere,
//&ProgressiveGildedSword,
// &StartingSpin,
// &AmmoDrops,
Expand Down Expand Up @@ -591,7 +590,7 @@ namespace Settings {
&startingInventorySongsMenu,
&startingInventoryUpgradesMenu,
&startingInventoryRemainsMenu,
//&startingInventoryTokensMenu,
&startingInventoryTokensMenu,
};
//Menu mainSettings = Menu::SubMenu("Main Settings", &mainSettingsOptions);
Menu comfort = Menu::SubMenu("Comfort Settings", &comfortOptions);
Expand Down Expand Up @@ -691,7 +690,7 @@ namespace Settings {

ctx.blastMaskCooldown = BlastMaskCooldown.Value<u8>();
//ctx.underwaterOcarina = (UnderwaterOcarina) ? 1 : 0;
//ctx.fierceDeityAnywhere = (FierceDeityAnywhere) ? 1 : 0;
ctx.useFierceDeityAnywhere = (FierceDeityAnywhere) ? 1 : 0;
ctx.skipMinigamePhases = (SkipMinigamePhases) ? 1 : 0;
ctx.skipEponaRace = (SkipEponaRace) ? 1 : 0;
//ctx.fastLabFish = (FastLabFish) ? 1 : 0;
Expand Down Expand Up @@ -744,7 +743,7 @@ namespace Settings {
ctx.startingMaxRupees = (StartingMaxRupees) ? 1 : 0;
ctx.startingNutCapacity = StartingNutCapacity.Value<u8>();
ctx.startingStickCapacity = StartingStickCapacity.Value<u8>();
ctx.startingOcarina = StartingOcarina.Value<u8>();
ctx.startingOcarina = (StartingOcarina) ? 1 : 0;
ctx.startingNotebook = StartingNotebook.Value<u8>();
ctx.startingBombBag = StartingBombBag.Value<u8>();
ctx.startingBombchus = StartingBombchus.Value<u8>();
Expand Down Expand Up @@ -1021,7 +1020,7 @@ namespace Settings {
for (int i = 0; i <= 30; i++) {
OtokenOptions.push_back(std::to_string(i));
}
StartingSwampToken.SetOptions(StokenOptions);
StartingSwampToken.SetOptions(StokenOptions);
StartingOceanToken.SetOptions(OtokenOptions);

//Create Location Exclude settings
Expand Down Expand Up @@ -1189,8 +1188,14 @@ namespace Settings {
else {
Unhide(HeartContainers);
}
//Force hide Ocarina
IncludeAndHide({CLOCK_TOWER_OCARINA_OF_TIME});
//Ocarina
if (StartingOcarina.Value<u8>() == 0) {
Unhide({CLOCK_TOWER_OCARINA_OF_TIME});
}
else{
IncludeAndHide({CLOCK_TOWER_OCARINA_OF_TIME});
}


//Force hide Deku Princess
IncludeAndHide({WOODFALL_TEMPLE_DEKU_PRINCESS});
Expand Down
16 changes: 13 additions & 3 deletions source/spoiler_log.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ static void WriteIngameSpoilerLog() {
continue;
}
// Always hide unreachable checks
if (key == CLOCK_TOWER_OCARINA_OF_TIME) {
if (key == CLOCK_TOWER_OCARINA_OF_TIME && (Settings::StartingOcarina.Value<u8>() == u8(1))) {
continue;
}
if (key == HMS_STARTING_SWORD){ // && Settings::StartingKokiriSword.Is((u8)StartingSwordSetting::STARTINGSWORD_KOKIRI)) {
Expand Down Expand Up @@ -461,7 +461,7 @@ static void WriteStartingInventory(tinyxml2::XMLDocument& spoilerLog) {
for (size_t i = 0; i < Settings::startingInventoryInventory.size(); ++i) {
const auto setting = Settings::startingInventoryInventory[i];
//Ignore no starting bottles and the Choose/All On toggles
if (setting->GetSelectedOptionIndex() == (u8)StartingBottleSetting::STARTINGBOTTLE_NONE || setting->GetSelectedOptionText() == "Choose" || setting->GetSelectedOptionText() == "All On") {
if (setting->GetSelectedOptionIndex() == (u8)StartingBottleSetting::STARTINGBOTTLE_NONE || setting->GetSelectedOptionText() == "Choose" || setting->GetSelectedOptionText() == "All On" || setting->GetSelectedOptionIndex() == 0) {
continue;
}

Expand Down Expand Up @@ -510,6 +510,16 @@ static void WriteStartingInventory(tinyxml2::XMLDocument& spoilerLog) {
node->SetText(setting->GetSelectedOptionText().c_str());
}

for (size_t i = 0; i < Settings::startingInventoryTokensFairys.size(); ++i) {
const auto setting = Settings::startingInventoryTokensFairys[i];
if (setting->GetSelectedOptionIndex() == 0) {
continue;
}
auto node = parentNode->InsertNewChildElement("item");
node->SetAttribute("name", setting->GetName().c_str());
node->SetText(setting->GetSelectedOptionText().c_str());
}

if (!parentNode->NoChildren()) {
spoilerLog.RootElement()->InsertEndChild(parentNode);
}
Expand Down Expand Up @@ -629,7 +639,7 @@ bool SpoilerLog_Write() {
rootNode->SetAttribute("seed", Settings::seed.c_str());
rootNode->SetAttribute("hash", GetRandomizerHashAsString().c_str());

WriteSettings(spoilerLog);
WriteSettings(spoilerLog, true);
WriteExcludedLocations(spoilerLog);
WriteStartingInventory(spoilerLog);
//WriteEnabledTricks(spoilerLog);
Expand Down
1 change: 1 addition & 0 deletions source/starting_inventory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ void GenerateStartingInventory() {
AddItemToInventory(PIECE_OF_HEART, (hearts - maxContainers) * 4);
}
}

}

void ApplyStartingInventory() {
Expand Down