diff --git a/module/helpers/utils.mjs b/module/helpers/utils.mjs index 03dcb32c..66e743a3 100644 --- a/module/helpers/utils.mjs +++ b/module/helpers/utils.mjs @@ -307,8 +307,8 @@ export function updateLinkedItemApps(options, sheet) { export const itemAbleRollParse = (value, actor, item) => { if (!value) return value; - const isItemTarget = value.toLowerCase().replace('item.@', '@'); - const slicedValue = isItemTarget ? value.slice(5) : value; + const isItemTarget = value.toLowerCase().includes('item.@'); + const slicedValue = isItemTarget ? value.replaceAll(/item\.@/gi, '@') : value; try { return Roll.replaceFormulaData(slicedValue, isItemTarget ? item : actor); } catch (_) { diff --git a/templates/sheets/global/partials/inventory-item-V2.hbs b/templates/sheets/global/partials/inventory-item-V2.hbs index 46d63861..a9eb6e3b 100644 --- a/templates/sheets/global/partials/inventory-item-V2.hbs +++ b/templates/sheets/global/partials/inventory-item-V2.hbs @@ -241,19 +241,19 @@ Parameters: {{#unless hideDescription}}
{{/unless}} - {{!-- Dice Resource --}} - {{#if (and (not hideResources) (eq item.system.resource.type 'diceValue'))}} - {{> "systems/daggerheart/templates/sheets/global/partials/item-resource.hbs"}} - {{/if}} - {{!-- Actions Buttons --}} - {{#if (and showActions (eq item.type 'feature'))}} -
- {{#each item.system.actions as | action |}} - - {{/each}} -
- {{/if}} + {{!-- Dice Resource --}} + {{#if (and (not hideResources) (eq item.system.resource.type 'diceValue'))}} + {{> "systems/daggerheart/templates/sheets/global/partials/item-resource.hbs"}} + {{/if}} + {{!-- Actions Buttons --}} + {{#if (and showActions (eq item.type 'feature'))}} +
+ {{#each item.system.actions as | action |}} + + {{/each}} +
+ {{/if}} diff --git a/templates/sheets/global/partials/item-resource.hbs b/templates/sheets/global/partials/item-resource.hbs index b29c818e..85977158 100644 --- a/templates/sheets/global/partials/item-resource.hbs +++ b/templates/sheets/global/partials/item-resource.hbs @@ -1,21 +1,14 @@ -{{#if (eq item.system.resource.type 'simple')}} -
- - -
-{{else}} -
+
{{#times (rollParsed item.system.resource.max item.parent item numerical=true)}} - {{#with (ifThen (lookup ../item.system.resource.diceStates this) (lookup ../item.system.resource.diceStates this) this) as | state |}} - -
- - - {{#if state.used}}{{/if}} -
-
- {{/with}} - {{/times}} - -
-{{/if}} \ No newline at end of file + {{#with (ifThen (lookup ../item.system.resource.diceStates this) (lookup ../item.system.resource.diceStates this) this) as | state |}} + +
+ + + {{#if state.used}}{{/if}} +
+
+ {{/with}} + {{/times}} + +
\ No newline at end of file