From 699f3e672b7b66f9eaca2bf3e892e97b845f438b Mon Sep 17 00:00:00 2001
From: Pregmodder <pregmodder@gmail.com>
Date: Fri, 9 Mar 2018 10:59:07 -0500
Subject: [PATCH] Sugarcube.State stripping.

---
 devNotes/VersionChangeLog-Premod+LoliMod.txt |  8 +++++-
 devNotes/twine JS                            | 30 ++++++++++----------
 src/js/extendedFamilyModeJS.tw               |  6 ++--
 src/js/familyTree.tw                         | 20 ++++++-------
 src/js/storyJS.tw                            |  4 +--
 5 files changed, 37 insertions(+), 31 deletions(-)

diff --git a/devNotes/VersionChangeLog-Premod+LoliMod.txt b/devNotes/VersionChangeLog-Premod+LoliMod.txt
index a27fa57979c..74819b04284 100644
--- a/devNotes/VersionChangeLog-Premod+LoliMod.txt
+++ b/devNotes/VersionChangeLog-Premod+LoliMod.txt
@@ -2,10 +2,15 @@
 
 0.10.7.0/1
 
+3/09/2018
+
+	389
+	-various git fixes (brothel implant ads, custom slave voice, SF tweaks)
+
 3/08/2018
 
 	388
-	-fixed a very very unlikely case in sister indentifying
+	-fixed a very very unlikely case in sister indentification
 	-fixed some improper pregnancy sets in the dairy
 	-fixed more improper preg sets in saLongTermEffects
 	-barred random impreg in dairies with preg settings on
@@ -35,6 +40,7 @@
 	
 	384
 	-various git merges
+	-devoted virgin event
 
 3/04/18
 
diff --git a/devNotes/twine JS b/devNotes/twine JS
index 39bcb333b0f..74146a41c26 100644
--- a/devNotes/twine JS	
+++ b/devNotes/twine JS	
@@ -191,7 +191,7 @@ if (typeof SlaveStatsChecker == "undefined") {
 	var SlaveStatsChecker = {
 		checkForLisp: function (slave) {
 				/* Begin mod section: toggle whether slaves lisp. */
-				if (SugarCube.State && SugarCube.State.variables.disableLisping == 1) {
+				if (State && State.variables.disableLisping == 1) {
 					return false;
 				}
 				/* End mod section: toggle whether slaves lisp. */
@@ -1111,7 +1111,7 @@ window.bodyguardSuccessorEligible = function(slave) {
 };
 
 window.ngUpdateGenePool = function(genePool) {
-  var transferredSlaveIds = (SugarCube.State.variables.slaves || [])
+  var transferredSlaveIds = (State.variables.slaves || [])
     .filter(function(s) { return s.ID >= 1200000; })
     .map(function(s) { return s.ID - 1200000; });
   return (genePool || [])
@@ -1304,7 +1304,7 @@ window.isSlaveAvailable = function(slave) {
 		return false;
 	} else if (slave.assignment == "be confined in the arcade") {
 		return false;
-	} else if (slave.assignment == "work in the dairy" && SugarCube.State.variables.DairyRestraintsSetting >= 2) {
+	} else if (slave.assignment == "work in the dairy" && State.variables.DairyRestraintsSetting >= 2) {
 		return false;
 	} else {
 		return true;
@@ -1326,7 +1326,7 @@ if (typeof DairyRestraintsSetting == "undefined") {
 window.randomRelatedSlave = function(slave, filterFunction) {
   if(!slave || !SugarCube) { return undefined; }
   if(typeof filterFunction !==  'function') { filterFunction = function(s, index, array) { return true; }; }
-  return SugarCube.State.variables.slaves.filter(filterFunction).shuffle().find(function(s, index, array) {return areSisters(slave, s) || s.mother == slave.ID || s.father == slave.ID || slave.ID == s.mother || slave.ID == s.father; })
+  return State.variables.slaves.filter(filterFunction).shuffle().find(function(s, index, array) {return areSisters(slave, s) || s.mother == slave.ID || s.father == slave.ID || slave.ID == s.mother || slave.ID == s.father; })
 }
 */
 
@@ -1335,7 +1335,7 @@ window.randomRelatedSlave = function(slave, filterFunction) {
   if(typeof filterFunction !== 'function') {
     filterFunction = function(s, index, array) { return true; };
   }
-  var arr = SugarCube.State.variables.slaves.filter(filterFunction)
+  var arr = State.variables.slaves.filter(filterFunction)
   arr.shuffle()
   return arr.find(function(s, index, array) {
     return areSisters(slave, s)
@@ -8052,7 +8052,7 @@ window.renderFamilyTree = function(slaves, filterID) {
 	}
 };
 
-window.buildFamilyTree = function(slaves = SugarCube.State.variables.slaves, filterID) {
+window.buildFamilyTree = function(slaves = State.variables.slaves, filterID) {
 	var family_graph = {
 		nodes: [],
 		links: []
@@ -8070,20 +8070,20 @@ window.buildFamilyTree = function(slaves = SugarCube.State.variables.slaves, fil
 	var kids = {};
 
 	var fake_pc = {
-		slaveName: SugarCube.State.variables.PC.name + '(You)',
-		mother: SugarCube.State.variables.PC.mother,
-		father: SugarCube.State.variables.PC.father,
-		dick: SugarCube.State.variables.PC.dick,
-		vagina: SugarCube.State.variables.PC.vagina,
-		ID: SugarCube.State.variables.PC.ID
+		slaveName: State.variables.PC.name + '(You)',
+		mother: State.variables.PC.mother,
+		father: State.variables.PC.father,
+		dick: State.variables.PC.dick,
+		vagina: State.variables.PC.vagina,
+		ID: State.variables.PC.ID
 	};
 	var charList = [fake_pc];
 	charList.push.apply(charList, slaves);
-	charList.push.apply(charList, SugarCube.State.variables.tanks);
+	charList.push.apply(charList, State.variables.tanks);
 
 	var unborn = {};
-	for(var i = 0; i < SugarCube.State.variables.tanks.length; i++) {
-		unborn[SugarCube.State.variables.tanks[i].ID] = true;
+	for(var i = 0; i < State.variables.tanks.length; i++) {
+		unborn[State.variables.tanks[i].ID] = true;
 	}
 
 	for(var i  = 0; i < charList.length; i++) {
diff --git a/src/js/extendedFamilyModeJS.tw b/src/js/extendedFamilyModeJS.tw
index 1ee880e7801..d88d678955b 100644
--- a/src/js/extendedFamilyModeJS.tw
+++ b/src/js/extendedFamilyModeJS.tw
@@ -133,7 +133,7 @@ window.isSlaveAvailable = function(slave) {
 		return false;
 	} else if (slave.assignment == "be confined in the arcade") {
 		return false;
-	} else if (slave.assignment == "work in the dairy" && SugarCube.State.variables.DairyRestraintsSetting >= 2) {
+	} else if (slave.assignment == "work in the dairy" && State.variables.DairyRestraintsSetting >= 2) {
 		return false;
 	} else {
 		return true;
@@ -155,7 +155,7 @@ if (typeof DairyRestraintsSetting == "undefined") {
 window.randomRelatedSlave = function(slave, filterFunction) {
   if(!slave || !SugarCube) { return undefined; }
   if(typeof filterFunction !==  'function') { filterFunction = function(s, index, array) { return true; }; }
-  return SugarCube.State.variables.slaves.filter(filterFunction).shuffle().find(function(s, index, array) {return areSisters(slave, s) || s.mother == slave.ID || s.father == slave.ID || slave.ID == s.mother || slave.ID == s.father; })
+  return State.variables.slaves.filter(filterFunction).shuffle().find(function(s, index, array) {return areSisters(slave, s) || s.mother == slave.ID || s.father == slave.ID || slave.ID == s.mother || slave.ID == s.father; })
 }
 */
 
@@ -164,7 +164,7 @@ window.randomRelatedSlave = function(slave, filterFunction) {
   if(typeof filterFunction !== 'function') {
     filterFunction = function(s, index, array) { return true; };
   }
-  var arr = SugarCube.State.variables.slaves.filter(filterFunction)
+  var arr = State.variables.slaves.filter(filterFunction)
   arr.shuffle()
   return arr.find(function(s, index, array) {
     return areSisters(slave, s)
diff --git a/src/js/familyTree.tw b/src/js/familyTree.tw
index 6f783ff53da..45fd882a312 100644
--- a/src/js/familyTree.tw
+++ b/src/js/familyTree.tw
@@ -200,7 +200,7 @@ window.renderFamilyTree = function(slaves, filterID) {
 	}
 };
 
-window.buildFamilyTree = function(slaves = SugarCube.State.variables.slaves, filterID) {
+window.buildFamilyTree = function(slaves = State.variables.slaves, filterID) {
 	var family_graph = {
 		nodes: [],
 		links: []
@@ -218,20 +218,20 @@ window.buildFamilyTree = function(slaves = SugarCube.State.variables.slaves, fil
 	var kids = {};
 
 	var fake_pc = {
-		slaveName: SugarCube.State.variables.PC.name + '(You)',
-		mother: SugarCube.State.variables.PC.mother,
-		father: SugarCube.State.variables.PC.father,
-		dick: SugarCube.State.variables.PC.dick,
-		vagina: SugarCube.State.variables.PC.vagina,
-		ID: SugarCube.State.variables.PC.ID
+		slaveName: State.variables.PC.name + '(You)',
+		mother: State.variables.PC.mother,
+		father: State.variables.PC.father,
+		dick: State.variables.PC.dick,
+		vagina: State.variables.PC.vagina,
+		ID: State.variables.PC.ID
 	};
 	var charList = [fake_pc];
 	charList.push.apply(charList, slaves);
-	charList.push.apply(charList, SugarCube.State.variables.tanks);
+	charList.push.apply(charList, State.variables.tanks);
 
 	var unborn = {};
-	for(var i = 0; i < SugarCube.State.variables.tanks.length; i++) {
-		unborn[SugarCube.State.variables.tanks[i].ID] = true;
+	for(var i = 0; i < State.variables.tanks.length; i++) {
+		unborn[State.variables.tanks[i].ID] = true;
 	}
 
 	for(var i  = 0; i < charList.length; i++) {
diff --git a/src/js/storyJS.tw b/src/js/storyJS.tw
index 2ece4f56c10..b18a5bdd102 100644
--- a/src/js/storyJS.tw
+++ b/src/js/storyJS.tw
@@ -191,7 +191,7 @@ if (typeof SlaveStatsChecker == "undefined") {
 	var SlaveStatsChecker = {
 		checkForLisp: function (slave) {
 				/* Begin mod section: toggle whether slaves lisp. */
-				if (SugarCube.State && SugarCube.State.variables.disableLisping == 1) {
+				if (State && State.variables.disableLisping == 1) {
 					return false;
 				}
 				/* End mod section: toggle whether slaves lisp. */
@@ -1111,7 +1111,7 @@ window.bodyguardSuccessorEligible = function(slave) {
 };
 
 window.ngUpdateGenePool = function(genePool) {
-  var transferredSlaveIds = (SugarCube.State.variables.slaves || [])
+  var transferredSlaveIds = (State.variables.slaves || [])
     .filter(function(s) { return s.ID >= 1200000; })
     .map(function(s) { return s.ID - 1200000; });
   return (genePool || [])
-- 
GitLab