mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-04-24 16:33:38 +02:00
Compare commits
No commits in common. "ade6dde5bbd03b3e8d2b66df1eb2f7295b8c2bd3" and "4332a1ba7a1c395bab92653caeaa60d5785d5acf" have entirely different histories.
ade6dde5bb
...
4332a1ba7a
6 changed files with 18 additions and 18 deletions
|
|
@ -10,8 +10,8 @@ export default class DamageReductionDialog extends HandlebarsApplicationMixin(Ap
|
||||||
this.reject = reject;
|
this.reject = reject;
|
||||||
this.actor = actor;
|
this.actor = actor;
|
||||||
this.damage = damage;
|
this.damage = damage;
|
||||||
|
// this.damageType = damageType;
|
||||||
this.damageType = damageType;
|
this.damageType = ['physical'];
|
||||||
this.rulesDefault = game.settings.get(
|
this.rulesDefault = game.settings.get(
|
||||||
CONFIG.DH.id,
|
CONFIG.DH.id,
|
||||||
CONFIG.DH.SETTINGS.gameSettings.Automation
|
CONFIG.DH.SETTINGS.gameSettings.Automation
|
||||||
|
|
@ -340,8 +340,9 @@ export default class DamageReductionDialog extends HandlebarsApplicationMixin(Ap
|
||||||
const { selectedStressMarks, stressReductions, currentDamage } = this.getDamageInfo();
|
const { selectedStressMarks, stressReductions, currentDamage } = this.getDamageInfo();
|
||||||
const armorChanges = this.marks.armor.reduce((acc, source) => {
|
const armorChanges = this.marks.armor.reduce((acc, source) => {
|
||||||
const amount = Object.values(source.marks).filter(x => x.selected).length;
|
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;
|
return acc;
|
||||||
}, []);
|
}, []);
|
||||||
const stressSpent =
|
const stressSpent =
|
||||||
|
|
|
||||||
|
|
@ -203,7 +203,7 @@ export default class DhpDowntime extends HandlebarsApplicationMixin(ApplicationV
|
||||||
const msg = {
|
const msg = {
|
||||||
user: game.user.id,
|
user: game.user.id,
|
||||||
system: {
|
system: {
|
||||||
moves: moves.map(move => ({ ...move, actions: Array.from(move.actions) })),
|
moves: moves,
|
||||||
actor: this.actor.uuid
|
actor: this.actor.uuid
|
||||||
},
|
},
|
||||||
speaker: cls.getSpeaker(),
|
speaker: cls.getSpeaker(),
|
||||||
|
|
|
||||||
|
|
@ -190,14 +190,11 @@ export default class Party extends DHBaseActorSheet {
|
||||||
* Toggles a armor slot resource value.
|
* Toggles a armor slot resource value.
|
||||||
* @type {ApplicationClickAction}
|
* @type {ApplicationClickAction}
|
||||||
*/
|
*/
|
||||||
static async #toggleArmorSlot(_, target) {
|
static async #toggleArmorSlot(_, target, element) {
|
||||||
const actor = game.actors.get(target.dataset.actorId);
|
const armorItem = await foundry.utils.fromUuid(target.dataset.itemUuid);
|
||||||
const { value, max } = actor.system.armorScore;
|
const armorValue = Number.parseInt(target.dataset.value);
|
||||||
const inputValue = Number.parseInt(target.dataset.value);
|
const newValue = armorItem.system.marks.value >= armorValue ? armorValue - 1 : armorValue;
|
||||||
const newValue = value >= inputValue ? inputValue - 1 : inputValue;
|
await armorItem.update({ 'system.marks.value': newValue });
|
||||||
const changeValue = Math.min(newValue - value, max - value);
|
|
||||||
|
|
||||||
await actor.system.updateArmorValue({ value: changeValue });
|
|
||||||
this.render();
|
this.render();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -527,7 +527,7 @@ export default class DhCharacter extends DhCreature {
|
||||||
|
|
||||||
const updateValues = Object.values(embeddedUpdates);
|
const updateValues = Object.values(embeddedUpdates);
|
||||||
for (const [index, { doc, updates }] of updateValues.entries())
|
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 }) {
|
async updateArmorEffectValue({ uuid, value }) {
|
||||||
|
|
|
||||||
|
|
@ -52,12 +52,13 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{#if actor.system.armorScore.max}}
|
{{#if actor.system.armor.system.marks}}
|
||||||
<div class="slot-section">
|
<div class="slot-section">
|
||||||
<div class="slot-bar">
|
<div class="slot-bar">
|
||||||
{{#times actor.system.armorScore.max}}
|
{{#times actor.system.armorScore}}
|
||||||
<a class='armor-slot' data-action='toggleArmorSlot' data-actor-id="{{actor.id}}" data-value="{{add this 1}}">
|
<a class='armor-slot'
|
||||||
{{#if (gte actor.system.armorScore.value (add this 1))}}
|
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))}}
|
||||||
<i class="fa-solid fa-shield"></i>
|
<i class="fa-solid fa-shield"></i>
|
||||||
{{else}}
|
{{else}}
|
||||||
<i class="fa-solid fa-shield-halved"></i>
|
<i class="fa-solid fa-shield-halved"></i>
|
||||||
|
|
@ -67,7 +68,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="slot-label">
|
<div class="slot-label">
|
||||||
<span class="label">{{localize "DAGGERHEART.GENERAL.armorSlots"}}</span>
|
<span class="label">{{localize "DAGGERHEART.GENERAL.armorSlots"}}</span>
|
||||||
<span class="value">{{actor.system.armorScore.value}} / {{actor.system.armorScore.max}}</span>
|
<span class="value">{{actor.system.armor.system.marks.value}} / {{actor.system.armorScore}}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
|
||||||
|
|
@ -18,5 +18,6 @@
|
||||||
collection=effects.inactives
|
collection=effects.inactives
|
||||||
canCreate=true
|
canCreate=true
|
||||||
hideResources=true
|
hideResources=true
|
||||||
|
disabled=true
|
||||||
}}
|
}}
|
||||||
</section>
|
</section>
|
||||||
Loading…
Add table
Add a link
Reference in a new issue