From 6d909c1369a5f56b484d0691ffdd2e546bbeefb0 Mon Sep 17 00:00:00 2001 From: sasquach45932 Date: Thu, 19 Sep 2024 11:19:29 +0200 Subject: [PATCH] Shadow Of The Demon Lord support --- scripts/pathfinding/WallTracer.js | 11 ++++++++++- scripts/system_attributes.js | 2 ++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/scripts/pathfinding/WallTracer.js b/scripts/pathfinding/WallTracer.js index 965d527..4527262 100644 --- a/scripts/pathfinding/WallTracer.js +++ b/scripts/pathfinding/WallTracer.js @@ -407,7 +407,16 @@ export class WallTracerEdge extends GraphEdge { // Don't block dead tokens (HP <= 0). const { tokenHPAttribute, pathfindingIgnoreStatuses } = CONFIG[MODULE_ID]; - const tokenHP = Number(foundry.utils.getProperty(token, tokenHPAttribute)); + let tokenHP = Number(foundry.utils.getProperty(token, tokenHPAttribute)); + + //DemonLord using damage system + if ( game.system.id === 'demonlord') + { + let health = Number(foundry.utils.getProperty(token, "actor.system.characteristics.health.max")); + let damage = Number(foundry.utils.getProperty(token, "actor.system.characteristics.health.value")); + tokenHP = health - damage; + } + if ( Number.isFinite(tokenHP) && tokenHP <= 0 ) return false; // Don't block tokens with certain status. diff --git a/scripts/system_attributes.js b/scripts/system_attributes.js index 3f52c4b..179593e 100644 --- a/scripts/system_attributes.js +++ b/scripts/system_attributes.js @@ -110,6 +110,7 @@ export function defaultWalkAttribute() { case "twodsix": return "actor.system.movement.walk"; case "worldofdarkness": return "actor.system.movement.walk"; case "TheWitcherTRPG": return "actor.system.stats.spd.current"; + case "demonlord": return "actor.system.characteristics.speed"; default: return ""; } } @@ -165,6 +166,7 @@ export function defaultDashMultiplier() { case "dragonbane": case "twodsix": case "a5e": + case "demonlord": case "ds4": return 2; case "CoC7": return 5;