mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 03:31:07 +01:00
[Fix] Fixed Resources (#485)
* Fixed DiceValues placement in InventoryItemV2. Fixed parsing of ITEM.@ paths * Restored simple view
This commit is contained in:
parent
7bbbdce739
commit
23b8363dd2
3 changed files with 18 additions and 18 deletions
|
|
@ -240,12 +240,12 @@ Hooks.on('moveToken', async (movedToken, data) => {
|
||||||
const effectsAutomation = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Automation).effects;
|
const effectsAutomation = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Automation).effects;
|
||||||
if (!effectsAutomation.rangeDependent) return;
|
if (!effectsAutomation.rangeDependent) return;
|
||||||
|
|
||||||
const rangeDependantEffects = movedToken.actor.effects.filter(effect => effect.system.rangeDependence.enabled);
|
const rangeDependantEffects = movedToken.actor.effects.filter(effect => effect.system.rangeDependence?.enabled);
|
||||||
|
|
||||||
const updateEffects = async (disposition, token, effects, effectUpdates) => {
|
const updateEffects = async (disposition, token, effects, effectUpdates) => {
|
||||||
const rangeMeasurement = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.RangeMeasurement);
|
const rangeMeasurement = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.RangeMeasurement);
|
||||||
|
|
||||||
for (let effect of effects.filter(x => x.system.rangeDependence.enabled)) {
|
for (let effect of effects.filter(x => x.system.rangeDependence?.enabled)) {
|
||||||
const { target, range, type } = effect.system.rangeDependence;
|
const { target, range, type } = effect.system.rangeDependence;
|
||||||
if ((target === 'friendly' && disposition !== 1) || (target === 'hostile' && disposition !== -1))
|
if ((target === 'friendly' && disposition !== 1) || (target === 'hostile' && disposition !== -1))
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -307,8 +307,8 @@ export function updateLinkedItemApps(options, sheet) {
|
||||||
export const itemAbleRollParse = (value, actor, item) => {
|
export const itemAbleRollParse = (value, actor, item) => {
|
||||||
if (!value) return value;
|
if (!value) return value;
|
||||||
|
|
||||||
const isItemTarget = value.toLowerCase().replace('item.@', '@');
|
const isItemTarget = value.toLowerCase().includes('item.@');
|
||||||
const slicedValue = isItemTarget ? value.slice(5) : value;
|
const slicedValue = isItemTarget ? value.replaceAll(/item\.@/gi, '@') : value;
|
||||||
try {
|
try {
|
||||||
return Roll.replaceFormulaData(slicedValue, isItemTarget ? item : actor);
|
return Roll.replaceFormulaData(slicedValue, isItemTarget ? item : actor);
|
||||||
} catch (_) {
|
} catch (_) {
|
||||||
|
|
|
||||||
|
|
@ -241,19 +241,19 @@ Parameters:
|
||||||
{{#unless hideDescription}}
|
{{#unless hideDescription}}
|
||||||
<div class="invetory-description"></div>
|
<div class="invetory-description"></div>
|
||||||
{{/unless}}
|
{{/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'))}}
|
|
||||||
<div class="item-buttons">
|
|
||||||
{{#each item.system.actions as | action |}}
|
|
||||||
<button type="button" data-action="useItem" data-item-uuid="{{action.uuid}}">
|
|
||||||
{{action.name}}
|
|
||||||
</button>
|
|
||||||
{{/each}}
|
|
||||||
</div>
|
|
||||||
{{/if}}
|
|
||||||
</div>
|
</div>
|
||||||
|
{{!-- 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'))}}
|
||||||
|
<div class="item-buttons">
|
||||||
|
{{#each item.system.actions as | action |}}
|
||||||
|
<button type="button" data-action="useItem" data-item-uuid="{{action.uuid}}">
|
||||||
|
{{action.name}}
|
||||||
|
</button>
|
||||||
|
{{/each}}
|
||||||
|
</div>
|
||||||
|
{{/if}}
|
||||||
</li>
|
</li>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue