Skip to content

Commit

Permalink
Adjustments for macro flag changes
Browse files Browse the repository at this point in the history
  • Loading branch information
MrPrimate committed Sep 9, 2023
1 parent 0e9f5a1 commit 833c15a
Show file tree
Hide file tree
Showing 100 changed files with 119 additions and 101 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- Improvements to importing adventures in v11.
- Arcane Recovery will now detect if you have an Arcane Grimoire attuned and grant a bonus.
- Remove hard dependency on Item Macro for effects in v11 (DAE now provides an editor).
- Some preliminary work for upcoming macro changes.

# 3.4.63

Expand Down
1 change: 1 addition & 0 deletions macros/generics/activeAuraConditionOnEntry.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ async function applyCondition(condition, targetToken, item, itemLevel) {
workflowItemData.system.target = { value: null, width: null, units: "", type: "creature" };
workflowItemData.system.preparation.mode = "atwill";
setProperty(workflowItemData, "flags.itemacro", {});
setProperty(workflowItemData, "flags.dae.macro", {});
setProperty(workflowItemData, "flags.midi-qol", {});
setProperty(workflowItemData, "flags.dae", {});
setProperty(workflowItemData, "effects", []);
Expand Down
2 changes: 2 additions & 0 deletions macros/generics/activeAuraDamageAndConditionOnEntry.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ async function applyCondition(condition, targetToken, item, itemLevel) {
workflowItemData.system.target = { value: null, width: null, units: "", type: "creature" };
workflowItemData.system.preparation.mode = "atwill";
setProperty(workflowItemData, "flags.itemacro", {});
setProperty(workflowItemData, "flags.dae.macro", {});
setProperty(workflowItemData, "flags.midi-qol", {});
setProperty(workflowItemData, "flags.dae", {});
setProperty(workflowItemData, "effects", []);
Expand Down Expand Up @@ -103,6 +104,7 @@ async function rollItemDamage(targetToken, itemUuid, itemLevel) {
workflowItemData.system.target = { value: null, width: null, units: "", type: "creature" };

setProperty(workflowItemData, "flags.itemacro", {});
setProperty(workflowItemData, "flags.dae.macro", {});
setProperty(workflowItemData, "flags.midi-qol", {});
setProperty(workflowItemData, "flags.dae", {});
setProperty(workflowItemData, "effects", []);
Expand Down
1 change: 1 addition & 0 deletions macros/generics/activeAuraDamageOnEntry.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ async function rollItemDamage(targetToken, itemUuid, itemLevel) {
workflowItemData.system.target = { value: null, width: null, units: "", type: "creature" };

setProperty(workflowItemData, "flags.itemacro", {});
setProperty(workflowItemData, "flags.dae.macro", {});
setProperty(workflowItemData, "flags.midi-qol", {});
setProperty(workflowItemData, "flags.dae", {});
setProperty(workflowItemData, "effects", []);
Expand Down
11 changes: 7 additions & 4 deletions macros/spells/boomingBlade.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ function weaponAttack(caster, sourceItemData, origin, target) {
const attackItem = new CONFIG.Item.documentClass(weaponCopy, { parent: caster });
attackItem.prepareData();
attackItem.prepareFinalAttributes();
console.warn(attackItem);
// console.warn(attackItem);
const options = { showFullCard: false, createWorkflow: true, configureDialog: true };
await MidiQOL.completeItemUse(attackItem, {}, options);
},
Expand Down Expand Up @@ -91,12 +91,15 @@ if (args[0].tag === "OnUse") {
// uses midis move flag to determine if to apply extra damage
if (lastArg["expiry-reason"] === "midi-qol:isMoved" || lastArg["expiry-reaason"] === "midi-qol:isMoved") {
const targetToken = await fromUuid(lastArg.tokenUuid);
const sourceItem = await fromUuid(lastArg.efData.flags.origin);
const caster = sourceItem.parent;
const caster = await fromUuid(lastArg.efData.flags.casterUuid);
const itemId = DAE.getFlag(caster, "boomingBladeChoice");
// const sourceItem = await fromUuid(lastArg.efData.flags.origin);
const sourceItem = caster.getEmbeddedDocument("Item", itemId);
// const caster = sourceItem.parent;
const casterToken = canvas.tokens.placeables.find((t) => t.actor?.uuid === caster.uuid);
const damageRoll = await new CONFIG.Dice.DamageRoll(`${lastArg.efData.flags.cantripDice}d8[${damageType}]`).evaluate({ async: true });
if (game.dice3d) game.dice3d.showForRoll(damageRoll);
const workflowItemData = duplicate(sourceItem.data);
const workflowItemData = duplicate(sourceItem);
workflowItemData.system.target = { value: 1, units: "", type: "creature" };
workflowItemData.name = "Booming Blade: Movement Damage";

Expand Down
3 changes: 2 additions & 1 deletion macros/spells/greenFlameBlade.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,8 @@ function weaponAttack(caster, sourceItemData, origin, target) {
transfer: false,
flags: { targetUuid: target.uuid, casterId: caster.id, origin, cantripDice, damageType, dae: { specialDuration: ["1Action", "1Attack", "turnStartSource"], transfer: false } },
});
setProperty(weaponCopy, "flags.itemacro", duplicate(sourceItemData.flags.itemacro));
if (hasProperty(sourceItemData, "flags.itemacro")) setProperty(weaponCopy, "flags.itemacro", duplicate(sourceItemData.flags.itemacro));
if (hasProperty(sourceItemData, "flags.dae.macro")) setProperty(weaponCopy, "flags.dae.macro", duplicate(sourceItemData.flags.dae.macro));
setProperty(weaponCopy, "flags.midi-qol.effectActivation", false);
if (game.modules.get("sequencer")?.active && Sequencer.Database.entryExists(patreonPrimary)) {
const autoAnimationsAdjustments = duplicate(baseAutoAnimation);
Expand Down
2 changes: 1 addition & 1 deletion macros/spells/hailOfThorns.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const defaultItemName = "Hail of Thorns";
// Set to false to remove debug logging
const debug = false;

const dependencies = ["dae", "itemacro", "times-up", "midi-qol"];
const dependencies = ["dae", "times-up", "midi-qol"];
if (!game.modules.get("ddb-importer")?.api.effects.requirementsSatisfied(defaultItemName, dependencies)) {
return;
}
Expand Down
4 changes: 2 additions & 2 deletions src/effects/effects.js
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ export function getMidiCEOnFlags(midiFlags = {}) {
}

export function forceItemEffect(document) {
if (document.effects.length > 0 || hasProperty(document.flags, "itemacro")) {
if (document.effects.length > 0 || hasProperty(document.flags, "itemacro") || hasProperty(document.flags, "dae.macro")) {
setProperty(document, "flags.ddbimporter.effectsApplied", true);
setProperty(document, "flags.midi-qol.forceCEOff", true);
}
Expand Down Expand Up @@ -1473,7 +1473,7 @@ export function generateEffects(ddb, character, ddbItem, foundryItem, isCompendi
// no default
}

if (foundryItem.effects?.length > 0 || hasProperty(foundryItem.flags, "itemacro")) {
if (foundryItem.effects?.length > 0 || hasProperty(foundryItem.flags, "itemacro") || hasProperty(document.flags, "dae.macro")) {
logger.debug(`${type} effect ${foundryItem.name}:`, duplicate(foundryItem));
setProperty(foundryItem, "flags.ddbimporter.effectsApplied", true);
}
Expand Down
2 changes: 1 addition & 1 deletion src/effects/feats/ancestralProtectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { loadMacroFile, generateItemMacroFlag } from "../macros.js";

export async function ancestralProtectorsEffect(document) {
const itemMacroText = await loadMacroFile("feat", "ancestralProtectors.js");
document.flags["itemacro"] = generateItemMacroFlag(document, itemMacroText);
document = generateItemMacroFlag(document, itemMacroText);

let effect = baseFeatEffect(document, document.name);
effect.changes.push({
Expand Down
2 changes: 1 addition & 1 deletion src/effects/feats/arcaneRecovery.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { baseFeatEffect } from "../specialFeats.js";
export async function arcaneRecoveryEffect(document) {
let effect = baseFeatEffect(document, document.name);
const itemMacroText = await loadMacroFile("feat", "arcaneRecovery.js");
document.flags["itemacro"] = generateItemMacroFlag(document, itemMacroText);
document = generateItemMacroFlag(document, itemMacroText);
effect.changes.push(generateMacroChange(""));
setProperty(effect, "flags.dae.selfTarget", true);
setProperty(effect, "flags.dae.selfTargetAlways", true);
Expand Down
2 changes: 1 addition & 1 deletion src/effects/feats/arcaneWard.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { loadMacroFile, generateItemMacroFlag } from "../macros.js";
export async function arcaneWardEffect(document) {
let detectionEffect = baseItemEffect(document, `${document.name}: Spell Detection`);
const itemMacroText = await loadMacroFile("feat", "arcaneWard.js");
document.flags["itemacro"] = generateItemMacroFlag(document, itemMacroText);
document = generateItemMacroFlag(document, itemMacroText);

detectionEffect.changes.push({
key: "flags.midi-qol.onUseMacroName",
Expand Down
2 changes: 1 addition & 1 deletion src/effects/feats/blessedHealer.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { loadMacroFile, generateItemMacroFlag } from "../macros.js";
export async function blessedHealerEffect(document) {
let effect = baseItemEffect(document, document.name);
const itemMacroText = await loadMacroFile("feat", "blessedHealer.js");
document.flags["itemacro"] = generateItemMacroFlag(document, itemMacroText);
document = generateItemMacroFlag(document, itemMacroText);

effect.changes.push({
key: "flags.midi-qol.onUseMacroName",
Expand Down
2 changes: 1 addition & 1 deletion src/effects/feats/crusher.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export async function crusherEffect(document) {
document.effects.push(effect);

const itemMacroText = await loadMacroFile("feat", "crusher.js");
setProperty(document, "flags.itemacro", generateItemMacroFlag(document, itemMacroText));
document = generateItemMacroFlag(document, itemMacroText);
document.system.actionType = null;
return document;
}
2 changes: 1 addition & 1 deletion src/effects/feats/crusherCritical.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export async function crusherCriticalEffect(document) {
document.effects.push(effect);

const itemMacroText = await loadMacroFile("feat", "crusherCritical.js");
setProperty(document, "flags.itemacro", generateItemMacroFlag(document, itemMacroText));
document = generateItemMacroFlag(document, itemMacroText);
document.system.actionType = null;

return document;
Expand Down
2 changes: 1 addition & 1 deletion src/effects/feats/favoredFoe.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export async function favoredFoeEffect(document) {
document.effects.push(damageBonusEffect);

const itemMacroText = await loadMacroFile("feat", "favoredFoe.js");
setProperty(document, "flags.itemacro", generateItemMacroFlag(document, itemMacroText));
document = generateItemMacroFlag(document, itemMacroText);
setProperty(document, "flags.midi-qol.onUseMacroName", "[postActiveEffects]ItemMacro");

setProperty(document, "system.actionType", "util");
Expand Down
2 changes: 1 addition & 1 deletion src/effects/feats/fontOfMagic.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { loadMacroFile, generateItemMacroFlag } from "../macros.js";
export async function fontOfMagicEffect(document) {
let effect = baseItemEffect(document, document.name);
const itemMacroText = await loadMacroFile("feat", "fontOfMagic.js");
document.flags["itemacro"] = generateItemMacroFlag(document, itemMacroText);
document = generateItemMacroFlag(document, itemMacroText);
setProperty(document, "flags.midi-qol.onUseMacroName", "[preItemRoll]ItemMacro");

document.effects.push(effect);
Expand Down
2 changes: 1 addition & 1 deletion src/effects/feats/maneuvers.js
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ export async function maneuversEffect(ddb, character, document) {
}
case "Maneuvers: Rally": {
const itemMacroText = await loadMacroFile("feat", "maneuversRally.js");
document.flags["itemacro"] = generateItemMacroFlag(document, itemMacroText);
document = generateItemMacroFlag(document, itemMacroText);
effect.changes.push(generateMacroChange(`${diceString} @abilities.cha.mod`, 20));
document.effects.push(effect);
break;
Expand Down
2 changes: 1 addition & 1 deletion src/effects/feats/mantleOfInspiration.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { loadMacroFile, generateItemMacroFlag } from "../macros.js";

export async function mantleOfInspirationEffect(document) {
const itemMacroText = await loadMacroFile("feat", "mantleOfInspiration.js");
setProperty(document, "flags.itemacro", generateItemMacroFlag(document, itemMacroText));
document = generateItemMacroFlag(document, itemMacroText);
setProperty(document, "flags.midi-qol.onUseMacroName", "[preTargeting]ItemMacro");

return document;
Expand Down
2 changes: 1 addition & 1 deletion src/effects/feats/piercer.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { loadMacroFile, generateItemMacroFlag } from "../macros.js";

async function commonPiercer(document) {
const itemMacroText = await loadMacroFile("feat", "piercer.js");
setProperty(document, "flags.itemacro", generateItemMacroFlag(document, itemMacroText));
document = generateItemMacroFlag(document, itemMacroText);
document.system.target = {
value: null,
width: null,
Expand Down
2 changes: 1 addition & 1 deletion src/effects/feats/planarWarrior.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { loadMacroFile, generateItemMacroFlag } from "../macros.js";

export async function planarWarriorEffect(document) {
const itemMacroText = await loadMacroFile("feat", "planarWarrior.js");
document.flags["itemacro"] = generateItemMacroFlag(document, itemMacroText);
document = generateItemMacroFlag(document, itemMacroText);

let effect = baseFeatEffect(document, "Marked by Planar Warrior");

Expand Down
2 changes: 1 addition & 1 deletion src/effects/feats/radiantSoul.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export async function radiantSoulEffect(document) {
effect.transfer = true;

const itemMacroText = await loadMacroFile("feat", "radiantSoul.js");
document.flags["itemacro"] = generateItemMacroFlag(document, itemMacroText);
document = generateItemMacroFlag(document, itemMacroText);
setProperty(document, "system.activation.type", "special");

document.effects.push(effect);
Expand Down
2 changes: 1 addition & 1 deletion src/effects/feats/runeCarver.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export async function runeCarverEffect(document) {
);
} else {
const itemMacroText = await loadMacroFile("spell", "darkvision.js");
document.flags["itemacro"] = generateItemMacroFlag(document, itemMacroText);
document = generateItemMacroFlag(document, itemMacroText);
baseEffect.changes.push(generateMacroChange(""));
}
break;
Expand Down
2 changes: 1 addition & 1 deletion src/effects/feats/sacredWeapon.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export async function sacredWeaponEffect(document) {
let effect = baseFeatEffect(document, document.name);

const itemMacroText = await loadMacroFile("feat", "sacredWeapon.js");
document.flags["itemacro"] = generateItemMacroFlag(document, itemMacroText);
document = generateItemMacroFlag(document, itemMacroText);
effect.changes.push(generateMacroChange("@abilities.cha.mod", 0));

// effect.changes.push(
Expand Down
2 changes: 1 addition & 1 deletion src/effects/feats/slasherCritical.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export async function slasherCriticalEffect(document) {
document.effects.push(effect);

const itemMacroText = await loadMacroFile("feat", "slasherCritical.js");
setProperty(document, "flags.itemacro", generateItemMacroFlag(document, itemMacroText));
document = generateItemMacroFlag(document, itemMacroText);
document.system.actionType = null;

return document;
Expand Down
2 changes: 1 addition & 1 deletion src/effects/feats/slasherReduceSpeed.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export async function slasherReduceSpeedEffect(document) {
document.effects.push(effect);

const itemMacroText = await loadMacroFile("feat", "slasherReduceSpeed.js");
setProperty(document, "flags.itemacro", generateItemMacroFlag(document, itemMacroText));
document = generateItemMacroFlag(document, itemMacroText);
document.system.actionType = null;
return document;
}
2 changes: 1 addition & 1 deletion src/effects/feats/slayersPrey.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export async function slayersPreyEffect(document) {
document.effects.push(damageBonusEffect);

const itemMacroText = await loadMacroFile("feat", "slayersPrey.js");
setProperty(document, "flags.itemacro", generateItemMacroFlag(document, itemMacroText));
document = generateItemMacroFlag(document, itemMacroText);
setProperty(document, "flags.midi-qol.onUseMacroName", "[postActiveEffects]ItemMacro");

setProperty(document, "system.actionType", "util");
Expand Down
2 changes: 1 addition & 1 deletion src/effects/feats/squireOfSolamnia.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { loadMacroFile, generateItemMacroFlag, generateMacroChange } from "../ma
export async function squireOfSolamniaEffect(document) {
let effect = baseItemEffect(document, document.name);
const itemMacroText = await loadMacroFile("feat", "squireOfSolamnia.js");
document.flags["itemacro"] = generateItemMacroFlag(document, itemMacroText);
document = generateItemMacroFlag(document, itemMacroText);
effect.changes.push(generateMacroChange(`"${document.name}"`));
effect.transfer = false;

Expand Down
2 changes: 1 addition & 1 deletion src/effects/items/cloakOfDisplacement.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export async function cloakOfDisplacementEffect(document) {
let effect = baseItemEffect(document, `${document.name} - Check`);
setProperty(effect, "flags.dae.macroRepeat", "startEveryTurn");
const itemMacroText = await loadMacroFile("item", "cloakOfDisplacement.js");
document.flags["itemacro"] = generateItemMacroFlag(document, itemMacroText);
document = generateItemMacroFlag(document, itemMacroText);
effect.changes.push(generateMacroChange(""));
document.effects[0] = effect;

Expand Down
2 changes: 1 addition & 1 deletion src/effects/items/javelinOfLightning.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { loadMacroFile, generateMacroChange, generateItemMacroFlag } from "../ma
export async function javelinOfLightningEffect(document) {
let effect = baseItemEffect(document, `${document.name}: Used Effect Tracker`);
const itemMacroText = await loadMacroFile("item", "javelinOfLightning.js");
document.flags["itemacro"] = generateItemMacroFlag(document, itemMacroText);
document = generateItemMacroFlag(document, itemMacroText);
effect.changes.push(generateMacroChange(`"${document.name}"`));
effect.transfer = false;
setProperty(effect, "flags.dae.specialDuration", ["newDay", "longRest"]);
Expand Down
2 changes: 1 addition & 1 deletion src/effects/items/pearlOfPower.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { loadMacroFile, generateMacroChange, generateItemMacroFlag } from "../ma
export async function pearlOfPowerEffect(document) {
let effect = baseItemEffect(document, document.name);
const itemMacroText = await loadMacroFile("item", "pearlOfPower.js");
document.flags["itemacro"] = generateItemMacroFlag(document, itemMacroText);
document = generateItemMacroFlag(document, itemMacroText);
effect.changes.push(generateMacroChange(`"${document.name}"`));
effect.transfer = false;
setProperty(effect, "flags.dae.selfTarget", true);
Expand Down
10 changes: 9 additions & 1 deletion src/effects/macros.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,22 @@ if (isNewerVersion(11, game.version)) {
}

export function generateItemMacroFlag(document, macroText) {
return {
const data = {
macro: {
name: document.name,
type: "script",
scope: "global",
command: macroText,
},
};
setProperty(document, "flags.itemacro", data);
// code for if permanent switch to itemacro flag is made
// if (isNewerVersion(11, game.version) || isNewerVersion("11.0.12", game.modules.get("dae")?.version)) {
// setProperty(document, "flags.itemacro", data);
// } else {
// setProperty(document, "flags.dae.macro", data);
// }
return document;
}

export function generateMacroChange(macroValues, priority = 20, local = false) {
Expand Down
2 changes: 1 addition & 1 deletion src/effects/monsterFeatures/beholderEyeRays.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export async function beholderEyeRaysEffect(document) {

let effect = baseFeatEffect(document, document.name);
const itemMacroText = await loadMacroFile("monsterFeature", "beholderEyeRay.js");
setProperty(document, "flags.itemacro", generateItemMacroFlag(document, itemMacroText));
document = generateItemMacroFlag(document, itemMacroText);
setProperty(document, "flags.midi-qol.onUseMacroName", "[postActiveEffects]ItemMacro");
// effect.changes.push(generateMacroChange(""));
effect.transfer = false;
Expand Down
2 changes: 1 addition & 1 deletion src/effects/monsterFeatures/skeletalJuggernautEffects.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ async function disassembleEffect(document) {
let effect = baseFeatEffect(document, document.name);

const itemMacroText = await loadMacroFile("monsterFeature", "disassemble.js");
setProperty(document, "flags.itemacro", generateItemMacroFlag(document, itemMacroText));
document = generateItemMacroFlag(document, itemMacroText);
effect.changes.push(generateMacroChange("", 0));
effect.transfer = true;
setProperty(effect, "flags.dae.specialDuration", ["zeroHP"]);
Expand Down
3 changes: 2 additions & 1 deletion src/effects/monsterFeatures/venomTroll.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export async function venomTrollEffects(npc) {

const itemMacroText = await loadMacroFile("monsterFeature", "venomSpray.js");
setProperty(item, "flags.itemacro", generateItemMacroFlag(item, itemMacroText));
item = generateItemMacroFlag(item, itemMacroText);
setProperty(item, "flags.midi-qol.onUseMacroName", "[postActiveEffects]ItemMacro");


Expand All @@ -43,7 +44,7 @@ export async function venomTrollEffects(npc) {
setProperty(effect, "flags.dae.stackable", "noneName");

const itemMacroText = await loadMacroFile("monsterFeature", "poisonSplash.js");
setProperty(item, "flags.itemacro", generateItemMacroFlag(item, itemMacroText));
item = generateItemMacroFlag(item, itemMacroText);

item.effects.push(effect);

Expand Down
4 changes: 2 additions & 2 deletions src/effects/restrictions.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ async function woundingWeaponEffect(document) {
};

const itemMacroText = await loadMacroFile("item", "wounding.js");
document.flags["itemacro"] = generateItemMacroFlag(document, itemMacroText);
document = generateItemMacroFlag(document, itemMacroText);
effect.changes.push(generateMacroChange());
document.effects.push(effect);

Expand All @@ -31,7 +31,7 @@ async function woundingWeaponEffect(document) {
async function lifeStealingEffect(document) {
let effect = baseItemEffect(document, document.name);
const itemMacroText = await loadMacroFile("item", "lifeStealing.js");
document.flags["itemacro"] = generateItemMacroFlag(document, itemMacroText);
document = generateItemMacroFlag(document, itemMacroText);
setProperty(document, "flags.midi-qol.onUseMacroName", "[postActiveEffects]ItemMacro");
document.effects.push(effect);
return document;
Expand Down
Loading

0 comments on commit 833c15a

Please sign in to comment.