From 735ed4c2140f5a6e49e6001387cfc1a6fc475072 Mon Sep 17 00:00:00 2001 From: WBHarry <89362246+WBHarry@users.noreply.github.com> Date: Wed, 4 Feb 2026 07:11:18 +0100 Subject: [PATCH 01/18] [Fix] RollMessage Order (#1626) * Fixed so that the description message always comes first with the action workflow * Changed to instead render the description in the roll message * Made the action config title not get changed in d20rolldialog if it's not a trait roll * Initial chat message description design change * Revert "Initial chat message description design change" This reverts commit f4f5fd6c24d05c6967615fe8498a34aee739b1b3. * . --- module/applications/dialogs/d20RollDialog.mjs | 7 +- module/data/action/baseAction.mjs | 8 +- module/data/chat-message/actorRoll.mjs | 1 + module/data/fields/action/damageField.mjs | 2 + module/data/settings/Appearance.mjs | 2 +- module/dice/dhRoll.mjs | 15 +- module/documents/chatMessage.mjs | 2 + module/systemRegistration/handlebars.mjs | 1 + styles/less/ui/chat/action.less | 118 -------------- styles/less/ui/chat/chat.less | 153 ++++++++++++++++++ templates/ui/chat/parts/description-part.hbs | 11 ++ templates/ui/chat/roll.hbs | 8 +- 12 files changed, 201 insertions(+), 127 deletions(-) create mode 100644 templates/ui/chat/parts/description-part.hbs diff --git a/module/applications/dialogs/d20RollDialog.mjs b/module/applications/dialogs/d20RollDialog.mjs index 4a4b1556..8e79ba58 100644 --- a/module/applications/dialogs/d20RollDialog.mjs +++ b/module/applications/dialogs/d20RollDialog.mjs @@ -165,9 +165,10 @@ export default class D20RollDialog extends HandlebarsApplicationMixin(Applicatio } if (rest.hasOwnProperty('trait')) { this.config.roll.trait = rest.trait; - this.config.title = game.i18n.format('DAGGERHEART.UI.Chat.dualityRoll.abilityCheckTitle', { - ability: game.i18n.localize(abilities[this.config.roll.trait]?.label) - }); + if (!this.config.source.item) + this.config.title = game.i18n.format('DAGGERHEART.UI.Chat.dualityRoll.abilityCheckTitle', { + ability: game.i18n.localize(abilities[this.config.roll.trait]?.label) + }); } this.config.extraFormula = rest.extraFormula; this.render(); diff --git a/module/data/action/baseAction.mjs b/module/data/action/baseAction.mjs index e843027b..f6ffe75f 100644 --- a/module/data/action/baseAction.mjs +++ b/module/data/action/baseAction.mjs @@ -229,7 +229,7 @@ export default class DHBaseAction extends ActionMixin(foundry.abstract.DataModel if (Hooks.call(`${CONFIG.DH.id}.postUseAction`, this, config) === false) return; - if (this.chatDisplay) await this.toChat(); + if (this.chatDisplay && !config.actionChatMessageHandled) await this.toChat(); return config; } @@ -240,9 +240,13 @@ export default class DHBaseAction extends ActionMixin(foundry.abstract.DataModel * @returns {object} */ prepareBaseConfig(event) { + const isActor = this.item instanceof CONFIG.Actor.documentClass; + const actionTitle = game.i18n.localize(this.name); + const itemTitle = isActor || this.item.name === actionTitle ? '' : `${this.item.name} - `; + const config = { event, - title: `${this.item instanceof CONFIG.Actor.documentClass ? '' : `${this.item.name}: `}${game.i18n.localize(this.name)}`, + title: `${itemTitle}${actionTitle}`, source: { item: this.item._id, originItem: this.originItem, diff --git a/module/data/chat-message/actorRoll.mjs b/module/data/chat-message/actorRoll.mjs index 61262529..1ea7ff93 100644 --- a/module/data/chat-message/actorRoll.mjs +++ b/module/data/chat-message/actorRoll.mjs @@ -31,6 +31,7 @@ export default class DHActorRoll extends foundry.abstract.TypeDataModel { static defineSchema() { return { title: new fields.StringField(), + actionDescription: new fields.HTMLField(), roll: new fields.ObjectField(), targets: targetsField(), hasRoll: new fields.BooleanField({ initial: false }), diff --git a/module/data/fields/action/damageField.mjs b/module/data/fields/action/damageField.mjs index ef91c64e..56eb51e5 100644 --- a/module/data/fields/action/damageField.mjs +++ b/module/data/fields/action/damageField.mjs @@ -68,6 +68,8 @@ export default class DamageField extends fields.SchemaField { const damageResult = await CONFIG.Dice.daggerheart.DamageRoll.build(damageConfig); if (!damageResult) return false; + if (damageResult.actionChatMessageHandled) config.actionChatMessageHandled = true; + config.damage = damageResult.damage; config.message ??= damageConfig.message; } diff --git a/module/data/settings/Appearance.mjs b/module/data/settings/Appearance.mjs index d7a638d7..cd98d6f9 100644 --- a/module/data/settings/Appearance.mjs +++ b/module/data/settings/Appearance.mjs @@ -37,7 +37,7 @@ export default class DhAppearance extends foundry.abstract.DataModel { extendEnvironmentDescriptions: new BooleanField(), extendItemDescriptions: new BooleanField(), expandRollMessage: new SchemaField({ - desc: new BooleanField(), + desc: new BooleanField({ initial: true }), roll: new BooleanField(), damage: new BooleanField(), target: new BooleanField() diff --git a/module/dice/dhRoll.mjs b/module/dice/dhRoll.mjs index 1977c7ea..d8e5f6dd 100644 --- a/module/dice/dhRoll.mjs +++ b/module/dice/dhRoll.mjs @@ -96,6 +96,19 @@ export default class DHRoll extends Roll { } static async toMessage(roll, config) { + const item = config.data.parent?.items?.get?.(config.source.item) ?? null; + const action = item ? item.system.actions.get(config.source.action) : null; + let actionDescription = null; + if (action?.chatDisplay) { + actionDescription = action + ? await foundry.applications.ux.TextEditor.implementation.enrichHTML(action.description, { + relativeTo: config.data, + rollData: config.data.getRollData?.() ?? {} + }) + : null; + config.actionChatMessageHandled = true; + } + const cls = getDocumentClass('ChatMessage'), msgData = { type: this.messageType, @@ -103,7 +116,7 @@ export default class DHRoll extends Roll { title: roll.title, speaker: cls.getSpeaker({ actor: roll.data?.parent }), sound: config.mute ? null : CONFIG.sounds.dice, - system: config, + system: { ...config, actionDescription }, rolls: [roll] }; diff --git a/module/documents/chatMessage.mjs b/module/documents/chatMessage.mjs index 1d2c6c41..668ad06b 100644 --- a/module/documents/chatMessage.mjs +++ b/module/documents/chatMessage.mjs @@ -110,6 +110,8 @@ export default class DhpChatMessage extends foundry.documents.ChatMessage { } else if (s.classList.contains('damage-section')) s.classList.toggle('expanded', autoExpandRoll.damage); else if (s.classList.contains('target-section')) s.classList.toggle('expanded', autoExpandRoll.target); + else if (s.classList.contains('description-section')) + s.classList.toggle('expanded', autoExpandRoll.desc); }); if (itemDesc && autoExpandRoll.desc) itemDesc.setAttribute('open', ''); } diff --git a/module/systemRegistration/handlebars.mjs b/module/systemRegistration/handlebars.mjs index 97769181..ad8c741a 100644 --- a/module/systemRegistration/handlebars.mjs +++ b/module/systemRegistration/handlebars.mjs @@ -39,6 +39,7 @@ export const preloadHandlebarsTemplates = async function () { 'systems/daggerheart/templates/dialogs/downtime/activities.hbs', 'systems/daggerheart/templates/dialogs/dice-roll/costSelection.hbs', 'systems/daggerheart/templates/ui/chat/parts/roll-part.hbs', + 'systems/daggerheart/templates/ui/chat/parts/description-part.hbs', 'systems/daggerheart/templates/ui/chat/parts/damage-part.hbs', 'systems/daggerheart/templates/ui/chat/parts/target-part.hbs', 'systems/daggerheart/templates/ui/chat/parts/button-part.hbs', diff --git a/styles/less/ui/chat/action.less b/styles/less/ui/chat/action.less index a3d2f3cc..6eeb7a52 100644 --- a/styles/less/ui/chat/action.less +++ b/styles/less/ui/chat/action.less @@ -38,124 +38,6 @@ flex-direction: column; align-items: center; - details[open] { - .fa-chevron-down { - transform: rotate(180deg); - transition: all 0.3s ease; - } - } - - .action-move { - width: 100%; - - .fa-chevron-down { - transition: all 0.3s ease; - margin-left: auto; - } - - .action-section { - display: flex; - flex-direction: row; - align-items: center; - margin: 8px 8px 0; - padding-bottom: 5px; - width: -webkit-fill-available; - gap: 5px; - border-bottom: 1px solid @golden; - - &:hover { - background: @golden-10; - cursor: pointer; - transition: all 0.3s ease; - } - - .action-img { - width: 40px; - height: 40px; - border-radius: 3px; - object-fit: cover; - } - - .action-header { - display: flex; - flex-direction: column; - gap: 5px; - color: @beige; - - .title { - font-size: var(--font-size-20); - color: @golden; - font-weight: 700; - } - - .label { - font-size: var(--font-size-12); - color: @beige; - margin: 0; - } - } - } - } - - .description { - padding: 8px; - - .summons-header { - font-size: var(--font-size-14); - text-align: center; - display: flex; - align-items: center; - justify-content: center; - - span { - width: 100%; - } - - &:before, - &:after { - content: ' '; - height: 1px; - width: 100%; - } - - &:before { - background: linear-gradient(90deg, rgba(0, 0, 0, 0) 0%, light-dark(@dark-blue, @golden) 100%); - } - - &:after { - background: linear-gradient(90deg, light-dark(@dark-blue, @golden) 0%, rgba(0, 0, 0, 0) 100%); - } - } - - .summons-container { - display: flex; - flex-direction: column; - gap: 4px; - - .summon-container { - display: flex; - align-items: center; - justify-content: space-between; - - .summon-label-container { - flex: 1; - display: flex; - align-items: center; - gap: 4px; - - img { - height: 32px; - } - - label { - display: flex; - flex-wrap: wrap; - } - } - } - } - } - .ability-card-footer { display: flex; flex-wrap: wrap; diff --git a/styles/less/ui/chat/chat.less b/styles/less/ui/chat/chat.less index 494af5f1..8728fbda 100644 --- a/styles/less/ui/chat/chat.less +++ b/styles/less/ui/chat/chat.less @@ -228,6 +228,15 @@ font-size: var(--font-size-12); padding: 0 20px; + .roll-part-title { + text-align: center; + font-family: @font-subtitle; + font-size: var(--font-size-18); + font-weight: bold; + color: var(--text-color); + margin-bottom: -2px; + } + > .roll-part-header { font-size: var(--font-size-14); } @@ -286,6 +295,7 @@ > :first-child:not(.target-selector) { margin-top: 5px; + text-align: center; } > :last-child { @@ -573,6 +583,30 @@ } } + .chat-roll .description-section { + .roll-part-content { + .dice-tooltip { + .wrapper { + i { + margin: 0; + + :first-child { + margin-top: 0; + } + + :last-child { + margin-bottom: 0; + } + } + + > :first-child:not(.target-selector) { + margin: 0; + } + } + } + } + } + .roll-buttons { display: flex; gap: 5px; @@ -590,5 +624,124 @@ .dice-roll .dice-tooltip fieldset { margin-bottom: 5px; } + + details[open] { + .fa-chevron-down { + transform: rotate(180deg); + transition: all 0.3s ease; + } + } + + .action-move { + width: 100%; + + .fa-chevron-down { + transition: all 0.3s ease; + margin-left: auto; + } + + .action-section { + display: flex; + flex-direction: row; + align-items: center; + margin: 8px 8px 0; + padding-bottom: 5px; + width: -webkit-fill-available; + gap: 5px; + border-bottom: 1px solid @golden; + + &:hover { + background: @golden-10; + cursor: pointer; + transition: all 0.3s ease; + } + + .action-img { + width: 40px; + height: 40px; + border-radius: 3px; + object-fit: cover; + } + + .action-header { + display: flex; + flex-direction: column; + gap: 5px; + color: @beige; + + .title { + font-size: var(--font-size-20); + color: @golden; + font-weight: 700; + margin: 0; + } + + .label { + font-size: var(--font-size-12); + color: @beige; + margin: 0; + } + } + } + } + + .description { + padding: 8px; + + .summons-header { + font-size: var(--font-size-14); + text-align: center; + display: flex; + align-items: center; + justify-content: center; + + span { + width: 100%; + } + + &:before, + &:after { + content: ' '; + height: 1px; + width: 100%; + } + + &:before { + background: linear-gradient(90deg, rgba(0, 0, 0, 0) 0%, light-dark(@dark-blue, @golden) 100%); + } + + &:after { + background: linear-gradient(90deg, light-dark(@dark-blue, @golden) 0%, rgba(0, 0, 0, 0) 100%); + } + } + + .summons-container { + display: flex; + flex-direction: column; + gap: 4px; + + .summon-container { + display: flex; + align-items: center; + justify-content: space-between; + + .summon-label-container { + flex: 1; + display: flex; + align-items: center; + gap: 4px; + + img { + height: 32px; + } + + label { + display: flex; + flex-wrap: wrap; + } + } + } + } + } } } diff --git a/templates/ui/chat/parts/description-part.hbs b/templates/ui/chat/parts/description-part.hbs new file mode 100644 index 00000000..2e73a753 --- /dev/null +++ b/templates/ui/chat/parts/description-part.hbs @@ -0,0 +1,11 @@ +
Drop a smoke bomb that fi lls the air within Close range with smoke, Dizzying all targets in this area. Dizzied targets have disadvantage on their next action roll, then clear the condition.
@Template[type:emanation|range:c]
", + "description": "Drop a smoke bomb that fills the air within Close range with smoke, Dizzying all targets in this area. Dizzied targets have disadvantage on their next action roll, then clear the condition.
@Template[type:emanation|range:c]
", "resource": null, "actions": { "sp7RfJRQJsEUm09m": { diff --git a/src/packs/domains/domainCard_Bold_Presence_tdsL00yTSLNgZWs6.json b/src/packs/domains/domainCard_Bold_Presence_tdsL00yTSLNgZWs6.json index 08110cca..aaf070fc 100644 --- a/src/packs/domains/domainCard_Bold_Presence_tdsL00yTSLNgZWs6.json +++ b/src/packs/domains/domainCard_Bold_Presence_tdsL00yTSLNgZWs6.json @@ -110,7 +110,7 @@ "startRound": null, "startTurn": null }, - "description": "Add your Strength to the presence roll roll.
", + "description": "Add your Strength to the presence roll.
", "tint": "#ffffff", "statuses": [], "sort": 0, From c1f78665945adb9686a8aa2e7953a1b5580d417e Mon Sep 17 00:00:00 2001 From: WBHarry <89362246+WBHarry@users.noreply.github.com> Date: Fri, 6 Feb 2026 11:32:33 +0100 Subject: [PATCH 04/18] [Fix] 1633 - ActiveEffect Autocomplete (#1636) * Improved the autocomplete typing experience * Made it work. But I hate it. * Revert "Made it work. But I hate it." This reverts commit d2fc9fd6486c44eac6067994ba564227fece714d. * Actually nice solution instead O_O --- daggerheart.mjs | 32 ++++++++ lang/en.json | 1 + .../dialogs/attributionDialog.mjs | 6 +- .../dialogs/group-roll-dialog.mjs | 12 ++- .../sheets-configs/activeEffectConfig.mjs | 48 ++++++++---- .../setting-active-effect-config.mjs | 6 +- module/data/actor/adversary.mjs | 9 ++- module/data/actor/character.mjs | 21 +++--- module/data/fields/actorField.mjs | 24 +++--- module/data/levelData.mjs | 7 +- module/documents/token.mjs | 74 ++++--------------- styles/less/ux/autocomplete/autocomplete.less | 1 - 12 files changed, 139 insertions(+), 102 deletions(-) diff --git a/daggerheart.mjs b/daggerheart.mjs index f75ff1da..49ed7049 100644 --- a/daggerheart.mjs +++ b/daggerheart.mjs @@ -242,6 +242,38 @@ Hooks.on('setup', () => { systemEffect: true })) ]; + + const actorCommon = { + bar: ['resources.stress'], + value: [] + }; + const damageThresholds = ['damageThresholds.major', 'damageThresholds.severe']; + const traits = Object.keys(game.system.api.data.actors.DhCharacter.schema.fields.traits.fields).map( + trait => `traits.${trait}.value` + ); + CONFIG.Actor.trackableAttributes = { + character: { + bar: [...actorCommon.bar, 'resources.hitPoints', 'resources.hope'], + value: [ + ...actorCommon.value, + ...traits, + ...damageThresholds, + 'proficiency', + 'evasion', + 'armorScore', + 'scars', + 'levelData.level.current' + ] + }, + adversary: { + bar: [...actorCommon.bar, 'resources.hitPoints'], + value: [...actorCommon.value, ...damageThresholds, 'criticalThreshold'] + }, + companion: { + bar: [...actorCommon.bar], + value: [...actorCommon.value, 'evasion', 'levelData.level.current'] + } + }; }); Hooks.on('ready', async () => { diff --git a/lang/en.json b/lang/en.json index 0186ae3e..86b4323c 100755 --- a/lang/en.json +++ b/lang/en.json @@ -2152,6 +2152,7 @@ "continue": "Continue", "criticalSuccess": "Critical Success", "criticalShort": "Critical", + "currentLevel": "Current Level", "custom": "Custom", "d20Roll": "D20 Roll", "damage": "Damage", diff --git a/module/applications/dialogs/attributionDialog.mjs b/module/applications/dialogs/attributionDialog.mjs index 99ff261a..7f3f8bb2 100644 --- a/module/applications/dialogs/attributionDialog.mjs +++ b/module/applications/dialogs/attributionDialog.mjs @@ -54,7 +54,11 @@ export default class AttributionDialog extends HandlebarsApplicationMixin(Applic const after = label.slice(matchIndex + search.length, label.length); const element = document.createElement('li'); - element.innerHTML = `${beforeText}${matchText ? `${matchText}` : ''}${after}`; + element.innerHTML = + `${beforeText}${matchText ? `${matchText}` : ''}${after}`.replaceAll( + ' ', + ' ' + ); if (item.hint) { element.dataset.tooltip = game.i18n.localize(item.hint); } diff --git a/module/applications/dialogs/group-roll-dialog.mjs b/module/applications/dialogs/group-roll-dialog.mjs index 2cb79563..8a3c43d6 100644 --- a/module/applications/dialogs/group-roll-dialog.mjs +++ b/module/applications/dialogs/group-roll-dialog.mjs @@ -70,7 +70,11 @@ export default class GroupRollDialog extends HandlebarsApplicationMixin(Applicat element.appendChild(img); const label = document.createElement('span'); - label.innerHTML = `${beforeText}${matchText ? `${matchText}` : ''}${after}`; + label.innerHTML = + `${beforeText}${matchText ? `${matchText}` : ''}${after}`.replaceAll( + ' ', + ' ' + ); element.appendChild(label); return element; @@ -119,7 +123,11 @@ export default class GroupRollDialog extends HandlebarsApplicationMixin(Applicat element.appendChild(img); const label = document.createElement('span'); - label.innerHTML = `${beforeText}${matchText ? `${matchText}` : ''}${after}`; + label.innerHTML = + `${beforeText}${matchText ? `${matchText}` : ''}${after}`.replaceAll( + ' ', + ' ' + ); element.appendChild(label); return element; diff --git a/module/applications/sheets-configs/activeEffectConfig.mjs b/module/applications/sheets-configs/activeEffectConfig.mjs index d7b1b536..9b8edd8a 100644 --- a/module/applications/sheets-configs/activeEffectConfig.mjs +++ b/module/applications/sheets-configs/activeEffectConfig.mjs @@ -4,20 +4,34 @@ export default class DhActiveEffectConfig extends foundry.applications.sheets.Ac constructor(options) { super(options); - const ignoredActorKeys = ['config', 'DhEnvironment']; + const ignoredActorKeys = ['config', 'DhEnvironment', 'DhParty']; this.changeChoices = Object.keys(game.system.api.models.actors).reduce((acc, key) => { - if (!ignoredActorKeys.includes(key)) { - const model = game.system.api.models.actors[key]; - const attributes = CONFIG.Token.documentClass.getTrackedAttributes(model); - // As per DHToken._getTrackedAttributesFromSchema, attributes.bar have a max version as well. - const maxAttributes = attributes.bar.map(x => [...x, 'max']); - attributes.value.push(...maxAttributes); - const group = game.i18n.localize(model.metadata.label); - const choices = CONFIG.Token.documentClass - .getTrackedAttributeChoices(attributes, model) - .map(x => ({ ...x, group: group })); - acc.push(...choices); - } + if (ignoredActorKeys.includes(key)) return acc; + + const model = game.system.api.models.actors[key]; + const group = game.i18n.localize(model.metadata.label); + const attributes = CONFIG.Token.documentClass.getTrackedAttributes(model.metadata.type); + + const getLabel = path => { + const label = model.schema.getField(path)?.label; + return label ? game.i18n.localize(label) : path; + }; + + const bars = attributes.bar.flatMap(x => { + const joined = `${x.join('.')}.max`; + const label = + joined === 'resources.hope.max' + ? 'DAGGERHEART.SETTINGS.Homebrew.FIELDS.maxHope.label' + : getLabel(joined); + return { value: joined, label, group }; + }); + const values = attributes.value.flatMap(x => { + const joined = x.join('.'); + return { value: joined, label: getLabel(joined), group }; + }); + + acc.push(...bars, ...values); + return acc; }, []); } @@ -68,14 +82,18 @@ export default class DhActiveEffectConfig extends foundry.applications.sheets.Ac }, render: function (item, search) { const label = game.i18n.localize(item.label); - const matchIndex = label.toLowerCase().indexOf(search); + const matchIndex = label.toLowerCase().indexOf(search.toLowerCase()); const beforeText = label.slice(0, matchIndex); const matchText = label.slice(matchIndex, matchIndex + search.length); const after = label.slice(matchIndex + search.length, label.length); const element = document.createElement('li'); - element.innerHTML = `${beforeText}${matchText ? `${matchText}` : ''}${after}`; + element.innerHTML = + `${beforeText}${matchText ? `${matchText}` : ''}${after}`.replaceAll( + ' ', + ' ' + ); if (item.hint) { element.dataset.tooltip = game.i18n.localize(item.hint); } diff --git a/module/applications/sheets-configs/setting-active-effect-config.mjs b/module/applications/sheets-configs/setting-active-effect-config.mjs index ca0d56e3..fe36e37f 100644 --- a/module/applications/sheets-configs/setting-active-effect-config.mjs +++ b/module/applications/sheets-configs/setting-active-effect-config.mjs @@ -103,7 +103,11 @@ export default class SettingActiveEffectConfig extends HandlebarsApplicationMixi const after = label.slice(matchIndex + search.length, label.length); const element = document.createElement('li'); - element.innerHTML = `${beforeText}${matchText ? `${matchText}` : ''}${after}`; + element.innerHTML = + `${beforeText}${matchText ? `${matchText}` : ''}${after}`.replaceAll( + ' ', + ' ' + ); if (item.hint) { element.dataset.tooltip = game.i18n.localize(item.hint); } diff --git a/module/data/actor/adversary.mjs b/module/data/actor/adversary.mjs index 16e7e37a..f2c38090 100644 --- a/module/data/actor/adversary.mjs +++ b/module/data/actor/adversary.mjs @@ -40,7 +40,14 @@ export default class DhpAdversary extends BaseDataActor { integer: true, label: 'DAGGERHEART.GENERAL.hordeHp' }), - criticalThreshold: new fields.NumberField({ required: true, integer: true, min: 1, max: 20, initial: 20 }), + criticalThreshold: new fields.NumberField({ + required: true, + integer: true, + min: 1, + max: 20, + initial: 20, + label: 'DAGGERHEART.ACTIONS.Settings.criticalThreshold' + }), damageThresholds: new fields.SchemaField({ major: new fields.NumberField({ required: true, diff --git a/module/data/actor/character.mjs b/module/data/actor/character.mjs index 8af4c74c..3913d426 100644 --- a/module/data/actor/character.mjs +++ b/module/data/actor/character.mjs @@ -35,15 +35,18 @@ export default class DhCharacter extends BaseDataActor { 'DAGGERHEART.ACTORS.Character.maxHPBonus' ), stress: resourceField(6, 0, 'DAGGERHEART.GENERAL.stress', true), - hope: new fields.SchemaField({ - value: new fields.NumberField({ - initial: 2, - min: 0, - integer: true, - label: 'DAGGERHEART.GENERAL.hope' - }), - isReversed: new fields.BooleanField({ initial: false }) - }) + hope: new fields.SchemaField( + { + value: new fields.NumberField({ + initial: 2, + min: 0, + integer: true, + label: 'DAGGERHEART.GENERAL.hope' + }), + isReversed: new fields.BooleanField({ initial: false }) + }, + { label: 'DAGGERHEART.GENERAL.hope' } + ) }), traits: new fields.SchemaField({ agility: attributeField('DAGGERHEART.CONFIG.Traits.agility.name'), diff --git a/module/data/fields/actorField.mjs b/module/data/fields/actorField.mjs index f9eeeb90..db1faad4 100644 --- a/module/data/fields/actorField.mjs +++ b/module/data/fields/actorField.mjs @@ -7,16 +7,20 @@ const attributeField = label => }); const resourceField = (max = 0, initial = 0, label, reverse = false, maxLabel) => - new fields.SchemaField({ - value: new fields.NumberField({ initial: initial, min: 0, integer: true, label }), - max: new fields.NumberField({ - initial: max, - integer: true, - label: - maxLabel ?? game.i18n.format('DAGGERHEART.GENERAL.maxWithThing', { thing: game.i18n.localize(label) }) - }), - isReversed: new fields.BooleanField({ initial: reverse }) - }); + new fields.SchemaField( + { + value: new fields.NumberField({ initial: initial, min: 0, integer: true, label }), + max: new fields.NumberField({ + initial: max, + integer: true, + label: + maxLabel ?? + game.i18n.format('DAGGERHEART.GENERAL.maxWithThing', { thing: game.i18n.localize(label) }) + }), + isReversed: new fields.BooleanField({ initial: reverse }) + }, + { label } + ); const stressDamageReductionRule = localizationPath => new fields.SchemaField({ diff --git a/module/data/levelData.mjs b/module/data/levelData.mjs index 669077ee..4f55d9ee 100644 --- a/module/data/levelData.mjs +++ b/module/data/levelData.mjs @@ -6,7 +6,12 @@ export default class DhLevelData extends foundry.abstract.DataModel { return { level: new fields.SchemaField({ - current: new fields.NumberField({ required: true, integer: true, initial: 1 }), + current: new fields.NumberField({ + required: true, + integer: true, + initial: 1, + label: 'DAGGERHEART.GENERAL.currentLevel' + }), changed: new fields.NumberField({ required: true, integer: true, initial: 1 }), bonuses: new fields.TypedObjectField(new fields.NumberField({ integer: true, nullable: false })) }), diff --git a/module/documents/token.mjs b/module/documents/token.mjs index b9507c2f..6fd931d6 100644 --- a/module/documents/token.mjs +++ b/module/documents/token.mjs @@ -1,78 +1,30 @@ export default class DHToken extends CONFIG.Token.documentClass { - /** - * Inspect the Actor data model and identify the set of attributes which could be used for a Token Bar. - * @param {object} attributes The tracked attributes which can be chosen from - * @returns {object} A nested object of attribute choices to display - */ - static getTrackedAttributeChoices(attributes, model) { + /**@inheritdoc */ + static getTrackedAttributeChoices(attributes, typeKey) { attributes = attributes || this.getTrackedAttributes(); const barGroup = game.i18n.localize('TOKEN.BarAttributes'); const valueGroup = game.i18n.localize('TOKEN.BarValues'); + const actorModel = typeKey ? game.system.api.data.actors[`Dh${typeKey.capitalize()}`] : null; + const getLabel = path => { + const label = actorModel.schema.getField(path)?.label; + return label ? game.i18n.localize(label) : path; + }; const bars = attributes.bar.map(v => { const a = v.join('.'); - const modelLabel = model ? game.i18n.localize(model.schema.getField(`${a}.value`).label) : null; - return { group: barGroup, value: a, label: modelLabel ? modelLabel : a }; + return { group: barGroup, value: a, label: getLabel(a) }; }); - bars.sort((a, b) => a.label.compare(b.label)); + bars.sort((a, b) => a.value.compare(b.value)); - const invalidAttributes = [ - 'gold', - 'levelData', - 'actions', - 'biography', - 'class', - 'multiclass', - 'companion', - 'notes', - 'partner', - 'description', - 'impulses', - 'tier', - 'type' - ]; - const values = attributes.value.reduce((acc, v) => { + const values = attributes.value.map(v => { const a = v.join('.'); - if (invalidAttributes.some(x => a.startsWith(x))) return acc; - - const field = model ? model.schema.getField(a) : null; - const modelLabel = field ? game.i18n.localize(field.label) : null; - const hint = field ? game.i18n.localize(field.hint) : null; - acc.push({ group: valueGroup, value: a, label: modelLabel ? modelLabel : a, hint: hint }); - - return acc; - }, []); - values.sort((a, b) => a.label.compare(b.label)); + return { group: valueGroup, value: a, label: getLabel(a) }; + }); + values.sort((a, b) => a.value.compare(b.value)); return bars.concat(values); } - static _getTrackedAttributesFromSchema(schema, _path = []) { - const attributes = { bar: [], value: [] }; - for (const [name, field] of Object.entries(schema.fields)) { - const p = _path.concat([name]); - if (field instanceof foundry.data.fields.NumberField) attributes.value.push(p); - if (field instanceof foundry.data.fields.BooleanField && field.options.isAttributeChoice) - attributes.value.push(p); - if (field instanceof foundry.data.fields.StringField) attributes.value.push(p); - if (field instanceof foundry.data.fields.ArrayField) attributes.value.push(p); - const isSchema = field instanceof foundry.data.fields.SchemaField; - const isModel = field instanceof foundry.data.fields.EmbeddedDataField; - - if (isSchema || isModel) { - const schema = isModel ? field.model.schema : field; - const isBar = schema.has && schema.has('value') && schema.has('max'); - if (isBar) attributes.bar.push(p); - else { - const inner = this.getTrackedAttributes(schema, p); - attributes.bar.push(...inner.bar); - attributes.value.push(...inner.value); - } - } - } - return attributes; - } - _shouldRecordMovementHistory() { return false; } diff --git a/styles/less/ux/autocomplete/autocomplete.less b/styles/less/ux/autocomplete/autocomplete.less index 08854a53..7f799449 100644 --- a/styles/less/ux/autocomplete/autocomplete.less +++ b/styles/less/ux/autocomplete/autocomplete.less @@ -32,7 +32,6 @@ li[role='option'] { display: flex; align-items: center; - gap: 10px; font-size: var(--font-size-14); padding: 0 10px; cursor: pointer; From c3653e1b30ff35f2d8649788f9c898eaf2cf05ba Mon Sep 17 00:00:00 2001 From: alterNERDtive <53827887+alterNERDtive@users.noreply.github.com> Date: Sat, 7 Feb 2026 19:02:28 +0000 Subject: [PATCH 05/18] feat(dev): adds editorconfig (#1644) --- .editorconfig | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..8bbc2b52 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,3 @@ +[*] +indent_size = 4 +indent_style = spaces From cad3f533ad20ba8192658a1b6ff8c3e27e528ff4 Mon Sep 17 00:00:00 2001 From: alterNERDtive <53827887+alterNERDtive@users.noreply.github.com> Date: Sat, 7 Feb 2026 22:14:17 +0000 Subject: [PATCH 06/18] fix: restricts target amount for downtime actions (#1645) --- module/config/generalConfig.mjs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/module/config/generalConfig.mjs b/module/config/generalConfig.mjs index ae49c73e..5e5eecfb 100644 --- a/module/config/generalConfig.mjs +++ b/module/config/generalConfig.mjs @@ -236,6 +236,7 @@ export const defaultRestOptions = { actionType: 'action', chatDisplay: false, target: { + amount: 1, type: 'friendly' }, damage: { @@ -304,6 +305,7 @@ export const defaultRestOptions = { actionType: 'action', chatDisplay: false, target: { + amount: 1, type: 'friendly' }, damage: { @@ -349,6 +351,7 @@ export const defaultRestOptions = { actionType: 'action', chatDisplay: false, target: { + amount: 1, type: 'friendly' }, damage: { @@ -417,6 +420,7 @@ export const defaultRestOptions = { actionType: 'action', chatDisplay: false, target: { + amount: 1, type: 'friendly' }, damage: { From 5e7201bfe990a4c4df8eb91d4c12cae66bb59cd4 Mon Sep 17 00:00:00 2001 From: WBHarry <89362246+WBHarry@users.noreply.github.com> Date: Sun, 8 Feb 2026 17:59:08 +0100 Subject: [PATCH 07/18] [Fix]Environment Attack Error (#1647) * Fixed so that environment attacks don't error * Fixed for companion aswell --- module/data/fields/action/damageField.mjs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/data/fields/action/damageField.mjs b/module/data/fields/action/damageField.mjs index 56eb51e5..efad726c 100644 --- a/module/data/fields/action/damageField.mjs +++ b/module/data/fields/action/damageField.mjs @@ -109,8 +109,8 @@ export default class DamageField extends fields.SchemaField { ); else { const configDamage = foundry.utils.deepClone(config.damage); - const hpDamageMultiplier = config.actionActor?.system.rules.attack.damage.hpDamageMultiplier ?? 1; - const hpDamageTakenMultiplier = actor.system.rules.attack.damage.hpDamageTakenMultiplier; + const hpDamageMultiplier = config.actionActor?.system.rules?.attack?.damage?.hpDamageMultiplier ?? 1; + const hpDamageTakenMultiplier = actor.system.rules?.attack?.damage?.hpDamageTakenMultiplier; if (configDamage.hitPoints) { for (const part of configDamage.hitPoints.parts) { part.total = Math.ceil(part.total * hpDamageMultiplier * hpDamageTakenMultiplier); From 202e624a068718757088cf5a013499c748ce7fce Mon Sep 17 00:00:00 2001 From: WBHarry <89362246+WBHarry@users.noreply.github.com> Date: Sun, 8 Feb 2026 18:00:09 +0100 Subject: [PATCH 08/18] Fixed so that SecondWind has a decreasing resource (#1642) --- src/packs/domains/domainCard_Second_Wind_ffPbSEvLuFrFsMxl.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/packs/domains/domainCard_Second_Wind_ffPbSEvLuFrFsMxl.json b/src/packs/domains/domainCard_Second_Wind_ffPbSEvLuFrFsMxl.json index a8a21ec3..8dc535cc 100644 --- a/src/packs/domains/domainCard_Second_Wind_ffPbSEvLuFrFsMxl.json +++ b/src/packs/domains/domainCard_Second_Wind_ffPbSEvLuFrFsMxl.json @@ -170,7 +170,8 @@ "value": 1, "recovery": "shortRest", "max": "1", - "icon": "" + "icon": "", + "progression": "decreasing" }, "attribution": { "source": "Daggerheart SRD", From 44131d21a6170879a4cc6418c562636ea4a5cbee Mon Sep 17 00:00:00 2001 From: WBHarry <89362246+WBHarry@users.noreply.github.com> Date: Sun, 8 Feb 2026 18:01:30 +0100 Subject: [PATCH 09/18] [Fix] Beastform Effects (#1635) * Fixed so that beastform items always have a beastformEffect on them that can't be removed * Fixed so that you can drag an active effect onto a character --- .../sheets/api/application-mixin.mjs | 8 ++++++-- module/data/item/beastform.mjs | 16 ++++++++++++++++ module/documents/activeEffect.mjs | 5 +++-- .../sheets/global/partials/inventory-item-V2.hbs | 2 +- 4 files changed, 26 insertions(+), 5 deletions(-) diff --git a/module/applications/sheets/api/application-mixin.mjs b/module/applications/sheets/api/application-mixin.mjs index 3c0444eb..49f7dcf0 100644 --- a/module/applications/sheets/api/application-mixin.mjs +++ b/module/applications/sheets/api/application-mixin.mjs @@ -433,7 +433,7 @@ export default function DHApplicationMixin(Base) { icon: 'fa-solid fa-lightbulb', condition: target => { const doc = getDocFromElementSync(target); - return doc && !doc.disabled; + return doc && !doc.disabled && doc.type !== 'beastform'; }, callback: async target => (await getDocFromElement(target)).update({ disabled: true }) }, @@ -442,7 +442,7 @@ export default function DHApplicationMixin(Base) { icon: 'fa-regular fa-lightbulb', condition: target => { const doc = getDocFromElementSync(target); - return doc && doc.disabled; + return doc && doc.disabled && doc.type !== 'beastform'; }, callback: async target => (await getDocFromElement(target)).update({ disabled: false }) } @@ -536,6 +536,10 @@ export default function DHApplicationMixin(Base) { options.push({ name: 'CONTROLS.CommonDelete', icon: 'fa-solid fa-trash', + condition: target => { + const doc = getDocFromElementSync(target); + return doc && doc.type !== 'beastform'; + }, callback: async (target, event) => { const doc = await getDocFromElement(target); if (event.shiftKey) return doc.delete(); diff --git a/module/data/item/beastform.mjs b/module/data/item/beastform.mjs index dd491169..3a41aa7e 100644 --- a/module/data/item/beastform.mjs +++ b/module/data/item/beastform.mjs @@ -253,4 +253,20 @@ export default class DHBeastform extends BaseDataItem { return false; } + + _onCreate(_data, _options, userId) { + if (!this.actor && game.user.id === userId) { + const hasBeastformEffect = this.parent.effects.some(x => x.type === 'beastform'); + if (!hasBeastformEffect) + this.parent.createEmbeddedDocuments('ActiveEffect', [ + { + type: 'beastform', + name: game.i18n.localize('DAGGERHEART.ITEMS.Beastform.beastformEffect'), + img: 'icons/creatures/abilities/paw-print-pair-purple.webp' + } + ]); + + return; + } + } } diff --git a/module/documents/activeEffect.mjs b/module/documents/activeEffect.mjs index 5e9b0c3b..d0e329ff 100644 --- a/module/documents/activeEffect.mjs +++ b/module/documents/activeEffect.mjs @@ -61,14 +61,15 @@ export default class DhActiveEffect extends foundry.documents.ActiveEffect { update.img = 'icons/magic/life/heart-cross-blue.webp'; } + const statuses = Object.keys(data.statuses ?? {}); const immuneStatuses = - data.statuses?.filter( + statuses.filter( status => this.parent.system.rules?.conditionImmunities && this.parent.system.rules.conditionImmunities[status] ) ?? []; if (immuneStatuses.length > 0) { - update.statuses = data.statuses.filter(x => !immuneStatuses.includes(x)); + update.statuses = statuses.filter(x => !immuneStatuses.includes(x)); const conditions = CONFIG.DH.GENERAL.conditions(); const scrollingTexts = immuneStatuses.map(status => ({ text: game.i18n.format('DAGGERHEART.ACTIVEEFFECT.immuneStatusText', { diff --git a/templates/sheets/global/partials/inventory-item-V2.hbs b/templates/sheets/global/partials/inventory-item-V2.hbs index dbacd1e4..76e13a5c 100644 --- a/templates/sheets/global/partials/inventory-item-V2.hbs +++ b/templates/sheets/global/partials/inventory-item-V2.hbs @@ -113,7 +113,7 @@ Parameters: data-tooltip="DAGGERHEART.UI.Tooltip.{{ifThen item.system.inVault 'sendToLoadout' 'sendToVault' }}"> - {{else if (eq type 'effect')}} + {{else if (and (eq type 'effect') (not (eq item.type 'beastform')))}} From f7e4c5346effe775250db51770cf4a6ae22cfb5d Mon Sep 17 00:00:00 2001 From: WBHarry <89362246+WBHarry@users.noreply.github.com> Date: Sun, 8 Feb 2026 18:03:35 +0100 Subject: [PATCH 10/18] [Fix] ActiveEffect Autocomplete (#1641) * Added rules and bonuses to ActiveEffect-autocomplete * . --- lang/en.json | 49 +++++++++++++++++++ .../sheets-configs/activeEffectConfig.mjs | 23 ++++++++- module/data/actor/base.mjs | 43 +++++++++++++--- module/data/actor/character.mjs | 25 +++++++--- module/data/actor/companion.mjs | 15 ++++-- 5 files changed, 137 insertions(+), 18 deletions(-) diff --git a/lang/en.json b/lang/en.json index 86b4323c..81408c66 100755 --- a/lang/en.json +++ b/lang/en.json @@ -192,6 +192,9 @@ }, "age": "Age", "backgroundQuestions": "Backgrounds", + "burden": { + "ignore": { "label": "Burden: Ignore", "hint": "Ignore burden rules" } + }, "companionFeatures": "Companion Features", "connections": "Connections", "contextMenu": { @@ -214,6 +217,12 @@ "maxEvasionBonus": "Max Evasion Increase", "maxHPBonus": "Max HP Increase", "pronouns": "Pronouns", + "roll": { + "guaranteedCritical": { + "label": "Guaranteed Critical", + "hint": "Set to 1 to always roll a critical" + } + }, "story": { "backgroundTitle": "Background", "characteristics": "Characteristics", @@ -1840,6 +1849,16 @@ "singular": "Adversary", "plural": "Adversaries" }, + "Attack": { + "hpDamageMultiplier": { + "label": "HP Damage Multiplier", + "hint": "Multiply any damage you deal by this number" + }, + "hpDamageTakenMultiplier": { + "label": "HP Damage Taken Multiplier", + "hint": "Multiply any damage dealt to you by this number" + } + }, "Bonuses": { "rest": { "downtimeAction": "Downtime Action", @@ -2024,16 +2043,40 @@ "reaction": "Reaction Roll" }, "Rules": { + "conditionImmunities": { + "hidden": "Condition Immunity: Hidden", + "restrained": "Condition Immunity: Restrained", + "vulnerable": "Condition Immunity: Vulnerable" + }, "damageReduction": { + "disabledArmor": { "label": "Disabled Armorslots" }, "increasePerArmorMark": { "label": "Damage Reduction per Armor Slot", "hint": "A used armor slot normally reduces damage by one step. This value increases the number of steps damage is reduced by." }, + "magical": { + "label": "Daamge Reduction: Only Magical", + "hint": "Armor can only be used to reduce magical damage" + }, "maxArmorMarkedBonus": "Max Armor Used", "maxArmorMarkedStress": { "label": "Max Armor Used With Stress", "hint": "If this value is set you can use up to that much stress to spend additional Armor Marks beyond your normal maximum." }, + "reduceSeverity": { + "magical": { + "label": "Reduce Damage Severity: Magical", + "hint": "Lowers any magical damage received by the set amount of severity degrees" + }, + "physical": { + "label": "Reduce Damage Severity: Physical", + "hint": "Lowers any physical damage received by the set amount of severity degrees" + } + }, + "physical": { + "label": "Damage Reduction: Only Physical", + "hint": "Armor can only be used to reduce physical damage" + }, "stress": { "any": { "label": "Stress Damage Reduction: Any", @@ -2051,6 +2094,12 @@ "label": "Stress Damage Reduction: Minor", "hint": "The cost in stress you can pay to reduce minor damage to none." } + }, + "thresholdImmunities": { + "minor": { + "label": "Threshold Immunities: Minor", + "hint": "Automatically ignores minor damage" + } } }, "attack": { diff --git a/module/applications/sheets-configs/activeEffectConfig.mjs b/module/applications/sheets-configs/activeEffectConfig.mjs index 9b8edd8a..8abc0b79 100644 --- a/module/applications/sheets-configs/activeEffectConfig.mjs +++ b/module/applications/sheets-configs/activeEffectConfig.mjs @@ -5,6 +5,24 @@ export default class DhActiveEffectConfig extends foundry.applications.sheets.Ac super(options); const ignoredActorKeys = ['config', 'DhEnvironment', 'DhParty']; + + const getAllLeaves = (root, group, parentPath = '') => { + const leaves = []; + const rootKey = `${parentPath ? `${parentPath}.` : ''}${root.name}`; + for (const field of Object.values(root.fields)) { + if (field instanceof foundry.data.fields.SchemaField) + leaves.push(...getAllLeaves(field, group, rootKey)); + else + leaves.push({ + value: `${rootKey}.${field.name}`, + label: game.i18n.localize(field.label), + hint: game.i18n.localize(field.hint), + group + }); + } + + return leaves; + }; this.changeChoices = Object.keys(game.system.api.models.actors).reduce((acc, key) => { if (ignoredActorKeys.includes(key)) return acc; @@ -30,7 +48,10 @@ export default class DhActiveEffectConfig extends foundry.applications.sheets.Ac return { value: joined, label: getLabel(joined), group }; }); - acc.push(...bars, ...values); + const bonuses = getAllLeaves(model.schema.fields.bonuses, group); + const rules = getAllLeaves(model.schema.fields.rules, group); + + acc.push(...bars, ...values, ...rules, ...bonuses); return acc; }, []); diff --git a/module/data/actor/base.mjs b/module/data/actor/base.mjs index 08308eab..5e16bac9 100644 --- a/module/data/actor/base.mjs +++ b/module/data/actor/base.mjs @@ -29,17 +29,40 @@ const resistanceField = (resistanceLabel, immunityLabel, reductionLabel) => /* Common rules applying to Characters and Adversaries */ export const commonActorRules = (extendedData = { damageReduction: {}, attack: { damage: {} } }) => ({ conditionImmunities: new fields.SchemaField({ - hidden: new fields.BooleanField({ initial: false }), - restrained: new fields.BooleanField({ initial: false }), - vulnerable: new fields.BooleanField({ initial: false }) + hidden: new fields.BooleanField({ + initial: false, + label: 'DAGGERHEART.GENERAL.Rules.conditionImmunities.hidden' + }), + restrained: new fields.BooleanField({ + initial: false, + label: 'DAGGERHEART.GENERAL.Rules.conditionImmunities.restrained' + }), + vulnerable: new fields.BooleanField({ + initial: false, + label: 'DAGGERHEART.GENERAL.Rules.conditionImmunities.vulnerable' + }) }), damageReduction: new fields.SchemaField({ thresholdImmunities: new fields.SchemaField({ - minor: new fields.BooleanField({ initial: false }) + minor: new fields.BooleanField({ + initial: false, + label: 'DAGGERHEART.GENERAL.Rules.damageReduction.thresholdImmunities.minor.label', + hint: 'DAGGERHEART.GENERAL.Rules.damageReduction.thresholdImmunities.minor.hint' + }) }), reduceSeverity: new fields.SchemaField({ - magical: new fields.NumberField({ initial: 0, min: 0 }), - physical: new fields.NumberField({ initial: 0, min: 0 }) + magical: new fields.NumberField({ + initial: 0, + min: 0, + label: 'DAGGERHEART.GENERAL.Rules.damageReduction.reduceSeverity.magical.label', + hint: 'DAGGERHEART.GENERAL.Rules.damageReduction.reduceSeverity.magical.hint' + }), + physical: new fields.NumberField({ + initial: 0, + min: 0, + label: 'DAGGERHEART.GENERAL.Rules.damageReduction.reduceSeverity.physical.label', + hint: 'DAGGERHEART.GENERAL.Rules.damageReduction.reduceSeverity.physical.hint' + }) }), ...(extendedData.damageReduction ?? {}) }), @@ -49,12 +72,16 @@ export const commonActorRules = (extendedData = { damageReduction: {}, attack: { hpDamageMultiplier: new fields.NumberField({ required: true, nullable: false, - initial: 1 + initial: 1, + label: 'DAGGERHEART.GENERAL.Attack.hpDamageMultiplier.label', + hint: 'DAGGERHEART.GENERAL.Attack.hpDamageMultiplier.hint' }), hpDamageTakenMultiplier: new fields.NumberField({ required: true, nullable: false, - initial: 1 + initial: 1, + label: 'DAGGERHEART.GENERAL.Attack.hpDamageTakenMultiplier.label', + hint: 'DAGGERHEART.GENERAL.Attack.hpDamageTakenMultiplier.hint' }), ...(extendedData.attack?.damage ?? {}) }) diff --git a/module/data/actor/character.mjs b/module/data/actor/character.mjs index 3913d426..c79bb078 100644 --- a/module/data/actor/character.mjs +++ b/module/data/actor/character.mjs @@ -225,8 +225,16 @@ export default class DhCharacter extends BaseDataActor { rules: new fields.SchemaField({ ...commonActorRules({ damageReduction: { - magical: new fields.BooleanField({ initial: false }), - physical: new fields.BooleanField({ initial: false }), + magical: new fields.BooleanField({ + initial: false, + label: 'DAGGERHEART.GENERAL.Rules.damageReduction.magical.label', + hint: 'DAGGERHEART.GENERAL.Rules.damageReduction.magical.hint' + }), + physical: new fields.BooleanField({ + initial: false, + label: 'DAGGERHEART.GENERAL.Rules.damageReduction.physical.label', + hint: 'DAGGERHEART.GENERAL.Rules.damageReduction.physical.hint' + }), maxArmorMarked: new fields.SchemaField({ value: new fields.NumberField({ required: true, @@ -256,7 +264,10 @@ export default class DhCharacter extends BaseDataActor { label: 'DAGGERHEART.GENERAL.Rules.damageReduction.increasePerArmorMark.label', hint: 'DAGGERHEART.GENERAL.Rules.damageReduction.increasePerArmorMark.hint' }), - disabledArmor: new fields.BooleanField({ intial: false }) + disabledArmor: new fields.BooleanField({ + intial: false, + label: 'DAGGERHEART.GENERAL.Rules.damageReduction.disabledArmor.label' + }) }, attack: { damage: { @@ -304,12 +315,14 @@ export default class DhCharacter extends BaseDataActor { label: 'DAGGERHEART.ACTORS.Character.defaultFearDice' }) }), - runeWard: new fields.BooleanField({ initial: false }), burden: new fields.SchemaField({ - ignore: new fields.BooleanField() + ignore: new fields.BooleanField({ label: 'DAGGERHEART.ACTORS.Character.burden.ignore.label' }) }), roll: new fields.SchemaField({ - guaranteedCritical: new fields.BooleanField() + guaranteedCritical: new fields.BooleanField({ + label: 'DAGGERHEART.ACTORS.Character.roll.guaranteedCritical.label', + hint: 'DAGGERHEART.ACTORS.Character.roll.guaranteedCritical.hint' + }) }) }) }; diff --git a/module/data/actor/companion.mjs b/module/data/actor/companion.mjs index 1c25b48c..40cece72 100644 --- a/module/data/actor/companion.mjs +++ b/module/data/actor/companion.mjs @@ -53,9 +53,18 @@ export default class DhCompanion extends BaseDataActor { ), rules: new fields.SchemaField({ conditionImmunities: new fields.SchemaField({ - hidden: new fields.BooleanField({ initial: false }), - restrained: new fields.BooleanField({ initial: false }), - vulnerable: new fields.BooleanField({ initial: false }) + hidden: new fields.BooleanField({ + initial: false, + label: 'DAGGERHEART.GENERAL.Rules.conditionImmunities.hidden' + }), + restrained: new fields.BooleanField({ + initial: false, + label: 'DAGGERHEART.GENERAL.Rules.conditionImmunities.restrained' + }), + vulnerable: new fields.BooleanField({ + initial: false, + label: 'DAGGERHEART.GENERAL.Rules.conditionImmunities.vulnerable' + }) }) }), attack: new ActionField({ From 4ad8b960b53cf23f8e56e1906aafb5050cbb46c6 Mon Sep 17 00:00:00 2001 From: alterNERDtive <53827887+alterNERDtive@users.noreply.github.com> Date: Sun, 8 Feb 2026 17:30:32 +0000 Subject: [PATCH 11/18] fix: adds actions to prepare downtime actions (#1646) --- lang/en.json | 8 +++ module/config/generalConfig.mjs | 102 +++++++++++++++++++++++++++++++- 2 files changed, 108 insertions(+), 2 deletions(-) diff --git a/lang/en.json b/lang/en.json index 81408c66..0eab2dbc 100755 --- a/lang/en.json +++ b/lang/en.json @@ -455,6 +455,10 @@ "description": "Describe how you are preparing for the next day's adventure, then gain a Hope. If you choose to Prepare with one or more members of your party, you may each take two Hope.", "name": "Prepare" }, + "prepareWithFriends": { + "description": "Describe how you are preparing for the next day's adventure, then gain a Hope. If you choose to Prepare with one or more members of your party, you may each take two Hope.", + "name": "Prepare (with Friends)" + }, "repairArmor": { "description": "Describe how you spend time repairing your armor and clear all of its Armor Slots. You may also do this to an ally's armor instead.", "name": "Repair Armor" @@ -486,6 +490,10 @@ "prepare": { "name": "Prepare", "description": "Describe how you prepare yourself for the path ahead, then gain a Hope. If you choose to Prepare with one or more members of your party, you each gain 2 Hope." + }, + "prepareWithFriends": { + "name": "Prepare (with Friends)", + "description": "Describe how you prepare yourself for the path ahead, then gain a Hope. If you choose to Prepare with one or more members of your party, you each gain 2 Hope." } }, "refreshable": { diff --git a/module/config/generalConfig.mjs b/module/config/generalConfig.mjs index 5e5eecfb..a38d1c8a 100644 --- a/module/config/generalConfig.mjs +++ b/module/config/generalConfig.mjs @@ -331,7 +331,56 @@ export const defaultRestOptions = { icon: 'fa-solid fa-dumbbell', img: 'icons/skills/trades/academics-merchant-scribe.webp', description: game.i18n.localize('DAGGERHEART.APPLICATIONS.Downtime.shortRest.prepare.description'), - actions: {}, + actions: { + prepare: { + type: 'healing', + systemPath: 'restMoves.shortRest.moves.prepare.actions', + name: game.i18n.localize('DAGGERHEART.APPLICATIONS.Downtime.shortRest.prepare.name'), + img: 'icons/skills/trades/academics-merchant-scribe.webp', + actionType: 'action', + chatDisplay: false, + target: { + type: 'self' + }, + damage: { + parts: [ + { + applyTo: healingTypes.hope.id, + value: { + custom: { + enabled: true, + formula: '1' + } + } + } + ] + } + }, + prepareWithFriends: { + type: 'healing', + systemPath: 'restMoves.shortRest.moves.prepare.actions', + name: game.i18n.localize('DAGGERHEART.APPLICATIONS.Downtime.shortRest.prepareWithFriends.name'), + img: 'icons/skills/trades/academics-merchant-scribe.webp', + actionType: 'action', + chatDisplay: false, + target: { + type: 'self' + }, + damage: { + parts: [ + { + applyTo: healingTypes.hope.id, + value: { + custom: { + enabled: true, + formula: '2' + } + } + } + ] + } + } + }, effects: [] } }), @@ -446,7 +495,56 @@ export const defaultRestOptions = { icon: 'fa-solid fa-dumbbell', img: 'icons/skills/trades/academics-merchant-scribe.webp', description: game.i18n.localize('DAGGERHEART.APPLICATIONS.Downtime.longRest.prepare.description'), - actions: {}, + actions: { + prepare: { + type: 'healing', + systemPath: 'restMoves.longRest.moves.prepare.actions', + name: game.i18n.localize('DAGGERHEART.APPLICATIONS.Downtime.longRest.prepare.name'), + img: 'icons/skills/trades/academics-merchant-scribe.webp', + actionType: 'action', + chatDisplay: false, + target: { + type: 'self' + }, + damage: { + parts: [ + { + applyTo: healingTypes.hope.id, + value: { + custom: { + enabled: true, + formula: '1' + } + } + } + ] + } + }, + prepareWithFriends: { + type: 'healing', + systemPath: 'restMoves.longRest.moves.prepare.actions', + name: game.i18n.localize('DAGGERHEART.APPLICATIONS.Downtime.longRest.prepareWithFriends.name'), + img: 'icons/skills/trades/academics-merchant-scribe.webp', + actionType: 'action', + chatDisplay: false, + target: { + type: 'self' + }, + damage: { + parts: [ + { + applyTo: healingTypes.hope.id, + value: { + custom: { + enabled: true, + formula: '2' + } + } + } + ] + } + } + }, effects: [] }, workOnAProject: { From 78012be6e42a5ee53726684235dde9bf41b8b2ce Mon Sep 17 00:00:00 2001 From: WBHarry