damaged armor scaling appropriately #59529
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
Damaged armor was completely broken for calculating protection values and has been for years. the damage value (0-4) was being subtracted from thickness to arrive at a protection value. Recently with bringing in real thicknesses and multi materials this means that any damage to almost all armor made it useless. This was also applied separately to each material. So for example everything under 1mm 0 protection after 1 tick, everything under 2mm 0 protection after 2 ticks, half protection after 1. This also made really thick stuff like ballistic plates extra powerful since 25 - 4 (nearly destroyed state) is still 21 thickness.
Describe the solution
Removed this direct additive scaling of thickness.
Now for each damage level the OVERALL protection of an item after all calculations is scaled by 12.5%. So something about to fall apart has 50% defense, something that is only slightly damaged will have 12.5% reduction in protection value.
Describe alternatives you've considered
Testing
Curious if this breaks any DPS tests
Additional context
This probably fixes a number of "why is my armor breaking so fast" issues, since the armor would still be getting hit but have a protection value of 0 to resist taking further damage.
Also I really need to at some point in the future refactor all these functions they are all identical except for a single nested call.