mirror of
https://github.com/MarioSpore/Grinch-AP.git
synced 2025-10-21 20:21:32 -06:00
Options: change displayname to display_name
This commit is contained in:
@@ -11,7 +11,7 @@ LuaBool = Or(bool, And(int, lambda n: n in (0, 1)))
|
||||
|
||||
class MaxSciencePack(Choice):
|
||||
"""Maximum level of science pack required to complete the game."""
|
||||
displayname = "Maximum Required Science Pack"
|
||||
display_name = "Maximum Required Science Pack"
|
||||
option_automation_science_pack = 0
|
||||
option_logistic_science_pack = 1
|
||||
option_military_science_pack = 2
|
||||
@@ -35,7 +35,7 @@ class MaxSciencePack(Choice):
|
||||
|
||||
class Goal(Choice):
|
||||
"""Goal required to complete the game."""
|
||||
displayname = "Goal"
|
||||
display_name = "Goal"
|
||||
option_rocket = 0
|
||||
option_satellite = 1
|
||||
default = 0
|
||||
@@ -43,7 +43,7 @@ class Goal(Choice):
|
||||
|
||||
class TechCost(Choice):
|
||||
"""How expensive are the technologies."""
|
||||
displayname = "Technology Cost Scale"
|
||||
display_name = "Technology Cost Scale"
|
||||
option_very_easy = 0
|
||||
option_easy = 1
|
||||
option_kind = 2
|
||||
@@ -56,7 +56,7 @@ class TechCost(Choice):
|
||||
|
||||
class Silo(Choice):
|
||||
"""Ingredients to craft rocket silo or auto-place if set to spawn."""
|
||||
displayname = "Rocket Silo"
|
||||
display_name = "Rocket Silo"
|
||||
option_vanilla = 0
|
||||
option_randomize_recipe = 1
|
||||
option_spawn = 2
|
||||
@@ -65,7 +65,7 @@ class Silo(Choice):
|
||||
|
||||
class Satellite(Choice):
|
||||
"""Ingredients to craft satellite."""
|
||||
displayname = "Satellite"
|
||||
display_name = "Satellite"
|
||||
option_vanilla = 0
|
||||
option_randomize_recipe = 1
|
||||
default = 0
|
||||
@@ -73,7 +73,7 @@ class Satellite(Choice):
|
||||
|
||||
class FreeSamples(Choice):
|
||||
"""Get free items with your technologies."""
|
||||
displayname = "Free Samples"
|
||||
display_name = "Free Samples"
|
||||
option_none = 0
|
||||
option_single_craft = 1
|
||||
option_half_stack = 2
|
||||
@@ -83,7 +83,7 @@ class FreeSamples(Choice):
|
||||
|
||||
class TechTreeLayout(Choice):
|
||||
"""Selects how the tech tree nodes are interwoven."""
|
||||
displayname = "Technology Tree Layout"
|
||||
display_name = "Technology Tree Layout"
|
||||
option_single = 0
|
||||
option_small_diamonds = 1
|
||||
option_medium_diamonds = 2
|
||||
@@ -101,7 +101,7 @@ class TechTreeLayout(Choice):
|
||||
|
||||
class TechTreeInformation(Choice):
|
||||
"""How much information should be displayed in the tech tree."""
|
||||
displayname = "Technology Tree Information"
|
||||
display_name = "Technology Tree Information"
|
||||
option_none = 0
|
||||
option_advancement = 1
|
||||
option_full = 2
|
||||
@@ -119,7 +119,7 @@ class RecipeTime(Choice):
|
||||
New Normal: 0.25 - 10 seconds
|
||||
New Slow: 5 - 10 seconds
|
||||
"""
|
||||
displayname = "Recipe Time"
|
||||
display_name = "Recipe Time"
|
||||
option_vanilla = 0
|
||||
option_fast = 1
|
||||
option_normal = 2
|
||||
@@ -133,7 +133,7 @@ class RecipeTime(Choice):
|
||||
class Progressive(Choice):
|
||||
"""Merges together Technologies like "automation-1" to "automation-3" into 3 copies of "Progressive Automation",
|
||||
which awards them in order."""
|
||||
displayname = "Progressive Technologies"
|
||||
display_name = "Progressive Technologies"
|
||||
option_off = 0
|
||||
option_grouped_random = 1
|
||||
option_on = 2
|
||||
@@ -147,26 +147,26 @@ class Progressive(Choice):
|
||||
|
||||
class RecipeIngredients(Choice):
|
||||
"""Select if rocket, or rocket + science pack ingredients should be random."""
|
||||
displayname = "Random Recipe Ingredients Level"
|
||||
display_name = "Random Recipe Ingredients Level"
|
||||
option_rocket = 0
|
||||
option_science_pack = 1
|
||||
|
||||
|
||||
class FactorioStartItems(ItemDict):
|
||||
"""Mapping of Factorio internal item-name to amount granted on start."""
|
||||
displayname = "Starting Items"
|
||||
display_name = "Starting Items"
|
||||
verify_item_name = False
|
||||
default = {"burner-mining-drill": 19, "stone-furnace": 19}
|
||||
|
||||
|
||||
class FactorioFreeSampleBlacklist(OptionSet):
|
||||
"""Set of items that should never be granted from Free Samples"""
|
||||
displayname = "Free Sample Blacklist"
|
||||
display_name = "Free Sample Blacklist"
|
||||
|
||||
|
||||
class FactorioFreeSampleWhitelist(OptionSet):
|
||||
"""Overrides any free sample blacklist present. This may ruin the balance of the mod, be warned."""
|
||||
displayname = "Free Sample Whitelist"
|
||||
display_name = "Free Sample Whitelist"
|
||||
|
||||
|
||||
class TrapCount(Range):
|
||||
@@ -175,19 +175,19 @@ class TrapCount(Range):
|
||||
|
||||
class AttackTrapCount(TrapCount):
|
||||
"""Trap items that when received trigger an attack on your base."""
|
||||
displayname = "Attack Traps"
|
||||
display_name = "Attack Traps"
|
||||
|
||||
|
||||
class EvolutionTrapCount(TrapCount):
|
||||
"""Trap items that when received increase the enemy evolution."""
|
||||
displayname = "Evolution Traps"
|
||||
display_name = "Evolution Traps"
|
||||
|
||||
|
||||
class EvolutionTrapIncrease(Range):
|
||||
"""How much an Evolution Trap increases the enemy evolution.
|
||||
Increases scale down proportionally to the session's current evolution factor
|
||||
(40 increase at 0.50 will add 0.20... 40 increase at 0.75 will add 0.10...)"""
|
||||
displayname = "Evolution Trap % Effect"
|
||||
display_name = "Evolution Trap % Effect"
|
||||
range_start = 1
|
||||
default = 10
|
||||
range_end = 100
|
||||
@@ -196,7 +196,7 @@ class EvolutionTrapIncrease(Range):
|
||||
class FactorioWorldGen(OptionDict):
|
||||
"""World Generation settings. Overview of options at https://wiki.factorio.com/Map_generator,
|
||||
with in-depth documentation at https://lua-api.factorio.com/latest/Concepts.html#MapGenSettings"""
|
||||
displayname = "World Generation"
|
||||
display_name = "World Generation"
|
||||
# FIXME: do we want default be a rando-optimized default or in-game DS?
|
||||
value: typing.Dict[str, typing.Dict[str, typing.Any]]
|
||||
default = {
|
||||
@@ -330,7 +330,7 @@ class FactorioWorldGen(OptionDict):
|
||||
|
||||
class ImportedBlueprint(DefaultOnToggle):
|
||||
"""Allow or Disallow Blueprints from outside the current savegame."""
|
||||
displayname = "Blueprints"
|
||||
display_name = "Blueprints"
|
||||
|
||||
|
||||
factorio_options: typing.Dict[str, type(Option)] = {
|
||||
|
||||
@@ -74,7 +74,6 @@ class Factorio(World):
|
||||
|
||||
self.sending_visible = self.world.tech_tree_information[player] == TechTreeInformation.option_full
|
||||
|
||||
|
||||
generate_output = generate_mod
|
||||
|
||||
def create_regions(self):
|
||||
@@ -145,12 +144,12 @@ class Factorio(World):
|
||||
silo_recipe = None
|
||||
if self.world.silo[self.player] == Silo.option_spawn:
|
||||
silo_recipe = self.custom_recipes["rocket-silo"] if "rocket-silo" in self.custom_recipes \
|
||||
else next(iter(all_product_sources.get("rocket-silo")))
|
||||
else next(iter(all_product_sources.get("rocket-silo")))
|
||||
part_recipe = self.custom_recipes["rocket-part"]
|
||||
satellite_recipe = None
|
||||
if self.world.goal[self.player] == Goal.option_satellite:
|
||||
satellite_recipe = self.custom_recipes["satellite"] if "satellite" in self.custom_recipes \
|
||||
else next(iter(all_product_sources.get("satellite")))
|
||||
else next(iter(all_product_sources.get("satellite")))
|
||||
victory_tech_names = get_rocket_requirements(silo_recipe, part_recipe, satellite_recipe)
|
||||
world.get_location("Rocket Launch", player).access_rule = lambda state: all(state.has(technology, player)
|
||||
for technology in
|
||||
@@ -205,7 +204,8 @@ class Factorio(World):
|
||||
new_ingredient = pool.pop()
|
||||
liquids_used += 1
|
||||
new_ingredients[new_ingredient] = 1
|
||||
return Recipe(original.name, self.get_category(original.category, liquids_used), new_ingredients, original.products, original.energy)
|
||||
return Recipe(original.name, self.get_category(original.category, liquids_used), new_ingredients,
|
||||
original.products, original.energy)
|
||||
|
||||
def make_balanced_recipe(self, original: Recipe, pool: list, factor: float = 1, allow_liquids: int = 2) -> \
|
||||
Recipe:
|
||||
@@ -225,7 +225,7 @@ class Factorio(World):
|
||||
while remaining_num_ingredients > 0 and pool:
|
||||
ingredient = pool.pop()
|
||||
if liquids_used == allow_liquids and ingredient in liquids:
|
||||
continue # can't use this ingredient as we already have maximum liquid in our recipe.
|
||||
continue # can't use this ingredient as we already have maximum liquid in our recipe.
|
||||
if ingredient in all_product_sources:
|
||||
ingredient_recipe = min(all_product_sources[ingredient], key=lambda recipe: recipe.rel_cost)
|
||||
ingredient_raw = sum((count for ingredient, count in ingredient_recipe.base_cost.items()))
|
||||
@@ -292,7 +292,8 @@ class Factorio(World):
|
||||
if remaining_num_ingredients > 1:
|
||||
logging.warning("could not randomize recipe")
|
||||
|
||||
return Recipe(original.name, self.get_category(original.category, liquids_used), new_ingredients, original.products, original.energy)
|
||||
return Recipe(original.name, self.get_category(original.category, liquids_used), new_ingredients,
|
||||
original.products, original.energy)
|
||||
|
||||
def set_custom_technologies(self):
|
||||
custom_technologies = {}
|
||||
|
||||
Reference in New Issue
Block a user