From 2e8015aee266c71bcc3b171ee988ad01a2b02cd6 Mon Sep 17 00:00:00 2001
From: Svornost <11434-svornost@users.noreply.gitgud.io>
Date: Sat, 27 Mar 2021 09:38:59 -0700
Subject: [PATCH 1/2] Re-connect slave market encyclopedia entries.

---
 src/005-passages/slaveMarketPassages.js       |  1 +
 src/gui/Encyclopedia/encyclopedia.tw          |  9 ++++++
 .../Encyclopedia/encyclopediaRelatedLinks.tw  |  3 +-
 .../JobFulfillmentCenterOrder.js              |  1 -
 .../specificMarkets/customSlaveMarket.js      |  1 -
 src/markets/specificMarkets/eliteSlave.js     |  1 -
 .../specificMarkets/householdLiquidator.js    |  1 -
 src/markets/specificMarkets/huskSlave.js      |  1 -
 .../specificMarkets/prestigiousSlave.js       |  1 -
 src/markets/specificMarkets/slaveShelter.js   |  1 -
 src/markets/theMarket/buySlaves.js            | 11 ++++++--
 src/markets/theMarket/marketData.js           | 28 +++++++++++++++++++
 12 files changed, 48 insertions(+), 11 deletions(-)

diff --git a/src/005-passages/slaveMarketPassages.js b/src/005-passages/slaveMarketPassages.js
index 2969e72df11..d4b048763b1 100644
--- a/src/005-passages/slaveMarketPassages.js
+++ b/src/005-passages/slaveMarketPassages.js
@@ -10,6 +10,7 @@ new App.DomPassage("Buy Slaves",
 	() => {
 		V.nextButton = "Back";
 		V.nextLink = "Main";
+		V.encyclopedia = "Obtaining Slaves";
 
 		return App.UI.market();
 	}, ["jump-from-safe", "jump-to-safe"]
diff --git a/src/gui/Encyclopedia/encyclopedia.tw b/src/gui/Encyclopedia/encyclopedia.tw
index 1d84f6367fb..91bc5e3e3a6 100644
--- a/src/gui/Encyclopedia/encyclopedia.tw
+++ b/src/gui/Encyclopedia/encyclopedia.tw
@@ -614,6 +614,15 @@ OBTAINING SLAVES
 
 	<br><br>Most of these slaves were submitted to the game by anons on /d/. If you'd like to submit a slave for addition to the game, you can do so at http://freecitiesblog.blogspot.com/2015/08/slave-submissions.html.
 
+<<case "Discarded Slaves">>
+	//Slaves don't last forever in the Free Cities. Many don't even last until retirement, with broken minds and abused or over-used bodies.
+
+	<br><br>These slaves which have lost their value are often simply culled from the owners' herds, but may also be sold through <<= App.Encyclopedia.Dialog.linkSC("the Flesh Heap", "The Flesh Heap")>> as discount merchandise for new or cash-strapped slaveowners who can wring some final use out of them. Their new owners may end up using them as discount whores, <<= App.Encyclopedia.Dialog.linkSC("living sex toys", "Fuckdolls")>>, or for medical testing.
+
+	<br><br>Some discarded slaves are also "rescued" by the so-called Slave Shelters. These charities place the discarded slaves with well-off slaveowners who are willing to invest the time and effort into caring for them, whether to restore them to serviceable condition or simply for humanitarian reasons. Abuse and resale of placed shelter slaves is generally prohibited, and most shelters attempt to enforce these terms with regular inspections.
+
+	<br><br>— Lawrence, W. G., //Guide to Modern Slavery, 2037 Edition////
+
 /**********
 SLAVE ASSIGNMENTS:
 **********/
diff --git a/src/gui/Encyclopedia/encyclopediaRelatedLinks.tw b/src/gui/Encyclopedia/encyclopediaRelatedLinks.tw
index 8708300e781..48bf1a4d93a 100644
--- a/src/gui/Encyclopedia/encyclopediaRelatedLinks.tw
+++ b/src/gui/Encyclopedia/encyclopediaRelatedLinks.tw
@@ -53,7 +53,7 @@ SLAVES
 /**********
 OBTAINING SLAVES
 **********/
-<<case "Direct Sales" "Household Liquidations" "Kidnapped Slaves" "Obtaining Slaves" "Pre-Owned Slaves" "Slave Schools" "Stables" "The Flesh Heap" "The Job Fulfillment Center">>
+<<case "Direct Sales" "Discarded Slaves" "Household Liquidations" "Kidnapped Slaves" "Obtaining Slaves" "Pre-Owned Slaves" "Slave Schools" "Stables" "The Flesh Heap" "The Job Fulfillment Center" "Wetware CPUs">>
 	<<= App.Encyclopedia.Dialog.linkSC("Kidnapped Slaves", "Kidnapped Slaves")>>
 	| <<= App.Encyclopedia.Dialog.linkSC("Slave Schools", "Slave Schools")>>
 	| <<= App.Encyclopedia.Dialog.linkSC("Stables", "Stables")>>
@@ -61,6 +61,7 @@ OBTAINING SLAVES
 	| <<= App.Encyclopedia.Dialog.linkSC("Direct Sales", "Direct Sales")>>
 	| <<= App.Encyclopedia.Dialog.linkSC("Pre-Owned Slaves", "Pre-Owned Slaves")>>
 	| <<= App.Encyclopedia.Dialog.linkSC("Random Events", "Random Events")>>
+	| <<= App.Encyclopedia.Dialog.linkSC("Discarded Slaves", "Discarded Slaves")>>
 	| <<= App.Encyclopedia.Dialog.linkSC("The Flesh Heap", "The Flesh Heap")>>
 	| <<= App.Encyclopedia.Dialog.linkSC("The Job Fulfillment Center", "The Job Fulfillment Center")>>
 	| <<= App.Encyclopedia.Dialog.linkSC("Wetware CPUs", "Wetware CPUs")>>
diff --git a/src/markets/specificMarkets/JobFulfillmentCenterOrder.js b/src/markets/specificMarkets/JobFulfillmentCenterOrder.js
index 4c1f8907be4..8ac00ca4099 100644
--- a/src/markets/specificMarkets/JobFulfillmentCenterOrder.js
+++ b/src/markets/specificMarkets/JobFulfillmentCenterOrder.js
@@ -1,5 +1,4 @@
 App.Markets.JobFulfillmentCenterOrder = function() {
-	V.encyclopedia = "Kidnapped Slaves";
 	const el = document.createElement("p");
 	el.id = "job-fulfillment-center-order";
 	el.append(JobFulfillmentCenterOrder());
diff --git a/src/markets/specificMarkets/customSlaveMarket.js b/src/markets/specificMarkets/customSlaveMarket.js
index 99ca66c95cb..5865b9287de 100644
--- a/src/markets/specificMarkets/customSlaveMarket.js
+++ b/src/markets/specificMarkets/customSlaveMarket.js
@@ -1,5 +1,4 @@
 App.Markets["Custom Slave"] = function() {
-	V.encyclopedia = "Kidnapped Slaves";
 	const el = document.createElement("p");
 	const slave = V.customSlave;
 	el.append(intro());
diff --git a/src/markets/specificMarkets/eliteSlave.js b/src/markets/specificMarkets/eliteSlave.js
index cb7d7dc5459..32e3dc544c2 100644
--- a/src/markets/specificMarkets/eliteSlave.js
+++ b/src/markets/specificMarkets/eliteSlave.js
@@ -1,6 +1,5 @@
 App.Markets["Elite Slave"] = function() {
 	const el = new DocumentFragment();
-	V.encyclopedia = "Slave Schools";
 
 	el.append(`You check to see if any potential breeding slaves are on auction. `);
 	if (V.eliteAuctioned === 1) {
diff --git a/src/markets/specificMarkets/householdLiquidator.js b/src/markets/specificMarkets/householdLiquidator.js
index a2a355b198c..d7f1262a2e5 100644
--- a/src/markets/specificMarkets/householdLiquidator.js
+++ b/src/markets/specificMarkets/householdLiquidator.js
@@ -1,5 +1,4 @@
 App.Markets["Household Liquidator"] = function() {
-	V.encyclopedia = "Household Liquidations";
 	V.market.introType = "liquidator";
 	V.market.newSlavesDone = 0;
 
diff --git a/src/markets/specificMarkets/huskSlave.js b/src/markets/specificMarkets/huskSlave.js
index e7b4d985c54..287184beaab 100644
--- a/src/markets/specificMarkets/huskSlave.js
+++ b/src/markets/specificMarkets/huskSlave.js
@@ -1,7 +1,6 @@
 App.Markets["Husk Slave"] = function() {
 	const el = new DocumentFragment();
 	let r = [];
-	V.encyclopedia = "Kidnapped Slaves";
 
 	if (V.huskSlaveOrdered === 0) {
 		r.push(`You lay out a new order for a braindead slave to be put aside for your use.`);
diff --git a/src/markets/specificMarkets/prestigiousSlave.js b/src/markets/specificMarkets/prestigiousSlave.js
index 6b23545247e..58a5f2d7820 100644
--- a/src/markets/specificMarkets/prestigiousSlave.js
+++ b/src/markets/specificMarkets/prestigiousSlave.js
@@ -1,5 +1,4 @@
 App.Markets["Prestigious Slave"] = function() {
-	V.encyclopedia = "Slave Schools";
 	const el = new DocumentFragment();
 	App.UI.DOM.appendNewElement("p", el, `You check to see if any especially prestigious slaves are on auction.`);
 	if (V.prestigeAuctioned === 1) {
diff --git a/src/markets/specificMarkets/slaveShelter.js b/src/markets/specificMarkets/slaveShelter.js
index d27ce413238..4ce26d10d5c 100644
--- a/src/markets/specificMarkets/slaveShelter.js
+++ b/src/markets/specificMarkets/slaveShelter.js
@@ -1,5 +1,4 @@
 App.Markets["Slave Shelter"] = function() {
-	V.encyclopedia = "Kidnapped Slaves";
 	const el = new DocumentFragment();
 	let r = [];
 
diff --git a/src/markets/theMarket/buySlaves.js b/src/markets/theMarket/buySlaves.js
index a6c743a3bac..71722ed7b8d 100644
--- a/src/markets/theMarket/buySlaves.js
+++ b/src/markets/theMarket/buySlaves.js
@@ -145,7 +145,7 @@ App.UI.buySlaves = function() {
 					V.market.slaveMarket = store.marketType;
 					V.market.newSlaves = [];
 					V.market.numArcology = 1;
-					updateNav();
+					updateNav(store);
 				},
 				[],
 				"Market"
@@ -200,12 +200,17 @@ App.UI.buySlaves = function() {
 		return el;
 	}
 
-	function updateNav() {
+	/** @param {market} [store] */
+	function updateNav(store) {
 		// Sidebar
 		V.nextButton = "Back";
 		V.nextLink = "Buy Slaves";
 		V.returnTo = "Buy Slaves";
-		V.encyclopedia = "Kidnapped Slaves";
+		if (store && store.encyclopedia) {
+			V.encyclopedia = store.encyclopedia;
+		} else {
+			V.encyclopedia = "Obtaining Slaves";
+		}
 		// Multi-Purchase Support
 		if (V.market.newSlaves.length > 0) {
 			V.nextButton = "Continue";
diff --git a/src/markets/theMarket/marketData.js b/src/markets/theMarket/marketData.js
index 7ab69ed7056..95f24444d0c 100644
--- a/src/markets/theMarket/marketData.js
+++ b/src/markets/theMarket/marketData.js
@@ -7,6 +7,7 @@
  * @property {string} title
  * @property {string} [marketType]
  * @property {string} [note]
+ * @property {string} [encyclopedia]
  * @property {string} [sale]
  * @property {boolean} [bulkAvailable=true]
  * @property {boolean|string} [requirements] if requirements failed, may return string explaining why
@@ -19,6 +20,7 @@ App.Data.Markets = {
 			title: "Corporate Market",
 			marketType: "corporate",
 			get note() { return V.corp.Market === 1 ? `Slaves from your corporation purchased at a discounted rate.` : `Slaves from your corporation`; },
+			encyclopedia: "The Corporation",
 			sale: "",
 			bulkAvailable: true,
 			get requirements() { return (V.corp.Incorporated === 1); }
@@ -28,11 +30,13 @@ App.Data.Markets = {
 			marketType: "heap",
 			bulkAvailable: false,
 			note: `Broken and discarded slaves. Near useless, but cheap. No longer does bulk orders after complaints.`,
+			encyclopedia: "The Flesh Heap"
 		},
 		{
 			title: "Order a custom husk slave from the Flesh Heap",
 			marketType: `Husk Slave`,
 			note: `Will need to be used on arrival.`,
+			encyclopedia: "The Flesh Heap",
 			bulkAvailable: false,
 			get requirements() { return (V.bodyswapAnnounced === 1); }
 		},
@@ -40,30 +44,35 @@ App.Data.Markets = {
 			title: "Kidnappers' Market",
 			marketType: "kidnappers",
 			note: `Slaves will tend to be low quality and resistant.`,
+			encyclopedia: "Kidnapped Slaves",
 			get requirements() { return (V.rep > 500) ? true : `You are not reputable enough to buy kidnapped slaves.`; }
 		},
 		{
 			title: "Runaway Hunters' Market",
 			marketType: "hunters",
 			note: "Slaves will tend to be skilled but rebellious.",
+			encyclopedia: "Kidnapped Slaves",
 			get requirements() { return (V.rep > 1000) ? true : `You are not reputable enough to buy recaptured slaves.`; }
 		},
 		{
 			title: "Indentures Market",
 			marketType: "indentures",
 			note: "Temporary enslavement and restrictions on treatment.",
+			encyclopedia: "Indentured Servants",
 			get requirements() { return (V.rep > 1500) ? true : `You are not reputable enough to buy indentured servants.`; }
 		},
 		{
 			title: "Raiders' Market",
 			marketType: "raiders",
 			note: "Slaves will always be sold immediately upon reaching majority.",
+			encyclopedia: "Kidnapped Slaves",
 			get requirements() { return (V.rep > 2000) ? true : `You are not reputable enough to buy teenaged slaves.`; }
 		},
 		{
 			title: "Raiders' Black Market",
 			marketType: "underage raiders",
 			note: "Very young slaves.",
+			encyclopedia: "Kidnapped Slaves",
 			get requirements() {
 				if (V.rep <= 3000) {
 					return `You are not reputable enough to buy underaged slaves.`;
@@ -78,6 +87,7 @@ App.Data.Markets = {
 			title: "Trainers' Market",
 			marketType: "trainers",
 			note: "Slaves will tend to be good quality and obedient.",
+			encyclopedia: "Stables",
 			sale: "",
 			bulkAvailable: true,
 			get requirements() { return (V.rep > 4000) ? true : `You are not reputable enough to buy trained slaves.`; }
@@ -86,6 +96,7 @@ App.Data.Markets = {
 			title: "Wetware CPUs",
 			marketType: "wetware",
 			note: "Ruined bodies but keen minds. Requires some TLC, but offers outstanding training at a discount.",
+			encyclopedia: "Wetware CPUs",
 			sale: "",
 			bulkAvailable: true,
 			get requirements() { return (V.arcologies[0].FSPaternalist === "unset") ? true : `The paternalistic nature of your society blocks the abusive Wetware CPU manufactures from operating within your arcology.`; }
@@ -129,60 +140,70 @@ App.Data.Markets = {
 			title: "The Slavegirl School",
 			marketType: "TSS",
 			note: "Straightforward slaves with good training.",
+			encyclopedia: "Slave Schools",
 			get requirements() { return (V.seeDicks !== 100); }
 		},
 		{
 			title: "The Utopian Orphanage",
 			marketType: "TUO",
 			note: "Intelligent, unspoiled slaves just past their majority.",
+			encyclopedia: "Slave Schools",
 			get requirements() { return (V.seeDicks !== 100); }
 		},
 		{
 			title: "Growth Research Institute",
 			marketType: "GRI",
 			note: "Poorly trained slaves with huge assets.",
+			encyclopedia: "Slave Schools",
 			get requirements() { return (V.seeDicks !== 100); }
 		},
 		{
 			title: "St. Claver Preparatory",
 			marketType: "SCP",
 			note: "Slaves with basic training and solid implants.",
+			encyclopedia: "Slave Schools",
 			get requirements() { return (V.seeDicks !== 100); }
 		},
 		{
 			title: "The Cattle Ranch",
 			marketType: "TCR",
 			note: "Mentally conditioned free-range cowgirls.",
+			encyclopedia: "Slave Schools",
 			get requirements() { return (V.seeDicks !== 100); }
 		},
 		{
 			title: "The Hippolyta Academy",
 			marketType: "HA",
 			note: "High quality slaves of powerful physique and refined skills.",
+			encyclopedia: "Slave Schools",
 			get requirements() { return (V.seeDicks !== 100); }
 		},
 		{
 			title: "L'École des Enculées",
 			marketType: "LDE",
 			note: "Slaves optimized and trained for anal.",
+			encyclopedia: "Slave Schools",
 			get requirements() { return (V.seeDicks !== 0); }
 		},
 		{
 			title: "The Gymnasium-Academy",
 			marketType: "TGA",
 			note: "Well trained slaves with dicks.",
+			encyclopedia: "Slave Schools",
 			get requirements() { return (V.seeDicks !== 0); }
 		},
 		{
 			title: "The Futanari Sisters",
 			marketType: "TFS",
 			note: "Highly skilled, highly feminine hermaphrodites.",
+			encyclopedia: "Slave Schools",
 			get requirements() { return (V.seeDicks !== 0); }
 		},
 		{
 			title: "Nueva Universidad de Libertad",
 			marketType: "NUL",
 			note: "Androgynous slaves lacking genitalia.",
+			encyclopedia: "Slave Schools",
 		},
 	],
 	high: [
@@ -190,6 +211,7 @@ App.Data.Markets = {
 			title: "Take in a shelter slave",
 			marketType: "Slave Shelter",
 			note: "Presents charity cases for a nominal fee.",
+			encyclopedia: "Discarded Slaves",
 			bulkAvailable: false,
 			get requirements() {
 				if (V.arcologies[0].FSDegradationist !== "unset") {
@@ -211,6 +233,7 @@ App.Data.Markets = {
 			title: "Consult the household liquidator",
 			marketType: "Household Liquidator",
 			note: "Offers slaves close to one another at a very high price.",
+			encyclopedia: "Household Liquidations",
 			bulkAvailable: false,
 			get requirements() { return (V.rep > 8000) ? true : `You are not reputable enough to consult the household liquidator.`; }
 		},
@@ -218,6 +241,7 @@ App.Data.Markets = {
 			title: "Place a special order",
 			marketType: "Custom Slave",
 			note: "Customizable but very expensive.",
+			encyclopedia: "Kidnapped Slaves",
 			bulkAvailable: false,
 			get requirements() { return (V.rep > 10000) ? true : `You are not reputable enough to order custom slaves.`; }
 		},
@@ -225,6 +249,7 @@ App.Data.Markets = {
 			title: "Place a fulfillment order",
 			marketType: "JobFulfillmentCenterOrder",
 			note: "Fills leaderships roles for a price.",
+			encyclopedia: "The Job Fulfillment Center",
 			bulkAvailable: false,
 			get requirements() { return (V.rep > 10000); }
 		},
@@ -232,6 +257,7 @@ App.Data.Markets = {
 			title: "Attend an auction of a prestigious slave",
 			marketType: "Prestigious Slave",
 			note: "Variable and expensive.",
+			encyclopedia: "Slave Schools",
 			bulkAvailable: false,
 			get requirements() { return (V.rep > 12000) ? true : `You are not reputable enough to bid on prestigious slaves.`; }
 		},
@@ -239,6 +265,7 @@ App.Data.Markets = {
 			title: "Attend an auction of other Elite's stock",
 			marketType: "Elite Slave",
 			note: "Limited and very expensive.",
+			encyclopedia: "Slave Schools",
 			bulkAvailable: false,
 			get requirements() { return (V.propOutcome === 1); }
 		},
@@ -246,6 +273,7 @@ App.Data.Markets = {
 			title: "Acquire other slaveowners' stock",
 			marketType: "Special Slave",
 			note: "Variable and expensive",
+			encyclopedia: "Pre-Owned Slaves",
 			bulkAvailable: false,
 			get requirements() { return (V.rep > 14000) ? true : `You are not reputable enough to acquire other slaveowners' stock.`; }
 		},
-- 
GitLab


From 550bbaacdf094acc3b38c0e6d60c22a2da243e53 Mon Sep 17 00:00:00 2001
From: Svornost <11434-svornost@users.noreply.gitgud.io>
Date: Sat, 27 Mar 2021 09:39:19 -0700
Subject: [PATCH 2/2] Fix missing semicolons

---
 src/facilities/surgery/analyzePregnancy.js | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/facilities/surgery/analyzePregnancy.js b/src/facilities/surgery/analyzePregnancy.js
index 2ee6a0688ad..c9a65250acb 100644
--- a/src/facilities/surgery/analyzePregnancy.js
+++ b/src/facilities/surgery/analyzePregnancy.js
@@ -62,7 +62,7 @@ globalThis.analyzePregnancies = function(mother, cheat) {
 				if (cheat) {
 					option.showTextBox();
 				}
-				option = options.addOption(`Eye Color: ${capFirstChar(genes.eyeColor)}`, "eyeColor", genes)
+				option = options.addOption(`Eye Color: ${capFirstChar(genes.eyeColor)}`, "eyeColor", genes);
 				if (cheat) {
 					option.showTextBox().pulldown();
 					for (const color of App.Medicine.Modification.eyeColor.map(color => color.value)) {
@@ -76,20 +76,20 @@ globalThis.analyzePregnancies = function(mother, cheat) {
 						option.addValue(capFirstChar(color), color);
 					}
 				}
-				option = options.addOption(`Pubic hair: ${capFirstChar(genes.pubicHStyle)}`, "pubicHStyle", genes)
+				option = options.addOption(`Pubic hair: ${capFirstChar(genes.pubicHStyle)}`, "pubicHStyle", genes);
 				if (cheat) {
 					option.showTextBox().pulldown()
 						.addValue("hairless")
 						.addValue("hair");
 				}
-				option = options.addOption(`Armpit hair: ${capFirstChar(genes.underArmHStyle)}`, "underArmHStyle", genes)
+				option = options.addOption(`Armpit hair: ${capFirstChar(genes.underArmHStyle)}`, "underArmHStyle", genes);
 				if (cheat) {
 					option.showTextBox().pulldown()
 						.addValue("hairless")
 						.addValue("hair");
 				}
 				if (genes.markings === "freckles" || genes.markings === "heavily freckled") {
-					option = options.addOption(`Markings: ${capFirstChar(genes.markings)}`, "markings", genes)
+					option = options.addOption(`Markings: ${capFirstChar(genes.markings)}`, "markings", genes);
 					if (cheat) {
 						option.addValueList([
 							["None", "none"],
-- 
GitLab