feat(balance): rework how ranged bash data checks destroy_threshold
#4223
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.
Purpose of change
This implements an idea I mentioned in #4222 that will enable support for terrain being wrecked by shots that don't penetrate.
Set aside as WIP since I'm doing this from my laptop, plus I will want to wait until the other two PRs are merged since I'll likely need to do some final audits of destroy thresholds for some items.
Describe the solution
C++ changes:
map::shoot
so that the checks for ranged bash info set aside the incoming damage value as a number randomly multiplied by a value of 0.9 to 1.1, the same damage randomization that standard hits deal to creatures. This value is then checked againstdestroy_threshold
instead of damage, so damage threshold now checks the value of incoming damage (with some RNG) prior to damage reduction.map::shoot
now properly tracks armor penetration separately from raw damage, and takes armor multiplier into account.reduction
values for ranged bashed info are reduced by the bullet's arpen, then modified by any armor mult, before being applied to incoming damage.destroy_threshold
does in mapdata.h accordingly.JSON changes:
Describe alternatives you've considered
Rigging some case-by-case basis hackery allowing some ranged bash data to roll before damage reduction is considered and some to check after damage reduction.
Testing
Initially ran into #4236 along the way but testing confirmed it happens in build
2024-02-18
too. Repeated test after grabbing the fix for it and no crashes.Additional context
Checklist