diff --git a/soh/soh/Enhancements/randomizer/context.cpp b/soh/soh/Enhancements/randomizer/context.cpp index f072725e7..a6adc7b9b 100644 --- a/soh/soh/Enhancements/randomizer/context.cpp +++ b/soh/soh/Enhancements/randomizer/context.cpp @@ -440,8 +440,8 @@ void Context::ParseArchipelago() { mSpoilerLoaded = false; ArchipelagoClient& ap_client = ArchipelagoClient::GetInstance(); - Rando::Settings::GetInstance()->ParseArchipelago(ap_client.GetSlotData()); ParseArchipelagoItemsLocations(ap_client.GetScoutedItems()); + ParseArchipelagoOptions(ap_client.GetSlotData()); // lets see if counting AP_loaded as spoiler loaded does the trick mSpoilerLoaded = true; @@ -481,6 +481,217 @@ void Context::ParseItemLocationsJson(nlohmann::json spoilerFileJson) { } } +void Context::ParseArchipelagoOptions(const std::map& slot_data) { + // Set options to what Archipelago expects. Need to slowly convert these to options in apworld and + // load those in instead. + mOptions[RSK_FOREST].Set(RO_CLOSED_FOREST_OFF); + mOptions[RSK_KAK_GATE].Set(RO_KAK_GATE_OPEN); + mOptions[RSK_DOOR_OF_TIME].Set(RO_DOOROFTIME_OPEN); + mOptions[RSK_ZORAS_FOUNTAIN].Set(RO_ZF_CLOSED); + mOptions[RSK_SLEEPING_WATERFALL].Set(RO_WATERFALL_CLOSED); + mOptions[RSK_STARTING_AGE].Set(RO_AGE_CHILD); + mOptions[RSK_SELECTED_STARTING_AGE].Set(0); + mOptions[RSK_GERUDO_FORTRESS].Set(RO_GF_CARPENTERS_NORMAL); + mOptions[RSK_RAINBOW_BRIDGE].Set(RO_BRIDGE_GREG); + mOptions[RSK_RAINBOW_BRIDGE_STONE_COUNT].Set(0); + mOptions[RSK_RAINBOW_BRIDGE_MEDALLION_COUNT].Set(0); + mOptions[RSK_RAINBOW_BRIDGE_REWARD_COUNT].Set(0); + mOptions[RSK_RAINBOW_BRIDGE_DUNGEON_COUNT].Set(0); + mOptions[RSK_RAINBOW_BRIDGE_TOKEN_COUNT].Set(0); + mOptions[RSK_BRIDGE_OPTIONS].Set(0); + mOptions[RSK_GANONS_TRIALS].Set(RO_GANONS_TRIALS_SKIP); + mOptions[RSK_TRIAL_COUNT].Set(0); + mOptions[RSK_STARTING_OCARINA].Set(RO_GENERIC_NO); + mOptions[RSK_SHUFFLE_OCARINA].Set(RO_GENERIC_YES); + mOptions[RSK_SHUFFLE_OCARINA_BUTTONS].Set(RO_GENERIC_NO); + mOptions[RSK_SHUFFLE_SWIM].Set(RO_GENERIC_NO); + mOptions[RSK_STARTING_DEKU_SHIELD].Set(RO_GENERIC_NO); + mOptions[RSK_STARTING_KOKIRI_SWORD].Set(RO_GENERIC_NO); + mOptions[RSK_STARTING_MASTER_SWORD].Set(RO_GENERIC_NO); + mOptions[RSK_STARTING_ZELDAS_LULLABY].Set(RO_GENERIC_NO); + mOptions[RSK_STARTING_EPONAS_SONG].Set(RO_GENERIC_NO); + mOptions[RSK_STARTING_SARIAS_SONG].Set(RO_GENERIC_NO); + mOptions[RSK_STARTING_SUNS_SONG].Set(RO_GENERIC_NO); + mOptions[RSK_STARTING_SONG_OF_TIME].Set(RO_GENERIC_NO); + mOptions[RSK_STARTING_SONG_OF_STORMS].Set(RO_GENERIC_NO); + mOptions[RSK_STARTING_MINUET_OF_FOREST].Set(RO_GENERIC_NO); + mOptions[RSK_STARTING_BOLERO_OF_FIRE].Set(RO_GENERIC_NO); + mOptions[RSK_STARTING_SERENADE_OF_WATER].Set(RO_GENERIC_NO); + mOptions[RSK_STARTING_REQUIEM_OF_SPIRIT].Set(RO_GENERIC_NO); + mOptions[RSK_STARTING_NOCTURNE_OF_SHADOW].Set(RO_GENERIC_NO); + mOptions[RSK_STARTING_PRELUDE_OF_LIGHT].Set(RO_GENERIC_NO); + mOptions[RSK_SHUFFLE_KOKIRI_SWORD].Set(RO_GENERIC_YES); + mOptions[RSK_SHUFFLE_MASTER_SWORD].Set(RO_GENERIC_NO); + mOptions[RSK_SHUFFLE_CHILD_WALLET].Set(RO_GENERIC_NO); + mOptions[RSK_INCLUDE_TYCOON_WALLET].Set(RO_GENERIC_YES); + mOptions[RSK_SHUFFLE_DUNGEON_REWARDS].Set(RO_DUNGEON_REWARDS_ANYWHERE); + mOptions[RSK_SHUFFLE_SONGS].Set(RO_SONG_SHUFFLE_ANYWHERE); + mOptions[RSK_SHUFFLE_TOKENS].Set(RO_TOKENSANITY_ALL); + mOptions[RSK_SHOPSANITY].Set(RO_SHOPSANITY_OFF); + mOptions[RSK_SHOPSANITY_COUNT].Set(0); + mOptions[RSK_SHOPSANITY_PRICES].Set(0); + mOptions[RSK_SHOPSANITY_PRICES_FIXED_PRICE].Set(0); + mOptions[RSK_SHOPSANITY_PRICES_RANGE_1].Set(0); + mOptions[RSK_SHOPSANITY_PRICES_RANGE_2].Set(0); + mOptions[RSK_SHOPSANITY_PRICES_NO_WALLET_WEIGHT].Set(0); + mOptions[RSK_SHOPSANITY_PRICES_CHILD_WALLET_WEIGHT].Set(0); + mOptions[RSK_SHOPSANITY_PRICES_ADULT_WALLET_WEIGHT].Set(0); + mOptions[RSK_SHOPSANITY_PRICES_GIANT_WALLET_WEIGHT].Set(0); + mOptions[RSK_SHOPSANITY_PRICES_TYCOON_WALLET_WEIGHT].Set(0); + mOptions[RSK_SHOPSANITY_PRICES_AFFORDABLE].Set(0); + mOptions[RSK_SHUFFLE_SCRUBS].Set(RO_SCRUBS_OFF); + mOptions[RSK_SCRUBS_PRICES].Set(0); + mOptions[RSK_SCRUBS_PRICES_FIXED_PRICE].Set(0); + mOptions[RSK_SCRUBS_PRICES_RANGE_1].Set(0); + mOptions[RSK_SCRUBS_PRICES_RANGE_2].Set(0); + mOptions[RSK_SCRUBS_PRICES_NO_WALLET_WEIGHT].Set(0); + mOptions[RSK_SCRUBS_PRICES_CHILD_WALLET_WEIGHT].Set(0); + mOptions[RSK_SCRUBS_PRICES_ADULT_WALLET_WEIGHT].Set(0); + mOptions[RSK_SCRUBS_PRICES_GIANT_WALLET_WEIGHT].Set(0); + mOptions[RSK_SCRUBS_PRICES_TYCOON_WALLET_WEIGHT].Set(0); + mOptions[RSK_SCRUBS_PRICES_AFFORDABLE].Set(0); + mOptions[RSK_SHUFFLE_BEEHIVES].Set(RO_GENERIC_NO); + mOptions[RSK_SHUFFLE_COWS].Set(RO_GENERIC_NO); + mOptions[RSK_SHUFFLE_WEIRD_EGG].Set(RO_GENERIC_NO); + mOptions[RSK_SHUFFLE_GERUDO_MEMBERSHIP_CARD].Set(RO_GENERIC_YES); + mOptions[RSK_SHUFFLE_POTS].Set(RO_GENERIC_NO); + mOptions[RSK_SHUFFLE_CRATES].Set(RO_GENERIC_NO); + mOptions[RSK_SHUFFLE_FROG_SONG_RUPEES].Set(RO_GENERIC_NO); + mOptions[RSK_ITEM_POOL].Set(0); + mOptions[RSK_ICE_TRAPS].Set(0); + mOptions[RSK_GOSSIP_STONE_HINTS].Set(RO_GOSSIP_STONES_NONE); + mOptions[RSK_TOT_ALTAR_HINT].Set(RO_GENERIC_NO); + mOptions[RSK_GANONDORF_HINT].Set(RO_GENERIC_NO); + mOptions[RSK_SHEIK_LA_HINT].Set(RO_GENERIC_NO); + mOptions[RSK_DAMPES_DIARY_HINT].Set(RO_GENERIC_NO); + mOptions[RSK_GREG_HINT].Set(RO_GENERIC_NO); + mOptions[RSK_LOACH_HINT].Set(RO_GENERIC_NO); + mOptions[RSK_SARIA_HINT].Set(RO_GENERIC_NO); + mOptions[RSK_FROGS_HINT].Set(RO_GENERIC_NO); + mOptions[RSK_OOT_HINT].Set(RO_GENERIC_NO); + mOptions[RSK_KAK_10_SKULLS_HINT].Set(RO_GENERIC_NO); + mOptions[RSK_KAK_20_SKULLS_HINT].Set(RO_GENERIC_NO); + mOptions[RSK_KAK_30_SKULLS_HINT].Set(RO_GENERIC_NO); + mOptions[RSK_KAK_40_SKULLS_HINT].Set(RO_GENERIC_NO); + mOptions[RSK_KAK_50_SKULLS_HINT].Set(RO_GENERIC_NO); + mOptions[RSK_KAK_100_SKULLS_HINT].Set(RO_GENERIC_NO); + mOptions[RSK_MASK_SHOP_HINT].Set(RO_GENERIC_NO); + mOptions[RSK_BIGGORON_HINT].Set(RO_GENERIC_NO); + mOptions[RSK_BIG_POES_HINT].Set(RO_GENERIC_NO); + mOptions[RSK_CHICKENS_HINT].Set(RO_GENERIC_NO); + mOptions[RSK_MALON_HINT].Set(RO_GENERIC_NO); + mOptions[RSK_HBA_HINT].Set(RO_GENERIC_NO); + mOptions[RSK_WARP_SONG_HINTS].Set(RO_GENERIC_NO); + mOptions[RSK_SCRUB_TEXT_HINT].Set(RO_GENERIC_NO); + mOptions[RSK_MERCHANT_TEXT_HINT].Set(RO_GENERIC_NO); + mOptions[RSK_FISHING_POLE_HINT].Set(RO_GENERIC_NO); + mOptions[RSK_HINT_CLARITY].Set(0); + mOptions[RSK_HINT_DISTRIBUTION].Set(0); + mOptions[RSK_SHUFFLE_MAPANDCOMPASS].Set(0); + mOptions[RSK_KEYSANITY].Set(RO_DUNGEON_ITEM_LOC_ANYWHERE); + mOptions[RSK_GERUDO_KEYS].Set(RO_GERUDO_KEYS_ANYWHERE); + mOptions[RSK_BOSS_KEYSANITY].Set(RO_DUNGEON_ITEM_LOC_ANYWHERE); + mOptions[RSK_GANONS_BOSS_KEY].Set(RO_GANON_BOSS_KEY_ANYWHERE); + mOptions[RSK_SKIP_CHILD_STEALTH].Set(RO_GENERIC_YES); + mOptions[RSK_SKIP_CHILD_ZELDA].Set(RO_GENERIC_NO); + mOptions[RSK_STARTING_STICKS].Set(RO_GENERIC_NO); + mOptions[RSK_STARTING_NUTS].Set(RO_GENERIC_NO); + mOptions[RSK_FULL_WALLETS].Set(RO_GENERIC_YES); + mOptions[RSK_SHUFFLE_CHEST_MINIGAME].Set(RO_GENERIC_NO); + mOptions[RSK_CUCCO_COUNT].Set(1); + mOptions[RSK_BIG_POE_COUNT].Set(1); + mOptions[RSK_SKIP_EPONA_RACE].Set(RO_GENERIC_YES); + mOptions[RSK_COMPLETE_MASK_QUEST].Set(RO_GENERIC_YES); + mOptions[RSK_SKIP_SCARECROWS_SONG].Set(RO_GENERIC_YES); + mOptions[RSK_SKULLS_SUNS_SONG].Set(0); + mOptions[RSK_SHUFFLE_ADULT_TRADE].Set(RO_GENERIC_NO); + mOptions[RSK_SHUFFLE_MERCHANTS].Set(RO_GENERIC_NO); + mOptions[RSK_MERCHANT_PRICES].Set(0); + mOptions[RSK_MERCHANT_PRICES_FIXED_PRICE].Set(0); + mOptions[RSK_MERCHANT_PRICES_RANGE_1].Set(0); + mOptions[RSK_MERCHANT_PRICES_RANGE_2].Set(0); + mOptions[RSK_MERCHANT_PRICES_NO_WALLET_WEIGHT].Set(0); + mOptions[RSK_MERCHANT_PRICES_CHILD_WALLET_WEIGHT].Set(0); + mOptions[RSK_MERCHANT_PRICES_ADULT_WALLET_WEIGHT].Set(0); + mOptions[RSK_MERCHANT_PRICES_GIANT_WALLET_WEIGHT].Set(0); + mOptions[RSK_MERCHANT_PRICES_TYCOON_WALLET_WEIGHT].Set(0); + mOptions[RSK_MERCHANT_PRICES_AFFORDABLE].Set(0); + mOptions[RSK_BLUE_FIRE_ARROWS].Set(RO_GENERIC_YES); + mOptions[RSK_SUNLIGHT_ARROWS].Set(RO_GENERIC_YES); + mOptions[RSK_ENABLE_BOMBCHU_DROPS].Set(RO_GENERIC_YES); + mOptions[RSK_BOMBCHU_BAG].Set(RO_GENERIC_YES); + mOptions[RSK_LINKS_POCKET].Set(RO_LINKS_POCKET_NOTHING); + mOptions[RSK_MQ_DUNGEON_RANDOM].Set(0); + mOptions[RSK_MQ_DUNGEON_COUNT].Set(0); + mOptions[RSK_MQ_DUNGEON_SET].Set(0); + mOptions[RSK_MQ_DEKU_TREE].Set(0); + mOptions[RSK_MQ_DODONGOS_CAVERN].Set(0); + mOptions[RSK_MQ_JABU_JABU].Set(0); + mOptions[RSK_MQ_FOREST_TEMPLE].Set(0); + mOptions[RSK_MQ_FIRE_TEMPLE].Set(0); + mOptions[RSK_MQ_WATER_TEMPLE].Set(0); + mOptions[RSK_MQ_SPIRIT_TEMPLE].Set(0); + mOptions[RSK_MQ_SHADOW_TEMPLE].Set(0); + mOptions[RSK_MQ_BOTTOM_OF_THE_WELL].Set(0); + mOptions[RSK_MQ_ICE_CAVERN].Set(0); + mOptions[RSK_MQ_GTG].Set(0); + mOptions[RSK_MQ_GANONS_CASTLE].Set(0); + mOptions[RSK_LACS_STONE_COUNT].Set(0); + mOptions[RSK_LACS_MEDALLION_COUNT].Set(0); + mOptions[RSK_LACS_REWARD_COUNT].Set(0); + mOptions[RSK_LACS_DUNGEON_COUNT].Set(0); + mOptions[RSK_LACS_TOKEN_COUNT].Set(0); + mOptions[RSK_LACS_OPTIONS].Set(0); + mOptions[RSK_KEYRINGS].Set(0); + mOptions[RSK_KEYRINGS_RANDOM_COUNT].Set(0); + mOptions[RSK_KEYRINGS_GERUDO_FORTRESS].Set(0); + mOptions[RSK_KEYRINGS_FOREST_TEMPLE].Set(0); + mOptions[RSK_KEYRINGS_FIRE_TEMPLE].Set(0); + mOptions[RSK_KEYRINGS_WATER_TEMPLE].Set(0); + mOptions[RSK_KEYRINGS_SPIRIT_TEMPLE].Set(0); + mOptions[RSK_KEYRINGS_SHADOW_TEMPLE].Set(0); + mOptions[RSK_KEYRINGS_BOTTOM_OF_THE_WELL].Set(0); + mOptions[RSK_KEYRINGS_GTG].Set(0); + mOptions[RSK_KEYRINGS_GANONS_CASTLE].Set(0); + mOptions[RSK_SHUFFLE_ENTRANCES].Set(0); + mOptions[RSK_SHUFFLE_DUNGEON_ENTRANCES].Set(0); + mOptions[RSK_SHUFFLE_OVERWORLD_ENTRANCES].Set(0); + mOptions[RSK_SHUFFLE_INTERIOR_ENTRANCES].Set(0); + mOptions[RSK_SHUFFLE_GROTTO_ENTRANCES].Set(0); + mOptions[RSK_SHUFFLE_OWL_DROPS].Set(0); + mOptions[RSK_SHUFFLE_WARP_SONGS].Set(0); + mOptions[RSK_SHUFFLE_OVERWORLD_SPAWNS].Set(0); + mOptions[RSK_MIXED_ENTRANCE_POOLS].Set(0); + mOptions[RSK_MIX_DUNGEON_ENTRANCES].Set(0); + mOptions[RSK_MIX_BOSS_ENTRANCES].Set(0); + mOptions[RSK_MIX_OVERWORLD_ENTRANCES].Set(0); + mOptions[RSK_MIX_INTERIOR_ENTRANCES].Set(0); + mOptions[RSK_MIX_GROTTO_ENTRANCES].Set(0); + mOptions[RSK_DECOUPLED_ENTRANCES].Set(0); + mOptions[RSK_STARTING_SKULLTULA_TOKEN].Set(0); + mOptions[RSK_STARTING_HEARTS].Set(3); + mOptions[RSK_DAMAGE_MULTIPLIER].Set(0); + mOptions[RSK_ALL_LOCATIONS_REACHABLE].Set(0); + mOptions[RSK_SHUFFLE_BOSS_ENTRANCES].Set(0); + mOptions[RSK_SHUFFLE_100_GS_REWARD].Set(RO_GENERIC_NO); + mOptions[RSK_TRIFORCE_HUNT].Set(RO_GENERIC_NO); + mOptions[RSK_TRIFORCE_HUNT_PIECES_TOTAL].Set(0); + mOptions[RSK_TRIFORCE_HUNT_PIECES_REQUIRED].Set(0); + mOptions[RSK_SHUFFLE_BOSS_SOULS].Set(RO_GENERIC_NO); + mOptions[RSK_FISHSANITY].Set(RO_FISHSANITY_OFF); + mOptions[RSK_FISHSANITY_POND_COUNT].Set(0); + mOptions[RSK_FISHSANITY_AGE_SPLIT].Set(0); + mOptions[RSK_SHUFFLE_FISHING_POLE].Set(RO_GENERIC_NO); + mOptions[RSK_INFINITE_UPGRADES].Set(RO_INF_UPGRADES_OFF); + mOptions[RSK_SKELETON_KEY].Set(RO_GENERIC_NO); + mOptions[RSK_SHUFFLE_DEKU_STICK_BAG].Set(RO_GENERIC_NO); + mOptions[RSK_SHUFFLE_DEKU_NUT_BAG].Set(RO_GENERIC_NO); + mOptions[RSK_SHUFFLE_FREESTANDING].Set(RO_SHUFFLE_FREESTANDING_OFF); + mOptions[RSK_SHUFFLE_FAIRIES].Set(RO_GENERIC_NO); + mOptions[RSK_LOCK_OVERWORLD_DOORS].Set(RO_GENERIC_NO); + mOptions[RSK_SHUFFLE_GRASS].Set(RO_SHUFFLE_GRASS_OFF); +} + void Context::ParseArchipelagoItemsLocations(const std::vector& scouted_items) { const std::string SlotName = ArchipelagoClient::GetInstance().GetSlotName(); diff --git a/soh/soh/Enhancements/randomizer/context.h b/soh/soh/Enhancements/randomizer/context.h index de8edb0c6..f97b21287 100644 --- a/soh/soh/Enhancements/randomizer/context.h +++ b/soh/soh/Enhancements/randomizer/context.h @@ -126,7 +126,7 @@ class Context { RandomizerArea GetAreaFromString(std::string str); void ParseArchipelago(); - void ParseArchipelagoSettings(const std::map& slot_data); + void ParseArchipelagoOptions(const std::map& slot_data); void ParseArchipelagoItemsLocations(const std::vector& slot_data); /** diff --git a/soh/soh/Enhancements/randomizer/hook_handlers.cpp b/soh/soh/Enhancements/randomizer/hook_handlers.cpp index a9b209b7b..3c8e23b2c 100644 --- a/soh/soh/Enhancements/randomizer/hook_handlers.cpp +++ b/soh/soh/Enhancements/randomizer/hook_handlers.cpp @@ -796,6 +796,8 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_l va_list args; va_copy(args, originalArgs); + u8 test; + switch (id) { case VB_ALLOW_ENTRANCE_CS_FOR_EITHER_AGE: { s32 entranceIndex = va_arg(args, s32); @@ -858,6 +860,7 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_l } break; case VB_MOVE_MIDO_IN_KOKIRI_FOREST: + test = RAND_GET_OPTION(RSK_FOREST); if (RAND_GET_OPTION(RSK_FOREST) == RO_CLOSED_FOREST_OFF && gSaveContext.cutsceneIndex == 0) { *should = true; } diff --git a/soh/soh/Enhancements/randomizer/settings.cpp b/soh/soh/Enhancements/randomizer/settings.cpp index aac0e8927..388ea6f6f 100644 --- a/soh/soh/Enhancements/randomizer/settings.cpp +++ b/soh/soh/Enhancements/randomizer/settings.cpp @@ -2906,10 +2906,6 @@ void Settings::ParseJson(nlohmann::json spoilerFileJson) { } } -void Settings::ParseArchipelago(const std::map& slot_data) { - // This is going to be completely redone since switching to apclientpp -} - void Settings::AssignContext(std::shared_ptr ctx) { mContext = ctx; }