diff --git a/src/SecExp/rebellionReport.tw b/src/SecExp/rebellionReport.tw index b35e466172a1b300fba621c5744367f9a7b29e2e..5a18bd640a4c436f1813c7eb5f7e1b32ddfd6fb1 100644 --- a/src/SecExp/rebellionReport.tw +++ b/src/SecExp/rebellionReport.tw @@ -618,7 +618,7 @@ <<if $Concubine.health.health >= -60>> <<run healthDamage($Concubine, 30)>> <<else>> - <<run healthDamage($Concubine, 90)>> + <<run healthDamage($Concubine, -90 - $Concubine.health.health)>> <</if>> <</if>> <</if>> diff --git a/src/js/SlaveState.js b/src/js/SlaveState.js index 80de9079aedde186cbb50c68e03c23afbb5392ce..553245f3feb974e1b10628bad5a52fbe26cae02c 100644 --- a/src/js/SlaveState.js +++ b/src/js/SlaveState.js @@ -623,7 +623,7 @@ App.Entity.SlaveState = class SlaveState { tired: 0, /** slave 's combined health (condition - short - long) */ health: 0 - } + }; /** * slave has a minor injury ("black eye", "bruise", "split lip") * @type {number | string} diff --git a/src/js/datatypeCleanupJS.js b/src/js/datatypeCleanupJS.js index 6c5064be27a72923f17d7f43a298496029e86655..64ddfec3964d78f3635111c6cebafd50c4ab6ed8 100644 --- a/src/js/datatypeCleanupJS.js +++ b/src/js/datatypeCleanupJS.js @@ -20,6 +20,7 @@ App.Entity.Utils.SlaveDataSchemeCleanup = (function() { migrateCustomProperties(slave); migrateBrand(slave); migrateScars(slave); + migrateHealth(slave); App.Entity.Utils.migratePronouns(slave); if (slave.hasOwnProperty("assignmentVisible")) { @@ -27,6 +28,22 @@ App.Entity.Utils.SlaveDataSchemeCleanup = (function() { } } + /** + * @param {App.Entity.SlaveState} slave + */ + function migrateHealth(slave) { + if (typeof slave.health === "number") { + const condition = slave.health; + slave.health = {}; + slave.health.condition = condition; + slave.health.shortDamage = 0; + slave.health.longDamage = 0; + slave.health.illness = 0; + slave.health.tired = 0; + slave.health.health = condition; + } + } + /** * @param {App.Entity.SlaveState} slave */ @@ -423,11 +440,6 @@ window.SlaveDatatypeCleanup = (function SlaveDatatypeCleanup() { slave.pubertyAgeXY = Math.max(+slave.pubertyAgeXY, 0) || V.potencyAge; slave.ageAdjust = Math.clamp(+slave.ageAdjust, -40, 40) || 0; slave.NCSyouthening = Math.max(+slave.NCSyouthening, 0) || 0; - if (typeof slave.health === "number") { - const condition = slave.health; - slave.health = {}; - slave.health.condition = condition; - } slave.health.condition = Math.clamp(slave.health.condition, -100, 100) || 0; slave.health.shortDamage = Math.max(+slave.health.shortDamage, 0) || 0; slave.health.longDamage = Math.max(+slave.health.longDamage, 0) || 0;