From 3a8d5285cf1bcdb62fa9c65f6cfba724eb94b6f8 Mon Sep 17 00:00:00 2001 From: Samuel Lopez Date: Mon, 23 Feb 2026 13:36:41 +0100 Subject: [PATCH 1/7] fix (#355): save physical description --- CHANGELOG.md | 6 ++++++ module/data/actor/agent.js | 2 +- module/sheets/agent-sheet.js | 25 ------------------------- module/sheets/base-actor-sheet.js | 2 +- 4 files changed, 8 insertions(+), 27 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9c3e2b2..0001e0d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,12 @@ - [#283](https://github.com/deltagreen-foundryvtt/delta-green-foundry-vtt-system/issues/283) - Added new actor sheet with left hand Sidebar RFC - [#291](https://github.com/deltagreen-foundryvtt/delta-green-foundry-vtt-system/issues/291) - Moving Luck button from three dots to left hand panel +## Version 1.6.6 - 2026-02-XX + +### **Bug Fixes:** + +- [#355](https://github.com/deltagreen-foundryvtt/delta-green-foundry-vtt-system/issues/355) - Save the physical description of an agent. + ## Version 1.6.5 - 2026-02-17 ### **Features:** diff --git a/module/data/actor/agent.js b/module/data/actor/agent.js index 222914e..1797bf1 100644 --- a/module/data/actor/agent.js +++ b/module/data/actor/agent.js @@ -30,7 +30,7 @@ export default class AgentData extends CharacterData { }), physical: new SchemaField({ description: new StringField({ - initial: "(Physical description of agent)", + initial: "", }), wounds: new StringField({ initial: "" }), firstAidAttempted: new BooleanField({ initial: false }), diff --git a/module/sheets/agent-sheet.js b/module/sheets/agent-sheet.js index a09b7e2..cd406dd 100644 --- a/module/sheets/agent-sheet.js +++ b/module/sheets/agent-sheet.js @@ -63,31 +63,6 @@ export default class DGAgentSheet extends DGActorSheet { /* -------------------------------------------- */ - /** @override */ - async _prepareContext(options) { - const context = await super._prepareContext(options); - - const enrichedDescription = - await foundry.applications.ux.TextEditor.implementation.enrichHTML( - this.actor.system.physicalDescription, - { - rollData: this.document.getRollData(), - relativeTo: this.document, - }, - ); - const { HTMLProseMirrorElement } = foundry.applications.elements; - context.descriptionField = HTMLProseMirrorElement.create({ - name: "system.physicalDescription", - value: this.actor.system.physicalDescription, - enriched: enrichedDescription, - toggled: true, - }).outerHTML; - - return context; - } - - /* -------------------------------------------- */ - /** * Resets the actor's current breaking point by recalculating it as the difference * between the actor's sanity value and POW value, ensuring it is non-negative, diff --git a/module/sheets/base-actor-sheet.js b/module/sheets/base-actor-sheet.js index 40deaa7..cac09a2 100644 --- a/module/sheets/base-actor-sheet.js +++ b/module/sheets/base-actor-sheet.js @@ -280,7 +280,7 @@ export default class DGActorSheet extends DGSheetMixin(ActorSheetV2) { switch (this.actor.type) { case "agent": - descriptionPath = "system.physicalDescription"; + descriptionPath = "system.physical.description"; break; case "npc": case "unnatural": From b5bef85fbe189d06a0519f8d3cacdac77a7c4e29 Mon Sep 17 00:00:00 2001 From: Samuel Lopez Date: Sat, 7 Mar 2026 09:18:33 +0100 Subject: [PATCH 2/7] fix (#359): save profession npc --- CHANGELOG.md | 3 ++- module/data/actor/npc.js | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0001e0d..d1bbffd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,11 +12,12 @@ - [#283](https://github.com/deltagreen-foundryvtt/delta-green-foundry-vtt-system/issues/283) - Added new actor sheet with left hand Sidebar RFC - [#291](https://github.com/deltagreen-foundryvtt/delta-green-foundry-vtt-system/issues/291) - Moving Luck button from three dots to left hand panel -## Version 1.6.6 - 2026-02-XX +## Version 1.6.6 - 2026-03-XX ### **Bug Fixes:** - [#355](https://github.com/deltagreen-foundryvtt/delta-green-foundry-vtt-system/issues/355) - Save the physical description of an agent. +- [#359](https://github.com/deltagreen-foundryvtt/delta-green-foundry-vtt-system/issues/359) - Save the profession of an NPC. ## Version 1.6.5 - 2026-02-17 diff --git a/module/data/actor/npc.js b/module/data/actor/npc.js index ff67ffd..623d360 100644 --- a/module/data/actor/npc.js +++ b/module/data/actor/npc.js @@ -16,6 +16,9 @@ export default class NPCData extends CharacterData { value: new NumberField({ initial: 100 }), currentBreakingPoint: new NumberField({ initial: 101 }), }), + biography: new SchemaField({ + profession: new StringField({ initial: "" }), + }), notes: new StringField({ initial: "" }), shortDescription: new StringField({ initial: "" }), showUntrainedSkills: new BooleanField({ initial: true }), From 328c121e9b4195144a8795ebfcde83e9f3305480 Mon Sep 17 00:00:00 2001 From: jalensailin Date: Sun, 8 Mar 2026 18:18:13 -0400 Subject: [PATCH 3/7] Don't register new sheet yet --- module/deltagreen.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/module/deltagreen.js b/module/deltagreen.js index 9d3f03a..63f12f7 100644 --- a/module/deltagreen.js +++ b/module/deltagreen.js @@ -86,12 +86,13 @@ Hooks.once("init", async () => { }); }); - Actors.registerSheet(DG.ID, DGAgentSheetV2, { - makeDefault: false, - themes: null, - label: `Agent Sheet V2`, - types: ["agent"], - }); + // Don't register new sheet yet. + // Actors.registerSheet(DG.ID, DGAgentSheetV2, { + // makeDefault: false, + // themes: null, + // label: `Agent Sheet V2`, + // types: ["agent"], + // }); // Register item sheet. Items.registerSheet(DG.ID, DeltaGreenItemSheet, { From 01cc0f9d085e94c3c31caca21db6ad00c8bf5b3a Mon Sep 17 00:00:00 2001 From: jalensailin Date: Sun, 8 Mar 2026 18:49:17 -0400 Subject: [PATCH 4/7] Fix error in saving vehicle sheet; By restricting unnatural logic to to unnatural sheets only --- module/sheets/base-actor-sheet.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/module/sheets/base-actor-sheet.js b/module/sheets/base-actor-sheet.js index cac09a2..5b2b651 100644 --- a/module/sheets/base-actor-sheet.js +++ b/module/sheets/base-actor-sheet.js @@ -63,6 +63,28 @@ export default class DGActorSheet extends DGSheetMixin(ActorSheetV2) { }, }); + /** @override */ + async _processSubmitData(event, form, submitData, options) { + const submittedData = foundry.utils.expandObject(submitData); + + if (this.actor.type !== "unnatural") + return super._processSubmitData(event, form, submittedData, options); + + // we need to update max WP if POW has changed (only for unnatural, but doesn't hurt others) + submittedData.system.wp.maxNeedsUpdate = + submittedData.system?.statistics.pow.value !== + this.actor.system.statistics.pow.value; + + // we need to update max HP if STR or CON have changed (only for unnatural, but doesn't hurt others) + submittedData.system.health.maxNeedsUpdate = + submittedData.system?.statistics.str.value !== + this.actor.system.statistics.str.value || + submittedData.system?.statistics.con.value !== + this.actor.system.statistics.con.value; + + return super._processSubmitData(event, form, submittedData, options); + } + /** @override */ async _prepareContext(options) { const context = await super._prepareContext(options); From 6764ae9d9e4e5efe8005866ecdbf15339f9b8882 Mon Sep 17 00:00:00 2001 From: jalensailin Date: Sun, 8 Mar 2026 18:51:34 -0400 Subject: [PATCH 5/7] First Aid misspelled in stat-parser-macro.js --- CHANGELOG.md | 1 + module/other/stat-parser-macro.js | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d1bbffd..2df8c8c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ - [#355](https://github.com/deltagreen-foundryvtt/delta-green-foundry-vtt-system/issues/355) - Save the physical description of an agent. - [#359](https://github.com/deltagreen-foundryvtt/delta-green-foundry-vtt-system/issues/359) - Save the profession of an NPC. +- [#363](https://github.com/deltagreen-foundryvtt/delta-green-foundry-vtt-system/issues/363) - First Aid misspelled in stat-parser-macro.js ## Version 1.6.5 - 2026-02-17 diff --git a/module/other/stat-parser-macro.js b/module/other/stat-parser-macro.js index 8c7b086..cdbf909 100644 --- a/module/other/stat-parser-macro.js +++ b/module/other/stat-parser-macro.js @@ -460,7 +460,7 @@ async function RegexParseNpcStatBlock(inputStr, actorType) { failure: false, }; actorData.system.skills.first_aid = { - label: "First Adi", + label: "First Aid", proficiency: GetSkillRatingsFromInput(inputStr, "FIRST AID"), failure: false, }; @@ -641,7 +641,7 @@ async function GetUserInput() {
- From 613129aa4a92d4b2f283b3163fce4fffa0f2087c Mon Sep 17 00:00:00 2001 From: jalensailin Date: Wed, 15 Apr 2026 23:01:28 -0400 Subject: [PATCH 6/7] Fix rituals not respecting `learnedDamage` --- CHANGELOG.md | 1 + module/item/item-sheet.js | 7 ++++++- templates/item/item-ritual-sheet.html | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2df8c8c..2a7e0d2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ ### **Bug Fixes:** +- [#382](https://github.com/deltagreen-foundryvtt/delta-green-foundry-vtt-system/issues/382) - Fix rituals not respecting damage from learning. - [#355](https://github.com/deltagreen-foundryvtt/delta-green-foundry-vtt-system/issues/355) - Save the physical description of an agent. - [#359](https://github.com/deltagreen-foundryvtt/delta-green-foundry-vtt-system/issues/359) - Save the profession of an NPC. - [#363](https://github.com/deltagreen-foundryvtt/delta-green-foundry-vtt-system/issues/363) - First Aid misspelled in stat-parser-macro.js diff --git a/module/item/item-sheet.js b/module/item/item-sheet.js index 5313fbf..dd2d011 100644 --- a/module/item/item-sheet.js +++ b/module/item/item-sheet.js @@ -146,7 +146,12 @@ export default class DeltaGreenItemSheet extends foundry.appv1.sheets break; } case "sanity-damage": { - const { successLoss, failedLoss } = this.item.system.sanity; + // Applies only to rituals, as far as Jalen can tell. Tomes have "study damage", but it just uses `sanity`. + const isLearntDamage = element.hasAttribute("data-san-on-learn"); + + const { successLoss, failedLoss } = isLearntDamage + ? this.item.system.learnedSanity + : this.item.system.sanity; const combinedFormula = `{${successLoss}, ${failedLoss}}`; roll = new DGSanityDamageRoll(combinedFormula, {}, rollOptions); diff --git a/templates/item/item-ritual-sheet.html b/templates/item/item-ritual-sheet.html index 4084abe..50f49cc 100644 --- a/templates/item/item-ritual-sheet.html +++ b/templates/item/item-ritual-sheet.html @@ -88,7 +88,7 @@ / - + {{localize 'DG.ItemWindow.Ritual.ActivationSanityDamage'}}: From 7a01d0cdfefed0b83853188de740c47e1deb500b Mon Sep 17 00:00:00 2001 From: jalensailin Date: Wed, 15 Apr 2026 23:25:51 -0400 Subject: [PATCH 7/7] Adjust date on Changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2a7e0d2..eac9f7a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,7 +12,7 @@ - [#283](https://github.com/deltagreen-foundryvtt/delta-green-foundry-vtt-system/issues/283) - Added new actor sheet with left hand Sidebar RFC - [#291](https://github.com/deltagreen-foundryvtt/delta-green-foundry-vtt-system/issues/291) - Moving Luck button from three dots to left hand panel -## Version 1.6.6 - 2026-03-XX +## Version 1.6.6 - 2026-04-15 ### **Bug Fixes:**