foundryvtt/pf2e

Request: Embedded @Check inside Note RE should include a flag with the origin item's UUID if it exists

shemetz opened this issue · 1 comments

This request is needed to allow my module (Modifiers Matter) to correctly react when a @Check's DC is affected by some condition.


To show the problem, let's compare the two following scenarios:

Scenario 1 (current situation with Monk)

A Monk uses Stunning Fist, which relies on a Note rule element that triggers on damage.

The Note RE looks like this:

Note RE

image

(technically it uses PF2E.SpecificRule.Monk.StunningFist.Note but it's functionally the same)

When this RE is triggered, i.e. when the monk damages a creature, the @Check in the text becomes an embedded saving throw button. When that button is pressed (when selecting a token), it will roll the save, but the roll's chat message will not have the origin item (Stunning Fist) in the flags.

Specifically, chatMessage.flags.pf2e.origin?.uuid will be undefined.

This means that my module will not be able to tell that certain conditions (Clumsy, in this case) affect the Monk Class DC that was used for this saving throw.

It'll look like this:

Screenshot of sad state

image

Scenario 2

Same as Scenario 1, except instead of relying on the Note RE, I put the @Check directly inside the item's description, then posted it to chat, then pressed the embedded button.

(the @Check syntax is the same: @Check[type:fortitude|dc:resolve(@actor.system.proficiencies.classDCs.monk.value)|traits:incapacitation|overrideTraits:true])

Item sheet description

image

This time you can see that it successfully figured out that the check's DC was reduced by the monk being clumsy. You can also see that several item roll options are available to rely on.

Screenshot of happy state

image

Because in my code, now I have a value: originUuid = 'Actor.WaLIFf8oXqqO8diT.Item.DTuFKrM46TAKmvqL'


I'm not sure what exactly needs to change, technically, to enable this; my best guess is that it has to do with how the roll options and flags are generated for the @Check inside the Note RE. to solve this, perhaps the Note RE code will need to maintain a reference to which item (if any) it was taken from, and keep that information stored within embedded @Checks.

Without this change, I think it's impossible for me to know from the note's roll's chat message that the check DC is someone's class DC.

My only available flags are these:

Chat message flags screenshot

image

I'm re-requesting this but specifically for class DCs here -- #16537