Allow locations to be prioritized for progress item placement (#189)

This commit is contained in:
Brad Humphrey
2022-01-19 20:19:07 -07:00
committed by GitHub
parent ab4fb6e69c
commit ec95ce8329
4 changed files with 371 additions and 45 deletions

View File

@@ -787,7 +787,7 @@ class Region(object):
self.type = type_
self.entrances = []
self.exits = []
self.locations = []
self.locations: List[Location] = []
self.dungeon = None
self.shop = None
self.world = world
@@ -908,6 +908,11 @@ class Boss():
return f"Boss({self.name})"
class LocationProgressType(Enum):
DEFAULT = 1
PRIORITY = 2
EXCLUDED = 3
class Location():
# If given as integer, then this is the shop's inventory index
shop_slot: Optional[int] = None
@@ -919,6 +924,7 @@ class Location():
show_in_spoiler: bool = True
excluded: bool = False
crystal: bool = False
progress_type: LocationProgressType = LocationProgressType.DEFAULT
always_allow = staticmethod(lambda item, state: False)
access_rule = staticmethod(lambda state: True)
item_rule = staticmethod(lambda item: True)