diff --git a/module.json b/module.json index 3448fc2..cc37c0e 100644 --- a/module.json +++ b/module.json @@ -62,7 +62,7 @@ "type": "system", "manifest": "https://gitlab.com/asacolips-projects/foundry-mods/archmage/-/raw/2.0.2/system.json", "compatibility": { - "verified": "2.0.2" + "verified": "3.3.1" } } ], @@ -71,13 +71,13 @@ "id": "simbuls-athenaeum", "type": "module", "compatibility": { - "verified": "1.0.0" + "verified": "1.1.0" } } ] }, "compatibility": { - "minimum": "10", - "verified": "11" + "minimum": "12", + "verified": "12" } } diff --git a/scripts/apps/config-app.js b/scripts/apps/config-app.js index d67b005..9fd4a9b 100644 --- a/scripts/apps/config-app.js +++ b/scripts/apps/config-app.js @@ -37,7 +37,7 @@ export class HelpersSettingsConfig extends SettingsConfig { /**@override */ static get defaultOptions(){ - return mergeObject(super.defaultOptions, { + return foundry.utils.mergeObject(super.defaultOptions, { title : HELPER.localize("Helpers"), id : "creature-aide-client-settings", template : `${MODULE.data.athenaeum}/templates/ModularSettings.html`, @@ -86,12 +86,12 @@ export class HelpersSettingsConfig extends SettingsConfig { /**@override */ getData(options){ - const canConfigure = game.user.can("SETTING_MODIFY"); + const canConfigure = game.user.can("SETTING_MODIFY") || game.user.can("SETTINGS_MODIFY"); const settings = Array.from(game.settings.settings); options.title = HELPER.format('SCA.ConfigApp.title'); let data = { - tabs: duplicate(options.groupLabels), + tabs: foundry.utils.duplicate(options.groupLabels), hasParent: !!options.subMenuId, parentMenu: options.parentMenu } diff --git a/scripts/modules/AbilityRecharge.js b/scripts/modules/AbilityRecharge.js index 9311bdc..3d20c3e 100644 --- a/scripts/modules/AbilityRecharge.js +++ b/scripts/modules/AbilityRecharge.js @@ -82,7 +82,7 @@ export class AbilityRecharge { queueUpdate(async () => { // Roll the check - const roll = await(new Roll("1d6").evaluate({async: true})); + const roll = await(new Roll("1d6").evaluate()); const success = roll.total >= parseInt(data.recharge.value); const rollMode = HELPER.setting(MODULE.data.name, "hideAbilityRecharge") == true ? "blindroll" : ""; diff --git a/scripts/modules/LairActionManagement.js b/scripts/modules/LairActionManagement.js index 8740505..ac062e9 100644 --- a/scripts/modules/LairActionManagement.js +++ b/scripts/modules/LairActionManagement.js @@ -58,7 +58,7 @@ export class LairActionManagement { /* do not run if not the first GM or the feature is not enabled */ if (!HELPER.isFirstGM() || !HELPER.setting(MODULE.data.name, 'lairActionHelper')) return; - const usesLair = getProperty(combatant, "actor.system.resources.lair.value"); + const usesLair = foundry.utils.getProperty(combatant, "actor.system.resources.lair.value"); const hasLairAction = !!combatant.actor?.items.find((i) => i.system?.activation?.type === "lair"); /* flag this combatant as a lair actor for quick filtering */ @@ -109,7 +109,7 @@ export class LairActionManagement { } const hasHp = (combatant) => { - return getProperty(combatant.actor, 'system.attributes.hp.value') ?? 0 > 0; + return foundry.utils.getProperty(combatant.actor, 'system.attributes.hp.value') ?? 0 > 0; } const filterCondition = inside ? containsLair : excludesLair; diff --git a/scripts/modules/LegendaryActionManagement.js b/scripts/modules/LegendaryActionManagement.js index 09e1d9c..eaebb59 100644 --- a/scripts/modules/LegendaryActionManagement.js +++ b/scripts/modules/LegendaryActionManagement.js @@ -94,8 +94,8 @@ export class LegendaryActionManagement { let legendaryCombatants = combat.combatants.filter( combatant => combatant.getFlag(MODULE.data.name, 'hasLegendary') && combatant.id != previousId ); /* only prompt for actions from alive creatures with leg acts remaining */ - legendaryCombatants = legendaryCombatants.filter( combatant => getProperty(combatant.actor, 'system.resources.legact.value') ?? 0 > 0 ); - legendaryCombatants = legendaryCombatants.filter( combatant => getProperty(combatant.actor, 'system.attributes.hp.value') ?? 0 > 0 ); + legendaryCombatants = legendaryCombatants.filter( combatant => foundry.utils.getProperty(combatant.actor, 'system.resources.legact.value') ?? 0 > 0 ); + legendaryCombatants = legendaryCombatants.filter( combatant => foundry.utils.getProperty(combatant.actor, 'system.attributes.hp.value') ?? 0 > 0 ); /* send list of combantants to the action dialog subclass */ if (legendaryCombatants.length > 0) { @@ -142,7 +142,7 @@ export class LegendaryActionManagement { return; } - let legact = getProperty(combatant.actor, 'system.resources.legact'); + let legact = foundry.utils.getProperty(combatant.actor, 'system.resources.legact'); /* does this creature have the legendary action counter? */ if (!!legact && legact.value !== null) { @@ -152,7 +152,7 @@ export class LegendaryActionManagement { /* send the reset update and sheet refresh */ queueUpdate( async () => { - const newActor = await combatant.actor.update({'data.resources.legact.value': legact.max}); + const newActor = await combatant.actor.update({'system.resources.legact.value': legact.max}); newActor.sheet.render(false); }); } diff --git a/scripts/modules/Regeneration.js b/scripts/modules/Regeneration.js index 96c76cd..6b0e436 100644 --- a/scripts/modules/Regeneration.js +++ b/scripts/modules/Regeneration.js @@ -72,7 +72,7 @@ export class Regeneration { /** before we check anything else, is regen blocked on this actor? */ const regenBlockName = HELPER.setting(MODULE.data.name, "regenBlock"); const blockEffect = actor.effects?.find(e => e.name ?? e.label === regenBlockName ); - const enabledBlockEffect = !(getProperty(blockEffect ?? {}, 'disabled') ?? true); + const enabledBlockEffect = !(foundry.utils.getProperty(blockEffect ?? {}, 'disabled') ?? true); if (enabledBlockEffect) { logger.debug(game.settings.get(MODULE.data.name, "debug"), `${NAME} | ${actor.name}'s regeneration blocked by ${blockEffect.name ?? blockEffect.label}`); @@ -90,7 +90,7 @@ export class Regeneration { } static _getActorHP(actor) { - const actorHP = getProperty(actor, 'system.attributes.hp'); + const actorHP = foundry.utils.getProperty(actor, 'system.attributes.hp'); return actorHP; } @@ -121,7 +121,7 @@ export class Regeneration { const rollRegenCallback = () => queueUpdate( async () => { /** roll the regen expression */ - const rollObject = await new Roll(regen).evaluate({async: true}); + const rollObject = await new Roll(regen).evaluate(); let regenRoll = rollObject.total; /** apply the damage to the token */ diff --git a/scripts/modules/UndeadFortitude.js b/scripts/modules/UndeadFortitude.js index f65fddd..8ebbc42 100644 --- a/scripts/modules/UndeadFortitude.js +++ b/scripts/modules/UndeadFortitude.js @@ -66,17 +66,19 @@ export class UndeadFortitude { if (!(HELPER.setting(MODULE.data.name, 'undeadFortEnable') > 0)) return; /* bail if HP isnt being modified */ - if ( getProperty(update, "system.attributes.hp.value") == undefined ) return; + if (foundry.utils.getProperty(update, "system.attributes.hp.value") == undefined ) return; /* Bail if the actor does not have undead fortitude and the flag is not set to true (shakes fist at double negatives)*/ if (!actor.items.getName(HELPER.setting(MODULE.data.name, "undeadFortName")) && !actor.getFlag("dnd5e","helpersUndeadFortitude")) return; /* collect the needed information and pass it along to the handler */ const originalHp = actor.system.attributes.hp.value; - const finalHp = getProperty(update, "system.attributes.hp.value") ?? originalHp; + const finalHp = foundry.utils.getProperty(update, "system.attributes.hp.value") ?? originalHp; // default the damage to this calculation let hpDelta = originalHp - finalHp; + if (originalHp === 0 && finalHp === 0) return; + // if you have midi-QOL then you'll have the applied damage if (options.damageItem) { hpDelta = options.damageItem.appliedDamage @@ -146,7 +148,7 @@ export class UndeadFortitude { if (hasSaved) { /* they saved, report and restore to 1 HP */ content = HELPER.format("SCA.UndeadFort_surivalmessage", { tokenName: messageName, total: result }); - await data.actor.update({'data.attributes.hp.value': 1}); + await data.actor.update({'system.attributes.hp.value': 1}); } else { /* rolled and failed, but not instantly via damage type */ content = HELPER.format("SCA.UndeadFort_deathmessage", { tokenName: messageName, total: result });