Max Cards loadout switch & Homebrew setting (#412)

* Max Cards loadout switch & Homebrew setting

* Fixes

* Fixes
This commit is contained in:
Dapoulp 2025-07-26 00:50:39 +02:00 committed by GitHub
parent 2a4777f1a0
commit dddee78356
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 42 additions and 4 deletions

View file

@ -202,6 +202,11 @@ export default class DhCharacter extends BaseDataActor {
hint: 'DAGGERHEART.GENERAL.Bonuses.rest.longRest.longRestMoves.hint'
})
})
}),
maxLoadout : new fields.NumberField({
integer: true,
initial: 0,
label: 'DAGGERHEART.GENERAL.Bonuses.maxLoadout.label'
})
}),
companion: new ForeignDocumentUUIDField({ type: 'Actor', nullable: true, initial: null }),
@ -321,6 +326,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);
}