:: Cloning Workaround [nobr]

<<set $nextButton = "Cancel", $nextLink = "Gene Lab", _eligibility = 0>>
<<if $donatrix != "Undecided" && $donatrix.ID == -1>><<set _impreg = PlayerName()>><<elseif $donatrix != "Undecided">><<set _impreg = SlaveFullName($donatrix)>><<else>><<set _impreg = $donatrix>><</if>>
<<if $receptrix != "Undecided" && $receptrix.ID == -1>><<set _receive = PlayerName()>><<elseif $receptrix != "Undecided">><<set _receive = SlaveFullName($receptrix)>><<else>><<set _receive = $receptrix>><</if>>

<h2>Genetic Source</h2>
<div class="note">Blank ovum prepared, please select genetic source and surrogate.</div>
<div>Chosen source: _impreg</div>

<div class="majorText">
[[Yourself|Cloning Workaround][$donatrix = $PC]]
<<for _cw = 0; _cw < $slaves.length; _cw++>>
	<<capture _cw>>
		<<set _name = SlaveFullName($slaves[_cw])>>
		<<if $donatrix != "Undecided" && $donatrix.ID == $slaves[_cw].ID>>
		<div>//_name//</div>
		<<else>>
		<div>[[_name|Cloning Workaround][$donatrix = $slaves[_cw]]]</div>
		<</if>>
	<</capture>>
<</for>>
</div>
<h2>Surrogate</h2>
<div>Chosen surrogate: _receive</div>
<div class="majorText">
<<for _cw1 = 0; _cw1 < $slaves.length; _cw1++>>
	<<capture _cw1>>
		<<if ($slaves[_cw1].ovaries > 0 || $slaves[_cw1].mpreg > 0) && isSlaveAvailable($slaves[_cw1]) && $slaves[_cw1].preg >= 0 && $slaves[_cw1].preg < 4 && $slaves[_cw1].pregWeek >= 0 && $slaves[_cw1].pubertyXX == 1 && $slaves[_cw1].pregType < 12 && $slaves[_cw1].bellyImplant == -1 && $slaves[_cw1].broodmother == 0 && $slaves[_cw1].inflation <= 2 && $slaves[_cw1].physicalAge < 70>>
			<<set _name2 = SlaveFullName($slaves[_cw1])>>
			<div>
			<<if $receptrix != "Undecided" && $receptrix.ID == $slaves[_cw1].ID>>
				//_name2//
			<<else>>
				[[_name2|Cloning Workaround][$receptrix = $slaves[_cw1]]] <<if $slaves[_cw1].pregType >= 4>>//Using a slave carrying multiples is inadvisable//<</if>>
			<</if>>
			</div>
			<<set _eligibility = 1>>
		<</if>>
	<</capture>>
<</for>>
<<if (_eligibility == 0)>>
	<div class="note">You have no slaves capable of acting as a surrogate.</div>
<</if>>

<<if $PC.vagina != -1 && $PC.preg >= 0 && $PC.preg < 4 && $PC.pregType < 8 && $PC.physicalAge < 70>>
	<div>
	<<if $receptrix != "Undecided" && $receptrix.ID == $PC.ID>>
		//Yourself//
	<<else>>
		[[Use your own womb|Cloning Workaround][$receptrix = $PC]]
	<</if>>
	</div>
<</if>>
</div>
<h2>Implantation</h2>
<div class="majorText">
<<if _impreg != "Undecided" && _receive != "Undecided">>
_impreg will be cloned and _receive shall act as the incubator.
	[[Implant clone ovum|Surrogacy][cashX(forceNeg($surgeryCost*2), "slaveSurgery"), $surgeryType = "clone"]]
<<elseif _impreg != "Undecided">>
_impreg will be cloned. //Please select a surrogate//
<<elseif _receive != "Undecided">>
_receive shall act as the incubator. //Please select a genetic source//
<<else>>
//Please select a genetic source and surrogate//
<</if>>
</div>

src/pregmod/cloningWorkaround.tw