From 5f47de8d49b2ea20365a99cec81aa58b23a5b24b Mon Sep 17 00:00:00 2001
From: lowercasedonkey <lowercasedonkey@gmail.com>
Date: Thu, 4 Jun 2020 21:07:33 -0400
Subject: [PATCH] accent

---
 src/npc/descriptions/accent.js            | 29 +++++++++++++++++++++++
 src/uncategorized/longSlaveDescription.tw |  4 ++--
 src/utility/descriptionWidgetsFlesh.tw    | 16 -------------
 3 files changed, 31 insertions(+), 18 deletions(-)
 create mode 100644 src/npc/descriptions/accent.js

diff --git a/src/npc/descriptions/accent.js b/src/npc/descriptions/accent.js
new file mode 100644
index 00000000000..07ef4aad9db
--- /dev/null
+++ b/src/npc/descriptions/accent.js
@@ -0,0 +1,29 @@
+App.Desc.accent = function(slave) {
+	const r = [];
+	const {
+		he, him, his, hers, himself, boy, He, His
+	} = getPronouns(slave);
+	let accent;
+	if (slave.accent !== 0) {
+		if (slave.accent === 1) {
+			accent = either("a beautiful", "a distinctive", "an intriguing", "a light", "a lovely", "a mild", "a pleasant", "a rich", "a slight", "a smooth");
+			r.push(`${He} speaks ${V.language} in ${accent} ${aNational(slave.nationality)}`);
+			if (slave.rules.speech === "accent elimination") {
+				r.push(`accent, which the rules encourage ${him} to suppress.`);
+			} else {
+				r.push(`accent.`);
+			}
+		} else if (slave.accent === 2) {
+			accent = either("a broad", "a harsh", "a heavy", "an intense", "a marked", "a noticeable", "a rough", "a significant", "a stressed", "a strong", "a thick");
+			r.push(`${He} speaks ${V.language} in ${accent} ${aNational(slave.nationality)} accent that can be hard to`);
+			if (slave.rules.speech === "accent elimination") {
+				r.push(`understand, and the rules encourage ${him} to make an effort to suppress it.`);
+			} else {
+				r.push(`understand.`);
+			}
+		} else {
+			r.push(`${He} speaks little ${V.language}, but understands enough to be given orders.`);
+		}
+	}
+	return r.join(" ");
+};
diff --git a/src/uncategorized/longSlaveDescription.tw b/src/uncategorized/longSlaveDescription.tw
index 724a6a71092..12c354b401d 100644
--- a/src/uncategorized/longSlaveDescription.tw
+++ b/src/uncategorized/longSlaveDescription.tw
@@ -194,7 +194,7 @@ is
 			<</if>>
 
 			<<if canTalk($activeSlave, false)>>
-				<<accentDescription>>
+				<<= App.Desc.accent($activeSlave)>>
 			<</if>>
 
 		<</if>>
@@ -1781,7 +1781,7 @@ $He is
 
 <<if $saleDescription == 1>>
 
-	<<accentDescription>>
+	<<= App.Desc.accent($activeSlave)>>
 
 <</if>>
 
diff --git a/src/utility/descriptionWidgetsFlesh.tw b/src/utility/descriptionWidgetsFlesh.tw
index 7069f032dc2..44774144680 100644
--- a/src/utility/descriptionWidgetsFlesh.tw
+++ b/src/utility/descriptionWidgetsFlesh.tw
@@ -1,21 +1,5 @@
 :: flesh description widgets [widget nobr]
 
-<<widget "accentDescription">>
-
-<<if $activeSlave.accent != 0>>
-	<<if $activeSlave.accent == 1>>
-		<<set _accent = either("a beautiful", "a distinctive", "an intriguing", "a light", "a lovely", "a mild", "a pleasant", "a rich", "a slight", "a smooth")>>
-		$He speaks $language in _accent <<print aNational($activeSlave.nationality)>> accent<<if $activeSlave.rules.speech == "accent elimination">>, which the rules encourage $him to suppress<</if>>.
-	<<elseif $activeSlave.accent == 2>>
-		<<set _accent = either("a broad", "a harsh", "a heavy", "an intense", "a marked", "a noticeable", "a rough", "a significant", "a stressed", "a strong", "a thick")>>
-		$He speaks $language in _accent <<print aNational($activeSlave.nationality)>> accent that can be hard to understand<<if $activeSlave.rules.speech == "accent elimination">>, and the rules encourage $him to make an effort to suppress it<</if>>.
-	<<else>>
-		$He speaks little $language, but understands enough to be given orders.
-	<</if>>
-<</if>>
-
-<</widget>>
-
 <<widget "shouldersDescription">>
 
 <<if $activeSlave.fuckdoll == 0>>
-- 
GitLab