mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-06-06 04:44:16 +02:00
Rename key to value
This commit is contained in:
parent
479d7e506a
commit
8a2a7e982e
1 changed files with 6 additions and 6 deletions
|
|
@ -170,10 +170,10 @@ export default class DhActiveEffect extends foundry.documents.ActiveEffect {
|
||||||
}
|
}
|
||||||
|
|
||||||
static getChangeValue(model, change, effect) {
|
static getChangeValue(model, change, effect) {
|
||||||
let key = change.value.toString();
|
let value = change.value.toString();
|
||||||
let origin = null;
|
let origin = null;
|
||||||
if (key.toLowerCase().includes('origin.@') && effect.origin) {
|
if (value.toLowerCase().includes('origin.@') && effect.origin) {
|
||||||
key = key.replaceAll(/origin\.@/gi, '@');
|
value = value.replaceAll(/origin\.@/gi, '@');
|
||||||
try {
|
try {
|
||||||
const originEffect = foundry.utils.fromUuidSync(effect.origin);
|
const originEffect = foundry.utils.fromUuidSync(effect.origin);
|
||||||
origin =
|
origin =
|
||||||
|
|
@ -187,10 +187,10 @@ export default class DhActiveEffect extends foundry.documents.ActiveEffect {
|
||||||
const actor = model.parent instanceof Actor ? model.parent : model;
|
const actor = model.parent instanceof Actor ? model.parent : model;
|
||||||
const item = origin ?? null;
|
const item = origin ?? null;
|
||||||
const stackingParsedValue = effect.system.stacking
|
const stackingParsedValue = effect.system.stacking
|
||||||
? Roll.replaceFormulaData(key, { stacks: effect.system.stacking.value })
|
? Roll.replaceFormulaData(value, { stacks: effect.system.stacking.value })
|
||||||
: key;
|
: value;
|
||||||
const evalValue = itemAbleRollParse(stackingParsedValue, actor, item);
|
const evalValue = itemAbleRollParse(stackingParsedValue, actor, item);
|
||||||
return evalValue ?? key;
|
return evalValue ?? value;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue