diff --git a/src/js/summaryWidgets.js b/src/js/summaryWidgets.js index 6af4e66e07cbcc23cf89082681eef67d73aa3be7..215c5b2488b8254ace13e0eec080bf988903f853 100644 --- a/src/js/summaryWidgets.js +++ b/src/js/summaryWidgets.js @@ -1,14 +1,17 @@ -window.SlaveStatClamp = /** @param {App.Entity.SlaveState} slave */ function SlaveStatClamp(slave) { +/** + * @param {App.Entity.SlaveState} slave + */ +window.SlaveStatClamp = function SlaveStatClamp(slave) { slave.energy = Math.clamp(slave.energy, 0, 100); const V = State.variables; if (slave.devotion > 100) { if (slave.trust < -95) slave.trust = -100; - else if ((slave.trust < 100) && (slave.trust > 20)) - slave.trust += (Math.trunc((slave.devotion-100)*5)/10); + else if (slave.trust < 100 && slave.trust > 20) + slave.trust += Math.trunc((slave.devotion - 100) * 5) / 10; else - repX(4*(slave.devotion-100), "slavesViewOfPC", slave); + repX(4 * (slave.devotion - 100), "slavesViewOfPC", slave); slave.devotion = 100; } else if (slave.devotion < -95) slave.devotion = -100; @@ -16,9 +19,9 @@ window.SlaveStatClamp = /** @param {App.Entity.SlaveState} slave */ function Sla if (slave.devotion < -95) slave.devotion = -100; else if (slave.devotion < 100 && slave.devotion > 20) - slave.devotion += Math.trunc(slave.trust-100); + slave.devotion += Math.trunc(slave.trust - 100); else - repX(4*(slave.trust-100), "slavesViewOfPC", slave); + repX(4 * (slave.trust - 100), "slavesViewOfPC", slave); slave.trust = 100; } else if (slave.trust < -95) slave.trust = -100;