From 3dd1d49b38e38878237793bfcbc617eadb6809bb Mon Sep 17 00:00:00 2001
From: Pregmodder <pregmodder@gmail.com>
Date: Fri, 17 Feb 2017 17:13:10 -0500
Subject: [PATCH] Implementation of slave genetics and some bug fixes.

---
 src/config/start.tw                                 |  1 +
 src/gui/Encyclopedia/encyclopedia.tw                |  1 +
 src/npc/rgASDump.tw                                 |  2 ++
 src/pregmod/generateChild.tw                        | 12 ++++++++++++
 src/pregmod/pRaped.tw                               |  2 ++
 src/pregmod/sePlayerBirth.tw                        |  1 -
 src/uncategorized/genericPlotEvents.tw              | 13 +++++++++++++
 src/uncategorized/householdLiquidator.tw            |  6 +++---
 src/uncategorized/motherDaughterWorkaround.tw       |  1 +
 src/uncategorized/newSlaveIntro.tw                  |  2 ++
 src/uncategorized/pCoupAttempt.tw                   |  7 +++++++
 src/uncategorized/pInvasion.tw                      |  2 +-
 src/uncategorized/pRaidResult.tw                    |  3 +++
 src/uncategorized/pSlaveMedic.tw                    |  1 +
 .../reFSEgyptianRevivalistAcquisition.tw            |  2 +-
 .../reFSEgyptianRevivalistAcquisitionWorkaround.tw  |  1 +
 src/uncategorized/reShippingContainer.tw            |  1 +
 src/uncategorized/recETS.tw                         | 13 ++++++++-----
 src/uncategorized/recETSWorkaround.tw               |  1 +
 src/uncategorized/resFailure.tw                     |  7 +++++++
 src/uncategorized/saRecruitGirls.tw                 | 10 +++++-----
 src/uncategorized/saRules.tw                        |  6 +++---
 src/uncategorized/seCoursing.tw                     |  3 +++
 src/uncategorized/siblingsWorkaround.tw             |  1 +
 src/uncategorized/slaveSummary.tw                   |  3 +--
 src/uncategorized/twinsWorkaround.tw                |  1 +
 26 files changed, 82 insertions(+), 21 deletions(-)
 create mode 100644 src/pregmod/generateChild.tw

diff --git a/src/config/start.tw b/src/config/start.tw
index 6c9c518d4b8..7168173c205 100644
--- a/src/config/start.tw
+++ b/src/config/start.tw
@@ -80,6 +80,7 @@ src\pregmod\fSelf.tw
 src\pregmod\fSlaveFeed.tw
 src\pregmod\fillUpButt.tw
 src\pregmod\fillUpFace.tw
+src\pregmod\generateChild.tw
 src\pregmod\huskSlave.tw
 src\pregmod\incubator.tw
 src\pregmod\incubatorReport.tw
diff --git a/src/gui/Encyclopedia/encyclopedia.tw b/src/gui/Encyclopedia/encyclopedia.tw
index cf5868585ef..7896615d8d2 100644
--- a/src/gui/Encyclopedia/encyclopedia.tw
+++ b/src/gui/Encyclopedia/encyclopedia.tw
@@ -926,6 +926,7 @@ __I do not give credit without explicit permission to do so.__ If you have contr
 ''anon'' for grorious nihon starting rocation.
 ''anon'' for player getting fucked work.
 ''anon'' for additional bodyguard weapons.
+''anon'' for HGExclusion and animal pregnancy work.
 ''Bane70'' optimized huge swaths of code with notable professionalism.
 ''Circle Tritagonist'' provided several new collars and outfits.
 ''Qotsafan'' submitted bugfixes.
diff --git a/src/npc/rgASDump.tw b/src/npc/rgASDump.tw
index 9dc2062fa0a..9d8513936be 100644
--- a/src/npc/rgASDump.tw
+++ b/src/npc/rgASDump.tw
@@ -13,6 +13,8 @@
 
 <<display "Checkin Checks">>
 
+<<set $genePool.push($activeSlave)>>
+
 /* RECRUITERS */
 
 <<if $familyTesting == 1>>
diff --git a/src/pregmod/generateChild.tw b/src/pregmod/generateChild.tw
new file mode 100644
index 00000000000..b597769d47c
--- /dev/null
+++ b/src/pregmod/generateChild.tw
@@ -0,0 +1,12 @@
+:: generateChild
+
+<<if $babyGender == 1>>
+	<<if $PC.pregSource < 1>>
+	<<else>>
+	<</if>>
+<<elseif $babyGender == 2>>
+	<<if $PC.pregSource < 1>>
+	<<else>>
+	<</if>>
+<<else>>
+<</if>>
\ No newline at end of file
diff --git a/src/pregmod/pRaped.tw b/src/pregmod/pRaped.tw
index 3eacc1c26bf..74046543858 100644
--- a/src/pregmod/pRaped.tw
+++ b/src/pregmod/pRaped.tw
@@ -188,6 +188,7 @@ Now the only question is what to do with the would be rapist. You could toss the
 			<<AutoRulesActivate 1>>
 		<</if>>
 		<<set $slaves.push($activeSlave)>>
+		<<set $genePool.push($activeSlave)>>
 		<<set $cash -= $contractCost>>
 		<<replace "#result">>
 			You complete the legalities and biometric scanning quickly and cautiously. The idiot will wake up <<if $dairyStimulatorsSetting > 1>>in agony as her anus takes the rectal hydration dildo<<else>>to find her chest has begun swelling with milk<</if>>.
@@ -219,6 +220,7 @@ Now the only question is what to do with the would be rapist. You could toss the
 		<<if ($universalRulesNewSlavesRA == 1) && ($autoRulesAssistant != 0)>>	
 			<<AutoRulesActivate 1>>
 		<</if>>
+		<<set $genePool.push($activeSlave)>>
 		<<set $slaves.push($activeSlave)>>
 		<<set $cash -= $contractCost>>
 		<<replace "#result">>
diff --git a/src/pregmod/sePlayerBirth.tw b/src/pregmod/sePlayerBirth.tw
index 438bbff7c87..40df45481a5 100644
--- a/src/pregmod/sePlayerBirth.tw
+++ b/src/pregmod/sePlayerBirth.tw
@@ -137,7 +137,6 @@ Now you are faced with a decision of what to do with your new child. You're far
 <<click "Boarding School">><<replace "#choice">><<print "You have decided to send them away to be raised in your stead.">><</replace>><</click>> | <<click "Slave Orphanage">><<replace "#choice">><<print "You have decided to send them to a slave orphanage to be raised to $minimumSlaveAge and sold. Perhaps you'll even see them again, though you are unlikely to recognize them if you do.">><</replace>><</click>><<if $Cash4Babies == 1>> | <<click "Auction Them">><<replace "#choice">><<print "You send the child to be sold at auction amongst other prestigious slaves. The winning big for your offspring came in at @@color:yellowgreen;¤<<print 1000*$seed>>.@@">><</replace>><<set $cash += 1000*$seed>><</click>><</if>></span>
 <</if>>
 
-<<set $babyGender = 0>>
 <<set $badBirth = 0>>
 <<set $PC.pregSource = 0>>
 <<set $seed = 0>>
diff --git a/src/uncategorized/genericPlotEvents.tw b/src/uncategorized/genericPlotEvents.tw
index 74ff09ce9b7..30e83f08f8e 100644
--- a/src/uncategorized/genericPlotEvents.tw
+++ b/src/uncategorized/genericPlotEvents.tw
@@ -229,6 +229,7 @@ When the aircraft lands at your penthouse pad, the would-be escapees are still u
 	<<if ($universalRulesNewSlavesRA == 1) && ($autoRulesAssistant != 0)>>
 		<<AutoRulesActivate 1>>
 	<</if>>
+	<<set $genePool.push($activeSlave)>>
 	<<set $slaves.push($activeSlave)>>
 	<<for $i to 0; $i < 3; $i++>>
 		<<set $activeSlaveOneTimeMinAge to 18>>
@@ -256,6 +257,7 @@ When the aircraft lands at your penthouse pad, the would-be escapees are still u
 		<<if ($universalRulesNewSlavesRA == 1) && ($autoRulesAssistant != 0)>>
 			<<AutoRulesActivate 1>>
 		<</if>>
+		<<set $genePool.push($activeSlave)>>
 		<<set $slaves.push($activeSlave)>>
 	<</for>>
 <<elseif $PAidTarget is "school">>
@@ -289,6 +291,7 @@ When the aircraft lands at your penthouse pad, the would-be escapees are still u
 	<<if ($universalRulesNewSlavesRA == 1) && ($autoRulesAssistant != 0)>>
 		<<AutoRulesActivate 1>>
 	<</if>>
+	<<set $genePool.push($activeSlave)>>
 	<<set $slaves.push($activeSlave)>>
 	<<for $i to 0; $i < 3; $i++>>
 		<<set $activeSlaveOneTimeMaxAge to 18>>
@@ -315,6 +318,7 @@ When the aircraft lands at your penthouse pad, the would-be escapees are still u
 		<<if ($universalRulesNewSlavesRA == 1) && ($autoRulesAssistant != 0)>>
 					<<AutoRulesActivate 1>>
 		<</if>>
+		<<set $genePool.push($activeSlave)>>
 		<<set $slaves.push($activeSlave)>>
 	<</for>>
 <<elseif $PAidTarget is "maternity">>
@@ -341,6 +345,7 @@ When the aircraft lands at your penthouse pad, the would-be escapees are still u
 		<<if ($universalRulesNewSlavesRA == 1) && ($autoRulesAssistant != 0)>>
 			<<AutoRulesActivate 1>>
 		<</if>>
+		<<set $genePool.push($activeSlave)>>
 		<<set $slaves.push($activeSlave)>>
 	<</for>>
 <<elseif $PAidTarget is "gradeSchool">>
@@ -369,6 +374,7 @@ When the aircraft lands at your penthouse pad, the would-be escapees are still u
 		<<if ($universalRulesNewSlavesRA == 1) && ($autoRulesAssistant != 0)>>	
 			<<AutoRulesActivate 1>>
 		<</if>>
+		<<set $genePool.push($activeSlave)>>
 		<<set $slaves.push($activeSlave)>>
 	<</for>>
 <<elseif $PAidTarget is "conversion">>
@@ -398,6 +404,7 @@ When the aircraft lands at your penthouse pad, the would-be escapees are still u
 	<<if ($universalRulesNewSlavesRA == 1) && ($autoRulesAssistant != 0)>>
 		<<AutoRulesActivate 1>>
 	<</if>>
+	<<set $genePool.push($activeSlave)>>
 	<<set $slaves.push($activeSlave)>>
 	<<for $i to 0; $i < 3; $i++>>
 		<<set $activeSlaveOneTimeMinAge to 16>>
@@ -423,6 +430,7 @@ When the aircraft lands at your penthouse pad, the would-be escapees are still u
 		<<if ($universalRulesNewSlavesRA == 1) && ($autoRulesAssistant != 0)>>
 			<<AutoRulesActivate 1>>
 		<</if>>
+		<<set $genePool.push($activeSlave)>>
 		<<set $slaves.push($activeSlave)>>
 	<</for>>
 <<else>>
@@ -454,6 +462,7 @@ When the aircraft lands at your penthouse pad, the would-be escapees are still u
 		<<if ($universalRulesNewSlavesRA == 1) && ($autoRulesAssistant != 0)>>
 			<<AutoRulesActivate 1>>
 		<</if>>
+		<<set $genePool.push($activeSlave)>>
 		<<set $slaves.push($activeSlave)>>
 	<</for>>
 <</if>>
@@ -750,6 +759,7 @@ A screen opposite your desk springs to life, <<if $assistant == 0>>showing your
 	<<if ($universalRulesNewSlavesRA == 1) && ($autoRulesAssistant != 0)>>
 		<<AutoRulesActivate 1>>
 	<</if>>
+	<<set $genePool.push($activeSlave)>>
 	<<set $slaves.push($activeSlave)>>
 	<</replace>>
 <</click>>
@@ -795,6 +805,7 @@ A screen opposite your desk springs to life, <<if $assistant == 0>>showing your
 	<<if ($universalRulesNewSlavesRA == 1) && ($autoRulesAssistant != 0)>>
 		<<AutoRulesActivate 1>>
 	<</if>>
+	<<set $genePool.push($activeSlave)>>
 	<<set $slaves.push($activeSlave)>>
 	<</replace>>
 <</click>>
@@ -832,6 +843,7 @@ A screen opposite your desk springs to life, <<if $assistant == 0>>showing your
 	<<if ($universalRulesNewSlavesRA == 1) && ($autoRulesAssistant != 0)>>
 		<<AutoRulesActivate 1>>
 	<</if>>
+	<<set $genePool.push($activeSlave)>>
 	<<set $slaves.push($activeSlave)>>
 	<</replace>>
 <</click>>
@@ -875,6 +887,7 @@ A screen opposite your desk springs to life, <<if $assistant == 0>>showing your
 	<<if ($universalRulesNewSlavesRA == 1) && ($autoRulesAssistant != 0)>>
 		<<AutoRulesActivate 1>>
 	<</if>>
+	<<set $genePool.push($activeSlave)>>
 	<<set $slaves.push($activeSlave)>>
 	<</replace>>
 <</click>>
diff --git a/src/uncategorized/householdLiquidator.tw b/src/uncategorized/householdLiquidator.tw
index aa050924ca8..3e98ccc4d45 100644
--- a/src/uncategorized/householdLiquidator.tw
+++ b/src/uncategorized/householdLiquidator.tw
@@ -41,7 +41,7 @@ The price is ¤<<print $slaveCost*3>>.
 
 <<nobr>>
 <<if $cash >= $slaveCost*3>>
-	[[Buy their slave contract|Siblings Workaround][$cash -= $slaveCost*3,$olderSister to $activeSlave, $slaves.push($olderSister),$nextButton to "Continue",$nextLink to "AS Dump",$returnTo to "Main"]]
+	[[Buy their slave contract|Siblings Workaround][$cash -= $slaveCost*3,$olderSister to $activeSlave, $slaves.push($olderSister), $genePool.push($olderSister),$nextButton to "Continue",$nextLink to "AS Dump",$returnTo to "Main"]]
 <<else>>
 	//You lack the necessary funds to buy these slaves.//
 <</if>>
@@ -95,7 +95,7 @@ The price is ¤<<print $slaveCost*3>>.<<if $slavesSeen > $slaveMarketLimit>> You
 
 <<nobr>>
 <<if $cash >= $slaveCost*3>>
-	[[Buy their slave contract|Mother Daughter Workaround][$cash -= $slaveCost*3,$mother to $activeSlave, $slaves.push($mother),$nextButton to "Continue",$nextLink to "AS Dump",$returnTo to "Main"]]
+	[[Buy their slave contract|Mother Daughter Workaround][$cash -= $slaveCost*3,$mother to $activeSlave, $slaves.push($mother), $genePool.push($mother),$nextButton to "Continue",$nextLink to "AS Dump",$returnTo to "Main"]]
 <<else>>
 	//You lack the necessary funds to buy these slaves.//
 <</if>>
@@ -142,7 +142,7 @@ The price is ¤<<print $slaveCost*4>>.<<if $slavesSeen > $slaveMarketLimit>> You
 
 <<nobr>>
 <<if $cash >= $slaveCost*4>>
-	[[Buy their slave contract|Twins Workaround][$cash -= $slaveCost*4,$alphaTwin to $activeSlave, $slaves.push($alphaTwin),$nextButton to "Continue",$nextLink to "AS Dump",$returnTo to "Main"]]
+	[[Buy their slave contract|Twins Workaround][$cash -= $slaveCost*4,$alphaTwin to $activeSlave, $slaves.push($alphaTwin), $genePool.push($alphaTwin),$nextButton to "Continue",$nextLink to "AS Dump",$returnTo to "Main"]]
 <<else>>
 	//You lack the necessary funds to buy these slaves.//
 <</if>>
diff --git a/src/uncategorized/motherDaughterWorkaround.tw b/src/uncategorized/motherDaughterWorkaround.tw
index 76a28a49ba2..4bae2c1c939 100644
--- a/src/uncategorized/motherDaughterWorkaround.tw
+++ b/src/uncategorized/motherDaughterWorkaround.tw
@@ -71,4 +71,5 @@ Your new pair of slaves look frightened and uncertain, but seem encouraged by ea
 	<<set _secondSlave.butt += random(-1, 1)>>
 <</if>>
 
+<<set $genePool.push(_secondSlave)>>
 <<set $slaves.push(_secondSlave)>>
diff --git a/src/uncategorized/newSlaveIntro.tw b/src/uncategorized/newSlaveIntro.tw
index d0674a8f39c..801f137b3bc 100644
--- a/src/uncategorized/newSlaveIntro.tw
+++ b/src/uncategorized/newSlaveIntro.tw
@@ -25,6 +25,8 @@
 	<<set $activeSlave.vaginalSkill = 0>>
 <</if>>
 
+<<set $genePool.push($activeSlave)>>
+
 <<if $activeSlave.nipplesPiercing > 0>>
 	<<if $activeSlave.nipples is "partially inverted">>
 <<set $activeSlave.nipples to "cute">>
diff --git a/src/uncategorized/pCoupAttempt.tw b/src/uncategorized/pCoupAttempt.tw
index 76c6f52853d..39b7fe76b60 100644
--- a/src/uncategorized/pCoupAttempt.tw
+++ b/src/uncategorized/pCoupAttempt.tw
@@ -43,6 +43,7 @@ You are awakened in the middle of the night by a jolt that shakes the entire arc
 		<<if ($universalRulesNewSlavesRA == 1) && ($autoRulesAssistant != 0)>>	
 			<<AutoRulesActivate 1>>
 		<</if>>
+		<<set $genePool.push($activeSlave)>>
 		<<set $slaves.push($activeSlave)>>
 	<</for>>
 	<<if $seeDicks > 50>>
@@ -58,6 +59,7 @@ You are awakened in the middle of the night by a jolt that shakes the entire arc
 		<<if ($universalRulesNewSlavesRA == 1) && ($autoRulesAssistant != 0)>>	
 			<<AutoRulesActivate 1>>
 		<</if>>
+		<<set $genePool.push($activeSlave)>>
 		<<set $slaves.push($activeSlave)>>
 	<</for>>
 	<<set $desc = "a Daughters of Liberty brassard">>
@@ -78,6 +80,7 @@ You are awakened in the middle of the night by a jolt that shakes the entire arc
 		<<if ($universalRulesNewSlavesRA == 1) && ($autoRulesAssistant != 0)>>	
 			<<AutoRulesActivate 1>>
 		<</if>>
+		<<set $genePool.push($activeSlave)>>
 		<<set $slaves.push($activeSlave)>>
 	<</if>>
 	<<for $i to 0; $i < 8; $i++>>
@@ -90,6 +93,7 @@ You are awakened in the middle of the night by a jolt that shakes the entire arc
 		<<if ($universalRulesNewSlavesRA == 1) && ($autoRulesAssistant != 0)>>	
 			<<AutoRulesActivate 1>>
 		<</if>>
+		<<set $genePool.push($activeSlave)>>
 		<<set $slaves.push($activeSlave)>>
 	<</for>>
 	<<set $desc = "a damaged plate carrier bearing Daughters of Liberty insignia">>
@@ -110,6 +114,7 @@ You are awakened in the middle of the night by a jolt that shakes the entire arc
 		<<if ($universalRulesNewSlavesRA == 1) && ($autoRulesAssistant != 0)>>		
 			<<AutoRulesActivate 1>>
 		<</if>>
+		<<set $genePool.push($activeSlave)>>
 		<<set $slaves.push($activeSlave)>>
 	<</if>>
 	<<if $seeDicks > 50>>
@@ -125,6 +130,7 @@ You are awakened in the middle of the night by a jolt that shakes the entire arc
 		<<if ($universalRulesNewSlavesRA == 1) && ($autoRulesAssistant != 0)>>	
 			<<AutoRulesActivate 1>>
 		<</if>>
+		<<set $genePool.push($activeSlave)>>
 		<<set $slaves.push($activeSlave)>>
 	<</for>>
 	<<if $seeDicks > 50>>
@@ -140,6 +146,7 @@ You are awakened in the middle of the night by a jolt that shakes the entire arc
 		<<if ($universalRulesNewSlavesRA == 1) && ($autoRulesAssistant != 0)>>	
 			<<AutoRulesActivate 1>>
 		<</if>>
+		<<set $genePool.push($activeSlave)>>
 		<<set $slaves.push($activeSlave)>>
 	<</for>>
 	<<set $desc = "a Daughters of Liberty flag that once hung in their forward command post within your arcology">>
diff --git a/src/uncategorized/pInvasion.tw b/src/uncategorized/pInvasion.tw
index c22d1c653e1..722120938c4 100644
--- a/src/uncategorized/pInvasion.tw
+++ b/src/uncategorized/pInvasion.tw
@@ -89,6 +89,7 @@ The loose militia lately organized by the arcology owners has been called out to
 	<<if ($universalRulesNewSlavesRA == 1) && ($autoRulesAssistant != 0)>>	
 		<<AutoRulesActivate 1>>
 	<</if>>
+	<<set $genePool.push($activeSlave)>>
 	<<set $slaves.push($activeSlave)>>
 <</for>>
 
@@ -105,7 +106,6 @@ The loose militia lately organized by the arcology owners has been called out to
 		<<slaveCost $slaves[$i]>>
 		<<set $cash += $slaveCost>>
 		<<set $dump to $slaves.pluck([$i], [$i])>><<set $i-->>
-		<<set $i-->>
 		<</if>>
 	<</for>>
 	Prisoners sold.
diff --git a/src/uncategorized/pRaidResult.tw b/src/uncategorized/pRaidResult.tw
index 1e1ee9ee018..6453ba14506 100644
--- a/src/uncategorized/pRaidResult.tw
+++ b/src/uncategorized/pRaidResult.tw
@@ -28,6 +28,7 @@ Out ahead of the main body of refugees there is a small knot moving quickly and
 		<<else>>
 		<<display "Generate XX Slave">>
 		<<set $activeSlave.origin to "She is an enslaved refugee who participated in the defeated attack on your arcology.">>
+		<<set $genePool.push($activeSlave)>>
 		<<set $slaves.push($activeSlave)>>
 		<</if>>
 	<</for>>
@@ -40,6 +41,7 @@ Out ahead of the main body of refugees there is a small knot moving quickly and
 			<<AutoRulesActivate 1>>
 		<</if>>
 		<<set $activeSlave.origin to "She is an enslaved refugee.">>
+		<<set $genePool.push($activeSlave)>>
 		<<set $slaves.push($activeSlave)>>
 	<</for>>
 <<else>>
@@ -53,6 +55,7 @@ Out ahead of the main body of refugees there is a small knot moving quickly and
 		<</if>>
 		<<set $activeSlave.origin to "She is an enslaved refugee who was wounded in the defeated attack on your arcology.">>
 		<<set $activeSlave.health = random(-80,-40)>>
+		<<set $genePool.push($activeSlave)>>
 		<<set $slaves.push($activeSlave)>>
 	<</for>>
 <</if>>
diff --git a/src/uncategorized/pSlaveMedic.tw b/src/uncategorized/pSlaveMedic.tw
index 6b1dd5f1358..077f2dcc3b5 100644
--- a/src/uncategorized/pSlaveMedic.tw
+++ b/src/uncategorized/pSlaveMedic.tw
@@ -115,6 +115,7 @@ When you enter the lounge of their barracks, you see $activeSlave.slaveName bend
 	<<if ($universalRulesNewSlavesRA == 1) && ($autoRulesAssistant != 0)>>	
 		<<AutoRulesActivate 1>>
 	<</if>>
+	<<set $genePool.push($activeSlave)>>
 	<<set $slaves.push($activeSlave)>>
 	<<set $cash -= 25000>>
 		"Huh," says the mercenary. "She's popular, but for that we could probably buy two of her. Might be fun to train a couple of new nurses. Let me ask the boys and girls." He speaks into his helmet for a few minutes, and then turns back to you. "Sold. Enjoy, she's a good fuck."
diff --git a/src/uncategorized/reFSEgyptianRevivalistAcquisition.tw b/src/uncategorized/reFSEgyptianRevivalistAcquisition.tw
index 50bdca5a237..e89393769a9 100644
--- a/src/uncategorized/reFSEgyptianRevivalistAcquisition.tw
+++ b/src/uncategorized/reFSEgyptianRevivalistAcquisition.tw
@@ -46,7 +46,7 @@ This call is coming from a public kiosk, which is usually an indication that the
 
 <span id="result">
 <<if $cash >= $contractCost>>\
-[[Enslave the pair|RE FSEgyptianRevivalist acquisition workaround][$sibling to $activeSlave, $slaves.push($sibling), $cash -= ($contractCost)]]
+[[Enslave the pair|RE FSEgyptianRevivalist acquisition workaround][$sibling to $activeSlave, $slaves.push($sibling), $genePool.push($sibling), $cash -= ($contractCost)]]
 <<else>>\
 	//You lack the necessary funds to enslave them.//
 <</if>>\
diff --git a/src/uncategorized/reFSEgyptianRevivalistAcquisitionWorkaround.tw b/src/uncategorized/reFSEgyptianRevivalistAcquisitionWorkaround.tw
index b647599810c..ff16a7f1596 100644
--- a/src/uncategorized/reFSEgyptianRevivalistAcquisitionWorkaround.tw
+++ b/src/uncategorized/reFSEgyptianRevivalistAcquisitionWorkaround.tw
@@ -97,4 +97,5 @@ They arrive hand-in-hand and don't let go of each other until the end of the ens
 
 <</if>>
 
+	<<set $genePool.push(_secondSlave)>>
 	<<set $slaves.push(_secondSlave)>>
diff --git a/src/uncategorized/reShippingContainer.tw b/src/uncategorized/reShippingContainer.tw
index 9661ef19dfa..b489a7ab749 100644
--- a/src/uncategorized/reShippingContainer.tw
+++ b/src/uncategorized/reShippingContainer.tw
@@ -15,6 +15,7 @@
 	<<if ($universalRulesNewSlavesRA == 1) && ($autoRulesAssistant != 0)>>	
 		<<AutoRulesActivate 1>>
 	<</if>>
+	<<set $genePool($activeSlave)>>
 	<<set $slaves.push($activeSlave)>>
 <</for>>
 <<set $helots += 25>>
diff --git a/src/uncategorized/recETS.tw b/src/uncategorized/recETS.tw
index d0352d241ff..c6769dc2dd3 100644
--- a/src/uncategorized/recETS.tw
+++ b/src/uncategorized/recETS.tw
@@ -485,6 +485,7 @@ The other blurts out. "But we kinda got too into each other, in more ways than o
 	<<set $activeSlave.relationTarget to 0>>
 	<<set $activeSlave.oralCount += 1>>
 	<<set $oralTotal += 1>>
+	<<set $genePool.push($activeSlave)>>
 	<<set $slaves.push($activeSlave)>>
 	<<set $cash -= $contractCost>>
 	<<replace "#result">>
@@ -498,6 +499,7 @@ The other blurts out. "But we kinda got too into each other, in more ways than o
 	<<set $activeSlave.daughters = 0>>
 	<<set $activeSlave.relation to 0>>
 	<<set $activeSlave.relationTarget to 0>>
+	<<set $genePool.push($activeSlave)>>
 	<<set $slaves.push($activeSlave)>>
 	<<set $cash -= $contractCost>>
 	<<replace "#result">>
@@ -512,6 +514,7 @@ The other blurts out. "But we kinda got too into each other, in more ways than o
 	<<set $activeSlave.father to 0>>	
 	<<set $activeSlave.relation to 0>>
 	<<set $activeSlave.relationTarget to 0>>
+	<<set $genePool.push($activeSlave)>>
 	<<set $slaves.push($activeSlave)>>
 	<<set $cash -= $contractCost>>
 	<<replace "#result">>
@@ -535,35 +538,35 @@ The other blurts out. "But we kinda got too into each other, in more ways than o
 <<case "addict mother daughter">>
 
 <<click "Manipulate her to enslave both mother and daughter">>
-	<<set $mother to $activeSlave, $mother.devotion -= 50, $slaves.push($mother), $cash -= ($contractCost*2)>>
+	<<set $mother to $activeSlave, $mother.devotion -= 50, $slaves.push($mother), $genePool.push($mother), $cash -= ($contractCost*2)>>
 	<<goto "RecETS workaround">>
 <</click>>
 
 <<case "posh mother daughter">>
 
 <<click "Manipulate her to enslave both mother and daughter">>
-	<<set $mother to $activeSlave, $mother.devotion -= 25, $slaves.push($mother), $cash -= ($contractCost*2)>>
+	<<set $mother to $activeSlave, $mother.devotion -= 25, $slaves.push($mother), $genePool.push($mother), $cash -= ($contractCost*2)>>
 	<<goto "RecETS workaround">>
 <</click>>
 
 <<case "mismatched pair">>
 
 <<click "Enslave both">>
-	<<set $sissy to $activeSlave, $slaves.push($sissy), $cash -= ($contractCost*2)>>
+	<<set $sissy to $activeSlave, $slaves.push($sissy), $genePool.push($sissy), $cash -= ($contractCost*2)>>
 	<<goto "RecETS workaround">>
 <</click>>
 
 <<case "incest mother son" "incest father daughter">>
 
 <<click "Buy both">>
-	<<set $sissy to $activeSlave, $slaves.push($sissy), $cash -= $contractCost>>
+	<<set $sissy to $activeSlave, $slaves.push($sissy), $genePool.push($sissy), $cash -= $contractCost>>
 	<<goto "RecETS workaround">>
 <</click>>
 
 <<case "matched pair" "identical pair" "identical herm pair">>
 
 <<click "Buy both">>
-	<<set $sissy to $activeSlave, $slaves.push($sissy), $cash -= ($contractCost*2)>>
+	<<set $sissy to $activeSlave, $slaves.push($sissy), $genePool.push($sissy), $cash -= ($contractCost*2)>>
 	<<goto "RecETS workaround">>
 <</click>>
 
diff --git a/src/uncategorized/recETSWorkaround.tw b/src/uncategorized/recETSWorkaround.tw
index 0d2d1292473..c88a51c917e 100644
--- a/src/uncategorized/recETSWorkaround.tw
+++ b/src/uncategorized/recETSWorkaround.tw
@@ -261,4 +261,5 @@ They giggle and kiss each other rather passionately, their miniskirts becoming p
 <<else>>
 	<<set $activeSlave.slaveName to $activeSlave.birthName>>
 <</if>>
+<<set $genePool.push($activeSlave)>>
 <<set $slaves.push($activeSlave)>>
\ No newline at end of file
diff --git a/src/uncategorized/resFailure.tw b/src/uncategorized/resFailure.tw
index 08aa7206e61..0cf6110558c 100644
--- a/src/uncategorized/resFailure.tw
+++ b/src/uncategorized/resFailure.tw
@@ -81,6 +81,7 @@
 		<<if ($universalRulesNewSlavesRA == 1) && ($autoRulesAssistant != 0)>>	
 			<<AutoRulesActivate 1>>
 		<</if>>
+		<<set $genePool.push($activeSlave)>>
 		<<set $slaves.push($activeSlave)>>
 	<</for>>
 <<elseif $RESFailure is "GRI">>
@@ -134,6 +135,7 @@
 		<<if ($universalRulesNewSlavesRA == 1) && ($autoRulesAssistant != 0)>>	
 			<<AutoRulesActivate 1>>
 		<</if>>
+		<<set $genePool.push($activeSlave)>>
 		<<set $slaves.push($activeSlave)>>
 	<</for>>
 <<elseif $RESFailure is "SCP">>
@@ -205,6 +207,7 @@
 		<<if ($universalRulesNewSlavesRA == 1) && ($autoRulesAssistant != 0)>>	
 			<<AutoRulesActivate 1>>
 		<</if>>
+		<<set $genePool.push($activeSlave)>>
 		<<set $slaves.push($activeSlave)>>
 	<</for>>
 <<elseif $RESFailure is "LDE">>
@@ -268,6 +271,7 @@
 		<<if ($universalRulesNewSlavesRA == 1) && ($autoRulesAssistant != 0)>>		
 			<<AutoRulesActivate 1>>
 		<</if>>
+		<<set $genePool.push($activeSlave)>>
 		<<set $slaves.push($activeSlave)>>
 	<</for>>
 <<elseif $RESFailure is "TGA">>
@@ -324,6 +328,7 @@
 		<<if ($universalRulesNewSlavesRA == 1) && ($autoRulesAssistant != 0)>>	
 			<<AutoRulesActivate 1>>
 		<</if>>
+		<<set $genePool.push($activeSlave)>>
 		<<set $slaves.push($activeSlave)>>
 	<</for>>
 <<else>>
@@ -488,6 +493,7 @@
 		<<if ($universalRulesNewSlavesRA == 1) && ($autoRulesAssistant != 0)>>	
 			<<AutoRulesActivate 1>>
 		<</if>>
+		<<set $genePool.push($activeSlave)>>
 		<<set $slaves.push($activeSlave)>>
 	<</for>>
 	<<display "Generate XY Slave">>
@@ -560,6 +566,7 @@
 	<<if ($universalRulesNewSlavesRA == 1) && ($autoRulesAssistant != 0)>>	
 		<<AutoRulesActivate 1>>
 	<</if>>
+	<<set $genePool.push($activeSlave)>>
 	<<set $slaves.push($activeSlave)>>
 <</if>>
 
diff --git a/src/uncategorized/saRecruitGirls.tw b/src/uncategorized/saRecruitGirls.tw
index b0d0e019cdc..6211bb29fb4 100644
--- a/src/uncategorized/saRecruitGirls.tw
+++ b/src/uncategorized/saRecruitGirls.tw
@@ -361,19 +361,19 @@ She uses her extra time and @@color:yellowgreen;recruitment allowance@@ this wee
 			<<set $relation = $relation.shuffle()>>
 			<<set _recruiterRelation = 0>>
 			<<for _j = 0; _j < $relation.length; _j++>>
-				<<if areSisters($slaves[$i], $relation[_j]) > 0 && isAvailable($relation[_j])>>
+				<<if areSisters($slaves[$i], $relation[_j]) > 0 && isSlaveAvailable($relation[_j])>>
 					<<set _recruiterRelation = $relation[_j]>>
 					<<break>>
-				<<elseif $relation[_j].mother == $slaves[$i].ID && isAvailable($relation[_j])>>
+				<<elseif $relation[_j].mother == $slaves[$i].ID && isSlaveAvailable($relation[_j])>>
 					<<set _recruiterRelation = $relation[_j]>>
 					<<break>>
-				<<elseif $relation[_j].father == $slaves[$i].ID && isAvailable($relation[_j])>>
+				<<elseif $relation[_j].father == $slaves[$i].ID && isSlaveAvailable($relation[_j])>>
 					<<set _recruiterRelation = $relation[_j]>>
 					<<break>>
-				<<elseif $relation[_j].ID == $slaves[$i].mother && isAvailable($relation[_j])>>
+				<<elseif $relation[_j].ID == $slaves[$i].mother && isSlaveAvailable($relation[_j])>>
 					<<set _recruiterRelation = $relation[_j]>>
 					<<break>>
-				<<elseif $relation[_j].ID == $slaves[$i].father && isAvailable($relation[_j])>>
+				<<elseif $relation[_j].ID == $slaves[$i].father && isSlaveAvailable($relation[_j])>>
 					<<set _recruiterRelation = $relation[_j]>>
 					<<break>>
 				<</if>>
diff --git a/src/uncategorized/saRules.tw b/src/uncategorized/saRules.tw
index 9a57c5d2038..ef5588cc861 100644
--- a/src/uncategorized/saRules.tw
+++ b/src/uncategorized/saRules.tw
@@ -29,7 +29,7 @@ She
 	<<elseif ($slaves[$i].devotion <= 20)>>
 		occasionally comes to you to beg for sexual release, @@color:hotpink;hating herself@@ for it.
 		<<set $slaves[$i].devotion += 1>>
-	<<elseif ($slaves[$i].devotion < 10)>>
+	<<elseif ($slaves[$i].devotion <= 50)>>
 		doesn't mind having to come to you to beg for sexual release, @@color:hotpink;drawing her closer@@ to her <<if $PC.title == 0>>Mistress<<else>>Master<</if>>.
 		<<set $slaves[$i].devotion += 1>>
 	<<else>>
@@ -177,7 +177,7 @@ She
 			is forced to demand sex from other slaves by the urges induced by the food, and @@color:hotpink;hates herself@@ for it.
 			<<set $slaves[$i].devotion += 1>>
 		<</if>>
-		<<elseif ($slaves[$i].devotion < 10)>>
+		<<elseif ($slaves[$i].devotion <= 50)>>
 		accepts the need to demand sex from your other slaves, @@color:hotpink;building her acceptance@@ of her life.
 		<<set $slaves[$i].devotion += 1>>
 		<<else>>
@@ -348,7 +348,7 @@ She
 			is forced to swap sex with other slaves by the urges induced by the food, and @@color:hotpink;hates herself@@ for it.
 			<<set $slaves[$i].devotion += 1>>
 		<</if>>
-		<<elseif ($slaves[$i].devotion < 10)>>
+		<<elseif ($slaves[$i].devotion <= 50)>>
 		doesn't mind having to ask other slaves for sex, @@color:mediumaquamarine;building her acceptance@@ of her life.
 		<<set $slaves[$i].trust += 1>>
 		<<else>>
diff --git a/src/uncategorized/seCoursing.tw b/src/uncategorized/seCoursing.tw
index 584d5bd5412..2434c246c8c 100644
--- a/src/uncategorized/seCoursing.tw
+++ b/src/uncategorized/seCoursing.tw
@@ -601,6 +601,7 @@ You place your hand on the leash's quick release and whisper your direction into
 	<<if ($universalRulesNewSlavesRA == 1) && ($autoRulesAssistant != 0)>>
 		<<AutoRulesActivate 1>>
 	<</if>>
+	<<set $genePool.push($activeSlave)>>
 	<<set $slaves.push($activeSlave)>>
 <<else>>
 	<<if $Lurcher.devotion > 50>>
@@ -935,6 +936,7 @@ You place your hand on the leash's quick release and whisper your direction into
 	<<if ($universalRulesNewSlavesRA == 1) && ($autoRulesAssistant != 0)>>
 		<<AutoRulesActivate 1>>
 	<</if>>
+	<<set $genePool.push($activeSlave)>>
 	<<set $slaves.push($activeSlave)>>
 <<else>>
 	<<if $Lurcher.devotion > 50>>
@@ -1269,6 +1271,7 @@ You place your hand on the leash's quick release and whisper your direction into
 	<<if ($universalRulesNewSlavesRA == 1) && ($autoRulesAssistant != 0)>>
 		<<AutoRulesActivate 1>>
 	<</if>>
+	<<set $genePool.push($activeSlave)>>
 	<<set $slaves.push($activeSlave)>>
 <<else>>
 	<<if $Lurcher.devotion > 50>>
diff --git a/src/uncategorized/siblingsWorkaround.tw b/src/uncategorized/siblingsWorkaround.tw
index 50a150ea06b..3a0b2ef30e1 100644
--- a/src/uncategorized/siblingsWorkaround.tw
+++ b/src/uncategorized/siblingsWorkaround.tw
@@ -67,4 +67,5 @@ Your new pair of slaves look frightened and uncertain, but seem encouraged by ea
 	<<set _secondSlave.butt += random (-1, 1)>>
 <</if>>
 
+	<<set $genePool.push(_secondSlave)>>
 	<<set $slaves.push(_secondSlave)>>
diff --git a/src/uncategorized/slaveSummary.tw b/src/uncategorized/slaveSummary.tw
index c492ca0ecec..32519ca5be0 100644
--- a/src/uncategorized/slaveSummary.tw
+++ b/src/uncategorized/slaveSummary.tw
@@ -2984,7 +2984,7 @@ _Slave.faceShape face.
 <<if $abbreviateClothes is 2>>
 <<if _Slave.choosesOwnClothes == 1>>
 	Dressing herself.
-<<else>>
+<</if>>
 <<switch _Slave.clothes>>
 <<case "attractive lingerie">>
 	Lingerie.
@@ -3073,7 +3073,6 @@ _Slave.faceShape face.
 <<default>>
 	Naked.
 <</switch>>
-<</if>>
 <<switch _Slave.collar>>
 <<case "uncomfortable leather">>
 	Leather collar.
diff --git a/src/uncategorized/twinsWorkaround.tw b/src/uncategorized/twinsWorkaround.tw
index 1869953e5be..18ef3fc75d7 100644
--- a/src/uncategorized/twinsWorkaround.tw
+++ b/src/uncategorized/twinsWorkaround.tw
@@ -30,4 +30,5 @@ Your new pair of slaves look frightened and uncertain, but seem encouraged by ea
 <<set _secondSlave.relationTarget to _secondSlave.ID - 1000>>
 <</if>>
 
+<<set $genePool.push(_secondSlave)>>
 <<set $slaves.push(_secondSlave)>>
-- 
GitLab