mirror of
https://github.com/MarioSpore/Grinch-AP.git
synced 2025-10-21 20:21:32 -06:00
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:
@@ -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
|
||||
|
Reference in New Issue
Block a user