diff --git a/src/endWeek/saLongTermEffects.js b/src/endWeek/saLongTermEffects.js index 5420f3f57f9fe74dc1cc771a6bcd4d47d4d05793..7ba175872fd802a4971a6ef13c8494b239af1543 100644 --- a/src/endWeek/saLongTermEffects.js +++ b/src/endWeek/saLongTermEffects.js @@ -6,12 +6,9 @@ App.SlaveAssignment.longTermEffects = (function() { // eslint-disable-next-line no-unused-vars let he, him, his, hers, himself, girl, loli, He, His, wife; - let boobSize; let gigantomastiaMod; let rearQuirk; let uterineHypersensitivityMod; - let oldEnergy; - let maxEnergyGain; let effect; return saLongTermEffects; @@ -23,13 +20,10 @@ App.SlaveAssignment.longTermEffects = (function() { function saLongTermEffects(slave) { r = []; - updateBoobSize(slave); gigantomastiaMod = slave.geneticQuirks.gigantomastia === 2 ? (slave.geneticQuirks.macromastia === 2 ? 3 : 2) : 1; rearQuirk = slave.geneticQuirks.rearLipedema === 2 ? 2 : 0; uterineHypersensitivityMod = slave.geneticQuirks.uterineHypersensitivity === 2 ? 2 : 1; - // anaphrodisiac stuff - oldEnergy = slave.energy; - maxEnergyGain = Math.round((75 - oldEnergy) / 9.3); + const oldEnergy = slave.energy; ({ // eslint-disable-next-line no-unused-vars @@ -89,7 +83,7 @@ App.SlaveAssignment.longTermEffects = (function() { } } r.push(App.SlaveAssignment.longTermPhysicalEffects(slave)); - anaphrodisiacEffects(slave); // must come after all .energy gains! + anaphrodisiacEffects(slave, oldEnergy); // must come after all .energy gains! if (slave.accent > 0 && slave.fetish !== "mindbroken") { languageLearning(slave); } @@ -116,12 +110,12 @@ App.SlaveAssignment.longTermEffects = (function() { } /** - * Used to keep boobSize up to date as changes happen to it. + * Calculate current total base of the slave's boobs, since it'll be changing throughout the passage * @param {App.Entity.SlaveState} slave * */ - function updateBoobSize(slave) { - boobSize = slave.boobs - slave.boobsImplant - slave.boobsMilk; + function boobSize(slave) { + return slave.boobs - slave.boobsImplant - slave.boobsMilk; } /** @@ -541,7 +535,7 @@ App.SlaveAssignment.longTermEffects = (function() { r.push(`All the hormones in ${his} system from ${his} heavy, steroid enhanced workouts <span class="change negative">harden ${his} face a little.</span>`); slave.face -= 5; } - if (boobSize > 250) { + if (boobSize(slave) > 250) { if (random(1, 100) > 95) { r.push(`All the hormones in ${his} system from ${his} heavy workouts <span class="change negative">shrink ${his} breasts slightly.</span>`); slave.boobs -= 50; @@ -555,7 +549,6 @@ App.SlaveAssignment.longTermEffects = (function() { * */ function aphrodisiacEffects(slave) { - updateBoobSize(slave); let Effects = []; if (V.aphrodisiacUpgradeRefine !== 1) { if (slave.dick > 1 && slave.geneticQuirks.wellHung !== 2) { @@ -577,7 +570,7 @@ App.SlaveAssignment.longTermEffects = (function() { if (((slave.butt - slave.buttImplant) < 2 + rearQuirk) && (slave.geneMods.NCS === 0 || (random(1, 100) > 75 / rearQuirkDivider))) { Effects.push("ButtBigger"); } - if ((boobSize < 500 * gigantomastiaMod) && ((slave.geneMods.NCS === 0) || (random(1, 100) > 75 / gigantomastiaMod))) { + if ((boobSize(slave) < 500 * gigantomastiaMod) && ((slave.geneMods.NCS === 0) || (random(1, 100) > 75 / gigantomastiaMod))) { Effects.push("BoobsBigger"); } if (slave.face - slave.faceImplant <= 10) { @@ -871,7 +864,6 @@ App.SlaveAssignment.longTermEffects = (function() { * */ function puberty(slave) { - updateBoobSize(slave); if (V.precociousPuberty === 1) { let earlyPubertyFlag = 0; let precocious = 0; @@ -897,8 +889,8 @@ App.SlaveAssignment.longTermEffects = (function() { precocious += 0.1; } else if (slave.drugs === "steroids") { precocious += 0.2; - if (boobSize > 100 && random(1, 100) < 30 / gigantomastiaMod && gigantomastiaMod !== 3) { - if (slave.geneMods.NCS === 1 && boobSize > 300 && random(1, 100) > 25 * gigantomastiaMod) { + if (boobSize(slave) > 100 && random(1, 100) < 30 / gigantomastiaMod && gigantomastiaMod !== 3) { + if (slave.geneMods.NCS === 1 && boobSize(slave) > 300 && random(1, 100) > 25 * gigantomastiaMod) { r.push(`Hormonal effects work with ${his} <span class="ncs">NCS</span> and cause <span class="change negative">${his} tits to shrink down.</span>`); slave.boobs -= 50 / gigantomastiaMod; slave.energy += 1; @@ -917,7 +909,7 @@ App.SlaveAssignment.longTermEffects = (function() { precocious -= 0.5; if (slave.geneMods.NCS === 0) { r.push(`${He} feels an <span class="change positive">unusual warm feeling</span> in ${his} belly and breasts.`); - if (boobSize < 400 * gigantomastiaMod && random(1, 100) < 30) { + if (boobSize(slave) < 400 * gigantomastiaMod && random(1, 100) < 30) { r.push(`${His} breasts feel <span class="change positive">heavy, hot and sensitive.</span>`); slave.boobs += 50; if (random(1, 100) < 10 && slave.breastMesh !== 1) { @@ -977,7 +969,6 @@ App.SlaveAssignment.longTermEffects = (function() { } if (slave.physicalAge < slave.pubertyAgeXY && slave.balls >= 1 && slave.pubertyXY === 0) { // Male type precocious = 0; - updateBoobSize(slave); /* Just having NCS speeds precocious Puberty, but also hormonal puberty affects are increased while secondary growth is suppressed */ if (slave.geneMods.NCS === 1) { precocious -= 0.8; @@ -1012,7 +1003,7 @@ App.SlaveAssignment.longTermEffects = (function() { precocious -= 1; if (slave.geneMods.NCS === 0) { r.push(`${He} feels <span class="change positive">unusual warm feeling</span> in ${his} breasts.`); - if (boobSize < 400 * gigantomastiaMod && random(1, 100) < 30 && gigantomastiaMod !== 3) { + if (boobSize(slave) < 400 * gigantomastiaMod && random(1, 100) < 30 && gigantomastiaMod !== 3) { r.push(`${His} chest feels <span class="change positive">hot and sensitive.</span>`); slave.boobs += 50; if (random(1, 100) < 10 && slave.breastMesh !== 1) { @@ -2540,9 +2531,10 @@ App.SlaveAssignment.longTermEffects = (function() { /** * @param {App.Entity.SlaveState} slave - * + * @param {number} oldEnergy */ - function anaphrodisiacEffects(slave) { + function anaphrodisiacEffects(slave, oldEnergy) { + const maxEnergyGain = Math.round((75 - oldEnergy) / 9.3); if (slave.aphrodisiacs === -1 && slave.energy - oldEnergy > maxEnergyGain) { r.push(`Anaphrodisiacs <span class="stat drop">limit ${his} sex drive.</span>`); slave.energy = oldEnergy + maxEnergyGain;