code:
/* OPEN MAIN */
App.UI.View.MainLinks = function() {
	"use strict";
	const V = State.variables;
	const PA = Array.isArray(V.personalAttention) ? V.personalAttention.map(x => getSlave(x.ID)) : [];
	let r = '';

	if (V.PCWounded === 1) {
		r += `The injuries received in the recent battle prevent you from undertaking tiring efforts.`;
	} else {
		switch (V.personalAttention) {
			case "business":
				r += `You plan to focus on business this week.`;
				break;
			case "whoring":
				r += `You plan to focus on earning extra money this week.`;
				break;
			case "upkeep":
				r += `You plan to focus on cleaning the penthouse this week.`;
				break;
			case "smuggling":
				r += `You plan to make some easy (but dirty) money this week.`;
				break;
			case "HG":
				r += `You plan to support your Head Girl this week, `;
				if (V.HeadGirl) {
					const pronouns = getPronouns(V.HeadGirl);
					r += `so ${pronouns.pronoun} can give more slaves ${pronouns.possessive} attention.`;
				} else {
					r += `should you assign one.`;
				}
				break;
			case "sex":
				r += `You plan to have as much sex with your slaves as possible this week.`;
				break;
			case "trading":
				r += `This week you will learn trading.`;
				break;
			case "warfare":
				r += `This week you will learn modern combat tactics.`;
				break;
			case "slaving":
				r += `This week you will learn slaving.`;
				break;
			case "engineering":
				r += `This week you will learn engineering.`;
				break;
			case "medicine":
				r += `This week you will learn medicine.`;
				break;
			case "hacking":
				r += `This week you will learn hacking.`;
				break;
			case "proclamation":
				r += `This week you plan to issue a proclamation about ${V.proclamationType}.`;
				break;
			case "technical accidents":
				r += `This week you plan to sell your technical skills to the highest bidder.`;
				break;
			default:
				if (PA.length > 0) {
					r += `You plan to train `;
					let l = PA.length;
					for (let dwi = 0; dwi < l; dwi++) {
						if (dwi > 0 && dwi === l - 1) {
							r += ` and `;
						}
						r += `<strong><u><span class="pink">${SlaveFullName(PA[dwi])}</span></u></strong> to ${V.personalAttention[dwi].trainingRegimen}`;
						if (dwi > 0 && dwi < l - 2) {
							r += `,`;
						}
					}
					r += ` this week.`;
				}
				break;
		}
	}

	if (V.PCWounded !== 1) {
		r += ` <span id="managePA"><strong><<link "Change plans">><<goto "Personal Attention Select">><</link>></strong></span> <span class="cyan">[A]</span>`;
	}

	if (V.useSlaveSummaryOverviewTab !== 1) {
		if (typeof V.slaveIndices[V.HeadGirl.ID] !== 'undefined') {
			r += `<br><strong><u><span class="pink">${SlaveFullName(V.HeadGirl)}</span></u></strong> is serving as your Head Girl`;
			if (V.arcologies[0].FSEgyptianRevivalistLaw === 1) {
				r += ` and Consort`;
			}
			r += `. <span id="manageHG"><strong><<link "Manage Head Girl">><<goto "HG Select">><</link>></strong></span> <span class="cyan">[H]</span>`;
		} else if (typeof V.slaveIndices[V.HeadGirl.ID] === 'undefined' && (V.slaves.length > 1)) {
			r += `<br>You have not selected a Head Girl`;
			if (V.arcologies[0].FSEgyptianRevivalistLaw === 1) {
				r += ` and Consort`;
			}
			r += `. <span id="manageHG"><strong><<link "Select one">><<goto "HG Select">><</link>></strong></span> <span class="cyan">[H]</span>`;
		} else if (typeof V.slaveIndices[V.HeadGirl.ID] === 'undefined') {
			r += `//<br>You do not have enough slaves to keep a Head Girl//`;
		}
		r += `<br>`;

		if (typeof V.slaveIndices[V.Recruiter.ID] !== 'undefined') {
			r += `${SlaveFullName(V.Recruiter)} is working to recruit girls. <<link "Manage Recruiter">><<goto "Recruiter Select">><</link>> [U]`;
		} else {
			r += `You have not selected a Recruiter. <span id="manageRecruiter"><strong><<link "Select one">><<goto "Recruiter Select">><</link>></strong></span> <span class="cyan">[U]</span>`;
		}

		if (V.dojo) {
			r += `<br>`;
			if (typeof V.slaveIndices[V.Bodyguard.ID] !== 'undefined') {
				r += `${SlaveFullName(V.Bodyguard)} is serving as your bodyguard. <<link "Manage Bodyguard">><<goto "BG Select">><</link>> [B]`;
			} else {
				r += `You have not selected a Bodyguard. <span id="manageBG"><strong><<link "Select one">><<goto "BG Select">><</link>></strong></span> <span class="cyan">[B]</span>`;
			}
		}
	}

	if (V.completedOrgans.length > 0) {
		/* first remove any organs with no corresponding slave */
		V.completedOrgans = V.completedOrgans.filter(organ => {
			return (typeof organ === 'object' && getSlave(organ.ID) !== undefined);
		});
		/* cycle through slaves, for each slave cycle through completed organs and track how many are of the interrogated slave (and if organs have a slaves to be implanted on) */
		for (let i = 0; i < V.slaves.length; i++) {
			let slaveOrgans = 0;
			V.completedOrgans.forEach(organ => { if (organ.ID === V.slaves[i].ID) { slaveOrgans++; } });
			/* if the interrogated slave has one or more organs ready: */
			if (slaveOrgans > 0) {
				r += '
The fabricator has completed ';
				if (slaveOrgans > 1) {
					r += `${slaveOrgans} organs`;
				} else {
					r += 'an organ';
				}
				r += ` for </span><<link "<<print $slaves[${i}].slaveName>>">><<set $activeSlave = $slaves[${i}]>><<goto "Slave Interact">><</link>>, <span class="yellow"> which `;
				if (slaveOrgans > 1) {
					r += 'are';
				} else {
					r += 'is';
				}
				r += ' ready to be implanted.';
			}
		}
	}

	if (V.adjustProstheticsCompleted > 0) {
		for (let j = 0; j < V.adjustProsthetics.length; j++) {
			if (getSlave(V.adjustProsthetics[j].slaveID) !== undefined) {
				const i = V.slaveIndices[V.adjustProsthetics[j].slaveID];
				if (V.adjustProsthetics[j].workLeft <= 0) {
					r += `
The lab has completed <<= addA(setup.prosthetics[$adjustProsthetics[${j}].id].name)>> for <<= "[[SlaveFullName($slaves[${i}])|Slave Interact][$activeSlave = $slaves[${i}]]]">>,  which is ready to be attached.`;
				}
			} else {
				V.adjustProsthetics.splice(j, 1);
				j--;
			}
		}
	}

	if (V.completedOrgans.length > 0 && V.adjustProstheticsCompleted > 0) {
		r += `<br>[[Implant and Attach|Multiple Organ Implant]] <span class="yellow">all organs and prosthetics that are ready.</span>`;
	} else if (V.completedOrgans.length > 0) {
		r += `<br>[[Implant|Multiple Organ Implant]] <span class="yellow">all organs that are ready for implantation.</span>`;
	} else if (V.adjustProstheticsCompleted > 0) {
		r += `<br>[[Attach|Multiple Organ Implant]] <span class="yellow">all prosthetics that are ready to be attached.</span>`;
	}

	if (V.slaveCostFactor > 1.05) {
		r += `<br><span class="yellow">There is a bull market for slaves; the price of slaves is very high.</span>`;
	} else if (V.slaveCostFactor > 1) {
		r += `<br><span class="yellow">The slave market is bullish; the price of slaves is high.</span>`;
	} else if (V.slaveCostFactor < 0.95) {
		r += `<br><span class="yellow">There is a bear market for slaves; the price of slaves is very low.</span>`;
	} else if (V.slaveCostFactor < 1) {
		r += `<br><span class="yellow">The slave market is bearish; the price of slaves is low.</span>`;
	} else {
		r += `<br>The slave market is stable; the price of slaves is average.`;
	}

	r += ` <span id="buySlaves"><strong><<link "Buy Slaves">><<goto "Buy Slaves">><</link>></strong></span> <span class="cyan">[S]</span>`;
	if (V.seeDicks !== 100) {
		if (V.TSS.schoolSale !== 0) {
			r += `<br><span class="yellow">For your first purchase, </span><strong>[[The Slavegirl School][$slavesSeen += 1]]</strong><span class="yellow"> will sell at half price this week.</span>`;
		}
		if (V.GRI.schoolSale !== 0) {
			r += `<br><span class="yellow">For your first purchase, </span><strong>[[Growth Research Institute][$slavesSeen += 1]]</strong><span class="yellow"> will sell at half price this week.</span>`;
		}
		if (V.SCP.schoolSale !== 0) {
			r += `<br><span class="yellow">For your first purchase, </span><strong>[[St. Claver Preparatory][$slavesSeen += 1]]</strong><span class="yellow"> will sell at half price this week.</span>`;
		}
		if (V.TCR.schoolSale !== 0) {
			r += `<br><span class="yellow">For your first purchase, </span><strong>[[The Cattle Ranch][$slavesSeen += 1]]</strong><span class="yellow"> will sell at half price this week.</span>`;
		}
		if (V.HA.schoolSale !== 0) {
			r += `<br><span class="yellow">For your first purchase, </span><strong>[[The Hippolyta Academy][$slavesSeen += 1]]</strong><span class="yellow"> will sell at half price this week.</span>`;
		}
	}
	if (V.seeDicks !== 0) {
		if (V.LDE.schoolSale !== 0) {
			r += `<br><span class="yellow">For your first purchase, </span><strong>[[L'École des Enculées][$slavesSeen += 1]]</strong><span class="yellow"> will sell at half price this week.</span>`;
		}
		if (V.TGA.schoolSale !== 0) {
			r += `<br><span class="yellow">For your first purchase, </span><strong>[[The Gymnasium-Academy][$slavesSeen += 1]]</strong><span class="yellow"> will sell at half price this week.</span>`;
		}
		if (V.TFS.schoolSale !== 0) {
			r += `<br><span class="yellow">For your first purchase, </span><strong>[[The Futanari Sisters][$slavesSeen += 1]]</strong><span class="yellow"> will sell at half price this week.</span>`;
		}
	}
	if (V.NUL.schoolSale !== 0) {
		r += `<br><span class="yellow">For your first purchase, </span><strong>[[Nueva Universidad de Libertad][$slavesSeen += 1]]</strong><span class="yellow"> will sell at half price this week.</span>`;
	}
	return r;
};
/* CLOSE MAIN */


code:
/* OPEN TOYCHEST */
App.Interact.ToyChest = function(slave) {
	"use strict";
	const V = State.variables;
	let r = ``;
	/* eslint-disable */
	let pronouns = getPronouns(slave);
	let he = pronouns.pronoun;
	let him = pronouns.object;
	let his = pronouns.possessive;
	let hers = pronouns.possessivePronoun;
	let himself = pronouns.objectReflexive;
	let boy = pronouns.noun;
	let He = capFirstChar(he);
	let His = capFirstChar(his);
	/* eslint-enable */

	r = `${slave.slaveName} `;
	if (slave.fuckdoll) {
		r += `is waiting for use nearby. `;
	} else if (slave.fetish === "mindbroken") {
		if (canSmell(slave) && slave.career === "a breeding bull" && isPlayerFertile(V.PC) && canPenetrate(slave)) {
			r += `is rock hard and sniffing the air. `;
		} else {
			r += `is waiting dumbly nearby. `;
		}
	} else if (slave.devotion > 50) {
		if (slave.toyHole === "mouth") {
			r += `has positioned ${himself} nearby with ${his} mouth conveniently `;
			if (V.PC.dick) {
				r += `at cock level. `;
			} else {
				r += `level with your pussy. `;
			}
		} else if (slave.toyHole === "boobs") {
			r += `is kneeling nearby with ${his} chest thrust out as far as it will go. `;
		} else if (slave.toyHole === "pussy" && !slave.amp) {
			r += `is kneeling on the couch with legs apart to present ${his} pussy. `;
		} else if (slave.toyHole === "pussy") {
			r += `is lying on the couch with ${his} pussy ready for you. `;
		} else if (slave.toyHole === "ass" && !slave.amp) {
			r += `is lying on the couch with ${his} legs up and back to present ${his} butthole. `;
		} else if (slave.toyHole === "ass") {
			r += `is lying on the couch with ${his} butt ready for you. `;
		} else if (slave.toyHole === "dick") {
			r += `is lying on the couch with ${his} dick at the ready for you. `;
		} else {
			r += `is nearby, eagerly presenting ${himself}. `;
		}
	} else if (slave.trust < -20) {
		r += `is waiting nearby in terror, hoping obedience will save ${him} from punishment. `;
	} else if (slave.devotion < -90) {
		r += `is hogtied nearby for sexual abuse. `;
	} else if (slave.devotion < -50) {
		r += `is restrained nearby for sexual use. `;
	} else if (slave.devotion < -20) {
		r += `is unhappily waiting nearby for sexual use. `;
	} else if (slave.devotion <= 20) {
		r += `is obediently waiting nearby for sexual use. `;
	} else if (slave.devotion <= 50) {
		r += `has positioned ${himself} nearby to offer you ${his} body. `;
	}
	let pose = jsRandom(1, 100);
	if (slave.fuckdoll) {
		r += `${His} holes are, as always, available. `;
	} else if (slave.fetish === "mindbroken") {
		r += `${He} ignores ${his} clothing, regarding it as an impediment to ${his} purpose. `;
	} else {
		switch (slave.clothes) {
			case "shibari ropes":
				r += `You've tied ${his} shibari bindings so that ${he}'s forced to thrust out ${his} chest. `;
				break;
			case "uncomfortable straps":
				if (pose > 75) {
					r += `${His} leather straps are forcing ${him} to thrust out ${his} tits. `;
				} else if (pose > 50) {
					r += `${His} leather straps are uncomfortably pressing ${his} breasts and asscrack. `;
				} else if (pose > 25) {
					r += `The rings in ${his} leather straps over each nipple and hole make ${him} look like a perfect fucktoy. `;
				} else {
					r += `${His} uncomfortable straps force ${him} to constantly present ${his} holes. `;
				}
				break;
			case "restrictive latex":
			case "a latex catsuit":
				r += `${His} complete suit of latex makes ${him} a nice, artistic display, a plastic work of art in the shape of a female form.`;
				break;
			case "a military uniform":
				r += `${His} uniformed presence lends your office the air of a military command center.`;
				break;
			case "a schutzstaffel uniform":
				r += `${His} uniformed presence lends your office the air of a military command center.`;
				break;
			case "a slutty schutzstaffel uniform":
				r += `${His} uniformed presence lends your office the air of a military command center.`;
				break;
			case "a red army uniform":
				r += `${His} uniformed presence lends your office the air of a military command center.`;
				break;
			case "a long qipao":
				r += `${His} elegant qipao lends your office an air of traditional opulence and prestige.`;
				break;
			case "battlearmor":
				r += `${His} armored presence lends your office the air of a battlefield command center.`;
				break;
			case "a mounty outfit":
				r += `${His} uniformed presence lends your office the air of a police command center.`;
				break;
			case "a dirndl":
				r += `${His} dirndl lends a traditional atmosphere to your office.`;
				break;
			case "lederhosen":
				r += `${His} lederhosen lends a traditional atmosphere to your office.`;
				break;
			case "a biyelgee costume":
				r += `${His} biyelgee costume lends a festive atmosphere to your office.`;
				break;
			case "a mini skirt":
				r += `${His} flattering mini dress makes ${him} the perfect office ornament for the modern captain of industry.`;
				break;
			case "a nice nurse outfit":
				r += `${His} proper nurse's outfit gives the office a clinical air.`;
				break;
			case "a fallen nuns habit":
				r += `${His} latex parody of a nuns habit gives the office a sacrilegious air.`;
				break;
			case "a chattel habit":
				r += `${His} chattel habit makes the office look like what it is: the inner sanctum of a new and deeply sensual faith.`;
				break;
			case "a penitent nuns habit":
				r += `${His} sackcloth habit gives the office a somber air.`;
				break;
			case "attractive lingerie":
				r += `${He}'s wearing classy lingerie, making ${him} an unusually refined ornament to the office.`;
				break;
			case "kitty lingerie":
				r += `${His} cat-themed lingerie gives the office a bizarrely innocent air of perversion.`;
				break;
			case "a succubus outfit":
				r += `${He}'s dressed to look like a succubus. There is a <<if $PC.title == 1>>demon<<else>>demoness<</if>> in this office, and ${he} serves _himP.`;
				break;
			case "spats and a tank top":
				r += `${He}'s wearing spats and a tank top, giving the office the active air of a gym.`;
				break;
			case "a string bikini":
				r += `${He}'s wearing a string bikini, making ${him} a sexy, enticing office ornament.`;
				break;
			case "a scalemail bikini":
				r += `${His} scalemail bikini gives the office a medieval air.`;
				break;
			case "striped panties":
			case "a striped bra":
			case "striped underwear":
				r += `${He}'s wearing cute underwear, making ${him} a sexy, innocent-looking office ornament.`;
				break;
			case "attractive lingerie for a pregnant woman":
				r += `${His} breasts gently spill out of ${his} slightly too small top.`;
				if (slave.lactation) {
					r += `${His} leaking nipples have rendered ${his} top see-through.`;
				}
				break;
			case "a maternity dress":
				r += `${His} low cut dress reveals ample cleavage.`;
				break;
			case "stretch pants and a crop-top":
				r += `${His} comfortable clothes give your office a laid back air and are easy to slip off when the mood strikes.`;
				break;
			case "a cheerleader outfit":
				r += `${He}'s wearing a slutty cheerleader outfit, making it look like ${he}'s here to fuck before team practice.`;
				break;
			case "clubslut netting":
				r += `${He}'s wearing slutty netting and headphones so ${he} can dance to music without annoying visitors.`;
				break;
			case "cutoffs and a t-shirt":
				r += `${He}'s wearing cutoffs and a t-shirt, making ${him} a fun, clean office ornament.`;
				break;
			case "a slutty nurse outfit":
				r += `${He}'s wearing a slutty nurse outfit, and looks more than ready to minister to any patient's needs.`;
				break;
			case "a schoolgirl outfit":
				r += `${He}'s wearing a slutty schoolgirl outfit, and looks ready to do whatever it takes to improve ${his} grades.`;
				break;
			case "a kimono":
				r += `${He}'s wearing a kimono, lending your office an air of elegance, though ${he} lacks some of the air of the true yamato nadeshiko.`;
				break;
			case "a burkini":
				r += `${He}'s wearing a colorful burkini, lending your office a vague air of conservatism.`;
				break;
			case "a hijab and blouse":
				r += `${He}'s wearing a modest hijab and blouse, lending your office a certain air of conservatism.`;
				break;
			case "a hijab and abaya":
				r += `${He}'s wearing a modest hijab and abaya, lending your office a certain air of conservatism.`;
				break;
			case "a niqab and abaya":
				r += `${He}'s wearing a niqab and abaya, lending your office an air of conservatism.`;
				break;
			case "a klan robe":
			case "a slutty klan robe":
				r += `${He}'s wearing a ku klux klan robe, lending your office an air of conservatism.`;
				break;
			case "a burqa":
				r += `${He}'s wearing an all-concealing burqa, lending your office an intense air of conservatism.`;
				break;
			case "battledress":
				r += `${He}'s wearing skimpy battledress, making your office seem a little like the ideal bunker for a survivalist.`;
				break;
			case "a slutty outfit":
				if (slave.actualAge < 21) {
					r += `${He}'s wearing a schoolgirl uniform and sucking on hard candy, giving ${him} a delectably youthful appearance.`;
				} else if (slave.actualAge < 30) {
					r += `${He}'s chosen to wear a slutty nurse outfit, and looks more than ready to minister to any patient's needs.`;
				} else if (slave.actualAge < 40) {
					// TODO: is this supposed to be the same as the one above?
					r += `${He}'s wearing a schoolgirl uniform and sucking on hard candy, a delightfully perverse outfit for a slave in ${his} thirties.`;
				} else {
					r += `${He}'s wearing a wifely apron that covers ${his} front, but leaves ${his} backside bare, an appropriate outfit for a slave in ${his} forties.`;
				}
				break;
			case "a halter top dress":
				r += `The gorgeous halter top dress ${he}'s wearing is almost a work of art.`;
				break;
			case "a ball gown":
				r += `The fabulous silken ball gown ${he}'s wearing lifts the entire atmosphere.`;
				break;
			case "a slave gown":
				r += `The gorgeous gown ${he}'s wearing lends an air of class to the office.`;
				break;
			case "slutty business attire":
				r += `The suit ${he}'s wearing would make it look like ${he}'s here to do business, if not for the extreme shortness of the skirt and ${his} acre of cleavage.`;
				break;
			case "nice business attire":
				r += `The suit ${he}'s wearing makes it look like ${he}'s here to do business, not fuck.`;
				break;
			case "a comfortable bodysuit":
				r += `The bodysuit ${he}'s wearing displays ${his} every fuckable curve.`;
				break;
			case "a leotard":
				r += `The leotard ${he}'s wearing is tight enough to advertise every detail.`;
				break;
			case "a monokini":
				r += `${His} topless swimsuit gives the office a perverted yet cultured aura.`;
				break;
			case "an apron":
				r += `${His} apron makes the office an intimate air, especially since ${he}'s nude underneath it.`;
				break;
			case "a cybersuit":
				r += `${His} cybersuit lends to an impersonal but sexual atmosphere, as ${his} delicious curves are prominently displayed.`;
				break;
			case "a bunny outfit":
				r += `The bunny outfit ${he}'s wearing makes ${him} look ready to serve drinks and suck dick.`;
				break;
			case "a slutty maid outfit":
				r += `${His} maid outfit makes ${him} look useful and sexually easy.`;
				break;
			case "a nice maid outfit":
				r += `${His} maid outfit makes ${his} servitude obvious while not looking too lewd.`;
				break;
			case "harem gauze":
				r += `${His} harem girl outfit lends ${his} corner of your office an Eastern opulence.`;
				break;
			case "slutty jewelry":
				r += `The bangles ${he}'s wearing make little noises every time ${he} moves, serving as a constant reminder of ${his} sexual availability.`;
				break;
			case "conservative clothing":
				r += `${His} clothes make it look like ${he}'s here for some other purpose than sexual slavery.`;
				break;
			case "chains":
				r += `${His} chains make it obvious that ${he}'s here as an office sex toy.`;
				break;
			case "Western clothing":
				r += `${His} Western clothing is comically out of place in a modern office.`;
				break;
			case "overalls":
				r += `${His} worker's overalls make it clear that you're the boss and ${he} is your subordinate.`;
				break;
			case "body oil":
				r += `${His} body oil makes ${his} muscles a lovely ornament to the office, and makes all ${his} holes nice and inviting.`;
				break;
			case "a toga":
			case "a hanbok":
				r += `${His} toga lends an air of antiquity to the office.`;
				break;
			case "a huipil":
				r += `${His} revealing huipil is a delightfully exotic novelty in your office.`;
				break;
			case "a slutty qipao":
				r += `${His} lovely qipao is a delicious contradiction of conservative silk patterns and scandalously high cuts.`;
				break;
			case "a bra":
			case "a button-up shirt":
			case "a button-up shirt and panties":
			case "a sweater":
			case "a sweater and cutoffs":
			case "a sweater and panties":
			case "a t-shirt":
			case "a t-shirt and jeans":
			case "a t-shirt and panties":
			case "a t-shirt and thong":
			case "a tank-top":
			case "a tank-top and panties":
			case "a thong":
			case "a tube top":
			case "a tube top and thong":
			case "an oversized t-shirt":
			case "an oversized t-shirt and boyshorts":
			case "boyshorts":
			case "cutoffs":
			case "jeans":
			case "leather pants":
			case "leather pants and a tube top":
			case "leather pants and pasties":
			case "panties":
			case "panties and pasties":
			case "pasties":
				r += `${His} purpose as your office sex toy is prominently displayed by ${his} revealing outfit.`;
				break;
			case "a gothic lolita dress":
				r += `${His} gothic lolita dress lends a cute but dark old world charm to your office.`;
				break;
			case "a police uniform":
				r += `${His} police uniform lends an air of security and authority to your office.`;
				break;
			case "a one-piece swimsuit":
				r += `${His} one-piece swimsuit lends your office a more casual atmosphere.`;
				break;
			case "a nice pony outfit":
			case "a slutty pony outfit":
				r += `${His} bondage pony outfit reinforces the atmosphere of submission to your will.`;
				break;
			case "a sports bra":
			case "sport shorts and a t-shirt":
			case "sport shorts and a sports bra":
			case "sport shorts":
				r += `${His} athletic clothing gives the office a more youthful vibe.`;
				break;
			case "a skimpy loincloth":
				r += `${His} skimpy loincloth gives the office a more barbaric and raw atmosphere.`;
				break;
			case "a Santa dress":
				r += `${His} skimpy dress somehow makes you seem more charitable and jovial than you really are.`;
				break;
			default:
				if (slave.chastityVagina && slave.chastityAnus) {
					r += `${His} chastity belt covers and protects both ${his} vagina and anus, but leaves ${his} breasts naked and ${his} mouth available.`;
				} else if (slave.chastityVagina) {
					r += `${His} chastity belt covers and protects ${his} pussy, but leaves ${his} breasts naked, ${his} mouth available, and ${his} asshole vulnerable.`;
				} else if (slave.chastityAnus) {
					r += `${His} chastity belt covers and protects ${his} anus, but leaves ${his} breasts naked, ${his} mouth available, and ${his} pussy vulnerable.`;
				} else {
					r += `${He}'s nude and ready to be fucked.`;
				}
				break;
		}
	}
	return r;
};

repo_name: KelioSteel/fc


code:
/* OPEN USEGUARD */
App.Interact.UseGuard = function(slave) {
	"use strict";
	let r = ``;
	/* eslint-disable */
	let pronouns = getPronouns(slave);
	let he = pronouns.pronoun;
	let him = pronouns.object;
	let his = pronouns.possessive;
	let hers = pronouns.possessivePronoun;
	let himself = pronouns.objectReflexive;
	let boy = pronouns.noun;
	let He = capFirstChar(he);
	let His = capFirstChar(his);
	/* eslint-enable */

	r = `${slave.slaveName} is standing behind your left shoulder, guarding your person. `;
	switch (slave.clothes) {
		case "attractive lingerie":
			r += `${His} lacy lingerie contrasts with ${his} deadly weaponry.`;
			break;
		case "a succubus outfit":
			r += `${His} succubus outfit and impressive weapons make ${him} look like a character from an overwrought graphic novel.`;
			break;
		case "uncomfortable straps":
			r += `${His} uncomfortable straps make ${him} look like a classical slave warrior.`;
			break;
		case "shibari ropes":
			r += `${His} shibari ropes make ${him} look like an insane slave fighter.`;
			break;
		case "restrictive latex":
		case "a latex catsuit":
			r += `${His} complete suit of latex gives ${him} a beautiful yet intimidating appearance.`;
			break;
		case "a nice nurse outfit":
			r += `${His} practical nurse's outfit make ${his} weapons look like surgical instruments of death.`;
			break;
		case "a military uniform":
			r += `${His} military uniform is most befitting of an honor guard.`;
			break;
		case "a schutzstaffel uniform":
			r += `${His} military uniform is most befitting of an honor guard.`;
			break;
		case "a slutty schutzstaffel uniform":
			r += `${His} military uniform is most befitting of an honor guard and your personal whore.`;
			break;
		case "a red army uniform":
			r += `${His} military uniform is most befitting of an honor guard.`;
			break;
		case "a long qipao":
			r += `${His} elegant qipao makes ${him} seem less deadly than ${he} actually is.`;
			break;
		case "battlearmor":
			r += `${His} battlearmor means ${he}'s always ready for combat.`;
			break;
		case "a mounty outfit":
			r += `${His} mounty outfit only enhances ${his} authority as your personal guard.`;
			break;
		case "a police uniform":
			r += `${His} police uniform only enhances ${his} authority as your personal guard.`;
			break;
		case "a gothic lolita dress":
			r += `${His} elegant dress makes ${him} seem less deadly than ${he} actually is.`;
			break;
		case "a dirndl":
			r += `${His} dirndl allows ${him} to hide all sorts of useful weapons against ${his} bare thighs.`;
			break;
		case "lederhosen":
			r += `${His} weapon hangs from a shoulder sling over ${his} lederhosen.`;
			break;
		case "a biyelgee costume":
			r += `${His} biyelgee costume makes ${him} appear as an athletic specimen, ready to defend you in hand-to-hand combat.`;
			break;
		case "a mini dress":
			r += `${His} revealing mini dress and elegant weapons make ${him} look sexy, yet deadly.`;
			break;
		case "a monokini":
			r += `${His} monokini's unrepressed appearance clashes amusingly with ${his} deadly weapons.`;
			break;
		case "an apron":
			r += `${He}'s nude, aside from an apron and the holsters for ${his} numerous weapons.`;
			break;
		case "overalls":
			r += `${His} overalls and armaments make ${him} look like ${he}'s ready to shoot some varmints.`;
			break;
		case "a cybersuit":
			r += `${His} cybersuit makes ${him} look sleek, sexy, and deadly. A perfect femme fatale.`;
			break;
		case "clubslut netting":
			r += `${His} club netting's slutty appearance clashes amusingly with ${his} deadly weapons.`;
			break;
		case "a string bikini":
			r += `${His} string bikini's flirty appearance clashes amusingly with ${his} deadly weapons.`;
			break;
		case "a scalemail bikini":
			r += `${His} scalemail bikini's barbaric appearance meshes well with ${his} sword, but clashes with ${his} firearms.`;
			break;
		case "striped panties":
			r += `${He}'s nude, aside from some cute panties and the holsters for ${his} numerous weapons.`;
			break;
		case "a slutty outfit":
			if (slave.actualAge < 21) {
				r += `${He}'s wearing a schoolgirl uniform and sucking on hard candy, making ${him} look like a character from a kung-fu film.`;
			} else if (slave.actualAge < 30) {
				r += `${He}'s chosen to wear a catsuit, and looks like a fictional heroine.`;
			} else if (slave.actualAge < 40) {
				// TODO: should this one be the same as the one above?
				r += `${He}'s wearing a schoolgirl uniform and sucking on hard candy, making ${him} look like a character from a kung-fu film.`;
			} else {
				r += `${He}'s wearing a wifely dress, creating a discordant effect with ${his} weapons.`;
			}
			break;
		case "a cheerleader outfit":
			r += `${He}'s wearing a cheerleader uniform, creating an amusing effect with ${his} weapons.`;
			break;
		case "attractive lingerie for a pregnant woman":
			r += `${His} silky lingerie contrasts with ${his} deadly weaponry.`;
			break;
		case "kitty lingerie":
			r += `${His} cutesy lingerie contrasts with ${his} deadly weaponry.`;
			break;
		case "a maternity dress":
			r += `${His} loose dress gives ${him} plenty of places to conceal weaponry.`;
			break;
		case "stretch pants and a crop-top":
			r += `${His} relaxed outfit clashes amusingly with ${his} serious weapons.`;
			break;
		case "a slave gown":
			r += `${His} gorgeous gown and elegant weapons make ${him} look refined, yet deadly.`;
			break;
		case "a halter top dress":
			r += `${His} beautiful halter top dress and elegant weapons make ${him} look refined, yet deadly.`;
			break;
		case "a ball gown":
			r += `${His} fabulous silken ball gown and elegant weapons make ${him} look refined, yet deadly.`;
			break;
		case "a nice maid outfit":
			r += `${His} pretty maid outfit and weapons make ${him} look like a character from an animated movie.`;
			break;
		case "a nice pony outfit":
		case "a slutty pony outfit":
			r += `${His} leather outfit make ${him} look like an insane slave fighter.`;
			break;
		case "a hanbok":
			r += `${His} pretty hanbok and weapons make ${him} look like a character from a history novel.`;
			break;
		case "spats and a tank top":
			r += `${His} exercise outfit makes ${him} look like ${he} has the fitness to back up ${his} weapons.`;
			break;
		case "a slutty maid outfit":
			r += `${His} slutty maid outfit and weapons make ${him} look like a character from an exploitation film.`;
			break;
		case "cutoffs and a t-shirt":
			r += `${His} relaxed clothing clashes with ${his} weaponry, making ${him} look like ${he}'s planning to kill someone and then have a relaxing day off.`;
			break;
		case "harem gauze":
			r += `${His} weapons pin ${his} sheer gauze down over ${his} body, putting everything on lewd display.`;
			break;
		case "a fallen nuns habit":
			r += `${His} sacrilegious getup and weapons make ${him} look like a sinner's fantasy.`;
			break;
		case "a chattel habit":
			r += `${His} chattel habit and weapons make ${his} role as a defender of the new faith instantly obvious.`;
			break;
		case "a penitent nuns habit":
			r += `${His} somber habit and weapons make ${him} look like a member of a militant order.`;
			break;
		case "slutty business attire":
			r += `${His} slutty business suit and weapons give ${him} the look a supervillain's sidekick.`;
			break;
		case "nice business attire":
			r += `${His} business suit and weapons give ${him} the look of a finely honed corporate instrument.`;
			break;
		case "conservative clothing":
			r += `${His} casual, conservative clothes and weapons make ${him} look like a normal old world security contractrix.`;
			break;
		case "a hijab and blouse":
			r += `${His} modest, conservative clothes and weapons make ${him} look like an old world security contractrix.`;
			break;
		case "a comfortable bodysuit":
			r += `${His} bodysuit and weapons make ${him} look like an action movie heroine.`;
			break;
		case "a burkini":
			r += `${His} form-fitting swimsuit and weapons make ${him} look like an action movie heroine.`;
			break;
		case "a Santa dress":
			r += `${His} skimpy holiday dress seems to be for those on the nice list, but ${his} weaponry is for those on the naughty list.`;
			break;
		case "a leotard":
			r += `${His} leotard and weapons make ${him} look like the heroine of an old exploitation film.`;
			break;
		case "a bunny outfit":
			r += `${His} bunny outfit and weapons make ${him} look like the henchwoman of a villain from a cheesy vintage spy film.`;
			break;
		case "a slutty nurse outfit":
			r += `Between ${his} nurse outfit and ${his} weapons ${he} looks prepared to do harm, and then to heal it.`;
			break;
		case "a schoolgirl outfit":
			r += `This schoolgirl is well armed, bringing to mind more than one farcical action film.`;
			break;
		case "a kimono":
			r += `${His} kimono has discreet cuts that allow ${him} to fight reasonably well in it if necessary, and are almost invisible when ${he} stands straight.`;
			break;
		case "a slutty qipao":
			r += `${His} qipao and weapons make ${him} look like a character from a fighting game.`;
			break;
		case "a toga":
			r += `${His} toga and weapons make a stark contrast, making ${him} stand out a lot.`;
			break;
		case "a huipil":
			r += `${His} huipil hides most of the weapons ${he} carries, but carrying them on naked skin is a slight discomfort.`;
			break;
		case "a hijab and abaya":
		case "a niqab and abaya":
			r += `${His} weapons are strapped to the outside of ${his} abaya, a juxtaposition that would be more ludicrous had not many women in the Middle East recently been seen fighting dressed in just this way.`;
			break;
		case "a burqa":
			r += `${His} weapons are strapped to the outside of ${his} burqa, a juxtaposition that would be more ludicrous had not some women in the Middle East recently been seen fighting dressed in just this way.`;
			break;
		case "a klan robe":
		case "a slutty klan robe":
			r += `${His} weapons are strapped to the outside of ${his} robe, all the essentials are present, mainly rope.`;
			break;
		case "battledress":
			r += `Though ${his} battledress top is just a tank top, ${he} still skirts the edge of looking more like a Free Cities mercenary than a Free Cities sex slave.`;
			break;
		case "slutty jewelry":
			r += `The bangles ${he}'s wearing are complemented by the straps that mount ${his} weapons to ${his} otherwise naked body.`;
			break;
		case "a tube top and thong":
		case "a button-up shirt and panties":
		case "a bra":
		case "a button-up shirt":
		case "a sweater":
		case "a tank-top":
		case "a thong":
		case "a tube top":
		case "a striped bra":
		case "a skimpy loincloth":
		case "a sports bra":
			r += `Due to the skimpiness of ${his} outfit, ${he} appears to be wearing more weapons than clothing.`;
			break;
		case "a sweater and panties":
		case "a sweater and cutoffs":
		case "a t-shirt and jeans":
		case "a t-shirt and panties":
		case "a t-shirt and thong":
		case "a t-shirt":
		case "a tank-top and panties":
		case "an oversized t-shirt and boyshorts":
		case "an oversized t-shirt":
		case "boyshorts":
		case "cutoffs":
		case "jeans":
		case "leather pants and a tube top":
		case "leather pants and pasties":
		case "leather pants":
		case "panties and pasties":
		case "panties":
		case "pasties":
		case "sport shorts and a sports bra":
		case "sport shorts and a t-shirt":
		case "sport shorts":
		case "striped underwear":
			r += `${His} weapons only accentuate the nakedness of ${his} body.`;
			break;
		default:
			if (slave.chastityVagina || slave.chastityAnus) {
				r += `${His} chastity belt covers and protects ${him}, just as ${his} weapons cover and protect you.`;
			} else if (slave.chastityPenis === 1) {
				r += `${His} chastity cage covers and protects ${him}, just as ${his} weapons cover and protect you.`;
			} else {
				r += `${He} is nude except for ${his} armament.`;
			}
			break;
	}
	return r;
};
/* CLOSE USEGUARD */


code:
:: Prosthetics Config [nobr]

<<switch $prostheticsConfig>>

<<case "main">>
	<<set $nextButton = "Back", $nextLink = "Slave Interact">>
	/* get all prosthetics that are ready for this slave */
	<<if $adjustProstheticsCompleted > 0>>
		<<set $adjustProsthetics = $adjustProsthetics.filter(function(p) {
			if (p.workLeft <= 0 && p.slaveID == $activeSlave.ID) {
				$activeSlave.readyProsthetics.push({id: p.id});
				$adjustProstheticsCompleted--;
				return false;
			}
			return true;
		})>>
	<</if>>

/* base screen START */
This room is lined with shelves and cabinets, it could be easily mistaken for a storage room if it were not for the examination table in its center.

<<if $activeSlave.amp != 1>>
	Your slave $activeSlave.slaveName is obediently waiting for your instructions.
<<else>>
	Your slave $activeSlave.slaveName is lying on the table, waiting for your instructions.
<</if>>

<<if $activeSlave.eyesImplant == 1>>

	$He has an ocular implant installed.
	<<if $activeSlave.eyes == 1>>
		They are operating normally.
	<<elseif $activeSlave.eyes == -1>>
		They are set to blur $his vision.
	<<else>>
		They are turned off.
	<</if>>

	<<if $activeSlave.eyes != 1>>
		[[Restore vision|Prosthetics Config][$activeSlave.eyes = 1, $prostheticsConfig = "eyes"]] |
	<</if>>
	<<if $activeSlave.eyes != -1>>
		[[Blur|Prosthetics Config][$activeSlave.eyes = -1, $prostheticsConfig = "eyes"]] |
	<</if>>
	<<if $activeSlave.eyes != -2>>
		[[Disable|Prosthetics Config][$activeSlave.eyes = -2, $prostheticsConfig = "eyes"]]
	<</if>>

	$He currently has $activeSlave.eyeColor lenses equipped.

	Swap out $his lenses:

	Iris Color:
	[[Blue|Prosthetics Config][$activeSlave.eyeColor = "blue", $prostheticsConfig = "eyeColor", cashX(forceNeg($modCost), "slaveMod", $activeSlave)]]
	| [[Black|Prosthetics Config][$activeSlave.eyeColor = "black", $prostheticsConfig = "eyeColor", cashX(forceNeg($modCost), "slaveMod", $activeSlave)]]
	| [[Brown|Prosthetics Config][$activeSlave.eyeColor = "brown", $prostheticsConfig = "eyeColor", cashX(forceNeg($modCost), "slaveMod", $activeSlave)]]
	| [[Green|Prosthetics Config][$activeSlave.eyeColor = "green", $prostheticsConfig = "eyeColor", cashX(forceNeg($modCost), "slaveMod", $activeSlave)]]
	| [[Turquoise|Prosthetics Config][$activeSlave.eyeColor = "turquoise", $prostheticsConfig = "eyeColor", cashX(forceNeg($modCost), "slaveMod", $activeSlave)]]
	| [[Sky-Blue|Prosthetics Config][$activeSlave.eyeColor = "sky-blue", $prostheticsConfig = "eyeColor", cashX(forceNeg($modCost), "slaveMod", $activeSlave)]]
	| [[Hazel|Prosthetics Config][$activeSlave.eyeColor = "hazel", $prostheticsConfig = "eyeColor", cashX(forceNeg($modCost), "slaveMod", $activeSlave)]]
	| [[Pale-Grey|Prosthetics Config][$activeSlave.eyeColor = "pale-grey", $prostheticsConfig = "eyeColor", cashX(forceNeg($modCost), "slaveMod", $activeSlave)]]
	| [[White|Prosthetics Config][$activeSlave.eyeColor = "white", $prostheticsConfig = "eyeColor" ,cashX(forceNeg($modCost), "slaveMod", $activeSlave)]]
	| [[Pink|Prosthetics Config][$activeSlave.eyeColor = "pink", $prostheticsConfig = "eyeColor", cashX(forceNeg($modCost), "slaveMod", $activeSlave)]]
	| [[Amber|Prosthetics Config][$activeSlave.eyeColor = "amber", $prostheticsConfig = "eyeColor", cashX(forceNeg($modCost), "slaveMod", $activeSlave)]]
	| [[Red|Prosthetics Config][$activeSlave.eyeColor = "red", $prostheticsConfig = "eyeColor", cashX(forceNeg($modCost), "slaveMod", $activeSlave)]]
	| [[Yellow|Prosthetics Config][$activeSlave.eyeColor = "yellow", $prostheticsConfig = "eyeColor", cashX(forceNeg($modCost), "slaveMod", $activeSlave)]]
	| [[Orange|Prosthetics Config][$activeSlave.eyeColor = "orange", $prostheticsConfig = "eyeColor", cashX(forceNeg($modCost), "slaveMod", $activeSlave)]]

	Pupil Shape:

[[Circular|Prosthetics Config][$activeSlave.pupil = "circular", $prostheticsConfig = "eyeColor", cashX(forceNeg($modCost), "slaveMod", $activeSlave)]]
	| [[Catlike|Prosthetics Config][$activeSlave.pupil = "catlike", $prostheticsConfig = "eyeColor", cashX(forceNeg($modCost), "slaveMod", $activeSlave)]]
	| [[Serpent-Like|Prosthetics Config][$activeSlave.pupil = "serpent-like", $prostheticsConfig = "eyeColor", cashX(forceNeg($modCost), "slaveMod", $activeSlave)]]
	| [[Devilish|Prosthetics Config][$activeSlave.pupil = "devilish", $prostheticsConfig = "eyeColor", cashX(forceNeg($modCost), "slaveMod", $activeSlave)]]
	| [[Demonic|Prosthetics Config][$activeSlave.pupil = "demonic", $prostheticsConfig = "eyeColor", cashX(forceNeg($modCost), "slaveMod", $activeSlave)]]
	| [[Hypnotic|Prosthetics Config][$activeSlave.pupil = "hypnotic", $prostheticsConfig = "eyeColor", cashX(forceNeg($modCost), "slaveMod", $activeSlave)]]
	| [[Heart-Shaped|Prosthetics Config][$activeSlave.pupil = "heart-shaped", $prostheticsConfig = "eyeColor", cashX(forceNeg($modCost), "slaveMod", $activeSlave)]]
	| [[Wide-Eyed|Prosthetics Config][$activeSlave.pupil = "wide-eyed", $prostheticsConfig = "eyeColor", cashX(forceNeg($modCost), "slaveMod", $activeSlave)]]
	| [[Almond-Shaped|Prosthetics Config][$activeSlave.pupil = "almond-shaped", $prostheticsConfig = "eyeColor", cashX(forceNeg($modCost), "slaveMod", $activeSlave)]]
	| [[Bright|Prosthetics Config][$activeSlave.pupil = "bright", $prostheticsConfig = "eyeColor", cashX(forceNeg($modCost), "slaveMod", $activeSlave)]]
	| [[Teary|Prosthetics Config][$activeSlave.pupil = "teary", $prostheticsConfig = "eyeColor", cashX(forceNeg($modCost), "slaveMod", $activeSlave)]]
	| [[Vacant|Prosthetics Config][$activeSlave.pupil = "vacant", $prostheticsConfig = "eyeColor", cashX(forceNeg($modCost), "slaveMod", $activeSlave)]]
	| [[Star-Shaped|Prosthetics Config][$activeSlave.pupil = "star-shaped", $prostheticsConfig = "eyeColor", cashX(forceNeg($modCost), "slaveMod", $activeSlave)]]
	| [[Goat-Like|Prosthetics Config][$activeSlave.pupil = "goat-like", $prostheticsConfig = "eyeColor", cashX(forceNeg($modCost), "slaveMod", $activeSlave)]]

	Sclera Colors:
	[[White|Prosthetics Config][$activeSlave.sclerae = "white", $prostheticsConfig = "eyeColor", cashX(forceNeg($modCost), "slaveMod", $activeSlave)]]
	| [[Blue|Prosthetics Config][$activeSlave.sclerae = "blue", $prostheticsConfig = "eyeColor", cashX(forceNeg($modCost), "slaveMod", $activeSlave)]]
	| [[Black|Prosthetics Config][$activeSlave.sclerae = "black", $prostheticsConfig = "eyeColor", cashX(forceNeg($modCost), "slaveMod", $activeSlave)]]
	| [[Brown|Prosthetics Config][$activeSlave.sclerae = "brown", $prostheticsConfig = "eyeColor", cashX(forceNeg($modCost), "slaveMod", $activeSlave)]]
	| [[Green|Prosthetics Config][$activeSlave.sclerae = "green", $prostheticsConfig = "eyeColor", cashX(forceNeg($modCost), "slaveMod", $activeSlave)]]
	| [[Turquoise|Prosthetics Config][$activeSlave.sclerae = "turquoise", $prostheticsConfig = "eyeColor", cashX(forceNeg($modCost), "slaveMod", $activeSlave)]]
	| [[Sky-Blue|Prosthetics Config][$activeSlave.sclerae = "sky-blue", $prostheticsConfig = "eyeColor", cashX(forceNeg($modCost), "slaveMod", $activeSlave)]]
	| [[Hazel|Prosthetics Config][$activeSlave.sclerae = "hazel", $prostheticsConfig = "eyeColor", cashX(forceNeg($modCost), "slaveMod", $activeSlave)]]
	| [[Pale-Grey|Prosthetics Config][$activeSlave.sclerae = "pale-grey", $prostheticsConfig = "eyeColor", cashX(forceNeg($modCost), "slaveMod", $activeSlave)]]
	| [[Pink|Prosthetics Config][$activeSlave.sclerae = "pink", $prostheticsConfig = "eyeColor", cashX(forceNeg($modCost), "slaveMod", $activeSlave)]]
	| [[Amber|Prosthetics Config][$activeSlave.sclerae = "amber", $prostheticsConfig = "eyeColor", cashX(forceNeg($modCost), "slaveMod", $activeSlave)]]
	| [[Red|Prosthetics Config][$activeSlave.sclerae = "red", $prostheticsConfig = "eyeColor", cashX(forceNeg($modCost), "slaveMod", $activeSlave)]]
	| [[Yellow|Prosthetics Config][$activeSlave.sclerae = "yellow", $prostheticsConfig = "eyeColor", cashX(forceNeg($modCost), "slaveMod", $activeSlave)]]
	| [[Orange|Prosthetics Config][$activeSlave.sclerae = "orange", $prostheticsConfig = "eyeColor", cashX(forceNeg($modCost), "slaveMod", $activeSlave)]]
<</if>>

<<if $activeSlave.earImplant == 1>>

	$He has a cochlear implant installed.
	<<if $activeSlave.hears == 0>>
		They are operating normally.
	<<elseif $activeSlave.hears == -1>>
		They are set to muffle $his hearing.
	<<else>>
		They are turned off.
	<</if>>

	<<if $activeSlave.hears != 0>>
		[[Restore hearing|Prosthetics Config][$activeSlave.hears = 0, $prostheticsConfig = "hearing"]] |
	<</if>>
	<<if $activeSlave.hears != -1>>
		[[Muffle|Prosthetics Config][$activeSlave.hears = -1, $prostheticsConfig = "hearing"]] |
	<</if>>
	<<if $activeSlave.hears != -2>>
		[[Disable|Prosthetics Config][$activeSlave.hears = -2, $prostheticsConfig = "hearing"]]
	<</if>>
<</if>>

<<if $activeSlave.electrolarynx == 1>>

	$He has an electrolarynx installed.
	<<if $activeSlave.voice == 0>>
		It is turned off.
	<<elseif $activeSlave.voice == 1>>
		It is set to its "deep voice" setting.
	<<elseif $activeSlave.voice == 2>>
		It is set to its "normal voice" setting.
	<<elseif $activeSlave.voice == 3>>
		It is set to its "high voice" setting.
	<</if>>

	<<if $activeSlave.voice != 0>>
		[[Disable|Prosthetics Config][$activeSlave.voice = 0, $prostheticsConfig = "voice"]] |
	<</if>>
	<<if $activeSlave.voice != 1>>
		[[Deep voice setting|Prosthetics Config][$activeSlave.voice = 1, $prostheticsConfig = "voice"]] |
	<</if>>
	<<if $activeSlave.voice != 2>>
		[[Standard voice setting|Prosthetics Config][$activeSlave.voice = 2, $prostheticsConfig = "voice"]] |
	<</if>>
	<<if $activeSlave.voice != 3>>
		[[High voice setting|Prosthetics Config][$activeSlave.voice = 3, $prostheticsConfig = "voice"]]
	<</if>>
<</if>>

<<if $activeSlave.readyProsthetics.length > 0>>

	<<if $activeSlave.fuckdoll != 0>>
		// A Fuckdoll can't use prosthetic limbs. //
	<<elseif $activeSlave.amp == 0>>
		// $He must be an amputee to attach prosthetic limbs. //
	<<elseif $activeSlave.PLimb == 0>>
		// $He must have a prosthetic interface installed to attach prosthetic limbs. //
	<<else>>
		<<if $activeSlave.amp < 0>>
			//$He currently has
			<<switch $activeSlave.amp>>
			<<case -1>> <<= addA(setup.prosthetics.basicL.name)>>
			<<case -2>> <<= addA(setup.prosthetics.sexL.name)>>
			<<case -3>> <<= addA(setup.prosthetics.beautyL.name)>>
			<<case -4>> <<= addA(setup.prosthetics.combatL.name)>>
			<<case -5>> <<= addA(setup.prosthetics.cyberneticL.name)>>
			<</switch>>
			installed.//

			<<link "Detach <<= $his>> limbs" "Prosthetics Config">>
				<<set $activeSlave.amp = 1, $prostheticsConfig = "removeLimbs">>
			<</link>>

		<</if>>
		/*TODO save .legsTat and .armsTat / link them to prosthetic*/
		<<if $activeSlave.amp != -1 && $activeSlave.readyProsthetics.findIndex(function(p) {return p.id == "basicL"}) != -1>>
			<<link "Attach <<= addA(setup.prosthetics.basicL.name)>>" "Prosthetics Config">>
				<<set $activeSlave.amp = -1, $prostheticsConfig = "basicPLimbs">>
			<</link>>

		<</if>>
		<<if $activeSlave.amp != -2 && $activeSlave.readyProsthetics.findIndex(function(p) {return p.id == "sexL"}) != -1>>
			<<link "Attach <<= addA(setup.prosthetics.sexL.name)>>" "Prosthetics Config">>
				<<set $activeSlave.amp = -2, $prostheticsConfig = "sexPLimbs">>
			<</link>>

		<</if>>
		<<if $activeSlave.amp != -3 && $activeSlave.readyProsthetics.findIndex(function(p) {return p.id == "beautyL"}) != -1>>
			<<link "Attach <<= addA(setup.prosthetics.beautyL.name)>>" "Prosthetics Config">>
				<<set $activeSlave.amp = -3, $prostheticsConfig = "beautyPLimbs">>
			<</link>>

		<</if>>
		<<if $activeSlave.amp != -4 && $activeSlave.readyProsthetics.findIndex(function(p) {return p.id == "combatL"}) != -1>>
			<<link "Attach <<= addA(setup.prosthetics.combatL.name)>>" "Prosthetics Config">>
				<<set $activeSlave.amp = -4, $prostheticsConfig = "combatPLimbs">>
			<</link>>

		<</if>>
		<<if $activeSlave.amp != -5 && $activeSlave.readyProsthetics.findIndex(function(p) {return p.id == "cyberneticL"}) != -1>>
			<<if $activeSlave.PLimb == 2>>
				<<link "Attach <<= addA(setup.prosthetics.cyberneticL.name)>>" "Prosthetics Config">>
					<<set $activeSlave.amp = -5, $prostheticsConfig = "cyberPLimbs">>
				<</link>>
			<<else>>
				// $He must have <<= addA(setup.prosthetics.interfaceP2.name)>> installed to attach <<= addA(setup.prosthetics.cyberneticL.name)>>. //
			<</if>>
		<</if>>
	<</if>>
<</if>>

<<if $activeSlave.PTail == 1>>

	$He has a neural tail interface installed. You can assign and adjust $his tail here.
	<<if $activeSlave.tail != "none">>

		$He currently has a tail attached, if you wish to change it you will first need to detach it.

		[[Detach|Prosthetics Config][$prostheticsConfig = "detachTail",$nextButton = "Continue", $nextLink = "Prosthetics Config"]]
	<<else>>

		<<if $activeSlave.readyProsthetics.findIndex(function(p) {return p.id == "modT"})>>
			Attach a modular tail designed to look like a:

			[[Cat's Tail|Prosthetics Config][$prostheticsConfig = "attachTail", $activeSlave.tail = "mod", $activeSlave.tailShape = "neko", $activeSlave.tailColor = $activeSlave.hColor]]
			| [[Dog's Tail|Prosthetics Config][$prostheticsConfig = "attachTail", $activeSlave.tail = "mod", $activeSlave.tailShape = "inu", $activeSlave.tailColor = $activeSlave.hColor]]
			| [[Fox's Tail|Prosthetics Config][$prostheticsConfig = "attachTail", $activeSlave.tail = "mod", $activeSlave.tailShape = "kit", $activeSlave.tailColor = $activeSlave.hColor]]
			| [[Kitsune's Tail|Prosthetics Config][$prostheticsConfig = "attachTail", $activeSlave.tail = "mod", $activeSlave.tailShape = "kitsune", $activeSlave.tailColor = $activeSlave.hColor]]
			| [[Tanuki's Tail|Prosthetics Config][$prostheticsConfig = "attachTail", $activeSlave.tail = "mod", $activeSlave.tailShape = "tanuki", $activeSlave.tailColor = $activeSlave.hColor]]
			| [[Cow's Tail|Prosthetics Config][$prostheticsConfig = "attachTail", $activeSlave.tail = "mod", $activeSlave.tailColor = "ushi", $activeSlave.tailColor = $activeSlave.hColor]]

		<</if>>
		<<if $activeSlave.readyProsthetics.findIndex(function(p) {return p.id == "combatT"})>>
			[[Attach Combat Tail|Prosthetics Config][$prostheticsConfig = "attachTail", $activeSlave.tail = "combat", $activeSlave.tailColor = "jet black"]]
		<</if>>
		<<if $activeSlave.readyProsthetics.findIndex(function(p) {return p.id == "sexT"})>>
			| [[Attach Pleasure Tail|Prosthetics Config][$prostheticsConfig = "attachTail", $activeSlave.tail = "sex", $activeSlave.tailColor = "pink"]]
		<</if>>
	<</if>>
<<else>>

	$He does not have a neural tail interface installed so you cannot attach a tail.
<</if>>
<<if $activeSlave.tail == "mod">>

	$He currently has a modular tail, styled to look like
	<<if $activeSlave.tailShape == "neko">>
		a long, slender cat tail.
	<<elseif $activeSlave.tailShape == "inu">>
		a bushy dog tail.
	<<elseif $activeSlave.tailShape == "kit">>
		a soft, fluffy fox tail.
	<<elseif $activeSlave.tailShape == "kitsune">>
		three incredibly soft, fluffy fox tails.
	<<elseif $activeSlave.tailShape == "tanuki">>
		a long, fluffy tanuki tail.
	<<elseif $activeSlave.tailShape == "ushi">>
		a long cow tail.
	<</if>>

	Modify $his tail's appearance:

	[[Cat|Prosthetics Config][$activeSlave.tailShape = "neko", cashX(forceNeg($modCost), "slaveMod", $activeSlave)]]
	| [[Dog|Prosthetics Config][$activeSlave.tailShape = "inu", cashX(forceNeg($modCost), "slaveMod", $activeSlave)]]
	| [[Fox|Prosthetics Config][$activeSlave.tailShape = "kit", cashX(forceNeg($modCost), "slaveMod", $activeSlave)]]
	| [[Kitsune|Prosthetics Config][$activeSlave.tailShape = "kitsune", cashX(forceNeg($modCost), "slaveMod", $activeSlave)]]
	| [[Tanuki|Prosthetics Config][$activeSlave.tailShape = "tanuki", cashX(forceNeg($modCost), "slaveMod", $activeSlave)]]
	| [[Bovine|Prosthetics Config][$activeSlave.tailShape = "ushi", cashX(forceNeg($modCost), "slaveMod", $activeSlave)]]
<</if>>

<<if $activeSlave.readyProsthetics.length > 0>>

	These prosthetics are in storage or already equipped by $him:

	<<for _p range $activeSlave.readyProsthetics>>
		  <<= capFirstChar(setup.prosthetics[_p.id].name)>>

	<</for>>
<</if>>

Fit prosthetics to $him:
<<for _p range setup.prostheticIDs>>
	<<if _p != "erectile">> /* exclude erectile implant */
		<<if $adjustProsthetics.findIndex(function(p) {return p.id == _p && p.slaveID == $activeSlave.ID}) != -1 || $researchLab.tasks.findIndex(function(p) {return p.type == "craftFit" && p.id == _p && p.slaveID == $activeSlave.ID}) != -1>>

			//<<= capFirstChar(addA(setup.prosthetics[_p].name))>> is already being fitted to $him.//
		<<elseif setup.prosthetics[_p].level > $prostheticsUpgrade>>

			//You need better contracts to buy <<= addA(setup.prosthetics[_p].name)>>.//
		<<elseif $activeSlave.readyProsthetics.findIndex(function(p) {return p.id == _p}) == -1>>

			<<capture _p>>
			<<if $prosthetics[_p].amount > 0>>
				<<link "Fit <<= addA(setup.prosthetics[_p].name)>> from storage to <<= $him>>" "Prosthetics Config">>
					<<set $adjustProsthetics.push({id: _p, workLeft: setup.prosthetics[_p].adjust, slaveID: $activeSlave.ID}), $prosthetics[_p].amount -= 1>>
				<</link>>
			<<else>>
				<<link "Buy and fit <<= addA(setup.prosthetics[_p].name)>> to <<= $him>>" "Prosthetics Config">>
					<<set $adjustProsthetics.push({id: _p, workLeft: setup.prosthetics[_p].adjust, slaveID: $activeSlave.ID}), cashX(forceNeg(setup.prosthetics[_p].costs), "slaveMod", $activeSlave)>>
				<</link>>
				//Costs <<= cashFormat(setup.prosthetics[_p].costs)>>.//
			<</if>>
			<<if $researchLab.level > 0 & $prosthetics[_p].research > 0>>

				<<link "Construct <<= addA(setup.prosthetics[_p].name)>> for <<= $him>>" "Prosthetics Config">>
					<<set $researchLab.tasks.push({
						type: "craftFit",
						id: _p,
						workLeft: (setup.prosthetics[_p].adjust + setup.prosthetics[_p].craft) / 1.5,
						slaveID: $activeSlave.ID})>>
					/* 1.5: longer than adjust, but faster than adjust+craft. */
				<</link>>
				//Will take longer than fitting an existing prosthetic but faster than first building it and than fitting it to $him.//
			<</if>>
			<</capture>>
		<</if>>
	<</if>>
<</for>>

/* base screen END */

<<case "eyeColor">>
	<<set $prostheticsConfig = "main", $nextButton = "Continue", $nextLink = "Prosthetics Config">>
	<<if $activeSlave.amp != 1>>You have $him lie down and<<else>>You<</if>> use a speculum to keep $his eyes open while you disengage $his lenses remotely and swap them out with $his new $activeSlave.eyeColor lenses<<if $activeSlave.pupil != "circular" || $activeSlave.sclerae != "white">> with <<if $activeSlave.pupil != "circular" >>$activeSlave.pupil pupils<</if>><<if $activeSlave.pupil != "circular" && $activeSlave.sclerae != "white">> and <</if>><<if $activeSlave.sclerae != "white" >>$activeSlave.sclerae sclerae<</if>><</if>>.

<<case "eyes">>
	<<set $prostheticsConfig = "main", $nextButton = "Continue", $nextLink = "Prosthetics Config">>
	<<if $activeSlave.eyes == 1>>
		$He blinks as $his vision returns.
	<<elseif $activeSlave.eyes == -1>>
		$He squints at you as $his vision becomes a blur.
	<<else>>
		$He has a panicked expression when $his vision suddenly goes out.
	<</if>>

<<case "basicPLimbs">>
	<<set $prostheticsConfig = "main", $nextButton = "Continue", $nextLink = "Prosthetics Config">>
	Attaching $his limbs is a simple procedure, you simply push a connector on each limb into the socket in $his implants until the lock engages.<<if $activeSlave.PLimb == 2>> $He jumps a bit as limbs connect to $his nerves.<</if>>
	<<if $activeSlave.fetish != "mindbroken" && $activeSlave.fuckdoll == 0>>
		<<if $activeSlave.devotion > 20>>
			$He's overwhelmed with gratitude and thanks you profusely the first chance $he gets. $He follows the acclimation program diligently, doing $his best to learn how to be a good slave despite, or sometimes even because of, $his artificial arms and legs.
		<<elseif $activeSlave.devotion >= -20>>
			$He's overwhelmed with gratitude in part because $he didn't think you'd do something like this for $him. $He thanks you profusely the first chance $he gets, and follows the acclimation program diligently, trying to deserve the expense you went to.
		<<else>>
			Despite $his hatred of you, $he can't help but notice that you clearly have a plan for $him that involves putting a good deal of value into $him. Your goals might not be $hers, but at least $he has an indication that you're not toying with $him.
		<</if>>
	<</if>>

<<case "sexPLimbs">>
	<<set $prostheticsConfig = "main", $nextButton = "Continue", $nextLink = "Prosthetics Config">>
	Attaching $his limbs is a simple procedure, you simply push a connector on each limb into the socket in $his implants until the lock engages.<<if $activeSlave.PLimb == 2>> $He jumps a bit as limbs connect to $his nerves.<</if>>
	While exiting the prosthetic lab $he is experimenting with $his new arms and legs.
	<<if $activeSlave.fetish != "mindbroken" && $activeSlave.fuckdoll == 0>>
		<<if $activeSlave.devotion <= 20>>
			$He rapidly discovers that $his fingertips are now vibrators, and then makes a mess when $he figures out that $his hands can dispense lube without figuring out how to make them stop dispensing lube. $He's frustrated and frightened, realizing that even $his prosthetics are now customized to suit $his purpose as a human sex toy. $He knew $he was a toy before, but somehow, being a literal vibrator is a bit much for $him.
		<<elseif $activeSlave.energy > 95>>
			Since $he's a nympho, $he discovers $his new sexual functions in a hurry. They trigger in part is based on arousal, and $he's never not aroused, so they activate one by one as $he leaves the surgery. The vibration, lube, and other dirty functions surprise $him, and it takes $him a moment to realize what's going on, but $he begins to breathe hard when $he understands.
		<<else>>
			$He discovers $his sexy new functions one by one. The vibration, lube, and other dirty functions surprise $him, and it takes $him a moment to realize what's going on, but $he begins to shake with amusement when $he understands. $He heads off to try them out.
		<</if>>
	<</if>>

<<case "beautyPLimbs">>
	<<set $prostheticsConfig = "main", $nextButton = "Continue", $nextLink = "Prosthetics Config">>
	Attaching $his limbs is a simple procedure, you simply push a connector on each limb into the socket in $his implants until the lock engages.<<if $activeSlave.PLimb == 2>> $He jumps a bit as limbs connect to $his nerves.<</if>> $He exits the prosthetic lab <<if canSee($activeSlave)>>marveling at the beautiful, natural appearance of $his new arms and legs<<else>>thanking you for $his new arms and legs, unaware of how natural they look<</if>>.
	<<if $activeSlave.fetish != "mindbroken" && $activeSlave.fuckdoll == 0>>
		<<if $activeSlave.devotion <= 20>>
			If $he doubts that you have some sort of long term plan for $him, all $he has to do is <<if canSee($activeSlave)>>look down and examine<<else>>feel<</if>> $his elegant, natural prosthetics, which are often mistaken for the genuine article. Even $he makes the mistake at times as $he gets used to them.
		<<elseif $activeSlave.skill.entertainment >= 100>>
			Since $he's a masterful entertainer, $he knows multiple styles of dance, though $his straightforward modern prosthetics never allowed $him to be anything more than a mechanically competent dancer. $He finds that $he has far better balance now, in addition to looking more natural. Before long, $he goes //en pointe// and holds the position, before collapsing in a heap. It soon becomes apparent that this wasn't due to clumsiness: $he's sobbing so hard $he can barely breathe. $He thanks you profusely the next time $he sees you, eyes still puffy with tears of joy.
		<<else>>
			When $he first <<if canSee($activeSlave)>>catches sight of $himself in a mirror<<else>>runs a new finger over $his natural feeling skin<</if>>, $he begins to cry. Terribly complex emotions war across $his face: gratitude, joy, regret, and something undefinable. Blinking, $he uses newly elegant fingertips to trace the scarcely visible seams where $his artificial and natural skin meet. $He thanks you profusely the next time $he sees you, eyes still puffy with tears.
		<</if>>
	<</if>>

<<case "combatPLimbs">>
	<<set $prostheticsConfig = "main", $nextButton = "Continue", $nextLink = "Prosthetics Config">>
	Attaching $his limbs is a simple procedure, you simply push a connector on each limb into the socket in $his implants until the lock engages.<<if $activeSlave.PLimb == 2>> $He jumps a bit as limbs connect to $his nerves.<</if>> While exiting the prosthetic lab $he is wondering over the bulky <<if canSee($activeSlave)>>appearance<<else>>weight<</if>> of $his reinforced arms and legs.
	<<if $activeSlave.fetish != "mindbroken" && $activeSlave.fuckdoll == 0>>
		<<if $activeSlave.devotion <= 20>>
			$He's frightened, once $he discovers what $he can do, and what $he is. $His integral weapons are locked out by the arcology systems, for now, but $he quickly realizes what they are. $He is not, to say the least, thrilled by the revelation that $he is now a living weapon, and is kept awake by thoughts of what you might be planning for $him.
		<<elseif ($activeSlave.skill.combat == 1) && ($activeSlave.devotion > 75)>>
			$He leaves the prosthetic lab with a purpose, $his footsteps a bit heavier than before. $He heads down to the armory's range, still naked, and when $he gets there, $he places $his dominant hand over $his thigh on that side. It folds open, revealing a handgun, which $he draws and empties into a <<if canSee($activeSlave)>>target<<else>>beeping target<</if>>; as $he fires the last rounds, $he uses $his off hand to reach down to that thigh, which folds open and reveals spare magazines. $He knows that $his prosthetics are a wash, at best, in terms of actual combat effectiveness; they'll never match the reliability and dexterity of the genuine article. But $he thinks they are //cool.//
		<<else>>
			$He has mixed feelings about what $he soon discovers. $He's a living weapon now, and has to live with the constant knowledge that $he can incapacitate or kill with nothing more than what's contained within $his arms and legs. $He's touched, though, by the tremendous trust this shows. $He knows that the arcology would instantly lock out $his weapons if $he were to misbehave, but $he's still affected.
		<</if>>
	<</if>>

<<case "cyberPLimbs">>
	<<set $prostheticsConfig = "main", $nextButton = "Continue", $nextLink = "Prosthetics Config">>
	Attaching $his limbs is a simple procedure, you simply push a connector on each limb into the socket in $his implants until the lock engages.<<if $activeSlave.PLimb == 2>> $He jumps a bit as limbs connect to $his nerves.<</if>> $He exits the prosthetic lab marveling <<if canSee($activeSlave)>>at the shiny artificial skin of $his new arms and legs<<else>>at the feel of the artificial skin of $his new arms and legs under $his new fingers<</if>>.
	<<if $activeSlave.fetish != "mindbroken" && $activeSlave.fuckdoll == 0>>
		<<if $activeSlave.devotion <= 20>>
			$He's frightened, once $he discovers what $he can do, and what $he is. $His cybernetic limbs are restricted by the arcology systems, for now, but $he quickly realizes what they are. $He is not, to say the least, thrilled by the revelation that $he is now a living weapon, and is kept awake by thoughts of what you might be planning for $him.
		<<elseif ($activeSlave.skill.combat == 1) && ($activeSlave.devotion > 75)>>
			$He leaves the surgery with a purpose, $his footsteps a bit heavier than before. $He heads down to the armory's range, still naked, and when $he gets there, $he places $his dominant hand over $his thigh on that side. It folds open, revealing a handgun, which $he draws and empties into a <<if canSee($activeSlave)>>target<<else>>beeping target<</if>>; as $he fires the last rounds, $he uses $his off hand to reach down to that thigh, which folds open and reveals spare magazines. $He knows that $his prosthetics will enhance $his combat effectiveness and $he thinks they are //cool.//
		<<else>>
			$He has mixed feelings about what $he soon discovers. $He's a living weapon now, and has to live with the constant knowledge that $he can incapacitate or kill with nothing more than $his arms and legs themselves. $He's touched, though, by the tremendous trust this shows. $He knows that the arcology would instantly lock out $his limbs if $he were to misbehave, but $he's still affected.
		<</if>>
	<</if>>

<<case "removeLimbs">>
	<<set $prostheticsConfig = "main", $nextButton = "Continue", $nextLink = "Prosthetics Config">>
	<<set $activeSlave.amp = 1>>
	Due to built-in safeties it is necessary to remove each limb separately, first releasing the lock and then waiting for automated seal release.

	<<if ($activeSlave.devotion > 20)>>
		You instruct $him to lie down on the table and proceed to remove $his limbs. $He <<if canSee($activeSlave)>>watches<<elseif canHear($activeSlave)>>listens<<else>>waits<</if>> with interest as you work.<<if ($activeSlave.devotion > 50)>> As you remove the last limb $he playfully wiggles $his stumps at you.<</if>>
	<<else>>
		You order $him to lie down on the table and proceed to remove $his limbs. $He <<if canSee($activeSlave)>>watches<<elseif canHear($activeSlave)>>listens<<else>>waits<</if>> with a bitter expression as you work.
	<</if>>

<<case "hearing">>
	<<set $prostheticsConfig = "main", $nextButton = "Continue", $nextLink = "Prosthetics Config">>
	<<if $activeSlave.hears == 0>>
		$He tilts $his head as $his hearing returns.
	<<elseif $activeSlave.hears == -1>>
		$He shakes $his head as $his hearing becomes muffled.
	<<else>>
		$He has a panicked expression when $his hearing is suddenly silenced.
	<</if>>

<<case "voice">>
	<<set $prostheticsConfig = "main", $nextButton = "Continue", $nextLink = "Prosthetics Config">>
	<<if $activeSlave.voice == 0>>
		$He tries testing out $his new voice, only to discover $he's been made mute.
	<<elseif $activeSlave.voice == 1>>
		$He tests out the <<if canHear($activeSlave)>>sound<<else>>feeling<</if>> of $his new, deep voice.
	<<elseif $activeSlave.voice == 2>>
		$He tests out the <<if canHear($activeSlave)>>sound<<else>>feeling<</if>> of $his new, normal voice.
	<<elseif $activeSlave.voice == 3>>
		$He tests out the <<if canHear($activeSlave)>>sound<<else>>feeling<</if>> of $his new, high voice.
	<</if>>

<<case "detachTail">>
	<<set $prostheticsConfig = "main", $nextButton = "Continue", $nextLink = "Prosthetics Config">>
	<<if $activeSlave.tail == "mod">><<set $stockpile.modPTail += 1>>
	<<elseif $activeSlave.tail == "combat">><<set $stockpile.warPTail += 1>>
	<<elseif $activeSlave.tail == "sex">><<set $stockpile.sexPTail += 1>>
	<</if>>
	<<set $activeSlave.tail = "none">><<set $activeSlave.tailShape = "none">><<set $activeSlave.tailColor = "none">>
	You send the release signal and the mechanical lock disengages allowing the artificial tail to pop right off.

<<case "attachTail">>
	<<set $prostheticsConfig = "main", $nextButton = "Continue", $nextLink = "Prosthetics Config">>
	Attaching $his tail is a simple procedure, you simply push the connector into a socket, right where $his tailbone ends, until the lock engages.

	When you are done, $he looks back and
	<<if $activeSlave.tailShape == "neko">>sways $his tail side to side enigmatically.
	<<elseif $activeSlave.tailShape == "inu">>wags $his tail side to side energetically.
	<<elseif $activeSlave.tailShape == "kit">>slowly sways $his tail feeling the soft fur brush against $his skin.
	<<elseif $activeSlave.tailShape == "kitsune">>slowly sways $his tails luxuriating in the incredibly soft, fluffy fur brushing against $his skin.
	<<elseif $activeSlave.tailShape == "tanuki">>admires $his long, thick fluffy tail.
	<<elseif $activeSlave.tailShape == "ushi">>swats $himself playfully.
	<<elseif $activeSlave.tail == "combat">>experimentally whips the long tail side to side then takes aim at a prepared fruit, lashes out with blinding speed and smiles as it explodes into chunks.
	<<elseif $activeSlave.tail == "sex">>accidentally engages the vibrating and lube functions, startling $him and making quite a mess.
	<<else>>admires $his new tail.
	<</if>>

<<case "interface">>

	<<set _first = 1>>
	/*TODO save .legsTat and .armsTat / link them to prosthetic*/
	<<if $activeSlave.amp != -1 && $activeSlave.readyProsthetics.findIndex(function(p) {return p.id == "basicL"}) != -1>>
		<<if _first>>

Since you already have prepared limbs for $him you might as well attach them while you are working on $him:

			<<set _first = 0>>
		<</if>>
		<<link "Attach <<= addA(setup.prosthetics.basicL.name)>>">>
			<<set $activeSlave.amp = -1, $prostheticsConfig = "basicPLimbs">>
			<<replace #attach>>

<<include "Prosthetics Config">><<set $nextLink = "Remote Surgery">><</replace>>
		<</link>>

	<</if>>
	<<if $activeSlave.amp != -2 && $activeSlave.readyProsthetics.findIndex(function(p) {return p.id == "sexL"}) != -1>>
		<<if _first>>

Since you already have prepared limbs for $him you might as well attach them while you are working on $him:

			<<set _first = 0>>
		<</if>>
		<<link "Attach <<= addA(setup.prosthetics.sexL.name)>>">>
			<<set $activeSlave.amp = -2, $prostheticsConfig = "sexPLimbs">>
			<<replace #attach>>

<<include "Prosthetics Config">><<set $nextLink = "Remote Surgery">><</replace>>
		<</link>>

	<</if>>
	<<if $activeSlave.amp != -3 && $activeSlave.readyProsthetics.findIndex(function(p) {return p.id == "beautyL"}) != -1>>
		<<if _first>>

Since you already have prepared limbs for $him you might as well attach them while you are working on $him:

			<<set _first = 0>>
		<</if>>
		<<link "Attach <<= addA(setup.prosthetics.beautyL.name)>>">>
			<<set $activeSlave.amp = -3, $prostheticsConfig = "beautyPLimbs">>
			<<replace #attach>>

<<include "Prosthetics Config">><<set $nextLink = "Remote Surgery">><</replace>>
		<</link>>

	<</if>>
	<<if $activeSlave.amp != -4 && $activeSlave.readyProsthetics.findIndex(function(p) {return p.id == "combatL"}) != -1>>
		<<if _first>>

Since you already have prepared limbs for $him you might as well attach them while you are working on $him:

			<<set _first = 0>>
		<</if>>
		<<link "Attach <<= addA(setup.prosthetics.combatL.name)>>">>
			<<set $activeSlave.amp = -4, $prostheticsConfig = "combatPLimbs">>
			<<replace #attach>>

<<include "Prosthetics Config">><<set $nextLink = "Remote Surgery">><</replace>>
		<</link>>

	<</if>>
	<<if $activeSlave.amp != -5 && $activeSlave.readyProsthetics.findIndex(function(p) {return p.id == "cyberneticL"}) != -1>>
		<<if $activeSlave.PLimb == 2>>
			<<if _first>>

Since you already have prepared limbs for $him you might as well attach them while you are working on $him:

				<<set _first = 0>>
			<</if>>
			<<link "Attach <<= addA(setup.prosthetics.cyberneticL.name)>>" "Prosthetics Config">>
				<<set $activeSlave.amp = -5, $prostheticsConfig = "cyberPLimbs">>
				<<replace #attach>>

<<include "Prosthetics Config">><<set $nextLink = "Remote Surgery">><</replace>>
			<</link>>
		<</if>>
	<</if>>

<</switch>>


code:
:: Prosthetic Lab [nobr]

<<set $nextButton = "Back", $nextLink = "Main">>

<<set $researchLab.speed = (($researchLab.hired * 3) + $researchLab.menials) * $researchLab.aiModule>>

Prosthetic Lab

<<if $adjustProsthetics.length > 0>>
	Currently adjusting these prosthetics:

	<<for _p range $adjustProsthetics>>
		  <<= capFirstChar(setup.prosthetics[_p.id].name)>> for <<= SlaveFullName($slaves[$slaveIndices[_p.slaveID]])>>

	<</for>>
<<else>>
	//Currently there are no prosthetics being fit to a slave.//
<</if>>

<<if $researchLab.level > 0>>

Research Department

	//You switch one of the screens in your office to the feed from your research facility.//

	__Personnel__

	<<if $researchLab.aiModule == 1>>
		[[Buy and install research module|Prosthetic Lab][cashX(forceNeg(35000*$upgradeMultiplierArcology), "capEx"), $researchLab.aiModule = 2]] //This module enables your personal assistant to assist staff and direct menials assigned to your research facility, increasing efficiency. It costs <<= cashFormat(35000*$upgradeMultiplierArcology)>>//

	<</if>>
	<<if ($researchLab.hired + $researchLab.menials) == 0>>
		//Facility is currently unstaffed.//
	<<else>>
		//You have
		<<if $researchLab.hired == 1>>
			one scientist
		<<elseif $researchLab.hired > 1>>
			$researchLab.hired scientists
		<</if>>
		<<if $researchLab.hired > 0 && $researchLab.menials > 0 >> and<</if>>
		<<if $researchLab.menials == 1>>
			one menial slave
		<<elseif $researchLab.menials > 1>>
			$researchLab.menials menials
		<</if>>
		working in your lab.
			<<setAssistantPronouns>>
			<<if $researchLab.aiModule > 1>>Occasionally you hear the voice of your assistant as _heA helps direct and organize work.<</if>>//
	<</if>>

	 Currently, this facility can employ $researchLab.maxSpace people.
	<<if $researchLab.maxSpace == 5>>
		[[Expand facility|Prosthetic Lab][cashX(forceNeg(Math.trunc(5000*$upgradeMultiplierArcology)), "capEx"), $researchLab.maxSpace = 10]]
		//Costs <<= cashFormat(Math.trunc(5000*$upgradeMultiplierArcology))>>//
	<<elseif $researchLab.maxSpace == 10>>
		[[Expand facility|Prosthetic Lab][cashX(forceNeg(Math.trunc(10000*$upgradeMultiplierArcology)), "capEx"), $researchLab.maxSpace = 20]]
		//Costs <<= cashFormat(Math.trunc(10000*$upgradeMultiplierArcology))>>//
	<<elseif $researchLab.maxSpace == 20>>
		[[Expand facility|Prosthetic Lab][cashX(forceNeg(Math.trunc(15000*$upgradeMultiplierArcology)), "capEx"), $researchLab.maxSpace = 30]]
		//Costs <<= cashFormat(Math.trunc(15000*$upgradeMultiplierArcology))>>//
	<<elseif $researchLab.maxSpace == 30>>
		[[Expand facility|Prosthetic Lab][cashX(forceNeg(Math.trunc(20000*$upgradeMultiplierArcology)), "capEx"), $researchLab.maxSpace = 40]]
		//Costs <<= cashFormat(Math.trunc(20000*$upgradeMultiplierArcology))>>//
	<<elseif $researchLab.maxSpace == 40>>
		[[Expand facility|Prosthetic Lab][cashX(forceNeg(Math.trunc(25000*$upgradeMultiplierArcology)), "capEx"), $researchLab.maxSpace = 50]]
		//Costs <<= cashFormat(Math.trunc(25000*$upgradeMultiplierArcology))>>//
	<<elseif $researchLab.maxSpace == 50>>
		//Facility is fully expanded.//
	<</if>>

	<<if ($researchLab.hired + $researchLab.menials) < $researchLab.maxSpace>>
		Hire [[x1|Prosthetic Lab][$researchLab.hired += 1,cashX(-2000, "lab")]]
		<<if ($researchLab.maxSpace - ($researchLab.hired + $researchLab.menials)) >= 5>>
			| [[x5|Prosthetic Lab][$researchLab.hired += 5,cashX(-10000, "lab")]]
		<</if>>
		<<if ($researchLab.maxSpace - ($researchLab.hired + $researchLab.menials)) >= 10>>
			| [[x10|Prosthetic Lab][$researchLab.hired += 10,cashX(-10000, "lab")]]
		<</if>>
		scientists.

		   //Each scientist will require an initial fee of <<= cashFormat(2000)>> and incur <<= cashFormat(300)>> weekly.//

		<<if $menials > 0>>
			Assign [[x1|Prosthetic Lab][$researchLab.menials += 1,$menials -= 1]]
			<<if ($researchLab.maxSpace - ($researchLab.hired + $researchLab.menials)) >= 5 && $menials >= 5>>
				| [[x5|Prosthetic Lab][$researchLab.menials += 5,$menials -= 5]]
			<</if>>
			<<if ($researchLab.maxSpace - ($researchLab.hired + $researchLab.menials)) >= 10 && $menials >= 10>>
				| [[x10|Prosthetic Lab][$researchLab.menials += 10,$menials -= 10]]
			<</if>>
			menial slaves to lab.

		<<else>>You do not own any <<if $researchLab.menials != 0>>unassigned <</if>>menial slaves.

		<</if>>
		   //Using menial slaves is much cheaper than hiring scientists, but they are less effective. <<= cashFormat(100)>> per slave each week.//

	<<else>>
		   //Facility is fully staffed.//
	<</if>>

	<<if $researchLab.hired > 0>>
		Fire [[x1|Prosthetic Lab][$researchLab.hired -= 1]]
		<<if $researchLab.hired >= 5>>
			| [[x5|Prosthetic Lab][$researchLab.hired -= 5]]
		<</if>>
		<<if $researchLab.hired >= 10>>
			| [[x10|Prosthetic Lab][$researchLab.hired -= 10]]
		<</if>>
		| [[All|Prosthetic Lab][$researchLab.hired = 0]]
		scientists.
	<</if>>
	<<if $researchLab.menials > 0>>

		Dismiss [[x1|Prosthetic Lab][$researchLab.menials -= 1,$menials += 1]]
		<<if $researchLab.menials >= 5>>
			| [[x5|Prosthetic Lab][$researchLab.menials -= 5,$menials += 5]]
		<</if>>
		<<if $researchLab.menials >= 10>>
			| [[x10|Prosthetic Lab][$researchLab.menials -= 10,$menials += 10]]
		<</if>>
		| [[All|Prosthetic Lab][$menials += $researchLab.menials, $researchLab.menials = 0]]
		menial slaves.
	<</if>>

	__Tasks__

	<<if $researchLab.tasks.length > 0>>
		<<set _j = 0>>
		<<if $researchLab.speed > 0>>
			The following tasks are queued:
		<<else>>
			You have projects planned but without researchers you won't be able to work on them:
		<</if>>

		<<for _i = 0; _i < $researchLab.tasks.length; _i++>>

			<<switch $researchLab.tasks[_i].type>>
			<<case "research">>
				You <<if _i == 0>>are researching<<else>> plan to research<</if>>
			<<case "craft">>
				You <<if _i == 0>>are constructing<<else>> plan to construct<</if>>
			<<case "craftFit">>
				For @@.yellow;<<= SlaveFullName($slaves[$slaveIndices[$researchLab.tasks[_i].slaveID]])>>@@ you <<if _i == 0>>are constructing<<else>> plan to construct<</if>>
			<<default>>
				@@.red;Error: Unknown $researchLab.tasks[].type: $researchLab.tasks[_i].type@@
			<</switch>>
			<<set _j += $researchLab.tasks[_i].workLeft>>
			@@.yellow;<<= capFirstChar(setup.prosthetics[$researchLab.tasks[_i].id].name)>>@@.
			<<if $researchLab.speed > 0>>
				Finished in approximately <<= (Math.floor(_j / $researchLab.speed) + 1)>> week(s).
			<</if>>

			<<if $researchLab.tasks[_i].type == "research">>
				<<set _link = "Cancel: Will not return investments.">>
			<<else>>
				<<set _link = "Cancel">>
			<</if>>
			<<capture _i>>
				<<link _link "Prosthetic Lab">>
					<<if $researchLab.tasks[_i].type == "research">>
						<<set $prosthetics[$researchLab.tasks[_i].id].research = 0>>
					<</if>>
					<<set $researchLab.tasks.deleteAt(_i)>>
				<</link>>
			<</capture>>

		<</for>>
	<<else>>
		//Currently the research lab has no tasks planned.//
	<</if>>

	__Research__

	 Available research projects:

	<<for _p range setup.prostheticIDs>>
		<<if $prosthetics[_p].research == 0>>
			<<if _p != "erectile">> /*excludes erectile*/

			<<if setup.prosthetics[_p].level <= $prostheticsUpgrade>>
				<<capture _p>>
				<<link "Reverse engineer <<= capFirstChar(setup.prosthetics[_p].name)>>" "Prosthetic Lab">>
					<<set cashX(forceNeg(setup.prosthetics[_p].costs), "lab"), $prosthetics[_p].research = -1, $researchLab.tasks.push({type: "research", id: _p, workLeft: setup.prosthetics[_p].research})>>
				<</link>>
				<</capture>>
					//Costs <<= cashFormat(setup.prosthetics[_p].costs)>> of initial investment.//
			<<else>>
				//You need better contracts to get the needed research material for researching <<= capFirstChar(setup.prosthetics[_p].name)>>.//
			<</if>>

			<</if>>
		<</if>>
	<</for>>

	__Manufacture__

	Available building projects:

	<<for _p range setup.prostheticIDs>>
		<<if $prosthetics[_p].research == 1>>
			<<if _p != "erectile">> /*excludes erectile*/

			<<capture _p>>
			<<link "Build <<= addA(setup.prosthetics[_p].name)>>" "Prosthetic Lab">>
				<<set $researchLab.tasks.push({type: "craft", id: _p, workLeft: setup.prosthetics[_p].craft})>>
			<</link>>
			<</capture>>

			<</if>>
		<</if>>
	<</for>>

	 <<= ResearchLabStockPile()>>
<</if>>