From 40e39d8ab9422f2ee597ad2e64276885f9509117 Mon Sep 17 00:00:00 2001
From: Pregmodder <pregmodder@gmail.com>
Date: Sun, 11 Mar 2018 00:00:16 -0500
Subject: [PATCH] Fixes and PC cheat menu fixes

---
 devNotes/twine JS                             | 154 +++++++++++++++++-
 src/cheats/PCCheatMenu.tw                     |  49 +++---
 src/cheats/PCCheatMenuCheatDatatypeCleanup.tw |  41 +++--
 src/pregmod/managePersonalAffairs.tw          |   7 +-
 src/uncategorized/sellSlave.tw                |   4 +-
 src/uncategorized/slaveSold.tw                |   2 +-
 6 files changed, 207 insertions(+), 50 deletions(-)

diff --git a/devNotes/twine JS b/devNotes/twine JS
index af0851205c7..41976f3ee94 100644
--- a/devNotes/twine JS	
+++ b/devNotes/twine JS	
@@ -7135,6 +7135,20 @@ window.WombNormalizePreg = function(actor)
     actor.bellyPreg = WombGetVolume(actor);
 }
 
+window.WombZeroID = function(actor, id)
+{
+    WombInit(actor);
+    var i, ft;
+    for (i in actor.womb)
+    {
+        ft = actor.womb[i];
+        if (ft.fatherID == id)
+            ft.fatherID = 0;
+    }
+
+    WombNormalizePreg(actor);
+}
+
 /*:: clothingSelectionJS [script]*/
 
 window.todaysOutfit = function(slave) {
@@ -7242,6 +7256,18 @@ window.todaysOutfit = function(slave) {
 				break;
 			}
 		}
+	} else if(slave.devotion <= 20) {
+		clothing.push({text: "She uses the ability to select outfits to cover up with comfortable cut-offs and a t-shirt,", clothes: "cutoffs and a t-shirt"});
+		if(isItemAccessible("conservative clothing")) {
+			wardrobeAssignment.push({text: "She uses the ability to select outfits to cover up with the most conservative clothing she can find.", clothes: "conservative clothing"});
+		}
+		if(isItemAccessible("a kimono")) {
+			wardrobeAssignment.push({text: "She uses the ability to select outfits to cover herself with a kimono.", clothes: "a kimono"});
+		}
+		if(isItemAccessible("stretch pants and a crop-top")) {
+			wardrobeAssignment.push({text: "She uses the ability to select outfits to cover up with stretch pants and a crop-top, though she wishes it didn't have lewd comments printed on it.", clothes: "stretch pants and a crop-top"});
+		}
+		selection = jsEither(clothing);
 	} else {
 		if(ArcologyZero.FSChattelReligionist > 0) {
 			clothing.push({text: "and wears a chattel habit to conform to your arcology's culture.", clothes: "a chattel habit"});
@@ -7251,7 +7277,7 @@ window.todaysOutfit = function(slave) {
 			if(slave.energy > 95 || slave.need > 100) {
 				wardrobeAssignment.push({text: "and wears a slutty nurse outfit to make it clear just how much this nurse needs her daily lay.", clothes: "a slutty nurse outfit"});
 			} else if(slave.energy > 80) {
-				wardrobeAssignment.push({text: "and wears a slutty nurse outfit to showoff her body and arouse her patients.", clothes: "a slutty nurse outfit"});
+				wardrobeAssignment.push({text: "and wears a slutty nurse outfit to show off her body and arouse her patients.", clothes: "a slutty nurse outfit"});
 				wardrobeAssignment.push({text: "and wears a nice nurse outfit to look professional before her patients.", clothes: "a nice nurse outfit"});
 				wardrobeAssignment.push({text: "and wears a slutty nurse outfit to show to a little skin as she cares for her patients.", clothes: "a slutty nurse outfit"});
 			} else {
@@ -7297,10 +7323,10 @@ window.todaysOutfit = function(slave) {
 				}
 			}
 		} else if(slave.assignment == "be your Head Girl") {
-			wardrobeAssignment.push({text: "and wears a militay uniform to give her that extra touch of authority.", clothes: "a military uniform"});
+			wardrobeAssignment.push({text: "and wears a military uniform to give her that extra touch of authority.", clothes: "a military uniform"});
 			wardrobeAssignment.push({text: "and wears a handsome suit to give her that extra touch of authority.", clothes: "nice business attire"});
 			if(canPenetrate(slave)){
-				wardrobeAssignment.push({text: "and wears a slutty suit to make it prefectly clear that her dick is her main tool in her job.", clothes: "slutty business attire"});
+				wardrobeAssignment.push({text: "and wears a slutty suit to make it perfectly clear that her dick is her main tool in her job.", clothes: "slutty business attire"});
 			}
 		} else if(slave.assignment == "be the Schoolteacher") {
 			wardrobeAssignment.push({text: "and wears a handsome suit to give her that teacherly authority.", clothes: "nice business attire"});
@@ -7439,7 +7465,7 @@ window.todaysOutfit = function(slave) {
 				wardrobeAssignment.push({text: "and wears a flattering mini dress to really strut her stuff.", clothes: "a mini dress"});
 			} else if(slave.assignment == "serve the public" || slave.assignment == "serve in the club") {
 				wardrobeAssignment.push({text: "and wears string lingerie to look fun and fuckable.", clothes: "a string bikini"});
-				wardrobeAssignment.push({text: "and throws togethor the sluttiest outfit since if you're going to slut you might as well go all out.", clothes: "a slutty outfit"});
+				wardrobeAssignment.push({text: "and throws together the sluttiest outfit since if you're going to slut you might as well go all out.", clothes: "a slutty outfit"});
 				wardrobeAssignment.push({text: "and tosses on a slutty suit that screams she needs a good fuck after a long day.", clothes: "slutty business attire"});
 				wardrobeAssignment.push({text: "and dresses up as a slutty nurse. She knows just how to fix penile swelling", clothes: "a slutty nurse outfit"});
 				wardrobeAssignment.push({text: "and wears a cheerleader outfit to look energetic and fuckable.", clothes: "a cheerleader outfit"});
@@ -7715,6 +7741,126 @@ window.todaysOutfit = function(slave) {
 	return selection;
 }
 
+window.todaysShoes = function(slave) {
+	var ArcologyZero = State.variables.arcologies[0];
+	var player = State.variables.PC;
+	var shoes = [];
+	
+	if(slave.fetish == 'mindbroken') {
+		if(slave.amp != 1 && slave.heels == 1) {
+			shoes.push({text: "She finds she can inexplicably walk if she wears heels; a daily lesson for her, as she forgets shortly after leaving.", shoes: jsEither("heels", "extreme heels", "boots")});
+		}
+		shoes.push({text: "She vaguely remembers putting things on her feet, so she does.", shoes: jsEither("heels", "extreme heels", "boots", "flats")});
+		shoes.push({text: "She entered without shoes, and will leave the same.", shoes: "none"});
+	} else if(slave.devotion <= 20) {
+		if(slave.heels == 0) {
+			shoes.push({text: "and wears comfortable flats,", shoes: "flats"});
+		} else {
+			shoes.push({text: "and angrily wears the heels she needs to walk,", shoes: "heels"});
+		}
+	} else {
+		if(slave.fetishKnown == 1 && slave.fetish == "dom") {
+			shoes.push({text: "She wears boots to look like a proper dominant.", shoes: "boots"});
+		} else if(slave.fetishKnown == 1 && slave.fetish == "sadist") {
+			shoes.push({text: "She wears boots, since she thinks they make her look dangerous.", shoes: "boots"});
+		} else if(slave.fetishKnown == 1 && slave.fetish == "masochist") {
+			shoes.push({text: "She wears painfully tall heels, since she enjoys the twinge of pain with each step.", shoes: "extreme heels"});
+		} else if(slave.heels == 1) {
+			shoes.push({text: "She wears the heels she needs to walk.", shoes: "heels"});
+		} else if(slave.fetishKnown == 1 && slave.fetish == "pregnancy" && slave.bellyPreg >= 500) {
+			shoes.push({text: "She goes barefoot to complement her pregnancy.", shoes: "none"});
+		} else if(slave.fetishKnown == 1 && slave.fetish == "none") {
+			shoes.push({text: "She wears comfortable flats, since she doesn't have a fetish to show off.", shoes: "flats"});
+		} else if(slave.actualAge < 13){
+			shoes.push({text: "She puts on boots so she can stomp around.", shoes: "boots"});
+			shoes.push({text: "She playfully puts on heels to be like all the other girls.", shoes: "heels"});
+			shoes.push({text: "She wears flats as they are comfortable and easy to take on and off.", shoes: "flats"});
+			shoes.push({text: "Going barefoot is fun, so no shoes for her.", shoes: "none"});
+		} else {
+			shoes.push({text: "She wears heels to strut her stuff.", shoes: "heels"});
+			shoes.push({text: "She wears comfortable flats to take it easy.", shoes: "flats"});
+			shoes.push({text: "She goes barefoot to show off her toes.", shoes: "none"});
+		}
+	}
+	return jsEither(shoes);
+}
+
+window.todaysCollar = function(slave) {
+	var ArcologyZero = State.variables.arcologies[0];
+	var player = State.variables.PC;
+	var neck = [];
+	
+	if(slave.fetish == 'mindbroken') {
+		
+	} else if(slave.devotion <= 20) {
+		
+	} else {
+		if(ArcologyZero.FSEgyptianRevivalist > 0) {
+			neck.push({text: "dons a wesekh to support your ancient Egyptian pretensions,", collar: "ancient Egyptian"});
+		}
+		if(slave.fetish == "masochist") {
+			neck.push({text: "dons a tight steel collar around her neck,", collar: "tight steel"});
+			neck.push({text: "dons a painful leather collar,", collar: "uncomfortable leather"});
+			neck.push({text: "dons a painfully tight neck corset,", collar: "satin choker"});
+		} else if(slave.fetish == "pregnancy" && (canGetPregnant(slave) || slave.pregKnown == 1)) {
+			neck.push({text: "dons a digital display that tells everything about her womb,", collar: "preg biometrics"});
+		} else if(slave.fetish == "boobs" && slave.boobs >= 1000) {
+			neck.push({text: "dons a cowbell to draw attention to her luscious udders,", collar: "leather with cowbell"});
+		}
+		neck.push({text: "decides her neck needs no accenting,", collar: "none"});
+		neck.push({text: "dons some pretty jewelry,", collar: "pretty jewelry"});
+		neck.push({text: "dons a lovely gold collar,", collar: "heavy gold"});
+		neck.push({text: "dons a simple silk ribbon around her neck,", collar: "silk ribbon"});
+	}
+	return jsEither(neck);
+}
+
+window.todaysCorset = function(slave) {
+	var ArcologyZero = State.variables.arcologies[0];
+	var player = State.variables.PC;
+	var belly = [];
+	var empathyBellies = ["a small empathy belly", "a medium empathy belly", "a large empathy belly", "a huge empathy belly"];
+	
+	if(slave.fetish == 'mindbroken') {
+		if(ArcologyZero.FSRepopulationFocus > 0 && slave.belly < 1500) {
+			if(slave.weight > 130) {
+				belly.push({text: "She notices the fake bellies; since every girl she has ever met has a rounded middle, it's only natural she is compelled to wear one. She struggles to fit it around her huge gut, only stopping when another slave takes it away from her so she moves on and stops blocking the wardrobe with her fat ass.", bellyAccessory: "none"});
+			} else {
+				belly.push({text: "She notices the fake bellies; since every girl she has ever met has a rounded middle, it's only natural she is compelled to wear one.", bellyAccessory: jsEither("a small empathy belly", "a medium empathy belly", "a large empathy belly", "a huge empathy belly")});
+			}
+		} else {
+			belly.push({text: "", bellyAccessory: slave.bellyAccessory}); /*compatiblity for no output, will likely get deprecated in the future as content is added*/
+		}
+	} else if(slave.devotion <= 20) {
+		
+	} else {
+		if(ArcologyZero.FSRepopulationFocus > 0 && slave.belly < 1500 && slave.sexualFlaw != "breeder") {
+			if(slave.weight > 130) {
+				belly.push({text: "struggles to fit a fake pregnant belly around her gut before giving up and hoping she can pass as fecund,", bellyAccessory: "none"});
+			} else {
+				belly.push({text: "straps on a fake pregnant belly to fit in with all the other pregnant girls,", bellyAccessory: jsEither("a small empathy belly", "a medium empathy belly", "a large empathy belly", "a huge empathy belly")});
+			}
+		} else if(slave.belly < 1500 && slave.fetish == "pregnancy" && isItemAccessible("a small empathy belly") && slave.sexualFlaw != "breeder" && slave.weight <= 130) {
+			if(slave.fetishStrength <= 30) {
+				belly.push({text: "straps on a 1st trimester belly to sate her curiosity,", bellyAccessory: "a small empathy belly"});
+				belly.push({text: "straps on a 2nd trimester belly to sate her curiosity,", bellyAccessory: "a medium empathy belly"});
+				belly.push({text: "straps on a 3rd trimester belly to sate her curiosity,", bellyAccessory: "a large empathy belly"});
+			} else if(slave.fetishStrength <= 95) {
+				belly.push({text: "straps on a 3rd trimester belly to satisfy her pregnancy fetish,", bellyAccessory: "a large empathy belly"});
+			} else if(slave.fetishStrength > 95) {
+				belly.push({text: "straps on the largest belly she can find to satisfy her pregnancy fetish,", bellyAccessory: "a huge empathy belly"});
+			}
+		} else if(empathyBellies.includes(slave.bellyAccessory) && slave.fetish != "pregnancy") {
+			belly.push({text: "removes her fake belly, since she dislikes it,", bellyAccessory: "none"});
+		} else if(empathyBellies.includes(slave.bellyAccessory) && slave.sexualFlaw == "breeder") {
+			belly.push({text: "pulls her fake belly off, disgusted by it,", bellyAccessory: "none"});
+		} else {
+			belly.push({text: "", bellyAccessory: slave.bellyAccessory}); /*compatiblity for no output, will likely get deprecated in the future as content is added*/
+		}
+	}
+	return jsEither(belly);
+}
+
 /*:: DTreeJS [script]*/
 /* This is the minified version of lodash, d3 and dTree */
 ;
diff --git a/src/cheats/PCCheatMenu.tw b/src/cheats/PCCheatMenu.tw
index 92cc55612c2..54c31a8bff0 100644
--- a/src/cheats/PCCheatMenu.tw
+++ b/src/cheats/PCCheatMenu.tw
@@ -1,31 +1,13 @@
 :: PCCheatMenu [nobr]
+
 <<set $showEncyclopedia = 0, $nextButton = "Back", $nextLink = "PCCheatMenuCheatDatatypeCleanup">>
-<<set _Z = 0>>
 
-<<if $PC.vagina == 1 || $PC.title == 0 || $PC.Boobs == 1>>
-<<set _Z = 1>>
-	<<if $PC.preg >= 1>>
-		__pregnancy__
-		<br>''Pregnancy length'': <<textbox "$PC.preg" $PC.preg "PCCheatMenu">> week: <<textbox "$PC.pregWeek" $PC.pregWeek "PCCheatMenu">> //How far along the your pregnancy is (pregMood kicks in at 24+ weeks) -2      menopausal -1      contraceptives 0      not pregnant 1 - 42 pregnant 43+    giving birth//\
-		<br>''Belly'': <<textbox "$PC.belly" $PC.belly "PCCheatMenu">> //how big your belly is in CCs (preg only). thresholds 100    - bloated 1500   - early pregnancy 5000   - obviously pregnant 10000  - very pregnant 15000  - full term 30000  - full term twins 45000  - full term triplets 60000  - full term quads 75000  - full term quints 90000  - full term sextuplets 105000 - full term septuplets 120000 - full term octuplets//
-		<br>''PregSource'': <<textbox "$PC.pregSource" $PC.pregSource "PCCheatMenu">> //who knocked you up 0 - unknown -1 - Societal Elite -2 - client -3 - former master -4 - male arc owner -5 - citizen -6 - self-impreg//
-		<<if $PC.preg >= 28>>
-			<br>''PregMood'': <<textbox "$PC.pregMood" $PC.pregMood "PCCheatMenu">> //how you act when heavily pregnant. 0: no change 1: submissive and motherly 2: aggressive and dominant//
-		<</if>>
-		<br>''Labor'': <<textbox "$PC.labor" $PC.labor "PCCheatMenu">> //are you giving birth this week. 0: no 1: yes//
-		<br><br>
-	<</if>>
-	
+''Surname'': <<textbox "$PC.surname" $PC.surname "PCCheatMenu">>
+<br>''Boobs'': <<textbox "$PC.boobs" $PC.boobs "PCCheatMenu">> //0 - masculine chest (if title = 1) or flat chested (if title = 0)(WIP) 1 - feminine bust//
+<<if $PC.boobs > 0>>
 	<br>''BoobsBonus'': <<textbox "$PC.boobsBonus" $PC.boobsBonus "PCCheatMenu">> //breast size -1   - C-cup -0.5 - D-cup 0   - DD-cup 1   - F-cup 2   - G-cup 3   - H-cup//
 	<br>''BoobsImplant'': <<textbox "$PC.boobsImplant" $PC.boobsImplant "PCCheatMenu">> //do you have breast implants 0 - no 1 - yes//
-	
-	<br><br>
-<</if>>
-
-<<if $PC.surname == 0 || $PC.surname != 0>>
-	<<if _Z == 1>> <br> <</if>>''Surname'': <<textbox "$PC.surname" $PC.surname "PCCheatMenu">>
 <</if>>
-<br>''Boobs'': <<textbox "$PC.boobs" $PC.boobs "PCCheatMenu">> //0 - masculine chest (if title = 1) or flat chested (if title = 0)(WIP) 1 - feminine bust//
 <br>''Skin'': <<textbox "$PC.skin" $PC.skin "PCCheatMenu">>
 <br>''OrigSkin'': <<textbox "$PC.origSkin" $PC.origSkin "PCCheatMenu">>
 <br>''EyeColor'': <<textbox "$PC.eyeColor" $PC.eyeColor "PCCheatMenu">>
@@ -45,5 +27,24 @@
 <br>''ActualAge'': <<textbox "$PC.actualAge" $PC.actualAge "PCCheatMenu">>
 <br>''PhysicalAge'': <<textbox "$PC.physicalAge" $PC.physicalAge "PCCheatMenu">>
 <br>''VisualAge'': <<textbox "$PC.visualAge" $PC.visualAge "PCCheatMenu">>
-<br>''AgeImplant'': <<textbox "$PC.ageImplant" $PC.ageImplant "PCCheatMenu">> //have your had age altering surgery 0 - no 1 - yes//
-<br>''PlayerAging'': <<textbox "$PC.playerAging" $PC.playerAging "PCCheatMenu">> //0 - will ''not age,'' and not experience birthdays. 1 - ''will'' celebrate birthdays, but ''not age.'' 2 - will ''age naturally.''//
\ No newline at end of file
+<br>''OvaryAge'': <<textbox "$PC.ovaryAge" $PC.ovaryAge "PCCheatMenu">>
+<br>''AgeImplant'': <<textbox "$PC.ageImplant" $PC.ageImplant "PCCheatMenu">>
+<br>
+<<radiobutton "$PC.ageImplant" 0>> No surgery
+<<radiobutton "$PC.ageImplant" 1>> Age altering surgery
+<br>''PlayerAging (0: no aging, 1:no aging, but birthdays, 2:aging): $PC.playerAging |'' <<textbox "$PC.playerAging" $PC.playerAging "PCCheatMenu">>
+<<radiobutton "$PC.playerAging" 0>> No aging
+<<radiobutton "$PC.playerAging" 1>> No aging, yes birthdays
+<<radiobutton "$PC.playerAging" 3>> Aging
+
+<<if $PC.vagina == 1>>
+	<<if $PC.preg >= 1>>
+		__pregnancy__
+		<br>''Pregnancy length'': <<textbox "$PC.preg" $PC.preg "PCCheatMenu">> //How far along the your pregnancy is (pregMood kicks in at 24+ weeks) -2      infertile -1      contraceptives 0      not pregnant 1 - 42 pregnant 43+    giving birth//\
+		<br>''Belly'': <<textbox "$PC.belly" $PC.belly "PCCheatMenu">> //how big your belly is in CCs (preg only). thresholds 100    - bloated 1500   - early pregnancy 5000   - obviously pregnant 10000  - very pregnant 15000  - full term 30000  - full term twins 45000  - full term triplets 60000  - full term quads 75000  - full term quints 90000  - full term sextuplets 105000 - full term septuplets 120000 - full term octuplets//
+		<br>''PregSource'': <<textbox "$PC.pregSource" $PC.pregSource "PCCheatMenu">> //who knocked you up 0 - unknown -1 - Societal Elite -2 - client -3 - former master -4 - male arc owner -5 - citizen -6 - self-impreg//
+	<<else>>
+		<br>''Contraception'': <<textbox "$PC.preg" $PC.preg "PCCheatMenu">> // 0 -fertile, -1 -contraceptives, -2 -infertile , 1+ -pregnant
+	<</if>>
+	<br>''PregMood'': <<textbox "$PC.pregMood" $PC.pregMood "PCCheatMenu">> //how you act when heavily pregnant. 0: no change 1: submissive and motherly 2: aggressive and dominant//
+<</if>>
diff --git a/src/cheats/PCCheatMenuCheatDatatypeCleanup.tw b/src/cheats/PCCheatMenuCheatDatatypeCleanup.tw
index 26b932ced94..920c5e539e9 100644
--- a/src/cheats/PCCheatMenuCheatDatatypeCleanup.tw
+++ b/src/cheats/PCCheatMenuCheatDatatypeCleanup.tw
@@ -4,30 +4,41 @@
 
 <<if $PC.preg >= 1>>
 	<<set $PC.preg = Number($PC.preg) || 0>>
-	<<set $PC.belly = Number($PC.belly) || 0>>
-	<<set $PC.pregWeek = Number($PC.pregWeek) || 0>>
-	<<set $PC.belly = Number($PC.belly) || 0>>
 	<<set $PC.pregSource = Number($PC.pregSource) || 0>>
-	<<if $PC.preg >= 28>>
-			<<set $PC.pregMood = Number($PC.pregMood) || 0>>
-		<</if>>
-	<<set $PC.labor = Number($PC.labor) || 0>>
-<</if>>	
-
-<<set $PC.boobsBonus = Number($PC.boobsBonus) || 0>>
-<<set $PC.boobsImplant = Number($PC.boobsImplant) || 0>>
+	<<set $PC.pregMood = Number($PC.pregMood) || 0>>
+<</if>>
+<<set WombNormalizePreg($PC), $PC.pregWeek = $PC.preg>>
+<<set $PC.belly = WombGetVolume($PC)>>
+<<if $PC.boobs == 0>>
+	<<set $PC.boobsBonus = 0>>
+	<<set $PC.boobsImplant = 0>>
+<<else>>
+	<<set $PC.boobsBonus = Number($PC.boobsBonus) || 0>>
+	<<set $PC.boobsImplant = Number($PC.boobsImplant) || 0>>
+<</if>>
 <<set $PC.butt = Number($PC.butt) || 0>>
-<<set $PC.buttImplant = Number($PC.buttImplant) || 0>>
+<<if $PC.butt == 0>>
+	<<set $PC.buttImplant = 0>>
+<<else>>
+	<<set $PC.buttImplant = Math.clamp($PC.buttImplant, 0, 1>>
+<</if>>
 <<if $PC.dick == 1>>
 	<<set $PC.balls = Number($PC.balls) || 0>>
 	<<set $PC.ballsImplant = Number($PC.ballsImplant) || 0>>
+<<else>>
+	<<set $PC.balls = 0>>
+	<<set $PC.ballsImplant = 0>>
 <</if>>
 
-<<set $PC.dick = Number($PC.dick) || 0>>
-<<set $PC.vagina = Number($PC.vagina) || 0>>
+<<set $PC.dick = Math.clamp($PC.dick, 0, 1>>
+<<set $PC.vagina = Math.clamp($PC.vagina, 0, 1>>
 
 <<set $PC.ageImplant = Number($PC.ageImplant) || 0>>
 <<set $PC.playerAging = Number($PC.playerAging) || 0>>
 <<set $PC.playerAging = Number($PC.playerAging) || 0>>
 <<set $PC.ageImplant = Number($PC.ageImplant) || 0>>
-<<set $PC.physicalAge = $PC.actualAge, $PC.visualAge = $PC.actualAge>>
\ No newline at end of file
+<<set $PC.physicalAge = Number($PC.physicalAge) || 0>>
+<<set $PC.visualAge = Number($PC.visualAge) || 14>>
+<<set $PC.actualAge = Number($PC.actualAge) || 14>>
+<<set $PC.actualAge = Number($PC.actualAge) || 14>>
+<<set $PC.ovaryAge = Number($PC.ovaryAge) || 14>>
\ No newline at end of file
diff --git a/src/pregmod/managePersonalAffairs.tw b/src/pregmod/managePersonalAffairs.tw
index b28587c37d8..27e8076af85 100644
--- a/src/pregmod/managePersonalAffairs.tw
+++ b/src/pregmod/managePersonalAffairs.tw
@@ -3,11 +3,8 @@
 <<set $nextButton = "Back", $nextLink = "Main", $showEncyclopedia = 0>>
 <<PCTitle>>
 
-<<if $cheatModeM == 1>>
-	<<link "Go to PC cheat menu">>
-		<<goto "PCCheatMenu">>
-	<</link>>
-	<br><br>
+<<if $cheatMode == 1>>
+	<center>//[[Cheat Edit Player|PCCheatMenu][$cheater = 1]]<br><br>//</center>
 <</if>>
 
 You pause for a moment from your busy day to day life to return to <<if $masterSuite != 0>>$masterSuiteName<<else>>your room<</if>> to consider some things about yourself.
diff --git a/src/uncategorized/sellSlave.tw b/src/uncategorized/sellSlave.tw
index eef5961155f..fa67db158d9 100644
--- a/src/uncategorized/sellSlave.tw
+++ b/src/uncategorized/sellSlave.tw
@@ -413,7 +413,9 @@ A reputable slave appraiser arrives promptly to inspect her and certify her qual
 <<else>>
 	Her rebelliousness is a major negative
 <</if>>
-<<if (($activeSlave.devotion+30) > $activeSlave.trust) && (($activeSlave.devotion-30) < $activeSlave.trust)>>
+<<if $activeSlave.devotion >= -20 && $activeSlave.devotion <= 20 && $activeSlave.trust <= 20 && $activeSlave.trust > -20>>
+	but
+<<elseif ($activeSlave.trust > 20 && $activeSlave.devotion > 20) || ($activeSlave.trust < -20 && $activeSlave.devotion < -20)>>
 	and
 <<else>>
 	but
diff --git a/src/uncategorized/slaveSold.tw b/src/uncategorized/slaveSold.tw
index d5af7f29ccc..9896a7f9a08 100644
--- a/src/uncategorized/slaveSold.tw
+++ b/src/uncategorized/slaveSold.tw
@@ -4,7 +4,7 @@
 
 <<set $display = 0>>
 
-<<if !["elite auction", "tentacle bred", "womb filler", "organ crafter", "abortion TV", "repopulationist arcology", "eugenics arcology", "peacekeepers"].includes($buyer)>> /* organ crafter is not viable now, the elite won't part so easily with a prize, some take place x months later when the event's max is 15 weeks, and the rest are snuff events. You don't want that slave back. */
+<<if !["elite auction", "tentacle bred", "womb filler", "organ crafter", "abortion TV", "repopulationist arcology", "eugenics arcology", "peacekeepers"].includes($buyer) && ((($activeSlave.actualAge < $retirementAge-1) && $PhysicalRetirementAgePolicy != 1) || (($activeSlave.physicalAge < $retirementAge-1) && $PhysicalRetirementAgePolicy == 1))>> /* organ crafter is not viable now, the elite won't part so easily with a prize, some take place x months later when the event's max is 15 weeks, and the rest are snuff events. You don't want that slave back. */
 <<if !$boomerangSlave || $boomerangWeeks > 15>>
 	<<if $activeSlave.fuckdoll == 0>>
 	<<if canWalk($activeSlave)>>
-- 
GitLab