From 11dc29aed537983c0b7b621cf3d896b560bee393 Mon Sep 17 00:00:00 2001
From: lowercasedonkey <lowercasedonkey@gmail.com>
Date: Sat, 13 Jun 2020 23:16:41 -0400
Subject: [PATCH] prestige

---
 src/npc/descriptions/prestige.js          | 42 +++++++++++++++++++++++
 src/uncategorized/longSlaveDescription.tw | 28 +--------------
 2 files changed, 43 insertions(+), 27 deletions(-)
 create mode 100644 src/npc/descriptions/prestige.js

diff --git a/src/npc/descriptions/prestige.js b/src/npc/descriptions/prestige.js
new file mode 100644
index 00000000000..f422b1b5071
--- /dev/null
+++ b/src/npc/descriptions/prestige.js
@@ -0,0 +1,42 @@
+/**
+ * @param {App.Entity.SlaveState} slave
+ * @returns {string}
+ */
+App.Desc.prestige = function(slave) {
+	const r = [];
+	const {
+		He, him, he, his
+	} = getPronouns(slave);
+
+	if (slave.prestige > 0) {
+		if (slave.prestigeDesc) {
+			r.push(`${slave.prestigeDesc}`);
+		} if (slave.prestige > 2) {
+			r.push(`<span class="green">It is extremely prestigious to own ${him}.</span>`);
+		} else if (slave.prestige > 1) {
+			r.push(`<span class="green">It is quite prestigious to own ${him}.</span>`);
+		} else {
+			r.push(`<span class="green">It is fairly prestigious to own ${him}.</span>`);
+		}
+	}
+
+	if (slave.porn.prestige > 0) {
+		if (slave.porn.prestigeDesc) {
+			r.push(`${slave.porn.prestigeDesc}`);
+		} if (slave.porn.prestige > 2) {
+			r.push(`As such, ${he} tends to gain a following wherever ${he} goes.`);
+		} else if (slave.porn.prestige > 1) {
+			r.push(`As such, ${he} is recognized often.`);
+		} else {
+			r.push(`As such, ${he} is recognized occasionally.`);
+		}
+	}
+
+	if (slave.prestige > 0 || slave.porn.prestige > 1) {
+		if (slave.fuckdoll === 0 && slave.markings === "birthmark") {
+			r.push(`${He} has a large, liver - colored birthmark, but since ${he}'s well known, this uniqueness adds to ${his} beauty rather than detracting from it.`);
+		}
+	}
+	return r.join(" ");
+};
+
diff --git a/src/uncategorized/longSlaveDescription.tw b/src/uncategorized/longSlaveDescription.tw
index 5955230e7f5..34bea1c1da2 100644
--- a/src/uncategorized/longSlaveDescription.tw
+++ b/src/uncategorized/longSlaveDescription.tw
@@ -150,33 +150,7 @@ is
 
 <<= App.Desc.career($activeSlave)>>
 
-<<if $activeSlave.prestige > 0>>
-	<<if $activeSlave.prestigeDesc>>$activeSlave.prestigeDesc<</if>>
-	<<if $activeSlave.prestige > 2>>
-		<span class="green">It is extremely prestigious to own $him.</span>
-	<<elseif $activeSlave.prestige > 1>>
-		<span class="green">It is quite prestigious to own $him.</span>
-	<<else>>
-		<span class="green">It is fairly prestigious to own $him.</span>
-	<</if>>
-<</if>>
-
-<<if $activeSlave.porn.prestige > 0>>
-	<<if $activeSlave.porn.prestigeDesc>>$activeSlave.porn.prestigeDesc<</if>>
-	<<if $activeSlave.porn.prestige > 2>>
-		As such, $he tends to gain a following wherever $he goes.
-	<<elseif $activeSlave.porn.prestige > 1>>
-		As such, $he is recognized often.
-	<<else>>
-		As such, $he is recognized occasionally.
-	<</if>>
-<</if>>
-
-<<if $activeSlave.prestige > 0 || $activeSlave.porn.prestige > 1>>
-	<<if $activeSlave.fuckdoll == 0 && $activeSlave.markings == "birthmark">>
-		$He has a large, liver-colored birthmark, but since $he's well known, this uniqueness adds to $his beauty rather than detracting from it.
-	<</if>>
-<</if>>
+<<= App.Desc.prestige($activeSlave)>>
 
 <<= App.Desc.skills($activeSlave)>>
 
-- 
GitLab