diff --git a/CHANGELOG.md b/CHANGELOG.md index 9c3e2b2..eac9f7a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,15 @@ - [#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-04-15 + +### **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 + ## 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/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 }), 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, { 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/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() {
- 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..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); @@ -280,7 +302,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": 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'}}: