From f8571493d845cac31071284d465270c6c47e8bfc Mon Sep 17 00:00:00 2001 From: clem Date: Mon, 16 Feb 2026 04:07:45 +0800 Subject: [PATCH 1/3] update splittermond thresholds --- src/module/providers/splittermond.js | 52 ++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/src/module/providers/splittermond.js b/src/module/providers/splittermond.js index 622c20d..571e48f 100644 --- a/src/module/providers/splittermond.js +++ b/src/module/providers/splittermond.js @@ -1,6 +1,58 @@ import EstimationProvider from "./templates/Base.js"; export default class splittermondEstimationProvider extends EstimationProvider { + constructor() { + super(); + this.breakOnZeroMaxHP = true; + this._breakAttribute = "token.actor.system.health.max"; + + // Splittermond Gesundheitsstufen (GRW p.172) + // nbrLevels is modified by NPC features: Schwächlich (3) and Zerbrechlich (1) + this.customLogic = "const _nbrLevels = system.health?.woundMalus?.levels?.length ?? 5;"; + + this.estimations = [ + // Default: 5 Gesundheitsstufen (standard) + // Boundaries at 80/60/40/20% of max HP + { + name: "", + rule: "", + ignoreColor: false, + estimates: [ + { value: 0, label: "Todgeweiht" }, + { value: 19, label: "Todgeweiht" }, + { value: 39, label: "Schwer verletzt" }, + { value: 59, label: "Verletzt" }, + { value: 79, label: "Angeschlagen" }, + { value: 100, label: "Unverletzt" }, + ], + }, + // Schwächlich: 3 Gesundheitsstufen + // Boundaries at 2/3 and 1/3 of max HP (trunc to 66% and 33%) + { + name: "Schwächlich (3 Gesundheitsstufen)", + rule: "_nbrLevels === 3", + ignoreColor: false, + estimates: [ + { value: 0, label: "Todgeweiht" }, + { value: 32, label: "Todgeweiht" }, + { value: 65, label: "Verletzt" }, + { value: 100, label: "Unverletzt" }, + ], + }, + // Zerbrechlich: 1 Gesundheitsstufe (no wound penalties) + { + name: "Zerbrechlich (1 Gesundheitsstufe)", + rule: "_nbrLevels === 1", + ignoreColor: false, + estimates: [ + { value: 0, label: "Todgeweiht" }, + { value: 50, label: "Angeschlagen" }, + { value: 100, label: "Unverletzt" }, + ], + }, + ]; + } + fraction(token) { const hp = token.actor.system.health; return hp.total.value / hp.max; From eb431fb0c46cd08f5ec2faff33975771542f850f Mon Sep 17 00:00:00 2001 From: clem Date: Mon, 16 Feb 2026 04:23:27 +0800 Subject: [PATCH 2/3] use localization --- src/module/providers/splittermond.js | 36 ++++++++++++++++++---------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/src/module/providers/splittermond.js b/src/module/providers/splittermond.js index 571e48f..c109b8b 100644 --- a/src/module/providers/splittermond.js +++ b/src/module/providers/splittermond.js @@ -1,11 +1,21 @@ import EstimationProvider from "./templates/Base.js"; +function l(key) { + return game.i18n.localize(`splittermond.woundMalusLevels.${key}`); +} + export default class splittermondEstimationProvider extends EstimationProvider { constructor() { super(); this.breakOnZeroMaxHP = true; this._breakAttribute = "token.actor.system.health.max"; + const notinjured = l("notinjured"); + const battered = l("battered"); + const injured = l("injured"); + const badlyinjured = l("badlyinjured"); + const doomed = l("doomed"); + // Splittermond Gesundheitsstufen (GRW p.172) // nbrLevels is modified by NPC features: Schwächlich (3) and Zerbrechlich (1) this.customLogic = "const _nbrLevels = system.health?.woundMalus?.levels?.length ?? 5;"; @@ -18,12 +28,12 @@ export default class splittermondEstimationProvider extends EstimationProvider { rule: "", ignoreColor: false, estimates: [ - { value: 0, label: "Todgeweiht" }, - { value: 19, label: "Todgeweiht" }, - { value: 39, label: "Schwer verletzt" }, - { value: 59, label: "Verletzt" }, - { value: 79, label: "Angeschlagen" }, - { value: 100, label: "Unverletzt" }, + { value: 0, label: doomed }, + { value: 19, label: doomed }, + { value: 39, label: badlyinjured }, + { value: 59, label: injured }, + { value: 79, label: battered }, + { value: 100, label: notinjured }, ], }, // Schwächlich: 3 Gesundheitsstufen @@ -33,10 +43,10 @@ export default class splittermondEstimationProvider extends EstimationProvider { rule: "_nbrLevels === 3", ignoreColor: false, estimates: [ - { value: 0, label: "Todgeweiht" }, - { value: 32, label: "Todgeweiht" }, - { value: 65, label: "Verletzt" }, - { value: 100, label: "Unverletzt" }, + { value: 0, label: doomed }, + { value: 32, label: doomed }, + { value: 65, label: injured }, + { value: 100, label: notinjured }, ], }, // Zerbrechlich: 1 Gesundheitsstufe (no wound penalties) @@ -45,9 +55,9 @@ export default class splittermondEstimationProvider extends EstimationProvider { rule: "_nbrLevels === 1", ignoreColor: false, estimates: [ - { value: 0, label: "Todgeweiht" }, - { value: 50, label: "Angeschlagen" }, - { value: 100, label: "Unverletzt" }, + { value: 0, label: doomed }, + { value: 50, label: battered }, + { value: 100, label: notinjured }, ], }, ]; From 6ad8491be1b4f5ebc02d054d9c8242162270970d Mon Sep 17 00:00:00 2001 From: Matheus Clemente Date: Wed, 29 Apr 2026 21:54:07 -0300 Subject: [PATCH 3/3] Update splittermond.js --- src/module/providers/splittermond.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/module/providers/splittermond.js b/src/module/providers/splittermond.js index c109b8b..5ef43ed 100644 --- a/src/module/providers/splittermond.js +++ b/src/module/providers/splittermond.js @@ -8,7 +8,6 @@ export default class splittermondEstimationProvider extends EstimationProvider { constructor() { super(); this.breakOnZeroMaxHP = true; - this._breakAttribute = "token.actor.system.health.max"; const notinjured = l("notinjured"); const battered = l("battered"); @@ -63,6 +62,8 @@ export default class splittermondEstimationProvider extends EstimationProvider { ]; } + _breakAttribute = "token.actor.system.health.max"; + fraction(token) { const hp = token.actor.system.health; return hp.total.value / hp.max;