diff --git a/src/endWeek/events/retire.js b/src/endWeek/events/retire.js index 6032594948d7fe0abd5baf5718e657e55e78b800..56dffde15148b8d8ccaa13c7bfebf34b3cec8dbf 100644 --- a/src/endWeek/events/retire.js +++ b/src/endWeek/events/retire.js @@ -114,19 +114,7 @@ globalThis.retireScene = function(originalSlave) { } App.Events.addParagraph(desc, r); r = []; - let _toSearch; // TODO yuck yuck yuck - let _toSearchAlt; - if (slave.prestigeDesc === 0) { - _toSearch = ""; - } else { - _toSearch = slave.prestigeDesc; - } - if (slave.porn.prestigeDesc === 0) { - _toSearchAlt = ""; - } else { - _toSearchAlt = slave.porn.prestigeDesc; - } - if (_toSearch.indexOf("Head Girl") !== -1 || V.HeadGirlID === slave.ID) { + if (slave.prestigeDesc && slave.prestigeDesc.includes("Head Girl") || V.HeadGirlID === slave.ID) { r.push(`${He} has a reputation from ${his} long service as your Head Girl. To ${his} bemusement, and considerable satisfaction, ${he} has multiple job offers from slaving operations without even having to circulate ${his} resume.`); if (slave.fetish === "sadist") { r.push(`The prospect of a virtually unlimited field for abuse and rape is something ${he}'d pay for, now that ${he} has ${his} own money. ${He}'s excited beyond description to find that there are people interested in paying ${him} to exercise ${his} exquisitely horrible skills.`); @@ -135,7 +123,7 @@ globalThis.retireScene = function(originalSlave) { } else { r.push(`${His} annuity means that ${he} doesn't have to work, but ${he}'s inclined to do so. ${His} skills command reasonable wages in the slave training field, and between those prospects and ${his} annuity, ${he} stands to become wealthy.`); } - } else if (_toSearchAlt.indexOf("is world famous for") !== -1) { + } else if (slave.porn.prestigeDesc && slave.porn.prestigeDesc.includes("is world famous for")) { let _pornFame = slave.porn.prestigeDesc; _pornFame = _pornFame.replace("$He is world famous for $his career in slave pornography. Millions are intimately familiar with", "enjoy"); _pornFame = _pornFame.replace(".", ","); diff --git a/src/endWeek/nextWeek/nextWeek.js b/src/endWeek/nextWeek/nextWeek.js index 19cc42c1edac5d003af1e8067b382db69083b0a9..74d243cfe278874041019318ba1042fd57c9a7c0 100644 --- a/src/endWeek/nextWeek/nextWeek.js +++ b/src/endWeek/nextWeek/nextWeek.js @@ -270,8 +270,7 @@ App.EndWeek.nextWeek = function() { } } - const toSearch = V.PC.refreshment.toLowerCase(); - if (toSearch.indexOf("fertility") !== -1) { + if (V.PC.refreshment.includes("fertility")) { V.PC.forcedFertDrugs = 1; } else if (V.PC.forcedFertDrugs > 0) { V.PC.forcedFertDrugs--; diff --git a/src/facilities/incubator/incubatorInteract.js b/src/facilities/incubator/incubatorInteract.js index d09ba5ed15e06631141cd64f30ce026e7199a00c..fcca66f3cf5a99ca732a01bad75bb0ba65feafc3 100644 --- a/src/facilities/incubator/incubatorInteract.js +++ b/src/facilities/incubator/incubatorInteract.js @@ -90,14 +90,14 @@ App.UI.incubator = function() { }, [], passage() ) - ) + ); } price = Math.trunc(60000 * V.upgradeMultiplierArcology); App.UI.DOM.appendNewElement("div", el, `Adding a tank costs ${cashFormat(price)} and will increase upkeep. `).append(App.UI.DOM.generateLinksStrip(tankBulkOptions)); - + const empty = freeTanks - reservedChildren; if (empty > 0) { - tankBulkOptions = []; + tankBulkOptions = []; for (const multiplier of tankMultiplier) { price = Math.trunc((10000 * multiplier) * V.upgradeMultiplierArcology); if (empty >= multiplier && V.incubator.capacity - multiplier > 0) { @@ -110,7 +110,7 @@ App.UI.incubator = function() { }, [], passage() ) - ) + ); } } price = Math.trunc(10000 * V.upgradeMultiplierArcology); diff --git a/src/futureSocieties/fsDecoration.js b/src/futureSocieties/fsDecoration.js index a8521b78cbfef789adc354b16fcf7a540eea12f1..7861241d48ae57bb351a16903a3729b531e4cb72 100644 --- a/src/futureSocieties/fsDecoration.js +++ b/src/futureSocieties/fsDecoration.js @@ -65,33 +65,40 @@ App.UI.facilityRedecoration = function() { // dummy variable to make sure the first option is selected by default const currentSelected = {value: "none"}; - options.addOption(`The decoration style of ${name} is`, "value", currentSelected) + let option = options.addOption(`Set decoration value for all facilities to`, "value", currentSelected) .addValue("(Select option)", "none") - .addValue("Standard", "standard") - .addValueList(decorationNames) - .addValue("Distribute Evenly", "even") - .addCallbackToEach(value => { - console.log(value); - if (value === "even") { // Cycles through the list of available FS decorations, and distributes them to facilities round robin style. - let i = 0; - for (const decoration of activeFacilities.values()) { - cashX(-5000, "capEx"); + .addValue("Standard", "standard"); + if (decorationNames.length > 0) { + option.addValueList(decorationNames) + .addValue("Distribute Evenly", "even"); + } + option.addCallbackToEach(value => { + console.log(value); + let totalCost = 0; + if (value === "even") { // Cycles through the list of available FS decorations, and distributes them to facilities round robin style. + let i = 0; + for (const decoration of activeFacilities.values()) { + if (V[decoration] !== decorationNames[i]) { + totalCost += 5000; V[decoration] = decorationNames[i]; - i++; - if (i >= decorationNames.length) { - i = 0; - } } - } else { - for (const decoration of activeFacilities.values()) { - if (value !== "standard") { - cashX(-5000, "capEx"); - } - V[decoration] = value; + i++; + if (i >= decorationNames.length) { + i = 0; + } + } + } else if (value !== "none") { + for (const decoration of activeFacilities.values()) { + if (value !== "standard") { + totalCost += 5000; } + V[decoration] = value; } - }) - .pulldown(); + } + if (totalCost > 0) { + cashX(forceNeg(totalCost), "capEx"); + } + }).pulldown(); for (const [name, decoration] of activeFacilities) { options.addOption(`The decoration style of ${name} is`, decoration) diff --git a/src/futureSocieties/fsPassage.js b/src/futureSocieties/fsPassage.js index 47aa8eaa69d4800a591e587e08115b7265d41dca..61b46e1489aeb9ee2716055f28074bd6b0fd6b2c 100644 --- a/src/futureSocieties/fsPassage.js +++ b/src/futureSocieties/fsPassage.js @@ -299,25 +299,13 @@ App.UI.fsPassage = function() { () => { for (const slave of V.slaves) { if (slave.devotion > 20 || (slave.devotion >= -20 && slave.trust < -20)) { - const _toSearch = slave.slaveName; - if (_toSearch.indexOf("Miss") === -1) { - if (_toSearch.indexOf("Ms.") === -1) { - if (_toSearch.indexOf("Mrs.") === -1) { - if (slave.relationship > 4) { - /* - <<for V.j = 0; V.j < V.slaves.length; V.j++>> - if (slave.relationshipTarget === V.slaves[V.j].ID) { - slave.slaveName = ("Mrs. " + slave.slaveName + " " + V.slaves[V.j].slaveName); - } - <</for>> - */ - slave.slaveName = ("Mrs. " + slave.slaveName); - } else if (slave.actualAge > 24) { - slave.slaveName = ("Ms. " + slave.slaveName); - } else { - slave.slaveName = ("Miss " + slave.slaveName); - } - } + if (!["Miss", "Ms.", "Mrs."].some(title => slave.slaveName.includes(title))) { + if (slave.relationship > 4) { + slave.slaveName = ("Mrs. " + slave.slaveName); + } else if (slave.actualAge > 24) { + slave.slaveName = ("Ms. " + slave.slaveName); + } else { + slave.slaveName = ("Miss " + slave.slaveName); } } } diff --git a/src/interaction/main/toychest.js b/src/interaction/main/toychest.js index 407e339838055102c48191d299270d3966e642b4..bd1b307b1e3d479e0e42141f10e989565eb89aa1 100644 --- a/src/interaction/main/toychest.js +++ b/src/interaction/main/toychest.js @@ -158,7 +158,7 @@ App.Interact.ToyChest = function(slave) { case "attractive lingerie for a pregnant woman": r += `${His} breasts gently spill out of ${his} slightly too small top.`; if (slave.lactation) { - r += `${His} leaking nipples have rendered ${his} top see-through.`; + r += ` ${His} leaking nipples have rendered ${his} top see-through.`; } break; case "a maternity dress": diff --git a/src/interaction/multiImplant.js b/src/interaction/multiImplant.js index be65676c7da4a594297ea53e90323c92803e29e7..87ef27e9abb7fdfdb0e961e4d6fdd9d1af8642cb 100644 --- a/src/interaction/multiImplant.js +++ b/src/interaction/multiImplant.js @@ -47,7 +47,7 @@ App.UI.multiImplant = function() { App.UI.DOM.appendNewElement("div", frag, error, "warning"); } } else if (slave.health.health - actions[k].healthImpact < -75) { - App.UI.Dom.appendNewElement("div", frag, "Estimated health impact too high, skipping further surgeries."); + App.UI.DOM.appendNewElement("div", frag, "Estimated health impact too high, skipping further surgeries."); cancel = true; break; } else { @@ -58,7 +58,7 @@ App.UI.multiImplant = function() { } if (cancel) { break; } if (!success && manual) { - App.UI.Dom.appendNewElement("div", frag, `Cannot implant ${F.Organs.get(sortedOrgans[j]).name.toLowerCase()} automatically, try implanting manually in the remote surgery.`, "note"); + App.UI.DOM.appendNewElement("div", frag, `Cannot implant ${F.Organs.get(sortedOrgans[j]).name.toLowerCase()} automatically, try implanting manually in the remote surgery.`, "note"); } } } diff --git a/src/player/desc/playerBelly.js b/src/player/desc/playerBelly.js index 1ea8b10e09c17c835b77a16c04878f6e7821de7e..4ae76b84930d27ab39c4eadbf68e5a6731af9b2a 100644 --- a/src/player/desc/playerBelly.js +++ b/src/player/desc/playerBelly.js @@ -1,9 +1,7 @@ App.Desc.Player.belly = function() { const r = []; const children = V.PC.pregType > 1 ? "children" : "child"; - let fertRefresh; - let toSearch; - let babyDaddy; + const fertRefresh = V.PC.refreshment.includes("fertility") ? 1 : 0; let adjust; const {girlP} = getPronouns(V.PC).appendSuffix("P"); @@ -87,11 +85,6 @@ App.Desc.Player.belly = function() { } else if (V.PC.belly >= 105000) { r.push(`You can barely function any more. You're so big and heavy that even the simplest of actions requires both intense effort and thought just to get it done. Your frumpy dress is also at its limit, and much to your annoyance, your children will not stay still enough to let you fix it.`); } else if (V.PC.belly >= 90000) { - toSearch = V.PC.refreshment.toLowerCase(); - fertRefresh = 0; - if (toSearch.indexOf("fertility") !== -1) { - fertRefresh = 1; - } r.push(`You may have a`); if (fertRefresh === 1) { r.push(`problem, but then again, you did take all those fertility drugs, so you can't really say you didn't want it.`); @@ -222,7 +215,7 @@ App.Desc.Player.belly = function() { } else if (V.PC.preg === 22) { r.push(`Something startling happened this week; while enjoying a slave, your belly button popped out!`); } else if (V.PC.preg === 8 && V.PC.pregSource > 0) { - babyDaddy = findFather(V.PC.pregSource); + const babyDaddy = findFather(V.PC.pregSource); if (babyDaddy) { adjust = babyDaddy.counter.PCKnockedUp++; adjustFatherProperty(babyDaddy, "PCKnockedUp", adjust); @@ -254,10 +247,6 @@ App.Desc.Player.belly = function() { } else if (V.PC.belly >= 105000) { r.push(`You can barely function any more. You're so big and heavy that even the simplest of actions requires both intense effort and thought just to get it done. None of your poses work with your gravid body either, and you're practically popping out of your skimpiest outfit.`); } else if (V.PC.belly >= 90000) { - let toSearch = V.PC.refreshment.toLowerCase(), fertRefresh = 0; - if (toSearch.indexOf("fertility") !== -1) { - fertRefresh = 1; - } if (fertRefresh === 1) { r.push(`You may have a problem, but then again, you did take all those fertility drugs, so you can't really say you didn't want it.`); } else { @@ -367,7 +356,7 @@ App.Desc.Player.belly = function() { } else if (V.PC.preg === 22) { r.push(`Something startling happened this week; while enjoying a slave, your belly button popped out!`); } else if (V.PC.preg === 8 && V.PC.pregSource > 0) { - babyDaddy = findFather(V.PC.pregSource); + const babyDaddy = findFather(V.PC.pregSource); if (babyDaddy) { adjust = babyDaddy.counter.PCKnockedUp++; adjustFatherProperty(babyDaddy, "PCKnockedUp", adjust); @@ -399,10 +388,6 @@ App.Desc.Player.belly = function() { } else if (V.PC.belly >= 105000) { r.push(`You can barely function any more. You're so big and heavy that even the simplest of actions requires both intense effort and thought just to get it done. Your suit buttons keep popping, and much to your annoyance, your ${children} will not stay still enough to let you redo them.`); } else if (V.PC.belly >= 90000) { - let toSearch = V.PC.refreshment.toLowerCase(), fertRefresh = 0; - if (toSearch.indexOf("fertility") !== -1) { - fertRefresh = 1; - } if (fertRefresh === 1) { r.push(`You may have a problem, but then again, you did take all those fertility drugs, so you can't really say you didn't want it.`); } else { @@ -490,7 +475,7 @@ App.Desc.Player.belly = function() { } else if (V.PC.preg === 22) { r.push(`Something startling happened this week; while enjoying a slave, your belly button popped out!`); } else if (V.PC.preg === 8 && V.PC.pregSource > 0) { - babyDaddy = findFather(V.PC.pregSource); + const babyDaddy = findFather(V.PC.pregSource); if (babyDaddy) { adjust = babyDaddy.counter.PCKnockedUp++; adjustFatherProperty(babyDaddy, "PCKnockedUp", adjust);