From 6f12ed38d95d0b53a0af2d386d2e9f0b9dcfc74b Mon Sep 17 00:00:00 2001 From: CaitSith2 Date: Thu, 2 Dec 2021 15:27:48 -0800 Subject: [PATCH] Add in whitelist for overriding blacklist. --- worlds/factorio/Mod.py | 3 ++- worlds/factorio/Options.py | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/worlds/factorio/Mod.py b/worlds/factorio/Mod.py index 90580ab4..0b10e8f5 100644 --- a/worlds/factorio/Mod.py +++ b/worlds/factorio/Mod.py @@ -113,7 +113,7 @@ def generate_mod(world, output_directory: str): "goal": multiworld.goal[player].value} for factorio_option in Options.factorio_options: - if factorio_option == "free_sample_blacklist": + if factorio_option in ["free_sample_blacklist", "free_sample_whitelist"]: continue template_data[factorio_option] = getattr(multiworld, factorio_option)[player].value @@ -124,6 +124,7 @@ def generate_mod(world, output_directory: str): template_data["free_sample_blacklist"]["satellite"] = 1 template_data["free_sample_blacklist"].update({item: 1 for item in multiworld.free_sample_blacklist[player].value}) + template_data["free_sample_blacklist"].update({item: 0 for item in multiworld.free_sample_whitelist[player].value}) control_code = control_template.render(**template_data) data_template_code = data_template.render(**template_data) diff --git a/worlds/factorio/Options.py b/worlds/factorio/Options.py index 2da6d974..38991102 100644 --- a/worlds/factorio/Options.py +++ b/worlds/factorio/Options.py @@ -158,6 +158,11 @@ class FactorioFreeSampleBlacklist(OptionSet): displayname = "Free Sample Blacklist" +class FactorioFreeSampleWhitelist(OptionSet): + """overrides any free sample blacklist present. This may ruin the balance of the mod, be forewarned.""" + displayname = "Free Sample Whitelist" + + class TrapCount(Range): range_end = 4 @@ -327,6 +332,7 @@ factorio_options: typing.Dict[str, type(Option)] = { "tech_tree_information": TechTreeInformation, "starting_items": FactorioStartItems, "free_sample_blacklist": FactorioFreeSampleBlacklist, + "free_sample_whitelist": FactorioFreeSampleWhitelist, "recipe_time": RecipeTime, "recipe_ingredients": RecipeIngredients, "imported_blueprints": ImportedBlueprint,