diff --git a/src/SpecialForce/SpecialForce.js b/src/SpecialForce/SpecialForce.js index 843af18489ec6ff1c054d7a747d23cf6a9771f7a..cbee9283d519e999f0ae98791c96f1878edff3d1 100644 --- a/src/SpecialForce/SpecialForce.js +++ b/src/SpecialForce/SpecialForce.js @@ -1,3 +1,4 @@ +/* eslint-disable no-unused-vars */ /* eslint-disable no-undef */ //V = SugarCube.State.variables, T = SugarCube.State.temporary; window.Main = function() { @@ -485,7 +486,7 @@ window.Interactions = function() { window.BadOutcome = function() { "use strict"; const V = State.variables; - let r = ``; /** FIXME: r' is declared but its value is never read.ts(6133) */ + let r = ``; V.SF.Active = -2; switch(V.SF.Colonel.Core) { case "Shell-Shocked": @@ -1069,7 +1070,7 @@ window.UnitText = function(input) { } text += `\n Smuggle in FS-optimized : `; const Optionslist = UpgradeOptions; - for (var i = 0;i<Optionslist.length;i++) { + for (let i = 0;i<Optionslist.length;i++) { var OptPOS = Optionslist[i]; var title = ``; switch(OptPOS) { diff --git a/src/art/artJS.js b/src/art/artJS.js index 35ac5896066726fd27fb3e4f35bf2ac8c9ec9dc3..830f4cb7811159459d6417c621c4cba68a3c98a8 100644 --- a/src/art/artJS.js +++ b/src/art/artJS.js @@ -1,3 +1,5 @@ +/* eslint-disable no-console */ +/* eslint-disable no-undef */ /* Call as <<= SlaveArt(...)>> or <<print SlaveArt(...)>> Displays slave images. Currently passage-based. @@ -208,7 +210,7 @@ window.extractColor = function (color, eyes) { }; window.clothing2artSuffix = function (v) { - if (v == "restrictive latex") { + if (v === "restrictive latex") { v = "latex"; } /* universal "special case": latex art is actually "restrictive latex" TODO: align name in vector source */ return v.replace(/^a[n]? /, "") /* remove "a" and "an" from the beginning*/ diff --git a/src/art/vector/VectorArtJS.js b/src/art/vector/VectorArtJS.js index 388a856059c0ee15b73a2b1406dfb7733c0e9297..918758cc80c68a43a103e5d86405eaa67d1f6b83 100644 --- a/src/art/vector/VectorArtJS.js +++ b/src/art/vector/VectorArtJS.js @@ -1,3 +1,4 @@ +/* eslint-disable no-undef */ window.VectorArt = (function () { "use strict"; let V, T, slave; @@ -626,7 +627,7 @@ window.VectorArt = (function () { case "slutty jewelry": case "uncomfortable straps": case "Western clothing": - let ballsScaleFactor = (slave.scrotum / 3) * heightScaleFactor; + ballsScaleFactor = (slave.scrotum / 3) * heightScaleFactor; artTranslationX = -271 * (ballsScaleFactor - 1); artTranslationY = -453 * (ballsScaleFactor - 1); T.artTransformBalls = `matrix(${ballsScaleFactor},0,0,${ballsScaleFactor},${artTranslationX},${artTranslationY})`; @@ -1052,7 +1053,7 @@ window.VectorArt = (function () { /* TODO: rewrite all textual descriptions not to explicitly mention the latex being of black color. */ if (wearingLatex === true || slave.clothes === "a cybersuit") outfitBaseColour = slave.clothingBaseColor || "#515351"; /* use custom color, or use default latex color */ - else if (slave.clothes == "a comfortable bodysuit") + else if (slave.clothes === "a comfortable bodysuit") outfitBaseColour = slave.clothingBaseColor || "#464646"; /* use custom color, or use default bodysuit color */ /* head addons */ @@ -2640,7 +2641,7 @@ window.LegacyVectorArt = function(slave, artSize) { r += `<img class='paperdoll' src=${filePath}/outfit/chastity female.svg'/>`; r += `<img class='paperdoll' src=${filePath}/outfit/chastity base.svg'/>`; } else if (slave.pubicHStyle !== "waxed" && slave.pubicHStyle !== "bald" && slave.pubicHStyle !== "hairless") { - let pubicHStyle = (slave.pubicHStyle == "in a strip" ? "strip" : slave.pubicHStyle); + let pubicHStyle = (slave.pubicHStyle === "in a strip" ? "strip" : slave.pubicHStyle); r += `<img class='paperdoll' src=${filePath}/hair/pubes ${pubicHStyle}.svg' style='${pubesFilter}'/>`; } diff --git a/src/art/vector_revamp/vectorRevampedArtControl.js b/src/art/vector_revamp/vectorRevampedArtControl.js index 29245d09cd26b1b718566bda4bb83fed144b64f9..e0e30c1234a78994856c5edba298082a2e0bb8ca 100644 --- a/src/art/vector_revamp/vectorRevampedArtControl.js +++ b/src/art/vector_revamp/vectorRevampedArtControl.js @@ -1,3 +1,5 @@ +/* eslint-disable no-unused-vars */ +/* eslint-disable no-undef */ window.RevampedVectorArt = function(slave) { const V = State.variables; const T = State.temporary; @@ -10,7 +12,7 @@ window.RevampedVectorArt = function(slave) { T.art_display_class = `ad${T.art_display_id}`; /*Using JS from vectorRevampedArtControl.tw*/ - T.revampedVectorArtControl = getVectorArtRevampedControl(T.art_display_class, slave, V.seeVectorArtHighlights, V.showBodyMods) + T.revampedVectorArtControl = getVectorArtRevampedControl(T.art_display_class, slave, V.seeVectorArtHighlights, V.showBodyMods); r = `<style>${T.revampedVectorArtControl.StylesCss}</style>`; T.revampedArtLayers = T.revampedVectorArtControl.Layers; @@ -23,7 +25,7 @@ window.RevampedVectorArt = function(slave) { T.revampedArtLayers.forEach(function(s) { r += jsInclude(s); }); return r; -} +}; window.getVectorArtRevampedControl = function(artDisplayClass, artSlave, globalShowHighlights, globalShowBodyMods) { return new RevampedArtControl(artDisplayClass, artSlave, globalShowHighlights, globalShowBodyMods); @@ -135,12 +137,12 @@ class ArtStyleControl { } applyEyeLensStyle() { - if (this.artSlave.eyeColor == null || this.artSlave.eyeColor == undefined) + if (this.artSlave.eyeColor === null || this.artSlave.eyeColor === undefined) return; var eyeColorSplit = this.artSlave.eyeColor.split(" "); - if (eyeColorSplit == 1) + if (eyeColorSplit === 1) return; var eyeLens = eyeColorSplit[0]; @@ -157,7 +159,7 @@ class ArtStyleControl { /*currently unused, keeping for color reference - */ parseSkinColorFromName(colorName) { - if (colorName == null) + if (colorName === null) return "#000000"; var skinPalette = [ @@ -414,7 +416,7 @@ class ClothingControl { labiaSkin: { fill: defaultOutfitColor }, lips: { fill: areolaColor } } - } + }; } get niceMaid() { @@ -433,7 +435,7 @@ class ClothingControl { bellyUpperSkin: { fill: "#FFFFFF" }, bellyDetails: { "fill-opacity": 0 } } - } + }; } get sluttyMaid() { @@ -445,12 +447,12 @@ class ClothingControl { bellySkin: { fill: "#FFFFFF" }, bellyDetails: { "fill-opacity": 0 } } - } + }; } get restrictiveLatex() { var defaultOutfitColor = "#515351"; - var areolaColor = "#383838"; + var areolaColor = "#383838"; /** FIXME: 'areolaColor' is declared but its value is never read.ts(6133) */ return { bodySettings: { showEyes: false, @@ -477,7 +479,7 @@ class ClothingControl { bellyUpperSkin: { fill: defaultOutfitColor }, shoe: { fill: defaultOutfitColor } } - } + }; } get latexCatsuit() { @@ -515,7 +517,7 @@ class ClothingControl { shoe: { fill: defaultOutfitColor }, labiaSkin: { fill: defaultOutfitColor } } - } + }; } get bodyOil() { @@ -529,7 +531,7 @@ class ClothingControl { styleSettings: { } - } + }; } get bodysuit() { @@ -561,7 +563,7 @@ class ClothingControl { muscleTone: { "fill-opacity": 0 }, bellyDetails: { "fill-opacity": 0 } } - } + }; } get leotard() { @@ -589,7 +591,7 @@ class ClothingControl { muscleTone: { "fill-opacity": 0 }, bellyDetails: { "fill-opacity": 0 } } - } + }; } } @@ -639,11 +641,11 @@ class RevampedArtControl { this.pubicTattooText = ""; var clothing = this.getClothing(); - if (clothing != null) + if (clothing !== null) { - if (clothing.bodySettings != null) + if (clothing.bodySettings !== null) this.applyClothingSettings(clothing.bodySettings); - if (clothing.styleSettings != null) + if (clothing.styleSettings !== null) this.applyClothingStyleSettings(clothing.styleSettings); } @@ -666,7 +668,7 @@ class RevampedArtControl { } copyProperties(objTo, objFrom) { - for (var attr in objFrom) { + for (let attr in objFrom) { if (objFrom.hasOwnProperty(attr)) objTo[attr] = objFrom[attr]; } @@ -677,7 +679,7 @@ class RevampedArtControl { } applyClothingStyleSettings(styleSettings) { - for (var attr in styleSettings) { + for (let attr in styleSettings) { if (styleSettings.hasOwnProperty(attr)) this.copyProperties(this.styleControl[attr], styleSettings[attr]); } @@ -820,7 +822,7 @@ class RevampedArtControl { if (!this.showHair) return result; - if (this.artSlave.hLength == 0) + if (this.artSlave.hLength === 0) return result; switch(this.artSlave.hStyle) @@ -872,10 +874,10 @@ class RevampedArtControl { get armLayer() { var result = []; - var leftArmType = ""; - var rightArmType = ""; + var leftArmType = ""; /** FIXME: 'leftArmType' is declared but its value is never read.ts(6133) */ + var rightArmType = ""; /** FIXME: 'rightArmType' is declared but its value is never read.ts(6133) */ - if (this.artSlave.amp == 1) { + if (this.artSlave.amp === 1) { result.push("Art_Vector_Revamp_Arm_Stump"); } else { @@ -883,7 +885,7 @@ class RevampedArtControl { result.push("Art_Vector_Revamp_Arm_Left_"+this.leftArmType); } - if (this.showArmHair && (this.artSlave.amp == 1 || (this.leftArmType == "High" && this.artSlave.amp != 1))) + if (this.showArmHair && (this.artSlave.amp === 1 || (this.leftArmType === "High" && this.artSlave.amp !== 1))) { switch(this.artSlave.underArmHStyle) { @@ -923,7 +925,7 @@ class RevampedArtControl { get legLayer() { var result = []; - if (this.artSlave.amp == 1) { + if (this.artSlave.amp === 1) { result.push("Art_Vector_Revamp_Stump"); } else { @@ -932,7 +934,7 @@ class RevampedArtControl { if (this.artSlave.hips < 0) { legSize = this.artSlave.weight > 95 ? "Normal" : "Narrow"; } - else if (this.artSlave.hips == 0) { + else if (this.artSlave.hips === 0) { legSize = this.artSlave.weight > 95 ? "Wide" : "Normal"; } else if (this.artSlave.hips > 0) { @@ -954,7 +956,7 @@ class RevampedArtControl { get feetLayer() { var result = []; - if (this.artSlave.amp == 1) { + if (this.artSlave.amp === 1) { return result; } @@ -990,7 +992,7 @@ class RevampedArtControl { result.push("Art_Vector_Revamp_Torso_Highlights1"); } - if (this.showArmHair && this.leftArmType != "High" && this.artSlave.amp != 1) + if (this.showArmHair && this.leftArmType !== "High" && this.artSlave.amp !== 1) { switch(this.artSlave.underArmHStyle) { @@ -1025,9 +1027,9 @@ class RevampedArtControl { if (this.artSlave.physicalAge < 12) return result; - if (this.artSlave.vaginaTat == "rude words") + if (this.artSlave.vaginaTat === "rude words") { - this.pubicTattooText = this.artSlave.dick != 0 ? "Useless" : "Fucktoy"; + this.pubicTattooText = this.artSlave.dick !== 0 ? "Useless" : "Fucktoy"; result.push("Art_Vector_Revamp_Pussy_Tattoo"); } switch(this.artSlave.pubicHStyle) @@ -1058,16 +1060,16 @@ class RevampedArtControl { if (!this.showPussyPiercings) return result; - if (this.artSlave.vaginaPiercing == 1) + if (this.artSlave.vaginaPiercing === 1) result.push("Art_Vector_Revamp_Pussy_Piercing"); - else if (this.artSlave.vaginaPiercing == 2) + else if (this.artSlave.vaginaPiercing === 2) result.push("Art_Vector_Revamp_Pussy_Piercing_Heavy"); - if (this.artSlave.clitPiercing == 1) + if (this.artSlave.clitPiercing === 1) result.push("Art_Vector_Revamp_Clit_Piercing"); - else if (this.artSlave.clitPiercing == 2) + else if (this.artSlave.clitPiercing === 2) result.push("Art_Vector_Revamp_Clit_Piercing_Heavy"); - else if (this.artSlave.clitPiercing == 3) + else if (this.artSlave.clitPiercing === 3) result.push("Art_Vector_Revamp_Clit_Piercing_Smart"); return result; @@ -1076,11 +1078,11 @@ class RevampedArtControl { get chastityBeltLayer() { var result = []; - var isChastityAnalWorn = this.artSlave.chastityAnus == 1; + var isChastityAnalWorn = this.artSlave.chastityAnus === 1; isChastityAnalWorn = isChastityAnalWorn && this.showChastityAnal; - var isChastityVaginalWorn = this.artSlave.chastityVagina == 1; + var isChastityVaginalWorn = this.artSlave.chastityVagina === 1; isChastityVaginalWorn = isChastityVaginalWorn && this.showChastityVaginal; @@ -1152,7 +1154,7 @@ class RevampedArtControl { if (this.artSlave.navelPiercing >= 1) result.push("Art_Vector_Revamp_Belly_" + this.bellyLevel + "_Piercing"); - if (this.artSlave.navelPiercing == 2) + if (this.artSlave.navelPiercing === 2) result.push("Art_Vector_Revamp_Belly_" + this.bellyLevel + "_Piercing_Heavy"); } } @@ -1163,7 +1165,7 @@ class RevampedArtControl { if (this.artSlave.navelPiercing >= 1) result.push("Art_Vector_Revamp_Navel_Piercing"); - if (this.artSlave.navelPiercing == 2) + if (this.artSlave.navelPiercing === 2) result.push("Art_Vector_Revamp_Navel_Piercing_Heavy"); } } @@ -1199,23 +1201,23 @@ class RevampedArtControl { if (!this.showPenis || penisSize < 0) return result; - if (canAchieveErection(this.artSlave) && (this.artSlave.chastityPenis != 1)) + if (canAchieveErection(this.artSlave) && (this.artSlave.chastityPenis !== 1)) { result.push("Art_Vector_Revamp_Penis_" + penisSize); if (!this.showPenisPiercings) return result; - if (this.artSlave.dickPiercing == 1) + if (this.artSlave.dickPiercing === 1) result.push("Art_Vector_Revamp_Penis_" + penisSize + "_Piercing"); - else if (this.artSlave.dickPiercing == 2) + else if (this.artSlave.dickPiercing === 2) result.push("Art_Vector_Revamp_Penis_" + penisSize + "_Piercing_Heavy"); } else { result.push("Art_Vector_Revamp_Flaccid_" + penisSize); - if (this.artSlave.chastityPenis == 1) { + if (this.artSlave.chastityPenis === 1) { result.push("Art_Vector_Revamp_Chastity_Cage_" + penisSize); } } @@ -1305,7 +1307,7 @@ class RevampedArtControl { if (this.showNipples) { - var areolaeShape = "Normal"; + let areolaeShape = "Normal"; switch(this.artSlave.areolae) { @@ -1366,14 +1368,14 @@ class RevampedArtControl { size = "Huge"; } - if (this.artSlave.nipplesPiercing == 1) + 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"); } - else if (this.artSlave.nipplesPiercing == 2) + else if (this.artSlave.nipplesPiercing === 2) { if (this.artSlave.boobs < 300) result.push("Art_Vector_Revamp_Boob_None_Piercing_Heavy"); @@ -1381,14 +1383,14 @@ class RevampedArtControl { result.push("Art_Vector_Revamp_Boob_" + size + "_Piercing_Heavy"); } - if (this.artSlave.areolaePiercing == 1) + 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"); } - else if (this.artSlave.areolaePiercing == 2) + else if (this.artSlave.areolaePiercing === 2) { if (this.artSlave.boobs < 300) result.push("Art_Vector_Revamp_Boob_None_Areola_Piercing_Heavy"); @@ -1408,10 +1410,10 @@ class RevampedArtControl { { if (this.artSlave.boobs < 600) { - var artScaleFactor = 0.288539*Math.log(0.106667*this.artSlave.boobs); - var artTranslationX = 270*((-1*artScaleFactor) + 1); - var artTranslationY = 198*((-1*artScaleFactor) + 1);//-198.438*artScaleFactor+203.274; - var artBoobTransform = "matrix(" + artScaleFactor +",0,0," + artScaleFactor + "," + artTranslationX + "," + artTranslationY + ")"; + let artScaleFactor = 0.288539*Math.log(0.106667*this.artSlave.boobs); + let artTranslationX = 270*((-1*artScaleFactor) + 1); + let artTranslationY = 198*((-1*artScaleFactor) + 1);//-198.438*artScaleFactor+203.274; + let artBoobTransform = "matrix(" + artScaleFactor +",0,0," + artScaleFactor + "," + artTranslationX + "," + artTranslationY + ")"; this.boobOutfitArtTransform = artBoobTransform; @@ -1419,19 +1421,19 @@ class RevampedArtControl { } else if (this.artSlave.boobs < 15000) { - var artScaleFactor = 0.155334*Math.log(1.04167*this.artSlave.boobs); - var artTranslationX = 270*((-1.25*artScaleFactor) + 1.25); - var artTranslationY = 198*((-0.8*artScaleFactor) + 0.8);//-198.438*artScaleFactor+203.274; - var artBoobTransform = "matrix(" + artScaleFactor +",0,0," + artScaleFactor + "," + artTranslationX + "," + artTranslationY + ")"; + let artScaleFactor = 0.155334*Math.log(1.04167*this.artSlave.boobs); + let artTranslationX = 270*((-1.25*artScaleFactor) + 1.25); + let artTranslationY = 198*((-0.8*artScaleFactor) + 0.8);//-198.438*artScaleFactor+203.274; + let artBoobTransform = "matrix(" + artScaleFactor +",0,0," + artScaleFactor + "," + artTranslationX + "," + artTranslationY + ")"; this.boobOutfitArtTransform = artBoobTransform; result.push("Art_Vector_Revamp_Boob_Medium_Outfit_Maid"); } else { - var artScaleFactor = 1.56609*Math.log(0.00017373*this.artSlave.boobs); - var artTranslationX = 340*((-1*artScaleFactor) + 1); - var artTranslationY = 153*((-1*artScaleFactor) + 1);//-198.438*artScaleFactor+203.274; - var artBoobTransform = "matrix(" + artScaleFactor +",0,0," + artScaleFactor + "," + artTranslationX + "," + artTranslationY + ")"; + let artScaleFactor = 1.56609*Math.log(0.00017373*this.artSlave.boobs); + let artTranslationX = 340*((-1*artScaleFactor) + 1); + let artTranslationY = 153*((-1*artScaleFactor) + 1);//-198.438*artScaleFactor+203.274; + let artBoobTransform = "matrix(" + artScaleFactor +",0,0," + artScaleFactor + "," + artTranslationX + "," + artTranslationY + ")"; this.boobOutfitArtTransform = artBoobTransform; result.push("Art_Vector_Revamp_Boob_Huge_Outfit_Maid"); @@ -1506,14 +1508,14 @@ class RevampedArtControl { if (!this.showHeadPiercings) return result; - if (this.artSlave.earPiercing == 1) + if (this.artSlave.earPiercing === 1) result.push("Art_Vector_Revamp_Head_Ear_Piercing"); - else if (this.artSlave.earPiercing == 2) + else if (this.artSlave.earPiercing === 2) result.push("Art_Vector_Revamp_Head_Ear_Piercing_Heavy"); - if (this.artSlave.nosePiercing == 1) + if (this.artSlave.nosePiercing === 1) result.push("Art_Vector_Revamp_Head_Nose_Piercing"); - else if (this.artSlave.nosePiercing == 2) + else if (this.artSlave.nosePiercing === 2) result.push("Art_Vector_Revamp_Head_Nose_Piercing_Heavy"); return result; @@ -1532,9 +1534,9 @@ class RevampedArtControl { if (this.showHeadPiercings) { - if (this.artSlave.eyebrowPiercing == 1) + if (this.artSlave.eyebrowPiercing === 1) result.push("Art_Vector_Revamp_Head_Eyebrow_Happy_Piercing"); - else if (this.artSlave.eyebrowPiercing == 2) + else if (this.artSlave.eyebrowPiercing === 2) result.push("Art_Vector_Revamp_Head_Eyebrow_Happy_Piercing_Heavy"); } } @@ -1545,9 +1547,9 @@ class RevampedArtControl { if (this.showHeadPiercings) { - if (this.artSlave.eyebrowPiercing == 1) + if (this.artSlave.eyebrowPiercing === 1) result.push("Art_Vector_Revamp_Head_Eyebrow_Shy_Piercing"); - else if (this.artSlave.eyebrowPiercing == 2) + else if (this.artSlave.eyebrowPiercing === 2) result.push("Art_Vector_Revamp_Head_Eyebrow_Shy_Piercing_Heavy"); } } @@ -1557,9 +1559,9 @@ class RevampedArtControl { if (this.showHeadPiercings) { - if (this.artSlave.eyebrowPiercing == 1) + if (this.artSlave.eyebrowPiercing === 1) result.push("Art_Vector_Revamp_Head_Eyebrow_Closed_Piercing"); - else if (this.artSlave.eyebrowPiercing == 2) + else if (this.artSlave.eyebrowPiercing === 2) result.push("Art_Vector_Revamp_Head_Eyebrow_Closed_Piercing_Heavy"); } } @@ -1569,9 +1571,9 @@ class RevampedArtControl { result.push("Art_Vector_Revamp_Eyes_Angry_Highlights"); if (this.showHeadPiercings) { - if (this.artSlave.eyebrowPiercing == 1) + if (this.artSlave.eyebrowPiercing === 1) result.push("Art_Vector_Revamp_Head_Eyebrow_Angry_Piercing"); - else if (this.artSlave.eyebrowPiercing == 2) + else if (this.artSlave.eyebrowPiercing === 2) result.push("Art_Vector_Revamp_Head_Eyebrow_Angry_Piercing_Heavy"); } } @@ -1606,9 +1608,9 @@ class RevampedArtControl { if (this.showHeadPiercings) { - if (this.artSlave.lipsPiercing == 1) + if (this.artSlave.lipsPiercing === 1) result.push("Art_Vector_Revamp_Head_Mouth_Happy_Piercing"); - else if (this.artSlave.lipsPiercing == 2) + else if (this.artSlave.lipsPiercing === 2) result.push("Art_Vector_Revamp_Head_Mouth_Happy_Piercing_Heavy"); } } @@ -1619,9 +1621,9 @@ class RevampedArtControl { if (this.showHeadPiercings) { - if (this.artSlave.lipsPiercing == 1) + if (this.artSlave.lipsPiercing === 1) result.push("Art_Vector_Revamp_Head_Mouth_Angry_Piercing"); - else if (this.artSlave.lipsPiercing == 2) + else if (this.artSlave.lipsPiercing === 2) result.push("Art_Vector_Revamp_Head_Mouth_Angry_Piercing_Heavy"); } } @@ -1668,7 +1670,7 @@ class RevampedArtControl { if (!this.showHair) return result; - if (this.artSlave.hLength == 0) + if (this.artSlave.hLength === 0) return result; switch(this.artSlave.hStyle) diff --git a/src/debugging/debugJS.js b/src/debugging/debugJS.js index 5e94aaa4a4461bcd9317eedf485eac465eb606ad..69c665ef71d205c5b69f315b2fd28e34e1560fd8 100644 --- a/src/debugging/debugJS.js +++ b/src/debugging/debugJS.js @@ -1,3 +1,4 @@ +/* eslint-disable no-undef */ /* Given an object, this will return an array where for each property of the original object, we include the object {variable: property, oldVal: _oldDiff.property, newVal: _newDiff.property} @@ -17,11 +18,12 @@ window.difference = function difference(o1, o2) { var k, kDiff, diff = {}; for (k in o1) { if (!o1.hasOwnProperty(k)) { - } else if (typeof o1[k] != 'object' || typeof o2[k] != 'object') { + /** FIXME: Empty block statement.eslint(no-empty) */ + } else if (typeof o1[k] !== 'object' || typeof o2[k] !== 'object') { if (!(k in o2) || o1[k] !== o2[k]) { diff[k] = o2[k]; } - } else if (kDiff = difference(o1[k], o2[k])) { + } else if (kDiff = difference(o1[k], o2[k])) { /** FIXME: Expected a conditional expression and instead saw an assignment.eslint(no-cond-assign) */ diff[k] = kDiff; } } @@ -51,11 +53,11 @@ window.diffFlatten = function diffFlatten(data) { } else if (Array.isArray(cur)) { for(var i=0, l=cur.length; i<l; i++) recurse(cur[i], prop + "[" + i + "]"); - if (l == 0) + if (l === 0) result[prop] = []; } else { var isEmpty = true; - for (var p in cur) { + for (let p in cur) { isEmpty = false; recurse(cur[p], prop ? prop+"."+p : p); } @@ -73,7 +75,7 @@ Finds all NaN values anywhere in the State.variables object. Returns an array wi window.findNaN = function findNan() { const flatV = diffFlatten(State.variables); var result = []; - for (var key in flatV) { + for (let key in flatV) { if (Number.isNaN(flatV[key])) { result.push('$$'+key); /* double dollar signs to escape sugarcube markup */ } @@ -105,7 +107,7 @@ App.Debug.dumpGameState = function () { oldHandler(save); } downloadToFile(JSON.stringify(save, null, 2), save.id + ".json", "text/plain"); - } + }; SugarCube.Save.serialize(); } finally { SugarCube.Config.saves.onSave = oldHandler; diff --git a/src/endWeek/saChoosesOwnClothes.js b/src/endWeek/saChoosesOwnClothes.js index 8b1b2e3e80d4cb7de59b7d413f89d89829e70c36..78451c250e5f0cb8b51174fad58f1740bac840e1 100644 --- a/src/endWeek/saChoosesOwnClothes.js +++ b/src/endWeek/saChoosesOwnClothes.js @@ -1,3 +1,5 @@ +/* eslint-disable no-undef */ +/* eslint-disable no-unused-vars */ window.saChoosesOwnClothes = (function() { "use strict"; let V; @@ -62,7 +64,7 @@ window.saChoosesOwnClothes = (function() { r += `${He} <span class="hotpink">loves</span> being able to dress ${himself}, ${neckChoice.text} ${corsetChoice.text} ${clothingChoice.text} `; slave.devotion += 1; - if (V.arcologies[0].FSRestart !== "unset" && slave.choosesOwnChastity == 1) { + if (V.arcologies[0].FSRestart !== "unset" && slave.choosesOwnChastity === 1) { if (slave.vagina > -1 && slave.breedingMark === 1 && slave.chastityVagina === 1) { r += `${He} unfastens ${his} chastity belt knowing full well ${his} role in life is to carry ${his} ${WrittenMaster(slave)}'s children. `; slave.chastityVagina = 0; @@ -100,7 +102,7 @@ window.saChoosesOwnClothes = (function() { let wardrobeTastes = []; let selection; - if(slave.fetish == 'mindbroken') { + if(slave.fetish === 'mindbroken') { if(V.arcologies[0].FSChattelReligionist > 0) { selection = {text: `${he} commonly sees others wearing chattel habits and is drawn to doing so ${himself}.`, clothes: "a chattel habit"}; } else { @@ -161,7 +163,7 @@ window.saChoosesOwnClothes = (function() { selection = {text: `${he} commonly sees others wearing qipaos and is drawn to doing so ${himself}.`, clothes: "a slutty qipao"}; break; case 'genderFund': - if(jsRandom(1,2) == 1) { + if(jsRandom(1,2) === 1) { selection = {text: `${he} commonly sees cheerleaders around and instinctually follows along.`, clothes: jsEither(['a cheerleader outfit', 'a schoolgirl outfit'])}; } else { selection = {text: `${he} commonly sees bunnies around and instinctually follows along.`, clothes: "a bunny outfit"}; @@ -213,7 +215,7 @@ window.saChoosesOwnClothes = (function() { clothing.push({text: `and wears a chattel habit to conform to your arcology's culture.`, clothes: "a chattel habit"}); } /*Chooses clothes according to assignment (no exceptions)*/ - else if(slave.assignment == "be the Nurse") { + else if(slave.assignment === "be the Nurse") { if(slave.energy > 95 || slave.need > 100) { wardrobeAssignment.push({text: `and wears a slutty nurse outfit to make it clear just how much this nurse needs ${his} daily lay.`, clothes: "a slutty nurse outfit"}); } else if(slave.energy > 80) { @@ -228,7 +230,7 @@ window.saChoosesOwnClothes = (function() { } wardrobeAssignment.push({text: `and wears a slutty nurse outfit to show to a little skin as ${he} cares for ${his} patients.`, clothes: "a slutty nurse outfit"}); } - } else if(slave.assignment == "be the Madam") { + } else if(slave.assignment === "be the Madam") { if(slave.energy > 95 || slave.need > 100) { wardrobeAssignment.push({text: `and wears a slutty suit to be certain nothing blocks ${him} from getting the sex ${he} needs.`, clothes: "slutty business attire"}); } else if(slave.energy > 80) { @@ -243,7 +245,7 @@ window.saChoosesOwnClothes = (function() { } wardrobeAssignment.push({text: `and wears a slutty suit to entice and arouse while still looking managerial.`, clothes: "slutty business attire"}); } - } else if(slave.assignment == "be the Milkmaid") { + } else if(slave.assignment === "be the Milkmaid") { if(slave.energy > 95 || slave.need > 100) { if(isItemAccessible("body oil")) { wardrobeAssignment.push({text: `and coats ${himself} with oil to better slip between ${his} cows as ${he} pleasures them.`, clothes: "body oil"}); @@ -272,7 +274,7 @@ window.saChoosesOwnClothes = (function() { } } } - } else if(slave.assignment == "be your Head Girl") { + } else if(slave.assignment === "be your Head Girl") { if(isItemAccessible("a military uniform")) { wardrobeAssignment.push({text: `and wears a military uniform to give ${him} that extra touch of authority.`, clothes: "a military uniform"}); } @@ -294,7 +296,7 @@ window.saChoosesOwnClothes = (function() { } else { wardrobeAssignment.push({text: `and wears a slutty suit to give ${him} an extra touch of authority while keeping ${his} crotch available.`, clothes: "slutty business attire"}); } - } else if(slave.assignment == "be the Schoolteacher") { + } else if(slave.assignment === "be the Schoolteacher") { if(isItemAccessible("nice business attire")) { wardrobeAssignment.push({text: `and wears a handsome suit to give ${him} that teacherly authority.`, clothes: "nice business attire"}); } @@ -310,7 +312,7 @@ window.saChoosesOwnClothes = (function() { if(isItemAccessible("a maternity dress") && slave.belly >= 10000) { wardrobeAssignment.push({text: `and settles for a comfortable maternity dress to support ${his} middle while ${he} lectures in front of the class all week.`, clothes: "a maternity dress"}); } - } else if(slave.assignment == "be the Wardeness") { + } else if(slave.assignment === "be the Wardeness") { if(isItemAccessible("battledress")) { wardrobeAssignment.push({text: `and dons battledress, the better to intimidate the prisoners.`, clothes: "battledress"}); } @@ -329,7 +331,7 @@ window.saChoosesOwnClothes = (function() { if(isItemAccessible("stretch pants and a crop-top")) { wardrobeAssignment.push({text: `and decides to take it easy by slipping into some stretch pants. They come off just as quickly as they come on, just in case.`, clothes: "stretch pants and a crop-top"}); } - } else if(slave.assignment == "be the Attendant") { + } else if(slave.assignment === "be the Attendant") { wardrobeAssignment.push({text: `and wears a string bikini, since it's all ${he} can wear that won't be ruined by all the moisture in the spa.`, clothes: "a string bikini"}); if(isItemAccessible("a monokini")) { wardrobeAssignment.push({text: `and wears an one-piece swimsuit, since it's all ${he} can wear that won't be ruined by all the moisture in the spa.`, clothes: "a monokini"}); @@ -341,7 +343,7 @@ window.saChoosesOwnClothes = (function() { wardrobeAssignment.push({text: `and wears a modest swimsuit, since it's all ${he} can wear that won't be ruined by all the moisture in the spa.`, clothes: "a burkini"}); } wardrobeAssignment.push({text: `but decides to go nude, since ${he}'ll be spending so much time in the water.`, clothes: "no clothing"}); - } else if(slave.assignment == "rest") { + } else if(slave.assignment === "rest") { wardrobeAssignment.push({text: `and wears a comfortable t-shirt and cutoffs to relax.`, clothes: "cutoffs and a t-shirt"}); wardrobeAssignment.push({text: `and slips into some attractive lingerie to enjoy ${himself} as ${he} unwinds.`, clothes: "attractive lingerie"}); wardrobeAssignment.push({text: `and slips into nothing more than a pair of panties.`, clothes: "panties"}); @@ -352,10 +354,10 @@ window.saChoosesOwnClothes = (function() { if(isItemAccessible("attractive lingerie for a pregnant woman") && slave.belly >= 1500) { wardrobeAssignment.push({text: `and slips into some attractive lingerie to enjoy ${himself} as ${he} unwinds.`, clothes: "attractive lingerie for a pregnant woman"}); } - if(slave.fetish == "submissive") { + if(slave.fetish === "submissive") { wardrobeAssignment.push({text: `and decides the best way to relax is tied up nice and tight.`, clothes: "shibari ropes"}); } - } else if(slave.assignment == "get milked" || slave.assignment == "work in the dairy") { + } else if(slave.assignment === "get milked" || slave.assignment === "work in the dairy") { wardrobeAssignment.push({text: `and wears sturdy lingerie to offer the best support to ${his} sore, milk-filled udders.`, clothes: "attractive lingerie"}); if(isItemAccessible("attractive lingerie for a pregnant woman") && slave.belly >= 1500) { wardrobeAssignment.push({text: `and wears lingerie designed for milky mothers.`, clothes: "attractive lingerie for a pregnant woman"}); @@ -368,7 +370,7 @@ window.saChoosesOwnClothes = (function() { wardrobeAssignment.push({text: `but goes nude. There's no time for clothing, ${his} udders need to be drained now!`, clothes: "no clothing"}); } wardrobeAssignment.push({text: `and dons a slutty outfit. If ${his} breasts are going to hang out, might as well wear something to complement them.`, clothes: "a slutty outfit"}); - } else if(slave.assignment == "guard you") { + } else if(slave.assignment === "guard you") { wardrobeAssignment.push({text: `and wears a bodysuit to show off ${his} curves without hindering ${his} deadliness.`, clothes: "a comfortable bodysuit"}); if(isItemAccessible("a military uniform")) { wardrobeAssignment.push({text: `and wears a military uniform to look the part of the honor guard.`, clothes: "a military uniform"}); @@ -392,7 +394,7 @@ window.saChoosesOwnClothes = (function() { } } else { /*Chooses clothes according to assignment (exceptions allowed)*/ - if(slave.assignment == "recruit girls") { + if(slave.assignment === "recruit girls") { if(isItemAccessible("a mini dress")) { wardrobeAssignment.push({text: `and wears a flattering mini dress to appear sexy and carefree before those desperately seeking a better life.`, clothes: "a mini dress"}); } @@ -414,7 +416,7 @@ window.saChoosesOwnClothes = (function() { if(isItemAccessible("conservative clothing")) { wardrobeAssignment.push({text: `and wears normal clothing to suggest to those desperately seeking a better life that they can find it here with you.`, clothes: "conservative clothing"}); } - } else if(slave.assignment == "be the DJ") { + } else if(slave.assignment === "be the DJ") { wardrobeAssignment.push({text: `and wears clubslut netting to look like the perfect easy club girl.`, clothes: "clubslut netting"}); wardrobeAssignment.push({text: `and wears cutoffs and a t-shirt to look like the perfect easy club girl.`, clothes: "cutoffs and a t-shirt"}); wardrobeAssignment.push({text: `and wears the slutty outfit ${he} can find to look like the perfect easy club girl.`, clothes: "a slutty outfit"}); @@ -426,40 +428,40 @@ window.saChoosesOwnClothes = (function() { if(isItemAccessible("harem gauze")) { wardrobeAssignment.push({text: `and wears the finest available silks to give ${his} moves a sensual grace.`, clothes: "harem gauze"}); } - } else if(slave.assignment == "be your Concubine") { + } else if(slave.assignment === "be your Concubine") { wardrobeAssignment.push({text: `and goes naked, since it's ${his} honored role to be the chief object of your desire.`, clothes: "no clothing"}); wardrobeAssignment.push({text: `and dresses as a slutty nurse as your genitals are always in need of ${his} special treatment.`, clothes: "a slutty nurse outfit"}); wardrobeAssignment.push({text: `and dresses as a schoolgirl in the hopes that you teach ${him} how to be a woman.`, clothes: "a schoolgirl outfit"}); wardrobeAssignment.push({text: `and dresses as a cheerleader so ${he} may cheer you on as you blow ${his} mind.`, clothes: "a cheerleader outfit"}); - if(player.dick == 1) { + if(player.dick === 1) { wardrobeAssignment.push({text: `and dresses as a slutty maid as you always come home with a stiff package that needs a thorough polishing.`, clothes: "a slutty maid outfit"}); } wardrobeAssignment.push({text: `and, since you personally see that ${he} never goes hungry, ${he} dresses like the sex demoness ${he} is.`, clothes: "a succubus outfit"}); - if(isItemAccessible("attractive lingerie for a pregnant woman") && slave.belly >= 10000 && slave.pregSource == -1) { + if(isItemAccessible("attractive lingerie for a pregnant woman") && slave.belly >= 10000 && slave.pregSource === -1) { wardrobeAssignment.push({text: `and chooses attractive lingerie to showcase the body you've given ${him} in the hopes that you ravish ${him}.`, clothes: "attractive lingerie for a pregnant woman"}); } - if(slave.toyHole == "dick" && canPenetrate(slave)) { + if(slave.toyHole === "dick" && canPenetrate(slave)) { wardrobeAssignment.push({text: `and slips into a scalemail bikini so ${he} can act the role of your conqueror as ${he} bends you over.`, clothes: "a scalemail bikini"}); } - } else if(slave.assignment == "be a subordinate slave") { + } else if(slave.assignment === "be a subordinate slave") { wardrobeAssignment.push({text: `but gives up and goes naked after the other slaves constantly tear whatever ${he}'s wearing off ${him}.`, clothes: "no clothing"}); if(isItemAccessible("Western clothing")) { wardrobeAssignment.push({text: `and chooses a pair of crotchless chaps so your other slaves don't have to waste time undressing ${him}.`, clothes: "Western clothing"}); } - if(slave.fetish == "submissive") { + if(slave.fetish === "submissive") { wardrobeAssignment.push({text: `and chooses to slip on a pair of spats and a tank top in the hopes that ${he} gets to be a violated schoolgirl.`, clothes: "spats and a tank top"}); wardrobeAssignment.push({text: `and chooses to slip on a schoolgirl outfit in the hope that ${he} gets held down and raped.`, clothes: "a schoolgirl outfit"}); wardrobeAssignment.push({text: `and chooses to wear the sluttiest outfit available to make it clear what ${he} wants done to ${him}.`, clothes: "a slutty outfit"}); } - } else if(slave.assignment == "work a glory hole") { + } else if(slave.assignment === "work a glory hole") { wardrobeAssignment.push({text: `but doesn't bother wearing anything, since no one can see ${his} clothing when ${he}'s immured inside a glory hole.`, clothes: "no clothing"}); - } else if(slave.assignment == "take classes" || slave.assignment == "learn in the schoolroom") { + } else if(slave.assignment === "take classes" || slave.assignment === "learn in the schoolroom") { wardrobeAssignment.push({text: `and wears a schoolgirl outfit, since it seems most appropriate.`, clothes: "a schoolgirl outfit"}); wardrobeAssignment.push({text: `and wears a cheerleader outfit, since ${he} might as well be one of the popular girls.`, clothes: "a cheerleader outfit"}); if(isItemAccessible("conservative clothing")) { wardrobeAssignment.push({text: `and wears normal clothing to not distract from ${his} lessons.`, clothes: "conservative clothing"}); } - } else if((slave.assignment == "whore") || (slave.assignment == "work in the brothel")) { + } else if((slave.assignment === "whore") || (slave.assignment === "work in the brothel")) { if(slave.belly >= 5000 && isItemAccessible("attractive lingerie for a pregnant woman")) { wardrobeAssignment.push({text: `and wears pretty lingerie to show off ${his} merchandise and accentuate ${his} pregnancy while still looking a little classy.`, clothes: "attractive lingerie for a pregnant woman"}); } @@ -480,7 +482,7 @@ window.saChoosesOwnClothes = (function() { if(isItemAccessible("a mini dress")) { wardrobeAssignment.push({text: `and wears a flattering mini dress to really strut ${his} stuff.`, clothes: "a mini dress"}); } - } else if(slave.assignment == "serve the public" || slave.assignment == "serve in the club") { + } else if(slave.assignment === "serve the public" || slave.assignment === "serve in the club") { wardrobeAssignment.push({text: `and wears string lingerie to look fun and fuckable.`, clothes: "a string bikini"}); wardrobeAssignment.push({text: `and throws together the sluttiest outfit since if you're going to slut you might as well go all out.`, clothes: "a slutty outfit"}); wardrobeAssignment.push({text: `and tosses on a slutty suit that screams ${he} needs a good fuck after a long day.`, clothes: "slutty business attire"}); @@ -493,7 +495,7 @@ window.saChoosesOwnClothes = (function() { if(slave.bellyPreg >= 10000) { wardrobeAssignment.push({text: `and struggles into a schoolgirl outfit. ${His} gravid belly just screams that ${he} is a slutty little student who cares more for dick than lessons.`, clothes: "a succubus outfit"}); } - } else if(slave.assignment == "be a servant" || slave.assignment == "work as a servant") { + } else if(slave.assignment === "be a servant" || slave.assignment === "work as a servant") { if(slave.energy > 95 || slave.need > 100) { wardrobeAssignment.push({text: `and wears a skimpy maid outfit hoping that someone sneaks up behind ${him} as ${he} works and fulfills ${his} desires.`, clothes: "a slutty maid outfit"}); wardrobeAssignment.push({text: `and wears nothing more than an apron in the hopes that someone sneaks up behind ${him} as ${he} works and fulfills ${his} desires.`, clothes: "an apron"}); @@ -543,7 +545,7 @@ window.saChoosesOwnClothes = (function() { } if(V.arcologies[0].FSPaternalist > 0) { wardrobeFS.push({text: `and wears conservative clothing, as permitted by your paternalism.`, clothes: "conservative clothing"}); - if(isItemAccessible("a hijab and blouse") && slave.race == "middle eastern") { + if(isItemAccessible("a hijab and blouse") && slave.race === "middle eastern") { wardrobeFS.push({text: `and wears very conservative clothing, as permitted by your paternalism.`, clothes: "a hijab and blouse"}); } if(isItemAccessible("stretch pants and a crop-top")) { @@ -635,14 +637,14 @@ window.saChoosesOwnClothes = (function() { } } if(V.arcologies[0].FSSupremacist > 0) { - if(V.arcologies[0].FSSupremacistRace == "white") { + if(V.arcologies[0].FSSupremacistRace === "white") { if(isItemAccessible("a dirndl")) { wardrobeFS.push({text: `and wears one of the beautiful folk costumes of the white race.`, clothes: "a dirndl"}); } if(isItemAccessible("lederhosen")) { wardrobeFS.push({text: `and wears one of the beautiful folk costumes of the white race.`, clothes: "lederhosen"}); } - } else if(V.arcologies[0].FSSupremacistRace == "asian") { + } else if(V.arcologies[0].FSSupremacistRace === "asian") { if(isItemAccessible("a biyelgee costume")) { wardrobeFS.push({text: `and wears one of the beautiful folk costumes of the asian race.`, clothes: "a biyelgee costume"}); } @@ -657,7 +659,7 @@ window.saChoosesOwnClothes = (function() { /*Chooses clothes according to fetishes, quirks, etc.*/ if(slave.attrXY > 70) { - if(slave.attrKnown == 1) { + if(slave.attrKnown === 1) { wardrobeTastes.push({text: `and wears a schoolgirl outfit to show off a some T&A to attract boys.`, clothes: "a schoolgirl outfit"}); wardrobeTastes.push({text: `and wears nothing but pretty lingerie to attract boys.`, clothes: "attractive lingerie"}); wardrobeTastes.push({text: `and selects a slutty outfit that's sure to have men drooling.`, clothes: "a slutty outfit"}); @@ -686,7 +688,7 @@ window.saChoosesOwnClothes = (function() { } } if(slave.attrXX > 70) { - if(slave.attrKnown == 1) { + if(slave.attrKnown === 1) { if(isItemAccessible("a slave gown")) { wardrobeTastes.push({text: `and wears a fashionable gown, since girls appreciate nice clothes.`, clothes: "a slave gown"}); } @@ -715,38 +717,38 @@ window.saChoosesOwnClothes = (function() { } /* quirks n flaws */ - if(slave.behavioralFlaw == "arrogant") { + if(slave.behavioralFlaw === "arrogant") { if(isItemAccessible("a ball gown")) { wardrobeTastes.push({text: `and chooses a formal dress that makes ${him} feel like royalty.`, clothes: "a ball gown"}); } - } else if(slave.behavioralFlaw == "devout") { + } else if(slave.behavioralFlaw === "devout") { wardrobeTastes.push({text: `and wears something more appropriate for a monastery than a whorehouse.`, clothes: "a penitent nuns habit"}); } - if(slave.behavioralQuirk == "sinful") { + if(slave.behavioralQuirk === "sinful") { wardrobeTastes.push({text: `and dresses up like a succubus because it makes ${him} feel naughty.`, clothes: "a succubus outfit"}); - } else if(slave.behavioralQuirk == "fitness") { + } else if(slave.behavioralQuirk === "fitness") { wardrobeTastes.push({text: `and wears spats and a tank top to give ${himself} a sporty look.`, clothes: "spats and a tank top"}); } - if(slave.sexualFlaw == "shamefast") { + if(slave.sexualFlaw === "shamefast") { wardrobeTastes.push({text: `and chooses an outfit that covers ${him} up as much as possible.`, clothes: "a hijab and abaya"}); - } else if(slave.sexualFlaw == "breeder") { + } else if(slave.sexualFlaw === "breeder") { if(isItemAccessible("attractive lingerie for a pregnant woman")) { wardrobeTastes.push({text: `and wears lingerie designed to accommodate pregnancies, hoping that others get the hint.`, clothes: "attractive lingerie for a pregnant woman"}); } - } else if(slave.sexualFlaw == "malicious") { + } else if(slave.sexualFlaw === "malicious") { if(isItemAccessible("a schutzstaffel uniform")) { wardrobeTastes.push({text: `and chooses an outfit that is commonly associated with wanton cruelty.`, clothes: "a schutzstaffel uniform"}); wardrobeTastes.push({text: `and chooses a skimpy outfit that is commonly associated with wanton cruelty.`, clothes: "a slutty schutzstaffel uniform"}); } } - if(slave.sexualQuirk == "romantic") { + if(slave.sexualQuirk === "romantic") { if(isItemAccessible("a halter top dress")) { wardrobeTastes.push({text: `and dresses up like ${he}'s about to go on a date.`, clothes: "a halter top dress"}); } - } else if(slave.sexualQuirk == "tease") { + } else if(slave.sexualQuirk === "tease") { if(isItemAccessible("kitty lingerie")) { wardrobeTastes.push({text: `and wears a set of provocatively designed lingerie.`, clothes: "kitty lingerie"}); } @@ -773,11 +775,11 @@ window.saChoosesOwnClothes = (function() { } /* fetishes */ - if(slave.fetishKnown == 1) { - if(slave.fetish == "submissive") { + if(slave.fetishKnown === 1) { + if(slave.fetish === "submissive") { wardrobeTastes.push({text: `and wears restrictive latex to encourage others to dominate ${him}.`, clothes: "restrictive latex"}); wardrobeTastes.push({text: `and wears shibari ropes to encourage others to dominate ${him}.`, clothes: "shibari ropes"}); - } else if(slave.fetish == "dom") { + } else if(slave.fetish === "dom") { if(isItemAccessible("nice business attire")) { wardrobeTastes.push({text: `and wears a handsome suit, since ${he} likes other slaves to look up to ${him}.`, clothes: "nice business attire"}); } @@ -785,29 +787,29 @@ window.saChoosesOwnClothes = (function() { wardrobeTastes.push({text: `and wears a full body latex catsuit to look the part of the whip cracking dom.`, clothes: "a latex catsuit"}); } wardrobeTastes.push({text: `and wears a scalemail bikini to make ${himself} look tough.`, clothes: "a scalemail bikini"}); - } else if(slave.fetish == "masochist") { + } else if(slave.fetish === "masochist") { wardrobeTastes.push({text: `and wears painfully restrictive bondage gear, since ${he} likes the torment.`, clothes: "uncomfortable straps"}); if(isItemAccessible("chains")) { wardrobeTastes.push({text: `and wears painfully tight chains, since ${he} likes the torment.`, clothes: "chains"}); } - } else if(slave.fetish == "sadist") { + } else if(slave.fetish === "sadist") { if(isItemAccessible("a slave gown")) { wardrobeTastes.push({text: `and wears an elegant gown, since ${he} thinks it makes ${him} look the part of the femme fatale.`, clothes: "a slave gown"}); } wardrobeTastes.push({text: `and wears a scalemail bikini, since ${he} thinks it makes ${him} look fierce.`, clothes: "a scalemail bikini"}); - } else if(slave.fetish == "cumslut") { + } else if(slave.fetish === "cumslut") { wardrobeTastes.push({text: `and wears cutoffs and a t-shirt, because the fun yet relatively conservative outfit seems to encourage others to ask ${him} for blowjobs.`, clothes: "cutoffs and a t-shirt"}); - } else if(slave.fetish == "humiliation") { + } else if(slave.fetish === "humiliation") { wardrobeTastes.push({text: `and wears leather straps with rings over ${his} private parts because ${he} enjoys the embarrassment such a humiliating outfit causes ${him}.`, clothes: "uncomfortable straps"}); - } else if(slave.fetish == "buttslut") { + } else if(slave.fetish === "buttslut") { wardrobeTastes.push({text: `and wears nothing other than slutty bangles, because ${he} likes to catch the eye without putting anything between cocks and ${his} rear end.`, clothes: "slutty jewelry"}); wardrobeTastes.push({text: `and wears nothing other than an apron, because ${he} likes to catch the eye without putting anything between cocks and ${his} rear end.`, clothes: "an apron"}); - } else if(slave.fetish == "pregnancy") { + } else if(slave.fetish === "pregnancy") { wardrobeTastes.push({text: `and wears a short maid dress, because ${he} wants to look motherly and fuckable at the same time.`, clothes: "a slutty maid outfit"}); if(isItemAccessible("a maternity dress") && canGetPregnant(slave)) { wardrobeTastes.push({text: `and wears a maternity dress in the hope someone fills out its middle.`, clothes: "a maternity dress"}); } - } else if(slave.fetish == "boobs") { + } else if(slave.fetish === "boobs") { wardrobeTastes.push({text: `and wears a cheerleader outfit, since ${he} loves the way it hugs ${his} tits as ${he} moves.`, clothes: "a cheerleader outfit"}); if(isItemAccessible("a monokini")) { wardrobeTastes.push({text: `and wears a monokini, since ${he} loves how it leaves ${his} breasts totally bare.`, clothes: "a monokini"}); @@ -824,10 +826,10 @@ window.saChoosesOwnClothes = (function() { wardrobeTastes.push({text: `and wears nothing but a pair of panties so ${his} tits can bounce freely.`, clothes: "panties"}); } } else { - if(slave.fetish == "submissive") { + if(slave.fetish === "submissive") { wardrobeTastes.push({text: `and strangely opts for restrictive latex.`, clothes: "restrictive latex"}); wardrobeTastes.push({text: `and strangely opts for shibari ropes.`, clothes: "shibari ropes"}); - } else if(slave.fetish == "dom") { + } else if(slave.fetish === "dom") { if(isItemAccessible("nice business attire")) { wardrobeTastes.push({text: `and wears a handsome suit; ${he} seems to think highly of ${himself} in it.`, clothes: "nice business attire"}); } @@ -835,29 +837,29 @@ window.saChoosesOwnClothes = (function() { wardrobeTastes.push({text: `and wears a full body latex catsuit; there is a strange look on ${his} face as ${he} wears it.`, clothes: "a latex catsuit"}); } wardrobeTastes.push({text: `and wears a scalemail bikini; ${he} keeps flexing and acting tough to ${himself}.`, clothes: "a scalemail bikini"}); - } else if(slave.fetish == "masochist") { + } else if(slave.fetish === "masochist") { wardrobeTastes.push({text: `and strangely opts for painfully restrictive bondage gear.`, clothes: "uncomfortable straps"}); if(isItemAccessible("chains")) { wardrobeTastes.push({text: `and strangely opts for painfully tight chains.`, clothes: "chains"}); } - } else if(slave.fetish == "sadist") { + } else if(slave.fetish === "sadist") { if(isItemAccessible("a slave gown")) { wardrobeTastes.push({text: `and wears an elegant gown for some reason.`, clothes: "a slave gown"}); } wardrobeTastes.push({text: `and wears a scalemail bikini; an odd choice.`, clothes: "a scalemail bikini"}); - } else if(slave.fetish == "cumslut") { + } else if(slave.fetish === "cumslut") { wardrobeTastes.push({text: `and wears cutoffs and a t-shirt; ${he} can't stop licking ${his} lips.`, clothes: "cutoffs and a t-shirt"}); - } else if(slave.fetish == "humiliation") { + } else if(slave.fetish === "humiliation") { wardrobeTastes.push({text: `and strangely opts for leather straps with rings over ${his} private parts.`, clothes: "uncomfortable straps"}); - } else if(slave.fetish == "buttslut") { + } else if(slave.fetish === "buttslut") { wardrobeTastes.push({text: `and wears nothing other than slutty bangles, an odd choice; ${his} ass is completely exposed.`, clothes: "slutty jewelry"}); wardrobeTastes.push({text: `and wears nothing other than an apron, an odd choice; ${his} ass is completely exposed.`, clothes: "an apron"}); - } else if(slave.fetish == "pregnancy") { + } else if(slave.fetish === "pregnancy") { wardrobeTastes.push({text: `and wears a short maid dress; you frequently notice ${him} observing ${his} stomach.`, clothes: "a slutty maid outfit"}); if(isItemAccessible("a maternity dress") && canGetPregnant(slave)) { wardrobeTastes.push({text: `and wears a maternity dress even though ${he} isn't pregnant.`, clothes: "a maternity dress"}); } - } else if(slave.fetish == "boobs") { + } else if(slave.fetish === "boobs") { wardrobeTastes.push({text: `and wears a cheerleader outfit; ${he} seems to enjoy jiggling ${his} breasts in it.`, clothes: "a cheerleader outfit"}); if(isItemAccessible("a monokini")) { wardrobeTastes.push({text: `and strangely decides to wear a monokini, which leaves ${his} breasts totally bare.`, clothes: "a monokini"}); @@ -906,11 +908,11 @@ window.saChoosesOwnClothes = (function() { wardrobeTastes.push({text: `and wears string lingerie to show off ${his} body.`, clothes: "a string bikini"}); } - if(slave.nationality == "Canadian") { + if(slave.nationality === "Canadian") { if(isItemAccessible("a mounty outfit")) { wardrobeTastes.push({text: `and chooses an outfit that makes ${him} feel oddly nostalgic.`, clothes: "a mounty outfit"}); } - } else if(slave.nationality == "Japanese") { + } else if(slave.nationality === "Japanese") { if(isItemAccessible("a kimono")) { wardrobeTastes.push({text: `and chooses an outfit that makes ${him} feel oddly nostalgic.`, clothes: "a kimono"}); } @@ -943,30 +945,30 @@ window.saChoosesOwnClothes = (function() { function todaysShoes(slave) { let shoes = []; - if(slave.fetish == 'mindbroken') { - if(slave.amp != 1 && slave.heels == 1) { + if(slave.fetish === 'mindbroken') { + if(slave.amp !== 1 && slave.heels === 1) { shoes.push({text: `${He} finds ${he} can inexplicably walk if ${he} wears heels; a daily lesson for ${him}, as ${he} forgets shortly after leaving.`, shoes: jsEither(["boots", "extreme heels", "heels", "pumps"])}); } shoes.push({text: `${He} vaguely remembers putting things on ${his} feet, so ${he} does.`, shoes: jsEither(["boots", "extreme heels", "flats", "heels", "pumps"])}); shoes.push({text: `${He} entered without shoes, and will leave the same.`, shoes: "none"}); } else if(slave.devotion <= 20) { - if(slave.heels == 0) { + if(slave.heels === 0) { shoes.push({text: `and wears comfortable flats,`, shoes: "flats"}); } else { shoes.push({text: `and angrily wears the heels ${he} needs to walk,`, shoes: "heels"}); } } else { - if(slave.fetishKnown == 1 && slave.fetish == "dom") { + if(slave.fetishKnown === 1 && slave.fetish === "dom") { shoes.push({text: `${He} wears boots to look like a proper dominant.`, shoes: "boots"}); - } else if(slave.fetishKnown == 1 && slave.fetish == "sadist") { + } else if(slave.fetishKnown === 1 && slave.fetish === "sadist") { shoes.push({text: `${He} wears boots, since ${he} thinks they make ${him} look dangerous.`, shoes: "boots"}); - } else if(slave.fetishKnown == 1 && slave.fetish == "masochist") { + } else if(slave.fetishKnown === 1 && slave.fetish === "masochist") { shoes.push({text: `${He} wears painfully tall heels, since ${he} enjoys the twinge of pain with each step.`, shoes: "extreme heels"}); - } else if(slave.heels == 1) { + } else if(slave.heels === 1) { shoes.push({text: `${He} wears the heels ${he} needs to walk.`, shoes: "heels"}); - } else if(slave.fetishKnown == 1 && slave.fetish == "pregnancy" && slave.bellyPreg >= 500) { + } else if(slave.fetishKnown === 1 && slave.fetish === "pregnancy" && slave.bellyPreg >= 500) { shoes.push({text: `${He} goes barefoot to complement ${his} pregnancy.`, shoes: "none"}); - } else if(slave.fetishKnown == 1 && slave.fetish == "none") { + } else if(slave.fetishKnown === 1 && slave.fetish === "none") { shoes.push({text: `${He} wears comfortable flats, since ${he} doesn't have a fetish to show off.`, shoes: "flats"}); } else if(slave.actualAge < 13){ shoes.push({text: `${He} puts on boots so ${he} can stomp around.`, shoes: "boots"}); @@ -987,9 +989,9 @@ window.saChoosesOwnClothes = (function() { let neck = []; if(slave.fetish === 'mindbroken') { - + /** FIXME: Empty block statement.eslint(no-empty) */ } else if(slave.devotion <= 20) { - + /** FIXME: Empty block statement.eslint(no-empty) */ } else { if(V.arcologies[0].FSEgyptianRevivalist > 0) { neck.push({text: `dons a wesekh to support your ancient Egyptian pretensions,`, collar: "ancient Egyptian"}); @@ -998,7 +1000,7 @@ window.saChoosesOwnClothes = (function() { neck.push({text: `dons a tight steel collar around ${his} neck,`, collar: "tight steel"}); neck.push({text: `dons a painful leather collar,`, collar: "uncomfortable leather"}); neck.push({text: `dons a painfully tight neck corset,`, collar: "neck corset"}); - } else if(slave.fetish === "pregnancy" && (canGetPregnant(slave) || slave.pregKnown == 1)) { + } else if(slave.fetish === "pregnancy" && (canGetPregnant(slave) || slave.pregKnown === 1)) { neck.push({text: `dons a digital display that tells everything about ${his} womb,`, collar: "preg biometrics"}); } else if(slave.fetish === "boobs" && slave.boobs >= 1000) { neck.push({text: `dons a cowbell to draw attention to ${his} luscious udders,`, collar: "leather with cowbell"}); @@ -1027,19 +1029,19 @@ window.saChoosesOwnClothes = (function() { belly.push({text: "", bellyAccessory: slave.bellyAccessory}); /*compatibility for no output, will likely get deprecated in the future as content is added*/ } } else if(slave.devotion <= 20) { - if(slave.belly > 10000 && (slave.pregAdaptation*800 <= slave.belly) && slave.bellyAccessory != "a support band"){ + if(slave.belly > 10000 && (slave.pregAdaptation*800 <= slave.belly) && slave.bellyAccessory !== "a support band"){ belly.push({text: `slips a pregnancy support band around ${his} middle to help alleviate some of the discomfort,`, bellyAccessory: "a support band"}); - } else if (slave.belly < 8000 && slave.bellyAccessory == "a support band") { + } else if (slave.belly < 8000 && slave.bellyAccessory === "a support band") { belly.push({text: `removes ${his} support band since ${he} no longer needs it,`, bellyAccessory: "none"}); } } else { - if(V.arcologies[0].FSRepopulationFocus > 0 && slave.belly < 1500 && slave.sexualFlaw != "breeder") { + if(V.arcologies[0].FSRepopulationFocus > 0 && slave.belly < 1500 && slave.sexualFlaw !== "breeder") { if(slave.weight > 130) { belly.push({text: `struggles to fit a fake pregnant belly around ${his} gut before giving up and hoping ${he} can pass as fecund,`, bellyAccessory: "none"}); } else { belly.push({text: `straps on a fake pregnant belly to fit in with all the other pregnant girls,`, bellyAccessory: jsEither(["a small empathy belly", "a medium empathy belly", "a large empathy belly"])}); } - } else if(slave.belly < 1500 && slave.fetish == "pregnancy" && isItemAccessible("a small empathy belly") && slave.sexualFlaw != "breeder" && slave.weight <= 130) { + } else if(slave.belly < 1500 && slave.fetish === "pregnancy" && isItemAccessible("a small empathy belly") && slave.sexualFlaw !== "breeder" && slave.weight <= 130) { if(slave.fetishStrength <= 30) { belly.push({text: `straps on a 1st trimester belly to sate ${his} curiosity,`, bellyAccessory: "a small empathy belly"}); belly.push({text: `straps on a 2nd trimester belly to sate ${his} curiosity,`, bellyAccessory: "a medium empathy belly"}); @@ -1049,20 +1051,20 @@ window.saChoosesOwnClothes = (function() { } else if(slave.fetishStrength > 95) { belly.push({text: `straps on the largest belly ${he} can find to satisfy ${his} pregnancy fetish,`, bellyAccessory: "a huge empathy belly"}); } - } else if(slave.belly > 10000 && (slave.pregAdaptation*1200 <= slave.belly) && slave.bellyAccessory != "a support band"){ + } else if(slave.belly > 10000 && (slave.pregAdaptation*1200 <= slave.belly) && slave.bellyAccessory !== "a support band"){ belly.push({text: `slips a pregnancy support band around ${his} middle to better handle ${his} fecund mound,`, bellyAccessory: "a support band"}); - } else if(empathyBellies.includes(slave.bellyAccessory) && slave.fetish != "pregnancy") { + } else if(empathyBellies.includes(slave.bellyAccessory) && slave.fetish !== "pregnancy") { belly.push({text: `removes ${his} fake belly, since ${he} dislikes it,`, bellyAccessory: "none"}); - } else if(empathyBellies.includes(slave.bellyAccessory) && slave.sexualFlaw == "breeder") { + } else if(empathyBellies.includes(slave.bellyAccessory) && slave.sexualFlaw === "breeder") { belly.push({text: `pulls ${his} fake belly off, disgusted by it,`, bellyAccessory: "none"}); - } else if (slave.belly < 8000 && slave.bellyAccessory == "a support band") { + } else if (slave.belly < 8000 && slave.bellyAccessory === "a support band") { belly.push({text: `removes ${his} support band since ${he} no longer needs it,`, bellyAccessory: "none"}); } else { belly.push({text: "", bellyAccessory: slave.bellyAccessory}); /*compatibility for no output, will likely get deprecated in the future as content is added*/ } } return jsEither(belly); - }; + } return saChoosesOwnClothes; diff --git a/src/endWeek/saRest.js b/src/endWeek/saRest.js index 588bdad618ac4b68ba82f2275f6d6c97c87f1b69..87ebcf033c35d8cda751f3c90d094ac289e22572 100644 --- a/src/endWeek/saRest.js +++ b/src/endWeek/saRest.js @@ -1,3 +1,5 @@ +/* eslint-disable no-undef */ +/* eslint-disable no-unused-vars */ window.saRest = /** @param {App.Entity.SlaveState} slave */ function saRest(slave) { var pronouns = getPronouns(slave); @@ -9,7 +11,7 @@ window.saRest = /** @param {App.Entity.SlaveState} slave */ function saRest(slav if (slave.fuckdoll > 0) { t += ` ${He} has nothing to do but `; - if (slave.amp == 0) { + if (slave.amp === 0) { t += `lie `; } else { t += `stand `; @@ -25,13 +27,13 @@ window.saRest = /** @param {App.Entity.SlaveState} slave */ function saRest(slav if (!(canHear(slave))) { t += ` Since ${he} is deaf, the hustle and bustle of daily life in the penthouse <span class='green'>didn't bother ${him} at all.</span>`; slave.health += 3; - } else if ((slave.hears == -1 && slave.earwear != "hearing aids") || (slave.hears == 0 && slave.earwear == "muffling ear plugs")) { + } else if ((slave.hears === -1 && slave.earwear !== "hearing aids") || (slave.hears === 0 && slave.earwear === "muffling ear plugs")) { t += ` Since ${he} is hard of hearing, the hustle and bustle of daily life in the penthouse <span class='green'>didn't disturb ${his} rest as much.</span>`; slave.health += 1; } } - if (slave.fuckdoll == 0 && slave.fetish != "mindbroken") { + if (slave.fuckdoll === 0 && slave.fetish !== "mindbroken") { if (slave.devotion > 20) { if (slave.trust <= 20) { t += ` Being allowed to rest <span class='mediumaquamarine'>reduces ${his} fear</span> of you.`; @@ -51,10 +53,10 @@ window.saRest = /** @param {App.Entity.SlaveState} slave */ function saRest(slav } } - if (V.showVignettes == 1 && slave.assignment === Job.REST) { + if (V.showVignettes === 1 && slave.assignment === Job.REST) { var _vignette = GetVignette(slave); t += ` __This week__ ${_vignette.text} `; - if (_vignette.type == "cash") { + if (_vignette.type === "cash") { if (_vignette.effect > 0) { t += `<span class='yellowgreen'>making you an extra ${cashFormat(Math.trunc(V.FResult*_vignette.effect))}.</span>`; } else if (_vignette.effect < 0) { @@ -63,7 +65,7 @@ window.saRest = /** @param {App.Entity.SlaveState} slave */ function saRest(slav t += `an incident without lasting effect.`; } cashX(Math.trunc(V.FResult*_vignette.effect), "rest", slave); - } else if (_vignette.type == "devotion") { + } else if (_vignette.type === "devotion") { if (_vignette.effect > 0) { if (slave.devotion > 50) { t += `<span class='hotpink'>increasing ${his} devotion to you.</span>`; @@ -88,7 +90,7 @@ window.saRest = /** @param {App.Entity.SlaveState} slave */ function saRest(slav t += `an incident without lasting effect.`; } slave.devotion += (1*_vignette.effect); - } else if (_vignette.type == "trust") { + } else if (_vignette.type === "trust") { if (_vignette.effect > 0) { if (slave.trust > 20) { t += `<span class='mediumaquamarine'>increasing ${his} trust in you.</span>`; @@ -109,7 +111,7 @@ window.saRest = /** @param {App.Entity.SlaveState} slave */ function saRest(slav t += `an incident without lasting effect.`; } slave.trust += (1*_vignette.effect); - } else if (_vignette.type == "health") { + } else if (_vignette.type === "health") { if (_vignette.effect > 0) { t += `<span class='green'>improving ${his} health.</span>`; } else if (_vignette.effect < 0) { diff --git a/src/endWeek/saServant.js b/src/endWeek/saServant.js index c9562fb451d6bcfbbac87909a8ecf86295cffc04..5b8dab55b30a191d1ad1e246c7b002a67094b338 100644 --- a/src/endWeek/saServant.js +++ b/src/endWeek/saServant.js @@ -1,19 +1,20 @@ +/* eslint-disable no-undef */ window.saServant = /** @param {App.Entity.SlaveState} slave */ function saServant(slave) { var pronouns = getPronouns(slave); - var he = pronouns.pronoun, him = pronouns.object, his = pronouns.possessive, hers = pronouns.possessivePronoun, himself = pronouns.objectReflexive, boy = pronouns.noun; + var he = pronouns.pronoun, him = pronouns.object, his = pronouns.possessive;//, hers = pronouns.possessivePronoun, himself = pronouns.objectReflexive, boy = pronouns.noun; /** FIXME: 'hers', 'himself', 'boy' is declared but its value is never read.ts(6133) */ var He = capFirstChar(he), His = capFirstChar(his); var V = State.variables; var t = `works as a servant. ${He} performs the lowest jobs in your penthouse, cleaning up after your other slaves, bathing them, helping them dress, and giving them sexual relief.`; if (V.servantsQuarters > 0) { - if ((V.universalRulesFacilityWork == 1 && slave.assignment == "be a servant" && V.servantsQuartersSpots > 0) || (slave.assignment == "work as a servant")) { - if (slave.assignment == "be a servant") { + if ((V.universalRulesFacilityWork === 1 && slave.assignment === "be a servant" && V.servantsQuartersSpots > 0) || (slave.assignment === "work as a servant")) { + if (slave.assignment === "be a servant") { t += ` Since there's extra space in the servants' quarters, ${V.assistantName} attaches ${him} to the cadre of maids there.`; V.servantsQuartersSpots--; } - if (V.Stewardess != 0) { + if (V.Stewardess !== 0) { t += ` This brings ${him} under ${V.Stewardess.slaveName}'s supervision. The Stewardess `; if (slave.devotion < -20) { t += `subjects ${him} to <span class='gold'>corrective rape</span> when ${his} service is imperfect, <span class='hotpink'>when ${he} steps out of line</span>, or when the Stewardess just feels like raping ${him}, forcing the poor slave to <span class='yellowgreen'>find refuge in work.</span>`; @@ -29,7 +30,7 @@ window.saServant = /** @param {App.Entity.SlaveState} slave */ function saServan if (!(canHear(slave))) { t += ` However, ${his} inability to hear often leaves ${him} oblivious to ${V.Stewardess.slaveName}'s orders, limiting their meaningful interactions.`; cashX(V.stewardessBonus/4, "houseServant", slave); - } else if ((slave.hears == -1 && slave.earwear != "hearing aids") || (slave.hears == 0 && slave.earwear == "muffling ear plugs")) { + } else if ((slave.hears === -1 && slave.earwear !== "hearing aids") || (slave.hears === 0 && slave.earwear === "muffling ear plugs")) { t += ` However, ${he} often doesn't catch what ${V.Stewardess.slaveName} says, leading to frustration, confusion and less work done.`; cashX(V.stewardessBonus/2, "houseServant", slave); } else { @@ -64,9 +65,9 @@ window.saServant = /** @param {App.Entity.SlaveState} slave */ function saServan V.oralTotal += _oral; } - if (slave.relationship == -2) { + if (slave.relationship === -2) { t += ` ${He} does ${his} best to perfect your domesticity due to ${his} emotional bond to you.`; - } else if (slave.relationship == -3 && slave.devotion > 50) { + } else if (slave.relationship === -3 && slave.devotion > 50) { t += ` ${He} does ${his} very best to be the perfect housewife, making ${him} an outstanding servant.`; } @@ -79,9 +80,9 @@ window.saServant = /** @param {App.Entity.SlaveState} slave */ function saServan } if (slave.fetishStrength > 60) { - if (slave.fetish == "submissive" && slave.fetishKnown == 1) { + if (slave.fetish === "submissive" && slave.fetishKnown === 1) { t += ` ${His} natural affinity for submission increases ${his} effectiveness.`; - } else if (slave.fetishKnown == 1 && slave.fetish == "dom") { + } else if (slave.fetishKnown === 1 && slave.fetish === "dom") { t += ` ${His} sexual appetite for domination reduces ${his} effectiveness.`; } } @@ -92,7 +93,7 @@ window.saServant = /** @param {App.Entity.SlaveState} slave */ function saServan t += ` ${His} low sex drive keeps ${him} from becoming too distracted by the intercourse all around ${him}, making ${him} more efficient.`; } - if ((slave.eyes <= -1 && slave.eyewear != "corrective glasses" && slave.eyewear != "corrective contacts") || (slave.eyewear == "blurring glasses") || (slave.eyewear == "blurring contacts")) { + if ((slave.eyes <= -1 && slave.eyewear !== "corrective glasses" && slave.eyewear !== "corrective contacts") || (slave.eyewear === "blurring glasses") || (slave.eyewear === "blurring contacts")) { t += ` ${His} bad vision makes ${him} a worse servant.`; } @@ -111,10 +112,10 @@ window.saServant = /** @param {App.Entity.SlaveState} slave */ function saServan } } - if (V.showVignettes == 1 && (slave.assignment === Job.SERVANT || slave.assignment === Job.SERVER)) { + if (V.showVignettes === 1 && (slave.assignment === Job.SERVANT || slave.assignment === Job.SERVER)) { var _vignette = GetVignette(slave); t += ` __This week__ ${_vignette.text} `; - if (_vignette.type == "cash") { + if (_vignette.type === "cash") { if (_vignette.effect > 0) { t += `<span class='yellowgreen'>making you an extra ${cashFormat(Math.trunc(V.FResult*_vignette.effect))}.</span>`; } else if (_vignette.effect < 0) { @@ -123,7 +124,7 @@ window.saServant = /** @param {App.Entity.SlaveState} slave */ function saServan t += `an incident without lasting effect.`; } cashX(Math.trunc(V.FResult*_vignette.effect), "houseServant", slave); - } else if (_vignette.type == "devotion") { + } else if (_vignette.type === "devotion") { if (_vignette.effect > 0) { if (slave.devotion > 50) { t += `<span class='hotpink'>increasing ${his} devotion to you.</span>`; @@ -148,7 +149,7 @@ window.saServant = /** @param {App.Entity.SlaveState} slave */ function saServan t += `an incident without lasting effect.`; } slave.devotion += (1*_vignette.effect); - } else if (_vignette.type == "trust") { + } else if (_vignette.type === "trust") { if (_vignette.effect > 0) { if (slave.trust > 20) { t += `<span class='mediumaquamarine'>increasing ${his} trust in you.</span>`; @@ -169,7 +170,7 @@ window.saServant = /** @param {App.Entity.SlaveState} slave */ function saServan t += `an incident without lasting effect.`; } slave.trust += (1*_vignette.effect); - } else if (_vignette.type == "health") { + } else if (_vignette.type === "health") { if (_vignette.effect > 0) { t += `<span class='green'>improving ${his} health.</span>`; } else if (_vignette.effect < 0) { diff --git a/src/endWeek/saStayConfined.js b/src/endWeek/saStayConfined.js index 62b61b9db79a2a1e441bc2656f8356f106971d12..a2b6fbb528e52f464f56ad3e537322be7cae3b9c 100644 --- a/src/endWeek/saStayConfined.js +++ b/src/endWeek/saStayConfined.js @@ -1,3 +1,5 @@ +/* eslint-disable no-undef */ +/* eslint-disable no-unused-vars */ window.saStayConfined = /** @param {App.Entity.SlaveState} slave */ function saStayConfined(slave) { var pronouns = getPronouns(slave); @@ -7,7 +9,7 @@ window.saStayConfined = /** @param {App.Entity.SlaveState} slave */ function saS var t = ""; - if (slave.fetish != "mindbroken") { + if (slave.fetish !== "mindbroken") { if (slave.devotion < -50) { t += `is kept in solitary confinement whenever ${he} is not being forced to do something else. ${He} still hates ${his} place in the world, but being forced to rely on slave life as ${his} only human contact <span class='hotpink'>grinds down ${his} resistance.</span>`; slave.devotion += 2; @@ -34,8 +36,8 @@ window.saStayConfined = /** @param {App.Entity.SlaveState} slave */ function saS slave.trust -= 5; } - if (slave.assignment == "be confined in the cellblock") { - if ((slave.hears == -1 && slave.earwear != "hearing aids") || (slave.hears == 0 && slave.earwear == "muffling ear plugs") || (slave.hears == -2)) { + if (slave.assignment === "be confined in the cellblock") { + if ((slave.hears === -1 && slave.earwear !== "hearing aids") || (slave.hears === 0 && slave.earwear === "muffling ear plugs") || (slave.hears === -2)) { t += ` ${His} hearing impairment spares ${him} the sounds of ${his} peers getting punished, lightening the impact of ${his} imprisonment.`; } } @@ -46,32 +48,32 @@ window.saStayConfined = /** @param {App.Entity.SlaveState} slave */ function saS t += `is oblivious to ${his} confinement.`; } - if (V.Wardeness !== 0 && (V.Wardeness.sexualFlaw == "malicious" || V.Wardeness.sexualFlaw == "abusive" || V.Wardeness.sexualFlaw == "breast growth") && slave.lactation == 1 && slave.lactationDuration == 0) { - t += ` ${V.Wardeness.slaveName} ` - if (V.Wardeness.sexualFlaw == "malicious") { - t += `savors the torment brought about by ${his} milk-bloated chest and makes sure to milk ${him} thoroughly every other week to maximize ${his} suffering.` - } else if (V.Wardeness.sexualFlaw == "abusive") { - t += `enjoys neglecting ${his} milk-bloated chest until it gets big and painfully swollen; only then does the abusive jail-keeper roughly drain ${his} sensitive mounds.` - } else if (V.Wardeness.sexualFlaw == "breast growth") { - t += `loves watching ${his} breasts steadily swell with pent-up milk and only milks ${him} in order to reset the process.` + if (V.Wardeness !== 0 && (V.Wardeness.sexualFlaw === "malicious" || V.Wardeness.sexualFlaw === "abusive" || V.Wardeness.sexualFlaw === "breast growth") && slave.lactation === 1 && slave.lactationDuration === 0) { + t += ` ${V.Wardeness.slaveName} `; + if (V.Wardeness.sexualFlaw === "malicious") { + t += `savors the torment brought about by ${his} milk-bloated chest and makes sure to milk ${him} thoroughly every other week to maximize ${his} suffering.`; + } else if (V.Wardeness.sexualFlaw === "abusive") { + t += `enjoys neglecting ${his} milk-bloated chest until it gets big and painfully swollen; only then does the abusive jail-keeper roughly drain ${his} sensitive mounds.`; + } else if (V.Wardeness.sexualFlaw === "breast growth") { + t += `loves watching ${his} breasts steadily swell with pent-up milk and only milks ${him} in order to reset the process.`; } } - if (slave.sentence != 0) { + if (slave.sentence !== 0) { t += ` ${He} has ${slave.sentence}`; - if (slave.sentence == 1) { + if (slave.sentence === 1) { t += ` week remaining.`; } else { t += ` weeks remaining.`; } - } else if (slave.devotion > 20 || (slave.devotion >= -20 && slave.trust < -20) || (slave.devotion >= -50 && slave.trust < -50) || slave.fetish == "mindbroken") { - if (slave.fetish == "mindbroken") { + } else if (slave.devotion > 20 || (slave.devotion >= -20 && slave.trust < -20) || (slave.devotion >= -50 && slave.trust < -50) || slave.fetish === "mindbroken") { + if (slave.fetish === "mindbroken") { t += ` ${His} broken mind hinges entirely on other's guidance,`; } else { t += ` ${He} is now willing to <span class='hotpink'>do as ${he}'s told,</span>`; } t += ` so <span class='yellow'>${his} assignment has defaulted to rest.</span>`; - if (slave.assignment == "be confined in the cellblock") { + if (slave.assignment === "be confined in the cellblock") { State.temporary.brokenSlaves++; State.temporary.DL--; State.temporary.dI--; diff --git a/src/js/DefaultRules.js b/src/js/DefaultRules.js index 2c76f5a36878a0e44b9f27606360a9e6b39858d8..ef2091f5319677aebb9de168326e4cc9121a1e2b 100644 --- a/src/js/DefaultRules.js +++ b/src/js/DefaultRules.js @@ -1,3 +1,4 @@ +/* eslint-disable no-undef */ // this code applies RA rules onto slaves window.DefaultRules = (function() { @@ -1139,20 +1140,30 @@ window.DefaultRules = (function() { r += `<br>${slave.slaveName}'s pregnancy has been terminated; `; if (slave.sexualFlaw === "breeder") { r += `it broke ${his} mind.`; - slave.fetish = "mindbroken", slave.behavioralQuirk = "none", slave.behavioralFlaw = "none", slave.sexualQuirk = "none", slave.sexualFlaw = "none", slave.devotion = 0, slave.trust = 0; + slave.fetish = "mindbroken"; + slave.behavioralQuirk = "none"; + slave.behavioralFlaw = "none"; + slave.sexualQuirk = "none"; + slave.sexualFlaw = "none"; + slave.devotion = 0; + slave.trust = 0; } else if (slave.devotion < -50) { r += `${he} did not handle it well.`; - slave.trust -= 10, slave.devotion -= 25; + slave.trust -= 10; + slave.devotion -= 25; } else if (slave.devotion < -20) { r += `${he} did not handle it well.`; - slave.trust -= 10, slave.devotion -= 10; + slave.trust -= 10; + slave.devotion -= 10; } else if (slave.fetish === "pregnancy") { r += `${he} did not handle it well.`; let fetishModifier = (slave.fetishStrength / 2); - slave.devotion -= (1 * fetishModifier), (slave.trust -= 1 * fetishModifier); + slave.devotion -= (1 * fetishModifier); + (slave.trust -= 1 * fetishModifier); } else if (slave.devotion <= 20) { r += `${he} did not handle it well.`; - slave.trust -= 10, slave.devotion -= 5; + slave.trust -= 10; + slave.devotion -= 5; } else if (slave.devotion <= 50) { r += `${he} did not handle it well.`; slave.trust -= 10; @@ -1167,11 +1178,15 @@ window.DefaultRules = (function() { slave.preg = 0; } if (slave.abortionTat > -1) { - slave.abortionTat++, cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave); + slave.abortionTat++; + cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave); } V.reservedChildren = FetusGlobalReserveCount("incubator"); V.reservedChildrenNursery = FetusGlobalReserveCount("nursery"); - slave.pregType = 0, slave.pregSource = 0, slave.pregKnown = 0, slave.pregWeek = -2; + slave.pregType = 0; + slave.pregSource = 0; + slave.pregKnown = 0; + slave.pregWeek = -2; WombFlush(slave); } else if (rule.abortion === "male") { if (slave.preg < 4) { @@ -1184,7 +1199,10 @@ window.DefaultRules = (function() { } } if (WL === 0) { - slave.pregType = 0, slave.pregSource = 0, slave.pregKnown = 0, slave.pregWeek = -2; + slave.pregType = 0; + slave.pregSource = 0; + slave.pregKnown = 0; + slave.pregWeek = -2; WombFlush(slave); } r += `<br>${slave.slaveName}'s male fetuses have been terminated.`; @@ -1200,7 +1218,10 @@ window.DefaultRules = (function() { } } if (WL === 0) { - slave.pregType = 0, slave.pregSource = 0, slave.pregKnown = 0, slave.pregWeek = -2; + slave.pregType = 0; + slave.pregSource = 0; + slave.pregKnown = 0; + slave.pregWeek = -2; WombFlush(slave); } r += `<br>${slave.slaveName}'s female fetuses have been terminated.`; @@ -1463,31 +1484,31 @@ window.DefaultRules = (function() { break; case "breast injections": - if (!(slave.boobs < 48000)) { + if (slave.boobs >= 48000) { flag = false; } break; case "hyper breast injections": - if (!(slave.boobs < 48000)) { + if (slave.boobs >= 48000) { flag = false; } break; case "breast redistributors": - if (!(slave.boobs - slave.boobsImplant > 100)) { + if ((slave.boobs - slave.boobsImplant) <= 100) { flag = false; } break; case "butt injections": - if (!(slave.butt < 9)) { + if (slave.butt >= 9) { flag = false; } break; case "hyper butt injections": - if (!(slave.butt < 20)) { + if (slave.butt >= 20) { flag = false; } break; @@ -1499,79 +1520,79 @@ window.DefaultRules = (function() { break; case "butt redistributors": - if (!(slave.buttImplant > 0)) { + if (slave.buttImplant <= 0) { flag = false; } break; case "lip injections": - if (!(slave.lips <= 95 || (slave.lips <= 85 && V.seeExtreme !== 1))) { + if (slave.lips > 95 || (slave.lips > 85 && V.seeExtreme !== 1)) { flag = false; } break; case "lip atrophiers": - if (!(slave.lips - slave.lipsImplant > 0)) { + if (slave.lips - slave.lipsImplant <= 0) { flag = false; } break; case "super fertility drugs": - if (!(slave.indentureRestrictions < 1 && (slave.breedingMark !== 1 || V.propOutcome === 0))) { + if (slave.indentureRestrictions >= 1 && (slave.breedingMark !== 1 || V.propOutcome === 0)) { // TODO: this line needs review. not sure of the intended effect flag = false; } break; case "penis enhancement": - if (!((slave.dick > 0 && slave.dick < 10) || slave.clit < 5)) { + if ((slave.dick > 0 && slave.dick < 10) || slave.clit < 5) { flag = false; } break; case "hyper penis enhancement": - if (!((slave.dick > 0 && slave.dick < 31) || slave.clit < 5)) { + if ((slave.dick > 0 && slave.dick < 31) || slave.clit < 5) { flag = false; } break; case "penis atrophiers": - if (!(slave.dick > 1)) { + if (slave.dick > 1) { flag = false; } break; case "testicle enhancement": - if (!(slave.balls > 0)) { + if (slave.balls > 0) { flag = false; } break; case "hyper testicle enhancement": - if (!(slave.balls > 0)) { + if (slave.balls > 0) { flag = false; } break; case "testicle atrophiers": - if (!(slave.balls > 1)) { + if (slave.balls > 1) { flag = false; } break; case "clitoris atrophiers": - if (!(slave.clit > 0)) { + if (slave.clit > 0) { flag = false; } break; case "labia atrophiers": - if (!(slave.labia > 0)) { + if (slave.labia > 0) { flag = false; } break; case "appetite suppressors": - if (!(slave.weight <= -95)) { + if (slave.weight <= -95) { flag = false; } break; @@ -1602,6 +1623,7 @@ window.DefaultRules = (function() { slave.cumSource = 0; SetBellySize(slave); } else if ((rule.inflationType === "curative" && slave.health > 90) || (rule.inflationType === "tightener" && slave.anus <= 1 && slave.vagina <= 1)) { + /** FIXME: Empty block statement.eslint(no-empty) */ } else { r += `<br>${slave.slaveName}'s current enema regimen has been set to ${rule.inflationType}.`; slave.inflation = 1; @@ -1635,12 +1657,12 @@ window.DefaultRules = (function() { // Diet Setting if (rule.diet !== undefined && rule.diet !== "no default setting") { /* - if ((slave.boobs >= 1600) && (slave.muscles <= 5) && (slave.amp != 1) && ((rule.muscles == "no default setting") || (rule.muscles === 0))) { + if ((slave.boobs >= 1600) && (slave.muscles <= 5) && (slave.amp !== 1) && ((rule.muscles === "no default setting") || (rule.muscles === 0))) { if ((slave.diet !== "muscle building")) { slave.diet = "muscle building" r += `<br>${slave.slaveName} has big tits and no back muscles, so ${he}'s been assigned to gain some.` } - } else if ((slave.boobs >= 1600) && (slave.muscles > 5) && (slave.diet == "muscle building") && ((rule.muscles == "no default setting") || (rule.muscles === 0))) { + } else if ((slave.boobs >= 1600) && (slave.muscles > 5) && (slave.diet === "muscle building") && ((rule.muscles === "no default setting") || (rule.muscles === 0))) { */ if (rule.diet === "healthy" && slave.diet !== "healthy") { slave.diet = "healthy"; diff --git a/src/js/SlaveState.js b/src/js/SlaveState.js index 6f2ac8dac9f3c7cbf524ddcec0eaac32f4fb01a2..24a2b8a9e90567c447043d8c09d24e402815225e 100644 --- a/src/js/SlaveState.js +++ b/src/js/SlaveState.js @@ -845,7 +845,7 @@ App.Entity.SlaveState = class SlaveState { /** * count of ova that broodmother implant force to release. * - * Should be set with "broodmother" property together. If broodmother == 0 has no meaning. + * Should be set with "broodmother" property together. If broodmother === 0 has no meaning. */ this.broodmotherFetuses = 0; /** @@ -1016,7 +1016,7 @@ App.Entity.SlaveState = class SlaveState { * * function relative to .ballSize * - * *If .balls > 0 and .scrotum == 0, balls are internal* + * *If .balls > 0 and .scrotum === 0, balls are internal* */ this.scrotum = 0; /** has ovaries @@ -1886,7 +1886,7 @@ App.Entity.SlaveState = class SlaveState { * * 3: orally by another slave */ this.inflationMethod = 0; - /** If inflationMethod == 3, ID of the slave filling her with milk. */ + /** If inflationMethod === 3, ID of the slave filling her with milk. */ this.milkSource = 0; /** If inflationMethod 3, ID of the slave filling her with cum. */ this.cumSource = 0; diff --git a/src/js/accordianJS.js b/src/js/accordianJS.js index 0b31fa239c32914f8732ba6e51f7a1dd030f661c..a0d03de5a5b25f38a75fe583e665785e5f83fe38 100644 --- a/src/js/accordianJS.js +++ b/src/js/accordianJS.js @@ -1,3 +1,5 @@ +/* eslint-disable no-unused-vars */ +/* eslint-disable no-undef */ /* Accordion 000-250-006 */ /* @@ -13,8 +15,8 @@ * 000-250-006 03092017 */ -postdisplay["doAccordionSet"] = function (content) { - if (variables().useAccordion == 1) { +postdisplay["doAccordionSet"] = function (content) { /** FIXME: ['doAccordionSet'] is better written in dot notation. (W069)jshint(W069) */ + if (variables().useAccordion === 1) { Array.prototype.slice.call(document.querySelectorAll('.macro-include')) .forEach(function (element) { element.classList.add('accHidden'); @@ -22,7 +24,7 @@ postdisplay["doAccordionSet"] = function (content) { } }; -postdisplay["doAccordion"] = function (content) { +postdisplay["doAccordion"] = function (content) { /** FIXME: ['doAccordion'] is better written in dot notation. (W069)jshint(W069) */ var acc = document.getElementsByClassName("accordion"); var i; @@ -30,9 +32,9 @@ postdisplay["doAccordion"] = function (content) { acc[i].onclick = function () { this.classList.toggle("active"); var panel = this.nextElementSibling; - if(panel == null || panel == undefined){ + if(panel === null || panel === undefined){ panel = document.getElementById(this.id + "accHidden"); - if( panel.style.display=='none' ){ + if( panel.style.display === 'none' ) { panel.style.display = ''; }else{ panel.style.display = 'none'; diff --git a/src/js/assayJS.js b/src/js/assayJS.js index 59c31f4a970076e5c99e345f51de8b1c1e414007..e3b1c666adc8b49790f10c1ed4a19ecc07b784f8 100644 --- a/src/js/assayJS.js +++ b/src/js/assayJS.js @@ -1,3 +1,4 @@ +/* eslint-disable no-unused-vars */ /* eslint-disable no-undef */ window.isSlim = /** @param {App.Entity.SlaveState} slave */ function(slave) { let slim = false; @@ -1931,7 +1932,7 @@ window.SlaveSort = /** @param {App.Entity.SlaveState[]} slaves */ function Slave } }; -window.slaveSortMinor = /** @param {App.Entity.SlaveState[]} slaves */ function slaveSortMinor(slaves) { /** FIXME: 'slaves' is assigned a value but never used.eslint(no-unused-vars) */ +window.slaveSortMinor = /** @param {App.Entity.SlaveState[]} slaves */ function slaveSortMinor(slaves) { slaves = slaves.sort((a, b) => a.slaveName < b.slaveName ? -1 : 1); }; diff --git a/src/js/assignJS.js b/src/js/assignJS.js index b44407d86daa5b5158682405710472dacc23ee91..7f2f743a5fb6469b50f54720941c834a0dcd2b84 100644 --- a/src/js/assignJS.js +++ b/src/js/assignJS.js @@ -1,3 +1,4 @@ +/* eslint-disable no-undef */ window.assignJob = function assignJob(slave, job) { "use strict"; const V = State.variables; @@ -249,7 +250,6 @@ window.assignJob = function assignJob(slave, job) { case "be the schoolteacher": case "be the stewardess": case "be the wardeness": - case "be the matron": slave.assignment = job; slave.assignmentVisible = 0; /* non-visible leadership roles */ slave.livingRules = "luxurious"; @@ -488,7 +488,7 @@ window.removeJob = function removeJob(slave, assignment) { case "be your agent": case "live with your agent": slave.assignment = "rest"; - const _leaderIndex = V.leaders.findIndex(function(x) { return x.ID === slave.ID; }); + _leaderIndex = V.leaders.findIndex(function(x) { return x.ID === slave.ID; }); if (_leaderIndex !== -1) V.leaders.deleteAt(_leaderIndex); diff --git a/src/js/datatypeCleanupJS.js b/src/js/datatypeCleanupJS.js index 78275bcd539bdd8b12cefd3711a596afecd5f214..2e159d033bf9dbde7a59c2ef1e7b344b702405fa 100644 --- a/src/js/datatypeCleanupJS.js +++ b/src/js/datatypeCleanupJS.js @@ -1,3 +1,4 @@ +/* eslint-disable no-undef */ /* This function does not ensure values make sense. For example, it does not fix weird relations/relationships/rivalries/pregnancies/prosthetics. It only makes sure most datatypes are correct, and sets to default if not. Number values are clamped to the correct bounds. @@ -20,7 +21,7 @@ Use slave.value = Math.min(+slave.value, a) || default; if you need slave.value <= a. Use slave.value = Math.clamp(+slave.value, a, b) || default; if you need a <= slave.value <= b. Use slave.value = +slave.value || default; if slave.value can be any number. - The exception to this is if the default != 0. In this case, it's usually good enough to just check if slave.value !== 0 first. The strict equality is important! + The exception to this is if the default !== 0. In this case, it's usually good enough to just check if slave.value !== 0 first. The strict equality is important! If you want slave.value to be a string, there's no easy tricks to make sure it's already an accepted value. The simplest way is the following if (typeof slave.value !== "string") slave.value = default; diff --git a/src/js/eventSelectionJS.js b/src/js/eventSelectionJS.js index 44f283d46ed008e2f1154acbac85ca0d0975ffd2..4b303286f93920e300092d6008c20b7b51c33571 100644 --- a/src/js/eventSelectionJS.js +++ b/src/js/eventSelectionJS.js @@ -1,3 +1,4 @@ +/* eslint-disable no-undef */ window.generateRandomEventPoolStandard = function(eventSlave) { /* STANDARD EVENTS */ @@ -399,7 +400,7 @@ window.generateRandomEventPoolStandard = function(eventSlave) { } /* - if(eventSlave.drugs == "breast injections") { + if(eventSlave.drugs === "breast injections") { if(eventSlave.anus > 0 || eventSlave.vagina > 0) { if(eventSlave.devotion <= 50) { if(eventSlave.devotion >= -20) { diff --git a/src/js/extendedFamilyModeJS.js b/src/js/extendedFamilyModeJS.js index 64db893921f98427b06b35abb8b5a212a9d5f360..3e6d2ac7575d089088602324b54b2371a667aaa4 100644 --- a/src/js/extendedFamilyModeJS.js +++ b/src/js/extendedFamilyModeJS.js @@ -1,3 +1,4 @@ +/* eslint-disable no-undef */ /* see documentation for details /devNotes/Extended Family Mode Explained.txt */ window.isMotherP = function isMotherP(daughter, mother) { @@ -65,7 +66,7 @@ window.sameTParent = function(slave1, slave2) { /* window.sameTParent = function(slave1, slave2) { - if ((slave1.mother == slave2.father || slave1.father == slave2.mother) && (slave1.mother != 0 && slave1.mother != -2 && slave1.father != 0 && slave1.father != -2)) { + if ((slave1.mother === slave2.father || slave1.father === slave2.mother) && (slave1.mother !== 0 && slave1.mother !== -2 && slave1.father !== 0 && slave1.father !== -2)) { return true; //testtest catches the case if a mother is a father or a father a mother } else { return false; @@ -114,7 +115,7 @@ window.areSisters = function(slave1, slave2) { /* //3 = half-sisters, 2 = sisters, 1 = twins, 0 = not related window.areSisters = function(c1, c2) { - if(c1.ID == c2.ID) { + if(c1.ID === c2.ID) { return 0; } var sib = 4; @@ -124,10 +125,10 @@ window.areSisters = function(c1, c2) { if(sameDad(c1, c2)) { sib -=1; } - if (sib == 2 && c1.actualAge == c2.actualAge && c1.birthWeek == c2.birthWeek) { + if (sib === 2 && c1.actualAge === c2.actualAge && c1.birthWeek === c2.birthWeek) { sib -= 1; } - if(sib == 4) { + if(sib === 4) { return 0 } else { return sib; @@ -213,7 +214,7 @@ window.isSlaveAvailable = /** @param {App.Entity.SlaveState} slave */ function ( window.randomRelatedSlave = function(slave, filterFunction) { if(!slave || !SugarCube) { return undefined; } if(typeof filterFunction !== 'function') { filterFunction = function(s, index, array) { return true; }; } - return State.variables.slaves.filter(filterFunction).shuffle().find(function(s, index, array) {return areSisters(slave, s) || s.mother == slave.ID || s.father == slave.ID || slave.ID == s.mother || slave.ID == s.father; }) + return State.variables.slaves.filter(filterFunction).shuffle().find(function(s, index, array) {return areSisters(slave, s) || s.mother === slave.ID || s.father === slave.ID || slave.ID === s.mother || slave.ID === s.father; }) } */ diff --git a/src/js/familyTreeJS.js b/src/js/familyTreeJS.js index fb8943b8a05fe46b9b5bde9a4c13867c8ebbc0fb..7e6ef9826562d8f81c58c6f3a0b291f474b915b2 100644 --- a/src/js/familyTreeJS.js +++ b/src/js/familyTreeJS.js @@ -1,3 +1,6 @@ +/* eslint-disable no-console */ +/* eslint-disable no-unused-vars */ +/* eslint-disable no-undef */ var lastActiveSlave, lastSlaves, lastPC; /* @@ -115,7 +118,7 @@ window.renderFamilyTree = function(slaves, filterID) { node.append('circle') .attr('r', function (d) { return d.r; }) .attr('stroke', function(d) { - if(d.ID == filterID) { + if(d.ID === filterID) { return '#ffff20'; } else { return '#5a5a5a'; @@ -127,12 +130,12 @@ window.renderFamilyTree = function(slaves, filterID) { node.append('text') .text(function(d) { var ssym; - if(d.ID == -1) { - if(d.dick == 1 && d.vagina == 1) { + if(d.ID === -1) { + if(d.dick === 1 && d.vagina === 1) { ssym = '☿'; - } else if (d.dick == 1) { + } else if (d.dick === 1) { ssym = '♂'; - } else if (d.vagina == 1) { + } else if (d.vagina === 1) { ssym = '♀'; } } else if (d.dick > 0 && d.vagina > -1) { @@ -234,14 +237,14 @@ window.buildFamilyTree = function(slaves = State.variables.slaves, filterID) { charList.push.apply(charList, State.variables.tanks); var unborn = {}; - for(var i = 0; i < State.variables.tanks.length; i++) { + for(let i = 0; i < State.variables.tanks.length; i++) { unborn[State.variables.tanks[i].ID] = true; } - for (var i = 0; i < State.variables.cribs.length; i++) { + for (let i = 0; i < State.variables.cribs.length; i++) { unborn[State.variables.cribs[i].ID] = true; } - for(var i = 0; i < charList.length; i++) { + for(let i = 0; i < charList.length; i++) { var mom = charList[i].mother; var dad = charList[i].father; @@ -259,53 +262,53 @@ window.buildFamilyTree = function(slaves = State.variables.slaves, filterID) { } } - for(var i = 0; i < charList.length; i++) { + for(let i = 0; i < charList.length; i++) { var character = charList[i]; - if(character.mother == 0 && character.father == 0 && !kids[character.ID]) { + if(character.mother === 0 && character.father === 0 && !kids[character.ID]) { continue; } - var mom = character.mother; + let mom = character.mother; if(mom < -6) { if (mom in State.variables.missingTable && State.variables.showMissingSlaves) { node_lookup[mom] = family_graph.nodes.length; var missing = State.variables.missingTable[mom]; charList.push({ID: mom, mother: 0, father: 0, is_mother: true, dick: missing.dick, vagina: missing.vagina, slaveName: missing.slaveName}); } else { - if(typeof outmoms[mom] == 'undefined') { + if(typeof outmoms[mom] === 'undefined') { outmoms[mom] = []; } outmoms[mom].push(character.slaveName); } - } else if(mom < 0 && typeof node_lookup[mom] == 'undefined' && typeof preset_lookup[mom] != 'undefined') { + } else if(mom < 0 && typeof node_lookup[mom] === 'undefined' && typeof preset_lookup[mom] !== 'undefined') { node_lookup[mom] = family_graph.nodes.length; charList.push({ID: mom, mother: 0, father: 0, is_father: true, dick: 0, vagina: 1, slaveName: preset_lookup[mom]}); } - var dad = character.father; + let dad = character.father; if(dad < -6) { if (dad in State.variables.missingTable && State.variables.showMissingSlaves) { node_lookup[dad] = family_graph.nodes.length; - var missing = State.variables.missingTable[dad]; + let missing = State.variables.missingTable[dad]; charList.push({ID: dad, mother: 0, father: 0, is_father: true, dick: missing.dick, vagina: missing.vagina, slaveName: missing.slaveName}); } else { - if(typeof outdads[dad] == 'undefined') { + if(typeof outdads[dad] === 'undefined') { outdads[dad] = []; } outdads[dad].push(character.slaveName); } - } else if(dad < 0 && typeof node_lookup[dad] == 'undefined' && typeof preset_lookup[dad] != 'undefined') { + } else if(dad < 0 && typeof node_lookup[dad] === 'undefined' && typeof preset_lookup[dad] !== 'undefined') { node_lookup[dad] = family_graph.nodes.length; charList.push({ID: dad, mother: 0, father: 0, is_father: true, dick: 1, vagina: -1, slaveName: preset_lookup[dad]}); } } var mkeys = Object.keys(outmoms); - for(var i = 0; i < mkeys.length; i++) { + for(let i = 0; i < mkeys.length; i++) { var name; var key = mkeys[i]; var names = outmoms[key]; - if(names.length == 1) { + if(names.length === 1) { name = names[0]; - } else if(names.length == 2) { + } else if(names.length === 2) { name = names.join(' and '); } else { names[-1] = 'and '+names[-1]; @@ -317,13 +320,13 @@ window.buildFamilyTree = function(slaves = State.variables.slaves, filterID) { } var dkeys = Object.keys(outdads); - for(var i = 0; i < dkeys.length; i++) { - var name; - var key = dkeys[i]; - var names = outdads[key]; - if(names.length == 1) { + for(let i = 0; i < dkeys.length; i++) { + let name; + let key = dkeys[i]; + let names = outdads[key]; + if(names.length === 1) { name = names[0]; - } else if(names.length == 2) { + } else if(names.length === 2) { name = names.join(' and '); } else { names[-1] = 'and '+names[-1]; @@ -335,7 +338,7 @@ window.buildFamilyTree = function(slaves = State.variables.slaves, filterID) { } var charHash = {}; - for(var i = 0; i < charList.length; i++) { + for(let i = 0; i < charList.length; i++) { charHash[charList[i].ID] = charList[i]; } @@ -348,19 +351,19 @@ window.buildFamilyTree = function(slaves = State.variables.slaves, filterID) { relIDs.related = true; return relIDs; } - if(character.ID == targetID) { + if(character.ID === targetID) { relIDs.related = true; } if(seen[character.ID]) { return relIDs; } seen[character.ID] = true; - if(character.mother != 0) { + if(character.mother !== 0) { if(charHash[character.mother]) { relatedTo(charHash[character.mother], targetID, relIDs); } } - if(character.father != 0) { + if(character.father !== 0) { if(charHash[character.father]) { relatedTo(charHash[character.father], targetID, relIDs); } @@ -370,17 +373,17 @@ window.buildFamilyTree = function(slaves = State.variables.slaves, filterID) { if(filterID) { if(charHash[filterID]) { var relIDs = relatedTo(charHash[filterID], filterID); - for(var k in relIDs.tree) { + for(let k in relIDs.tree) { related[k] = true; } - for(var i = 0; i < charList.length; i++) { + for(let i = 0; i < charList.length; i++) { if(charHash[charList[i].ID]) { var pRelIDs = relatedTo(charHash[charList[i].ID], filterID); if(pRelIDs.related) { - for(var k in pRelIDs.tree) { + for(let k in pRelIDs.tree) { related[k] = true; if(saveTree[k]) { - for(var k2 in saveTree[k].tree) { + for(let k2 in saveTree[k].tree) { related[k2] = true; } } @@ -392,10 +395,10 @@ window.buildFamilyTree = function(slaves = State.variables.slaves, filterID) { } } - for(var i = 0; i < charList.length; i++) { - var character = charList[i]; - var char_id = character.ID; - if(character.mother == 0 && character.father == 0 && !kids[char_id]) { + for(let i = 0; i < charList.length; i++) { + let character = charList[i]; + let char_id = character.ID; + if(character.mother === 0 && character.father === 0 && !kids[char_id]) { continue; } if(filterID && !related[char_id]) { @@ -419,10 +422,10 @@ window.buildFamilyTree = function(slaves = State.variables.slaves, filterID) { family_graph.nodes.push(char_obj); } - for(var i = 0; i < charList.length; i++) { - var character = charList[i]; - var char_id = character.ID; - if(character.mother == 0 && character.father == 0 && !kids[char_id]) { + for(let i = 0; i < charList.length; i++) { + let character = charList[i]; + let char_id = character.ID; + if(character.mother === 0 && character.father === 0 && !kids[char_id]) { continue; } if(filterID && !related[char_id]) { @@ -434,9 +437,9 @@ window.buildFamilyTree = function(slaves = State.variables.slaves, filterID) { } continue; } - if(typeof node_lookup[character.mother] != 'undefined') { + if(typeof node_lookup[character.mother] !== 'undefined') { var ltype; - if(character.mother == character.father) { + if(character.mother === character.father) { ltype = 'homologous'; } else { ltype = 'maternal'; @@ -447,10 +450,10 @@ window.buildFamilyTree = function(slaves = State.variables.slaves, filterID) { source: node_lookup[character.mother]*1 }); } - if(character.mother == character.father) { + if(character.mother === character.father) { continue; } - if(typeof node_lookup[character.father] != 'undefined') { + if(typeof node_lookup[character.father] !== 'undefined') { family_graph.links.push({ type: 'paternal', target: node_lookup[char_id]*1, @@ -494,17 +497,17 @@ window.updateFamilyTree = function(activeSlave = lastActiveSlave, slaves = lastS */ function getSlave(id, expectedGenes) { - if(id == -1) { + if(id === -1) { return {"slaveName":"YOU", "ID":id, "physicalAge":PC.physicalAge, "genes":PC.genes, father:PC.father, mother:PC.mother}; } - if(id == 0) { + if(id === 0) { return {"slaveName":"-", "ID":id, "genes":expectedGenes}; } - if(id == activeSlave.ID) { + if(id === activeSlave.ID) { return activeSlave; } - for(var i = 0; i < slaves.length; ++i) { - if(slaves[i].ID == id) + for(let i = 0; i < slaves.length; ++i) { + if(slaves[i].ID === id) return slaves[i]; } return {"slaveName":"-", "ID":id, "genes":expectedGenes}; @@ -519,17 +522,17 @@ window.updateFamilyTree = function(activeSlave = lastActiveSlave, slaves = lastS } recursionProtectSlaveId[slave.ID] = true; - if(typeof slave.father == "undefined" || typeof slave.mother == "undefined") + if(typeof slave.father === "undefined" || typeof slave.mother === "undefined") return slaveInfo_(slave, activeSlaveId); - if(slave.father == -1 || slave.mother == -1) { + if(slave.father === -1 || slave.mother === -1) { return slaveInfo(getSlave(-1), activeSlaveId, recursionProtectSlaveId); } - if(slave.father != 0) { + if(slave.father !== 0) { return slaveInfo(getSlave(slave.father, "unknownXY"), activeSlaveId, recursionProtectSlaveId); } - if(slave.mother != 0) { + if(slave.mother !== 0) { return slaveInfo(getSlave(slave.mother, "unknownXX"), activeSlaveId, recursionProtectSlaveId); } return slaveInfo_(slave, activeSlaveId); @@ -545,21 +548,21 @@ window.updateFamilyTree = function(activeSlave = lastActiveSlave, slaves = lastS var data = { "name": slave.slaveName + (slave.physicalAge?(" (" + slave.physicalAge + ")"):""), "class" : slave.genes, - "textClass": (activeSlaveId == slave.ID)?"emphasis":"", + "textClass": (activeSlaveId === slave.ID)?"emphasis":"", "marriages": [], }; var spouseToChild = {}; function maybeAddSpouseToChild(child) { - if(child.ID == slave.ID) + if(child.ID === slave.ID) return; - if (child.father == slave.ID) { + if (child.father === slave.ID) { if(!spouseToChild[child.mother]) { spouseToChild[child.mother] = []; } spouseToChild[child.mother].push(child); - } else if (child.mother == slave.ID) { + } else if (child.mother === slave.ID) { if(!spouseToChild[child.father]) { spouseToChild[child.father] = []; } @@ -567,29 +570,29 @@ window.updateFamilyTree = function(activeSlave = lastActiveSlave, slaves = lastS } } - if(activeSlave.ID != PC.ID) + if(activeSlave.ID !== PC.ID) maybeAddSpouseToChild(activeSlave); maybeAddSpouseToChild(getSlave(-1)); - for(var i = 0; i < slaves.length; ++i) { + for(let i = 0; i < slaves.length; ++i) { var child = slaves[i]; - if(child.ID != activeSlave.ID) + if(child.ID !== activeSlave.ID) maybeAddSpouseToChild(child); } - for(var key in spouseToChild) { + for(let key in spouseToChild) { if(spouseToChild.hasOwnProperty(key)) { var children = shouldAddChildren?spouseToChild[key]:[]; - var spouse = getSlave(key, (slaves.genes=="XX")?"unknownXY":(slaves.genes=="XY")?"unknownXX":"unknown"); + var spouse = getSlave(key, (slaves.genes === "XX")?"unknownXY":(slaves.genes === "XY")?"unknownXX":"unknown"); var spouseName; - if (spouse.ID != slave.ID){ - spouseName = spouse.slaveName + (spouse.physicalAge?(" (" + spouse.physicalAge + ")"):"") + if (spouse.ID !== slave.ID){ + spouseName = spouse.slaveName + (spouse.physicalAge?(" (" + spouse.physicalAge + ")"):""); } else { - spouseName = (spouse.ID==-1)?"(yourself)":"(themselves)"; + spouseName = (spouse.ID === -1)?"(yourself)":"(themselves)"; } var marriage = { "spouse": {"name": spouseName, "class": spouse.genes}, - "children": children.map(function (x) { return slaveInfo_(x, activeSlaveId, slavesAdded, depth + 1);} ), + "children": children.map(function (x) { return slaveInfo_(x, activeSlaveId, slavesAdded, depth + 1);} ), /** FIXME: Functions declared within loops referencing an outer scoped variable may lead to confusing semantics. (slaveInfo_, activeSlaveId, slavesAdded, depth) (W083)jshint(W083) */ }; data.marriages.push(marriage); } @@ -597,7 +600,7 @@ window.updateFamilyTree = function(activeSlave = lastActiveSlave, slaves = lastS return data; } - if (activeSlave == PC || activeSlave == null) + if (activeSlave === PC || activeSlave === null) activeSlave = getSlave(-1); const treeData = [slaveInfo(activeSlave, activeSlave.ID)]; console.log("Family tree is", treeData, 'and has:', numTreeNodes); diff --git a/src/js/generateNewSlaveJS.js b/src/js/generateNewSlaveJS.js index 42124482003092bec6d136a017f51a8eba0365fd..80f4198597ce2c16f646e63389d429cde71a3a03 100644 --- a/src/js/generateNewSlaveJS.js +++ b/src/js/generateNewSlaveJS.js @@ -1,3 +1,4 @@ +/* eslint-disable no-undef */ window.GenerateNewSlave = (function(){ 'use strict'; let V, chance; @@ -222,7 +223,7 @@ window.GenerateNewSlave = (function(){ slave.preg = 0; if (slave.physicalAge <= 13) { - if (slave.geneticQuirks.wellHung == 2) { + if (slave.geneticQuirks.wellHung === 2) { if (slave.physicalAge >= 8) { slave.dick = jsEither([2, 2, 3, 3, 4]); } else { @@ -238,7 +239,7 @@ window.GenerateNewSlave = (function(){ } slave.scrotum = slave.balls; } else if (slave.physicalAge <= 15) { - if (slave.geneticQuirks.wellHung == 2) { + if (slave.geneticQuirks.wellHung === 2) { slave.dick = jsEither([3, 3, 4, 4, 5]); } else { slave.dick = jsEither([1, 1, 1, 2, 2, 2, 3]); @@ -250,7 +251,7 @@ window.GenerateNewSlave = (function(){ } slave.scrotum = slave.balls; } else if (slave.physicalAge <= 17) { - if (slave.geneticQuirks.wellHung == 2) { + if (slave.geneticQuirks.wellHung === 2) { slave.dick = jsEither([4, 4, 5, 5, 6]); } else { slave.dick = jsEither([1, 1, 2, 2, 3, 3]); @@ -262,7 +263,7 @@ window.GenerateNewSlave = (function(){ } slave.scrotum = slave.balls; } else { - if (slave.geneticQuirks.wellHung == 2) { + if (slave.geneticQuirks.wellHung === 2) { slave.dick = jsEither([5, 5, 6]); } else { slave.dick = jsEither([1, 2, 2, 2, 3, 3, 3, 4, 4, 5]); @@ -273,7 +274,7 @@ window.GenerateNewSlave = (function(){ slave.balls = jsEither([1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 5]); } if (slave.balls !== 0) { - if (slave.geneticQuirks.wellHung == 2) { + if (slave.geneticQuirks.wellHung === 2) { slave.balls++; } slave.scrotum = slave.balls + jsEither([0, 0, 1]); @@ -1103,13 +1104,13 @@ window.GenerateNewSlave = (function(){ slave.geneticQuirks.hyperFertility = 1; } chance = jsRandom(1,20000); - if (chance == 777) { + if (chance === 777) { slave.geneticQuirks.albinism = 2; } else if (chance >= 19500) { slave.geneticQuirks.albinism = 1; } chance = jsRandom(1,20000); - if (chance == 10001) { + if (chance === 10001) { slave.geneticQuirks.heterochromia = 2; } else if (chance >= 19750) { slave.geneticQuirks.heterochromia = 1; @@ -1131,13 +1132,13 @@ window.GenerateNewSlave = (function(){ if (chance >= 9900) { slave.geneticQuirks.hyperFertility = 1; } - if (chance == 777) { + if (chance === 777) { slave.geneticQuirks.albinism = 2; } else if (chance >= 19500) { slave.geneticQuirks.albinism = 1; } chance = jsRandom(1,20000); - if (chance == 10001) { + if (chance === 10001) { slave.geneticQuirks.heterochromia = 2; } else if (chance >= 19750) { slave.geneticQuirks.heterochromia = 1; @@ -1268,7 +1269,7 @@ window.GenerateNewSlave = (function(){ slave.skin = jsEither(["black", "brown", "dark brown"]); slave.hColor = jsEither(["black", "black", "black", "brown"]); slave.hStyle = jsEither(["crinkled", "neat"]); - if (slave.geneticQuirks.heterochromia == 2) { + if (slave.geneticQuirks.heterochromia === 2) { slave.geneticQuirks.heterochromia = "brown"; } break; @@ -1277,35 +1278,35 @@ window.GenerateNewSlave = (function(){ if (slave.nationality === "German") { slave.skin = jsEither(["fair", "light", "pale"]); slave.eyeColor = jsEither(["blue", "blue", "blue", "brown", "green"]); - if (slave.geneticQuirks.heterochromia == 2) { + if (slave.geneticQuirks.heterochromia === 2) { slave.geneticQuirks.heterochromia = jsEither(["blue", "blue", "blue", "brown", "green"]); } slave.hColor = jsEither(["black", "blonde", "blonde", "blonde", "brown", "red"]); } else if (slave.nationality === "Icelandic") { slave.skin = jsEither(["fair", "light", "pale", "pale"]); slave.eyeColor = jsEither(["blue", "blue", "blue", "brown", "green"]); - if (slave.geneticQuirks.heterochromia == 2) { + if (slave.geneticQuirks.heterochromia === 2) { slave.geneticQuirks.heterochromia = jsEither(["blue", "blue", "blue", "brown", "green"]); } slave.hColor = jsEither(["black", "blonde", "blonde", "blonde", "brown", "red"]); } else if (slave.nationality === "Irish") { slave.skin = jsEither(["fair", "light", "pale", "pale"]); slave.eyeColor = jsEither(["blue", "brown", "green", "green", "green"]); - if (slave.geneticQuirks.heterochromia == 2) { + if (slave.geneticQuirks.heterochromia === 2) { slave.geneticQuirks.heterochromia = jsEither(["blue", "brown", "green", "green", "green"]); } slave.hColor = jsEither(["black", "blonde", "brown", "red", "red", "red"]); } else if (slave.nationality === "Scottish") { slave.skin = jsEither(["fair", "fair", "light", "pale"]); slave.eyeColor = jsEither(["blue", "brown", "brown", "green", "green", "green"]); - if (slave.geneticQuirks.heterochromia == 2) { + if (slave.geneticQuirks.heterochromia === 2) { slave.geneticQuirks.heterochromia = jsEither(["blue", "brown", "brown", "green", "green", "green"]); } slave.hColor = jsEither(["black", "black", "blonde", "red", "red", "red", "brown"]); } else { slave.skin = jsEither(["fair", "light", "pale"]); slave.eyeColor = jsEither(["blue", "brown", "green"]); - if (slave.geneticQuirks.heterochromia == 2) { + if (slave.geneticQuirks.heterochromia === 2) { slave.geneticQuirks.heterochromia = jsEither(["blue", "brown", "green"]); } slave.hColor = jsEither(["black", "blonde", "brown", "red"]); @@ -1316,7 +1317,7 @@ window.GenerateNewSlave = (function(){ slave.lips = jsRandom(5,25); slave.skin = jsEither(["brown", "dark brown", "dark olive", "light olive", "tanned"]); slave.hColor = jsEither(["black", "brown"]); - if (slave.geneticQuirks.heterochromia == 2) { + if (slave.geneticQuirks.heterochromia === 2) { slave.geneticQuirks.heterochromia = jsEither(["blue", "brown", "green"]); } slave.hStyle = "neat"; @@ -1329,7 +1330,7 @@ window.GenerateNewSlave = (function(){ slave.skin = jsEither(["dark", "light"]); slave.hColor = "black"; slave.hStyle = "neat"; - if (slave.geneticQuirks.heterochromia == 2) { + if (slave.geneticQuirks.heterochromia === 2) { slave.geneticQuirks.heterochromia = "brown"; } break; @@ -1338,7 +1339,7 @@ window.GenerateNewSlave = (function(){ slave.skin = jsEither(["dark olive", "light olive", "light"]); slave.hColor = "black"; slave.hStyle = "neat"; - if (slave.geneticQuirks.heterochromia == 2) { + if (slave.geneticQuirks.heterochromia === 2) { slave.geneticQuirks.heterochromia = jsEither(["blue", "brown", "green"]); } break; @@ -1349,7 +1350,7 @@ window.GenerateNewSlave = (function(){ slave.skin = jsEither(["fair", "light olive", "light", "tanned"]); slave.hColor = "black"; slave.hStyle = "neat"; - if (slave.geneticQuirks.heterochromia == 2) { + if (slave.geneticQuirks.heterochromia === 2) { slave.geneticQuirks.heterochromia = jsEither(["blue", "brown", "green"]); } break; @@ -1358,7 +1359,7 @@ window.GenerateNewSlave = (function(){ slave.skin = jsEither(["dark", "light", "pale"]); slave.hColor = jsEither(["black", "black", "black", "black", "blonde", "brown", "brown", "red"]); slave.hStyle = "neat"; - if (slave.geneticQuirks.heterochromia == 2) { + if (slave.geneticQuirks.heterochromia === 2) { slave.geneticQuirks.heterochromia = jsEither(["blue", "brown", "green"]); } } diff --git a/src/js/optionsMacro.js b/src/js/optionsMacro.js index 8fc97a6ff5ec9f62a3ee5c08a64108b84b21b273..daa84fa758168dbfed9d297ad5f554d608d3bb02 100644 --- a/src/js/optionsMacro.js +++ b/src/js/optionsMacro.js @@ -1,3 +1,5 @@ +/* eslint-disable no-console */ +/* eslint-disable no-undef */ /* Use like: <<options $varname "New Passage (defaults to current passage)">> A title @@ -26,7 +28,7 @@ Macro.add('options', { variable like $foo */ if (this.payload[0].args.full && - this.payload[0].args.full != '""' && this.payload[0].args.full != "''") { + this.payload[0].args.full !== '""' && this.payload[0].args.full !== "''") { if (currentOption === undefined) currentOption = false; if (this.payload[0].args.full.startsWith("State.temporary.")) { @@ -39,7 +41,7 @@ Macro.add('options', { } /* First print out the string for the current value */ - for (var i = 1, len = this.payload.length; i < len; ++i) { + for (let i = 1, len = this.payload.length; i < len; ++i) { if (this.payload[i].name === 'option') { if (this.payload[i].args[0] === currentOption) { if (found) { @@ -51,16 +53,16 @@ Macro.add('options', { } else if (this.payload[i].name === 'comment') { comment = this.payload[i].contents; } else { - throw new Error("Only valid tag is 'option' inside 'options'") + throw new Error("Only valid tag is 'option' inside 'options'"); } } } - var showSelectedOption = true; //this.payload.length != 3 || !description; + var showSelectedOption = true; //this.payload.length !== 3 || !description; /* Now print out the list of options */ var output = ""; - for (var i = 1, len = this.payload.length; i < len; ++i) { + for (let i = 1, len = this.payload.length; i < len; ++i) { if (this.payload[i].name === 'option') { var args = this.payload[i].args; if (args.length === 0) { diff --git a/src/js/pregJS.js b/src/js/pregJS.js index 76b33a4e1093271d81bb80a765e488f348c82650..07427e670051d8161c954c1e6149ab7a68b30af3 100644 --- a/src/js/pregJS.js +++ b/src/js/pregJS.js @@ -1,16 +1,17 @@ /* eslint-disable no-undef */ /* Major props to the anons who worked together to forge the Super Pregnancy Project. Let your legacy go unforgotten.*/ window.getPregBellySize = function(s) { + var targetLen; var gestastionWeek = s.preg; var fetuses = s.pregType; var phi = 1.618; if(gestastionWeek <= 32) { - var targetLen = ((0.00006396 * Math.pow(gestastionWeek, 4)) - (0.005501 * Math.pow(gestastionWeek, 3)) + (0.161 * Math.pow(gestastionWeek, 2)) - (0.76 * gestastionWeek) + 0.208); + targetLen = ((0.00006396 * Math.pow(gestastionWeek, 4)) - (0.005501 * Math.pow(gestastionWeek, 3)) + (0.161 * Math.pow(gestastionWeek, 2)) - (0.76 * gestastionWeek) + 0.208); } else if(gestastionWeek <= 106) { - var targetLen = ((-0.0000004675 * Math.pow(gestastionWeek, 4)) + (0.0001905 * Math.pow(gestastionWeek, 3)) - (0.029 * Math.pow(gestastionWeek, 2)) + (2.132 * gestastionWeek) - 16.575); /** FIXME: 'targetLen' is already defined. (W004)jshint(W004) */ + targetLen = ((-0.0000004675 * Math.pow(gestastionWeek, 4)) + (0.0001905 * Math.pow(gestastionWeek, 3)) - (0.029 * Math.pow(gestastionWeek, 2)) + (2.132 * gestastionWeek) - 16.575); /** FIXME: 'targetLen' is already defined. (W004)jshint(W004) */ } else { - var targetLen = ((-0.00003266 * Math.pow(gestastionWeek,2)) + (0.076 * gestastionWeek) + 43.843); + targetLen = ((-0.00003266 * Math.pow(gestastionWeek,2)) + (0.076 * gestastionWeek) + 43.843); } /** FIXME: 'targetLen' is already defined. (W004)jshint(W004) */ var bellySize = ((4 / 3) * (Math.PI) * (phi / 2) * (Math.pow((targetLen / 2), 3)) * fetuses); /** FIXME: 'targetLen' used out of scope. (W038)jshint(W038) */ @@ -384,7 +385,7 @@ window.setPregType = function(actor) { }; /* - Penetrative ability, ability to become pregnant, and canBreed() must be checked outside of this. Designed to assume .eggType == "human". + Penetrative ability, ability to become pregnant, and canBreed() must be checked outside of this. Designed to assume .eggType === "human". target is the slave to get pregnant. Also accepts the PC. chance is the % chance to conceive. hole control's the hole involved (0 - vagina, 1 - ass, 2 - both). .mpreg did this. @@ -408,7 +409,9 @@ window.knockMeUp = function(target, chance, hole, fatherID, displayOverride) { target.pregType = setPregType(target); WombImpregnate(target, target.pregType, target.pregSource, 1); - if (V.menstruation === 1) {} + if (V.menstruation === 1) { + /** FIXME: Empty block statement.eslint(no-empty) */ + } else if (!displayOverride) { target.pregKnown = 1; if (target.ID === -1) { @@ -434,7 +437,9 @@ window.knockMeUp = function(target, chance, hole, fatherID, displayOverride) { target.pregType = setPregType(target); WombImpregnate(target, target.pregType, target.pregSource, 1); - if (V.menstruation === 1) {} + if (V.menstruation === 1) { + /** FIXME: Empty block statement.eslint(no-empty) */ + } else if (!displayOverride) { target.pregKnown = 1; if (target.ID === -1) { @@ -493,18 +498,18 @@ window.adjustFatherProperty = function(actor, property, newValue) { let V = State.variables; let fatherIndex; - fatherIndex = V.slaves.findIndex(function(s) { return s.ID == actor.ID; }); + fatherIndex = V.slaves.findIndex(function(s) { return s.ID === actor.ID; }); if (fatherIndex > 0) { V.slaves[fatherIndex][property] = newValue; } else if (V.incubator > 0) { - fatherIndex = V.tanks.findIndex(function(s) { return s.ID == actor.ID; }); + fatherIndex = V.tanks.findIndex(function(s) { return s.ID === actor.ID; }); if (fatherIndex > 0) { V.tanks[fatherIndex][property] = newValue; } } if (fatherIndex === -1) { if (V.nursery > 0) { - fatherIndex = V.cribs.findIndex(function(s) { return s.ID == actor.ID; }); + fatherIndex = V.cribs.findIndex(function(s) { return s.ID === actor.ID; }); if (fatherIndex !== -1) { V.cribs[fatherIndex][property] = newValue; } diff --git a/src/js/quickListJS.js b/src/js/quickListJS.js index 0d844d95609ccbf785fae474868d97aa98b26499..b9cfec3f418ba29127880904a7d3437f5ab12dd8 100644 --- a/src/js/quickListJS.js +++ b/src/js/quickListJS.js @@ -1,3 +1,4 @@ +/* eslint-disable no-undef */ window.sortDomObjects = function (objects, attrName, reverse = 0) { reverse = (reverse) ? -1 : 1; function sortingByAttr (a, b) { @@ -8,7 +9,7 @@ window.sortDomObjects = function (objects, attrName, reverse = 0) { return ((parseInt(bVal) - aInt) * reverse); else if (bVal > aVal) return -1 * reverse; - return ((aVal == bVal) ? 0 : 1) * reverse; + return ((aVal === bVal) ? 0 : 1) * reverse; } return objects.toArray().sort(sortingByAttr); }; diff --git a/src/js/rbuttonJS.js b/src/js/rbuttonJS.js index aee998bf910a3a1f4e8883835d61bd5e06e27cd6..06ff286cd4942cb79649c975b599252f20a91c30 100644 --- a/src/js/rbuttonJS.js +++ b/src/js/rbuttonJS.js @@ -1,3 +1,4 @@ +/* eslint-disable no-undef */ /* This is modified radiobutton macro, for automatic checked state setup*/ /* Usage (be sure to use quotes around parameters): @@ -73,7 +74,7 @@ Macro.add('rbutton', { var replaceEl = document.getElementById(replaceID); //alert (replaceEl); - if (replaceEl != null) { + if (replaceEl !== null) { replaceEl.innerHTML = replaceText; } @@ -86,7 +87,7 @@ Macro.add('rbutton', { var replaceEl = document.getElementById(replaceID); //alert (replaceEl); - if (replaceEl != null) { + if (replaceEl !== null) { replaceEl.innerHTML = replaceText; } @@ -97,7 +98,7 @@ Macro.add('rbutton', { /* Set the story variable to the checked value and the input element to checked, if requested. */ - if (initValue == checkValue) { + if (initValue === checkValue) { el.checked = true; Wikifier.setValue(varName, checkValue); } diff --git a/src/js/rulesAssistantOptions.js b/src/js/rulesAssistantOptions.js index 2b61cf819ea041c8828c3563df4443d660adb56c..1838c5c63dad22930c4891841d1db527a278656b 100644 --- a/src/js/rulesAssistantOptions.js +++ b/src/js/rulesAssistantOptions.js @@ -1,3 +1,4 @@ +/* eslint-disable no-unused-vars */ /* eslint-disable no-undef */ // rewrite of the rules assistant options page in javascript // uses an object-oriented widget pattern @@ -22,7 +23,7 @@ window.rulesAssistantOptions = (function() { else current_rule = V.defaultRules[idx]; } - const root = new Root(element); /** FIXME: 'root' is declared but its value is never read.ts(6133) */ + const root = new Root(element); } function returnP(e) { return e.keyCode === 13; } diff --git a/src/js/sexActsJS.js b/src/js/sexActsJS.js index 0b0291db3d5b18d9c4ce9bac0b06b593160b4fa9..f7d8af1a04120583cc9781fec97e59e49ec39625 100644 --- a/src/js/sexActsJS.js +++ b/src/js/sexActsJS.js @@ -1,3 +1,5 @@ +/* eslint-disable no-unused-vars */ +/* eslint-disable no-undef */ /* times is how many times to increment the anal counts. if left undefined it will assume it to be 1. @@ -373,7 +375,7 @@ window.SimpleSexAct = function SimpleSexAct(slave, count) { if (count) { fuckCount = count; } - for (var i = 0; i < fuckCount; i++) { + for (let i = 0; i < fuckCount; i++) { fuckTarget = jsRandom(1, 100); if (slave.nipples === "fuckable" && V.PC.dick === 1 && fuckTarget > 80) { V.mammaryTotal += 1; @@ -412,7 +414,7 @@ window.SimpleSlaveFucking = function SimpleSlaveFucking(slave, count) { if (count) { fuckCount = count; } - for (var i = 0; i < fuckCount; i++) { + for (let i = 0; i < fuckCount; i++) { fuckTarget = jsRandom(1, 100); if (slave.nipples === "fuckable" && fuckTarget > 80) { V.mammaryTotal += 1; @@ -446,7 +448,7 @@ window.SimpleSlaveSlaveFucking = function SimpleSlaveSlaveFucking(subslave, doms if (count) { fuckCount = count; } - for (var j = 0; j < fuckCount; j++) { + for (let j = 0; j < fuckCount; j++) { //there is a reason randomization happens inside cycle - to spread fuck around, otherwise cycle isn't even needed fuckTarget = jsRandom(1, 100); if (subslave.nipples === "fuckable" && canPenetrate(domslave) && fuckTarget > 80) { diff --git a/src/js/slaveCostJS.js b/src/js/slaveCostJS.js index 8aa75bdaf377fb909b9fc649ff4d00ef278ec5db..1339c626047b25e8985575bea6ee7ed7a814d72d 100644 --- a/src/js/slaveCostJS.js +++ b/src/js/slaveCostJS.js @@ -1,3 +1,4 @@ +/* eslint-disable no-undef */ window.Beauty = (function() { "use strict"; let V, arcology, beauty; @@ -1083,7 +1084,7 @@ window.Beauty = (function() { if (arcology.FSChattelReligionist > 40 && arcology.FSBodyPurist === "unset") { let tats = ["anusTat", "armsTat", "backTat", "boobsTat", "buttTat", "dickTat", "legsTat", "lipsTat", "shouldersTat", "stampTat", "vaginaTat"]; let sacrilegeCount = 0; - for (var index in tats) { + for (let index in tats) { if (slave[index] === "sacrilege") { sacrilegeCount++; } @@ -1191,7 +1192,7 @@ window.Beauty = (function() { /** @param {App.Entity.SlaveState} slave */ function calcMultipliersBeauty(slave) { calcBellyBeauty(slave); - if (slave.geneticQuirks.albinism == 2) { + if (slave.geneticQuirks.albinism === 2) { beauty += 0.1*beauty; } if (slave.breedingMark === 1) { diff --git a/src/js/slaveStatsChecker.js b/src/js/slaveStatsChecker.js index e1cdfe727f2462491e57f8f9c57b5c04eedbf6ef..12b4ef0ec3caa4e15235a8d6ee8dc10ec6c1f1b8 100644 --- a/src/js/slaveStatsChecker.js +++ b/src/js/slaveStatsChecker.js @@ -1,3 +1,4 @@ +/* eslint-disable no-undef */ window.SlaveStatsChecker = (function() { return { checkForLisp: hasLisp, @@ -171,7 +172,7 @@ window.canGetPregnant = /** @param {App.Entity.SlaveState} slave */ function(sla } }; -/** contraceptives (.preg == -1) do not negate this function +/** contraceptives (.preg === -1) do not negate this function * @param {App.Entity.SlaveState} slave */ window.isFertile = function(slave) { if (!slave) { diff --git a/src/js/slaveSummaryWidgets.js b/src/js/slaveSummaryWidgets.js index fa8ff6642dddbc7aa7bbef0b79ba44a89ccae6d3..edcf03c510c9c9257b073b4e77a44f6946b6d202 100644 --- a/src/js/slaveSummaryWidgets.js +++ b/src/js/slaveSummaryWidgets.js @@ -1,3 +1,4 @@ +/* eslint-disable no-unused-vars */ /* eslint-disable no-undef */ window.clearSummaryCache = /** @param {App.Entity.SlaveState | number} slave */ function clearSummaryCache(slave) { if (!slave) @@ -4906,9 +4907,9 @@ App.UI.slaveSummaryList = function (passageName) { */ if (((_Count > 1) && (_indexed === 0) && (((passageName === 'Main') && (V.Flag === undefined) && ((V.useSlaveSummaryTabs === 0) || (V.slaveAssignmentTab === "all"))) || (V.Flag === 1)))) { - let _indexed = 1, /** FIXME: '_indexed' is declared but its value is never read.ts(6133) */ - _counter = 0, /** FIXME: '_counter' is declared but its value is never read.ts(6133) */ - _buttons = [], + let _indexed = 1; + _counter = 0; + _buttons = []; _offset = -50; if (/Select/i.test(passageName)) { _offset = -25; diff --git a/src/js/utilJS.js b/src/js/utilJS.js index 1c7840db63d7d6f844fb8f98326f14392691b8ad..6b50a76a7d45ee2caaea68976d0e3c7cdd164aef 100644 --- a/src/js/utilJS.js +++ b/src/js/utilJS.js @@ -1,3 +1,4 @@ +/* eslint-disable no-unused-vars */ /* eslint-disable no-console */ /* eslint-disable no-undef */ /* @@ -683,7 +684,7 @@ window.massFormat = function (s) { }; window.budgetLine = function(category, title) { - const V = State.variables; + const V = State.variables; // TODO: convert budgetLine references to JS let income; let expenses; let profits; diff --git a/src/js/walkPastJS.js b/src/js/walkPastJS.js index d2ed0f66621b58703a855d96cba72353ae4885c9..ca56e19c2cee92cb7f1c22b3b2a073a088c65ffc 100644 --- a/src/js/walkPastJS.js +++ b/src/js/walkPastJS.js @@ -1,3 +1,5 @@ +/* eslint-disable no-unused-vars */ +/* eslint-disable no-undef */ /* temporary container until the entire thing is complete. No point in not deploying the working functions, you know? */ window.primeSlave = function(activeSlave, seed) { @@ -68,7 +70,7 @@ window.loverSlave = function(activeSlave) { var _seed = jsRandom(1,100); var _fuckSpot; - if (_partnerSlave != undefined) { + if (_partnerSlave !== undefined) { var pronouns2 = getPronouns(_partnerSlave); var he2 = pronouns2.pronoun, him2 = pronouns2.object, his2 = pronouns2.possessive, hers2 = pronouns2.possessivePronoun, himself2 = pronouns2.objectReflexive, boy2 = pronouns2.noun; @@ -163,7 +165,7 @@ window.loverSlave = function(activeSlave) { } else if (canDoAnal(activeSlave) && activeSlave.anus > 0 && _fuckSeed > 10) { if (canPenetrate(_partnerSlave)) { t += `${partnerName} is enthusiastically fucking ${name}'s ass.`; - } else if (_partnerSlave.amp != 1) { + } else if (_partnerSlave.amp !== 1) { t += `${partnerName} is enthusiastically fisting ${name}'s ass.`; } else { t += `${partnerName} is enthusiastically pounding ${name}'s ass with a dildo.`; @@ -185,7 +187,7 @@ window.loverSlave = function(activeSlave) { } } else { t += `${name} loves having ${his} breasts suckled and has ${partnerName}'s lips wrapped around a nipple. `; - if (activeSlave.amp != 1) { + if (activeSlave.amp !== 1) { t += `${partnerName} is held close until ${his2} ${activeSlaveRel} has been completely emptied.`; } else { t += `${partnerName} knows that ${his2} ${activeSlaveRel} can't milk ${himself} and appreciates the act.`; @@ -461,7 +463,7 @@ window.loverSlave = function(activeSlave) { } else if (activeSlave.dick > 0 && _fuckSeed > 50) { t += `${name} is deepthroating ${partnerName} as ${he2} struggles to breath.`; } else if (canDoVaginal(activeSlave) && _fuckSeed > 30) { - if (canPenetrate(_partnerSlave) && activeSlave.vagina != 0) { + if (canPenetrate(_partnerSlave) && activeSlave.vagina !== 0) { if (_fuckSeed > 45 && _partnerSlave.amp !== 1) { t += `${name} is forcing ${partnerName} to hold ${him} aloft as ${he} enjoys a good vaginal pounding from an unwilling partner.`; } else if (_fuckSeed > 40 && activeSlave.amp !== 1 && _partnerSlave.amp !== 1) { @@ -479,7 +481,7 @@ window.loverSlave = function(activeSlave) { } else if (canDoAnal(activeSlave) && canPenetrate(_partnerSlave) && _fuckSeed > 10 && activeSlave.anus !== 0) { if (_fuckSeed > 20 && activeSlave.amp !== 1) { t += `${name} is forcing ${partnerName} to hold ${him} aloft as ${he} enjoys a good anal pounding from an unwilling partner.`; - } else if (_fuckSeed > 10 && activeSlave.amp != 1 && _partnerSlave.amp !== 1) { + } else if (_fuckSeed > 10 && activeSlave.amp !== 1 && _partnerSlave.amp !== 1) { t += `${name} has ${partnerName} pinned against the wall and is taking ${his2} dick in ${his} ass by force.`; } else { t += `${name} has ${partnerName} on ${his2} back and is anally riding ${his2} dick while ${he2} tries to buck ${him} off.`; @@ -889,9 +891,9 @@ window.loverSlave = function(activeSlave) { } else { t += `on ${name}'s bedroll `; } - t += `${fuckspot}, having gentle anal sex while spooning. ${name} is enjoying ${partnerName}'s ass, and is doing ${his} best to ensure ${his} ${activeSlaveRel} enjoys being buttfucked. ${He}'s nibbling ${his} ${activeSlaveRel}'s ` + t += `${fuckspot}, having gentle anal sex while spooning. ${name} is enjoying ${partnerName}'s ass, and is doing ${his} best to ensure ${his} ${activeSlaveRel} enjoys being buttfucked. ${He}'s nibbling ${his} ${activeSlaveRel}'s `; if (_partnerSlave.earShape !== "none") { - t +=`ears and ` + t +=`ears and `; } t += `neck, cupping a breast with one hand, and lightly stimulating ${him2} with the other.`; } else if (activeSlave.clit > 2 && canDoAnal(_partnerSlave) && _partnerSlave.anus > 0 && _partnerSlave.amp !== 1 && activeSlave.amp !== 1) { @@ -911,9 +913,9 @@ window.loverSlave = function(activeSlave) { } else { t += `on ${name}'s bedroll `; } - t += `${fuckspot}, spooning while ${name} gently rubs ${his} cock between ${partnerName}'s thighs, pressed tightly together. Since ${partnerName} is a virgin, this is the closest they can come to penetrative intercourse, but ${name} is enjoying ${partnerName}'s body anyway, and is doing ${his} best to ensure ${his} ${activeSlaveRel} enjoys ${himself2}. ${He}'s nibbling ${his} ${activeSlaveRel}'s ` + t += `${fuckspot}, spooning while ${name} gently rubs ${his} cock between ${partnerName}'s thighs, pressed tightly together. Since ${partnerName} is a virgin, this is the closest they can come to penetrative intercourse, but ${name} is enjoying ${partnerName}'s body anyway, and is doing ${his} best to ensure ${his} ${activeSlaveRel} enjoys ${himself2}. ${He}'s nibbling ${his} ${activeSlaveRel}'s `; if (_partnerSlave.earShape !== "none") { - t +=`ears and ` + t +=`ears and `; } t += `neck, cupping a breast with one hand, and lightly stimulating ${him2} with the other.`; } else if (activeSlave.clit > 2 && canDoVaginal(activeSlave) && _partnerSlave.amp !== 1 && activeSlave.amp !== 1) { @@ -948,9 +950,9 @@ window.loverSlave = function(activeSlave) { } else { t += `on ${name}'s bedroll `; } - t += `${fuckspot}, having gentle anal sex while spooning. ${name} is enjoying penetrating ${partnerName}'s ass with a strap-on, and is doing ${his} best to ensure ${his} ${activeSlaveRel} enjoys being buttfucked. ${He}'s nibbling ${his} ${activeSlaveRel}'s ` + t += `${fuckspot}, having gentle anal sex while spooning. ${name} is enjoying penetrating ${partnerName}'s ass with a strap-on, and is doing ${his} best to ensure ${his} ${activeSlaveRel} enjoys being buttfucked. ${He}'s nibbling ${his} ${activeSlaveRel}'s `; if (_partnerSlave.earShape !== "none") { - t +=`ears and ` + t +=`ears and `; } t += `neck, cupping a breast with one hand, and lightly stimulating ${him} with the other.`; } else if (_partnerSlave.amp !== 1 && activeSlave.amp !== 1) { @@ -1067,7 +1069,7 @@ window.loverSlave = function(activeSlave) { t += `${name} is spooning ${his} ${activeSlaveRel} possessively, ${his} rounded belly pushing into ${his2} back.`; } else if (_partnerSlave.belly >= 5000) { t += `${name} is spooning ${his} ${activeSlaveRel} possessively`; - if (activeSlave.amp != 1) { + if (activeSlave.amp !== 1) { t += `, and even in ${his} sleep, has a proprietary hand on ${partnerName}'s belly`; } t += `.`; @@ -1103,9 +1105,9 @@ window.loverSlave = function(activeSlave) { case "cutting": t += `seeing to their chores together. ${name} `; if (canTalk(activeSlave) && canHear(_partnerSlave)) { - t += `is making biting remarks about another one of your other slaves, with which ${his} ${activeSlaveRel} agrees tolerantly.`; + t += `is making biting remarks about another one of your other slaves, with which ${his} ${activeSlaveRel} agrees tolerantly.`; } else { - t += `is making ${his} thoughts about another one of your other slaves clear to ${his} ${activeSlaveRel}.`; + t += `is making ${his} thoughts about another one of your other slaves clear to ${his} ${activeSlaveRel}.`; } break; case "funny": @@ -1120,7 +1122,7 @@ window.loverSlave = function(activeSlave) { } t += `with ${his} antics.`; } - break + break; case "fitness": t += `have just woken up. `; if (activeSlave.amp !== 1) { @@ -1128,7 +1130,7 @@ window.loverSlave = function(activeSlave) { } else { t += `${name} is doing ${his} morning exercises, and ${his} ${activeSlaveRel} is sleepily sitting nearby, providing moral support.`; } - break + break; case "insecure": t += `have just woken up. ${name} is getting dressed when ${his} ${activeSlaveRel} `; if ( (canTalk(_partnerSlave) && canHear(activeSlave)) || (_partnerSlave.amp !== 1 && canSee(activeSlave)) ) { @@ -1146,7 +1148,7 @@ window.loverSlave = function(activeSlave) { } else { t += `blushing, ${he} seems to be substituting in the occasional lewd act.`; } - break + break; case "advocate": if (canTalk(activeSlave)) { t += `starting a meal together. A third, less well trained slave has asked ${name} an innocent question, and is getting enthusiastic slave dogma in return. ${His} ${activeSlaveRel} smiles tolerantly.`; @@ -1232,7 +1234,7 @@ window.loverSlave = function(activeSlave) { t += ` Lover not found!`; } return t; -} +}; window.relatedSlave = function(activeSlave) { const V = State.variables; @@ -1827,9 +1829,6 @@ window.walkPasts = function(slave, _seed) { t += `under ${V.Schoolteacher.slaveName}, perhaps literally; `; } break; - case "be a subordinate slave": - t += `service your other slaves; `; - break; case "be the Attendant": t += `look after the slaves in ${V.spaName}; `; break; @@ -1868,12 +1867,12 @@ window.walkPasts = function(slave, _seed) { window.boobWatch = function(slave) { /* will be moved up once this becomes a single, contained function. */ - let t = "" - let V = State.variables + let t = ""; + let V = State.variables; - let pronouns = getPronouns(slave) - let he = pronouns.pronoun, him = pronouns.object, his = pronouns.possessive, hers = pronouns.possessivePronoun, himself = pronouns.objectReflexive, boy = pronouns.noun - let He = capFirstChar(he), His = capFirstChar(his) + let pronouns = getPronouns(slave); + let he = pronouns.pronoun, him = pronouns.object, his = pronouns.possessive, hers = pronouns.possessivePronoun, himself = pronouns.objectReflexive, boy = pronouns.noun; + let He = capFirstChar(he), His = capFirstChar(his); let breasts = (slave.boobs < 300) ? `flat chest` : `breasts`; @@ -2250,7 +2249,7 @@ window.boobWatch = function(slave) { // ends needs work block case "no clothing": - if (slave.chastityAnus == 1 || slave.chastityVagina == 1 || slave.chastityPenis == 1) { + if (slave.chastityAnus === 1 || slave.chastityVagina === 1 || slave.chastityPenis === 1) { t += `Since ${he}'s wearing nothing but a chastity belt, ${his} ${(slave.boobs < 300) ? 'non-existent ' : ''}breasts are delightfully naked.`; } else { t += `${His} naked `; @@ -2420,9 +2419,9 @@ window.buttWatch = function(slave) { t += `${His} tight skirt flatters ${his} ass.`; break; case "a schoolgirl outfit": - if (slave.anus == 0) { + if (slave.anus === 0) { t += `This schoolgirl clearly needs to lose ${his} anal virginity.`; - } else if (slave.vagina == 0) { + } else if (slave.vagina === 0) { t += `This schoolgirl clearly takes it up the ass; that way, ${he} can remain a virgin, and be, like, totally pure and innocent.`; } else { t += `This schoolgirl clearly takes it up the ass.`; @@ -2508,7 +2507,7 @@ window.buttWatch = function(slave) { t += `${His} dress can be lifted easily enough to get as ${his} rear.`; break; case "a hanbok": - t += `${His} hanbok can be lifted easily enough to get as ${his} ` + t += `${His} hanbok can be lifted easily enough to get as ${his} `; if (slave.butt > 7) { t += `rear and its motion beneath the fabric certainly invites it.`; } else {