-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Add assign reader for damage instances, deprecate legacy damage code #37329
Add assign reader for damage instances, deprecate legacy damage code #37329
Conversation
I suggest we jsonize damage types too. I actually started this in https://github.com/ZhilkinSerg/Cataclysm-DDA/tree/jsonize-damage-type. |
a4054c4
to
8a73717
Compare
8a73717
to
bf4b552
Compare
2c50e21
to
3a88833
Compare
Okay, after fixing two issues regarding copy-from, I think everything's working right and this is ready for merge. I've decided to pull out the JSON changes (barring one to prevent load error) to make extra sure that this works with no data migration. I'll open another PR with those. |
b69ee7a
to
a69911f
Compare
a69911f
to
cc9c1cd
Compare
4eed712
to
4ad66a4
Compare
Can you resolve conflicts please? |
4ad66a4
to
91c5de2
Compare
Hhm, rebased, but found a bug. Looking into it. |
This assign reader allows consistent and clear reading of damage instances for all items. Make the necessary changes to item factory and damage units to preserve existing functionality.
These names weren't very clear, hopefully this is an improvement. The JSON changes are to fix errors this exposes.
91c5de2
to
4131911
Compare
Should be good now. |
Summary
SUMMARY: Infrastructure "Add damage instance assign reader, unify item damage loading code"
Purpose of change
This makes it easier to modify the damage type of ranged weapons (instead of all of them dealing
DT_STAB
, as well as enabling obsoleting legacy members for armor penetration and proportional damage in favor of having one damage object that defines that.In the future, this will make it easier to allow using damage objects everywhere we have damage, instead of raw integers for various types (in places like item melee damage).
Describe the solution
Add an assign reader for
damage_instance
s and three static functions to validate the assigned damage, and to assign damage using relative and proportional.Add
unconditional_
res_mult
anddamage_mult
to replace proportional damage and add proportional piercing capability, for arrows.Describe alternatives you've considered
Not doing the JSON changes in the same PR. I probably will back them out and do them in a separate PR later.
Testing
Tests run correctly.
TODO:
Additional context
Working towards obsoleting use of raw floats over multiple members to assign damage.
Originally started as a look into making a
DT_BULLET
, and then looking into using damage objects for bullet/gun damage.