diff --git a/module/applications/dialogs/damageReductionDialog.mjs b/module/applications/dialogs/damageReductionDialog.mjs index 6aeb2cf9..31e4f72d 100644 --- a/module/applications/dialogs/damageReductionDialog.mjs +++ b/module/applications/dialogs/damageReductionDialog.mjs @@ -10,8 +10,8 @@ export default class DamageReductionDialog extends HandlebarsApplicationMixin(Ap this.reject = reject; this.actor = actor; this.damage = damage; - - this.damageType = damageType; + // this.damageType = damageType; + this.damageType = ['physical']; this.rulesDefault = game.settings.get( CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Automation @@ -340,8 +340,9 @@ export default class DamageReductionDialog extends HandlebarsApplicationMixin(Ap const { selectedStressMarks, stressReductions, currentDamage } = this.getDamageInfo(); const armorChanges = this.marks.armor.reduce((acc, source) => { const amount = Object.values(source.marks).filter(x => x.selected).length; - if (amount) acc.push({ uuid: source.effect.uuid, amount }); + if (!amount) return acc; + acc.push({ uuid: source.effect.uuid, amount }); return acc; }, []); const stressSpent = diff --git a/module/applications/dialogs/downtime.mjs b/module/applications/dialogs/downtime.mjs index 3475dee7..52cced3e 100644 --- a/module/applications/dialogs/downtime.mjs +++ b/module/applications/dialogs/downtime.mjs @@ -203,7 +203,7 @@ export default class DhpDowntime extends HandlebarsApplicationMixin(ApplicationV const msg = { user: game.user.id, system: { - moves: moves.map(move => ({ ...move, actions: Array.from(move.actions) })), + moves: moves, actor: this.actor.uuid }, speaker: cls.getSpeaker(), diff --git a/module/applications/sheets/actors/party.mjs b/module/applications/sheets/actors/party.mjs index 20792141..1b1722db 100644 --- a/module/applications/sheets/actors/party.mjs +++ b/module/applications/sheets/actors/party.mjs @@ -190,14 +190,11 @@ export default class Party extends DHBaseActorSheet { * Toggles a armor slot resource value. * @type {ApplicationClickAction} */ - static async #toggleArmorSlot(_, target) { - const actor = game.actors.get(target.dataset.actorId); - const { value, max } = actor.system.armorScore; - const inputValue = Number.parseInt(target.dataset.value); - const newValue = value >= inputValue ? inputValue - 1 : inputValue; - const changeValue = Math.min(newValue - value, max - value); - - await actor.system.updateArmorValue({ value: changeValue }); + static async #toggleArmorSlot(_, target, element) { + const armorItem = await foundry.utils.fromUuid(target.dataset.itemUuid); + const armorValue = Number.parseInt(target.dataset.value); + const newValue = armorItem.system.marks.value >= armorValue ? armorValue - 1 : armorValue; + await armorItem.update({ 'system.marks.value': newValue }); this.render(); } diff --git a/module/data/actor/character.mjs b/module/data/actor/character.mjs index 8ded7a0f..7b868f6b 100644 --- a/module/data/actor/character.mjs +++ b/module/data/actor/character.mjs @@ -527,7 +527,7 @@ export default class DhCharacter extends DhCreature { const updateValues = Object.values(embeddedUpdates); for (const [index, { doc, updates }] of updateValues.entries()) - await doc.updateEmbeddedDocuments('ActiveEffect', updates, { render: index === updateValues.length - 1 }); + doc.updateEmbeddedDocuments('ActiveEffect', updates, { render: index === updateValues.length - 1 }); } async updateArmorEffectValue({ uuid, value }) { diff --git a/templates/sheets/actors/party/resources.hbs b/templates/sheets/actors/party/resources.hbs index bfbfb578..74f94806 100644 --- a/templates/sheets/actors/party/resources.hbs +++ b/templates/sheets/actors/party/resources.hbs @@ -52,12 +52,13 @@ - {{#if actor.system.armorScore.max}} + {{#if actor.system.armor.system.marks}}
- {{#times actor.system.armorScore.max}} - - {{#if (gte actor.system.armorScore.value (add this 1))}} + {{#times actor.system.armorScore}} + + {{#if (gte actor.system.armor.system.marks.value (add this 1))}} {{else}} @@ -67,7 +68,7 @@
{{localize "DAGGERHEART.GENERAL.armorSlots"}} - {{actor.system.armorScore.value}} / {{actor.system.armorScore.max}} + {{actor.system.armor.system.marks.value}} / {{actor.system.armorScore}}
{{/if}} diff --git a/templates/sheets/global/tabs/tab-effects.hbs b/templates/sheets/global/tabs/tab-effects.hbs index 1f0967b8..bca7f326 100644 --- a/templates/sheets/global/tabs/tab-effects.hbs +++ b/templates/sheets/global/tabs/tab-effects.hbs @@ -18,5 +18,6 @@ collection=effects.inactives canCreate=true hideResources=true + disabled=true }} \ No newline at end of file