RC-106 | Add equipped armour display

This commit is contained in:
Oliver-Akins 2025-01-17 19:24:53 -07:00
parent 07f3b24897
commit d1ce144114
5 changed files with 67 additions and 0 deletions

View file

@ -72,6 +72,7 @@ export class HeroSummaryCardV1 extends GenericAppMixin(HandlebarsApplicationMixi
ctx = await HeroSummaryCardV1.prepareGuts(ctx);
ctx = await HeroSummaryCardV1.prepareWeapons(ctx);
ctx = await HeroSummaryCardV1.prepareArmor(ctx);
ctx = await HeroSummaryCardV1.prepareFatePath(ctx);
ctx = await HeroSummaryCardV1.prepareAbilityRow(ctx);
ctx = await HeroSummaryCardV1.prepareSpeed(ctx);
@ -136,6 +137,20 @@ export class HeroSummaryCardV1 extends GenericAppMixin(HandlebarsApplicationMixi
return ctx;
};
static async prepareArmor(ctx) {
ctx.armours = {};
const equipped = ctx.actor.system.equippedArmour;
for (const slot of gameTerms.Anatomy) {
const item = equipped[slot];
ctx.armours[slot] = {
name: item?.name ?? ``,
uuid: item?.uuid ?? ``,
defense: 0,
};
};
return ctx;
};
static async prepareWeapons(ctx) {
const limit = ctx.actor.system.limit.weapons;
const embedded = ctx.actor.itemTypes.weapon;