:: MOD_Edit Slave Cheat Datatype Cleanup [nobr]

<<set $nextButton = "Continue", $nextLink = "AS Dump", $returnTo = "Slave Interact">>
/* Cancel Option Check */
<<if $tempSlave == "unset">>
	<<unset $tempSlave>>
	<<goto "Slave Interact">>
<</if>>

<<set $rep = Number($rep) || 0>>
<<set $cash = Number($cash) || 0>>
<<set $week = Number($week) || 1>>
<<set $tempSlave.preg = Number($tempSlave.preg) || 0>>
<<set $tempSlave.pregType = Number($tempSlave.pregType) || 0>>
<<if $tempSlave.broodmother == 0>>
	<<set WombInit($tempSlave)>> /* just to make sure */
	<<set $tempSlave.womb.length = 0>> /* simple way to delete all fetuses */
	<<set WombImpregnate($tempSlave, $tempSlave.pregType, $tempSlave.pregSource, $tempSlave.preg)>> /* recreates fetuses */
<<else>>
	<<set WombNormalizePreg($tempSlave)>>
<</if>>
<<if $tempSlave.preg > 0>>
	<<set $tempSlave.pregKnown = 1, $tempSlave.pregWeek = $tempSlave.preg>>
<<else>>
	<<set $tempSlave.pregKnown = 0, $tempSlave.pregWeek = 0>>
<</if>>
<<if $tempSlave.lactation > 0 && $tempSlave.lactationDuration == 0>>
	<<set $tempSlave.lactationDuration = 2>>
<<elseif $tempSlave.lactation == 0 && $tempSlave.lactationDuration > 0>>
	<<set $tempSlave.lactationDuration = 0>>
<</if>>
<<set $tempSlave.pregAdaptation = Number($tempSlave.pregAdaptation) || 0>>
<<if $tempSlave.pregAdaptation <= 0>>
	<<if $tempSlave.genes === "XY">> /* copied from GenerateXYPregAdaptation */
		<<if slave.physicalAge <= 6>>
			<<set $tempSlave.pregAdaptation = 5>>
		<<elseif $tempSlave.physicalAge <= 11>>
			<<set $tempSlave.pregAdaptation = $tempSlave.physicalAge - 1>>
		<<elseif $tempSlave.physicalAge <= 15>>
			<<set $tempSlave.pregAdaptation = 2 * ($tempSlave.physicalAge - 12) + 12>>
		<<else>>
			<<set $tempSlave.pregAdaptation = 20>>
		<</if>>
	<<else>> /* copied from GenerateXXPregAdaptation */
		<<if $tempSlave.physicalAge <= 6>>
			<<set $tempSlave.pregAdaptation = 5>>
		<<elseif $tempSlave.physicalAge <= 11>>
			<<set $tempSlave.pregAdaptation = $tempSlave.physicalAge - 1>>
		<<elseif $tempSlave.physicalAge <= 14>>
			<<set $tempSlave.pregAdaptation = 4 * ($tempSlave.physicalAge - 12) + 14>>
		<<elseif $tempSlave.physicalAge <= 15>>
			<<set $tempSlave.pregAdaptation = 28>>
		<<elseif $tempSlave.physicalAge <= 16>>
			<<set $tempSlave.pregAdaptation = 34>>
		<<elseif $tempSlave.physicalAge <= 17>>
			<<set $tempSlave.pregAdaptation = 42>>
		<<else>>
			<<set $tempSlave.pregAdaptation = 50>>
		<</if>>
	<</if>>
<</if>>
<<run SlaveDatatypeCleanup($tempSlave)>> /* will break cheated pregnancies if run before the above block of code */

You perform the dark rituals, pray to the dark gods, and sell your soul for the power to change and mold slaves to your will.

<br><br>This slave has been changed forever and you have lost a bit of your soul, YOU CHEATER!

<<set $activeSlave = clone($tempSlave)>>
<<unset $tempSlave>>
<<set _escdc = $slaveIndices[$activeSlave.ID]>>
<<if def _escdc>>
	<<set $slaves[_escdc] = $activeSlave>>
<</if>>

src/cheats/mod_EditSlaveCheatDatatypeCleanup.tw