mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 03:31:07 +01:00
Feature/683 damage dialog options (#735)
* Temp solution for specific weapon feature * Add Serrated & Self-Correcting * Remove comments
This commit is contained in:
parent
1c000c7cfe
commit
585601c134
18 changed files with 177 additions and 118 deletions
|
|
@ -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({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue