diff --git a/module/applications/sheets/items/domainCard.mjs b/module/applications/sheets/items/domainCard.mjs index 17a83f95..dd951be5 100644 --- a/module/applications/sheets/items/domainCard.mjs +++ b/module/applications/sheets/items/domainCard.mjs @@ -4,20 +4,56 @@ const { ItemSheetV2 } = foundry.applications.sheets; export default class DomainCardSheet extends DHItemSheetV2(ItemSheetV2) { static DEFAULT_OPTIONS = { classes: ['domain-card'], - position: { width: 450, height: 700 } + position: { width: 450, height: 700 }, + actions: { + addEffect: this.addEffect, + editEffect: this.editEffect, + removeEffect: this.removeEffect + } }; static PARTS = { header: { template: 'systems/daggerheart/templates/sheets/items/domainCard/header.hbs' }, tabs: { template: 'systems/daggerheart/templates/sheets/global/tabs/tab-navigation.hbs' }, description: { template: 'systems/daggerheart/templates/sheets/global/tabs/tab-description.hbs' }, + settings: { + template: 'systems/daggerheart/templates/sheets/items/domainCard/settings.hbs', + scrollable: ['.settings'] + }, actions: { template: 'systems/daggerheart/templates/sheets/global/tabs/tab-actions.hbs', scrollable: ['.actions'] }, - settings: { - template: 'systems/daggerheart/templates/sheets/items/domainCard/settings.hbs', - scrollable: ['.settings'] + effects: { + template: 'systems/daggerheart/templates/sheets/global/tabs/tab-effects.hbs', + scrollable: ['.effects'] } }; + + static TABS = { + ...super.TABS, + effects: { + active: false, + cssClass: '', + group: 'primary', + id: 'effects', + icon: null, + label: 'DAGGERHEART.Sheets.Feature.Tabs.Effects' + } + }; + + static async addEffect() { + await this.document.createEmbeddedDocuments('ActiveEffect', [ + { name: game.i18n.localize('DAGGERHEART.Feature.NewEffect') } + ]); + } + + static async editEffect(_, target) { + const effect = this.document.effects.get(target.dataset.effect); + effect.sheet.render(true); + } + + static async removeEffect(_, target) { + await this.document.effects.get(target.dataset.effect).delete(); + } } diff --git a/module/data/item/domainCard.mjs b/module/data/item/domainCard.mjs index dcafd0d9..f9ecca8a 100644 --- a/module/data/item/domainCard.mjs +++ b/module/data/item/domainCard.mjs @@ -16,10 +16,18 @@ export default class DHDomainCard extends BaseDataItem { const fields = foundry.data.fields; return { ...super.defineSchema(), - domain: new fields.StringField({ choices: SYSTEM.DOMAIN.domains, required: true, blank: true }), + domain: new fields.StringField({ + choices: SYSTEM.DOMAIN.domains, + required: true, + initial: SYSTEM.DOMAIN.domains.arcana.id + }), level: new fields.NumberField({ initial: 1, integer: true }), recallCost: new fields.NumberField({ initial: 0, integer: true }), - type: new fields.StringField({ choices: SYSTEM.DOMAIN.cardTypes, required: true, blank: true }), + type: new fields.StringField({ + choices: SYSTEM.DOMAIN.cardTypes, + required: true, + initial: SYSTEM.DOMAIN.cardTypes.ability.id + }), foundation: new fields.BooleanField({ initial: false }), inVault: new fields.BooleanField({ initial: false }), actions: new fields.ArrayField(new ActionField()) diff --git a/module/documents/activeEffect.mjs b/module/documents/activeEffect.mjs index 7bbf79e3..ce73441b 100644 --- a/module/documents/activeEffect.mjs +++ b/module/documents/activeEffect.mjs @@ -4,6 +4,10 @@ export default class DhActiveEffect extends ActiveEffect { return !this.parent.system.equipped; } + if (this.parent.type === 'domainCard') { + return this.parent.system.inVault; + } + return super.isSuppressed; } diff --git a/styles/daggerheart.css b/styles/daggerheart.css index 72459da7..c1824583 100755 --- a/styles/daggerheart.css +++ b/styles/daggerheart.css @@ -4071,6 +4071,9 @@ div.daggerheart.views.multiclass { gap: 10px; grid-template-columns: 1fr 1.5fr 1.5fr; } +.application.sheet.daggerheart.dh-style.class .tab.settings .fieldsets-section .drop-section { + width: 100%; +} .application.sheet.daggerheart.dh-style.class .tab.settings .list-items { margin-bottom: 10px; width: 100%; diff --git a/styles/less/items/class.less b/styles/less/items/class.less index a70b56d4..f8004d31 100644 --- a/styles/less/items/class.less +++ b/styles/less/items/class.less @@ -7,6 +7,10 @@ display: grid; gap: 10px; grid-template-columns: 1fr 1.5fr 1.5fr; + + .drop-section { + width: 100%; + } } .list-items { diff --git a/templates/sheets/actors/character/sidebar.hbs b/templates/sheets/actors/character/sidebar.hbs index f6589f62..8e4891dc 100644 --- a/templates/sheets/actors/character/sidebar.hbs +++ b/templates/sheets/actors/character/sidebar.hbs @@ -6,12 +6,12 @@

/

-

{{document.system.resources.hitPoints.max}}

+

{{document.system.resources.hitPoints.maxTotal}}

Health

@@ -22,12 +22,12 @@

/

-

{{document.system.resources.stress.max}}

+

{{document.system.resources.stress.maxTotal}}

Stress

diff --git a/templates/sheets/items/domainCard/settings.hbs b/templates/sheets/items/domainCard/settings.hbs index 4b3f2968..2a55fb88 100644 --- a/templates/sheets/items/domainCard/settings.hbs +++ b/templates/sheets/items/domainCard/settings.hbs @@ -7,11 +7,11 @@ {{localize tabs.settings.label}} {{localize "DAGGERHEART.Sheets.DomainCard.Type"}} - {{formField systemFields.type value=source.system.type localize=true blank=""}} + {{formField systemFields.type value=source.system.type localize=true}} {{localize "DAGGERHEART.Sheets.DomainCard.Foundation"}} {{formField systemFields.foundation value=source.system.foundation }} {{localize "DAGGERHEART.Sheets.DomainCard.Domain"}} - {{formField systemFields.domain value=source.system.domain localize=true blank=""}} + {{formField systemFields.domain value=source.system.domain localize=true}} {{localize "DAGGERHEART.Sheets.DomainCard.Level"}} {{formField systemFields.level value=source.system.level data-dtype="Number"}} {{localize "DAGGERHEART.Sheets.DomainCard.RecallCost"}} diff --git a/templates/sheets/items/subclass/header.hbs b/templates/sheets/items/subclass/header.hbs index 4e6d10e9..8459949b 100644 --- a/templates/sheets/items/subclass/header.hbs +++ b/templates/sheets/items/subclass/header.hbs @@ -4,7 +4,7 @@

{{localize 'TYPES.Item.subclass'}}

-

{{localize (concat 'DAGGERHEART.Abilities.' source.system.spellcastingTrait '.name')}}

+ {{#if source.system.spellcastingTrait}}

{{localize (concat 'DAGGERHEART.Abilities.' source.system.spellcastingTrait '.name')}}

{{/if}}
\ No newline at end of file