From eae4d46a15ebb68826ce7697147518a3c3c263a6 Mon Sep 17 00:00:00 2001
From: Pregmodder <pregmodder@gmail.com>
Date: Wed, 31 May 2017 08:32:44 -0400
Subject: [PATCH] Returned tweaks and initialization.

---
 src/init/storyInit.tw                |  4 +--
 src/pregmod/MpregSelf.tw             |  3 +-
 src/pregmod/electiveSurgery.tw       | 16 +++++------
 src/pregmod/managePersonalAffairs.tw |  4 +--
 src/pregmod/sePlayerBirth.tw         | 41 ++++++++++++----------------
 src/uncategorized/main.tw            |  6 ++++
 6 files changed, 36 insertions(+), 38 deletions(-)

diff --git a/src/init/storyInit.tw b/src/init/storyInit.tw
index 41c3bc9370a..5224c5fc108 100644
--- a/src/init/storyInit.tw
+++ b/src/init/storyInit.tw
@@ -196,7 +196,7 @@ You should have received a copy of the GNU General Public License along with thi
 
 <<set $cheater = 0>>
 <<set $PCName = "Anonymous">>
-<<set $PC = {title: 1, ID: -1, dick: 1, vagina: 0, preg: 0, pregSource: 0, pregMood: 0, labor: 0, births: 0, boobsBonus: 0, degeneracy: 0, voiceImplant: 0, accent: 0, shoulders: 0, shouldersImplant: 0, boobs: 0, career: "capitalist", rumor: "wealth", indenture: -1, indentureRestrictions: 0, birthWeek: random(0,51), age: 2, sexualEnergy: 4, refreshment: "cigar", refreshmentType: 0, trading: 0, warfare: 0, slaving: 0, engineering: 0, medicine: 0, cumTap: 0, race: "white", origRace: "white", skin: "white", origSkin: "white", eyeColor: "blue", origEye: "blue", hColor: "blonde", origHColor: "blonde", nationality: "Stateless", father: 0, mother: 0, sisters: 0, daughters: 0, birthElite: 0, birthMaster: 0, birthDegenerate: 0, birthClient: 0, birthOther: 0, birthArcOwner: 0, birthCitizen: 0, intelligence: 3, face: 100, actualAge: 35, physicalAge: 35, visualAge: 35, birthWeek: 0, boobsImplant: 0, butt: 0, buttImplant: 0, ballsImplant: 0, ageImplant: 0, newVag: 0}>>
+<<set $PC = {title: 1, ID: -1, dick: 1, vagina: 0, preg: 0, pregSource: 0, pregMood: 0, labor: 0, births: 0, boobsBonus: 0, degeneracy: 0, voiceImplant: 0, accent: 0, shoulders: 0, shouldersImplant: 0, boobs: 0, career: "capitalist", rumor: "wealth", indenture: -1, indentureRestrictions: 0, birthWeek: random(0,51), age: 2, sexualEnergy: 4, refreshment: "cigar", refreshmentType: 0, trading: 0, warfare: 0, slaving: 0, engineering: 0, medicine: 0, cumTap: 0, race: "white", origRace: "white", skin: "white", origSkin: "white", eyeColor: "blue", origEye: "blue", hColor: "blonde", origHColor: "blonde", nationality: "Stateless", father: 0, mother: 0, sisters: 0, daughters: 0, birthElite: 0, birthMaster: 0, birthDegenerate: 0, birthClient: 0, birthOther: 0, birthArcOwner: 0, birthCitizen: 0, birthSelf: 0, intelligence: 3, face: 100, actualAge: 35, physicalAge: 35, visualAge: 35, birthWeek: 0, boobsImplant: 0, butt: 0, buttImplant: 0, balls: 0, ballsImplant: 0, ageImplant: 0, newVag: 0}>>
 <<set $cash = 10000>>
 <<set $normalizedEvents = 0>>
 <<set $autosave = 1>>
@@ -304,7 +304,7 @@ You should have received a copy of the GNU General Public License along with thi
 		<<set $cheater = 0>>
 		<<set $PCName = "Anonymous">>
 		<<set $cash = 10000>>
-		<<set $PC = {title: 1, ID: -1, dick: 1, vagina: 0, preg: 0, pregSource: 0, pregMood: 0, labor: 0, births: 0, boobsBonus: 0, degeneracy: 0, voiceImplant: 0, accent: 0, shoulders: 0, shouldersImplant: 0, boobs: 0, career: "capitalist", rumor: "wealth", indenture: -1, indentureRestrictions: 0, birthWeek: random(0,51), age: 2, sexualEnergy: 4, refreshment: "cigar", refreshmentType: 0, trading: 0, warfare: 0, slaving: 0, engineering: 0, medicine: 0, cumTap: 0, race: "white", origRace: "white", skin: "white", origSkin: "white", eyeColor: "blue", origEye: "blue", hColor: "blonde", origHColor: "blonde", nationality: "Stateless", father: 0, mother: 0, sisters: 0, daughters: 0, birthElite: 0, birthMaster: 0, birthDegenerate: 0, birthClient: 0, birthOther: 0, birthArcOwner: 0, birthCitizen: 0, intelligence: 3, face: 100, actualAge: 35, physicalAge: 35, visualAge: 35, birthWeek: 0, boobsImplant: 0, butt: 0, buttImplant: 0, ballsImplant: 0, ageImplant: 0, newVag: 0}>>
+		<<set $PC = {title: 1, ID: -1, dick: 1, vagina: 0, preg: 0, pregSource: 0, pregMood: 0, labor: 0, births: 0, boobsBonus: 0, degeneracy: 0, voiceImplant: 0, accent: 0, shoulders: 0, shouldersImplant: 0, boobs: 0, career: "capitalist", rumor: "wealth", indenture: -1, indentureRestrictions: 0, birthWeek: random(0,51), age: 2, sexualEnergy: 4, refreshment: "cigar", refreshmentType: 0, trading: 0, warfare: 0, slaving: 0, engineering: 0, medicine: 0, cumTap: 0, race: "white", origRace: "white", skin: "white", origSkin: "white", eyeColor: "blue", origEye: "blue", hColor: "blonde", origHColor: "blonde", nationality: "Stateless", father: 0, mother: 0, sisters: 0, daughters: 0, birthElite: 0, birthMaster: 0, birthDegenerate: 0, birthClient: 0, birthOther: 0, birthArcOwner: 0, birthCitizen: 0, birthSelf: 0, intelligence: 3, face: 100, actualAge: 35, physicalAge: 35, visualAge: 35, birthWeek: 0, boobsImplant: 0, butt: 0, buttImplant: 0, balls: 0, ballsImplant: 0, ageImplant: 0, newVag: 0}>>
 	<</if>>
 <</if>>
 
diff --git a/src/pregmod/MpregSelf.tw b/src/pregmod/MpregSelf.tw
index 24c3f6d433e..0503e7ba7ab 100644
--- a/src/pregmod/MpregSelf.tw
+++ b/src/pregmod/MpregSelf.tw
@@ -1,7 +1,6 @@
 :: MpregSelf [nobr] 
  
-<<set $nextButton = "Back">>
-<<set $nextLink = "Main">>
+<<set $nextButton = "Back", $nextLink = "Main">>
 
 <<if $PC.birthSelf == 0>>
 	<<if $PC.balls > 2>>
diff --git a/src/pregmod/electiveSurgery.tw b/src/pregmod/electiveSurgery.tw
index d93ceb46870..b7d67301675 100644
--- a/src/pregmod/electiveSurgery.tw
+++ b/src/pregmod/electiveSurgery.tw
@@ -217,30 +217,30 @@ You're @@.orange;$PC.actualAge years old.@@
 <<if $PC.dick == 1 && $PC.vagina == 1>>
 	You have working @@.orange;male and female reproductive organs@@ and a @@.orange;<<if $PC.title > 0>>masculine<<else>>feminine<</if>> appearance.@@
 	<br>
-	[[Remove your male half|PC Surgery Degradation][$PC.ballsImplant = 0, $PC.dick = 0, $cash -= 25000, $surgeryType = "herm2female"]] | 
+	[[Remove your male half|PC Surgery Degradation][$PC.ballsImplant = 0, $PC.balls = 0, $PC.dick = 0, $cash -= 25000, $surgeryType = "herm2female"]] | 
 	[[Remove your female half|PC Surgery Degradation][$PC.vagina = 0, $PC.preg = 0, $cash -= 25000, $surgeryType = "herm2male"]] | 
 	<<if $PC.title > 0>>
-		[[Remove your male half completely|PC Surgery Degradation][$PC.ballsImplant = 0, $PC.dick = 0, $PC.title = 0, $cash -= 25000, $surgeryType = "herm2truefemale"]]
+		[[Remove your male half completely|PC Surgery Degradation][$PC.ballsImplant = 0, $PC.balls = 0, $PC.dick = 0, $PC.title = 0, $cash -= 25000, $surgeryType = "herm2truefemale"]]
 	<<else>>
 		[[Remove your female half completely|PC Surgery Degradation][$PC.vagina = 0, $PC.preg = 0, $PC.boobs = 0, $PC.boobsBonus = 0, $PC.boobsImplant = 0, $PC.title = 1, $cash -= 25000, $surgeryType = "herm2truemale"]]
 	<</if>>
 <<elseif $PC.dick == 1>>
 	You have @@.orange;male genitalia@@ and a @@.orange;<<if $PC.title > 0>>masculine<<else>>feminine<</if>> appearance.@@
 	<br>
-	[[Have your male organs replaced with female ones|PC Surgery Degradation][$PC.ballsImplant = 0, $PC.dick = 0, $PC.vagina = 1, $PC.newVag = 1, $cash -= 50000, $surgeryType = "male2female"]] | 
+	[[Have your male organs replaced with female ones|PC Surgery Degradation][$PC.ballsImplant = 0, $PC.balls = 0, $PC.dick = 0, $PC.vagina = 1, $PC.newVag = 1, $cash -= 50000, $surgeryType = "male2female"]] | 
 	[[Add a female reproductive tract|PC Surgery Degradation][$PC.vagina = 1, $PC.newVag = 1, $PC.preg = 0, $cash -= 150000, $surgeryType = "male2herm"]] | 
 	<<if $PC.title > 0>>
-		[[Become a woman|PC Surgery Degradation][$PC.ballsImplant = 0, $PC.dick == 0, $PC.vagina = 1, $PC.newVag = 1, $PC.preg = 0, $PC.title = 0, $cash -= 50000, $surgeryType = "male2truefemale"]] | 
+		[[Become a woman|PC Surgery Degradation][$PC.ballsImplant = 0, $PC.balls = 0, $PC.dick == 0, $PC.vagina = 1, $PC.newVag = 1, $PC.preg = 0, $PC.title = 0, $cash -= 50000, $surgeryType = "male2truefemale"]] | 
 		[[Become a hermaphrodite girl|PC Surgery Degradation][$PC.vagina = 1, $PC.newVag = 1, $PC.preg = 0, $PC.title = 0, $cash -= 150000, $surgeryType = "male2hermfemale"]]
 	<</if>>
 <<else>>
 	You have @@.orange;female genitalia@@ and a @@.orange;<<if $PC.title > 0>>masculine<<else>>feminine<</if>> appearance.@@
 	<br>
-	[[Have your female organs replaced with male ones|PC Surgery Degradation][$PC.ballsImplant = 0, $PC.dick = 1, $PC.vagina = 0, $cash -= 50000, $surgeryType = "female2male"]] | 
-	[[Add a male reproductive tract|PC Surgery Degradation][$PC.ballsImplant = 0, $PC.dick = 1, $cash -= 150000, $surgeryType = "female2herm"]] | 
+	[[Have your female organs replaced with male ones|PC Surgery Degradation][$PC.ballsImplant = 0, $PC.balls = 0, $PC.dick = 1, $PC.vagina = 0, $cash -= 50000, $surgeryType = "female2male"]] | 
+	[[Add a male reproductive tract|PC Surgery Degradation][$PC.ballsImplant = 0, $PC.balls = 0, $PC.dick = 1, $cash -= 150000, $surgeryType = "female2herm"]] | 
 	<<if $PC.title == 0>>
-		[[Become a man|PC Surgery Degradation][$PC.ballsImplant = 0, $PC.dick = 1, $PC.vagina = 0, $PC.preg = 0, $PC.title = 1, $PC.boobs = 0, $PC.boobsBonus = 0, $PC.boobsImplant = 0, $cash -= 50000, $surgeryType = "female2truemale"]] | 
-		[[Become a hermaphrodite boy|PC Surgery Degradation][$PC.ballsImplant = 0, $PC.dick = 1, $PC.title = 1, $PC.boobs = 0, $PC.boobsBonus = 0, $PC.boobsImplant = 0, $cash -= 150000, $surgeryType = "female2hermmale"]]
+		[[Become a man|PC Surgery Degradation][$PC.ballsImplant = 0, $PC.balls = 0, $PC.dick = 1, $PC.vagina = 0, $PC.preg = 0, $PC.title = 1, $PC.boobs = 0, $PC.boobsBonus = 0, $PC.boobsImplant = 0, $cash -= 50000, $surgeryType = "female2truemale"]] | 
+		[[Become a hermaphrodite boy|PC Surgery Degradation][$PC.ballsImplant = 0, $PC.balls = 0, $PC.dick = 1, $PC.title = 1, $PC.boobs = 0, $PC.boobsBonus = 0, $PC.boobsImplant = 0, $cash -= 150000, $surgeryType = "female2hermmale"]]
 	<</if>>
 <</if>>
 <</if>>
diff --git a/src/pregmod/managePersonalAffairs.tw b/src/pregmod/managePersonalAffairs.tw
index d8501216aef..ea84226406d 100644
--- a/src/pregmod/managePersonalAffairs.tw
+++ b/src/pregmod/managePersonalAffairs.tw
@@ -61,7 +61,7 @@ Beneath all that;
 <<if $PC.dick == 1 && $PC.vagina == 1>>
 	an @@.orange;above average penis@@<<if $PC.balls > 2>> that is constantly streaming precum,<<elseif $PC.balls > 0>> that is constantly dripping precum,<</if> and a pair of
 	<<if $PC.ballsImplant > 3>>
-		@@.orange;monstrous, heavy balls@@ roughly the size of small watermelons thanks to a combination of growth hormones and gel injections; it's impossible to sit normally, you have to sit in special chairs designed to accommodate your colossal testes. You've given up on wearing pants, and their bulging mass is so gargantuan that people assume they're fake, but every slave you fuck gets a distended belly from all the cum you pump into them. They make just about everything you do difficult: sitting, walking, fucking; but they certainly make life interesting.
+		@@.orange;monstrous, heavy balls@@ roughly the size of small watermelons thanks to a combination of growth hormones and gel injections; it's impossible to sit normally, <<if $ballsAccessibility == 1>>but your penthouse has been redesigned with oversized balls in mind. There are plenty of chairs capable of handling you littering the penthouse<<else>> you rest on the edge of your chair, allowing your oversized balls to dangle precariously<</if>>. You've given up on wearing pants around the penthouse, and their bulging mass is so gargantuan that people assume they're fake, but every slave you fuck gets a distended belly from all the cum you pump into them. They make just about everything you do difficult: sitting, walking, fucking; but they certainly make life interesting.
 	<<elseif $PC.ballsImplant == 3>>
 		@@.orange;enormous, heavy balls@@ roughly the size of cantaloupes; it's difficult to sit normally, your clothes barely fit, and everyone probably assumes they are fake, but every slave you fuck gets a distinct slap with each thrust. They get in the way of nearly everything you do: sitting, walking, fucking; but they make life certainly interesting.
 	<<elseif $PC.ballsImplant == 2>>
@@ -92,7 +92,7 @@ Beneath all that;
 <<elseif $PC.dick == 1>>
 	an @@.orange;above average penis@@<<if $PC.balls > 2>> that is constantly streaming precum,<<elseif $PC.balls > 0>> that is constantly dripping precum,<</if> and a pair of
 	<<if $PC.ballsImplant > 3>>
-		@@.orange;monstrous, heavy balls@@ roughly the size of small watermelons thanks to a combination of growth hormones and gel injections; it's impossible to sit normally, you have to sit in special chairs designed to accommodate your colossal testes. You've given up on wearing pants, and their bulging mass is so gargantuan that people assume they're fake, but every slave you fuck gets a distended belly from all the cum you pump into them. They make just about everything you do difficult: sitting, walking, fucking; but they certainly make life interesting.
+		@@.orange;monstrous, heavy balls@@ roughly the size of small watermelons thanks to a combination of growth hormones and gel injections; it's impossible to sit normally, <<if $ballsAccessibility == 1>>but your penthouse has been redesigned with oversized balls in mind. There are plenty of chairs capable of handling you littering the penthouse<<else>> you rest on the edge of your chair, allowing your oversized balls to dangle precariously<</if>>. You've given up on wearing pants around the penthouse, and their bulging mass is so gargantuan that people assume they're fake, but every slave you fuck gets a distended belly from all the cum you pump into them. They make just about everything you do difficult: sitting, walking, fucking; but they certainly make life interesting.
 	<<elseif $PC.ballsImplant == 3>>
 		@@.orange;enormous, heavy balls@@ roughly the size of cantaloupes; it's difficult to sit normally, your clothes barely fit, and everyone probably assumes they are fake, but every slave you fuck gets a distinct slap with each thrust. They get in the way of nearly everything you do: sitting, walking, fucking; but they make life certainly interesting.
 	<<elseif $PC.ballsImplant == 2>>
diff --git a/src/pregmod/sePlayerBirth.tw b/src/pregmod/sePlayerBirth.tw
index 7a0549d9890..6afeac4b727 100644
--- a/src/pregmod/sePlayerBirth.tw
+++ b/src/pregmod/sePlayerBirth.tw
@@ -2,8 +2,7 @@
  
 <<set $nextButton = "Continue", $nextLink = "Scheduled Event">>
 
-<<set _gaveBirth = 0>>
-<<set _PCDegree = 0>>
+<<set _gaveBirth = 0, _PCDegree = 0>>
 
 /*
 PC.pregSource documentation
@@ -23,9 +22,7 @@ PC.pregSource documentation
 	<<set $badBirth = 10>>
 <</if>>
 
-<<set $PC.preg = 0>>
-<<set $PC.labor = 0>>
-<<set $PC.births += 1>>
+<<set $PC.preg = 0, $PC.labor = 0, $PC.births += 1>>
 <<if $PC.pregSource == 0>>
 	<<set $PC.birthOther += 1>>
 <<elseif $PC.pregSource == -1>>
@@ -149,24 +146,23 @@ Your little <<if $babyGender == 1>>girl<<else>>boy<</if>>
 <</if>>
 
 <<if $PC.pregSource > 0>>
-	<<for $i = 0; $i < $slaves.length; $i++>>
-		<<if $slaves[$i].ID == $PC.pregSource>>
-			Rumors spread that your child was fathered by a slave, @@.red;harming your lasting reputation.@@
-			<<set $PC.degeneracy += 20>>
-			<<if $arcologies[0].FSSupremacist != "unset">>
-				<<if $activeSlave.race != $arcologies[0].FSSupremacistRace>>
-					Furthermore, word is that your child was not $arcologies[0].FSSupremacistRace, @@.red;hurting your lasting reputation.@@
-					<<set $PC.degeneracy += 10>>
-				<</if>>
+	<<set _pb = $slaves.findIndex(function(s) { return s.ID == $PC.pregSource; })>>
+	<<if _pb != -1>>
+		Rumors spread that your child was fathered by a slave, @@.red;harming your lasting reputation.@@
+		<<set $PC.degeneracy += 20>>
+		<<if $arcologies[0].FSSupremacist != "unset">>
+			<<if $slaves[_pb].race != $arcologies[0].FSSupremacistRace>>
+				Furthermore, word is that your child was not $arcologies[0].FSSupremacistRace, @@.red;hurting your lasting reputation.@@
+				<<set $PC.degeneracy += 10>>
 			<</if>>
-			<<if $arcologies[0].FSSubjugationist != "unset">>
-				<<if $activeSlave.race == $arcologies[0].FSSubjugationistRace>>
-					In addition, there is a nasty rumor that you gave birth to a $arcologies[0].FSSubjugationistRace child, @@.red;devastating your lasting reputation.@@
-					<<set $PC.degeneracy += 50>>
-				<</if>>
+		<</if>>
+		<<if $arcologies[0].FSSubjugationist != "unset">>
+			<<if $slaves[_pb].race == $arcologies[0].FSSubjugationistRace>>
+				In addition, there is a nasty rumor that you gave birth to a $arcologies[0].FSSubjugationistRace child, @@.red;devastating your lasting reputation.@@
+				<<set $PC.degeneracy += 50>>
 			<</if>>
 		<</if>>
-	<</for>>
+	<</if>>
 <</if>>
 
 <br><br>
@@ -185,7 +181,4 @@ Now you are faced with a decision of what to do with your new child. You're far
 <</if>> /*closes gaveBirth*/
 <</if>> /*closes SE*/
 
-<<set $badBirth = 0>>
-<<set $PC.pregSource = 0>>
-<<set $seed = 0>>
-<<set $babyGender = 0>>
\ No newline at end of file
+<<set $badBirth = 0, $PC.pregSource = 0, $seed = 0, $babyGender = 0>>
\ No newline at end of file
diff --git a/src/uncategorized/main.tw b/src/uncategorized/main.tw
index 7ee9d0aab84..ec4cae270f1 100644
--- a/src/uncategorized/main.tw
+++ b/src/uncategorized/main.tw
@@ -23,6 +23,12 @@
 <<if ndef $dietCleanse>>
 	<<set $dietCleanse = 0>>
 <</if>>
+<<if ndef $PC.birthSelf>>
+	<<set $PC.birthSelf = 0>>
+<</if>>
+<<if ndef $PC.balls>>
+	<<set $PC.balls = 0>>
+<</if>>
 <<set $currentRule = $defaultRules[0]>>
 
 <<SlaveSort $slaves>>
-- 
GitLab