From bf86271814a9f102a15d0652f7da5d99cf5b289f Mon Sep 17 00:00:00 2001
From: Pregmodder <pregmodder@gmail.com>
Date: Wed, 19 Sep 2018 03:40:12 -0400
Subject: [PATCH] tweaks

---
 devNotes/twine JS.txt                |  4 ++++
 src/js/assayJS.tw                    |  4 ++++
 src/uncategorized/completeCatalog.tw | 35 ++++++++++++++++++++++++++-
 src/uncategorized/specialSlave.tw    | 36 +++++++++++++++++++++++++++-
 4 files changed, 77 insertions(+), 2 deletions(-)

diff --git a/devNotes/twine JS.txt b/devNotes/twine JS.txt
index 09d5808448a..c9b04cc0807 100644
--- a/devNotes/twine JS.txt	
+++ b/devNotes/twine JS.txt	
@@ -8805,6 +8805,10 @@ window.SlaveSort = function SlaveSort(slaves, main=false) {
 	}
 };
 
+window.slaveSortMinor = function slaveSortMinor(slaves) {
+	slaves = slaves.sort((a, b) => a.slaveName < b.slaveName ? -1 : 1);
+}
+
 window.MenialPopCap = function MenialPopCap () {
 	const V = State.variables;
 	let popCap = 500;
diff --git a/src/js/assayJS.tw b/src/js/assayJS.tw
index a3654719c33..bd686508b72 100644
--- a/src/js/assayJS.tw
+++ b/src/js/assayJS.tw
@@ -1925,6 +1925,10 @@ window.SlaveSort = function SlaveSort(slaves, main=false) {
 	}
 };
 
+window.slaveSortMinor = function slaveSortMinor(slaves) {
+	slaves = slaves.sort((a, b) => a.slaveName < b.slaveName ? -1 : 1);
+}
+
 window.MenialPopCap = function MenialPopCap () {
 	const V = State.variables;
 	let popCap = 500;
diff --git a/src/uncategorized/completeCatalog.tw b/src/uncategorized/completeCatalog.tw
index 6057a1930db..35b23ef1ef8 100644
--- a/src/uncategorized/completeCatalog.tw
+++ b/src/uncategorized/completeCatalog.tw
@@ -6,9 +6,14 @@
 
 <br><br>
 
+<<run slaveSortMinor($heroSlaves)>>
 <<for $i = 0; $i < $heroSlaves.length; $i++>>
 	<<if $i > 0>> | <</if>>
-	<<print "[[$heroSlaves[$i].slaveName|Complete Catalog][$activeSlave = getHeroSlave($heroSlaves[" + $i + "], $baseHeroSlave)]]">>
+	<<if $heroSlaves[$i].ID == $activeSlave.ID>>
+		//$heroSlaves[$i].slaveName//
+	<<else>>
+		<<print "[[$heroSlaves[$i].slaveName|Complete Catalog][$activeSlave = getHeroSlave($heroSlaves[" + $i + "], $baseHeroSlave)]]">>
+	<</if>>
 <</for>>
 
 <<if ndef $activeSlave.pubicHColor>>
@@ -17,6 +22,34 @@
 <<if ndef $activeSlave.underArmHColor>>
 	<<set $activeSlave.underArmHColor = $activeSlave.hColor>>
 <</if>>
+<<if ($activeSlave.override_Eye_Color != 1)>>
+	<<switch ($activeSlave.eyeColor)>>
+		<<case "blind blue">>
+			<<set $activeSlave.origEye = "deep blue">>
+		<<case "milky white" "implant">>
+			<<set $activeSlave.origEye = random("blue", "green", "brown", "hazel", "light blue", "light green", "dark green", "dark blue")>>
+		<<default>>
+			<<set $activeSlave.origEye = $activeSlave.eyeColor>>
+	<</switch>>
+<</if>>
+<<if ($activeSlave.override_Race != 1)>>
+	<<set $activeSlave.origRace = $activeSlave.race>>
+<</if>>
+<<if ($activeSlave.override_H_Color != 1)>>
+	<<set $activeSlave.origHColor = $activeSlave.hColor>>
+<</if>>
+<<if ($activeSlave.override_Arm_H_Color != 1)>>
+	<<set $activeSlave.underArmHColor = $activeSlave.hColor>>
+<</if>>
+<<if ($activeSlave.override_Pubic_H_Color != 1)>>
+	<<set $activeSlave.pubicHColor = $activeSlave.hColor>>
+<</if>>
+<<if ($activeSlave.override_Brow_H_Color != 1)>>
+	<<set $activeSlave.eyebrowHColor = $activeSlave.hColor>>
+<</if>>
+<<if ($activeSlave.override_Skin != 1)>>
+	<<set $activeSlave.origSkin = $activeSlave.skin>>
+<</if>>
 <<run SetBellySize($activeSlave)>>
 <<set $specialSlavesPriceOverride = 1>>
 <<run nationalityToAccent($activeSlave)>>
diff --git a/src/uncategorized/specialSlave.tw b/src/uncategorized/specialSlave.tw
index b8e840c2502..7475b41a29b 100644
--- a/src/uncategorized/specialSlave.tw
+++ b/src/uncategorized/specialSlave.tw
@@ -18,6 +18,36 @@
 	<<if ndef $activeSlave.underArmHColor>>
 		<<set $activeSlave.underArmHColor = $activeSlave.hColor>>
 	<</if>>
+	
+	<<if ($activeSlave.override_Eye_Color != 1)>>
+		<<switch ($activeSlave.eyeColor)>>
+			<<case "blind blue">>
+				<<set $activeSlave.origEye = "deep blue">>
+			<<case "milky white" "implant">>
+				<<set $activeSlave.origEye = random("blue", "green", "brown", "hazel", "light blue", "light green", "dark green", "dark blue")>>
+			<<default>>
+				<<set $activeSlave.origEye = $activeSlave.eyeColor>>
+		<</switch>>
+	<</if>>
+	<<if ($activeSlave.override_Race != 1)>>
+		<<set $activeSlave.origRace = $activeSlave.race>>
+	<</if>>
+	<<if ($activeSlave.override_H_Color != 1)>>
+		<<set $activeSlave.origHColor = $activeSlave.hColor>>
+	<</if>>
+	<<if ($activeSlave.override_Arm_H_Color != 1)>>
+		<<set $activeSlave.underArmHColor = $activeSlave.hColor>>
+	<</if>>
+	<<if ($activeSlave.override_Pubic_H_Color != 1)>>
+		<<set $activeSlave.pubicHColor = $activeSlave.hColor>>
+	<</if>>
+	<<if ($activeSlave.override_Brow_H_Color != 1)>>
+		<<set $activeSlave.eyebrowHColor = $activeSlave.hColor>>
+	<</if>>
+	<<if ($activeSlave.override_Skin != 1)>>
+		<<set $activeSlave.origSkin = $activeSlave.skin>>
+	<</if>>
+	
 	<<run SetBellySize($activeSlave)>>
 	<<if $familyTesting == 1>>
 		/* special slaves exceptions to keep siblings sensible */
@@ -52,7 +82,12 @@
 		<</if>>
 	<</if>>
 	<<run nationalityToAccent($activeSlave)>>
+	<<set $specialSlavesPriceOverride = 1>>
 	<<slaveCost $activeSlave>>
+	<<set $slaveCost = (10*Math.trunc(($slaveCost/10)*2))>>
+	<<if $slaveCost < 20000>>
+		<<set $slaveCost += random(5000,30000)>>
+	<</if>>
 
 	The offered price is <<print cashFormat($slaveCost)>>.
 
@@ -68,7 +103,6 @@
 
 	<br><br>
 
-	<<set $specialSlavesPriceOverride = 1>>
 	<<set $saleDescription = 1>><<include "Long Slave Description">>
 	<<set $specialSlavesPriceOverride = 0>>
 
-- 
GitLab