diff --git a/roll_settings.py b/roll_settings.py index 138f790..4266323 100644 --- a/roll_settings.py +++ b/roll_settings.py @@ -25,10 +25,11 @@ def load_weights_file(weights_fname): datain = json.load(fin) weight_options = datain["options"] if "options" in datain else None + conditionals = datain["conditionals"] if "conditionals" in datain else None weight_multiselect = datain["multiselect"] if "multiselect" in datain else None weight_dict = datain["weights"] - return weight_options, weight_multiselect, weight_dict + return weight_options, conditionals, weight_multiselect, weight_dict def generate_balanced_weights(fname="default_weights.json"): @@ -128,19 +129,19 @@ def draw_dungeon_shortcuts(random_settings): def generate_weights_override(weights, override_weights_fname): # Load the weight dictionary if weights == "RSL": - weight_options, weight_multiselect, weight_dict = load_weights_file("weights/rsl_season6.json") + weight_options, conditionals, weight_multiselect, weight_dict = load_weights_file("weights/rsl_season6.json") elif weights == "full-random": weight_options = None weight_dict = generate_balanced_weights(None) else: - weight_options, weight_multiselect, weight_dict = load_weights_file(weights) + weight_options, conditionals, weight_multiselect, weight_dict = load_weights_file(weights) # If an override_weights file name is provided, load it start_with = {"starting_inventory":[], "starting_songs":[], "starting_equipment":[]} if override_weights_fname is not None: print(f"RSL GENERATOR: LOADING OVERRIDE WEIGHTS from {override_weights_fname}") - override_options, override_multiselect, override_weights = load_weights_file(override_weights_fname) + override_options, override_conditionals, override_multiselect, override_weights = load_weights_file(override_weights_fname) # Check for starting items, songs and equipment for key in start_with.keys(): if key in override_weights.keys(): @@ -179,16 +180,21 @@ def generate_weights_override(weights, override_weights_fname): for key, value in override_weights.items(): weight_dict[key] = value + # Replace the conditionals + if override_conditionals is not None: + for name, state in override_conditionals.items(): + conditionals[name] = state + # Replace the multiselects if override_multiselect is not None: for key, value in override_multiselect.items(): weight_multiselect[key] = value - return weight_options, weight_multiselect, weight_dict, start_with + return weight_options, conditionals, weight_multiselect, weight_dict, start_with def generate_plando(weights, override_weights_fname, no_seed): - weight_options, weight_multiselects, weight_dict, start_with = generate_weights_override(weights, override_weights_fname) + weight_options, conditionals, weight_multiselects, weight_dict, start_with = generate_weights_override(weights, override_weights_fname) #################################################################################### # Make a new function that parses the weights file that does this stuff @@ -215,10 +221,14 @@ def generate_plando(weights, override_weights_fname, no_seed): if weight_multiselects is not None: random_settings.update(resolve_multiselects(weight_multiselects)) - # Add starting items, conditionals, tricks, excluded locations, and misc hints + # Set the conditionals + if conditionals is not None: + conds.parse_conditionals(conditionals, weight_dict, random_settings, start_with) + + # Add starting items, tricks, and excluded locations if weight_options is not None: - if "conditionals" in weight_options: - conds.parse_conditionals(weight_options["conditionals"], weight_dict, random_settings, start_with) + # if "conditionals" in weight_options: + # conds.parse_conditionals(weight_options["conditionals"], weight_dict, random_settings, start_with) if "tricks" in weight_options: random_settings["allowed_tricks"] = weight_options["tricks"] if "disabled_locations" in weight_options: diff --git a/rslversion.py b/rslversion.py index 91af557..8be273a 100644 --- a/rslversion.py +++ b/rslversion.py @@ -1,4 +1,4 @@ -__version__ = "2.7.3" +__version__ = "2.7.4" # Randomizer Info randomizer_repo = 'rrealmuto/OoT-Randomizer' diff --git a/weights/beginner_override.json b/weights/beginner_override.json index a2f664c..af0c0f8 100755 --- a/weights/beginner_override.json +++ b/weights/beginner_override.json @@ -4,15 +4,13 @@ "ganon_bosskey_tokens_max": 50, "bridge_hearts_max": 10, "ganon_bosskey_hearts_max": 10, - "triforce_goal_per_world_max": 75, - "conditionals": { - "split_collectible_bridge_conditions": [true, "10%", "50/50", "40/40/20"], - "select_one_pots_crates_freestanding": [false] - }, - "extra_conditionals": { - "limit_mixed_pool_entrances": [true, 2, true], - "keysanity_key_get_keyrings": [true] - } + "triforce_goal_per_world_max": 75 + }, + "conditionals": { + "split_collectible_bridge_conditions": [true, "10%", "50/50", "40/40/20"], + "select_one_pots_crates_freestanding": [false], + "limit_mixed_pool_entrances": [true, 2, true], + "keysanity_key_get_keyrings": [true] }, "weights": { "bridge": { diff --git a/weights/rsl_season6.json b/weights/rsl_season6.json index 7a17a46..ccd8271 100644 --- a/weights/rsl_season6.json +++ b/weights/rsl_season6.json @@ -8,28 +8,6 @@ "ganon_bosskey_hearts_max": 20, "triforce_goal_per_world_max": 100, "starting_items": true, - "conditionals": { - "constant_triforce_hunt_extras": [true], - "exclude_ice_trap_misery": [true], - "disable_keysanity_independence": [true], - "random_scrubs_start_wallet": [true], - "split_collectible_bridge_conditions": [true, "15%", "50/50", "40/40/20"], - "replace_dampe_diary_hint_with_lightarrow": [true], - "adjust_chaos_hint_distro": [true], - "exclude_mapcompass_info_remove": [true], - "ohko_starts_with_nayrus": [true], - "shuffle_valley_lake_exit": [true], - "select_one_pots_crates_freestanding": [true, "20%", "1/1/1", "1/1/1"], - "geometrically_draw_dungeon_shortcuts": [true], - "limit_overworld_entrances_in_mixed_entrance_pools": [true, "20%"], - "restrict_one_entrance_randomizer": [false], - "disable_pot_chest_texture_independence": [false], - "shuffle_goal_hints": [false, "50%"], - "invert_dungeons_mq_count": [false, "0%"], - "exclude_minimal_triforce_hunt": [false], - "limit_mixed_pool_entrances": [false, 2, false], - "keysanity_key_get_keyrings": [false] - }, "misc_hints": [ "altar", "dampe_diary", @@ -61,6 +39,28 @@ ], "disabled_locations": [] }, + "conditionals": { + "constant_triforce_hunt_extras": [true], + "exclude_ice_trap_misery": [true], + "disable_keysanity_independence": [true], + "random_scrubs_start_wallet": [true], + "split_collectible_bridge_conditions": [true, "15%", "50/50", "40/40/20"], + "replace_dampe_diary_hint_with_lightarrow": [true], + "adjust_chaos_hint_distro": [true], + "exclude_mapcompass_info_remove": [true], + "ohko_starts_with_nayrus": [true], + "shuffle_valley_lake_exit": [true], + "select_one_pots_crates_freestanding": [true, "20%", "1/1/1", "1/1/1"], + "geometrically_draw_dungeon_shortcuts": [true], + "limit_overworld_entrances_in_mixed_entrance_pools": [true, "20%"], + "restrict_one_entrance_randomizer": [false], + "disable_pot_chest_texture_independence": [false], + "shuffle_goal_hints": [false, "50%"], + "invert_dungeons_mq_count": [false, "0%"], + "exclude_minimal_triforce_hunt": [false], + "limit_mixed_pool_entrances": [false, 2, false], + "keysanity_key_get_keyrings": [false] + }, "multiselect": { "key_rings": 20, "silver_rupee_pouches": 100,