From 77a476305541201208beedf12f870d30c9647a53 Mon Sep 17 00:00:00 2001 From: phBalance Date: Fri, 29 Nov 2024 18:07:28 -0700 Subject: [PATCH] fix(elemental control): correct slot costing when less than base cost --- CHANGELOG.md | 6 +++++- module/item/item.mjs | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index afacb0c2..0f8b9d37 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ # Releases -## Version 4.0.10 [Hero System 6e (Unofficial) v2](https://github.com/dmdorman/hero6e-foundryvtt) +## Version 4.0.11 (So far...) [Hero System 6e (Unofficial) v2](https://github.com/dmdorman/hero6e-foundryvtt) + +- Correct EC costing. + +## Version 4.0.10 - Fix migration SETANDBRACE warning. diff --git a/module/item/item.mjs b/module/item/item.mjs index 0e44b8df..eb77c2be 100644 --- a/module/item/item.mjs +++ b/module/item/item.mjs @@ -2908,7 +2908,8 @@ export class HeroSystem6eItem extends Item { _realCost /= 5.0; } } else if (this.parentItem.system.XMLID === "ELEMENTAL_CONTROL") { - _realCost = _realCost - this.parentItem.system.BASECOST; + const baseCost = (this.parentItem.system.BASECOST = parseFloat(this.parentItem.system.BASECOST)); + _realCost = Math.max(baseCost, _realCost - baseCost); } }