From d4289f1da4b8dba4d3a317da9a765bc59f78fa16 Mon Sep 17 00:00:00 2001 From: lowercasedonkey <lowercasedonkey@gmail.com> Date: Sun, 18 Oct 2020 23:03:34 -0400 Subject: [PATCH] progress --- src/facilities/incubator/incubatorInteract.js | 471 ++++++++++-------- 1 file changed, 257 insertions(+), 214 deletions(-) diff --git a/src/facilities/incubator/incubatorInteract.js b/src/facilities/incubator/incubatorInteract.js index 5af504c0f1b..4a7d315c554 100644 --- a/src/facilities/incubator/incubatorInteract.js +++ b/src/facilities/incubator/incubatorInteract.js @@ -1,5 +1,4 @@ App.Facility.Incubator = function() { - V.nextButton = "Back to Main", V.nextLink = "Main", V.returnTo = "Incubator", V.encyclopedia = "The Incubation Facility"; V.targetAge = Number(V.targetAge) || V.minimumSlaveAge; V.targetAge = Math.clamp(V.targetAge, V.minimumSlaveAge, 42); @@ -7,15 +6,15 @@ App.Facility.Incubator = function() { let r = []; const el = new DocumentFragment(); let _freeTanks = V.incubator - V.incubatorSlaves; - const _SL = V.slaves.length + const _SL = V.slaves.length; let _eligibility = 0; V.readySlaves = 0; V.readySlave = 0; V.incubatorSlaves = V.tanks.length; - + V.reservedChildren = FetusGlobalReserveCount("incubator"), V.reservedChildrenNursery = FetusGlobalReserveCount("nursery"); - //<br><br> + // <br><br> const _incubatorNameCaps = capFirstChar(V.incubatorName); r.push(`${_incubatorNameCaps} is a clean, cold hall designed to be lined with tanks and their connected monitoring systems.`); @@ -32,26 +31,26 @@ App.Facility.Incubator = function() { choice( "Decommission the incubator", () => { - V.incubator = 0, - V.incubatorUpgradeSpeed = 5, - V.incubatorUpgradeWeight = 0, - V.incubatorUpgradeMuscles = 0, - V.incubatorUpgradeReproduction = 0, - V.incubatorUpgradeGrowthStims = 0, - V.incubatorWeightSetting = 0, - V.incubatorMusclesSetting = 0, - V.incubatorReproductionSetting = 0, - V.incubatorGrowthStimsSetting = 0, - V.tanks = [] + V.incubator = 0; + V.incubatorUpgradeSpeed = 5; + V.incubatorUpgradeWeight = 0; + V.incubatorUpgradeMuscles = 0; + V.incubatorUpgradeReproduction = 0; + V.incubatorUpgradeGrowthStims = 0; + V.incubatorWeightSetting = 0; + V.incubatorMusclesSetting = 0; + V.incubatorReproductionSetting = 0; + V.incubatorGrowthStimsSetting = 0; + V.tanks = []; } ) - ) + ); } /** - * - * @param {string} title - * @param {function():void} func + * + * @param {string} title + * @param {function():void} func * @param {string} [passage="Incubator"] * @param {string} [note] * @returns {HTMLElement} @@ -66,14 +65,14 @@ App.Facility.Incubator = function() { [], passage ) - ) + ); if (note) { App.UI.DOM.appendNewElement("span", div, ` ${note}`, "note"); } return div; } r = []; - //<br> + // <br> r.push(`It can support ${V.incubator}`); if (V.incubatorSlaves === 1) { r.push(`child. There is currently ${V.incubatorSlaves} tank`); @@ -88,7 +87,7 @@ App.Facility.Incubator = function() { `Add another incubation tank`, () => { cashX(forceNeg(Math.trunc(60000 * V.upgradeMultiplierArcology)), "capEx"); - V.incubator += 1 + V.incubator += 1; }, "Incubator", `Costs ${cashFormat(Math.trunc(60000 * V.upgradeMultiplierArcology))} and will increase upkeep costs` @@ -102,7 +101,7 @@ App.Facility.Incubator = function() { `Remove an incubation tank`, () => { cashX(forceNeg(Math.trunc(10000 * V.upgradeMultiplierArcology)), "capEx"); - V.incubator -= 1 + V.incubator -= 1; }, "Incubator", `Costs ${cashFormat(Math.trunc(10000 * V.upgradeMultiplierArcology))} and will reduce upkeep costs` @@ -110,7 +109,7 @@ App.Facility.Incubator = function() { ); } - //<br><br> + // <br><br> r = []; r.push(`Reserve an eligible mother-to-be's child to be placed in a tank upon birth. Of ${V.incubator} tanks, ${_freeTanks}`); if (_freeTanks === 1) { @@ -150,10 +149,9 @@ App.Facility.Incubator = function() { V.sortIncubatorList = 'Name'; sortIncubatorPossiblesByName(); jQuery(`#qlIncubatorSort`).empty().append(V.sortIncubatorList); - } ) - ) + ); linkArray.push( App.UI.DOM.link( "Sort by Reserved Incubator Spots", @@ -161,10 +159,9 @@ App.Facility.Incubator = function() { V.sortIncubatorList = 'Reserved Incubator Spots'; sortIncubatorPossiblesByReservedSpots(); jQuery(`#qlIncubatorSort`).empty().append(V.sortIncubatorList); - } ) - ) + ); linkArray.push( App.UI.DOM.link( "Sort by Pregnancy Week", @@ -172,10 +169,9 @@ App.Facility.Incubator = function() { V.sortIncubatorList = 'Reserved Incubator Spots'; sortIncubatorPossiblesByPregnancyWeek(); jQuery(`#qlIncubatorSort`).empty().append(V.sortIncubatorList); - } ) - ) + ); linkArray.push( App.UI.DOM.link( "Sort by Number of Children", @@ -183,10 +179,9 @@ App.Facility.Incubator = function() { V.sortIncubatorList = 'Reserved Incubator Spots'; sortIncubatorPossiblesByPregnancyCount(); jQuery(`#qlIncubatorSort`).empty().append(V.sortIncubatorList); - } ) - ) + ); sortingBar.append(App.UI.DOM.generateLinksStrip(linkArray)); el.append(sortingBar); } @@ -195,9 +190,8 @@ App.Facility.Incubator = function() { qlIncubator.id = "qlIncubator"; for (const slave of V.slaves) { const { - He, His, - he, his - } = getPronouns(slave) + His, his + } = getPronouns(slave); if (slave.preg > 0 && slave.broodmother === 0 && slave.pregKnown === 1 && slave.eggType === "human") { if ((slave.assignment === "work in the dairy" && V.dairyPregSetting > 0) || slave.assignment === "be your agent" || slave.assignment === "live with your agent") { } else { @@ -214,7 +208,7 @@ App.Facility.Incubator = function() { linkArray = []; const choices = document.createElement("div"); choices.classList.add("choices"); - //<div class="possible" @id="_slaveId" @data-preg - count="_WL" @data-reserved - spots="_reservedIncubator" @data-preg - week="_pregWeek" @data-name="_slaveName" > + // <div class="possible" @id="_slaveId" @data-preg - count="_WL" @data-reserved - spots="_reservedIncubator" @data-preg - week="_pregWeek" @data-name="_slaveName" > r.push(`${App.UI.slaveDescriptionDialog(slave)}`); r.push(` is ${slave.pregWeek} week`); if (slave.pregWeek > 1) { @@ -271,58 +265,58 @@ App.Facility.Incubator = function() { App.UI.DOM.link( `Inspect pregnancy`, () => { - V.AS = slave.ID + V.AS = slave.ID; }, [], `Analyze Pregnancy` ) - ) + ); } linkArray.push( App.UI.DOM.link( `Keep another child`, () => { - WombAddToGenericReserve(slave, 'incubator', 1) + WombAddToGenericReserve(slave, 'incubator', 1); }, [], `Incubator` ) - ) + ); if (_reservedIncubator > 0) { linkArray.push( App.UI.DOM.link( `Keep one less child`, () => { - WombCleanGenericReserve(slave, 'incubator', 1) + WombCleanGenericReserve(slave, 'incubator', 1); }, [], `Incubator` ) - ) + ); } if (_reservedIncubator > 1) { linkArray.push( App.UI.DOM.link( `Keep none of ${his} children`, () => { - WombCleanGenericReserve(slave, 'incubator', 9999) + WombCleanGenericReserve(slave, 'incubator', 9999); }, [], `Incubator` ) - ) + ); } if ((V.reservedChildren + _WL - _reservedIncubator) <= _freeTanks) { linkArray.push( App.UI.DOM.link( `Keep the rest of ${his} children`, () => { - WombAddToGenericReserve(slave, 'incubator', 9999) + WombAddToGenericReserve(slave, 'incubator', 9999); }, [], `Incubator` ) - ) + ); } } else if ((_reservedIncubator === _WL) || (V.reservedChildren === _freeTanks) || (_reservedIncubator + _reservedNursery === _WL)) { if (V.pregnancyMonitoringUpgrade === 1) { @@ -330,34 +324,34 @@ App.Facility.Incubator = function() { App.UI.DOM.link( `Inspect pregnancy`, () => { - V.AS = slave.ID + V.AS = slave.ID; }, [], `Analyze Pregnancy` ) - ) + ); } linkArray.push( App.UI.DOM.link( `Keep one less child`, () => { - WombCleanGenericReserve(slave, 'incubator', 1) + WombCleanGenericReserve(slave, 'incubator', 1); }, [], `Incubator` ) - ) + ); if (_reservedIncubator > 1) { linkArray.push( App.UI.DOM.link( `Keep none of ${his} children`, () => { - WombCleanGenericReserve(slave, 'incubator', 9999) + WombCleanGenericReserve(slave, 'incubator', 9999); }, [], `Incubator` ) - ) + ); } } } else if ((V.reservedChildren < _freeTanks)) { @@ -368,23 +362,23 @@ App.Facility.Incubator = function() { App.UI.DOM.link( `Inspect pregnancy`, () => { - V.AS = slave.ID + V.AS = slave.ID; }, [], `Analyze Pregnancy` ) - ) + ); } linkArray.push( App.UI.DOM.link( `Keep ${his} ${((_WL > 1) ? "children" : "child")} here instead`, () => { - WombChangeReserveType(slave, 'nursery', 'incubator') + WombChangeReserveType(slave, 'nursery', 'incubator'); }, [], `Incubator` ) - ) + ); } else { r.push(`You have`); if (_freeTanks === 1) { @@ -398,35 +392,35 @@ App.Facility.Incubator = function() { App.UI.DOM.link( `Inspect pregnancy`, () => { - V.AS = slave.ID + V.AS = slave.ID; }, [], `Analyze Pregnancy` ) - ) + ); } } linkArray.push( App.UI.DOM.link( `Keep ${(_WL > 1) ? "a" : "the"} child`, () => { - WombAddToGenericReserve(slave, 'incubator', 1) + WombAddToGenericReserve(slave, 'incubator', 1); }, [], `Incubator` ) - ) + ); if ((_WL > 1) && (V.reservedChildren + _WL - _reservedIncubator) <= _freeTanks) { linkArray.push( App.UI.DOM.link( `Keep all of ${his} children`, () => { - WombAddToGenericReserve(slave, 'incubator', 9999) + WombAddToGenericReserve(slave, 'incubator', 9999); }, [], `Incubator` ) - ) + ); } } } else if (V.reservedChildren === _freeTanks) { @@ -435,12 +429,12 @@ App.Facility.Incubator = function() { App.UI.DOM.link( `Inspect pregnancy`, () => { - V.AS = slave.ID + V.AS = slave.ID; }, [], `Analyze Pregnancy` ) - ) + ); } linkArray.push(App.UI.DOM.makeElement("span", `You have <span class= "red"> no room for ${his} offspring.</span>`)); } @@ -448,7 +442,7 @@ App.Facility.Incubator = function() { App.Events.addNode(momDiv, r, "div"); choices.append(App.UI.DOM.generateLinksStrip(linkArray)); - momDiv.append(choices) + momDiv.append(choices); qlIncubator.append(momDiv); } } @@ -462,7 +456,7 @@ App.Facility.Incubator = function() { const _WL = V.PC.womb.length; const _reservedIncubator = WombReserveCount(V.PC, "incubator"); const _reservedNursery = WombReserveCount(V.PC, "nursery"); - //<br> + // <br> r.push(`''<span class="pink">You're V.PC.pregWeek week`); if (V.PC.pregWeek > 1) { r.push(`s`); @@ -489,7 +483,6 @@ App.Facility.Incubator = function() { } if ((_reservedIncubator < _WL) && (V.reservedChildren < _freeTanks) && (_reservedIncubator - _reservedNursery > 0)) { - if (V.pregnancyMonitoringUpgrade === 1) { linkArray.push( App.UI.DOM.link( @@ -498,53 +491,53 @@ App.Facility.Incubator = function() { [], `Analyze PC Pregnancy` ) - ) + ); } linkArray.push( App.UI.DOM.link( `Keep another child`, () => { - WombAddToGenericReserve(V.PC, 'incubator', 1) + WombAddToGenericReserve(V.PC, 'incubator', 1); }, [], `Incubator` ) - ) + ); if (_reservedIncubator > 0) { linkArray.push( App.UI.DOM.link( `Keep one less child`, () => { - WombCleanGenericReserve(V.PC, 'incubator', 1) + WombCleanGenericReserve(V.PC, 'incubator', 1); }, [], `Incubator` ) - ) + ); } if (_reservedIncubator > 1) { linkArray.push( App.UI.DOM.link( `Keep none of your children`, () => { - WombCleanGenericReserve(V.PC, 'incubator', 9999) + WombCleanGenericReserve(V.PC, 'incubator', 9999); }, [], `Incubator` ) - ) + ); } if ((V.reservedChildren + _WL - _reservedIncubator) <= _freeTanks) { linkArray.push( App.UI.DOM.link( `Keep the rest of your children`, () => { - WombAddToGenericReserve(V.PC, 'incubator', 9999) + WombAddToGenericReserve(V.PC, 'incubator', 9999); }, [], `Incubator` ) - ) + ); } } else if ((_reservedIncubator === _WL) || (V.reservedChildren === _freeTanks) || (_reservedIncubator - _reservedNursery >= 0)) { if (V.pregnancyMonitoringUpgrade === 1) { @@ -555,7 +548,7 @@ App.Facility.Incubator = function() { [], `Analyze PC Pregnancy` ) - ) + ); } linkArray.push( App.UI.DOM.link( @@ -566,16 +559,16 @@ App.Facility.Incubator = function() { [], `Incubator` ) - ) + ); if (_reservedIncubator > 1) { App.UI.DOM.link( `Keep none of your children`, () => { - WombCleanGenericReserve(V.PC, 'incubator', 9999) + WombCleanGenericReserve(V.PC, 'incubator', 9999); }, [], `Incubator` - ) + ); } } } else if (V.reservedChildren < _freeTanks) { @@ -586,15 +579,15 @@ App.Facility.Incubator = function() { `Your ${(_WL === 1) ? `child is` : `children are`} already reserved for ${V.nurseryName}`, "note" ) - ) + ); App.UI.DOM.link( `Keep your ${(_WL === 1) ? `child` : `children`} here instead`, () => { - WombChangeReserveType(V.PC, 'nursery', 'incubator') + WombChangeReserveType(V.PC, 'nursery', 'incubator'); }, [], `Incubator` - ) + ); } else { r.push(``); if (_freeTanks === 1) { @@ -610,25 +603,25 @@ App.Facility.Incubator = function() { [], `Analyze PC Pregnancy` ) - ) + ); } App.UI.DOM.link( `Keep ${(_WL > 1) ? `a` : `your`} child`, () => { - WombAddToGenericReserve(V.PC, 'incubator', 1) + WombAddToGenericReserve(V.PC, 'incubator', 1); }, [], `Incubator` - ) + ); if ((_WL > 1) && (V.reservedChildren + _WL - _reservedIncubator) <= _freeTanks) { App.UI.DOM.link( `Keep all of your children|Incubator`, () => { - WombAddToGenericReserve(V.PC, 'incubator', 9999) + WombAddToGenericReserve(V.PC, 'incubator', 9999); }, [], `Incubator` - ) + ); } } } else if (V.reservedChildren === _freeTanks) { @@ -640,13 +633,13 @@ App.Facility.Incubator = function() { [], `Analyze PC Pregnancy` ) - ) + ); } linkArray.push(App.UI.DOM.makeElement("span", `You have <span class= "red"> no room for your offspring.</span>`)); } App.Events.addNode(el, r, "div"); choices.append(App.UI.DOM.generateLinksStrip(linkArray)); - el.append(choices) + el.append(choices); } if (V.reservedChildren !== 0 || _childrenReserved === 1) { @@ -667,7 +660,7 @@ App.Facility.Incubator = function() { [], "Incubator" ) - ) + ); } function tankSettings() { @@ -685,7 +678,7 @@ App.Facility.Incubator = function() { }, true ) - ) + ); linkArray = []; linkArray.push( App.UI.DOM.link( @@ -696,7 +689,7 @@ App.Facility.Incubator = function() { [], `Incubator` ) - ) + ); linkArray.push( App.UI.DOM.link( `Average Age of Fertility`, @@ -706,7 +699,7 @@ App.Facility.Incubator = function() { [], `Incubator` ) - ) + ); linkArray.push( App.UI.DOM.link( `Average Age of Potency`, @@ -716,7 +709,7 @@ App.Facility.Incubator = function() { [], `Incubator` ) - ) + ); linkArray.push( App.UI.DOM.link( `Legal Adulthood`, @@ -726,8 +719,8 @@ App.Facility.Incubator = function() { [], `Incubator` ) - ) - row.append(App.UI.DOM.generateLinksStrip(linkArray)) + ); + row.append(App.UI.DOM.generateLinksStrip(linkArray)); App.UI.DOM.appendNewElement("span", row, `Setting will not be applied to tanks in use.`, "note"); el.append(row); @@ -743,7 +736,7 @@ App.Facility.Incubator = function() { ), [], `Incubator` - ) + ); } else { row.append(`Released children will be seen to personally. `); row.append( @@ -755,7 +748,7 @@ App.Facility.Incubator = function() { ), [], `Incubator` - ) + ); } el.append(row); @@ -776,7 +769,7 @@ App.Facility.Incubator = function() { [], "Incubator" ) - ) + ); App.UI.DOM.appendNewElement("span", row, `Costs ${cashFormat(cost)} and will increase upkeep costs`, "note"); } else if (V.incubatorUpgradeSpeed === 9) { cost = Math.trunc(75000 * V.upgradeMultiplierArcology); @@ -791,7 +784,7 @@ App.Facility.Incubator = function() { [], "Incubator" ) - ) + ); App.UI.DOM.appendNewElement("span", row, `Costs ${cashFormat(cost)} and will increase upkeep costs`, "note"); } else if (V.incubatorUpgradeSpeed === 6) { cost = Math.trunc(30000 * V.upgradeMultiplierArcology); @@ -806,7 +799,7 @@ App.Facility.Incubator = function() { [], "Incubator" ) - ) + ); App.UI.DOM.appendNewElement("span", row, `Costs ${cashFormat(cost)} and will increase upkeep costs`, "note"); } else if (V.incubatorUpgradeSpeed === 5) { cost = Math.trunc(30000 * V.upgradeMultiplierArcology); @@ -821,7 +814,7 @@ App.Facility.Incubator = function() { [], "Incubator" ) - ) + ); App.UI.DOM.appendNewElement("span", row, `Costs ${cashFormat(cost)} and will increase upkeep costs`, "note"); } @@ -838,12 +831,12 @@ App.Facility.Incubator = function() { `Upgrade the growth tanks with weight monitoring systems`, () => { cashX(forceNeg(cost), "capEx"); - V.incubatorUpgradeWeight = 1 + V.incubatorUpgradeWeight = 1; }, [], "Incubator" ) - ) + ); App.UI.DOM.appendNewElement("span", row, `Costs ${cashFormat(cost)} and will increase upkeep costs`, "note"); } @@ -854,18 +847,18 @@ App.Facility.Incubator = function() { row.append(`Advanced monitoring and steroid injection systems have been installed in the tanks to monitor and maintain a developing child's musculature.`); } else { cost = Math.trunc(20000 * V.upgradeMultiplierArcology); - row.append(`There are no systems in place to control a growing child's musculature; they will likely come out frail and weak from the rapid growth. `) + row.append(`There are no systems in place to control a growing child's musculature; they will likely come out frail and weak from the rapid growth. `); row.append( App.UI.DOM.link( `Upgrade the growth tanks with muscle monitoring systems`, () => { cashX(forceNeg(cost), "capEx"); - V.incubatorUpgradeMuscles = 1 + V.incubatorUpgradeMuscles = 1; }, [], "Incubator" ) - ) + ); App.UI.DOM.appendNewElement("span", row, `Costs ${cashFormat(cost)} and will increase upkeep costs`, "note"); } @@ -882,12 +875,12 @@ App.Facility.Incubator = function() { `Upgrade the growth tanks with hormone monitoring systems`, () => { cashX(forceNeg(cost), "capEx"); - V.incubatorUpgradeReproduction = 1 + V.incubatorUpgradeReproduction = 1; }, [], "Incubator" ) - ) + ); App.UI.DOM.appendNewElement("span", row, `Costs ${cashFormat(cost)} and will increase upkeep costs`, "note"); } @@ -904,12 +897,12 @@ App.Facility.Incubator = function() { `Upgrade the growth tanks with surgical extraction tools`, () => { cashX(forceNeg(cost), "capEx"); - V.incubatorUpgradeOrgans = 1 + V.incubatorUpgradeOrgans = 1; }, [], "Incubator" ) - ) + ); App.UI.DOM.appendNewElement("span", row, `Costs ${cashFormat(cost)} and will increase upkeep costs`, "note"); } else { row.append(`The tanks lack the ability to extract tissue samples and the dispensary lacks the ability to make use of them to fabricate organs.`); @@ -928,12 +921,12 @@ App.Facility.Incubator = function() { `Upgrade the growth tanks with stimulants injection systems`, () => { cashX(forceNeg(cost), "capEx"); - V.incubatorUpgradeOrgans = 1 + V.incubatorUpgradeOrgans = 1; }, [], "Incubator" ) - ) + ); App.UI.DOM.appendNewElement("span", row, `Costs ${cashFormat(cost)} and will increase upkeep costs`, "note"); } else { row.append(`There are no systems in place to control a growing child's height and you lack the capability to fabricate growth stimulants.`); @@ -941,7 +934,7 @@ App.Facility.Incubator = function() { el.append(row); if (V.minimumSlaveAge <= 6 && (V.arcologies[0].FSRepopulationFocus >= 60 || V.BlackmarketPregAdaptation === 1)) { - /*Main prerequisite - stable repopulation FS OR documentation purchased from black market. And age gate. */ + /* Main prerequisite - stable repopulation FS OR documentation purchased from black market. And age gate. */ row = document.createElement("div"); if (V.incubatorUpgradePregAdaptation === 1) { row.append(`The incubators have been upgraded with special set of manipulators, probes, nozzles and syringes coupled together with specific programs to take advantage of the accelerated growth to heighten viable reproductive capacity. These include injections of specialized serums and mechanical manipulation of the reproductive system and associated tissues, organs, muscles and bones.`); @@ -968,12 +961,12 @@ App.Facility.Incubator = function() { `Manufacture and install this subsystem`, () => { cashX(forceNeg(cost), "capEx"); - V.incubatorUpgradePregAdaptation = 1 + V.incubatorUpgradePregAdaptation = 1; }, "Incubator", `Costs ${cashFormat(cost)} and will increase upkeep costs` ) - ) + ); } } el.append(row); @@ -988,19 +981,19 @@ App.Facility.Incubator = function() { choice( `Switch the system to focus on preparation for body-swapping`, () => { - V.incubatorImprintSetting = "husk" + V.incubatorImprintSetting = "husk"; } ) - ) + ); } row.append( choice( `Switch the system to focus on attachment`, () => { - V.incubatorImprintSetting = "trust" + V.incubatorImprintSetting = "trust"; } ) - ) + ); } else if (V.incubatorImprintSetting === "trust") { row.append(`The imprinting system is currently focused on making them devoted and trusting of you. The imprinting cycle is locked upon incubation start.`); if (V.bodyswapAnnounced === 1) { @@ -1008,46 +1001,47 @@ App.Facility.Incubator = function() { choice( `Switch the system to focus preparation for body-swapping`, () => { - V.incubatorImprintSetting = "husk" + V.incubatorImprintSetting = "husk"; } ) - ) + ); } row.append( choice( `Switch the system to focus on dependence`, () => { - V.incubatorImprintSetting = "terror" + V.incubatorImprintSetting = "terror"; } ) - ) + ); } else { row.append(`The imprinting system is currently focused on producing complete vegetables ready to be used as hosts for body swapping. The imprinting cycle is locked upon incubation start.`); row.append( choice( `Switch the system to focus on dependence`, () => { - V.incubatorImprintSetting = "terror" + V.incubatorImprintSetting = "terror"; } ) - ) + ); row.append( choice( `Switch the system to focus on attachment`, () => { - V.incubatorImprintSetting = "trust" + V.incubatorImprintSetting = "trust"; } ) - ) + ); } return el; } function tankBabies() { const el = new DocumentFragment(); + let row; if (V.incubatorSlaves > 0) { - App.UI.DOM.appendNewElement("h2", el, `Children in ${V.incubatorName}`) + App.UI.DOM.appendNewElement("h2", el, `Children in ${V.incubatorName}`); for (let i = 0; i < V.incubatorSlaves; i++) { const p = document.createElement("p"); @@ -1190,11 +1184,11 @@ App.Facility.Incubator = function() { } if (V.tanks[i].growTime <= 0) { V.readySlaves = 1; - //<br> + // <br> r.push(`${He} is ready to be released from ${his} tank.`); } else { const _weekDisplay = Math.round(V.tanks[i].growTime / V.incubatorUpgradeSpeed); - //<br> + // <br> r.push(`${His} growth is currently being accelerated. ${He} will be ready for release in about _weekDisplay week`); if (_weekDisplay > 1) { @@ -1202,7 +1196,7 @@ App.Facility.Incubator = function() { } r.push(`.`); } - //<br> + // <br> if (V.tanks[i].tankBaby !== 3) { r.push(`The tank is imprinting ${him} with basic life and sexual skills, though ${he} will still be very naïve and inexperienced on release.`); if (V.tanks[i].tankBaby === 2) { @@ -1214,7 +1208,7 @@ App.Facility.Incubator = function() { r.push(`The tank keeps ${him} a braindead husk on a complete life-support.`); } if (V.incubatorUpgradeWeight === 1) { - //<br> + // <br> if (V.incubatorWeightSetting === 1) { r.push(`${His} weight is not being properly managed, saving costs but likely causing excessive weight gain.`); } else if (V.incubatorWeightSetting === 2) { @@ -1224,7 +1218,7 @@ App.Facility.Incubator = function() { } } if (V.incubatorUpgradeMuscles === 1) { - //<br> + // <br> if (V.incubatorMusclesSetting === 2) { r.push(`${His} strength levels are purposefully set higher than recommended; ${he} is likely to have excessive musculature.`); } else if (V.incubatorMusclesSetting === 1) { @@ -1234,7 +1228,7 @@ App.Facility.Incubator = function() { } } if (V.incubatorUpgradeGrowthStims === 1) { - //<br> + // <br> if (V.incubatorGrowthStimsSetting === 2) { r.push(`${He} is being injected with higher than recommended doses of stimulants; ${he} is likely to be much taller than expected.`); } else if (V.incubatorGrowthStimsSetting === 1) { @@ -1244,7 +1238,7 @@ App.Facility.Incubator = function() { } } if (V.incubatorUpgradeReproduction === 1) { - //<br> + // <br> if (V.incubatorReproductionSetting === 2) { r.push(`${His} hormone levels are purposefully set higher than recommended; ${his} reproductive systems are likely to be over-active.`); } else if (V.incubatorReproductionSetting === 1) { @@ -1254,7 +1248,7 @@ App.Facility.Incubator = function() { } if ((V.incubatorPregAdaptationSetting === 1 && V.tanks[i].genes === "XX") || (V.incubatorPregAdaptationSetting === 2 && V.tanks[i].genes === "XY") || V.incubatorPregAdaptationSetting === 3) { /* Should be visible only after incubatorUpgradeReproduction is installed and activated*/ - //<br> + // <br> r.push(`${His} reproductive organs are getting `); if (V.tanks[i].incubatorPregAdaptationPower === 1) { r.push(`an advanced`); @@ -1268,12 +1262,12 @@ App.Facility.Incubator = function() { r.push(` course of mechanical and hormonal therapy to become adapted for future use.`); } } - //<br> + // <br> r.push(`Rename ${him}: `); - //<<textbox "_tempName" _tempName >> - //r.push(` [[Apply |Incubator][${V.tanks[i].slaveName} =${_tempName]]} // Given name only //`); + // <<textbox "_tempName" _tempName >> + // r.push(` [[Apply |Incubator][${V.tanks[i].slaveName} =${_tempName]]} // Given name only //`); if (V.cheatMode === 1) { - //<br> + // <br> /* ''Cheatmode: '' << link "Retrieve immediately" >> @@ -1285,7 +1279,7 @@ App.Facility.Incubator = function() { */ } if ((V.incubatorUpgradeOrgans === 1) && (V.tanks[i].tankBaby != 3)) { - //<br> + // <br> r.push(`You can extract a sample and prepare a new organ for ${him} to be implanted once ${he} exits ${his} tank.`); let _newOrgan = 0; const tankOrgans = { @@ -1295,7 +1289,7 @@ App.Facility.Incubator = function() { rightEye: 0, leftEye: 0, voiceBox: 0 - } + }; for (let _i = 0; _i < V.incubatorOrgans.length;) { if (V.tanks[i].ID === V.incubatorOrgans[_i].ID) { if (V.incubatorOrgans[_i].type === "ovaries") { @@ -1324,10 +1318,10 @@ App.Facility.Incubator = function() { } else { r.push(`Being a natural boy, ${he} possesses a functional penis and balls. You can:`); } - //<br> + // <br> if (V.tanks[i].ovaries === 0) { if (tankOrgans.ovaries !== 1) { - /*<< link "Prepare ovaries">> + /* << link "Prepare ovaries">> App.Medicine.OrganFarm.growIncubatorOrgan(V.tanks[i], "ovaries"); <<goto "Incubator">> <</link>>*/ @@ -1337,7 +1331,7 @@ App.Facility.Incubator = function() { } if (V.tanks[i].dick === 0) { if (tankOrgans.penis !== 1) { - /*<< link "Prepare penis">> + /* << link "Prepare penis">> App.Medicine.OrganFarm.growIncubatorOrgan(V.tanks[i], "penis"); <<goto "Incubator">> <</link>>*/ @@ -1346,9 +1340,9 @@ App.Facility.Incubator = function() { } } if (V.tanks[i].balls === 0) { - //| + // | if (tankOrgans.testicles !== 1) { - /*<< link "Prepare testicles">> + /* << link "Prepare testicles">> App.Medicine.OrganFarm.growIncubatorOrgan(V.tanks[i], "testicles"); <<goto "Incubator">> <</link>>*/ @@ -1359,7 +1353,7 @@ App.Facility.Incubator = function() { const vision = { left: getLeftEyeVision(V.tanks[i]), right: getRightEyeVision(V.tanks[i]) - } + }; if (vision.left === 0 || vision.right === 0) { if (vision.left === 0 && vision.right === 0) { r.push(`${He} appears to be blind in both eyes:`); @@ -1369,22 +1363,22 @@ App.Facility.Incubator = function() { r.push(`${He} appears to be blind in ${his} right eye:`); } if (vision.left === 0 && tankOrgans.leftEye !== 1) { - /*<< link "Prepare left eye" >> + /* << link "Prepare left eye" >> App.Medicine.OrganFarm.growIncubatorOrgan(V.tanks[i], "leftEye"); << goto "Incubator" >> << /link>>*/ } if (vision.right === 0 && tankOrgans.rightEye !== 1) { - /*<< link "Prepare right eye" >> + /* << link "Prepare right eye" >> App.Medicine.OrganFarm.growIncubatorOrgan(V.tanks[i], "rightEye"); << goto "Incubator" >> << /link>>*/ } if (vision.left === 0 && vision.right === 0 && linkArray.length === 2) { - /*<< link "Prepare both eyes" >> - App.Medicine.OrganFarm.growIncubatorOrgan(V.tanks[i], "leftEye"), App.Medicine.OrganFarm.growIncubatorOrgan(V.tanks[i], "rightEye"); - << goto "Incubator" >> - << /link>>*/ + /* << link "Prepare both eyes" >> + App.Medicine.OrganFarm.growIncubatorOrgan(V.tanks[i], "leftEye"), App.Medicine.OrganFarm.growIncubatorOrgan(V.tanks[i], "rightEye"); + << goto "Incubator" >> + << /link>>*/ } if (vision.left === 0 && vision.right === 0 && linkArray.length === 0) { r.push(` <span class="detail">Both eyes are already prepared.</span>`); @@ -1395,10 +1389,10 @@ App.Facility.Incubator = function() { } } if (V.tanks[i].voice === 0) { - //<br> + // <br> r.push(`${He} appears to be mute: `); if (tankOrgans.voicebox !== 1) { - /*<< link "Prepare vocal cords">> + /* << link "Prepare vocal cords">> App.Medicine.OrganFarm.growIncubatorOrgan(V.tanks[i], "voicebox"); <<goto "Incubator">> <</link>>*/ @@ -1410,8 +1404,8 @@ App.Facility.Incubator = function() { } } - //<br> - //<br> + // <br> + // <br> if (V.incubatorUpgradeWeight === 1) { if (V.incubatorWeightSetting === 1) { @@ -1422,7 +1416,7 @@ App.Facility.Incubator = function() { r.push(`Weight management systems are offline; children will likely be malnourished. [[Activate|Incubator][V.incubatorWeightSetting = 2]]`); } } - //<br> + // <br> if (V.incubatorUpgradeMuscles === 1) { if (V.incubatorMusclesSetting === 2) { r.push(`Strength levels are purposefully set higher than recommended; excessive muscle gain is likely. [[Limit|Incubator][V.incubatorMusclesSetting = 1]] | [[Disable|Incubator][V.incubatorMusclesSetting = 0]]`); @@ -1432,71 +1426,111 @@ App.Facility.Incubator = function() { r.push(`Strength management systems are offline; children will likely be released extremely weak. [[Activate|Incubator][V.incubatorMusclesSetting = 1]]`); } } - //<br> if (V.incubatorUpgradeReproduction === 1) { + row = document.createElement("row"); if (V.incubatorReproductionSetting === 2) { - r.push(`Hormone levels are purposefully set higher than recommended; over-active reproductive systems are likely. [[Limit|Incubator][V.incubatorReproductionSetting = 1]] | [[Disable|Incubator][V.incubatorReproductionSetting = 0]]`); - } else if (V.incubatorReproductionSetting === 1) { - r.push(`Hormone levels are being carefully managed; children will be released with fully functional reproductive organs. [[Overload|Incubator][V.incubatorReproductionSetting = 2]] | [[Disable|Incubator][V.incubatorReproductionSetting = 0]]`); - } else if (V.incubatorReproductionSetting === 0) { - r.push(`Reproduction management systems are offline; children will undergo normal puberty. [[Activate|Incubator][V.incubatorReproductionSetting = 1]]`); + row.append(`Hormone levels are purposefully set higher than recommended; over-active reproductive systems are likely. `); + } else { + linkArray.push(makeLink(`Overload`, () => { V.incubatorReproductionSetting = 2; })); } + + if (V.incubatorReproductionSetting === 1) { + row.append(`Hormone levels are being carefully managed; children will be released with fully functional reproductive organs. `); + } else { + linkArray.push(makeLink(`Limit`, () => { V.incubatorReproductionSetting = 1; })); + } + + if (V.incubatorReproductionSetting === 0) { + row.append(`Reproduction management systems are offline; children will undergo normal puberty. `); + } else { + linkArray.push(makeLink(`Disable`, () => { V.incubatorReproductionSetting = 0; })); + } + row.append(App.UI.DOM.generateLinksStrip(linkArray)); + el.append(row); + if (V.incubatorUpgradePregAdaptation === 1) { - /* Should be visible only after incubatorUpgradeReproduction is installed */ - //<br> + // Should be visible only after incubatorUpgradeReproduction is installed + row = document.createElement("row"); linkArray = []; if (V.incubatorPregAdaptationSetting === 3) { - r.push(`Pregnancy adaptation system online: All.`); - linkArray.push(makeLink(`Females`, () => {V.incubatorPregAdaptationSetting = 1})); - linkArray.push(makeLink(`Males`, () => {V.incubatorPregAdaptationSetting = 2})); - linkArray.push(makeLink(`Disable`, () => {V.incubatorPregAdaptationSetting = 0})); - } else if (V.incubatorPregAdaptationSetting === 2) { - r.push(`Pregnancy adaptation system online: Males only.`); - linkArray.push(makeLink(`All`, () => {V.incubatorPregAdaptationSetting = 3})); - linkArray.push(makeLink(`Females`, () => {V.incubatorPregAdaptationSetting = 1})); - linkArray.push(makeLink(`Disable`, () => {V.incubatorPregAdaptationSetting = 0})); - linkArray.push(makeLink(``, () => {})); - } else if (V.incubatorPregAdaptationSetting === 1) { - r.push(`Pregnancy adaptation system online: Females only.`); - linkArray.push(makeLink(`All`, () => {V.incubatorPregAdaptationSetting = 3})); - linkArray.push(makeLink(`Males`, () => {V.incubatorPregAdaptationSetting = 2})); - linkArray.push(makeLink(`Disable`, () => {V.incubatorPregAdaptationSetting = 0})); + row.append(`Pregnancy adaptation system online: All. `); } else { - r.push(`Pregnancy adaptation system offline.`); - linkArray.push(makeLink(`All`, () => {V.incubatorPregAdaptationSetting = 3})); - linkArray.push(makeLink(`Females`, () => {V.incubatorPregAdaptationSetting = 1})); - linkArray.push(makeLink(``, () => {V.incubatorPregAdaptationSetting = 2})); + linkArray.push(makeLink(`All`, () => { V.incubatorPregAdaptationSetting = 3; })); } + + if (V.incubatorPregAdaptationSetting === 2) { + row.append(`Pregnancy adaptation system online: Males only. `); + } else { + linkArray.push(makeLink(`Males`, () => { V.incubatorPregAdaptationSetting = 2; })); + } + + if (V.incubatorPregAdaptationSetting === 1) { + row.append(`Pregnancy adaptation system online: Females only. `); + } else { + linkArray.push(makeLink(`Females`, () => { V.incubatorPregAdaptationSetting = 1; })); + } + + if (V.incubatorPregAdaptationSetting === 0) { + row.append(`Pregnancy adaptation system offline. `); + } else { + linkArray.push(makeLink(`Disable`, () => { V.incubatorPregAdaptationSetting = 0; })); + } + row.append(App.UI.DOM.generateLinksStrip(linkArray)); + el.append(row); } if (V.incubatorUpgradePregAdaptation === 1 && V.incubatorPregAdaptationSetting > 0) { - r.push(` /* Should be visible only after incubatorUpgradeReproduction is installed and turned on*/`); - //<br> + // Should be visible only after incubatorUpgradeReproduction is installed and turned on + row = document.createElement("row"); + linkArray = []; if (V.incubatorPregAdaptationPower === 1) { r.push(`Pregnancy adaptation programmed to advanced procedures. Up to triplet pregnancy should be safe for the subjects.`); - [[Standard | Incubator][V.incubatorPregAdaptationPower = 0]] | [[Intensive | Incubator][V.incubatorPregAdaptationPower = 2]] | [[Extreme | Incubator][V.incubatorPregAdaptationPower = 3]] - } else if (V.incubatorPregAdaptationPower === 2) { + } else { + linkArray.push(makeLink(`Advanced`, () => { V.incubatorPregAdaptationSetting = 1; })); + } + + if (V.incubatorPregAdaptationPower === 2) { r.push(`Pregnancy adaptation programmed to intensive procedures. Up to octuplet pregnancy should be possible for the subjects. Warning! Side effects may occur to health and mental condition.`); - [[Standard | Incubator][V.incubatorPregAdaptationPower = 0]] | [[Advanced | Incubator][V.incubatorPregAdaptationPower = 1]] | [[Extreme | Incubator][V.incubatorPregAdaptationPower = 3]] - } else if (V.incubatorPregAdaptationPower === 3) { + } else { + linkArray.push(makeLink(`Intensive`, () => { V.incubatorPregAdaptationSetting = 2; })); + } + + if (V.incubatorPregAdaptationPower === 3) { r.push(`Pregnancy adaptation programmed to extreme procedures. Normally unsustainable pregnancies may be possible for some subjects. Actual capacity will vary with genetic and other individual conditions. WARNING! Extreme side effects may occur to health and mental condition!`); - [[Standard | Incubator][V.incubatorPregAdaptationPower = 0]] | [[Advanced | Incubator][V.incubatorPregAdaptationPower = 1]] | [[Intensive | Incubator][V.incubatorPregAdaptationPower = 2]] } else { + linkArray.push(makeLink(`Extreme`, () => { V.incubatorPregAdaptationSetting = 3; })); + } + + if (V.incubatorPregAdaptationPower === 0) { r.push(`Pregnancy adaptation programmed to standard procedures. Normal pregnancy should be safe for subjects.`); - [[Advanced | Incubator][V.incubatorPregAdaptationPower = 1]] | [[Intensive | Incubator][V.incubatorPregAdaptationPower = 2]] | [[Extreme | Incubator][V.incubatorPregAdaptationPower = 3]] + } else { + linkArray.push(makeLink(`Standard`, () => { V.incubatorPregAdaptationSetting = 0; })); } - //<br> - //Due to the high complexity and steep risks of the procedure, settings will not be changed on tanks in use.// + row.append(App.UI.DOM.generateLinksStrip(linkArray)); + App.UI.DOM.appendNewElement("span", row, `Due to the high complexity and steep risks of the procedure, settings will not be changed on tanks in use.`, "note"); + el.append(row); } } - //<br> + // <br> if (V.incubatorUpgradeGrowthStims === 1) { if (V.incubatorGrowthStimsSetting === 2) { - r.push(`Children are injected with higher than recommended doses of stimulants; exceeding expected final height is likely. [[Limit|Incubator][V.incubatorGrowthStimsSetting = 1]] | [[Disable|Incubator][V.incubatorGrowthStimsSetting = 0]]`); - } else if (V.incubatorGrowthStimsSetting === 1) { - r.push(`Children are injected with the recommended dosage of stimulants; they will grow to their full expected height. [[Overload|Incubator][V.incubatorGrowthStimsSetting = 2]] | [[Disable|Incubator][V.incubatorGrowthStimsSetting = 0]]`); - } else if (V.incubatorGrowthStimsSetting === 0) { - r.push(`Growth stimulant injection systems are offline; children will develop normally. [[Activate|Incubator][V.incubatorGrowthStimsSetting = 1]]`); + r.push(`Children are injected with higher than recommended doses of stimulants; exceeding expected final height is likely. `); + } else { + linkArray.push(makeLink(`Overload`, () => { V.incubatorGrowthStimsSetting = 2; })); + } + + if (V.incubatorGrowthStimsSetting === 1) { + r.push(`Children are injected with the recommended dosage of stimulants; they will grow to their full expected height. `); + } else { + linkArray.push(makeLink(`Limit`, () => { V.incubatorGrowthStimsSetting = 1; })); + } + + if (V.incubatorGrowthStimsSetting === 0) { + r.push(`Growth stimulant injection systems are offline; children will develop normally. `); + } else { + linkArray.push(makeLink(`Disable`, () => { V.incubatorGrowthStimsSetting = 0; })); } + row.append(App.UI.DOM.generateLinksStrip(linkArray)); + el.append(row); } if (V.readySlaves === 1) { @@ -1505,8 +1539,8 @@ App.Facility.Incubator = function() { for (let _inc = 0; _inc < V.tanks.length;) { if (V.tanks[_inc].growTime <= 0) { V.incubatorOldID = V.tanks[_inc].ID; - r.push(` /* single slave case */`); - _tempObject = { object: V.tanks[_inc], ID: V.tanks[_inc].ID }; + /* single slave case */ + const _tempObject = {object: V.tanks[_inc], ID: V.tanks[_inc].ID}; V.newSlavePool.push(clone(_tempObject)); V.tanks.splice(_inc, 1); _inc--; @@ -1526,13 +1560,22 @@ App.Facility.Incubator = function() { } } } - << goto "Incubator Retrieval Workaround" >> - } + // TODO: fucking fix this + Engine.play("Incubator Retrieval Workaround"); + } - //<br> <br> - Rename V.incubatorName: - //<<textbox "V.incubatorName" V.incubatorName "Incubator">> - r.push(` //Use a noun or similar short phrase//`); + row = document.createElement("row"); + row.append(`Rename ${V.incubatorName}: `); + row.append( + App.UI.DOM.makeTextBox( + V.incubatorName, + (v) => { + V.incubatorName = v; + Engine.play("Incubator"); + } + ) + ); + App.UI.DOM.appendNewElement("span", row, ` Use a noun or similar short phrase`, "note"); } function makeLink(title, func) { @@ -1541,6 +1584,6 @@ App.Facility.Incubator = function() { func, [], "Incubator" - ) + ); } -}; \ No newline at end of file +}; -- GitLab