Introduced a adversary category split for BP calculation and CombatTracker display based on token disposition

This commit is contained in:
WBHarry 2026-05-10 14:47:41 +02:00
parent abd7824c96
commit 3f9f4fac17
4 changed files with 24 additions and 4 deletions

View file

@ -350,7 +350,9 @@ export default class DhTooltipManager extends foundry.helpers.interaction.Toolti
async getBattlepointHTML(combatId) {
const combat = game.combats.get(combatId);
const adversaries =
combat.turns?.filter(x => x.actor?.isNPC)?.map(x => ({ ...x.actor, type: x.actor.system.type })) ?? [];
combat.turns
?.filter(x => x.actor?.isNPC && x.token.disposition === CONST.TOKEN_DISPOSITIONS.HOSTILE)
?.map(x => ({ ...x.actor, type: x.actor.system.type })) ?? [];
const characters = combat.turns?.filter(x => !x.isNPC && x.actor) ?? [];
const nrCharacters = characters.length;