mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-04-21 23:13:39 +02:00
Fixes
This commit is contained in:
parent
4332a1ba7a
commit
7a8591bb1b
5 changed files with 17 additions and 17 deletions
|
|
@ -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 = ['physical'];
|
||||
|
||||
this.damageType = damageType;
|
||||
this.rulesDefault = game.settings.get(
|
||||
CONFIG.DH.id,
|
||||
CONFIG.DH.SETTINGS.gameSettings.Automation
|
||||
|
|
@ -340,9 +340,8 @@ 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) return acc;
|
||||
if (amount) acc.push({ uuid: source.effect.uuid, amount });
|
||||
|
||||
acc.push({ uuid: source.effect.uuid, amount });
|
||||
return acc;
|
||||
}, []);
|
||||
const stressSpent =
|
||||
|
|
|
|||
|
|
@ -190,11 +190,14 @@ export default class Party extends DHBaseActorSheet {
|
|||
* Toggles a armor slot resource value.
|
||||
* @type {ApplicationClickAction}
|
||||
*/
|
||||
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 });
|
||||
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 });
|
||||
this.render();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue