From b98b7bfa46691f2f353dd946a12f4da297436837 Mon Sep 17 00:00:00 2001
From: lowercase-donkey <lowercasedonkey@gmail.com>
Date: Fri, 12 Jul 2019 22:54:32 -0400
Subject: [PATCH] App.Desc.mods

---
 .../nursery/longChildDescription.tw           | 26 +++++++--------
 src/js/datatypeCleanupJS.js                   |  4 +--
 src/js/descriptionWidgets.js                  | 11 ++++++-
 src/npc/descriptions/boobs/boobs.js           |  2 +-
 src/uncategorized/longSlaveDescription.tw     |  8 ++---
 src/utility/descriptionWidgetsFlesh.tw        | 14 ++++----
 src/utility/descriptionWidgetsTattoos.tw      | 33 +++++++++----------
 7 files changed, 53 insertions(+), 45 deletions(-)

diff --git a/src/facilities/nursery/longChildDescription.tw b/src/facilities/nursery/longChildDescription.tw
index 504812100fe..9c6b3dd183d 100644
--- a/src/facilities/nursery/longChildDescription.tw
+++ b/src/facilities/nursery/longChildDescription.tw
@@ -686,9 +686,9 @@ is
 <</if>>
 
 <<if $activeChild.fuckdoll == 0>>
-	<<= App.Desc.brand($activeChild, "cheek")>>
-	<<= App.Desc.brand($activeChild, "ear")>>
-	<<= App.Desc.brand($activeChild, "neck")>>
+	<<= App.Desc.mods($activeChild, "cheek")>>
+	<<= App.Desc.mods($activeChild, "ear")>>
+	<<= App.Desc.mods($activeChild, "neck")>>
 <</if>>
 
 <<if $familyTesting == 1>>
@@ -1156,21 +1156,21 @@ $He is
 	/* Check it's not a facial brand. (posting much later, I have basically just printed the list that was here. It might need to be longer, but it's the only way I can think of to hide cheeks and ears in multiBrand.)*/
 	/* Sorted top to bottom */
 	/* Torso */
-	<<= App.Desc.brand($activeChild, "chest")>>
-	<<= App.Desc.brand($activeChild, "back")>>
-	<<= App.Desc.brand($activeChild, "lower back")>>
+	<<= App.Desc.mods($activeChild, "chest")>>
+	<<= App.Desc.mods($activeChild, "back")>>
+	<<= App.Desc.mods($activeChild, "lower back")>>
 
 	/* Arms */
-	<<= App.Desc.brand($activeChild, "upper arm")>>
-	<<= App.Desc.brand($activeChild, "lower arm")>>
-	<<= App.Desc.brand($activeChild, "wrist")>>
-	<<= App.Desc.brand($activeChild, "hand")>>
+	<<= App.Desc.mods($activeChild, "upper arm")>>
+	<<= App.Desc.mods($activeChild, "lower arm")>>
+	<<= App.Desc.mods($activeChild, "wrist")>>
+	<<= App.Desc.mods($activeChild, "hand")>>
 
 	/* Legs */
 	/*buttock and thigh are displayed in descriptionWidgetsTattoos, if you can believe it */
-	<<= App.Desc.brand($activeChild), "calf")>>
-	<<= App.Desc.brand($activeChild), "ankle")>>
-	<<= App.Desc.brand($activeChild), "foot")>>
+	<<= App.Desc.mods($activeChild), "calf")>>
+	<<= App.Desc.mods($activeChild), "ankle")>>
+	<<= App.Desc.mods($activeChild), "foot")>>
 <</if>>
 
 /* Opposite way of handling above, if that ever proves more convenient. This will print everything that's not on the face. The risk is that it may print things that are already printed elsewhere. */
diff --git a/src/js/datatypeCleanupJS.js b/src/js/datatypeCleanupJS.js
index dbc33f61de6..c8abe96effe 100644
--- a/src/js/datatypeCleanupJS.js
+++ b/src/js/datatypeCleanupJS.js
@@ -266,8 +266,8 @@ App.Entity.Utils.SlaveDataSchemeCleanup = (function() {
 	 */
 	function migrateScars(slave) {
 		if (!slave.hasOwnProperty("scar")) {
-				slave.scar = {};  // switching to singular to match .brand and someday others.
-			}
+			slave.scar = {};  // switching to singular to match .brand and someday others.
+		}
 		if (slave.hasOwnProperty("scars")) { // even if it's 0
 			if (slave.scars) { // not 0
 				slave.scar["left cheek"] = slave.scars;  // old location was not defined, but surgery described it as facial.  Putting it on left cheek for a default.
diff --git a/src/js/descriptionWidgets.js b/src/js/descriptionWidgets.js
index ce19a4af6be..25ed9f13b26 100644
--- a/src/js/descriptionWidgets.js
+++ b/src/js/descriptionWidgets.js
@@ -576,6 +576,14 @@ App.Desc.ageAndHealth = function(slave) {
 	return r;
 };
 
+/**
+ * @param {App.Entity.SlaveState} slave
+ * @returns {string} Slave's mods.
+ */
+App.Desc.mods = function(slave, surface) {
+	return App.Desc.brand(slave, surface) + App.Desc.scar(slave, surface);
+};
+
 /**
  * @param {App.Entity.SlaveState} slave
  * @returns {string} Slave's brand. Slave is the slave in question, but call the body part without modifiers. Rather than using "left breast" and "right breast" just use "breast". The function will then describe any brands on the breasts, if present, in natural language.
@@ -699,6 +707,7 @@ App.Desc.brand = function(slave, surface) {
 App.Desc.scar = function(slave, surface) {
 	"use strict";
 	let r = ``;
+	const bellyAccessory = slave.bellyAccessory;
 	/* eslint-disable no-unused-vars*/
 	const {
 		he, him, his, hers, himself, boy, He, His
@@ -782,7 +791,7 @@ App.Desc.scar = function(slave, surface) {
 						r += `${He} has ${App.Desc.describeScarInt(slave, surface.left)} on ${his} ${surface.left}. `;
 					} else if (App.Desc.describeScarInt(slave, surface.right)) {
 						// right
-						r += `${He} has ${App.Desc.App.Desc.describeScarInt(slave, surface.right)} on ${his} ${surface.right}. `;
+						r += `${He} has ${App.Desc.describeScarInt(slave, surface.right)} on ${his} ${surface.right}. `;
 					}
 				}
 			}
diff --git a/src/npc/descriptions/boobs/boobs.js b/src/npc/descriptions/boobs/boobs.js
index 861b3193129..b3f7eeadbaa 100644
--- a/src/npc/descriptions/boobs/boobs.js
+++ b/src/npc/descriptions/boobs/boobs.js
@@ -1486,7 +1486,7 @@ App.Desc.boobsExtra = function(slave, pronouns) {
 App.Desc.boobsBrand = function(slave) {
 	if (State.variables.showBodyMods === 1) {
 		if (slave.fuckdoll === 0) {
-			return(App.Desc.brand(slave, "chest") + App.Desc.brand(slave, "breast"));
+			return(App.Desc.mods(slave, "chest") + App.Desc.mods(slave, "breast"));
 		}
 	}
 };
diff --git a/src/uncategorized/longSlaveDescription.tw b/src/uncategorized/longSlaveDescription.tw
index ddac80c5cce..6b075408cf5 100644
--- a/src/uncategorized/longSlaveDescription.tw
+++ b/src/uncategorized/longSlaveDescription.tw
@@ -1157,9 +1157,9 @@ is
 <</if>>
 
 <<if $activeSlave.fuckdoll == 0>>
-	<<= App.Desc.brand($activeSlave, "cheek")>>
-	<<= App.Desc.brand($activeSlave, "ear")>>
-	<<= App.Desc.brand($activeSlave, "neck")>>
+	<<= App.Desc.mods($activeSlave, "cheek")>>
+	<<= App.Desc.mods($activeSlave, "ear")>>
+	<<= App.Desc.mods($activeSlave, "neck")>>
 <</if>>
 
 <<if $familyTesting == 1>>
@@ -2059,7 +2059,7 @@ $He is
 
 <<if $activeSlave.fuckdoll == 0>>
 	/* Describe any brands that are not directly addressed elsewhere in longSlave */
-	<<= App.Desc.brand($activeSlave, "extra")>>
+	<<= App.Desc.mods($activeSlave, "extra")>>
 <</if>>
 
 <<if ($showClothing == 1) && ($saleDescription == 0)>>
diff --git a/src/utility/descriptionWidgetsFlesh.tw b/src/utility/descriptionWidgetsFlesh.tw
index 0bb9d7c612a..f03b59c848c 100644
--- a/src/utility/descriptionWidgetsFlesh.tw
+++ b/src/utility/descriptionWidgetsFlesh.tw
@@ -3616,8 +3616,8 @@ $He's got a
 	<<if $showBodyMods == 1>>
 		<<dickTatDescription>>
 		<<dickPiercingDescription>>
-		<<= App.Desc.brand($activeSlave, "penis")>>
-		<<= App.Desc.brand($activeSlave, "testicle")>>
+		<<= App.Desc.mods($activeSlave, "penis")>>
+		<<= App.Desc.mods($activeSlave, "testicle")>>
 	<</if>>
 <</if>>
 
@@ -4090,7 +4090,7 @@ $He's got a
 
 <<if $activeSlave.fuckdoll == 0>>
 	<<if $showBodyMods == 1>>
-		<<= App.Desc.brand($activeSlave, "pubic mound")>>
+		<<= App.Desc.mods($activeSlave, "pubic mound")>>
 	<</if>>
 <</if>>
 
@@ -15414,7 +15414,7 @@ $He has
 					It has a short length of chain dangling from it.
 				<</if>>
 			<</if>>
-			<<= App.Desc.brand($activeSlave, "belly")>>
+			<<= App.Desc.mods($activeSlave, "belly")>>
 		<</if>>
 	<<else>>
 		<<if $showBodyMods == 1>>
@@ -15489,7 +15489,7 @@ $He has
 			<<elseif $activeSlave.abortionTat == 0 && $activeSlave.birthsTat == -1 && $activeSlave.pregKnown == 1>>
 				$He has a single baby-shaped temporary tattoo adorning $his stomach.
 			<</if>>
-			<<= App.Desc.brand($activeSlave, "belly")>>
+			<<= App.Desc.mods($activeSlave, "belly")>>
 		<</if>>
 		<<if $activeSlave.breedingMark == 1>>
 			<<if $propOutcome == 1>>
@@ -18472,7 +18472,7 @@ $His womb contains <<= num(_slaveWD.litters.length)>> separate pregnancies;
 	<<elseif $activeSlave.abortionTat == 0 && $activeSlave.birthsTat == -1 && $activeSlave.pregKnown == 1>>
 		$He has a single baby-shaped temporary tattoo adorning $his stomach.
 	<</if>>
-	<<= App.Desc.brand($activeSlave, "belly")>>
+	<<= App.Desc.mods($activeSlave, "belly")>>
 
 	<<if $activeSlave.breedingMark == 1>>
 		<<if $propOutcome == 1>>
@@ -19552,7 +19552,7 @@ $His womb contains <<= num(_slaveWD.litters.length)>> separate pregnancies;
 	<</if>>
 <</if>>
 
-<<= App.Desc.brand($activeSlave, "belly")>>
+<<= App.Desc.mods($activeSlave, "belly")>>
 
 <<if $activeSlave.breedingMark == 1>>
 	<<if $propOutcome == 1>>
diff --git a/src/utility/descriptionWidgetsTattoos.tw b/src/utility/descriptionWidgetsTattoos.tw
index 598e6dcfe40..3b578fee440 100644
--- a/src/utility/descriptionWidgetsTattoos.tw
+++ b/src/utility/descriptionWidgetsTattoos.tw
@@ -44,7 +44,7 @@
 				$activeSlave.shouldersTat
 		<</switch>>
 	<</if>>
-	<<= App.Desc.brand($activeSlave, "shoulder")>>
+	<<= App.Desc.mods($activeSlave, "shoulder")>>
 <</if>>
 <</widget>>
 
@@ -91,7 +91,7 @@
 				$activeSlave.lipsTat
 		<</switch>>
 	<</if>>
-	<<= App.Desc.brand($activeSlave, "lips")>>
+	<<= App.Desc.mods($activeSlave, "lips")>>
 <</if>>
 <</widget>>
 
@@ -136,8 +136,7 @@
 		<</switch>>
 	<</if>>
 	/* App.Desc.boobsBrand handles boobBrands */
-	/*<<= App.Desc.brand($activeSlave, "breast")>>*/
-	<<= App.Desc.scar($activeSlave, "breast")>>
+	/*<<= App.Desc.mods($activeSlave, "breast")>>*/
 <</if>>
 <</widget>>
 
@@ -225,10 +224,10 @@
 			$activeSlave.armsTat
 		<</switch>>
 	<</if>>
-	<<= App.Desc.brand($activeSlave, "upper arm")>>
-	<<= App.Desc.brand($activeSlave, "lower arm")>>
-	<<= App.Desc.brand($activeSlave, "hand")>>
-	<<= App.Desc.brand($activeSlave, "wrist")>>
+	<<= App.Desc.mods($activeSlave, "upper arm")>>
+	<<= App.Desc.mods($activeSlave, "lower arm")>>
+	<<= App.Desc.mods($activeSlave, "hand")>>
+	<<= App.Desc.mods($activeSlave, "wrist")>>
 <</if>>
 <</widget>>
 
@@ -310,7 +309,7 @@
 			$activeSlave.backTat
 		<</switch>>
 	<</if>>
-	<<= App.Desc.brand($activeSlave, "back")>>
+	<<= App.Desc.mods($activeSlave, "back")>>
 <</if>>
 <</widget>>
 
@@ -360,7 +359,7 @@
 			$activeSlave.stampTat
 	<</switch>>
 	<</if>>
-	<<= App.Desc.brand($activeSlave, "lower back")>>
+	<<= App.Desc.mods($activeSlave, "lower back")>>
 <</if>>
 <</widget>>
 
@@ -425,7 +424,7 @@
 				$activeSlave.buttTat
 		<</switch>>
 	<</if>>
-<<= App.Desc.brand($activeSlave, "buttock")>>
+<<= App.Desc.mods($activeSlave, "buttock")>>
 <</if>>
 <</widget>>
 
@@ -592,8 +591,8 @@
 	<</switch>>
 <</if>>
 /* Just in case someone makes these someday: */
-<<= App.Desc.brand($activeSlave, "anus")>>
-<<= App.Desc.brand($activeSlave, "asshole")>>
+<<= App.Desc.mods($activeSlave, "anus")>>
+<<= App.Desc.mods($activeSlave, "asshole")>>
 <</widget>>
 
 <<widget "legsTatDescription">>
@@ -634,9 +633,9 @@
 			$activeSlave.legsTat
 		<</switch>>
 	<</if>>
-	<<= App.Desc.brand($activeSlave, "thigh")>>
-	<<= App.Desc.brand($activeSlave, "calf")>>
-	<<= App.Desc.brand($activeSlave, "ankle")>>
-	<<= App.Desc.brand($activeSlave, "foot")>>
+	<<= App.Desc.mods($activeSlave, "thigh")>>
+	<<= App.Desc.mods($activeSlave, "calf")>>
+	<<= App.Desc.mods($activeSlave, "ankle")>>
+	<<= App.Desc.mods($activeSlave, "foot")>>
 <</if>>
 <</widget>>
-- 
GitLab