From 5b9b36f501473edab2d270b9a392b57839914d7b Mon Sep 17 00:00:00 2001 From: nsalyzyn Date: Sat, 27 Dec 2025 15:39:17 -0700 Subject: [PATCH] Adding an action with a cost dialog for stress - if there is a stress cost --- .../applications/sheets/actors/character.mjs | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/module/applications/sheets/actors/character.mjs b/module/applications/sheets/actors/character.mjs index cbda1d06..b48d459d 100644 --- a/module/applications/sheets/actors/character.mjs +++ b/module/applications/sheets/actors/character.mjs @@ -325,14 +325,31 @@ export default class CharacterSheet extends DHBaseActorSheet { const doc = getDocFromElementSync(target); return doc && doc.system.inVault; }, - callback: async target => { + callback: async (target, event) => { const doc = await getDocFromElement(target); const actorLoadout = doc.actor.system.loadoutSlot; if (!actorLoadout.available) { ui.notifications.warn(game.i18n.localize('DAGGERHEART.UI.Notifications.loadoutMaxReached')); return; } - return doc.update({ 'system.inVault': false }); + if (doc.system.recallCost == 0) { + return doc.update({ 'system.inVault': false }); + } + const type = 'effect'; + const cls = game.system.api.models.actions.actionsTypes[type]; + const action = new cls({ + ...cls.getSourceConfig(doc.system), + type: type, + chatDisplay: false, + cost: [{ + key: 'stress', + value: doc.system.recallCost + }] + }, { parent: doc.system }); + const config = await action.use(event); + if (config) { + return doc.update({ 'system.inVault': false }); + } } }, {