diff --git a/src/js/DefaultRules.js b/src/js/DefaultRules.js index d1867b5354fc486c0dd586300a5b4283857d846e..ad0ec052a1263b54b0acff0a2969e7f30c922c34 100644 --- a/src/js/DefaultRules.js +++ b/src/js/DefaultRules.js @@ -2774,13 +2774,15 @@ window.DefaultRules = (function() { } else if (!hasLeftArm(slave)) { if (brandPlace === "both") { brandPlace = "right"; - } if (brandPlace === "left") { + } + if (brandPlace === "left") { brandPlace = ""; } } else if (!hasRightArm(slave)) { if (brandPlace === "both") { brandPlace = "left"; - } if (brandPlace === "right") { + } + if (brandPlace === "right") { brandPlace = ""; } } @@ -2791,13 +2793,15 @@ window.DefaultRules = (function() { } else if (!hasLeftLeg(slave)) { if (brandPlace === "both") { brandPlace = "right"; - } if (brandPlace === "left") { + } + if (brandPlace === "left") { brandPlace = ""; } } else if (!hasRightLeg(slave)) { if (brandPlace === "both") { brandPlace = "left"; - } if (brandPlace === "right") { + } + if (brandPlace === "right") { brandPlace = ""; } } diff --git a/src/js/assayJS.js b/src/js/assayJS.js index ebd3bd69d223365420e128304c960aa9f0a0babf..11a985e8d18c5149cf2b9e9bc8a14bb43b7aa42c 100644 --- a/src/js/assayJS.js +++ b/src/js/assayJS.js @@ -1430,19 +1430,19 @@ window.DegradingName = function DegradingName(slave) { }; window.PaternalistName = function PaternalistName(slave) { - if (slave.slaveName.search("Miss") === -1) { - if (slave.slaveName.search("Ms.") === -1) { - if (slave.slaveName.search("Mrs.") === -1) { - 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); - } - } - } - } + if (slave.slaveName.search("Miss") === -1) { + if (slave.slaveName.search("Ms.") === -1) { + if (slave.slaveName.search("Mrs.") === -1) { + 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); + } + } + } + } }; window.SlaveSort = function() { diff --git a/src/js/datatypeCleanupJS.js b/src/js/datatypeCleanupJS.js index f3db920c0c852ae293c0b79aba216a96ffee5698..f85228f52b8e70c3725a5f50d34be999b9a8aece 100644 --- a/src/js/datatypeCleanupJS.js +++ b/src/js/datatypeCleanupJS.js @@ -22,27 +22,27 @@ App.Entity.Utils.SlaveDataSchemeCleanup = (function() { migrateScars(slave); App.Entity.Utils.migratePronouns(slave); } - + /** * @param {App.Entity.SlaveState} slave */ function migrateRules(slave) { if (!slave.hasOwnProperty("rules")) { - slave.rules = new App.Entity.Rulestate(); + slave.rules = new App.Entity.Rulestate(); slave.rules.lactation = slave.lactationRules; - delete slave.lactationRules; + delete slave.lactationRules; slave.rules.living = slave.livingRules; - delete slave.livingRules; + delete slave.livingRules; slave.rules.relationship = slave.relationshipRules; - delete slave.relationshipRules; + delete slave.relationshipRules; slave.rules.release = slave.releaseRules; - delete slave.releaseRules; + delete slave.releaseRules; slave.rules.speech = slave.speechRules; - delete slave.speechRules; + delete slave.speechRules; slave.rules.punishment = slave.standardPunishment; - delete slave.standardPunishment; + delete slave.standardPunishment; slave.rules.reward = slave.standardReward; - delete slave.standardReward; + delete slave.standardReward; } } @@ -73,27 +73,27 @@ App.Entity.Utils.SlaveDataSchemeCleanup = (function() { delete slave.pornFocus; } } - + if (slave.hasOwnProperty("pornFeed")) { slave.porn.feed = slave.pornFeed; delete slave.pornFeed; } - + if (slave.hasOwnProperty("pornFame")) { slave.porn.viewerCount = slave.pornFame; delete slave.pornFame; } - + if (slave.hasOwnProperty("pornFameSpending")) { slave.porn.spending = slave.pornFameSpending; delete slave.pornFameSpending; } - + if (slave.hasOwnProperty("pornPrestige")) { slave.porn.prestige = slave.pornPrestige; delete slave.pornPrestige; } - + if (slave.hasOwnProperty("pornPrestigeDesc")) { slave.porn.prestigeDesc = slave.pornPrestigeDesc; delete slave.pornPrestigeDesc; diff --git a/src/js/descriptionWidgets.js b/src/js/descriptionWidgets.js index 2d7d6055139cbbbcdbfa92a8a29ba8bfed7f2f25..f82371e36deaa1664d36eab5b88e8564b66f190a 100644 --- a/src/js/descriptionWidgets.js +++ b/src/js/descriptionWidgets.js @@ -313,8 +313,8 @@ App.Desc.eyeColor = function(slave) { // temporary while eye rework // TODO remove @Arkerthan App.Desc.eyesColor = function(slave) { - return `${App.Desc.eyeColor(slave)} eyes` -} + return `${App.Desc.eyeColor(slave)} eyes`; +}; /** * @param {App.Entity.SlaveState} slave diff --git a/src/js/generateMarketSlave.js b/src/js/generateMarketSlave.js index 179faef0236dc0c2bc78b5653269c04a0bf927a8..f953c230689ae76b59aa9511ea5e7abcbc53f14e 100644 --- a/src/js/generateMarketSlave.js +++ b/src/js/generateMarketSlave.js @@ -1138,7 +1138,7 @@ window.generateMarketSlave = function(market = "kidnappers", numArcology = 1) { V.activeSlave.smells = -1; V.activeSlave.tastes = -1; if (V.seeExtreme === 1) { - removeLimbs(V.activeSlave,"all"); + removeLimbs(V.activeSlave, "all"); V.activeSlave.earShape = "none"; } if (hasAnyLegs(V.activeSlave)) { diff --git a/src/js/generateNewSlaveJS.js b/src/js/generateNewSlaveJS.js index 4d77c5a1f4b42106154f90e5f58226cdcf7974f5..cfc4e3c7efdd264163235c50fd5912af6753f019 100644 --- a/src/js/generateNewSlaveJS.js +++ b/src/js/generateNewSlaveJS.js @@ -798,7 +798,7 @@ window.GenerateNewSlave = (function() { let minorSizeAdjustment = 0; while (randomRoll > volume_dist[actualSize]) { - actualSize = actualSize + 1; + actualSize += 1; } if (Math.random() < 0.5) { minorSizeAdjustment = (Math.floor(Math.random() * 2) + 1) * 50; diff --git a/src/js/proxies.js b/src/js/proxies.js index d729f7d8d934326d7a054d01bf1dcff2874f8dc7..9ce94c7366f622e34bf28802f616152f3dc35320 100644 --- a/src/js/proxies.js +++ b/src/js/proxies.js @@ -1,58 +1,56 @@ window.createReadonlyProxy = function(target) { - if(target.__isReadonlyProxy) return target; + if (target.__isReadonlyProxy) { return target; } return new Proxy(target, { - get:function(o, prop) { - if(prop == '__isReadonlyProxy') return true; + get: function(o, prop) { + if (prop == '__isReadonlyProxy') { return true; } return createReadonlyProxy(o[prop]); }, - set:function(o, prop, value) { + set: function(o, prop, value) { return false; }, - deleteProperty:function(o, prop) { + deleteProperty: function(o, prop) { return false; } - }) + }); }; window.createCheatProxy = function(target) { - if(target.__isCheatProxy) return target; + if (target.__isCheatProxy) { return target; } return new Proxy(target, { - get:function(o, prop) { - if(prop == '__isCheatProxy') return true; + get: function(o, prop) { + if (prop == '__isCheatProxy') { return true; } return createCheatProxy(o[prop]); }, - set:function(o, prop, value) { + set: function(o, prop, value) { o[prop] = value; State.variables.cheater = 1; return true; }, - deleteProperty:function(o, prop) { + deleteProperty: function(o, prop) { delete o[prop]; State.variables.cheater = 1; return false; } - }) -} + }); +}; Object.defineProperty(window, "V", { get: function() { - if(window.storyProxy != null) return window.storyProxy; + if (window.storyProxy != null) { return window.storyProxy; } return State.variables; } }); -window.runWithReadonlyProxy = function(callback) -{ +window.runWithReadonlyProxy = function(callback) { window.storyProxy = createReadonlyProxy(State.variables); try { callback(); } finally { window.storyProxy = null; } -} -window.runWithCheatProxy = function(callback) -{ +}; +window.runWithCheatProxy = function(callback) { window.storyProxy = createCheatProxy(State.variables); try { callback(); } finally { window.storyProxy = null; } -} +}; diff --git a/src/js/slaveCostJS.js b/src/js/slaveCostJS.js index aee3276c89f4d12a55bf3a9442b5d03f649b25dd..b1c62aa7eec671e04ec849f843247d22d02cbb27 100644 --- a/src/js/slaveCostJS.js +++ b/src/js/slaveCostJS.js @@ -1388,7 +1388,7 @@ window.Beauty = (function() { } if (slave.breedingMark === 1) { if (V.propOutcome === 1 && V.arcologies[0].FSRestart !== "unset") { - beauty = 2 * beauty; + beauty *= 2; } else { beauty += 2; } @@ -1414,17 +1414,17 @@ window.Beauty = (function() { } if (slave.bellyPreg >= 500 && arcology.FSRepopulationFocus === "unset" && arcology.FSRestart === "unset") { if (arcology.FSRepopulationFocusPregPolicy === 1) { - beauty = 0.9 * beauty; + beauty *= 0.9; } else if (arcology.FSGenderRadicalist !== "unset") { if (slave.mpreg === 1) { - beauty = 0.9 * beauty; + beauty *= 0.9; } else { - beauty = 0.7 * beauty; + beauty *= 0.7; } } else if (arcology.FSGenderFundamentalist === "unset") { - beauty = 0.8 * beauty; + beauty *= 0.8; } else { - beauty = 0.7 * beauty; + beauty *= 0.7; } } if (slave.bellyImplant >= 1500) { @@ -1437,17 +1437,17 @@ window.Beauty = (function() { } else { if (slave.bellyImplant >= 750000) { /* multipliers */ - beauty = 0.2 * beauty; + beauty *= 0.2; } else if (slave.bellyImplant >= 450000) { - beauty = 0.5 * beauty; + beauty *= 0.5; } else if (slave.bellyImplant >= 300000) { - beauty = 0.7 * beauty; + beauty *= 0.7; } else if (slave.bellyImplant >= 100000) { - beauty = 0.8 * beauty; + beauty *= 0.8; } else if (slave.bellyImplant >= 50000) { - beauty = 0.85 * beauty; + beauty *= 0.85; } else { - beauty = 0.9 * beauty; + beauty *= 0.9; } } } @@ -2455,7 +2455,7 @@ window.slaveCost = (function() { cost += cost * startingSlaveMultiplier; cost = 500 * Math.trunc(cost / 500); if (V.PC.career === "slaver") { - cost = cost / 2; + cost /= 2; } } diff --git a/src/js/slaveGenerationJS.js b/src/js/slaveGenerationJS.js index 6e3c10225f0e4c1c5c9e43686ac6954c2a933ab1..72953069750d063321340b2ddf3b494801d0fe49 100644 --- a/src/js/slaveGenerationJS.js +++ b/src/js/slaveGenerationJS.js @@ -91,7 +91,7 @@ window.nationalityToName = function nationalityToName(slave) { } slave.slaveSurname = slave.birthSurname; if (V.useFSNames === 1) { - if(V.FSNamePref === 0) { + if (V.FSNamePref === 0) { if (V.arcologies[0].FSChattelReligionist > 20) { slave.slaveName = jsEither(setup.chattelReligionistSlaveNames); slave.slaveSurname = 0; @@ -110,26 +110,26 @@ window.nationalityToName = function nationalityToName(slave) { } else if (V.arcologies[0].FSDegradationist !== "unset") { DegradingName(slave); } - } else if(V.FSNamePref === 1) { + } else if (V.FSNamePref === 1) { slave.slaveName = jsEither(setup.chattelReligionistSlaveNames); slave.slaveSurname = 0; - } else if(V.FSNamePref === 2) { + } else if (V.FSNamePref === 2) { slave.slaveName = jsEither(setup.romanSlaveNames); slave.slaveSurname = jsEither(setup.romanSlaveSurnames); - } else if(V.FSNamePref === 3) { + } else if (V.FSNamePref === 3) { slave.slaveName = jsEither(setup.aztecSlaveNames); slave.slaveSurname = 0; - } else if(V.FSNamePref === 4) { + } else if (V.FSNamePref === 4) { slave.slaveName = jsEither(setup.ancientEgyptianSlaveNames); slave.slaveSurname = 0; - } else if(V.FSNamePref === 5) { + } else if (V.FSNamePref === 5) { slave.slaveName = jsEither(setup.edoSlaveNames); slave.slaveSurname = jsEither(setup.edoSlaveSurnames); - } else if(V.FSNamePref === 6) { + } else if (V.FSNamePref === 6) { DegradingName(slave); - } else if(V.FSNamePref === 7) { + } else if (V.FSNamePref === 7) { PaternalistName(slave); - } else if(V.FSNamePref === 8) { + } else if (V.FSNamePref === 8) { slave.slaveName = jsEither(setup.bimboSlaveNames); slave.slaveSurname = 0; } diff --git a/src/js/utilJS.js b/src/js/utilJS.js index 71ff2d18d9a937955721958c7a97b4b725d364eb..38ff41e3ce1ffd6e1666cf804aaa2ab9e466fef3 100644 --- a/src/js/utilJS.js +++ b/src/js/utilJS.js @@ -740,8 +740,8 @@ window.Height = (function() { })(); /** - * Intelligence.random(options) - returns a random intelligence. If no options are passed, the generated number - * will be on a normal distribution with mean 0 and standard deviation 45. + * Intelligence.random(options) - returns a random intelligence. If no options are passed, the generated number + * will be on a normal distribution with mean 0 and standard deviation 45. * * Example: Only generate above-average intelligence based on $activeSlave: * Intelligence.random({limitIntelligence: [0, 100]}) @@ -1161,10 +1161,8 @@ window.years = function(weeks) { if ((weeks - 52) % 4.33 !== 0) { // not exactly x years, y months r += `, `; - } else { - if (weeks % 52 !== 0) { // not exactly x years - r += ` and `; - } + } else if (weeks % 52 !== 0) { // not exactly x years + r += ` and `; } weeks -= years * 52; // rounds down to and drops number of years } @@ -1205,11 +1203,7 @@ window.asDateString = function(weeks, bonusDay = 0) { * @returns {boolean} */ window.jsDef = function(x) { - if (typeof x !== "undefined" && x !== null && x !== undefined) { - return true; - } else { - return false; - } + return (typeof x !== "undefined" && x !== null && x !== undefined); }; /** @@ -1574,12 +1568,10 @@ window.getSlaveTrustClass = function(slave) { } else { return "trusting"; } + } else if (slave.devotion < -20) { + return "defiant"; } else { - if (slave.devotion < -20) { - return "defiant"; - } else { - return "profoundly-trusting"; - } + return "profoundly-trusting"; } };