Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor rework of shopkeeper_item_group #58174

Merged
merged 3 commits into from
Jun 12, 2022

Conversation

andrei8l
Copy link
Contributor

@andrei8l andrei8l commented Jun 5, 2022

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 the shopkeeper_blacklist I'm introducing in #57952: seems unnecessary and gross

Testing

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 feature
dseguin also yours please since you wrote the original implementation

@github-actions github-actions bot added <Documentation> Design documents, internal info, guides and help. [C++] Changes (can be) made in C++. Previously named `Code` [JSON] Changes (can be) made in JSON [Markdown] Markdown issues and PRs Code: Tests Measurement, self-control, statistics, balancing. Mods Issues related to mods or modding astyled astyled PR, label is assigned by github actions labels Jun 5, 2022
@andrei8l andrei8l force-pushed the shopkeeper-item-group-rework branch from 089a14f to f9780f7 Compare June 5, 2022 13:01
@github-actions github-actions bot added json-styled JSON lint passed, label assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions labels Jun 5, 2022
@andrei8l andrei8l marked this pull request as ready for review June 5, 2022 14:57
@andrei8l andrei8l force-pushed the shopkeeper-item-group-rework branch from f9780f7 to 55171f3 Compare June 5, 2022 14:57
src/npc_class.cpp Outdated Show resolved Hide resolved
@andrei8l andrei8l force-pushed the shopkeeper-item-group-rework branch from 55171f3 to d8a9b3f Compare June 6, 2022 12:54
@andrei8l andrei8l mentioned this pull request Jun 8, 2022
2 tasks
@dseguin dseguin merged commit c15589a into CleverRaven:master Jun 12, 2022
@andrei8l
Copy link
Contributor Author

Thanks for merging.

@andrei8l andrei8l deleted the shopkeeper-item-group-rework branch June 12, 2022 01:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions [C++] Changes (can be) made in C++. Previously named `Code` Code: Tests Measurement, self-control, statistics, balancing. <Documentation> Design documents, internal info, guides and help. [JSON] Changes (can be) made in JSON json-styled JSON lint passed, label assigned by github actions [Markdown] Markdown issues and PRs Mods Issues related to mods or modding
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants