Merge branch 'split' into Archipelago_Main
# Conflicts: # Main.py
This commit is contained in:
commit
753a5f7cb2
17
Main.py
17
Main.py
|
@ -24,8 +24,8 @@ from worlds.alttp.ItemPool import generate_itempool, difficulties, fill_prizes
|
|||
from Utils import output_path, parse_player_names, get_options, __version__, _version_tuple
|
||||
from worlds.hk import gen_hollow
|
||||
from worlds.hk import create_regions as hk_create_regions
|
||||
from worlds.factorio import gen_factorio, factorio_create_regions
|
||||
from worlds.factorio.Mod import generate_mod
|
||||
# from worlds.factorio import gen_factorio, factorio_create_regions
|
||||
# from worlds.factorio.Mod import generate_mod
|
||||
from worlds.minecraft import gen_minecraft, fill_minecraft_slot_data, generate_mc_data
|
||||
from worlds.minecraft.Regions import minecraft_create_regions
|
||||
from worlds.generic.Rules import locality_rules
|
||||
|
@ -128,9 +128,8 @@ def main(args, seed=None):
|
|||
world.game = args.game.copy()
|
||||
import Options
|
||||
for option_set in Options.option_sets:
|
||||
for option in option_set:
|
||||
setattr(world, option, getattr(args, option, {}))
|
||||
|
||||
# for option in option_set:
|
||||
# setattr(world, option, getattr(args, option, {}))
|
||||
world.glitch_triforce = args.glitch_triforce # This is enabled/disabled globally, no per player option.
|
||||
|
||||
world.rom_seeds = {player: random.Random(world.random.randint(0, 999999999)) for player in range(1, world.players + 1)}
|
||||
|
@ -200,8 +199,8 @@ def main(args, seed=None):
|
|||
for player in world.hk_player_ids:
|
||||
hk_create_regions(world, player)
|
||||
|
||||
for player in world.factorio_player_ids:
|
||||
factorio_create_regions(world, player)
|
||||
# for player in world.factorio_player_ids:
|
||||
# factorio_create_regions(world, player)
|
||||
|
||||
for player in world.minecraft_player_ids:
|
||||
minecraft_create_regions(world, player)
|
||||
|
@ -262,8 +261,8 @@ def main(args, seed=None):
|
|||
for player in world.hk_player_ids:
|
||||
gen_hollow(world, player)
|
||||
|
||||
for player in world.factorio_player_ids:
|
||||
gen_factorio(world, player)
|
||||
# for player in world.factorio_player_ids:
|
||||
# gen_factorio(world, player)
|
||||
|
||||
for player in world.minecraft_player_ids:
|
||||
gen_minecraft(world, player)
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
import worlds.loader
|
||||
print(worlds.loader.world_types)
|
|
@ -0,0 +1,13 @@
|
|||
class AutoWorldRegister(type):
|
||||
_world_types = {}
|
||||
|
||||
def __new__(cls, name, bases, dct):
|
||||
new_class = super().__new__(cls, name, bases, dct)
|
||||
AutoWorldRegister._world_types[name] = new_class
|
||||
return new_class
|
||||
|
||||
class World(metaclass=AutoWorldRegister):
|
||||
"""A World object encompasses a game's Items, Locations, Rules and additional data or functionality required.
|
||||
A Game should have its own subclass of World in which it defines the required data structures."""
|
||||
def __init__(self):
|
||||
pass
|
|
@ -1,8 +1,26 @@
|
|||
from ..BaseWorld import World
|
||||
|
||||
|
||||
from BaseClasses import Region, Entrance, Location, MultiWorld, Item
|
||||
from .Technologies import tech_table, recipe_sources, technology_table, advancement_technologies, \
|
||||
all_ingredient_names, required_technologies, get_rocket_requirements, rocket_recipes
|
||||
from .Shapes import get_shapes
|
||||
|
||||
class Factorio(World):
|
||||
def generate_basic(self, world: MultiWorld, player: int):
|
||||
static_nodes = world._static_nodes = {"automation", "logistics"} # turn dynamic/option?
|
||||
for tech_name, tech_id in tech_table.items():
|
||||
tech_item = Item(tech_name, tech_name in advancement_technologies, tech_id, player)
|
||||
tech_item.game = "Factorio"
|
||||
if tech_name in static_nodes:
|
||||
loc = world.get_location(tech_name, player)
|
||||
loc.item = tech_item
|
||||
loc.locked = True
|
||||
loc.event = tech_item.advancement
|
||||
else:
|
||||
world.itempool.append(tech_item)
|
||||
world.custom_data[player]["custom_technologies"] = custom_technologies = set_custom_technologies(world, player)
|
||||
set_rules(world, player, custom_technologies)
|
||||
|
||||
def gen_factorio(world: MultiWorld, player: int):
|
||||
static_nodes = world._static_nodes = {"automation", "logistics"} # turn dynamic/option?
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
import importlib
|
||||
import os
|
||||
world_types = []
|
||||
world_folder = os.path.dirname(__file__)
|
||||
for entry in os.scandir(world_folder):
|
||||
if entry.is_dir():
|
||||
entryname = entry.name
|
||||
if not entryname.startswith("_"):
|
||||
world_module = importlib.import_module("."+entry.name, package="worlds")
|
||||
world_types.append(world_module)
|
||||
print(world_folder)
|
||||
print(world_types)
|
Loading…
Reference in New Issue