From f428b7c8ae4927e75cbfbb0f89687edc5ca86d5c Mon Sep 17 00:00:00 2001
From: Pregmodder <pregmodder@gmail.com>
Date: Thu, 14 Jun 2018 17:48:12 -0400
Subject: [PATCH] template literal implementation

---
 src/endWeek/saRest.tw    | 12 +++++-----
 src/endWeek/saServant.tw | 50 ++++++++++++++++++++--------------------
 2 files changed, 31 insertions(+), 31 deletions(-)

diff --git a/src/endWeek/saRest.tw b/src/endWeek/saRest.tw
index 563bace8c02..96d28662ac4 100644
--- a/src/endWeek/saRest.tw
+++ b/src/endWeek/saRest.tw
@@ -20,27 +20,27 @@ window.saRest = function saRest(slave) {
 	}
 
 	if (slave.health > 90) {
-		t += " " + His + " health is so outstanding that rest does not improve it.";
+		t += ` ${His} health is so outstanding that rest does not improve it.`;
 	} else if (slave.health > -100) {
-		t += " " + His + " <span class='green'>health recovers</span> with rest.";
+		t += ` ${His} <span class='green'>health recovers</span> with rest.`;
 		slave.health += 10;
 	}
 
 	if (slave.fuckdoll == 0 && slave.fetish != "mindbroken") {
 		if (slave.devotion > 20) {
 			if (slave.trust <= 20) {
-				t += " Being allowed to rest <span class='mediumaquamarine'>reduces " + his + " fear</span> of you.";
+				t += ` Being allowed to rest <span class='mediumaquamarine'>reduces ${his} fear</span> of you.`;
 				slave.trust += 4;
 			} else if (slave.trust <= 50) {
-				t += " Being allowed to rest <span class='mediumaquamarine'>builds " + his + " trust</span> in you.";
+				t += ` Being allowed to rest <span class='mediumaquamarine'>builds ${his} trust</span> in you.`;
 				slave.trust += 2;
 			} else {
-				t += " Being allowed to rest <span class='mediumaquamarine'>confirms " + his + " trust</span> in you.";
+				t += ` Being allowed to rest <span class='mediumaquamarine'>confirms ${his} trust</span> in you.`;
 				slave.trust += 2;
 			}
 		} else {
 			if (slave.trust < -20) {
-				t += " Being allowed to rest <span class='mediumaquamarine'>reduces " + his + " fear</span> of you.";
+				t += ` Being allowed to rest <span class='mediumaquamarine'>reduces ${his} fear</span> of you.`;
 				slave.trust += 4;
 			}
 		}
diff --git a/src/endWeek/saServant.tw b/src/endWeek/saServant.tw
index 867ab742032..d90f8fc4117 100644
--- a/src/endWeek/saServant.tw
+++ b/src/endWeek/saServant.tw
@@ -7,41 +7,41 @@ window.saServant = function saServant(slave) {
 	var He = capFirstChar(he), His = capFirstChar(his);
 	var V = State.variables;
 	
-	var t = "works as a servant. " + He + " performs the lowest jobs in your penthouse, cleaning up after your other slaves, bathing them, helping them dress, and giving them sexual relief.";
+	var t = "works as a servant. ${He} performs the lowest jobs in your penthouse, cleaning up after your other slaves, bathing them, helping them dress, and giving them sexual relief.";
 
 	if (V.servantsQuarters > 0) {
 		if ((V.universalRulesFacilityWork == 1 && slave.assignment == "be a servant" && V.servantsQuartersSpots > 0) || (slave.assignment == "work as a servant")) {
 			if (slave.assignment == "be a servant") {
-				t += " Since there's extra space in the servants' quarters, " + V.assistantName + " attaches " + him + " to the cadre of maids there.";
+				t += ` Since there's extra space in the servants' quarters, ${V.assistantName} attaches ${him} to the cadre of maids there.`;
 				V.servantsQuartersSpots--;
 			}
 			if (V.Stewardess != 0) {
-				t += " This brings " + him + " under " + V.Stewardess.slaveName + "'s supervision. The Stewardess ";
+				t += ` This brings ${him} under ${V.Stewardess.slaveName}'s supervision. The Stewardess `;
 				if (slave.devotion < -20) {
-					t += "subjects " + him + " to corrective rape when " + his + "service is imperfect, or when the Stewardess feels like raping " + him + ", forcing the poor slave to <span class='yellowgreen'>find refuge in work.</span>";
+					t += `subjects ${him} to corrective rape when ${his}service is imperfect, or when the Stewardess feels like raping ${him}, forcing the poor slave to <span class='yellowgreen'>find refuge in work.</span>`;
 				} else if (slave.devotion <= 20) {
-					t += "molests " + him + ", encouraging the poor slave to keep " + his + " head down and <span class='yellowgreen'>work harder.</span>";
+					t += `molests ${him}, encouraging the poor slave to keep ${his} head down and <span class='yellowgreen'>work harder.</span>`;
 				} else {
-					t += "uses sex as a reward, getting " + him + " off when " + he + " <span class='yellowgreen'>works harder.</span>";
+					t += `uses sex as a reward, getting ${him} off when ${he} <span class='yellowgreen'>works harder.</span>`;
 				}
 				V.cash += V.stewardessBonus;
 			}
 		}
 	}
 
-	t += " " + He + " is ";
+	t += " ${He} is ";
 	if (slave.trust < -20) {
 		t += "frightened of punishment and works very hard, <span class='yellowgreen'>reducing the upkeep</span> of your slaves.";
 	} else if (slave.devotion < -20) {
-		t += "reluctant, requiring your other slaves to force " + his + " services, and does not <span class='yellowgreen'>reduce upkeep</span> of your slaves much.";
+		t += `reluctant, requiring your other slaves to force ${his} services, and does not <span class='yellowgreen'>reduce upkeep</span> of your slaves much.`;
 	} else if (slave.devotion <= 20) {
-		t += "hesitant, requiring your other slaves to demand " + his + " services, and only slightly <span class='yellowgreen'>reduces upkeep</span> of your slaves.";
+		t += `hesitant, requiring your other slaves to demand ${his} services, and only slightly <span class='yellowgreen'>reduces upkeep</span> of your slaves.`;
 	} else if (slave.devotion <= 50) {
-		t += "obedient, offering your other slaves " + his + " services, and moderately <span class='yellowgreen'>reduces the upkeep</span> of your slaves.";
+		t += `obedient, offering your other slaves ${his} services, and moderately <span class='yellowgreen'>reduces the upkeep</span> of your slaves.`;
 	} else if (slave.devotion <= 95) {
-		t += "devoted, happily giving your other slaves " + his + " services, and <span class='yellowgreen'>reduces the upkeep</span> of your slaves.";
+		t += `devoted, happily giving your other slaves ${his} services, and <span class='yellowgreen'>reduces the upkeep</span> of your slaves.`;
 	} else {
-		t += "so happy to serve your other slaves that " + he + " often sees to their needs before they know they have them, and greatly <span class='yellowgreen'>reduces the upkeep</span> of your slaves.";
+		t += `so happy to serve your other slaves that ${he} often sees to their needs before they know they have them, and greatly <span class='yellowgreen'>reduces the upkeep</span> of your slaves.`;
 	}
 
 	let _oral = jsRandom(5,10);
@@ -49,45 +49,45 @@ window.saServant = function saServant(slave) {
 	V.oralTotal += _oral;
 
 	if (slave.relationship == -2) {
-		t +=  " " + He + " does " + his + " best to perfect your domesticity due to " + his + " emotional bond to you.";
+		t +=  ` ${He} does ${his} best to perfect your domesticity due to ${his} emotional bond to you.`;
 	} else if (slave.relationship == -3 && slave.devotion > 50) {
-		t +=  " " + He + " does " + his + "very best to be the perfect housewife, making " + him + " an outstanding servant.";
+		t +=  ` ${He} does ${his}very best to be the perfect housewife, making ${him} an outstanding servant.`;
 	}
 
 	if (setup.servantCareers.includes(slave.career)) {
-		t +=  " " + He + " has experience with house keeping from " + his + " life before " + he + " was a slave, making " + him + " more effective.";
+		t +=  ` ${He} has experience with house keeping from ${his} life before ${he} was a slave, making ${him} more effective.`;
 	} else if (slave.skillS >= V.masteredXP) {
-		t +=  " " + He + " has experience with house keeping from working for you, making " + him + " more effective.";
+		t +=  ` ${He} has experience with house keeping from working for you, making ${him} more effective.`;
 	} else {
 		slave.skillS += jsRandom(1,(slave.intelligence+4)*2);
 	}
 
 	if (slave.fetishStrength > 60) {
 		if (slave.fetish == "submissive" && slave.fetishKnown == 1) {
-			t +=  " " + His + " natural affinity for submission increases " + his + " effectiveness.";
+			t +=  ` ${His} natural affinity for submission increases ${his} effectiveness.`;
 		} else if (slave.fetishKnown == 1 && slave.fetish == "dom") {
-			t +=  " " + His + " sexual appetite for domination reduces " + his + " effectiveness.";
+			t +=  ` ${His} sexual appetite for domination reduces ${his} effectiveness.`;
 		}
 	}
 
 	if (slave.energy < 20) {
-		t +=  " " + His + " frigidity allows " + him + " to ignore the intercourse all around " + him + ", making " + him + " very efficient.";
+		t +=  ` ${His} frigidity allows ${him} to ignore the intercourse all around ${him}, making ${him} very efficient.`;
 	} else if (slave.energy < 40) {
-		t += " " + His + " low sex drive keeps " + him + " from becoming too distracted by the intercourse all around " + him + ", making " + him + " more efficient.";
+		t += ` ${His} low sex drive keeps ${him} from becoming too distracted by the intercourse all around ${him}, making ${him} more efficient.`;
 	}
 
 	if ((slave.eyes <= -1 && slave.eyewear != "corrective glasses" && slave.eyewear != "corrective contacts") || (slave.eyewear == "blurring glasses") || (slave.eyewear == "blurring contacts")) {
-		t +=  " " + His + " bad vision makes " + him + " a worse servant.";
+		t +=  ` ${His} bad vision makes ${him} a worse servant.`;
 	}
 
 	if (slave.lactation > 0) {
-		t += " Since " + he + " is lactating, ";
+		t += " Since ${he} is lactating, ";
 		if (slave.devotion > 20 || slave.trust < -20) {
-			t += he + " serves ";
+			t += ` ${he} serves `;
 		} else {
-			t += "and disobedient, " + he + " is restrained to serve ";
+			t += `and disobedient, ${he} is restrained to serve `;
 		}
-		t += "as a drink dispenser at mealtimes, and makes a meaningful contribution to " + his + " fellow slaves' nutrition in concert with the feeding systems.";
+		t += `as a drink dispenser at mealtimes, and makes a meaningful contribution to ${his} fellow slaves' nutrition in concert with the feeding systems.`;
 	}
 
 	return t;
-- 
GitLab