From 3392159b79e817dc3b57b075ff66799c17b47a1a Mon Sep 17 00:00:00 2001 From: lowercasedonkey <lowercasedonkey@gmail.com> Date: Sun, 13 Sep 2020 09:53:40 -0400 Subject: [PATCH] revert uniting variables --- src/interaction/slaveInteract.js | 43 ++++++++++++++++---------------- 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/src/interaction/slaveInteract.js b/src/interaction/slaveInteract.js index a8b020f7222..a88f02eca38 100644 --- a/src/interaction/slaveInteract.js +++ b/src/interaction/slaveInteract.js @@ -1434,27 +1434,26 @@ App.UI.SlaveInteract.fertility = function(slave) { } = getPronouns(slave); let fertilityBlock = document.createElement('span'); let linkArray = []; - let text; if (slave.ovaries === 1 || slave.mpreg === 1 || slave.preg > 0) { - text = ""; + let note = ""; if (slave.preg < -1) { - text += `${He} is sterile`; + note += `${He} is sterile`; } else if (slave.pubertyXX === 0 && slave.preg < 1) { - text += `${He} is not yet fertile`; + note += `${He} is not yet fertile`; } else if (slave.ovaryAge >= 47 && slave.preg < 1) { - text += `${He} is too old to become pregnant`; + note += `${He} is too old to become pregnant`; if (slave.preg === -1) { slave.preg = 0; SetBellySize(slave); } } else if (slave.broodmotherOnHold === 1) { - text += `${His} pregnancy implant is turned off`; + note += `${His} pregnancy implant is turned off`; if (slave.broodmotherCountDown > 0) { - text += `${he} is expected to be completely emptied of ${his} remaining brood in ${slave.broodmotherCountDown} week`; + note += `${he} is expected to be completely emptied of ${his} remaining brood in ${slave.broodmotherCountDown} week`; if (slave.broodmotherCountDown > 1) { - text += `s`; + note += `s`; } - text += `.`; + note += `.`; linkArray.push(App.UI.DOM.link( `Turn on implant`, () => { @@ -1467,26 +1466,26 @@ App.UI.SlaveInteract.fertility = function(slave) { } } else if (slave.preg >= -1) { fertilityBlock.append("Contraception and fertility: "); - text = ""; + let fertility = ""; // fertility.id = "fertility"; if (slave.preg === -1) { - text = "using contraceptives"; + fertility = "using contraceptives"; } else if (slave.pregWeek < 0) { - text = "postpartum"; + fertility = "postpartum"; } else if (slave.preg === 0) { - text = "fertile"; + fertility = "fertile"; } else if (slave.preg < 4 && (slave.broodmother === 0 || slave.broodmotherOnHold === 1)) { - text = "may be pregnant"; + fertility = "may be pregnant"; } else if (slave.preg < 2) { - text = "1 week pregnant"; + fertility = "1 week pregnant"; } else { - text = `${Math.trunc(slave.preg * 1000) / 1000} weeks pregnant`; // * and / needed to avoid seeing something like 20.1000000008 in some cases. + fertility = `${Math.trunc(slave.preg * 1000) / 1000} weeks pregnant`; // * and / needed to avoid seeing something like 20.1000000008 in some cases. if (slave.broodmother > 0) { - text += " broodmother"; + fertility += " broodmother"; } } - text += ". "; - App.UI.DOM.appendNewElement("span", fertilityBlock, text, "bold"); + fertility += ". "; + App.UI.DOM.appendNewElement("span", fertilityBlock, fertility, "bold"); if (slave.preg === 0) { linkArray.push(App.UI.DOM.link( @@ -1505,7 +1504,7 @@ App.UI.SlaveInteract.fertility = function(slave) { }, )); } else if (slave.induce === 1) { - text += `Hormones are being slipped into ${his} food; ${he} will give birth suddenly and rapidly this week`; + note += `Hormones are being slipped into ${his} food; ${he} will give birth suddenly and rapidly this week`; } else if (slave.preg > slave.pregData.normalBirth - 2 && slave.preg > slave.pregData.minLiveBirth && slave.broodmother === 0 && slave.labor === 0) { linkArray.push(App.UI.DOM.link( `Induce labor`, @@ -1542,7 +1541,7 @@ App.UI.SlaveInteract.fertility = function(slave) { "csec" )); } else if (slave.preg > 0 && slave.breedingMark === 1 && V.propOutcome === 1 && V.arcologies[0].FSRestart !== "unset" && V.eugenicsFullControl !== 1 && (slave.pregSource === -1 || slave.pregSource === -6)) { - text += "You are forbidden from aborting an Elite child"; + note += "You are forbidden from aborting an Elite child"; } else if (slave.preg > 0) { linkArray.push(App.UI.DOM.link( `Abort ${his} pregnancy`, @@ -1555,7 +1554,7 @@ App.UI.SlaveInteract.fertility = function(slave) { )); } } - App.UI.DOM.appendNewElement("span", fertilityBlock, text, "note"); + App.UI.DOM.appendNewElement("span", fertilityBlock, note, "note"); App.UI.DOM.appendNewElement("div", fertilityBlock, App.UI.DOM.generateLinksStrip(linkArray), "choices"); } if ( -- GitLab