mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-14 04:31:07 +01:00
Armor functional to be hit
This commit is contained in:
parent
3334baef11
commit
7ac9e3cec1
2 changed files with 25 additions and 10 deletions
|
|
@ -21,6 +21,7 @@ export default class CharacterSheet extends DHBaseActorSheet {
|
||||||
rollAttribute: CharacterSheet.#rollAttribute,
|
rollAttribute: CharacterSheet.#rollAttribute,
|
||||||
toggleHitPoints: CharacterSheet.#toggleHitPoints,
|
toggleHitPoints: CharacterSheet.#toggleHitPoints,
|
||||||
toggleStress: CharacterSheet.#toggleStress,
|
toggleStress: CharacterSheet.#toggleStress,
|
||||||
|
toggleArmor: CharacterSheet.#toggleArmor,
|
||||||
toggleHope: CharacterSheet.#toggleHope,
|
toggleHope: CharacterSheet.#toggleHope,
|
||||||
toggleLoadoutView: CharacterSheet.#toggleLoadoutView,
|
toggleLoadoutView: CharacterSheet.#toggleLoadoutView,
|
||||||
openPack: CharacterSheet.#openPack,
|
openPack: CharacterSheet.#openPack,
|
||||||
|
|
@ -749,6 +750,16 @@ export default class CharacterSheet extends DHBaseActorSheet {
|
||||||
await this.document.update({ 'system.resources.stress.value': newValue });
|
await this.document.update({ 'system.resources.stress.value': newValue });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Toggles ArmorScore resource value.
|
||||||
|
* @type {ApplicationClickAction}
|
||||||
|
*/
|
||||||
|
static async #toggleArmor(_, button,element) {
|
||||||
|
const ArmorValue = Number.parseInt(button.dataset.value);
|
||||||
|
const newValue = this.document.system.armor.system.marks.value >= ArmorValue ? ArmorValue - 1 : ArmorValue;
|
||||||
|
await this.document.system.armor.update({ 'system.marks.value': newValue });
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Toggles a hope resource value.
|
* Toggles a hope resource value.
|
||||||
* @type {ApplicationClickAction}
|
* @type {ApplicationClickAction}
|
||||||
|
|
|
||||||
|
|
@ -62,19 +62,23 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{#if document.system.armor.system.marks}}
|
{{#if document.system.armor.system.marks}}
|
||||||
<div class="status-bar armor-slots">
|
<div class="status-bar">
|
||||||
<div class='status-value'>
|
<div class='status-value'>
|
||||||
<p><input class="bar-input armor-marks-input" value="{{document.system.armor.system.marks.value}}" type="number"></p>
|
<div class="slot-bar">
|
||||||
<p>/</p>
|
{{#times document.system.armorScore}}
|
||||||
<p class="bar-label">{{document.system.armorScore}}</p>
|
<a class='armor-slot' data-action='toggleArmor' data-value="{{add this 1}}">
|
||||||
|
{{#if (gte ../document.system.armor.system.marks.value (add this 1))}}
|
||||||
|
<i class="fa-solid fa-shield"></i>
|
||||||
|
{{else}}
|
||||||
|
<i class="fa-solid fa-shield-halved"></i>
|
||||||
|
{{/if}}
|
||||||
|
</a>
|
||||||
|
{{/times}}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<progress
|
<div class="progress-bar"></div>
|
||||||
class='progress-bar stress-color'
|
|
||||||
value='{{document.system.armor.system.marks.value}}'
|
|
||||||
max='{{document.system.armorScore}}'
|
|
||||||
></progress>
|
|
||||||
<div class="status-label">
|
<div class="status-label">
|
||||||
<h4>{{localize "DAGGERHEART.GENERAL.armorSlots"}}</h4>
|
<h4>{{localize "DAGGERHEART.GENERAL.armorSlots"}}|<span>{{document.system.armor.system.marks.value}} / {{document.system.armorScore}}</span></h4>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{else}}
|
{{else}}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue