Minor rework of shopkeeper_item_group #58174
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
None
Purpose of change
shopkeeper_item_group
currently blocks restocking from using item groups if their conditions are not met.strict
parameter prevents buy-back if conditions are not met after restocking.This means that if the player meets the conditions right after a restock (by ex. turning in a mission or picking the right dialogue option), they'll have to wait until the next restock before they can buy the new items.
I want to change it to:
strict
blocks restocking from using item groups if their conditions are not met. Conditions on their own only block selling (ie.npc::wants_to_sell()
)This will make the gated items available right away once conditions are met. Item groups that aren't supposed to be visible for some reason (like the Hub 01 UHMWPE armor pieces) can be gated by a
strict
condition.Split off from #57952
Describe the solution
Implement
Describe alternatives you've considered
Using a
shopkeeper_sell_blacklist
like theshopkeeper_blacklist
I'm introducing in #57952: seems unnecessary and grossTesting
Unit test.
Additional context
This will have a real use case in #58052
I-am-Erk I'd like to get your opinion since you originally asked for the
shopkeeper_item_group
featuredseguin also yours please since you wrote the original implementation