From a3be363a8a254a4480ad6af31d86548487e4dbb0 Mon Sep 17 00:00:00 2001
From: Svornost <11434-svornost@users.noreply.gitgud.io>
Date: Wed, 29 Jan 2020 20:43:44 -0800
Subject: [PATCH] Prefer string interpolation to SC re-parsing for pronoun
 insertion where possible

---
 src/endWeek/saGetMilked.js          |  2 +-
 src/endWeek/saPorn.js               |  6 ++--
 src/endWeek/saTakeClasses.js        |  2 +-
 src/js/releaseRules.js              | 47 +++++++++++++++--------------
 src/npc/descriptions/boobs/boobs.js |  4 +--
 5 files changed, 31 insertions(+), 30 deletions(-)

diff --git a/src/endWeek/saGetMilked.js b/src/endWeek/saGetMilked.js
index aa643de961e..d5de581d2b7 100644
--- a/src/endWeek/saGetMilked.js
+++ b/src/endWeek/saGetMilked.js
@@ -432,7 +432,7 @@ window.saGetMilked = (function saGetMilked() {
 				slave.nipples = "cute";
 			} else if (slave.areolae < 4 && jsRandom(1, 100) > (30 + (slave.areolae * 20))) {
 				if (slave.nipples === "fuckable") {
-					r += ` The constant suction around of $his nipples as their depths are drained of milk`;
+					r += ` The constant suction around of ${his} nipples as their depths are drained of milk`;
 				} else {
 					r += ` Producing this river of milk`;
 				}
diff --git a/src/endWeek/saPorn.js b/src/endWeek/saPorn.js
index 8e4adfa98e1..0e013d488d7 100644
--- a/src/endWeek/saPorn.js
+++ b/src/endWeek/saPorn.js
@@ -168,9 +168,9 @@ window.saPorn = (function saPorn() {
 		if (slave.fuckdoll > 0) {
 			return;
 		} else if (slave.collar === "porcelain mask") {
-			r += `${His} mask adds an air of mystery to $him, `;
+			r += `${His} mask adds an air of mystery to ${him}, `;
 			if (slave.porn.prestige > 1) {
-				r += `but people wonder if $he is trying to hide something. `;
+				r += `but people wonder if ${he} is trying to hide something. `;
 			} else if (slave.porn.prestige > 0) {
 				r += `tantalizing viewers with what it hides. `;
 			} else {
@@ -303,7 +303,7 @@ window.saPorn = (function saPorn() {
 				slave.porn.prestigeDesc = `$He is well known from $his career in slave pornography. ${genre.prestigeDesc2}.`;
 				r += `<span class="green">${He} has gained a hold in ${slave.porn.fameType} pornography!</span> ${genre.prestigeDesc2}, so it is now prestigious to own ${him}. `;
 			} else if (slave.porn.fame[highestPorn] >= slave.porn.fame[genre.fameVar] * swapPoint) {
-				r += `${His} fame in ${slave.porn.fameType} pornography has been overwhelmed by $his surging popularity in other aspects. <span class="yellow">${He} is now better known for ${his} ${highestPorn.fameName} porn.</span> `;
+				r += `${His} fame in ${slave.porn.fameType} pornography has been overwhelmed by ${his} surging popularity in other aspects. <span class="yellow">${He} is now better known for ${his} ${highestPorn.fameName} porn.</span> `;
 				slave.porn.fameType = highestPorn.fameName;
 				slave.porn.prestigeDesc = `$He has a following in slave pornography. ${highestPorn.prestigeDesc1}.`;
 			} else if (slave.porn.fame[genre.fameVar] < 5000) {
diff --git a/src/endWeek/saTakeClasses.js b/src/endWeek/saTakeClasses.js
index 069a3719e9c..728e1b228a8 100644
--- a/src/endWeek/saTakeClasses.js
+++ b/src/endWeek/saTakeClasses.js
@@ -277,7 +277,7 @@ window.saTakeClasses = (function saServeThePublic() {
 		}
 		for (let lessons = 0; lessons < learning; lessons++) {
 			if (slave.devotion <= 20 && undevoted === 0) {
-				r += ` Since ${he} is wanting in basic obedience, ${he} suffers through courses on <span class="devotion inc">$his place</span> in the Free Cities world.`;
+				r += ` Since ${he} is wanting in basic obedience, ${he} suffers through courses on <span class="devotion inc">${his} place</span> in the Free Cities world.`;
 				slave.devotion += 10;
 				undevoted++;
 			} else if (slave.skill.oral <= 10) {
diff --git a/src/js/releaseRules.js b/src/js/releaseRules.js
index 18e55663bbd..65d540a01f8 100644
--- a/src/js/releaseRules.js
+++ b/src/js/releaseRules.js
@@ -158,35 +158,36 @@ App.Utils.releaseSummaryLong = function releaseSummaryLong(slave) {
 App.Desc.releaseDesc = function releaseDesc(slave) {
 	const rel = slave.rules.release;
 	const includeFamily = (rel.family === 1) && (V.seeIncest === 1);
+	const {He, he, his} = getPronouns(slave);
 	let r = "and ";
 	let appendFrequency = false;
 	if (rel.masturbation === 0 && rel.partner === 0 && !includeFamily && rel.slaves === 0 && rel.master === 0) {
-		r += "$he is to remain completely chaste.";
+		r += `${he} is to remain completely chaste.`;
 	} else if (rel.masturbation === 1 && rel.partner === 0 && !includeFamily && rel.slaves === 0 && rel.master === 0) {
-		r += "$he is only allowed to masturbate";
+		r += `${he} is only allowed to masturbate`;
 		if (slave.energy > 95) {
-			r += ", which $he is constantly doing.";
+			r += `, which ${he} is constantly doing.`;
 		} else {
-			r += ".";
+			r += `.`;
 		}
 	} else if (rel.masturbation === 0 && rel.partner === 1 && !includeFamily && rel.slaves === 0 && rel.master === 0) {
-		r += "$he is not allowed to masturbate or proposition ";
+		r += `${he} is not allowed to masturbate or proposition `;
 		if (slave.rules.relationship === "permissive" && slave.relationship >= 3) {
-			r += `slaves other than $his ${relationshipTerm(slave)}.`;
+			r += `slaves other than ${his} ${relationshipTerm(slave)}.`;
 		} else {
-			r += "other slaves; $he must find sexual release in $his duties.";
+			r += `other slaves; ${he} must find sexual release in $his duties.`;
 		}
 	} else if (rel.masturbation === 0 && rel.partner === 0 && includeFamily && rel.slaves === 0 && rel.master === 0) {
-		r += "$he is not allowed to masturbate. $He is only allowed to achieve sexual release with close family members,";
+		r += `${he} is not allowed to masturbate. ${He} is only allowed to achieve sexual release with close family members,`;
 		appendFrequency = true;
 	} else if (rel.masturbation === 0 && rel.partner === 0 && !includeFamily && rel.slaves === 0 && rel.master === 1) {
-		r += "$he is not allowed to masturbate. $He must find you if $he wants sexual release,";
+		r += `${he} is not allowed to masturbate. ${He} must find you if ${he} wants sexual release,`;
 		appendFrequency = true;
 	} else if (rel.slaves === 1) {
 		if (rel.masturbation === 0) {
-			r += "$he is not allowed to masturbate, but may ";
+			r += `${he} is not allowed to masturbate, but may `;
 		} else {
-			r += "$he is allowed to masturbate. $He may also ";
+			r += `${he} is allowed to masturbate. ${He} may also `;
 		}
 		if (V.universalRulesConsent === 1) {
 			r += "proposition other slaves to find sexual release,";
@@ -196,30 +197,30 @@ App.Desc.releaseDesc = function releaseDesc(slave) {
 
 		const exceptPartner = (rel.partner === 0) && (slave.rules.relationship === "permissive") && (slave.relationship >= 3);
 		if (exceptPartner && !includeFamily) {
-			r += ` except for $his ${relationshipTerm(slave)} and close family members,`;
+			r += ` except for ${his} ${relationshipTerm(slave)} and close family members,`;
 		} else if (exceptPartner) {
-			r += ` except for $his ${relationshipTerm(slave)},`;
+			r += ` except for ${his} ${relationshipTerm(slave)},`;
 		} else if (!includeFamily) {
-			r += ` except for $his close family members,`;
+			r += ` except for ${his} close family members,`;
 		}
 
 		appendFrequency = true;
 	} else {
 		if (rel.masturbation === 0) {
-			r += "$he is not allowed to masturbate, but may ";
+			r += `${he} is not allowed to masturbate, but may `;
 		} else {
-			r += "$he is allowed to masturbate. $He may also ";
+			r += `${he} is allowed to masturbate. ${He} may also `;
 		}
 
 		const showPartner = (rel.partner === 1) && (slave.rules.relationship === "permissive") && (slave.relationship >= 3);
 		if (includeFamily && showPartner) {
-			r += `have sex with $his ${relationshipTerm(slave)} and close family members,`;
+			r += `have sex with ${his} ${relationshipTerm(slave)} and close family members,`;
 		} else if (showPartner) {
-			r += `fuck $his ${relationshipTerm(slave)} as much as he wants,`;
+			r += `fuck ${his} ${relationshipTerm(slave)} as much as he wants,`;
 		} else if (includeFamily && rel.master === 1) {
-			r += `proposition sex from $his close family members and you,`;
+			r += `proposition sex from ${his} close family members and you,`;
 		} else if (includeFamily) {
-			r += `proposition sex from $his close family members,`;
+			r += `proposition sex from ${his} close family members,`;
 		} else { // should mean rel.master === 1
 			r += `find you for sexual relief,`;
 		}
@@ -228,11 +229,11 @@ App.Desc.releaseDesc = function releaseDesc(slave) {
 	}
 	if (appendFrequency) {
 		if ((slave.devotion > 50) || (slave.energy > 95)) {
-			r += " which $he is constantly doing.";
+			r += ` which ${he} is constantly doing.`;
 		} else if (slave.devotion > 20) {
-			r += " which $he is often willing to do.";
+			r += ` which ${he} is often willing to do.`;
 		} else {
-			r += " which $he is rarely willing to do.";
+			r += ` which ${he} is rarely willing to do.`;
 		}
 	}
 	return r;
diff --git a/src/npc/descriptions/boobs/boobs.js b/src/npc/descriptions/boobs/boobs.js
index e563ecf15e4..66debecd07b 100644
--- a/src/npc/descriptions/boobs/boobs.js
+++ b/src/npc/descriptions/boobs/boobs.js
@@ -1738,7 +1738,7 @@ App.Desc.nipples = function(slave, pronouns) {
  */
 App.Desc.areola = function(slave, pronouns) {
 	pronouns = pronouns || getPronouns(slave);
-	const {his, His} = pronouns;
+	const {his, His, him} = pronouns;
 	const nipColor = nippleColor(slave);
 
 	let r = [];
@@ -1798,7 +1798,7 @@ App.Desc.areola = function(slave, pronouns) {
 						r.push(`The material of ${his} leotard is so thin and tight that not only are ${his} nipples obvious, the outline of ${his} areolae can be made out, too.`);
 						break;
 					case "a monokini":
-						r.push(`As ${his} monokini leaves $him topless, ${his} areolae are naturally on public display.`);
+						r.push(`As ${his} monokini leaves ${him} topless, ${his} areolae are naturally on public display.`);
 						break;
 				}
 			}
-- 
GitLab