From 96aef6c7b3a0e23cda00e02abaabd14318111f41 Mon Sep 17 00:00:00 2001
From: lowercasedonkey <lowercasedonkey@gmail.com>
Date: Fri, 10 Jul 2020 22:49:16 -0400
Subject: [PATCH] rearrange and restore baked in food brands

---
 js/003-data/slaveMods.js              |   2 +-
 src/uncategorized/bodyModification.js | 238 ++++++++++++++------------
 2 files changed, 125 insertions(+), 115 deletions(-)

diff --git a/js/003-data/slaveMods.js b/js/003-data/slaveMods.js
index df6e02405e9..1d660eb8e5b 100644
--- a/js/003-data/slaveMods.js
+++ b/js/003-data/slaveMods.js
@@ -130,7 +130,7 @@ App.Medicine.Modification.Brands = {
 				return (V.arcologies[0].FSHedonisticDecadence !== "unset");
 			}
 		},
-		"a big helping of $PC.refreshment": {
+		"a big helping of your favorite food": {
 			displayName: "Favorite Food",
 			requirements: function() {
 				return ((V.arcologies[0].FSHedonisticDecadence !== "unset") && V.PC.refreshmentType === 2);
diff --git a/src/uncategorized/bodyModification.js b/src/uncategorized/bodyModification.js
index 327421c3bb9..802fe46df6d 100644
--- a/src/uncategorized/bodyModification.js
+++ b/src/uncategorized/bodyModification.js
@@ -2,7 +2,7 @@ App.Medicine.Modification.Select.brand = function(slave, cheat = false) {
 	const el = new DocumentFragment();
 	let p = document.createElement('p');
 	let div = document.createElement('div');
-	const { his, His, him, He } = getPronouns(slave);
+	const {his, His, him, He} = getPronouns(slave);
 
 	p.classList.add("indent");
 	for (const brandPlace in slave.brand) {
@@ -68,43 +68,6 @@ App.Medicine.Modification.Select.brand = function(slave, cheat = false) {
 	p.append(symbolBlock("silhouettes"));
 	p.append(symbolBlock("FS"));
 
-	function symbolBlock(brandList) {
-		const div = document.createElement('div');
-		div.classList.add("double-choices");
-		div.style.textIndent = 0;
-		div.append(symbolOptions(brandList));
-		return div;
-	}
-
-	function symbolOptions(brandList) {
-		const frag = new DocumentFragment();
-		const list = App.Medicine.Modification.Brands[brandList];
-		let length = Object.keys(list).length;
-		for (const brand in list) {
-			if (!cheat && list[brand].hasOwnProperty("requirements")) {
-				if (!list[brand].requirements()) {
-					continue;
-				}
-			}
-			if (brandList === "FS") {
-				App.UI.DOM.appendNewElement("span", frag, "FS ", "note");
-			}
-			frag.append(
-				App.UI.DOM.link(
-					list[brand].displayName,
-					() => {
-						V.brandDesign.local = brand;
-						App.Medicine.Modification.Select.brand(slave, cheat); // Refresh display
-					}
-				)
-			);
-			length--;
-			if (length > 0) {
-				frag.append(" | ");
-			}
-		}
-		return frag;
-	}
 	div = document.createElement('div');
 	div.classList.add("indent");
 	div.append(`Or design your own: `);
@@ -128,78 +91,6 @@ App.Medicine.Modification.Select.brand = function(slave, cheat = false) {
 	p.append(partLinks(body.arms));
 	p.append(partLinks(body.legs));
 
-	function slaveBody() {
-		const body = {};
-		// Sorted head to toe
-		// Head
-		body.head = {};
-		if (slave.earShape !== "none") {
-			body.head.ears = "Ears";
-		}
-		body.head.cheek = "Cheeks";
-		body.head.neck = "Neck";
-
-		// Torso
-		body.torso = {};
-		body.torso.chest = "Chest";
-		body.torso.breast = "Breasts";
-		body.torso.back = "Back";
-		body.torso["lower back"] = "Lower Back";
-		body.torso.belly = "Belly";
-		body.torso["pubic mound"] = "Pubic Mound";
-
-		if (slave.dick > 0) {
-			body.torso.penis = "Penis";
-		}
-		if (slave.balls > 0 && slave.scrotum > 0) {
-			body.torso.testicle = "Testicles";
-		}
-
-		// Arms
-		body.arms = {};
-		body.arms.shoulder = "Shoulders";
-		if (hasAnyNaturalArms(slave)) {
-			body.arms["upper arm"] = "Arm, upper";
-			body.arms["lower arm"] = "Arm, lower";
-			body.arms.wrist = "Wrists";
-			body.arms.hand = "Hands";
-		}
-
-		// Legs
-		body.legs = {};
-		body.legs.buttock = "Buttocks";
-		if (hasAnyNaturalLegs(slave)) {
-			body.legs.thigh = "Thighs";
-			body.legs.calf = "Calves";
-			body.legs.ankle = "Ankles";
-			body.legs.foot = "Feet";
-		}
-		return body;
-	}
-
-	function partLinks(bodyPartObj) {
-		const div = document.createElement("div");
-		div.classList.add("double-choices");
-		div.style.textIndent = 0;
-		let length = Object.keys(bodyPartObj).length;
-		for (const bp in bodyPartObj) {
-			div.append(
-				App.UI.DOM.link(
-					bodyPartObj[bp],
-					() => {
-						V.brandTarget.local = bp;
-						App.Medicine.Modification.Select.brand(slave, cheat); // Refresh display
-					}
-				)
-			);
-			length--;
-			if (length > 0) {
-				div.append(" | ");
-			}
-		}
-		return div;
-	}
-
 	div = document.createElement('div');
 	div.classList.add("indent");
 	div.append(`Or a custom site:  `);
@@ -240,7 +131,7 @@ App.Medicine.Modification.Select.brand = function(slave, cheat = false) {
 						"left",
 						() => {
 							V.brandApplied = 1;
-							slave.brand[leftTarget] = V.brandDesign.local;
+							slave.brand[leftTarget] = check(V.brandDesign.local);
 							cashX(forceNeg(V.modCost), "slaveMod", slave);
 							V.degradation += 10;
 						},
@@ -253,7 +144,7 @@ App.Medicine.Modification.Select.brand = function(slave, cheat = false) {
 					App.UI.DOM.link(
 						"left",
 						() => {
-							slave.brand[leftTarget] = V.brandDesign.local;
+							slave.brand[leftTarget] = check(V.brandDesign.local);
 						},
 					)
 				);
@@ -272,7 +163,7 @@ App.Medicine.Modification.Select.brand = function(slave, cheat = false) {
 							"right",
 							() => {
 								V.brandApplied = 1;
-								slave.brand[rightTarget] = V.brandDesign.local;
+								slave.brand[rightTarget] = check(V.brandDesign.local);
 								cashX(forceNeg(V.modCost), "slaveMod", slave);
 								V.degradation += 10;
 							},
@@ -285,7 +176,7 @@ App.Medicine.Modification.Select.brand = function(slave, cheat = false) {
 						App.UI.DOM.link(
 							"right",
 							() => {
-								slave.brand[rightTarget] = V.brandDesign.local;
+								slave.brand[rightTarget] = check(V.brandDesign.local);
 							},
 						)
 					);
@@ -336,4 +227,123 @@ App.Medicine.Modification.Select.brand = function(slave, cheat = false) {
 	}
 	el.append(p);
 	return jQuery('#brandSelection').empty().append(el);
+
+	function symbolBlock(brandList) {
+		const div = document.createElement('div');
+		div.classList.add("double-choices");
+		div.style.textIndent = 0;
+		div.append(symbolOptions(brandList));
+		return div;
+	}
+
+	function symbolOptions(brandList) {
+		const frag = new DocumentFragment();
+		const list = App.Medicine.Modification.Brands[brandList];
+		let length = Object.keys(list).length;
+		for (const brand in list) {
+			if (!cheat && list[brand].hasOwnProperty("requirements")) {
+				if (!list[brand].requirements()) {
+					continue;
+				}
+			}
+			if (brandList === "FS") {
+				App.UI.DOM.appendNewElement("span", frag, "FS ", "note");
+			}
+			frag.append(
+				App.UI.DOM.link(
+					list[brand].displayName,
+					() => {
+						V.brandDesign.local = check(brand);
+						App.Medicine.Modification.Select.brand(slave, cheat); // Refresh display
+					}
+				)
+			);
+			length--;
+			if (length > 0) {
+				frag.append(" | ");
+			}
+		}
+		return frag;
+	}
+
+	function slaveBody() {
+		const body = {};
+		// Sorted head to toe
+		// Head
+		body.head = {};
+		if (slave.earShape !== "none") {
+			body.head.ears = "Ears";
+		}
+		body.head.cheek = "Cheeks";
+		body.head.neck = "Neck";
+
+		// Torso
+		body.torso = {};
+		body.torso.chest = "Chest";
+		body.torso.breast = "Breasts";
+		body.torso.back = "Back";
+		body.torso["lower back"] = "Lower Back";
+		body.torso.belly = "Belly";
+		body.torso["pubic mound"] = "Pubic Mound";
+
+		if (slave.dick > 0) {
+			body.torso.penis = "Penis";
+		}
+		if (slave.balls > 0 && slave.scrotum > 0) {
+			body.torso.testicle = "Testicles";
+		}
+
+		// Arms
+		body.arms = {};
+		body.arms.shoulder = "Shoulders";
+		if (hasAnyNaturalArms(slave)) {
+			body.arms["upper arm"] = "Arm, upper";
+			body.arms["lower arm"] = "Arm, lower";
+			body.arms.wrist = "Wrists";
+			body.arms.hand = "Hands";
+		}
+
+		// Legs
+		body.legs = {};
+		body.legs.buttock = "Buttocks";
+		if (hasAnyNaturalLegs(slave)) {
+			body.legs.thigh = "Thighs";
+			body.legs.calf = "Calves";
+			body.legs.ankle = "Ankles";
+			body.legs.foot = "Feet";
+		}
+		return body;
+	}
+
+	function partLinks(bodyPartObj) {
+		const div = document.createElement("div");
+		div.classList.add("double-choices");
+		div.style.textIndent = 0;
+		let length = Object.keys(bodyPartObj).length;
+		for (const bp in bodyPartObj) {
+			div.append(
+				App.UI.DOM.link(
+					bodyPartObj[bp],
+					() => {
+						V.brandTarget.local = check(bp);
+						App.Medicine.Modification.Select.brand(slave, cheat); // Refresh display
+					}
+				)
+			);
+			length--;
+			if (length > 0) {
+				div.append(" | ");
+			}
+		}
+		return div;
+	}
+
+	function check(brand) {
+		switch(brand) {
+			case "a big helping of your favorite food":
+				return 	"a big helping of " + V.PC.refreshment;
+			default:
+				return brand;
+		}
+	}
 };
-- 
GitLab