Archipelago
Archipelago copied to clipboard
Core: Add list/item group exclusive methods to CollectionState
It was brought to my attention recently that the way I've been using has_group and count_group can break completely if the player is to use either Plando or their Starting Inventory to create more instances of an item than there are intended to ever be in a multiworld.
These new methods would help to fix this issue by only adding to the found total if any number of the item is in state, before moving on to the next item in the group.
Tested this in Bomb Rush Cyberfunk #2925 by choosing one graffiti design of each size, and adding 20 of them to my starting inventory.
Hi! Okay, so, I've been holding off on reviewing this because it had a "soft conflict" with https://github.com/ArchipelagoMW/Archipelago/pull/2934, which I wanted to have merged first
Not really a "real" conflict per se, but moreso, now that that PR is in, this implies that this PR should also add has_from_list_exclusive and count_from_list_exclusive. Can I convince you to add these to the scope of this PR? Then, I'll be willing to review and merge it :) It should be the same process - The new list functions are pretty much 1:1 analogs to the existing group functions.
The reason I wanted it in this order is because the new has_from_list is anywhere from slightly more efficient to infinitely more efficient than has_group, so generally I don't like recommending has_group to people because that. The same will be true here