From 25e746469248998d809cc0bd338ca917c4ad7a49 Mon Sep 17 00:00:00 2001
From: Blank_Alt <12406-Blank_Alt@users.noreply.gitgud.io>
Date: Wed, 27 Apr 2022 01:11:25 +1200
Subject: [PATCH] Revert files and implement safties

---
 src/endWeek/saAgent.js                       | 2 +-
 src/endWeek/saLongTermPhysicalEffects.js     | 2 +-
 src/events/PE/peHeadgirlConcubine.js         | 2 +-
 src/events/RE/rePregInventorInvite.js        | 2 +-
 src/events/RE/rePregInventorShowOff.js       | 6 +++---
 src/events/REFI/reButtslut.js                | 4 ++--
 src/events/RESS/review/sleepingAmbivalent.js | 2 +-
 src/events/RETS/reIncestuousNursing.js       | 2 +-
 src/events/RETS/reTopExhaustion.js           | 2 +-
 src/js/slaveCostJS.js                        | 2 +-
 src/js/utilsUnits.js                         | 2 +-
 src/npc/children/longChildDescription.js     | 6 +++---
 src/npc/descriptions/boobs/boobsShape.js     | 8 ++++----
 src/npc/descriptions/butt/butt.js            | 2 +-
 src/npc/descriptions/longSlave.js            | 2 +-
 src/npc/descriptions/mouth.js                | 2 +-
 src/npc/descriptions/skin.js                 | 4 ++--
 src/npc/interaction/fAssistedSex.js          | 2 +-
 src/npc/interaction/fBellyFuck.js            | 2 +-
 src/npc/interaction/fPoolSex.js              | 4 ++--
 20 files changed, 30 insertions(+), 30 deletions(-)

diff --git a/src/endWeek/saAgent.js b/src/endWeek/saAgent.js
index e7fac6dc302..df50161b1a4 100644
--- a/src/endWeek/saAgent.js
+++ b/src/endWeek/saAgent.js
@@ -46,7 +46,7 @@ App.SlaveAssignment.agent = function(slave) {
 		}
 	}
 	if (slave.breastMesh !== 1) {
-		if (slave.boobs - (slave.muscles * 30) > 5000 && slave.boobs <= 8000 && slave.boobsImplant / slave.boobs < 0.5) {
+		if (slave.boobs - (slave.muscles * 30) > 5000 && slave.boobs <= 8000 && slave.boobsImplant / slave.boobs < .50) {
 			if (slave.physicalAge < random(10, 200)) {
 				if (slave.boobShape === "perky") {
 					slave.boobShape = "torpedo-shaped";
diff --git a/src/endWeek/saLongTermPhysicalEffects.js b/src/endWeek/saLongTermPhysicalEffects.js
index ede1608f8cc..909726a5b94 100644
--- a/src/endWeek/saLongTermPhysicalEffects.js
+++ b/src/endWeek/saLongTermPhysicalEffects.js
@@ -1131,7 +1131,7 @@ App.SlaveAssignment.longTermPhysicalEffects = function saLongTermPhysicalEffects
 			}
 		}
 		if (slave.breastMesh !== 1) {
-			if (slave.boobs - (slave.muscles * 30) > 5000 && slave.boobs <= 8000 && slave.boobsImplant / slave.boobs < 0.5) { // Check now requires breasts to be less than half implant to sag.
+			if (slave.boobs - (slave.muscles * 30) > 5000 && slave.boobs <= 8000 && slave.boobsImplant / slave.boobs < .50) { // Check now requires breasts to be less than half implant to sag.
 				if (slave.physicalAge < random(10, 200)) {
 					if (slave.boobShape === "perky") {
 						r.push(`${His} <span class="change negative">breasts lose their perkiness</span> under their own titanic weight. Their nipples now point forward and ${his} boobs rest more heavily against the chest beneath them.`);
diff --git a/src/events/PE/peHeadgirlConcubine.js b/src/events/PE/peHeadgirlConcubine.js
index a642d8d42cd..ddc13892f7c 100644
--- a/src/events/PE/peHeadgirlConcubine.js
+++ b/src/events/PE/peHeadgirlConcubine.js
@@ -364,7 +364,7 @@ App.Events.PEHeadgirlConcubine = class PEHeadgirlConcubine extends App.Events.Ba
 			r.push(`Cupping your Head Girl's butt in your left hand and your Concubine's in your right, you give them a good squeeze as ${S.HeadGirl.slaveName} finishes ${his} question. ${His} voice rises cutely as your marauding hand moves over the`);
 			if (S.HeadGirl.butt > 10) {
 				r.push(`endless expanse of ${his} backside. ${He} manages to finish, but trails off into a groan, the`);
-				if (Math.floor(S.HeadGirl.buttImplant / S.HeadGirl.butt) > 0.6) {
+				if (Math.floor(S.HeadGirl.buttImplant / S.HeadGirl.butt) > .60) {
 					r.push(`firm`);
 				} else {
 					r.push(`soft`);
diff --git a/src/events/RE/rePregInventorInvite.js b/src/events/RE/rePregInventorInvite.js
index c12f8e647ca..ac6f4262f3b 100644
--- a/src/events/RE/rePregInventorInvite.js
+++ b/src/events/RE/rePregInventorInvite.js
@@ -300,7 +300,7 @@ App.Events.rePregInventorInvite = class rePregInventorInvite extends App.Events.
 				r.push(`sink face first into ${his} warm, room filling ass cleavage`);
 			} else if (slave.butt > 5) {
 				r.push(`grab generous handfuls of ${his} humongous ass`);
-			} else if ((slave.buttImplant / slave.butt) > 0.6) {
+			} else if ((slave.buttImplant / slave.butt) > .60) {
 				r.push(`rest the weight of your upper body on ${his} implant inflated ass cheeks`);
 			} else if (slave.butt > 2) {
 				r.push(`slap ${his} generous ass`);
diff --git a/src/events/RE/rePregInventorShowOff.js b/src/events/RE/rePregInventorShowOff.js
index ba90fb3d8c3..253d4c39e34 100644
--- a/src/events/RE/rePregInventorShowOff.js
+++ b/src/events/RE/rePregInventorShowOff.js
@@ -106,7 +106,7 @@ App.Events.rePregInventorShowOff = class rePregInventorShowOff extends App.Event
 				r.push(`debilitating, insanely enormous ass`);
 			} else if (slave.butt > 5) {
 				r.push(`huge ass`);
-			} else if ((slave.buttImplant / slave.butt) > 0.6) {
+			} else if ((slave.buttImplant / slave.butt) > .60) {
 				r.push(`implant swollen ass cheeks`);
 			} else if (slave.butt > 2) {
 				r.push(`plump ass`);
@@ -234,7 +234,7 @@ App.Events.rePregInventorShowOff = class rePregInventorShowOff extends App.Event
 				r.push(`couch smothering ass cheeks.`);
 			} else if (slave.butt > 5) {
 				r.push(`enormous ass.`);
-			} else if ((slave.buttImplant / slave.butt) > 0.6) {
+			} else if ((slave.buttImplant / slave.butt) > .60) {
 				r.push(`implant-filled ass.`);
 			} else if (slave.butt > 2) {
 				r.push(`delicious looking ass.`);
@@ -486,7 +486,7 @@ App.Events.rePregInventorShowOff = class rePregInventorShowOff extends App.Event
 				r.push(`enormous, gel-slicked ass,`);
 			} else if (slave.butt > 4) {
 				r.push(`plush, gel-slicked ass,`);
-			} else if ((slave.buttImplant / slave.butt) > 0.6) {
+			} else if ((slave.buttImplant / slave.butt) > .60) {
 				r.push(`implant-filled, gel-slicked ass,`);
 			} else if (slave.butt > 2) {
 				r.push(`perfect, gel-slicked ass,`);
diff --git a/src/events/REFI/reButtslut.js b/src/events/REFI/reButtslut.js
index 31cba3c4dea..6c840fc66fd 100644
--- a/src/events/REFI/reButtslut.js
+++ b/src/events/REFI/reButtslut.js
@@ -191,7 +191,7 @@ App.Events.REFIButtslut = class REFIButtslut extends App.Events.BaseEvent {
 						t.push(`absurdly massive`);
 					}
 					t.push(`ass around your cock. Deep within its quivering`);
-					if (eventSlave.buttImplant / eventSlave.butt > 0.6) {
+					if (eventSlave.buttImplant / eventSlave.butt > .60) {
 						t.push(`firmness,`);
 					} else {
 						t.push(`softness,`);
@@ -210,7 +210,7 @@ App.Events.REFIButtslut = class REFIButtslut extends App.Events.BaseEvent {
 					} else if (eventSlave.butt <= 5) {
 						t.push(`enormous`);
 					}
-					if (eventSlave.buttImplant / eventSlave.butt > 0.6) {
+					if (eventSlave.buttImplant / eventSlave.butt > .60) {
 						t.push(`firm`);
 					} else {
 						t.push(`soft`);
diff --git a/src/events/RESS/review/sleepingAmbivalent.js b/src/events/RESS/review/sleepingAmbivalent.js
index a1c8db1cd76..721e65ae637 100644
--- a/src/events/RESS/review/sleepingAmbivalent.js
+++ b/src/events/RESS/review/sleepingAmbivalent.js
@@ -71,7 +71,7 @@ App.Events.RESSSleepingAmbivalent = class RESSSleepingAmbivalent extends App.Eve
 				r.push(`You're mauling ${his} fake boob, squeezing it and making the skin of ${his} breast, which is already stretched rather taut by the implant, stretch a bit farther.`);
 			} else if (eventSlave.boobs > 3000) {
 				r.push(`You're hefting and massaging ${his} mass of breastflesh, playing with ${his}`);
-				if ((eventSlave.boobsImplant/eventSlave.boobs) < 0.6) {
+				if ((eventSlave.boobsImplant/eventSlave.boobs) < .60) {
 					r.push(`mostly`);
 				}
 				r.push(`natural boob, making ${his} huge soft udder bounce and jiggle.`);
diff --git a/src/events/RETS/reIncestuousNursing.js b/src/events/RETS/reIncestuousNursing.js
index 3a8eea09582..d61a97e1d86 100644
--- a/src/events/RETS/reIncestuousNursing.js
+++ b/src/events/RETS/reIncestuousNursing.js
@@ -18,7 +18,7 @@ App.Events.RETSIncestuousNursing = class RETSIncestuousNursing extends App.Event
 				s => s.sexualQuirk === "perverted" || s.energy > 80,
 				s => s.belly < 100000,
 				s => s.lactation > 0,
-				s => s.boobsImplant / s.boobs < 0.6,
+				s => s.boobsImplant / s.boobs < .60,
 			],
 			[ // and subslave
 				s => s.fetish !== "mindbroken",
diff --git a/src/events/RETS/reTopExhaustion.js b/src/events/RETS/reTopExhaustion.js
index ea26a10279d..c2679a623d9 100644
--- a/src/events/RETS/reTopExhaustion.js
+++ b/src/events/RETS/reTopExhaustion.js
@@ -177,7 +177,7 @@ App.Events.RETSTopExhaustion = class RETSTopExhaustion extends App.Events.BaseEv
 			seX(subSlave, "vaginal", domSlave, "penetrative", 6);
 		}
 		t.push(`Being the ${subSlave.relationship > 4 ? `${wife}` : `lover`} of a lusty fucker like ${domSlave.slaveName} can be tiring, especially in addition to ${his} other duties. But despite the vigor, the sex looks quite loving. ${subSlave.slaveName} goes on smiling comfortably as ${his}`);
-		if (subSlave.buttImplant / subSlave.butt > 0.6) {
+		if (subSlave.buttImplant / subSlave.butt > .60) {
 			t.push(`implant-filled butt wobbles slightly`);
 		} else {
 			if (subSlave.butt > 11) {
diff --git a/src/js/slaveCostJS.js b/src/js/slaveCostJS.js
index 13c8e9a4e69..110b97089a2 100644
--- a/src/js/slaveCostJS.js
+++ b/src/js/slaveCostJS.js
@@ -382,7 +382,7 @@ globalThis.BeautyArray = (function() {
 				break;
 			case "freckles":
 			case "heavily freckled":
-				if (skinToneLevel(slave.skin).isBetween(5, 10)) {
+				if (typeof skinToneLevel(slave.skin) === number && skinToneLevel(slave.skin).isBetween(5, 10)) {
 					adjustBeauty("Freckles", 2);
 					if (App.Data.misc.redheadColors.includes(slave.hColor)) {
 						adjustBeauty("Freckles: Redhead", 2);
diff --git a/src/js/utilsUnits.js b/src/js/utilsUnits.js
index e95b6820355..32acbd89baa 100644
--- a/src/js/utilsUnits.js
+++ b/src/js/utilsUnits.js
@@ -371,7 +371,7 @@ globalThis.repFormat = function(s = 0) {
 	} else {
 		/* In order to calculate just how much any one category matters so we can show a "fuzzy" symbolic value to the player, we need to know how "busy" reputation was this week. To calculate this, I ADD income to expenses. Why? 100 - 100 and 10000 - 10000 BOTH are 0, but a +50 event matters a lot more in the first case than the second. I exclude overflow and curving from the calculation because it's not a "real" expense for our purposes, and divide by half just to make percentages a bit easier. */
 		let weight = s / (((V.lastWeeksRepIncome.Total - V.lastWeeksRepExpenses.Total) + (V.lastWeeksRepExpenses.overflow + V.lastWeeksRepExpenses.curve)) / 2);
-		if (weight > 0.6) {
+		if (weight > 0.60) {
 			return `<span class="green">+++++ rep</span>`;
 		} else if (weight > 0.45) {
 			return `<span class="green">++++ rep</span>`;
diff --git a/src/npc/children/longChildDescription.js b/src/npc/children/longChildDescription.js
index 0da6e5e10ef..39f31bd9755 100644
--- a/src/npc/children/longChildDescription.js
+++ b/src/npc/children/longChildDescription.js
@@ -610,7 +610,7 @@ App.Facilities.Nursery.LongChildDescription = function(child, {market = 0, event
 		if (arcology.FSTransformationFetishist > 20) {
 			if (arcology.FSSlimnessEnthusiast !== "unset") {
 				if (child.butt >= 3) {
-					if (child.buttImplant / child.butt < 0.25) {
+					if (child.buttImplant / child.butt < .25) {
 						r += `${His} ass is <span class="red">disgustingly natural</span> for its size. `;
 					} else {
 						r += `${His} asscheeks are <span class="green">obviously implants,</span> as they should be. `;
@@ -618,7 +618,7 @@ App.Facilities.Nursery.LongChildDescription = function(child, {market = 0, event
 				}
 			} else {
 				if (child.butt >= 6) {
-					if (child.buttImplant / child.butt > 0.5) {
+					if (child.buttImplant / child.butt > .5) {
 						r += `${His} ass is <span class="red">disgustingly natural</span> for its size. `;
 					} else {
 						r += `${His} asscheeks are <span class="green">obviously implants,</span> as they should be. `;
@@ -3900,7 +3900,7 @@ App.Facilities.Nursery.LongChildDescription = function(child, {market = 0, event
 				}
 				if (arcology.FSTransformationFetishist > 20) {
 					if (child.lips > 70) {
-						if (child.lipsImplant / child.lips < 0.5) {
+						if (child.lipsImplant / child.lips < .50) {
 							r += `${His} lips are huge and <span class="red">disgustingly natural</span> for their size. `;
 						} else {
 							r += `${His} lips are huge and <span class="green">obviously implants,</span> as they should be. `;
diff --git a/src/npc/descriptions/boobs/boobsShape.js b/src/npc/descriptions/boobs/boobsShape.js
index 173cd8b0a0f..a041233b199 100644
--- a/src/npc/descriptions/boobs/boobsShape.js
+++ b/src/npc/descriptions/boobs/boobsShape.js
@@ -218,25 +218,25 @@ App.Desc.boobsShape = function(slave) {
 			const boobThreshold = V.arcologies[0].FSSlimnessEnthusiast !== "unset" ? 400 : 600;
 			if (slave.boobs >= boobThreshold) {
 				if (slave.boobs >= 10000) {
-					if (slave.boobsImplant / slave.boobs < 0.75) {
+					if (slave.boobsImplant / slave.boobs < .75) {
 						r.push(`${His} breasts are <span class="red">disgustingly natural</span> for their size.`);
 					} else {
 						r.push(`${His} breasts are <span class="green">obviously implants,</span> as they should be.`);
 					}
 				} else if (slave.boobs >= 2000) {
-					if (slave.boobsImplant / slave.boobs < 0.5) {
+					if (slave.boobsImplant / slave.boobs < .50) {
 						r.push(`${His} breasts are <span class="red">disgustingly natural</span> for their size.`);
 					} else {
 						r.push(`${His} breasts are <span class="green">obviously implants,</span> as they should be.`);
 					}
 				} else if (slave.boobs >= 1000) {
-					if (slave.boobsImplant / slave.boobs < 0.25) {
+					if (slave.boobsImplant / slave.boobs < .25) {
 						r.push(`${His} breasts are <span class="red">disgustingly natural</span> for their size.`);
 					} else {
 						r.push(`${His} breasts are <span class="green">obviously implants,</span> as they should be.`);
 					}
 				} else {
-					if (slave.boobsImplant / slave.boobs < 0.1) {
+					if (slave.boobsImplant / slave.boobs < .10) {
 						r.push(`${His} breasts are <span class="red">disgustingly natural</span> for their size.`);
 					} else {
 						r.push(`${His} breasts are <span class="green">obviously implants,</span> as they should be.`);
diff --git a/src/npc/descriptions/butt/butt.js b/src/npc/descriptions/butt/butt.js
index 165aa647f4e..3b2d0b828b8 100644
--- a/src/npc/descriptions/butt/butt.js
+++ b/src/npc/descriptions/butt/butt.js
@@ -1189,7 +1189,7 @@ App.Desc.butt = function(slave, descType = DescType.NORMAL) {
 		if (V.arcologies[0].FSTransformationFetishist > 20) {
 			const buttThreshold = V.arcologies[0].FSSlimnessEnthusiast !== "unset" ? 3 : 6;
 			if (slave.butt >= buttThreshold) {
-				if (slave.buttImplant / slave.butt < 0.25) {
+				if (slave.buttImplant / slave.butt < .25) {
 					r.push(`${His} ass is <span class="red">disgustingly natural</span> for its size.`);
 				} else {
 					r.push(`${His} asscheeks are <span class="green">obviously implants,</span> as they should be.`);
diff --git a/src/npc/descriptions/longSlave.js b/src/npc/descriptions/longSlave.js
index 5d55dfc4c66..f6d5042f748 100644
--- a/src/npc/descriptions/longSlave.js
+++ b/src/npc/descriptions/longSlave.js
@@ -468,7 +468,7 @@ App.Desc.longSlave = function(slave, {descType, market = 0, prisonCrime, noArt}
 		if (App.Data.misc.redheadColors.includes(slave.hColor)) {
 			if (slave.hLength >= 10) {
 				if (slave.markings === "freckles" || slave.markings === "heavily freckled") {
-					if (App.Medicine.Modification.naturalSkins.includes(slave.skin) && skinToneLevel(slave.skin).isBetween(5, 10)) {
+					if (App.Medicine.Modification.naturalSkins.includes(slave.skin) && typeof skinToneLevel(slave.skin) === number && skinToneLevel(slave.skin).isBetween(5, 10)) {
 						r.push(`It goes perfectly with ${his} ${slave.skin} skin and freckles.`);
 					}
 				}
diff --git a/src/npc/descriptions/mouth.js b/src/npc/descriptions/mouth.js
index 4b9833168f3..606e946e08b 100644
--- a/src/npc/descriptions/mouth.js
+++ b/src/npc/descriptions/mouth.js
@@ -35,7 +35,7 @@ App.Desc.mouth = function(slave) {
 			}
 			if (V.arcologies[0].FSTransformationFetishist > 20) {
 				if (slave.lips > 70) {
-					if (slave.lipsImplant / slave.lips < 0.5) {
+					if (slave.lipsImplant / slave.lips < .50) {
 						r.push(`${His} lips are huge and <span class="red">disgustingly natural</span> for their size.`);
 					} else {
 						r.push(`${His} lips are huge and <span class="green">obviously implants,</span> as they should be.`);
diff --git a/src/npc/descriptions/skin.js b/src/npc/descriptions/skin.js
index 1436e041d18..ee2c6c2658d 100644
--- a/src/npc/descriptions/skin.js
+++ b/src/npc/descriptions/skin.js
@@ -77,7 +77,7 @@ App.Desc.skin = function(slave, descType) {
 			r.push(`${slave.skin} and lightly spotted.`);
 		} else if (slave.markings === "freckles") {
 			r.push(`${slave.skin} and lightly`);
-			if (skinToneLevel(slave.skin).isBetween(5, 10) && (App.Data.misc.redheadColors.includes(slave.hColor))) {
+			if (typeof skinToneLevel(slave.skin) === number && skinToneLevel(slave.skin).isBetween(5, 10) && (App.Data.misc.redheadColors.includes(slave.hColor))) {
 				r.push(`freckled, an attractive combination.`);
 			} else {
 				r.push(`freckled.`);
@@ -86,7 +86,7 @@ App.Desc.skin = function(slave, descType) {
 			r.push(`${slave.skin} and heavily spotted.`);
 		} else if (slave.markings === "heavily freckled") {
 			r.push(`${slave.skin} and heavily`);
-			if (skinToneLevel(slave.skin).isBetween(5, 10) && (App.Data.misc.redheadColors.includes(slave.hColor))) {
+			if (typeof skinToneLevel(slave.skin) === number && skinToneLevel(slave.skin).isBetween(5, 10) && (App.Data.misc.redheadColors.includes(slave.hColor))) {
 				r.push(`freckled, an attractive combination.`);
 			} else {
 				r.push(`freckled.`);
diff --git a/src/npc/interaction/fAssistedSex.js b/src/npc/interaction/fAssistedSex.js
index b23397e0e5a..63f4e5b3e80 100644
--- a/src/npc/interaction/fAssistedSex.js
+++ b/src/npc/interaction/fAssistedSex.js
@@ -141,7 +141,7 @@ App.Interact.fAssistedSex = function(slave) {
 				text.push(`${his} overgrown, wobbling ass cheeks`);
 			} else if (slave.butt > 5) {
 				text.push(`${his} huge, wobbling ass cheeks`);
-			} else if (Math.floor(slave.buttImplant/slave.butt) > 0.6) {
+			} else if (Math.floor(slave.buttImplant/slave.butt) > .60) {
 				text.push(`${his} saline inflated ass cheeks`);
 			} else if (slave.butt > 2) {
 				text.push(`${his} wobbling ass cheeks`);
diff --git a/src/npc/interaction/fBellyFuck.js b/src/npc/interaction/fBellyFuck.js
index 12e8a5a124a..5f999e3d31a 100644
--- a/src/npc/interaction/fBellyFuck.js
+++ b/src/npc/interaction/fBellyFuck.js
@@ -132,7 +132,7 @@ App.Interact.fBellyFuck = function(slave) {
 			text.push(`insanely enormous ass,`);
 		} else if (slave.butt > 5) {
 			text.push(`huge ass,`);
-		} else if (Math.floor(slave.buttImplant/slave.butt) > 0.6) {
+		} else if (Math.floor(slave.buttImplant/slave.butt) > .60) {
 			text.push(`jiggly, saline filled ass,`);
 		} else if (slave.butt > 2) {
 			text.push(`thick ass,`);
diff --git a/src/npc/interaction/fPoolSex.js b/src/npc/interaction/fPoolSex.js
index bfaf3cf0afb..aeec33d65eb 100644
--- a/src/npc/interaction/fPoolSex.js
+++ b/src/npc/interaction/fPoolSex.js
@@ -71,7 +71,7 @@ App.Interact.fPoolSex = function(slave) {
 				r.push(`debilitatingly enormous, cushiony ass`);
 			} else if (slave.butt > 5) {
 				r.push(`massive, cushiony ass`);
-			} else if (Math.floor(slave.buttImplant / slave.butt) > 0.6) {
+			} else if (Math.floor(slave.buttImplant / slave.butt) > .60) {
 				r.push(`implant swollen ass`);
 			} else if (slave.butt > 2) {
 				r.push(`plush ass`);
@@ -148,7 +148,7 @@ App.Interact.fPoolSex = function(slave) {
 				r.push(`debilitatingly enormous, cushiony ass`);
 			} else if (slave.butt > 5) {
 				r.push(`massive, cushiony ass`);
-			} else if (Math.floor(slave.buttImplant / slave.butt) > 0.6) {
+			} else if (Math.floor(slave.buttImplant / slave.butt) > .60) {
 				r.push(`implant swollen ass`);
 			} else if (slave.butt > 2) {
 				r.push(`plush ass`);
-- 
GitLab