Remove locations from pool that are not shuffled. (#5023)

* Cleanup of unshuffled locations from pool/spoiler

* Removes unshuffled scrubs from the location pool

* Fix some instances of weird spacing

* Actually remove placement of vanilla freestandings

* Cleans up some now unnecessary code.

* Minor Optimization of PlaceItemsForType

* Fixes some grammer and spelling

* Another grammar fix
This commit is contained in:
Christopher Leggett 2025-02-12 15:42:58 -05:00 committed by GitHub
parent 266792599e
commit d4b9e8c835
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 92 additions and 1454 deletions

View File

@ -471,72 +471,6 @@ void PlaceJunkInExcludedLocation(const RandomizerCheck il) {
SPDLOG_ERROR("ERROR: No Junk to Place!!!");
}
static void PlaceVanillaDekuScrubItems(bool junkOneTimeScrubs) {
auto ctx = Rando::Context::GetInstance();
if (junkOneTimeScrubs){
ctx->PlaceItemInLocation(RC_LW_DEKU_SCRUB_GROTTO_FRONT, RG_BLUE_RUPEE, false, true);
ctx->PlaceItemInLocation(RC_LW_DEKU_SCRUB_NEAR_BRIDGE, RG_BLUE_RUPEE, false, true);
ctx->PlaceItemInLocation(RC_HF_DEKU_SCRUB_GROTTO, RG_BLUE_RUPEE, false, true);
}
ctx->PlaceItemInLocation(RC_ZR_DEKU_SCRUB_GROTTO_REAR, RG_RED_POTION_REFILL, false, true);
ctx->PlaceItemInLocation(RC_ZR_DEKU_SCRUB_GROTTO_FRONT, RG_GREEN_POTION_REFILL, false, true);
ctx->PlaceItemInLocation(RC_SFM_DEKU_SCRUB_GROTTO_REAR, RG_RED_POTION_REFILL, false, true);
ctx->PlaceItemInLocation(RC_SFM_DEKU_SCRUB_GROTTO_FRONT, RG_GREEN_POTION_REFILL, false, true);
ctx->PlaceItemInLocation(RC_LH_DEKU_SCRUB_GROTTO_LEFT, RG_BUY_DEKU_NUTS_5, false, true);
ctx->PlaceItemInLocation(RC_LH_DEKU_SCRUB_GROTTO_RIGHT, RG_BUY_BOMBS_535, false, true);
ctx->PlaceItemInLocation(RC_LH_DEKU_SCRUB_GROTTO_CENTER, RG_BUY_DEKU_SEEDS_30, false, true);
ctx->PlaceItemInLocation(RC_GV_DEKU_SCRUB_GROTTO_REAR, RG_RED_POTION_REFILL, false, true);
ctx->PlaceItemInLocation(RC_GV_DEKU_SCRUB_GROTTO_FRONT, RG_GREEN_POTION_REFILL, false, true);
ctx->PlaceItemInLocation(RC_LW_DEKU_SCRUB_NEAR_DEKU_THEATER_RIGHT, RG_BUY_DEKU_NUTS_5, false, true);
ctx->PlaceItemInLocation(RC_LW_DEKU_SCRUB_NEAR_DEKU_THEATER_LEFT, RG_BUY_DEKU_STICK_1, false, true);
ctx->PlaceItemInLocation(RC_LW_DEKU_SCRUB_GROTTO_REAR, RG_BUY_DEKU_SEEDS_30, false, true);
ctx->PlaceItemInLocation(RC_COLOSSUS_DEKU_SCRUB_GROTTO_REAR, RG_RED_POTION_REFILL, false, true);
ctx->PlaceItemInLocation(RC_COLOSSUS_DEKU_SCRUB_GROTTO_FRONT, RG_GREEN_POTION_REFILL, false, true);
ctx->PlaceItemInLocation(RC_DMC_DEKU_SCRUB, RG_BUY_BOMBS_535, false, true);
ctx->PlaceItemInLocation(RC_DMC_DEKU_SCRUB_GROTTO_LEFT, RG_BUY_DEKU_NUTS_5, false, true);
ctx->PlaceItemInLocation(RC_DMC_DEKU_SCRUB_GROTTO_RIGHT, RG_BUY_BOMBS_535, false, true);
ctx->PlaceItemInLocation(RC_DMC_DEKU_SCRUB_GROTTO_CENTER, RG_BUY_DEKU_SEEDS_30, false, true);
ctx->PlaceItemInLocation(RC_GC_DEKU_SCRUB_GROTTO_LEFT, RG_BUY_DEKU_NUTS_5, false, true);
ctx->PlaceItemInLocation(RC_GC_DEKU_SCRUB_GROTTO_RIGHT, RG_BUY_BOMBS_535, false, true);
ctx->PlaceItemInLocation(RC_GC_DEKU_SCRUB_GROTTO_CENTER, RG_BUY_DEKU_SEEDS_30, false, true);
ctx->PlaceItemInLocation(RC_LLR_DEKU_SCRUB_GROTTO_LEFT, RG_BUY_DEKU_NUTS_5, false, true);
ctx->PlaceItemInLocation(RC_LLR_DEKU_SCRUB_GROTTO_RIGHT, RG_BUY_BOMBS_535, false, true);
ctx->PlaceItemInLocation(RC_LLR_DEKU_SCRUB_GROTTO_CENTER, RG_BUY_DEKU_SEEDS_30, false, true);
//Dungeon Scrubs
if (ctx->GetDungeon(Rando::DEKU_TREE)->IsMQ()) {
ctx->PlaceItemInLocation(RC_DEKU_TREE_MQ_DEKU_SCRUB, RG_BUY_DEKU_SHIELD, false, true);
}
if (ctx->GetDungeon(Rando::DODONGOS_CAVERN)->IsMQ()) {
ctx->PlaceItemInLocation(RC_DODONGOS_CAVERN_MQ_DEKU_SCRUB_LOBBY_REAR, RG_BUY_DEKU_STICK_1, false, true);
ctx->PlaceItemInLocation(RC_DODONGOS_CAVERN_MQ_DEKU_SCRUB_LOBBY_FRONT, RG_BUY_DEKU_SEEDS_30, false, true);
ctx->PlaceItemInLocation(RC_DODONGOS_CAVERN_MQ_DEKU_SCRUB_STAIRCASE, RG_BUY_DEKU_SHIELD, false, true);
ctx->PlaceItemInLocation(RC_DODONGOS_CAVERN_MQ_DEKU_SCRUB_SIDE_ROOM_NEAR_LOWER_LIZALFOS, RG_RED_POTION_REFILL,
false, true);
} else {
ctx->PlaceItemInLocation(RC_DODONGOS_CAVERN_DEKU_SCRUB_NEAR_BOMB_BAG_LEFT, RG_BUY_DEKU_NUTS_5, false, true);
ctx->PlaceItemInLocation(RC_DODONGOS_CAVERN_DEKU_SCRUB_SIDE_ROOM_NEAR_DODONGOS, RG_BUY_DEKU_STICK_1, false, true);
ctx->PlaceItemInLocation(RC_DODONGOS_CAVERN_DEKU_SCRUB_NEAR_BOMB_BAG_RIGHT, RG_BUY_DEKU_SEEDS_30, false, true);
ctx->PlaceItemInLocation(RC_DODONGOS_CAVERN_DEKU_SCRUB_LOBBY, RG_BUY_DEKU_SHIELD, false, true);
}
if (ctx->GetDungeon(Rando::JABU_JABUS_BELLY)->IsVanilla()) {
ctx->PlaceItemInLocation(RC_JABU_JABUS_BELLY_DEKU_SCRUB, RG_BUY_DEKU_NUTS_5, false, true);
}
if (ctx->GetDungeon(Rando::GANONS_CASTLE)->IsMQ()) {
ctx->PlaceItemInLocation(RC_GANONS_CASTLE_MQ_DEKU_SCRUB_LEFT, RG_GREEN_POTION_REFILL, false, true);
ctx->PlaceItemInLocation(RC_GANONS_CASTLE_MQ_DEKU_SCRUB_CENTER_LEFT, RG_BUY_BOMBS_535, false, true);
ctx->PlaceItemInLocation(RC_GANONS_CASTLE_MQ_DEKU_SCRUB_CENTER, RG_BUY_ARROWS_30, false, true);
ctx->PlaceItemInLocation(RC_GANONS_CASTLE_MQ_DEKU_SCRUB_CENTER_RIGHT, RG_RED_POTION_REFILL, false, true);
ctx->PlaceItemInLocation(RC_GANONS_CASTLE_MQ_DEKU_SCRUB_RIGHT, RG_BUY_DEKU_NUTS_5, false, true);
} else {
ctx->PlaceItemInLocation(RC_GANONS_CASTLE_DEKU_SCRUB_CENTER_LEFT, RG_BUY_BOMBS_535, false, true);
ctx->PlaceItemInLocation(RC_GANONS_CASTLE_DEKU_SCRUB_CENTER_RIGHT, RG_BUY_DEKU_SEEDS_30, false, true);
ctx->PlaceItemInLocation(RC_GANONS_CASTLE_DEKU_SCRUB_RIGHT, RG_RED_POTION_REFILL, false, true);
ctx->PlaceItemInLocation(RC_GANONS_CASTLE_DEKU_SCRUB_LEFT, RG_GREEN_POTION_REFILL, false, true);
}
}
static void PlaceVanillaMapsAndCompasses() {
auto ctx = Rando::Context::GetInstance();
for (auto dungeon : ctx->GetDungeons()->GetDungeonList()) {
@ -558,143 +492,11 @@ static void PlaceVanillaBossKeys() {
dungeon->PlaceVanillaBossKey();
}
}
// TODO: This feels like it could be moved to Dungeons class and probably shorten
// a few function call chains. Needs investigation.
static void PlaceVanillaBeehiveRupees() {
auto ctx = Rando::Context::GetInstance();
ctx->PlaceItemInLocation(RC_KF_STORMS_GROTTO_BEEHIVE_LEFT, RG_BLUE_RUPEE, false, true);
ctx->PlaceItemInLocation(RC_LW_NEAR_SHORTCUTS_GROTTO_BEEHIVE_LEFT, RG_BLUE_RUPEE, false, true);
ctx->PlaceItemInLocation(RC_HF_NEAR_MARKET_GROTTO_BEEHIVE_LEFT, RG_BLUE_RUPEE, false, true);
ctx->PlaceItemInLocation(RC_HF_OPEN_GROTTO_BEEHIVE_LEFT, RG_BLUE_RUPEE, false, true);
ctx->PlaceItemInLocation(RC_HF_SOUTHEAST_GROTTO_BEEHIVE_LEFT, RG_BLUE_RUPEE, false, true);
ctx->PlaceItemInLocation(RC_KAK_OPEN_GROTTO_BEEHIVE_LEFT, RG_BLUE_RUPEE, false, true);
ctx->PlaceItemInLocation(RC_DMT_STORMS_GROTTO_BEEHIVE_LEFT, RG_BLUE_RUPEE, false, true);
ctx->PlaceItemInLocation(RC_DMC_UPPER_GROTTO_BEEHIVE_LEFT, RG_BLUE_RUPEE, false, true);
ctx->PlaceItemInLocation(RC_ZR_OPEN_GROTTO_BEEHIVE_LEFT, RG_BLUE_RUPEE, false, true);
ctx->PlaceItemInLocation(RC_KF_STORMS_GROTTO_BEEHIVE_RIGHT, RG_RED_RUPEE, false, true);
ctx->PlaceItemInLocation(RC_LW_NEAR_SHORTCUTS_GROTTO_BEEHIVE_RIGHT, RG_RED_RUPEE, false, true);
ctx->PlaceItemInLocation(RC_LW_DEKU_SCRUB_GROTTO_BEEHIVE, RG_RED_RUPEE, false, true);
ctx->PlaceItemInLocation(RC_SFM_STORMS_GROTTO_BEEHIVE, RG_RED_RUPEE, false, true);
ctx->PlaceItemInLocation(RC_HF_NEAR_MARKET_GROTTO_BEEHIVE_RIGHT, RG_RED_RUPEE, false, true);
ctx->PlaceItemInLocation(RC_HF_OPEN_GROTTO_BEEHIVE_RIGHT, RG_RED_RUPEE, false, true);
ctx->PlaceItemInLocation(RC_HF_SOUTHEAST_GROTTO_BEEHIVE_RIGHT, RG_RED_RUPEE, false, true);
ctx->PlaceItemInLocation(RC_HF_INSIDE_FENCE_GROTTO_BEEHIVE, RG_RED_RUPEE, false, true);
ctx->PlaceItemInLocation(RC_LLR_GROTTO_BEEHIVE, RG_RED_RUPEE, false, true);
ctx->PlaceItemInLocation(RC_KAK_OPEN_GROTTO_BEEHIVE_RIGHT, RG_RED_RUPEE, false, true);
ctx->PlaceItemInLocation(RC_DMT_COW_GROTTO_BEEHIVE, RG_RED_RUPEE, false, true);
ctx->PlaceItemInLocation(RC_DMT_STORMS_GROTTO_BEEHIVE_RIGHT, RG_RED_RUPEE, false, true);
ctx->PlaceItemInLocation(RC_GC_GROTTO_BEEHIVE, RG_RED_RUPEE, false, true);
ctx->PlaceItemInLocation(RC_DMC_UPPER_GROTTO_BEEHIVE_RIGHT, RG_RED_RUPEE, false, true);
ctx->PlaceItemInLocation(RC_DMC_HAMMER_GROTTO_BEEHIVE, RG_RED_RUPEE, false, true);
ctx->PlaceItemInLocation(RC_ZR_OPEN_GROTTO_BEEHIVE_RIGHT, RG_RED_RUPEE, false, true);
ctx->PlaceItemInLocation(RC_ZR_STORMS_GROTTO_BEEHIVE, RG_RED_RUPEE, false, true);
ctx->PlaceItemInLocation(RC_ZD_IN_FRONT_OF_KING_ZORA_BEEHIVE_LEFT, RG_RED_RUPEE, false, true);
ctx->PlaceItemInLocation(RC_ZD_IN_FRONT_OF_KING_ZORA_BEEHIVE_RIGHT, RG_RED_RUPEE, false, true);
ctx->PlaceItemInLocation(RC_ZD_BEHIND_KING_ZORA_BEEHIVE, RG_RED_RUPEE, false, true);
ctx->PlaceItemInLocation(RC_LH_GROTTO_BEEHIVE, RG_RED_RUPEE, false, true);
ctx->PlaceItemInLocation(RC_GV_DEKU_SCRUB_GROTTO_BEEHIVE, RG_RED_RUPEE, false, true);
ctx->PlaceItemInLocation(RC_COLOSSUS_GROTTO_BEEHIVE, RG_RED_RUPEE, false, true);
static void PlaceItemsForType(RandomizerCheckType rctype, bool overworldActive, bool dungeonActive) {
if (!(overworldActive || dungeonActive)) {
return;
}
static void PlaceVanillaCowMilk() {
auto ctx = Rando::Context::GetInstance();
ctx->PlaceItemInLocation(RC_KF_LINKS_HOUSE_COW, RG_MILK, false, true);
ctx->PlaceItemInLocation(RC_HF_COW_GROTTO_COW, RG_MILK, false, true);
ctx->PlaceItemInLocation(RC_GV_COW, RG_MILK, false, true);
ctx->PlaceItemInLocation(RC_KAK_IMPAS_HOUSE_COW, RG_MILK, false, true);
ctx->PlaceItemInLocation(RC_DMT_COW_GROTTO_COW, RG_MILK, false, true);
ctx->PlaceItemInLocation(RC_LLR_STABLES_LEFT_COW, RG_MILK, false, true);
ctx->PlaceItemInLocation(RC_LLR_STABLES_RIGHT_COW, RG_MILK, false, true);
ctx->PlaceItemInLocation(RC_LLR_TOWER_LEFT_COW, RG_MILK, false, true);
ctx->PlaceItemInLocation(RC_LLR_TOWER_RIGHT_COW, RG_MILK, false, true);
if (ctx->GetDungeon(Rando::JABU_JABUS_BELLY)->IsMQ()) {
ctx->PlaceItemInLocation(RC_JABU_JABUS_BELLY_MQ_COW, RG_MILK, false, true);
}
}
static void PlaceVanillaOverworldFish() {
auto ctx = Rando::Context::GetInstance();
for (auto rc : Rando::StaticData::GetOverworldFishLocations()) {
ctx->PlaceItemInLocation(rc, RG_FISH, false, true);
}
}
static void PlaceVanillaFairies() {
auto ctx = Rando::Context::GetInstance();
for (auto rc : Rando::StaticData::GetOverworldFairyLocations()) {
ctx->PlaceItemInLocation(rc, GetJunkItem(), false, true);
}
if (ctx->GetDungeon(Rando::GANONS_CASTLE)->IsMQ()) {
ctx->PlaceItemInLocation(RC_GANONS_CASTLE_MQ_SCRUBS_FAIRY_1, GetJunkItem(), false, true);
ctx->PlaceItemInLocation(RC_GANONS_CASTLE_MQ_SCRUBS_FAIRY_2, GetJunkItem(), false, true);
ctx->PlaceItemInLocation(RC_GANONS_CASTLE_MQ_SCRUBS_FAIRY_3, GetJunkItem(), false, true);
ctx->PlaceItemInLocation(RC_GANONS_CASTLE_MQ_SCRUBS_FAIRY_4, GetJunkItem(), false, true);
ctx->PlaceItemInLocation(RC_GANONS_CASTLE_MQ_SCRUBS_FAIRY_5, GetJunkItem(), false, true);
ctx->PlaceItemInLocation(RC_GANONS_CASTLE_MQ_SCRUBS_FAIRY_6, GetJunkItem(), false, true);
ctx->PlaceItemInLocation(RC_GANONS_CASTLE_MQ_SCRUBS_FAIRY_7, GetJunkItem(), false, true);
ctx->PlaceItemInLocation(RC_GANONS_CASTLE_MQ_SCRUBS_FAIRY_8, GetJunkItem(), false, true);
} else {
ctx->PlaceItemInLocation(RC_GANONS_CASTLE_SCRUBS_FAIRY_1, GetJunkItem(), false, true);
ctx->PlaceItemInLocation(RC_GANONS_CASTLE_SCRUBS_FAIRY_2, GetJunkItem(), false, true);
ctx->PlaceItemInLocation(RC_GANONS_CASTLE_SCRUBS_FAIRY_3, GetJunkItem(), false, true);
ctx->PlaceItemInLocation(RC_GANONS_CASTLE_SCRUBS_FAIRY_4, GetJunkItem(), false, true);
ctx->PlaceItemInLocation(RC_GANONS_CASTLE_SCRUBS_FAIRY_5, GetJunkItem(), false, true);
ctx->PlaceItemInLocation(RC_GANONS_CASTLE_SCRUBS_FAIRY_6, GetJunkItem(), false, true);
ctx->PlaceItemInLocation(RC_GANONS_CASTLE_SCRUBS_FAIRY_7, GetJunkItem(), false, true);
ctx->PlaceItemInLocation(RC_GANONS_CASTLE_SCRUBS_FAIRY_8, GetJunkItem(), false, true);
}
if (ctx->GetDungeon(Rando::DODONGOS_CAVERN)->IsMQ()) {
ctx->PlaceItemInLocation(RC_DODONGOS_CAVERN_MQ_GOSSIP_STONE_FAIRY, GetJunkItem(), false, true);
ctx->PlaceItemInLocation(RC_DODONGOS_CAVERN_MQ_GOSSIP_STONE_FAIRY_BIG, GetJunkItem(), false, true);
} else {
ctx->PlaceItemInLocation(RC_DODONGOS_CAVERN_GOSSIP_STONE_FAIRY, GetJunkItem(), false, true);
ctx->PlaceItemInLocation(RC_DODONGOS_CAVERN_GOSSIP_STONE_FAIRY_BIG, GetJunkItem(), false, true);
}
if (ctx->GetDungeon(Rando::FIRE_TEMPLE)->IsMQ()) {
ctx->PlaceItemInLocation(RC_FIRE_TEMPLE_MQ_LOOP_STALFOS_SUN_FAIRY, GetJunkItem(), false, true);
ctx->PlaceItemInLocation(RC_FIRE_TEMPLE_MQ_LOOP_KNUCKLE_SUN_FAIRY, GetJunkItem(), false, true);
}
if (ctx->GetDungeon(Rando::WATER_TEMPLE)->IsMQ()) {
ctx->PlaceItemInLocation(RC_WATER_TEMPLE_MQ_DARK_LINK_PILAR_SUN_FAIRY, GetJunkItem(), false, true);
ctx->PlaceItemInLocation(RC_WATER_TEMPLE_MQ_DARK_LINK_LEFT_STORM_FAIRY, GetJunkItem(), false, true);
ctx->PlaceItemInLocation(RC_WATER_TEMPLE_MQ_DARK_LINK_RIGHT_SUN_FAIRY, GetJunkItem(), false, true);
}
if (ctx->GetDungeon(Rando::SPIRIT_TEMPLE)->IsMQ()) {
ctx->PlaceItemInLocation(RC_SPIRIT_TEMPLE_MQ_DINALFOS_ROOM_SUN_FAIRY, GetJunkItem(), false, true);
} else {
ctx->PlaceItemInLocation(RC_SPIRIT_TEMPLE_BOULDER_ROOM_SUN_FAIRY, GetJunkItem(), false, true);
ctx->PlaceItemInLocation(RC_SPIRIT_TEMPLE_ARMOS_ROOM_SUN_FAIRY, GetJunkItem(), false, true);
}
if (ctx->GetDungeon(Rando::SHADOW_TEMPLE)->IsMQ()) {
ctx->PlaceItemInLocation(RC_SHADOW_TEMPLE_MQ_BEAMOS_STORM_FAIRY, GetJunkItem(), false, true);
ctx->PlaceItemInLocation(RC_SHADOW_TEMPLE_MQ_PIT_STORM_FAIRY, GetJunkItem(), false, true);
ctx->PlaceItemInLocation(RC_SHADOW_TEMPLE_MQ_WIND_HINT_SUN_FAIRY, GetJunkItem(), false, true);
} else {
ctx->PlaceItemInLocation(RC_SHADOW_TEMPLE_BEAMOS_STORM_FAIRY, GetJunkItem(), false, true);
ctx->PlaceItemInLocation(RC_SHADOW_TEMPLE_PIT_STORM_FAIRY, GetJunkItem(), false, true);
ctx->PlaceItemInLocation(RC_SHADOW_TEMPLE_WIND_HINT_SUN_FAIRY, GetJunkItem(), false, true);
}
if (ctx->GetDungeon(Rando::BOTTOM_OF_THE_WELL)->IsMQ()) {
ctx->PlaceItemInLocation(RC_BOTTOM_OF_THE_WELL_MQ_CELL_SUN_FAIRY, GetJunkItem(), false, true);
ctx->PlaceItemInLocation(RC_BOTTOM_OF_THE_WELL_MQ_BASEMENT_SUN_FAIRY, GetJunkItem(), false, true);
} else {
ctx->PlaceItemInLocation(RC_BOTTOM_OF_THE_WELL_BASEMENT_SUN_FAIRY, GetJunkItem(), false, true);
}
if (ctx->GetDungeon(Rando::ICE_CAVERN)->IsVanilla()) {
ctx->PlaceItemInLocation(RC_ICE_CAVERN_ENTRANCE_STORMS_FAIRY, GetJunkItem(), false, true);
}
if (ctx->GetDungeon(Rando::GERUDO_TRAINING_GROUND)->IsVanilla()) {
ctx->PlaceItemInLocation(RC_GERUDO_TRAINING_GROUND_ENTRANCE_STORMS_FAIRY, GetJunkItem(), false, true);
}
if (ctx->GetDungeon(Rando::GANONS_CASTLE)->IsVanilla()) {
ctx->PlaceItemInLocation(RC_GANONS_CASTLE_SPIRIT_TRIAL_SUN_FAIRY, GetJunkItem(), false, true);
}
}
static void PlaceItemsForType(RandomizerCheckType rctype, bool overworldActive, bool dungeonActive, bool placeVanilla) {
for (RandomizerCheck rc : ctx->GetLocations(ctx->allLocations, rctype)) {
auto loc = Rando::StaticData::GetLocation(rc);
@ -702,8 +504,6 @@ static void PlaceItemsForType(RandomizerCheckType rctype, bool overworldActive,
if (loc->IsOverworld()) {
if (overworldActive) {
AddItemToMainPool(loc->GetVanillaItem());
} else if (placeVanilla) {
ctx->PlaceItemInLocation(rc, loc->GetVanillaItem(), false, true);
}
} else {
if (dungeonActive) {
@ -723,8 +523,6 @@ static void PlaceItemsForType(RandomizerCheckType rctype, bool overworldActive,
}
}
}
} else if (placeVanilla) {
ctx->PlaceItemInLocation(rc, loc->GetVanillaItem(), false, true);
}
}
}
@ -905,8 +703,6 @@ void GenerateItemPool() {
//32 total beehive locations
AddItemToMainPool(RG_RED_RUPEE, 23);
AddItemToMainPool(RG_BLUE_RUPEE, 9);
} else {
PlaceVanillaBeehiveRupees();
}
if (ctx->GetOption(RSK_SHUFFLE_COWS)) {
@ -918,8 +714,6 @@ void GenerateItemPool() {
if (ctx->GetDungeon(Rando::JABU_JABUS_BELLY)->IsMQ()) {
AddItemToMainPool(GetJunkItem());
}
} else {
PlaceVanillaCowMilk();
}
// Shuffle Pots
@ -927,9 +721,7 @@ void GenerateItemPool() {
ctx->GetOption(RSK_SHUFFLE_POTS).Is(RO_SHUFFLE_POTS_ALL);
bool dungeonPotsActive = ctx->GetOption(RSK_SHUFFLE_POTS).Is(RO_SHUFFLE_POTS_DUNGEONS) ||
ctx->GetOption(RSK_SHUFFLE_POTS).Is(RO_SHUFFLE_POTS_ALL);
if (overworldPotsActive || dungeonPotsActive) {
PlaceItemsForType(RCTYPE_POT, overworldPotsActive, dungeonPotsActive, false);
}
PlaceItemsForType(RCTYPE_POT, overworldPotsActive, dungeonPotsActive);
auto fsMode = ctx->GetOption(RSK_FISHSANITY);
if (fsMode.IsNot(RO_FISHSANITY_OFF)) {
@ -953,8 +745,6 @@ void GenerateItemPool() {
if (fsMode.Is(RO_FISHSANITY_OVERWORLD) || fsMode.Is(RO_FISHSANITY_BOTH)) {
for (uint8_t i = 0; i < Rando::StaticData::GetOverworldFishLocations().size(); i++)
AddItemToMainPool(GetJunkItem());
} else {
PlaceVanillaOverworldFish();
}
if (fsMode.Is(RO_FISHSANITY_HYRULE_LOACH)) {
@ -962,9 +752,6 @@ void GenerateItemPool() {
} else {
ctx->PlaceItemInLocation(RC_LH_HYRULE_LOACH, RG_PURPLE_RUPEE, false, true);
}
} else {
PlaceVanillaOverworldFish();
ctx->PlaceItemInLocation(RC_LH_HYRULE_LOACH, RG_PURPLE_RUPEE, false, true);
}
if (ctx->GetOption(RSK_SHUFFLE_FISHING_POLE)) {
@ -1333,8 +1120,6 @@ void GenerateItemPool() {
for (int i = 0; i < extra; i++) {
AddItemToMainPool(GetJunkItem());
}
} else {
PlaceVanillaFairies();
}
//Scrubsanity
@ -1377,19 +1162,13 @@ void GenerateItemPool() {
AddItemToMainPool(RG_DEKU_SEEDS_30);
}
}
} else {
PlaceVanillaDekuScrubItems(ctx->GetOption(RSK_SHUFFLE_SCRUBS).Is(RO_SCRUBS_OFF));
}
// RANDOTODO: Don't add freestanding locations to the seed at all in the first place so this check
// can be put back in place, and not place the vanilla items in PlaceItemsForType.
bool overworldFreeStandingActive = ctx->GetOption(RSK_SHUFFLE_FREESTANDING).Is(RO_SHUFFLE_FREESTANDING_OVERWORLD) ||
ctx->GetOption(RSK_SHUFFLE_FREESTANDING).Is(RO_SHUFFLE_FREESTANDING_ALL);
bool dungeonFreeStandingActive = ctx->GetOption(RSK_SHUFFLE_FREESTANDING).Is(RO_SHUFFLE_FREESTANDING_DUNGEONS) ||
ctx->GetOption(RSK_SHUFFLE_FREESTANDING).Is(RO_SHUFFLE_FREESTANDING_ALL);
//if (overworldFreeStandingActive || dungeonFreeStandingActive) {
PlaceItemsForType(RCTYPE_FREESTANDING, overworldFreeStandingActive, dungeonFreeStandingActive, true);
//}
PlaceItemsForType(RCTYPE_FREESTANDING, overworldFreeStandingActive, dungeonFreeStandingActive);
AddItemsToPool(ItemPool, alwaysItems);
AddItemsToPool(ItemPool, dungeonRewards);

View File

@ -98,6 +98,10 @@ ItemLocation* Context::GetItemLocation(size_t locKey) {
return &itemLocationTable[static_cast<RandomizerCheck>(locKey)];
}
bool Context::IsLocationShuffled(const RandomizerCheck locKey) {
return itemLocationTable[locKey].GetPlacedRandomizerGet() != RG_NONE;
}
ItemOverride& Context::GetItemOverride(RandomizerCheck locKey) {
if (!overrides.contains(locKey)) {
overrides.emplace(locKey, ItemOverride());
@ -156,36 +160,73 @@ void Context::GenerateLocationPool() {
if (mOptions[RSK_TRIFORCE_HUNT]) {
AddLocation(RC_TRIFORCE_COMPLETED);
}
AddLocations(StaticData::GetOverworldLocations());
if (mOptions[RSK_FISHSANITY].IsNot(RO_FISHSANITY_OFF)) {
AddLocations(mFishsanity->GetFishsanityLocations().first);
for (Location& location : StaticData::GetLocationTable()) {
// skip RCs that shouldn't be in the pool for any reason (i.e. settings, unsupported check type, etc.)
// TODO: Exclude checks for some of the older shuffles from the pool too i.e. Frog Songs, Scrubs, etc.)
if (location.GetRandomizerCheck() == RC_UNKNOWN_CHECK ||
location.GetRandomizerCheck() == RC_TRIFORCE_COMPLETED || // already in pool
location.GetRCType() == RCTYPE_CHEST_GAME || // not supported yet
location.GetRCType() == RCTYPE_STATIC_HINT || // can't have items
location.GetRCType() == RCTYPE_GOSSIP_STONE || // can't have items
(location.GetRCType() == RCTYPE_SCRUB && mOptions[RSK_SHUFFLE_SCRUBS].Is(RO_SCRUBS_OFF)) ||
(location.GetRCType() == RCTYPE_SCRUB && mOptions[RSK_SHUFFLE_SCRUBS].Is(RO_SCRUBS_ONE_TIME_ONLY) && !(
location.GetRandomizerCheck() == RC_LW_DEKU_SCRUB_GROTTO_FRONT ||
location.GetRandomizerCheck() == RC_LW_DEKU_SCRUB_NEAR_BRIDGE ||
location.GetRandomizerCheck() == RC_HF_DEKU_SCRUB_GROTTO
)) ||
(location.GetRCType() == RCTYPE_COW && mOptions[RSK_SHUFFLE_COWS].Is(RO_GENERIC_OFF)) ||
(location.GetRCType() == RCTYPE_FISH && mOptions[RSK_FISHSANITY].Is(RO_FISHSANITY_OFF)) ||
(location.GetRCType() == RCTYPE_POT && mOptions[RSK_SHUFFLE_POTS].Is(RO_SHUFFLE_POTS_OFF)) ||
(location.GetRCType() == RCTYPE_FAIRY && !mOptions[RSK_SHUFFLE_FAIRIES]) ||
(location.GetRCType() == RCTYPE_FREESTANDING &&
mOptions[RSK_SHUFFLE_FREESTANDING].Is(RO_SHUFFLE_FREESTANDING_OFF)) ||
(location.GetRCType() == RCTYPE_BEEHIVE && !mOptions[RSK_SHUFFLE_BEEHIVES])) {
continue;
}
if (location.IsOverworld()) {
// Skip stuff that is shuffled to dungeon only, i.e. tokens, pots, etc., or other checks that
// should not have a shuffled item.
if ((location.GetRCType() == RCTYPE_FREESTANDING && mOptions[RSK_SHUFFLE_FREESTANDING].Is(RO_SHUFFLE_FREESTANDING_DUNGEONS)) ||
(location.GetRCType() == RCTYPE_POT && mOptions[RSK_SHUFFLE_POTS].Is(RO_SHUFFLE_POTS_DUNGEONS))) {
continue;
}
// If we've gotten past all the conditions where an overworld location should not be
// shuffled, add it to the pool.
AddLocation(location.GetRandomizerCheck());
} else { // is a dungeon check
auto* dungeon = GetDungeon(location.GetArea() - RCAREA_DEKU_TREE);
if (location.GetQuest() == RCQUEST_BOTH || (location.GetQuest() == RCQUEST_MQ) == dungeon->IsMQ()) {
if ((location.GetRCType() == RCTYPE_FREESTANDING &&
mOptions[RSK_SHUFFLE_FREESTANDING].Is(RO_SHUFFLE_FREESTANDING_OVERWORLD)) ||
(location.GetRCType() == RCTYPE_POT && mOptions[RSK_SHUFFLE_POTS].Is(RO_SHUFFLE_POTS_OVERWORLD))) {
continue;
}
// also add to that dungeon's location list.
AddLocation(location.GetRandomizerCheck(), &dungeon->locations);
AddLocation(location.GetRandomizerCheck());
}
}
if (mOptions[RSK_SHUFFLE_POTS].Is(RO_SHUFFLE_POTS_OVERWORLD) ||
mOptions[RSK_SHUFFLE_POTS].Is(RO_SHUFFLE_POTS_ALL)) {
AddLocations(StaticData::GetOverworldPotLocations());
}
AddLocations(StaticData::GetAllDungeonLocations());
}
void Context::AddExcludedOptions() {
AddLocations(StaticData::GetOverworldLocations(), &everyPossibleLocation);
for (const auto dungeon : mDungeons->GetDungeonList()) {
AddLocations(dungeon->GetEveryLocation(), &everyPossibleLocation);
for (auto& loc : StaticData::GetLocationTable()) {
// Checks of these types don't have items, skip them.
if (loc.GetRandomizerCheck() == RC_UNKNOWN_CHECK ||
loc.GetRandomizerCheck() == RC_TRIFORCE_COMPLETED || loc.GetRCType() == RCTYPE_CHEST_GAME ||
loc.GetRCType() == RCTYPE_STATIC_HINT || loc.GetRCType() == RCTYPE_GOSSIP_STONE) {
continue;
}
for (const RandomizerCheck rc : everyPossibleLocation) {
AddLocation(loc.GetRandomizerCheck(), &everyPossibleLocation);
bool alreadyAdded = false;
Location* loc = StaticData::GetLocation(rc);
for (Option* location : Rando::Settings::GetInstance()->GetExcludeOptionsForArea(loc->GetArea()))
for (Option* location : Rando::Settings::GetInstance()->GetExcludeOptionsForArea(loc.GetArea()))
{
if (location->GetName() == loc->GetExcludedOption()->GetName()) {
if (location->GetName() == loc.GetExcludedOption()->GetName()) {
alreadyAdded = true;
}
}
if (!alreadyAdded) {
Rando::Settings::GetInstance()->GetExcludeOptionsForArea(loc->GetArea()).push_back(loc->GetExcludedOption());
Rando::Settings::GetInstance()->GetExcludeOptionsForArea(loc.GetArea()).push_back(loc.GetExcludedOption());
}
}
}

View File

@ -41,6 +41,7 @@ class Context {
void AddHint(const RandomizerHint hintId, const Hint hint);
ItemLocation* GetItemLocation(RandomizerCheck locKey);
ItemLocation* GetItemLocation(size_t locKey);
bool IsLocationShuffled(RandomizerCheck locKey);
ItemOverride& GetItemOverride(RandomizerCheck locKey);
ItemOverride& GetItemOverride(size_t locKey);
void PlaceItemInLocation(RandomizerCheck locKey, RandomizerGet item, bool applyEffectImmediately = false,

File diff suppressed because it is too large Load Diff

View File

@ -12,11 +12,7 @@ class DungeonInfo {
public:
DungeonInfo(std::string name_, RandomizerHintTextKey hintKey_, RandomizerGet map_, RandomizerGet compass_,
RandomizerGet smallKey_, RandomizerGet keyRing_, RandomizerGet bossKey_, RandomizerArea area_,
uint8_t vanillaKeyCount_, uint8_t mqKeyCount_, RandomizerSettingKey mqSetting_,
std::vector<RandomizerCheck> vanillaLocations_, std::vector<RandomizerCheck> mqLocations_,
std::vector<RandomizerCheck> vanillaPots_, std::vector<RandomizerCheck> mqPots_,
std::vector<RandomizerCheck> sharedLocations_,
std::vector<RandomizerCheck> bossRoomLocations_);
uint8_t vanillaKeyCount_, uint8_t mqKeyCount_, RandomizerSettingKey mqSetting_);
DungeonInfo();
~DungeonInfo();
@ -43,7 +39,7 @@ class DungeonInfo {
void PlaceVanillaBossKey() const;
void PlaceVanillaSmallKeys() const;
std::vector<RandomizerCheck> GetDungeonLocations() const;
std::vector<RandomizerCheck> GetEveryLocation() const;
std::vector<RandomizerCheck> locations;
private:
std::string name;
@ -60,12 +56,6 @@ class DungeonInfo {
uint8_t mqKeyCount{};
bool masterQuest = false;
bool hasKeyRing = false;
std::vector<RandomizerCheck> vanillaLocations;
std::vector<RandomizerCheck> mqLocations;
std::vector<RandomizerCheck> vanillaPots;
std::vector<RandomizerCheck> mqPots;
std::vector<RandomizerCheck> sharedLocations;
std::vector<RandomizerCheck> bossRoomLocations;
};
typedef enum {
@ -79,8 +69,8 @@ typedef enum {
SHADOW_TEMPLE,
BOTTOM_OF_THE_WELL,
ICE_CAVERN,
GANONS_CASTLE,
GERUDO_TRAINING_GROUND
GERUDO_TRAINING_GROUND,
GANONS_CASTLE
} DungeonKey;
class Dungeons {

View File

@ -232,7 +232,7 @@ void RandomizerOnFlagSetHandler(int16_t flagType, int16_t flag) {
if (rc == RC_UNKNOWN_CHECK) return;
auto loc = Rando::Context::GetInstance()->GetItemLocation(rc);
if (loc == nullptr || loc->HasObtained()) return;
if (loc == nullptr || loc->HasObtained() || loc->GetPlacedRandomizerGet() == RG_NONE) return;
SPDLOG_INFO("Queuing RC: {}", static_cast<uint32_t>(rc));
randomizerQueuedChecks.push(rc);
@ -250,7 +250,7 @@ void RandomizerOnSceneFlagSetHandler(int16_t sceneNum, int16_t flagType, int16_t
if (rc == RC_UNKNOWN_CHECK) return;
auto loc = Rando::Context::GetInstance()->GetItemLocation(rc);
if (loc == nullptr || loc->HasObtained()) return;
if (loc == nullptr || loc->HasObtained() || loc->GetPlacedRandomizerGet() == RG_NONE) return;
SPDLOG_INFO("Queuing RC: {}", static_cast<uint32_t>(rc));
randomizerQueuedChecks.push(rc);
@ -813,6 +813,9 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_l
case VB_GIVE_ITEM_FROM_CHEST: {
EnBox* chest = va_arg(args, EnBox*);
RandomizerCheck rc = OTRGlobals::Instance->gRandomizer->GetCheckFromActor(chest->dyna.actor.id, gPlayState->sceneNum, chest->dyna.actor.params);
if (!OTRGlobals::Instance->gRandoContext->IsLocationShuffled(rc)) {
break;
}
// if this is a treasure chest game chest then set the appropriate rando inf
RandomizerSetChestGameRandomizerInf(rc);

View File

@ -5342,7 +5342,7 @@ typedef enum {
//Scrubsanity settings (off, affordable, expensive, random)
typedef enum {
RO_SCRUBS_OFF,
RO_SCRUBS_MAJOR_ONLY,
RO_SCRUBS_ONE_TIME_ONLY,
RO_SCRUBS_ALL,
} RandoOptionScrubsanity;