From 93ade483a547fdddad30759d7587c612f49bbf5e Mon Sep 17 00:00:00 2001
From: DCoded <dcoded@live.com>
Date: Wed, 10 Apr 2019 09:36:07 -0400
Subject: [PATCH] Linting

---
 src/endWeek/saWorkTheFarm.js | 20 ++++++++++++----
 src/js/economyJS.js          | 30 +++++++++++------------
 src/js/pregJS.js             | 46 +++++++++++++++++++++---------------
 src/js/sexActsJS.js          | 30 ++++++++++++++++++-----
 4 files changed, 82 insertions(+), 44 deletions(-)

diff --git a/src/endWeek/saWorkTheFarm.js b/src/endWeek/saWorkTheFarm.js
index 9fefc378a28..91ff1e15a03 100644
--- a/src/endWeek/saWorkTheFarm.js
+++ b/src/endWeek/saWorkTheFarm.js
@@ -1,10 +1,22 @@
-window.saWorkTheFarm = /** @param {App.Entity.SlaveState} slave */ function saWorkTheFarm(slave) {
+/**
+ * @param {App.Entity.SlaveState} slave
+ * @returns {string}
+ */
+window.saWorkTheFarm = function saWorkTheFarm(slave) {
 	"use strict";
 	const V = State.variables;
 	const arcology = V.arcologies[0];
+	/* eslint-disable */
 	const pronouns = getPronouns(slave);
-	const he = pronouns.pronoun; const him = pronouns.object; const his = pronouns.possessive; const hers = pronouns.possessivePronoun; const himself = pronouns.objectReflexive; const boy = pronouns.noun;
-	const He = capFirstChar(he); const His = capFirstChar(his);
+	const he = pronouns.pronoun;
+	const him = pronouns.object;
+	const his = pronouns.possessive;
+	const hers = pronouns.possessivePronoun;
+	const himself = pronouns.objectReflexive;
+	const boy = pronouns.noun;
+	const He = capFirstChar(he);
+	const His = capFirstChar(his);
+	/* eslint-enable */
 	const incomeStats = getSlaveStatisticData(slave, V.facility.farmyard);
 
 	let t = `works as a farmhand this week. `;
@@ -94,7 +106,7 @@ window.saWorkTheFarm = /** @param {App.Entity.SlaveState} slave */ function saWo
 	if (V.farmyardShows) {
 		t += `${He} also puts on shows with animals this week. `;
 
-		//Open FS Subsection
+		// Open FS Subsection
 
 		if (arcology.FSSupremacist !== "unset") {
 			if (slave.race === arcology.FFSupremacistRace) {
diff --git a/src/js/economyJS.js b/src/js/economyJS.js
index 0e4624c2143..0a1bb7eee90 100644
--- a/src/js/economyJS.js
+++ b/src/js/economyJS.js
@@ -149,9 +149,9 @@ window.getBrothelAdsCosts = function() {
 };
 
 window.getArcadeCosts = function() {
-	var facilityCost = State.variables.facilityCost;
-	var arcade = State.variables.arcade;
-	var costs = (arcade * facilityCost * 0.05);
+	const facilityCost = State.variables.facilityCost;
+	const arcade = State.variables.arcade;
+	let costs = (arcade * facilityCost * 0.05);
 	costs += (0.02 * State.variables.arcadeUpgradeInjectors * arcade * facilityCost) + (0.05 * State.variables.arcadeUpgradeCollectors * arcade * facilityCost) + (0.02 * State.variables.arcadeUpgradeHealth * arcade * facilityCost);
 	return costs;
 };
@@ -933,7 +933,7 @@ window.slaveJobValues = function() {
 
 	// Accounting for the DJ.
 	V.DJ = V.slaves.find(s => {
-		return s.assignment == "be the DJ";
+		return s.assignment === "be the DJ";
 	});
 	if(V.DJ !== 0) {
 		if(!canTalk(V.DJ)) {
@@ -944,7 +944,7 @@ window.slaveJobValues = function() {
 			// ''__<span class=pink>$DJ.slaveName</span>__'' spends so much time giving birth and laboring that <span class=yell>w;$he cannot effectively serve as your DJ any longer.</span>
 			V.DJ = 0;
 			V.unDJ = 2;
-		} else if(V.DJ.fetish == "mindbroken") {
+		} else if(V.DJ.fetish === "mindbroken") {
 			// ''__<span class=pink>$DJ.slaveName</span>__'' is mindbroken <span class=yell>w;and cannot serve as your DJ any more.</span><br>
 			V.DJ = 0;
 			V.unDJ = 3;
@@ -1013,7 +1013,7 @@ window.slaveJobValues = function() {
 	// Glory hole slaves adding to 'arcade'
 	V.JobIDArray["work a glory hole"].forEach(ID => {
 		let s = V.slaves[V.slaveIndices[ID]];
-		s.sexAmount = Math.trunc((jsRandom(160,200) + (20 * (4 - s.anus)) + (10 * (4 - s.vagina)) + Math.trunc(s.health / 5)) * 0.8);
+		s.sexAmount = Math.trunc((jsRandom(160, 200) + (20 * (4 - s.anus)) + (10 * (4 - s.vagina)) + Math.trunc(s.health / 5)) * 0.8);
 		slaveJobValues.arcade += s.sexAmount;
 	});
 
@@ -1029,7 +1029,7 @@ window.slaveJobValues = function() {
 
 		// Arcade slaves adding to 'arcade'
 		if(s.assignment === "be confined in the arcade") {
-			s.sexAmount = (jsRandom(200,240) + (20 * (4 - (s.anus - 2 * V.arcadeUpgradeInjectors))) + (10 * (4 - (s.vagina - 2 * V.arcadeUpgradeInjectors))) + Math.trunc(s.health / 5));
+			s.sexAmount = (jsRandom(200, 240) + (20 * (4 - (s.anus - 2 * V.arcadeUpgradeInjectors))) + (10 * (4 - (s.vagina - 2 * V.arcadeUpgradeInjectors))) + Math.trunc(s.health / 5));
 			slaveJobValues.arcade += s.sexAmount;
 		}
 
@@ -1051,7 +1051,7 @@ window.slaveJobValues = function() {
 			beautyMultiplier += V.arcologies[0].FSEdoRevivalist / (V.FSLockinLevel * 3);
 		}
 		if(((V.universalRulesFacilityWork === 1) && (s.assignment === "serve the public") && (clubSpots > 0)) || (s.assignment === "serve in the club")) {
-			if(s.assignment == "serve the public") {
+			if(s.assignment === "serve the public") {
 				toTheClub = 1;
 				V.slavesGettingHelp += 1;
 			}
@@ -1126,7 +1126,7 @@ window.slaveJobValues = function() {
 						beautyMultiplier += 0.05;
 						// Almost everyone who comes to $clubName is looking to fuck a $girl like $him.
 					}
-				} else if(V.clubAdsXX == -1) {
+				} else if(V.clubAdsXX === -1) {
 					if(s.dick > 0) {
 						beautyMultiplier += 0.05;
 						// Almost everyone who comes to $clubName is looking to poke a $girl who cums when buttfucked.
@@ -1147,21 +1147,21 @@ window.slaveJobValues = function() {
 			if(s.health < -50) {
 				s.health -= 8;
 				s.minorInjury = 1;
-			} else if(s.health < -20 && jsRandom(1,100) > 50) {
+			} else if(s.health < -20 && jsRandom(1, 100) > 50) {
 				s.health -= 5;
 				s.minorInjury = 1;
 			} else if(!canDoVaginal(s)) {
 				if(canDoAnal(s)) {
-					if(jsRandom(1,100) > 40+(10*(s.skill.anal + s.skill.oral))) {
+					if(jsRandom(1, 100) > 40+(10*(s.skill.anal + s.skill.oral))) {
 					s.health -= 5;
 					s.minorInjury = 1;
 					}
-				} else if(jsRandom(1,100) > 40 + (10 * s.skill.oral)) {
+				} else if(jsRandom(1, 100) > 40 + (10 * s.skill.oral)) {
 					s.health -= 5;
 					s.minorInjury = 1;
 				}
 			} else if(s.skill.anal + s.skill.oral + s.skill.vaginal < 300) {
-				if(jsRandom(1,100) > 10+((s.skill.anal + s.skill.oral + s.skill.vaginal)/10)) {
+				if(jsRandom(1, 100) > 10+((s.skill.anal + s.skill.oral + s.skill.vaginal)/10)) {
 					s.minorInjury = 1;
 				}
 			}
@@ -1171,9 +1171,9 @@ window.slaveJobValues = function() {
 			s.health -= 5;
 			beautyMultiplier -= 0.05;
 			if(canDoAnal(s)) {
-				injuryChance = jsRandom(1,100);
+				injuryChance = jsRandom(1, 100);
 			} else {
-				injuryChance = jsRandom(1,80);
+				injuryChance = jsRandom(1, 80);
 			}
 			if(injuryChance > 80) {
 				s.minorInjury = "sore ass";
diff --git a/src/js/pregJS.js b/src/js/pregJS.js
index c73df8068a0..c3734525e09 100644
--- a/src/js/pregJS.js
+++ b/src/js/pregJS.js
@@ -10,55 +10,58 @@ window.getPregBellySize = function(s) {
 	} else if(gestastionWeek <= 106) {
 		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 {
-		targetLen = ((-0.00003266 * Math.pow(gestastionWeek,2)) + (0.076 * gestastionWeek) + 43.843);
+		targetLen = ((-0.00003266 * Math.pow(gestastionWeek, 2)) + (0.076 * gestastionWeek) + 43.843);
 	}
 
 	let bellySize = ((4 / 3) * (Math.PI) * (phi / 2) * (Math.pow((targetLen / 2), 3)) * fetuses);
 	return bellySize;
 };
 
-/** @param {App.Entity.SlaveState} slave */
+/**
+ * @param {App.Entity.SlaveState} slave
+ * @returns {string}
+ */
 window.bellyAdjective = function(slave) {
+	let r = ``;
 	slave = slave || State.variables.activeSlave;
 	if(slave.belly >= 1500) {
 		if(slave.belly >= 1000000) {
 			if(slave.preg > slave.pregData.normalBirth/4) {
-				return 'unfathomably distended, brimming with life';
+				r = `unfathomably distended, brimming with life`;
 			} else {
-				return 'unfathomable';
+				r = `unfathomable`;
 			}
 		} else if(slave.belly >= 750000) {
 			if(slave.preg > slave.pregData.normalBirth/4) {
-				return 'monolithic bulging';
+				r = `monolithic bulging`;
 			} else {
-				return 'monolithic';
+				r = `monolithic`;
 			}
 		} else if(slave.belly >= 600000) {
 			if(slave.preg > slave.pregData.normalBirth/4) {
-				return 'titanic bulging';
+				r = `titanic bulging`;
 			} else {
-				return 'titanic';
+				r = `titanic`;
 			}
 		} else if(slave.belly >= 450000) {
 			if(slave.preg > slave.pregData.normalBirth/4) {
-				return 'gigantic bulgy';
+				r = `gigantic bulgy`;
 			} else {
-				return 'gigantic';
+				r = `gigantic`;
 			}
 		} else if(slave.belly >= 300000) {
-			return 'massive';
+			r = `massive`;
 		} else if(slave.belly >= 100000) {
-			return 'giant';
+			r = `giant`;
 		} else if(slave.belly >= 15000) {
-			return 'huge';
+			r = `huge`;
 		} else if(slave.belly >= 10000) {
-			return 'big';
+			r = `big`;
 		} else {
-			return 'swollen';
+			r = `swollen`;
 		}
-	} else {
-		return '';
 	}
+	return r;
 };
 
 /* calculates and returns expected ovum count during conception*/
@@ -404,7 +407,7 @@ window.knockMeUp = function(target, chance, hole, fatherID, displayOverride) {
 		He = capFirstChar(pronouns.pronoun);
 	}
 	if (V.seePreg !== 0) {
-		if (jsRandom(0,99) < (chance + (V.reproductionFormula*((target.pregSource <= 0) ? ((target.ID === -1) ? 0 : 10) : 20)))) {
+		if (jsRandom(0, 99) < (chance + (V.reproductionFormula*((target.pregSource <= 0) ? ((target.ID === -1) ? 0 : 10) : 20)))) {
 			if (target.mpreg === hole) {
 
 				if (target.pregWeek <= 0) {
@@ -419,6 +422,7 @@ window.knockMeUp = function(target, chance, hole, fatherID, displayOverride) {
 				WombImpregnate(target, target.pregType, target.pregSource, 1);
 
 				if (V.menstruation === 1) {
+					//
 				}
 				else if (!displayOverride) {
 					target.pregKnown = 1;
@@ -445,6 +449,7 @@ window.knockMeUp = function(target, chance, hole, fatherID, displayOverride) {
 				WombImpregnate(target, target.pregType, target.pregSource, 1);
 
 				if (V.menstruation === 1) {
+					//
 				}
 				else if (!displayOverride) {
 					target.pregKnown = 1;
@@ -537,7 +542,10 @@ window.adjustFatherProperty = function(actor, property, newValue) {
 */
 
 /* not to be used until that last part is defined. It may become slave.boobWomb.volume or some shit */
-/** @param {App.Entity.SlaveState} slave */
+/**
+ * @param {App.Entity.SlaveState} slave
+ * @returns {number}
+ */
 window.getBaseBoobs = function(slave) {
 	return slave.boobs-slave.boobsImplant-slave.boobsMilk-slave.boobsWombVolume;
 };
diff --git a/src/js/sexActsJS.js b/src/js/sexActsJS.js
index dfe8dd1bc00..a087a920c35 100644
--- a/src/js/sexActsJS.js
+++ b/src/js/sexActsJS.js
@@ -7,7 +7,7 @@ window.AnalVCheck = function AnalVCheck(times = 1) {
 	const slave = V.activeSlave;
 	const pronouns = getPronouns(slave);
 	const he = pronouns.pronoun;
-	//him = pronouns.object,
+	// him = pronouns.object,
 	const his = pronouns.possessive;
 	// hers = pronouns.possessivePronoun,
 	// himself = pronouns.objectReflexive,
@@ -59,6 +59,7 @@ window.AnalVCheck = function AnalVCheck(times = 1) {
 window.VaginalVCheck = function VaginalVCheck(times = 1) {
 	const V = State.variables;
 	const slave = V.activeSlave;
+	/* eslint-disable */
 	const pronouns = getPronouns(slave);
 	const he = pronouns.pronoun;
 	const him = pronouns.object;
@@ -68,6 +69,7 @@ window.VaginalVCheck = function VaginalVCheck(times = 1) {
 	const boy = pronouns.noun;
 	const He = capFirstChar(he);
 	const His = capFirstChar(his);
+	/* eslint-enable */
 	let r = ``;
 	if (canDoVaginal(slave) && slave.vagina === 0) {
 		r += `<span class=lime>This breaks in ${slave.slaveName}'s virgin pussy.</span> `;
@@ -115,6 +117,7 @@ window.VaginalVCheck = function VaginalVCheck(times = 1) {
 window.BothVCheck = function BothVCheck(analTimes = 1, bothTimes = 1) {
 	const V = State.variables;
 	const slave = V.activeSlave;
+	/* eslint-disable */
 	const pronouns = getPronouns(slave);
 	const he = pronouns.pronoun;
 	const him = pronouns.object;
@@ -124,6 +127,7 @@ window.BothVCheck = function BothVCheck(analTimes = 1, bothTimes = 1) {
 	const boy = pronouns.noun;
 	const He = capFirstChar(he);
 	const His = capFirstChar(his);
+	/* eslint-enable */
 	let r = ``;
 	if (canDoVaginal(slave)) {
 		if (slave.vagina === 0) {
@@ -258,6 +262,7 @@ window.SimpleVCheck = function SimpleVCheck(times) {
 window.PartnerVCheck = function PartnerVCheck(analTimes = 1, bothTimes = 1) {
 	const V = State.variables;
 	const partner = V.slaves[V.partner];
+	/* eslint-disable */
 	const pronouns = getPronouns(partner);
 	const he = pronouns.pronoun;
 	const him = pronouns.object;
@@ -267,6 +272,7 @@ window.PartnerVCheck = function PartnerVCheck(analTimes = 1, bothTimes = 1) {
 	const boy = pronouns.noun;
 	const He = capFirstChar(he);
 	const His = capFirstChar(his);
+	/* eslint-enable */
 	let r = ``;
 
 	if (V.partner < 0 || V.partner >= V.slaves.length) {
@@ -319,7 +325,10 @@ window.PartnerVCheck = function PartnerVCheck(analTimes = 1, bothTimes = 1) {
  count is how many times to increment either the Vaginal, Anal, or Oral counts, depending on availability of slave.
  If count is left undefined it will assume it to be 1.
  Intended to be a simple "I want to fuck x and not have to code a bunch of logic for it".
- @param {App.Entity.SlaveState} slave */
+ * @param {App.Entity.SlaveState} slave 
+ * @param {number} fuckCount
+ * @returns {string}
+ */
 window.SimpleSexAct = function SimpleSexAct(slave, fuckCount = 1) {
 	const V = State.variables;
 	let fuckTarget = 0;
@@ -356,6 +365,7 @@ window.SimpleSexAct = function SimpleSexAct(slave, fuckCount = 1) {
  Intended to be a simple "x got fucked y times and I don't want to keep coding it".
  Pregnancy chance is handled in saLongTermEffects.tw.
  @param {App.Entity.SlaveState} slave
+ @param {number} fuckCount
 */
 window.SimpleSlaveFucking = function SimpleSlaveFucking(slave, fuckCount = 1) {
 	const V = State.variables;
@@ -386,6 +396,8 @@ window.SimpleSlaveFucking = function SimpleSlaveFucking(slave, fuckCount = 1) {
  Intended to be a simple "x got fucked y times by z and I don't want to keep coding it".
  @param {App.Entity.SlaveState} subslave
  @param {App.Entity.SlaveState} domslave
+ @param {number} fuckCount
+ @returns {string}
 */
 window.SimpleSlaveSlaveFucking = function SimpleSlaveSlaveFucking(subslave, domslave, fuckCount = 1) {
 	const V = State.variables;
@@ -393,7 +405,7 @@ window.SimpleSlaveSlaveFucking = function SimpleSlaveSlaveFucking(subslave, doms
 	let r = "";
 
 	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
+		// 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) {
 			if (passage() === "SA serve your other slaves") {
@@ -437,7 +449,7 @@ window.SimpleSlaveSlaveFucking = function SimpleSlaveSlaveFucking(subslave, doms
 				r += knockMeUp(subslave, 3, 0, domslave.ID, 1);
 			}
 		} else if (canDoAnal(subslave) && subslave.anus > 0 && canPenetrate(domslave) && fuckTarget > 10) {
-			//i think would impregnate from anal here even without .mpreg? same in original widget too
+			// i think would impregnate from anal here even without .mpreg? same in original widget too
 			if (canImpreg(subslave, domslave) && subslave.mpreg === 1) {
 				r += knockMeUp(subslave, 3, 1, domslave.ID, 1);
 			}
@@ -467,13 +479,19 @@ window.SimpleSlaveSlaveFucking = function SimpleSlaveSlaveFucking(subslave, doms
 	return r;
 };
 
-/** @param {App.Entity.SlaveState} slave */
+/**
+ * @param {App.Entity.SlaveState} slave
+ * @param {number} count
+ */
 window.SimpleVaginaFuck = function SimpleVaginaFuck(slave, count = 1) {
 	State.variables.vaginalTotal += count;
 	slave.counter.vaginal += count;
 };
 
-/** @param {App.Entity.SlaveState} slave */
+/**
+ * @param {App.Entity.SlaveState} slave
+ * @param {number} count
+ */
 window.SimpleAssFuck = function SimpleAssFuck(slave, count = 1) {
 	State.variables.analTotal += count;
 	slave.counter.anal += count;
-- 
GitLab