From cbac1eb669a5f8ca21d6026f47003f2732295706 Mon Sep 17 00:00:00 2001
From: DCoded <dcoded@live.com>
Date: Fri, 18 Jan 2019 00:06:53 -0500
Subject: [PATCH] Animal-slave pregnancy setup (I could have sworn I already
 enabled it once)

---
 src/facilities/farmyard/farmyardLab.tw |  8 +++++++-
 src/pregmod/fAnimalImpreg.tw           |  2 ++
 src/pregmod/organFarm.tw               |  2 --
 src/pregmod/pRaped.tw                  |  2 +-
 src/pregmod/widgets/economyWidgets.tw  |  1 +
 src/uncategorized/remoteSurgery.tw     |  2 ++
 src/uncategorized/slaveInteract.tw     | 17 +++++++++--------
 7 files changed, 22 insertions(+), 12 deletions(-)

diff --git a/src/facilities/farmyard/farmyardLab.tw b/src/facilities/farmyard/farmyardLab.tw
index 859d285175a..a9b62c76a80 100644
--- a/src/facilities/farmyard/farmyardLab.tw
+++ b/src/facilities/farmyard/farmyardLab.tw
@@ -8,7 +8,7 @@
 $farmyardNameCaps Research Lab
 <hr>
 
-<<if $animalOrgans > 0>>
+<<if $animalOvaries > 0>>
 	<<if $farmyardLabUpgrades.animalOvaries == 0>>
 		[[Retrofit the pharmaceutical fabricator to work with animal ovaries|FarmyardLab][$cash -= 25000, $farmyardLabUpgrades.animalOvaries = 1]]
 		<br>//Costs <<print cashFormat(25000)>> and allows you to implant animal ovaries into slaves.//
@@ -17,6 +17,9 @@ $farmyardNameCaps Research Lab
 		The pharmaceutical fabricator has been retrofitted to work with animal ovaries, allowing you to implant them into slaves.
 		<br>
 	<</if>>
+<</if>>
+
+<<if $animalTesticles > 0>>
 	<<if $farmyardLabUpgrades.animalTesticles == 0>>
 		[[Retrofit the pharmaceutical fabricator to work with animal testicles|FarmyardLab][$cash -= 25000, $farmyardLabUpgrades.animalTesticles = 1]]
 		<br>//Costs <<print cashFormat(25000)>> and allows you to implant animal testicles into slaves.//
@@ -25,6 +28,9 @@ $farmyardNameCaps Research Lab
 		The pharmaceutical fabricator has been retrofitted to work with animal testicles, allowing you to implant them into slaves.
 		<br>
 	<</if>>
+<</if>>
+
+<<if $animalMpreg > 0>>
 	<<if $farmyardLabUpgrades.animalMpreg == 0>>
 		[[Retrofit the pharmaceutical fabricator to work with animal anal wombs and ovaries|FarmyardLab][$cash -= 25000, $farmyardLabUpgrades.animalMpreg = 1]]
 		<br>//Costs <<print cashFormat(25000)>> and allows you to implant animal anal wombs and ovaries into slaves.//
diff --git a/src/pregmod/fAnimalImpreg.tw b/src/pregmod/fAnimalImpreg.tw
index 5868a9ed46b..ff6fa0323c3 100644
--- a/src/pregmod/fAnimalImpreg.tw
+++ b/src/pregmod/fAnimalImpreg.tw
@@ -10,6 +10,8 @@ __Select an eligible animal to knock $him up:__
 
 <br>
 
+/* FIXME: this might not work */
+
 <<for _c = 0; _c < _CL; _c++>>
     <<if canBreed($activeSlave, $canines[_c])>>
         <<if $canines[_c].species != "dog">>
diff --git a/src/pregmod/organFarm.tw b/src/pregmod/organFarm.tw
index f65eee5b042..2fc20174a48 100644
--- a/src/pregmod/organFarm.tw
+++ b/src/pregmod/organFarm.tw
@@ -150,7 +150,6 @@ Organ Production
 	<br>
 <</if>>
 
-/*
 <<if $seePreg != 0 && $seeBestiality != false>>
 	<<if $farmyardLabUpgrades.animalOvaries > 0>>
 		<<if $animalOvaries < 1>>
@@ -182,7 +181,6 @@ Organ Production
 		<</if>>
 	<</if>>
 <</if>>
-*/
 
 <br>
 Future Societies Research
diff --git a/src/pregmod/pRaped.tw b/src/pregmod/pRaped.tw
index 8365f77a251..5fe6db8c6dd 100644
--- a/src/pregmod/pRaped.tw
+++ b/src/pregmod/pRaped.tw
@@ -206,7 +206,7 @@ Now the only question is what to do with the would-be rapist. You could toss the
 		<<= assignJob($activeSlave, "work as a farmhand")>>
 		<<set $cash -= $contractCost>>
 		<<replace "#result">>
-			You complete the legalities and biometric scanning quickly and cautiously. The idiot will wake up in $farmyardName, where $he will spend the rest of $his days working the fields<<if $farmyardShows == true>><<if $seeBestiality == true>> and getting fucked by animals<<else>>putting on shows with animals<</if>>./*TODO: not too happy with this */
+			You complete the legalities and biometric scanning quickly and cautiously. The idiot will wake up in $farmyardName, where $he will spend the rest of $his days working the fields<<if $farmyardShows == true>> and <<if $seeBestiality == true>>getting fucked by animals<<else>>putting on shows with animals<</if>><</if>>.
 		<<run newSlave($activeSlave)>> /* skip New Slave Intro */
 		<</replace>>
 	<</link>>
diff --git a/src/pregmod/widgets/economyWidgets.tw b/src/pregmod/widgets/economyWidgets.tw
index 4c1895117ac..841e1c9e2b1 100644
--- a/src/pregmod/widgets/economyWidgets.tw
+++ b/src/pregmod/widgets/economyWidgets.tw
@@ -303,6 +303,7 @@
 		<<set _b.maintenance = (def _b.maintenance) ? _b.maintenance : 0>>
 		<<set _b.totalIncome = (def _b.totalIncome) ? _b.totalIncome : 0>>
 		<<set _b.totalExpenses = (def _b.totalExpenses) ? _b.totalExpenses : 0>>
+		<<set _b.food = (def _b.food) ? _b.food : 0>>
 		<<set _b.profit = (def _b.profit) ? _b.profit : 0>>
 		<table border="1" style="width: 100%; padding-left: 20px; padding-right: 20px;">
 		<tr style="border-bottom: 2px solid white;">
diff --git a/src/uncategorized/remoteSurgery.tw b/src/uncategorized/remoteSurgery.tw
index 5cbac5eb0ca..afed4925221 100644
--- a/src/uncategorized/remoteSurgery.tw
+++ b/src/uncategorized/remoteSurgery.tw
@@ -854,6 +854,8 @@ Work on $his sex:
 <</if>>
 <</if>> /*closes vag check */
 
+/* TODO: add a check for slave's eggType */
+
 <<if ($activeSlave.preg > -2) && ($activeSlave.preg < 1) && ($activeSlave.ovaries != 0 || $activeSlave.mpreg != 0) && ($activeSlave.pubertyXX == 0)>>
 	<br>&nbsp;&nbsp;&nbsp;&nbsp;
 	$He has not had $his first period.
diff --git a/src/uncategorized/slaveInteract.tw b/src/uncategorized/slaveInteract.tw
index 4e966d6d646..9b3e86e1edd 100644
--- a/src/uncategorized/slaveInteract.tw
+++ b/src/uncategorized/slaveInteract.tw
@@ -143,14 +143,15 @@
 	<</if>>
 	<span id = "impreg">
 	<<if (canGetPregnant($activeSlave)) && ($activeSlave.fuckdoll == 0) && $seePreg != 0>>
-		<<if canImpreg($activeSlave, $PC)>>
-		| <<link "Impregnate $him yourself">><<replace "#miniscene">><<include "FPCImpreg">><br>&nbsp;&nbsp;&nbsp;&nbsp;<</replace>><<SlaveInteractImpreg>><<SlaveInteractFertility>><</link>>
-		<</if>>
-		<<if canImpreg($activeSlave, $activeSlave)>>
-		| <<link "Use $his own seed to impregnate $him">><<replace "#miniscene">><<include "FSlaveSelfImpreg">><br>&nbsp;&nbsp;&nbsp;&nbsp;<</replace>><<SlaveInteractImpreg>><<SlaveInteractFertility>><</link>>
-		<</if>>
-		| <<link "Use another slave to impregnate $him" "FSlaveImpreg">><</link>>
-		<<if $activeSlave.eggType != "human" && (_CL > 0 || _HL > 0 || _FL > 0)>>
+		<<if $activeSlave.eggType == "human">>
+			<<if canImpreg($activeSlave, $PC)>>
+			| <<link "Impregnate $him yourself">><<replace "#miniscene">><<include "FPCImpreg">><br>&nbsp;&nbsp;&nbsp;&nbsp;<</replace>><<SlaveInteractImpreg>><<SlaveInteractFertility>><</link>>
+			<</if>>
+			<<if canImpreg($activeSlave, $activeSlave)>>
+			| <<link "Use $his own seed to impregnate $him">><<replace "#miniscene">><<include "FSlaveSelfImpreg">><br>&nbsp;&nbsp;&nbsp;&nbsp;<</replace>><<SlaveInteractImpreg>><<SlaveInteractFertility>><</link>>
+			<</if>>
+			| <<link "Use another slave to impregnate $him" "FSlaveImpreg">><</link>>
+		<<elseif (_CL > 0 || _HL > 0 || _FL > 0)>>
 			| <<link "Use an animal to impregnate $him" "FAnimalImpreg">><</link>>
 		<</if>>
 	<</if>>
-- 
GitLab