Skip to content

Commit

Permalink
Actually item bc that seems more useful
Browse files Browse the repository at this point in the history
  • Loading branch information
NewSoupVi committed Mar 15, 2024
1 parent 76392c9 commit 4e0ad3e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions BaseClasses.py
Original file line number Diff line number Diff line change
Expand Up @@ -970,7 +970,7 @@ def add_locations(self, locations: Dict[str, Optional[int]],
self.locations.append(location_type(self.player, location, address, self))

def add_event(self, location_name: str, item_name: Optional[str] = None,
rule: Optional[Callable[[CollectionState], bool]] = None) -> Location:
rule: Optional[Callable[[CollectionState], bool]] = None) -> Item:
"""
Adds an event location/item pair to a region.
Expand All @@ -980,14 +980,16 @@ def add_event(self, location_name: str, item_name: Optional[str] = None,
"""
if item_name is None:
item_name = location_name
event_item = Item(item_name, ItemClassification.progression, None, self.player)

event_location = Location(self.player, location_name, None, self)
if rule is not None:
event_location.access_rule = rule
self.locations.append(event_location)
event_location.place_locked_item(Item(item_name, ItemClassification.progression, None, self.player))

return event_location
event_location.place_locked_item(event_item)

return event_item

def connect(self, connecting_region: Region, name: Optional[str] = None,
rule: Optional[Callable[[CollectionState], bool]] = None) -> entrance_type:
Expand Down

0 comments on commit 4e0ad3e

Please sign in to comment.