Skip to content

Commit

Permalink
Merge pull request #208 from sasquach45932/main
Browse files Browse the repository at this point in the history
Shadow Of The Demon Lord support
  • Loading branch information
caewok authored Oct 2, 2024
2 parents 0f180a5 + 6d909c1 commit afe3743
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 10 additions & 1 deletion scripts/pathfinding/WallTracer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 2 additions & 0 deletions scripts/system_attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,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 "";
}
}
Expand Down Expand Up @@ -169,6 +170,7 @@ export function defaultDashMultiplier() {
case "dragonbane":
case "twodsix":
case "a5e":
case "demonlord":
case "ds4": return 2;

case "CoC7": return 5;
Expand Down

0 comments on commit afe3743

Please sign in to comment.