mirror of
https://github.com/MarioSpore/Grinch-AP.git
synced 2025-10-21 12:11:33 -06:00
Core: Region handling customization (#3682)
This commit is contained in:
@@ -292,6 +292,14 @@ class World(metaclass=AutoWorldRegister):
|
||||
web: ClassVar[WebWorld] = WebWorld()
|
||||
"""see WebWorld for options"""
|
||||
|
||||
origin_region_name: str = "Menu"
|
||||
"""Name of the Region from which accessibility is tested."""
|
||||
|
||||
explicit_indirect_conditions: bool = True
|
||||
"""If True, the world implementation is supposed to use MultiWorld.register_indirect_condition() correctly.
|
||||
If False, everything is rechecked at every step, which is slower computationally,
|
||||
but may be desirable in complex/dynamic worlds."""
|
||||
|
||||
multiworld: "MultiWorld"
|
||||
"""autoset on creation. The MultiWorld object for the currently generating multiworld."""
|
||||
player: int
|
||||
|
@@ -101,6 +101,7 @@ class Factorio(World):
|
||||
tech_tree_layout_prerequisites: typing.Dict[FactorioScienceLocation, typing.Set[FactorioScienceLocation]]
|
||||
tech_mix: int = 0
|
||||
skip_silo: bool = False
|
||||
origin_region_name = "Nauvis"
|
||||
science_locations: typing.List[FactorioScienceLocation]
|
||||
|
||||
settings: typing.ClassVar[FactorioSettings]
|
||||
@@ -125,9 +126,6 @@ class Factorio(World):
|
||||
def create_regions(self):
|
||||
player = self.player
|
||||
random = self.multiworld.random
|
||||
menu = Region("Menu", player, self.multiworld)
|
||||
crash = Entrance(player, "Crash Land", menu)
|
||||
menu.exits.append(crash)
|
||||
nauvis = Region("Nauvis", player, self.multiworld)
|
||||
|
||||
location_count = len(base_tech_table) - len(useless_technologies) - self.skip_silo + \
|
||||
@@ -184,8 +182,7 @@ class Factorio(World):
|
||||
event = FactorioItem(f"Automated {ingredient}", ItemClassification.progression, None, player)
|
||||
location.place_locked_item(event)
|
||||
|
||||
crash.connect(nauvis)
|
||||
self.multiworld.regions += [menu, nauvis]
|
||||
self.multiworld.regions.append(nauvis)
|
||||
|
||||
def create_items(self) -> None:
|
||||
player = self.player
|
||||
|
@@ -45,7 +45,7 @@ class SubnauticaWorld(World):
|
||||
options_dataclass = options.SubnauticaOptions
|
||||
options: options.SubnauticaOptions
|
||||
required_client_version = (0, 5, 0)
|
||||
|
||||
origin_region_name = "Planet 4546B"
|
||||
creatures_to_scan: List[str]
|
||||
|
||||
def generate_early(self) -> None:
|
||||
@@ -66,13 +66,9 @@ class SubnauticaWorld(World):
|
||||
creature_pool, self.options.creature_scans.value)
|
||||
|
||||
def create_regions(self):
|
||||
# Create Regions
|
||||
menu_region = Region("Menu", self.player, self.multiworld)
|
||||
# Create Region
|
||||
planet_region = Region("Planet 4546B", self.player, self.multiworld)
|
||||
|
||||
# Link regions together
|
||||
menu_region.connect(planet_region, "Lifepod 5")
|
||||
|
||||
# Create regular locations
|
||||
location_names = itertools.chain((location["name"] for location in locations.location_table.values()),
|
||||
(creature + creatures.suffix for creature in self.creatures_to_scan))
|
||||
@@ -93,11 +89,8 @@ class SubnauticaWorld(World):
|
||||
# make the goal event the victory "item"
|
||||
location.item.name = "Victory"
|
||||
|
||||
# Register regions to multiworld
|
||||
self.multiworld.regions += [
|
||||
menu_region,
|
||||
planet_region
|
||||
]
|
||||
# Register region to multiworld
|
||||
self.multiworld.regions.append(planet_region)
|
||||
|
||||
# refer to rules.py
|
||||
set_rules = set_rules
|
||||
|
Reference in New Issue
Block a user