From 11a4d74acd543459a3ef239d63bd34ea40d09561 Mon Sep 17 00:00:00 2001
From: lowercasedonkey <lowercasedonkey@gmail.com>
Date: Sat, 13 Jun 2020 22:52:39 -0400
Subject: [PATCH] split out legs and arms

---
 src/npc/descriptions/arms.js              | 102 ++++++++++++++++
 src/npc/descriptions/dimensions.js        | 142 ++++------------------
 src/npc/descriptions/legs.js              | 131 ++++++++++++++++++++
 src/uncategorized/longSlaveDescription.tw |  25 +---
 4 files changed, 257 insertions(+), 143 deletions(-)
 create mode 100644 src/npc/descriptions/arms.js
 create mode 100644 src/npc/descriptions/legs.js

diff --git a/src/npc/descriptions/arms.js b/src/npc/descriptions/arms.js
new file mode 100644
index 00000000000..d8ccb8e33b0
--- /dev/null
+++ b/src/npc/descriptions/arms.js
@@ -0,0 +1,102 @@
+/**
+ * @param {App.Entity.SlaveState} slave
+ * @returns {string}
+ */
+App.Desc.arms = function(slave) {
+	const r = [];
+	const {
+		his, He
+	} = getPronouns(slave);
+
+	if (hasAnyNaturalArms(slave)) {
+		if (slave.weight > 190) {
+			r.push(`${He} has`);
+			if (hasBothNaturalArms(slave)) {
+				r.push(`hugely thick arms`);
+			} else {
+				r.push(`a hugely thick arm`);
+			}
+			r.push(`with sagging fat`);
+			if (slave.muscles > 5) {
+				r.push(`rolls and`);
+			} else {
+				r.push(`rolls.`);
+			}
+		} else if (slave.weight > 160) {
+			r.push(`${He} has`);
+			if (hasBothNaturalArms(slave)) {
+				r.push(`thick arms`);
+			} else {
+				r.push(`a thick arm`);
+			}
+			r.push(`with drooping fat`);
+			if (slave.muscles > 5) {
+				r.push(`folds and`);
+			} else {
+				r.push(`folds.`);
+			}
+		} else if (slave.weight > 130) {
+			r.push(`${He} has`);
+			if (hasBothNaturalArms(slave)) {
+				if (slave.muscles > 5) {
+					r.push(`plump arms with`);
+				} else {
+					r.push(`plump arms.`);
+				}
+			} else {
+				if (slave.muscles > 5) {
+					r.push(`a plump arm with`);
+				} else {
+					r.push(`a plump arm.`);
+				}
+			}
+		} else if (slave.weight > 97) {
+			r.push(`${He} has`);
+			if (hasBothNaturalArms(slave)) {
+				if (slave.muscles > 5) {
+					r.push(`chubby arms with`);
+				} else {
+					r.push(`chubby arms.`);
+				}
+			} else {
+				if (slave.muscles > 5) {
+					r.push(`a chubby arm with`);
+				} else {
+					r.push(`a chubby arm.`);
+				}
+			}
+		} else if (slave.muscles > 5) {
+			r.push(`${He} has`);
+			if (hasBothNaturalArms(slave)) {
+				r.push(`normal arms`);
+			} else {
+				r.push(`a normal arm`);
+			}
+			r.push(`with`);
+		}
+
+		if (slave.muscles > 95) {
+			if (slave.weight > 95) {
+				r.push(`huge muscles hidden beneath ${his} soft flesh.`);
+			} else {
+				r.push(`huge muscles.`);
+			}
+		} else if (slave.muscles > 30) {
+			if (slave.weight > 95) {
+				r.push(`obvious muscles hidden beneath ${his} soft flesh.`);
+			} else {
+				r.push(`obvious muscles.`);
+			}
+		} else if (slave.muscles > 5) {
+			if (slave.weight > 30) {
+				r.push(`toned muscles hidden beneath ${his} soft flesh.`);
+			} else {
+				r.push(`toned muscles.`);
+			}
+		} else {
+			// little muscle to them.
+		}
+	}
+	return r.join(" ");
+};
+
diff --git a/src/npc/descriptions/dimensions.js b/src/npc/descriptions/dimensions.js
index 58020c27d0a..7f11a7ef5f4 100644
--- a/src/npc/descriptions/dimensions.js
+++ b/src/npc/descriptions/dimensions.js
@@ -26,7 +26,7 @@ App.Desc.dimensions = function(slave) {
 	r.push(App.Desc.heightImplant(slave));
 
 	r.push(muscles());
-	r.push(arms());
+	r.push(App.Desc.arms(slave));
 
 	return r.join(" ");
 
@@ -70,62 +70,62 @@ App.Desc.dimensions = function(slave) {
 		const r = [];
 		if (slave.weight > 190) {
 			if (V.arcologies[0].FSHedonisticDecadence !== "unset") {
-				r.push(either("perfectly curvy.", "perfectly plush."));
+				r.push(either(`perfectly curvy.`, `perfectly plush.`));
 			} else {
-				r.push(`<span class="red">${either("dangerously fat", "dangerously overweight", "extremely obese")}.</span>`);
+				r.push(`<span class="red">${either(`dangerously fat`, `dangerously overweight`, `extremely obese`)}.</span>`);
 			}
 		} else if (slave.weight > 160) {
 			if (V.arcologies[0].FSHedonisticDecadence !== "unset") {
-				r.push(either("spectacularly curvy.", "spectacularly plush."));
+				r.push(either(`spectacularly curvy.`, `spectacularly plush.`));
 			} else {
-				r.push(`<span class="red">${either("extremely fat", "extremely overweight", "very obese")}.</span>`);
+				r.push(`<span class="red">${either(`extremely fat`, `extremely overweight`, `very obese`)}.</span>`);
 			}
 		} else if (slave.weight > 130) {
 			if (V.arcologies[0].FSHedonisticDecadence !== "unset") {
-				r.push(either("amazingly curvy.", "amazingly plush."));
+				r.push(either(`amazingly curvy.`, `amazingly plush.`));
 			} else {
-				r.push(`<span class="red">${either("obese", "very fat", "very overweight")}.</span>`);
+				r.push(`<span class="red">${either(`obese`, `very fat`, `very overweight`)}.</span>`);
 			}
 		} else if (slave.weight > 95) {
 			if (V.arcologies[0].FSHedonisticDecadence !== "unset") {
 				if (slave.hips > 1) {
-					r.push(`${either("extremely curvy", "extremely plush")}, ${his} huge hips complementing ${his} plushness perfectly`);
+					r.push(`${either(`extremely curvy`, `extremely plush`)}, ${his} huge hips complementing ${his} plushness perfectly`);
 				} else {
-					r.push(`${either("extremely curvy", "extremely plush")}.`);
+					r.push(`${either(`extremely curvy`, `extremely plush`)}.`);
 				}
 			} else if (slave.hips > 1) {
-				r.push(`${either("extremely curvy", "extremely plush")}, but ${his} huge hips make the extra weight attractive on ${him}.`);
+				r.push(`${either(`extremely curvy`, `extremely plush`)}, but ${his} huge hips make the extra weight attractive on ${him}.`);
 			} else {
-				r.push(`<span class="red">${either("carrying a lot of extra weight", "fat", "overweight")}.</span>`);
+				r.push(`<span class="red">${either(`carrying a lot of extra weight`, `fat`, `overweight`)}.</span>`);
 			}
 		} else if (slave.weight > 30) {
 			if (V.arcologies[0].FSHedonisticDecadence !== "unset") {
 				if (slave.hips > 1) {
-					r.push(`${either("quite curvy", "very plush")}, ${his} motherly hips adding to ${his} soft appeal`);
+					r.push(`${either(`quite curvy`, `very plush`)}, ${his} motherly hips adding to ${his} soft appeal`);
 				} else {
-					r.push(`${either("quite curvy", "very plush")}.`);
+					r.push(`${either(`quite curvy`, `very plush`)}.`);
 				}
 			} else if (slave.hips > 1) {
-				r.push(`${either("quite curvy", "very plush")}, but ${his} motherly hips make the extra weight attractive on ${him}.`);
+				r.push(`${either(`quite curvy`, `very plush`)}, but ${his} motherly hips make the extra weight attractive on ${him}.`);
 			} else {
-				r.push(`<span class="red">${either("carrying extra weight", "chubby")}.</span>`);
+				r.push(`<span class="red">${either(`carrying extra weight`, `chubby`)}.</span>`);
 			}
 		} else if (slave.weight > 10) {
-			r.push(either("nicely plush.", "pleasingly curvy."));
+			r.push(either(`nicely plush.`, `pleasingly curvy.`));
 		} else if (slave.weight >= -10) {
-			r.push(either("a healthy weight.", `an attractive weight for ${his} frame.`, "neither too fat nor too skinny."));
+			r.push(either(`a healthy weight.`, `an attractive weight for ${his} frame.`, `neither too fat nor too skinny.`));
 		} else if (slave.weight >= -30) {
-			r.push(either("appealingly skinny.", "pleasingly thin."));
+			r.push(either(`appealingly skinny.`, `pleasingly thin.`));
 		} else if (slave.weight >= -95) {
 			if (slave.hips > 1) {
-				r.push(`${either("quite skinny", "very thin")}, but ${his} wide hips make the gap between ${his} thighs very noticeable.`);
+				r.push(`${either(`quite skinny`, `very thin`)}, but ${his} wide hips make the gap between ${his} thighs very noticeable.`);
 			} else if (slave.hips < -1) {
-				r.push(`${either("quite skinny", "very thin")}, but ${his} trim hips make ${him} look like a model.`);
+				r.push(`${either(`quite skinny`, `very thin`)}, but ${his} trim hips make ${him} look like a model.`);
 			} else {
-				r.push(`<span class="red">${either("rail thin", "too skinny", "underweight")}.</span>`);
+				r.push(`<span class="red">${either(`rail thin`, `too skinny`, `underweight`)}.</span>`);
 			}
 		} else {
-			r.push(`<span class="red">${either("dangerously skinny", "emaciated")}.</span>`);
+			r.push(`<span class="red">${either(`dangerously skinny`, `emaciated`)}.</span>`);
 		}
 		return r.join(" ");
 	}
@@ -245,7 +245,6 @@ App.Desc.dimensions = function(slave) {
 		}
 		return r.join(" ");
 	}
-
 	function muscles() {
 		const r = [];
 		r.push(`${He} is`);
@@ -271,7 +270,7 @@ App.Desc.dimensions = function(slave) {
 				r.push(`muscles.`);
 			}
 		} else if (slave.muscles > 5) {
-			r.push(`<span class="pink">well built,</span> yet feminine, with just - visible`);
+			r.push(`<span class="pink">well built,</span> yet feminine, with just-visible`);
 			if (slave.weight > 30) {
 				r.push(`muscles hidden beneath a layer of fat`);
 			} else {
@@ -296,99 +295,4 @@ App.Desc.dimensions = function(slave) {
 		}
 		return r.join(" ");
 	}
-
-	function arms() {
-		const r = [];
-		if (hasAnyNaturalArms(slave)) {
-			if (slave.weight > 190) {
-				r.push(`${He} has`);
-				if (hasBothNaturalArms(slave)) {
-					r.push(`hugely thick arms`);
-				} else {
-					r.push(`a hugely thick arm`);
-				}
-				r.push(`with sagging fat`);
-				if (slave.muscles > 5) {
-					r.push(`rolls and`);
-				} else {
-					r.push(`rolls.`);
-				}
-			} else if (slave.weight > 160) {
-				r.push(`${He} has`);
-				if (hasBothNaturalArms(slave)) {
-					r.push(`thick arms`);
-				} else {
-					r.push(`a thick arm`);
-				}
-				r.push(`with drooping fat`);
-				if (slave.muscles > 5) {
-					r.push(`folds and`);
-				} else {
-					r.push(`folds.`);
-				}
-			} else if (slave.weight > 130) {
-				r.push(`${He} has`);
-				if (hasBothNaturalArms(slave)) {
-					if (slave.muscles > 5) {
-						r.push(`plump arms with`);
-					} else {
-						r.push(`plump arms.`);
-					}
-				} else {
-					if (slave.muscles > 5) {
-						r.push(`a plump arm with`);
-					} else {
-						r.push(`a plump arm.`);
-					}
-				}
-			} else if (slave.weight > 97) {
-				r.push(`${He} has`);
-				if (hasBothNaturalArms(slave)) {
-					if (slave.muscles > 5) {
-						r.push(`chubby arms with`);
-					} else {
-						r.push(`chubby arms.`);
-					}
-				} else {
-					if (slave.muscles > 5) {
-						r.push(`a chubby arm with`);
-					} else {
-						r.push(`a chubby arm.`);
-					}
-				}
-			} else if (slave.muscles > 5) {
-				r.push(`${He} has`);
-				if (hasBothNaturalArms(slave)) {
-					r.push(`normal arms`);
-				} else {
-					r.push(`a normal arm`);
-				}
-				r.push(`with`);
-			}
-
-			if (slave.muscles > 95) {
-				if (slave.weight > 95) {
-					r.push(`huge muscles hidden beneath ${his} soft flesh.`);
-				} else {
-					r.push(`huge muscles.`);
-				}
-			} else if (slave.muscles > 30) {
-				if (slave.weight > 95) {
-					r.push(`obvious muscles hidden beneath ${his} soft flesh.`);
-				} else {
-					r.push(`obvious muscles.`);
-				}
-			} else if (slave.muscles > 5) {
-				r.push(``);
-				if (slave.weight > 30) {
-					r.push(`toned muscles hidden beneath ${his} soft flesh.`);
-				} else {
-					r.push(`toned muscles.`);
-				}
-			} else {
-				// little muscle to them.
-			}
-		}
-		return r.join(" ");
-	}
 };
diff --git a/src/npc/descriptions/legs.js b/src/npc/descriptions/legs.js
new file mode 100644
index 00000000000..1282f78d05c
--- /dev/null
+++ b/src/npc/descriptions/legs.js
@@ -0,0 +1,131 @@
+/**
+ * @param {App.Entity.SlaveState} slave
+ * @returns {string}
+ */
+App.Desc.legs = function(slave) {
+	const r = [];
+	const {
+		his, He
+	} = getPronouns(slave);
+
+	if (hasAnyNaturalLegs(slave)) {
+		if (slave.weight > 190) {
+			r.push(`${He} has`);
+			if (hasBothNaturalLegs(slave)) {
+				r.push(`extremely fat legs with immense soft, rather uneven`);
+				if (slave.muscles > 5) {
+					r.push(`thighs and`);
+				} else {
+					r.push(`thighs.`);
+				}
+			} else {
+				r.push(`an extremely fat leg with an immense soft, rather uneven`);
+				if (slave.muscles > 5) {
+					r.push(`thigh and`);
+				} else {
+					r.push(`thigh.`);
+				}
+			}
+		} else if (slave.weight > 160) {
+			r.push(`${He} has`);
+			if (hasBothNaturalLegs(slave)) {
+				r.push(`very fat legs with massively thick, soft, somewhat uneven`);
+				if (slave.muscles > 5) {
+					r.push(`thighs and`);
+				} else {
+					r.push(`thighs.`);
+				}
+			} else {
+				r.push(`a very fat leg with a massively thick, soft, somewhat uneven`);
+				if (slave.muscles > 5) {
+					r.push(`thigh and`);
+				} else {
+					r.push(`thigh.`);
+				}
+			}
+		} else if (slave.weight > 130) {
+			r.push(`${He} has`);
+			if (hasBothNaturalLegs(slave)) {
+				r.push(`fat legs with hugely thick, soft`);
+				if (slave.muscles > 5) {
+					r.push(`thighs and`);
+				} else {
+					r.push(`thighs.`);
+				}
+			} else {
+				r.push(`a fat leg with a hugely thick, soft`);
+				if (slave.muscles > 5) {
+					r.push(`thigh and`);
+				} else {
+					r.push(`thigh.`);
+				}
+			}
+		} else if (slave.weight > 97) {
+			r.push(`${He} has`);
+			if (hasBothNaturalLegs(slave)) {
+				r.push(`fat legs with thick, soft`);
+				if (slave.muscles > 5) {
+					r.push(`thighs and`);
+				} else {
+					r.push(`thighs.`);
+				}
+			} else {
+				r.push(`a fat leg with a thick, soft`);
+				if (slave.muscles > 5) {
+					r.push(`thigh and`);
+				} else {
+					r.push(`thigh.`);
+				}
+			}
+		} else if (slave.weight > 95) {
+			r.push(`${He} has`);
+			if (hasBothNaturalLegs(slave)) {
+				r.push(`normal legs with thick, soft`);
+				if (slave.muscles > 5) {
+					r.push(`thighs and`);
+				} else {
+					r.push(`thighs.`);
+				}
+			} else {
+				r.push(`a normal leg with a thick, soft`);
+				if (slave.muscles > 5) {
+					r.push(`thigh and`);
+				} else {
+					r.push(`thigh.`);
+				}
+			}
+		} else if (slave.muscles > 5) {
+			r.push(`${He} has`);
+			if (hasBothNaturalLegs(slave)) {
+				r.push(`relatively normal legs and thighs`);
+			} else {
+				r.push(`a relatively normal leg and thigh`);
+			}
+			r.push(`with`);
+		}
+
+		if (slave.muscles > 95) {
+			if (slave.weight > 95) {
+				r.push(`huge muscles hidden beneath ${his} soft flab.`);
+			} else {
+				r.push(`huge muscles.`);
+			}
+		} else if (slave.muscles > 30) {
+			if (slave.weight > 95) {
+				r.push(`obvious muscles hidden beneath ${his} soft flab.`);
+			} else {
+				r.push(`obvious muscles.`);
+			}
+		} else if (slave.muscles > 5) {
+			if (slave.weight > 30) {
+				r.push(`toned muscles hidden beneath ${his} soft flab.`);
+			} else {
+				r.push(`toned muscles.`);
+			}
+		} else {
+			// barely any muscle in them.
+		}
+	}
+	return r.join(" ");
+};
+
diff --git a/src/uncategorized/longSlaveDescription.tw b/src/uncategorized/longSlaveDescription.tw
index 2fa61c4658e..0ee34090e0e 100644
--- a/src/uncategorized/longSlaveDescription.tw
+++ b/src/uncategorized/longSlaveDescription.tw
@@ -369,30 +369,7 @@ is
 
 <<= App.Desc.pregnancy($activeSlave)>>
 
-<<if hasAnyNaturalLegs($activeSlave)>>
-	<<if $activeSlave.weight > 190>>
-		$He has <<if hasBothNaturalLegs($activeSlave)>>extremely fat legs with immense soft, rather uneven thighs<<else>>an extremely fat leg with an immense soft, rather uneven thigh<</if>><<if $activeSlave.muscles > 5>> and<<else>>.<</if>>
-	<<elseif $activeSlave.weight > 160>>
-		$He has <<if hasBothNaturalLegs($activeSlave)>>very fat legs with massively thick, soft, somewhat uneven thighs<<else>>a very fat leg with a massively thick, soft, somewhat uneven thigh<</if>><<if $activeSlave.muscles > 5>> and<<else>>.<</if>>
-	<<elseif $activeSlave.weight > 130>>
-		$He has <<if hasBothNaturalLegs($activeSlave)>>fat legs with hugely thick, soft thighs<<else>>a fat leg with a hugely thick, soft thigh<</if>><<if $activeSlave.muscles > 5>> and<<else>>.<</if>>
-	<<elseif $activeSlave.weight > 97>>
-		$He has <<if hasBothNaturalLegs($activeSlave)>>fat legs with thick, soft thighs<<else>>a fat leg with a thick, soft thigh<</if>><<if $activeSlave.muscles > 5>> and<<else>>.<</if>>
-	<<elseif $activeSlave.weight > 95>>
-		$He has <<if hasBothNaturalLegs($activeSlave)>>normal legs with thick, soft thighs<<else>> a normal leg with a thick, soft thigh<</if>><<if $activeSlave.muscles > 5>> and<<else>>.<</if>>
-	<<elseif $activeSlave.muscles > 5>>
-		$He has <<if hasBothNaturalLegs($activeSlave)>>relatively normal legs and thighs<<else>>a relatively normal leg and thigh<</if>> with
-	<</if>>
-	<<if $activeSlave.muscles > 95>>
-		huge muscles<<if $activeSlave.weight > 95>> hidden beneath $his soft flab<</if>>.
-	<<elseif $activeSlave.muscles > 30>>
-		obvious muscles<<if $activeSlave.weight > 95>> hidden beneath $his soft flab<</if>>.
-	<<elseif $activeSlave.muscles > 5>>
-		toned muscles<<if $activeSlave.weight > 30>> hidden beneath $his soft flab<</if>>.
-	<<else>>
-		/*barely any muscle in them.*/
-	<</if>>
-<</if>>
+<<= App.Desc.legs($activeSlave)>>
 
 <<= App.Desc.mods($activeSlave, "thigh")>>
 <<= App.Desc.mods($activeSlave, "calf")>>
-- 
GitLab