This commit is contained in:
Dapoolp 2025-07-25 22:50:56 +02:00
parent cd517252fa
commit 973e54df96
4 changed files with 13 additions and 6 deletions

View file

@ -1080,6 +1080,9 @@
"hint": "The number of extra Long Rest Moves the character can take during a Long Rest."
}
}
},
"maxLoadout": {
"label": "Max Loadout Cards Bonus"
}
},
"Character": {

View file

@ -260,9 +260,9 @@ export default class CharacterSheet extends DHBaseActorSheet {
icon: 'fa-solid fa-arrow-up',
condition: target => getDocFromElement(target).system.inVault,
callback: target => {
const elem = getDocFromElement(target),
actorLoadout = elem.actor?.system.loadoutSlot ?? null;
if(actorLoadout?.available) return elem.update({ 'system.inVault': false });
const doc = getDocFromElement(target),
actorLoadout = doc.actor?.system.loadoutSlot ?? null;
if(actorLoadout?.available) return doc.update({ 'system.inVault': false });
ui.notifications.warn(game.i18n.format('DAGGERHEART.UI.Notifications.loadoutMaxReached', { max: actorLoadout.max }))
}
},

View file

@ -296,8 +296,8 @@ export default function DHApplicationMixin(Base) {
name: 'DAGGERHEART.APPLICATIONS.ContextMenu.useItem',
icon: 'fa-solid fa-burst',
condition: target => {
const elem = getDocFromElement(target);
return !(elem.type === 'domainCard' && elem.system.inVault)
const doc = getDocFromElement(target);
return !(doc.type === 'domainCard' && doc.system.inVault)
},
callback: (target, event) => getDocFromElement(target).use(event)
});

View file

@ -203,7 +203,11 @@ export default class DhCharacter extends BaseDataActor {
})
})
}),
maxLoadout : new fields.NumberField({ integer: true, initial: 0 })
maxLoadout : new fields.NumberField({
integer: true,
initial: 0,
label: 'DAGGERHEART.GENERAL.Bonuses.maxLoadout.label'
})
}),
companion: new ForeignDocumentUUIDField({ type: 'Actor', nullable: true, initial: null }),
rules: new fields.SchemaField({