From bd8964cd7ba4e5a1b6e645d94ea71d2a4ff988d6 Mon Sep 17 00:00:00 2001
From: lowercasedonkey <lowercasedonkey@gmail.com>
Date: Mon, 24 Aug 2020 22:51:22 -0400
Subject: [PATCH] progress

---
 src/markets/buySlaves.js  | 926 ++++++++++++++------------------------
 src/markets/marketData.js | 264 ++++++++++-
 2 files changed, 576 insertions(+), 614 deletions(-)

diff --git a/src/markets/buySlaves.js b/src/markets/buySlaves.js
index 9f9268a356b..8da09d8d53a 100644
--- a/src/markets/buySlaves.js
+++ b/src/markets/buySlaves.js
@@ -5,12 +5,9 @@
 
 App.UI.buySlaves = function() {
 	const el = new DocumentFragment();
-	let div;
+	const minCost = minimumSlaveCost();
 	let linkArray;
 
-	let _minimumFive = minimumSlaveCost() * 5;
-	let _minimumTen = minimumSlaveCost() * 10;
-
 	App.UI.DOM.appendNewElement("h2", el, "The Market");
 	App.UI.DOM.appendNewElement("p", el, `There are many different organizations to purchase slaves from, but many of them are selective about their customers and will only sell to you if you are reputable.`, `note`);
 
@@ -29,16 +26,113 @@ App.UI.buySlaves = function() {
 
 	App.UI.DOM.appendNewElement("h2", el, "Sex Slave Purchase Options");
 
-	App.UI.DOM.appendNewElement("div", el, storeFront(App.Data.Markets.starter[0]));
+	el.append(storeBlock(App.Data.Markets.low));
+
+
+	App.UI.DOM.appendNewElement("h3", el, "Neighboring Arcologies");
+	App.UI.DOM.appendNewElement("div", el, "The arcology's prosperity and culture will affect slaves who have lived there.", "note");
+	App.UI.DOM.appendNewElement("div", el, neighborsBlock());
+
+	App.UI.DOM.appendNewElement("h3", el, "Midrange prices");
+	el.append(storeBlock(App.Data.Markets.intermediate));
+
+	if (V.rep > 6000) {
+		App.UI.DOM.appendNewElement("h3", el, "Slave Schools");
+		App.UI.DOM.appendNewElement("div", el, "High prices; will be young and healthy.", "note");
+	} else {
+		App.UI.DOM.appendNewElement("div", el, "You are not reputable enough to acquire fresh school slaves.", "note");
+	}
+	el.append(storeBlock(App.Data.Markets.schools));
+
+	App.UI.DOM.appendNewElement("h3", el, "High prices");
+	el.append(storeBlock(App.Data.Markets.high));
+
 
 	return el;
 
+	function storeBlock(storeCategory) {
+		const el = new DocumentFragment();
+
+		for (const store of storeCategory) {
+			el.append(storeFront(store));
+		}
+
+		return el;
+	}
+
+	function neighborsBlock() {
+		const el = new DocumentFragment();
+		for (let _i = 0; _i < V.arcologies.length; _i++) {
+			if (V.arcologies[_i].direction !== 0) {
+				linkArray = [];
+				const linkUnit = document.createElement("span");
+				linkUnit.append(
+					App.UI.DOM.link(
+						"Slaves from",
+						() => {
+							V.slaveMarket = "neighbor";
+							V.numArcology = _i;
+						},
+						[],
+						"Slave Markets"
+					)
+				);
+				App.UI.DOM.appendNewElement("span", linkUnit, ` ${V.arcologies[_i].name}`, "bold");
+				linkArray.push(linkUnit);
+				if (V.cash > (minCost * 5)) {
+					linkArray.push(
+						App.UI.DOM.link(
+							"(x5)",
+							() => {
+								V.slaveMarket = "neighbor";
+								V.introType = "bulk";
+								V.numSlaves = 5;
+								V.numArcology = _i;
+							},
+							[],
+							"Slave Markets"
+						)
+					);
+				}
+				if (V.cash > (minCost * 10)) {
+					linkArray.push(
+						App.UI.DOM.link(
+							"(x10)",
+							() => {
+								V.slaveMarket = "neighbor";
+								V.introType = "bulk";
+								V.numSlaves = 10;
+								V.numArcology = _i;
+							},
+							[],
+							"Slave Markets"
+						)
+					);
+				}
+				App.UI.DOM.appendNewElement("div", el, App.UI.DOM.generateLinksStrip(linkArray));
+			}
+		}
+		return el;
+	}
+
 	/** *
 	 * @returns {Node}
 	 */
 	function storeFront(/** @type {market}*/store) {
-		const el = new DocumentFragment();
-		linkArray = [];
+		const el = document.createElement("div");
+
+		// Check requirements
+		const requirements = store.requirements;
+		if (requirements === false) {
+			return el;
+		} else if (typeof requirements === "string") {
+			el.append(requirements);
+			return el;
+		}
+		const linkArray = [];
+
+		store.passage = store.passage || passage();
+		console.log(store.passage);
 		linkArray.push(
 			App.UI.DOM.link(
 				store.title,
@@ -47,7 +141,7 @@ App.UI.buySlaves = function() {
 				store.passage
 			)
 		);
-		if (V.cash > _minimumFive) {
+		if (V.cash > (minCost * 5)) {
 			linkArray.push(
 				App.UI.DOM.link(
 					`(x5)`,
@@ -61,7 +155,7 @@ App.UI.buySlaves = function() {
 				)
 			);
 		}
-		if (V.cash > _minimumTen) {
+		if (V.cash > (minCost * 10)) {
 			linkArray.push(
 				App.UI.DOM.link(
 					`(x10)`,
@@ -76,629 +170,273 @@ App.UI.buySlaves = function() {
 			);
 		}
 		el.append(App.UI.DOM.generateLinksStrip(linkArray));
+
+		if (store.sale) {
+			el.append(store.sale);
+		}
+
+		if (store.note) {
+			App.UI.DOM.appendNewElement("span", el, ` ${store.note}`, "note");
+		}
 		return el;
 	}
-}
-/*
+};
 
-	<div>
-		[[The Flesh Heap|Slave Markets][V.slaveMarket = "heap", V.slavesSeen += 1]] | //Broken and discarded slaves. Near useless, but cheap. No longer does bulk orders after complaints.//
-	</div>
 
-		<div>
-			if (V.bodyswapAnnounced === 1) {
-				[[Order a custom husk slave from the Flesh Heap | Husk Slave]] | //Will need to be used on arrival.//
-		}
-		</div>
 
-		<div>
-			if (V.rep > 500) {
-				[[Kidnappers' Market|Slave Markets][V.slaveMarket = "kidnappers", V.slavesSeen += 1]] |
-			if (V.cash > _minimumFive) {
-				[[(x5) | Bulk Slave Generate][V.slaveMarket = "kidnappers", V.introType = "bulk", V.numSlaves = 5]] |
-			}
-			if (V.cash > _minimumTen) {
-				[[(x10) | Bulk Slave Generate][V.slaveMarket = "kidnappers", V.introType = "bulk", V.numSlaves = 10]] |
-			}
-			//Slaves will tend to be low quality and resistant.//
-		}
-	</div>
-
-		<div>
-			r.push(`''Neighboring Arcologies:'' //The arcology's prosperity and culture will affect slaves who have lived there.//`);
-	</div>
-	<<for _i = 0; _i < V.arcologies.length; _i++ >>
-		if (V.arcologies[_i].direction !== 0) {
-			<div class="indent">
-				<<capture _i>>[[Slaves from|Slave Markets][V.slaveMarket = "neighbor", V.numArcology = _i]]
-	<</capture>>
-				r.push(`'' ${V.arcologies[_i].name}''`);
-				if (V.cash > _minimumFive) {
-					| << capture _i>>[[(x5)|Bulk Slave Generate][V.slaveMarket = "neighbor", V.introType = "bulk", V.numSlaves = 5, V.numArcology = _i]]
-	<</capture>>
-				}
-				if (V.cash > _minimumTen) {
-					| << capture _i>>[[(x10)|Bulk Slave Generate][V.slaveMarket = "neighbor", V.introType = "bulk", V.numSlaves = 10, V.numArcology = _i]]
-	<</capture>>
-				}
-			</div>
-		}
-	<</for>>
 
-	<div>
-					if (V.rep > 1000) {
-						[[Runaway Hunters' Market|Slave Markets][V.slaveMarket = "hunters", V.slavesSeen += 1]] |
-			if (V.cash > _minimumFive) {
-						[[(x5) | Bulk Slave Generate][V.slaveMarket = "hunters", V.introType = "bulk", V.numSlaves = 5]] |
-			}
-			if (V.cash > _minimumTen) {
-						[[(x10) | Bulk Slave Generate][V.slaveMarket = "hunters", V.introType = "bulk", V.numSlaves = 10]] |
-			}
-			//Slaves will tend to be skilled but rebellious.//
-		}
-	</div>
+/*
 
-				<div>
-					if (V.rep > 1500) {
-						[[Indentures Market | Slave Markets][V.slaveMarket = "indentures", V.slavesSeen += 1]] |
-			if (V.cash > _minimumFive) {
-						[[(x5) | Bulk Slave Generate][V.slaveMarket = "indentures", V.introType = "bulk", V.numSlaves = 5]] |
-			}
-			if (V.cash > _minimumTen) {
-						[[(x10) | Bulk Slave Generate][V.slaveMarket = "indentures", V.introType = "bulk", V.numSlaves = 10]] |
-			}
-			//Temporary enslavement and restrictions on treatment.//
-		}
-	</div>
+	< h2 > Selling slaves</h2 >
 
-				<div>
-					if (V.rep > 2000) {
-						[[Raiders' Market|Slave Markets][V.slaveMarket = "raiders", V.slavesSeen += 1]] |
-			if (V.cash > _minimumFive) {
-						[[(x5) | Bulk Slave Generate][V.slaveMarket = "raiders", V.introType = "bulk", V.numSlaves = 5]] |
-			}
-			if (V.cash > _minimumTen) {
-						[[(x10) | Bulk Slave Generate][V.slaveMarket = "raiders", V.introType = "bulk", V.numSlaves = 10]] |
-			}
-			//Slaves will always be sold immediately upon reaching majority.//
-		}
-	</div>
+		r.push(`While you are at the market, you may want to [[look at your own underperforming slaves|Underperforming Slaves]].`);
 
-				<div>
-					if (V.pedo_mode === 1 || (V.minimumSlaveAge <= 13 && V.minimumSlaveAge <= V.fertilityAge)) && (V.rep > 3000) {
-						[[Raiders' Black Market|Slave Markets][V.slaveMarket = "underage raiders", V.slavesSeen += 1]] |
-			if (V.cash > _minimumFive) {
-						[[(x5) | Bulk Slave Generate][V.slaveMarket = "underage raiders", V.introType = "bulk", V.numSlaves = 5]] |
-			}
-			if (V.cash > _minimumTen) {
-						[[(x10) | Bulk Slave Generate][V.slaveMarket = "underage raiders", V.introType = "bulk", V.numSlaves = 10]] |
-			}
-			//Very young slaves.//
-		}
-	</div>
 
-	if (V.rep > 4000) {
-					<div>
-						[[Trainers' Market|Slave Markets][V.slaveMarket = "trainers", V.slavesSeen += 1]] |
-			if (V.cash > _minimumFive) {
-							[[(x5) | Bulk Slave Generate][V.slaveMarket = "trainers", V.introType = "bulk", V.numSlaves = 5]] |
-			}
-			if (V.cash > _minimumTen) {
-							[[(x10) | Bulk Slave Generate][V.slaveMarket = "trainers", V.introType = "bulk", V.numSlaves = 10]] |
-			}
-					//Slaves will tend to be good quality and obedient.//
-					</div>
-
-					<div>
-						if (V.arcologies[0].FSPaternalist === "unset") {
-							[[Wetware CPUs | Slave Markets][V.slaveMarket = "wetware", V.slavesSeen += 1]] |
-				if (V.cash > _minimumFive) {
-							[[(x5) | Bulk Slave Generate][V.slaveMarket = "wetware", V.introType = "bulk", V.numSlaves = 5]] |
-				}
-				if (V.cash > _minimumTen) {
-							[[(x10) | Bulk Slave Generate][V.slaveMarket = "wetware", V.introType = "bulk", V.numSlaves = 10]] |
-				}
-				//Ruined bodies but keen minds. Requires some TLC, but offers outstanding training at a discount.//
-			} else {
-							//The paternalistic nature of your society blocks the abusive Wetware CPU manufactures from operating within your arcology.//
-						}
-					</div>
-	}
+<h2>Menial Slaves</h2>
 
-				<div>
-					if (V.rep > 5000) {
-						V.weeklyMarket = V.prisonCircuit[V.prisonCircuitIndex];
-			[[Prisoner Sale|Criminal Market][V.slavesSeen += 1]] |
-			if (V.cash > _minimumFive) {
-						[[(x5) | Bulk Slave Generate][V.slaveMarket = V.weeklyMarket, V.introType = "bulk", V.numSlaves = 5]] |
-			}
-			if (V.cash > _minimumTen) {
-						[[(x10) | Bulk Slave Generate][V.slaveMarket = V.weeklyMarket, V.introType = "bulk", V.numSlaves = 10]] |
-			}
-			r.push(`This week`);
-			switch (V.weeklyMarket) {
-			case "low tier criminals":
-				r.push(`a minor prison is selling inmates.`);
-				//Slaves will tend to be low to mid quality with few redeeming factors.//
-			case "gangs and smugglers":
-				r.push(`a major prison is selling hardened criminals.`);
-				//Slaves will tend to be low quality and difficult but may prove useful once broken.//
-			case "white collar":
-				r.push(`a white collar prison is selling inmates.`);
-				//Slaves will tend to be medium to high quality with a variety of useful backgrounds.//
-			case "military prison":
-				r.push(`a military prison is selling inmates.`);
-				//Slaves will tend to be high quality but defiant.//
-			}
-		}
-	</div>
 
-	if (V.rep > 6000) {
-					<div>
-						r.push(`''Slave Schools:'' //High prices; will be young and healthy.//`);
-		</div>
-		if (V.seeDicks !== 100) {
-					<div class="indent">
-						[[The Slavegirl School][V.slavesSeen += 1]] |
-				if (V.cash > _minimumFive) {
-							[[(x5) | Bulk Slave Generate][V.slaveMarket = "TSS", V.introType = "bulk", V.numSlaves = 5]] |
-				}
-				if (V.cash > _minimumTen) {
-							[[(x10) | Bulk Slave Generate][V.slaveMarket = "TSS", V.introType = "bulk", V.numSlaves = 10]] |
-				}
-				//Straightforward slaves with good training.//
-	if (V.TSS.schoolSale === 1) {
-							r.push(` //<span class="yellow">Offering your first purchase at half price this week.</span>//`);
+r.push(`Slave demand is`);
+if (V.menialDemandFactor <= -35000) {
+									r.push(`<span class="red">''extremely low''</span>`);
+} else if (V.menialDemandFactor <= -20000) {
+									r.push(`<span class="red">''very low''</span>`);
+} else if (V.menialDemandFactor <= 0) {
+									r.push(`<span class="yellow">''weak''</span>`);
+} else if (V.menialDemandFactor >= 35000) {
+									r.push(`<span class="green">''extremely high''</span>`);
+} else if (V.menialDemandFactor >= 20000) {
+									r.push(`<span class="green">''very high''</span>`);
+} else {
+									r.push(`<span class="yellow">''strong''</span>`);
+}
+if (V.deltaDemand > 0) {
+									r.push(`and <span class="green">''improving''</span>`);
+} else if (V.deltaDemand < 0) {
+									r.push(`and <span class="red">''decreasing''</span>`);
+}
+if (V.deltaDemand !== 0) {
+	if (V.demandTimer - V.elapsedDemandTimer < 3) {
+									r.push(`but it might change soon`);
 	}
-			</div>
+}
+if (V.cheatMode) && (V.cheatModeM) {
+									<span id="menialDemandFactor">
+										r.push(`<span class="yellowgreen">Slave Demand</span>`);
+		| ${V.menialDemandFactor}
+									</span>
+	let _tMenialDemandFactor = V.menialDemandFactor;
+	<< textbox "_tMenialDemandFactor" _tMenialDemandFactor >>
+	<< link "Apply" >>
+		V.menialDemandFactor = Math.clamp(Math.trunc(Number(_tMenialDemandFactor)), -50000, 50000) || V.menialDemandFactor, V.cheater = 1;
+		<< replace "#menialDemandFactor" >>
+		r.push(`<span class="yellowgreen"> Slave Demand</span>`);
+			| ${V.menialDemandFactor}
+		<< /replace>>
+		<< /link>>
+}
 
-					<div class="indent">
-						[[The Utopian Orphanage][V.slavesSeen += 1]] |
-				if (V.cash > _minimumFive) {
-							[[(x5) | Bulk Slave Generate][V.slaveMarket = "TUO", V.introType = "bulk", V.numSlaves = 5]] |
-				}
-				if (V.cash > _minimumTen) {
-							[[(x10) | Bulk Slave Generate][V.slaveMarket = "TUO", V.introType = "bulk", V.numSlaves = 10]] |
-				}
-				//Intelligent, unspoiled slaves just past their majority.//
-	if (V.TUO.schoolSale === 1) {
-							r.push(` //<span class="yellow">Offering your first purchase at half price this week.</span>//`);
-	}
-			</div>
 
-					<div class="indent">
-						[[Growth Research Institute][V.slavesSeen += 1]] |
-				if (V.cash > _minimumFive) {
-							[[(x5) | Bulk Slave Generate][V.slaveMarket = "GRI", V.introType = "bulk", V.numSlaves = 5]] |
-				}
-				if (V.cash > _minimumTen) {
-							[[(x10) | Bulk Slave Generate][V.slaveMarket = "GRI", V.introType = "bulk", V.numSlaves = 10]] |
-				}
-				//Poorly trained slaves with huge assets.//
-	if (V.GRI.schoolSale === 1) {
-							r.push(` //<span class="yellow">Offering your first purchase at half price this week.</span>//`);
-	}
-			</div>
 
-					<div class="indent">
-						[[St. Claver Preparatory][V.slavesSeen += 1]] |
-				if (V.cash > _minimumFive) {
-							[[(x5) | Bulk Slave Generate][V.slaveMarket = "SCP", V.introType = "bulk", V.numSlaves = 5]] |
-				}
-				if (V.cash > _minimumTen) {
-							[[(x10) | Bulk Slave Generate][V.slaveMarket = "SCP", V.introType = "bulk", V.numSlaves = 10]] |
-				}
-				//Slaves with basic training and solid implants.//
-	if (V.SCP.schoolSale === 1) {
-							r.push(` //<span class="yellow">Offering your first purchase at half price this week.</span>//`);
+r.push(`Slave supply is`);
+if (V.menialSupplyFactor <= -35000) {
+									r.push(`<span class="green">''extremely low''</span>`);
+} else if (V.menialSupplyFactor <= -20000) {
+									r.push(`<span class="green">''very low''</span>`);
+} else if (V.menialSupplyFactor <= 0) {
+									r.push(`<span class="yellow">''weak''</span>`);
+} else if (V.menialSupplyFactor >= 35000) {
+									r.push(`<span class="red">''extremely high''</span>`);
+} else if (V.menialSupplyFactor >= 20000) {
+									r.push(`<span class="red">''very high''</span>`);
+} else {
+									r.push(`<span class="yellow">''strong''</span>`);
+}
+if (V.deltaSupply > 0) {
+									r.push(`and <span class="red">''improving''</span>`);
+} else if (V.deltaSupply < 0) {
+									r.push(`and <span class="green">''decreasing''</span>`);
+}
+if (V.deltaSupply !== 0) {
+	if (V.supplyTimer - V.elapsedDemandTimer < 3) {
+									r.push(`but it might change soon`);
 	}
-			</div>
+}
+if (V.cheatMode) && (V.cheatModeM) {
+									<span id="menialSupplyFactor">
+										r.push(`<span class="yellowgreen">Slave Supply</span>`);
+		| ${V.menialSupplyFactor}
+									</span>
+	let _tMenialSupplyFactor = V.menialSupplyFactor;
+	<< textbox "_tMenialSupplyFactor" _tMenialSupplyFactor >>
+	<< link "Apply" >>
+		V.menialSupplyFactor = Math.clamp(Math.trunc(Number(_tMenialSupplyFactor)), -50000, 50000) || V.menialSupplyFactor, V.cheater = 1;
+		<< replace "#menialSupplyFactor" >>
+		r.push(`<span class="yellowgreen"> Slave Supply</span>`);
+			| ${V.menialSupplyFactor}
+		<< /replace>>
+		<< /link>>
+}
 
-					<div class="indent">
-						[[The Cattle Ranch][V.slavesSeen += 1]] |
-				if (V.cash > _minimumFive) {
-							[[(x5) | Bulk Slave Generate][V.slaveMarket = "TCR", V.introType = "bulk", V.numSlaves = 5]] |
-				}
-				if (V.cash > _minimumTen) {
-							[[(x10) | Bulk Slave Generate][V.slaveMarket = "TCR", V.introType = "bulk", V.numSlaves = 10]] |
-				}
-				//Mentally conditioned free-range cowgirls.//
-	if (V.TCR.schoolSale === 1) {
-							r.push(` //<span class="yellow">Offering your first purchase at half price this week.</span>//`);
-	}
-			</div>
 
-					<div class="indent">
-						[[The Hippolyta Academy][V.slavesSeen += 1]] |
-				if (V.cash > _minimumFive) {
-							[[(x5) | Bulk Slave Generate][V.slaveMarket = "HA", V.introType = "bulk", V.numSlaves = 5]] |
-				}
-				if (V.cash > _minimumTen) {
-							[[(x10) | Bulk Slave Generate][V.slaveMarket = "HA", V.introType = "bulk", V.numSlaves = 10]] |
-				}
-				//High quality slaves of powerful physique and refined skills.//
-	if (V.HA.schoolSale === 1) {
-							r.push(` //<span class="yellow">Offering your first purchase at half price this week.</span>//`);
+
+${MenialPopCap()}
+r.push(`The parts of your arcology you own can house a total of ${num(${ V.PopCap)}} menial slaves.`);
+
+
+let _menialPrice = menialSlaveCost();
+let _bulkMax = V.PopCap - V.menials - V.fuckdolls - V.menialBioreactors;
+
+
+if (V.menials > 1) {
+									r.push(`You own ${num(Math.trunc(${ V.menials))}} menial slaves.`);
+} else if (V.menials > 0) {
+									r.push(`You own one menial ${slave.`);
+}} else {
+	r.push(`You do not own any menial slaves.`);
+}
+r.push(`The market price of menials is ${cashFormat(_menialPrice)}.`);
+let _optionsBreak = 0;
+if (_bulkMax > 0 && V.cash > _menialPrice) {
+									[[Buy | Buy Slaves][V.menials += 1, V.menialSupplyFactor -= 1, cashX(forceNeg(_menialPrice), "menialTransfer")]]
+	if (V.cash > (menialSlaveCost(10))*10) {
+									[[(x10) | Buy Slaves][V.menials += 10, V.menialSupplyFactor -= 10, cashX(forceNeg((menialSlaveCost(10)) * 10), "menialTransfer")]]
+								}
+	if (V.cash > (menialSlaveCost(100))*100) {
+									[[(x100) | Buy Slaves][V.menials += 100, V.menialSupplyFactor -= 100, cashX(forceNeg((menialSlaveCost(100)) * 100), "menialTransfer")]]
+								}
+	if (V.cash > (_menialPrice+1)*2) {
+									let _menialBulkPremium = Math.trunc(1 + Math.clamp(V.cash/_menialPrice,0,_bulkMax)/400);
+		[[(max)|Buy Slaves][V.menials+=Math.trunc(Math.clamp(V.cash/(_menialPrice+_menialBulkPremium),0,_bulkMax)),V.menialSupplyFactor-=Math.trunc(Math.clamp(V.cash/(_menialPrice+_menialBulkPremium),0,_bulkMax)),cashX(forceNeg(Math.trunc(Math.clamp(V.cash/(_menialPrice+_menialBulkPremium),0,_bulkMax))*(_menialPrice+_menialBulkPremium)), "menialTransfer")]]
 	}
-			</div>
-		}
-		if (V.seeDicks !== 0) {
-					<div class="indent">
-						[[L'École des Enculées][V.slavesSeen += 1]] |
-				if (V.cash > _minimumFive) {
-							[[(x5) | Bulk Slave Generate][V.slaveMarket = "LDE", V.introType = "bulk", V.numSlaves = 5]] |
-				}
-				if (V.cash > _minimumTen) {
-							[[(x10) | Bulk Slave Generate][V.slaveMarket = "LDE", V.introType = "bulk", V.numSlaves = 10]] |
-				}
-				//Slaves optimized and trained for anal.//
-	if (V.LDE.schoolSale === 1) {
-							r.push(` //<span class="yellow">Offering your first purchase at half price this week.</span>//`);
+	//Bulk transactions may require offering a premium.//
+	let _optionsBreak = 1;
+}
+if (V.menials >= 1) {
+	if (_optionsBreak) {|
+}
+	[[Sell|Buy Slaves][V.menials-=1,V.menialDemandFactor-=1,cashX(_menialPrice, "menialTransfer")]]
+	if (V.menials >= 10) {
+									[[(x10) | Buy Slaves][V.menials -= 10, V.menialDemandFactor -= 10, cashX(((menialSlaveCost(-10)) * 10), "menialTransfer")]]
+		if (V.menials >= 100) {
+									[[(x100) | Buy Slaves][V.menials -= 100, V.menialDemandFactor -= 100, cashX(((menialSlaveCost(-100)) * 100), "menialTransfer")]]
+								}
 	}
-			</div>
-
-					<div class="indent">
-						[[The Gymnasium-Academy][V.slavesSeen += 1]] |
-				if (V.cash > _minimumFive) {
-							[[(x5) | Bulk Slave Generate][V.slaveMarket = "TGA", V.introType = "bulk", V.numSlaves = 5]] |
-				}
-				if (V.cash > _minimumTen) {
-							[[(x10) | Bulk Slave Generate][V.slaveMarket = "TGA", V.introType = "bulk", V.numSlaves = 10]] |
+	[[(all)|Buy Slaves][cashX((V.menials*(menialSlaveCost(-V.menials))), "menialTransfer"),V.menialDemandFactor-=V.menials,V.menials = 0]]
+	if (V.arcologies[0].FSPaternalist === "unset") {
+		if (V.arcadeUpgradeFuckdolls > 0) {
+									let _fConvertCost = 100;
+
+		[[Convert to Fuckdoll|Buy Slaves][V.menials-=1,V.fuckdolls+=1,cashX(forceNeg(_fConvertCost), "menialTransfer")]]
+				if (V.menials >= 10) {
+									[[(x10) | Buy Slaves][V.menials -= 10, V.fuckdolls += 10, cashX(forceNeg(10 * (_fConvertCost)), "menialTransfer")]]
+					if (V.menials >= 100) {
+									[[(x100) | Buy Slaves][V.menials -= 100, V.fuckdolls += 100, cashX(forceNeg(100 * (_fConvertCost)), "menialTransfer")]]
+								}
 				}
-				//Well trained slaves with dicks.//
-	if (V.TGA.schoolSale === 1) {
-							r.push(` //<span class="yellow">Offering your first purchase at half price this week.</span>//`);
-	}
-			</div>
+				[[(all)|Buy Slaves][V.fuckdolls+=V.menials,cashX(forceNeg((_fConvertCost)*(V.menials)), "menialTransfer"),V.menials=0]]
+				//Conversion costs ${cashFormat(_fConvertCost)} each//
 
-					<div class="indent">
-						[[The Futanari Sisters][V.slavesSeen += 1]] |
-				if (V.cash > _minimumFive) {
-							[[(x5) | Bulk Slave Generate][V.slaveMarket = "TFS", V.introType = "bulk", V.numSlaves = 5]] |
-				}
-				if (V.cash > _minimumTen) {
-							[[(x10) | Bulk Slave Generate][V.slaveMarket = "TFS", V.introType = "bulk", V.numSlaves = 10]] |
-				}
-				//Highly skilled, highly feminine hermaphrodites.//
-	if (V.TFS.schoolSale === 1) {
-							r.push(` //<span class="yellow">Offering your first purchase at half price this week.</span>//`);
-	}
-			</div>
 		}
-				<div class="indent">
-					[[Nueva Universidad de Libertad][V.slavesSeen += 1]] |
-			if (V.cash > _minimumFive) {
-						[[(x5) | Bulk Slave Generate][V.slaveMarket = "NUL", V.introType = "bulk", V.numSlaves = 5]] |
-			}
-			if (V.cash > _minimumTen) {
-						[[(x10) | Bulk Slave Generate][V.slaveMarket = "NUL", V.introType = "bulk", V.numSlaves = 10]] |
-			}
-			//Androgynous slaves lacking genitalia.//
-	if (V.NUL.schoolSale === 1) {
-						r.push(` //<span class="yellow">Offering your first purchase at half price this week.</span>//`);
+		if (V.dairyFeedersUpgrade > 0) {
+
+									[[Convert to Bioreactor | Buy Slaves][V.menials -= 1, V.menialBioreactors += 1, cashX(-100, "menialTransfer")]]
+				if (V.menials >= 10) {
+									[[(x10) | Buy Slaves][V.menials -= 10, V.menialBioreactors += 10, cashX(-1000, "menialTransfer")]]
+					if (V.menials >= 100) {
+									[[(x100) | Buy Slaves][V.menials -= 100, V.menialBioreactors += 100, cashX(-10000, "menialTransfer")]]
+								}
+				}
+				[[(all)|Buy Slaves][V.menialBioreactors+=V.menials,cashX(forceNeg(500*V.menials), "menialTransfer"),V.menials=0]]
+				//Conversion costs ${cashFormat(500)} each//
+
 	}
-		</div>
 	}
+}
 
-	<div>
-					if (V.arcologies[0].FSDegradationist !== "unset") {
-						//The Slave Shelter does not place slaves into Degradationist arcologies.//
-					} else if ((V.shelterAbuse > 10)) {
-						//The Slave Shelter has banned you due to dark rumors about you.//
-					} else if ((V.shelterAbuse > 5)) {
-						//The Slave Shelter has banned you due to rumors that you resell its slaves.//
-					} else if ((V.shelterSlaveBought === 1)) {
-			>//The Slave Shelter will not offer another slave for placement until next week.//
-		} else if ((V.rep > 7000)) {
-						[[Take in a shelter slave | Slave Shelter]] | //Presents charity cases for a nominal fee.//
-		}
-				</div>
 
-				<div>
-					if (V.rep > 8000) {
-						[[Consult the household liquidator | Household Liquidator][V.slavesSeen += 2]] | //Offers slaves close to one another at a very high price.//
-		}
-				</div>
 
-	if (V.rep > 10000) {
-					<div>[[Place a special order|Custom Slave]] | //Customizable but very expensive.//</div>
-					<div>[[Place a fulfillment order|JobFulfillmentCenterOrder]] | //Fills leaderships roles for a price.//</div>
+		if (V.fuckdolls > 1) {
+									r.push(`You own ${num(Math.trunc(${ V.fuckdolls))}
+} standard Fuckdolls.`);
+} else if (V.fuckdolls > 0) {
+									r.push(`You own one standard Fuckdoll.`);
+} else if (V.arcologies[0].FSPaternalist === "unset") {
+									r.push(`You do not own any standard Fuckdolls.`);
+}
+if (V.fuckdolls > 0) || (V.arcologies[0].FSPaternalist === "unset") {
+									r.push(`The market price of standard Fuckdolls is ${cashFormat(_menialPrice)}.`);
+	let _optionsBreak = 0;
+	if (_bulkMax > 0) {
+		if (V.arcologies[0].FSPaternalist === "unset" && V.cash > _menialPrice) {
+									[[Buy | Buy Slaves][V.fuckdolls += 1, V.menialSupplyFactor -= 1, cashX(forceNeg(_menialPrice), "fuckdollsTransfer")]]
+			if (V.cash > menialSlaveCost(10)*10) {
+									[[(x10) | Buy Slaves][V.fuckdolls += 10, V.menialSupplyFactor -= 10, cashX(forceNeg(menialSlaveCost(10) * 10), "fuckdollsTransfer")]]
+								}
+			if (V.cash > menialSlaveCost(100)*100) {
+									[[(x100) | Buy Slaves][V.fuckdolls += 100, V.menialSupplyFactor -= 100, cashX(forceNeg(menialSlaveCost(100) * 100), "fuckdollsTransfer")]]
+								}
+			if (V.cash > ((_menialPrice+1)*2)) {
+									[[(max) | Buy Slaves][V.fuckdolls += Math.trunc(Math.clamp(V.cash / _menialPrice, 0, _bulkMax)), V.menialSupplyFactor -= Math.trunc(Math.clamp(V.cash / _menialPrice, 0, _bulkMax)), cashX(forceNeg(Math.trunc(Math.clamp(V.cash / _menialPrice, 0, _bulkMax)) * _menialPrice), "fuckdollsTransfer")]]
+								}
+			//Bulk transactions may require offering a premium.//
+			let _optionsBreak = 1;
+		}
 	}
+	if (V.fuckdolls >= 1) {
+		if (_optionsBreak) {|
+}
+		[[Sell|Buy Slaves][V.fuckdolls-=1,V.menialDemandFactor-=1,cashX(_menialPrice, "fuckdollsTransfer")]]
+	if (V.fuckdolls >= 10) {
+									[[(x10) | Buy Slaves][V.fuckdolls -= 10, V.menialDemandFactor -= 10, cashX((menialSlaveCost(-10) * 10), "fuckdollsTransfer")]]
+		if (V.fuckdolls >= 100) {
+									[[(x100) | Buy Slaves][V.fuckdolls -= 100, V.menialDemandFactor -= 100, cashX((menialSlaveCost(-100) * 100), "fuckdollsTransfer")]]
+								}
+	}
+	[[(all)|Buy Slaves][cashX(V.fuckdolls*(menialSlaveCost(-V.fuckdolls)), "fuckdollsTransfer"),V.menialDemandFactor-=V.fuckdolls,V.fuckdolls = 0]]
+	}
+}
 
-	if (V.rep > 12000) {
-					<div>[[Attend an auction of a prestigious slave|Prestigious Slave]] | //Variable and expensive.//</div>
-				}
-
-	if (V.propOutcome === 1) {
-					<div>[[Attend an auction of other Elite's stock|Elite Slave]] | //Limited and very expensive.//</div>
-				}
 
-	if (V.rep > 14000) {
-					<div>[[Acquire other slaveowners' stock|Special Slave]] | //Variable and expensive.//</div>
-				}
 
-				<div>
-					if (V.rep <= 500) {
-						//You are not reputable enough to buy kidnapped slaves.//
-					} else if ((V.rep <= 1000)) {
-						//You are not reputable enough to buy recaptured slaves.//
-					} else if ((V.rep <= 1500)) {
-						//You are not reputable enough to buy indentured servants.//
-					} else if ((V.rep <= 2000)) {
-						//You are not reputable enough to buy teenaged slaves.//
-					} else if ((V.pedo_mode === 1 || (V.minimumSlaveAge <= 13 && V.minimumSlaveAge <= V.fertilityAge)) && (V.rep <= 3000)) {
-						//You are not reputable enough to buy underaged slaves.//
-					} else if ((V.rep <= 4000)) {
-						//You are not reputable enough to buy trained slaves.//
-					} else if ((V.rep <= 5000)) {
-						//You are not reputable enough to buy prison slaves.//
-					} else if ((V.rep <= 6000)) {
-						//You are not reputable enough to acquire fresh school slaves.//
-					} else if ((V.rep <= 7000)) {
-						//You are not reputable enough to take in Shelter slaves.//
-					} else if ((V.rep <= 8000)) {
-						//You are not reputable enough to consult the household liquidator.//
-					} else if ((V.rep <= 1000)) {
-						//You are not reputable enough to order custom slaves.//
-					} else if ((V.rep <= 12000)) {
-						//You are not reputable enough to bid on prestigious slaves.//
-					} else if ((V.rep <= 14000)) {
-						//You are not reputable enough to acquire other slaveowners' stock.//
-					} else {
-						r.push(`You are so reputable that you can access all of the Free Cities' slaving markets.`);
-		}
-	</div>
-
-
-				<h2>Selling slaves</h2>
-				<div>
-					r.push(`While you are at the market, you may want to [[look at your own underperforming slaves|Underperforming Slaves]].`);
-	 </div>
-
-				<h2>Menial Slaves</h2>
-
-				<div>
-					r.push(`Slave demand is`);
-		if (V.menialDemandFactor <= -35000) {
-						r.push(`<span class="red">''extremely low''</span>`);
-		} else if (V.menialDemandFactor <= -20000) {
-						r.push(`<span class="red">''very low''</span>`);
-		} else if (V.menialDemandFactor <= 0) {
-						r.push(`<span class="yellow">''weak''</span>`);
-		} else if (V.menialDemandFactor >= 35000) {
-						r.push(`<span class="green">''extremely high''</span>`);
-		} else if (V.menialDemandFactor >= 20000) {
-						r.push(`<span class="green">''very high''</span>`);
-		} else {
-						r.push(`<span class="yellow">''strong''</span>`);
-		}
-		if (V.deltaDemand > 0) {
-						r.push(`and <span class="green">''improving''</span>`);
-		} else if (V.deltaDemand < 0) {
-						r.push(`and <span class="red">''decreasing''</span>`);
-		}
-		if (V.deltaDemand !== 0) {
-			if (V.demandTimer - V.elapsedDemandTimer < 3) {
-						r.push(`but it might change soon`);
-			}
-		}
-		if (V.cheatMode) && (V.cheatModeM) {
-						<span id="menialDemandFactor">
-							r.push(`<span class="yellowgreen">Slave Demand</span>`);
-				| ${V.menialDemandFactor}
-						</span>
-			let _tMenialDemandFactor = V.menialDemandFactor;
-			<<textbox "_tMenialDemandFactor" _tMenialDemandFactor>>
-			<<link "Apply">>
-				V.menialDemandFactor = Math.clamp(Math.trunc(Number(_tMenialDemandFactor)),-50000,50000) || V.menialDemandFactor, V.cheater = 1;
-				<<replace "#menialDemandFactor">>
-					r.push(`<span class="yellowgreen"> Slave Demand</span>`);
-					| ${V.menialDemandFactor}
-				<</replace>>
-			<</link>>
-		}
-	</div>
-
-				<div>
-					r.push(`Slave supply is`);
-		if (V.menialSupplyFactor <= -35000) {
-						r.push(`<span class="green">''extremely low''</span>`);
-		} else if (V.menialSupplyFactor <= -20000) {
-						r.push(`<span class="green">''very low''</span>`);
-		} else if (V.menialSupplyFactor <= 0) {
-						r.push(`<span class="yellow">''weak''</span>`);
-		} else if (V.menialSupplyFactor >= 35000) {
-						r.push(`<span class="red">''extremely high''</span>`);
-		} else if (V.menialSupplyFactor >= 20000) {
-						r.push(`<span class="red">''very high''</span>`);
-		} else {
-						r.push(`<span class="yellow">''strong''</span>`);
-		}
-		if (V.deltaSupply > 0) {
-						r.push(`and <span class="red">''improving''</span>`);
-		} else if (V.deltaSupply < 0) {
-						r.push(`and <span class="green">''decreasing''</span>`);
-		}
-		if (V.deltaSupply !== 0) {
-			if (V.supplyTimer - V.elapsedDemandTimer < 3) {
-						r.push(`but it might change soon`);
-			}
-		}
-		if (V.cheatMode) && (V.cheatModeM) {
-						<span id="menialSupplyFactor">
-							r.push(`<span class="yellowgreen">Slave Supply</span>`);
-				| ${V.menialSupplyFactor}
-						</span>
-			let _tMenialSupplyFactor = V.menialSupplyFactor;
-			<<textbox "_tMenialSupplyFactor" _tMenialSupplyFactor>>
-			<<link "Apply">>
-				V.menialSupplyFactor = Math.clamp(Math.trunc(Number(_tMenialSupplyFactor)),-50000,50000) || V.menialSupplyFactor, V.cheater = 1;
-				<<replace "#menialSupplyFactor">>
-					r.push(`<span class="yellowgreen"> Slave Supply</span>`);
-					| ${V.menialSupplyFactor}
-				<</replace>>
-			<</link>>
-		}
-	</div>
-
-				<div>
-					${MenialPopCap()}
-		r.push(`The parts of your arcology you own can house a total of ${num(${ V.PopCap)}} menial slaves.`);
-	</div>
-
-	let _menialPrice = menialSlaveCost();
-	let _bulkMax = V.PopCap-V.menials-V.fuckdolls-V.menialBioreactors;
-
-	<div>
-					if (V.menials > 1) {
-						r.push(`You own ${num(Math.trunc(${ V.menials))}} menial slaves.`);
-		} else if (V.menials > 0) {
-						r.push(`You own one menial ${slave.`);
-		}} else {
-			r.push(`You do not own any menial slaves.`);
-		}
-		r.push(`The market price of menials is ${cashFormat(_menialPrice)}.`);
-		let _optionsBreak = 0;
-		if (_bulkMax > 0 && V.cash > _menialPrice) {
-						[[Buy | Buy Slaves][V.menials += 1, V.menialSupplyFactor -= 1, cashX(forceNeg(_menialPrice), "menialTransfer")]]
-			if (V.cash > (menialSlaveCost(10))*10) {
-						[[(x10) | Buy Slaves][V.menials += 10, V.menialSupplyFactor -= 10, cashX(forceNeg((menialSlaveCost(10)) * 10), "menialTransfer")]]
-					}
-			if (V.cash > (menialSlaveCost(100))*100) {
-						[[(x100) | Buy Slaves][V.menials += 100, V.menialSupplyFactor -= 100, cashX(forceNeg((menialSlaveCost(100)) * 100), "menialTransfer")]]
-					}
-			if (V.cash > (_menialPrice+1)*2) {
-						let _menialBulkPremium = Math.trunc(1 + Math.clamp(V.cash/_menialPrice,0,_bulkMax)/400);
-				[[(max)|Buy Slaves][V.menials+=Math.trunc(Math.clamp(V.cash/(_menialPrice+_menialBulkPremium),0,_bulkMax)),V.menialSupplyFactor-=Math.trunc(Math.clamp(V.cash/(_menialPrice+_menialBulkPremium),0,_bulkMax)),cashX(forceNeg(Math.trunc(Math.clamp(V.cash/(_menialPrice+_menialBulkPremium),0,_bulkMax))*(_menialPrice+_menialBulkPremium)), "menialTransfer")]]
+		if (V.menialBioreactors > 1) {
+									r.push(`You own ${num(Math.trunc(${ V.menialBioreactors))}} standard bioreactors.`);
+} else if (V.menialBioreactors > 0) {
+									r.push(`You own one standard bioreactor.`);
+} else if (V.arcologies[0].FSPaternalist === "unset") {
+									r.push(`You do not own any standard bioreactors.`);
+}
+if (V.menialBioreactors > 0) || (V.arcologies[0].FSPaternalist === "unset") {
+									r.push(`The market price of standard bioreactors is ${cashFormat(_menialPrice - 100)}.`);
+	let _optionsBreak = 0;
+	if (_bulkMax > 0) {
+		if (V.arcologies[0].FSPaternalist === "unset" && V.cash > _menialPrice+100) {
+									[[Buy | Buy Slaves][V.menialBioreactors += 1, V.menialSupplyFactor -= 1, cashX(forceNeg(_menialPrice + 100), "menialBioreactors")]]
+			if (V.cash > (menialSlaveCost(10)-100)*10) {
+									[[(x10) | Buy Slaves][V.menialBioreactors += 10, V.menialSupplyFactor -= 10, cashX(forceNeg((menialSlaveCost(10) - 100) * 10), "menialBioreactors")]]
+								}
+			if (V.cash > (menialSlaveCost(100)-100)*100) {
+									[[(x100) | Buy Slaves][V.menialBioreactors += 100, V.menialSupplyFactor -= 100, cashX(forceNeg((menialSlaveCost(100) - 100) * 100), "menialBioreactors")]]
+								}
+			if (V.cash > (_menialPrice-99)*2) {
+									let _bioreactorBulkPremium = Math.trunc(1+ Math.clamp(V.cash/(_menialPrice-99),0,_bulkMax)/400);
+				[[(max)|Buy Slaves][V.menialBioreactors+=Math.trunc(Math.clamp(V.cash/(_menialPrice-99+_bioreactorBulkPremium),0,_bulkMax)),V.menialSupplyFactor-=Math.trunc(Math.clamp(V.cash/(_menialPrice-99+_bioreactorBulkPremium),0,_bulkMax)),cashX(forceNeg(Math.trunc(Math.clamp(V.cash/(_menialPrice-99+_bioreactorBulkPremium),0,_bulkMax))*(_menialPrice-99+_bioreactorBulkPremium)), "menialBioreactors")]]
 			}
 			//Bulk transactions may require offering a premium.//
 			let _optionsBreak = 1;
 		}
-		if (V.menials >= 1) {
-			if (_optionsBreak) {|
-	}
-			[[Sell|Buy Slaves][V.menials-=1,V.menialDemandFactor-=1,cashX(_menialPrice, "menialTransfer")]]
-			if (V.menials >= 10) {
-						[[(x10) | Buy Slaves][V.menials -= 10, V.menialDemandFactor -= 10, cashX(((menialSlaveCost(-10)) * 10), "menialTransfer")]]
-				if (V.menials >= 100) {
-						[[(x100) | Buy Slaves][V.menials -= 100, V.menialDemandFactor -= 100, cashX(((menialSlaveCost(-100)) * 100), "menialTransfer")]]
-					}
-			}
-			[[(all)|Buy Slaves][cashX((V.menials*(menialSlaveCost(-V.menials))), "menialTransfer"),V.menialDemandFactor-=V.menials,V.menials = 0]]
-			if (V.arcologies[0].FSPaternalist === "unset") {
-				if (V.arcadeUpgradeFuckdolls > 0) {
-						let _fConvertCost = 100;
-					<div class="indent">
-						[[Convert to Fuckdoll|Buy Slaves][V.menials-=1,V.fuckdolls+=1,cashX(forceNeg(_fConvertCost), "menialTransfer")]]
-						if (V.menials >= 10) {
-							[[(x10) | Buy Slaves][V.menials -= 10, V.fuckdolls += 10, cashX(forceNeg(10 * (_fConvertCost)), "menialTransfer")]]
-							if (V.menials >= 100) {
-							[[(x100) | Buy Slaves][V.menials -= 100, V.fuckdolls += 100, cashX(forceNeg(100 * (_fConvertCost)), "menialTransfer")]]
-						}
-						}
-						[[(all)|Buy Slaves][V.fuckdolls+=V.menials,cashX(forceNeg((_fConvertCost)*(V.menials)), "menialTransfer"),V.menials=0]]
-						//Conversion costs ${cashFormat(_fConvertCost)} each//
-					</div>
-				}
-				if (V.dairyFeedersUpgrade > 0) {
-						<div class="indent">
-							[[Convert to Bioreactor|Buy Slaves][V.menials-=1,V.menialBioreactors+=1,cashX(-100, "menialTransfer")]]
-						if (V.menials >= 10) {
-								[[(x10) | Buy Slaves][V.menials -= 10, V.menialBioreactors += 10, cashX(-1000, "menialTransfer")]]
-							if (V.menials >= 100) {
-								[[(x100) | Buy Slaves][V.menials -= 100, V.menialBioreactors += 100, cashX(-10000, "menialTransfer")]]
-							}
-						}
-						[[(all)|Buy Slaves][V.menialBioreactors+=V.menials,cashX(forceNeg(500*V.menials), "menialTransfer"),V.menials=0]]
-						//Conversion costs ${cashFormat(500)} each//
-					</div>
-					}
-			}
-		}
-	</div>
-
-				<div>
-					if (V.fuckdolls > 1) {
-						r.push(`You own ${num(Math.trunc(${ V.fuckdolls))}} standard Fuckdolls.`);
-		} else if (V.fuckdolls > 0) {
-						r.push(`You own one standard Fuckdoll.`);
-		} else if (V.arcologies[0].FSPaternalist === "unset") {
-						r.push(`You do not own any standard Fuckdolls.`);
-		}
-		if (V.fuckdolls > 0) || (V.arcologies[0].FSPaternalist === "unset") {
-						r.push(`The market price of standard Fuckdolls is ${cashFormat(_menialPrice)}.`);
-			let _optionsBreak = 0;
-			if (_bulkMax > 0) {
-				if (V.arcologies[0].FSPaternalist === "unset" && V.cash > _menialPrice) {
-						[[Buy | Buy Slaves][V.fuckdolls += 1, V.menialSupplyFactor -= 1, cashX(forceNeg(_menialPrice), "fuckdollsTransfer")]]
-					if (V.cash > menialSlaveCost(10)*10) {
-						[[(x10) | Buy Slaves][V.fuckdolls += 10, V.menialSupplyFactor -= 10, cashX(forceNeg(menialSlaveCost(10) * 10), "fuckdollsTransfer")]]
-					}
-					if (V.cash > menialSlaveCost(100)*100) {
-						[[(x100) | Buy Slaves][V.fuckdolls += 100, V.menialSupplyFactor -= 100, cashX(forceNeg(menialSlaveCost(100) * 100), "fuckdollsTransfer")]]
-					}
-					if (V.cash > ((_menialPrice+1)*2)) {
-						[[(max) | Buy Slaves][V.fuckdolls += Math.trunc(Math.clamp(V.cash / _menialPrice, 0, _bulkMax)), V.menialSupplyFactor -= Math.trunc(Math.clamp(V.cash / _menialPrice, 0, _bulkMax)), cashX(forceNeg(Math.trunc(Math.clamp(V.cash / _menialPrice, 0, _bulkMax)) * _menialPrice), "fuckdollsTransfer")]]
-					}
-					//Bulk transactions may require offering a premium.//
-					let _optionsBreak = 1;
-				}
-			}
-			if (V.fuckdolls >= 1) {
-				if (_optionsBreak) {|
 	}
-				[[Sell|Buy Slaves][V.fuckdolls-=1,V.menialDemandFactor-=1,cashX(_menialPrice, "fuckdollsTransfer")]]
-			if (V.fuckdolls >= 10) {
-						[[(x10) | Buy Slaves][V.fuckdolls -= 10, V.menialDemandFactor -= 10, cashX((menialSlaveCost(-10) * 10), "fuckdollsTransfer")]]
-				if (V.fuckdolls >= 100) {
-						[[(x100) | Buy Slaves][V.fuckdolls -= 100, V.menialDemandFactor -= 100, cashX((menialSlaveCost(-100) * 100), "fuckdollsTransfer")]]
-					}
-			}
-			[[(all)|Buy Slaves][cashX(V.fuckdolls*(menialSlaveCost(-V.fuckdolls)), "fuckdollsTransfer"),V.menialDemandFactor-=V.fuckdolls,V.fuckdolls = 0]]
-			}
-		}
-	</div>
-
-				<div>
-					if (V.menialBioreactors > 1) {
-						r.push(`You own ${num(Math.trunc(${ V.menialBioreactors))}} standard bioreactors.`);
-		} else if (V.menialBioreactors > 0) {
-						r.push(`You own one standard bioreactor.`);
-		} else if (V.arcologies[0].FSPaternalist === "unset") {
-						r.push(`You do not own any standard bioreactors.`);
+	if (V.menialBioreactors >= 1) {
+		if (_optionsBreak) {|
+}
+		[[Sell|Buy Slaves][V.menialBioreactors-=1,V.menialDemandFactor-=1,cashX((_menialPrice-100), "menialBioreactors")]]
+		if (V.menialBioreactors >= 10) {
+									[[(x10) | Buy Slaves][V.menialBioreactors -= 10, V.menialDemandFactor -= 10, cashX(((menialSlaveCost(-10) - 100) * 10), "menialBioreactors")]]
+			if (V.menialBioreactors >= 100) {
+									[[(x100) | Buy Slaves][V.menialBioreactors -= 100, V.menialDemandFactor -= 100, cashX(((menialSlaveCost(-100) - 100) * 100), "menialBioreactors")]]
+								}
 		}
-		if (V.menialBioreactors > 0) || (V.arcologies[0].FSPaternalist === "unset") {
-						r.push(`The market price of standard bioreactors is ${cashFormat(_menialPrice - 100)}.`);
-			let _optionsBreak = 0;
-			if (_bulkMax > 0) {
-				if (V.arcologies[0].FSPaternalist === "unset" && V.cash > _menialPrice+100) {
-						[[Buy | Buy Slaves][V.menialBioreactors += 1, V.menialSupplyFactor -= 1, cashX(forceNeg(_menialPrice + 100), "menialBioreactors")]]
-					if (V.cash > (menialSlaveCost(10)-100)*10) {
-						[[(x10) | Buy Slaves][V.menialBioreactors += 10, V.menialSupplyFactor -= 10, cashX(forceNeg((menialSlaveCost(10) - 100) * 10), "menialBioreactors")]]
-					}
-					if (V.cash > (menialSlaveCost(100)-100)*100) {
-						[[(x100) | Buy Slaves][V.menialBioreactors += 100, V.menialSupplyFactor -= 100, cashX(forceNeg((menialSlaveCost(100) - 100) * 100), "menialBioreactors")]]
-					}
-					if (V.cash > (_menialPrice-99)*2) {
-						let _bioreactorBulkPremium = Math.trunc(1+ Math.clamp(V.cash/(_menialPrice-99),0,_bulkMax)/400);
-						[[(max)|Buy Slaves][V.menialBioreactors+=Math.trunc(Math.clamp(V.cash/(_menialPrice-99+_bioreactorBulkPremium),0,_bulkMax)),V.menialSupplyFactor-=Math.trunc(Math.clamp(V.cash/(_menialPrice-99+_bioreactorBulkPremium),0,_bulkMax)),cashX(forceNeg(Math.trunc(Math.clamp(V.cash/(_menialPrice-99+_bioreactorBulkPremium),0,_bulkMax))*(_menialPrice-99+_bioreactorBulkPremium)), "menialBioreactors")]]
-					}
-					//Bulk transactions may require offering a premium.//
-					let _optionsBreak = 1;
-				}
-			}
-			if (V.menialBioreactors >= 1) {
-				if (_optionsBreak) {|
+		[[(all)|Buy Slaves][cashX((V.menialBioreactors*(menialSlaveCost(-V.menialBioreactors)-100)), "menialBioreactors"),V.menialDemandFactor-=V.menialBioreactors,V.menialBioreactors = 0]]
 	}
-				[[Sell|Buy Slaves][V.menialBioreactors-=1,V.menialDemandFactor-=1,cashX((_menialPrice-100), "menialBioreactors")]]
-				if (V.menialBioreactors >= 10) {
-						[[(x10) | Buy Slaves][V.menialBioreactors -= 10, V.menialDemandFactor -= 10, cashX(((menialSlaveCost(-10) - 100) * 10), "menialBioreactors")]]
-					if (V.menialBioreactors >= 100) {
-						[[(x100) | Buy Slaves][V.menialBioreactors -= 100, V.menialDemandFactor -= 100, cashX(((menialSlaveCost(-100) - 100) * 100), "menialBioreactors")]]
-					}
-				}
-				[[(all)|Buy Slaves][cashX((V.menialBioreactors*(menialSlaveCost(-V.menialBioreactors)-100)), "menialBioreactors"),V.menialDemandFactor-=V.menialBioreactors,V.menialBioreactors = 0]]
-			}
-		}
-	</div>*/
+}
+*/
 
diff --git a/src/markets/marketData.js b/src/markets/marketData.js
index 8a254bd790c..ec439a83ebd 100644
--- a/src/markets/marketData.js
+++ b/src/markets/marketData.js
@@ -1,18 +1,21 @@
+/**
+ * @typedef {Array<market>} marketCategory
+ * /
+
 /**
  * @typedef {object} market
  * @property {string} title
- * @property {string} passage
- * @property {string} marketType
+ * @property {string} [passage]
+ * @property {string} [marketType]
  * @property {string} [note]
  * @property {string} [sale]
- * @property {boolean} bulkAvailable=true
- * @property {boolean} requirements
+ * @property {boolean} [bulkAvailable=true]
+ * @property {boolean|string} [requirements] if requirements failed, may return string explaining why
  */
 
-
+/** @type {Object.<string, marketCategory>} */
 App.Data.Markets = {
-	/** @type {Array.<market>} */
-	starter: [
+	low: [
 		{
 			title: "Corporate Market",
 			passage: `Corporate Market`,
@@ -21,18 +24,239 @@ App.Data.Markets = {
 			sale: "",
 			bulkAvailable: true,
 			get requirements() { return (V.corp.Incorporated === 1); }
-		}
+		},
+		{
+			title: "The Flesh Heap",
+			marketType: "heap",
+			bulkAvailable: false,
+			note: `Broken and discarded slaves. Near useless, but cheap. No longer does bulk orders after complaints.`,
+		},
+		{
+			title: "Order a custom husk slave from the Flesh Heap",
+			passage: `Husk Slave`,
+			note: `Will need to be used on arrival.`,
+			get requirements() { return (V.bodyswapAnnounced === 1); }
+		},
+		{
+			title: "Kidnappers' Market",
+			passage: `Slave Markets`,
+			marketType: "kidnappers",
+			note: `Slaves will tend to be low quality and resistant.`,
+			get requirements() { return (V.rep > 500) ? true : `You are not reputable enough to buy kidnapped slaves.`; }
+		},
 	],
-	neighbors: {
-
-	},
-	intermediate: {
-
-	},
-	schools: {
-
-	},
-	advanced: {
-
-	}
+	intermediate: [
+		{
+			title: "Runaway Hunters' Market",
+			passage: `Slave Markets`,
+			marketType: "hunters",
+			note: "Slaves will tend to be skilled but rebellious.",
+			get requirements() { return (V.rep > 1000) ? true : `You are not reputable enough to buy recaptured slaves.`; }
+		},
+		{
+			title: "Indentures Market",
+			passage: `Slave Markets`,
+			marketType: "indentures",
+			note: "Temporary enslavement and restrictions on treatment.",
+			get requirements() { return (V.rep > 1500) ? true : `You are not reputable enough to buy indentured servants.`; }
+		},
+		{
+			title: "Raiders' Market",
+			passage: ``,
+			marketType: "raiders",
+			note: "Slaves will always be sold immediately upon reaching majority.",
+			get requirements() { return (V.rep > 2000) ? true : `You are not reputable enough to buy teenaged slaves.`; }
+		},
+		{
+			title: "Raiders' Black Market",
+			passage: ``,
+			marketType: "underage raiders",
+			note: "Very young slaves.",
+			get requirements() { return ((V.pedo_mode === 1 || (V.minimumSlaveAge <= 13 && V.minimumSlaveAge <= V.fertilityAge)) && V.rep > 3000) ? true : `You are not reputable enough to buy underaged slaves.`; }
+		},
+		{
+			title: "Trainers' Market",
+			passage: ``,
+			marketType: "trainers",
+			note: "Slaves will tend to be good quality and obedient.",
+			sale: "",
+			bulkAvailable: true,
+			get requirements() { return (V.rep > 4000) ? true : `You are not reputable enough to buy trained slaves.`; }
+		},
+		{
+			title: "Wetware CPUs",
+			passage: ``,
+			marketType: "wetware",
+			note: "Ruined bodies but keen minds. Requires some TLC, but offers outstanding training at a discount.",
+			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.`; }
+		},
+		{
+			title: "Prisoner Sale",
+			passage: `Criminal Market`,
+			get note() {
+				switch (V.prisonCircuit[V.prisonCircuitIndex]) {
+					case "low tier criminals":
+						return `Slaves will tend to be low to mid quality with few redeeming factors.`;
+					case "gangs and smugglers":
+						return `Slaves will tend to be low quality and difficult but may prove useful once broken.`;
+					case "white collar":
+						return `Slaves will tend to be medium to high quality with a variety of useful backgrounds.`;
+					case "military prison":
+						return `Slaves will tend to be high quality but defiant.`;
+					default:
+						return ``;
+				}
+			},
+			get sale() {
+				switch (V.prisonCircuit[V.prisonCircuitIndex]) {
+					case "low tier criminals":
+						return `a minor prison is selling inmates.`;
+					case "gangs and smugglers":
+						return `a major prison is selling hardened criminals.`;
+					case "white collar":
+						return `a white collar prison is selling inmates.`;
+					case "military prison":
+						return `a military prison is selling inmates.`;
+					default:
+						return ``;
+				}
+			},
+			get requirements() { return (V.rep > 5000) ? true : `You are not reputable enough to buy prison slaves.`; }
+		},
+	],
+	schools: [
+		{
+			title: "The Slavegirl School",
+			marketType: "TSS",
+			note: "Straightforward slaves with good training.",
+			get requirements() { return (V.seeDicks !== 100); }
+		},
+		{
+			title: "The Utopian Orphanage",
+			marketType: "TUO",
+			note: "Intelligent, unspoiled slaves just past their majority.",
+			get requirements() { return (V.seeDicks !== 100); }
+		},
+		{
+			title: "Growth Research Institute",
+			marketType: "GRI",
+			note: "Poorly trained slaves with huge assets.",
+			get requirements() { return (V.seeDicks !== 100); }
+		},
+		{
+			title: "St.Claver Preparatory",
+			marketType: "SCP",
+			note: "Slaves with basic training and solid implants.",
+			get requirements() { return (V.seeDicks !== 100); }
+		},
+		{
+			title: "The Cattle Ranch",
+			marketType: "TCR",
+			note: "Mentally conditioned free-range cowgirls.",
+			get requirements() { return (V.seeDicks !== 100); }
+		},
+		{
+			title: "The Hippolyta Academy",
+			marketType: "HA",
+			note: "High quality slaves of powerful physique and refined skills.",
+			get requirements() { return (V.seeDicks !== 100); }
+		},
+		{
+			title: "L'École des Enculées",
+			marketType: "LDE",
+			note: "Slaves optimized and trained for anal.",
+			get requirements() { return (V.seeDicks !== 0); }
+		},
+		{
+			title: "The Gymnasium - Academy",
+			marketType: "TGA",
+			note: "Well trained slaves with dicks.",
+			get requirements() { return (V.seeDicks !== 0); }
+		},
+		{
+			title: "The Futanari Sisters",
+			marketType: "TFS",
+			note: "Highly skilled, highly feminine hermaphrodites.",
+			get requirements() { return (V.seeDicks !== 0); }
+		},
+		{
+			title: "Nueva Universidad de Libertad",
+			marketType: "NUL",
+			note: "Androgynous slaves lacking genitalia.",
+		},
+	],
+	high: [
+		{
+			title: "Take in a shelter slave",
+			passage: `Slave Shelter`,
+			marketType: "",
+			note: "Presents charity cases for a nominal fee.",
+			bulkAvailable: true,
+			get requirements() {
+				if (V.arcologies[0].FSDegradationist !== "unset") {
+					return `The Slave Shelter does not place slaves into Degradationist arcologies.`;
+				} else if ((V.shelterAbuse > 10)) {
+					return `The Slave Shelter has banned you due to dark rumors about you.`;
+				} else if ((V.shelterAbuse > 5)) {
+					return `The Slave Shelter has banned you due to rumors that you resell its slaves.`;
+				} else if ((V.shelterSlaveBought === 1)) {
+					return `The Slave Shelter will not offer another slave for placement until next week.`;
+				} else if (V.rep > 7000) {
+					return true;
+				} else {
+					return `You are not reputable enough to take in Shelter slaves`;
+				}
+			}
+		},
+		{
+			title: "Consult the household liquidator",
+			passage: `Household Liquidator`,
+			marketType: "",
+			note: "Offers slaves close to one another at a very high price.",
+			bulkAvailable: false,
+			get requirements() { return (V.rep > 8000) ? true : `You are not reputable enough to consult the household liquidator.`; }
+		},
+		{
+			title: "Place a special order",
+			passage: `Custom Slave`,
+			marketType: "",
+			note: "Customizable but very expensive.",
+			bulkAvailable: false,
+			get requirements() { return (V.rep > 10000) ? true : `You are not reputable enough to order custom slaves.`; }
+		},
+		{
+			title: "Place a fulfillment order",
+			passage: `JobFulfillmentCenterOrder`,
+			marketType: "",
+			note: "Fills leaderships roles for a price.",
+			bulkAvailable: false,
+			get requirements() { return (V.rep > 10000); }
+		},
+		{
+			title: "Attend an auction of a prestigious slave",
+			passage: `Prestigious Slave`,
+			marketType: "",
+			note: "Variable and expensive.",
+			bulkAvailable: false,
+			get requirements() { return (V.rep > 12000) ? true : `You are not reputable enough to bid on prestigious slaves.`; }
+		},
+		{
+			title: "Attend an auction of other Elite's stock",
+			passage: `Elite Slave`,
+			marketType: "",
+			note: "Limited and very expensive.",
+			bulkAvailable: false,
+			get requirements() { return (V.propOutcome === 1); }
+		},
+		{
+			title: "Acquire other slaveowners' stock",
+			passage: `Special Slave`,
+			marketType: "",
+			note: "Variable and expensive",
+			bulkAvailable: false,
+			get requirements() { return (V.rep > 14000) ? true : `You are not reputable enough to acquire other slaveowners' stock.`; }
+		},
+	]
 };
-- 
GitLab