Move Factorio, Hollow Knight and Minecraft Options into AutoWorld
This commit is contained in:
@@ -9,7 +9,7 @@ import json
|
||||
import jinja2
|
||||
import Utils
|
||||
import shutil
|
||||
import Options
|
||||
from . import Options
|
||||
from BaseClasses import MultiWorld
|
||||
from .Technologies import tech_table, rocket_recipes, recipes, free_sample_blacklist
|
||||
|
||||
|
||||
85
worlds/factorio/Options.py
Normal file
85
worlds/factorio/Options.py
Normal file
@@ -0,0 +1,85 @@
|
||||
import typing
|
||||
|
||||
from Options import Choice, OptionDict, Option, DefaultOnToggle
|
||||
|
||||
|
||||
class MaxSciencePack(Choice):
|
||||
option_automation_science_pack = 0
|
||||
option_logistic_science_pack = 1
|
||||
option_military_science_pack = 2
|
||||
option_chemical_science_pack = 3
|
||||
option_production_science_pack = 4
|
||||
option_utility_science_pack = 5
|
||||
option_space_science_pack = 6
|
||||
default = 6
|
||||
|
||||
def get_allowed_packs(self):
|
||||
return {option.replace("_", "-") for option, value in self.options.items() if value <= self.value} - \
|
||||
{"space-science-pack"} # with rocket launch being the goal, post-launch techs don't make sense
|
||||
|
||||
|
||||
class TechCost(Choice):
|
||||
option_very_easy = 0
|
||||
option_easy = 1
|
||||
option_kind = 2
|
||||
option_normal = 3
|
||||
option_hard = 4
|
||||
option_very_hard = 5
|
||||
option_insane = 6
|
||||
default = 3
|
||||
|
||||
|
||||
class FreeSamples(Choice):
|
||||
option_none = 0
|
||||
option_single_craft = 1
|
||||
option_half_stack = 2
|
||||
option_stack = 3
|
||||
default = 3
|
||||
|
||||
|
||||
class TechTreeLayout(Choice):
|
||||
option_single = 0
|
||||
option_small_diamonds = 1
|
||||
option_medium_diamonds = 2
|
||||
option_large_diamonds = 3
|
||||
option_small_pyramids = 4
|
||||
option_medium_pyramids = 5
|
||||
option_large_pyramids = 6
|
||||
option_small_funnels = 7
|
||||
option_medium_funnels = 8
|
||||
option_large_funnels = 9
|
||||
option_funnels = 4
|
||||
alias_pyramid = 6
|
||||
alias_funnel = 9
|
||||
default = 0
|
||||
|
||||
|
||||
class TechTreeInformation(Choice):
|
||||
option_none = 0
|
||||
option_advancement = 1
|
||||
option_full = 2
|
||||
default = 2
|
||||
|
||||
|
||||
class RecipeTime(Choice):
|
||||
option_vanilla = 0
|
||||
option_fast = 1
|
||||
option_normal = 2
|
||||
option_slow = 4
|
||||
option_chaos = 5
|
||||
|
||||
|
||||
class FactorioStartItems(OptionDict):
|
||||
default = {"burner-mining-drill": 19, "stone-furnace": 19}
|
||||
|
||||
|
||||
factorio_options: typing.Dict[str, type(Option)] = {
|
||||
"max_science_pack": MaxSciencePack,
|
||||
"tech_tree_layout": TechTreeLayout,
|
||||
"tech_cost": TechCost,
|
||||
"free_samples": FreeSamples,
|
||||
"tech_tree_information": TechTreeInformation,
|
||||
"starting_items": FactorioStartItems,
|
||||
"recipe_time": RecipeTime,
|
||||
"imported_blueprints": DefaultOnToggle,
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
from typing import Dict, List, Set
|
||||
|
||||
from BaseClasses import MultiWorld
|
||||
from Options import TechTreeLayout
|
||||
from worlds.factorio.Options import TechTreeLayout
|
||||
|
||||
funnel_layers = {TechTreeLayout.option_small_funnels: 3,
|
||||
TechTreeLayout.option_medium_funnels: 4,
|
||||
|
||||
@@ -4,11 +4,12 @@ from typing import Dict, Set, FrozenSet
|
||||
import os
|
||||
import json
|
||||
|
||||
import Options
|
||||
import Utils
|
||||
import logging
|
||||
import functools
|
||||
|
||||
from . import Options
|
||||
|
||||
factorio_id = 2 ** 17
|
||||
source_folder = Utils.local_path("data", "factorio")
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ from .Technologies import tech_table, recipe_sources, technology_table, advancem
|
||||
all_ingredient_names, required_technologies, get_rocket_requirements, rocket_recipes
|
||||
from .Shapes import get_shapes
|
||||
from .Mod import generate_mod
|
||||
|
||||
from .Options import factorio_options
|
||||
|
||||
class Factorio(World):
|
||||
game: str = "Factorio"
|
||||
@@ -80,6 +80,8 @@ class Factorio(World):
|
||||
|
||||
world.completion_condition[player] = lambda state: state.has('Victory', player)
|
||||
|
||||
options = factorio_options
|
||||
|
||||
def set_custom_technologies(world: MultiWorld, player: int):
|
||||
custom_technologies = {}
|
||||
allowed_packs = world.max_science_pack[player].get_allowed_packs()
|
||||
|
||||
Reference in New Issue
Block a user