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) {
|
||||
const raise = buttons;
|
||||
const effectName = `${raise == 'raise' ? "Major" : "Minor"} ${direction} ${trait.name}`;
|
||||
const effectId = `${raise == 'raise' ? "Major" : "Minor"}${direction}${trait.name}`;
|
||||
const raise = (buttons == 'raise');
|
||||
const effectName = `${raise ? "Major" : "Minor"} ${direction} ${trait.name}`;
|
||||
const effectId = `${raise ? "Major" : "Minor"}${direction}${trait.name}`;
|
||||
const effectIcon = (direction == 'Boost' ? UPICON : DOWNICON)
|
||||
for (const token of tokens) {
|
||||
let tokenDoc = token.document;
|
||||
@ -174,13 +174,13 @@ async function createEffect(tokens, trait, direction, buttons) {
|
||||
};
|
||||
let mode = foundry.CONST.ACTIVE_EFFECT_MODES.ADD;
|
||||
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) {
|
||||
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") {
|
||||
effectData.duration = {rounds: 5};
|
||||
effectData.duration = { rounds: 5 };
|
||||
}
|
||||
let mutate = {
|
||||
embedded: {
|
||||
@ -190,7 +190,7 @@ async function createEffect(tokens, trait, direction, buttons) {
|
||||
};
|
||||
mutate.embedded.ActiveEffect[effectName] = effectData;
|
||||
let mutateOptions = {
|
||||
comparisonKeys: {'ActiveEffect': 'label'},
|
||||
comparisonKeys: { 'ActiveEffect': 'label' },
|
||||
name: effectName,
|
||||
permanent: false,
|
||||
description: effectName,
|
||||
|
||||
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user