Add "postAbilities" phase, prepare item UsesField data in that phase, prepare @item.uses.value-using changes' phase to "postAbilities" - #7368
Draft
roth-michael wants to merge 2 commits into
Conversation
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.
Further enables #3011 by allowing use of
@item.uses.valuespecifically, which currently wouldn't be prepared in time for use in a change value. Builds on #7366.Changes:
ActivitiesTemplateto its own method,ActivitiesTemplate#prepareUsesData.ActivitiesTemplate#prepareFinalActivityDatanow no longer requires roll data passed to it (as such, removed variousgetRollDatacalls in all mixing item subtypes' calls to that method)postAbilities, which is fired at the end ofCommonTemplate#prepareAbilities@item.uses.valuein it, set itsphaseto the new phaseEffectively, the only not-present-at-"initial"-phase item data that might reasonably be used in an AE is
uses.value, because previously it was prepared after (or immediately before, after #7366) thefinalstage. Ideally, it would be accessible as early as possible. There are certainly first party items which have limited uses depending on ability modifier, and so it must at earliest be after those are calculated.Questions/potential issues:
@item.uses.value-valued changes to be only after ability prep means you cannot, for instance, modify your strength value based on remaining uses of a given item. Since these items presumably would not be referencing ability mod in their max uses field, this could be worked around by prepping Uses data during "initial" for non-ability-mod-referencing items, and in "postAbilities" for ability-mod-referencing items. This then would also need to be considered when setting change phase during prep.uses.max.phaseduring data prep. It would now, for instance, be possible to increasesystem.spell.spell1.maxduring "final" phase, and so we should consider how to coercephaseto the "appropriate" value for such changes.