The Messenger, LADX: use collect and remove as intended (#2093)

Co-authored-by: el-u <109771707+el-u@users.noreply.github.com>
This commit is contained in:
Aaron Wagener
2023-11-25 15:07:02 -06:00
committed by GitHub
parent fe6a70a1de
commit cfe357eb71
3 changed files with 60 additions and 26 deletions

View File

@@ -176,11 +176,14 @@ class MessengerWorld(World):
self.total_shards += count
return MessengerItem(name, self.player, item_id, override_prog, count)
def collect_item(self, state: "CollectionState", item: "Item", remove: bool = False) -> Optional[str]:
if item.advancement and "Time Shard" in item.name:
shard_count = int(item.name.strip("Time Shard ()"))
if remove:
shard_count = -shard_count
state.prog_items[self.player]["Shards"] += shard_count
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 ()"))
return change
return super().collect_item(state, item, remove)
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 ()"))
return change