mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-18 16:09:03 +01:00
Max Cards loadout switch & Homebrew setting
This commit is contained in:
parent
fcba5041e9
commit
cd517252fa
6 changed files with 36 additions and 5 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,6 +14,13 @@ export default class DhHomebrew extends foundry.abstract.DataModel {
|
|||
initial: 12,
|
||||
label: 'DAGGERHEART.SETTINGS.Homebrew.FIELDS.maxFear.label'
|
||||
}),
|
||||
maxLoadout: new fields.NumberField({
|
||||
required: true,
|
||||
integer: true,
|
||||
min: 0,
|
||||
initial: 5,
|
||||
label: 'DAGGERHEART.SETTINGS.Homebrew.FIELDS.maxLoadout.label'
|
||||
}),
|
||||
traitArray: new fields.ArrayField(new fields.NumberField({ required: true, integer: true }), {
|
||||
initial: () => [2, 1, 1, 0, 0, -1]
|
||||
}),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue