mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-04-21 15:03:37 +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();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -527,7 +527,7 @@ export default class DhCharacter extends DhCreature {
|
|||
|
||||
const updateValues = Object.values(embeddedUpdates);
|
||||
for (const [index, { doc, updates }] of updateValues.entries())
|
||||
doc.updateEmbeddedDocuments('ActiveEffect', updates, { render: index === updateValues.length - 1 });
|
||||
await doc.updateEmbeddedDocuments('ActiveEffect', updates, { render: index === updateValues.length - 1 });
|
||||
}
|
||||
|
||||
async updateArmorEffectValue({ uuid, value }) {
|
||||
|
|
|
|||
|
|
@ -52,13 +52,12 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
{{#if actor.system.armor.system.marks}}
|
||||
{{#if actor.system.armorScore.max}}
|
||||
<div class="slot-section">
|
||||
<div class="slot-bar">
|
||||
{{#times actor.system.armorScore}}
|
||||
<a class='armor-slot'
|
||||
data-action='toggleArmorSlot' data-actor-id="{{actor.uuid}}" data-item-uuid="{{actor.system.armor.uuid}}" data-value="{{add this 1}}">
|
||||
{{#if (gte actor.system.armor.system.marks.value (add this 1))}}
|
||||
{{#times actor.system.armorScore.max}}
|
||||
<a class='armor-slot' data-action='toggleArmorSlot' data-actor-id="{{actor.id}}" data-value="{{add this 1}}">
|
||||
{{#if (gte actor.system.armorScore.value (add this 1))}}
|
||||
<i class="fa-solid fa-shield"></i>
|
||||
{{else}}
|
||||
<i class="fa-solid fa-shield-halved"></i>
|
||||
|
|
@ -68,7 +67,7 @@
|
|||
</div>
|
||||
<div class="slot-label">
|
||||
<span class="label">{{localize "DAGGERHEART.GENERAL.armorSlots"}}</span>
|
||||
<span class="value">{{actor.system.armor.system.marks.value}} / {{actor.system.armorScore}}</span>
|
||||
<span class="value">{{actor.system.armorScore.value}} / {{actor.system.armorScore.max}}</span>
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
|
|
|||
|
|
@ -18,6 +18,5 @@
|
|||
collection=effects.inactives
|
||||
canCreate=true
|
||||
hideResources=true
|
||||
disabled=true
|
||||
}}
|
||||
</section>
|
||||
Loading…
Add table
Add a link
Reference in a new issue