From 2fffb39e097b491d8c260972761570f197abf417 Mon Sep 17 00:00:00 2001 From: DCoded <dsoloha@live.com> Date: Sat, 18 May 2019 11:07:56 -0400 Subject: [PATCH] Linting --- .eslintrc.json | 2 +- src/002-config/fc-js-init.js | 2 +- src/SpecialForce/SpecialForce.js | 2 +- src/art/artJS.js | 29 +- src/art/vector/VectorArtJS.js | 4 +- .../vector_revamp/vectorRevampedArtControl.js | 264 +++---------- src/interaction/main/mainLinks.js | 2 +- src/js/DefaultRules.js | 4 +- src/js/assayJS.js | 367 +++++++----------- src/js/assignJS.js | 93 +---- src/js/familyTreeJS.js | 22 +- src/js/generateMarketSlave.js | 3 +- src/js/hTagMacroJS.js | 3 +- src/js/pregJS.js | 3 +- src/js/quickListJS.js | 30 +- src/js/removeActiveSlave.js | 6 +- src/js/rulesAssistant.js | 6 +- src/js/rulesAssistantOptions.js | 304 ++++++--------- src/js/rulesAutosurgery.js | 157 +++----- src/js/sexActsJS.js | 5 +- src/js/slaveCostJS.js | 51 +-- src/js/slaveGenerationJS.js | 4 +- src/js/slaveListing.js | 16 +- src/js/slaveStatsChecker.js | 60 +-- src/js/storyJS.js | 60 +-- src/js/textInput.js | 4 +- src/js/utilJS.js | 27 +- src/js/wombJS.js | 92 ++--- 28 files changed, 568 insertions(+), 1054 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index c50f403a869..dec9b166a68 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -36,7 +36,7 @@ "eqeqeq": "warn", "no-fallthrough": "error", "space-before-function-paren": ["warn", { - "anonymous": "always", + "anonymous": "never", "named": "never", "asyncArrow": "always" }], diff --git a/src/002-config/fc-js-init.js b/src/002-config/fc-js-init.js index db6fa2d707a..d0c5ef42917 100644 --- a/src/002-config/fc-js-init.js +++ b/src/002-config/fc-js-init.js @@ -5,7 +5,7 @@ */ window.App = { }; // the same declaration for code parsers that don't like the line above -var App = window.App || {}; +let App = window.App || {}; App.Data = {}; App.Debug = {}; diff --git a/src/SpecialForce/SpecialForce.js b/src/SpecialForce/SpecialForce.js index f24c2fca30f..b173d03362f 100644 --- a/src/SpecialForce/SpecialForce.js +++ b/src/SpecialForce/SpecialForce.js @@ -2521,7 +2521,7 @@ App.SF.AAR = function(endWeekCall = 1) { income *= 14.15; } } // Remove line if hard mode ever gets fixed. - if (endWeekCall > 0) S.Troops += FNG; + if (endWeekCall > 0) { S.Troops += FNG; } income = Math.ceil(income); if (V.debugMode > 0 && endWeekCall > 0) { r += `<br>income:${num(income)}, troop:${num((0.09+Multiplier.troop/NO).toFixed(2))}, unit:${num((0.09+Multiplier.unit/NO).toFixed(2))}, action:${num((0.09+Multiplier.action/NO).toFixed(2))}, depravity:${num((0.09+Multiplier.depravity/NO).toFixed(2))}, upkeep:${num((upkeep*N1).toFixed(2))}`; diff --git a/src/art/artJS.js b/src/art/artJS.js index cfeaba2ae90..a218b1fa5ed 100644 --- a/src/art/artJS.js +++ b/src/art/artJS.js @@ -19,16 +19,11 @@ UIDisplay (optional, only used by legacy art): icon UI Display for vector art, 1 */ window.SlaveArt = function(artSlave, artSize, UIDisplay) { const imageChoice = State.variables.imageChoice; - if (artSlave.custom.image !== null && artSlave.custom.image.filename !== "") - return CustomArt(artSlave, artSize); - else if (imageChoice === 1) /* VECTOR ART BY NOX/DEEPMURK */ - return VectorArt(artSlave, artSize); - else if (imageChoice === 2) /* VECTOR ART BY NOX - Pregmod Legacy Version */ - return LegacyVectorArt(artSlave, UIDisplay); - else if (imageChoice === 3) /* VECTOR ART REVAMP*/ - return RevampedVectorArt(artSlave); - else /* RENDERED IMAGES BY SHOKUSHU */ - return ArtControlRendered(artSlave, artSize); + if (artSlave.custom.image !== null && artSlave.custom.image.filename !== "") { return CustomArt(artSlave, artSize); } else if (imageChoice === 1) /* VECTOR ART BY NOX/DEEPMURK */ + { return VectorArt(artSlave, artSize); } else if (imageChoice === 2) /* VECTOR ART BY NOX - Pregmod Legacy Version */ + { return LegacyVectorArt(artSlave, UIDisplay); } else if (imageChoice === 3) /* VECTOR ART REVAMP*/ + { return RevampedVectorArt(artSlave); } else /* RENDERED IMAGES BY SHOKUSHU */ + { return ArtControlRendered(artSlave, artSize); } }; window.ArtControlRendered = function ArtControlRendered(slave, sizePlacement) { @@ -112,14 +107,7 @@ window.CustomArt = function(slave, imageSize) { const displayTypeStart = (fileType === "webm" ? "video loop autoplay" : "img"); const displayTypeEnd = (fileType === "webm" ? "</video>" : ""); - if (imageSize === 3) - return `<${displayTypeStart} src=${fileName} style='float:right; border:3px hidden'>${displayTypeEnd}`; - else if (imageSize === 2) - return `<${displayTypeStart} src=${fileName} style='float:right; border:3px hidden' width='300' height='300'>${displayTypeEnd}`; - else if (imageSize === 1) - return `<${displayTypeStart} src=${fileName} style='float:right; border:3px hidden' width='150' height='150'>${displayTypeEnd}`; - else - return `<${displayTypeStart} src=${fileName} style='float:right; border:3px hidden' width='120' height='120'>${displayTypeEnd}`; + if (imageSize === 3) { return `<${displayTypeStart} src=${fileName} style='float:right; border:3px hidden'>${displayTypeEnd}`; } else if (imageSize === 2) { return `<${displayTypeStart} src=${fileName} style='float:right; border:3px hidden' width='300' height='300'>${displayTypeEnd}`; } else if (imageSize === 1) { return `<${displayTypeStart} src=${fileName} style='float:right; border:3px hidden' width='150' height='150'>${displayTypeEnd}`; } else { return `<${displayTypeStart} src=${fileName} style='float:right; border:3px hidden' width='120' height='120'>${displayTypeEnd}`; } }; /* @@ -212,10 +200,7 @@ window.extractColor = function(color, eyes) { } if (!colorCode) { console.log("Art Color Tools JS: Unable to determine HTML compliant color code for color string '" + color + "'."); - if (eyes) - colorCode = "#89b7ff"; - else - colorCode = "fuchsia"; /* use fuchsia as error marker */ + if (eyes) { colorCode = "#89b7ff"; } else { colorCode = "fuchsia"; } /* use fuchsia as error marker */ } return colorCode; }; diff --git a/src/art/vector/VectorArtJS.js b/src/art/vector/VectorArtJS.js index 5295d7e1072..3da76328829 100644 --- a/src/art/vector/VectorArtJS.js +++ b/src/art/vector/VectorArtJS.js @@ -1,4 +1,4 @@ -window.VectorArt = (function () { +window.VectorArt = (function() { "use strict"; let V, T, slave; let r; @@ -2679,7 +2679,7 @@ window.VectorArt = (function () { return VectorArt; })(); -window.LegacyVectorArt = function (slave, artSize) { +window.LegacyVectorArt = function(slave, artSize) { const filePath = "'resources/vector"; const skinFilePath = `${filePath}/body/white`; const wearingLatex = slave.clothes === "a Fuckdoll suit" || slave.clothes === "restrictive latex" || slave.clothes === "a latex catsuit"; diff --git a/src/art/vector_revamp/vectorRevampedArtControl.js b/src/art/vector_revamp/vectorRevampedArtControl.js index ac04a40c9e1..ea0fa3052db 100644 --- a/src/art/vector_revamp/vectorRevampedArtControl.js +++ b/src/art/vector_revamp/vectorRevampedArtControl.js @@ -3,10 +3,7 @@ window.RevampedVectorArt = function(slave) { const T = State.temporary; let r; - if (T.art_display_id > 0) - T.art_display_id++; - else - T.art_display_id = 1; + if (T.art_display_id > 0) { T.art_display_id++; } else { T.art_display_id = 1; } T.art_display_class = `ad${T.art_display_id}`; /* Using JS from vectorRevampedArtControl.tw*/ @@ -50,8 +47,7 @@ class ArtStyleEntry { let cssDef = `{ ${styleValue} }`; // not sure if there should be padding here - if (this.name.length > 0) - cssDef = `.${this.name}${cssDef}`; + if (this.name.length > 0) { cssDef = `.${this.name}${cssDef}`; } return cssDef; } @@ -132,13 +128,11 @@ class ArtStyleControl { } applyEyeLensStyle() { - if (this.artSlave.eyeColor === null || this.artSlave.eyeColor === undefined) - return; + if (this.artSlave.eyeColor === null || this.artSlave.eyeColor === undefined) { return; } let eyeColorSplit = this.artSlave.eyeColor.split(" "); - if (eyeColorSplit === 1) - return; + if (eyeColorSplit === 1) { return; } let eyeLens = eyeColorSplit[0]; @@ -154,8 +148,7 @@ class ArtStyleControl { /* currently unused, keeping for color reference - */ parseSkinColorFromName(colorName) { // eslint-disable-next-line eqeqeq - if (colorName == null) - return "#000000"; + if (colorName == null) { return "#000000"; } let skinPalette = [ ["light", "#feebe5"], @@ -635,10 +628,8 @@ class RevampedArtControl { let clothing = this.getClothing(); if (clothing !== null) { - if (clothing.bodySettings !== null) - this.applyClothingSettings(clothing.bodySettings); - if (clothing.styleSettings !== null) - this.applyClothingStyleSettings(clothing.styleSettings); + if (clothing.bodySettings !== null) { this.applyClothingSettings(clothing.bodySettings); } + if (clothing.styleSettings !== null) { this.applyClothingStyleSettings(clothing.styleSettings); } } if (!globalShowHighlights) { @@ -658,8 +649,7 @@ class RevampedArtControl { copyProperties(objTo, objFrom) { for (let attr in objFrom) { - if (objFrom.hasOwnProperty(attr)) - objTo[attr] = objFrom[attr]; + if (objFrom.hasOwnProperty(attr)) { objTo[attr] = objFrom[attr]; } } } @@ -669,14 +659,12 @@ class RevampedArtControl { applyClothingStyleSettings(styleSettings) { for (let attr in styleSettings) { - if (styleSettings.hasOwnProperty(attr)) - this.copyProperties(this.styleControl[attr], styleSettings[attr]); + if (styleSettings.hasOwnProperty(attr)) { this.copyProperties(this.styleControl[attr], styleSettings[attr]); } } } getClothing() { - if (this.artSlave.fuckdoll > 0) - return this.clothingControl.fuckdoll; + if (this.artSlave.fuckdoll > 0) { return this.clothingControl.fuckdoll; } let clothing = null; switch (this.artSlave.clothes) { case "a nice maid outfit": @@ -707,12 +695,7 @@ class RevampedArtControl { get getHairLength() { let result = "Short"; - if (this.artSlave.hLength >= 80) - result = "Long"; - else if (this.artSlave.hLength >= 40) - result = "Medium"; - else - result = "Short"; + if (this.artSlave.hLength >= 80) { result = "Long"; } else if (this.artSlave.hLength >= 40) { result = "Medium"; } else { result = "Short"; } return result; } @@ -769,26 +752,7 @@ class RevampedArtControl { get getBellyLevel() { let bellyLevel = 0; - if (this.artSlave.belly >= 120000) - bellyLevel = 9; - else if (this.artSlave.belly >= 90000) - bellyLevel = 8; - else if (this.artSlave.belly >= 50000) - bellyLevel = 7; - else if (this.artSlave.belly >= 30000) - bellyLevel = 6; - else if (this.artSlave.belly >= 15000) - bellyLevel = 5; - else if (this.artSlave.belly >= 10000) - bellyLevel = 4; - else if (this.artSlave.belly >= 5000) - bellyLevel = 3; - else if (this.artSlave.belly >= 1500) - bellyLevel = 2; - else if (this.artSlave.belly >= 500) - bellyLevel = 1; - else - bellyLevel = 0; + if (this.artSlave.belly >= 120000) { bellyLevel = 9; } else if (this.artSlave.belly >= 90000) { bellyLevel = 8; } else if (this.artSlave.belly >= 50000) { bellyLevel = 7; } else if (this.artSlave.belly >= 30000) { bellyLevel = 6; } else if (this.artSlave.belly >= 15000) { bellyLevel = 5; } else if (this.artSlave.belly >= 10000) { bellyLevel = 4; } else if (this.artSlave.belly >= 5000) { bellyLevel = 3; } else if (this.artSlave.belly >= 1500) { bellyLevel = 2; } else if (this.artSlave.belly >= 500) { bellyLevel = 1; } else { bellyLevel = 0; } return bellyLevel; } @@ -796,11 +760,9 @@ class RevampedArtControl { get hairBackLayer() { let result = []; - if (!this.showHair) - return result; + if (!this.showHair) { return result; } - if (this.artSlave.hLength === 0) - return result; + if (this.artSlave.hLength === 0) { return result; } switch (this.artSlave.hStyle) { case "neat": @@ -878,17 +840,9 @@ class RevampedArtControl { get buttLayer() { let result = []; let buttSize = 0; - if (this.artSlave.amp) - return result; + if (this.artSlave.amp) { return result; } - if (this.artSlave.butt > 6) - buttSize = 3; - else if (this.artSlave.butt > 4) - buttSize = 2; - else if (this.artSlave.butt > 2) - buttSize = 1; - else - buttSize = 0; + if (this.artSlave.butt > 6) { buttSize = 3; } else if (this.artSlave.butt > 4) { buttSize = 2; } else if (this.artSlave.butt > 2) { buttSize = 1; } else { buttSize = 0; } result.push(`Art_Vector_Revamp_Butt_${buttSize}`); @@ -977,8 +931,7 @@ class RevampedArtControl { get pussyLayer() { let result = []; - if (this.showPussy && this.artSlave.vagina >= 0) - result.push("Art_Vector_Revamp_Pussy"); + if (this.showPussy && this.artSlave.vagina >= 0) { result.push("Art_Vector_Revamp_Pussy"); } return result; } @@ -986,11 +939,9 @@ class RevampedArtControl { get pubicLayer() { let result = []; - if (!this.showPubic) - return result; + if (!this.showPubic) { return result; } - if (this.artSlave.physicalAge < 12) - return result; + if (this.artSlave.physicalAge < 12) { return result; } if (this.artSlave.vaginaTat === "rude words") { this.pubicTattooText = this.artSlave.dick !== 0 ? "Useless" : "Fucktoy"; @@ -1020,20 +971,11 @@ class RevampedArtControl { get pussyPiercingsLayer() { let result = []; - if (!this.showPussyPiercings) - return result; + if (!this.showPussyPiercings) { return result; } - if (this.artSlave.vaginaPiercing === 1) - result.push("Art_Vector_Revamp_Pussy_Piercing"); - else if (this.artSlave.vaginaPiercing === 2) - result.push("Art_Vector_Revamp_Pussy_Piercing_Heavy"); + if (this.artSlave.vaginaPiercing === 1) { result.push("Art_Vector_Revamp_Pussy_Piercing"); } else if (this.artSlave.vaginaPiercing === 2) { result.push("Art_Vector_Revamp_Pussy_Piercing_Heavy"); } - if (this.artSlave.clitPiercing === 1) - result.push("Art_Vector_Revamp_Clit_Piercing"); - else if (this.artSlave.clitPiercing === 2) - result.push("Art_Vector_Revamp_Clit_Piercing_Heavy"); - else if (this.artSlave.clitPiercing === 3) - result.push("Art_Vector_Revamp_Clit_Piercing_Smart"); + if (this.artSlave.clitPiercing === 1) { result.push("Art_Vector_Revamp_Clit_Piercing"); } else if (this.artSlave.clitPiercing === 2) { result.push("Art_Vector_Revamp_Clit_Piercing_Heavy"); } else if (this.artSlave.clitPiercing === 3) { result.push("Art_Vector_Revamp_Clit_Piercing_Smart"); } return result; } @@ -1049,14 +991,11 @@ class RevampedArtControl { isChastityVaginalWorn = isChastityVaginalWorn && this.showChastityVaginal; - if (isChastityAnalWorn) - result.push("Art_Vector_Revamp_Chastity_Anus"); + if (isChastityAnalWorn) { result.push("Art_Vector_Revamp_Chastity_Anus"); } - if (isChastityVaginalWorn) - result.push("Art_Vector_Revamp_Chastity_Vagina"); + if (isChastityVaginalWorn) { result.push("Art_Vector_Revamp_Chastity_Vagina"); } - if (isChastityAnalWorn || isChastityVaginalWorn) - result.push("Art_Vector_Revamp_Chastity_Base"); + if (isChastityAnalWorn || isChastityVaginalWorn) { result.push("Art_Vector_Revamp_Chastity_Base"); } return result; } @@ -1083,21 +1022,11 @@ class RevampedArtControl { get ballsLayer() { let result = []; - if (!this.showBalls || this.artSlave.scrotum <= 0 || this.artSlave.balls <= 0) - return result; + if (!this.showBalls || this.artSlave.scrotum <= 0 || this.artSlave.balls <= 0) { return result; } let ballsSize = 0; - if (this.artSlave.scrotum >= 6) - ballsSize = 4; - else if (this.artSlave.scrotum >= 4) - ballsSize = 3; - else if (this.artSlave.scrotum >= 3) - ballsSize = 2; - else if (this.artSlave.scrotum >= 2) - ballsSize = 1; - else - ballsSize = 0; + if (this.artSlave.scrotum >= 6) { ballsSize = 4; } else if (this.artSlave.scrotum >= 4) { ballsSize = 3; } else if (this.artSlave.scrotum >= 3) { ballsSize = 2; } else if (this.artSlave.scrotum >= 2) { ballsSize = 1; } else { ballsSize = 0; } result.push(`Art_Vector_Revamp_Balls_${ballsSize}`); @@ -1111,19 +1040,15 @@ class RevampedArtControl { result.push(`Art_Vector_Revamp_Belly_${this.bellyLevel}`); if (this.showBellyPiercings) { - if (this.artSlave.navelPiercing >= 1) - result.push(`Art_Vector_Revamp_Belly_${this.bellyLevel}_Piercing`); + if (this.artSlave.navelPiercing >= 1) { result.push(`Art_Vector_Revamp_Belly_${this.bellyLevel}_Piercing`); } - if (this.artSlave.navelPiercing === 2) - result.push(`Art_Vector_Revamp_Belly_${this.bellyLevel}_Piercing_Heavy`); + if (this.artSlave.navelPiercing === 2) { result.push(`Art_Vector_Revamp_Belly_${this.bellyLevel}_Piercing_Heavy`); } } } else { if (this.showBellyPiercings) { - if (this.artSlave.navelPiercing >= 1) - result.push("Art_Vector_Revamp_Navel_Piercing"); + if (this.artSlave.navelPiercing >= 1) { result.push("Art_Vector_Revamp_Navel_Piercing"); } - if (this.artSlave.navelPiercing === 2) - result.push("Art_Vector_Revamp_Navel_Piercing_Heavy"); + if (this.artSlave.navelPiercing === 2) { result.push("Art_Vector_Revamp_Navel_Piercing_Heavy"); } } } @@ -1133,41 +1058,20 @@ class RevampedArtControl { get penisLayer() { let result = []; - if (this.getBellyLevel >= 8) - return result; + if (this.getBellyLevel >= 8) { return result; } let penisSize = -1; - if (this.artSlave.dick >= 8) - penisSize = 6; - else if (this.artSlave.dick >= 7) - penisSize = 5; - else if (this.artSlave.dick >= 6) - penisSize = 4; - else if (this.artSlave.dick >= 5) - penisSize = 3; - else if (this.artSlave.dick >= 4) - penisSize = 2; - else if (this.artSlave.dick >= 2) - penisSize = 1; - else if (this.artSlave.dick >= 1) - penisSize = 0; - else - penisSize = -1; - - if (!this.showPenis || penisSize < 0) - return result; + if (this.artSlave.dick >= 8) { penisSize = 6; } else if (this.artSlave.dick >= 7) { penisSize = 5; } else if (this.artSlave.dick >= 6) { penisSize = 4; } else if (this.artSlave.dick >= 5) { penisSize = 3; } else if (this.artSlave.dick >= 4) { penisSize = 2; } else if (this.artSlave.dick >= 2) { penisSize = 1; } else if (this.artSlave.dick >= 1) { penisSize = 0; } else { penisSize = -1; } + + if (!this.showPenis || penisSize < 0) { return result; } if (canAchieveErection(this.artSlave) && (this.artSlave.chastityPenis !== 1)) { result.push(`Art_Vector_Revamp_Penis_${penisSize}`); - if (!this.showPenisPiercings) - return result; + if (!this.showPenisPiercings) { return result; } - if (this.artSlave.dickPiercing === 1) - result.push(`Art_Vector_Revamp_Penis_${penisSize}_Piercing`); - else if (this.artSlave.dickPiercing === 2) - result.push(`Art_Vector_Revamp_Penis_${penisSize}_Piercing_Heavy`); + if (this.artSlave.dickPiercing === 1) { result.push(`Art_Vector_Revamp_Penis_${penisSize}_Piercing`); } else if (this.artSlave.dickPiercing === 2) { result.push(`Art_Vector_Revamp_Penis_${penisSize}_Piercing_Heavy`); } } else { result.push(`Art_Vector_Revamp_Flaccid_${penisSize}`); @@ -1224,8 +1128,7 @@ class RevampedArtControl { this.artTransform = artBoobTransform; - if (!this.showBoobs) - return result; + if (!this.showBoobs) { return result; } let size = "Small"; @@ -1303,27 +1206,15 @@ class RevampedArtControl { } if (this.artSlave.nipplesPiercing === 1) { - if (this.artSlave.boobs < 300) - result.push("Art_Vector_Revamp_Boob_None_Piercing"); - else - result.push(`Art_Vector_Revamp_Boob_${size}_Piercing`); + if (this.artSlave.boobs < 300) { result.push("Art_Vector_Revamp_Boob_None_Piercing"); } else { result.push(`Art_Vector_Revamp_Boob_${size}_Piercing`); } } else if (this.artSlave.nipplesPiercing === 2) { - if (this.artSlave.boobs < 300) - result.push("Art_Vector_Revamp_Boob_None_Piercing_Heavy"); - else - result.push(`Art_Vector_Revamp_Boob_${size}_Piercing_Heavy`); + if (this.artSlave.boobs < 300) { result.push("Art_Vector_Revamp_Boob_None_Piercing_Heavy"); } else { result.push(`Art_Vector_Revamp_Boob_${size}_Piercing_Heavy`); } } if (this.artSlave.areolaePiercing === 1) { - if (this.artSlave.boobs < 300) - result.push("Art_Vector_Revamp_Boob_None_Areola_Piercing"); - else - result.push(`Art_Vector_Revamp_Boob_${size}_Areola_Piercing`); + if (this.artSlave.boobs < 300) { result.push("Art_Vector_Revamp_Boob_None_Areola_Piercing"); } else { result.push(`Art_Vector_Revamp_Boob_${size}_Areola_Piercing`); } } else if (this.artSlave.areolaePiercing === 2) { - if (this.artSlave.boobs < 300) - result.push("Art_Vector_Revamp_Boob_None_Areola_Piercing_Heavy"); - else - result.push(`Art_Vector_Revamp_Boob_${size}_Areola_Piercing_Heavy`); + if (this.artSlave.boobs < 300) { result.push("Art_Vector_Revamp_Boob_None_Areola_Piercing_Heavy"); } else { result.push(`Art_Vector_Revamp_Boob_${size}_Areola_Piercing_Heavy`); } } } @@ -1422,21 +1313,13 @@ class RevampedArtControl { result.push("Art_Vector_Revamp_Head"); - if (this.showHeadHighlight) - result.push("Art_Vector_Revamp_Face_Highlights"); + if (this.showHeadHighlight) { result.push("Art_Vector_Revamp_Face_Highlights"); } - if (!this.showHeadPiercings) - return result; + if (!this.showHeadPiercings) { return result; } - if (this.artSlave.earPiercing === 1) - result.push("Art_Vector_Revamp_Head_Ear_Piercing"); - else if (this.artSlave.earPiercing === 2) - result.push("Art_Vector_Revamp_Head_Ear_Piercing_Heavy"); + if (this.artSlave.earPiercing === 1) { result.push("Art_Vector_Revamp_Head_Ear_Piercing"); } else if (this.artSlave.earPiercing === 2) { result.push("Art_Vector_Revamp_Head_Ear_Piercing_Heavy"); } - if (this.artSlave.nosePiercing === 1) - result.push("Art_Vector_Revamp_Head_Nose_Piercing"); - else if (this.artSlave.nosePiercing === 2) - result.push("Art_Vector_Revamp_Head_Nose_Piercing_Heavy"); + if (this.artSlave.nosePiercing === 1) { result.push("Art_Vector_Revamp_Head_Nose_Piercing"); } else if (this.artSlave.nosePiercing === 2) { result.push("Art_Vector_Revamp_Head_Nose_Piercing_Heavy"); } return result; } @@ -1444,46 +1327,33 @@ class RevampedArtControl { get eyesLayer() { let result = []; - if (!this.showEyes) - return result; + if (!this.showEyes) { return result; } if (this.artSlave.devotion > 50) { result.push("Art_Vector_Revamp_Eyes_Happy"); result.push("Art_Vector_Revamp_Eyes_Happy_Highlights"); if (this.showHeadPiercings) { - if (this.artSlave.eyebrowPiercing === 1) - result.push("Art_Vector_Revamp_Head_Eyebrow_Happy_Piercing"); - else if (this.artSlave.eyebrowPiercing === 2) - result.push("Art_Vector_Revamp_Head_Eyebrow_Happy_Piercing_Heavy"); + if (this.artSlave.eyebrowPiercing === 1) { result.push("Art_Vector_Revamp_Head_Eyebrow_Happy_Piercing"); } else if (this.artSlave.eyebrowPiercing === 2) { result.push("Art_Vector_Revamp_Head_Eyebrow_Happy_Piercing_Heavy"); } } } else if (this.artSlave.devotion >= 0) { result.push("Art_Vector_Revamp_Eyes_Shy"); result.push("Art_Vector_Revamp_Eyes_Shy_Highlights"); if (this.showHeadPiercings) { - if (this.artSlave.eyebrowPiercing === 1) - result.push("Art_Vector_Revamp_Head_Eyebrow_Shy_Piercing"); - else if (this.artSlave.eyebrowPiercing === 2) - result.push("Art_Vector_Revamp_Head_Eyebrow_Shy_Piercing_Heavy"); + if (this.artSlave.eyebrowPiercing === 1) { result.push("Art_Vector_Revamp_Head_Eyebrow_Shy_Piercing"); } else if (this.artSlave.eyebrowPiercing === 2) { result.push("Art_Vector_Revamp_Head_Eyebrow_Shy_Piercing_Heavy"); } } } else if (this.artSlave.devotion >= -50) { result.push("Art_Vector_Revamp_Eyes_Closed"); if (this.showHeadPiercings) { - if (this.artSlave.eyebrowPiercing === 1) - result.push("Art_Vector_Revamp_Head_Eyebrow_Closed_Piercing"); - else if (this.artSlave.eyebrowPiercing === 2) - result.push("Art_Vector_Revamp_Head_Eyebrow_Closed_Piercing_Heavy"); + if (this.artSlave.eyebrowPiercing === 1) { result.push("Art_Vector_Revamp_Head_Eyebrow_Closed_Piercing"); } else if (this.artSlave.eyebrowPiercing === 2) { result.push("Art_Vector_Revamp_Head_Eyebrow_Closed_Piercing_Heavy"); } } } else { result.push("Art_Vector_Revamp_Eyes_Angry"); result.push("Art_Vector_Revamp_Eyes_Angry_Highlights"); if (this.showHeadPiercings) { - if (this.artSlave.eyebrowPiercing === 1) - result.push("Art_Vector_Revamp_Head_Eyebrow_Angry_Piercing"); - else if (this.artSlave.eyebrowPiercing === 2) - result.push("Art_Vector_Revamp_Head_Eyebrow_Angry_Piercing_Heavy"); + if (this.artSlave.eyebrowPiercing === 1) { result.push("Art_Vector_Revamp_Head_Eyebrow_Angry_Piercing"); } else if (this.artSlave.eyebrowPiercing === 2) { result.push("Art_Vector_Revamp_Head_Eyebrow_Angry_Piercing_Heavy"); } } } @@ -1494,41 +1364,23 @@ class RevampedArtControl { let result = []; let lipsSize = "Normal"; - if (!this.showMouth) - return result; + if (!this.showMouth) { return result; } - if (this.artSlave.lips > 95) - lipsSize = "Enormous"; - else if (this.artSlave.lips > 70) - lipsSize = "Huge"; - else if (this.artSlave.lips > 50) - lipsSize = "Big"; - else if (this.artSlave.lips > 30) - lipsSize = "Plush"; - else if (this.artSlave.lips > 10) - lipsSize = "Normal"; - else - lipsSize = "Thin"; + if (this.artSlave.lips > 95) { lipsSize = "Enormous"; } else if (this.artSlave.lips > 70) { lipsSize = "Huge"; } else if (this.artSlave.lips > 50) { lipsSize = "Big"; } else if (this.artSlave.lips > 30) { lipsSize = "Plush"; } else if (this.artSlave.lips > 10) { lipsSize = "Normal"; } else { lipsSize = "Thin"; } if (this.artSlave.trust > 20) { result.push(`Art_Vector_Revamp_Makeup_Mouth_Happy_${lipsSize}`); result.push(`Art_Vector_Revamp_Mouth_Happy_${lipsSize}`); if (this.showHeadPiercings) { - if (this.artSlave.lipsPiercing === 1) - result.push("Art_Vector_Revamp_Head_Mouth_Happy_Piercing"); - else if (this.artSlave.lipsPiercing === 2) - result.push("Art_Vector_Revamp_Head_Mouth_Happy_Piercing_Heavy"); + if (this.artSlave.lipsPiercing === 1) { result.push("Art_Vector_Revamp_Head_Mouth_Happy_Piercing"); } else if (this.artSlave.lipsPiercing === 2) { result.push("Art_Vector_Revamp_Head_Mouth_Happy_Piercing_Heavy"); } } } else { result.push(`Art_Vector_Revamp_Makeup_Mouth_Angry_${lipsSize}`); result.push(`Art_Vector_Revamp_Mouth_Angry_${lipsSize}`); if (this.showHeadPiercings) { - if (this.artSlave.lipsPiercing === 1) - result.push("Art_Vector_Revamp_Head_Mouth_Angry_Piercing"); - else if (this.artSlave.lipsPiercing === 2) - result.push("Art_Vector_Revamp_Head_Mouth_Angry_Piercing_Heavy"); + if (this.artSlave.lipsPiercing === 1) { result.push("Art_Vector_Revamp_Head_Mouth_Angry_Piercing"); } else if (this.artSlave.lipsPiercing === 2) { result.push("Art_Vector_Revamp_Head_Mouth_Angry_Piercing_Heavy"); } } } @@ -1567,11 +1419,9 @@ class RevampedArtControl { get hairForeLayer() { let result = []; - if (!this.showHair) - return result; + if (!this.showHair) { return result; } - if (this.artSlave.hLength === 0) - return result; + if (this.artSlave.hLength === 0) { return result; } switch (this.artSlave.hStyle) { case "neat": diff --git a/src/interaction/main/mainLinks.js b/src/interaction/main/mainLinks.js index 80a9153ca67..44b7f3aa8b2 100644 --- a/src/interaction/main/mainLinks.js +++ b/src/interaction/main/mainLinks.js @@ -1,5 +1,5 @@ /* OPEN MAIN */ -App.UI.View.MainLinks = function () { +App.UI.View.MainLinks = function() { "use strict"; const V = State.variables; const PA = Array.isArray(V.personalAttention) ? V.personalAttention.map(x => getSlave(x.ID)) : []; diff --git a/src/js/DefaultRules.js b/src/js/DefaultRules.js index c94323529c1..90ed3d4ce5e 100644 --- a/src/js/DefaultRules.js +++ b/src/js/DefaultRules.js @@ -1,6 +1,6 @@ // this code applies RA rules onto slaves -window.DefaultRules = (function () { +window.DefaultRules = (function() { "use strict"; let V; let r; @@ -1353,7 +1353,7 @@ window.DefaultRules = (function () { } } if (_priorities.length > 1) { - _priorities = _priorities.sort(function (a, b) { + _priorities = _priorities.sort(function(a, b) { if (a.weight > b.weight) { return -1; } diff --git a/src/js/assayJS.js b/src/js/assayJS.js index 85d9c11a4b1..de143fd63b4 100644 --- a/src/js/assayJS.js +++ b/src/js/assayJS.js @@ -53,17 +53,13 @@ window.isLeaderP = function isLeaderP(slave) { // helper function returning PC's title window.properTitle = function properTitle() { const PC = State.variables.PC; - if (PC.customTitle) return PC.customTitle; - else if (PC.title !== 0) return "Sir"; - else return "Ma'am"; + if (PC.customTitle) { return PC.customTitle; } else if (PC.title !== 0) { return "Sir"; } else { return "Ma'am"; } }; // helper function returning slave's title for PC in situations where WrittenMaster() is inappropriate window.properMaster = function properMaster() { const PC = State.variables.PC; - if (PC.customTitle) return PC.customTitle; - else if (PC.title !== 0) return "Master"; - else return "Mistress"; + if (PC.customTitle) { return PC.customTitle; } else if (PC.title !== 0) { return "Master"; } else { return "Mistress"; } }; /** @@ -192,7 +188,7 @@ window.newSlave = function newSlave(slave) { V.genePool.push(slave); /* Store non-albino stats in genePool */ if (slave.geneticQuirks.albinism === 2) { - const albInd = V.genePool.findIndex(function(s) {return s.ID === slave.ID;}); + const albInd = V.genePool.findIndex(function(s) { return s.ID === slave.ID; }); V.genePool[albInd].origSkin = slave.albinismOverride.skin; V.genePool[albInd].origEye = slave.albinismOverride.eyeColor; V.genePool[albInd].origHColor = slave.albinismOverride.hColor; @@ -202,7 +198,7 @@ window.newSlave = function newSlave(slave) { slave.albinismOverride = 0; } } else { - if (V.genePool.findIndex(function(s) {return s.ID === slave.ID;}) === -1) {V.genePool.push(slave);} + if (V.genePool.findIndex(function(s) { return s.ID === slave.ID; }) === -1) { V.genePool.push(slave); } } assignJob(slave, slave.assignment); @@ -389,7 +385,7 @@ App.Utils.Pronouns = class { * @param {App.Entity.SlaveState} slave * @returns {App.Utils.Pronouns} */ -window.getPronouns = function (slave) { +window.getPronouns = function(slave) { return new App.Utils.Pronouns(slave); }; @@ -412,10 +408,7 @@ window.SlavePronouns = function SlavePronouns(slave) { */ window.WrittenMaster = function WrittenMaster(slave) { const V = State.variables; - if (slave !== undefined) - Enunciate(slave); - else if (V.titleEnunciate === undefined) - Enunciate(V.activeSlave); + if (slave !== undefined) { Enunciate(slave); } else if (V.titleEnunciate === undefined) { Enunciate(V.activeSlave); } return V.writtenTitle; }; @@ -425,48 +418,23 @@ window.WrittenMaster = function WrittenMaster(slave) { window.Enunciate = function Enunciate(slave) { const V = State.variables; if (SlaveStatsChecker.checkForLisp(slave)) { - if (V.PC.customTitleLisp !== undefined) - V.titleEnunciate = V.PC.customTitleLisp; - else if (V.PC.title !== 0) - V.titleEnunciate = "Mathter"; - else - V.titleEnunciate = "Mithtreth"; + if (V.PC.customTitleLisp !== undefined) { V.titleEnunciate = V.PC.customTitleLisp; } else if (V.PC.title !== 0) { V.titleEnunciate = "Mathter"; } else { V.titleEnunciate = "Mithtreth"; } if (V.allowFamilyTitles === 1) { if (slave.father === -1) { - if (slave.actualAge < 4 && slave.physicalAge < 4) - V.titleEnunciate = "Dadda"; - else if (slave.actualAge < 9) - V.titleEnunciate = "Daddy"; - else - V.titleEnunciate = "Dad"; + if (slave.actualAge < 4 && slave.physicalAge < 4) { V.titleEnunciate = "Dadda"; } else if (slave.actualAge < 9) { V.titleEnunciate = "Daddy"; } else { V.titleEnunciate = "Dad"; } } else if (slave.mother === -1) { - if (slave.actualAge < 4 && slave.physicalAge < 4) - V.titleEnunciate = "Mama"; - else if (slave.actualAge < 9) - V.titleEnunciate = "Mommy"; - else - V.titleEnunciate = "Mom"; + if (slave.actualAge < 4 && slave.physicalAge < 4) { V.titleEnunciate = "Mama"; } else if (slave.actualAge < 9) { V.titleEnunciate = "Mommy"; } else { V.titleEnunciate = "Mom"; } } else if (V.PC.mother === slave.ID || V.PC.father === slave.ID) { - if (V.PC.title === 1) - V.titleEnunciate = "Thon"; - else if (V.PC.title === 0) - V.titleEnunciate = "Daughter"; + if (V.PC.title === 1) { V.titleEnunciate = "Thon"; } else if (V.PC.title === 0) { V.titleEnunciate = "Daughter"; } } else if (areSisters(slave, V.PC) > 0) { if (V.PC.title === 1) { - if (slave.actualAge < 18) - V.titleEnunciate = "Bro"; - else - V.titleEnunciate = "Brother"; + if (slave.actualAge < 18) { V.titleEnunciate = "Bro"; } else { V.titleEnunciate = "Brother"; } } else if (V.PC.title === 0) { - if (slave.actualAge < 18) - V.titleEnunciate = "Thith"; - else - V.titleEnunciate = "Thithter"; + if (slave.actualAge < 18) { V.titleEnunciate = "Thith"; } else { V.titleEnunciate = "Thithter"; } } } } - if (slave.custom.titleLisp && slave.custom.titleLisp !== "") - V.titleEnunciate = slave.custom.titleLisp; + if (slave.custom.titleLisp && slave.custom.titleLisp !== "") { V.titleEnunciate = slave.custom.titleLisp; } V.sayEnunciate = "lisp"; V.sEnunciate = "th"; V.SEnunciate = "Th"; @@ -489,56 +457,25 @@ window.Enunciate = function Enunciate(slave) { V.xEnunciate = "kth"; V.XEnunciate = "Th"; } else { - if (V.PC.customTitle !== undefined) - V.titleEnunciate = V.PC.customTitle; - else if (V.PC.title !== 0) - V.titleEnunciate = "Master"; - else - V.titleEnunciate = "Mistress"; + if (V.PC.customTitle !== undefined) { V.titleEnunciate = V.PC.customTitle; } else if (V.PC.title !== 0) { V.titleEnunciate = "Master"; } else { V.titleEnunciate = "Mistress"; } if (V.allowFamilyTitles === 1) { if (slave.father === -1) { - if (slave.actualAge < 4 && slave.physicalAge < 4) - V.titleEnunciate = "Dadda"; - else if (slave.actualAge < 9) - V.titleEnunciate = "Daddy"; - else - V.titleEnunciate = "Dad"; + if (slave.actualAge < 4 && slave.physicalAge < 4) { V.titleEnunciate = "Dadda"; } else if (slave.actualAge < 9) { V.titleEnunciate = "Daddy"; } else { V.titleEnunciate = "Dad"; } } else if (slave.mother === -1) { - if (slave.actualAge < 4 && slave.physicalAge < 4) - V.titleEnunciate = "Mama"; - else if (slave.actualAge < 9) - V.titleEnunciate = "Mommy"; - else - V.titleEnunciate = "Mom"; + if (slave.actualAge < 4 && slave.physicalAge < 4) { V.titleEnunciate = "Mama"; } else if (slave.actualAge < 9) { V.titleEnunciate = "Mommy"; } else { V.titleEnunciate = "Mom"; } } else if (V.PC.mother === slave.ID || V.PC.father === slave.ID) { - if (V.PC.title === 1) - V.titleEnunciate = "Son"; - else if (V.PC.title === 0) - V.titleEnunciate = "Daughter"; + if (V.PC.title === 1) { V.titleEnunciate = "Son"; } else if (V.PC.title === 0) { V.titleEnunciate = "Daughter"; } } else if (areSisters(slave, V.PC) > 0) { if (V.PC.title === 1) { - if (slave.actualAge < 18) - V.titleEnunciate = "Bro"; - else - V.titleEnunciate = "Brother"; + if (slave.actualAge < 18) { V.titleEnunciate = "Bro"; } else { V.titleEnunciate = "Brother"; } } else if (V.PC.title === 0) { - if (slave.actualAge < 18) - V.titleEnunciate = "Sis"; - else - V.titleEnunciate = "Sister"; + if (slave.actualAge < 18) { V.titleEnunciate = "Sis"; } else { V.titleEnunciate = "Sister"; } } } } - if (slave.custom.title !== undefined && slave.custom.title !== "") - V.titleEnunciate = slave.custom.title; - if (V.PC.customTitle !== undefined) - V.writtenTitle = V.PC.customTitle; - else if (V.PC.title !== 0) - V.writtenTitle = "Master"; - else - V.writtenTitle = "Mistress"; - if (slave.custom.title !== undefined && slave.custom.title !== "" && slave.rudeTitle === 0) - V.writtenTitle = slave.custom.title; + if (slave.custom.title !== undefined && slave.custom.title !== "") { V.titleEnunciate = slave.custom.title; } + if (V.PC.customTitle !== undefined) { V.writtenTitle = V.PC.customTitle; } else if (V.PC.title !== 0) { V.writtenTitle = "Master"; } else { V.writtenTitle = "Mistress"; } + if (slave.custom.title !== undefined && slave.custom.title !== "" && slave.rudeTitle === 0) { V.writtenTitle = slave.custom.title; } V.sayEnunciate = "say"; V.sEnunciate = "s"; V.SEnunciate = "S"; @@ -591,8 +528,7 @@ window.fetishChangeChance = function fetishChangeChance(slave) { window.SlaveFullName = function SlaveFullName(slave) { const V = State.variables; const pair = slave.slaveSurname ? [slave.slaveName, slave.slaveSurname] : [slave.slaveName]; - if ((V.surnameOrder !== 1 && ["Cambodian", "Chinese", "Hungarian", "Japanese", "Korean", "Mongolian", "Taiwanese", "Vietnamese"].includes(slave.nationality)) || (V.surnameOrder === 2)) - pair.reverse(); + if ((V.surnameOrder !== 1 && ["Cambodian", "Chinese", "Hungarian", "Japanese", "Korean", "Mongolian", "Taiwanese", "Vietnamese"].includes(slave.nationality)) || (V.surnameOrder === 2)) { pair.reverse(); } return pair.join(" "); }; @@ -603,16 +539,14 @@ window.SlaveFullName = function SlaveFullName(slave) { window.SlaveFullBirthName = function SlaveFullBirthName(slave) { const V = State.variables; const pair = slave.birthSurname ? [slave.birthName, slave.birthSurname] : [slave.birthName]; - if ((V.surnameOrder !== 1 && ["Cambodian", "Chinese", "Hungarian", "Japanese", "Korean", "Mongolian", "Taiwanese", "Vietnamese"].includes(slave.nationality)) || (V.surnameOrder === 2)) - pair.reverse(); + if ((V.surnameOrder !== 1 && ["Cambodian", "Chinese", "Hungarian", "Japanese", "Korean", "Mongolian", "Taiwanese", "Vietnamese"].includes(slave.nationality)) || (V.surnameOrder === 2)) { pair.reverse(); } return pair.join(" "); }; window.PlayerName = function PlayerName() { const V = State.variables; const names = V.PC.surname ? [V.PC.name, V.PC.surname] : [V.PC.name]; - if ((V.surnameOrder !== 1 && ["Cambodian", "Chinese", "Hungarian", "Japanese", "Korean", "Mongolian", "Taiwanese", "Vietnamese"].includes(V.PC.nationality)) || (V.surnameOrder === 2)) - names.reverse(); + if ((V.surnameOrder !== 1 && ["Cambodian", "Chinese", "Hungarian", "Japanese", "Korean", "Mongolian", "Taiwanese", "Vietnamese"].includes(V.PC.nationality)) || (V.surnameOrder === 2)) { names.reverse(); } return names.join(" "); }; @@ -623,48 +557,48 @@ window.PCTitle = function PCTitle() { V.PCTitle = PlayerName(); if (V.cheater === 1) { - V.PCTitle = (`${V.PCTitle } the Cheater`); + V.PCTitle = (`${V.PCTitle} the Cheater`); } else if (V.arcologies[0].FSRestart > 10) { - V.PCTitle = (`${V.PCTitle } of the Societal Elite`); + V.PCTitle = (`${V.PCTitle} of the Societal Elite`); } else if (V.rep > 18000) { - V.PCTitle = (`${V.PCTitle } the Great`); + V.PCTitle = (`${V.PCTitle} the Great`); } else if (V.rep > 17000) { - V.PCTitle = (`the exalted ${ V.PCTitle}`); + V.PCTitle = (`the exalted ${V.PCTitle}`); } else if (V.rep > 16000) { - V.PCTitle = (`the illustrious ${ V.PCTitle}`); + V.PCTitle = (`the illustrious ${V.PCTitle}`); } else if (V.rep > 15000) { - V.PCTitle = (`the prestigious ${ V.PCTitle}`); + V.PCTitle = (`the prestigious ${V.PCTitle}`); } else if (V.rep > 14000) { - V.PCTitle = (`the renowned ${ V.PCTitle}`); + V.PCTitle = (`the renowned ${V.PCTitle}`); } else if (V.rep > 13000) { - V.PCTitle = (`the famed ${ V.PCTitle}`); + V.PCTitle = (`the famed ${V.PCTitle}`); } else if (V.rep > 12000) { - V.PCTitle = (`the celebrated ${ V.PCTitle}`); + V.PCTitle = (`the celebrated ${V.PCTitle}`); } else if (V.rep > 11000) { - V.PCTitle = (`the honored ${ V.PCTitle}`); + V.PCTitle = (`the honored ${V.PCTitle}`); } else if (V.rep > 10000) { - V.PCTitle = (`the acclaimed ${ V.PCTitle}`); + V.PCTitle = (`the acclaimed ${V.PCTitle}`); } else if (V.rep > 9000) { - V.PCTitle = (`the eminent ${ V.PCTitle}`); + V.PCTitle = (`the eminent ${V.PCTitle}`); } else if (V.rep > 8250) { - V.PCTitle = (`the prominent ${ V.PCTitle}`); + V.PCTitle = (`the prominent ${V.PCTitle}`); } else if (V.rep > 7500) { - V.PCTitle = (`the distinguished ${ V.PCTitle}`); + V.PCTitle = (`the distinguished ${V.PCTitle}`); } else if (V.rep > 6750) { - V.PCTitle = (`the admired ${ V.PCTitle}`); + V.PCTitle = (`the admired ${V.PCTitle}`); } else if (V.rep > 6000) { - V.PCTitle = (`the esteemed ${ V.PCTitle}`); + V.PCTitle = (`the esteemed ${V.PCTitle}`); } else if (V.rep > 5250) { - V.PCTitle = (`the respected ${ V.PCTitle}`); + V.PCTitle = (`the respected ${V.PCTitle}`); } else if (V.rep > 4500) { - V.PCTitle = (`the known ${ V.PCTitle}`); + V.PCTitle = (`the known ${V.PCTitle}`); } else if (V.rep > 3750) { - V.PCTitle = (`the recognized ${ V.PCTitle}`); + V.PCTitle = (`the recognized ${V.PCTitle}`); } else if (V.rep > 3000) { - V.PCTitle = (`the rumored ${ V.PCTitle}`); + V.PCTitle = (`the rumored ${V.PCTitle}`); } - V.PCTitle = (`${V.PCTitle }, `); + V.PCTitle = (`${V.PCTitle}, `); if (V.PC.name === "FC Dev") { titles.push("the Creator"); @@ -704,17 +638,17 @@ window.PCTitle = function PCTitle() { if (V.mercenaries >= 5) { if (V.mercenariesTitle === "Evocati") { - titles.push(`Princeps of the ${ V.mercenariesTitle}`); + titles.push(`Princeps of the ${V.mercenariesTitle}`); } else if (V.mercenariesTitle === "Knights") { if (V.PC.title === 1) { - titles.push(`Lord Commander of the ${ V.mercenariesTitle}`); + titles.push(`Lord Commander of the ${V.mercenariesTitle}`); } else { - titles.push(`Lady Commander of the ${ V.mercenariesTitle}`); + titles.push(`Lady Commander of the ${V.mercenariesTitle}`); } } else if (V.mercenariesTitle === "Immortals") { - titles.push(`Tyrant of the ${ V.mercenariesTitle}`); + titles.push(`Tyrant of the ${V.mercenariesTitle}`); } else { - titles.push(`Commander of the ${ V.mercenariesTitle}`); + titles.push(`Commander of the ${V.mercenariesTitle}`); } } else if (V.mercenaries >= 1) { titles.push("Commander of the Mercenaries"); @@ -1063,9 +997,9 @@ window.PCTitle = function PCTitle() { if (schoolsPerfected.length === 1) { schoolTitle += schoolsPerfected[0]; } else if (schoolsPerfected.length === 2) { - schoolTitle += `${schoolsPerfected[0] } and ${ schoolsPerfected[1]}`; + schoolTitle += `${schoolsPerfected[0]} and ${schoolsPerfected[1]}`; } else { - schoolsPerfected[schoolsPerfected.length - 1] = `and ${ schoolsPerfected[schoolsPerfected.length - 1]}`; + schoolsPerfected[schoolsPerfected.length - 1] = `and ${schoolsPerfected[schoolsPerfected.length - 1]}`; schoolTitle += schoolsPerfected.join(", "); } titles.push(schoolTitle); @@ -1076,9 +1010,9 @@ window.PCTitle = function PCTitle() { if (schoolsPresent.length === 1) { schoolTitle += schoolsPresent[0]; } else if (schoolsPresent.length === 2) { - schoolTitle += `${schoolsPresent[0] } and ${ schoolsPresent[1]}`; + schoolTitle += `${schoolsPresent[0]} and ${schoolsPresent[1]}`; } else { - schoolsPresent[schoolsPresent.length - 1] = `and ${ schoolsPresent[schoolsPresent.length - 1]}`; + schoolsPresent[schoolsPresent.length - 1] = `and ${schoolsPresent[schoolsPresent.length - 1]}`; schoolTitle += schoolsPresent.join(", "); } titles.push(schoolTitle); @@ -1147,9 +1081,9 @@ window.PCTitle = function PCTitle() { if (titles.length === 1) { V.PCTitle += titles[0]; } else if (titles.length === 2) { - V.PCTitle += `${titles[0] } and ${ titles[1]}`; + V.PCTitle += `${titles[0]} and ${titles[1]}`; } else { - titles[titles.length - 1] = `and ${ titles[titles.length - 1]}`; + titles[titles.length - 1] = `and ${titles[titles.length - 1]}`; V.PCTitle += titles.join(", "); } }; @@ -1253,80 +1187,80 @@ window.SlaveTitle = function SlaveTitle(slave) { if (slave.visualAge < 13) { if (slave.genes === "XY" && slave.vagina === -1) { - r = `shota ${ r}`; + r = `shota ${r}`; } else { - r = `loli ${ r}`; + r = `loli ${r}`; } } if (slave.geneticQuirks.albinism === 2) { - r = `albino ${ r}`; + r = `albino ${r}`; } if (slave.dick > 9 && slave.balls > 9 && slave.boobs > 12000) { - r = `hyper ${ r}`; + r = `hyper ${r}`; } if (slave.boobs > 4000 && slave.lactation > 0) { if (slave.physicalAge < 13) { - r = `${r } calf`; + r = `${r} calf`; } else { - r = `${r } cow`; + r = `${r} cow`; } } else if (slave.lactation > 0) { - r = `milky ${ r}`; + r = `milky ${r}`; } if (slave.boobs > 20000) { - r = `supermassive titted ${ r}`; + r = `supermassive titted ${r}`; } else if (slave.boobs > 10000) { - r = `giant titted ${ r}`; + r = `giant titted ${r}`; } else if (slave.boobs > 4000) { - r = `huge titted ${ r}`; + r = `huge titted ${r}`; } else if (slave.boobs > 1000) { - r = `busty ${ r}`; + r = `busty ${r}`; } if (slave.dick > 5 && slave.balls > 5) { - r = `womb filling ${ r}`; + r = `womb filling ${r}`; } else if (slave.dick > 5) { - r = `well hung ${ r}`; + r = `well hung ${r}`; } if (slave.butt >= 12) { - r = `colossal assed ${ r}`; + r = `colossal assed ${r}`; } else if (slave.butt >= 12) { - r = `massive assed ${ r}`; + r = `massive assed ${r}`; } else if (slave.butt >= 8) { - r = `fat assed ${ r}`; + r = `fat assed ${r}`; } else if (slave.butt >= 6) { - r = `bottom heavy ${ r}`; + r = `bottom heavy ${r}`; } else if (slave.butt >= 4) { - r = `big bottomed ${ r}`; + r = `big bottomed ${r}`; } if (slave.weight > 10 && slave.weight < 100 && slave.boobs > 5000 && slave.butt > 5 && slave.hips >= 2 && slave.bellyPreg >= 30000 && slave.counter.births >= 10) { - r = `${r } fertility goddess`; + r = `${r} fertility goddess`; } else if (slave.counter.births >= 6) { - r = `${r } broodmother`; + r = `${r} broodmother`; } else if (slave.counter.births >= 3) { - r = `${r } breeder`; + r = `${r} breeder`; } if (slave.indenture > -1) { - r = `indentured ${ r}`; + r = `indentured ${r}`; } if (slave.preg > slave.pregData.normalBirth / 4 && slave.pregKnown === 1) { - r = `pregnant ${ r}`; + r = `pregnant ${r}`; } else if (slave.bellyFluid >= 5000) { - r = `bloated ${ r}`; + r = `bloated ${r}`; } else if (slave.belly >= 5000) { - r = `gravid ${ r}`; + r = `gravid ${r}`; } if (slave.fuckdoll > 0) { - r = `${r } fuckdoll`; + r = `${r} fuckdoll`; } } else { r = "slave"; /* I don't tihnk there is an 'else'? */ @@ -1334,24 +1268,24 @@ window.SlaveTitle = function SlaveTitle(slave) { /* NULLS */ r = "null"; if ((slave.lactation > 0) && (slave.boobs > 2000)) { - r = `${r } cow`; + r = `${r} cow`; } else if ((slave.boobsImplant > 0) && (slave.buttImplant > 0)) { - r = `${r } bimbo `; + r = `${r} bimbo `; } else if (slave.boobs > 6000) { - r = `${r } boob`; + r = `${r} boob`; } else if (slave.butt > 6) { - r = `${r } ass`; + r = `${r} ass`; } else if ((slave.muscles > 30) && (slave.height < 185)) { - r = `${r } muscle`; + r = `${r} muscle`; } if (slave.visualAge > 55) { - r = `${r }GILF`; + r = `${r}GILF`; } else if (slave.visualAge > 35) { - r = `${r }MILF`; + r = `${r}MILF`; } else if (slave.visualAge >= 25) { - r = `${r }slave`; + r = `${r}slave`; } else { - r = `${r }girl`; + r = `${r}girl`; } } @@ -1367,15 +1301,15 @@ window.SlaveTitle = function SlaveTitle(slave) { r = "slavegirl"; } if ((slave.muscles > 30) && (slave.height < 185)) { - r = `muscle ${ r}`; + r = `muscle ${r}`; } else if ((slave.lactation > 0) && (slave.boobs > 2000)) { - r = `${r } cow`; + r = `${r} cow`; } else if ((slave.boobsImplant > 0) && (slave.buttImplant > 0)) { - r = `${r } bimbo`; + r = `${r} bimbo`; } else if (slave.boobs > 6000) { - r = `boob${ r}`; + r = `boob${r}`; } else if (slave.butt > 6) { - r = `ass${ r}`; + r = `ass${r}`; } } @@ -1388,27 +1322,27 @@ window.SlaveTitle = function SlaveTitle(slave) { r = "futa "; } if ((slave.lactation > 0) && (slave.boobs > 2000)) { - r = `${r }cow`; + r = `${r}cow`; } else if ((slave.boobsImplant > 0) && (slave.buttImplant > 0)) { - r = `${r }bimbo `; + r = `${r}bimbo `; } else if (slave.boobs > 6000) { - r = `${r }boob`; + r = `${r}boob`; } else if (slave.butt > 6) { - r = `${r }ass`; + r = `${r}ass`; } else if ((slave.muscles > 30) && (slave.height < 185)) { - r = `${r }muscle`; + r = `${r}muscle`; } if (slave.visualAge > 55) { - r = `${r }GILF`; + r = `${r}GILF`; } else if (slave.visualAge > 35) { - r = `${r }MILF`; + r = `${r}MILF`; } else if (slave.visualAge >= 25) { - r = `${r }slave`; + r = `${r}slave`; } else { - r = `${r }girl`; + r = `${r}girl`; } if (slave.dick > 5 && slave.balls > 5 && slave.boobs > 5000) { - r = `hyper ${ r}`; + r = `hyper ${r}`; } } @@ -1424,15 +1358,15 @@ window.SlaveTitle = function SlaveTitle(slave) { r = "tgirl"; } if ((slave.muscles > 30) && (slave.height < 185)) { - r = `muscle${ r}`; + r = `muscle${r}`; } else if ((slave.lactation > 0) && (slave.boobs > 2000)) { - r = `${r } cow`; + r = `${r} cow`; } else if ((slave.boobsImplant > 0) && (slave.buttImplant > 0)) { - r = `${r } bimbo`; + r = `${r} bimbo`; } else if (slave.boobs > 6000) { - r = `topheavy ${ r}`; + r = `topheavy ${r}`; } else if (slave.butt > 6) { - r = `bottomheavy ${ r}`; + r = `bottomheavy ${r}`; } } @@ -1461,9 +1395,9 @@ window.SlaveTitle = function SlaveTitle(slave) { } } if (slave.lactation > 0) { - r = `${r } cow`; + r = `${r} cow`; } else if ((slave.boobsImplant > 0) && (slave.buttImplant > 0)) { - r = `${r } bimbo`; + r = `${r} bimbo`; } } } @@ -1475,18 +1409,18 @@ window.SlaveTitle = function SlaveTitle(slave) { /* BITCHES: masculine shoulders or muscles */ r = "bitch"; if ((slave.muscles > 30) && (slave.height < 185)) { - r = `muscle${ r}`; + r = `muscle${r}`; } else if (slave.lactation > 0) { - r = `${r }cow`; + r = `${r}cow`; } else if ((slave.boobsImplant > 0) && (slave.buttImplant > 0)) { - r = `bimbo ${ r}`; + r = `bimbo ${r}`; } if (slave.visualAge > 55) { - r = `aged ${ r}`; + r = `aged ${r}`; } else if (slave.visualAge > 35) { - r = `mature ${ r}`; + r = `mature ${r}`; } else if (slave.visualAge < 25) { - r = `young ${ r}`; + r = `young ${r}`; } } } @@ -1495,61 +1429,61 @@ window.SlaveTitle = function SlaveTitle(slave) { if ((slave.dick !== 0) && (slave.vagina === -1) && (slave.balls === 0)) { r = "dick"; if (slave.visualAge > 55) { - r = `${r }GILF`; + r = `${r}GILF`; } else if (slave.visualAge > 35) { - r = `${r }MILF`; + r = `${r}MILF`; } else if (slave.visualAge >= 25) { - r = `${r }slave`; + r = `${r}slave`; } else { - r = `${r }girl`; + r = `${r}girl`; } if ((slave.muscles > 30) && (slave.height < 185)) { - r = `muscle${ r}`; + r = `muscle${r}`; } else if ((slave.lactation > 0) && (slave.boobs > 2000)) { - r = `${r } cow`; + r = `${r} cow`; } else if ((slave.boobsImplant > 0) && (slave.buttImplant > 0)) { - r = `${r } bimbo`; + r = `${r} bimbo`; } else if (slave.boobs > 6000) { - r = `boob ${ r}`; + r = `boob ${r}`; } else if (slave.butt > 6) { - r = `ass ${ r}`; + r = `ass ${r}`; } } if ((slave.muscles > 30) && (slave.height > 185)) { - r = `amazon ${ r}`; + r = `amazon ${r}`; } else if ((slave.muscles < 30) && (slave.height > 185)) { - r = `statuesque ${ r}`; + r = `statuesque ${r}`; } else if ((slave.boobs < 800) && (slave.height < 150)) { - r = `petite ${ r}`; + r = `petite ${r}`; } else if ((slave.boobs > 800) && (slave.height < 150)) { - r = `shortstack ${ r}`; + r = `shortstack ${r}`; } if (slave.counter.births >= 5) { - r = `${r } broodmother`; + r = `${r} broodmother`; } else if (slave.counter.births >= 2) { - r = `${r } breeder`; + r = `${r} breeder`; } if (slave.geneticQuirks.albinism === 2) { - r = `albino ${ r}`; + r = `albino ${r}`; } if (slave.indenture > -1) { - r = `indentured ${ r}`; + r = `indentured ${r}`; } if (slave.preg > slave.pregData.normalBirth / 4 && slave.pregKnown === 1) { - r = `pregnant ${ r}`; + r = `pregnant ${r}`; } else if (slave.bellyFluid >= 5000) { - r = `bloated ${ r}`; + r = `bloated ${r}`; } else if (slave.belly >= 5000) { - r = `gravid ${ r}`; + r = `gravid ${r}`; } if (slave.fuckdoll > 0) { - r = `${r } fuckdoll`; + r = `${r} fuckdoll`; } } return r; @@ -1580,10 +1514,10 @@ window.DegradingName = function DegradingName(slave) { const suffixes = []; if (slave.fuckdoll > 0) { - slave.slaveName = `Fuckdoll No. ${ slave.ID}`; + slave.slaveName = `Fuckdoll No. ${slave.ID}`; slave.slaveSurname = 0; } else if (slave.assignment === "work in the dairy" && V.dairyRestraintsSetting >= 2) { - slave.slaveName = `Bioreactor No. ${ slave.ID}`; + slave.slaveName = `Bioreactor No. ${slave.ID}`; slave.slaveSurname = 0; } else { if (V.seeRace === 1) { @@ -2096,20 +2030,9 @@ window.faceIncrease = function faceIncrease(slave, amount) { const his = pronouns.possessive; const His = capFirstChar(his); let r = ""; - if (slave.face <= -95) - r += `<span class="green">${His} face is no longer horrifying,</span> and is now merely ugly.`; - else if (slave.face <= -40 && slave.face + amount > -40) - r += `<span class="green">${His} face is no longer ugly,</span> and is now merely unattractive.`; - else if (slave.face <= -10 && slave.face + amount > -10) - r += `<span class="green">${His} face is no longer unattractive,</span> and is now somewhat tolerable.`; - else if (slave.face <= 10 && slave.face + amount > 10) - r += `<span class="green">${His} face is now decently attractive,</span> rather than merely tolerable.`; - else if (slave.face <= 40 && slave.face + amount > 40) - r += `<span class="green">${His} face is now quite beautiful,</span> rather than merely pretty.`; - else if (slave.face <= 95 && slave.face + amount > 95) - r += `<span class="green">${His} face is now perfect.</span> It's difficult to imagine how it could be any more beautiful.`; + if (slave.face <= -95) { r += `<span class="green">${His} face is no longer horrifying,</span> and is now merely ugly.`; } else if (slave.face <= -40 && slave.face + amount > -40) { r += `<span class="green">${His} face is no longer ugly,</span> and is now merely unattractive.`; } else if (slave.face <= -10 && slave.face + amount > -10) { r += `<span class="green">${His} face is no longer unattractive,</span> and is now somewhat tolerable.`; } else if (slave.face <= 10 && slave.face + amount > 10) { r += `<span class="green">${His} face is now decently attractive,</span> rather than merely tolerable.`; } else if (slave.face <= 40 && slave.face + amount > 40) { r += `<span class="green">${His} face is now quite beautiful,</span> rather than merely pretty.`; } else if (slave.face <= 95 && slave.face + amount > 95) { r += `<span class="green">${His} face is now perfect.</span> It's difficult to imagine how it could be any more beautiful.`; } slave.face = Math.clamp(slave.face + amount, -100, 100); - if (slave.face > 95) slave.face = 100; + if (slave.face > 95) { slave.face = 100; } return r; }; diff --git a/src/js/assignJS.js b/src/js/assignJS.js index 90124832f88..3211b3bc5cd 100644 --- a/src/js/assignJS.js +++ b/src/js/assignJS.js @@ -4,8 +4,7 @@ window.assignJob = function assignJob(slave, job) { const V = State.variables; let r = ""; - if (job === "Pit" || job === "Coursing Association") - return r; + if (job === "Pit" || job === "Coursing Association") { return r; } removeJob(slave, slave.assignment); const idx = V.slaveIndices[slave.ID]; @@ -170,10 +169,7 @@ window.assignJob = function assignJob(slave, job) { slave.assignmentVisible = 0; V.masterSuiteSlaves++; V.MastSiIDs.push(slave.ID); - if (V.masterSuiteUpgradeLuxury > 0) - slave.livingRules = "luxurious"; - else - slave.livingRules = "spare"; + if (V.masterSuiteUpgradeLuxury > 0) { slave.livingRules = "luxurious"; } else { slave.livingRules = "spare"; } break; case "learn in the schoolroom": @@ -258,10 +254,7 @@ window.assignJob = function assignJob(slave, job) { case "be your concubine": slave.assignment = job; slave.assignmentVisible = 0; /* non-visible leadership roles */ - if (V.masterSuiteUpgradeLuxury > 0) - slave.livingRules = "luxurious"; - else - slave.livingRules = "normal"; + if (V.masterSuiteUpgradeLuxury > 0) { slave.livingRules = "luxurious"; } else { slave.livingRules = "normal"; } break; case "be your head girl": @@ -276,8 +269,7 @@ window.assignJob = function assignJob(slave, job) { if (V.dojo > 1) { slave.livingRules = "luxurious"; } - if (V.pitBG === 1 && V.fighterIDs.includes(slave.ID)) - V.fighterIDs.delete(slave.ID); + if (V.pitBG === 1 && V.fighterIDs.includes(slave.ID)) { V.fighterIDs.delete(slave.ID); } break; case "be your agent": @@ -303,24 +295,17 @@ window.assignJob = function assignJob(slave, job) { } if (slave.assignmentVisible === 0 && Array.isArray(V.personalAttention)) { - const awi = V.personalAttention.findIndex(function(s) {return s.ID === slave.ID;}); + const awi = V.personalAttention.findIndex(function(s) { return s.ID === slave.ID; }); if (awi !== -1) { V.personalAttention.deleteAt(awi); if (V.personalAttention.length === 0) { - if (V.PC.career === "escort") - V.personalAttention = "whoring"; - else if (V.PC.career === "servant") - V.personalAttention = "upkeep"; - else - V.personalAttention = "business"; + if (V.PC.career === "escort") { V.personalAttention = "whoring"; } else if (V.PC.career === "servant") { V.personalAttention = "upkeep"; } else { V.personalAttention = "business"; } r += `${slave.slaveName} no longer has your personal attention; you plan to focus on ${V.personalAttention}.`; - } else - r += `${slave.slaveName} no longer has your personal attention.`; + } else { r += `${slave.slaveName} no longer has your personal attention.`; } } } V.JobIDArray = resetJobIDArray(); - if (idx >= 0) - V.slaves[idx] = slave; + if (idx >= 0) { V.slaves[idx] = slave; } return r; }; @@ -332,43 +317,8 @@ window.removeJob = function removeJob(slave, assignment) { const idx = V.slaveIndices[slave.ID]; - if (assignment === "Pit") - V.fighterIDs.delete(slave.ID); - - else if (assignment === "Coursing Association") - V.Lurcher = 0; - - else { - if (V.HeadGirl !== 0 && slave.ID === V.HeadGirl.ID) - V.HeadGirl = 0; - else if (V.Recruiter !== 0 && slave.ID === V.Recruiter.ID) - V.Recruiter = 0; - else if (V.Bodyguard !== 0 && slave.ID === V.Bodyguard.ID) - V.Bodyguard = 0; - else if (V.Madam !== 0 && slave.ID === V.Madam.ID) - V.Madam = 0; - else if (V.DJ !== 0 && slave.ID === V.DJ.ID) - V.DJ = 0; - else if (V.Milkmaid !== 0 && slave.ID === V.Milkmaid.ID) - V.Milkmaid = 0; - else if (V.Farmer !== 0 && slave.ID === V.Farmer.ID) - V.Farmer = 0; - else if (V.Schoolteacher !== 0 && slave.ID === V.Schoolteacher.ID) - V.Schoolteacher = 0; - else if (V.Attendant !== 0 && slave.ID === V.Attendant.ID) - V.Attendant = 0; - else if (V.Matron !== 0 && slave.ID === V.Matron.ID) - V.Matron = 0; - else if (V.Nurse !== 0 && slave.ID === V.Nurse.ID) - V.Nurse = 0; - else if (V.Stewardess !== 0 && slave.ID === V.Stewardess.ID) - V.Stewardess = 0; - else if (V.Wardeness !== 0 && slave.ID === V.Wardeness.ID) - V.Wardeness = 0; - else if (V.Concubine !== 0 && slave.ID === V.Concubine.ID) - V.Concubine = 0; - else if (V.Collectrix !== 0 && slave.ID === V.Collectrix.ID) - V.Collectrix = 0; + if (assignment === "Pit") { V.fighterIDs.delete(slave.ID); } else if (assignment === "Coursing Association") { V.Lurcher = 0; } else { + if (V.HeadGirl !== 0 && slave.ID === V.HeadGirl.ID) { V.HeadGirl = 0; } else if (V.Recruiter !== 0 && slave.ID === V.Recruiter.ID) { V.Recruiter = 0; } else if (V.Bodyguard !== 0 && slave.ID === V.Bodyguard.ID) { V.Bodyguard = 0; } else if (V.Madam !== 0 && slave.ID === V.Madam.ID) { V.Madam = 0; } else if (V.DJ !== 0 && slave.ID === V.DJ.ID) { V.DJ = 0; } else if (V.Milkmaid !== 0 && slave.ID === V.Milkmaid.ID) { V.Milkmaid = 0; } else if (V.Farmer !== 0 && slave.ID === V.Farmer.ID) { V.Farmer = 0; } else if (V.Schoolteacher !== 0 && slave.ID === V.Schoolteacher.ID) { V.Schoolteacher = 0; } else if (V.Attendant !== 0 && slave.ID === V.Attendant.ID) { V.Attendant = 0; } else if (V.Matron !== 0 && slave.ID === V.Matron.ID) { V.Matron = 0; } else if (V.Nurse !== 0 && slave.ID === V.Nurse.ID) { V.Nurse = 0; } else if (V.Stewardess !== 0 && slave.ID === V.Stewardess.ID) { V.Stewardess = 0; } else if (V.Wardeness !== 0 && slave.ID === V.Wardeness.ID) { V.Wardeness = 0; } else if (V.Concubine !== 0 && slave.ID === V.Concubine.ID) { V.Concubine = 0; } else if (V.Collectrix !== 0 && slave.ID === V.Collectrix.ID) { V.Collectrix = 0; } /* use .toLowerCase() to get rid of a few dupe conditions. */ switch (assignment.toLowerCase()) { @@ -475,12 +425,7 @@ window.removeJob = function removeJob(slave, assignment) { case "be your head girl": slave.assignment = "rest"; if (V.HGSuiteEquality === 0 && V.personalAttention === "HG") { - if (V.PC.career === "escort") - V.personalAttention = "whoring"; - else if (V.PC.career === "servant") - V.personalAttention = "upkeep"; - else - V.personalAttention = "business"; + if (V.PC.career === "escort") { V.personalAttention = "whoring"; } else if (V.PC.career === "servant") { V.personalAttention = "upkeep"; } else { V.personalAttention = "business"; } r += `You no longer have a slave assigned to be your Head Girl, so you turn your personal attention to focus on ${V.personalAttention}.`; } @@ -492,12 +437,11 @@ window.removeJob = function removeJob(slave, assignment) { const _leaderIndex = V.leaders.findIndex(function(x) { return x.ID === slave.ID; }); - if (_leaderIndex !== -1) - V.leaders.deleteAt(_leaderIndex); + if (_leaderIndex !== -1) { V.leaders.deleteAt(_leaderIndex); } if (slave.relationshipTarget > 0) { /* following code assumes there can be at most one companion */ - const _lover = V.slaves.findIndex(function(s) {return haveRelationshipP(s, slave) && s.assignment === "live with your agent";}); + const _lover = V.slaves.findIndex(function(s) { return haveRelationshipP(s, slave) && s.assignment === "live with your agent"; }); if (_lover !== -1) { V.slaves[_lover].assignment = "rest"; V.slaves[_lover].assignmentVisible = 1; @@ -510,16 +454,14 @@ window.removeJob = function removeJob(slave, assignment) { break; } - if (slave.livingRules === "luxurious" && slave.assignmentVisible !== 1) - slave.livingRules = "normal"; + if (slave.livingRules === "luxurious" && slave.assignmentVisible !== 1) { slave.livingRules = "normal"; } slave.assignmentVisible = 1; slave.choosesOwnAssignment = 0; slave.sentence = 0; } V.JobIDArray = resetJobIDArray(); - if (idx >= 0) - V.slaves[idx] = slave; + if (idx >= 0) { V.slaves[idx] = slave; } return r; }; @@ -541,8 +483,7 @@ window.resetJobIDArray = function resetJobIDArray() { }; slaves.forEach(function(slave) { - if (JobIDArray.hasOwnProperty(slave.assignment)) - JobIDArray[slave.assignment].push(slave.ID); + if (JobIDArray.hasOwnProperty(slave.assignment)) { JobIDArray[slave.assignment].push(slave.ID); } }); return JobIDArray; @@ -602,7 +543,7 @@ App.UI.jobLinks = function() { const slave = App.Utils.slaveByIndex(index); for (const f of facilitiesOrder) { - if (!f.established) continue; + if (!f.established) { continue; } const rejects = f.canHostSlave(slave); if (rejects.length === 0) { transfers.push(f.transferLink(index, undefined, passage())); diff --git a/src/js/familyTreeJS.js b/src/js/familyTreeJS.js index a557c3ba98b..1626ba8faf5 100644 --- a/src/js/familyTreeJS.js +++ b/src/js/familyTreeJS.js @@ -195,7 +195,7 @@ window.renderFamilyTree = function(slaves, filterID) { .links(data.links); function dragstarted(d) { - if (!d3.event.active) simulation.alphaTarget(0.3).restart(); + if (!d3.event.active) { simulation.alphaTarget(0.3).restart(); } d.fx = d.x; d.fy = d.y; } @@ -206,7 +206,7 @@ window.renderFamilyTree = function(slaves, filterID) { } function dragended(d) { - if (!d3.event.active) simulation.alphaTarget(0); + if (!d3.event.active) { simulation.alphaTarget(0); } d.fx = null; d.fy = null; } @@ -536,8 +536,7 @@ window.updateFamilyTree = function(activeSlave = lastActiveSlave, slaves = lastS let numTreeNodes = 0; let graphElement = document.getElementById("graph"); - if (!graphElement) - return; + if (!graphElement) { return; } graphElement.innerHTML = ""; /* The way this code works is that we start with the activeSlave then we call @@ -563,8 +562,7 @@ window.updateFamilyTree = function(activeSlave = lastActiveSlave, slaves = lastS return activeSlave; } for (let i = 0; i < slaves.length; ++i) { - if (slaves[i].ID === id) - return slaves[i]; + if (slaves[i].ID === id) { return slaves[i]; } } return { "slaveName": "-", @@ -582,8 +580,7 @@ window.updateFamilyTree = function(activeSlave = lastActiveSlave, slaves = lastS } recursionProtectSlaveId[slave.ID] = true; - if (typeof slave.father === "undefined" || typeof slave.mother === "undefined") - return slaveInfo_(slave, activeSlaveId); + if (typeof slave.father === "undefined" || typeof slave.mother === "undefined") { return slaveInfo_(slave, activeSlaveId); } if (slave.father === -1 || slave.mother === -1) { return slaveInfo(getSlave(-1), activeSlaveId, recursionProtectSlaveId); @@ -616,8 +613,7 @@ window.updateFamilyTree = function(activeSlave = lastActiveSlave, slaves = lastS let spouseToChild = {}; function maybeAddSpouseToChild(child) { - if (child.ID === slave.ID) - return; + if (child.ID === slave.ID) { return; } if (child.father === slave.ID) { if (!spouseToChild[child.mother]) { spouseToChild[child.mother] = []; @@ -663,16 +659,14 @@ window.updateFamilyTree = function(activeSlave = lastActiveSlave, slaves = lastS return data; } - if (activeSlave === PC || activeSlave === null) - activeSlave = getSlave(-1); + if (activeSlave === PC || activeSlave === null) { activeSlave = getSlave(-1); } const treeData = [slaveInfo(activeSlave, activeSlave.ID)]; console.log("Family tree is", treeData, 'and has:', numTreeNodes); let parentWidth = document.getElementById('editFamily').offsetWidth; console.log(parentWidth, document.getElementById('passages').offsetWidth); - if (!parentWidth) - parentWidth = document.body.offsetWidth - 483; + if (!parentWidth) { parentWidth = document.body.offsetWidth - 483; } console.log(parentWidth, Math.min(200 + 40 * numTreeNodes, parentWidth - 200) + 200); diff --git a/src/js/generateMarketSlave.js b/src/js/generateMarketSlave.js index 30bf3581877..1f153839b51 100644 --- a/src/js/generateMarketSlave.js +++ b/src/js/generateMarketSlave.js @@ -1,3 +1,4 @@ +/* eslint-disable camelcase */ window.generateMarketSlave = function(market = "kidnappers", numArcology = 1) { const V = State.variables; let r = ``; @@ -77,7 +78,7 @@ window.generateMarketSlave = function(market = "kidnappers", numArcology = 1) { } else if (V.corpSpecRaces.length === 1) { r += `The corporation specializes in ${V.corpSpecRaces[0]} slaves. `; } else { - r += `The corporation selects slaves based on race. `; /*getting into the specifics of which races exactly is a hellhole I'd rather not jump into*/ + r += `The corporation selects slaves based on race. `; /* getting into the specifics of which races exactly is a hellhole I'd rather not jump into*/ } if (V.corpSpecTrust > 0) { V.activeSlave.trust = jsRandom(-105, -85) + V.corpSpecTrust * 20; diff --git a/src/js/hTagMacroJS.js b/src/js/hTagMacroJS.js index eae7530a3a8..3226d538fa3 100644 --- a/src/js/hTagMacroJS.js +++ b/src/js/hTagMacroJS.js @@ -31,8 +31,7 @@ Macro.add('htag', { } else { attributes = `id="${String(this.args[0]).trim()}"`; } - if (Config.debug) - { + if (Config.debug) { this.debugView.modes({ block: true }); diff --git a/src/js/pregJS.js b/src/js/pregJS.js index 853e4d66669..f8f08951944 100644 --- a/src/js/pregJS.js +++ b/src/js/pregJS.js @@ -507,8 +507,7 @@ window.findFather = function(fatherID) { window.adjustFatherProperty = function(actor, property, newValue) { let father = findFather(actor.ID); - if (father) - father[property] = newValue; + if (father) { father[property] = newValue; } }; /* OLD diff --git a/src/js/quickListJS.js b/src/js/quickListJS.js index 8ac22f3e4c8..27fe34eed16 100644 --- a/src/js/quickListJS.js +++ b/src/js/quickListJS.js @@ -1,4 +1,4 @@ -window.sortDomObjects = function (objects, attrName, reverse = 0) { +window.sortDomObjects = function(objects, attrName, reverse = 0) { reverse = (reverse) ? -1 : 1; function sortingByAttr(a, b) { @@ -15,22 +15,22 @@ window.sortDomObjects = function (objects, attrName, reverse = 0) { return objects.toArray().sort(sortingByAttr); }; -window.sortButtonsByDevotion = function () { +window.sortButtonsByDevotion = function() { let $sortedButtons = $('#qlWrapper button').remove(); $sortedButtons = sortDomObjects($sortedButtons, 'data-devotion'); $($sortedButtons).appendTo($('#qlWrapper')); quickListBuildLinks(); }; -window.sortButtonsByTrust = function () { +window.sortButtonsByTrust = function() { let $sortedButtons = $('#qlWrapper button').remove(); $sortedButtons = sortDomObjects($sortedButtons, 'data-trust'); $($sortedButtons).appendTo($('#qlWrapper')); quickListBuildLinks(); }; -window.quickListBuildLinks = function () { - $("[data-scroll-to]").click(function () { +window.quickListBuildLinks = function() { + $("[data-scroll-to]").click(function() { let $this = $(this), $toElement = $this.attr('data-scroll-to'); // note the * 1 enforces $offset to be an integer, without @@ -44,31 +44,31 @@ window.quickListBuildLinks = function () { }); }; -window.sortIncubatorPossiblesByName = function () { +window.sortIncubatorPossiblesByName = function() { let $sortedIncubatorPossibles = $('#qlIncubator div.possible').detach(); $sortedIncubatorPossibles = sortDomObjects($sortedIncubatorPossibles, 'data-name'); $($sortedIncubatorPossibles).appendTo($('#qlIncubator')); }; -window.sortIncubatorPossiblesByPregnancyWeek = function () { +window.sortIncubatorPossiblesByPregnancyWeek = function() { let $sortedIncubatorPossibles = $('#qlIncubator div.possible').detach(); $sortedIncubatorPossibles = sortDomObjects($sortedIncubatorPossibles, 'data-preg-week'); $($sortedIncubatorPossibles).appendTo($('#qlIncubator')); }; -window.sortIncubatorPossiblesByPregnancyCount = function () { +window.sortIncubatorPossiblesByPregnancyCount = function() { let $sortedIncubatorPossibles = $('#qlIncubator div.possible').detach(); $sortedIncubatorPossibles = sortDomObjects($sortedIncubatorPossibles, 'data-preg-count'); $($sortedIncubatorPossibles).appendTo($('#qlIncubator')); }; -window.sortIncubatorPossiblesByReservedSpots = function () { +window.sortIncubatorPossiblesByReservedSpots = function() { let $sortedIncubatorPossibles = $('#qlIncubator div.possible').detach(); $sortedIncubatorPossibles = sortDomObjects($sortedIncubatorPossibles, 'data-reserved-spots'); $($sortedIncubatorPossibles).appendTo($('#qlIncubator')); }; -window.sortIncubatorPossiblesByPreviousSort = function () { +window.sortIncubatorPossiblesByPreviousSort = function() { let sort = State.variables.sortIncubatorList; if ('unsorted' !== sort) { if ('Name' === sort) { @@ -83,31 +83,31 @@ window.sortIncubatorPossiblesByPreviousSort = function () { } }; -window.sortNurseryPossiblesByName = function () { +window.sortNurseryPossiblesByName = function() { let $sortedNurseryPossibles = $('#qlNursery div.possible').detach(); $sortedNurseryPossibles = sortDomObjects($sortedNurseryPossibles, 'data-name'); $($sortedNurseryPossibles).appendTo($('#qlNursery')); }; -window.sortNurseryPossiblesByPregnancyWeek = function () { +window.sortNurseryPossiblesByPregnancyWeek = function() { let $sortedNurseryPossibles = $('#qlNursery div.possible').detach(); $sortedNurseryPossibles = sortDomObjects($sortedNurseryPossibles, 'data-preg-week'); $($sortedNurseryPossibles).appendTo($('#qlNursery')); }; -window.sortNurseryPossiblesByPregnancyCount = function () { +window.sortNurseryPossiblesByPregnancyCount = function() { let $sortedNurseryPossibles = $('#qlNursery div.possible').detach(); $sortedNurseryPossibles = sortDomObjects($sortedNurseryPossibles, 'data-preg-count'); $($sortedNurseryPossibles).appendTo($('#qlNursery')); }; -window.sortNurseryPossiblesByReservedSpots = function () { +window.sortNurseryPossiblesByReservedSpots = function() { let $sortedNurseryPossibles = $('#qlNursery div.possible').detach(); $sortedNurseryPossibles = sortDomObjects($sortedNurseryPossibles, 'data-reserved-spots'); $($sortedNurseryPossibles).appendTo($('#qlNursery')); }; -window.sortNurseryPossiblesByPreviousSort = function () { +window.sortNurseryPossiblesByPreviousSort = function() { let sort = State.variables.sortNurseryList; if ('unsorted' !== sort) { if ('Name' === sort) { diff --git a/src/js/removeActiveSlave.js b/src/js/removeActiveSlave.js index d07be0a9658..c93d9435f7e 100644 --- a/src/js/removeActiveSlave.js +++ b/src/js/removeActiveSlave.js @@ -125,7 +125,7 @@ window.removeActiveSlave = function removeActiveSlave() { } if (Array.isArray(V.personalAttention)) { - const _rasi = V.personalAttention.findIndex(function (s) { return s.ID === AS_ID; }); + const _rasi = V.personalAttention.findIndex(function(s) { return s.ID === AS_ID; }); if (_rasi !== -1) { V.personalAttention.deleteAt(_rasi); if (V.personalAttention.length === 0) { @@ -195,7 +195,7 @@ window.removeActiveSlave = function removeActiveSlave() { } } - const _geneIndex = V.genePool.findIndex(function (s) { return s.ID === AS_ID; }); + const _geneIndex = V.genePool.findIndex(function(s) { return s.ID === AS_ID; }); if (_geneIndex !== -1) { let keep = false; if (V.traitor !== 0) { @@ -335,7 +335,7 @@ window.removeNonNGPSlave = function removeNonNGPSlave(removedSlave) { } }); - const _geneIndex = V.genePool.findIndex(function (s) { return s.ID === ID; }); + const _geneIndex = V.genePool.findIndex(function(s) { return s.ID === ID; }); if (_geneIndex !== -1) { let keep = false; if (isImpregnatedBy(V.PC, removedSlave)) { diff --git a/src/js/rulesAssistant.js b/src/js/rulesAssistant.js index 399d95b4a9f..58dc828578e 100644 --- a/src/js/rulesAssistant.js +++ b/src/js/rulesAssistant.js @@ -72,7 +72,7 @@ window.mergeRules = function mergeRules(rules) { const applies = (combinedRule[key] === undefined || (key === "autoBrand" && rule[key]) || (key !== "autoBrand" && rule[key] !== "no default setting")); - if (!applies) return; + if (!applies) { return; } combinedRule[key] = rule[key]; }); }); @@ -97,7 +97,7 @@ window.ruleApplied = function(slave, rule) { window.RAFacilityRemove = function RAFacilityRemove(slave, rule) { const V = State.variables; let r = ""; - if (!rule.facilityRemove) return r; + if (!rule.facilityRemove) { return r; } switch (rule.setAssignment) { case "be confined in the arcade": if (slave.assignment === rule.setAssignment) { @@ -223,7 +223,7 @@ window.ruleAppliesP = function ruleAppliesP(cond, slave) { } // assignment / facility / special slaves / specific slaves check let assignment = slave.assignment; - if (assignment === "be your Concubine") assignment = "serve in the master suite"; + if (assignment === "be your Concubine") { assignment = "serve in the master suite"; } if (cond.specialSlaves !== -1) { // not "Include", which means "doesn't matter" flag = flag && (cond.specialSlaves == isLeaderP(slave)); // eslint-disable-line eqeqeq diff --git a/src/js/rulesAssistantOptions.js b/src/js/rulesAssistantOptions.js index 2892fd399a4..f9f55a9e043 100644 --- a/src/js/rulesAssistantOptions.js +++ b/src/js/rulesAssistantOptions.js @@ -18,10 +18,7 @@ window.rulesAssistantOptions = (function() { V.encyclopedia = "Personal Assistant"; if (V.currentRule !== null) { const idx = V.defaultRules.findIndex(rule => rule.ID === V.currentRule); - if (idx === -1) - current_rule = V.defaultRules[0]; - else - current_rule = V.defaultRules[idx]; + if (idx === -1) { current_rule = V.defaultRules[0]; } else { current_rule = V.defaultRules[idx]; } } const root = new Root(element); } @@ -41,28 +38,28 @@ window.rulesAssistantOptions = (function() { if (V.defaultRules.length > 0) { const new_idx = idx < V.defaultRules.length ? idx : V.defaultRules.length - 1; V.currentRule = V.defaultRules[new_idx].ID; - } else V.currentRule = null; + } else { V.currentRule = null; } reload(root); } function lowerPriority(root) { - if (V.defaultRules.length === 1) return; // nothing to swap with + if (V.defaultRules.length === 1) { return; } // nothing to swap with const idx = V.defaultRules.findIndex(rule => rule.ID === current_rule.ID); - if (idx === 0) return; // no lower rule + if (idx === 0) { return; } // no lower rule arraySwap(V.defaultRules, idx, idx - 1); reload(root); } function higherPriority(root) { - if (V.defaultRules.length === 1) return; // nothing to swap with + if (V.defaultRules.length === 1) { return; } // nothing to swap with const idx = V.defaultRules.findIndex(rule => rule.ID === current_rule.ID); - if (idx === V.defaultRules.length - 1) return; // no higher rule + if (idx === V.defaultRules.length - 1) { return; } // no higher rule arraySwap(V.defaultRules, idx, idx + 1); reload(root); } function changeName(name, root) { - if (name === current_rule.name) return; + if (name === current_rule.name) { return; } current_rule.name = name; reload(root); } @@ -128,7 +125,7 @@ window.rulesAssistantOptions = (function() { constructor(header, hidden = false) { super(header); this.hidey = this.element.querySelector("div"); - if (hidden) this.toggle_hidey(); + if (hidden) { this.toggle_hidey(); } } render(header) { @@ -186,22 +183,19 @@ window.rulesAssistantOptions = (function() { } inputEdited() { - if (this.selectedItem) this.selectedItem.deselect(); + if (this.selectedItem) { this.selectedItem.deselect(); } this.propagateChange(); } selectItem(item) { - if (this.selectedItem) this.selectedItem.deselect(); + if (this.selectedItem) { this.selectedItem.deselect(); } this.selectedItem = item; this.setValue(item.data); this.propagateChange(); } setValue(what) { - if (this.value.tagName === "INPUT") - this.value.value = `${what}`; - else - this.value.innerHTML = `${what}`; + if (this.value.tagName === "INPUT") { this.value.value = `${what}`; } else { this.value.innerHTML = `${what}`; } } getData(what) { @@ -212,8 +206,7 @@ window.rulesAssistantOptions = (function() { parse(what) { return what; } propagateChange() { - if (this.onchange instanceof Function) - this.onchange(this.getData()); + if (this.onchange instanceof Function) { this.onchange(this.getData()); } } } @@ -234,7 +227,7 @@ window.rulesAssistantOptions = (function() { } select() { - if (this.selected) return false; + if (this.selected) { return false; } this.parent.selectItem(this); this.element.classList.add("selected"); this.selected = true; @@ -261,7 +254,7 @@ window.rulesAssistantOptions = (function() { this.inputEdited(); }; res.onkeypress = (e) => { - if (returnP(e)) this.inputEdited(); + if (returnP(e)) { this.inputEdited(); } }; return res; } @@ -283,7 +276,7 @@ window.rulesAssistantOptions = (function() { this.inputEdited(); }; res.onkeypress = (e) => { - if (returnP(e)) this.inputEdited(); + if (returnP(e)) { this.inputEdited(); } }; return res; } @@ -428,10 +421,7 @@ window.rulesAssistantOptions = (function() { const text = this.textarea.value; try { const rule = JSON.parse(text); - if (rule instanceof Array) - rule.forEach(r => V.defaultRules.push(r)); - else - V.defaultRules.push(rule); + if (rule instanceof Array) { rule.forEach(r => V.defaultRules.push(r)); } else { V.defaultRules.push(rule); } reload(this.root); } catch (e) { alert(`Couldn't import that rule:\n${e.message}`); @@ -518,7 +508,7 @@ window.rulesAssistantOptions = (function() { constructor(root) { super(); this.element.onblur = () => changeName(this.element.value, root); - this.element.onkeypress = (e) => { if (returnP(e)) changeName(this.element.value, root); }; + this.element.onkeypress = (e) => { if (returnP(e)) { changeName(this.element.value, root); } }; } render() { @@ -637,7 +627,7 @@ window.rulesAssistantOptions = (function() { } show_custom_editor(what, ...args) { - if (this.custom_editor !== null) this.hide_custom_editor(); + if (this.custom_editor !== null) { this.hide_custom_editor(); } this.custom_editor = new what(...args); this.appendChild(this.custom_editor); } @@ -681,7 +671,7 @@ window.rulesAssistantOptions = (function() { class CustomEditor extends Element { constructor(data) { - if (data.length === 0) data = "(slave) => slave.slaveName === 'Fancy Name'"; + if (data.length === 0) { data = "(slave) => slave.slaveName === 'Fancy Name'"; } super(data); } @@ -709,7 +699,7 @@ window.rulesAssistantOptions = (function() { const min = document.createElement("input"); min.setAttribute("type", "text"); min.value = `${data.value[0]}`; - min.onkeypress = e => { if (returnP(e)) this.setmin(min.value); }; + min.onkeypress = e => { if (returnP(e)) { this.setmin(min.value); } }; min.onblur = e => this.setmin(min.value); this.min = min; elem.appendChild(min); @@ -723,7 +713,7 @@ window.rulesAssistantOptions = (function() { const max = document.createElement("input"); max.setAttribute("type", "text"); max.value = `${data.value[1]}`; - max.onkeypress = e => { if (returnP(e)) this.setmax(max.value); }; + max.onkeypress = e => { if (returnP(e)) { this.setmax(max.value); } }; max.onblur = e => this.setmax(max.value); this.max = max; elem.appendChild(max); @@ -737,10 +727,9 @@ window.rulesAssistantOptions = (function() { parse(value) { value = value.trim(); - if (value === "null") value = null; - else { + if (value === "null") { value = null; } else { value = parseInt(value); - if (isNaN(value)) value = null; + if (isNaN(value)) { value = null; } } return value; } @@ -782,7 +771,7 @@ window.rulesAssistantOptions = (function() { const input = document.createElement("input"); input.setAttribute("type", "text"); input.value = JSON.stringify(data.value); - input.onkeypress = e => { if (returnP(e)) this.setValue(input); }; + input.onkeypress = e => { if (returnP(e)) { this.setValue(input); } }; input.onblur = e => this.setValue(input); this.input = input; elem.appendChild(input); @@ -818,18 +807,18 @@ window.rulesAssistantOptions = (function() { constructor() { super("Apply to assignments and facilities"); const items = ["Classes", "Confined", "Fucktoy", "Gloryhole", "House Servant", "Milked", "Public Servant", "Rest", "Subordinate Slave", "Whore"]; - if (V.HGSuite > 0) items.push("Head Girl Suite"); - if (V.brothel > 0) items.push("Brothel"); - if (V.club > 0) items.push("Club"); - if (V.arcade > 0) items.push("Arcade"); - if (V.dairy > 0) items.push("Dairy"); - if (V.servantsQuarters > 0) items.push("Servant Quarters"); - if (V.masterSuite > 0) items.push("Master Suite"); - if (V.schoolroom > 0) items.push("Schoolroom"); - if (V.spa > 0) items.push("Spa"); - if (V.nursery > 0) items.push("Nursery"); - if (V.clinic > 0) items.push("Clinic"); - if (V.cellblock > 0) items.push("Cellblock"); + if (V.HGSuite > 0) { items.push("Head Girl Suite"); } + if (V.brothel > 0) { items.push("Brothel"); } + if (V.club > 0) { items.push("Club"); } + if (V.arcade > 0) { items.push("Arcade"); } + if (V.dairy > 0) { items.push("Dairy"); } + if (V.servantsQuarters > 0) { items.push("Servant Quarters"); } + if (V.masterSuite > 0) { items.push("Master Suite"); } + if (V.schoolroom > 0) { items.push("Schoolroom"); } + if (V.spa > 0) { items.push("Spa"); } + if (V.nursery > 0) { items.push("Nursery"); } + if (V.clinic > 0) { items.push("Clinic"); } + if (V.cellblock > 0) { items.push("Cellblock"); } items.forEach( i => this.appendChild(new ButtonItem(i, this.getAttribute(i), current_rule.condition.assignment.includes(this.getAttribute(i))))); } @@ -889,13 +878,13 @@ window.rulesAssistantOptions = (function() { } show_slave_selection() { - if (this.subwidget) this.subwidget.remove(); + if (this.subwidget) { this.subwidget.remove(); } this.subwidget = new SlaveSelection(); this.appendChild(this.subwidget); } show_slave_exclusion() { - if (this.subwidget) this.subwidget.remove(); + if (this.subwidget) { this.subwidget.remove(); } this.subwidget = new SlaveExclusion(); this.appendChild(this.subwidget); } @@ -977,15 +966,13 @@ window.rulesAssistantOptions = (function() { class RegimenSection extends Section { constructor() { super("Physical Regimen Settings"); - if (V.arcologies[0].FSAssetExpansionistResearch === 1) - this.appendChild(new HyperGrowthSwitch()); + if (V.arcologies[0].FSAssetExpansionistResearch === 1) { this.appendChild(new HyperGrowthSwitch()); } this.appendChild(new GrowthList()); this.appendChild(new CurrativesList()); this.appendChild(new AphrodisiacList()); this.appendChild(new ContraceptiveList()); this.appendChild(new AbortionList()); - if (V.pregSpeedControl) - this.appendChild(new PregDrugsList()); + if (V.pregSpeedControl) { this.appendChild(new PregDrugsList()); } this.appendChild(new FemaleHormonesList()); this.appendChild(new ShemaleHormonesList()); this.appendChild(new GeldingHormonesList()); @@ -1086,8 +1073,7 @@ window.rulesAssistantOptions = (function() { this.appendChild(new UpperBackTattooList()); this.appendChild(new LowerBackTattooList()); this.appendChild(new AbdomenTattooList()); - if (V.seeDicks || V.makeDicks) - this.appendChild(new DickTattooList()); + if (V.seeDicks || V.makeDicks) { this.appendChild(new DickTattooList()); } this.appendChild(new ButtockTattooList()); this.appendChild(new AnalTattooList()); this.appendChild(new LegTattooList()); @@ -1115,8 +1101,7 @@ window.rulesAssistantOptions = (function() { this.appendChild(new TummyTuckSurgeryList()); this.appendChild(new BodyHairSurgeryList()); this.appendChild(new HairSurgeryList()); - if (V.bellyImplants > 0) - this.appendChild(new BellyImplantList()); + if (V.bellyImplants > 0) { this.appendChild(new BellyImplantList()); } } } @@ -1236,8 +1221,8 @@ window.rulesAssistantOptions = (function() { ["Toga (FS)", "a toga"], ["Western clothing (FS)", "Western clothing"], ]; - spclothes.forEach(pair => { if (isItemAccessible(pair[1])) nclothes.push(pair); }); - fsnclothes.forEach(pair => { if (isItemAccessible(pair[1])) nclothes.push(pair); }); + spclothes.forEach(pair => { if (isItemAccessible(pair[1])) { nclothes.push(pair); } }); + fsnclothes.forEach(pair => { if (isItemAccessible(pair[1])) { nclothes.push(pair); } }); const nice = new ListSubSection(this, "Nice", nclothes); this.appendChild(nice); @@ -1251,7 +1236,7 @@ window.rulesAssistantOptions = (function() { const fshclothes = [ ["Chains (FS)", "chains"], ]; - fshclothes.forEach(pair => { if (isItemAccessible(pair[1])) hclothes.push(pair); }); + fshclothes.forEach(pair => { if (isItemAccessible(pair[1])) { hclothes.push(pair); } }); const harsh = new ListSubSection(this, "Harsh", hclothes); this.appendChild(harsh); @@ -1278,22 +1263,18 @@ window.rulesAssistantOptions = (function() { ["Bell", "bell collar"], ["Cowbell", "leather with cowbell"] ]; - if (V.seeAge !== 0) - ncollars.push(["Nice retirement counter", "nice retirement counter"]); + if (V.seeAge !== 0) { ncollars.push(["Nice retirement counter", "nice retirement counter"]); } const fsncollars = [ ["Bowtie collar", "bowtie"], ["Ancient Egyptian", "ancient Egyptian"], ]; - fsncollars.forEach(pair => { if (isItemAccessible(pair[1])) ncollars.push(pair); }); + fsncollars.forEach(pair => { if (isItemAccessible(pair[1])) { ncollars.push(pair); } }); const nice = new ListSubSection(this, "Nice", ncollars); this.appendChild(nice); const hcollars = []; setup.harshCollars.forEach(item => { - if (item.fs === "seeAge" && V.seeAge === 0) return; - else if (item.fs === "seePreg" && V.seePreg === 0) return; - else if (item.rs === "buyGag" && V.toysBoughtGags !== 1) return; - else hcollars.push([item.name, item.value]); + if (item.fs === "seeAge" && V.seeAge === 0) { return; } else if (item.fs === "seePreg" && V.seePreg === 0) { return; } else if (item.rs === "buyGag" && V.toysBoughtGags !== 1) { return; } else { hcollars.push([item.name, item.value]); } }); const harsh = new ListSubSection(this, "Harsh", hcollars); this.appendChild(harsh); @@ -1315,12 +1296,7 @@ window.rulesAssistantOptions = (function() { constructor() { const bellies = []; setup.bellyAccessories.forEach(acc => { - if (acc.fs === undefined && acc.rs === undefined) - bellies.push([acc.name, acc.value]); - else if (acc.fs === "repopulation" && V.arcologies[0].FSRepopulationFocus !== "unset") - bellies.push([`${acc.name} (FS)`, acc.value]); - else if (acc.rs === "boughtBelly" && V.clothesBoughtBelly === 1) - bellies.push([`${acc.name} (Purchased)`, acc.value]); + if (acc.fs === undefined && acc.rs === undefined) { bellies.push([acc.name, acc.value]); } else if (acc.fs === "repopulation" && V.arcologies[0].FSRepopulationFocus !== "unset") { bellies.push([`${acc.name} (FS)`, acc.value]); } else if (acc.rs === "boughtBelly" && V.clothesBoughtBelly === 1) { bellies.push([`${acc.name} (Purchased)`, acc.value]); } }); super("Corsetage", bellies); this.setValue(current_rule.set.bellyAccessory); @@ -1359,10 +1335,7 @@ window.rulesAssistantOptions = (function() { constructor() { const accs = []; setup.vaginalAccessories.forEach(acc => { - if (acc.fs === undefined && acc.rs === undefined) - accs.push([acc.name, acc.value]); - else if (acc.rs === "buyBigDildos" && V.toysBoughtDildos === 1) - accs.push([`${acc.name} (Purchased)`, acc.value]); + if (acc.fs === undefined && acc.rs === undefined) { accs.push([acc.name, acc.value]); } else if (acc.rs === "buyBigDildos" && V.toysBoughtDildos === 1) { accs.push([`${acc.name} (Purchased)`, acc.value]); } }); super("Vaginal accessories for virgins", accs); this.setValue(current_rule.set.virginAccessory); @@ -1374,10 +1347,7 @@ window.rulesAssistantOptions = (function() { constructor() { const accs = []; setup.vaginalAccessories.forEach(acc => { - if (acc.fs === undefined && acc.rs === undefined) - accs.push([acc.name, acc.value]); - else if (acc.rs === "buyBigDildos" && V.toysBoughtDildos === 1) - accs.push([`${acc.name} (Purchased)`, acc.value]); + if (acc.fs === undefined && acc.rs === undefined) { accs.push([acc.name, acc.value]); } else if (acc.rs === "buyBigDildos" && V.toysBoughtDildos === 1) { accs.push([`${acc.name} (Purchased)`, acc.value]); } }); super("Vaginal accessories for anal virgins", accs); this.setValue(current_rule.set.aVirginAccessory); @@ -1389,10 +1359,7 @@ window.rulesAssistantOptions = (function() { constructor() { const accs = []; setup.vaginalAccessories.forEach(acc => { - if (acc.fs === undefined && acc.rs === undefined) - accs.push([acc.name, acc.value]); - else if (acc.rs === "buyBigDildos" && V.toysBoughtDildos === 1) - accs.push([`${acc.name} (Purchased)`, acc.value]); + if (acc.fs === undefined && acc.rs === undefined) { accs.push([acc.name, acc.value]); } else if (acc.rs === "buyBigDildos" && V.toysBoughtDildos === 1) { accs.push([`${acc.name} (Purchased)`, acc.value]); } }); super("Vaginal accessories for other slaves", accs); this.setValue(current_rule.set.vaginalAccessory); @@ -1404,10 +1371,7 @@ window.rulesAssistantOptions = (function() { constructor() { const accs = []; setup.vaginalAttachments.forEach(acc => { - if (acc.fs === undefined && acc.rs === undefined) - accs.push([acc.name, acc.value]); - else if (acc.rs === "buyVaginalAttachments" && V.toysBoughtVaginalAttachments === 1) - accs.push([`${acc.name} (Purchased)`, acc.value]); + if (acc.fs === undefined && acc.rs === undefined) { accs.push([acc.name, acc.value]); } else if (acc.rs === "buyVaginalAttachments" && V.toysBoughtVaginalAttachments === 1) { accs.push([`${acc.name} (Purchased)`, acc.value]); } }); super("Vaginal attachments for slaves with vaginal accessories", accs); this.setValue(current_rule.set.vaginalAttachment); @@ -1461,10 +1425,7 @@ window.rulesAssistantOptions = (function() { constructor() { const accs = []; setup.buttplugs.forEach(acc => { - if (acc.fs === undefined && acc.rs === undefined) - accs.push([acc.name, acc.value]); - else if (acc.rs === "buyBigPlugs" && V.toysBoughtButtPlugs === 1) - accs.push([`${acc.name} (Purchased)`, acc.value]); + if (acc.fs === undefined && acc.rs === undefined) { accs.push([acc.name, acc.value]); } else if (acc.rs === "buyBigPlugs" && V.toysBoughtButtPlugs === 1) { accs.push([`${acc.name} (Purchased)`, acc.value]); } }); super("Buttplugs for anal virgins", accs); this.setValue(current_rule.set.aVirginButtplug); @@ -1476,10 +1437,7 @@ window.rulesAssistantOptions = (function() { constructor() { const accs = []; setup.buttplugs.forEach(acc => { - if (acc.fs === undefined && acc.rs === undefined) - accs.push([acc.name, acc.value]); - else if (acc.rs === "buyBigPlugs" && V.toysBoughtButtPlugs === 1) - accs.push([`${acc.name} (Purchased)`, acc.value]); + if (acc.fs === undefined && acc.rs === undefined) { accs.push([acc.name, acc.value]); } else if (acc.rs === "buyBigPlugs" && V.toysBoughtButtPlugs === 1) { accs.push([`${acc.name} (Purchased)`, acc.value]); } }); super("Buttplugs for other slaves", accs); this.setValue(current_rule.set.buttplug); @@ -1491,10 +1449,7 @@ window.rulesAssistantOptions = (function() { constructor() { const accs = []; setup.buttplugAttachments.forEach(acc => { - if (acc.fs === undefined && acc.rs === undefined) - accs.push([acc.name, acc.value]); - else if (acc.rs === "buyTails" && V.toysBoughtButtPlugTails === 1) - accs.push([`${acc.name} (Purchased)`, acc.value]); + if (acc.fs === undefined && acc.rs === undefined) { accs.push([acc.name, acc.value]); } else if (acc.rs === "buyTails" && V.toysBoughtButtPlugTails === 1) { accs.push([`${acc.name} (Purchased)`, acc.value]); } }); super("Buttplug attachments for slaves with buttplugs", accs); this.setValue(current_rule.set.buttplugAttachment); @@ -1595,8 +1550,8 @@ window.rulesAssistantOptions = (function() { this.breasts.setValue(350); this.butts.setValue(2); this.lips.setValue(25); - if (this.dicks) this.dicks.setValue(0); - if (this.balls) this.balls.setValue(0); + if (this.dicks) { this.dicks.setValue(0); } + if (this.balls) { this.balls.setValue(0); } this.sublists.forEach(i => i.propagateChange()); } @@ -1604,8 +1559,8 @@ window.rulesAssistantOptions = (function() { this.breasts.setValue(1000); this.butts.setValue(5); this.lips.setValue(25); - if (this.dicks) this.dicks.setValue(4); - if (this.balls) this.balls.setValue(4); + if (this.dicks) { this.dicks.setValue(4); } + if (this.balls) { this.balls.setValue(4); } this.sublists.forEach(i => i.propagateChange()); } @@ -1613,8 +1568,8 @@ window.rulesAssistantOptions = (function() { this.breasts.setValue(9000); this.butts.setValue(10); this.lips.setValue(45); - if (this.dicks) this.dicks.setValue(6); - if (this.balls) this.balls.setValue(6); + if (this.dicks) { this.dicks.setValue(6); } + if (this.balls) { this.balls.setValue(6); } this.sublists.forEach(i => i.propagateChange()); } @@ -1622,8 +1577,8 @@ window.rulesAssistantOptions = (function() { this.breasts.setValue(48000); this.butts.setValue(20); this.lips.setValue(100); - if (this.dicks) this.dicks.setValue(30); - if (this.balls) this.balls.setValue(125); + if (this.dicks) { this.dicks.setValue(30); } + if (this.balls) { this.balls.setValue(125); } this.sublists.forEach(i => i.propagateChange()); } @@ -1856,14 +1811,12 @@ window.rulesAssistantOptions = (function() { ["intensive testicle enhancement"], ]; - if (V.growthStim === 1) - drugs.push(["Growth Stimulants (Research)", "growth stimulants"]); + if (V.growthStim === 1) { drugs.push(["Growth Stimulants (Research)", "growth stimulants"]); } if (V.precociousPuberty === 1 && V.pubertyHormones) { drugs.push(["Female hormone injections (Research)", "female hormone injections"]); drugs.push(["Male hormone injections (Research)", "male hormone injections"]); } - if (V.purchasedSagBGone === 1) - drugs.push(["Sag-B-gone (Product)", "sag-B-gone"]); + if (V.purchasedSagBGone === 1) { drugs.push(["Sag-B-gone (Product)", "sag-B-gone"]); } if (V.arcologies[0].FSSlimnessEnthusiastResearch === 1) { drugs.push(["Weight loss pills (FS)", "appetite suppressors"]); drugs.push(["breast redistributors"]); @@ -1881,10 +1834,8 @@ window.rulesAssistantOptions = (function() { drugs.push(["hyper penis enhancement"]); drugs.push(["hyper testicle enhancement"]); } - if (V.arcologies[0].FSYouthPreferentialistResearch === 1) - drugs.push(["Anti-aging cream (FS)", "anti-aging cream"]); - if (V.seeHyperPreg === 1 && V.superFertilityDrugs === 1) - drugs.push(["Super fertility drugs", "super fertility drugs"]); + if (V.arcologies[0].FSYouthPreferentialistResearch === 1) { drugs.push(["Anti-aging cream (FS)", "anti-aging cream"]); } + if (V.seeHyperPreg === 1 && V.superFertilityDrugs === 1) { drugs.push(["Super fertility drugs", "super fertility drugs"]); } super("Other drugs", drugs); this.setValue(current_rule.set.drug); this.onchange = (value) => current_rule.set.drug = value; @@ -1926,15 +1877,11 @@ window.rulesAssistantOptions = (function() { ["Feminine", "XX"], ["Masculine", "XY"] ); - if (V.dietXXY === 1) - diets.push(["Futanari", "XXY"]); + if (V.dietXXY === 1) { diets.push(["Futanari", "XXY"]); } } - if (V.dietCleanse === 1) - diets.push(["Cleansing", "cleansing"]); - if (V.dietFertility === 1) - diets.push(["Fertility", "fertility"]); - if (V.cumProDiet === 1) - diets.push(["Cum production", "cum production"]); + if (V.dietCleanse === 1) { diets.push(["Cleansing", "cleansing"]); } + if (V.dietFertility === 1) { diets.push(["Fertility", "fertility"]); } + if (V.cumProDiet === 1) { diets.push(["Cum production", "cum production"]); } super("Slave diets", diets, true); this.setValue(current_rule.set.diet); @@ -2265,16 +2212,13 @@ window.rulesAssistantOptions = (function() { combine() { const lst = []; - if (this.colorlist.value !== "no default setting") - lst.push(this.colorlist.value); - if (this.shapelist.value !== "no default setting") - lst.push(this.shapelist.value); - if (lst.length === 0) return "no default setting"; - else return lst.join(" "); + if (this.colorlist.value !== "no default setting") { lst.push(this.colorlist.value); } + if (this.shapelist.value !== "no default setting") { lst.push(this.shapelist.value); } + if (lst.length === 0) { return "no default setting"; } else { return lst.join(" "); } } setValue(val) { - if (val === undefined) val = this.combine(); + if (val === undefined) { val = this.combine(); } this.label.innerText = `${val} `; current_rule.set.eyeColor = val; } @@ -3031,77 +2975,53 @@ window.rulesAssistantOptions = (function() { ["Devil", "a devil silhouette"] ]; - if (V.arcologies[0].FSSupremacist !== "unset" || V.arcologies[0].FSSubjugationist !== "unset") - items.push(["(FS) Racial Slur", "a racial slur"]); + if (V.arcologies[0].FSSupremacist !== "unset" || V.arcologies[0].FSSubjugationist !== "unset") { items.push(["(FS) Racial Slur", "a racial slur"]); } - if (V.arcologies[0].FSSupremacist !== "unset" && V.arcologies[0].FSSupremacistRace === "white") - items.push(["(FS) Swastika", "a swastika"]); + if (V.arcologies[0].FSSupremacist !== "unset" && V.arcologies[0].FSSupremacistRace === "white") { items.push(["(FS) Swastika", "a swastika"]); } - if (V.arcologies[0].FSSubjugationist !== "unset" && V.arcologies[0].FSSubjugationistRace === "semitic") - items.push(["(FS) Star of David", "a Star of David"]); + if (V.arcologies[0].FSSubjugationist !== "unset" && V.arcologies[0].FSSubjugationistRace === "semitic") { items.push(["(FS) Star of David", "a Star of David"]); } - if (V.arcologies[0].FSGenderRadicalist !== "unset" || V.arcologies.FSGenderFundamentalist !== "unset") - items.push(["(FS) Gender Symbol", "a gender symbol"]); + if (V.arcologies[0].FSGenderRadicalist !== "unset" || V.arcologies.FSGenderFundamentalist !== "unset") { items.push(["(FS) Gender Symbol", "a gender symbol"]); } - if (V.arcologies[0].FSPaternalist !== "unset") - items.push(["(FS) Personal Symbol", "her own personal symbol"]); + if (V.arcologies[0].FSPaternalist !== "unset") { items.push(["(FS) Personal Symbol", "her own personal symbol"]); } - if (V.arcologies[0].FSDegradationist !== "unset") - items.push(["(FS) Chain Symbol", "a chain symbol"]); + if (V.arcologies[0].FSDegradationist !== "unset") { items.push(["(FS) Chain Symbol", "a chain symbol"]); } - if (V.arcologies[0].FSBodyPurist !== "unset") - items.push(["(FS) Vitruvian Man", "a Vitruvian man"]); + if (V.arcologies[0].FSBodyPurist !== "unset") { items.push(["(FS) Vitruvian Man", "a Vitruvian man"]); } - if (V.arcologies[0].FSTransformationFetishist !== "unset") - items.push(["(FS) Most Desired Implants", "a shortlist of desired implants"]); + if (V.arcologies[0].FSTransformationFetishist !== "unset") { items.push(["(FS) Most Desired Implants", "a shortlist of desired implants"]); } - if (V.arcologies[0].FSYouthPreferentialist !== "unset") - items.push(["(FS) Virginity Status", "her virginity status"]); + if (V.arcologies[0].FSYouthPreferentialist !== "unset") { items.push(["(FS) Virginity Status", "her virginity status"]); } - if (V.arcologies[0].FSMaturityPreferentialist !== "unset") - items.push(["(FS) Sexual Skill Info", "her sexual skills"]); + if (V.arcologies[0].FSMaturityPreferentialist !== "unset") { items.push(["(FS) Sexual Skill Info", "her sexual skills"]); } - if (V.arcologies[0].FSSlimnessEnthusiast !== "unset") - items.push(["(FS) Breast Ceiling", "her absolute maximum breast size"]); + if (V.arcologies[0].FSSlimnessEnthusiast !== "unset") { items.push(["(FS) Breast Ceiling", "her absolute maximum breast size"]); } - if (V.arcologies[0].FSAssetExpansionist !== "unset") - items.push(["(FS) Breast Floor", "her absolute minimum breast size"]); + if (V.arcologies[0].FSAssetExpansionist !== "unset") { items.push(["(FS) Breast Floor", "her absolute minimum breast size"]); } - if (V.arcologies[0].FSPastoralist !== "unset") - items.push(["(FS) Product Quality", "her body product quality"]); + if (V.arcologies[0].FSPastoralist !== "unset") { items.push(["(FS) Product Quality", "her body product quality"]); } - if (V.arcologies[0].FSPhysicalIdelist !== "unset") - items.push(["(FS) Deadlift Info", "her deadlift record"]); + if (V.arcologies[0].FSPhysicalIdelist !== "unset") { items.push(["(FS) Deadlift Info", "her deadlift record"]); } - if (V.arcologies[0].FSHedonisticDecadence !== "unset") - items.push(["(FS) Weight Record", "her highest weigh-in"]); + if (V.arcologies[0].FSHedonisticDecadence !== "unset") { items.push(["(FS) Weight Record", "her highest weigh-in"]); } - if (V.arcologies[0].FSHedonisticDecadence && V.PC.refreshmentType === 2) - items.push(["(FS) Favorite Food", `a big helping of ${V.PC.refreshment}`]); + if (V.arcologies[0].FSHedonisticDecadence && V.PC.refreshmentType === 2) { items.push(["(FS) Favorite Food", `a big helping of ${V.PC.refreshment}`]); } - if (V.arcologies[0].FSRepopulationFocus !== "unset") - items.push(["(FS) Birth Count", "the number of children she has birthed"]); + if (V.arcologies[0].FSRepopulationFocus !== "unset") { items.push(["(FS) Birth Count", "the number of children she has birthed"]); } - if (V.arcologies[0].FSChattelReligionist !== "unset") - items.push(["(FS) Religious Symbol", "a religious symbol"]); + if (V.arcologies[0].FSChattelReligionist !== "unset") { items.push(["(FS) Religious Symbol", "a religious symbol"]); } - if (V.arcologies[0].FSRomanRevivalist !== "unset") - items.push(["(FS) Republican Crest", "a small crest of your Republic"]); + if (V.arcologies[0].FSRomanRevivalist !== "unset") { items.push(["(FS) Republican Crest", "a small crest of your Republic"]); } - if (V.arcologies[0].FSAztecRevivalist !== "unset") - items.push(["(FS) Seven Serpents", "a small symbol of the Aztec gods"]); + if (V.arcologies[0].FSAztecRevivalist !== "unset") { items.push(["(FS) Seven Serpents", "a small symbol of the Aztec gods"]); } - if (V.arcologies[0].FSEgyptianRevivalist !== "unset") - items.push(["(FS) Dynastic Sigil", "a small sigil of your Dynasty"]); + if (V.arcologies[0].FSEgyptianRevivalist !== "unset") { items.push(["(FS) Dynastic Sigil", "a small sigil of your Dynasty"]); } - if (V.arcologies[0].FSEdoRevivalist !== "unset") - items.push(["(FS) Mon", "a small image of the Shogunate's mon"]); + if (V.arcologies[0].FSEdoRevivalist !== "unset") { items.push(["(FS) Mon", "a small image of the Shogunate's mon"]); } - if (V.arcologies[0].FSArabianRevivalist !== "unset") - items.push(["(FS) Caliphate Symbol", "a small symbol of the Caliphate"]); + if (V.arcologies[0].FSArabianRevivalist !== "unset") { items.push(["(FS) Caliphate Symbol", "a small symbol of the Caliphate"]); } - if (V.arcologies[0].FSChineseRevivalist !== "unset") - items.push(["(FS) Imperial Seal", "a small image of your Imperial Seal"]); + if (V.arcologies[0].FSChineseRevivalist !== "unset") { items.push(["(FS) Imperial Seal", "a small image of your Imperial Seal"]); } super("Your brand design is", items, true); } @@ -3603,18 +3523,18 @@ window.rulesAssistantOptions = (function() { ["Choose Her Own", "choose her own job"] ]; - if (V.HGSuite > 0) items.push(["Head Girl Suite", "live with your Head Girl"]); - if (V.brothel > 0) items.push(["Brothel", "work in the brothel"]); - if (V.club > 0) items.push(["Club", "serve in the club"]); - if (V.arcade > 0) items.push(["Arcade", "be confined in the arcade"]); - if (V.dairy > 0) items.push(["Dairy", "work in the dairy"]); - if (V.farmyard > 0) items.push(["Farmyard", "work as a farmhand"]); - if (V.servantsQuarters > 0) items.push(["Servant Quarters", "work as a servant"]); - if (V.masterSuite > 0) items.push(["Master Suite", "serve in the master suite"]); - if (V.schoolroom > 0) items.push(["Schoolroom", "learn in the schoolroom"]); - if (V.spa > 0) items.push(["Spa", "rest in the spa"]); - if (V.clinic > 0) items.push(["Clinic", "get treatment in the clinic"]); - if (V.cellblock > 0) items.push(["Cellblock", "be confined in the cellblock"]); + if (V.HGSuite > 0) { items.push(["Head Girl Suite", "live with your Head Girl"]); } + if (V.brothel > 0) { items.push(["Brothel", "work in the brothel"]); } + if (V.club > 0) { items.push(["Club", "serve in the club"]); } + if (V.arcade > 0) { items.push(["Arcade", "be confined in the arcade"]); } + if (V.dairy > 0) { items.push(["Dairy", "work in the dairy"]); } + if (V.farmyard > 0) { items.push(["Farmyard", "work as a farmhand"]); } + if (V.servantsQuarters > 0) { items.push(["Servant Quarters", "work as a servant"]); } + if (V.masterSuite > 0) { items.push(["Master Suite", "serve in the master suite"]); } + if (V.schoolroom > 0) { items.push(["Schoolroom", "learn in the schoolroom"]); } + if (V.spa > 0) { items.push(["Spa", "rest in the spa"]); } + if (V.clinic > 0) { items.push(["Clinic", "get treatment in the clinic"]); } + if (V.cellblock > 0) { items.push(["Cellblock", "be confined in the cellblock"]); } super("Automatically set assignment", items); this.setValue(current_rule.set.setAssignment); diff --git a/src/js/rulesAutosurgery.js b/src/js/rulesAutosurgery.js index 6cc77c4bfc9..4d10d598c5b 100644 --- a/src/js/rulesAutosurgery.js +++ b/src/js/rulesAutosurgery.js @@ -154,50 +154,42 @@ window.rulesAutosurgery = (function() { surgeries.push("surgery to correct her vision"); slave.eyes = 1; cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave); - if (V.PC.medicine >= 100) slave.health -= 5; - else slave.health -= 10; + if (V.PC.medicine >= 100) { slave.health -= 5; } else { slave.health -= 10; } } else if (slave.eyes === 1 && thisSurgery.surgery_eyes === -1) { surgeries.push("surgery to blur her vision"); slave.eyes = -1; cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave); - if (V.PC.medicine >= 100) slave.health -= 5; - else slave.health -= 10; + if (V.PC.medicine >= 100) { slave.health -= 5; } else { slave.health -= 10; } } else if (slave.hears === -1 && thisSurgery.surgery_hears === 0) { surgeries.push("surgery to correct her hearing"); slave.hears = 0; cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave); - if (V.PC.medicine >= 100) slave.health -= 5; - else slave.health -= 10; + if (V.PC.medicine >= 100) { slave.health -= 5; } else { slave.health -= 10; } } else if (slave.hears === 0 && thisSurgery.surgery_hears === -1) { surgeries.push("surgery to muffle her hearing"); slave.hears = -1; cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave); - if (V.PC.medicine >= 100) slave.health -= 5; - else slave.health -= 10; + if (V.PC.medicine >= 100) { slave.health -= 5; } else { slave.health -= 10; } } else if (slave.smells === -1 && thisSurgery.surgery_smells === 0) { surgeries.push("surgery to correct her sense of smell"); slave.smells = 0; cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave); - if (V.PC.medicine >= 100) slave.health -= 5; - else slave.health -= 10; + if (V.PC.medicine >= 100) { slave.health -= 5; } else { slave.health -= 10; } } else if (slave.smells === 0 && thisSurgery.surgery_smells === -1) { surgeries.push("surgery to muffle her sense of smell"); slave.smells = -1; cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave); - if (V.PC.medicine >= 100) slave.health -= 5; - else slave.health -= 10; + if (V.PC.medicine >= 100) { slave.health -= 5; } else { slave.health -= 10; } } else if (slave.tastes === -1 && thisSurgery.surgery_tastes === 0) { surgeries.push("surgery to correct her sense of taste"); slave.tastes = 0; cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave); - if (V.PC.medicine >= 100) slave.health -= 5; - else slave.health -= 10; + if (V.PC.medicine >= 100) { slave.health -= 5; } else { slave.health -= 10; } } else if (slave.tastes === 0 && thisSurgery.surgery_tastes === -1) { surgeries.push("surgery to muffle her sense of taste"); slave.tastes = -1; cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave); - if (V.PC.medicine >= 100) slave.health -= 5; - else slave.health -= 10; + if (V.PC.medicine >= 100) { slave.health -= 5; } else { slave.health -= 10; } } } if (slave.health > 20 && surgeries.length < 3) { @@ -205,20 +197,17 @@ window.rulesAutosurgery = (function() { surgeries.push("surgery to remove her lactation implants"); slave.lactation = 0; cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave); - if (V.PC.medicine >= 100) slave.health -= 5; - else slave.health -= 10; + if (V.PC.medicine >= 100) { slave.health -= 5; } else { slave.health -= 10; } } else if (slave.lactation !== 2 && (thisSurgery.surgery_lactation === 1)) { surgeries.push("lactation inducing implanted drugs"); slave.lactation = 2; cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave); - if (V.PC.medicine >= 100) slave.health -= 5; - else slave.health -= 10; + if (V.PC.medicine >= 100) { slave.health -= 5; } else { slave.health -= 10; } } else if ((slave.boobShape === "saggy" || slave.boobShape === "downward-facing") && thisSurgery.surgery_cosmetic > 0 && slave.breastMesh !== 1) { surgeries.push("a breast lift"); slave.boobShape = "normal"; cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave); - if (V.PC.medicine >= 100) slave.health -= 5; - else slave.health -= 10; + if (V.PC.medicine >= 100) { slave.health -= 5; } else { slave.health -= 10; } } else if ((slave.boobShape === "normal" || slave.boobShape === "wide-set") && thisSurgery.surgery_cosmetic > 0 && slave.breastMesh !== 1) { if (slave.boobs > 800) { slave.boobShape = "torpedo-shaped"; @@ -227,44 +216,38 @@ window.rulesAutosurgery = (function() { } surgeries.push("more interestingly shaped breasts"); cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave); - if (V.PC.medicine >= 100) slave.health -= 5; - else slave.health -= 10; + if (V.PC.medicine >= 100) { slave.health -= 5; } else { slave.health -= 10; } } else if (thisSurgery.surgery_boobs === 0 && slave.boobsImplant > 0) { surgeries.push("surgery to remove her boob implants"); slave.boobs -= slave.boobsImplant; slave.boobsImplant = 0; slave.boobsImplantType = 0; cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave); - if (V.PC.medicine >= 100) slave.health -= 5; - else slave.health -= 10; + if (V.PC.medicine >= 100) { slave.health -= 5; } else { slave.health -= 10; } } else if (slave.boobs <= 600 && slave.lactation < 2 && (slave.boobs + 400 <= thisSurgery.surgery_boobs)) { surgeries.push("bigger boobs"); slave.boobsImplant += 400; slave.boobs += 400; cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave); - if (V.PC.medicine >= 100) slave.health -= 5; - else slave.health -= 10; + if (V.PC.medicine >= 100) { slave.health -= 5; } else { slave.health -= 10; } } else if (slave.boobs <= 600 && slave.lactation < 2 && (slave.boobs + 200 <= thisSurgery.surgery_boobs)) { surgeries.push("modestly bigger boobs"); slave.boobsImplant += 200; slave.boobs += 200; cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave); - if (V.PC.medicine >= 100) slave.health -= 5; - else slave.health -= 10; + if (V.PC.medicine >= 100) { slave.health -= 5; } else { slave.health -= 10; } } else if (slave.boobs <= 2000 && slave.lactation < 2 && (slave.boobs + 400 < thisSurgery.surgery_boobs)) { surgeries.push("bigger boobs"); slave.boobsImplant += 400; slave.boobs += 400; cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave); - if (V.PC.medicine >= 100) slave.health -= 5; - else slave.health -= 10; + if (V.PC.medicine >= 100) { slave.health -= 5; } else { slave.health -= 10; } } else if (slave.boobs <= 9000 && slave.lactation < 2 && (slave.boobs < thisSurgery.surgery_boobs)) { surgeries.push("bigger boobs"); slave.boobsImplant += 200; slave.boobs += 200; cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave); - if (V.PC.medicine >= 100) slave.health -= 5; - else slave.health -= 10; + if (V.PC.medicine >= 100) { slave.health -= 5; } else { slave.health -= 10; } } } if (slave.health > 20 && surgeries.length < 3) { @@ -274,29 +257,25 @@ window.rulesAutosurgery = (function() { slave.buttImplant = 0; slave.buttImplantType = 0; cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave); - if (V.PC.medicine >= 100) slave.health -= 5; - else slave.health -= 10; + if (V.PC.medicine >= 100) { slave.health -= 5; } else { slave.health -= 10; } } else if (slave.butt <= 3 && (slave.butt < thisSurgery.surgery_butt)) { surgeries.push("a bigger butt"); slave.buttImplant = 1; slave.butt += 1; cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave); - if (V.PC.medicine >= 100) slave.health -= 5; - else slave.health -= 10; + if (V.PC.medicine >= 100) { slave.health -= 5; } else { slave.health -= 10; } } else if (slave.butt <= 5 && (slave.butt < thisSurgery.surgery_butt)) { surgeries.push("a bigger butt"); slave.buttImplant = 1; slave.butt += 1; cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave); - if (V.PC.medicine >= 100) slave.health -= 5; - else slave.health -= 10; + if (V.PC.medicine >= 100) { slave.health -= 5; } else { slave.health -= 10; } } else if (slave.butt <= 8 && (slave.butt < thisSurgery.surgery_butt)) { surgeries.push("a bigger butt"); slave.buttImplant = 1; slave.butt += 1; cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave); - if (V.PC.medicine >= 100) slave.health -= 5; - else slave.health -= 10; + if (V.PC.medicine >= 100) { slave.health -= 5; } else { slave.health -= 10; } } } if (slave.health > 20 && surgeries.length < 3) { @@ -307,8 +286,7 @@ window.rulesAutosurgery = (function() { slave.skill.anal -= 10; } cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave); - if (V.PC.medicine >= 100) slave.health -= 5; - else slave.health -= 10; + if (V.PC.medicine >= 100) { slave.health -= 5; } else { slave.health -= 10; } } else if (slave.vagina > 3 && thisSurgery.surgery_cosmetic > 0) { surgeries.push("a restored pussy"); slave.vagina = 3; @@ -316,8 +294,7 @@ window.rulesAutosurgery = (function() { slave.skill.vaginal -= 10; } cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave); - if (V.PC.medicine >= 100) slave.health -= 5; - else slave.health -= 10; + if (V.PC.medicine >= 100) { slave.health -= 5; } else { slave.health -= 10; } } else if (slave.anus > 0 && V.surgeryUpgrade === 1 && thisSurgery.surgery_holes === 2) { surgeries.push("a virgin anus"); slave.anus = 0; @@ -325,8 +302,7 @@ window.rulesAutosurgery = (function() { slave.skill.anal -= 10; } cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave); - if (V.PC.medicine >= 100) slave.health -= 5; - else slave.health -= 10; + if (V.PC.medicine >= 100) { slave.health -= 5; } else { slave.health -= 10; } } else if (slave.vagina > 0 && V.surgeryUpgrade === 1 && thisSurgery.surgery_holes === 2) { surgeries.push("a virgin pussy"); slave.vagina = 0; @@ -334,8 +310,7 @@ window.rulesAutosurgery = (function() { slave.skill.vaginal -= 10; } cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave); - if (V.PC.medicine >= 100) slave.health -= 5; - else slave.health -= 10; + if (V.PC.medicine >= 100) { slave.health -= 5; } else { slave.health -= 10; } } else if (slave.anus > 1 && thisSurgery.surgery_holes === 1) { surgeries.push("a tighter anus"); slave.anus = 1; @@ -343,8 +318,7 @@ window.rulesAutosurgery = (function() { slave.skill.anal -= 10; } cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave); - if (V.PC.medicine >= 100) slave.health -= 5; - else slave.health -= 10; + if (V.PC.medicine >= 100) { slave.health -= 5; } else { slave.health -= 10; } } else if (slave.vagina > 1 && thisSurgery.surgery_holes === 1) { surgeries.push("a tighter pussy"); slave.vagina = 1; @@ -352,8 +326,7 @@ window.rulesAutosurgery = (function() { slave.skill.vaginal -= 10; } cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave); - if (V.PC.medicine >= 100) slave.health -= 5; - else slave.health -= 10; + if (V.PC.medicine >= 100) { slave.health -= 5; } else { slave.health -= 10; } } } if (slave.health > 20 && surgeries.length < 3) { @@ -361,14 +334,12 @@ window.rulesAutosurgery = (function() { surgeries.push("surgery to remove her prostate implant"); slave.prostate = 0; cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave); - if (V.PC.medicine >= 100) slave.health -= 5; - else slave.health -= 10; + if (V.PC.medicine >= 100) { slave.health -= 5; } else { slave.health -= 10; } } else if (slave.prostate === 1 && thisSurgery.surgery_prostate === 1) { surgeries.push("a precum production enhancing drug implant"); slave.prostate = 2; cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave); - if (V.PC.medicine >= 100) slave.health -= 5; - else slave.health -= 10; + if (V.PC.medicine >= 100) { slave.health -= 5; } else { slave.health -= 10; } } else if (slave.balls > 0 && slave.vasectomy === 0 && thisSurgery.surgery_vasectomy === true) { surgeries.push("vasectomy"); V.surgeryType = "vasectomy"; @@ -394,28 +365,22 @@ window.rulesAutosurgery = (function() { if (slave.health > 20 && surgeries.length < 3) { if (slave.faceImplant <= 15 && slave.face <= 95 && thisSurgery.surgery_cosmetic > 0) { surgeries.push("a nicer face"); - if (slave.faceShape === "masculine") slave.faceShape = "androgynous"; + if (slave.faceShape === "masculine") { slave.faceShape = "androgynous"; } slave.faceImplant += 25 - 5 * Math.trunc(V.PC.medicine / 50) - 5 * V.surgeryUpgrade; slave.face = Math.clamp(slave.face + 20, -100, 100); cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave); - if (V.PC.medicine >= 100) slave.health -= 5; - else slave.health -= 10; + if (V.PC.medicine >= 100) { slave.health -= 5; } else { slave.health -= 10; } } else if (slave.faceImplant <= 15 && slave.ageImplant !== 1 && slave.visualAge >= 25 && thisSurgery.surgery_cosmetic > 0) { surgeries.push("an age lift"); slave.ageImplant = 1; slave.faceImplant += 25 - 5 * Math.trunc(V.PC.medicine / 50) - 5 * V.surgeryUpgrade; - if (slave.visualAge > 80) slave.visualAge -= 40; - else if (slave.visualAge >= 70) slave.visualAge -= 30; - else if (slave.visualAge > 50) slave.visualAge -= 20; - else if (slave.visualAge > 36) slave.visualAge -= 10; - else slave.visualAge -= 5; - cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave); - if (V.PC.medicine >= 100) slave.health -= 5; - else slave.health -= 10; + if (slave.visualAge > 80) { slave.visualAge -= 40; } else if (slave.visualAge >= 70) { slave.visualAge -= 30; } else if (slave.visualAge > 50) { slave.visualAge -= 20; } else if (slave.visualAge > 36) { slave.visualAge -= 10; } else { slave.visualAge -= 5; } + cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave); + if (V.PC.medicine >= 100) { slave.health -= 5; } else { slave.health -= 10; } } else if (((slave.underArmHStyle !== "bald" && slave.underArmHStyle !== "hairless") || (slave.pubicHStyle !== "bald" && slave.pubicHStyle !== "hairless")) && thisSurgery.surgery_bodyhair === 2) { surgeries.push("body hair removal"); - if (slave.underArmHStyle !== "hairless") slave.underArmHStyle = "bald"; - if (slave.pubicHStyle !== "hairless") slave.pubicHStyle = "bald"; + if (slave.underArmHStyle !== "hairless") { slave.underArmHStyle = "bald"; } + if (slave.pubicHStyle !== "hairless") { slave.pubicHStyle = "bald"; } cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave); } else if ((slave.bald === 0 || slave.hStyle !== "bald" || slave.eyebrowHStyle !== "bald") && thisSurgery.surgery_hair === 2) { surgeries.push("hair removal"); @@ -427,22 +392,19 @@ window.rulesAutosurgery = (function() { surgeries.push("liposuction"); slave.weight -= 50; cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave); - if (V.PC.medicine >= 100) slave.health -= 5; - else slave.health -= 10; + if (V.PC.medicine >= 100) { slave.health -= 5; } else { slave.health -= 10; } } else if ((slave.bellySagPreg > 0 || slave.bellySag > 0) && (thisSurgery.surgery_cosmetic > 0 || thisSurgery.surgery_tummy > 0 )) { surgeries.push("a tummy tuck"); slave.bellySag = 0; slave.bellySagPreg = 0; cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave); - if (V.PC.medicine >= 100) slave.health -= 10; - else slave.health -= 20; + if (V.PC.medicine >= 100) { slave.health -= 10; } else { slave.health -= 20; } } else if (slave.voice === 1 && slave.voiceImplant === 0 && thisSurgery.surgery_cosmetic > 0) { surgeries.push("a feminine voice"); slave.voice += 1; slave.voiceImplant += 1; cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave); - if (V.PC.medicine >= 100) slave.health -= 5; - else slave.health -= 10; + if (V.PC.medicine >= 100) { slave.health -= 5; } else { slave.health -= 10; } } else if (thisSurgery.surgery_lips === 0 && slave.lipsImplant > 0) { surgeries.push("surgery to remove her lip implants"); slave.lips -= slave.lipsImplant; @@ -451,8 +413,7 @@ window.rulesAutosurgery = (function() { slave.skill.oral -= 10; } cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave); - if (V.PC.medicine >= 100) slave.health -= 5; - else slave.health -= 10; + if (V.PC.medicine >= 100) { slave.health -= 5; } else { slave.health -= 10; } } else if (slave.lips <= 95 && (slave.lips < thisSurgery.surgery_lips)) { surgeries.push("bigger lips"); slave.lipsImplant += 10; @@ -461,22 +422,19 @@ window.rulesAutosurgery = (function() { slave.skill.oral -= 10; } cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave); - if (V.PC.medicine >= 100) slave.health -= 5; - else slave.health -= 10; + if (V.PC.medicine >= 100) { slave.health -= 5; } else { slave.health -= 10; } } else if (slave.cSec === 1 && thisSurgery.surgery_cosmetic > 0) { surgeries.push("surgery to remove a c-section scar"); slave.cSec = 0; cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave); - if (V.PC.medicine >= 100) slave.health -= 5; - else slave.health -= 10; + if (V.PC.medicine >= 100) { slave.health -= 5; } else { slave.health -= 10; } } else if (slave.faceImplant <= 45 && slave.face <= 95 && thisSurgery.surgery_cosmetic === 2) { surgeries.push("a nicer face"); - if (slave.faceShape === "masculine") slave.faceShape = "androgynous"; + if (slave.faceShape === "masculine") { slave.faceShape = "androgynous"; } slave.faceImplant += 25 - 5 * Math.trunc(V.PC.medicine / 50) - 5 * V.surgeryUpgrade; slave.face = Math.clamp(slave.face + 20, -100, 100); cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave); - if (V.PC.medicine >= 100) slave.health -= 5; - else slave.health -= 10; + if (V.PC.medicine >= 100) { slave.health -= 5; } else { slave.health -= 10; } } else if (slave.faceImplant <= 45 && slave.ageImplant !== 1 && slave.visualAge >= 25 && thisSurgery.surgery_cosmetic === 2) { surgeries.push("an age lift"); slave.ageImplant = 1; @@ -493,15 +451,13 @@ window.rulesAutosurgery = (function() { } slave.faceImplant += 25 - 5 * Math.trunc(V.PC.medicine / 50) - 5 * V.surgeryUpgrade; cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave); - if (V.PC.medicine >= 100) slave.health -= 5; - else slave.health -= 10; + if (V.PC.medicine >= 100) { slave.health -= 5; } else { slave.health -= 10; } } else if (slave.voice < 3 && slave.voiceImplant === 0 && thisSurgery.surgery_cosmetic === 2) { surgeries.push("a bimbo's voice"); slave.voice += 1; slave.voiceImplant += 1; cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave); - if (V.PC.medicine >= 100) slave.health -= 5; - else slave.health -= 10; + if (V.PC.medicine >= 100) { slave.health -= 5; } else { slave.health -= 10; } } } if (slave.health > 20 && surgeries.length < 3) { @@ -509,35 +465,30 @@ window.rulesAutosurgery = (function() { surgeries.push("a narrower waist"); slave.waist -= 20; cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave); - if (V.PC.medicine >= 100) slave.health -= 5; - else slave.health -= 10; + if (V.PC.medicine >= 100) { slave.health -= 5; } else { slave.health -= 10; } } else if (slave.hips < 1 && V.surgeryUpgrade === 1 && (slave.hips < thisSurgery.surgery_hips)) { surgeries.push("wider hips"); slave.hips++; slave.hipsImplant++; cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave); - if (V.PC.medicine >= 100) slave.health -= 5; - else slave.health -= 10; + if (V.PC.medicine >= 100) { slave.health -= 5; } else { slave.health -= 10; } } else if (slave.waist >= -95 && V.seeExtreme === 1 && thisSurgery.surgery_cosmetic === 2) { surgeries.push("a narrower waist"); slave.waist = Math.clamp(slave.waist - 20, -100, 100); cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave); - if (V.PC.medicine >= 100) slave.health -= 5; - else slave.health -= 10; + if (V.PC.medicine >= 100) { slave.health -= 5; } else { slave.health -= 10; } } else if (slave.hips < 2 && V.surgeryUpgrade === 1 && (slave.hips < thisSurgery.surgery_hips)) { surgeries.push("wider hips"); slave.hips++; slave.hipsImplant++; cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave); - if (V.PC.medicine >= 100) slave.health -= 5; - else slave.health -= 10; + if (V.PC.medicine >= 100) { slave.health -= 5; } else { slave.health -= 10; } } else if (slave.hips < 3 && V.surgeryUpgrade === 1 && (slave.hips < thisSurgery.surgery_hips)) { surgeries.push("wider hips"); slave.hips++; slave.hipsImplant++; cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave); - if (V.PC.medicine >= 100) slave.health -= 5; - else slave.health -= 10; + if (V.PC.medicine >= 100) { slave.health -= 5; } else { slave.health -= 10; } } } if (slave.health > 20 && surgeries.length < 3) { @@ -548,13 +499,11 @@ window.rulesAutosurgery = (function() { if (slave.ovaries === 1 || slave.mpreg === 1) { surgeries.push("belly implant"); V.surgeryType = "bellyIn"; - if (V.PC.medicine >= 100) slave.health -= 5; - else slave.health -= 10; + if (V.PC.medicine >= 100) { slave.health -= 5; } else { slave.health -= 10; } } else { surgeries.push("male belly implant"); V.surgeryType = "bellyInMale"; - if (V.PC.medicine >= 100) slave.health -= 25; - else slave.health -= 50; + if (V.PC.medicine >= 100) { slave.health -= 25; } else { slave.health -= 50; } } bellyIn(slave); } else if (slave.bellyImplant >= 0 && thisSurgery.surgery_bellyImplant === "remove") { diff --git a/src/js/sexActsJS.js b/src/js/sexActsJS.js index 231f899b902..3ca88e59963 100644 --- a/src/js/sexActsJS.js +++ b/src/js/sexActsJS.js @@ -1,5 +1,6 @@ -window.VCheck = (function () { +window.VCheck = (function() { "use strict"; + /* eslint-disable */ let he; let him; let his; @@ -8,6 +9,7 @@ window.VCheck = (function () { let boy; let He; let His; + /* eslint-enable */ return { Anal: AnalVCheck, @@ -315,7 +317,6 @@ window.VCheck = (function () { } return r; } - })(); /** diff --git a/src/js/slaveCostJS.js b/src/js/slaveCostJS.js index a4a571ffe93..366a185619f 100644 --- a/src/js/slaveCostJS.js +++ b/src/js/slaveCostJS.js @@ -1488,7 +1488,7 @@ window.FResult = (function() { } const uses = V.oralUseWeight + V.vaginalUseWeight + V.analUseWeight; - if (uses <= 0) return; + if (uses <= 0) { return; } result += (6 + slave.tonguePiercing) * (V.oralUseWeight / uses) * (slave.skill.oral / 30); if (slave.sexualFlaw === "cum addict") { @@ -1527,11 +1527,11 @@ window.FResult = (function() { V.slaves.forEach(islave => { if (isParentP(slave, islave) && sameAssignmentP(slave, islave)) { result += 1; - if (incestBonus) result += 1; + if (incestBonus) { result += 1; } } if (areSisters(slave, islave) > 0 && sameAssignmentP(slave, islave)) { result += 1; - if (incestBonus) result += 1; + if (incestBonus) { result += 1; } } }); } @@ -1543,7 +1543,7 @@ window.FResult = (function() { const fre = getSlave(slave.relationTarget); if (fre !== undefined && sameAssignmentP(slave, fre)) { result += 2; - if (incestBonus) result += 2; + if (incestBonus) { result += 2; } } } @@ -1554,7 +1554,7 @@ window.FResult = (function() { const fre = V.slaves.findIndex(s => { return haveRelationshipP(slave, s) && sameAssignmentP(slave, s); }); - if (fre !== -1) result += 1; + if (fre !== -1) { result += 1; } } /** @@ -1562,7 +1562,7 @@ window.FResult = (function() { */ function calcWorksWithRival(slave) { const en = getSlave(slave.rivalryTarget); - if (en !== undefined && sameAssignmentP(slave, en)) result -= 1; + if (en !== undefined && sameAssignmentP(slave, en)) { result -= 1; } } /** @@ -1588,8 +1588,7 @@ window.FResult = (function() { */ function calcPreg(slave) { if (V.arcologies[0].FSRepopulationFocus > 20) { - if (slave.belly >= 1500) result += 2; - else result -= 2; + if (slave.belly >= 1500) { result += 2; } else { result -= 2; } } else if (V.arcologies[0].FSRepopulationFocusPregPolicy === 1) { if (slave.bellyPreg >= 1500) { result += 1; @@ -1624,8 +1623,8 @@ window.FResult = (function() { * @param {App.Entity.SlaveState} slave */ function calcSexAttributes(slave) { - if (slave.clitPiercing > 2) result += 1; - if (slave.tail === "sex") result += 1; + if (slave.clitPiercing > 2) { result += 1; } + if (slave.tail === "sex") { result += 1; } if (slave.fetishKnown === 1 && slave.fetishStrength > 60 && slave.fetish !== "none") { result += slave.fetishStrength / 5; } @@ -1633,16 +1632,12 @@ window.FResult = (function() { if (slave.attrKnown === 1) { result += Math.trunc(slave.attrXX / 20); result += Math.trunc(slave.attrXY / 20); - if (slave.energy > 95) result += 3; - else if (slave.energy > 80) result += 2; - else if (slave.energy > 60) result += 1; - else if (slave.energy <= 20) result -= 2; - else if (slave.energy <= 40) result -= 1; + if (slave.energy > 95) { result += 3; } else if (slave.energy > 80) { result += 2; } else if (slave.energy > 60) { result += 1; } else if (slave.energy <= 20) { result -= 2; } else if (slave.energy <= 40) { result -= 1; } } - if (slave.sexualFlaw !== "none") result -= 2; - if (slave.sexualQuirk !== "none") result += 2; - if (slave.behavioralFlaw !== "none") result -= 2; - if (slave.behavioralQuirk !== "none") result += 2; + if (slave.sexualFlaw !== "none") { result -= 2; } + if (slave.sexualQuirk !== "none") { result += 2; } + if (slave.behavioralFlaw !== "none") { result -= 2; } + if (slave.behavioralQuirk !== "none") { result += 2; } } /** @@ -1660,8 +1655,7 @@ window.FResult = (function() { * @param {App.Entity.SlaveState} slave */ function calcSight(slave) { - if (!canSee(slave)) result -= 3; - else if (slave.eyes <= -1) { + if (!canSee(slave)) { result -= 3; } else if (slave.eyes <= -1) { if (slave.eyewear !== "corrective glasses" && slave.eyewear !== "corrective contacts") { result -= 1; } @@ -1676,8 +1670,7 @@ window.FResult = (function() { * @param {App.Entity.SlaveState} slave */ function calcHearing(slave) { - if (!canHear(slave)) result -= 2; - else if (slave.hears <= -1) { + if (!canHear(slave)) { result -= 2; } else if (slave.hears <= -1) { if (slave.earwear !== "hearing aids") { result -= 1; } @@ -1690,7 +1683,7 @@ window.FResult = (function() { * @param {App.Entity.SlaveState} slave */ function calcEgyptianBonus(slave) { - if (V.racialVarieties === undefined) V.racialVarieties = []; + if (V.racialVarieties === undefined) { V.racialVarieties = []; } if (!V.racialVarieties.includes(slave.race)) { V.racialVarieties.push(slave.race); } @@ -1728,8 +1721,8 @@ window.FResult = (function() { } else if (!V.familyTesting && slave.relation !== 0) { calcWorksWithRelativesVanilla(slave); } - if (slave.relationship > 0) calcWorksWithRelationship(slave); - if (slave.rivalry !== 0) calcWorksWithRival(slave); + if (slave.relationship > 0) { calcWorksWithRelationship(slave); } + if (slave.rivalry !== 0) { calcWorksWithRival(slave); } calcHInjectionsDiet(slave); calcPreg(slave); calcRace(slave); @@ -1753,12 +1746,10 @@ window.FResult = (function() { function calcAge(slave) { if ((V.arcologies[0].FSRepopulationFocus !== "unset" || V.arcologies[0].FSGenderFundamentalist !== "unset") && slave.physicalAge === V.minimumSlaveAge && slave.physicalAge === V.fertilityAge && canGetPregnant(slave)) { result += 1; - if (slave.birthWeek === 0) result += result; - else if (slave.birthWeek < 4) result += 0.2 * result; + if (slave.birthWeek === 0) { result += result; } else if (slave.birthWeek < 4) { result += 0.2 * result; } } else if (slave.physicalAge === V.minimumSlaveAge) { result += 1; - if (slave.birthWeek === 0) result += 0.5 * result; - else if (slave.birthWeek < 4) result += 0.1 * result; + if (slave.birthWeek === 0) { result += 0.5 * result; } else if (slave.birthWeek < 4) { result += 0.1 * result; } } else if (slave.physicalAge === V.fertilityAge && canGetPregnant(slave) && (V.arcologies[0].FSRepopulationFocus !== "unset" || V.arcologies[0].FSGenderFundamentalist !== "unset")) { result += 1; if (slave.birthWeek === 0) { diff --git a/src/js/slaveGenerationJS.js b/src/js/slaveGenerationJS.js index 5bb707929cb..653092227d1 100644 --- a/src/js/slaveGenerationJS.js +++ b/src/js/slaveGenerationJS.js @@ -1532,7 +1532,7 @@ window.generatePronouns = function generatePronouns(slave) { /** * @param {App.Entity.SlaveState} slave */ -window.generatePuberty = function (slave) { +window.generatePuberty = function(slave) { if ((slave.ovaries === 1 || slave.mpreg === 1) && slave.physicalAge >= slave.pubertyAgeXX) { slave.pubertyXX = 1; } else { @@ -1548,7 +1548,7 @@ window.generatePuberty = function (slave) { /** * @param {App.Entity.SlaveState} slave */ -window.ageImplantAdjustment = function (slave) { +window.ageImplantAdjustment = function(slave) { if (slave.visualAge > 80) { slave.visualAge -= 40; } else if (slave.visualAge >= 70) { diff --git a/src/js/slaveListing.js b/src/js/slaveListing.js index 5ded9cc39e2..cf1af0e4258 100644 --- a/src/js/slaveListing.js +++ b/src/js/slaveListing.js @@ -362,7 +362,7 @@ App.UI.selectSlaveForPersonalAttention = function(id) { * @param {string} passage The passage to link to * @returns {string} */ -App.UI.SlaveList.sortingLinks = function (passage) { +App.UI.SlaveList.sortingLinks = function(passage) { const V = State.variables; let r = ' Sort by: '; r += ["devotion", "name", "assignment", "seniority", "actualAge", "visualAge", "physicalAge"] @@ -385,7 +385,7 @@ App.UI.SlaveList.sortingLinks = function (passage) { * @param {{assign: string, remove: string, transfer: (string| undefined)}} [tabCaptions] * @returns {string} */ -App.UI.SlaveList.listSJFacilitySlaves = function (facility, facilityPassage, showTransfersTab = false, tabCaptions = undefined) { +App.UI.SlaveList.listSJFacilitySlaves = function(facility, facilityPassage, showTransfersTab = false, tabCaptions = undefined) { const V = State.variables; facilityPassage = facilityPassage || passage(); tabCaptions = tabCaptions || { @@ -463,7 +463,7 @@ App.UI.SlaveList.listSJFacilitySlaves = function (facility, facilityPassage, sho /** * @returns {string} */ -App.UI.SlaveList.listNGPSlaves = function () { +App.UI.SlaveList.listNGPSlaves = function() { const V = State.variables; const thisPassage = 'New Game Plus'; let r = this.sortingLinks(thisPassage) + '<br>'; @@ -507,7 +507,7 @@ App.UI.SlaveList.listNGPSlaves = function () { * @param {string} [selectionPassage] passage name for manager selection. "${Manager} Select" if omitted * @returns {string} */ -App.UI.SlaveList.displayManager = function (facility, selectionPassage) { +App.UI.SlaveList.displayManager = function(facility, selectionPassage) { const managerCapName = capFirstChar(facility.desc.manager.position); selectionPassage = selectionPassage || `${managerCapName} Select`; const manager = facility.manager.currentEmployee; @@ -526,11 +526,11 @@ App.UI.SlaveList.displayManager = function (facility, selectionPassage) { * @param {boolean} [showTransfersPage] * @returns {string} */ -App.UI.SlaveList.stdFacilityPage = function (facility, showTransfersPage) { +App.UI.SlaveList.stdFacilityPage = function(facility, showTransfersPage) { return this.displayManager(facility) + '<br><br>' + this.listSJFacilitySlaves(facility, passage(), showTransfersPage); }; -App.UI.SlaveList.penthousePage = function () { +App.UI.SlaveList.penthousePage = function() { const V = State.variables; const ph = App.Entity.facilities.penthouse; const listElementId = 'summarylist'; // for the untabbed mode only @@ -783,7 +783,7 @@ App.UI.SlaveList.penthousePage = function () { * @returns {boolean} */ -App.UI.SlaveList.slaveSelectionList = function () { +App.UI.SlaveList.slaveSelectionList = function() { const selectionElementId = "slaveSelectionList"; return selection; @@ -915,7 +915,7 @@ App.UI.SlaveList.slaveSelectionList = function () { * @param {string} [passage] one of the *Workaround passages. Will be composed from the position name if omitted * @returns {string} */ -App.UI.SlaveList.facilityManagerSelection = function (facility, passage) { +App.UI.SlaveList.facilityManagerSelection = function(facility, passage) { passage = passage || capFirstChar(facility.manager.desc.position) + " Workaround"; return this.slaveSelectionList(slave => facility.manager.canEmploy(slave), (slave, index) => App.UI.passageLink(SlaveFullName(slave), passage, `$i = ${index}`), diff --git a/src/js/slaveStatsChecker.js b/src/js/slaveStatsChecker.js index 905d4f8bd54..1c0b9811c47 100644 --- a/src/js/slaveStatsChecker.js +++ b/src/js/slaveStatsChecker.js @@ -1,4 +1,4 @@ -window.SlaveStatsChecker = (function () { +window.SlaveStatsChecker = (function() { return { checkForLisp: hasLisp, isModded: isModded, @@ -177,7 +177,7 @@ window.SlaveStatsChecker = (function () { * @param {App.Entity.SlaveState} slave * @returns {boolean} */ -window.isSlim = function (slave) { +window.isSlim = function(slave) { let slim = false; const ArcologyZero = State.variables.arcologies[0]; @@ -209,7 +209,7 @@ window.isSlim = function (slave) { * @param {App.Entity.SlaveState} slave * @returns {number} */ -window.slimPass = function (slave) { +window.slimPass = function(slave) { let slimPass = 0; const ArcologyZero = State.variables.arcologies[0]; @@ -238,7 +238,7 @@ window.slimPass = function (slave) { * @param {App.Entity.SlaveState} slave * @returns {boolean} */ -window.isStacked = function (slave) { +window.isStacked = function(slave) { return (slave.butt > 4) && (slave.boobs > 800); }; @@ -246,7 +246,7 @@ window.isStacked = function (slave) { * @param {App.Entity.SlaveState} slave * @returns {boolean} */ -window.isXY = function (slave) { +window.isXY = function(slave) { return (slave.dick > 0); }; @@ -254,7 +254,7 @@ window.isXY = function (slave) { * @param {App.Entity.SlaveState} slave * @returns {boolean} */ -window.isYoung = function (slave) { +window.isYoung = function(slave) { return (slave.visualAge < 30); }; @@ -262,7 +262,7 @@ window.isYoung = function (slave) { * @param {App.Entity.SlaveState} slave * @returns {boolean} */ -window.isPreg = function (slave) { +window.isPreg = function(slave) { return ((slave.bellyPreg >= 5000) || (slave.bellyImplant >= 5000)); }; @@ -270,7 +270,7 @@ window.isPreg = function (slave) { * @param {App.Entity.SlaveState} slave * @returns {boolean} */ -window.isNotPreg = function (slave) { +window.isNotPreg = function(slave) { return (!isPreg(slave) && (slave.belly < 100) && (slave.weight < 30) && !setup.fakeBellies.includes(slave.bellyAccessory)); }; @@ -278,7 +278,7 @@ window.isNotPreg = function (slave) { * @param {App.Entity.SlaveState} slave * @returns {boolean} */ -window.isPure = function (slave) { +window.isPure = function(slave) { return ((slave.boobsImplant === 0) && (slave.buttImplant === 0) && (slave.waist >= -95) && (slave.lipsImplant === 0) && (slave.faceImplant < 30) && (slave.bellyImplant === -1) && (Math.abs(slave.shouldersImplant) < 2) && (Math.abs(slave.hipsImplant) < 2)); }; @@ -286,7 +286,7 @@ window.isPure = function (slave) { * @param {App.Entity.SlaveState} slave * @returns {boolean} */ -window.isSurgicallyImproved = function (slave) { +window.isSurgicallyImproved = function(slave) { return ((slave.boobsImplant > 0) && (slave.buttImplant > 0) && (slave.waist < -10) && (slave.lipsImplant > 0)); }; @@ -294,7 +294,7 @@ window.isSurgicallyImproved = function (slave) { * @param {App.Entity.SlaveState} slave * @returns {boolean} */ -window.isFullyPotent = function (slave) { +window.isFullyPotent = function(slave) { if (!slave) { return null; } else if (slave.dick > 0 && slave.balls > 0 && slave.ballType !== "sterile" && slave.hormoneBalance < 100 && slave.drugs !== "hormone blockers") { @@ -307,7 +307,7 @@ window.isFullyPotent = function (slave) { * @param {App.Entity.SlaveState} slave * @returns {boolean} */ -window.canGetPregnant = function (slave) { +window.canGetPregnant = function(slave) { if (!slave) { return null; } else if (slave.preg === -1) { /* contraceptives check */ @@ -327,7 +327,7 @@ window.canGetPregnant = function (slave) { * @param {App.Entity.SlaveState} slave * @returns {boolean} */ -window.isFertile = function (slave) { +window.isFertile = function(slave) { if (!slave) { return null; } @@ -375,7 +375,7 @@ window.isFertile = function (slave) { * @param {App.Entity.SlaveState} slave * @returns {boolean} */ -window.canAchieveErection = function (slave) { +window.canAchieveErection = function(slave) { if (!slave) { return null; } else if (slave.dick <= 0) { @@ -400,7 +400,7 @@ window.canAchieveErection = function (slave) { * @param {App.Entity.SlaveState} slave * @returns {boolean} */ -window.canPenetrate = function (slave) { +window.canPenetrate = function(slave) { if (!slave) { return null; } else if (!canAchieveErection(slave)) { @@ -417,7 +417,7 @@ window.canPenetrate = function (slave) { * @param {App.Entity.SlaveState} slave * @returns {boolean} */ -window.canSee = function (slave) { +window.canSee = function(slave) { if (!slave) { return null; } @@ -428,7 +428,7 @@ window.canSee = function (slave) { * @param {App.Entity.SlaveState} slave * @returns {boolean} */ -window.canHear = function (slave) { +window.canHear = function(slave) { if (!slave) { return null; } @@ -439,7 +439,7 @@ window.canHear = function (slave) { * @param {App.Entity.SlaveState} slave * @returns {boolean} */ -window.canSmell = function (slave) { +window.canSmell = function(slave) { if (!slave) { return null; } @@ -450,7 +450,7 @@ window.canSmell = function (slave) { * @param {App.Entity.SlaveState} slave * @returns {boolean} */ -window.canTaste = function (slave) { +window.canTaste = function(slave) { if (!slave) { return null; } @@ -461,7 +461,7 @@ window.canTaste = function (slave) { * @param {App.Entity.SlaveState} slave * @returns {boolean} */ -window.canWalk = function (slave) { +window.canWalk = function(slave) { if (!slave) { return null; } else if (slave.amp === 1) { @@ -494,7 +494,7 @@ window.canWalk = function (slave) { * @param {App.Entity.SlaveState} slave * @returns {boolean} */ -window.canTalk = function (slave) { +window.canTalk = function(slave) { if (!slave) { return null; } else if (slave.accent > 2) { @@ -519,7 +519,7 @@ window.canTalk = function (slave) { * @param {App.Entity.SlaveState} slave * @returns {boolean} */ -window.canDoAnal = function (slave) { +window.canDoAnal = function(slave) { if (!slave) { return null; } else if (slave.chastityAnus === 1) { @@ -532,7 +532,7 @@ window.canDoAnal = function (slave) { * @param {App.Entity.SlaveState} slave * @returns {boolean} */ -window.canDoVaginal = function (slave) { +window.canDoVaginal = function(slave) { if (!slave) { return null; } else if (slave.vagina < 0) { @@ -547,7 +547,7 @@ window.canDoVaginal = function (slave) { * @param {App.Entity.SlaveState} slave * @returns {boolean} */ -window.tooFatSlave = function (slave) { +window.tooFatSlave = function(slave) { if (!slave) { return null; } else if (slave.weight > 190 + (slave.muscles / 5) && slave.physicalAge >= 18) { @@ -566,7 +566,7 @@ window.tooFatSlave = function (slave) { * @param {App.Entity.SlaveState} slave * @returns {boolean} */ -window.tooBigBreasts = function (slave) { +window.tooBigBreasts = function(slave) { if (!slave) { return null; } else if (slave.boobs > 30000 + (slave.muscles * 100) && slave.physicalAge >= 18) { @@ -585,7 +585,7 @@ window.tooBigBreasts = function (slave) { * @param {App.Entity.SlaveState} slave * @returns {boolean} */ -window.tooBigBelly = function (slave) { +window.tooBigBelly = function(slave) { if (!slave) { return null; } else if (slave.belly >= 450000 + (slave.muscles * 2000) && slave.physicalAge >= 18) { @@ -604,7 +604,7 @@ window.tooBigBelly = function (slave) { * @param {App.Entity.SlaveState} slave * @returns {boolean} */ -window.tooBigBalls = function (slave) { +window.tooBigBalls = function(slave) { if (!slave) { return null; } else if (slave.balls >= 30 + (slave.muscles * .3) && slave.physicalAge <= 3) { @@ -621,7 +621,7 @@ window.tooBigBalls = function (slave) { * @param {App.Entity.SlaveState} slave * @returns {boolean} */ -window.tooBigDick = function (slave) { +window.tooBigDick = function(slave) { if (!slave) { return null; } else if (slave.dick >= 20 + (slave.muscles * .1) && slave.physicalAge <= 3 && slave.dick !== 0) { @@ -638,7 +638,7 @@ window.tooBigDick = function (slave) { * @param {App.Entity.SlaveState} slave * @returns {boolean} */ -window.tooBigButt = function (slave) { +window.tooBigButt = function(slave) { if (!slave) { return null; } else if (slave.butt > 10 && slave.physicalAge <= 3) { @@ -653,7 +653,7 @@ window.tooBigButt = function (slave) { * @param {App.Entity.SlaveState} slave * @returns {boolean} */ -window.isVegetable = function (slave) { +window.isVegetable = function(slave) { if (!slave) { return false; } diff --git a/src/js/storyJS.js b/src/js/storyJS.js index a58bc99bbe5..18530af669e 100644 --- a/src/js/storyJS.js +++ b/src/js/storyJS.js @@ -8,7 +8,7 @@ * @param {number} maxValue * @returns {number} */ -window.variableAsNumber = function (x, defaultValue = 0, minValue, maxValue) { +window.variableAsNumber = function(x, defaultValue = 0, minValue, maxValue) { x = Number(x); if (isNaN(x)) { return defaultValue; @@ -26,7 +26,7 @@ window.variableAsNumber = function (x, defaultValue = 0, minValue, maxValue) { * @param {App.Entity.SlaveState} slave * @return {boolean} */ -window.isSexuallyPure = function (slave) { +window.isSexuallyPure = function(slave) { if (!slave) { return null; } @@ -34,7 +34,7 @@ window.isSexuallyPure = function (slave) { }; if (typeof interpolate === "undefined") { - const interpolate = function (x0, y0, x1, y1, x) { + const interpolate = function(x0, y0, x1, y1, x) { if (x <= x0) { return y0; } else if (x >= x1) { @@ -51,7 +51,7 @@ if (typeof interpolate === "undefined") { * @param {any} val * @returns {any[]} */ -window.removeFromArray = function (arr, val) { +window.removeFromArray = function(arr, val) { for (let i = 0; i < arr.length; i++) { if (val === arr[i]) { return arr.splice(i, 1); @@ -66,10 +66,10 @@ window.removeFromArray = function (arr, val) { * @param {any} thisArg * @returns {Array} */ -window.filterInPlace = function (arr, callback, thisArg) { +window.filterInPlace = function(arr, callback, thisArg) { let j = 0; - arr.forEach(function (e, i) { + arr.forEach(function(e, i) { if (callback.call(thisArg, e, i, arr)) { arr[j++] = e; } @@ -84,7 +84,7 @@ window.filterInPlace = function (arr, callback, thisArg) { * @param {App.Entity.SlaveState} slave2 * @returns {boolean} */ -window.canBreed = function (slave1, slave2) { +window.canBreed = function(slave1, slave2) { if (!slave1 || !slave2) { return null; } @@ -98,7 +98,7 @@ window.canBreed = function (slave1, slave2) { * @param {App.Entity.SlaveState} slave2 * @returns {boolean} */ -window.canImpreg = function (slave1, slave2) { +window.canImpreg = function(slave1, slave2) { if (!slave1 || !slave2) { return null; } else if (slave2.dick < 1) { @@ -144,7 +144,7 @@ window.canImpreg = function (slave1, slave2) { * @param {object} PC * @returns {boolean} */ -window.isPlayerFertile = function (PC) { +window.isPlayerFertile = function(PC) { if (!PC) { return null; } else if (PC.preg !== 0) { @@ -164,7 +164,7 @@ window.isPlayerFertile = function (PC) { * @param {App.Entity.SlaveState} slave * @returns {string|number} */ -window.relationTargetWord = function (slave) { +window.relationTargetWord = function(slave) { if (!slave) { return null; } else if (slave.relation === "daughter") { @@ -179,7 +179,7 @@ window.relationTargetWord = function (slave) { * @param {App.Entity.SlaveState} slave * @returns {number} */ -window.milkAmount = function (slave) { +window.milkAmount = function(slave) { let milk; let calcs; if (!slave) { @@ -229,7 +229,7 @@ window.milkAmount = function (slave) { * @param {App.Entity.SlaveState} slave * @returns {number} */ -window.cumAmount = function (slave) { +window.cumAmount = function(slave) { let cum = 0; let calcs = 0; if (!slave) { @@ -279,7 +279,7 @@ window.cumAmount = function (slave) { * @param {string} text * @returns {string} */ -window.lispReplace = function (text) { +window.lispReplace = function(text) { text = text.replace(/Sh/g, "Th"); text = text.replace(/SS/g, "Th"); text = text.replace(/Ss/g, "Th"); @@ -367,7 +367,7 @@ window.lispReplace = function (text) { * @param {Object} arcology * @returns {number} */ -window.repGainSacrifice = function (slave, arcology) { +window.repGainSacrifice = function(slave, arcology) { if (!slave || !arcology || arcology.FSAztecRevivalist === "unset" || arcology.FSAztecRevivalist <= 0) { return 0; } @@ -379,33 +379,33 @@ window.repGainSacrifice = function (slave, arcology) { * @param {App.Entity.SlaveState} slave * @returns {boolean} */ -window.bodyguardSuccessorEligible = function (slave) { +window.bodyguardSuccessorEligible = function(slave) { if (!slave) { return false; } return (slave.devotion > 50 && slave.muscles >= 0 && slave.weight < 100 && slave.boobs < 8000 && slave.butt < 10 && slave.belly < 5000 && slave.balls < 10 && slave.dick < 10 && slave.preg < 20 && slave.fuckdoll === 0 && slave.fetish !== "mindbroken" && canWalk(slave)); }; -window.ngUpdateGenePool = function (genePool) { +window.ngUpdateGenePool = function(genePool) { const transferredSlaveIds = (State.variables.slaves || []) - .filter(function (s) { + .filter(function(s) { return s.ID >= 1200000; }) - .map(function (s) { + .map(function(s) { return s.ID - 1200000; }); return (genePool || []) - .filter(function (s) { + .filter(function(s) { return transferredSlaveIds.indexOf(s.ID) >= 0; }) - .map(function (s) { + .map(function(s) { const result = jQuery.extend(true, {}, s); result.ID += 1200000; return result; }); }; -window.ngUpdateMissingTable = function (missingTable) { +window.ngUpdateMissingTable = function(missingTable) { const newTable = {}; (State.variables.slaves || []) @@ -423,7 +423,7 @@ window.ngUpdateMissingTable = function (missingTable) { * @param {any} obj * @returns {string} */ -window.toJson = function (obj) { +window.toJson = function(obj) { let jsontext = JSON.stringify(obj); jsontext = jsontext.replace(/^{/, ""); jsontext = jsontext.replace(/}$/, ""); @@ -434,7 +434,7 @@ window.toJson = function (obj) { * @param {App.Entity.SlaveState} slave * @returns {string} */ -window.nippleColor = function (slave) { +window.nippleColor = function(slave) { if (skinToneLevel(slave.skin) < 8) { if (slave.preg > slave.pregData.normalBirth / 4 || (slave.counter.birthsTotal > 0 && slave.lactation > 0)) { return "brown"; @@ -467,7 +467,7 @@ window.nippleColor = function (slave) { * @param {Object} PC * @returns {number} */ -window.overpowerCheck = function (slave, PC) { +window.overpowerCheck = function(slave, PC) { let strength; if (State.variables.arcologies[0].FSPhysicalIdealist !== "unset") { @@ -494,7 +494,7 @@ window.overpowerCheck = function (slave, PC) { * @param {App.Entity.SlaveState} slave * @returns {number[]} */ -window.impregnatedBy = function (slave) { +window.impregnatedBy = function(slave) { const IDArray = []; if (!Array.isArray(slave.womb)) { WombInit(slave); @@ -511,15 +511,15 @@ window.impregnatedBy = function (slave) { * @param {App.Entity.SlaveState} father * @returns {boolean} */ -window.isImpregnatedBy = function (mother, father) { +window.isImpregnatedBy = function(mother, father) { return impregnatedBy(mother).includes(father.ID); }; -window.jsAlert = function (obj) { +window.jsAlert = function(obj) { alert(obj); }; -window.jsConsoleInfo = function (obj) { +window.jsConsoleInfo = function(obj) { // eslint-disable-next-line no-console console.info(obj); }; @@ -599,7 +599,7 @@ window.SoftenSexualFlaw = function SoftenSexualFlaw(slave) { /** * @param {object} PC */ -window.generatePlayerPronouns = function (PC) { +window.generatePlayerPronouns = function(PC) { if (PC.title === 0) { PC.pronoun = "she"; PC.possessivePronoun = "hers"; @@ -617,7 +617,7 @@ window.generatePlayerPronouns = function (PC) { } }; -window.generateAssistantPronouns = function () { +window.generateAssistantPronouns = function() { const V = State.variables; if (V.assistant === 0) { V.assistantPronouns.pronoun = "it"; diff --git a/src/js/textInput.js b/src/js/textInput.js index 00bffdaac33..25c358be815 100644 --- a/src/js/textInput.js +++ b/src/js/textInput.js @@ -2,7 +2,7 @@ Macro.add("textinput", { // Signifies that the macro is a container macro. tags: null, - handler: function () { + handler: function() { if (this.args.length < 2) { const errors = []; if (this.args.length < 1) { @@ -38,7 +38,7 @@ Macro.add("textinput", { tabindex: 0 // for accessibility }) .addClass("macro-textarea") // "hijack" the .macro-textarea class - .on("input", function () { + .on("input", function() { Wikifier.setValue(varName, this.value); if (that.payload[0].contents !== "") { Wikifier.wikifyEval(that.payload[0].contents.trim()); diff --git a/src/js/utilJS.js b/src/js/utilJS.js index d9f92887d1a..0fbe1c553ca 100644 --- a/src/js/utilJS.js +++ b/src/js/utilJS.js @@ -1342,16 +1342,14 @@ window.arr2obj = function arr2obj(arr) { window.hashPush = function hashPush(obj, ...rest) { rest.forEach((item) => { - if (obj[item] === undefined) obj[item] = 1; - else obj[item] += 1; + if (obj[item] === undefined) { obj[item] = 1; } else { obj[item] += 1; } }); }; window.weightedArray2HashMap = function weightedArray2HashMap(arr) { const obj = {}; arr.forEach((item) => { - if (obj[item] === undefined) obj[item] = 1; - else obj[item] += 1; + if (obj[item] === undefined) { obj[item] = 1; } else { obj[item] += 1; } }); return obj; }; @@ -1485,14 +1483,11 @@ window.getSlaveTrustClass = function(slave) { } else if (slave.trust <= 20) { return "fearful"; } else if (slave.trust <= 50) { - if (slave.devotion < -20) return "hate-careful"; - else return "careful"; + if (slave.devotion < -20) { return "hate-careful"; } else { return "careful"; } } else if (slave.trust <= 95) { - if (slave.devotion < -20) return "bold"; - else return "trusting"; + if (slave.devotion < -20) { return "bold"; } else { return "trusting"; } } else { - if (slave.devotion < -20) return "defiant"; - else return "profoundly-trusting"; + if (slave.devotion < -20) { return "defiant"; } else { return "profoundly-trusting"; } } }; @@ -1830,7 +1825,7 @@ App.UI.tabbar = function() { function handlePreSelectedTab() { let selectedTab = State.variables.tabChoice[_tabChoiceVarName()]; if (!selectedTab) { selectedTab = "assign"; } - $(document).one(':passagedisplay', function () { + $(document).one(':passagedisplay', function() { let tabBtn = document.getElementById(`tab ${selectedTab}`); if (!tabBtn) { tabBtn = document.getElementsByClassName('tablinks').item(0); @@ -1893,7 +1888,7 @@ App.UI.passageLink = function(linkText, passage, setter, elementType = 'a') { * @param {string} selector * @param {string} newContent */ -App.UI.replace = function (selector, newContent) { +App.UI.replace = function(selector, newContent) { let ins = jQuery(document.createDocumentFragment()); ins.wiki(newContent); const target = $(selector); @@ -1918,7 +1913,7 @@ App.UI.replace = function (selector, newContent) { * @param {string} [tag='div'] * @returns {string} */ -App.UI.htag = function (text, attributes, tag = 'div') { +App.UI.htag = function(text, attributes, tag = 'div') { const payload = text.replace(/(^\n+|\n+$)/, ""); if ("object" === typeof attributes) { @@ -2480,8 +2475,8 @@ window.changeSkinTone = function(skin, value) { } let prop; for (prop in skinToMelanin) { - if (!skinToMelanin.hasOwnProperty(prop)) continue; - if (newSkin >= skinToMelanin[prop]) return prop; + if (!skinToMelanin.hasOwnProperty(prop)) { continue; } + if (newSkin >= skinToMelanin[prop]) { return prop; } } return prop; }; @@ -2532,6 +2527,6 @@ App.Utils.setActiveSlaveByIndex = function(index) { * @param {number} id slave ID * @returns {number} */ -App.Utils.slaveIndexForId = function (id) { +App.Utils.slaveIndexForId = function(id) { return State.variables.slaveIndices[id]; }; diff --git a/src/js/wombJS.js b/src/js/wombJS.js index fd6ce592c0b..a701ad92c80 100644 --- a/src/js/wombJS.js +++ b/src/js/wombJS.js @@ -62,7 +62,7 @@ window.WombInit = function(actor) { // sorry but for already present broodmothers it's impossible to calculate fully, approximation used. let pw = actor.preg, bCount, bLeft; - if (pw > actor.pregData.normalBirth) pw = actor.pregData.normalBirth; // to avoid disaster. + if (pw > actor.pregData.normalBirth) { pw = actor.pregData.normalBirth; } // to avoid disaster. bCount = Math.floor(actor.pregType / pw); bLeft = actor.pregType - (bCount * pw); if (pw > actor.pregType) { @@ -238,22 +238,14 @@ window.WombBirthReady = function(actor, readyAge) { }; window.WombGetVolume = function(actor) { // most legacy code from pregJS.tw with minor adaptation. - if (actor.pregData.sizeType === 0) - return getVolByLen(actor); - else if (actor.pregData.sizeType === 1) - return getVolByWeight(actor); - else if (actor.pregData.sizeType === 2) - return getVolByRaw(actor); - else - return 0; + if (actor.pregData.sizeType === 0) { return getVolByLen(actor); } else if (actor.pregData.sizeType === 1) { return getVolByWeight(actor); } else if (actor.pregData.sizeType === 2) { return getVolByRaw(actor); } else { return 0; } function getCurData(actor, age) { let i = 0; let min, max, ageMin, ageMax, rateMin, rateMax, one, rateOne, rate, cage, csize; let data = {}; - while (actor.pregData.fetusWeek[i + 1] < age && i < actor.pregData.fetusWeek.length - 1) - i++; + while (actor.pregData.fetusWeek[i + 1] < age && i < actor.pregData.fetusWeek.length - 1) { i++; } min = actor.pregData.fetusSize[i]; max = actor.pregData.fetusSize[i + 1]; @@ -328,7 +320,7 @@ window.WombGetVolume = function(actor) { // most legacy code from pregJS.tw with alert("WombGetVolume warning - " + actor.slaveName + " " + err); } if (wombSize < 0) // catch for strange cases, to avoid messing with outside code. - wombSize = 0; + { wombSize = 0; } return wombSize; } @@ -345,7 +337,7 @@ window.WombGetVolume = function(actor) { // most legacy code from pregJS.tw with }); if (wombSize < 0) // catch for strange cases, to avoid messing with outside code. - wombSize = 0; + { wombSize = 0; } return wombSize; } @@ -362,7 +354,7 @@ window.WombGetVolume = function(actor) { // most legacy code from pregJS.tw with }); if (wombSize < 0) // catch for strange cases, to avoid messing with outside code. - wombSize = 0; + { wombSize = 0; } return wombSize; } @@ -381,18 +373,12 @@ window.WombUpdatePregVars = function(actor) { window.WombMinPreg = function(actor) { WombSort(actor); - if (actor.womb.length > 0) - return actor.womb[actor.womb.length - 1].age; - else - return 0; + if (actor.womb.length > 0) { return actor.womb[actor.womb.length - 1].age; } else { return 0; } }; window.WombMaxPreg = function(actor) { WombSort(actor); - if (actor.womb.length > 0) - return actor.womb[0].age; - else - return 0; + if (actor.womb.length > 0) { return actor.womb[0].age; } else { return 0; } }; window.WombNormalizePreg = function(actor) { @@ -407,14 +393,11 @@ window.WombNormalizePreg = function(actor) { // to avoid legacy code conflicts - broodmother on hold // can't be impregnated, but she is not on normal contraceptives. // So we set this for special case. - if (actor.preg >= 0) - actor.preg = 0.1; + if (actor.preg >= 0) { actor.preg = 0.1; } - if (actor.pregSource > 0) - actor.pregSource = 0; + if (actor.pregSource > 0) { actor.pregSource = 0; } - if (actor.pregWeek > 0) - actor.pregWeek = 0; + if (actor.pregWeek > 0) { actor.pregWeek = 0; } actor.broodmotherCountDown = 0; } @@ -423,8 +406,7 @@ window.WombNormalizePreg = function(actor) { let max = WombMaxPreg(actor); // console.log("max: " + max); // console.log(".preg: "+ actor.preg); - if (actor.pregWeek < 1) - actor.pregWeek = 1; + if (actor.pregWeek < 1) { actor.pregWeek = 1; } if (max < actor.preg) { WombProgress(actor, actor.preg - max, actor.preg - max); @@ -442,16 +424,13 @@ window.WombNormalizePreg = function(actor) { actor.pregType = 0; actor.pregKnown = 0; - if (actor.preg > 0) - actor.preg = 0; + if (actor.preg > 0) { actor.preg = 0; } - if (actor.pregSource > 0) - actor.pregSource = 0; + if (actor.pregSource > 0) { actor.pregSource = 0; } // We can't properly set postpartum here, // but can normalize obvious error with forgotten property. - if (actor.pregWeek > 0) - actor.pregWeek = 0; + if (actor.pregWeek > 0) { actor.pregWeek = 0; } } actor.bellyPreg = WombGetVolume(actor); }; @@ -508,8 +487,7 @@ window.fetalSplit = function(actor, chance) { nft.identical = 1; // this is marker that this fetus has at least one twin. s.identical = 1; // this is marker that this fetus has at least one twin. - if (s.twinID === "" || s.twinID === undefined) - s.twinID = generateNewID(); + if (s.twinID === "" || s.twinID === undefined) { s.twinID = generateNewID(); } nft.twinID = s.twinID; @@ -528,10 +506,7 @@ window.WombFetusCount = function(actor) { // give reference to fetus object, but not remove fetus, use for manipulation in the womb. window.WombGetFetus = function(actor, fetusNum) { WombInit(actor); - if (actor.womb.length >= fetusNum) - return actor.womb[fetusNum]; - else - return null; + if (actor.womb.length >= fetusNum) { return actor.womb[fetusNum]; } else { return null; } }; // give reference to fetus object, and remove it form the womb. @@ -543,8 +518,7 @@ window.WombRemoveFetus = function(actor, fetusNum) { WombSort(actor); actor.pregType = actor.womb.length; return ft; - } else - return null; + } else { return null; } }; /* to add fetus object in the womb. Be warned - you can add one single fetus to many wombs, or even add it many times to one womb. It will not show error, but behavior becomes strange, as fetus object will be the same - it's reference, not full copies. If this is not desired - use clone() on fetus before adding.*/ @@ -611,19 +585,16 @@ window.FetusGlobalReserveCount = function(reserveType) { let cnt = 0; let SV = State.variables; - if (typeof reserveType !== 'string') - return 0; + if (typeof reserveType !== 'string') { return 0; } SV.slaves.forEach(function(slave) { slave.womb.forEach(function(ft) { - if (ft.reserve === reserveType) - cnt++; + if (ft.reserve === reserveType) { cnt++; } }); }); SV.PC.womb.forEach(function(ft) { - if (ft.reserve === reserveType) - cnt++; + if (ft.reserve === reserveType) { cnt++; } }); return cnt; @@ -742,8 +713,7 @@ window.WombGetLittersData = function(actor) { // in first place we need to know how many litters here (Assuming that unique litter is have similar .realAge). Also we will know their ages. actor.womb.forEach(function(ft) { - if (!unicLiters.includes(Math.ceil(ft.realAge))) - unicLiters.push(Math.ceil(ft.realAge)); + if (!unicLiters.includes(Math.ceil(ft.realAge))) { unicLiters.push(Math.ceil(ft.realAge)); } }); // now we should find and store separate litters data (count of fetuses): @@ -765,24 +735,20 @@ window.BCReserveInit = function() { SV.slaves.forEach(function(slave) { slave.womb.forEach(function(ft) { - if (typeof ft.reserve !== 'string') - ft.reserve = ""; + if (typeof ft.reserve !== 'string') { ft.reserve = ""; } if (typeof ft.motherID !== 'number') // setting missing biological mother ID for fetus. - ft.motherID = slave.ID; - if (ft.ID === undefined) - ft.ID = generateNewID(); + { ft.motherID = slave.ID; } + if (ft.ID === undefined) { ft.ID = generateNewID(); } if (typeof ft.realAge !== 'number') // setting missing chronological age - ft.realAge = ft.age; + { ft.realAge = ft.age; } }); }); SV.PC.womb.forEach(function(ft) { - if (typeof ft.reserve !== 'string') - ft.reserve = ""; - if (typeof ft.motherID !== 'number') - ft.motherID = SV.PC.ID; + if (typeof ft.reserve !== 'string') { ft.reserve = ""; } + if (typeof ft.motherID !== 'number') { ft.motherID = SV.PC.ID; } if (typeof ft.realAge !== 'number') // setting missing chronological age - ft.realAge = ft.age; + { ft.realAge = ft.age; } }); }; -- GitLab