Merge pull request #386 from deltagreen-foundryvtt/hotfix/v1.6.6

Hotfix/v1.6.6
This commit is contained in:
Jalen
2026-04-19 13:14:22 -04:00
committed by GitHub
9 changed files with 52 additions and 37 deletions
+9
View File
@@ -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:**
+1 -1
View File
@@ -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 }),
+3
View File
@@ -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 }),
+7 -6
View File
@@ -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, {
+6 -1
View File
@@ -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);
+2 -2
View File
@@ -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() {
<div class="form-group">
<label>Output Actor Type: </label>
<div class="form-fields">
<select name="actor-type">
<select name="actor-type">
<option value="npc" selected>NPC</option>
<option value="unnatural">Unnatural</option>
<option value="agent">Agent</option>
-25
View File
@@ -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,
+23 -1
View File
@@ -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":
+1 -1
View File
@@ -88,7 +88,7 @@
<input class="item-sheet-short-input" name="system.learnedSanity.successLoss" type="text" value="{{item.system.learnedSanity.successLoss}}" type="text" />
/
<input class="item-sheet-short-input" name="system.learnedSanity.failedLoss" type="text" value="{{item.system.learnedSanity.failedLoss}}" type="text" />
<i class="fas fa-dice rollable" data-rolltype="sanity-damage"></i>
<i class="fas fa-dice rollable" data-rolltype="sanity-damage" data-san-on-learn></i>
</span>
<span class="resource-label">{{localize 'DG.ItemWindow.Ritual.ActivationSanityDamage'}}:</span>