Implement most of shield functionality using the armour implementation as a backbone
This commit is contained in:
parent
27d924e336
commit
9d48794b83
9 changed files with 60 additions and 29 deletions
|
|
@ -143,6 +143,7 @@ export class HeroSummaryCardV1 extends GenericAppMixin(HandlebarsApplicationMixi
|
|||
static async prepareArmor(ctx) {
|
||||
ctx.armours = {};
|
||||
const equipped = ctx.actor.system.equippedArmour;
|
||||
const shield = ctx.actor.system.equippedShield;
|
||||
const defenses = ctx.actor.system.defense;
|
||||
for (const slot of Object.values(gameTerms.Anatomy)) {
|
||||
const item = equipped[slot];
|
||||
|
|
@ -150,9 +151,16 @@ export class HeroSummaryCardV1 extends GenericAppMixin(HandlebarsApplicationMixi
|
|||
name: item?.name ?? ``,
|
||||
uuid: item?.uuid ?? ``,
|
||||
defense: defenses[slot],
|
||||
shielded: false,
|
||||
shielded: shield?.system.location.has(slot) ?? false,
|
||||
};
|
||||
};
|
||||
|
||||
ctx.shield = {
|
||||
name: shield?.name ?? ``,
|
||||
uuid: shield?.uuid ?? ``,
|
||||
bonus: shield?.system.protection ?? 0,
|
||||
};
|
||||
|
||||
return ctx;
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue