code:
:: Multiple Organ Implant [nobr]

You head down to your <<if $surgeryUpgrade == 1>>heavily upgraded and customized remote surgery<<else>>remote surgery<</if>> and start having the slaves with <<if ($completedOrgans.length > 0) && ($adjustProstheticsCompleted > 0)>>organs or prosthetics <<elseif ($completedOrgans.length > 1)>>organs <<elseif ($adjustProstheticsCompleted > 1)>>prosthetics <</if>>that are ready be sent down.

/* builds a list for each slave and adds the appropriate organs to it */
<<for _i = 0; _i < $slaves.length; _i++>>
	<<set $activeSlave = $slaves[_i]>>
	<<setLocalPronouns $activeSlave>>
	<<set _slaveOrgans = {
		penis: 0,
		testicles: 0,
		scrotum: 0,
		pigTesticles: 0,
		canineTesticles: 0,
		horseTesticles: 0,
		cowTesticles: 0,
		foreskin: 0,
		ovaries: 0,
		freshOvaries: 0,
		asexualReproOvaries: 0,
		prostate: 0,
		pigOvaries: 0,
		canineOvaries: 0,
		horseOvaries: 0,
		cowOvaries: 0,
		eyes: 0,
		ears: 0,
		cochleae: 0,
		voicebox: 0,
		mpreg: 0,
		mpregPig: 0,
		mpregCanine: 0,
		mpregHorse: 0,
		mpregCow: 0
		}>>
	<<for _j = 0; _j < $completedOrgans.length; _j++>>
		<<if $activeSlave.ID == $completedOrgans[_j].ID>>
			<<if $completedOrgans[_j].type == "penis">>
				<<set _slaveOrgans.penis = $completedOrgans[_j]>>
				<<set $completedOrgans.deleteAt(_j),_j-->>
			<<elseif $completedOrgans[_j].type == "testicles">>
				<<set _slaveOrgans.testicles = $completedOrgans[_j]>>
				<<set $completedOrgans.deleteAt(_j),_j-->>
			<<elseif $completedOrgans[_j].type == "scrotum">>
				<<set _slaveOrgans.scrotum = $completedOrgans[_j]>>
				<<set $completedOrgans.deleteAt(_j),_j-->>
			<<elseif $completedOrgans[_j].type == "pigTesticles">>
				<<set _slaveOrgans.pigTesticles = $completedOrgans[_j]>>
				<<set $completedOrgans.deleteAt(_j),_j-->>
			<<elseif $completedOrgans[_j].type == "canineTesticles">>
				<<set _slaveOrgans.canineTesticles = $completedOrgans[_j]>>
				<<set $completedOrgans.deleteAt(_j),_j-->>
			<<elseif $completedOrgans[_j].type == "horseTesticles">>
				<<set _slaveOrgans.horseTesticles = $completedOrgans[_j]>>
				<<set $completedOrgans.deleteAt(_j),_j-->>
			<<elseif $completedOrgans[_j].type == "cowTesticles">>
				<<set _slaveOrgans.cowTesticles = $completedOrgans[_j]>>
				<<set $completedOrgans.deleteAt(_j),_j-->>
			<<elseif $completedOrgans[_j].type == "foreskin">>
				<<set _slaveOrgans.foreskin = $completedOrgans[_j]>>
				<<set $completedOrgans.deleteAt(_j),_j-->>
			<<elseif $completedOrgans[_j].type == "ovaries">>
				<<set _slaveOrgans.ovaries = $completedOrgans[_j]>>
				<<set $completedOrgans.deleteAt(_j),_j-->>
			<<elseif $completedOrgans[_j].type == "freshOvaries">>
				<<set _slaveOrgans.freshOvaries = $completedOrgans[_j]>>
				<<set $completedOrgans.deleteAt(_j),_j-->>
			<<elseif $completedOrgans[_j].type == "asexualReproOvaries">>
				<<set _slaveOrgans.asexualReproOvaries = $completedOrgans[_j]>>
				<<set $completedOrgans.deleteAt(_j),_j-->>
			<<elseif $completedOrgans[_j].type == "prostate">>
				<<set _slaveOrgans.prostate = $completedOrgans[_j]>>
				<<set $completedOrgans.deleteAt(_j),_j-->>
			<<elseif $completedOrgans[_j].type == "pigOvaries">>
				<<set _slaveOrgans.pigOvaries = $completedOrgans[_j]>>
				<<set $completedOrgans.deleteAt(_j),_j-->>
			<<elseif $completedOrgans[_j].type == "canineOvaries">>
				<<set _slaveOrgans.canineOvaries = $completedOrgans[_j]>>
				<<set $completedOrgans.deleteAt(_j),_j-->>
			<<elseif $completedOrgans[_j].type == "horseOvaries">>
				<<set _slaveOrgans.horseOvaries = $completedOrgans[_j]>>
				<<set $completedOrgans.deleteAt(_j),_j-->>
			<<elseif $completedOrgans[_j].type == "cowOvaries">>
				<<set _slaveOrgans.cowOvaries = $completedOrgans[_j]>>
				<<set $completedOrgans.deleteAt(_j),_j-->>
			<<elseif $completedOrgans[_j].type == "eyes">>
				<<set _slaveOrgans.eyes = $completedOrgans[_j]>>
				<<set $completedOrgans.deleteAt(_j),_j-->>
			<<elseif $completedOrgans[_j].type == "ears">>
				<<set _slaveOrgans.ears = $completedOrgans[_j]>>
				<<set $completedOrgans.deleteAt(_j),_j-->>
			<<elseif $completedOrgans[_j].type == "cochleae">>
				<<set _slaveOrgans.cochleae = $completedOrgans[_j]>>
				<<set $completedOrgans.deleteAt(_j),_j-->>
			<<elseif $completedOrgans[_j].type == "voicebox">>
				<<set _slaveOrgans.voicebox = $completedOrgans[_j]>>
				<<set $completedOrgans.deleteAt(_j),_j-->>
			<<elseif $completedOrgans[_j].type == "mpreg">>
				<<set _slaveOrgans.mpreg = $completedOrgans[_j]>>
				<<set $completedOrgans.deleteAt(_j),_j-->>
			<<elseif $completedOrgans[_j].type == "mpregPig">>
				<<set _slaveOrgans.mpregPig = $completedOrgans[_j]>>
				<<set $completedOrgans.deleteAt(_j),_j-->>
			<<elseif $completedOrgans[_j].type == "mpregCanine">>
				<<set _slaveOrgans.mpregCanine = $completedOrgans[_j]>>
				<<set $completedOrgans.deleteAt(_j),_j-->>
			<<elseif $completedOrgans[_j].type == "mpregHorse">>
				<<set _slaveOrgans.mpregHorse = $completedOrgans[_j]>>
				<<set $completedOrgans.deleteAt(_j),_j-->>
			<<elseif $completedOrgans[_j].type == "mpregCow">>
				<<set _slaveOrgans.mpregCow = $completedOrgans[_j]>>
				<<set $completedOrgans.deleteAt(_j),_j-->>
			<<else>>

Error: unrecognized organ.
			<</if>>
		<</if>>
	<</for>>
	/* read _slaveOrgans and install them when appropriate */
	/* order here is important, do not change it without good reason */
	/* eyes */
	<<if _slaveOrgans.eyes != 0>>
		<<if ($activeSlave.eyes == -2) && $activeSlave.eyesImplant == 0>>
			<<run cashX(forceNeg($surgeryCost), "slaveSurgery", $activeSlave)>>
			<<set $activeSlave.eyes = 1>>
			<<set $activeSlave.eyeColor = $activeSlave.origEye>>
			/* no way to salvage original eye color */
			<<set $activeSlave.health -= 20>>
			<<if $organFarmUpgrade == 2>>
				<<set $activeSlave.chem += 20>>
			<</if>>
			<<set $surgeryType = "unblind">>

			<<include "Surgery Degradation">>
		<<elseif $activeSlave.eyesImplant == 1>>
			<<run cashX(forceNeg($surgeryCost), "slaveSurgery", $activeSlave)>>
			<<set $stockpile.ocularImplant++>>
			<<set $activeSlave.eyes = 1>>
			<<set $activeSlave.eyeColor = $activeSlave.origEye>>
			<<set $activeSlave.health -= 20>>
			<<if $organFarmUpgrade == 2>>
				<<set $activeSlave.chem += 20>>
			<</if>>
			<<set $surgeryType = "newEyes">>
			<<include "Surgery Degradation">>
		<<else>>

			@@.red;Could not implant eyes on $activeSlave.slaveName: $he is not blind.@@
			<<set $completedOrgans.push(_slaveOrgans.eyes)>>
		<</if>>
	<</if>>
	/* ears */
	<<if _slaveOrgans.ears != 0>>
		<<if $activeSlave.earShape == "none">>
			<<run cashX(forceNeg($surgeryCost), "slaveSurgery", $activeSlave)>>
			<<set $activeSlave.earShape = "normal">>
			<<if $activeSlave.hears == -1>>
				<<set $activeSlave.hears = 0>>
			<</if>>
			<<set $activeSlave.health -= 15>>
			<<if $organFarmUpgrade == 2>>
				<<set $activeSlave.chem += 20>>
			<</if>>
			<<set $surgeryType = "earMinor">>

			<<include "Surgery Degradation">>
		<<else>>

			@@.red;Could not implant ears on $activeSlave.slaveName: $he already has them. Additional options available under individual surgery.@@
			<<set $completedOrgans.push(_slaveOrgans.ears)>>
		<</if>>
	<</if>>
	/* cochleae */
	<<if _slaveOrgans.cochleae != 0>>
		<<if ($activeSlave.hears == -2) && $activeSlave.earImplant != 1>>
			<<run cashX(forceNeg($surgeryCost), "slaveSurgery", $activeSlave)>>
			<<set $activeSlave.hears = 0>>
			<<set $activeSlave.health -= 20>>
			<<if $organFarmUpgrade == 2>>
				<<set $activeSlave.chem += 20>>
			<</if>>
			<<set $surgeryType = "undeafen">>

			<<include "Surgery Degradation">>
		<<elseif $activeSlave.earImplant == 1>>
			<<run cashX(forceNeg($surgeryCost), "slaveSurgery", $activeSlave)>>
			<<set $stockpile.cochlearImplant++>>
			<<set $activeSlave.hears = 0>>
			<<set $activeSlave.health -= 20>>
			<<if $organFarmUpgrade == 2>>
				<<set $activeSlave.chem += 20>>
			<</if>>
			<<set $surgeryType = "newEars">>
			<<include "Surgery Degradation">>
		<<else>>

			@@.red;Could not implant cochleae on $activeSlave.slaveName: $he is not deaf.@@
			<<set $completedOrgans.push(_slaveOrgans.cochleae)>>
		<</if>>
	<</if>>
	/* voice */
	<<if _slaveOrgans.voicebox != 0>>
		<<if ($activeSlave.voice == 0)>>
			<<run cashX(forceNeg($surgeryCost), "slaveSurgery", $activeSlave)>>
			<<if $activeSlave.ovaries == 1 && $activeSlave.hormoneBalance >= 200>>
				<<set $activeSlave.voice = 3>>
			<<elseif ($activeSlave.balls > 0) || ($activeSlave.hormoneBalance < -20)>>
				<<set $activeSlave.voice = 1>>
			<<else>>
				<<set $activeSlave.voice = 2>>
			<</if>>
			<<set $activeSlave.health -= 10>>
			<<if $organFarmUpgrade == 2>>
				<<set $activeSlave.chem += 10>>
			<</if>>
			<<set $surgeryType = "restoreVoice">>

			<<run Enunciate($activeSlave)>>
			<<include "Surgery Degradation">>
		<<else>>

			@@.red;Could not implant vocal cords on $activeSlave.slaveName: $he is not mute.@@
			<<set $completedOrgans.push(_slaveOrgans.voicebox)>>
		<</if>>
	<</if>>
	/* foreskin */
	<<if _slaveOrgans.foreskin != 0>>
		<<if ($activeSlave.foreskin == 0)>>
			<<run cashX(forceNeg($surgeryCost), "slaveSurgery", $activeSlave)>>
			<<if $activeSlave.dick > 0>>
				<<set $activeSlave.foreskin = $activeSlave.dick>>
			<<else>>
				<<set $activeSlave.foreskin = $activeSlave.clit>>
			<</if>>
			<<set $activeSlave.health -= 10>>
			<<if $organFarmUpgrade == 2>>
				<<set $activeSlave.chem += 10>>
			<</if>>
			<<set $surgeryType = "addForeskin">>

			<<include "Surgery Degradation">>
		<<else>>

			@@.red;Could not implant <<if $activeSlave.dick > 0>>foreskin<<else>>clitoral hood<</if>> on $activeSlave.slaveName: $he already has one.@@
			<<set $completedOrgans.push(_slaveOrgans.foreskin)>>
		<</if>>
	<</if>>
	/* prostate */
	<<if _slaveOrgans.prostate != 0>>
		<<if ($activeSlave.prostate == 0)>>
			<<run cashX(forceNeg($surgeryCost), "slaveSurgery", $activeSlave)>>
			<<set $activeSlave.prostate = 1>>
			<<set $activeSlave.health -= 20>>
			<<if $organFarmUpgrade == 2>>
				<<set $activeSlave.chem += 20>>
			<</if>>
			<<set $surgeryType = "addProstate">>

			<<include "Surgery Degradation">>
		<<else>>

			@@.red;Could not implant prostate on $activeSlave.slaveName: $he already has a prostate.@@
			<<set $completedOrgans.push(_slaveOrgans.prostate)>>
		<</if>>
	<</if>>
	/* ovaries */
	<<if _slaveOrgans.ovaries != 0>>
		<<if ($activeSlave.ovaries == 0) && ($activeSlave.vagina >= 0) && ($activeSlave.mpreg == 0) && ($activeSlave.bellyImplant == -1)>>
			<<run cashX(forceNeg($surgeryCost), "slaveSurgery", $activeSlave)>>
			<<set $activeSlave.ovaries = 1>>
			<<set $activeSlave.eggType = "human">>
			<<set $activeSlave.preg = 0>>
			<<set $activeSlave.health -= 20>>
			<<if $organFarmUpgrade == 2>>
				<<set $activeSlave.chem += 20>>
			<</if>>
			<<if $activeSlave.pubertyXX == 0>>
				<<if $precociousPuberty == 1>>
					<<if $activeSlave.physicalAge >= $fertilityAge>>
						<<set $activeSlave.pubertyAgeXX = ($activeSlave.physicalAge+1)>>
					<</if>>
				<<else>>
					<<if $activeSlave.physicalAge >= $fertilityAge>>
						<<set $activeSlave.pubertyXX = 1>>
					<</if>>
				<</if>>
			<</if>>
			<<set $surgeryType = "addOvaries">>

			<<include "Surgery Degradation">>
		<<elseif $activeSlave.ovaries == 1>>

			@@.red;Could not implant ovaries on $activeSlave.slaveName: $he already has ovaries.@@
			<<set $completedOrgans.push(_slaveOrgans.ovaries)>>
		<<elseif $activeSlave.vagina < 0>>

			@@.red;Could not implant ovaries on $activeSlave.slaveName: $he lacks a vagina.@@
			<<set $completedOrgans.push(_slaveOrgans.ovaries)>>
		<<elseif $activeSlave.bellyImplant >= 0>>

			@@.red;Could not implant ovaries on $activeSlave.slaveName: $he has a fillable abdominal implant.@@
			<<set $completedOrgans.push(_slaveOrgans.ovaries)>>
		<<elseif $activeSlave.mpreg != 0>>

			@@.red;Could not implant ovaries on $activeSlave.slaveName: $he has an anal womb.@@
			<<set $completedOrgans.push(_slaveOrgans.ovaries)>>
		<</if>>
	<</if>>
	/* asexual reproduction modifiction */
	<<if _slaveOrgans.asexualReproOvaries != 0>>
		<<if ($activeSlave.mpreg == 1 || $activeSlave.ovaries == 1)>>
			<<run cashX(forceNeg($surgeryCost), "slaveSurgery", $activeSlave)>>
			<<set $activeSlave.eggType = "human">>
			<<set $activeSlave.preg = 0>>
			<<set $activeSlave.health -= 20>>
			<<if $organFarmUpgrade == 2>>
				<<set $activeSlave.chem += 20>>
			<</if>>
			<<if $activeSlave.pubertyXX == 0>>
				<<if $precociousPuberty == 1>>
					<<if $activeSlave.physicalAge >= $fertilityAge>>
						<<set $activeSlave.pubertyAgeXX = ($activeSlave.physicalAge+1)>>
					<</if>>
				<<else>>
					<<if $activeSlave.physicalAge >= $fertilityAge>>
						<<set $activeSlave.pubertyXX = 1>>
					<</if>>
				<</if>>
			<</if>>
			<<set $surgeryType = "asexualReproOvaries">>

			<<include "Surgery Degradation">>
		<<else>>

			@@.red;Could not implant modified ovary in $activeSlave.slaveName: $he has no ovaries.@@
			<<set $completedOrgans.push(_slaveOrgans.asexualReproOvaries)>>
		<</if>>
	<</if>>
	/* pig ovaries */
	<<if _slaveOrgans.pigOvaries != 0>>
		<<if ($activeSlave.ovaries == 0) && ($activeSlave.vagina >= 0) && ($activeSlave.mpreg == 0) && ($activeSlave.bellyImplant == -1)>>
			<<run cashX(forceNeg($surgeryCost), "slaveSurgery", $activeSlave)>>
			<<set $activeSlave.ovaries = 1>>
			<<set $activeSlave.eggType = "pig">>
			<<set $activeSlave.preg = 0>>
			<<set $activeSlave.health -= 20>>
			<<if $organFarmUpgrade == 2>>
				<<set $activeSlave.chem += 20>>
			<</if>>
			<<if $activeSlave.pubertyXX == 0>>
				<<if $precociousPuberty == 1>>
					<<if $activeSlave.physicalAge >= $fertilityAge>>
						<<set $activeSlave.pubertyAgeXX = ($activeSlave.physicalAge+1)>>
					<</if>>
				<<else>>
					<<if $activeSlave.physicalAge >= $fertilityAge>>
						<<set $activeSlave.pubertyXX = 1>>
					<</if>>
				<</if>>
			<</if>>
			<<set $surgeryType = "addAnimalOvaries">>

			<<include "Surgery Degradation">>
		<<elseif $activeSlave.ovaries == 1>>

			@@.red;Could not implant pig ovaries on $activeSlave.slaveName: $he already has ovaries.@@
			<<set $completedOrgans.push(_slaveOrgans.pigOvaries)>>
		<<elseif $activeSlave.vagina < 0>>

			@@.red;Could not implant pig ovaries on $activeSlave.slaveName: $he lacks a vagina.@@
			<<set $completedOrgans.push(_slaveOrgans.pigOvaries)>>
		<<elseif $activeSlave.bellyImplant >= 0>>

			@@.red;Could not implant pig ovaries on $activeSlave.slaveName: $he has a fillable abdominal implant.@@
			<<set $completedOrgans.push(_slaveOrgans.pigOvaries)>>
		<<elseif $activeSlave.mpreg != 0>>

			@@.red;Could not implant pig ovaries on $activeSlave.slaveName: $he has an anal womb.@@
			<<set $completedOrgans.push(_slaveOrgans.pigOvaries)>>
		<</if>>
	<</if>>
	/* dog ovaries */
	<<if _slaveOrgans.canineOvaries != 0>>
		<<if ($activeSlave.ovaries == 0) && ($activeSlave.vagina >= 0) && ($activeSlave.mpreg == 0) && ($activeSlave.bellyImplant == -1)>>
			<<run cashX(forceNeg($surgeryCost), "slaveSurgery", $activeSlave)>>
			<<set $activeSlave.ovaries = 1>>
			<<set $activeSlave.eggType = "dog">>
			<<set $activeSlave.preg = 0>>
			<<set $activeSlave.health -= 20>>
			<<if $organFarmUpgrade == 2>>
				<<set $activeSlave.chem += 20>>
			<</if>>
			<<if $activeSlave.pubertyXX == 0>>
				<<if $precociousPuberty == 1>>
					<<if $activeSlave.physicalAge >= $fertilityAge>>
						<<set $activeSlave.pubertyAgeXX = ($activeSlave.physicalAge+1)>>
					<</if>>
				<<else>>
					<<if $activeSlave.physicalAge >= $fertilityAge>>
						<<set $activeSlave.pubertyXX = 1>>
					<</if>>
				<</if>>
			<</if>>
			<<set $surgeryType = "addAnimalOvaries">>

			<<include "Surgery Degradation">>
		<<elseif $activeSlave.ovaries == 1>>

			@@.red;Could not implant dog ovaries on $activeSlave.slaveName: $he already has ovaries.@@
			<<set $completedOrgans.push(_slaveOrgans.canineOvaries)>>
		<<elseif $activeSlave.vagina < 0>>

			@@.red;Could not implant dog ovaries on $activeSlave.slaveName: $he lacks a vagina.@@
			<<set $completedOrgans.push(_slaveOrgans.canineOvaries)>>
		<<elseif $activeSlave.bellyImplant >= 0>>

			@@.red;Could not implant dog ovaries on $activeSlave.slaveName: $he has a fillable abdominal implant.@@
			<<set $completedOrgans.push(_slaveOrgans.canineOvaries)>>
		<<elseif $activeSlave.mpreg != 0>>

			@@.red;Could not implant dog ovaries on $activeSlave.slaveName: $he has an anal womb.@@
			<<set $completedOrgans.push(_slaveOrgans.canineOvaries)>>
		<</if>>
	<</if>>
	/* horse ovaries */
	<<if _slaveOrgans.horseOvaries != 0>>
		<<if ($activeSlave.ovaries == 0) && ($activeSlave.vagina >= 0) && ($activeSlave.mpreg == 0) && ($activeSlave.bellyImplant == -1)>>
			<<run cashX(forceNeg($surgeryCost), "slaveSurgery", $activeSlave)>>
			<<set $activeSlave.ovaries = 1>>
			<<set $activeSlave.eggType = "horse">>
			<<set $activeSlave.preg = 0>>
			<<set $activeSlave.health -= 20>>
			<<if $organFarmUpgrade == 2>>
				<<set $activeSlave.chem += 20>>
			<</if>>
			<<if $activeSlave.pubertyXX == 0>>
				<<if $precociousPuberty == 1>>
					<<if $activeSlave.physicalAge >= $fertilityAge>>
						<<set $activeSlave.pubertyAgeXX = ($activeSlave.physicalAge+1)>>
					<</if>>
				<<else>>
					<<if $activeSlave.physicalAge >= $fertilityAge>>
						<<set $activeSlave.pubertyXX = 1>>
					<</if>>
				<</if>>
			<</if>>
			<<set $surgeryType = "addAnimalOvaries">>

			<<include "Surgery Degradation">>
		<<elseif $activeSlave.ovaries == 1>>

			@@.red;Could not implant horse ovaries on $activeSlave.slaveName: $he already has ovaries.@@
			<<set $completedOrgans.push(_slaveOrgans.horseOvaries)>>
		<<elseif $activeSlave.vagina < 0>>

			@@.red;Could not implant horse ovaries on $activeSlave.slaveName: $he lacks a vagina.@@
			<<set $completedOrgans.push(_slaveOrgans.horseOvaries)>>
		<<elseif $activeSlave.bellyImplant >= 0>>

			@@.red;Could not implant horse ovaries on $activeSlave.slaveName: $he has a fillable abdominal implant.@@
			<<set $completedOrgans.push(_slaveOrgans.horseOvaries)>>
		<<elseif $activeSlave.mpreg != 0>>

			@@.red;Could not implant horse ovaries on $activeSlave.slaveName: $he has an anal womb.@@
			<<set $completedOrgans.push(_slaveOrgans.horseOvaries)>>
		<</if>>
	<</if>>
	/* cow ovaries */
	<<if _slaveOrgans.cowOvaries != 0>>
		<<if ($activeSlave.ovaries == 0) && ($activeSlave.vagina >= 0) && ($activeSlave.mpreg == 0) && ($activeSlave.bellyImplant == -1)>>
			<<run cashX(forceNeg($surgeryCost), "slaveSurgery", $activeSlave)>>
			<<set $activeSlave.ovaries = 1>>
			<<set $activeSlave.eggType = "cow">>
			<<set $activeSlave.preg = 0>>
			<<set $activeSlave.health -= 20>>
			<<if $organFarmUpgrade == 2>>
				<<set $activeSlave.chem += 20>>
			<</if>>
			<<if $activeSlave.pubertyXX == 0>>
				<<if $precociousPuberty == 1>>
					<<if $activeSlave.physicalAge >= $fertilityAge>>
						<<set $activeSlave.pubertyAgeXX = ($activeSlave.physicalAge+1)>>
					<</if>>
				<<else>>
					<<if $activeSlave.physicalAge >= $fertilityAge>>
						<<set $activeSlave.pubertyXX = 1>>
					<</if>>
				<</if>>
			<</if>>
			<<set $surgeryType = "addAnimalOvaries">>

			<<include "Surgery Degradation">>
		<<elseif $activeSlave.ovaries == 1>>

			@@.red;Could not implant cow ovaries on $activeSlave.slaveName: $he already has ovaries.@@
			<<set $completedOrgans.push(_slaveOrgans.cowOvaries)>>
		<<elseif $activeSlave.vagina < 0>>

			@@.red;Could not implant cow ovaries on $activeSlave.slaveName: $he lacks a vagina.@@
			<<set $completedOrgans.push(_slaveOrgans.cowOvaries)>>
		<<elseif $activeSlave.bellyImplant >= 0>>

			@@.red;Could not implant cow ovaries on $activeSlave.slaveName: $he has a fillable abdominal implant.@@
			<<set $completedOrgans.push(_slaveOrgans.cowOvaries)>>
		<<elseif $activeSlave.mpreg != 0>>

			@@.red;Could not implant cow ovaries on $activeSlave.slaveName: $he has an anal womb.@@
			<<set $completedOrgans.push(_slaveOrgans.cowOvaries)>>
		<</if>>
	<</if>>
	/* male preg */
	<<if _slaveOrgans.mpreg != 0>>
		<<if ($activeSlave.ovaries == 0) && ($activeSlave.vagina < 0) && ($activeSlave.mpreg == 0) && ($activeSlave.bellyImplant == -1)>>
			<<run cashX(forceNeg($surgeryCost), "slaveSurgery", $activeSlave)>>
			<<set $activeSlave.mpreg = 1>>
			<<set $activeSlave.eggType = "human">>
			<<set $activeSlave.preg = 0>>
			<<set $activeSlave.health -= 40>>
			<<if $organFarmUpgrade == 2>>
				<<set $activeSlave.chem += 20>>
			<</if>>
			<<if $activeSlave.pubertyXX == 0>>
				<<if $precociousPuberty == 1>>
					<<if $activeSlave.physicalAge >= $fertilityAge>>
						<<set $activeSlave.pubertyAgeXX = ($activeSlave.physicalAge+1)>>
					<</if>>
				<<else>>
					<<if $activeSlave.physicalAge >= $fertilityAge>>
						<<set $activeSlave.pubertyXX = 1>>
					<</if>>
				<</if>>
			<</if>>
			<<set $surgeryType = "mpreg">>

			<<include "Surgery Degradation">>
		<<elseif $activeSlave.ovaries == 1>>

			@@.red;Could not implant anal womb on $activeSlave.slaveName: $he has ovaries.@@
			<<set $completedOrgans.push(_slaveOrgans.mpreg)>>
		<<elseif $activeSlave.vagina < 0>>

			@@.red;Could not implant anal womb on $activeSlave.slaveName: $he has a vagina.@@
			<<set $completedOrgans.push(_slaveOrgans.mpreg)>>
		<<elseif $activeSlave.bellyImplant >= 0>>

			@@.red;Could not implant anal womb on $activeSlave.slaveName: $he has a fillable abdominal implant.@@
			<<set $completedOrgans.push(_slaveOrgans.mpreg)>>
		<<elseif $activeSlave.mpreg == 1>>

			@@.red;Could not implant anal womb on $activeSlave.slaveName: $he already has an anal womb.@@
			<<set $completedOrgans.push(_slaveOrgans.mpreg)>>
		<</if>>
	<</if>>
	/* male pig preg */
	<<if _slaveOrgans.mpregPig != 0>>
		<<if ($activeSlave.ovaries == 0) && ($activeSlave.vagina < 0) && ($activeSlave.mpreg == 0) && ($activeSlave.bellyImplant == -1)>>
			<<run cashX(forceNeg($surgeryCost), "slaveSurgery", $activeSlave)>>
			<<set $activeSlave.mpreg = 1>>
			<<set $activeSlave.eggType = "pig">>
			<<set $activeSlave.preg = 0>>
			<<set $activeSlave.health -= 40>>
			<<if $organFarmUpgrade == 2>>
				<<set $activeSlave.chem += 20>>
			<</if>>
			<<if $activeSlave.pubertyXX == 0>>
				<<if $precociousPuberty == 1>>
					<<if $activeSlave.physicalAge >= $fertilityAge>>
						<<set $activeSlave.pubertyAgeXX = ($activeSlave.physicalAge+1)>>
					<</if>>
				<<else>>
					<<if $activeSlave.physicalAge >= $fertilityAge>>
						<<set $activeSlave.pubertyXX = 1>>
					<</if>>
				<</if>>
			<</if>>
			<<set $surgeryType = "mpregAnimal">>

			<<include "Surgery Degradation">>
		<<elseif $activeSlave.ovaries == 1>>

			@@.red;Could not implant pig anal womb on $activeSlave.slaveName: $he has ovaries.@@
			<<set $completedOrgans.push(_slaveOrgans.mpregPig)>>
		<<elseif $activeSlave.vagina < 0>>

			@@.red;Could not implant pig anal womb on $activeSlave.slaveName: $he has a vagina.@@
			<<set $completedOrgans.push(_slaveOrgans.mpregPig)>>
		<<elseif $activeSlave.bellyImplant >= 0>>

			@@.red;Could not implant pig anal womb on $activeSlave.slaveName: $he has a fillable abdominal implant.@@
			<<set $completedOrgans.push(_slaveOrgans.mpregPig)>>
		<<elseif $activeSlave.mpreg != 0>>

			@@.red;Could not implant pig anal womb on $activeSlave.slaveName: $he already has an anal womb.@@
			<<set $completedOrgans.push(_slaveOrgans.mpregPig)>>
		<</if>>
	<</if>>
	/* male dog preg */
	<<if _slaveOrgans.mpregCanine != 0>>
		<<if ($activeSlave.ovaries == 0) && ($activeSlave.vagina < 0) && ($activeSlave.mpreg == 0) && ($activeSlave.bellyImplant == -1)>>
			<<run cashX(forceNeg($surgeryCost), "slaveSurgery", $activeSlave)>>
			<<set $activeSlave.mpreg = 1>>
			<<set $activeSlave.eggType = "dog">>
			<<set $activeSlave.preg = 0>>
			<<set $activeSlave.health -= 40>>
			<<if $organFarmUpgrade == 2>>
				<<set $activeSlave.chem += 20>>
			<</if>>
			<<if $activeSlave.pubertyXX == 0>>
				<<if $precociousPuberty == 1>>
					<<if $activeSlave.physicalAge >= $fertilityAge>>
						<<set $activeSlave.pubertyAgeXX = ($activeSlave.physicalAge+1)>>
					<</if>>
				<<else>>
					<<if $activeSlave.physicalAge >= $fertilityAge>>
						<<set $activeSlave.pubertyXX = 1>>
					<</if>>
				<</if>>
			<</if>>
			<<set $surgeryType = "mpregAnimal">>

			<<include "Surgery Degradation">>
		<<elseif $activeSlave.ovaries == 1>>

			@@.red;Could not implant dog anal womb on $activeSlave.slaveName: $he has ovaries.@@
			<<set $completedOrgans.push(_slaveOrgans.mpregCanine)>>
		<<elseif $activeSlave.vagina < 0>>

			@@.red;Could not implant dog anal womb on $activeSlave.slaveName: $he has a vagina.@@
			<<set $completedOrgans.push(_slaveOrgans.mpregCanine)>>
		<<elseif $activeSlave.bellyImplant >= 0>>

			@@.red;Could not implant dog anal womb on $activeSlave.slaveName: $he has a fillable abdominal implant.@@
			<<set $completedOrgans.push(_slaveOrgans.mpregCanine)>>
		<<elseif $activeSlave.mpreg != 0>>

			@@.red;Could not implant dog anal womb on $activeSlave.slaveName: $he already has an anal womb.@@
			<<set $completedOrgans.push(_slaveOrgans.mpregCanine)>>
		<</if>>
	<</if>>
	/* male horse preg */
	<<if _slaveOrgans.mpregHorse != 0>>
		<<if ($activeSlave.ovaries == 0) && ($activeSlave.vagina < 0) && ($activeSlave.mpreg == 0) && ($activeSlave.bellyImplant == -1)>>
			<<run cashX(forceNeg($surgeryCost), "slaveSurgery", $activeSlave)>>
			<<set $activeSlave.mpreg = 1>>
			<<set $activeSlave.eggType = "horse">>
			<<set $activeSlave.preg = 0>>
			<<set $activeSlave.health -= 40>>
			<<if $organFarmUpgrade == 2>>
				<<set $activeSlave.chem += 20>>
			<</if>>
			<<if $activeSlave.pubertyXX == 0>>
				<<if $precociousPuberty == 1>>
					<<if $activeSlave.physicalAge >= $fertilityAge>>
						<<set $activeSlave.pubertyAgeXX = ($activeSlave.physicalAge+1)>>
					<</if>>
				<<else>>
					<<if $activeSlave.physicalAge >= $fertilityAge>>
						<<set $activeSlave.pubertyXX = 1>>
					<</if>>
				<</if>>
			<</if>>
			<<set $surgeryType = "mpregAnimal">>

			<<include "Surgery Degradation">>
		<<elseif $activeSlave.ovaries == 1>>

			@@.red;Could not implant horse anal womb on $activeSlave.slaveName: $he has ovaries.@@
			<<set $completedOrgans.push(_slaveOrgans.mpregHorse)>>
		<<elseif $activeSlave.vagina < 0>>

			@@.red;Could not implant horse anal womb on $activeSlave.slaveName: $he has a vagina.@@
			<<set $completedOrgans.push(_slaveOrgans.mpregHorse)>>
		<<elseif $activeSlave.bellyImplant >= 0>>

			@@.red;Could not implant horse anal womb on $activeSlave.slaveName: $he has a fillable abdominal implant.@@
			<<set $completedOrgans.push(_slaveOrgans.mpregHorse)>>
		<<elseif $activeSlave.mpreg != 0>>

			@@.red;Could not implant horse anal womb on $activeSlave.slaveName: $he already has an anal womb.@@
			<<set $completedOrgans.push(_slaveOrgans.mpregHorse)>>
		<</if>>
	<</if>>
	/* male cow preg */
	<<if _slaveOrgans.mpregCow != 0>>
		<<if ($activeSlave.ovaries == 0) && ($activeSlave.vagina < 0) && ($activeSlave.mpreg == 0) && ($activeSlave.bellyImplant == -1)>>
			<<run cashX(forceNeg($surgeryCost), "slaveSurgery", $activeSlave)>>
			<<set $activeSlave.mpreg = 1>>
			<<set $activeSlave.eggType = "cow">>
			<<set $activeSlave.preg = 0>>
			<<set $activeSlave.health -= 40>>
			<<if $organFarmUpgrade == 2>>
				<<set $activeSlave.chem += 20>>
			<</if>>
			<<if $activeSlave.pubertyXX == 0>>
				<<if $precociousPuberty == 1>>
					<<if $activeSlave.physicalAge >= $fertilityAge>>
						<<set $activeSlave.pubertyAgeXX = ($activeSlave.physicalAge+1)>>
					<</if>>
				<<else>>
					<<if $activeSlave.physicalAge >= $fertilityAge>>
						<<set $activeSlave.pubertyXX = 1>>
					<</if>>
				<</if>>
			<</if>>
			<<set $surgeryType = "mpregAnimal">>

			<<include "Surgery Degradation">>
		<<elseif $activeSlave.ovaries == 1>>

			@@.red;Could not implant cow anal womb on $activeSlave.slaveName: $he has ovaries.@@
			<<set $completedOrgans.push(_slaveOrgans.mpregCow)>>
		<<elseif $activeSlave.vagina < 0>>

			@@.red;Could not implant cow anal womb on $activeSlave.slaveName: $he has a vagina.@@
			<<set $completedOrgans.push(_slaveOrgans.mpregCow)>>
		<<elseif $activeSlave.bellyImplant >= 0>>

			@@.red;Could not implant cow anal womb on $activeSlave.slaveName: $he has a fillable abdominal implant.@@
			<<set $completedOrgans.push(_slaveOrgans.mpregCow)>>
		<<elseif $activeSlave.mpreg != 0>>

			@@.red;Could not implant cow anal womb on $activeSlave.slaveName: $he already has an anal womb.@@
			<<set $completedOrgans.push(_slaveOrgans.mpregCow)>>
		<</if>>
	<</if>>
	/* ovary renewal */
	<<if _slaveOrgans.freshOvaries != 0>>
		<<if (($activeSlave.ovaries == 1) || ($activeSlave.mpreg == 1)) && ($activeSlave.bellyImplant == -1) && ($activeSlave.physicalAge < 60)>>
			<<run cashX(forceNeg($surgeryCost), "slaveSurgery", $activeSlave)>>
			<<if $activeSlave.ovaryAge >= 47>>
				<<set $activeSlave.ovaryAge = 45>>
			<<else>>
				<<set $activeSlave.ovaryAge -= 2>> /* It shouldn't matter if this goes negative as it is just a signal for menopause to occur. */
			<</if>>
			<<if $activeSlave.preg < 0>>
				<<set $activeSlave.preg = 0>>
			<</if>>
			<<set $activeSlave.health -= 20>>
			<<if $organFarmUpgrade == 2>>
				<<set $activeSlave.chem += 20>>
			<</if>>
			<<if $activeSlave.pubertyXX == 0>>
				<<if $precociousPuberty == 1>>
					<<if $activeSlave.physicalAge >= $fertilityAge>>
						<<set $activeSlave.pubertyAgeXX = ($activeSlave.physicalAge+1)>>
					<</if>>
				<<else>>
					<<if $activeSlave.physicalAge >= $fertilityAge>>
						<<set $activeSlave.pubertyXX = 1>>
					<</if>>
				<</if>>
			<</if>>
			<<set $surgeryType = "freshOvaries">>

			<<include "Surgery Degradation">>
		<<elseif ($activeSlave.physicalAge >= 70)>>

			@@.red;This slave's body is too old to handle pregnancy.@@
		<<elseif ($activeSlave.mpreg == 0 && $activeSlave.ovaries == 0) || $activeSlave.bellyImplant != -1>>

			@@.red;This slave lacks a viable womb to accept fertile ovaries.@@
			<<set $completedOrgans.push(_slaveOrgans.freshOvaries)>>
		<</if>>
	<</if>>
	/* penis */
	<<if _slaveOrgans.penis != 0>>
		<<if $activeSlave.dick == 0>>
			<<run cashX(forceNeg($surgeryCost), "slaveSurgery", $activeSlave)>>
			<<if $activeSlave.prostate == 0>>
				<<set $activeSlave.prostate = 1>>
			<</if>>
			<<set $activeSlave.dick = 2>>
			<<set $activeSlave.clit = 0>>
			<<set $activeSlave.foreskin = $activeSlave.dick>>
			<<set $activeSlave.health -= 20>>
			<<set $surgeryType = "addDick">>

			<<include "Surgery Degradation">>
		<<else>>
			@@.red;Could not implant penis on $activeSlave.slaveName: $he already has a penis.@@
			<<set $completedOrgans.push(_slaveOrgans.penis)>>
		<</if>>
	<</if>>
	/* testicles */
	<<if _slaveOrgans.testicles != 0>>
		<<if ($activeSlave.dick >= 1) && ($activeSlave.balls == 0)>>
			<<run cashX(forceNeg($surgeryCost), "slaveSurgery", $activeSlave)>>
			<<if $activeSlave.prostate == 0>>
				<<set $activeSlave.prostate = 1>>
			<</if>>
			<<set $activeSlave.balls = 2>>
			<<set $activeSlave.ballType = "human">>
			<<set $activeSlave.scrotum = 2>>
			<<set $activeSlave.health -= 20>>
			<<if $organFarmUpgrade == 2>>
				<<set $activeSlave.chem += 20>>
			<</if>>
			<<if $activeSlave.pubertyXY == 0>>
				<<if $precociousPuberty == 1>>
					<<if $activeSlave.physicalAge >= $potencyAge>>
						<<set $activeSlave.pubertyAgeXY = ($activeSlave.physicalAge+1)>>
					<</if>>
				<<else>>
					<<if $activeSlave.physicalAge >= $potencyAge>>
						<<set $activeSlave.pubertyXY = 1>>
					<</if>>
				<</if>>
			<</if>>
			<<set $surgeryType = "addBalls">>

			<<include "Surgery Degradation">>
		<<elseif $activeSlave.dick == 0>>

			@@.red;Could not implant testicles on $activeSlave.slaveName: $he lacks a penis.@@
			<<set $completedOrgans.push(_slaveOrgans.testicles)>>
		<<else>>

			@@.red;Could not implant testicles on $activeSlave.slaveName: $he already has testicles.@@
			<<set $completedOrgans.push(_slaveOrgans.testicles)>>
		<</if>>
	<</if>>
	/* pig testicles */
	<<if _slaveOrgans.pigTesticles != 0>>
		<<if ($activeSlave.dick >= 1) && ($activeSlave.balls == 0)>>
			<<run cashX(forceNeg($surgeryCost), "slaveSurgery", $activeSlave)>>
			<<set $activeSlave.balls = 3>>
			<<set $activeSlave.scrotum = 3>>
			<<set $activeSlave.ballType = "pig">>
			<<set $activeSlave.health -= 20>>
			<<if $organFarmUpgrade == 2>>
				<<set $activeSlave.chem += 20>>
			<</if>>
			<<if $activeSlave.pubertyXY == 0>>
				<<if $precociousPuberty == 1>>
					<<if $activeSlave.physicalAge >= $potencyAge>>
						<<set $activeSlave.pubertyAgeXY = ($activeSlave.physicalAge+1)>>
					<</if>>
				<<else>>
					<<if $activeSlave.physicalAge >= $potencyAge>>
						<<set $activeSlave.pubertyXY = 1>>
					<</if>>
				<</if>>
			<</if>>
			<<set $surgeryType = "addAnimalBalls">>

			<<include "Surgery Degradation">>
		<<elseif $activeSlave.dick == 0>>

			@@.red;Could not implant pig testicles on $activeSlave.slaveName: $he lacks a penis.@@
			<<set $completedOrgans.push(_slaveOrgans.pigTesticles)>>
		<<else>>

			@@.red;Could not implant pig testicles on $activeSlave.slaveName: $he already has testicles.@@
			<<set $completedOrgans.push(_slaveOrgans.pigTesticles)>>
		<</if>>
	<</if>>
	/* dog testicles */
	<<if _slaveOrgans.canineTesticles != 0>>
		<<if ($activeSlave.dick >= 0) && ($activeSlave.balls == 0)>>
			<<run cashX(forceNeg($surgeryCost), "slaveSurgery", $activeSlave)>>
			<<set $activeSlave.balls = 2>>
			<<set $activeSlave.ballType = "dog">>
			<<set $activeSlave.scrotum = 2>>
			<<set $activeSlave.health -= 20>>
			<<if $organFarmUpgrade == 2>>
				<<set $activeSlave.chem += 20>>
			<</if>>
			<<if $activeSlave.pubertyXY == 0>>
				<<if $precociousPuberty == 1>>
					<<if $activeSlave.physicalAge >= $potencyAge>>
						<<set $activeSlave.pubertyAgeXY = ($activeSlave.physicalAge+1)>>
					<</if>>
				<<else>>
					<<if $activeSlave.physicalAge >= $potencyAge>>
						<<set $activeSlave.pubertyXY = 1>>
					<</if>>
				<</if>>
			<</if>>

			<<set $surgeryType = "addAnimalBalls">>

			<<include "Surgery Degradation">>
		<<elseif $activeSlave.dick == 0>>

			@@.red;Could not implant dog testicles on $activeSlave.slaveName: $he lacks a penis.@@
			<<set $completedOrgans.push(_slaveOrgans.canineTesticles)>>
		<<else>>

			@@.red;Could not implant dog testicles on $activeSlave.slaveName: $he already has testicles.@@
			<<set $completedOrgans.push(_slaveOrgans.canineTesticles)>>
		<</if>>
	<</if>>
	/* horse testicles */
	<<if _slaveOrgans.horseTesticles != 0>>
		<<if ($activeSlave.dick >= 1) && ($activeSlave.balls == 0)>>
			<<run cashX(forceNeg($surgeryCost), "slaveSurgery", $activeSlave)>>
			<<set $activeSlave.balls = 3>>
			<<set $activeSlave.scrotum = 3>>
			<<set $activeSlave.ballType = "horse">>
			<<set $activeSlave.health -= 20>>
			<<if $organFarmUpgrade == 2>>
				<<set $activeSlave.chem += 20>>
			<</if>>
			<<if $activeSlave.pubertyXY == 0>>
				<<if $precociousPuberty == 1>>
					<<if $activeSlave.physicalAge >= $potencyAge>>
						<<set $activeSlave.pubertyAgeXY = ($activeSlave.physicalAge+1)>>
					<</if>>
				<<else>>
					<<if $activeSlave.physicalAge >= $potencyAge>>
						<<set $activeSlave.pubertyXY = 1>>
					<</if>>
				<</if>>
			<</if>>
			<<set $surgeryType = "addAnimalBalls">>

			<<include "Surgery Degradation">>
		<<elseif $activeSlave.dick == 0>>

			@@.red;Could not implant horse testicles on $activeSlave.slaveName: $he lacks a penis.@@
			<<set $completedOrgans.push(_slaveOrgans.horseTesticles)>>
		<<else>>

			@@.red;Could not implant horse testicles on $activeSlave.slaveName: $he already has testicles.@@
			<<set $completedOrgans.push(_slaveOrgans.horseTesticles)>>
		<</if>>
	<</if>>
	/* cow testicles */
	<<if _slaveOrgans.cowTesticles != 0>>
		<<if ($activeSlave.dick >= 1) && ($activeSlave.balls == 0)>>
			<<run cashX(forceNeg($surgeryCost), "slaveSurgery", $activeSlave)>>
			<<set $activeSlave.balls = 3>>
			<<set $activeSlave.scrotum = 3>>
			<<set $activeSlave.ballType = "cow">>
			<<set $activeSlave.health -= 20>>
			<<if $organFarmUpgrade == 2>>
				<<set $activeSlave.chem += 20>>
			<</if>>
			<<if $activeSlave.pubertyXY == 0>>
				<<if $precociousPuberty == 1>>
					<<if $activeSlave.physicalAge >= $potencyAge>>
						<<set $activeSlave.pubertyAgeXY = ($activeSlave.physicalAge+1)>>
					<</if>>
				<<else>>
					<<if $activeSlave.physicalAge >= $potencyAge>>
						<<set $activeSlave.pubertyXY = 1>>
					<</if>>
				<</if>>
			<</if>>
			<<set $surgeryType = "addAnimalBalls">>

			<<include "Surgery Degradation">>
		<<elseif $activeSlave.dick == 0>>

			@@.red;Could not implant cow testicles on $activeSlave.slaveName: $he lacks a penis.@@
			<<set $completedOrgans.push(_slaveOrgans.cowTesticles)>>
		<<else>>

			@@.red;Could not implant cow testicles on $activeSlave.slaveName: $he already has testicles.@@
			<<set $completedOrgans.push(_slaveOrgans.cowTesticles)>>
		<</if>>
	<</if>>
	/* scrotum */
	<<if _slaveOrgans.scrotum != 0>>
		<<if ($activeSlave.scrotum == 0) && ($activeSlave.balls >= 1)>>
			<<run cashX(forceNeg($surgeryCost), "slaveSurgery", $activeSlave)>>
			<<set $activeSlave.scrotum = $activeSlave.balls>>
			<<set $activeSlave.health -= 10>>
			<<if $organFarmUpgrade == 2>>
				<<set $activeSlave.chem += 10>>
			<</if>>
			<<set $surgeryType = "addScrotum">>

			<<include "Surgery Degradation">>
		<<elseif $activeSlave.balls == 0>>

			@@.red;Could not implant scrotum on $activeSlave.slaveName: $he lacks testicles.@@
			<<set $completedOrgans.push(_slaveOrgans.scrotum)>>
		<<else>>

			@@.red;Could not implant scrotum on $activeSlave.slaveName: $he already has a scrotum.@@
			<<set $completedOrgans.push(_slaveOrgans.scrotum)>>
		<</if>>
	<</if>>
	/* finished checking _slaveOrgans */

	/* start prosthetics */
	<<if $adjustProstheticsCompleted > 0>>
	<<for _k = 0; _k < $adjustProsthetics.length; _k++>>
	<<set _p = $adjustProsthetics[_k]>>
	<<if _p.slaveID == $activeSlave.ID && _p.workLeft <= 0>>
		<<set $adjustProsthetics.splice(_k, 1), _k-->>
		<<set $activeSlave.readyProsthetics.push({id: _p.id})>>

		<<if $activeSlave.health < -40>>
			@@.red;Slave unhealthy: Skipping Slave@@
			<<continue>>/* no break so that all prosthetics will be checked */
		<</if>>
		<<switch _p.id>>
		<<case "ocular">>
			<<if $activeSlave.eyes < -1>>
				<<set $activeSlave.eyesImplant = 1, cashX(forceNeg($surgeryCost), "slaveSurgery", $activeSlave), $activeSlave.health -= 20, $surgeryType = "ocular implant">>
				<<include "Surgery Degradation">>
			<<else>>
				//Since $he has working eyes the <<= setup.prosthetics.ocular.name>> will be put into storage.//
			<</if>>
		<<case "cochlear">>
			<<if $activeSlave.hears != 0>>
				<<set $activeSlave.earImplant = 1, cashX(forceNeg($surgeryCost), "slaveSurgery", $activeSlave), $activeSlave.health -= 20, $surgeryType = "cochlear implant">>
				<<include "Surgery Degradation">>
			<<else>>
				//Since $he has working ears the <<= setup.prosthetics.cochlear.name>> will be put into storage.//
			<</if>>
		<<case "electrolarynx">>
			<<if $activeSlave.voice <= 0>>
				<<set $activeSlave.electrolarynx = 1, $activeSlave.voice = 2, cashX(forceNeg($surgeryCost), "slaveSurgery", $activeSlave), $activeSlave.health -= 20, $surgeryType = "electrolarynx">>
				<<include "Surgery Degradation">>
			<<else>>
				//Since $he has a voice the <<= setup.prosthetics.electrolarynx.name>> will be put into storage.//
			<</if>>
		<<case "interfaceP1">>
			<<if $activeSlave.amp == 0>>
				//Since $he has healthy limbs the <<= setup.prosthetics.interfaceP1.name>> will be put into storage.//
			<<elseif $activeSlave.PLimb == 2>>
				//Since $he already has <<= addA(setup.prosthetics.interfaceP2.name)>> installed the <<= setup.prosthetics.interfaceP1.name>> will be put into storage.//
			<<else>>
				<<set $activeSlave.PLimb = 1, cashX(forceNeg($surgeryCost), "slaveSurgery", $activeSlave), $activeSlave.health -= 20, $surgeryType = "PLimb interface1">>
				<<include "Surgery Degradation">>
			<</if>>
		<<case "interfaceP2">>
			<<if $activeSlave.amp == 0>>
				//Since $he has healthy limbs the <<= setup.prosthetics.interfaceP1.name>> will be put into storage.//
			<<elseif $activeSlave.PLimb == 1>>
				<<set $activeSlave.PLimb = 2, cashX(forceNeg($surgeryCost), "slaveSurgery", $activeSlave), $activeSlave.health -= 5, $surgeryType = "PLimb interface3">>
				<<include "Surgery Degradation">>
			<<else>>
				<<set $activeSlave.PLimb = 2, cashX(forceNeg($surgeryCost), "slaveSurgery", $activeSlave), $activeSlave.health -= 20, $surgeryType = "PLimb interface2">>
				<<include "Surgery Degradation">>
			<</if>>
		<<case "basicL" "sexL" "beautyL" "combatL" "cyberneticL">>
			<<if $activeSlave.fuckdoll != 0>>
				//Since a Fuckdoll can't use prosthetic limbs the <<= setup.prosthetics[_p.id].name>> will be put into storage.//
			<<elseif $activeSlave.amp == 0>>
				//Since $he must be an amputee to attach prosthetic limbs the <<= setup.prosthetics[_p.id].name>> will be put into storage.//
			<<elseif $activeSlave.PLimb == 0>>
				//Since $he must have a prosthetic interface installed to attach prosthetic limbs the <<= setup.prosthetics[_p.id].name>> will be put into storage.//
			<<else>>
				<<if _p.id == "basicL">>
					<<if $activeSlave.amp > 0>>
						<<set $activeSlave.amp = -1, $prostheticsConfig = "basicPLimbs">>
						<<include "Prosthetics Config">>
					<<else>>
						//Since $he already has more advanced prosthetic limbs attached the <<= setup.prosthetics.basicL.name>> will be put into storage.//
					<</if>>
				<<elseif _p.id == "sexL">>
					<<if $activeSlave.amp >= -1>>
						<<set $activeSlave.amp = -2, $prostheticsConfig = "sexPLimbs">>
						<<include "Prosthetics Config">>
					<<else>>
						//Since $he already has advanced prosthetic limbs attached the <<= setup.prosthetics.sexL.name>> will be put into storage.//
					<</if>>
				<<elseif _p.id == "beautyL">>
					<<if $activeSlave.amp >= -1>>
						<<set $activeSlave.amp = -3, $prostheticsConfig = "beautyPLimbs">>
						<<include "Prosthetics Config">>
					<<else>>
						//Since $he already has advanced prosthetic limbs attached the <<= setup.prosthetics.beautyL.name>> will be put into storage.//
					<</if>>
				<<elseif _p.id == "combatL">>
					<<if $activeSlave.amp >= -1>>
						<<set $activeSlave.amp = -4, $prostheticsConfig = "combatPLimbs">>
						<<include "Prosthetics Config">>
					<<else>>
						//Since $he already has advanced prosthetic limbs attached the <<= setup.prosthetics.combatL.name>> will be put into storage.//
					<</if>>
				<<else>>
					<<if $activeSlave.PLimb == 2>>
						<<set $activeSlave.amp = -5, $prostheticsConfig = "cyberPLimbs">>
						<<include "Prosthetics Config">>
					<<else>>
						//Since $he must have <<= addA(setup.prosthetics.interfaceP2.name)>> installed to attach cybernetic limbs the <<= setup.prosthetics.cyberneticL.name>> will be put into storage.//
					<</if>>
				<</if>>
			<</if>>
		<<case "interfaceTail">>
			<<set $activeSlave.PTail = 1, $activeSlave.tail = "none", $activeSlave.tailColor = "none", cashX(forceNeg($surgeryCost), "slaveSurgery", $activeSlave), $activeSlave.health -= 10, $surgeryType = "tailInterface">>
			<<include "Surgery Degradation">>
		<<case "modT" "sexT" "combatT">>
			<<if $activeSlave.PTail == 0>>
				//Since $he must have <<= addA(setup.prosthetics.interfaceTail.name)>> installed to attach tails the <<= setup.prosthetics[_p.id].name>> will be put into storage.//
			<<elseif $activeSlave.tail != "none">>
				//Since $he currently has a tail attached the <<= setup.prosthetics[_p.id].name>> will be put into storage.//
			<<elseif _p.id == "modT">>
				//Since installing <<= addA(setup.prosthetics.modT.name)>> is complicated it can't be automated.//
				/*Reason: there are different designs player can choose from.*/
			<<elseif _p.id == "combatT">>
				<<set $prostheticsConfig = "attachTail", $activeSlave.tail = "combat", $activeSlave.tailColor = "jet black">>
				<<include "Prosthetics Config">>
			<<elseif _p.id == "sexT">>
				<<set $prostheticsConfig = "attachTail", $activeSlave.tail = "sex", $activeSlave.tailColor = "pink">>
				<<include "Prosthetics Config">>
			<</if>>
		<<default>>
			//Since there is no automated procedure to implant/attach <<= setup.prosthetics[_p.id].name>> it will be put into storage.//
		<</switch>>

	<</if>>
	<</for>>
	<</if>>
	/* end prosthetics */
	/* updates the interrogated slave */
	<<set $slaves[_i] = $activeSlave>>
<</for>> /* end of the $slaves loop */
<<set $adjustProstheticsCompleted = 0>>

/* This needs to be down here to over-ride any Surgery Degradation calls */
<<set $nextButton = "Continue">>
<<set $nextLink = "Main">>


code:
:: Neighbor Description [nobr]

'' $arcologies[$i].name'' is located to the $arcologies[$i].direction of your arcology. It is governed by
<<switch $arcologies[$i].government>>
<<case "elected officials">>
	elected officials, periodically paralyzing its development.
<<case "a committee">>
	a committee, hindering its development.
<<case "an oligarchy">>
	a small group of leading citizens, making its development very unpredictable.
<<case "your trustees">>
	a small group of leading citizens who are serving as @@.mediumseagreen;your trustees.@@
<<case "an individual">>
	@@.cyan;an individual,@@ making its development vibrant but unpredictable.
<<case "your agent">>
	@@.deeppink;your agent,@@ who is directing the arcology in your stead.
<<case "a corporation">>
	a corporation, making its development steady and unspectacular.
<<default>>
	direct democracy, making its development dangerously unstable.
<</switch>>
<<if $arcologies[$i].direction == 0>>
	<<set $economicUncertainty = 5>>
<<else>>
	<<set $economicUncertainty = 10>>
<</if>>
<<if $assistantPower > 1>>
	<<set $economicUncertainty = 0>>
<<elseif $assistantPower == 1>>
	<<set $economicUncertainty = Math.max(Math.trunc($economicUncertainty/2),0)>>
<</if>>
<<if $arcologies[$i].government != "your trustees">>
	<<if $arcologies[$i].government != "your agent">>
		Its leadership has control of approximately @@.orange;<<print Math.trunc(($arcologies[$i].ownership*random(100-$economicUncertainty,100+$economicUncertainty))/100)>>%@@ of the arcology<<if $arcologies[$i].minority > $arcologies[$i].ownership-10>>, a dangerously narrow margin over competition with a @@.tan;<<print Math.trunc(($arcologies[$i].minority*random(100-$economicUncertainty,100+$economicUncertainty))/100)>>%@@ share<</if>>.
	<</if>>
<</if>>
<<if $arcologies[$i].PCminority > 0>>You own @@.lime;$arcologies[$i].PCminority%@@ of this arcology<<if (($arcologies[$i].government == "your trustees") || ($arcologies[$i].government == "your agent")) && $arcologies[$i].minority > $arcologies[$i].PCminority-10>>, a dangerously narrow margin over competition with a @@.red;<<print Math.trunc(($arcologies[$i].minority*random(100-$economicUncertainty,100+$economicUncertainty))/100)>>%@@ share<</if>>.<</if>>
<<set $economicUncertainty -= 2*$assistantPower>>
The arcology has an estimated GSP of @@.yellowgreen;<<print cashFormat(Math.trunc((0.1*$arcologies[$i].prosperity*random(100-$economicUncertainty,100+$economicUncertainty))/100))>>m,@@
<<if Math.abs($arcologies[$i].prosperity - $averageProsperity) < 5>>
	average among
<<elseif $arcologies[$i].prosperity > $averageProsperity>>
	ahead of
<<else>>
	behind
<</if>>
its neighbors.

<<set $desc = 0>>
<<set _neighborDescription = []>>
<<if $arcologies[$i].FSSubjugationist != "unset">>
	<<if $arcologies[$i].FSSubjugationist > 80>>
		<<set $desc = "committed to ">>
	<<elseif $arcologies[$i].FSSubjugationist > 20>>
		<<set $desc = "pursuing ">>
	<<else>>
		<<set $desc = "just establishing ">>
	<</if>>
	<<set $desc = $desc + "@@.gold;Racial Subjugationism,@@ and is ">>
	<<if $arcologies[$i].FSSubjugationist > 95>>
		<<set $desc = $desc + "the home of an advanced project to create a subservient race of ">>
		<<set $desc = $desc + $arcologies[$i].FSSubjugationistRace>>
		<<set $desc = $desc + " slaves.">>
	<<elseif $arcologies[$i].FSSubjugationist > 40>>
		<<set $desc = $desc + "working to refine ">>
		<<set $desc = $desc + $arcologies[$i].FSSubjugationistRace>>
		<<set $desc = $desc + " slavery.">>
	<<else>>
		<<set $desc = $desc + "an excellent dumping ground for low quality ">>
		<<set $desc = $desc + $arcologies[$i].FSSubjugationistRace>>
		<<set $desc = $desc + " slaves.">>
	<</if>>
	<<set _neighborDescription.push($desc)>>
<</if>>
<<if $arcologies[$i].FSSupremacist != "unset">>
	<<if $arcologies[$i].FSSubjugationist > 80>>
		<<set $desc = "committed to ">>
	<<elseif $arcologies[$i].FSSubjugationist > 20>>
		<<set $desc = "pursuing ">>
	<<else>>
		<<set $desc = "just establishing ">>
	<</if>>
	<<set $desc = $desc + "@@.gold;Racial Supremacism,@@ and is ">>
	<<if $arcologies[$i].FSSubjugationist > 95>>
		<<set $desc = $desc + "a global magnet for ">>
		<<set $desc = $desc + $arcologies[$i].FSSupremacistRace>>
		<<set $desc = $desc + " nationalists.">>
	<<elseif $arcologies[$i].FSSubjugationist > 40>>
		<<set $desc = $desc + "becoming increasingly free of ">>
		<<set $desc = $desc + $arcologies[$i].FSSupremacistRace>>
		<<set $desc = $desc + " slaves.">>
	<<else>>
		<<set $desc = $desc + "the site of a furious debate over existing ">>
		<<set $desc = $desc + $arcologies[$i].FSSupremacistRace>>
		<<set $desc = $desc + " slaves.">>
	<</if>>
	<<set _neighborDescription.push($desc)>>
<</if>>
<<if $arcologies[$i].FSRepopulationFocus != "unset">>
	<<if $arcologies[$i].FSRepopulationFocus > 80>>
		<<set $desc = "committed to ">>
	<<elseif $arcologies[$i].FSRepopulationFocus > 20>>
		<<set $desc = "pursuing ">>
	<<else>>
		<<set $desc = "just establishing ">>
	<</if>>
	<<set $desc = $desc + "@@.gold;Repopulation,@@ and is ">>
	<<if $arcologies[$i].FSRepopulationFocus > 95>>
		<<set $desc = $desc + "notorious for the size and number of pregnancies among its population.">>
	<<elseif $arcologies[$i].FSRepopulationFocus > 40>>
		<<set $desc = $desc + "known to be a good place to find slavegirls heavy with children.">>
	<<else>>
		<<set $desc = $desc + "actively importing fertile slave girls.">>
	<</if>>
	<<set _neighborDescription.push($desc)>>
<</if>>
<<if $arcologies[$i].FSRestart != "unset">>
	<<if $arcologies[$i].FSRestart > 80>>
		<<set $desc = "committed to ">>
	<<elseif $arcologies[$i].FSRestart > 20>>
		<<set $desc = "pursuing ">>
	<<else>>
		<<set $desc = "just establishing ">>
	<</if>>
	<<set $desc = $desc + "@@.gold;Eugenics,@@ and is ">>
	<<if $arcologies[$i].FSRestart > 95>>
		<<set $desc = $desc + "notorious for the number of powerful civilians inhabiting it.">>
	<<elseif $arcologies[$i].FSRestart > 40>>
		<<set $desc = $desc + "known to be a good place make connections.">>
	<<else>>
		<<set $desc = $desc + "actively importing sterilization supplies.">>
	<</if>>
	<<set _neighborDescription.push($desc)>>
<</if>>
<<if $arcologies[$i].FSGenderRadicalist != "unset">>
	<<if $arcologies[$i].FSGenderRadicalist > 80>>
		<<set $desc = "committed to ">>
	<<elseif $arcologies[$i].FSGenderRadicalist > 20>>
		<<set $desc = "pursuing ">>
	<<else>>
		<<set $desc = "just establishing ">>
	<</if>>
	<<set $desc = $desc + "@@.gold;Gender Radicalism,@@ and is ">>
	<<if $arcologies[$i].FSGenderRadicalist > 95>>
		<<set $desc = $desc + "notorious for the openness with which its citizens fuck its slavegirls in the ass until they cum.">>
	<<elseif $arcologies[$i].FSGenderRadicalist > 40>>
		<<set $desc = $desc + "known to be a good place to find slavegirls who cum when buttfucked.">>
	<<else>>
		<<set $desc = $desc + "actively importing a wider variety of slave girls.">>
	<</if>>
	<<set _neighborDescription.push($desc)>>
<</if>>
<<if $arcologies[$i].FSGenderFundamentalist != "unset">>
	<<if $arcologies[$i].FSGenderFundamentalist > 80>>
		<<set $desc = "committed to ">>
	<<elseif $arcologies[$i].FSGenderFundamentalist > 20>>
		<<set $desc = "pursuing ">>
	<<else>>
		<<set $desc = "just establishing ">>
	<</if>>
	<<set $desc = $desc + "@@.gold;Gender Fundamentalism,@@ and is ">>
	<<if $arcologies[$i].FSGenderFundamentalist > 95>>
		<<set $desc = $desc + "famous for its slave schools, crowded with a future generation of world class slaves.">>
	<<elseif $arcologies[$i].FSGenderFundamentalist > 40>>
		<<set $desc = $desc + "remarkable for its crowds of hugely pregnant slave women.">>
	<<else>>
		<<set $desc = $desc + "importing increasing numbers of fertile slaves.">>
	<</if>>
	<<set _neighborDescription.push($desc)>>
<</if>>
<<if $arcologies[$i].FSPaternalist != "unset">>
	<<if $arcologies[$i].FSPaternalist > 80>>
		<<set $desc = "committed to ">>
	<<elseif $arcologies[$i].FSPaternalist > 20>>
		<<set $desc = "pursuing ">>
	<<else>>
		<<set $desc = "just establishing ">>
	<</if>>
	<<set $desc = $desc + "@@.gold;Paternalism,@@ and is ">>
	<<if $arcologies[$i].FSPaternalist > 95>>
		<<set $desc = $desc + "the home of an educated, enlightened caste of slaves more productive than some arcologies' citizens.">>
	<<elseif $arcologies[$i].FSPaternalist > 40>>
		<<set $desc = $desc + "becoming known for its unusually cheerful atmosphere.">>
	<<else>>
		<<set $desc = $desc + "starting to demand abused slaves whose lives can be turned around.">>
	<</if>>
	<<set _neighborDescription.push($desc)>>
<</if>>
<<if $arcologies[$i].FSDegradationist != "unset">>
	<<if $arcologies[$i].FSDegradationist > 80>>
		<<set $desc = "committed to ">>
	<<elseif $arcologies[$i].FSDegradationist > 20>>
		<<set $desc = "pursuing ">>
	<<else>>
		<<set $desc = "just establishing ">>
	<</if>>
	<<set $desc = $desc + "@@.gold;Degradationism,@@ and is ">>
	<<if $arcologies[$i].FSDegradationist > 95>>
		<<set $desc = $desc + "renowned and feared by slaves worldwide, as a place of blood and steel from which few ever leave.">>
	<<elseif $arcologies[$i].FSDegradationist > 40>>
		<<set $desc = $desc + "becoming dreaded by slaves, since the few it exports are full of unbelievably awful stories.">>
	<<else>>
		<<set $desc = $desc + "importing a rapidly increasing number of slaves, for some reason.">>
	<</if>>
	<<set _neighborDescription.push($desc)>>
<</if>>
<<if $arcologies[$i].FSBodyPurist != "unset">>
	<<if $arcologies[$i].FSBodyPurist > 80>>
		<<set $desc = "committed to ">>
	<<elseif $arcologies[$i].FSBodyPurist > 20>>
		<<set $desc = "pursuing ">>
	<<else>>
		<<set $desc = "just establishing ">>
	<</if>>
	<<set $desc = $desc + "@@.gold;Body Purism,@@ and is ">>
	<<if $arcologies[$i].FSBodyPurist > 95>>
		<<set $desc = $desc + "a world leader in the drug industry due to its pharmaceutical research breakthroughs.">>
	<<elseif $arcologies[$i].FSBodyPurist > 40>>
		<<set $desc = $desc + "pouring an ever increasing amount of money into drug research.">>
	<<else>>
		<<set $desc = $desc + "setting up research programs to develop better slave drugs.">>
	<</if>>
	<<set _neighborDescription.push($desc)>>
<</if>>
<<if $arcologies[$i].FSTransformationFetishist != "unset">>
	<<if $arcologies[$i].FSTransformationFetishist > 80>>
		<<set $desc = "committed to ">>
	<<elseif $arcologies[$i].FSTransformationFetishist > 20>>
		<<set $desc = "pursuing ">>
	<<else>>
		<<set $desc = "just establishing ">>
	<</if>>
	<<set $desc = $desc + "@@.gold;Transformation Fetishism,@@ and is ">>
	<<if $arcologies[$i].FSTransformationFetishist > 95>>
		<<set $desc = $desc + "renowned as the source of some of the world's most unbelievable surgical transformations.">>
	<<elseif $arcologies[$i].FSTransformationFetishist > 40>>
		<<set $desc = $desc + "rapidly moving from mere breast expansion to more esoteric surgical fetishism.">>
	<<else>>
		<<set $desc = $desc + "receiving daily shipments of silicone and surgical necessities.">>
	<</if>>
	<<set _neighborDescription.push($desc)>>
<</if>>
<<if $arcologies[$i].FSYouthPreferentialist != "unset">>
	<<if $arcologies[$i].FSYouthPreferentialist > 80>>
		<<set $desc = "committed to ">>
	<<elseif $arcologies[$i].FSYouthPreferentialist > 20>>
		<<set $desc = "pursuing ">>
	<<else>>
		<<set $desc = "just establishing ">>
	<</if>>
	<<set $desc = $desc + "@@.gold;Youth Preferentialism,@@ and is ">>
	<<if $arcologies[$i].FSYouthPreferentialist > 95>>
		<<set $desc = $desc + "famous for the intense celebratory attention slaves receive there once reaching their majorities.">>
	<<elseif $arcologies[$i].FSYouthPreferentialist > 40>>
		<<set $desc = $desc + "moving virginity and the taking of virginity ever higher in the public estimation.">>
	<<else>>
		<<set $desc = $desc + "starting to get a reputation as an excellent place to get a good price for a virgin.">>
	<</if>>
	<<set _neighborDescription.push($desc)>>
<</if>>
<<if $arcologies[$i].FSMaturityPreferentialist != "unset">>
	<<if $arcologies[$i].FSMaturityPreferentialist > 80>>
		<<set $desc = "committed to ">>
	<<elseif $arcologies[$i].FSMaturityPreferentialist > 20>>
		<<set $desc = "pursuing ">>
	<<else>>
		<<set $desc = "just establishing ">>
	<</if>>
	<<set $desc = $desc + "@@.gold;Maturity Preferentialism,@@ and is ">>
	<<if $arcologies[$i].FSMaturityPreferentialist > 95>>
		<<set $desc = $desc + "world famous among mature slaves, who see it as a paradise in which MILFs are the most valuable girls around.">>
	<<elseif $arcologies[$i].FSMaturityPreferentialist > 40>>
		<<set $desc = $desc + "striking for the variety of well-preserved beauties that can be seen there.">>
	<<else>>
		<<set $desc = $desc + "displaying an increasing demand for enslaved housewives and professional women.">>
	<</if>>
	<<set _neighborDescription.push($desc)>>
<</if>>
<<if $arcologies[$i].FSSlimnessEnthusiast != "unset">>
	<<if $arcologies[$i].FSSlimnessEnthusiast > 80>>
		<<set $desc = "committed to ">>
	<<elseif $arcologies[$i].FSSlimnessEnthusiast > 20>>
		<<set $desc = "pursuing ">>
	<<else>>
		<<set $desc = "just establishing ">>
	<</if>>
	<<set $desc = $desc + "@@.gold;Slimness Enthusiasm,@@ and is ">>
	<<if $arcologies[$i].FSSlimnessEnthusiast > 95>>
		<<set $desc = $desc + "very well known for the wonderful variety of nubile bodies that can be seen there.">>
	<<elseif $arcologies[$i].FSSlimnessEnthusiast > 40>>
		<<set $desc = $desc + "becoming known as an arcology that slims slaves down rather than turning them into piles of tits and ass.">>
	<<else>>
		<<set $desc = $desc + "starting to display unusual fashions regarding breasts and butts.">>
	<</if>>
	<<set _neighborDescription.push($desc)>>
<</if>>
<<if $arcologies[$i].FSAssetExpansionist != "unset">>
	<<if $arcologies[$i].FSAssetExpansionist > 80>>
		<<set $desc = "committed to ">>
	<<elseif $arcologies[$i].FSAssetExpansionist > 20>>
		<<set $desc = "pursuing ">>
	<<else>>
		<<set $desc = "just establishing ">>
	<</if>>
	<<set $desc = $desc + "@@.gold;Asset Expansionism,@@ and is ">>
	<<if $arcologies[$i].FSAssetExpansionist > 95>>
		<<set $desc = $desc + "widely considered an interior design masterpiece for its adaptations to slaves with fifty kilos of tits.">>
	<<elseif $arcologies[$i].FSAssetExpansionist > 40>>
		<<set $desc = $desc + "a popular tourist destination just for the view, which features some truly spectacular bare boobs.">>
	<<else>>
		<<set $desc = $desc + "demanding fatter slaves, since its citizens are learning they absorb growth hormones better.">>
	<</if>>
	<<set _neighborDescription.push($desc)>>
<</if>>
<<if $arcologies[$i].FSPastoralist != "unset">>
	<<if $arcologies[$i].FSPastoralist > 80>>
		<<set $desc = "committed to ">>
	<<elseif $arcologies[$i].FSPastoralist > 20>>
		<<set $desc = "pursuing ">>
	<<else>>
		<<set $desc = "just establishing ">>
	<</if>>
	<<set $desc = $desc + "@@.gold;Pastoralist,@@ and is ">>
	<<if $arcologies[$i].FSPastoralist > 95>>
		<<set $desc = $desc + "a world-renowned producer of cowgirl dairy products of all kinds.">>
	<<elseif $arcologies[$i].FSPastoralist > 40>>
		<<set $desc = $desc + "devoting more and more of its slaves to work as cowgirls, or to the service and upkeep of cowgirls.">>
	<<else>>
		<<set $desc = $desc + "displaying an increasing public appetite for dairy, and yet imports almost no true cow's milk.">>
	<</if>>
	<<set _neighborDescription.push($desc)>>
<</if>>
<<if $arcologies[$i].FSCummunism != "unset">>
	<<if $arcologies[$i].FSCummunism > 80>>
		<<set $desc = "committed to ">>
	<<elseif $arcologies[$i].FSCummunism > 20>>
		<<set $desc = "pursuing ">>
	<<else>>
		<<set $desc = "just establishing ">>
	<</if>>
	<<set $desc = $desc + "@@.gold;Cummunism,@@ and is ">>
	<<if $arcologies[$i].FSCummunism > 95>>
		<<set $desc = $desc + "a world-renowned producer of cum-based products of all kinds.">>
	<<elseif $arcologies[$i].FSCummunism > 40>>
		<<set $desc = $desc + "devoting more and more of its slaves to work as cumtanks, or to the service, upkeep and milking of ballgirls.">>
	<<else>>
		<<set $desc = $desc + "displaying an increasing public appetite for cum, and has begun importing more and more specialized milkers.">>
	<</if>>
	<<set _neighborDescription.push($desc)>>
<</if>>
<<if $arcologies[$i].FSPhysicalIdealist != "unset">>
	<<if $arcologies[$i].FSPhysicalIdealist > 80>>
		<<set $desc = "committed to ">>
	<<elseif $arcologies[$i].FSPhysicalIdealist > 20>>
		<<set $desc = "pursuing ">>
	<<else>>
		<<set $desc = "just establishing ">>
	<</if>>
	<<set $desc = $desc + "@@.gold;Physical Idealism,@@ and is ">>
	<<if $arcologies[$i].FSPhysicalIdealist > 95>>
		<<set $desc = $desc + "a constant standout at international athletic competitions, where both its citizens and slaves do very well.">>
	<<elseif $arcologies[$i].FSPhysicalIdealist > 40>>
		<<set $desc = $desc + "quite a sight, since its citizens and slaves all lift. Constantly.">>
	<<else>>
		<<set $desc = $desc + "the site of a musclegirl fetish community.">>
	<</if>>
	<<set _neighborDescription.push($desc)>>
<</if>>
<<if $arcologies[$i].FSHedonisticDecadence != "unset">>
	<<if $arcologies[$i].FSHedonisticDecadence > 80>>
		<<set $desc = "committed to ">>
	<<elseif $arcologies[$i].FSHedonisticDecadence > 20>>
		<<set $desc = "pursuing ">>
	<<else>>
		<<set $desc = "just establishing ">>
	<</if>>
	<<set $desc = $desc + "@@.gold;Hedonistic Decadence,@@ and is ">>
	<<if $arcologies[$i].FSHedonisticDecadence > 95>>
		<<set $desc = $desc + "very well known as a place where every imaginable desire and fantasy can be fulfilled.">>
	<<elseif $arcologies[$i].FSHedonisticDecadence > 40>>
		<<set $desc = $desc + "importing huge amounts of food and alcohol">>
	<<else>>
		<<set $desc = $desc + "the site of a large number of lazy individuals.">>
	<</if>>
	<<set _neighborDescription.push($desc)>>
<</if>>
<<if $arcologies[$i].FSIncestFetishist != "unset">>
	<<if $arcologies[$i].FSIncestFetishist > 80>>
		<<set $desc = "committed to ">>
	<<elseif $arcologies[$i].FSIncestFetishist > 20>>
		<<set $desc = "pursuing ">>
	<<else>>
		<<set $desc = "just establishing ">>
	<</if>>
	<<set $desc = $desc + "@@.gold;Incest Fetishism,@@ and is ">>
	<<if $arcologies[$i].FSIncestFetishist > 95>>
		<<set $desc = $desc + "highly recommended as a place to stop by if you like threesomes with twins or familial gangbangs.">>
	<<elseif $arcologies[$i].FSIncestFetishist > 40>>
		<<set $desc = $desc + "attracting a substantial number of families.">>
	<<else>>
		<<set $desc = $desc + "devoting more and more of its resources into genealogy.">>
	<</if>>
	<<set _neighborDescription.push($desc)>>
<</if>>
<<if $arcologies[$i].FSChattelReligionist != "unset">>
	<<if $arcologies[$i].FSChattelReligionist > 80>>
		<<set $desc = "committed to ">>
	<<elseif $arcologies[$i].FSChattelReligionist > 20>>
		<<set $desc = "pursuing ">>
	<<else>>
		<<set $desc = "just establishing ">>
	<</if>>
	<<set $desc = $desc + "@@.gold;Chattel Religionism,@@ and is ">>
	<<if $arcologies[$i].FSChattelReligionist > 95>>
		<<set $desc = $desc + "a significant force in the global development of Chattel Religionist dogma.">>
	<<elseif $arcologies[$i].FSChattelReligionist > 40>>
		<<set $desc = $desc + "a popular destination for devout old world citizens engaging in sex tourism.">>
	<<else>>
		<<set $desc = $desc + "in the throes of public dissention over its religious laws.">>
	<</if>>
	<<set _neighborDescription.push($desc)>>
<</if>>
<<if $arcologies[$i].FSRomanRevivalist != "unset">>
	<<if $arcologies[$i].FSRomanRevivalist > 80>>
		<<set $desc = "committed to ">>
	<<elseif $arcologies[$i].FSRomanRevivalist > 20>>
		<<set $desc = "pursuing ">>
	<<else>>
		<<set $desc = "just establishing ">>
	<</if>>
	<<set $desc = $desc + "@@.gold;Roman Revivalism,@@ and is ">>
	<<if $arcologies[$i].FSRomanRevivalist > 95>>
		<<set $desc = $desc + "hugely famous for its broadcasts of gladiatorial combat, popular even in the old world.">>
	<<elseif $arcologies[$i].FSRomanRevivalist > 40>>
		<<set $desc = $desc + "almost obnoxiously aspirational, with citizens competing to serve the state best.">>
	<<else>>
		<<set $desc = $desc + "working its way through sword and sandals fashion towards proper historicity.">>
	<</if>>
	<<set _neighborDescription.push($desc)>>
<</if>>
<<if $arcologies[$i].FSAztecRevivalist != "unset">>
	<<if $arcologies[$i].FSAztecRevivalist > 80>>
		<<set $desc = "committed to ">>
	<<elseif $arcologies[$i].FSAztecRevivalist > 20>>
		<<set $desc = "pursuing ">>
	<<else>>
		<<set $desc = "just establishing ">>
	<</if>>
	<<set $desc = $desc + "@@.gold;Aztec Revivalism,@@ and is ">>
	<<if $arcologies[$i].FSAztecRevivalist > 95>>
		<<set $desc = $desc + "world famous for its incredible architecture and highly qualified leading caste and military.">>
	<<elseif $arcologies[$i].FSAztecRevivalist > 40>>
		<<set $desc = $desc + "constructing great pyramids and statues with equally weighty costs.">>
	<<else>>
		<<set $desc = $desc + "struggling to embrace the amount of blood sacrifice and prayer involved.">>
	<</if>>
	<<set _neighborDescription.push($desc)>>
<</if>>
<<if $arcologies[$i].FSEgyptianRevivalist != "unset">>
	<<if $arcologies[$i].FSEgyptianRevivalist > 80>>
		<<set $desc = "committed to ">>
	<<elseif $arcologies[$i].FSEgyptianRevivalist > 20>>
		<<set $desc = "pursuing ">>
	<<else>>
		<<set $desc = "just establishing ">>
	<</if>>
	<<set $desc = $desc + "@@.gold;Egyptian Revivalism,@@ and is ">>
	<<if $arcologies[$i].FSEgyptianRevivalist > 95>>
		<<set $desc = $desc + "a world famous tourist destination for the traditional festival in its plaza, which never stops.">>
	<<elseif $arcologies[$i].FSEgyptianRevivalist > 40>>
		<<set $desc = $desc + "very much under renovation, as vast blocks of stone are imported around the clock.">>
	<<else>>
		<<set $desc = $desc + "struggling with the fashion implications of so much white linen everywhere.">>
	<</if>>
	<<set _neighborDescription.push($desc)>>
<</if>>
<<if $arcologies[$i].FSEdoRevivalist != "unset">>
	<<if $arcologies[$i].FSEdoRevivalist > 80>>
		<<set $desc = "committed to ">>
	<<elseif $arcologies[$i].FSEdoRevivalist > 20>>
		<<set $desc = "pursuing ">>
	<<else>>
		<<set $desc = "just establishing ">>
	<</if>>
	<<set $desc = $desc + "@@.gold;Edo Revivalism,@@ and is ">>
	<<if $arcologies[$i].FSEdoRevivalist > 95>>
		<<set $desc = $desc + "visibly trailing cherry blossoms, blown off its balconies by the wind.">>
	<<elseif $arcologies[$i].FSEdoRevivalist > 40>>
		<<set $desc = $desc + "becoming a notable cultural center, even in the old world.">>
	<<else>>
		<<set $desc = $desc + "the object of considerable debate among socially awkward teenagers worldwide.">>
	<</if>>
	<<set _neighborDescription.push($desc)>>
<</if>>
<<if $arcologies[$i].FSArabianRevivalist != "unset">>
	<<if $arcologies[$i].FSArabianRevivalist > 80>>
		<<set $desc = "committed to ">>
	<<elseif $arcologies[$i].FSArabianRevivalist > 20>>
		<<set $desc = "pursuing ">>
	<<else>>
	<<set $desc = "just establishing ">>
		<</if>>
	<<set $desc = $desc + "@@.gold;Arabian Revivalism,@@ and is ">>
	<<if $arcologies[$i].FSArabianRevivalist > 95>>
		<<set $desc = $desc + "a famous center of Arabian romanticism, since it has the wisdom not to be historically perfect.">>
	<<elseif $arcologies[$i].FSArabianRevivalist > 40>>
		<<set $desc = $desc + "working through which parts of Arabian romanticism to adopt and which to discard.">>
	<<else>>
		<<set $desc = $desc + "eagerly reveling in the most romantic parts of superficial Arabian romanticism.">>
	<</if>>
	<<set _neighborDescription.push($desc)>>
<</if>>
<<if $arcologies[$i].FSChineseRevivalist != "unset">>
	<<if $arcologies[$i].FSChineseRevivalist > 80>>
		<<set $desc = "committed to ">>
	<<elseif $arcologies[$i].FSChineseRevivalist > 20>>
		<<set $desc = "pursuing ">>
	<<else>>
		<<set $desc = "just establishing ">>
	<</if>>
	<<set $desc = $desc + "@@.gold;Chinese Revivalism,@@ and is ">>
	<<if $arcologies[$i].FSChineseRevivalist > 95>>
		<<set $desc = $desc + "now confidently mature about its possession of the Mandate of Heaven.">>
	<<elseif $arcologies[$i].FSChineseRevivalist > 40>>
		<<set $desc = $desc + "often aggressive about its status as the middle kingdom to the point that it betrays uncertainty.">>
	<<else>>
		<<set $desc = $desc + "moving towards a stage of refinement that will allow it to present itself properly.">>
	<</if>>
	<<set _neighborDescription.push($desc)>>
<</if>>

<<if _neighborDescription.length > 0>>
	<<if _neighborDescription.length > 2>>
		Its culture is complex. First, it is _neighborDescription[0]
		<<for $j = 1; $j < _neighborDescription.length; $j++>>
			<<if $j < _neighborDescription.length-1>>It is<<else>>Finally, the arcology is<</if>> _neighborDescription[$j]
		<</for>>
	<<elseif _neighborDescription.length == 2>>
		Its culture is developing along two lines. First, it is _neighborDescription[0] Second, it is _neighborDescription[1]
	<<else>>
		Its culture is diverging from the old world: it is _neighborDescription[0]
	<</if>>
<</if>>

repo_name: KelioSteel/fc