From 60bfa0b606594e26fdfe9f695887a79f517f0852 Mon Sep 17 00:00:00 2001 From: Skriv <skrivelese@gmail.com> Date: Fri, 6 Dec 2019 22:47:05 +0100 Subject: [PATCH] Revert "linting" This reverts commit 3d54e65d0220b0ec800915799d3f59cef4ebe74f. --- src/js/DefaultRules.js | 12 ++++------- src/js/assayJS.js | 26 ++++++++++++------------ src/js/datatypeCleanupJS.js | 28 +++++++++++++------------- src/js/descriptionWidgets.js | 4 ++-- src/js/generateMarketSlave.js | 2 +- src/js/generateNewSlaveJS.js | 2 +- src/js/proxies.js | 38 ++++++++++++++++++----------------- src/js/slaveCostJS.js | 26 ++++++++++++------------ src/js/slaveGenerationJS.js | 18 ++++++++--------- src/js/utilJS.js | 24 ++++++++++++++-------- 10 files changed, 93 insertions(+), 87 deletions(-) diff --git a/src/js/DefaultRules.js b/src/js/DefaultRules.js index ad0ec052a12..d1867b5354f 100644 --- a/src/js/DefaultRules.js +++ b/src/js/DefaultRules.js @@ -2774,15 +2774,13 @@ 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 = ""; } } @@ -2793,15 +2791,13 @@ 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 11a985e8d18..ebd3bd69d22 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 f85228f52b8..f3db920c0c8 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 f82371e36de..2d7d6055139 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 f953c230689..179faef0236 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 cfc4e3c7efd..4d77c5a1f4b 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 += 1; + actualSize = 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 9ce94c7366f..d729f7d8d93 100644 --- a/src/js/proxies.js +++ b/src/js/proxies.js @@ -1,56 +1,58 @@ 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 b1c62aa7eec..aee3276c89f 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 = 2 * beauty; } 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 = 0.9 * beauty; } else if (arcology.FSGenderRadicalist !== "unset") { if (slave.mpreg === 1) { - beauty *= 0.9; + beauty = 0.9 * beauty; } else { - beauty *= 0.7; + beauty = 0.7 * beauty; } } else if (arcology.FSGenderFundamentalist === "unset") { - beauty *= 0.8; + beauty = 0.8 * beauty; } else { - beauty *= 0.7; + beauty = 0.7 * beauty; } } if (slave.bellyImplant >= 1500) { @@ -1437,17 +1437,17 @@ window.Beauty = (function() { } else { if (slave.bellyImplant >= 750000) { /* multipliers */ - beauty *= 0.2; + beauty = 0.2 * beauty; } else if (slave.bellyImplant >= 450000) { - beauty *= 0.5; + beauty = 0.5 * beauty; } else if (slave.bellyImplant >= 300000) { - beauty *= 0.7; + beauty = 0.7 * beauty; } else if (slave.bellyImplant >= 100000) { - beauty *= 0.8; + beauty = 0.8 * beauty; } else if (slave.bellyImplant >= 50000) { - beauty *= 0.85; + beauty = 0.85 * beauty; } else { - beauty *= 0.9; + beauty = 0.9 * beauty; } } } @@ -2455,7 +2455,7 @@ window.slaveCost = (function() { cost += cost * startingSlaveMultiplier; cost = 500 * Math.trunc(cost / 500); if (V.PC.career === "slaver") { - cost /= 2; + cost = cost / 2; } } diff --git a/src/js/slaveGenerationJS.js b/src/js/slaveGenerationJS.js index 72953069750..6e3c10225f0 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 38ff41e3ce1..71ff2d18d9a 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,8 +1161,10 @@ 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 } @@ -1203,7 +1205,11 @@ window.asDateString = function(weeks, bonusDay = 0) { * @returns {boolean} */ window.jsDef = function(x) { - return (typeof x !== "undefined" && x !== null && x !== undefined); + if (typeof x !== "undefined" && x !== null && x !== undefined) { + return true; + } else { + return false; + } }; /** @@ -1568,10 +1574,12 @@ window.getSlaveTrustClass = function(slave) { } else { return "trusting"; } - } else if (slave.devotion < -20) { - return "defiant"; } else { - return "profoundly-trusting"; + if (slave.devotion < -20) { + return "defiant"; + } else { + return "profoundly-trusting"; + } } }; -- GitLab