code:
globalThis.eliteBreedingExam = function(slave = null) {
	const eliteAngered = V.failedElite > 100;
	const SlaveProfessionalismEstablished = V.arcologies[0].FSSlaveProfessionalism > 20;
	const preferYounger = V.arcologies[0].FSYouthPreferentialist > 20;
	const partyAnimal = V.arcologies[0].FSHedonisticDecadence > 20;
	const cost = 5000;
	let r = [], test, passing = 0, fixable;

	const result = function() {
		if (slave) {
			if (test === true) {
				return `<span class="lime">PASSED</span>`;
			} else if (fixable) {
				return `<span class="yellow">Within fixable range.</span>`;
			} else {
				passing--;
				return `<span class="red">FAILED</span>`;
			}
		}
		return ``;
	};

	r.push(`For each slave be to examined, a fee of <span class='yellowgreen'>${cashFormat(cost)}</span> will be deducted from your account.`);
	r.push(`Updates will be posted periodically. It is your responsibility to keep up to date.`);
	r.push(`Failures will be sterilized. Please make sure your slave fits the following criteria before submitting them for testing. We shall not be held responsible for time wasted.`);
	if (!slave) {
		r.push(`Must be not; already be marked as a breeding slave, inside a fuckdoll suit, infertile and already with child.`);
	} else {
		r.push(`${slave.slaveName} is up for review:`);
	}

	if (slave) {
		test = slave.intelligence + slave.intelligenceImplant >= (eliteAngered ? 95 : 50);
	}
	r.push(`Must be ${eliteAngered ? 'highly intelligent' : 'very smart'}. ${result()}`);

	if (slave) {
		test = Beauty(slave) >= (eliteAngered ? 120 : 100);
	}
	r.push(`Must be ${eliteAngered ? 'unbelievably' : ''} beautiful. ${result()}`);

	if (slave) {
		test = slave.face >= (eliteAngered ? 95 : 40);
	}
	r.push(`Their face must be ${eliteAngered ? 'breathtaking' : 'gorgeous'}. ${result()}`);

	if (slave) {
		test = slave.chem <= 20;
	}
	r.push(`Their health must not be overly impacted by drug use. ${result()}`);

	if (slave) {
		test = slave.addict === 0;
	}
	r.push(`They must not be addicted to drugs. ${result()}`);

	if (V.arcologies[0].FSMaturityPreferentialist > 20 || V.arcologies[0].FSYouthPreferentialist > 20) {
		const targetAge = 24;
		if (slave) {
			if (V.arcologies[0].FSMaturityPreferentialist > 20) {
				test = slave.physicalAge > targetAge;
			} else {
				test = slave.physicalAge < targetAge;
			}
		}
		r.push(`Must be ${preferYounger ? 'younger' : 'older'} than ${targetAge}. ${result()}`);
	}

	if (V.arcologies[0].FSIntellectualDependency > 20) {
		if (slave) {
			test = slave.energy >= 96;
		}
		r.push(`Must be sexually receptive at all times. ${result()}`);
	} else if (V.arcologies[0].FSSlaveProfessionalism > 20) {
		if (slave) {
			test = slave.skill.vaginal + slave.skill.anal + slave.skill.oral + slave.skill.entertainment + slave.skill.whoring >= (eliteAngered ? 500 : 400);
		}
		r.push(`Must be capable of mastering skills. ${result()}`);
		if (slave) {
			test = slave.accent <= 1;
		}
		r.push(`Must be capable of eloquent and accurate speech. ${result()}`);
	}
	if (V.arcologies[0].FSPetiteAdmiration > 20 || V.arcologies[0].FSStatuesqueGlorification > 20) {
		const targetHeight = V.arcologies[0].FSPetiteAdmiration > 20 ? 150 : 186;
		if (V.arcologies[0].FSPetiteAdmiration > 20) {
			if (slave) {
				test = (slave.height - (slave.heightImplant * 10)) < targetHeight;
			}
			r.push(`Must naturally be very short. (${targetHeight} cm) ${result()}`);
			if (slave) {
				test = (slave.height - (slave.heightImplant * 10)) < Height.mean(slave) - 15;
			}
			r.push(`Must naturally be very short for their age. ${result()}`);
		} else if (V.arcologies[0].FSStatuesqueGlorification > 20) {
			if (slave) {
				test = (slave.height - (slave.heightImplant * 10)) > targetHeight;
			}
			r.push(`Must naturally be very tall. (${targetHeight} cm) ${result()}`);
		}
	}

	if (V.arcologies[0].FSSupremacist > 20 || V.arcologies[0].FSSubjugationist > 20) {
		const targetRace = V.arcologies[0].FSSupremacist > 20 ? V.arcologies[0].FSSupremacistRace : V.arcologies[0].FSSubjugationistRace;
		if (slave) {
			test = slave.race === targetRace;
		}
		r.push(`Must be ${targetRace}. ${result()}`);
	}

	if (V.arcologies[0].FSGenderRadicalist > 20) {
		if (slave) {
			test = slave.dick >= 1 && slave.balls >= 1;
		}
		r.push(`Must have a functional penis. ${result()}`);
	} else if (V.arcologies[0].FSGenderFundamentalist > 20) {
		if (slave) {
			test = slave.dick === 0 && slave.balls === 0;
		}
		r.push(`Must be physically female. ${result()}`);
	}
	if (V.arcologies[0].FSPaternalist > 20) {
		if (slave) {
			test = slave.intelligenceImplant >= (SlaveProfessionalismEstablished ? 30 : 15);
		}
		r.push(`Must be ${SlaveProfessionalismEstablished ? 'well' : ''} educated. ${result()}`);
		if (slave) {
			test = slave.health.condition >= 60;
		}
		r.push(`Must be in good health. ${result()}`);
	// } else if (V.arcologies[0].FSDegradationist > 20) {
	}

	if (SlaveProfessionalismEstablished) {
		if (slave) {
			test = slave.intelligenceImplant >= 15;
		}
		r.push(`Must be well educated. ${result()}`);
	}

	if (V.arcologies[0].FSBodyPurist > 20) {
		if (slave) {
			test = slave.chem <= (eliteAngered ? 0 : 15);
		}
		r.push(`Must have low carcinogen levels. ${result()}`);
		if (slave) {
			test = slave.boobsImplant + slave.buttImplant + slave.lipsImplant + slave.hipsImplant + slave.shouldersImplant === 0 && slave.faceImplant <= 5 && slave.bellyImplant === -1;
		}
		r.push(`Must be implant free. ${result()}`);
	// } else if (V.arcologies[0].FSTransformationFetishist > 20) {
	//	idealSlave.chem = 20;
	}
	if (V.arcologies[0].FSSlimnessEnthusiast > 20) {
		if (slave) {
			test = slave.weight <= (partyAnimal ? 30 : 0);
		}
		if (partyAnimal) {
			r.push(`May be no larger than "plush". ${result()}`);
		} else {
			r.push(`Must be thin. ${result()}`);
		}
		if (slave) {
			test = slave.butt <= 2;
		}
		r.push(`Must have a trim rear. ${result()}`);
		if (slave) {
			test = slave.boobs <= 400;
		}
		r.push(`Must have a sleek chest. ${result()}`);
	} else if (V.arcologies[0].FSAssetExpansionist > 20) {
		if (slave) {
			test = (slave.butt - slave.buttImplant) >= 6;
		}
		r.push(`Must have a naturally gigantic rear. ${result()}`);
		if (slave) {
			test = (slave.boobs - slave.boobsImplant) >= 1000;
		}
		r.push(`Must be naturally busty. ${result()}`);
	}
	if (V.arcologies[0].FSPastoralist > 20) {
		if (slave) {
			test = slave.lactation === 1;
		}
		r.push(`Must be lactating naturally. ${result()}`);
	}
	if (V.arcologies[0].FSPhysicalIdealist > 20) {
		if (V.arcologies[0].FSPhysicalIdealistLaw === 1) {
			const musclesMin = 20;
			const musclesMax = 50;
			if (slave) {
				test = slave.weight <= 30;
			}
			r.push(`Must not be overweight. ${result()}`);
			if (slave) {
				test = between(slave.muscles, musclesMin, musclesMax);
				fixable = (slave.muscles <= musclesMin && slave.muscles > musclesMax - musclesMin) || (slave.muscles >= musclesMax && slave.muscles < musclesMin + 30);
				if (fixable && passing === 0) {
					passing = 2;
				}
			}
			r.push(`Must be fit, but not too muscular. ${result()}`);
		} else {
			if (slave) {
				test = slave.muscles > 95;
			}
			r.push(`Must be extremely muscular. ${result()}`);
		}
	} else if (V.arcologies[0].FSHedonisticDecadence > 20) {
		const targetWeight = V.arcologies[0].FSSlimnessEnthusiast > 20 ? 10 : 95;
		if (slave) {
			test = slave.weight > targetWeight;
		}
		if (V.arcologies[0].FSSlimnessEnthusiast > 20) {
			r.push(`Must be more than "trim". ${result()}`);
		} else {
			r.push(`Must be big, soft and fat. ${result()}`);
		}
	}

	if (slave) {
		if (passing === 2) {
			r.push(`The aforementioned slave has been deemed currently unsuitable for breeding, but may be resubmitted after corrections are applied. We understand the subjective nature of "fit" and do not wish to preclude the use a viable breeder over such a trivial fix. A contraceptive routine has been applied to protect against "accidents" in the interim.`);
			slave.preg = -1;
		} else if (passing !== 0) {
			r.push(`The aforementioned slave has been deemed <span class="red">unsuitable</span> for breeding.`);
			slave.preg = -3;
		} else {
			r.push(`The aforementioned slave has been deemed <span class="green">worthy</span> of being used for breeding and has been marked as such. Please note the increased restrictions on breeding slaves.`);
			r.push(`They are not permitted for public use or anything that may harm their growing child. The child within them is considered a member of the Elite class and as such, any harm that comes to them will result in severe penalties to the breeder's owner. Development of the child will be closely monitored; should the fetus be identified as not of the owner's blood (or any other member of the Elite class), said owner shall face severe fines.`);
			slave.breedingMark = 1; slave.pregControl = "none";
			removeJob(slave, slave.assignment);
		}
		cashX(-cost, "capEx");
	}

	return r.map(t => `<div>${t}</div>`).join("");
};


code:
:: eliteTakeOver [nobr]

<<set $nextButton = " ">>

<<set _pregSurrender = 0>>
/* preg/lobotomization check */
You knew this day would come. Surrounding yourself with powerful people has its boons, but also poses a distinct threat. You've heard them murmuring when you enter the room, you've seen them excuse themselves from your presence, and lately they've been overtly hostile. The Societal Elite<<if $arcologies[0].FSNeoImperialistLaw2 == 1>>, likely with the support of your ever-plotting Barons,<</if>> have turned on you.

You look up from your desk as the locked door to your office unseals, and a dozen individuals brazenly walk into your view.<<if _S.Bodyguard>><<setLocalPronouns _S.Bodyguard>> _S.Bodyguard.slaveName stands between you and them. A single glare from the leader of the bunch and $he backs off, eyes to the ground.<</if>>

<<if $PC.pregSource == -1 || $PC.pregSource == -6>>
	<<if $PC.refreshmentType == 0>>
		Taking a drag from a fresh $PC.refreshment,
	<<elseif $PC.refreshmentType == 1>>
		Taking a drink of a fresh glass of $PC.refreshment,
	<<elseif $PC.refreshmentType == 2>>
		Taking a bite of a fresh $PC.refreshment,
	<<elseif $PC.refreshmentType == 3>>
		Doing a line of $PC.refreshment,
	<<elseif $PC.refreshmentType == 4>>
		Injecting a hit of $PC.refreshment into your arm,
	<<elseif $PC.refreshmentType == 5>>
		Swallowing a $PC.refreshment,
	<<elseif $PC.refreshmentType == 6>>
		Placing a tab of $PC.refreshment under your tongue,
	<</if>>
	you greet your rather unwelcome guests.

	"You are no longer worthy of being a part of our society. But you carry within you one of our heirs. A conundrum for some, but we have already solved that problem."

	What was that last thing he said? It's getting hard to think right. The $PC.refreshment... Drugged... You collapse onto your desk, unconscious.

	<<if _S.Bodyguard>>
		A sharp pain and a rush of adrenaline drags you back to your senses. Sneaking a peak, you witness _S.Bodyguard.slaveName valiantly trying to protect you, despite <<if hasAnyProstheticLimbs(_S.Bodyguard)>>$his cybernetics being locked down<<else>>the overwhelming odds<</if>>. As $he and their leader struggle closer to your desk, his revolver and a syringe are dislodged onto your desk. It seems drugging you wasn't their first thought. With _S.Bodyguard.slaveName's risky gamble, your fate has fallen back into your hands.
	<<else>>
		You'll spend the rest of your life a breeder to the Societal Elite; blinded and muted. More than a slave, but still less than your master. Life isn't so bad, your two most devoted slaves were taken along to keep you happy, and you are treated quite well, possibilities considered. Though once your eggs dry up, odds are your little remaining usefulness will be at an end. Best not to think too much into it.
		<<set _pregSurrender = 1>>
		<<set $ui = "start">>

		''GAME OVER''
	<</if>>
<<else>>
	The leader reaches into his jacket and extracts a syringe, you recognize it as a powerful drug used in lobotomies, and places it to your left. From his hip he pulls a revolver, six-chambered, and loads five bullets, spins the chamber, and places it to your right.

	"You are no longer worthy of being a part of our society. You know you can't be allowed to spread any information. But we are not merciless; one of our members has taken an interest in having you as her pet. You may choose to lose your mind, and service her until she tires of you, or gamble for your life and serve her anyway. Now decide."
<</if>>

<<if _pregSurrender == 0>>
	<<set $finalChoice = "final stand">>
	The choice is simple — you will not be a slave.

	You decide to make a final stand.

	<<if _S.Bodyguard>>

		<<if $PC.pregSource == -1 || $PC.pregSource == -6>>
			_S.Bodyguard.slaveName is already doing everything in $his power to save you.
		<<else>>
			<<link "Attempt to signal _S.Bodyguard.slaveName, your bodyguard">>
				<<set $finalChoice = "bodyguard">>
				<<replace "#fate">>
					attempt to signal _S.Bodyguard.slaveName, your bodyguard.
				<</replace>>
			<</link>>
		<</if>>
	<</if>>
	<<if $mercenaries >= 1>>

		<<link "Send a message to the leader of the $mercenariesTitle">>
			<<set $finalChoice = "mercenaries">>
			<<replace "#fate">>
				send a message to the leader of the $mercenariesTitle.
			<</replace>>
		<</link>>
	<</if>>
	<<if $SF.Toggle && $SF.Active >= 1>>

 <<set _N = App.SF.SFC()>>
		<<link "Send a message to _N">>
			<<set $finalChoice = "SF">>
			<<replace "#fate">>
				send a message to <<print App.SF.SFC()>>.
			<</replace>>
		<</link>>
	<</if>>
	<<if $PC.pregSource != -1 && $PC.pregSource != -6>>

		<<link "Try and enrage them.">>
			<<set $finalChoice = "enrage">>
			<<replace "#fate">>
				try and enrage them, baiting them into a vulnerable position.
			<</replace>>
		<</link>>
	<</if>>

	<<link "Make a final stand">>
		<<set $finalChoice = "final stand">>
		<<replace "#fate">>
			make a final stand.
		<</replace>>
	<</link>>

	<<link "Give in">>
		<<set $finalChoice = "give in">>
		<<replace "#fate">>
			give in.
		<</replace>>
	<</link>>

	<<link "Confirm">>
		<<goto "eliteTakeOverFight">>
	<</link>>
<</if>>

repo_name: Welptard/fc

license: mit


code:
:: eliteTakeOverFight [nobr]

<<set _shoot = 0>>
<<switch $finalChoice>>
<<case "bodyguard">>
	<<set _roll = random(0,100)>>
	<<if $career == "mercenary">>
		As a result of your prior experience as a mercenary you were able to successfully signal _S.Bodyguard.slaveName without the Elites noticing.
		<<set _BgSignaled = 1>>
	<<elseif $PC.skill.warfare >= 100 && _roll > 20>>
		As a result of your mastery of warfare you were able to successfully signal _S.Bodyguard.slaveName without the Elites noticing.
		<<set _BgSignaled = 1>>
	<<elseif $PC.skill.warfare >= 60 && _roll > 30>>
		As a result of your expertness of warfare you were able to successfully signal _S.Bodyguard.slaveName without the Elites noticing.
		<<set _BgSignaled = 1>>
	<<elseif $PC.skill.warfare >= 30 && _roll > 40>>
		As a result of having some skill in warfare you were able to successfully signal _S.Bodyguard.slaveName without the elites noticing.
		<<set _BgSignaled = 1>>
	<<elseif $PC.skill.warfare >= 10 && _roll > 50>>
		As a result of having a small amount of skill in warfare you were able to successfully signal _S.Bodyguard.slaveName without the Elites noticing.
		<<set _BgSignaled = 1>>
	<<elseif $PC.skill.warfare < 10 && _roll > 60>>
		By blind luck and what little you remember of your lessons in warfare are were able to successfully signal _S.Bodyguard.slaveName without the Elites noticing.
		<<set _BgSignaled = 1>>
	<<else>>
		One of the Elites shouts "What the fuck are you trying to do?" Well, there goes that option.
		<<set _BgSignaled = 0>>
	<</if>>

You then pick up the revolver and quickly take aim.
<<case "mercenaries">>

You send a quick message to the leader of your $mercenariesTitle, about your situation, then you pick up the revolver and quickly take aim.
	<<set $MercenariesMessageSent = 1>>
<<case "SF">>

You send a quick message to <<print App.SF.SFC()>> about your situation, then you pick up the revolver and quickly take aim.
	<<set $SpecialForcesMessageSent = 1>>
<<case "enrage">>
	<<if $PC.career != "wealth" && $PC.career != "engineer" && $PC.career != "medicine">>
		You know exactly what to say in order to enrage them.
		<<set _EliteEnraged = 1>>
	<<elseif random(0,100) > 50>>
		You manage to select the right words to enrage them.
		<<set _EliteEnraged = 1>>
	<<else>>
		You try to enrage them, but your words have had no effect.
		<<set _EliteEnraged = 0>>
	<</if>>

You then pick up the revolver and quickly take aim.
<<case "final stand">>
	You pick up the revolver and quickly take aim.
<<case "give in">>
	You pick up the revolver and hold the barrel to your temple.
<</switch>>

<<if $finalChoice == "give in">>
	<<if $PC.pregSource == -1 || $PC.pregSource == -6>>Screw their plans, you're out of here. <</if>>With a "Bang!" you drop dead.
	<<set $ui = "start">>

	''GAME OVER''
<<else>>
	/* PC shooting */
	/* higher skill means a higher chance to hit due to lower requirements and if the elites are enraged they very slightly become easier targets. */
	/* 5/6 = 83% rounded down is the chance that it was loaded chamber (simplified version based off the Wikipedia article) */

	/* variables: */
	/* Revolver */
	<<set _revolverChambers = 6>>
	<<set _revolverBullets = 5>>
	/*Elites */
	<<set $eliteTotal = 12>>
	<<set $eliteDead = 0>>
	<<set $eliteVegetable = 0>>

	/* To Hit chance */
	<<if $PC.pregSource == -1 || $PC.pregSource == -6>> /* still woozy */
		<<set _toHit = 56>>
	<<elseif $PC.skill.career == "mercenary" || $PC.skill.warfare >= 100>>
		<<set _toHit = 83>>
	<<elseif $PC.skill.warfare >= 60>>
		<<set _toHit = 76>>
	<<elseif $PC.skill.warfare >= 30>>
		<<set _toHit = 67>>
	<<elseif $PC.skill.warfare >= 10>>
		<<set _toHit = 60>>
	<<else>>
		<<set _toHit = 56>>
	<</if>>
	<<if _EliteEnraged == 1>>
		<<set _toHit += 5>>
	<</if>>

	/* shooting */
	/* in the end I removed the messages from the cycle. I don't think having 6 lines of "you shot" is pretty looking. Feel free to re add them in however */
	<<for _i = _revolverChambers; _i > 0; _i-->>
		<<if random(0,100) <= _toHit && _revolverBullets > 0>>
			<<set $eliteDead += 1, _revolverBullets -= 1>>
		<<elseif _revolverBullets > 0>>
			<<set _revolverBullets -= 1>>
		<</if>>
	<</for>>

	<<if $eliteDead >= 1>>

You managed to kill several Elites in rapid succession, leaving the rest in shock and fear.
	<<elseif $eliteDead == 1>>

You managed to kill one Elite, leaving the rest in shock and fear.
	<<else>>

Unfortunately you fail to kill a single Elite.
	<</if>>

	/* syringe shot */
	<<set $eliteVegetable = 0>>
	<<set _druggedThrow = 0>>

	<<if $eliteDead > 0>>
		With $eliteDead Elites dead, you pick up the syringe from the desk and aim for the forehead of another.
	<<else>>
		Having failed to kill them with the revolver, in a desperate move you pick up the syringe from the desk and aim for the forehead of one of the elite.
	<</if>>
	<<if $PC.pregSource == -1 || $PC.pregSource == -6>>But there's two of them... Shaking your head, you realize it's the drugs messing with you. You just need to focus.<</if>>
	<<set _hitRoll = (random(0,100) - _druggedThrow)>>
	<<if $career == "mercenary" && _hitRoll > 0>>
		With your prior history as a mercenary, making the throw is child's play.
		<<set _SyringeHeadShot = 1>>
	<<elseif $PC.skill.warfare >= 100>>
		<<if _hitRoll > 50>>
			As a result of your mastery of warfare you successfully made the throw.
			<<set _SyringeHeadShot = 1>>
		<<else>>
			Unfortunately you miss the shot.
			<<set _SyringeHeadShot = 0>>
		<</if>>
	<<elseif $PC.skill.warfare >= 60>>
		<<if _hitRoll > 60>>
			As a result of your combat expertise you successfully made the throw.
			<<set _SyringeHeadShot = 1>>
		<<else>>
			Unfortunately you miss the shot.
			<<set _SyringeHeadShot = 0>>
		<</if>>
	<<elseif $PC.skill.warfare >= 30>>
		<<if _hitRoll > 70>>
			As you have some skill, you successfully made the throw.
			<<set _SyringeHeadShot = 1>>
		<<else>>
			Unfortunately you miss the shot.
			<<set _SyringeHeadShot = 0>>
		<</if>>
	<<elseif $PC.skill.warfare >= 10>>
		<<if _hitRoll > 80>>
			Your small amount of skill assisted you in making the throw.
			<<set _SyringeHeadShot = 1>>
		<<else>>
			Unfortunately you miss the shot.
			<<set _SyringeHeadShot = 0>>
		<</if>>
	<<elseif $PC.skill.warfare < 10>>
		<<if _hitRoll > 90>>
			By blind luck you successfully made the throw.
			<<set _SyringeHeadShot = 1>>
		<<else>>
			Unfortunately you miss the shot.
			<<set _SyringeHeadShot = 0>>
		<</if>>
	<</if>>
	<<if _SyringeHeadShot == 1>>

		Picking up the spent revolver, you aim for the syringe's plunger.
		<<if $career == "mercenary">>
			With your prior history as a mercenary, making the throw is child's play.
			<<set _SpentRevolverHitSyringePlunger = 1>>
		<<elseif $PC.skill.warfare >= 100 && random(0,100) > 50>>
			As a result of your mastery of warfare you successfully made the throw.
			<<set _SpentRevolverHitSyringePlunger = 1>>
		<<elseif $PC.skill.warfare >= 60 && random(0,100) > 60>>
			As a result of your expertness of warfare you successfully made the throw.
			<<set _SpentRevolverHitSyringePlunger = 1>>
		<<elseif $PC.skill.warfare >= 30 && random(0,100) > 70>>
			As you have some skill you successfully made the throw.
		<<set _SpentRevolverHitSyringePlunger = 1>>
		<<elseif $PC.skill.warfare >= 10 && random(0,100) > 80>>
			Your small amount of skill assisted you in making the throw.
			<<set _SpentRevolverHitSyringePlunger = 1>>
		<<elseif $PC.skill.warfare < 10 && random(0,100) > 90>>
			By blind luck you successfully made the throw.
			<<set _SpentRevolverHitSyringePlunger = 1>>
		<<else>>
			Unfortunately you miss the shot.
			<<set _SpentRevolverHitSyringePlunger = 0>>
		<</if>>
	<</if>>
	<<if _SpentRevolverHitSyringePlunger == 1>>

		<<if random(0,100) > 50>>
			The target dies of nervous system overload brought about by the drug.
			<<set $eliteDead +=1>>
		<<else>>
			The target is still alive but is nothing more than a vegetable.
			<<set $eliteVegetable = 1>>
		<</if>>
	<</if>>
<</if>>

<<set $eliteLeft = $eliteTotal - $eliteDead - $eliteVegetable>>

/* if the player has managed to make enough damage to the Elite and the rep is high enough the citizens will come to save the PC */
/* this is to give reason to exist for the "enrage" and "last stand" option */
/* result							*/
/* $eliteFate:						*/
/*		killed = 0					*/
/*		enslaved = 1				*/
/*		had fun (and enslaved) = 2	*/
<<if _BgSignaled == 1>>
	<<setLocalPronouns _S.Bodyguard>>
	<<run Enunciate(_S.Bodyguard)>>
	_S.Bodyguard.slaveName asks, "<<Master>>, what <<sh>>ould I do with the <<if $eliteLeft < $eliteTotal>>remaining<</if>> 'Elite' left?"

	<<link "Open fire">>
		<<set $eliteFate = 0>>
		<<goto "eliteTakeOverResult">>
	<</link>>

	<<link "Enslave them">>
		<<set $eliteFate = 1>>
		<<goto "eliteTakeOverResult">>
	<</link>>

<<link "Have fun with them them">>
		<<set $eliteFate = 2>>
		<<goto "eliteTakeOverResult">>
	<</link>>
<<elseif $MercenariesMessageSent == 1>>
	It is now that a squad of $mercenariesTitle makes their entrance, pointing their guns at the <<if $eliteLeft < $eliteTotal>>remaining<</if>> Elite.
	The officer asks, "Your orders, <<= properTitle()>>?"

	<<link "Open fire">>
		<<set $eliteFate = 0>>
		<<goto "eliteTakeOverResult">>
	<</link>>

	<<link "Enslave them">>
		<<set $eliteFate = 1>>
		<<goto "eliteTakeOverResult">>
	<</link>>

<<link "Have fun with them them">>
		<<set $eliteFate = 2>>
		<<goto "eliteTakeOverResult">>
	<</link>>
<<elseif $SpecialForcesMessageSent>>
	It is now that a squad of $SF.Lower makes their entrance, pointing their guns at the <<if $eliteLeft < $eliteTotal>>remaining<</if>> Elite.
	The officer asks, "Your orders, <<= properTitle()>>?"

	<<link "Open fire">>
		<<set $eliteFate = 0>>
		<<goto "eliteTakeOverResult">>
	<</link>>

	<<link "Enslave them">>
		<<set $eliteFate = 1>>
		<<goto "eliteTakeOverResult">>
	<</link>>

<<link "Have fun with them them">>
		<<set $eliteFate = 2>>
		<<goto "eliteTakeOverResult">>
	<</link>>
<<elseif $BodyguardID != 0>>
	<<setLocalPronouns _S.Bodyguard>>
	<<run Enunciate(_S.Bodyguard)>>
	It is now that _S.Bodyguard.slaveName makes $his entrance, pointing $his guns at the <<if $eliteLeft < $eliteTotal>>remaining<</if>> Elite.
	$He then asks "<<Master>>, what <<sh>>ould I do with the <<if $eliteLeft < $eliteTotal>>remaining<</if>> 'Elite' left?"

	<<link "Open fire">>
		<<set $eliteFate = 0>>
		<<goto "eliteTakeOverResult">>
	<</link>>

	<<link "Enslave them">>
		<<set $eliteFate = 1>>
		<<goto "eliteTakeOverResult">>
	<</link>>

<<link "Have fun with them them">>
		<<set $eliteFate = 2>>
		<<goto "eliteTakeOverResult">>
	<</link>>
<<elseif $eliteLeft <= 9 && $rep >= 10000>>
	Some of the citizens waiting outside your penthouse to see you hear the ruckus and rush inside, worried. Time seems to freeze for a few seconds, while the remaining Elite recover from their terror and the citizens digest the gory scene in front of them.
	The newcomers are quick to take your side. In little time the Elites, outgunned and outnumbered, are neutralized.

One of the more courageous citizens approaches you and asks "<<= properTitle()>>, what should we do with them?"

	<<link "Open fire">>
		<<set $eliteFate = 0>>
		<<goto "eliteTakeOverResult">>
	<</link>>

	<<link "Enslave them">>
		<<set $eliteFate = 1>>
		<<goto "eliteTakeOverResult">>
	<</link>>

<<link "Have fun with them them">>
		<<set $eliteFate = 2>>
		<<goto "eliteTakeOverResult">>
	<</link>>
<<elseif $finalChoice != "give in">>
	With nothing else left, you remain powerless to stop the <<if $eliteLeft < $eliteTotal>>remaining<</if>> Elite, who quickly capture and enslave you. Your personal story may continue, but the part of it worthy of retelling has now ended.
	<<set $ui = "start">>

	''GAME OVER''
<</if>>


code:
:: eliteTakeOverResult [nobr]

<<set $nextButton = "Continue">><<UpdateNextButton>> /* unlock Continue button */

<<if _S.Bodyguard>>
	<<setLocalPronouns _S.Bodyguard>>
<</if>>
<<setNonlocalPronouns $seeDicks>>

<<switch $eliteFate>>
<<case 0>>
	<<if $MercenariesMessageSent == 1>>
		The mercenaries open fire as ordered. Shortly after, the conspiring Elite are dead.
	<<elseif $SpecialForcesMessageSent == 1>>
		The soldiers open fire as ordered. Shortly after, the conspiring Elite are dead.
	<<elseif $eliteLeft <= 9 && $rep >= 10000>>
		Your citizens freeze for a second, then obey your orders. Shortly after, the conspiring Elite are dead.
	<<else>>
		Your bodyguard opens fire as ordered. Shortly after, the conspiring Elite are dead.
	<</if>>
<<case 1>>
	<<if random(0,100) > 50>>
		An Elite bites down on a cyanide pill hidden in a false tooth and
		<<if random(0,100) > 75>>
			takes the coward's way out (how predictable), frothing at the mouth.
			<<set $eliteDead += 1>>
		<<else>>
			experiences great pain but unfortunately (for them at least) survives.
		<</if>>
	<</if>>
	<<if $MercenariesMessageSent == 1>>

The <<if $eliteLeft < $eliteTotal>>remaining<</if>> Elite are quickly captured and enslaved by your mercenaries.
	<<elseif $SpecialForcesMessageSent == 1>>

The <<if $eliteLeft < $eliteTotal>>remaining<</if>> Elite are quickly captured and enslaved by your soldiers.
	<<elseif $eliteLeft <= 9 && $rep >= 10000>>

The <<if $eliteLeft < $eliteTotal>>remaining<</if>> Elite are quickly captured and enslaved by your loyal citizens.
	<<else>>

The <<if $eliteLeft < $eliteTotal>>remaining<</if>> Elite are quickly captured and enslaved by your bodyguard.
	<</if>>
<<case 2>>
	<<if random(0,100) > 50>>
			An Elite bites down on a cyanide pill hidden in a false tooth and
		<<if random(0,100) > 75>>
			takes the coward's way out (how predictable), frothing at the mouth.
			<<set $eliteDead += 1>>
		<<else>>
			experiences great pain but unfortunately (for them at least) survives.
		<</if>>
	<</if>>
	<<if $MercenariesMessageSent == 1>>

The <<if $eliteLeft < $eliteTotal>>remaining<</if>> Elite are quickly captured, abused and enslaved.
		The officer is thankful for giving the troops a chance to let off some stream. Two soldiers decide to double team an Elite; one ass fucks while the other facefucks.
		Another soldier takes a particular interest in an Elite and politely asks you
		"<<= properTitle()>>, can I keep _himU?"

			<<link "No">>
				<<replace "#choice1">>
					Your rejection upsets some of them, but their professionalism ensures it isn't visible.
				<</replace>>
			<</link>>
			|
			<<link "Yes">>
				<<set $eliteLeft -= 1>>
				<<run repX(2500, "event")>>
				<<replace "#choice1">>
					For a second your acceptance shocks them. Once they recover they are very grateful. "Thank you <<= properTitle()>>, I'll make sure to look after _himU." Soon the story spreads of the kind arcology owner, enhancing your reputation.
				<</replace>>
			<</link>>

	<<elseif $SpecialForcesMessageSent>>

The <<if $eliteLeft < $eliteTotal>>remaining<</if>> Elite are quickly captured, abused and enslaved.
		<<if $SF.Depravity <= 0.3>>
			Two soldiers decide to double team an Elite; one gropes _hisU ass while the other gropes _hisU tits.
		<<elseif $SF.Depravity <= 1.2>>
			Two soldiers decide to double team an Elite; one assfucks while the other facefucks.
		<<else>>
			Two soldiers decide to double team an Elite; one breaks out their knife and begins to make little breaks in the Elite's skin while the other soldier facefucks them.
		<</if>>
		Another soldier takes a particular interest in an Elite and politely asks you "<<= properTitle()>>, can I keep _himU?"

			<<link "No">>
				<<set _SFHappyEverAfter = 0>>
				<<replace "#choice1">>
					Your rejection upsets some of them, but their professionalism ensures it isn't visible.
				<</replace>>
			<</link>>
			|
			<<link "Yes">>
				<<set $eliteLeft -= 1, _SFHappyEverAfter = 1>>
				<<run repX(2500, "event")>>
				<<replace "#choice1">>
					For a second your acceptance shocks them. Once they recover they are very grateful. "Thank you <<= properTitle()>>, I'll make sure to look after _himU." Soon the story spreads of the kind arcology owner, enhancing your reputation.
				<</replace>>
			<</link>>

		<<if $SF.MercCon.CanAttend === -2>>
			<<switch $SF.Colonel.Core>>
			<<case "kind">>
				The Colonel is shocked that you would allow her troops to do this but understands that it comes with the territory.<<if _SFHappyEverAfter == 1>> "Thanks for being kind to one of my soldiers."<</if>>
			<<case "brazen" "cruel" "jaded">>
				The Colonel is grateful that you let her troops let off some steam.<<if _SFHappyEverAfter == 1>> "Thanks for being kind to one of my soldiers."<</if>>
			<</switch>>
		<</if>>
		<<set $SF.Depravity += 0.05>>
	<<elseif $eliteLeft <= 9 && $rep >= 10000>>
		<<if $arcologies[0].FSDegradationist != "unset">>
			An evil smile appears on the faces of your loyal citizens, while the surviving Elite freeze in terror. The impromptu festivity will go on for hours, getting more and more depraved.
		<<else>>
			While some citizens respectfully step out, some join you in the fun. The impromptu festivities will go on for hours, getting more and more depraved.
		<</if>>
	<<else>>
		<<if _S.Bodyguard.fetish == "sadist">>_S.Bodyguard.slaveName gets out $his melee weapon and starts to give them many small cuts, the look of pleasure on $his face is evident.<<else>>_S.Bodyguard.slaveName ties them and then gets out $his melee weapon and starts to abuse them; $his face is blank.<</if>>

Shortly after, the terrified <<if $eliteLeft < $eliteTotal>>remaining<</if>> Elite are quickly brought away to be officially enslaved.
	<</if>>
<</switch>>

<<if $eliteFate >= 1>>
	<<if $eliteVegetable == 1>>
		<<set $eliteLeft-->>
		<<set $activeSlaveOneTimeMinAge = 25>>
		<<set $activeSlaveOneTimeMaxAge = ($retirementAge-2)>>
		<<set $oneTimeDisableDisability = 1>>
		<<if $arcologies[0].FSSupremacistLawME == 1>>
			<<set $fixedRace = $arcologies[0].FSSupremacistRace>>
		<<elseif $arcologies[0].FSSubjugationistLawME == 1>>
			<<set _races = setup.filterRacesLowercase.filter(race => race !== $arcologies[0].FSSubjugationistRace)>>
			<<set $fixedRace = _races.random()>>
		<</if>>
		<<if $seeDicks == 0>>
			<<set $activeSlave = GenerateNewSlave("XX")>>
		<<elseif $seeDicks == 100>>
			<<set $activeSlave = GenerateNewSlave("XY")>>
		<<elseif random(1,100) > 50>> /* 50% chance of getting girl or boy */
			<<set $activeSlave = GenerateNewSlave("XX")>>
		<<else>>
			<<set $activeSlave = GenerateNewSlave("XY")>>
		<</if>>
		<<set _origin = "$He was a member of the Societal Elite, captured in their failed attempt at expressing their displeasure.">>
		<<set $activeSlave.origin = _origin>>
		<<set $activeSlave.career = "a well connected individual">>
		<<set $activeSlave.prestige = either(2,2,3)>> /* 33% chance of getting level 3 prestige */
		<<set $activeSlave.prestigeDesc = "$He was once considered influential in society, but now $he's the one getting fucked.">>
		<<set $activeSlave.face = random(70,100)>>
		<<set $activeSlave.devotion = random(-10,-20)>>
		<<set $activeSlave.trust = random(-20,-30)>>
		<<if $activeSlave.boobShape == "saggy" || $activeSlave.boobShape == "downward-facing">>
			<<set $activeSlave.boobShape = either("perky", "torpedo-shaped", "wide-set")>>
		<</if>>
		<<set $activeSlave.fetish = "mindbroken">>
		<<set $activeSlave.pubicHStyle = "waxed">>
		<<set $activeSlave.underArmHStyle = "waxed">>
		<<set $activeSlave.anus = 0>>
		<<set $activeSlave.weight = random(10,75)>>
		<<set $activeSlave.intelligence = random(70,100)>>
		<<set $activeSlave.intelligenceImplant = 30>>
		<<set $activeSlave.skill.entertainment = 0>>
		<<set $activeSlave.skill.whoring = 0>>
		<<run setHealth($activeSlave, jsRandom(60, 75), 0, 0, 0, jsRandom(0, 20))>>
		<<set $activeSlave.canRecruit = 0>>
		<<run newSlave($activeSlave)>> /* skip New Slave Intro */
	<</if>>
	<<for _i = $eliteLeft; _i > 0; _i-->>
		<<set $activeSlaveOneTimeMinAge = 25>>
		<<set $activeSlaveOneTimeMaxAge = ($retirementAge-2)>>
		<<set $oneTimeDisableDisability = 1>>
		<<if $arcologies[0].FSSupremacistLawME == 1>>
			<<set $fixedRace = $arcologies[0].FSSupremacistRace>>
		<<elseif $arcologies[0].FSSubjugationistLawME == 1>>
			<<set _races = setup.filterRacesLowercase.filter(race => race !== $arcologies[0].FSSubjugationistRace)>>
			<<set $fixedRace = _races.random()>>
		<</if>>
		<<if $seeDicks == 0>>
			<<set $activeSlave = GenerateNewSlave("XX")>>
		<<elseif $seeDicks == 100>>
			<<set $activeSlave = GenerateNewSlave("XY")>>
		<<elseif random(1,100) > 50>> /* 50% chance of getting girl or boy */
			<<set $activeSlave = GenerateNewSlave("XX")>>
		<<else>>
			<<set $activeSlave = GenerateNewSlave("XY")>>
		<</if>>
		<<set _origin = "$He was a member of the Societal Elite, captured in their failed attempt at expressing their displeasure.">>
		<<set $activeSlave.origin = _origin>>
		<<set $activeSlave.career = "a well connected individual">>
		<<set $activeSlave.prestige = either(2,2,3)>>
		<<set $activeSlave.prestigeDesc = "$He was once considered influential in society, but now $he's the one getting fucked.">>
		<<set $activeSlave.face = random(70,100)>>
		<<set $activeSlave.devotion = random(-10,-20)>>
		<<set $activeSlave.trust = random(-20,-30)>>
		<<if $eliteFate == 2 && random(1,100) >= 75>> /* 25% chance of getting mindbroken elites if they were abused */
			<<set $activeSlave.fetish = "mindbroken">>
		<</if>>
		<<if $activeSlave.boobShape == "saggy" || $activeSlave.boobShape == "downward-facing">>
			<<set $activeSlave.boobShape = either("perky", "torpedo-shaped", "wide-set")>>
		<</if>>
		<<set $activeSlave.pubicHStyle = "waxed">>
		<<set $activeSlave.underArmHStyle = "waxed">>
		<<set $activeSlave.anus = 0>>
		<<set $activeSlave.weight = random(-30,75)>>
		<<set $activeSlave.intelligence = random(0,60)>>
		<<set $activeSlave.intelligenceImplant = 30>>
		<<set $activeSlave.skill.entertainment = 0>>
		<<set $activeSlave.skill.whoring = 0>>
		<<run setHealth($activeSlave, jsRandom(60, 75), 0, 0, 0, jsRandom(0, 20))>>
		<<set $activeSlave.canRecruit = 0>>
		<<set $activeSlave.behavioralFlaw = either("arrogant", "bitchy")>>
		<<run newSlave($activeSlave)>> /* skip New Slave Intro */
	<</for>>
<</if>>

/* clean up */
<<set $failedElite = 0, $eugenicsFullControl = 1>>


code:
:: fat grafting workaround [nobr]

<<set $nextButton = "Finalize fat transfer", $nextLink = "Surgery Degradation">>

Enough graftable body fat was harvested for an additional <<print $availableFat*100>>ccs per breast or an additional <<if getSlave($AS).butt <= 10>><<print $availableFat/2>><<else>><<print $availableFat/5>><</if>> sizes to $his rear. <<if $availableFat == 0>>All fat marked for use<<else>>A total of $availableFat unit<<if $availableFat > 1>>s<</if>> remain<</if>>.

$boobFat units of fat will be added to $his breasts for a size gain of <<print $boobFat*100>>ccs.

<<if $availableFat > 0>>
	[[Increase|fat grafting workaround][$boobFat++, $availableFat--]] |
<<else>>
	No more fat available. |
<</if>>
<<if $boobFat > 0>>
	[[Decrease|fat grafting workaround][$boobFat--, $availableFat++]]
<<else>>
	No fat marked for breast use.
<</if>>

<<if getSlave($AS).butt <= 10>><<print $buttFat*2>><<else>><<print $buttFat*5>><</if>> units of fat will be added to $his ass for a size gain of $buttFat.
<<if getSlave($AS).butt > 10>>

	<<if $availableFat > 0>>
		[[Increase|fat grafting workaround][$buttFat += .2, $availableFat -= 1]] |
	<<else>>
		No more fat available. |
	<</if>>
	<<if $buttFat > 0>>
		[[Decrease|fat grafting workaround][$buttFat -= .2, $availableFat += 1]]
	<<else>>
		No fat marked for ass use.
	<</if>>
<<else>>

	<<if $availableFat > 0>>
		[[Increase|fat grafting workaround][$buttFat += .5, $availableFat -= 1]] |
	<<else>>
		No more fat available. |
	<</if>>
	<<if $buttFat > 0>>
		[[Decrease|fat grafting workaround][$buttFat -= .5, $availableFat += 1]]
	<<else>>
		No fat marked for ass use.
	<</if>>
<</if>>


code:
:: Gene Lab [nobr jump-to-safe jump-from-safe]

<<set $nextButton = "Back", $nextLink = "Manage Penthouse", $encyclopedia = "The Pharmaceutical Fab.", _PCSkillCheck = Math.min($upgradeMultiplierMedicine, $HackingSkillMultiplier)>>

The Gene Lab

<<if $geneticMappingUpgrade == 1>>
	//The gene lab is fully operational. It is capable of mapping a slave's genes, identifying genetic traits and abnormalities. It can be used to modify a slave's genome should you obtain the data necessary to adjust it.//

	[[Upgrade the genome mapper|Gene Lab][cashX(forceNeg(Math.trunc(500000*$upgradeMultiplierArcology)), "capEx"), $geneticMappingUpgrade = 2]]
	//Costs <<print cashFormat(Math.trunc(500000*$upgradeMultiplierArcology))>>//
<<elseif $geneticMappingUpgrade == 2>>
	//The gene lab is fully operational. It is capable of fully mapping a slave's genes, identifying genetic traits and abnormalities. It can be used to correct (or flaw) a slave's genome, as well as modify it should you obtain the data necessary to adjust it.//
<</if>>

Genetic Modification

<<if $dispensaryUpgrade == 0>>
	//The fabricator must be upgraded before it can produce treatments to alter genes//

<<else>>
	The fabricator is capable of producing treatments to alter a slave's genetic code.

	<<if $arcologies[0].childhoodFertilityInducedNCSResearch == 1>>
		The fabricator is capable of producing treatments to induce NCS.

	<</if>>
	<<if $RapidCellGrowthFormula == 1>>
		The fabricator is capable of producing treatments to accelerate cellular reproduction.

	<</if>>
	<<if $immortalityFormula == 1>>
		The fabricator is capable of producing treatments to permanently reverse aging.

	<<elseif $cash >= 50000000>>
		[[Fund the immortality project|Gene Lab][cashX(forceNeg(50000000), "capEx"), $immortalityFormula = 1]]
		//Costs <<print cashFormat(50000000)>>//

    //Will keep a slave at their prime physical age//

	<</if>>
	<<if $geneticMappingUpgrade >= 2>>
		<<if $geneticFlawLibrary != 1>>
			[[Purchase designs for inducing genetic anomalies|Gene Lab][cashX(forceNeg(100000*_PCSkillCheck), "capEx"), $geneticFlawLibrary = 1]]
			//Costs <<print cashFormat(100000*_PCSkillCheck)>>//

    //Will allow genetic flaws and quirks to be injected into a slave's genome//

		<<else>>
			The fabricator is capable of producing treatments to induce various genetic anomalies.

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

Genetic Harvesting

<<if ($cloningSystem != 1) && ($rep <= 18000*_PCSkillCheck)>>
	//You lack the reputation needed to access methods for human cloning//

<<elseif ($cloningSystem != 1) && ($rep > 18000*_PCSkillCheck)>>
	<<if $organFarmUpgrade == 0>>
		//An organ farm is needed to grow the blank embryo to serve as a clone base//

	<<else>>
		[[Purchase methods for human cloning|Gene Lab][cashX(forceNeg(100000*_PCSkillCheck), "capEx"), $cloningSystem = 1]]
		//Costs <<print cashFormat(100000*_PCSkillCheck)>>//

    //Will allow children to be created with identical base genetics as the source DNA//

	<</if>>
<<elseif ($cloningSystem > 0)>>
	The gene lab is capable of implanting a slave's genetic sequence into a blank embryo to produce a basic clone. [[Make a clone|Cloning Workaround][$donatrix = "Undecided", $receptrix = "Undecided"]]

<</if>>


code:
:: Husk Slave Swap [nobr]

<<set $nextButton = "Continue">>
<<set _oldSlave = clone($swappingSlave)>>
<<set _m = $slaveIndices[$swappingSlave.ID]>>

You strap $slaves[_m].slaveName, and the body to which $he will be transferred, into the remote surgery and stand back as it goes to work.
<<BodySwap $slaves[_m] $activeSlave>>
<<set _gps = $genePool.findIndex(function(s) { return s.ID == $slaves[_m].ID; })>>
<<set $genePool[_gps].race = $slaves[_m].race, $genePool[_gps].origRace = $slaves[_m].origRace, $genePool[_gps].skin = $slaves[_m].skin, $genePool[_gps].markings = $slaves[_m].markings, $genePool[_gps].eye.origColor = $slaves[_m].eye.origColor, $genePool[_gps].origHColor = $slaves[_m].origHColor, $genePool[_gps].origSkin = $slaves[_m].origSkin, $genePool[_gps].face = $slaves[_m].face, $genePool[_gps].pubicHStyle = $slaves[_m].pubicHStyle, $genePool[_gps].underArmHStyle = $slaves[_m].underArmHStyle, $genePool[_gps].eyebrowHStyle = $slaves[_m].eyebrowHStyle>> /* special exception to swap genePool since the temporary body lacks an entry. Otherwise we could just call the widget using the genePool entries */

After an honestly impressive procedure, $slaves[_m].slaveName is recovering nicely.

<<BodySwapReaction $slaves[_m] _oldSlave>>

<<set _slaveCost = slaveCost(_oldSlave)>>
<<set _payout = Math.trunc(_slaveCost/3)>>
$slaves[_m].slaveName's old body was bought by the Flesh Heap for <<print cashFormat(_payout)>>.
<<if $slaves[_m].bodySwap > 0>>
	<<set _myBody = $slaves.findIndex(function(s) { return s.origBodyOwnerID == $slaves[_m].ID; })>>
	<<if _myBody != -1>>
		<<set $slaves[_myBody].origBodyOwnerID = 0>>
		<<setLocalPronouns $slaves[_myBody] 2>>
		<<if $slaves[_myBody].fetish != "mindbroken" && $slaves[_myBody].fuckdoll == 0>>
			<<if $slaves[_myBody].devotion > 20>>
				$slaves[_myBody].slaveName is somewhat saddened to see _his2 body leave forever.
			<<elseif $slaves[_myBody].devotion >= -50>>
				$slaves[_myBody].slaveName is @@.mediumorchid;disturbed@@ to find _his2 body is gone for good, damaging _his2 @@.gold;ability to trust you.@@
				<<set $slaves[_myBody].devotion -= 30, $slaves[_myBody].trust -= 30>>
			<<else>>
				$slaves[_myBody].slaveName is @@.mediumorchid;deeply upset@@ that _he2'll never see _his2 body again. With so little left, _he2 finds it easy to take vengeance by @@.orangered;completely rejecting your ownership of _him2.@@
				<<set $slaves[_myBody].devotion -= 50, $slaves[_myBody].trust = 100>>
			<</if>>
		<</if>>
	<</if>>
<</if>>
<<set $slaves[_m].bodySwap++>>
<<run cashX(_payout, "slaveTransfer")>>
<<set $activeSlave = 0, $swappingSlave = 0>>


code:
:: husk Slave Swap Workaround [nobr]

<<if $activeSlave.tankBaby != 3>>
	<<set $nextButton = "Abort Operation", $nextLink = "Scheduled Event", $returnTo = "Scheduled Event">>
<<else>>
	<<set $nextButton = "Abort Operation", $nextLink = "Main", $returnTo = "Incubator">>
<</if>>

"This operation is neither simple nor is it perfected. There are extreme health risks involved and no guarantee of success. Strap a slave into your remote surgery to consent to the operation. Indentured servants<<if ($incubator > 0) || ($nurseryChildren)>> and slaves with reserved children<</if>> are not eligible."

//Select the slave whose mind will be transferred into the waiting husk. Amputated slaves must not be wearing prosthetics. This operation will cost <<print cashFormat(10000)>>.//

__Select an eligible slave:__
<<for _i = 0; _i < $slaves.length; _i++>>
	<<capture _i>>
		<<if isSlaveAvailable($slaves[_i])>>
			<<if $slaves[_i].fuckdoll == 0>>
				<<if !hasAnyProstheticLimbs($slaves[_i])>>
					<<if $slaves[_i].indenture == -1>>
						<<if $slaves[_i].breedingMark == 0 || $propOutcome == 0 || $eugenicsFullControl == 1 || $arcologies[0].FSRestart == "unset">>
							<<if WombReserveCount($slaves[_i]) == 0>>
								<<if $slaves[_i].ID != $AS>>
									<<set _name = SlaveFullName($slaves[_i])>>

[[_name|Husk Slave Swap][$swappingSlave = $slaves[_i], cashX(-10000, "slaveSurgery", $slaves[_i])]]
								<</if>>
							<</if>>
						<</if>>
					<</if>>
				<</if>>
			<</if>>
		<</if>>
	<</capture>>
<</for>>


code:
:: Implant Manufactory [nobr jump-to-safe jump-from-safe]

<<set $nextButton = "Back", $nextLink = "Manage Penthouse", $encyclopedia = "The Pharmaceutical Fab.", _PCSkillCheck = Math.min($upgradeMultiplierMedicine, $HackingSkillMultiplier)>>

The Implant Manufactory

	The implant manufactory is running smoothly. It can cheaply produce advanced implants and has freed you from relying on outside sources for specialty implants. It can easily produce more complex implants should you obtain the schematics necessary to build them.

Implant Production

The manufactory is capable of producing customized fillable implants.

<<if ($meshImplants != 1) && ($rep <= 10000*_PCSkillCheck)>>

		You lack the reputation to access plans for supportive breast implants.

<<elseif ($meshImplants != 1) && ($rep > 10000*_PCSkillCheck)>>

		[[Purchase plans for supportive mesh breast implants|Implant Manufactory][cashX(forceNeg(40000*_PCSkillCheck), "capEx"), $meshImplants = 1]]

			Costs <<print cashFormat(40000*_PCSkillCheck)>>

				Will allow the construction of organic and supportive mesh breast implants.

<<elseif ($meshImplants > 0)>>

The manufactory is capable of producing supportive mesh breast implants.

<</if>>

<<if $UterineRestraintMesh == 1>>

The manufactory is capable of producing supportive mesh uterine implants.

<</if>>

<<if ($bellyImplants == 0) && ($rep <= 2000*_PCSkillCheck)>>

You lack the reputation to access experimental fillable abdominal implants.

<<elseif ($bellyImplants == 0) && ($rep > 2000*_PCSkillCheck)>>

		[[Purchase schematics for fillable abdominal implants|Implant Manufactory][cashX(forceNeg(30000*_PCSkillCheck), "capEx"), $bellyImplants = 1]]

			Costs <<print cashFormat(30000*_PCSkillCheck)>>

				Will allow the construction of fillable abdominal implants for the autosurgery.

<<elseif ($bellyImplants > 0)>>

The manufactory is capable of crafting fillable abdominal implants.

	<<if ($bellyImplants == 1) && ($cervixImplants == 0) && ($rep <= 6000*_PCSkillCheck)>> /* show only after belly implants already researched */

You lack the reputation to access experimental cervix filter micropumps schematics for abdominal implants.

	<<elseif ($bellyImplants == 1) && ($cervixImplants == 0) && ($rep > 6000 * _PCSkillCheck)>> /* nanotech like technology much more impressive and costly than simple implant */

			[[Purchase schematics for cervix filter micropumps|Implant Manufactory][cashX(forceNeg(70000*_PCSkillCheck), "capEx"), $cervixImplants = 1]]

				Costs <<print cashFormat(70000*_PCSkillCheck)>>

					Will allow the construction of cervix filter micropumps for fillable abdominal implants using the autosurgery.

	<<elseif ($cervixImplants == 1) && ($rep <= 8000*_PCSkillCheck)>>

The manufactory is capable of crafting cervix filter micropumps for fillable abdominal implants.

			You lack the reputation to obtain conversion kits for rectal filter micropumps.

	<<elseif ($cervixImplants == 1) && ($rep > 8000*_PCSkillCheck)>>

The manufactory is capable of crafting cervix filter micropumps for fillable abdominal implants.

			[[Purchase conversion kits for rectal filter micropumps|Implant Manufactory][cashX(forceNeg(60000*_PCSkillCheck), "capEx"), $cervixImplants = 2]]

				Costs <<print cashFormat(60000*_PCSkillCheck)>>

					Will allow the construction of the anal equivalent of the cervix micropumps using the autosurgery.

	<<elseif ($cervixImplants > 1)>>

The manufactory is capable of crafting cervix and rectal filter micropumps for fillable abdominal implants.

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

<<if $seePreg != 0>>

Fertility Implants

	<<if $fertilityImplant == 1>>

The manufactory is capable of crafting fertility enhancing implants for ovaries.

	<<elseif $fertilityImplant == 0 && ($rep <= 3000*_PCSkillCheck)>>

			You lack the reputation to access fertility boosting ovarian implants.

	<<else>>

			[[Purchase schematics for fertility enhancing ovarian implants|Implant Manufactory][cashX(forceNeg(10000*_PCSkillCheck), "capEx"), $fertilityImplant = 1]]

				Costs <<print cashFormat(10000*_PCSkillCheck)>>

					Will allow the construction of implants that encourage multiple eggs being released during ovulation.

	<</if>>

	<<if $sympatheticOvaries == 1>>

The manufactory is capable of crafting implants that synchronize ovum release.

	<</if>>

	<<if $seeHyperPreg == 1 && $seeExtreme == 1>>
		<<if ($permaPregImplant == 0) && ($rep <= 4000*_PCSkillCheck)>>

You lack the reputation to access experimental pregnancy generator schematics.

		<<elseif ($permaPregImplant == 0) && ($rep > 4000*_PCSkillCheck)>>

				[[Purchase schematics for an experimental implantable pregnancy generator|Implant Manufactory][cashX(forceNeg(40000*_PCSkillCheck), "capEx"), $permaPregImplant = 1]]

					Costs <<print cashFormat(40000*_PCSkillCheck)>>

						Will allow the construction of implants that force perpetual pregnancy.

		<<elseif ($permaPregImplant > 0)>>

The manufactory is capable of crafting pregnancy generators.

		<</if>>
		<<if $PGHack == 1>>

			The tools required to hack the firmware of basic pregnancy generator implants have been produced by the manufactory for use in the remote surgery.

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

<</if>>

Fluid Production Implants

<<if ($prostateImplants != 1) && ($rep <= 3000*_PCSkillCheck)>>

You lack the reputation to access plans for prostate implants.

<<elseif ($prostateImplants != 1) && ($rep > 3000*_PCSkillCheck)>>

		[[Purchase plans for ejaculation enhancing prostate implants|Implant Manufactory][cashX(forceNeg(30000*_PCSkillCheck), "capEx"), $prostateImplants = 1]]

			Costs <<print cashFormat(30000*_PCSkillCheck)>>

				Will allow the construction of a prostate implant designed to stimulate fluid production for massive ejaculations. Beware of leaking and dehydration.

<<elseif ($prostateImplants > 0)>>

The manufactory is capable of producing ejaculation enhancing prostate implants.

<</if>>


code:
:: Incubator Report [nobr]

<<set $readySlaves = 0>>
<<if $incubatorImprintSetting == 0>><<set $incubatorImprintSetting = "trust">><</if>>

<<for _inc = 0; _inc < $tanks.length; _inc++>>
	<<setLocalPronouns $tanks[_inc]>>
	<<set $tanks[_inc].birthWeek += 1>>
	<<if $tanks[_inc].birthWeek >= 52>>
		<<set $tanks[_inc].birthWeek = 0>>
		<<if $seeAge == 1>>
			<<set $tanks[_inc].actualAge++, $tanks[_inc].ovaryAge++>>
		<</if>>
	<</if>>
	<<if $tanks[_inc].growTime > 0>>
		<<set $tanks[_inc].growTime -= $incubatorUpgradeSpeed>>

@@.pink;<<print $tanks[_inc].slaveName>>'s@@ growth is currently being accelerated. $He <<if Math.round($tanks[_inc].growTime/$incubatorUpgradeSpeed) <= 0>>is @@.lime;ready for release.@@ $He will be ejected from $his tank upon your approach<<else>>will be ready for release in about <<print Math.round($tanks[_inc].growTime/$incubatorUpgradeSpeed)>> weeks<</if>>.
	<<else>>
		@@.pink;$tanks[_inc].slaveName@@ is @@.lime;ready for release.@@ $He will be ejected from $his tank upon your approach.
		<<set $readySlaves = 1>>
	<</if>>

	<<if $incubatorUpgradeWeight == 1>>

		<<if $incubatorWeightSetting == 1>>
			<<if $tanks[_inc].weight < 200>>
				<<if $incubatorUpgradeSpeed == 52>>
					<<set $tanks[_inc].weight += 70>>
				<<elseif $incubatorUpgradeSpeed == 18>>
					<<set $tanks[_inc].weight += 40>>
				<<elseif $incubatorUpgradeSpeed == 9>>
					<<set $tanks[_inc].weight += 20>>
				<<elseif $incubatorUpgradeSpeed == 6>>
					<<set $tanks[_inc].weight += 10>>
				<<elseif $incubatorUpgradeSpeed == 5>>
					<<set $tanks[_inc].weight += 5>>
				<</if>>
			<</if>>
			The weight monitoring systems are overloading $his intake causing @@.red;rapid weight gain.@@
		<<elseif $incubatorWeightSetting == 2>>
			<<if $tanks[_inc].weight > 10>>
				<<if $incubatorUpgradeSpeed == 52>>
					<<set $tanks[_inc].weight -= 30>>
				<<elseif $incubatorUpgradeSpeed == 18>>
					<<set $tanks[_inc].weight -= 10>>
				<<elseif $incubatorUpgradeSpeed == 9>>
					<<set $tanks[_inc].weight -= 5>>
				<<elseif $incubatorUpgradeSpeed == 6>>
					<<set $tanks[_inc].weight -= 2>>
				<<elseif $incubatorUpgradeSpeed == 5>>
					<<set $tanks[_inc].weight -= 1>>
				<</if>>
				The weight monitoring systems detect $he is overweight and @@.green;decrease $his caloric intake.@@
			<<elseif $tanks[_inc].weight < -10>>
				<<if $incubatorUpgradeSpeed == 52>>
					<<set $tanks[_inc].weight += 30>>
				<<elseif $incubatorUpgradeSpeed == 18>>
					<<set $tanks[_inc].weight += 10>>
				<<elseif $incubatorUpgradeSpeed == 9>>
					<<set $tanks[_inc].weight += 5>>
				<<elseif $incubatorUpgradeSpeed == 6>>
					<<set $tanks[_inc].weight += 2>>
				<<elseif $incubatorUpgradeSpeed == 5>>
					<<set $tanks[_inc].weight += 1>>
				<</if>>
				The weight monitoring systems detect $he is underweight and @@.green;increase $his caloric intake.@@
			<<else>>
				$He is @@.lime;currently at a healthy weight;@@ efforts will be made to maintain it.
			<</if>>
		<<elseif $incubatorWeightSetting == 0>>
			<<if $tanks[_inc].weight > -100>>
				$His developing body @@.red;quickly sheds its gained weight.@@
				<<set $tanks[_inc].weight -= 40>>
			<</if>>
		<</if>>
	<<else>>
		<<if $tanks[_inc].weight > -100>>
			$His developing body @@.red;quickly sheds its gained weight.@@
			<<set $tanks[_inc].weight -= 40>>
		<</if>>
	<</if>>

	<<if $incubatorUpgradeMuscles == 1>>

		<<if $incubatorMusclesSetting == 2>>
			<<if $tanks[_inc].muscles < 100>>
				<<if $incubatorUpgradeSpeed == 52>>
					<<set $tanks[_inc].muscles += 70>>
				<<elseif $incubatorUpgradeSpeed == 18>>
					<<set $tanks[_inc].muscles += 40>>
				<<elseif $incubatorUpgradeSpeed == 9>>
					<<set $tanks[_inc].muscles += 20>>
				<<elseif $incubatorUpgradeSpeed == 6>>
					<<set $tanks[_inc].muscles += 10>>
				<<elseif $incubatorUpgradeSpeed == 5>>
					<<set $tanks[_inc].muscles += 5>>
				<</if>>
			<</if>>
			The strength monitoring systems are overloading $him with steroids causing @@.green;rapid muscle development.@@
		<<elseif $incubatorMusclesSetting == 1>>
			<<if $tanks[_inc].muscles > 10>>
				<<if $incubatorUpgradeSpeed == 52>>
					<<set $tanks[_inc].muscles -= 30>>
				<<elseif $incubatorUpgradeSpeed == 18>>
					<<set $tanks[_inc].muscles -= 10>>
				<<elseif $incubatorUpgradeSpeed == 9>>
					<<set $tanks[_inc].muscles -= 5>>
				<<elseif $incubatorUpgradeSpeed == 6>>
					<<set $tanks[_inc].muscles -= 2>>
				<<elseif $incubatorUpgradeSpeed == 5>>
					<<set $tanks[_inc].muscles-->>
				<</if>>
				The strength monitoring systems detect $he is overly muscular and @@.green;decrease $his steroid dosage.@@
			<<elseif $tanks[_inc].muscles < -10>>
				<<if $incubatorUpgradeSpeed == 52>>
					<<set $tanks[_inc].muscles += 30>>
				<<elseif $incubatorUpgradeSpeed == 18>>
					<<set $tanks[_inc].muscles += 10>>
				<<elseif $incubatorUpgradeSpeed == 9>>
					<<set $tanks[_inc].muscles += 5>>
				<<elseif $incubatorUpgradeSpeed == 6>>
					<<set $tanks[_inc].muscles += 2>>
				<<elseif $incubatorUpgradeSpeed == 5>>
					<<set $tanks[_inc].muscles++>>
				<</if>>
				The strength monitoring systems detect $he is weak and @@.green;increase $his steroid dosage.@@
			<<else>>
				$He has @@.lime;a healthy musculature;@@ efforts will be made to maintain it.
			<</if>>
		<<elseif $incubatorMusclesSetting == 0>>
			<<if $tanks[_inc].muscles > -100>>
				$His developing body @@.red;quickly loses its gained muscle.@@
				<<set $tanks[_inc].muscles -= 40>>
			<</if>>
		<</if>>
	<<else>>
		<<if $tanks[_inc].muscles > -100>>
			$His developing body @@.red;quickly loses its gained muscle.@@
			<<set $tanks[_inc].muscles -= 40>>
		<</if>>
	<</if>>

	<<if $incubatorUpgradeGrowthStims == 1 && $incubatorGrowthStimsSetting != 0>>

		<<set _heightLimit = Math.trunc(Math.clamp((Height.mean($tanks[_inc]) * 1.25),0,274))>>
		<<set _heightLimitAge = Height.forAge($tanks[_inc].height, $tanks[_inc])>>
		<<if $tanks[_inc].geneticQuirks.dwarfism == 2 && $tanks[_inc].geneticQuirks.gigantism != 2>>
			<<set _heightLimit = Math.min(_heightLimit, 160)>>
		<</if>>
		<<if $tanks[_inc].geneMods.NCS == 1>>
			/*
			** NCS should block physical growth beyond that of a toddler, but some players might like
			** a little more or less. So using $minimumSlaveAge or 8, whichever is lesser.
			*/
			<<set _limitAge = Math.min(8, $minimumSlaveAge)>>
			<<set _heightLimitAge = Height.forAge($tanks[_inc].height, _limitAge, $tanks[_inc].genes)>>
			<<set _heightLimit = _heightLimitAge>>
		<<elseif ($tanks[_inc].geneticQuirks.neoteny === 2 && $tanks[_inc].actualAge > 12)>>
			<<set _heightLimitAge = Height.forAge($tanks[_inc].height, 12, $tanks[_inc].genes)>>
			<<set _heightLimit = _heightLimitAge>>
		<</if>>
		<<if $tanks[_inc].height >= _heightLimit>>
			The monitoring system detects $his body is not able to support further increases in height, so it carefully regulates stimulant injections to @@.yellow;maintain $his current stature.@@
			<<set $tanks[_inc].height = _heightLimit>>
		<<elseif $incubatorGrowthStimsSetting == 2>>
			<<if $tanks[_inc].geneMods.NCS == 1>>
				The monitoring system floods $his body with growth stimulants, but $his @@.orange;NCS prevents an increase in $his growth rate.@@
				<<set $tanks[_inc].height = _heightLimitAge>>
			<<else>>
				The monitoring system floods $his body with growth stimulants, causing @@.green;a sharp increase in growth rate.@@
				<<if $incubatorWeightSetting >= 1 && $incubatorMusclesSetting <= 1 && $incubatorReproductionSetting <= 1>>
					<<if $incubatorUpgradeSpeed == 52>>
						<<set $tanks[_inc].height += random(3,6)>>
					<<elseif $incubatorUpgradeSpeed == 18>>
						<<set $tanks[_inc].height += random(2,5)>>
					<<elseif $incubatorUpgradeSpeed == 9>>
						<<set $tanks[_inc].height += random(1,4)>>
					<<elseif $incubatorUpgradeSpeed == 6>>
						<<set $tanks[_inc].height += random(1,3)>>
					<<elseif $incubatorUpgradeSpeed == 5>>
						<<set $tanks[_inc].height += random(1,2)>>
					<</if>>
				<<else>>
					<<if $incubatorUpgradeSpeed == 52>>
						<<set $tanks[_inc].height += random(2,5)>>
					<<elseif $incubatorUpgradeSpeed == 18>>
						<<set $tanks[_inc].height += random(1,4)>>
					<<elseif $incubatorUpgradeSpeed == 9>>
						<<set $tanks[_inc].height += random(1,3)>>
					<<elseif $incubatorUpgradeSpeed == 6>>
						<<set $tanks[_inc].height += random(1,2)>>
					<<elseif $incubatorUpgradeSpeed == 5>>
						<<set $tanks[_inc].height += random(0,1)>>
					<</if>>
				<</if>>
			<</if>>
		<<elseif $incubatorGrowthStimsSetting == 1>>
			<<if $tanks[_inc].geneMods.NCS == 1>>
				The monitoring system detects $he is near the expected height for $his @@.orange;NCS@@ condition, so it carefully regulates stimulant injections to @@.yellow;maintain $his current stature.@@
				<<set $tanks[_inc].height = _heightLimitAge>>
			<<elseif $tanks[_inc].height > _heightLimitAge>>
				The monitoring systems detect $he is near the expected height, so it carefully regulates stimulant injections to @@.yellow;maintain $his current stature.@@
				<<if random(1,10) == 10>>
					<<if $incubatorUpgradeSpeed == 52>>
						<<set $tanks[_inc].height += random(1,4)>>
					<<elseif $incubatorUpgradeSpeed == 18>>
						<<set $tanks[_inc].height += random(1,3)>>
					<<elseif $incubatorUpgradeSpeed == 9>>
						<<set $tanks[_inc].height += random(1,2)>>
					<<elseif $incubatorUpgradeSpeed == 6>>
						<<set $tanks[_inc].height += random(0,1)>>
					<<elseif $incubatorUpgradeSpeed == 5>>
						<<set $tanks[_inc].height += random(0,1)>>
					<</if>>
				<</if>>
			<<else>>
				The monitoring systems detect $his body is capable of developing more rapidly and @@.green;increase $his growth stimulant dosage.@@
				<<if $incubatorUpgradeSpeed == 52>>
					<<set $tanks[_inc].height += random(1,4)>>
				<<elseif $incubatorUpgradeSpeed == 18>>
					<<set $tanks[_inc].height += random(1,3)>>
				<<elseif $incubatorUpgradeSpeed == 9>>
					<<set $tanks[_inc].height += random(1,2)>>
				<<elseif $incubatorUpgradeSpeed == 6>>
					<<set $tanks[_inc].height += random(0,1)>>
				<<elseif $incubatorUpgradeSpeed == 5>>
					<<set $tanks[_inc].height += random(0,1)>>
				<</if>>
			<</if>>
		<</if>>
		<<set $tanks[_inc].height = Math.clamp($tanks[_inc].height, 0, _heightLimit)>>
	<<else>>

		With the growth stimulant injections offline, $his body is left to develop naturally.
	<</if>>

	<<if $incubatorUpgradeReproduction == 1>>

		<<set _rearQuirk = $tanks[_inc].geneticQuirks.rearLipedema == 2 ? 2 : 1>>
		<<if $incubatorReproductionSetting == 2>>
			$His developing body is being flooded with hormones.
			<<if $incubatorWeightSetting == 1>>
				Combined with the abundant food provided to $him, $his body grows rapidly.
				<<if $tanks[_inc].ovaries == 1>>
					<<set $tanks[_inc].pubertyXX = 1>>
					<<if $tanks[_inc].hormoneBalance < 500>>
						<<set $tanks[_inc].hormoneBalance += 100>>
					<</if>>
					<<if $seeHyperPreg == 1>>
						<<set $tanks[_inc].readyOva = random(25,45)>>
					<<else>>
						<<set $tanks[_inc].readyOva = random(3,8)>>
					<</if>>
					<<if $tanks[_inc].geneMods.NCS == 1>>
						/* NCS blocks hormonal growth of all secondary sexual characteristics */
						$His @@.orange;NCS blocks all growth@@ despite the excess estrogen-laced growth hormones flooding $his body.
					<<elseif $incubatorUpgradeSpeed == 52>>
						<<if $tanks[_inc].boobs < 8000>>
							The excess estrogen-laced growth hormones @@.green;rapidly balloon $his breasts.@@
							<<set $tanks[_inc].boobs += 2000>>
						<</if>>
						<<if $tanks[_inc].hips < 2 && random(1,100) > 50>>
							The excess estrogen-laced growth hormones @@.green;cause $his hips to widen for childbirth.@@
							<<set $tanks[_inc].hips += 2>>
						<</if>>
						<<if $tanks[_inc].butt < 12*_rearQuirk && random(1,100) > 30/_rearQuirk>>
							The excess estrogen-laced growth hormones @@.green;cause $his rear to grow fatter.@@
							<<set $tanks[_inc].butt += 4>>
						<</if>>
					<<elseif $incubatorUpgradeSpeed == 18>>
						<<if $tanks[_inc].boobs < 8000>>
							The excess estrogen-laced growth hormones @@.green;rapidly balloon $his breasts.@@
							<<set $tanks[_inc].boobs += 500>>
						<</if>>
						<<if $tanks[_inc].hips < 2 && random(1,100) > 50>>
							The excess estrogen-laced growth hormones @@.green;cause $his hips to widen for childbirth.@@
							<<set $tanks[_inc].hips++>>
						<</if>>
						<<if $tanks[_inc].butt < 12*_rearQuirk && random(1,100) > 50/_rearQuirk>>
							The excess estrogen-laced growth hormones @@.green;cause $his rear to grow fatter.@@
							<<set $tanks[_inc].butt += 3>>
						<</if>>
					<<elseif $incubatorUpgradeSpeed == 9>>
						<<if $tanks[_inc].boobs < 8000>>
							The excess estrogen-laced growth hormones @@.green;rapidly balloon $his breasts.@@
							<<set $tanks[_inc].boobs += 200>>
						<</if>>
						<<if $tanks[_inc].hips < 2 && random(1,100) > 60>>
							The excess estrogen-laced growth hormones @@.green;causes $his hips to widen for childbirth.@@
							<<set $tanks[_inc].hips++>>
						<</if>>
						<<if $tanks[_inc].butt < 12*_rearQuirk && random(1,100) > 50/_rearQuirk>>
							The excess estrogen-laced growth hormones @@.green;cause $his rear grow fatter.@@
							<<set $tanks[_inc].butt += 2>>
						<</if>>
					<<elseif $incubatorUpgradeSpeed == 6>>
						<<if $tanks[_inc].boobs < 8000>>
							The excess estrogen-laced growth hormones @@.green;rapidly balloon $his breasts.@@
							<<set $tanks[_inc].boobs += 100>>
						<</if>>
						<<if $tanks[_inc].hips < 2 && random(1,100) > 70>>
							The excess estrogen-laced growth hormones @@.green;cause $his hips to widen for childbirth.@@
							<<set $tanks[_inc].hips++>>
						<</if>>
						<<if $tanks[_inc].butt < 12*_rearQuirk && random(1,100) > 60/_rearQuirk>>
							The excess estrogen-laced growth hormones @@.green;cause $his rear to grow fatter.@@
							<<set $tanks[_inc].butt++>>
						<</if>>
					<<elseif $incubatorUpgradeSpeed == 5>>
						<<if $tanks[_inc].boobs < 8000>>
							The excess estrogen-laced growth hormones @@.green;rapidly balloon $his breasts.@@
							<<set $tanks[_inc].boobs += 100>>
						<</if>>
						<<if $tanks[_inc].hips < 2 && random(1,100) > 80>>
							The excess estrogen-laced growth hormones @@.green;cause $his hips to widen for childbirth.@@
							<<set $tanks[_inc].hips++>>
						<</if>>
						<<if $tanks[_inc].butt < 12*_rearQuirk && random(1,100) > 70/_rearQuirk>>
							The excess estrogen-laced growth hormones @@.green;cause $his rear to grow fatter.@@
							<<set $tanks[_inc].butt++>>
						<</if>>
					<</if>>
				<<elseif $tanks[_inc].balls > 0>>
					<<set $tanks[_inc].pubertyXY = 1>>
					<<if $tanks[_inc].hormoneBalance > -500>>
						<<set $tanks[_inc].hormoneBalance -= 100>>
					<</if>>
					<<if $tanks[_inc].geneMods.NCS == 1>>
						/* NCS blocks hormonal growth of all secondary sexual characteristics */
						$His @@.orange;NCS blocks all growth@@ despite the excess testosterone-laced growth hormones flooding $his body.
					<<elseif $incubatorUpgradeSpeed == 52>>
						<<if $tanks[_inc].balls < 40>>
							The excess testosterone-laced growth hormones @@.green;cause $his balls to balloon for extra cum production.@@
							<<set $tanks[_inc].balls += 16>>
						<</if>>
						<<if $tanks[_inc].dick < 10 && random(1,100) > 20>>
							The excess testosterone-laced growth hormones @@.green;cause $his penis to swell.@@
							<<set $tanks[_inc].dick += 4>>
						<</if>>
					<<elseif $incubatorUpgradeSpeed == 18>>
						<<if $tanks[_inc].balls < 40 && random(1,100) > 10>>
							The excess testosterone-laced growth hormones @@.green;cause $his balls to balloon for extra cum production.@@
							<<set $tanks[_inc].balls += 9>>
						<</if>>
						<<if $tanks[_inc].dick < 10 && random(1,100) > 30>>
							The excess testosterone-laced growth hormones @@.green;cause $his penis to swell.@@
							<<set $tanks[_inc].dick += 3>>
						<</if>>
					<<elseif $incubatorUpgradeSpeed == 9>>
						<<if $tanks[_inc].balls < 40 && random(1,100) > 20>>
							The excess testosterone-laced growth hormones @@.green;cause $his balls to balloon for extra cum production.@@
							<<set $tanks[_inc].balls += 4>>
						<</if>>
						<<if $tanks[_inc].dick < 10 && random(1,100) > 50>>
							The excess testosterone-laced growth hormones @@.green;cause $his penis to swell.@@
							<<set $tanks[_inc].dick += 2>>
						<</if>>
					<<elseif $incubatorUpgradeSpeed == 6>>
						<<if $tanks[_inc].balls < 40 && random(1,100) > 30>>
							The excess testosterone-laced growth hormones @@.green;cause $his balls to balloon for extra cum production.@@
							<<set $tanks[_inc].balls += 2>>
						<</if>>
						<<if $tanks[_inc].dick < 10 && random(1,100) > 70>>
							The excess testosterone-laced growth hormones @@.green;cause $his penis to swell.@@
							<<set $tanks[_inc].dick++>>
						<</if>>
					<<elseif $incubatorUpgradeSpeed == 5>>
						<<if $tanks[_inc].balls < 40 && random(1,100) > 30>>
							The excess testosterone-laced growth hormones @@.green;cause $his balls to balloon for extra cum production.@@
							<<set $tanks[_inc].balls++>>
						<</if>>
						<<if $tanks[_inc].dick < 10 && random(1,100) > 80>>
							The excess testosterone-laced growth hormones @@.green;cause $his penis to swell.@@
							<<set $tanks[_inc].dick++>>
						<</if>>
					<</if>>
				<</if>>
			<<elseif $incubatorWeightSetting == 2>>
				Combined with the healthy food provided to $him, $his body grows readily.
				<<if $tanks[_inc].ovaries == 1>>
					<<set $tanks[_inc].pubertyXX = 1>>
					<<if $tanks[_inc].hormoneBalance < 500>>
						<<set $tanks[_inc].hormoneBalance += 100>>
					<</if>>
					<<if $seeHyperPreg == 1>>
						<<set $tanks[_inc].readyOva = random(15,25)>>
					<<else>>
						<<set $tanks[_inc].readyOva = random(2,6)>>
					<</if>>
					<<if $tanks[_inc].geneMods.NCS == 1>>
						/* NCS blocks hormonal growth of all secondary sexual characteristics */
						$His @@.orange;NCS blocks all growth@@ despite the excess estrogen-laced growth hormones flooding $his body.
					<<elseif $incubatorUpgradeSpeed == 52>>
						<<if $tanks[_inc].boobs < 4000>>
							The excess estrogen-laced growth hormones @@.green;rapidly balloon $his breasts.@@
							<<set $tanks[_inc].boobs += 1000>>
						<</if>>
						<<if $tanks[_inc].hips < 2 && random(1,100) > 70>>
							The excess estrogen-laced growth hormones @@.green;cause $his hips to widen for childbirth.@@
							<<set $tanks[_inc].hips++>>
						<</if>>
						<<if $tanks[_inc].butt < 8*_rearQuirk && random(1,100) > 50/_rearQuirk>>
							The excess estrogen-laced growth hormones @@.green;cause $his rear to grow fatter.@@
							<<set $tanks[_inc].butt += 3>>
						<</if>>
					<<elseif $incubatorUpgradeSpeed == 18>>
						<<if $tanks[_inc].boobs < 4000>>
							The excess estrogen-laced growth hormones @@.green;rapidly balloon $his breasts.@@
							<<set $tanks[_inc].boobs += 500>>
						<</if>>
						<<if $tanks[_inc].hips < 2 && random(1,100) > 80>>
							The excess estrogen-laced growth hormones @@.green;cause $his hips to widen for childbirth.@@
							<<set $tanks[_inc].hips++>>
						<</if>>
						<<if $tanks[_inc].butt < 8*_rearQuirk && random(1,100) > 50/_rearQuirk>>
							The excess estrogen-laced growth hormones @@.green;cause $his rear to grow fatter.@@
							<<set $tanks[_inc].butt++>>
						<</if>>
					<<elseif $incubatorUpgradeSpeed == 9>>
						<<if $tanks[_inc].boobs < 4000>>
							The excess estrogen-laced growth hormones @@.green;rapidly balloon $his breasts.@@
							<<set $tanks[_inc].boobs += 200>>
						<</if>>
						<<if $tanks[_inc].hips < 2 && random(1,100) > 90>>
							The excess estrogen-laced growth hormones @@.green;cause $his hips to widen for childbirth.@@
							<<set $tanks[_inc].hips++>>
						<</if>>
						<<if $tanks[_inc].butt < 8*_rearQuirk && random(1,100) > 60/_rearQuirk>>
							The excess estrogen-laced growth hormones @@.green;cause $his rear to grow fatter.@@
							<<set $tanks[_inc].butt++>>
						<</if>>
					<<elseif $incubatorUpgradeSpeed == 6>>
						<<if $tanks[_inc].boobs < 4000>>
							The excess estrogen-laced growth hormones @@.green;rapidly balloon $his breasts.@@
							<<set $tanks[_inc].boobs += 100>>
						<</if>>
						<<if $tanks[_inc].hips < 2 && random(1,100) > 95>>
							The excess estrogen-laced growth hormones @@.green;cause $his hips to widen for childbirth.@@
							<<set $tanks[_inc].hips++>>
						<</if>>
						<<if $tanks[_inc].butt < 8*_rearQuirk && random(1,100) > 70/_rearQuirk>>
							The excess estrogen-laced growth hormones @@.green;cause $his rear to grow fatter.@@
							<<set $tanks[_inc].butt++>>
						<</if>>
					<<elseif $incubatorUpgradeSpeed == 5>>
						<<if $tanks[_inc].boobs < 4000>>
							The excess estrogen-laced growth hormones @@.green;rapidly balloon $his breasts.@@
							<<set $tanks[_inc].boobs += 100>>
						<</if>>
						<<if $tanks[_inc].hips < 2 && random(1,100) > 95>>
							The excess estrogen-laced growth hormones @@.green;cause $his hips to widen for childbirth.@@
							<<set $tanks[_inc].hips++>>
						<</if>>
						<<if $tanks[_inc].butt < 8*_rearQuirk && random(1,100) > 80/_rearQuirk>>
							The excess estrogen-laced growth hormones @@.green;cause $his rear to grow fatter.@@
							<<set $tanks[_inc].butt++>>
						<</if>>
					<</if>>
				<<elseif $tanks[_inc].balls > 0>>
					<<set $tanks[_inc].pubertyXY = 1>>
					<<if $tanks[_inc].hormoneBalance > -500>>
						<<set $tanks[_inc].hormoneBalance -= 100>>
					<</if>>
					<<if $tanks[_inc].geneMods.NCS == 1>>
						/* NCS blocks hormonal growth of all secondary sexual characteristics */
						$His @@.orange;NCS blocks all growth@@ despite the excess testosterone-laced growth hormones flooding $his body.
					<<elseif $incubatorUpgradeSpeed == 52>>
						<<if $tanks[_inc].balls < 10>>
							The excess testosterone-laced growth hormones @@.green;cause $his balls to balloon for extra cum production.@@
							<<set $tanks[_inc].balls += 3>>
						<</if>>
						<<if $tanks[_inc].dick < 7 && random(1,100) > 20>>
							The excess testosterone-laced growth hormones @@.green;cause $his penis to swell.@@
							<<set $tanks[_inc].dick += 2>>
						<</if>>
					<<elseif $incubatorUpgradeSpeed == 18>>
						<<if $tanks[_inc].balls < 10 && random(1,100) > 10>>
							The excess testosterone-laced growth hormones @@.green;cause $his balls to balloon for extra cum production.@@
							<<set $tanks[_inc].balls += 2>>
						<</if>>
						<<if $tanks[_inc].dick < 7 && random(1,100) > 30>>
							The excess testosterone-laced growth hormones @@.green;cause $his penis to swell.@@
							<<set $tanks[_inc].dick++>>
						<</if>>
					<<elseif $incubatorUpgradeSpeed == 9>>
						<<if $tanks[_inc].balls < 10 && random(1,100) > 20>>
							The excess testosterone-laced growth hormones @@.green;cause $his balls to balloon for extra cum production.@@
							<<set $tanks[_inc].balls++>>
						<</if>>
						<<if $tanks[_inc].dick < 7 && random(1,100) > 50>>
							The excess testosterone-laced growth hormones @@.green;cause $his penis to swell.@@
							<<set $tanks[_inc].dick++>>
						<</if>>
					<<elseif $incubatorUpgradeSpeed == 6>>
						<<if $tanks[_inc].balls < 10 && random(1,100) > 30>>
							The excess testosterone-laced growth hormones @@.green;cause $his balls to balloon for extra cum production.@@
							<<set $tanks[_inc].balls++>>
						<</if>>
						<<if $tanks[_inc].dick < 7 && random(1,100) > 70>>
							The excess testosterone-laced growth hormones @@.green;cause $his penis to swell.@@
							<<set $tanks[_inc].dick++>>
						<</if>>
					<<elseif $incubatorUpgradeSpeed == 5>>
						<<if $tanks[_inc].balls < 10 && random(1,100) > 30>>
							The excess testosterone-laced growth hormones @@.green;cause $his balls to balloon for extra cum production.@@
							<<set $tanks[_inc].balls++>>
						<</if>>
						<<if $tanks[_inc].dick < 7 && random(1,100) > 80>>
							The excess testosterone-laced growth hormones @@.green;cause $his penis to swell.@@
							<<set $tanks[_inc].dick++>>
						<</if>>
					<</if>>
				<</if>>
			<<else>>
				Since $his body has little to work with, $his growth is fairly minor.
				<<if $tanks[_inc].ovaries == 1>>
					<<set $tanks[_inc].pubertyXX = 1>>
					<<if $tanks[_inc].hormoneBalance < 500>>
						<<set $tanks[_inc].hormoneBalance += 100>>
					<</if>>
					<<if $seeHyperPreg == 1>>
						<<set $tanks[_inc].readyOva = random(10,15)>>
					<<else>>
						<<set $tanks[_inc].readyOva = random(2,4)>>
					<</if>>
					<<if $tanks[_inc].geneMods.NCS == 1>>
						/* NCS blocks hormonal growth of all secondary sexual characteristics */
						$His @@.orange;NCS blocks all growth@@ despite the excess estrogen-laced growth hormones flooding $his body.
					<<elseif $incubatorUpgradeSpeed == 52>>
						<<if $tanks[_inc].boobs < 2000>>
							The excess estrogen-laced growth hormones @@.green;rapidly balloon $his breasts.@@
							<<set $tanks[_inc].boobs += 700>>
						<</if>>
						<<if $tanks[_inc].hips < 2 && random(1,100) > 90>>
							The excess estrogen-laced growth hormones @@.green;cause $his hips to widen for childbirth.@@
							<<set $tanks[_inc].hips += 2>>
						<</if>>
						<<if $tanks[_inc].butt < 6*_rearQuirk && random(1,100) > 70/_rearQuirk>>
							The excess estrogen-laced growth hormones @@.green;cause $his rear to grow fatter.@@
							<<set $tanks[_inc].butt += 2>>
						<</if>>
					<<elseif $incubatorUpgradeSpeed == 18>>
						<<if $tanks[_inc].boobs < 2000>>
							The excess estrogen-laced growth hormones @@.green;rapidly balloon $his breasts.@@
							<<set $tanks[_inc].boobs += 200>>
						<</if>>
						<<if $tanks[_inc].hips < 2 && random(1,100) > 80>>
							The excess estrogen-laced growth hormones @@.green;cause $his hips to widen for childbirth.@@
							<<set $tanks[_inc].hips++>>
						<</if>>
						<<if $tanks[_inc].butt < 6*_rearQuirk && random(1,100) > 70/_rearQuirk>>
							The excess estrogen-laced growth hormones @@.green;cause $his rear to grow fatter.@@
							<<set $tanks[_inc].butt++>>
						<</if>>
					<<elseif $incubatorUpgradeSpeed == 9>>
						<<if $tanks[_inc].boobs < 2000>>
							The excess estrogen-laced growth hormones @@.green;rapidly balloon $his breasts.@@
							<<set $tanks[_inc].boobs += 50>>
						<</if>>
						<<if $tanks[_inc].hips < 2 && random(1,100) > 80>>
							The excess estrogen-laced growth hormones @@.green;cause $his hips to widen for childbirth.@@
							<<set $tanks[_inc].hips++>>
						<</if>>
						<<if $tanks[_inc].butt < 6*_rearQuirk && random(1,100) > 90/_rearQuirk>>
							The excess estrogen-laced growth hormones @@.green;cause $his rear to grow fatter.@@
							<<set $tanks[_inc].butt++>>
						<</if>>
					<<elseif $incubatorUpgradeSpeed == 6>>
						<<if $tanks[_inc].boobs < 2000>>
							The excess estrogen-laced growth hormones @@.green;rapidly grow $his breasts.@@
							<<set $tanks[_inc].boobs += 20>>
						<</if>>
						<<if $tanks[_inc].hips < 2 && random(1,100) > 90>>
							The excess estrogen-laced growth hormones @@.green;cause $his hips to widen for childbirth.@@
							<<set $tanks[_inc].hips++>>
						<</if>>
						<<if $tanks[_inc].butt < 6*_rearQuirk && random(1,100) > 90/_rearQuirk>>
							The excess estrogen-laced growth hormones @@.green;cause $his rear to grow fatter.@@
							<<set $tanks[_inc].butt++>>
						<</if>>
					<<elseif $incubatorUpgradeSpeed == 5>>
						<<if $tanks[_inc].boobs < 2000>>
							The excess estrogen-laced growth hormones @@.green;rapidly grow $his breasts.@@
							<<set $tanks[_inc].boobs += 10>>
						<</if>>
						<<if $tanks[_inc].hips < 2 && random(1,100) > 95>>
							The excess estrogen-laced growth hormones @@.green;cause $his hips to widen for childbirth.@@
							<<set $tanks[_inc].hips++>>
						<</if>>
						<<if $tanks[_inc].butt < 6*_rearQuirk && random(1,100) > 90/_rearQuirk>>
							The excess estrogen-laced growth hormones @@.green;cause $his rear to grow fatter.@@
							<<set $tanks[_inc].butt++>>
						<</if>>
					<</if>>
				<<elseif $tanks[_inc].balls > 0>>
					<<set $tanks[_inc].pubertyXY = 1>>
					<<if $tanks[_inc].hormoneBalance > -500>>
						<<set $tanks[_inc].hormoneBalance -= 100>>
					<</if>>
					<<if $tanks[_inc].geneMods.NCS == 1>>
						/* NCS blocks hormonal growth of all secondary sexual characteristics */
						$His @@.orange;NCS blocks all growth@@ despite the excess testosterone-laced growth hormones flooding $his body.
					<<elseif $incubatorUpgradeSpeed == 52>>
						<<if $tanks[_inc].balls < 6>>
							The excess testosterone-laced growth hormones @@.green;cause $his balls to grow for extra cum production.@@
							<<set $tanks[_inc].balls += 2>>
						<</if>>
						<<if $tanks[_inc].dick < 4 && random(1,100) > 60>>
							The excess testosterone-laced growth hormones @@.green;cause $his penis to swell.@@
							<<set $tanks[_inc].dick++>>
						<</if>>
					<<elseif $incubatorUpgradeSpeed == 18>>
						<<if $tanks[_inc].balls < 6 && random(1,100) > 50>>
							The excess testosterone-laced growth hormones @@.green;cause $his balls to grow for extra cum production.@@
							<<set $tanks[_inc].balls++>>
						<</if>>
						<<if $tanks[_inc].dick < 4 && random(1,100) > 60>>
							The excess testosterone-laced growth hormones @@.green;cause $his penis to swell.@@
							<<set $tanks[_inc].dick++>>
						<</if>>
					<<elseif $incubatorUpgradeSpeed == 9>>
						<<if $tanks[_inc].balls < 6 && random(1,100) > 60>>
							The excess testosterone-laced growth hormones @@.green;cause $his balls to balloon for extra cum production.@@
							<<set $tanks[_inc].balls++>>
						<</if>>
						<<if $tanks[_inc].dick < 4 && random(1,100) > 70>>
							The excess testosterone-laced growth hormones @@.green;cause $his penis to swell.@@
							<<set $tanks[_inc].dick += 2>>
						<</if>>
					<<elseif $incubatorUpgradeSpeed == 6>>
						<<if $tanks[_inc].balls < 6 && random(1,100) > 70>>
							The excess testosterone-laced growth hormones @@.green;cause $his balls to grow for extra cum production.@@
							<<set $tanks[_inc].balls++>>
						<</if>>
						<<if $tanks[_inc].dick < 4 && random(1,100) > 80>>
							The excess testosterone-laced growth hormones @@.green;cause $his penis to swell.@@
							<<set $tanks[_inc].dick++>>
						<</if>>
					<<elseif $incubatorUpgradeSpeed == 5>>
						<<if $tanks[_inc].balls < 6 && random(1,100) > 80>>
							The excess testosterone-laced growth hormones @@.green;cause $his balls to grow for extra cum production.@@
							<<set $tanks[_inc].balls++>>
						<</if>>
						<<if $tanks[_inc].dick < 4 && random(1,100) > 90>>
							The excess testosterone-laced growth hormones @@.green;cause $his penis to swell.@@
							<<set $tanks[_inc].dick++>>
						<</if>>
					<</if>>
				<</if>>
			<</if>>
		<<elseif $incubatorReproductionSetting == 1>>
			$His hormone levels are being carefully managed, @@.green;encouraging early puberty.@@
			<<if $tanks[_inc].ovaries == 1>>
				<<set $tanks[_inc].pubertyXX = 1>>
				<<set $tanks[_inc].hormoneBalance = 250>>
				<<if $tanks[_inc].geneMods.NCS == 1>>
					/* NCS blocks hormonal growth of all secondary sexual characteristics */
					$His @@.orange;NCS blocks growth@@ despite the added estrogen.
				<<else>>
					<<if $tanks[_inc].boobs < 400 && random(1,100) > 60>>
						The added estrogen @@.green;causes $his breasts to swell.@@
						<<set $tanks[_inc].boobs += 50>>
					<</if>>
					<<if $tanks[_inc].hips < 2 && random(1,100) > 90>>
						The added estrogen @@.green;causes $his hips to widen.@@
						<<set $tanks[_inc].hips++>>
					<</if>>
					<<if $tanks[_inc].butt < 5*_rearQuirk && random(1,100) > 80/_rearQuirk>>
						The added estrogen @@.green;causes $his butt to grow.@@
						<<set $tanks[_inc].butt++>>
					<</if>>
				<</if>>
			<<elseif $tanks[_inc].balls > 0>>
				<<set $tanks[_inc].pubertyXY = 1>>
				<<set $tanks[_inc].hormoneBalance = -250>>
				<<if $tanks[_inc].geneMods.NCS == 1>>
					/* NCS blocks hormonal growth of all secondary sexual characteristics */
					$His @@.orange;NCS blocks all growth@@ despite the added testosterone.
				<<else>>
					<<if $tanks[_inc].balls < 3 && random(1,100) > 80>>
						The added testosterone @@.green;causes $his balls to swell.@@
						<<set $tanks[_inc].balls++>>
					<</if>>
					<<if $tanks[_inc].dick < 3 && random(1,100) > 60>>
						The added testosterone @@.green;causes $his penis to grow.@@
						<<set $tanks[_inc].dick++>>
					<</if>>
				<</if>>
			<</if>>
		<<else>>
			<<if $tanks[_inc].hormoneBalance > 100>>
				<<set $tanks[_inc].hormoneBalance -= 50>>
			<<elseif $tanks[_inc].hormoneBalance < -100>>
				<<set $tanks[_inc].hormoneBalance += 50>>
			<</if>>
			<<if $tanks[_inc].balls > 0>>
				<<if $tanks[_inc].balls > 1>>
					<<set $tanks[_inc].balls -= 5>>
				<</if>>
				<<if $tanks[_inc].dick > 1>>
					<<set $tanks[_inc].dick -= 5>>
				<</if>>
				<<if $tanks[_inc].balls <= 0>>
					<<set $tanks[_inc].balls = 1>>
				<</if>>
				<<if $tanks[_inc].dick <= 0>>
					<<set $tanks[_inc].dick = 1>>
				<</if>>
			<</if>>
			<<if $tanks[_inc].boobs > 0>>
				<<set $tanks[_inc].boobs -= 500>>
			<</if>>
			<<if $tanks[_inc].butt > 0>>
				<<set $tanks[_inc].butt -= 4>>
			<</if>>
		<</if>>
	<<else>>
		<<if $tanks[_inc].hormoneBalance > 100>>
			<<set $tanks[_inc].hormoneBalance -= 50>>
		<<elseif $tanks[_inc].hormoneBalance < -100>>
			<<set $tanks[_inc].hormoneBalance += 50>>
		<</if>>
		<<if $tanks[_inc].balls > 0>>
			<<if $tanks[_inc].balls > 1>>
				<<set $tanks[_inc].balls -= 5>>
			<</if>>
			<<if $tanks[_inc].dick > 1>>
				<<set $tanks[_inc].dick -= 5>>
			<</if>>
			<<if $tanks[_inc].balls <= 0>>
				<<set $tanks[_inc].balls = 1>>
			<</if>>
			<<if $tanks[_inc].dick <= 0>>
				<<set $tanks[_inc].dick = 1>>
			<</if>>
		<</if>>
		<<if $tanks[_inc].boobs > 0>>
			<<set $tanks[_inc].boobs -= 500>>
		<</if>>
		<<if $tanks[_inc].butt > 0>>
			<<set $tanks[_inc].butt -= 4>>
		<</if>>
	<</if>>

	<<if $incubatorReproductionSetting == 2>>
		<<set $tanks[_inc].energy = 80, $tanks[_inc].need = 100>>
	<<elseif $incubatorReproductionSetting == 1>>
		<<set $tanks[_inc].energy = 50, $tanks[_inc].need = 20>>
	<<else>>
		<<set $tanks[_inc].energy = 0, $tanks[_inc].need = 0>>
	<</if>>

	<<if ($incubatorPregAdaptationSetting == 1 && $tanks[_inc].genes == "XX") || ($incubatorPregAdaptationSetting == 2 && $tanks[_inc].genes == "XY") || $incubatorPregAdaptationSetting == 3>>

		The incubator is working on adapting $his abdomen and reproductive organs for future pregnancies.

		<<set _weekAdapt = $tanks[_inc].incubatorPregAdaptationInWeek * $incubatorUpgradeSpeed>>
		<<if isNaN(_weekAdapt)>> /* NaN check AFTER multiply operation, against it result is critical here. Need to be absolutely sure about this operation, not about just tank[x] property itself. This give me two very unpleasant hours to catch this */
			<<set $tanks[_inc].incubatorPregAdaptationInWeek = (15000 / 2000 - $tanks[_inc].pregAdaptation) / $tanks[_inc].growTime>>
		<</if>>
		<<set _weekAdapt = $tanks[_inc].incubatorPregAdaptationInWeek * $incubatorUpgradeSpeed>> /* Now it's should be fine */
		<<set _weekAdapt *= 1 + ($incubatorReproductionSetting / 5)>>
		<<set _weekAdapt *= 1 + ($tanks[_inc].hormoneBalance / 1500)>>
		/*And now we done*/
		<<set $tanks[_inc].pregAdaptation += _weekAdapt>>
		/* here goes side effect from intense and extreme settings: */
		<<if (random(0, 100) <= ($tanks[_inc].incubatorPregAdaptationPower - 1) * ($incubatorUpgradeSpeed / 2 + 1))>>
			<<switch random(1, 9)>> /*side effect selection*/
			<<case 1>>
				<<set $tanks[_inc].preg = -2>>
				It caused @@.red;reproductive damage@@ when excessive meddling damaged an organ.
			<<case 2>>
				<<if $tanks[_inc].ovaries == 1 || $tanks[_inc].mpreg == 1>>
					<<set $tanks[_inc].preg = -3>>
				<</if>>
				<<if $tanks[_inc].balls > 0>>
					<<set $tanks[_inc].ballType = "sterile">>
				<</if>>
				It caused @@.red;severe reproductive damage@@ when excessive hormones shut down the associated organs.
			<<case 3>>
				<<set $tanks[_inc].lactation = 1>>
				It has @@.orange;triggered a hormonal disorder,@@ causing $his breast glands begin producing milk.
			<<case 4>>
				<<set $tanks[_inc].bellySag = 100, $tanks[_inc].bellySagPreg = 100>>
				It activated @@.red;emergency protocols@@ when overpressure to $his abdominal tissues and skin reached critical levels. $His belly has lost muscle tone and has begun to strongly sag.
			<<case 5>>
				<<set $tanks[_inc].health.condition -= 15>>
				Overzealous prodding caused some @@.red;internal bleeding.@@
			<<case 6>>
				<<set $tanks[_inc].weight += 50>>
				An unexpected shift in hormones spurred @@.red;massive weight gain@@ before it could be corrected.
			<<case 7>>
				<<set $tanks[_inc].weight -= 50>>
				An unexpected shift in hormones spurred @@.red;massive weight loss@@ before it could be corrected.
			<<case 8>>
				<<set $tanks[_inc].boobs += 5000>>
				<<set $tanks[_inc].boobShape = "saggy">>
				An unexpected shift in hormones encouraged @@.green;explosive breast growth@@ before it could be corrected.
			<<case 9>>
				<<set $tanks[_inc].hips = 3>>
				A malfunction in the skeletal reconstruction software caused it to @@.green;overwiden $his hips.@@
			<</switch>>
		<</if>>
	<</if>>

	<<if $tanks[_inc].preg > 0>>
		@@.red;The incubator is displaying an alert that $he may be pregnant.@@
	<</if>>

	<<set $tanks[_inc].weight = Math.clamp($tanks[_inc].weight, -100, 200)>>
	<<set $tanks[_inc].muscles = Math.clamp($tanks[_inc].muscles, -100, 100)>>
	<<set $tanks[_inc].dick = Math.clamp($tanks[_inc].dick, 0, 10)>>
	<<set $tanks[_inc].hips = Math.clamp($tanks[_inc].hips, -2, 2)>>
	<<set $tanks[_inc].balls = Math.clamp($tanks[_inc].balls, 0, 40)>>
	<<set $tanks[_inc].boobs = Math.clamp($tanks[_inc].boobs, 25, 30000)>>
	<<set $tanks[_inc].height = Math.clamp($tanks[_inc].height, 0, 274)>>
	<<set $tanks[_inc].hormoneBalance = Math.clamp($tanks[_inc].hormoneBalance, -500, 500)>>
	<<set $tanks[_inc].foreskin = $tanks[_inc].dick>> /*simple, clean way of making sure foreskins and scrotums grow appropriately*/
	<<set $tanks[_inc].scrotum = $tanks[_inc].balls>> /*if we want dicks/balls to outgrow foreskins/scrotums, this will have to be removed*/

<</for>>
/*
<<if $tanks.length == 0>>
<<= capFirstChar($incubatorName)>> is currently unused.
<</if>>
*/