mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-03-07 14:36:13 +01:00
[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:
parent
c3cb9121af
commit
451bef4c92
21 changed files with 712 additions and 141 deletions
|
|
@ -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 ?? {});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue