From 447b009372907a54b83a178bac068c5ab6413d86 Mon Sep 17 00:00:00 2001
From: Svornost <11434-svornost@users.noreply.gitgud.io>
Date: Fri, 5 Jun 2020 16:07:52 -0700
Subject: [PATCH] Reduce code duplication caused by Transformationist
 thresholds being shifted by Slimness Enthusiasm.

---
 src/npc/descriptions/boobs/boobsShape.js | 73 +++++++-----------------
 src/npc/descriptions/butt/butt.js        | 21 ++-----
 2 files changed, 28 insertions(+), 66 deletions(-)

diff --git a/src/npc/descriptions/boobs/boobsShape.js b/src/npc/descriptions/boobs/boobsShape.js
index d8624869797..349e986c710 100644
--- a/src/npc/descriptions/boobs/boobsShape.js
+++ b/src/npc/descriptions/boobs/boobsShape.js
@@ -191,60 +191,31 @@ App.Desc.boobsShape = function(slave) {
 		}
 
 		if (V.arcologies[0].FSTransformationFetishist > 20) {
-			if (V.arcologies[0].FSSlimnessEnthusiast !== "unset") {
-				if (slave.boobs >= 400) {
-					if (slave.boobs >= 10000) {
-						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 < .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 < .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.`);
-						}
+			const boobThreshold = V.arcologies[0].FSSlimnessEnthusiast !== "unset" ? 400 : 600;
+			if (slave.boobs >= boobThreshold) {
+				if (slave.boobs >= 10000) {
+					if (slave.boobsImplant / slave.boobs < .75) {
+						r.push(`${His} breasts are <span class="red">disgustingly natural</span> for their size.`);
 					} else {
-						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.`);
-						}
+						r.push(`${His} breasts are <span class="green">obviously implants,</span> as they should be.`);
 					}
-				}
-			} else {
-				if (slave.boobs >= 600) {
-					if (slave.boobs >= 10000) {
-						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 < .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 < .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.boobs >= 2000) {
+					if (slave.boobsImplant / slave.boobs < .50) {
+						r.push(`${His} breasts are <span class="red">disgustingly natural</span> for their size.`);
 					} else {
-						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.`);
-						}
+						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 < .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 < .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 77018c2f960..5a34b9de75c 100644
--- a/src/npc/descriptions/butt/butt.js
+++ b/src/npc/descriptions/butt/butt.js
@@ -1155,21 +1155,12 @@ App.Desc.butt = function(slave) {
 			}
 		}
 		if (V.arcologies[0].FSTransformationFetishist > 20) {
-			if (V.arcologies[0].FSSlimnessEnthusiast !== "unset") {
-				if (slave.butt >= 3) {
-					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.`);
-					}
-				}
-			} else {
-				if (slave.butt >= 6) {
-					if (slave.buttImplant / slave.butt < .5) {
-						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.`);
-					}
+			const buttThreshold = V.arcologies[0].FSSlimnessEnthusiast !== "unset" ? 3 : 6;
+			if (slave.butt >= buttThreshold) {
+				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.`);
 				}
 			}
 		}
-- 
GitLab