diff --git a/module/applications/actor/sheet-v2-mixin.mjs b/module/applications/actor/sheet-v2-mixin.mjs index 5a01f86d8f..4970ac70d2 100644 --- a/module/applications/actor/sheet-v2-mixin.mjs +++ b/module/applications/actor/sheet-v2-mixin.mjs @@ -428,6 +428,12 @@ export default function ActorSheetV2Mixin(Base) { ctx.activities = item.system.activities ?.filter(a => !item.getFlag("dnd5e", "riders.activity")?.includes(a.id)) ?.map(this._prepareActivity.bind(this)); + + // Linked Uses + const cachedFor = fromUuidSync(item.flags.dnd5e?.cachedFor, { relative: this.actor, strict: false }); + if ( cachedFor ) ctx.linkedUses = cachedFor.consumption?.targets.find(t => t.type === "activityUses") + ? cachedFor.uses : cachedFor.consumption?.targets.find(t => t.type === "itemUses") + ? cachedFor.item.system.uses : null; } /* -------------------------------------------- */ diff --git a/templates/actors/tabs/creature-spells.hbs b/templates/actors/tabs/creature-spells.hbs index 05e1a89794..cb5f4ee1fc 100644 --- a/templates/actors/tabs/creature-spells.hbs +++ b/templates/actors/tabs/creature-spells.hbs @@ -216,12 +216,17 @@ {{!-- Spell Uses --}} -
+
{{#if ctx.hasUses}} / {{ item.system.uses.max }} + {{else if ctx.linkedUses}} + {{ ctx.linkedUses.value }} + / + {{ ctx.linkedUses.max }} {{/if}}