Merge Damages - reonZ/pf2e-toolbelt GitHub Wiki

This feature allows you to merge a damage message with another one that precedes it. It will merge damages of the same type into a single instance for the purpose of Immunities/Weaknesses/Resistances.

  • The module will look for a matching message among the 5 preceding the current one.
  • The other message must have the same origin actor
  • The other message must have the same target(s) (including targets from the Target Helper tool)

[!NOTE] You can merge more than two messages together.

[!NOTE] Merged messages can be split back into their original messages.

Inject Damage

You can also inject damage instead directly into a previous message without merging both messages together. This leaves the older message intact and only merge the damage instances into it.

  • The module will look for a matching message among the 5 preceding the current one.
  • a message can be injected by more than one message
  • a message with injected damage can still merge to or be merged with another message
  • a message with injected/merged damage cannot inject itself into another message

Settings

Merge Button 👤

Adds a button to damage messages allowing them to be merged with other damage messages.

Inject Button 👤

Adds a button to damage messages allowing them to be injected to a previous damage message.

API

game.toolbelt?.api.mergeDamage = {
    injectDamageMessage(
        targetMessage: ChatMessagePF2e,
        originMessage: ChatMessagePF2e,
        options?: Omit<mergeDamage.MergeOptions, "targetMerge">,
    ): Promise<{ rolls: RollJSON[] } | undefined>,
    mergeDamageMessages(
        targetMessage: ChatMessagePF2e,
        originMessage: ChatMessagePF2e,
        options?: mergeDamage.MergeOptions,
    ): Promise<ChatMessagePF2e | undefined>,
}