Target Helper - reonZ/pf2e-toolbelt GitHub Wiki
This tool add target rows to different messages to handle inline save rolls and damage applications directly to the targets.
Important
This tool requires a GM to be online to function.
Note
A Set Target button is added to the message to add all the currently targeted tokens as targets for the message, this replace any target existing in the message. Any save rolled or damage already applied will remain in the message.
Tip
You can drop foundry items (i.e. conditions, effects, equipment) on a target row header to simulate the behavior of dropping it on the token itself.
Tip
You can also [Click] on a target header to select the token and [Double Click] to open its sheet. Hovering over it will highlight the associated token in the scene.

When a message contains a save check, target rows are added to it allowing the users to roll the saves by simply clicking on the button without generating an extra message in the chat.

Once rolled, a tooltip containing all the save details can be seen by hovering over the button.
Note
A Roll NPC Saves button is added to the message for the GM, making rolling all the saves easier.
Note
The information provided in the tooltip is entirely dependent of the different system metagame settings.
Note
The Pf2E Modifiers Matter module is used to display more data and color the modifiers which matter.
Note
Using the regular system save button while having some of the message's targets selected will first roll the inline save for each target that has yet to roll it instead of rolling a regular system check.
Tip
You can reroll a save by clicking the button once more.

The module allows you to drag & drop any inline save onto a damage or action message, adding the save to it.
- One must be the author of the message (or a GM) to drag & drop a save onto it.
- A save cannot be dropped onto a message that already contains a save.

Target rows are also added to damage message, allowing you to apply damage directly to the token's actor without having to select them.
If the message contains save data, the save buttons will also be shown there and if it is a basic save, damage buttons will be highlighted to indicate which one should be used based on the degree of success.
Note
When damage is applied to an actor by using one of the target row damage buttons, the message is updated to reflect damage application, blurring the rows.

The module has a special handling of splash damage, adding an extra Set Splash Target button, those target will only have the splash damage buttons shown in their target row while regular targets will see both button types.
Note
The module does some smart blurring for splash damage to help you spread the damages easily.
A spell message with a save will have the target rows added to it, if the spell message also has a damage component to it, clicking on the damage button will transfer all the save data to the newly created damage message and clear the spell message completely.
Note
Spell variants are fully supported and save rolls made in one variant will only exist in that variant's context.
When sending an action to chat, if its description contains a single inline save, the module will automatically parse the link and turn it into save data for the message (skipping the whole drag & drop requirement).
If the message description contains inline damage links, clicking any of them will transfer the save data into the newly generated damage message and clear the action message.
Tip
You can restart the whole process of the action message by dropping the inline save onto itself if needed.

Prompted messages are ones that only[1] contain a save inline link, those messages [before] will be reformatted and be able to receive target rows [after]. Depending on the origin of those messages, more details will be shown than normal while still respecting the different metagame settings and ownership rights.
The system generates two types of those:
- when clicking on
Post prompt to chaticon of a inline link - when using the
Generate Check Promptmacro
[1] The message can actually have more than just the inline link: a flavor text or a preceding label to the link. Those are not only taken into account but also reused to generate the new layout.
Enable the 'Target Helper' feature in your world.
Will add extra targets to chat messages where damage can be applied and saves can be rolled.
Upgrades the simple inline save messages into something that can be used by the feature. Also adds more details to it.
Reduce the size of damage buttons for the extra targets.
game.toolbelt?.api.targetHelper = {
/** get the current target uuids for the message */
getMessageTargets(message: ChatMessagePF2e): string[],
/** override the current target uuids of the message */
setMessageFlagTargets(updates: Record<string, any>, targets: string[] ): Record<string, any>
}This tool calls the following custom hooks whenever a save is rolled/rerolled.
// hook: "pf2e-toolbelt.rollSave"
type RollSaveHook = {
roll: Rolled<CheckRoll>,
message: ChatMessagePF2e,
rollMessage: ChatMessagePF2e,
target: TokenDocumentPF2e,
data: SaveRollData,
};
// hook: "pf2e-toolbelt.rerollSave"
type RerollSaveHook = {
oldRoll: Rolled<CheckRoll>,
newRoll: Rolled<CheckRoll>,
keptRoll: Rolled<CheckRoll>,
message: ChatMessagePF2e,
target: TokenDocumentPF2e,
data: SaveRollData,
};
type SaveRollData = {
die: number,
dosAdjustments?: Record<string, { label: string, amount: DegreeAdjustmentAmount }>,
modifiers: { label: string, modifier: number }[],
notes: RollNoteSource[],
private: boolean,
rerolled?: RerollType,
roll: string,
significantModifiers?: {
appliedTo: "roll" | "dc",
name: string,
significance: "ESSENTIAL" | "HELPFUL" | "NONE" | "HARMFUL" | "DETRIMENTAL",
value: number,
}[],
statistic: SaveType,
success: DegreeOfSuccessString,
unadjustedOutcome?: DegreeOfSuccessString | null,
value: number,
};