From 590cbd166405aa472c1cbdf1a97c65c7fab63e60 Mon Sep 17 00:00:00 2001 From: Samuel Lopez Date: Thu, 25 Sep 2025 16:04:13 +0200 Subject: [PATCH] fix (#269): calc unnatural max wp and health --- module/actor/actor.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/module/actor/actor.js b/module/actor/actor.js index 299b862..b0133ad 100644 --- a/module/actor/actor.js +++ b/module/actor/actor.js @@ -121,11 +121,21 @@ export default class DeltaGreenActor extends Actor { const { system } = actor; // Loop through ability scores, and add their modifiers to our sheet output. - for (const [key, statistic] of Object.entries(system.statistics)) { + for (const statistic of Object.values(system.statistics)) { // the x5 is just whatever the raw statistic is x 5 to turn it into a d100 percentile statistic.x5 = statistic.value * 5; } + system.wp.max = system.statistics.pow.value; + + try { + system.health.max = Math.ceil( + (system.statistics.con.value + system.statistics.str.value) / 2, + ); + } catch { + system.health.max = 10; + } + // calculate total armor rating let protection = 0; for (const i of actor.items) { @@ -138,7 +148,7 @@ export default class DeltaGreenActor extends Actor { system.health.protection = protection; - for (const [_key, skill] of Object.entries(system.skills)) { + for (const skill of Object.values(system.skills)) { skill.targetProficiency = skill.proficiency; } }