mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-04-21 23:13:39 +02:00
Add game.actors.party and refine logic
This commit is contained in:
parent
b08b8b93b6
commit
031f497c33
5 changed files with 22 additions and 18 deletions
|
|
@ -191,13 +191,11 @@ export const getDeleteKeys = (property, innerProperty, innerPropertyDefaultValue
|
|||
const nativeReplaceFormulaData = Roll.replaceFormulaData;
|
||||
Roll.replaceFormulaData = function (formula, baseData = {}, { missing, warn = false } = {}) {
|
||||
/* Inserting global data */
|
||||
const data = {
|
||||
...baseData,
|
||||
partySize:
|
||||
!game.actors ? 0 :
|
||||
game.actors.find(x => x.type === 'party' && x.system.active)?.system.partyMembers.length ?? 0,
|
||||
const data = {
|
||||
...baseData,
|
||||
partySize: game.actors?.party?.system.partyMembers.length ?? 0
|
||||
};
|
||||
|
||||
|
||||
const terms = Object.keys(CONFIG.DH.GENERAL.multiplierTypes).map(type => {
|
||||
return { term: type, default: 1 };
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue