Max Cards loadout switch & Homebrew setting

This commit is contained in:
Dapoolp 2025-07-25 22:38:19 +02:00
parent fcba5041e9
commit cd517252fa
6 changed files with 36 additions and 5 deletions

View file

@ -202,7 +202,8 @@ export default class DhCharacter extends BaseDataActor {
hint: 'DAGGERHEART.GENERAL.Bonuses.rest.longRest.longRestMoves.hint'
})
})
})
}),
maxLoadout : new fields.NumberField({ integer: true, initial: 0 })
}),
companion: new ForeignDocumentUUIDField({ type: 'Actor', nullable: true, initial: null }),
rules: new fields.SchemaField({
@ -320,6 +321,17 @@ export default class DhCharacter extends BaseDataActor {
};
}
get loadoutSlot() {
const loadoutCount = this.domainCards.loadout?.length ?? 0,
max = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Homebrew).maxLoadout + this.bonuses.maxLoadout;
return {
current: loadoutCount,
available: Math.max(max - loadoutCount, 0),
max
}
}
get armor() {
return this.parent.items.find(x => x.type === 'armor' && x.system.equipped);
}