AutoWorld: basic Item handling

This commit is contained in:
Fabian Dill
2021-07-12 13:54:47 +02:00
parent babd809fa6
commit 31c550d410
11 changed files with 84 additions and 51 deletions

View File

@@ -272,6 +272,8 @@ class MultiWorld():
return next(location for location in self.get_locations() if
location.item and location.item.name == item and location.item.player == player)
def create_item(self, item_name: str, player: int) -> Item:
return self.worlds[player].create_item(item_name)
def push_precollected(self, item: Item):
item.world = self
@@ -859,7 +861,6 @@ class CollectionState(object):
(self.has('Progressive Weapons', player, 1) and self.has('Bed', player)))
return respawn_dragon and self.has('Progressive Weapons', player, 2) and self.has('Progressive Armor', player) and self.has('Archery', player)
def collect(self, item: Item, event: bool = False, location: Location = None) -> bool:
if location:
self.locations_checked.add(location)