[Feature] Encounter Battlepoints (#1346)

* Added BP calculation and tooltip breakdown of BP sources

* Added Modifiers

* Fixed automatic battleToggles

* Corrected 'NoToughies' conditional

* Fixed GM-only visibility

* Fixed combatant isNPC
This commit is contained in:
WBHarry 2025-12-06 21:11:34 +01:00 committed by GitHub
parent c3cb9121af
commit 451bef4c92
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
21 changed files with 712 additions and 141 deletions

View file

@ -72,8 +72,32 @@ export default class DHToken extends TokenDocument {
}
return attributes;
}
_shouldRecordMovementHistory() {
return false;
}
/**@inheritdoc */
static async createCombatants(tokens, combat) {
combat ??= game.combats.viewed;
if (combat?.system?.battleToggles?.length) {
await combat.toggleModifierEffects(
true,
tokens.map(x => x.actor)
);
}
super.createCombatants(tokens, combat ?? {});
}
/**@inheritdoc */
static async deleteCombatants(tokens, { combat } = {}) {
combat ??= game.combats.viewed;
if (combat?.system?.battleToggles?.length) {
await combat.toggleModifierEffects(
false,
tokens.map(x => x.actor)
);
}
super.deleteCombatants(tokens, combat ?? {});
}
}