Files
DeltaGreen2/module/sheets/unnatural-sheet.js
T
tevansandClaude Fable 5 7c29335b0d Baseline: Delta Green official system v1.7.0 (MIT, TheLastScrub)
Pristine copy of the installed deltagreen 1.7.0 release build.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-15 17:22:41 +01:00

24 lines
960 B
JavaScript

import DGNPCSheet from "./npc-sheet.js";
/** @extends {DGNPCSheet} */
export default class DGUnnaturalSheet extends DGNPCSheet {
/** @override */
async _processSubmitData(event, form, submitData, options) {
const submittedData = foundry.utils.expandObject(submitData);
// 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);
}
}