-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Jsonify Limb Scores & Character Modifiers #53069
Conversation
Oh, that's fancy! It should streamline me klutzing together new scores at the drop of a hat nicely. Two things: Do you think there's a way to overwrite the How well do they play with |
Sure, it shouldn't be hard to add a new field to give it a little more control. I'll try to keep it open so that I (or anyone else) can easily expand it later on.
I don't think I've ever had a problem with |
Hands are pretty crowded, but CleverRaven#53069 will take care if it anyway
b1479d3
to
0551dbe
Compare
3fda059
to
ff2fa36
Compare
One other thing that could either be moved to a limb score (or limb field in general) would be the function of |
ff2fa36
to
9a88e57
Compare
@Venera3 Cheers! After one hell of a rebase, your changes should be properly jsonified. I've added new fields to
I refactored I've updated the documentation, so you can check JSON_INFO.md in this PR to see a summary of all the changes. |
- New fields for `character_mod`: "override_encumb" & "override_wounds" - Migrated new "footing" limb score - Modified "melee_stamina_cost_mod" to force lift score to be affected by encumbrance - Updated documentation
ee5f97f
to
da0807c
Compare
maybe insignificant but hand encumbrance also affects when you try to put pressure on your bleeding wound and torso encumbrance can throw you off balance when melee attacking even if you didnt past the threshold maybe it can be jsonified |
Summary
None
Purpose of change
Fixes #52846
Also inspired by Venera's awesome work on #53004.
I wanted to have the limb encumbrance descriptions be automatically associated to the appropriate body parts, but there are a couple of roadblocks that I want to address first:
Describe the solution
The goal is to create a generic method for defining limb scores, which can be used to generate the encumbrance descriptions for associated body parts, completely defined in JSON.
I created a new JSON type
"limb_score"
with this format:"name"
is a translatable string that identifies the score in the UI."affected_by_*"
indicates that this limb score is passed throughbodypart::wound_adjusted_limb_value()
and/orbodypart::encumb_adjusted_limb_value()
.These limb score types are referenced in
"body_part"
using the"limb_scores"
array:The array has 2 mandatory fields and one optional field:
Since character modifiers are generally tied to limb scores, I decided to jsonify them too:
"value"
is the magic JSON object that defines how the character modifier is calculated. The fields in "value" are as follows:affected_by_encumb
to force the score to be affected/unaffected by limb encumbrance.affected_by_wounds
to force the score to be affected/unaffected by limb health.nominator / limb_score
).(nominator / limb_score) - subtract
).Alternatively, the "value" can be specified as a
"builtin"
which refers to a hardcoded function in character_modifier.cpp.Limb scores can be iterated using
limb_score::get_all()
, which I'm using to generate the encumbrance descriptions:2021-11-28.00-32-37.mp4
Describe alternatives you've considered
It would be easy to move the encumbrance descriptions around to reflect the current effects, but that doesn't solve the underlying problem. It also wouldn't scale once new body parts start being added.
Testing
Ensure that these are working properly:
copy-from
,extend
anddelete
on all affected typesAdditional context
TODO: