From 0bc69c87d502d953cab6a7e85e1c5ef24c57517a Mon Sep 17 00:00:00 2001
From: lowercasedonkey <lowercasedonkey@gmail.com>
Date: Wed, 11 Mar 2020 21:50:32 -0400
Subject: [PATCH] custom

---
 js/003-data/gameVariableData.js           |  1 -
 src/js/heroCreator.js                     | 19 +++++++++++--------
 src/npc/acquisition.tw                    |  2 ++
 src/npc/databases/customSlavesDatabase.tw |  6 ++++++
 src/uncategorized/completeCatalog.tw      |  2 ++
 src/uncategorized/specialSlave.tw         |  3 +++
 6 files changed, 24 insertions(+), 9 deletions(-)

diff --git a/js/003-data/gameVariableData.js b/js/003-data/gameVariableData.js
index 6515a9f846c..b21aa28583d 100644
--- a/js/003-data/gameVariableData.js
+++ b/js/003-data/gameVariableData.js
@@ -1401,7 +1401,6 @@ App.Data.resetOnNGPlus = {
 	abbreviateHormoneBalance: 2,
 	legendaryFacility: 0,
 	heroSlavesPuchased: [],
-	heroSlaves: [], // Now used only for players custom slaves.  Set in "customSlavesDatabase.tw".
 	fcnn: [
 		("...coming up at the top of the hour: Catgirl slaves, science fact or science fiction..."),
 		("...coming up at the top of the hour: Malnockestivi Smith, Free Cities' first MtFtMtFtH transgendered person..."),
diff --git a/src/js/heroCreator.js b/src/js/heroCreator.js
index 6d27fa5f30e..9182fd41371 100644
--- a/src/js/heroCreator.js
+++ b/src/js/heroCreator.js
@@ -9,16 +9,17 @@ App.Utils.buildHeroArray = function() {
 			App.Data.HeroSlaves.DF,
 			App.Data.HeroSlaves.Dextreme,
 			App.Data.HeroSlaves.DDextreme,
-			App.Data.HeroSlaves.DFextreme,
-			V.heroSlaves
+			App.Data.HeroSlaves.DFextreme
 		);
 	} else {
 		array = App.Data.HeroSlaves.D.concat(
 			App.Data.HeroSlaves.DD,
-			App.Data.HeroSlaves.DF,
-			V.heroSlaves
+			App.Data.HeroSlaves.DF
 		);
 	}
+	/*if (V.heroSlaves) {
+		array = array.concat(V.heroSlaves);
+	}*/
 	for (let hero = 0; hero < array.length; hero++) {
 		if (V.seePreg !== 1 && [900089, 900102].includes(array[hero].ID)) {
 			array.splice(hero);
@@ -36,6 +37,7 @@ App.Utils.buildHeroArray = function() {
 			continue;
 		}
 	}
+	console.log(array);
 	return array;
 };
 
@@ -45,6 +47,7 @@ App.Utils.buildHeroArray = function() {
  * @returns {App.Entity.SlaveState}
  */
 App.Utils.getHeroSlave = function(heroSlave, baseHeroSlave) {
+	console.log("hero", heroSlave);
 	function repairLimbs(slave) {
 		if (slave.hasOwnProperty("removedLimbs")) {
 			if (slave.removedLimbs[0] === 1) {
@@ -72,10 +75,10 @@ App.Utils.getHeroSlave = function(heroSlave, baseHeroSlave) {
 	if (!heroSlave.hasOwnProperty("birthWeek")) {
 		heroSlave.birthWeek = random(0, 51);
 	}
-	heroSlave.ID = generateSlaveID();
-	/* Nationalities, races, surnames random fill */
+	heroSlave.ID = generateSlaveID();/*
+	// Nationalities, races, surnames random fill
 	if (!heroslave.nationality) {
-		/* Check for a pre-set race and if the nationality fits, else regenerate */
+		// Check for a pre-set race and if the nationality fits, else regenerate
 		if (heroslave.race && setup.filterRacesLowercase.includes(heroslave.race)) {
 			raceToNationality(heroslave);
 		} else {
@@ -101,7 +104,7 @@ App.Utils.getHeroSlave = function(heroSlave, baseHeroSlave) {
 	}
 	if (heroslave.geneMods.rapidCellGrowth === undefined) {
 		heroslave.geneMods.rapidCellGrowth = 0;
-	}
+	}*/
 	// WombInit(heroslave);
 	deepAssign(newSlave, heroSlave);
 	newSlave.albinismOverride = albinismOverride;
diff --git a/src/npc/acquisition.tw b/src/npc/acquisition.tw
index 599dfa90b99..9872b1bf093 100644
--- a/src/npc/acquisition.tw
+++ b/src/npc/acquisition.tw
@@ -216,7 +216,9 @@ the new owner of $arcologies[0].name. I will offer useful information whenever p
 <br><br>
 The previous owner seems to have left in something of a hurry.
 <<set _valueGiven = 0>>
+<<include "custom Slaves Database">>
 <<set _heroSlaves = App.Utils.buildHeroArray().shuffle()>>
+<<unset $heroSlaves>>
 <<if $cheatMode == 1>>
 	Since you've elected to take over an arcology with special advantages, you've acquired a very special group of slaves.
 	<<include [[Cheatmode Database]]>>
diff --git a/src/npc/databases/customSlavesDatabase.tw b/src/npc/databases/customSlavesDatabase.tw
index 099827349cf..972bafb4326 100644
--- a/src/npc/databases/customSlavesDatabase.tw
+++ b/src/npc/databases/customSlavesDatabase.tw
@@ -1,3 +1,9 @@
 :: custom Slaves Database
 
+<<set $heroSlaves = []>>
 <<set _i = 1000000>>
+<<set _HS = App.Entity.SlaveState.makeSkeleton()>>
+<<set _HS.slaveName = "McChesterton", _HS.birthName = "Testy", _HS.origin = "$He is obsessed with testing new customizations of $his body.", _HS.ID = _i++, _HS.birthWeek = random(0,51), _HS.actualAge = 24, _HS.physicalAge = 24, _HS.visualAge = 24, _HS.ovaryAge = 24, setHealth(_HS, 20), _HS.devotion = 100, _HS.weight = 25, _HS.origHColor = "chestnut", _HS.pubicHColor = "chestnut", _HS.hLength = 30, _HS.hStyle = "shoulder-length and in a bun", _HS.boobs = 700, _HS.butt = 3, _HS.vagina = 1, _HS.vaginaLube = 1, _HS.anus = 1, _HS.ovaries = 1, _HS.skill.vaginal = 15, _HS.skill.oral = 15, _HS.skill.anal = 15, _HS.skill.entertainment = 1, _HS.clothes = "a nice maid outfit", _HS.intelligence = 20, _HS.intelligenceImplant = 30, _HS.attrXY = 40, _HS.fetish = "submissive", _HS.career = "a maid", _HS.eyewear = "corrective glasses">>
+<<run eyeSurgery(_HS, "both", "blur")>>
+<<set $heroSlaves.push(_HS)>>
+<<run console.log($heroSlaves)>>
\ No newline at end of file
diff --git a/src/uncategorized/completeCatalog.tw b/src/uncategorized/completeCatalog.tw
index 68b57a21468..8618cb8d68e 100644
--- a/src/uncategorized/completeCatalog.tw
+++ b/src/uncategorized/completeCatalog.tw
@@ -5,7 +5,9 @@
 //This is the complete catalog of slaves that you can acquire from other slaveowners. Most of these slaves are not for sale, so persuading their owners to part with them will be extremely expensive.//
 
 <br><br>
+<<include "custom Slaves Database">>
 <<set _heroSlaves = App.Utils.buildHeroArray()>>
+<<unset $heroSlaves>>
 <<for $i = 0; $i < _heroSlaves.length; $i++>>
 	<<if $i > 0>> | <</if>>
 	<<if _heroSlaves[$i].ID == $activeSlave.ID>>
diff --git a/src/uncategorized/specialSlave.tw b/src/uncategorized/specialSlave.tw
index 68e5fbc4431..983416f3e61 100644
--- a/src/uncategorized/specialSlave.tw
+++ b/src/uncategorized/specialSlave.tw
@@ -2,7 +2,10 @@
 
 <<set $nextButton = "Back", $nextLink = "Buy Slaves", $returnTo = "Buy Slaves", $showEncyclopedia = 1, $encyclopedia = "Direct Sales">>
 
+<<include "custom Slaves Database">>
+<<run console.log($heroSlaves)>>
 <<set _heroSlaves = App.Utils.buildHeroArray()>>
+<<unset $heroSlaves>>
 
 <<if _heroSlaves.length == 0>>
 	Unfortunately, the catalog is empty.
-- 
GitLab