diff --git a/src/facilities/incubator/incubatorInteract.js b/src/facilities/incubator/incubatorInteract.js index b47fed5fc8a55e22e905b3ac722b515ecbdfcf1e..130c63161c8053c6c91eb0dd0747808e836c0fdd 100644 --- a/src/facilities/incubator/incubatorInteract.js +++ b/src/facilities/incubator/incubatorInteract.js @@ -997,10 +997,10 @@ App.UI.incubator = function() { } App.Events.addNode(p, r, "div"); - r = []; + linkArray = []; if (V.tanks[i].ovaries === 0) { if (V.tankOrgans.ovaries !== 1) { - r.push( + linkArray.push( makeLink( "Prepare ovaries", () => { @@ -1010,23 +1010,23 @@ App.UI.incubator = function() { ) ); } else { - r.push(App.UI.DOM.makeElement("span", `Ovaries are already prepared.`, "detail")); + linkArray.push(App.UI.DOM.makeElement("span", `Ovaries are already prepared.`, "detail")); } } if (V.tanks[i].dick === 0) { if (V.tankOrgans.penis !== 1) { - r.push( + linkArray.push( makeLink("Prepare penis", () => { App.Medicine.OrganFarm.growIncubatorOrgan(V.tanks[i], "penis"); }, refresh) ); } else { - r.push(App.UI.DOM.makeElement("span", `A penis is already prepared`, "detail")); + linkArray.push(App.UI.DOM.makeElement("span", `A penis is already prepared`, "detail")); } } if (V.tanks[i].balls === 0) { if (V.tankOrgans.testicles !== 1) { - r.push(makeLink("Prepare testicles", () => { App.Medicine.OrganFarm.growIncubatorOrgan(V.tanks[i], "testicles"); }, refresh)); + linkArray.push(makeLink("Prepare testicles", () => { App.Medicine.OrganFarm.growIncubatorOrgan(V.tanks[i], "testicles"); }, refresh)); } else { - r.push(App.UI.DOM.makeElement("span", `Testicles are already prepared.`, "detail")); + linkArray.push(App.UI.DOM.makeElement("span", `Testicles are already prepared.`, "detail")); } } const vision = { @@ -1035,20 +1035,20 @@ App.UI.incubator = function() { }; if (vision.left === 0 || vision.right === 0) { if (vision.left === 0 && vision.right === 0) { - r.push(App.UI.DOM.makeElement("span", `${He} appears to be blind in both eyes:`)); + linkArray.push(App.UI.DOM.makeElement("span", `${He} appears to be blind in both eyes:`)); } else if (vision.left === 0) { - r.push(App.UI.DOM.makeElement("span", `${He} appears to be blind in ${his} left eye:`)); + linkArray.push(App.UI.DOM.makeElement("span", `${He} appears to be blind in ${his} left eye:`)); } else { - r.push(App.UI.DOM.makeElement("span", `${He} appears to be blind in ${his} right eye:`)); + linkArray.push(App.UI.DOM.makeElement("span", `${He} appears to be blind in ${his} right eye:`)); } if (vision.left === 0 && V.tankOrgans.leftEye !== 1) { - r.push(makeLink("Prepare left eye", () => { App.Medicine.OrganFarm.growIncubatorOrgan(V.tanks[i], "leftEye"); }, refresh)); + linkArray.push(makeLink("Prepare left eye", () => { App.Medicine.OrganFarm.growIncubatorOrgan(V.tanks[i], "leftEye"); }, refresh)); } if (vision.right === 0 && V.tankOrgans.rightEye !== 1) { - r.push(makeLink("Prepare right eye", () => { App.Medicine.OrganFarm.growIncubatorOrgan(V.tanks[i], "rightEye"); }, refresh)); + linkArray.push(makeLink("Prepare right eye", () => { App.Medicine.OrganFarm.growIncubatorOrgan(V.tanks[i], "rightEye"); }, refresh)); } if (vision.left === 0 && vision.right === 0 && linkArray.length === 2) { - r.push( + linkArray.push( makeLink( "Prepare right eye", () => { @@ -1060,14 +1060,14 @@ App.UI.incubator = function() { ); } if (vision.left === 0 && vision.right === 0 && linkArray.length === 0) { - r.push(App.UI.DOM.makeElement("span", `Both eyes are already prepared.`, `detail`)); + linkArray.push(App.UI.DOM.makeElement("span", `Both eyes are already prepared.`, `detail`)); } else if (V.tankOrgans.leftEye === 1) { - r.push(App.UI.DOM.makeElement("span", `A left eye is already prepared.`, `detail`)); + linkArray.push(App.UI.DOM.makeElement("span", `A left eye is already prepared.`, `detail`)); } else if (V.tankOrgans.rightEye === 1) { - r.push(App.UI.DOM.makeElement("span", `A right eye is already prepared.`, `detail`)); + linkArray.push(App.UI.DOM.makeElement("span", `A right eye is already prepared.`, `detail`)); } } - App.UI.DOM.appendNewElement("div", p, App.UI.DOM.generateLinksStrip(r)); + App.UI.DOM.appendNewElement("div", p, App.UI.DOM.generateLinksStrip(linkArray)); if (V.tanks[i].voice === 0) { r = []; r.push(`${He} appears to be mute: `); @@ -1083,204 +1083,6 @@ App.UI.incubator = function() { } } - if (V.incubatorUpgradeWeight === 1) { - row = document.createElement("row"); - if (V.incubatorWeightSetting === 1) { - row.append(`Weight is not being properly managed; excessive weight gain is likely. `); - } else { - linkArray.push(makeLink(`Estimate only`, () => { V.incubatorWeightSetting = 1; }, refresh)); - } - - if (V.incubatorWeightSetting === 2) { - row.append(`Weight is being carefully managed; children will be released at a healthy weight. `); - } else { - linkArray.push(makeLink(`Activate`, () => { V.incubatorWeightSetting = 2; }, refresh)); - } - - if (V.incubatorWeightSetting === 0) { - row.append(`Weight management systems are offline; children will likely be malnourished. `); - } else { - linkArray.push(makeLink(`Disable`, () => { V.incubatorWeightSetting = 0; }, refresh)); - } - row.append(App.UI.DOM.generateLinksStrip(linkArray)); - el.append(row); - } - - if (V.incubatorUpgradeMuscles === 1) { - row = document.createElement("row"); - if (V.incubatorMusclesSetting === 2) { - row.append(`Strength levels are purposefully set higher than recommended; excessive muscle gain is likely. `); - } else { - linkArray.push(makeLink(`Overload`, () => { V.incubatorMusclesSetting = 2; }, refresh)); - } - - if (V.incubatorMusclesSetting === 1) { - row.append(`Musculature is being carefully managed; children will be released with near normal strength. `); - } else { - linkArray.push(makeLink(`Activate`, () => { V.incubatorMusclesSetting = 1; }, refresh)); - } - - if (V.incubatorMusclesSetting === 0) { - row.append(`Strength management systems are offline; children will likely be released extremely weak. `); - } else { - linkArray.push(makeLink(`Disable`, () => { V.incubatorMusclesSetting = 0; }, refresh)); - } - - row.append(App.UI.DOM.generateLinksStrip(linkArray)); - el.append(row); - } - - if (V.incubatorUpgradeReproduction === 1) { - row = document.createElement("row"); - if (V.incubatorReproductionSetting === 2) { - row.append(`Hormone levels are purposefully set higher than recommended; over-active reproductive systems are likely. `); - } else { - linkArray.push(makeLink(`Overload`, () => { V.incubatorReproductionSetting = 2; }, refresh)); - } - - 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; }, refresh)); - } - - if (V.incubatorReproductionSetting === 0) { - row.append(`Reproduction management systems are offline; children will undergo normal puberty. `); - } else { - linkArray.push(makeLink(`Disable`, () => { V.incubatorReproductionSetting = 0; }, refresh)); - } - row.append(App.UI.DOM.generateLinksStrip(linkArray)); - el.append(row); - - if (V.incubatorUpgradePregAdaptation === 1) { - // Should be visible only after incubatorUpgradeReproduction is installed - row = document.createElement("row"); - linkArray = []; - if (V.incubatorPregAdaptationSetting === 3) { - row.append(`Pregnancy adaptation system online: All. `); - } else { - linkArray.push(makeLink(`All`, () => { V.incubatorPregAdaptationSetting = 3; }, refresh)); - } - - if (V.incubatorPregAdaptationSetting === 2) { - row.append(`Pregnancy adaptation system online: Males only. `); - } else { - linkArray.push(makeLink(`Males`, () => { V.incubatorPregAdaptationSetting = 2; }, refresh)); - } - - if (V.incubatorPregAdaptationSetting === 1) { - row.append(`Pregnancy adaptation system online: Females only. `); - } else { - linkArray.push(makeLink(`Females`, () => { V.incubatorPregAdaptationSetting = 1; }, refresh)); - } - - if (V.incubatorPregAdaptationSetting === 0) { - row.append(`Pregnancy adaptation system offline. `); - } else { - linkArray.push(makeLink(`Disable`, () => { V.incubatorPregAdaptationSetting = 0; }, refresh)); - } - row.append(App.UI.DOM.generateLinksStrip(linkArray)); - el.append(row); - } - if (V.incubatorUpgradePregAdaptation === 1 && V.incubatorPregAdaptationSetting > 0) { - // Should be visible only after incubatorUpgradeReproduction is installed and turned on - row = document.createElement("row"); - linkArray = []; - if (V.incubatorPregAdaptationPower === 1) { - row.append(`Pregnancy adaptation programmed to advanced procedures. Up to triplet pregnancy should be safe for the subjects.`); - } else { - linkArray.push(makeLink(`Advanced`, () => { V.incubatorPregAdaptationSetting = 1; }, refresh)); - } - - if (V.incubatorPregAdaptationPower === 2) { - row.append(`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.`); - } else { - linkArray.push(makeLink(`Intensive`, () => { V.incubatorPregAdaptationSetting = 2; }, refresh)); - } - - if (V.incubatorPregAdaptationPower === 3) { - row.append(`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!`); - } else { - linkArray.push(makeLink(`Extreme`, () => { V.incubatorPregAdaptationSetting = 3; }, refresh)); - } - - if (V.incubatorPregAdaptationPower === 0) { - row.append(`Pregnancy adaptation programmed to standard procedures. Normal pregnancy should be safe for subjects.`); - } else { - linkArray.push(makeLink(`Standard`, () => { V.incubatorPregAdaptationSetting = 0; }, refresh)); - } - 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); - } - } - - if (V.incubatorUpgradeGrowthStims === 1) { - row = document.createElement("row"); - if (V.incubatorGrowthStimsSetting === 2) { - row.append(`Children are injected with higher than recommended doses of stimulants; exceeding expected final height is likely. `); - } else { - linkArray.push(makeLink(`Overload`, () => { V.incubatorGrowthStimsSetting = 2; }, refresh)); - } - - if (V.incubatorGrowthStimsSetting === 1) { - row.append(`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; }, refresh)); - } - - if (V.incubatorGrowthStimsSetting === 0) { - row.append(`Growth stimulant injection systems are offline; children will develop normally. `); - } else { - linkArray.push(makeLink(`Disable`, () => { V.incubatorGrowthStimsSetting = 0; }, refresh)); - } - row.append(App.UI.DOM.generateLinksStrip(linkArray)); - el.append(row); - } - - if (V.readySlaves === 1) { - if (V.incubatorBulkRelease === 1) { - V.newSlavePool = []; - for (let _inc = 0; _inc < V.tanks.length; _inc++) { - if (V.tanks[_inc].growTime <= 0) { - V.incubatorOldID = 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--; - } - } - if (V.newSlavePool.length === 1) { - V.readySlave = V.newSlavePool[0].object; - V.newSlavePool = 0; - } - } else { - for (let _inc = 0; _inc < V.incubatorSlaves; _inc++) { - if (V.tanks[_inc].growTime <= 0) { - V.incubatorOldID = V.tanks[_inc].ID; - V.readySlave = V.tanks[_inc]; - V.tanks.splice(_inc, 1); - break; - } - } - } - // TODO: fucking fix this - Engine.play("Incubator Retrieval Workaround"); - } - - row = document.createElement("row"); - row.append(`Rename ${V.incubatorName}: `); - row.append( - App.UI.DOM.makeTextBox( - V.incubatorName, - (v) => { - V.incubatorName = v; - refresh(); - } - ) - ); - App.UI.DOM.appendNewElement("span", row, ` Use a noun or similar short phrase`, "note"); return el; function refresh() { @@ -1645,6 +1447,210 @@ App.UI.incubator = function() { ) ); } + + if (V.incubatorUpgradeWeight === 1) { + row = document.createElement("row"); + linkArray = []; + if (V.incubatorWeightSetting === 1) { + row.append(`Weight is not being properly managed; excessive weight gain is likely. `); + } else { + linkArray.push(makeLink(`Estimate only`, () => { V.incubatorWeightSetting = 1; }, refresh)); + } + + if (V.incubatorWeightSetting === 2) { + row.append(`Weight is being carefully managed; children will be released at a healthy weight. `); + } else { + linkArray.push(makeLink(`Activate`, () => { V.incubatorWeightSetting = 2; }, refresh)); + } + + if (V.incubatorWeightSetting === 0) { + row.append(`Weight management systems are offline; children will likely be malnourished. `); + } else { + linkArray.push(makeLink(`Disable`, () => { V.incubatorWeightSetting = 0; }, refresh)); + } + row.append(App.UI.DOM.generateLinksStrip(linkArray)); + el.append(row); + } + + if (V.incubatorUpgradeMuscles === 1) { + row = document.createElement("row"); + linkArray = []; + if (V.incubatorMusclesSetting === 2) { + row.append(`Strength levels are purposefully set higher than recommended; excessive muscle gain is likely. `); + } else { + linkArray.push(makeLink(`Overload`, () => { V.incubatorMusclesSetting = 2; }, refresh)); + } + + if (V.incubatorMusclesSetting === 1) { + row.append(`Musculature is being carefully managed; children will be released with near normal strength. `); + } else { + linkArray.push(makeLink(`Activate`, () => { V.incubatorMusclesSetting = 1; }, refresh)); + } + + if (V.incubatorMusclesSetting === 0) { + row.append(`Strength management systems are offline; children will likely be released extremely weak. `); + } else { + linkArray.push(makeLink(`Disable`, () => { V.incubatorMusclesSetting = 0; }, refresh)); + } + + row.append(App.UI.DOM.generateLinksStrip(linkArray)); + el.append(row); + } + + if (V.incubatorUpgradeReproduction === 1) { + row = document.createElement("row"); + linkArray = []; + if (V.incubatorReproductionSetting === 2) { + row.append(`Hormone levels are purposefully set higher than recommended; over-active reproductive systems are likely. `); + } else { + linkArray.push(makeLink(`Overload`, () => { V.incubatorReproductionSetting = 2; }, refresh)); + } + + 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; }, refresh)); + } + + if (V.incubatorReproductionSetting === 0) { + row.append(`Reproduction management systems are offline; children will undergo normal puberty. `); + } else { + linkArray.push(makeLink(`Disable`, () => { V.incubatorReproductionSetting = 0; }, refresh)); + } + row.append(App.UI.DOM.generateLinksStrip(linkArray)); + el.append(row); + + if (V.incubatorUpgradePregAdaptation === 1) { + // Should be visible only after incubatorUpgradeReproduction is installed + row = document.createElement("row"); + linkArray = []; + if (V.incubatorPregAdaptationSetting === 3) { + row.append(`Pregnancy adaptation system online: All. `); + } else { + linkArray.push(makeLink(`All`, () => { V.incubatorPregAdaptationSetting = 3; }, refresh)); + } + + if (V.incubatorPregAdaptationSetting === 2) { + row.append(`Pregnancy adaptation system online: Males only. `); + } else { + linkArray.push(makeLink(`Males`, () => { V.incubatorPregAdaptationSetting = 2; }, refresh)); + } + + if (V.incubatorPregAdaptationSetting === 1) { + row.append(`Pregnancy adaptation system online: Females only. `); + } else { + linkArray.push(makeLink(`Females`, () => { V.incubatorPregAdaptationSetting = 1; }, refresh)); + } + + if (V.incubatorPregAdaptationSetting === 0) { + row.append(`Pregnancy adaptation system offline. `); + } else { + linkArray.push(makeLink(`Disable`, () => { V.incubatorPregAdaptationSetting = 0; }, refresh)); + } + row.append(App.UI.DOM.generateLinksStrip(linkArray)); + el.append(row); + } + if (V.incubatorUpgradePregAdaptation === 1 && V.incubatorPregAdaptationSetting > 0) { + // Should be visible only after incubatorUpgradeReproduction is installed and turned on + row = document.createElement("row"); + linkArray = []; + if (V.incubatorPregAdaptationPower === 1) { + row.append(`Pregnancy adaptation programmed to advanced procedures. Up to triplet pregnancy should be safe for the subjects.`); + } else { + linkArray.push(makeLink(`Advanced`, () => { V.incubatorPregAdaptationSetting = 1; }, refresh)); + } + + if (V.incubatorPregAdaptationPower === 2) { + row.append(`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.`); + } else { + linkArray.push(makeLink(`Intensive`, () => { V.incubatorPregAdaptationSetting = 2; }, refresh)); + } + + if (V.incubatorPregAdaptationPower === 3) { + row.append(`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!`); + } else { + linkArray.push(makeLink(`Extreme`, () => { V.incubatorPregAdaptationSetting = 3; }, refresh)); + } + + if (V.incubatorPregAdaptationPower === 0) { + row.append(`Pregnancy adaptation programmed to standard procedures. Normal pregnancy should be safe for subjects.`); + } else { + linkArray.push(makeLink(`Standard`, () => { V.incubatorPregAdaptationSetting = 0; }, refresh)); + } + 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); + } + } + + if (V.incubatorUpgradeGrowthStims === 1) { + row = document.createElement("row"); + linkArray = []; + if (V.incubatorGrowthStimsSetting === 2) { + row.append(`Children are injected with higher than recommended doses of stimulants; exceeding expected final height is likely. `); + } else { + linkArray.push(makeLink(`Overload`, () => { V.incubatorGrowthStimsSetting = 2; }, refresh)); + } + + if (V.incubatorGrowthStimsSetting === 1) { + row.append(`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; }, refresh)); + } + + if (V.incubatorGrowthStimsSetting === 0) { + row.append(`Growth stimulant injection systems are offline; children will develop normally. `); + } else { + linkArray.push(makeLink(`Disable`, () => { V.incubatorGrowthStimsSetting = 0; }, refresh)); + } + row.append(App.UI.DOM.generateLinksStrip(linkArray)); + el.append(row); + } + + if (V.readySlaves === 1) { + if (V.incubatorBulkRelease === 1) { + V.newSlavePool = []; + for (let _inc = 0; _inc < V.tanks.length; _inc++) { + if (V.tanks[_inc].growTime <= 0) { + V.incubatorOldID = 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--; + } + } + if (V.newSlavePool.length === 1) { + V.readySlave = V.newSlavePool[0].object; + V.newSlavePool = 0; + } + } else { + for (let _inc = 0; _inc < V.incubatorSlaves; _inc++) { + if (V.tanks[_inc].growTime <= 0) { + V.incubatorOldID = V.tanks[_inc].ID; + V.readySlave = V.tanks[_inc]; + V.tanks.splice(_inc, 1); + break; + } + } + } + // TODO: fucking fix this + Engine.play("Incubator Retrieval Workaround"); + } + + row = document.createElement("row"); + row.append(`Rename ${V.incubatorName}: `); + row.append( + App.UI.DOM.makeTextBox( + V.incubatorName, + (v) => { + V.incubatorName = v; + refresh(); + } + ) + ); + App.UI.DOM.appendNewElement("span", row, ` Use a noun or similar short phrase`, "note"); + return el; function refresh() {