diff --git a/src/SpecialForce/Firebase.tw b/src/SpecialForce/Firebase.tw index 586932152b42c86830f35a9d384c600ae8994a71..8392508f226c90875091490d0abf9e5df191c629 100644 --- a/src/SpecialForce/Firebase.tw +++ b/src/SpecialForce/Firebase.tw @@ -130,7 +130,7 @@ is in no condition initially to greet you. She's naked except for one sock that gives you a very good view of her muscled, taut body while lunging with her feet on the table and the rest on her couch. She is face-down in a drugged-out stupor in the middle of a wide variety of powders and pills. Perhaps sensing your approach, her head suddenly shoots up and looks at you with unfocused, bloodshot eyes. "Sorry, <<= SFCR()>>," she slurs, wiping her face and weakly holding up a hand. "Hold on a second, I need something to help me out here. Long fucking night." She struggles to sit on the couch and bending over the table, loudly snorts up some of the white powder on it. "Ahhh, fuck," she says, breathing heavily.<br><br> She shakes her head powerfully now looking at you, her eyes once again alert and piercing. "That's better," she says, leaning back on the couch and giving you another good view of her assets. "So, <<= SFCR()>>," she begins, "what brings you down here to our little clubhouse? I trust you're happy with how we've been handling things out there?" You nod. "Excellent", she laughs. "I have to say; it's nice to have a place like this while having some top-end gear and to be able to have fun out there without worrying about anyone coming back on us. Good fucking times." She laughs again. "So — I'm assuming you want something?" <<elseif random(0,100) > 70 && $SF.Depravity >= 1.5 && $SF.Colonel.Core == "cruel">> is relaxing on her couch stark naked, greeting you with a raised hand. Between her tightly clenched legs is a slave girl being forced to eat her out. "Hey, <<= SFCR()>>, what's —" she breaks off as a flash of pain crosses her features. "Fucking bitch!" she exclaims, pulling her legs away and punching the slave girl in the face. She pushes the girl to the ground, straddling her then begins hitting. You hear one crunch after another as The Colonel's powerful blows shatter the girl's face. She hisses from between clenched teeth, each word accompanied by a brutal punch. "How. Many. Fucking. Times. Have. I. Told. You. To. Watch. Your. Fucking. Teeth. On. My. Fucking. Clit!" She leans back, exhaling heavily. Before leaning back down to grip apply pressure onto the girl's neck with her powerful hands. Wordlessly, she increases the pressure and soon the girl begins to turn blue as she struggles to draw breath. Eventually her struggles weaken and then finally, end.<br><br> The Colonel relaxes her grip then wipes her brow, clearing away the sweat from her exertion. Finally rising from the girl's body, relaxing back on the couch and putting her feet back up on the table. "Sorry about that <<= SFCR()>>," she says, shrugging. "So many of these bitches we pick up from the outside don't understand that they have to behave." Shaking her head in frustration, "Now I need to find another one. But that's not your problem — you're here to talk business. So, what's up?" - >>else>> + <<else>> is topless while reviewing the particulars of her unit on a tablet as you approach. She raises a hand in greeting. "Hey <<= SFCR()>>," she says, noticing you looking at her chest. She laughs. "Nice, aren't they? But they're not for you or them." She throws a thumb at the plaza around her. "You're down here for a reason, though. What can I do for you?" <</if>> </div> <<if _S.Firebase === 10>> diff --git a/src/SpecialForce/SpecialForce.js b/src/SpecialForce/SpecialForce.js index 69ac209caa4799173ecc24690500cf4fbd1a813d..904072d4f7d38b4b8323631b4902e2550bb3a829 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..39468cc85b66d2f272a5ab043b5368c4e11f1723 100644 --- a/src/art/vector/VectorArtJS.js +++ b/src/art/vector/VectorArtJS.js @@ -1,3 +1,5 @@ +/* eslint-disable no-case-declarations */ +/* eslint-disable no-undef */ window.VectorArt = (function () { "use strict"; let V, T, slave; @@ -1052,7 +1054,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 +2642,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..762a4b22599b2306f4dad2e1425c487e47620346 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]; @@ -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..5675664ec6d6537aa37c7309676c06da467d7f70 100644 --- a/src/debugging/debugJS.js +++ b/src/debugging/debugJS.js @@ -1,3 +1,5 @@ +/* eslint-disable no-empty */ +/* 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,12 +19,15 @@ 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') { + } 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])) { - diff[k] = kDiff; + } else { + kDiff = difference(o1[k], o2[k]) + if (kDiff) { + diff[k] = kDiff; + } } } for (k in o2) { @@ -51,11 +56,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 +78,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 +110,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 71f64c25d2d96561fc8dfc3e51baaaafc322db00..b52e964369b6070163719370cb98fbb984915631 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"}); @@ -273,7 +275,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"}); } @@ -295,7 +297,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"}); } @@ -311,7 +313,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"}); } @@ -330,7 +332,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"}); @@ -342,7 +344,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"}); @@ -353,10 +355,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"}); @@ -374,7 +376,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"}); @@ -398,7 +400,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"}); } @@ -420,7 +422,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"}); @@ -432,40 +434,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"}); } @@ -486,7 +488,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"}); @@ -499,7 +501,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"}); @@ -549,7 +551,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")) { @@ -642,14 +644,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"}); } @@ -664,7 +666,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"}); @@ -693,7 +695,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"}); } @@ -722,38 +724,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"}); } @@ -780,11 +782,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"}); } @@ -792,29 +794,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"}); @@ -831,10 +833,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"}); } @@ -842,29 +844,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"}); @@ -913,11 +915,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"}); } @@ -950,30 +952,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"}); @@ -994,9 +996,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"}); @@ -1005,7 +1007,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"}); @@ -1034,19 +1036,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"}); @@ -1056,20 +1058,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..a1dbca384f12e997e9f1ae611062b7fd84892079 100644 --- a/src/endWeek/saServant.js +++ b/src/endWeek/saServant.js @@ -1,19 +1,21 @@ +/* eslint-disable no-unused-vars */ +/* 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 +31,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 +66,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 +81,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 +94,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 +113,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 +125,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 +150,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 +171,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/facilities/nursery/childSummary.tw b/src/facilities/nursery/childSummary.tw index 3fc4168fc5aa58659a4083267b8596ad5f0b7d62..cb3b48b4025de4e187cf84a6b5ac0b42388d7b7b 100644 --- a/src/facilities/nursery/childSummary.tw +++ b/src/facilities/nursery/childSummary.tw @@ -13,8 +13,8 @@ }>> <<set _Pass = passage(), _CL = $cribs.length, $assignTo = _Pass, _indexed = 0, _passagePreFilter = (c => c.assignment != "be your agent" && c.assignment != "live with your agent" && (!setup.passagePreFilters.hasOwnProperty(_Pass) || setup.passagePreFilters[_Pass](c))), - _filteredSlaveIdxs = $cribs.map(function(slave, idx) { return _passagePreFilter(slave) ? idx : null; }).filter(function(idx) { return idx !== null; }), - _indexSlavesIdxs = $cribs.map(function(slave, idx) { return _passagePreFilter(slave) ? idx : null; }).filter(function(idx) { return idx !== null; })>> + _filteredSlaveIdxs = $cribs.map(function(slave, idx) { return _passagePreFilter(slave) ? idx : null; }).filter(function(idx) { return idx != null; }), + _indexSlavesIdxs = $cribs.map(function(slave, idx) { return _passagePreFilter(slave) ? idx : null; }).filter(function(idx) { return idx != null; })>> <<for !_.isUndefined(_csi = _filteredSlaveIdxs.shift())>> <<set _Child = $cribs[_csi]>> <<set _childName = SlaveFullName(_Child);>> diff --git a/src/js/DefaultRules.js b/src/js/DefaultRules.js index b2f0873764b066c030465968ce141166760b4841..a6985cba59c0921d3aeaff603916fe9dc928a31e 100644 --- a/src/js/DefaultRules.js +++ b/src/js/DefaultRules.js @@ -1,3 +1,5 @@ +/* eslint-disable no-empty */ +/* eslint-disable no-undef */ // this code applies RA rules onto slaves window.DefaultRules = (function() { @@ -564,8 +566,8 @@ window.DefaultRules = (function() { ProcessAVirginDildos(slave, rule); } else if (slave.vagina > 0) { ProcessNonVirginDildos(slave, rule); - } ProcessVaginalAttachments(slave, rule); + } } /** @param {App.Entity.SlaveState} slave */ @@ -751,6 +753,7 @@ window.DefaultRules = (function() { slave.vaginalAttachment = rule.vaginalAttachment; if (slave.vaginalAccessory !== "none") { switch (slave.vaginalAttachment) { + case "none": r += `<br>${slave.slaveName} has been instructed not to use an attachment for ${his} dildo.`; break; @@ -765,6 +768,7 @@ window.DefaultRules = (function() { } } else { switch (slave.vaginalAttachment) { + case "none": r += `<br>${slave.slaveName} has been instructed not to use any vaginal accessories.`; break; @@ -1045,7 +1049,7 @@ window.DefaultRules = (function() { if ((rule.bellyImplantVol !== undefined) && slave.bellyImplant >= 0 && rule.bellyImplantVol >= 0) { r += "<br>"; if (slave.health > -10 ) { - const diff = rule.bellyImplantVol - slave.bellyImplant; + let diff = rule.bellyImplantVol - slave.bellyImplant; if (diff >= 5000 && slave.bellyPain === 0 && slave.health > 50) { r += `${slave.slaveName}'s belly is way too small, so ${he} has been directed to have intensive belly implant filling procedures throughout this week.`; slave.bellyImplant += 1000; @@ -1146,7 +1150,7 @@ window.DefaultRules = (function() { slave.trust -= 10, slave.devotion -= 10; } else if (slave.fetish === "pregnancy") { r += `${he} did not handle it well.`; - const fetishModifier = (slave.fetishStrength / 2); + let fetishModifier = (slave.fetishStrength / 2); slave.devotion -= (1 * fetishModifier), (slave.trust -= 1 * fetishModifier); } else if (slave.devotion <= 20) { r += `${he} did not handle it well.`; @@ -1633,7 +1637,7 @@ 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.` @@ -1821,7 +1825,7 @@ window.DefaultRules = (function() { slave.curatives = rule.curatives; } } else { - r += `<br>${slave.slaveName} has been ${rule.curatives > 0 ? "put on preventatives" : "taken off health drugs"}.`; + r += `<br>${slave.slaveName} has been ${rule.curatives > 0 ? "put on preventatives" : "taken off health drugs"}`; slave.curatives = rule.curatives; } } diff --git a/src/js/PenthouseNaming.js b/src/js/PenthouseNaming.js index 398e0f58178544e9f062686672c76e67fe155647..9d84a0be2e16073a2fd0d33129007049d9396bf9 100644 --- a/src/js/PenthouseNaming.js +++ b/src/js/PenthouseNaming.js @@ -1,3 +1,4 @@ +/* eslint-disable no-undef */ /** * @return {string} */ diff --git a/src/js/SetBellySize.js b/src/js/SetBellySize.js index 546c270af5145523a820bb47ad2d5e9b5a244d51..963e39484853c09f46297a41a58772c36f1af06c 100644 --- a/src/js/SetBellySize.js +++ b/src/js/SetBellySize.js @@ -1,3 +1,4 @@ +/* eslint-disable no-undef */ /** @param {App.Entity.SlaveState} slave */ window.SetBellySize = function SetBellySize(slave) { diff --git a/src/js/SlaveState.js b/src/js/SlaveState.js index 79dd9a5dd61b66187b5471dbc4b38ea36201d334..8610127e393cb88acc8effe6b7084cbdd9510f82 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 @@ -1887,7 +1887,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..cce8bdfbaaa63d8d6d64a952d02ab793c4c2b21d 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 */ /* @@ -14,7 +16,7 @@ */ postdisplay["doAccordionSet"] = function (content) { - if (variables().useAccordion == 1) { + if (variables().useAccordion === 1) { Array.prototype.slice.call(document.querySelectorAll('.macro-include')) .forEach(function (element) { element.classList.add('accHidden'); @@ -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 6cdae706ccfb32626250c04d86082d5e2d2e807d..e3b1c666adc8b49790f10c1ed4a19ecc07b784f8 100644 --- a/src/js/assayJS.js +++ b/src/js/assayJS.js @@ -1,3 +1,5 @@ +/* eslint-disable no-unused-vars */ +/* eslint-disable no-undef */ window.isSlim = /** @param {App.Entity.SlaveState} slave */ function(slave) { let slim = false; const ArcologyZero = State.variables.arcologies[0]; @@ -347,7 +349,7 @@ window.getSlave = /** @returns {App.Entity.SlaveState} */ function getSlave(ID) }; window.getChild = function getChild(ID) { const V = State.variables; - return V.cribs.find(function(s) { return s.ID == ID; }); + return V.cribs.find(function(s) { return s.ID === ID; }); }; window.getPronouns = /** @param {App.Entity.SlaveState} slave */ function getPronouns(slave) { return { diff --git a/src/js/assignJS.js b/src/js/assignJS.js index b44407d86daa5b5158682405710472dacc23ee91..9da3181848dfbc01a886c0b744183d6c65365224 100644 --- a/src/js/assignJS.js +++ b/src/js/assignJS.js @@ -1,3 +1,5 @@ +/* eslint-disable no-case-declarations */ +/* eslint-disable no-undef */ window.assignJob = function assignJob(slave, job) { "use strict"; const V = State.variables; @@ -249,7 +251,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"; diff --git a/src/js/bugReport.js b/src/js/bugReport.js index b0ace2e4ef770bcdae25c20171e29f4fdcefeee8..5302db55a333a121ab278a62a7f67d349120fb70 100644 --- a/src/js/bugReport.js +++ b/src/js/bugReport.js @@ -1,2 +1,3 @@ +/* eslint-disable */ /*! <<bugreport>> macro for SugarCube 2.x */ !function(){"use strict";if("undefined"==typeof version||"undefined"==typeof version.title||"SugarCube"!==version.title||"undefined"==typeof version.major||version.major<2)throw new Error("<<bugreport>> macro requires SugarCube 2.0 or greater, aborting load");Macro.add("bugreport",{handler:function(){function serializeVariables(varObj,diffObj,doSort){function renderDiff(diff,orig){for(var keys=Object.keys(diff||{}),render=orig?clone(orig):{},i=0,klen=keys.length;klen>i;i++){var p=keys[i],diffP=diff[p];if(diffP===Diff.Op.Delete)delete render[p];else if(Array.isArray(diffP))switch(diffP[0]){case Diff.Op.SpliceArray:try{render.splice(diffP[1],1+(diffP[2]-diffP[1]))}catch(e){}break;case Diff.Op.Copy:render[p]=clone(diffP[1]);break;case Diff.Op.CopyDate:render[p]=new Date(diffP[1])}else{var recurse=renderDiff(diffP,render[p]);0!==Object.keys(recurse).length&&(render[p]=recurse)}}return render}var varList=[],diff=renderDiff(Diff.diff(varObj,diffObj));for(var p in diff){var sName="$"+(-1===p.search(/[^\w]/)?p:'"'+p+'"');varList.push(sName+"="+JSON.stringify(diff[p]))}return doSort&&("function"==typeof doSort?varList.sort(doSort):varList.sort()),0!==varList.length?varList.join(", "):""}var srcMatch,passages,varsPre,varsPost,dialog,dataEl,info=null!=this.args[0]&&Story.has(this.args[0])?Story.get(this.args[0]):null,last=State.length-1,source=unescape(window.location);null!==(srcMatch=/\/([^\/]+)$/.exec(source))&&(source=srcMatch[1]),passages=[];for(var i=0;last>=i;i++)passages.push('"'+State.index(i).title+'"');passages=passages.join(", "),varsPre=serializeVariables(State.index(0).variables,State.index(last).variables),varsPost=serializeVariables(State.index(last).variables,State.variables),dialog=UI.setup("Bug Report","bugreport"),dialog.innerHTML=(null!==info?'<div id="bugreport-info"></div>':"")+'<div><b>Bug report:</b> <a id="bugreport-data-select" class="link-internal macro-bugreport">[Select]</a></div><code id="bugreport-data" tabindex="0"></code>'+(/applewebkit|chrome/.test(Browser.userAgent)?"":'<div class="scroll-pad"> </div>'),dataEl=dialog.querySelector("#bugreport-data"),null!==info&&new Wikifier(dialog.querySelector("#bugreport-info"),info.processText()),addAccessibleClickHandler("#bugreport-data-select",function(self){return function(){jQuery(dataEl).focus(),self.selectData(dataEl)}}(this.self)),insertText(dataEl,"[spoiler][code]"),insertElement(dataEl,"br"),insertText(dataEl,"SOURCE: "+source),insertElement(dataEl,"br"),insertElement(dataEl,"br"),insertText(dataEl,"PASSAGES:"),insertElement(dataEl,"br"),insertText(dataEl,passages),insertElement(dataEl,"br"),insertElement(dataEl,"br"),insertText(dataEl,"VARIABLES (PRE-EXECUTION):"),insertElement(dataEl,"br"),varsPre&&(insertText(dataEl,varsPre),insertElement(dataEl,"br")),insertElement(dataEl,"br"),insertText(dataEl,"VARIABLES (POST-EXECUTION):"),insertElement(dataEl,"br"),varsPost&&(insertText(dataEl,varsPost),insertElement(dataEl,"br")),insertText(dataEl,"[/code][/spoiler]"),UI.open()},selectData:function(e){var s,r;if(window.getSelection){s=window.getSelection();if(s.setBaseAndExtent){var l=(e.innerText.length>1)?e.innerText.length-1:1;try{s.setBaseAndExtent(e,0,e,l)}catch(error){r=document.createRange();r.selectNodeContents(e);s.removeAllRanges();s.addRange(r)}}else{if(window.opera&&e.innerHTML.substring(e.innerHTML.length-4)==='<br>'){e.innerHTML=e.innerHTML+' '}var r=document.createRange();r.selectNodeContents(e);s.removeAllRanges();s.addRange(r)}}else if(document.getSelection){s=document.getSelection();r=document.createRange();r.selectNodeContents(e);s.removeAllRanges();s.addRange(r)}else if(document.selection){r=document.body.createTextRange();r.moveToElementText(e);r.select()}}})}(); diff --git a/src/js/colorModeJS.js b/src/js/colorModeJS.js index a18e3231016867970de95ffc71daf44284514ddb..35f346ec526a30c918d6933a7e71d959bfc9d14c 100644 --- a/src/js/colorModeJS.js +++ b/src/js/colorModeJS.js @@ -1,3 +1,4 @@ +/* eslint-disable no-undef */ window.flipColors = function (lightColorMap) { if (!window.savedColorMap) { window.savedColorMap = setColors(lightColorMap); diff --git a/src/js/dTree.min.js b/src/js/dTree.min.js index b29089b88995fe7df6cab432f07f2e71d7f2e090..a3c51d890ea5194fcd558084455fe68d9db93170 100644 --- a/src/js/dTree.min.js +++ b/src/js/dTree.min.js @@ -1,3 +1,4 @@ +/* eslint-disable */ /* This is the minified version of lodash, d3 and dTree */ ; (function (window, define, exports) { diff --git a/src/js/datatypeCleanupJS.js b/src/js/datatypeCleanupJS.js index dfdeb26ed532159478166a978178ad34289b0d4c..47fbacfcd0173d11a1f0cb87639248be00bd6c58 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/displayVariables.js b/src/js/displayVariables.js index c153952509e31eab3818533944d8eaf82e651061..f78139b5ccf2d9b728c2061a2111ea19b94ac516 100644 --- a/src/js/displayVariables.js +++ b/src/js/displayVariables.js @@ -1,2 +1,3 @@ +/* eslint-disable */ /*! <<checkvars>> macro for SugarCube 2.x */ !function(){"use strict";if("undefined"==typeof version||"undefined"==typeof version.title||"SugarCube"!==version.title||"undefined"==typeof version.major||version.major<2)throw new Error("<<checkvars>> macro requires SugarCube 2.0 or greater, aborting load");Macro.add("checkvars",{handler:function(){function toString(value,indent){var baseType=typeof value;switch(baseType){case"number":return isNaN(value)?"NaN":isFinite(value)?String(value):"Infinity";case"string":return JSON.stringify(value);case"function":return"(function)";default:if("object"!==baseType||null==value)return String(value);var objType=Object.prototype.toString.call(value);if("[object Date]"===objType)return'(object: Date, value: "'+value.toISOString()+'")';if("[object RegExp]"===objType)return"(object: RegExp, value: "+value.toString()+")";var opener,closer,result=[],indentText=" ";return indent||(indent=""),("[object Set]"===objType||value instanceof Set)&&(value=Array.from(value)),Array.isArray(value)?(opener="[\n",closer="\n"+indent+"]",value.forEach(function(p,i){result.push(indent+indentText+i+" ⇒ "+toString(value[i],indent+indentText))}),Object.keys(value).forEach(function(p){/^\d+$/.test(p)||result.push(indent+indentText+toString(p)+" ⇒ "+toString(value[p],indent+indentText))})):"[object Map]"===objType||value instanceof Map?(opener="{\n",closer="\n"+indent+"}",Array.from(value).map(function(kv){result.push(indent+indentText+toString(kv[0],indent+indentText)+" ⇒ "+toString(kv[1],indent+indentText))})):(opener="{\n",closer="\n"+indent+"}",Object.keys(value).forEach(function(p){result.push(indent+indentText+toString(p)+" ⇒ "+toString(value[p],indent+indentText))})),opener+result.join(",\n")+closer}}var dialog,sv=State.variables,names=Object.keys(sv);if(dialog=UI.setup("Story $variables","checkvars"),0===names.length)return dialog.innerHTML="<h1>Story $variables (<code>State.variables</code>):</h1><p><em>No $variables currently set…</em></p>",void UI.open();dialog.innerHTML="<h1>Story $variables (<code>State.variables</code>):</h1><table><thead><tr><th>Name</th><th>Value</th></tr></thead><tbody></tbody></table>"+(/applewebkit|chrome/.test(Browser.userAgent)?"":'<div class="scroll-pad"> </div>');var tbody=dialog.querySelector("tbody");names.sort(function(a,b){return Util.isNumeric(a)&&Util.isNumeric(b)?Number(a)-Number(b):a.localeCompare(b)});for(var i=0;i<names.length;i++){var tr=document.createElement("tr"),tdName=document.createElement("td"),tdValue=document.createElement("td");tdName.textContent="$"+names[i],tdValue.textContent = toString(sv[names[i]]),tr.appendChild(tdName),tr.appendChild(tdValue),tbody.appendChild(tr)}UI.open()}})}(); diff --git a/src/js/eventSelectionJS.js b/src/js/eventSelectionJS.js index c7be5886d5b0bb3efefe02d338291175ab717c0f..00916eef3e3dc3677944de37a9cdadb96c3332cd 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/food.js b/src/js/food.js index 098ff5eb52525ed9bae7fcf40ab69ae244a89d92..e1382fb4cc571af5d83d3396660073837d029e82 100644 --- a/src/js/food.js +++ b/src/js/food.js @@ -1,3 +1,4 @@ +/* eslint-disable no-undef */ /** @param {App.Entity.SlaveState} slave */ window.foodAmount = function (slave) { const V = State.variables; diff --git a/src/js/foreachMacroJS.js b/src/js/foreachMacroJS.js index be77e940d959104e722baf5fcc8401f2d96642fe..ea5e0afcd3ffed39d03bb4a9ef4e833376ad54fb 100644 --- a/src/js/foreachMacroJS.js +++ b/src/js/foreachMacroJS.js @@ -1,3 +1,4 @@ +/* eslint-disable no-undef */ Macro.add('foreach', { skipArgs : true, tags : null, diff --git a/src/js/futureSocietyJS.js b/src/js/futureSocietyJS.js index 2453c30d7f1e181150ead99c9458aba9fb97ad24..6978059a94ef3010a2c41179f75d09b8c285ac8c 100644 --- a/src/js/futureSocietyJS.js +++ b/src/js/futureSocietyJS.js @@ -1,3 +1,5 @@ +/* eslint-disable no-console */ +/* eslint-disable no-undef */ window.FutureSocieties = (function() { return { remove: removeFS, diff --git a/src/js/generateGenetics.js b/src/js/generateGenetics.js index ea23289eab95c8eaf04e7ce937e26641fe91041b..0f0afc00e58a7b7e0cb311bb093267a27327c1a4 100644 --- a/src/js/generateGenetics.js +++ b/src/js/generateGenetics.js @@ -1,4 +1,6 @@ +/* eslint-disable no-undef */ // Generates a child's genetics based off mother and father and returns it as an object to be attached to an ovum + window.generateGenetics = (function() { "use strict"; let genes; @@ -971,7 +973,7 @@ window.generateChild = function (mother, ova, destination) { child.behavioralFlaw = genes.behavioralFlaw; child.fetish = genes.fetish; child.geneticQuirks = clone(genes.geneticQuirks); - if (child.geneticQuirks.albinism == 2) { + if (child.geneticQuirks.albinism === 2) { child.albinismOverride = {skin: genes.skin, eyeColor: genes.eyeColor, hColor: genes.hColor}; child.hColor = "white"; child.pubicHColor = child.hColor; 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/hTagMacroJS.js b/src/js/hTagMacroJS.js index 1f4eaa36511f8c7fc1c955a01d44179843905177..64681ad4b2d674888901a44ca00d456f210377db 100644 --- a/src/js/hTagMacroJS.js +++ b/src/js/hTagMacroJS.js @@ -1,3 +1,4 @@ +/* eslint-disable no-undef */ /* * <<htag>> macro * A simple macro which allows to create wrapping html elements with dynamic IDs. diff --git a/src/js/heroCreator.js b/src/js/heroCreator.js index faa919b75ca7ed098f3cf6ed21d43c1d73f821ad..5fe425a72ad4120d07bd8f3c609d3c8d05201118 100644 --- a/src/js/heroCreator.js +++ b/src/js/heroCreator.js @@ -1,3 +1,4 @@ +/* eslint-disable no-undef */ /** * @param {App.Entity.SlaveState} heroSlave * @param {App.Entity.SlaveState} baseHeroSlave diff --git a/src/js/optionsMacro.js b/src/js/optionsMacro.js index 166ba8b07e906bbc0c9c048b2080c11f1962e3c6..bea08c69fe3e3f8cee1a326e0c0b7b2f46f8807d 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 @@ -34,7 +36,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.")) { @@ -47,7 +49,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) { @@ -91,16 +93,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.startsWith('option')) { var args = this.payload[i].args; var hasComparitor = this.payload[i].name !== "option" && this.payload[i].name !== "optiondefault"; diff --git a/src/js/pregJS.js b/src/js/pregJS.js index 74c2dabe3087e6b4d27181cc66abfa0a0dd9e2fa..29a156582111bfd18ffccd936ccf538fab404962 100644 --- a/src/js/pregJS.js +++ b/src/js/pregJS.js @@ -1,15 +1,18 @@ +/* eslint-disable no-empty */ +/* 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); + targetLen = ((-0.0000004675 * Math.pow(gestastionWeek, 4)) + (0.0001905 * Math.pow(gestastionWeek, 3)) - (0.029 * Math.pow(gestastionWeek, 2)) + (2.132 * gestastionWeek) - 16.575); } 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); } var bellySize = ((4 / 3) * (Math.PI) * (phi / 2) * (Math.pow((targetLen / 2), 3)) * fetuses); @@ -383,7 +386,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. @@ -407,7 +410,8 @@ 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) { + } else if (!displayOverride) { target.pregKnown = 1; if (target.ID === -1) { @@ -433,7 +437,8 @@ 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) { + } else if (!displayOverride) { target.pregKnown = 1; if (target.ID === -1) { @@ -492,18 +497,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/removeActiveSlave.js b/src/js/removeActiveSlave.js index 9c62e34d070e2848366709ca1caf85cd7714f34d..2844d619479bbf732b57ac33d2264750cf0fea5a 100644 --- a/src/js/removeActiveSlave.js +++ b/src/js/removeActiveSlave.js @@ -1,3 +1,4 @@ +/* eslint-disable no-undef */ window.removeActiveSlave = function removeActiveSlave() { "use strict"; const V = State.variables; diff --git a/src/js/rulesAssistant.js b/src/js/rulesAssistant.js index 6d2db438933c0bcf567979507844c53591478516..8fd3ac027b6755fe3fa2ffb78c8ccc3fe96c9c9a 100644 --- a/src/js/rulesAssistant.js +++ b/src/js/rulesAssistant.js @@ -1,3 +1,4 @@ +/* eslint-disable no-undef */ /** @param {App.Entity.SlaveState} slave */ window.hasSurgeryRule = function (slave, rules) { return rules.some( diff --git a/src/js/rulesAssistantOptions.js b/src/js/rulesAssistantOptions.js index 784b8e05ea0a0341052f163b277fede6877ba8cd..70c5c42a6a0577e9f7bb53f8e5e602a5fd79d363 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/rulesAutosurgery.js b/src/js/rulesAutosurgery.js index 86b325ac1a990bbb3651627af38581d50022f837..0fbe86aef48da9cb918db7d58d9be8c5a53d151b 100644 --- a/src/js/rulesAutosurgery.js +++ b/src/js/rulesAutosurgery.js @@ -1,3 +1,4 @@ +/* eslint-disable no-undef */ window.rulesAutosurgery = (function() { "use strict"; let V; 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/slaveGenerationJS.js b/src/js/slaveGenerationJS.js index df933301d9d3e5f381660f4e43cc1b3e96aff008..f7fa84384cb8ba62a9ed189512cb90181ea7f6ae 100644 --- a/src/js/slaveGenerationJS.js +++ b/src/js/slaveGenerationJS.js @@ -1,3 +1,4 @@ +/* eslint-disable no-undef */ window.nationalityToRace = /** @param {App.Entity.SlaveState} slave */ function nationalityToRace(slave) { slave.race = hashChoice(setup.raceSelector[slave.nationality] || setup.raceSelector[""]); }; 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 7d5e247cafeab502aeb00e07fe51e2a9542f718f..2e0dc615c8a4f13451a193048787b6d1af3edbf5 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) @@ -4909,8 +4910,8 @@ 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) */ + let _indexed = 1, + _counter = 0, _buttons = [], _offset = -50; if (/Select/i.test(passageName)) { diff --git a/src/js/spanMacroJS.js b/src/js/spanMacroJS.js index dead2c13ec466c0cdd881e9c6e75af14ecd84691..005e6d1c7b6f0380b886b610df78d519f66902d8 100644 --- a/src/js/spanMacroJS.js +++ b/src/js/spanMacroJS.js @@ -1,3 +1,4 @@ +/* eslint-disable no-undef */ /* * <<span>> macro * A minimal macro which allows to create <span> elements with dynamic IDs. diff --git a/src/js/storyJS.js b/src/js/storyJS.js index ee10995deebd21051cfeaeb666886a75c955ac3b..de8ff5d892421569664fb9086d57938ea466478b 100644 --- a/src/js/storyJS.js +++ b/src/js/storyJS.js @@ -1,3 +1,5 @@ +/* eslint-disable no-console */ +/* eslint-disable no-undef */ /*config.history.tracking = false;*/ // State.expired.disable; @@ -586,6 +588,7 @@ window.generateAssistantPronouns = function() { window.printTrinkets = function printTrinkets() { function trinketPluralReplacer(desc) { + let r; switch (desc) { /* not supported best in show ribbons @@ -615,7 +618,7 @@ window.printTrinkets = function printTrinkets() { return "several thank-you notes from MILF tourists whom you made feel welcome in the arcology"; // replacement by groups default: - let r = desc; + r = desc; if (desc.endsWith("citizen")) { // will not reduce spam from different future societies r = r.replace("message", "messages"); r = r.replace("from a", "from"); diff --git a/src/js/summaryWidgets.js b/src/js/summaryWidgets.js index 215c5b2488b8254ace13e0eec080bf988903f853..5c5ccf5b4d1584d88d9ba9246bb0be650f42d25e 100644 --- a/src/js/summaryWidgets.js +++ b/src/js/summaryWidgets.js @@ -1,3 +1,5 @@ +/* eslint-disable no-undef */ +/* eslint-disable no-unused-vars */ /** * @param {App.Entity.SlaveState} slave */ diff --git a/src/js/textInput.js b/src/js/textInput.js index 86d6eebae8327921825d050c38d03b02e984af42..2e4cbbe37898b4f4968f00742529ce14abb33929 100644 --- a/src/js/textInput.js +++ b/src/js/textInput.js @@ -1,3 +1,4 @@ +/* eslint-disable no-undef */ Macro.add("textinput", { // Signifies that the macro is a container macro. tags: null, diff --git a/src/js/textboxJS.js b/src/js/textboxJS.js index 5dd0388fe6f3338e9e3df74875c5ee4610b5bf91..e4917d08c542242f60ab649b681be3889da9901b 100644 --- a/src/js/textboxJS.js +++ b/src/js/textboxJS.js @@ -1,3 +1,4 @@ +/* eslint-disable no-undef */ /* Nicked off greyelf, works for replace textboxes */ window.setReplaceTextboxMaxLength = function (storyVarName, maxLength) { var textboxId = '#textbox-' + Util.slugify(storyVarName); diff --git a/src/js/utilJS.js b/src/js/utilJS.js index 641d23b34e4556269332e5e05bfab11960577eee..c4ee812092660e639c6b6b9dac5de5fd25840f03 100644 --- a/src/js/utilJS.js +++ b/src/js/utilJS.js @@ -1,3 +1,6 @@ +/* eslint-disable no-unused-vars */ +/* eslint-disable no-console */ +/* eslint-disable no-undef */ /* * Height.mean(nationality, race, genes, age) - returns the mean height for the given combination and age in years (>=2) * Height.mean(nationality, race, genes) - returns the mean adult height for the given combination @@ -501,90 +504,90 @@ window.num = function(x) { const V = State.variables; let max = V.showNumbersMax; - function commaNum(s) { - if (!s) { - return 0; - } - if (State.variables.formatNumbers !== 1) { - return s; - } else { - return s.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ','); - } - } + var ONE_TO_NINETEEN = [ + 'one', 'two', 'three', 'four', 'five', + 'six', 'seven', 'eight', 'nine', 'ten', + 'eleven', 'twelve', 'thirteen', 'fourteen', 'fifteen', + 'sixteen', 'seventeen', 'eighteen', 'nineteen', + ]; - if (V.showNumbers !== 2) { - if (x === 0) { - return 'zero'; - } + var TENS = [ + 'ten', 'twenty', 'thirty', 'forty', 'fifty', + 'sixty', 'seventy', 'eighty', 'ninety', + ]; - let ONE_TO_NINETEEN = [ - 'one', 'two', 'three', 'four', 'five', - 'six', 'seven', 'eight', 'nine', 'ten', - 'eleven', 'twelve', 'thirteen', 'fourteen', 'fifteen', - 'sixteen', 'seventeen', 'eighteen', 'nineteen', - ]; + var SCALES = ['thousand', 'million', 'billion', 'trillion']; - let TENS = [ - 'ten', 'twenty', 'thirty', 'forty', 'fifty', - 'sixty', 'seventy', 'eighty', 'ninety', - ]; + // helper function for use with Array.filter + function isTruthy(item) { + return !!item; + } - let SCALES = ['thousand', 'million', 'billion', 'trillion']; + // convert a number into "chunks" of 0-999 + function chunk(number) { + let thousands = []; - // helper function for use with Array.filter - function isTruthy(item) { - return !!item; + while (number > 0) { + thousands.push(number % 1000); + number = Math.floor(number / 1000); } - // convert a number into "chunks" of 0-999 - function chunk(number) { - let thousands = []; + return thousands; + } - while (number > 0) { - thousands.push(number % 1000); - number = Math.floor(number / 1000); - } + // translate a number from 1-999 into English + function inEnglish(number) { + let hundreds; + let tens; + let ones; + let words = []; - return thousands; + if (number < 20) { + return ONE_TO_NINETEEN[number - 1]; // may be undefined } - // translate a number from 1-999 into English - function inEnglish(number) { - let hundreds; - let tens; - let ones; - let words = []; + if (number < 100) { + ones = number % 10; + tens = number / 10 | 0; // equivalent to Math.floor(number / 10) - if (number < 20) { - return ONE_TO_NINETEEN[number - 1]; // may be undefined - } + words.push(TENS[tens - 1]); + words.push(inEnglish(ones)); - if (number < 100) { - ones = number % 10; - tens = number / 10 | 0; // equivalent to Math.floor(number / 10) + return words.filter(isTruthy).join('-'); + } - words.push(TENS[tens - 1]); - words.push(inEnglish(ones)); + hundreds = number / 100 | 0; + words.push(inEnglish(hundreds)); + words.push('hundred'); + words.push(inEnglish(number % 100)); - return words.filter(isTruthy).join('-'); - } + return words.filter(isTruthy).join(' '); + } - hundreds = number / 100 | 0; - words.push(inEnglish(hundreds)); - words.push('hundred'); - words.push(inEnglish(number % 100)); + // append the word for a scale. Made for use with Array.map + function appendScale(chunk, exp) { + let scale; + if (!chunk) { + return null; + } + scale = SCALES[exp - 1]; + return [chunk, scale].filter(isTruthy).join(' '); + } - return words.filter(isTruthy).join(' '); + function commaNum(s) { + if (!s) { + return 0; + } + if (State.variables.formatNumbers !== 1) { + return s; + } else { + return s.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ','); } + } - // append the word for a scale. Made for use with Array.map - function appendScale(chunk, exp) { - let scale; - if (!chunk) { - return null; - } - scale = SCALES[exp - 1]; - return [chunk, scale].filter(isTruthy).join(' '); + if (V.showNumbers !== 2) { + if (x === 0) { + return 'zero'; } let string = chunk(x) @@ -681,6 +684,7 @@ window.massFormat = function (s) { }; window.budgetLine = function(category, title) { + const V = State.variables; // TODO: convert budgetLine references to JS let income; let expenses; let profits; @@ -705,7 +709,7 @@ window.budgetLine = function(category, title) { <td>${title}</td>\ <td>\ <<if (${income}.${category}) > 0>>\ - @@.yellowgreen;<<print cashFormat(${income}.${category})>>@@\ /*please don't put a plus sign in front of income, it's not done on a budget sheet. Safe to assume money is money unless it's in parenthesis or with a - sign.*/ + @@.yellowgreen;<<print cashFormat(${income}.${category})>>@@ /*please don't put a plus sign in front of income, it's not done on a budget sheet. Safe to assume money is money unless it's in parenthesis or with a - sign.*/ <<else>>\ <<print cashFormat(${income}.${category})>>\ <</if>>\ diff --git a/src/js/vignettes.js b/src/js/vignettes.js index 53ae2ddb2111ed62dcafc5ea1e4a66e07e178a17..b47ce02d1263405100c776bfb233763ed79d0ad7 100644 --- a/src/js/vignettes.js +++ b/src/js/vignettes.js @@ -1,3 +1,4 @@ +/* eslint-disable no-undef */ window.GetVignette = /** @param {App.Entity.SlaveState} slave */ function GetVignette(slave) { const V = State.variables; let vignettes = []; diff --git a/src/js/walkPastJS.js b/src/js/walkPastJS.js index c9ec7e6211bf971dd953deca262bdf196b0705b1..d4fdc6a403efbf7aeedacb9e95bb5c9370de9494 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`; @@ -2258,7 +2257,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 `; @@ -2431,9 +2430,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.`; @@ -2519,7 +2518,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 { diff --git a/src/js/wombJS.js b/src/js/wombJS.js index edd00e15909d12e84e9ff3303f721c07678b6c98..4d2eea75c4db3da11132933c0865661fce0c1619 100644 --- a/src/js/wombJS.js +++ b/src/js/wombJS.js @@ -1,3 +1,4 @@ +/* eslint-disable no-undef */ /* This is a womb processor/simulator script. It takes care of calculation of belly sizes based on individual fetus sizes, with full support of broodmothers implant random turning on and off possibility. Also this can be expanded to store more parents data in each individual fetus in future. Design limitations: @@ -92,12 +93,12 @@ window.WombImpregnate = function(actor, fCount, fatherID, age, surrogate) { tf.splitted = 0; //marker for already splitted fetus. if (surrogate) { tf.motherID = surrogate.ID; //Initial biological mother ID setup. - if(actor.eggType === "human"){ + if(actor.eggType === "human") { tf.genetics = generateGenetics(surrogate, fatherID, i+1); //Stored genetic information. } } else { tf.motherID = actor.ID; //Initial biological mother ID setup. - if(actor.eggType === "human"){ + if(actor.eggType === "human") { tf.genetics = generateGenetics(actor, fatherID, i+1); //Stored genetic information. } } @@ -109,10 +110,10 @@ window.WombImpregnate = function(actor, fCount, fatherID, age, surrogate) { actor.preg = age; } actor.womb.push(tf); - } catch(err){ + } catch(err) { WombInit(actor); actor.womb.push(tf); - alert("WombImpregnate warning - " + actor.slaveName+" "+err); + alert("WombImpregnate warning - " + actor.slaveName+" " + err); } } diff --git a/src/pregmod/widgets/pregmodWidgets.tw b/src/pregmod/widgets/pregmodWidgets.tw index 4ea78f894917a27eaa762c1a8b672b58e0b86f7c..3a39ee4183635337716cccc337219d603d8b30e4 100644 --- a/src/pregmod/widgets/pregmodWidgets.tw +++ b/src/pregmod/widgets/pregmodWidgets.tw @@ -1406,13 +1406,13 @@ extremely pale -5 || setup.whiteAmericanSlaveNames).random(); } generatePronouns(s); - if(s.geneMods === undefined) { + if(s.geneMods == undefined) { s.geneMods = {NCS: 0, rapidCellGrowth: 0}; } else { - if(s.geneMods.NCS === undefined) { + if(s.geneMods.NCS == undefined) { s.geneMods.NCS = 0; } - if(s.geneMods.rapidCellGrowth === undefined) { + if(s.geneMods.rapidCellGrowth == undefined) { s.geneMods.rapidCellGrowth = 0; } } diff --git a/src/pregmod/widgets/seBirthWidgets.tw b/src/pregmod/widgets/seBirthWidgets.tw index 5cce6a665885d0b215afc7f5e30f2aa31b712ea8..27544f126205122840ebeff5c6e43448bf991fd3 100644 --- a/src/pregmod/widgets/seBirthWidgets.tw +++ b/src/pregmod/widgets/seBirthWidgets.tw @@ -418,6 +418,8 @@ This decriptions can be expanded with more outcomes later. But it's not practica <<set _fathers.push("the Societal Elite")>> <<elseif $slaves[$i].curBabies[_seb].fatherID == -7>> <<set _fathers.push("your own design")>> + <<elseif $slaves[$i].curBabies[_seb].fatherID == -8>> + <<set _fathers.push("one of your animals")>> <<elseif $slaves[$i].curBabies[_cb].fatherID == -9>> <<set _fathers.push("a Futanari Sister")>> <<else>> diff --git a/src/uncategorized/neighborsDevelopment.tw b/src/uncategorized/neighborsDevelopment.tw index 184cc19a78f182e4ee50e3dcffe9db30516910a7..41fac2215a717ff916549b01b16e07827355662d 100644 --- a/src/uncategorized/neighborsDevelopment.tw +++ b/src/uncategorized/neighborsDevelopment.tw @@ -74,7 +74,8 @@ <<set _error = 10>> <</if>> <<set _error -= 2*$assistantPower>> -has an estimated GSP of @@.yellowgreen;<<print cashFormat(Math.trunc((0.1*$arcologies[$i].prosperity*random(100-_error,100+_error))/100))>>m,@@ +<<set _prosperity = (Math.trunc((0.1*$arcologies[$i].prosperity*random(100-_error,100+_error))/100))>> +has an estimated GSP of @@.yellowgreen;<<print cashFormat(_prosperity)>><<if $showNumbers != 2>><<if ($showNumbers == 1) && (_prosperity > $showNumbersMax)>>m<<else>> million<</if>><<else>>m<</if>>,@@ <<if ($arcologies[$i].rival == 1) && ($arcologies[$i].government != "an individual")>> but it is undergoing some internal turmoil. @@.red;Resentment that has been quietly building among the arcology's elite turns into open rebellion!@@ diff --git a/src/uncategorized/saLongTermEffects.tw b/src/uncategorized/saLongTermEffects.tw index dad5a4ea8fd1b179336fe3e15574f0ec1341eac0..54d8be62416c4216083d21b4296171c4002a80df 100644 --- a/src/uncategorized/saLongTermEffects.tw +++ b/src/uncategorized/saLongTermEffects.tw @@ -4174,7 +4174,7 @@ <</if>> <</if>> <</if>> - <<if $slaves[$i].pregSource != 0>> + <<if $slaves[$i].pregSource != 0 && $slaves[$i].eggType == "human">> A quick scan after a bout of morning nausea reveals that @@.lime;$he has become pregnant.@@ <<set $slaves[$i].preg = 1, $slaves[$i].pregWeek = 1, $slaves[$i].pregKnown = 1>><<set $slaves[$i].pregType = setPregType($slaves[$i])>> <<set WombImpregnate($slaves[$i], $slaves[$i].pregType, $slaves[$i].pregSource, 1)>>