From 6d909c1369a5f56b484d0691ffdd2e546bbeefb0 Mon Sep 17 00:00:00 2001 From: sasquach45932 Date: Thu, 19 Sep 2024 11:19:29 +0200 Subject: [PATCH 1/2] 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; From de7f2f5336b86d83d1a7cfd3443350d4efb5cba5 Mon Sep 17 00:00:00 2001 From: Michael Enion Date: Wed, 2 Oct 2024 23:13:21 +0200 Subject: [PATCH 2/2] =?UTF-8?q?=E2=9C=8F=EF=B8=8F=20docs|Changelog|Update?= =?UTF-8?q?=20notes=20re=20Shadow=20of=20Demonlord=20support?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Changelog.md | 1 + 1 file changed, 1 insertion(+) diff --git a/Changelog.md b/Changelog.md index 33a214a..25cb22d 100644 --- a/Changelog.md +++ b/Changelog.md @@ -3,6 +3,7 @@ Fixes for calculating movement penalty in drawings. Avoid displaying the default ruler label in some situations when using the custom label. Closes issue #212. Fix for PF2e speed not displaying correctly. Closes issue #211. Fix for user seeing the GM ruler when moving hidden tokens. Closes issue #207. +Add support for Shadow of the Demon Lord. Thanks @sasquach45932! # 0.10.11 When snapping pathfinding to grid, avoid two waypoints within the same space when snapping is possible.