Fall damage handling moved to FormulaHelper#2803
Open
RedRoryOTheGlen wants to merge 2 commits into
Open
Conversation
… use the same formula as players for calculating fall damage.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Unified the disparate ways that fall damage is calculated between PlayerHealth and EnemyMotor into an overridable formula.
For players, the formula by default can now directly reflect the value of fallingDamageThreshold set in AcrobatMotor instead of using its own const variable.
For enemies, EnemyMotor now has a public fallingDamageThreshold property that can be set by mods if necessary.
The intention is to maintain the current behavior but open up fall damage mechanics to modding, making it possible to have skills or spell effects be able to reduce fall damage or increase the distance to fall before taking damage, or even have enemies that can be resistant to fall damage (eg, Acrobats, spiders, etc).
Example used to test overriding the formula:
This example also showcases the formula allowing for different handling of fall damage between players and NPCs (or even specific NPCs) if required.