Skip to content
This repository has been archived by the owner on Jan 20, 2025. It is now read-only.

Commit

Permalink
Merge pull request #690 from oWave/pf2e-remaster
Browse files Browse the repository at this point in the history
pf2e 5.9 compatibility
  • Loading branch information
otigon authored Nov 20, 2023
2 parents 38dd313 + 1118b15 commit 47b8c56
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions src/system-support/aa-pf2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,15 +151,23 @@ async function runPF2eSpells(data) {
const msg = data.workflow;
const item = data.item;
const playOnDamage = data.playOnDamage;
const isDamageRoll = msg.isDamageRoll;
const hasAttack = spellHasAttack(item);
const spellType = getSpellType(item);
let spellType = getSpellType(item);

if (item.isVariant) {
data.isVariant = true
data.originalItem = item.original;
}

if (isNewerVersion(game.system.version, "5.8.3")) {
// pf2e 5.9 removes spellType
if (item.system.traits.value.includes("healing"))
spellType = "heal"
else if (item.system.traits.value.includes("attack"))
spellType = "attack"
else
spellType = "save"
}

switch (spellType) {
case "utility":
case "save":
Expand Down Expand Up @@ -252,7 +260,11 @@ function findDamageOnItem(item) {
}

function itemHasDamage(item) {
let damage = item.system?.damage?.value || item.system?.damageRolls || {};
let damage =
item.system?.damage?.value // before pf2e 5.9 spell damage
|| item.system?.damage // 5.9 spell damage
|| item.system?.damageRolls // strike damage
|| {};
return Object.keys(damage).length
}

Expand Down

0 comments on commit 47b8c56

Please sign in to comment.