From 6c16f4553bd52006079ee95402cfb61a17785326 Mon Sep 17 00:00:00 2001
From: i107760 <13422-i107760@users.noreply.gitgud.io>
Date: Tue, 4 Aug 2020 00:32:19 -0700
Subject: [PATCH] Allow exclusion from systematical impregnation by PC for
 slaves

---
 slave variables documentation - Pregmod.txt   |  6 ++++
 src/002-config/fc-version.js                  |  2 +-
 .../backwardsCompatibility/datatypeCleanup.js |  3 +-
 src/interaction/slaveInteract.js              | 34 ++++++++++++++++---
 src/js/SlaveState.js                          |  6 ++++
 src/npc/children/ChildState.js                |  4 +++
 src/uncategorized/saLongTermEffects.tw        |  2 +-
 7 files changed, 49 insertions(+), 8 deletions(-)

diff --git a/slave variables documentation - Pregmod.txt b/slave variables documentation - Pregmod.txt
index b6d2f7d04d9..537b1c31707 100644
--- a/slave variables documentation - Pregmod.txt	
+++ b/slave variables documentation - Pregmod.txt	
@@ -3698,6 +3698,12 @@ Can the slave recruit. Non-random slaves should be left off.
 0 - no
 1 - yes
 
+PCExclude:
+
+Is the PC permitted to fuck this slave pregnant.
+0 - no
+1 - yes
+
 HGExclude:
 
 Is the Head Girl permitted to fuck this slave pregnant.
diff --git a/src/002-config/fc-version.js b/src/002-config/fc-version.js
index 0b8dee56f73..823b5d93e71 100644
--- a/src/002-config/fc-version.js
+++ b/src/002-config/fc-version.js
@@ -2,5 +2,5 @@ App.Version = {
 	base: "0.10.7.1", // The vanilla version the mod is based off of, this should never be changed.
 	pmod: "3.6.2",
 	commitHash: null,
-	release: 1080
+	release: 1081
 };
diff --git a/src/data/backwardsCompatibility/datatypeCleanup.js b/src/data/backwardsCompatibility/datatypeCleanup.js
index 0d0904d701c..d85fc1d1ebc 100644
--- a/src/data/backwardsCompatibility/datatypeCleanup.js
+++ b/src/data/backwardsCompatibility/datatypeCleanup.js
@@ -1044,6 +1044,7 @@ globalThis.SlaveDatatypeCleanup = (function SlaveDatatypeCleanup() {
 			slave.useRulesAssistant = 1;
 		}
 		slave.choosesOwnAssignment = Math.clamp(+slave.choosesOwnAssignment, 0) || 0;
+		slave.PCExclude = Math.clamp(+slave.PCExclude, 0, 1) || 0;
 		slave.HGExclude = Math.clamp(+slave.HGExclude, 0, 1) || 0;
 		slave.StudExclude = Math.clamp(+slave.StudExclude, 0, 1) || 0;
 		slave.choosesOwnChastity = Math.clamp(+slave.choosesOwnChastity, 0, 1) || 0;
@@ -1783,7 +1784,7 @@ App.Entity.Utils.GenePoolRecordCleanup = (function() {
 			"counter", "custom", "porn",
 			"prestige", "prestigeDesc",
 			"subTarget", "relationship", "relationshipTarget", "rivalry", "rivalryTarget",
-			"weekAcquired", "HGExclude", "StudExclude",
+			"weekAcquired", "PCExclude", "HGExclude", "StudExclude",
 			"daughters", "sisters", "origin",
 			"canRecruit",
 			"choosesOwnAssignment", "assignment",
diff --git a/src/interaction/slaveInteract.js b/src/interaction/slaveInteract.js
index 36654d15032..4abb2393893 100644
--- a/src/interaction/slaveInteract.js
+++ b/src/interaction/slaveInteract.js
@@ -2032,7 +2032,31 @@ App.UI.SlaveInteract.rules = function(slave) {
 	} = getPronouns(slave);
 	if (V.seePreg !== 0) {
 		p = document.createElement('p');
-		if (V.universalRulesImpregnation === "HG") {
+		if (V.universalRulesImpregnation === "PC") {
+			if (slave.PCExclude === 0) {
+				p.append(`Will be bred by you when fertile. `);
+				p.append(
+					App.UI.DOM.link(
+						`Exempt ${him}`,
+						() => {
+							slave.PCExclude = 1;
+							App.UI.SlaveInteract.rules(slave);
+						}
+					)
+				)
+			} else {
+				p.append(`Will not be bred by you when fertile. `);
+				p.append(
+					App.UI.DOM.link(
+						`Include ${him}`,
+						() => {
+							slave.PCExclude = 0;
+							App.UI.SlaveInteract.rules(slave);
+						}
+					)
+				)
+			}
+		} else if (V.universalRulesImpregnation === "HG") {
 			if (slave.HGExclude === 0) {
 				p.append(`Will be bred by the Head Girl when fertile. `);
 				p.append(
@@ -2043,7 +2067,7 @@ App.UI.SlaveInteract.rules = function(slave) {
 							App.UI.SlaveInteract.rules(slave);
 						}
 					)
-				);
+				)
 			} else {
 				p.append(`Will not be bred by the Head Girl when fertile. `);
 				p.append(
@@ -2054,7 +2078,7 @@ App.UI.SlaveInteract.rules = function(slave) {
 							App.UI.SlaveInteract.rules(slave);
 						}
 					)
-				);
+				)
 			}
 		} else if (V.universalRulesImpregnation === "Stud") {
 			if (slave.StudExclude === 0) {
@@ -2067,7 +2091,7 @@ App.UI.SlaveInteract.rules = function(slave) {
 							App.UI.SlaveInteract.rules(slave);
 						}
 					)
-				);
+				)
 			} else {
 				p.append(`Will not be bred by your Stud when fertile. `);
 				p.append(
@@ -2078,7 +2102,7 @@ App.UI.SlaveInteract.rules = function(slave) {
 							App.UI.SlaveInteract.rules(slave);
 						}
 					)
-				);
+				)
 			}
 		}
 		frag.append(p);
diff --git a/src/js/SlaveState.js b/src/js/SlaveState.js
index 7a8469dc6fe..c9fc7b51bff 100644
--- a/src/js/SlaveState.js
+++ b/src/js/SlaveState.js
@@ -2326,6 +2326,12 @@ App.Entity.SlaveState = class SlaveState {
 		 * * 1: yes
 		 * * 0: no */
 		this.breedingMark = 0;
+		/** Is the PC permitted to fuck this slave pregnant.
+		 *  MB Cattle Ranch bulls will ignore this.
+		 *
+		 * * 0: no
+		 * * 1: yes */
+		this.PCExclude = 0;
 		/** Is the Head Girl permitted to fuck this slave pregnant.
 		 *
 		 * * 0: no
diff --git a/src/npc/children/ChildState.js b/src/npc/children/ChildState.js
index 4adb08d4e2c..5a07785d9f6 100644
--- a/src/npc/children/ChildState.js
+++ b/src/npc/children/ChildState.js
@@ -1767,6 +1767,10 @@ App.Facilities.Nursery.ChildState = class ChildState {
 		*
 		* 1: yes; 0: no */
 		this.breedingMark = 0;
+		/**  Is the PC permitted to fuck this slave pregnant.
+		*
+		* 0: no; 1: yes */
+		this.PCExclude = 0;
 		/**  Is the Head Girl permitted to fuck this slave pregnant.
 		*
 		* 0: no; 1: yes */
diff --git a/src/uncategorized/saLongTermEffects.tw b/src/uncategorized/saLongTermEffects.tw
index e6312eb7341..3aae7a82cbe 100644
--- a/src/uncategorized/saLongTermEffects.tw
+++ b/src/uncategorized/saLongTermEffects.tw
@@ -4466,7 +4466,7 @@
 		<<set _conceptionSeed = random(1,100)>>
 		<<set _studIgnoresRules = (_Stud && $universalRulesImpregnation == "Stud" && _Stud.career == "a breeding bull" && _Stud.fetish == "mindbroken" && canMove(_Stud)) ? 1 : 0>>
 
-		<<if ($universalRulesImpregnation == "PC") && canImpreg($slaves[$i], $PC)>>
+		<<if $universalRulesImpregnation == "PC" && canImpreg($slaves[$i], $PC) && $slaves[$i].PCExclude != 1>>
 			$slaves[$i].slaveName is ripe for breeding, so you ejaculate inside $him often. When you bore of $his fertile <<if $slaves[$i].mpreg == 1>>ass<<else>>cunt<</if>>, you keep $him around as you fuck other slaves so you can pull out of them, shove your cock into $him, and fill $him with your seed anyway.
 			<<if ($slaves[$i].fuckdoll == 0) && ($slaves[$i].fetish != "mindbroken")>>
 				<<if ($slaves[$i].devotion <= 20) && ($slaves[$i].trust >= -20)>>
-- 
GitLab