Feature/683 damage dialog options (#735)

* Temp solution for specific weapon feature

* Add Serrated & Self-Correcting

* Remove comments
This commit is contained in:
Dapoulp 2025-08-10 01:20:24 +02:00 committed by GitHub
parent 1c000c7cfe
commit 585601c134
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 177 additions and 118 deletions

View file

@ -333,7 +333,7 @@ export default function DHApplicationMixin(Base) {
}
];
if (usable)
if (usable) {
options.unshift({
name: 'DAGGERHEART.GENERAL.damage',
icon: 'fa-solid fa-explosion',
@ -353,24 +353,11 @@ export default function DHApplicationMixin(Base) {
icon: 'fa-solid fa-burst',
condition: target => {
const doc = getDocFromElementSync(target);
return doc?.system?.attack?.damage.parts.length || doc?.damage?.parts.length;
return doc && !(doc.type === 'domainCard' && doc.system.inVault);
},
callback: async (target, event) => {
const doc = await getDocFromElement(target),
action = doc?.system?.attack ?? doc;
return action && action.use(event, { byPassRoll: true });
}
callback: async (target, event) => (await getDocFromElement(target)).use(event)
});
options.unshift({
name: 'DAGGERHEART.APPLICATIONS.ContextMenu.useItem',
icon: 'fa-solid fa-burst',
condition: target => {
const doc = getDocFromElementSync(target);
return doc && !(doc.type === 'domainCard' && doc.system.inVault);
},
callback: async (target, event) => (await getDocFromElement(target)).use(event)
});
}
if (toChat)
options.push({