Feature/635 allow weapon direct damage (#657)

* #635 & #637

* #653
This commit is contained in:
Dapoulp 2025-08-06 20:28:53 +02:00 committed by GitHub
parent cf571aa2a5
commit bcedc74bf3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 57 additions and 156 deletions

View file

@ -7,7 +7,11 @@ export default class DhpEnvironment extends DHBaseActorSheet {
static DEFAULT_OPTIONS = {
classes: ['environment'],
position: {
width: 500
width: 500,
height: 725
},
window: {
resizable: true
},
actions: {},
dragDrop: [{ dragSelector: '.action-section .inventory-item', dropSelector: null }]

View file

@ -323,6 +323,20 @@ export default function DHApplicationMixin(Base) {
];
if (usable)
options.unshift({
name: 'DAGGERHEART.GENERAL.damage',
icon: 'fa-solid fa-explosion',
condition: target => {
const doc = getDocFromElementSync(target);
return doc?.system?.attack?.damage.parts.length || doc?.damage?.parts.length;
},
callback: async (target, event) => {
const doc = await getDocFromElement(target),
action = doc?.system?.attack ?? doc;
return action && action.use(event, { byPassRoll: true })
}
});
options.unshift({
name: 'DAGGERHEART.APPLICATIONS.ContextMenu.useItem',
icon: 'fa-solid fa-burst',
@ -334,7 +348,7 @@ export default function DHApplicationMixin(Base) {
});
if (toChat)
options.unshift({
options.push({
name: 'DAGGERHEART.APPLICATIONS.ContextMenu.sendToChat',
icon: 'fa-solid fa-message',
callback: async target => (await getDocFromElement(target)).toChat(this.document.id)