Logic built and literally have an apworld that can generate a yaml and stuff

This commit is contained in:
MarioSpore
2025-07-28 00:53:04 -04:00
parent c3ddce5b1a
commit 7e06efb1d0
6 changed files with 668 additions and 205 deletions

View File

@@ -1,8 +1,13 @@
from typing import TYPE_CHECKING
from BaseClasses import Region, MultiWorld
from .Locations import GrinchLocation, grinch_locations
from .Options import GrinchOptions
from . import GrinchWorld
from BaseClasses import Region
from .Rules import access_rules_dict, interpret_rule
if TYPE_CHECKING:
from . import GrinchWorld
mainareas_list = [
"Mount Crumpit",
@@ -46,12 +51,15 @@ def create_regions(world: "GrinchWorld"):
world.multiworld.regions.append(Region(supadow, world.player, world.multiworld))
def grinchconnect(world: "GrinchWorld", current_region_name: str, connected_region_name: str):
rule = []
current_region = world.get_region(current_region_name)
connected_region = world.get_region(connected_region_name)
required_items: set[list[str]] = access_rules_dict[connected_region.name]
rule = interpret_rule(required_items, world.player)
#Goes from current to connected
current_region.connect(connected_region)
current_region.connect(connected_region, rule = rule)
#Goes from connected to current
connected_region.connect(current_region)
connected_region.connect(current_region, rule = rule)
def connect_regions(world: "GrinchWorld"):
grinchconnect(world, "Mount Crumpit", "Whoville")
@@ -59,12 +67,12 @@ def connect_regions(world: "GrinchWorld"):
grinchconnect(world, "Mount Crumpit", "Who Dump")
grinchconnect(world, "Mount Crumpit", "Who Lake")
grinchconnect(world, "Mount Crumpit", "Sleigh Room")
grinchconnect(world, "Mount Crumpit", "Spin N' Win Supadow")
grinchconnect(world, "Mount Crumpit", "Dankamania Supadow")
grinchconnect(world, "Mount Crumpit", "The Copter Race Contest Supadow")
# grinchconnect(world, "Mount Crumpit", "Spin N' Win Supadow")
# grinchconnect(world, "Mount Crumpit", "Dankamania Supadow")
# grinchconnect(world, "Mount Crumpit", "The Copter Race Contest Supadow")
grinchconnect(world, "Whoville", "Post Office")
grinchconnect(world, "Whoville", "City Hall")
grinchconnect(world, "Whoville", "Countdown to X-Mas Tower")
grinchconnect(world, "Whoville", "Countdown to X-Mas Clock Tower")
grinchconnect(world, "Who Forest", "Ski Resort")
grinchconnect(world, "Who Forest", "Civic Center")
grinchconnect(world, "Who Dump", "Minefield")