fix boost/lower trait macro
This commit is contained in:
parent
302785feb1
commit
a6977f9312
@ -109,9 +109,9 @@ function getDottedPart(obj, key) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function createEffect(tokens, trait, direction, buttons) {
|
async function createEffect(tokens, trait, direction, buttons) {
|
||||||
const raise = buttons;
|
const raise = (buttons == 'raise');
|
||||||
const effectName = `${raise == 'raise' ? "Major" : "Minor"} ${direction} ${trait.name}`;
|
const effectName = `${raise ? "Major" : "Minor"} ${direction} ${trait.name}`;
|
||||||
const effectId = `${raise == 'raise' ? "Major" : "Minor"}${direction}${trait.name}`;
|
const effectId = `${raise ? "Major" : "Minor"}${direction}${trait.name}`;
|
||||||
const effectIcon = (direction == 'Boost' ? UPICON : DOWNICON)
|
const effectIcon = (direction == 'Boost' ? UPICON : DOWNICON)
|
||||||
for (const token of tokens) {
|
for (const token of tokens) {
|
||||||
let tokenDoc = token.document;
|
let tokenDoc = token.document;
|
||||||
@ -174,13 +174,13 @@ async function createEffect(tokens, trait, direction, buttons) {
|
|||||||
};
|
};
|
||||||
let mode = foundry.CONST.ACTIVE_EFFECT_MODES.ADD;
|
let mode = foundry.CONST.ACTIVE_EFFECT_MODES.ADD;
|
||||||
if (diemod != 0) {
|
if (diemod != 0) {
|
||||||
effectData.changes.push({key: trait.diekey, mode: mode, value: diemod, priority: 0});
|
effectData.changes.push({ key: trait.diekey, mode: mode, value: diemod, priority: 0 });
|
||||||
}
|
}
|
||||||
if (modmod != 0) {
|
if (modmod != 0) {
|
||||||
effectData.changes.push({key: trait.modkey, mode: mode, value: modmod, priority: 0});
|
effectData.changes.push({ key: trait.modkey, mode: mode, value: modmod, priority: 0 });
|
||||||
}
|
}
|
||||||
if (direction == "Boost") {
|
if (direction == "Boost") {
|
||||||
effectData.duration = {rounds: 5};
|
effectData.duration = { rounds: 5 };
|
||||||
}
|
}
|
||||||
let mutate = {
|
let mutate = {
|
||||||
embedded: {
|
embedded: {
|
||||||
@ -190,7 +190,7 @@ async function createEffect(tokens, trait, direction, buttons) {
|
|||||||
};
|
};
|
||||||
mutate.embedded.ActiveEffect[effectName] = effectData;
|
mutate.embedded.ActiveEffect[effectName] = effectData;
|
||||||
let mutateOptions = {
|
let mutateOptions = {
|
||||||
comparisonKeys: {'ActiveEffect': 'label'},
|
comparisonKeys: { 'ActiveEffect': 'label' },
|
||||||
name: effectName,
|
name: effectName,
|
||||||
permanent: false,
|
permanent: false,
|
||||||
description: effectName,
|
description: effectName,
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user