RC-107 | Display the protection values of the equipped armours
This commit is contained in:
parent
afc8278ffc
commit
67602779ed
3 changed files with 13 additions and 3 deletions
|
|
@ -140,12 +140,14 @@ export class HeroSummaryCardV1 extends GenericAppMixin(HandlebarsApplicationMixi
|
||||||
static async prepareArmor(ctx) {
|
static async prepareArmor(ctx) {
|
||||||
ctx.armours = {};
|
ctx.armours = {};
|
||||||
const equipped = ctx.actor.system.equippedArmour;
|
const equipped = ctx.actor.system.equippedArmour;
|
||||||
for (const slot of gameTerms.Anatomy) {
|
const defenses = ctx.actor.system.defense;
|
||||||
|
for (const slot of Object.values(gameTerms.Anatomy)) {
|
||||||
const item = equipped[slot];
|
const item = equipped[slot];
|
||||||
ctx.armours[slot] = {
|
ctx.armours[slot] = {
|
||||||
name: item?.name ?? ``,
|
name: item?.name ?? ``,
|
||||||
uuid: item?.uuid ?? ``,
|
uuid: item?.uuid ?? ``,
|
||||||
defense: 0,
|
defense: defenses[slot],
|
||||||
|
shielded: false,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
return ctx;
|
return ctx;
|
||||||
|
|
|
||||||
|
|
@ -152,7 +152,7 @@ export class HeroData extends foundry.abstract.TypeDataModel {
|
||||||
get equippedArmour() {
|
get equippedArmour() {
|
||||||
const armours = this.parent.itemTypes.armour;
|
const armours = this.parent.itemTypes.armour;
|
||||||
const slots = Object.fromEntries(
|
const slots = Object.fromEntries(
|
||||||
gameTerms.Anatomy.map(v => [v, null]),
|
Object.values(gameTerms.Anatomy).map(v => [v, null]),
|
||||||
);
|
);
|
||||||
for (const armour of armours) {
|
for (const armour of armours) {
|
||||||
if (!armour.system.equipped) { continue };
|
if (!armour.system.equipped) { continue };
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,13 @@
|
||||||
class="silhouette"
|
class="silhouette"
|
||||||
name="hero-silhouette"
|
name="hero-silhouette"
|
||||||
></rc-svg>
|
></rc-svg>
|
||||||
|
{{#each armours as | slot |}}
|
||||||
|
<div class="{{@key}}">
|
||||||
|
<div class="compass small">{{ slot.defense }}</div>
|
||||||
|
<span class="label">{{ rc-i18n (concat "RipCrypt.common.anatomy." @key) }}</span>
|
||||||
|
</div>
|
||||||
|
{{/each}}
|
||||||
|
<!--
|
||||||
<div class="head">
|
<div class="head">
|
||||||
<div class="compass small">0</div>
|
<div class="compass small">0</div>
|
||||||
<span class="label">{{ rc-i18n "RipCrypt.common.anatomy.head" }}</span>
|
<span class="label">{{ rc-i18n "RipCrypt.common.anatomy.head" }}</span>
|
||||||
|
|
@ -47,6 +54,7 @@
|
||||||
<div class="compass small">0</div>
|
<div class="compass small">0</div>
|
||||||
<span class="label">{{ rc-i18n "RipCrypt.common.anatomy.legs" }}</span>
|
<span class="label">{{ rc-i18n "RipCrypt.common.anatomy.legs" }}</span>
|
||||||
</div>
|
</div>
|
||||||
|
-->
|
||||||
<div class="shield">
|
<div class="shield">
|
||||||
<span class="label">{{ rc-i18n "RipCrypt.common.shield" }}</span>
|
<span class="label">{{ rc-i18n "RipCrypt.common.shield" }}</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue