From acc88c9bc849707d8d395188707c672a0dcedf80 Mon Sep 17 00:00:00 2001 From: Surge Date: Mon, 16 Feb 2026 12:45:39 -0500 Subject: [PATCH] Add roll options for area-fire and auto-fire saves --- src/module/chat-message/listeners/cards.ts | 24 +++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/src/module/chat-message/listeners/cards.ts b/src/module/chat-message/listeners/cards.ts index 75699b4cbbf..8e87c70e274 100644 --- a/src/module/chat-message/listeners/cards.ts +++ b/src/module/chat-message/listeners/cards.ts @@ -220,8 +220,18 @@ class ChatCards { return; } case "roll-area-save": { + const context = message.flags[SYSTEM_ID].context; + const type = tupleHasValue(["area-fire", "auto-fire"], context?.type) ? context.type : null; const dc = attack && "statistic" in attack ? attack.statistic.dc : null; - return this.#rollActorSaves({ event, saveType: "reflex", origin: actor, item, dc }); + const extraRollOptions = type ? [`origin:action:slug:${type}`] : []; + return this.#rollActorSaves({ + event, + saveType: "reflex", + origin: actor, + item, + dc, + extraRollOptions, + }); } case "roll-area-damage": attack?.damage?.({ event }); @@ -329,7 +339,14 @@ class ChatCards { * Apply rolled dice damage to the token or tokens which are currently controlled. * This allows for damage to be scaled by a multiplier to account for healing, critical hits, or resistance */ - static async #rollActorSaves({ event, saveType, origin, item, dc }: RollActorSavesParams): Promise { + static async #rollActorSaves({ + event, + saveType, + origin, + item, + dc, + extraRollOptions, + }: RollActorSavesParams): Promise { const tokens = game.user.getActiveTokens(); if (tokens.length === 0) { ui.notifications.error("PF2E.ErrorMessage.NoTokenSelected", { localize: true }); @@ -340,7 +357,7 @@ class ChatCards { const save = token.actor?.saves?.[saveType]; if (!save) return; - save.check.roll({ ...eventToRollParams(event, { type: "check" }), dc, item, origin }); + save.check.roll({ ...eventToRollParams(event, { type: "check" }), dc, item, origin, extraRollOptions }); } } } @@ -358,6 +375,7 @@ interface RollActorSavesParams { origin: ActorPF2e; item: ItemPF2e; dc: CheckDC | CheckDCReference | null; + extraRollOptions?: string[]; } export { ChatCards };