-
Notifications
You must be signed in to change notification settings - Fork 232
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[#4861] Add combat activation types that display in turn message #4911
base: 4.2.x
Are you sure you want to change the base?
Conversation
Adds three new activation types in a new "Combat" section: "Start of Encounter", "Start of Turn", and "End of Turn". These activation types will display in the combat chat message with a "Use" button to be easily activated. They also have a tooltip to display the full item description on hover. The turn chat message stores relative UUIDs of the activiations in its data model to avoid having to check all of the actor's items every time the chat message is rendered. Closes #4861
cd3d098
to
001cfc8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In addition to my comments I noticed a couple of issues while testing:
- It seems that
turnStart
is not fired for the first combatant of the combat when the combat is started. When I tested this I had only one combatant in the combat and they had rolled initiative. This might be a core v12 bug though. - Giving an activity one of the new combat activations puts them in the 'actions' section on the NPC features tab if 'group by origin' is enabled. Notably this is distinct from the 'action' section where all other actions are. I think there's still a todo for pluralising those section titles, but I think this issue is unrelated, and that combat activations should probably be sorted into the 'features' section (that we should also rename to 'traits' at some point).
.map(i => i.system.activities?.filter(a => periods.includes(a.activation?.type)).map(a => a.relativeUUID) ?? []) | ||
.flat(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.map(i => i.system.activities?.filter(a => periods.includes(a.activation?.type)).map(a => a.relativeUUID) ?? []) | |
.flat(); | |
.flatMap(i => i.system.activities?.filter(a => periods.includes(a.activation?.type)).map(a => a.relativeUUID) ?? []);; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Collection
doesn't have flatMap
.
Had to move it from I've realized we might have a bug with updating the dynamic ring during combat, because it looks like it only updates for the user who presses the "Next Turn" button. Might need to move that code into the |
Reworked where `_recoverUses` is called for start & end of turn to ensure that the `turnStart` period is called for the first combatant and to ensure these methods are always called for a GM user. Also fixes a bug where the dynamic ring is only being refreshed for the user who presses the combat control buttons. Changes the activity usage button in chat to be a rollable link on the title, rather than a separate button. Adjusts NPC sheets so that combat activations will appear in the passive section.
Adds three new activation types in a new "Combat" section: "Start of Encounter", "Start of Turn", and "End of Turn". These activation types will display in the combat chat message with a "Use" button to be easily activated. They also have a tooltip to display the full item description on hover.
The turn chat message stores relative UUIDs of the activiations in its data model to avoid having to check all of the actor's items every time the chat message is rendered.
Closes #4861