Core: Add State add/remove/set Helpers (#4845)
This commit is contained in:
@@ -428,13 +428,13 @@ class MessengerWorld(World):
|
||||
def collect(self, state: "CollectionState", item: "Item") -> bool:
|
||||
change = super().collect(state, item)
|
||||
if change and "Time Shard" in item.name:
|
||||
state.prog_items[self.player]["Shards"] += int(item.name.strip("Time Shard ()"))
|
||||
state.add_item("Shards", self.player, int(item.name.strip("Time Shard ()")))
|
||||
return change
|
||||
|
||||
def remove(self, state: "CollectionState", item: "Item") -> bool:
|
||||
change = super().remove(state, item)
|
||||
if change and "Time Shard" in item.name:
|
||||
state.prog_items[self.player]["Shards"] -= int(item.name.strip("Time Shard ()"))
|
||||
state.remove_item("Shards", self.player, int(item.name.strip("Time Shard ()")))
|
||||
return change
|
||||
|
||||
@classmethod
|
||||
|
||||
Reference in New Issue
Block a user