[#6121, #6646] Add support for multiple AC formulas #6658
+129
−83
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.
Modifies how armor class data is stored to use multiple formulas rather than only having a single formula that is evaluated. This change means that all enabled formulas are evaluated fully and the one that provides the highest base AC is used.
This also allows armor class formulas to define whether they are usable when the character is wearing armor or wielding a shield. This makes all of the existing unarmoed defense formulas work as expected.
In order to ensure that the previous
flatcalculation properly overrides the full AC it has been moved to a separateoverridevalue. The existingflatinput is retained to provide a place for players to manually enter a value that can be used in formulas (like the Natural Armor formula).Migrations are in place to move the existing actor data to use the new data structure and shims are added to ensure existing active effects that target AC will continue working. The removed
calcandformulafields are still set by the winning calculation so no shims are required.Closes #6121
Closes #6646