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

Infrastructure: Add max_worn field, migrate ONLY_ONE flag #79607

Merged
merged 7 commits into from
Feb 10, 2025

Conversation

b3brodie
Copy link
Contributor

@b3brodie b3brodie commented Feb 9, 2025

Summary

Infrastructure "Add max_worn field, migrate ONLY_ONE flag"

Purpose of change

Some items should be wearable more than 2 times
Remove flag hardcoding for more modular decision on how many items of a type can be worn
In terms of player visible changes, allow wearing more than just two pins.

Describe the solution

Adds 'max_worn' field that allows defining how many instances of the item can be worn at once. Defaults to 2.
Allow wearing maximum integer pins at once to simulate ability to wear infinite pins.
Replace every instance of ONLY_ONE with "max_worn": 1
Deprecate ONLY_ONE flag

Describe alternatives you've considered

N/A

Testing

max_worn_example
With max_worn = 18 for the pins and the replaced flag value for the solar backpack

Additional context

@github-actions github-actions bot added <Documentation> Design documents, internal info, guides and help. [JSON] Changes (can be) made in JSON Code: Tests Measurement, self-control, statistics, balancing. [C++] Changes (can be) made in C++. Previously named `Code` [Markdown] Markdown issues and PRs Mods: Magiclysm Anything to do with the Magiclysm mod Mods: Aftershock Anything to do with the Aftershock mod Mechanics: Enchantments / Spells Enchantments and spells Items: Armor / Clothing Armor and clothing Mods: Xedra Evolved Anything to do with Xedra Evolved Mods: Mind Over Matter Mods: Sky Island Anything about the Sky Island mod Code: Infrastructure / Style / Static Analysis Code internal infrastructure and style labels Feb 9, 2025
@github-actions github-actions bot added astyled astyled PR, label is assigned by github actions json-styled JSON lint passed, label assigned by github actions labels Feb 9, 2025
@b3brodie b3brodie marked this pull request as ready for review February 9, 2025 03:46
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Auto-requesting reviews from non-collaborators: @Standing-Storm

@RenechCDDA
Copy link
Member

The JSON churn feels really unnecessary? Just give the pins a flag that lets you wear infinite amount of them. Why even stop at 18? If someone wants to wear a pin (even the same pin) 100 times, they should go wild. It's not any different from 18

@Maleclypse
Copy link
Member

Ok I have a couple of questions. 1. When this says Max worn does it mean the number of copies of that item that can be worn or does it mean the number of items in that slot? For example, currently you can wear two magical rings, they can be the same rings I believe but only two total. Another example would be helmets I believe you can only wear one helmet at a time currently is that still accurate in this? Probably controlled by rigid flags and whatnot right?

@b3brodie
Copy link
Contributor Author

b3brodie commented Feb 9, 2025

The JSON churn feels really unnecessary? Just give the pins a flag that lets you wear infinite amount of them. Why even stop at 18? If someone wants to wear a pin (even the same pin) 100 times, they should go wild. It's not any different from 18

My logic is that characters can currently wear either 1 of an item with a special flag or two of an item by default. Any other combination would require adding another individual flag per amount. Rather than flag-ifying a new amount whenever somebody wants to add an item that supports more than the existing presets, having an int field allows easily doing whatever the creator wants. As for the choice of 18 pins that was just because there was 18 defined types of pins, but I can adjust that up to another number.

Ok I have a couple of questions. 1. When this says Max worn does it mean the number of copies of that item that can be worn or does it mean the number of items in that slot? For example, currently you can wear two magical rings, they can be the same rings I believe but only two total. Another example would be helmets I believe you can only wear one helmet at a time currently is that still accurate in this? Probably controlled by rigid flags and whatnot right?

Max Worn is for the number of copies of the item that can be worn. As an example, a backpack has the default max_worn value of 2 which means that a character can only equip 2 backpacks, but they an also equip 2 duffel bags and 2 hiking bags. For the magical rings, this won't touch how they work since their limits are made via their rigidity. Helmets are restricted in a similar way.

@b3brodie b3brodie marked this pull request as draft February 9, 2025 04:40
@b3brodie b3brodie marked this pull request as ready for review February 9, 2025 05:42
@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Feb 9, 2025
@GuardianDll GuardianDll merged commit f88cc1d into CleverRaven:master Feb 10, 2025
36 of 40 checks passed
@b3brodie b3brodie deleted the multi_wear branch February 10, 2025 08:44
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: Infrastructure / Style / Static Analysis Code internal infrastructure and style Code: Tests Measurement, self-control, statistics, balancing. <Documentation> Design documents, internal info, guides and help. Items: Armor / Clothing Armor and clothing [JSON] Changes (can be) made in JSON json-styled JSON lint passed, label assigned by github actions [Markdown] Markdown issues and PRs Mechanics: Enchantments / Spells Enchantments and spells Mods: Aftershock Anything to do with the Aftershock mod Mods: Magiclysm Anything to do with the Magiclysm mod Mods: Mind Over Matter Mods: Sky Island Anything about the Sky Island mod Mods: Xedra Evolved Anything to do with Xedra Evolved
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants