diff --git a/daggerheart.mjs b/daggerheart.mjs index e7be2f45..f27892e2 100644 --- a/daggerheart.mjs +++ b/daggerheart.mjs @@ -2,7 +2,6 @@ import { SYSTEM } from './module/config/system.mjs'; import * as applications from './module/applications/_module.mjs'; import * as data from './module/data/_module.mjs'; import * as models from './module/data/_module.mjs'; -import * as canvas from './module/canvas/_module.mjs'; import * as documents from './module/documents/_module.mjs'; import * as dice from './module/dice/_module.mjs'; import * as fields from './module/data/fields/_module.mjs'; @@ -17,7 +16,7 @@ import { settingsRegistration, socketRegistration } from './module/systemRegistration/_module.mjs'; -import { placeables } from './module/canvas/_module.mjs'; +import { placeables, DhTokenLayer } from './module/canvas/_module.mjs'; import './node_modules/@yaireo/tagify/dist/tagify.css'; import TemplateManager from './module/documents/templateManager.mjs'; import TokenManager from './module/documents/tokenManager.mjs'; @@ -53,7 +52,7 @@ CONFIG.ChatMessage.template = 'systems/daggerheart/templates/ui/chat/chat-messag CONFIG.Canvas.rulerClass = placeables.DhRuler; CONFIG.Canvas.layers.templates.layerClass = placeables.DhTemplateLayer; -CONFIG.Canvas.layers.tokens.layerClass = canvas.DhTokenLayer; +CONFIG.Canvas.layers.tokens.layerClass = DhTokenLayer; CONFIG.MeasuredTemplate.objectClass = placeables.DhMeasuredTemplate; diff --git a/module/applications/sheets/api/application-mixin.mjs b/module/applications/sheets/api/application-mixin.mjs index 903caa2a..7276316f 100644 --- a/module/applications/sheets/api/application-mixin.mjs +++ b/module/applications/sheets/api/application-mixin.mjs @@ -505,6 +505,7 @@ export default function DHApplicationMixin(Base) { const doc = await getDocFromElement(target), action = doc?.system?.attack ?? doc; const config = action.prepareConfig(event); + config.effects = Array.from(await this.document.allApplicableEffects()); config.hasRoll = false; return action && action.workflow.get('damage').execute(config, null, true); } diff --git a/module/dice/damageRoll.mjs b/module/dice/damageRoll.mjs index 482d2c41..cd26eb21 100644 --- a/module/dice/damageRoll.mjs +++ b/module/dice/damageRoll.mjs @@ -112,10 +112,12 @@ export default class DamageRoll extends DHRoll { const changeKeys = []; for (const roll of this.options.roll) { - for (const damageType of roll.damageTypes) changeKeys.push(`system.bonuses.${type}.${damageType}`); + for (const damageType of roll.damageTypes?.values?.() ?? []) { + changeKeys.push(`system.bonuses.${type}.${damageType}`); + } } - const item = this.data.parent.items?.get(this.options.source.item); + const item = this.data.parent?.items?.get(this.options.source.item); if (item) { switch (item.type) { case 'weapon':