code:
:: Revamped Art Control [script]

class ArtStyleEntry {
	constructor(name) {
		this.name = name;
	}

	toString()
	{
		var keys = Object.keys(this);
		var styleArray = [];
		if (keys !== null && keys !== undefined)
		{
			var styleObj = this;
			keys.forEach(function(key) {
				if(key !== "name") {
					var value = styleObj[key];
					styleArray.push(key + ":" + value);
				}
			});

			var styleValue = styleArray.join(";") + ";";

			var cssDef = "{" + styleValue + "}";

			if (this.name.length > 0)
				cssDef = "." + this.name + cssDef;

			return cssDef;
		}

		return "";
	}
}

class ArtStyleControl {
	constructor(artDisplayClass, artSlave) {
		this.artDisplayClass = artDisplayClass;
        this.artSlave = artSlave;
		this.styles = [];

		this.initDefaultValues();
		this.applyMakeup();
		this.applyCalcMuscleTone();
		this.applyEyeLensStyle();
    }

	applyMakeup() {
		var lipsColor = this.lips.fill;
		var lipsOpacity = this.lips["fill-opacity"];

		switch(this.artSlave.makeup)
		{
			case 1:
				//Nice
				lipsColor = "#ff69b4";
				lipsOpacity = 0.5;
				break;
			case 2:
				//Gorgeous
				lipsColor = "#8b008b";
				lipsOpacity = 0.7;
				break;
			case 3:
				//Hair coordinated
				lipsColor = this.hair.fill;
				lipsOpacity = 0.3;
				break;
			case 4:
				//Slutty
				lipsColor = "#ff0000";
				lipsOpacity = 1;
				break;
			case 5:
				//Neon
				lipsColor = "#DC143C";
				lipsOpacity = 1;
				break;
			case 6:
				//Neon hair coordinated
				lipsColor = this.hair.fill;
				lipsOpacity = 1;
				break;
			case 7:
				//Metallic
				lipsColor = "#b22222";
				lipsOpacity = 0.7;
				break;
			case 8:
				//Metallic hair coordinated
				lipsColor = this.hair.fill;
				lipsOpacity = 0.7;
				break;
			default:
		}

		this.lips.fill = lipsColor;
		this.lips["fill-opacity"] = lipsOpacity;
	}

	applyCalcMuscleTone() {
		var musclesValue = this.artSlave.muscles + 101;
		var musclesVisibility = 0.910239*Math.log(0.02*musclesValue);

		this.muscleTone["fill-opacity"] = musclesVisibility;
	}

	applyEyeLensStyle() {
		if (this.artSlave.eyeColor == null || this.artSlave.eyeColor == undefined)
			return;

		var eyeColorSplit = this.artSlave.eyeColor.split(" ");

		if (eyeColorSplit == 1)
			return;

		var eyeLens = eyeColorSplit[0];

		switch(eyeLens)
		{
			case "demonic":
				this.eyeball.fill = this.iris.fill;
				break;
			case "devilish":
				this.eyeball.fill = "#010101";
		}
	}

	parseColorFromName(colorName) {
		if (colorName == null)
			return "#000000";

		var colorPalette = [
			["auburn", "#7e543e"],
			["black", "#3F4040"],
			["blonde", "#F4F1A3"],
			["blue", "#4685C5"],
			["brown", "#8D4F21"],
			["burgundy", "#5f3946"],
			["chestnut", "#663622"],
			["chocolate", "#6e4937"],
			["copper", "#a16145"],
			["dark brown", "#463325"],
			["ginger", "#da822d"],
			["golden", "#ffdf31"],
			["green", "#5FBA46"],
			["grey", "#9e9fa4"],
			["hazel", "#8d6f1f"],
			["pink", "#D18CBC"],
			["platinum blonde", "#fcf3c1"],
			["red", "#BB2027"],
			["deep red", "#6D1318"],
			["blue-violet", "#8790B7"],
			["silver", "#cdc9c6"],
			["strawberry-blonde", "#e5a88c"],
			["blazing red", "#E00E2B"],
			["neon green", "#25d12b"],
			["neon blue", "#2284C3"],
			["neon pink", "#cc26aa"],
			["demonic", "#aa0000"],
			["devilish", "#ffd42a"],
			["hypnotic", "#ff5599"],
			["catlike", "#555555"],
			["serpent-like", "#555555"],
			["heart-shaped", "#555555"],
			["wide-eyed", "#555555"],
			["almond-shaped", "#555555"],
			["bright", "#555555"],
			["teary", "#555555"],
			["vacant", "#555555"],
		];

		var colorPaletteMap = new Map(colorPalette);
		colorName = colorName.toLowerCase();
		var colorValue = colorPaletteMap.get(colorName);
		if (!colorValue) {
			if (extractHairColor !== undefined) {
				return extractHairColor(colorName)
			}
			else {
				return colorName;
			}
		}

		return colorValue;
	}

	getLipsColorBySkinColorName(colorName) {
		if (colorName == null)
			return "#000000";

		var lipsPalette = [
			["light", "#ce6876"],
			["white", "#ce6876"],
			["fair", "#ce6876"],
			["lightened", "#ce6876"],
			["extremely pale", "#ffb9ca"],
			["pale", "#ffb9ca"],
			["tanned", "#9e4c44"],
			["natural", "#9e4c44"],
			["olive", "#c1a785"],
			["light brown", "#5d2f1b"],
			["dark", "#714536"],
			["brown", "#714536"],
			["black", "#403030"],
			["camouflage patterned", "#708050"],
			["red dyed", "#b04040"],
			["dyed red", "#b04040"],
			["green dyed", "#A0C070"],
			["dyed green", "#A0C070"],
			["blue dyed", "#5080b0"],
			["dyed blue", "#5080b0"],
			["tiger striped", "#e0d050"]
		];

		var lipsPaletteMap = new Map(lipsPalette);
		colorName = colorName.toLowerCase();
		var colorValue = lipsPaletteMap.get(colorName);
		if (!colorValue) {
			return this.parseColorFromName(colorName);
		}

		return colorValue;
	}

	parseSkinColorFromName(colorName) {
		if (colorName == null)
			return "#000000";

		var skinPalette = [
			["light", "#feebe5"],
			["white", "#feebe5"],
			["fair", "#feebe5"],
			["lightened", "#feebe5"],
			["extremely pale", "#fff8f8"],
			["pale", "#f9ebf0"],
			["tanned", "#e8b693"],
			["natural", "#e8b693"],
			["light olive", "#d4c6bb"],
			["dark", "#a46237"],
			["brown", "#845c44"],
			["dark brown", "#845c44"],
			["black", "#463a3a"],
			["camouflage patterned", "#78875a"],
			["red dyed", "#bc4949"],
			["dyed red", "#bc4949"],
			["green dyed", "#A6C373"],
			["dyed green", "#A6C373"],
			["blue dyed", "#5b8eb7"],
			["dyed blue", "#5b8eb7"],
			["tiger striped", "#e2d75d"],
			["olive", "#a46237"]
		];

		var skinPaletteMap = new Map(skinPalette);
		colorName = colorName.toLowerCase();
		var colorValue = skinPaletteMap.get(colorName);
		if (!colorValue) {
			return this.parseColorFromName(colorName);
		}

		return colorValue;
	}

	initDefaultValues() {
		this.white = new ArtStyleEntry("white");
		this.white.fill = "#FFFFFF";

		this.skin = new ArtStyleEntry("skin");
		this.skin.fill = this.parseSkinColorFromName(this.artSlave.skin);

		this.arm = new ArtStyleEntry("arm.skin");
		this.arm.fill = this.skin.fill;

		this.head = new ArtStyleEntry("head");
		this.head.fill = this.skin.fill;

		this.torso = new ArtStyleEntry("torso");
		this.torso.fill = this.skin.fill;

		this.boob = new ArtStyleEntry("boob");
		this.boob.fill = this.skin.fill;

		this.penis = new ArtStyleEntry("penis");
		this.penis.fill = this.skin.fill;

		this.scrotum = new ArtStyleEntry("scrotum");
		this.scrotum.fill = this.skin.fill;

		this.areola = new ArtStyleEntry("areola");
		this.areola.fill = this.getLipsColorBySkinColorName(this.artSlave.skin);

		this.labia = new ArtStyleEntry("labia");
		this.labia.fill = this.areola.fill;

		this.hair = new ArtStyleEntry("hair");
		this.hair.fill = this.parseColorFromName(this.artSlave.hColor);

		this.shoe = new ArtStyleEntry("shoe");
		this.shoe.fill = "#3E65B0";

		this.smartPiercing = new ArtStyleEntry("smart_piercing");
		this.smartPiercing.fill = "#4DB748";

		this.steelPiercing = new ArtStyleEntry("steel_piercing");
		this.steelPiercing.fill = "#c0c6c7";

		this.steelChastity = new ArtStyleEntry("steel_chastity");
		this.steelChastity.fill = "#c0c6c7";

		this.labiaSkin = new ArtStyleEntry("labia.skin");
		this.labiaSkin.fill = this.skin.fill;

		this.outfitBase = new ArtStyleEntry("outfit_base");
		this.outfitBase.fill = "#515351";

		this.shadow = new ArtStyleEntry("shadow");
		this.shadow.fill = "#010101";

		this.muscleTone = new ArtStyleEntry("muscle_tone");
		this.muscleTone.fill = "#010101";
		this.muscleTone["fill-opacity"] = 1;

		this.glasses = new ArtStyleEntry("glasses");
		this.glasses.fill = "#010101";

		this.lips = new ArtStyleEntry("lips");
		this.lips.fill = this.getLipsColorBySkinColorName(this.artSlave.skin);
		this.lips["fill-opacity"] = 0.6;

		this.eyeball = new ArtStyleEntry("eyeball");
		this.eyeball.fill = "#dfdfdf";

		this.iris = new ArtStyleEntry("iris");
		this.iris.fill = this.parseColorFromName(this.artSlave.eyeColor);

		this.highlight1 = new ArtStyleEntry("highlight1");
		this.highlight1.fill = "#ffffff";
		this.highlight1["fill-opacity"] = 0.9;
		this.highlight1["mix-blend-mode"] = "soft-light";

		this.highlight2 = new ArtStyleEntry("highlight2");
		this.highlight2.fill = "#ffffff";
		this.highlight2["fill-opacity"] = 0.9;
		this.highlight2["mix-blend-mode"] = "soft-light";

		this.highlightStrong = new ArtStyleEntry("highlightStrong");
		this.highlightStrong.fill = "#ffffff";

		this.armpitHair = new ArtStyleEntry("armpit_hair");
		this.armpitHair.fill = this.parseColorFromName(this.artSlave.underArmHColor);;

		this.pubicHair = new ArtStyleEntry("pubic_hair");
		this.pubicHair.fill = this.parseColorFromName(this.artSlave.pubicHColor);

		this.bellyDetails = new ArtStyleEntry("belly_details");
		this.bellyDetails["fill-opacity"] = 1;

		this.bellySkin = new ArtStyleEntry("belly.skin");
		this.bellySkin.fill = this.skin.fill;

		this.bellyUpperSkin = new ArtStyleEntry("belly_upper.skin");
		this.bellyUpperSkin.fill = this.skin.fill;

		this.neckSkin = new ArtStyleEntry("neck.skin");
		this.neckSkin.fill = this.skin.fill;

		this.legsSkin = new ArtStyleEntry("legs.skin");
		this.legsSkin.fill = this.skin.fill;

		this.buttSkin = new ArtStyleEntry("butt.skin");
		this.buttSkin.fill = this.skin.fill;

		this.feetSkin = new ArtStyleEntry("feet.skin");
		this.feetSkin.fill = this.skin.fill;

		this.shadowBoobInnerLowerShadow = new ArtStyleEntry("shadow.boob_inner_lower_shadow");
		this.shadowBoobInnerLowerShadow["fill-opacity"] = 1;

		this.shadowBoobInnerUpperShadow = new ArtStyleEntry("shadow.boob_inner_upper_shadow");
		this.shadowBoobInnerUpperShadow["fill-opacity"] = 1;

		this.gag = new ArtStyleEntry("gag");
		this.gag.fill = "#bf2126";
	}

	get StylesCss() {
		var mainStyle = new ArtStyleEntry("");
		mainStyle.position = "absolute";
    	mainStyle.height= "100%";
    	mainStyle["margin-left"] = "auto";
    	mainStyle["margin-right"] = "auto";
    	mainStyle.left = "0";
    	mainStyle.right = "0";

		this.styles.push(this.white);
		this.styles.push(this.arm);
		this.styles.push(this.skin);
		this.styles.push(this.head);
		this.styles.push(this.torso);
		this.styles.push(this.boob);
		this.styles.push(this.penis);
		this.styles.push(this.scrotum);
		this.styles.push(this.areola);
		this.styles.push(this.labia);
		this.styles.push(this.hair);
		this.styles.push(this.shoe);
		this.styles.push(this.smartPiercing);
		this.styles.push(this.steelPiercing);
		this.styles.push(this.steelChastity);
		this.styles.push(this.labiaSkin);
		this.styles.push(this.outfitBase);
		this.styles.push(this.shadow);
		this.styles.push(this.muscleTone);
		this.styles.push(this.glasses);
		this.styles.push(this.lips);
		this.styles.push(this.eyeball);
		this.styles.push(this.iris);
		this.styles.push(this.highlight1);
		this.styles.push(this.highlight2);
		this.styles.push(this.highlightStrong);
		this.styles.push(this.armpitHair);
		this.styles.push(this.pubicHair);
		this.styles.push(this.bellyDetails);
		this.styles.push(this.bellySkin);
		this.styles.push(this.bellyUpperSkin);
		this.styles.push(this.neckSkin);
		this.styles.push(this.legsSkin);
		this.styles.push(this.buttSkin);
		this.styles.push(this.feetSkin);
		this.styles.push(this.shadowBoobInnerLowerShadow);
		this.styles.push(this.shadowBoobInnerUpperShadow);
		this.styles.push(this.gag);
		var stylesValues = [];

		var artDisplayClass = this.artDisplayClass;

		stylesValues.push("." + artDisplayClass + " " + mainStyle.toString());
		this.styles.forEach(function(style) {
			stylesValues.push("." + artDisplayClass + " " + style.toString());
		});

		return stylesValues.join(" ");
	}

}

class ClothingControl {
	get fuckdoll() {
		var defaultOutfitColor = "#515351";
		var areolaColor = "#383838";
		return {
			bodySettings: {
				showEyes: false,
				showPubic: false,
				showArmHair: false,
				showHair: false,
				showLegHighlight: true,
				showTorsoHighlight: true,
				showBoobsHighlight: true,
				showHeadHighlight: true
			},
			styleSettings: {
				skin: { fill: defaultOutfitColor },
				arm: { fill: defaultOutfitColor },
				penis: { fill: defaultOutfitColor },
				legsSkin: {fill: defaultOutfitColor },
				feetSkin: {fill: defaultOutfitColor },
				torso: {fill: defaultOutfitColor },
				buttSkin: {fill: defaultOutfitColor },
				head: { fill: defaultOutfitColor },
				neckSkin: { fill: defaultOutfitColor },
				boob: { fill: defaultOutfitColor },
				areola: { fill: areolaColor },
				labia: { fill: areolaColor },
				bellySkin: { fill: defaultOutfitColor },
				bellyUpperSkin: { fill: defaultOutfitColor },
				shoe: { fill: defaultOutfitColor },
				labiaSkin: { fill: defaultOutfitColor },
				lips: { fill: areolaColor }
			}
		}
	}

	get niceMaid() {
		return {
			bodySettings: {
				showPubic: false,
				showBoobs: false,
				showNipples: false,
				showPenis: false,
				showBalls: false,
				showBellyPiercings: false,
				showNipplesPiercings: false
			},
			styleSettings: {
				bellySkin: { fill: "#FFFFFF" },
				bellyUpperSkin: { fill: "#FFFFFF" },
				bellyDetails: { "fill-opacity": 0 }
			}
		}
	}

	get sluttyMaid() {
		return {
			bodySettings: {
				showBellyPiercings: false
			},
			styleSettings: {
				bellySkin: { fill: "#FFFFFF" },
				bellyDetails: { "fill-opacity": 0 }
			}
		}
	}

	get restrictiveLatex() {
		var defaultOutfitColor = "#515351";
		var areolaColor = "#383838";
		return {
			bodySettings: {
				showEyes: false,
				showPubic: false,
				showArmHair: false,
				showHair: false,
				showLegHighlight: true,
				showTorsoHighlight: true,
				showBoobsHighlight: true,
				showHeadHighlight: true,
				showHeadPiercings: false,
				showBellyPiercings: false
			},
			styleSettings: {
				skin: { fill: defaultOutfitColor },
				arm: { fill: defaultOutfitColor },
				legsSkin: {fill: defaultOutfitColor },
				feetSkin: {fill: defaultOutfitColor },
				torso: {fill: defaultOutfitColor },
				buttSkin: {fill: defaultOutfitColor },
				head: { fill: defaultOutfitColor },
				neckSkin: { fill: defaultOutfitColor },
				bellySkin: { fill: defaultOutfitColor },
				bellyUpperSkin: { fill: defaultOutfitColor },
				shoe: { fill: defaultOutfitColor }
			}
		}
	}

	get latexCatsuit() {
		var defaultOutfitColor = "#515351";
		var areolaColor = "#383838";
		return {
			bodySettings: {
				showPubic: false,
				showArmHair: false,
				showLegHighlight: true,
				showTorsoHighlight: true,
				showBoobsHighlight: true,
				showHeadHighlight: true,
				showPussyPiercings: false,
				showPenisPiercings: false,
				showBellyPiercings: false,
				showNipplesPiercings: false
			},
			styleSettings: {
				skin: { fill: defaultOutfitColor },
				scrotum: { fill: defaultOutfitColor },
				arm: { fill: defaultOutfitColor },
				penis: { fill: defaultOutfitColor },
				legsSkin: {fill: defaultOutfitColor },
				feetSkin: {fill: defaultOutfitColor },
				torso: {fill: defaultOutfitColor },
				buttSkin: {fill: defaultOutfitColor },

				neckSkin: { fill: defaultOutfitColor },
				boob: { fill: defaultOutfitColor },
				areola: { fill: areolaColor },
				labia: { fill: areolaColor },
				bellySkin: { fill: defaultOutfitColor },
				bellyUpperSkin: { fill: defaultOutfitColor },
				shoe: { fill: defaultOutfitColor },
				labiaSkin: { fill: defaultOutfitColor }
			}
		}
	}

	get bodyOil() {
		return {
			bodySettings: {
				showLegHighlight: true,
				showTorsoHighlight: true,
				showBoobsHighlight: true,
				showHeadHighlight:true,
			},
			styleSettings: {

			}
		}
	}

	get bodysuit() {
		var defaultOutfitColor = "#162d50";
		return {
			bodySettings: {
				showPubic: false,
				showArmHair: false,
				showPussy: false,
				showPussyPiercings: false,
				showPenisPiercings: false,
				showBellyPiercings: false,
				showNipplesPiercings: false
			},
			styleSettings: {
				skin: { fill: defaultOutfitColor },
				scrotum: { fill: defaultOutfitColor },
				arm: { fill: defaultOutfitColor },
				penis: { fill: defaultOutfitColor },
				legsSkin: {fill: defaultOutfitColor },
				feetSkin: {fill: defaultOutfitColor },
				torso: {fill: defaultOutfitColor },
				buttSkin: {fill: defaultOutfitColor },
				boob: { fill: defaultOutfitColor },
				areola: { fill: defaultOutfitColor },
				bellySkin: { fill: defaultOutfitColor },
				bellyUpperSkin: { fill: defaultOutfitColor },
				shoe: { fill: defaultOutfitColor },
				muscleTone: { "fill-opacity": 0 },
				bellyDetails: { "fill-opacity": 0 }
			}
		}
	}

	get leotard() {
		var defaultOutfitColor = "#d35f8d";
		return {
			bodySettings: {
				showPubic: false,
				showArmHair: false,
				showPussy: false,
				showPussyPiercings: false,
				showPenisPiercings: false,
				showBellyPiercings: false,
				showNipplesPiercings: false,
				showNipples: false
			},
			styleSettings: {
				skin: { fill: defaultOutfitColor },
				scrotum: { fill: defaultOutfitColor },
				penis: { fill: defaultOutfitColor },
				torso: {fill: defaultOutfitColor },
				boob: { fill: defaultOutfitColor },
				areola: { fill: defaultOutfitColor },
				bellySkin: { fill: defaultOutfitColor },
				bellyUpperSkin: { fill: defaultOutfitColor },
				muscleTone: { "fill-opacity": 0 },
				bellyDetails: { "fill-opacity": 0 }
			}
		}
	}
}

class RevampedArtControl {
	constructor(artDisplayClass, artSlave, globalShowHighlights, globalShowBodyMods) {

		this.artDisplayClass = artDisplayClass;
        this.artSlave = artSlave;
		this.styleControl = new ArtStyleControl(artDisplayClass, artSlave);
		this.clothingControl = new ClothingControl();
		this.artTransform = "";
		this.boobRightArtTransform = "";
		this.boobLeftArtTransform = "";
		this.boobOutfitArtTransform = "";

		this.showArmHair = true;
		this.showHair = true;
		this.showPussy = true;
		this.showPubic = true;
		this.showChastityVaginal = true;
		this.showChastityAnal = true;
		this.showBalls = true;
		this.showPenis = true;
		this.showNipples = true;
		this.showBoobs = true;
		this.showEyes = true;
		this.showMouth = true;

		this.leftArmType = this.getLeftArmPosition;
		this.rightArmType = this.getRightArmPosition;

		this.hairLength = this.getHairLength;
		this.torsoSize = this.getTorsoSize;
		this.bellyLevel = this.getBellyLevel;

		this.showLegHighlight = false;
		this.showTorsoHighlight = false;
		this.showBoobsHighlight = false;
		this.showHeadHighlight = false;

		this.showPussyPiercings = true;
		this.showBellyPiercings = true;
		this.showPenisPiercings = true;
		this.showNipplesPiercings = true;
		this.showHeadPiercings = true;

		this.pubicTattooText = "";

		var clothing = this.getClothing();
		if (clothing != null)
		{
			if (clothing.bodySettings != null)
				this.applyClothingSettings(clothing.bodySettings);
			if (clothing.styleSettings != null)
				this.applyClothingStyleSettings(clothing.styleSettings);
		}

		if (!globalShowHighlights)
		{
			this.showLegHighlight = false;
			this.showTorsoHighlight = false;
			this.showBoobsHighlight = false;
			this.showHeadHighlight = false;
		}
		if (!globalShowBodyMods)
		{
			this.showPussyPiercings = false;
			this.showBellyPiercings = false;
			this.showPenisPiercings = false;
			this.showNipplesPiercings = false;
			this.showHeadPiercings = false;
		}

    }

	copyProperties(objTo, objFrom) {
		for (var attr in objFrom) {
			if (objFrom.hasOwnProperty(attr))
				objTo[attr] = objFrom[attr];
		}
	}

	applyClothingSettings(clothingSettings) {
		this.copyProperties(this, clothingSettings);
	}

	applyClothingStyleSettings(styleSettings) {
		for (var attr in styleSettings) {
			if (styleSettings.hasOwnProperty(attr))
				this.copyProperties(this.styleControl[attr], styleSettings[attr]);
		}
	}

	getClothing() {
		if (this.artSlave.fuckdoll > 0)
			return this.clothingControl.fuckdoll;

		switch(this.artSlave.clothes)
		{
			case "a nice maid outfit":
				return this.clothingControl.niceMaid;
				break;
			case "a slutty maid outfit":
				return this.clothingControl.sluttyMaid;
				break;
			case "restrictive latex":
				return this.clothingControl.restrictiveLatex;
				break;
			case "a latex catsuit":
				return this.clothingControl.latexCatsuit;
				break;
			case "body oil":
				return this.clothingControl.bodyOil;
				break;
			case "a comfortable bodysuit":
				return this.clothingControl.bodysuit;
				break;
			case "a leotard":
				/*return this.clothingControl.leotard;*/
				break;
			default:
		}

		return null;
	}

	get getHairLength() {
		var result = "Short";

		if (this.artSlave.hLength >= 80)
			result = "Long";
		else if (this.artSlave.hLength >= 40)
			result = "Medium";
		else
			result = "Short";

		return result;
	}

	get getTorsoSize() {
		var torsoSize = "Normal";

		if (this.artSlave.waist < -40) {
			torsoSize = this.artSlave.weight > 30 ? "Hourglass" : "Unnatural";
		}
		else if (this.artSlave.waist <= 10) {
			torsoSize = this.artSlave.weight > 30 ? "Normal" : "Hourglass";
		}
		else {
			torsoSize = "Normal";
		}

		return torsoSize;
	}

	get getLeftArmPosition() {
		var leftArmType = "Low";

		if (this.artSlave.devotion > 50) {
			leftArmType = "High";
		}
		else if (this.artSlave.trust >= -20) {
			if (this.artSlave.devotion <= 20) {
				leftArmType = "Low";
			}
			else
			{
				leftArmType = "Mid";
			}
		}
		else {
			leftArmType = "Mid";
		}

		return leftArmType;
	}

	get getRightArmPosition() {
		var rightArmType = "Low";

		if (this.artSlave.devotion > 50) {
			rightArmType = "High";
		}
		else if (this.artSlave.trust >= -20) {
			if (this.artSlave.devotion <= 20) {
				rightArmType = "Low";
			}
			else
			{
				rightArmType = "High";
			}
		}
		else {
			rightArmType = "Mid";
		}

		return rightArmType;
	}

	get getBellyLevel() {
		var bellyLevel = 0;
		if (this.artSlave.belly >= 120000)
			bellyLevel = 9;
		else if (this.artSlave.belly >= 90000)
			bellyLevel = 8;
		else if (this.artSlave.belly >= 50000)
			bellyLevel = 7;
		else if (this.artSlave.belly >= 30000)
			bellyLevel = 6;
		else if (this.artSlave.belly >= 15000)
			bellyLevel = 5;
		else if (this.artSlave.belly >= 10000)
			bellyLevel = 4;
		else if (this.artSlave.belly >= 5000)
			bellyLevel = 3;
		else if (this.artSlave.belly >= 1500)
			bellyLevel = 2;
		else if (this.artSlave.belly >= 500)
			bellyLevel = 1;
		else
			bellyLevel = 0;

		return bellyLevel;
	}

	get hairBackLayer() {
		var result = [];

		if (!this.showHair)
			return result;

		if (this.artSlave.hLength == 0)
			return result;

		switch(this.artSlave.hStyle)
		{
			case "neat":
				result.push("Art_Vector_Revamp_Hair_Back_Neat_" + this.hairLength);
				break;
			case "bun":
			case "up":
				result.push("Art_Vector_Revamp_Hair_Back_Bun_" + this.hairLength);
				break;
			case "tails":
				result.push("Art_Vector_Revamp_Hair_Back_Tails_" + this.hairLength);
				break;
			case "ponytail":
				result.push("Art_Vector_Revamp_Hair_Back_Ponytail_" + this.hairLength);
				break;
			case "braided":
				result.push("Art_Vector_Revamp_Hair_Back_Braids_" + this.hairLength);
				break;
			case "curled":
				result.push("Art_Vector_Revamp_Hair_Back_Curled_" + this.hairLength);
				break;
			case "cornrows":
				result.push("Art_Vector_Revamp_Hair_Back_Cornrows_" + this.hairLength);
				break;
			case "strip":
				result.push("Art_Vector_Revamp_Hair_Back_Shaved_Sides_" + this.hairLength);
				break;
			case "luxurious":
				result.push("Art_Vector_Revamp_Hair_Back_Luxurious_" + this.hairLength);
				break;
			case "afro":
				result.push("Art_Vector_Revamp_Hair_Back_Afro_" + this.hairLength);
				break;
			case "permed":
				result.push("Art_Vector_Revamp_Hair_Back_Permed_" + this.hairLength);
				break;
			case "dreadlocks":
				result.push("Art_Vector_Revamp_Hair_Back_Dreadlocks_" + this.hairLength);
				break;
			default:
				result.push("Art_Vector_Revamp_Hair_Back_Messy_" + this.hairLength);
		}

		return result;
	}

	get armLayer() {
		var result = [];

		var leftArmType = "";
		var rightArmType = "";

		if (this.artSlave.amp == 1) {
			result.push("Art_Vector_Revamp_Arm_Stump");
		}
		else {
			result.push("Art_Vector_Revamp_Arm_Right_"+this.rightArmType);
			result.push("Art_Vector_Revamp_Arm_Left_"+this.leftArmType);
		}

		if (this.showArmHair && (this.artSlave.amp == 1 || (this.leftArmType == "High" && this.artSlave.amp != 1)))
		{
			switch(this.artSlave.underArmHStyle)
			{
				case "bushy":
					result.push("Art_Vector_Revamp_Arm_Up_Hair_Bushy");
					break;
				case "neat":
					result.push("Art_Vector_Revamp_Arm_Up_Hair_Neat");
					break;
				default:
			}
		}

		return result;
	}

	get buttLayer() {
		var result = [];
		var buttSize = 0;
		if (this.artSlave.amp)
			return result;

		if (this.artSlave.butt > 6)
			buttSize = 3;
		else if (this.artSlave.butt > 4)
			buttSize = 2;
		else if (this.artSlave.butt > 2)
			buttSize = 1;
		else
			buttSize = 0;

		result.push("Art_Vector_Revamp_Butt_" + buttSize);

		return result;
	}

	get legLayer() {
		var result = [];

		if (this.artSlave.amp == 1) {
			result.push("Art_Vector_Revamp_Stump");
		}
		else {
			var legSize = "Normal";

			if (this.artSlave.hips < 0) {
				legSize = this.artSlave.weight > 95 ? "Normal" : "Narrow";
			}
			else if (this.artSlave.hips == 0) {
				legSize = this.artSlave.weight > 95 ? "Wide" : "Normal";
			}
			else if (this.artSlave.hips > 0) {
				legSize = "Wide";
			}

			result.push("Art_Vector_Revamp_Leg_" + legSize);

			if (this.showLegHighlight)
			{
				result.push("Art_Vector_Revamp_Leg_Highlights2");
				result.push("Art_Vector_Revamp_Leg_Highlights1");
			}
		}

		return result;
	}

	get feetLayer() {
		var result = [];

		if (this.artSlave.amp == 1) {
			return result;
		}

		switch(this.artSlave.shoes)
		{
			case "heels":
				result.push("Art_Vector_Revamp_Shoes_Heel");
				break;
			case "extreme heels":
				result.push("Art_Vector_Revamp_Shoes_Exterme_Heel");
				break;
			case "boots":
				result.push("Art_Vector_Revamp_Shoes_Boot");
				break;
			case "flats":
				result.push("Art_Vector_Revamp_Shoes_Flat");
				break;
			default:
				result.push("Art_Vector_Revamp_Feet");
		}

		return result;
	}

	get torsoLayer() {
		var result = [];

		result.push("Art_Vector_Revamp_Torso_" + this.torsoSize);
		result.push("Art_Vector_Revamp_Clavicle");
		if (this.showTorsoHighlight)
		{
			result.push("Art_Vector_Revamp_Torso_Highlights2");
			result.push("Art_Vector_Revamp_Torso_Highlights1");
		}

		if (this.showArmHair && this.leftArmType != "High" && this.artSlave.amp != 1)
		{
			switch(this.artSlave.underArmHStyle)
			{
				case "bushy":
					result.push("Art_Vector_Revamp_Arm_Down_Hair_Bushy");
					break;
				case "neat":
					result.push("Art_Vector_Revamp_Arm_Down_Hair_Neat");
					break;
				default:
			}
		}

		return result;
	}

	get pussyLayer() {
		var result = [];

		if (this.showPussy && this.artSlave.vagina >= 0)
			result.push("Art_Vector_Revamp_Pussy");

		return result;
	}

	get pubicLayer() {
		var result = [];

		if (!this.showPubic)
			return result;

		if (this.artSlave.physicalAge < 12)
			return result;

		if (this.artSlave.vaginaTat == "rude words")
		{
			this.pubicTattooText = this.artSlave.dick != 0 ? "Useless" : "Fucktoy";
			result.push("Art_Vector_Revamp_Pussy_Tattoo");
		}

		switch(this.artSlave.pubicHStyle)
		{
			case "strip":
			case "in a strip":
				result.push("Art_Vector_Revamp_Pubic_Hair_Strip");
				break;
			case "bushy":
			case "bushy in the front and neat in the rear":
			case "very bushy":
				result.push("Art_Vector_Revamp_Pubic_Hair_Bush");
				break;
			case "neat":
				result.push("Art_Vector_Revamp_Pubic_Hair_Neat");
				break;
			case "waxed":
				break;
			default:
		}

		return result;
	}

	get pussyPiercingsLayer() {
		var result = [];

		if (!this.showPussyPiercings)
			return result;

		if (this.artSlave.vaginaPiercing == 1)
			result.push("Art_Vector_Revamp_Pussy_Piercing");
		else if (this.artSlave.vaginaPiercing == 2)
			result.push("Art_Vector_Revamp_Pussy_Piercing_Heavy");

		if (this.artSlave.clitPiercing == 1)
			result.push("Art_Vector_Revamp_Clit_Piercing");
		else if (this.artSlave.clitPiercing == 2)
			result.push("Art_Vector_Revamp_Clit_Piercing_Heavy");
		else if (this.artSlave.clitPiercing == 1)
			result.push("Art_Vector_Revamp_Clit_Piercing_Smart");

		return result;
	}

	get chastityBeltLayer() {
		var result = [];

		var isChastityAnalWorn = this.artSlave.dickAccessory == "anal chastity" || this.artSlave.dickAccessory == "combined chastity" || this.artSlave.vaginalAccessory == "anal chastity" || this.artSlave.vaginalAccessory == "combined chastity";

		isChastityAnalWorn = isChastityAnalWorn && this.showChastityAnal;

		var isChastityVaginalWorn = this.artSlave.vaginalAccessory == "chastity belt" || this.artSlave.vaginalAccessory == "combined chastity";

		isChastityVaginalWorn = isChastityVaginalWorn && this.showChastityVaginal;

		if (isChastityAnalWorn)
			result.push("Art_Vector_Revamp_Chastity_Anus");

		if (isChastityVaginalWorn)
			result.push("Art_Vector_Revamp_Chastity_Vagina");

		if (isChastityAnalWorn || isChastityVaginalWorn)
			result.push("Art_Vector_Revamp_Chastity_Base");

		return result;
	}

	get torsoOutfitLayer() {
		var result = [];

		switch(this.artSlave.clothes)
		{
			case "uncomfortable straps":
				result.push("Art_Vector_Revamp_Torso_Outfit_Straps_" + this.torsoSize);
				break;
			case "a nice maid outfit":
				result.push("Art_Vector_Revamp_Torso_Outfit_Maid_" + this.torsoSize);
				break;
			case "a slutty maid outfit":
				result.push("Art_Vector_Revamp_Torso_Outfit_Maid_Lewd_" + this.torsoSize);
				break;
			default:
		}

		return result;
	}

	get ballsLayer() {
		var result = [];

		if (!this.showBalls || this.artSlave.scrotum <= 0 || this.artSlave.balls <= 0)
			return result;

		var ballsSize = 0;

		if (this.artSlave.scrotum >= 6)
			ballsSize = 4;
		else if (this.artSlave.scrotum >= 4)
			ballsSize = 3;
		else if (this.artSlave.scrotum >= 3)
			ballsSize = 2;
		else if (this.artSlave.scrotum >= 2)
			ballsSize = 1;
		else
			ballsSize = 0;

		result.push("Art_Vector_Revamp_Balls_" + ballsSize);

		return result;
	}

	get bellyLayer() {
		var result = [];

		if (this.bellyLevel > 0)
		{
			result.push("Art_Vector_Revamp_Belly_" + this.bellyLevel);

			if (this.showBellyPiercings)
			{
				if (this.artSlave.navelPiercing >= 1)
					result.push("Art_Vector_Revamp_Belly_" + this.bellyLevel + "_Piercing");

				if (this.artSlave.navelPiercing == 2)
					result.push("Art_Vector_Revamp_Belly_" + this.bellyLevel + "_Piercing_Heavy");
			}
		}
		else
		{
			if (this.showBellyPiercings)
			{
				if (this.artSlave.navelPiercing >= 1)
					result.push("Art_Vector_Revamp_Navel_Piercing");

				if (this.artSlave.navelPiercing == 2)
					result.push("Art_Vector_Revamp_Navel_Piercing_Heavy");
			}
		}

		return result;
	}

	get penisLayer() {
		var result = [];

		if (this.getBellyLevel >= 8)
			return result;

		var penisSize = -1;

		if (this.artSlave.dick >= 8)
			penisSize = 6;
		else if (this.artSlave.dick >= 7)
			penisSize = 5;
		else if (this.artSlave.dick >= 6)
			penisSize = 4;
		else if (this.artSlave.dick >= 5)
			penisSize = 3;
		else if (this.artSlave.dick >= 4)
			penisSize = 2;
		else if (this.artSlave.dick >= 2)
			penisSize = 1;
		else if (this.artSlave.dick >= 1)
			penisSize = 0;
		else
			penisSize = -1;

		if (!this.showPenis || penisSize < 0)
			return result;

		if (canAchieveErection(this.artSlave) && (this.artSlave.dickAccessory != "chastity") && (this.artSlave.dickAccessory != "combined chastity"))
		{
			result.push("Art_Vector_Revamp_Penis_" + penisSize);

			if (!this.showPenisPiercings)
				return result;

			if (this.artSlave.dickPiercing == 1)
				result.push("Art_Vector_Revamp_Penis_" + penisSize + "_Piercing");
			else if (this.artSlave.dickPiercing == 2)
				result.push("Art_Vector_Revamp_Penis_" + penisSize + "_Piercing_Heavy");
		}
		else
		{
			result.push("Art_Vector_Revamp_Flaccid_" + penisSize);

			if ((this.artSlave.dickAccessory == "chastity") || (this.artSlave.dickAccessory == "combined chastity")) {
				result.push("Art_Vector_Revamp_Chastity_Cage_" + penisSize);
			}
		}

		return result;
	}

	get boobLayer() {
		var result = [];

		var artScaleFactor = 0.804354*Math.log(0.00577801*this.artSlave.boobs);

		var boobRightArtTranslationX = 270*((-1*artScaleFactor) + 1);
		var boobLeftArtTranslationX = 320*((-1*artScaleFactor) + 1);
		var artTranslationX = -283.841*artScaleFactor+285.349;
		var artTranslationY = 198*((-1*artScaleFactor) + 1);
		var artBoobTransform = "matrix(" + artScaleFactor +",0,0," + artScaleFactor + "," + artTranslationX + "," + artTranslationY + ")";

		this.artTransform = artBoobTransform;

		if (this.artSlave.boobs < 300)
		{
			if (this.showNipples)
			{
				var areolaeShape = "Normal";

				switch(this.artSlave.areolae)
				{
					case 0:
						areolaeShape = "Normal";
						break;
					case 1:
						areolaeShape = "Large";
						break;
					case 2:
						areolaeShape = "Wide";
						break;
					case 3:
						areolaeShape = "Huge";
						break;
					case 4:
						areolaeShape = "Heart";
						break;
					case 5:
						areolaeShape = "Star";
						break;
				}

				result.push("Art_Vector_Revamp_Boob_None_Areola_" + areolaeShape);
			}

		}
		else
		{
			if (!this.showBoobs)
				return result;

			var size = "Small";

			if (this.artSlave.boobs < 600)
			{
				artScaleFactor = 0.360674*Math.log(0.0266667*this.artSlave.boobs);

				boobRightArtTranslationX = 240*((-1*artScaleFactor) + 1);
				boobLeftArtTranslationX = 300*((-1*artScaleFactor) + 1);
				artTranslationY = 250*((-1*artScaleFactor) + 1);
				size = "Small";
			}
			else if (this.artSlave.boobs < 15000)
			{
				size = "Medium";
			}
			else {
				size = "Huge";
				boobRightArtTranslationX = 252*((-1*artScaleFactor) + 1);
				boobLeftArtTranslationX = 315*((-1*artScaleFactor) + 1);
			}

			this.boobRightArtTransform = "matrix(" + artScaleFactor +",0,0," + artScaleFactor + "," + boobRightArtTranslationX + "," + artTranslationY + ")";
			this.boobLeftArtTransform = "matrix(" + artScaleFactor +",0,0," + artScaleFactor + "," + boobLeftArtTranslationX + "," + artTranslationY + ")";
			result.push("Art_Vector_Revamp_Boob_" + size);

			if (this.showNipples)
			{
				var areolaeShape = "Normal";

				switch(this.artSlave.areolae)
				{
					case 0:
						areolaeShape = "Normal";
						break;
					case 1:
						areolaeShape = "Large";
						break;
					case 2:
						areolaeShape = "Wide";
						break;
					case 3:
						areolaeShape = "Huge";
						break;
					case 4:
						areolaeShape = "Heart";
						break;
					case 5:
						areolaeShape = "Star";
						break;
				}

				result.push("Art_Vector_Revamp_Boob_" + size + "_Areolae_" + areolaeShape);
				result.push("Art_Vector_Revamp_Boob_" + size + "_Nipples");
			}
			if (this.showBoobsHighlight)
			{
				result.push("Art_Vector_Revamp_Boob_" + size + "_Highlights2");
				result.push("Art_Vector_Revamp_Boob_" + size + "_Highlights1");
			}
		}

		return result;
	}

	get boobAddonLayer() {
		var result = [];

		if (this.showNipplesPiercings)
		{
			var size = "Small";

			if (this.artSlave.boobs < 600)
			{
				size = "Small";
			}
			else if (this.artSlave.boobs < 15000)
			{
				size = "Medium";
			}
			else {
				size = "Huge";
			}

			if (this.artSlave.nipplesPiercing == 1)
			{
				if (this.artSlave.boobs < 300)
					result.push("Art_Vector_Revamp_Boob_None_Piercing");
				else
					result.push("Art_Vector_Revamp_Boob_" + size + "_Piercing");
			}
			else if (this.artSlave.nipplesPiercing == 2)
			{
				if (this.artSlave.boobs < 300)
					result.push("Art_Vector_Revamp_Boob_None_Piercing_Heavy");
				else
					result.push("Art_Vector_Revamp_Boob_" + size + "_Piercing_Heavy");
			}

			if (this.artSlave.areolaePiercing == 1)
			{
				if (this.artSlave.boobs < 300)
					result.push("Art_Vector_Revamp_Boob_None_Areola_Piercing");
				else
					result.push("Art_Vector_Revamp_Boob_" + size + "_Areola_Piercing");
			}
			else if (this.artSlave.areolaePiercing == 2)
			{
				if (this.artSlave.boobs < 300)
					result.push("Art_Vector_Revamp_Boob_None_Areola_Piercing_Heavy");
				else
					result.push("Art_Vector_Revamp_Boob_" + size + "_Areola_Piercing_Heavy");
			}
		}

		switch(this.artSlave.clothes)
		{
			case "uncomfortable straps":
				if (this.artSlave.boobs >= 300)
					//result.push("Art_Vector_Revamp_Boob_Outfit_Straps");
				break;
			case "a nice maid outfit":
				if (this.artSlave.boobs >= 300)
				{
					if (this.artSlave.boobs < 600)
					{
						var artScaleFactor = 0.288539*Math.log(0.106667*this.artSlave.boobs);
						var artTranslationX = 270*((-1*artScaleFactor) + 1);
						var artTranslationY = 198*((-1*artScaleFactor) + 1);//-198.438*artScaleFactor+203.274;
						var artBoobTransform = "matrix(" + artScaleFactor +",0,0," + artScaleFactor + "," + artTranslationX + "," + artTranslationY + ")";

						this.boobOutfitArtTransform = artBoobTransform;

						result.push("Art_Vector_Revamp_Boob_Small_Outfit_Maid");
					}
					else if (this.artSlave.boobs < 15000)
					{
						var artScaleFactor = 0.155334*Math.log(1.04167*this.artSlave.boobs);
						var artTranslationX = 270*((-1.25*artScaleFactor) + 1.25);
						var artTranslationY = 198*((-0.8*artScaleFactor) + 0.8);//-198.438*artScaleFactor+203.274;
						var artBoobTransform = "matrix(" + artScaleFactor +",0,0," + artScaleFactor + "," + artTranslationX + "," + artTranslationY + ")";

						this.boobOutfitArtTransform = artBoobTransform;
						result.push("Art_Vector_Revamp_Boob_Medium_Outfit_Maid");
					}
					else {
						var artScaleFactor = 1.56609*Math.log(0.00017373*this.artSlave.boobs);
						var artTranslationX = 340*((-1*artScaleFactor) + 1);
						var artTranslationY = 153*((-1*artScaleFactor) + 1);//-198.438*artScaleFactor+203.274;
						var artBoobTransform = "matrix(" + artScaleFactor +",0,0," + artScaleFactor + "," + artTranslationX + "," + artTranslationY + ")";

						this.boobOutfitArtTransform = artBoobTransform;
						result.push("Art_Vector_Revamp_Boob_Huge_Outfit_Maid");
					}

				}
				break;

			default:
		}

		return result;
	}

	get clavicleLayer() {
		var result = [];

		result.push("Art_Vector_Revamp_Clavicle");

		return result;
	}

	get collarLayer() {
		var result = [];

		switch(this.artSlave.collar)
		{
			case "leather with cowbell":
				result.push("Art_Vector_Revamp_Collar_Cowbell");
				break;
			case "heavy gold":
				result.push("Art_Vector_Revamp_Collar_Gold_Heavy");
				break;
			case "neck corset":
				result.push("Art_Vector_Revamp_Collar_Neck_Corset");
				break;
			case "pretty jewelry":
				result.push("Art_Vector_Revamp_Collar_Pretty_Jewelry");
				break;
			case "cruel retirement counter":
				result.push("Art_Vector_Revamp_Collar_Retirement_Cruel");
				break;
			case "nice retirement counter":
				result.push("Art_Vector_Revamp_Collar_Retirement_Nice");
				break;
			case "satin choker":
				result.push("Art_Vector_Revamp_Collar_Satin_Choker");
				break;
			case "shock punishment":
				result.push("Art_Vector_Revamp_Collar_Shock_Punishment");
				break;
			case "stylish leather":
				result.push("Art_Vector_Revamp_Collar_Stylish_Leather");
				break;
			case "tight steel":
				result.push("Art_Vector_Revamp_Collar_Tight_Steel");
				break;
			default:
		}

		return result;
	}

	get headLayer() {
		var result = [];

		result.push("Art_Vector_Revamp_Head");

		if (this.showHeadHighlight)
			result.push("Art_Vector_Revamp_Face_Highlights");

		if (!this.showHeadPiercings)
			return result;

		if (this.artSlave.earPiercing == 1)
			result.push("Art_Vector_Revamp_Head_Ear_Piercing");
		else if (this.artSlave.earPiercing == 2)
			result.push("Art_Vector_Revamp_Head_Ear_Piercing_Heavy");

		if (this.artSlave.nosePiercing == 1)
			result.push("Art_Vector_Revamp_Head_Nose_Piercing");
		else if (this.artSlave.nosePiercing == 2)
			result.push("Art_Vector_Revamp_Head_Nose_Piercing_Heavy");

		return result;
	}

	get eyesLayer() {
		var result = [];

		if (!this.showEyes)
			return result;

		if (this.artSlave.devotion > 50)
		{
			result.push("Art_Vector_Revamp_Eyes_Happy");
			result.push("Art_Vector_Revamp_Eyes_Happy_Highlights");

			if (this.showHeadPiercings)
			{
				if (this.artSlave.eyebrowPiercing == 1)
					result.push("Art_Vector_Revamp_Head_Eyebrow_Happy_Piercing");
				else if (this.artSlave.eyebrowPiercing == 2)
					result.push("Art_Vector_Revamp_Head_Eyebrow_Happy_Piercing_Heavy");
			}
		}
		else if (this.artSlave.devotion >= 0)
		{
			result.push("Art_Vector_Revamp_Eyes_Shy");
			result.push("Art_Vector_Revamp_Eyes_Shy_Highlights");

			if (this.showHeadPiercings)
			{
				if (this.artSlave.eyebrowPiercing == 1)
					result.push("Art_Vector_Revamp_Head_Eyebrow_Shy_Piercing");
				else if (this.artSlave.eyebrowPiercing == 2)
					result.push("Art_Vector_Revamp_Head_Eyebrow_Shy_Piercing_Heavy");
			}
		}
		else if (this.artSlave.devotion >= -50)
		{
			result.push("Art_Vector_Revamp_Eyes_Closed");

			if (this.showHeadPiercings)
			{
				if (this.artSlave.eyebrowPiercing == 1)
					result.push("Art_Vector_Revamp_Head_Eyebrow_Closed_Piercing");
				else if (this.artSlave.eyebrowPiercing == 2)
					result.push("Art_Vector_Revamp_Head_Eyebrow_Closed_Piercing_Heavy");
			}
		}
		else
		{
			result.push("Art_Vector_Revamp_Eyes_Angry");
			result.push("Art_Vector_Revamp_Eyes_Angry_Highlights");
			if (this.showHeadPiercings)
			{
				if (this.artSlave.eyebrowPiercing == 1)
					result.push("Art_Vector_Revamp_Head_Eyebrow_Angry_Piercing");
				else if (this.artSlave.eyebrowPiercing == 2)
					result.push("Art_Vector_Revamp_Head_Eyebrow_Angry_Piercing_Heavy");
			}
		}

		return result;
	}

	get mouthLayer() {
		var result = [];
		var lipsSize = "Normal";

		if (!this.showMouth)
			return result;

		if (this.artSlave.lips > 95)
			lipsSize = "Enormous";
		else if (this.artSlave.lips > 70)
			lipsSize = "Huge";
		else if (this.artSlave.lips > 50)
			lipsSize = "Big";
		else if (this.artSlave.lips > 30)
			lipsSize = "Plush";
		else if (this.artSlave.lips > 10)
			lipsSize = "Normal";
		else
			lipsSize = "Thin";

		if (this.artSlave.trust > 20)
		{
			result.push("Art_Vector_Revamp_Makeup_Mouth_Happy_" + lipsSize);
			result.push("Art_Vector_Revamp_Mouth_Happy_" + lipsSize);

			if (this.showHeadPiercings)
			{
				if (this.artSlave.lipsPiercing == 1)
					result.push("Art_Vector_Revamp_Head_Mouth_Happy_Piercing");
				else if (this.artSlave.lipsPiercing == 2)
					result.push("Art_Vector_Revamp_Head_Mouth_Happy_Piercing_Heavy");
			}
		}
		else
		{
			result.push("Art_Vector_Revamp_Makeup_Mouth_Angry_" + lipsSize);
			result.push("Art_Vector_Revamp_Mouth_Angry_" + lipsSize);

			if (this.showHeadPiercings)
			{
				if (this.artSlave.lipsPiercing == 1)
					result.push("Art_Vector_Revamp_Head_Mouth_Angry_Piercing");
				else if (this.artSlave.lipsPiercing == 2)
					result.push("Art_Vector_Revamp_Head_Mouth_Angry_Piercing_Heavy");
			}
		}

		return result;
	}

	get headAddonLayer() {
		var result = [];

		if (this.showEyes) {
			switch(this.artSlave.eyewear)
			{
				case "corrective glasses":
				case "glasses":
				case "blurring glasses":
					result.push("Art_Vector_Revamp_Glasses");
					break;
				default:
			}
		}

		if (this.showMouth)
		{
			switch(this.artSlave.collar)
			{
				case "dildo gag":
					result.push("Art_Vector_Revamp_Dildo_Gag");
					break;
				case "bit gag":
					result.push("Art_Vector_Revamp_Bit_Gag");
					break;
				case "ball gag":
					result.push("Art_Vector_Revamp_Ball_Gag");
					break;
				default:

			}
		}
		return result;
	}

	get hairForeLayer() {
		var result = [];

		if (!this.showHair)
			return result;

		if (this.artSlave.hLength == 0)
			return result;

		switch(this.artSlave.hStyle)
		{
			case "neat":
				result.push("Art_Vector_Revamp_Hair_Fore_Neat");
				break;
			case "bun":
			case "up":
			case "tails":
			case "ponytail":
				result.push("Art_Vector_Revamp_Hair_Fore_Bun");
				break;
			case "braided":
				result.push("Art_Vector_Revamp_Hair_Fore_Braids");
				break;
			case "curled":
				result.push("Art_Vector_Revamp_Hair_Fore_Curled");
				break;
			case "cornrows":
				result.push("Art_Vector_Revamp_Hair_Fore_Cornrows");
				break;
			case "strip":
				result.push("Art_Vector_Revamp_Hair_Fore_Shaved_Sides");
				break;
			case "luxurious":
				result.push("Art_Vector_Revamp_Hair_Fore_Luxurious");
				break;
			case "afro":
				result.push("Art_Vector_Revamp_Hair_Fore_Afro");
				break;
			case "permed":
				result.push("Art_Vector_Revamp_Hair_Fore_Permed");
				break;
			case "dreadlocks":
				result.push("Art_Vector_Revamp_Hair_Fore_Dreadlocks");
				break;
			default:
				result.push("Art_Vector_Revamp_Hair_Fore_Messy");
		}

		return result;
	}

	get StylesCss() {
		return this.styleControl.StylesCss;
	}

	get Layers() {
		var layers = [];

		Array.prototype.push.apply(layers, this.hairBackLayer);
		Array.prototype.push.apply(layers, this.armLayer);
		Array.prototype.push.apply(layers, this.buttLayer);
		Array.prototype.push.apply(layers, this.legLayer);
		Array.prototype.push.apply(layers, this.feetLayer);
		Array.prototype.push.apply(layers, this.torsoLayer);
		Array.prototype.push.apply(layers, this.clavicleLayer);
		Array.prototype.push.apply(layers, this.pussyLayer);
		Array.prototype.push.apply(layers, this.pubicLayer);
		Array.prototype.push.apply(layers, this.pussyPiercingsLayer);
		Array.prototype.push.apply(layers, this.chastityBeltLayer);
		Array.prototype.push.apply(layers, this.torsoOutfitLayer);
		Array.prototype.push.apply(layers, this.ballsLayer);
		Array.prototype.push.apply(layers, this.bellyLayer);
		Array.prototype.push.apply(layers, this.penisLayer);
		Array.prototype.push.apply(layers, this.boobLayer);
		Array.prototype.push.apply(layers, this.boobAddonLayer);
		Array.prototype.push.apply(layers, this.collarLayer);
		Array.prototype.push.apply(layers, this.headLayer);
		Array.prototype.push.apply(layers, this.eyesLayer);
		Array.prototype.push.apply(layers, this.mouthLayer);
		Array.prototype.push.apply(layers, this.headAddonLayer);
		Array.prototype.push.apply(layers, this.hairForeLayer);

		return layers;
	}
}

window.getVectorArtRevampedControl = function(artDisplayClass, artSlave, globalShowHighlights, globalShowBodyMods) {
	return new RevampedArtControl(artDisplayClass, artSlave, globalShowHighlights, globalShowBodyMods);
};


code:
:: wombJS [script]

/*
This is womb processor/simulator script. It's take care about calculation of belly sizes based on individual foetus sizes,
with full support of broodmothers implant random turning on and off possibility. Also this can be expanded to store more parents data in each individual fetus in future.
Design limitations:
- Mother can't gestate children with different speeds at same time. All speed changes apply to all fetuses.
- Sizes of inividual fetuses updated only on call of WombGetVolume - not every time as called WombProgress. This is for better overail code speed.
- For broodmothers we need actual "new ova release" code now. But it's possible to control how many children will be added each time, and so - how much children is ready to birth each time.

Usage from sugarcube code (samples):

WombInit($slave) - before first pregnancy, at slave creation, of as backward compatibility update.

WombImpregnate($slave, $fetus_count, $fatherID, $initial_age) - should be added after normal impregnation code, with already calcualted fetus count. ID of father - can be used in future for prcess children from different fathers in one pregnancy. Initial age normally 1 (as .preg normally set to 1), but can be raised if needed. Also should be called at time as broodmother implant add another fetus(es), or if new fetuses added from other sources in future (transplanting maybe?)

WombProgress($slave, $time_to_add_to_fetuses) - after code that update $slave.preg, time to add should be the same.

$isReady = WombBirthReady($slave, $birth_ready_age) - how many children ready to be birthed if their time to be ready is $birth_ready_age (40 is for normal length pregnancy). Return int - count of ready to birth children, or 0 if no ready exists.

$children = WombBirth($slave, $birth_ready_age) - for actual birth. Return array with fetuses objects that birthed (can be used in future) and remove them from womb array of $slave. Should be called at actual birth code in sugarcube. fetuses that not ready remained in womb (array).

WombFlush($slave) - clean womb (array). Can be used at broodmother birthstorm or abortion situations in game. But birthstorm logically should use WombBirth($slave, 35) or so before - some children in this event is live capable, others is not.

$slave.bellyPreg = WombGetWolume($slave) - return double, with current womb volume in CC - for updating $slave.bellyPreg, or if need to update individual fetuses sizes.

*/

window.WombInit = function(actor) //Init womb system.
{

    if (!Array.isArray(actor.womb))
    {
       //alert("creating new womb"); //debugging
	   actor.womb = [];
    }

//    console.log("broodmother:" + typeof actor.broodmother);

    if ( typeof actor.broodmother != "number" )
    {
          actor.broodmother = 0;
          actor.broodmotherFetuses = 0;
    }

    if ( typeof actor.readyOva != "number" )
    {
          actor.readyOva = 0;
    }

    if (actor.womb.length == 0 && actor.pregType != 0 && actor.broodmother == 0) //backward compatibility setup. Fully accurate for normal pregnancy only.
    {
        WombImpregnate(actor, actor.pregType, actor.pregSource, actor.preg);
    }
    else if (actor.womb.length == 0 && actor.pregType != 0 && actor.broodmother > 0 && actor.broodmotherOnHold < 1) //sorry but for already present broodmothers it's impossible to calculate fully, aproximation used.
    {
        var i, pw = actor.preg, bCount, bLeft;
        if (pw > 40)
            pw = 40; //to avoid disaster.
        bCount = Math.floor(actor.pregType/pw);
        bLeft = actor.pregType - (bCount*pw);
        if (pw > actor.pregType)
        {
            pw = actor.pregType // low children count broodmothers not supported here. It's emergency/backward compatibility code, and they not in game anyway. So minimum is 1 fetus in week.
            actor.preg = pw; // fixing initial pregnancy week.
        }
        for (i=0; i<pw; i++)
        {
            WombImpregnate(actor, bCount, actor.pregSource, i); // setting fetuses for every week, up to 40 week at max.
        }

        if (bLeft > 0)
        {
            WombImpregnate(actor, bLeft, actor.pregSource, i+1); // setting up leftower of fetuses.
        }
    }
}

window.WombImpregnate = function(actor, fCount, fatherID, age)
{
    var i;
    var tf;
    for (i=0; i<fCount; i++)
    {
	tf = {}; //new Object
    tf.age = age; //initial age
    tf.fatherID = fatherID; //We can store who is father too.
	tf.sex = Math.round(Math.random())+1; // 1 = male, 2 = female. For possible future usage, just as concept now.
    tf.volume = 1; //Initial, to create property. Updated with actual data after WombGetVolume call.
	tf.identical = 0; //Initial, to create property. Updated with actual data during fetalSplit call.

    try {
            if (actor.womb.length == 0)
            {
                actor.pregWeek = age;
                actor.preg = age;
            }

	        actor.womb.push(tf);
        }catch(err){
            WombInit(actor);
            actor.womb.push(tf);
            alert("WombImpregnate warning - " + actor.slaveName+" "+err);
        }

    }

}

window.WombProgress = function(actor, ageToAdd)
{
    var i, ft;
    ageToAdd = Math.ceil(ageToAdd*10)/10;
    try {
            for (i in actor.womb)
            {
                ft = actor.womb[i];
                ft.age += ageToAdd;
            }
    }catch(err){
            WombInit(actor);
            alert("WombProgress warning - " + actor.slaveName+" "+err);
    }
}

window.WombBirth = function(actor, readyAge)
{
    try{
        WombSort(actor); //For normal processing fetuses that more old should be first. Now - they are.
        }catch(err){
            WombInit(actor);
            alert("WombBirth warning - " + actor.slaveName+" "+err);
        }

    var birthed = [];
    var ready = WombBirthReady(actor, readyAge);
    var i;

    for (i=0; i<ready; i++) //here can't be used "for .. in .." syntax.
    {
        birthed.push(actor.womb.shift());
    }

    return birthed;
}

window.WombFlush = function(actor)
{
    actor.womb = [];
}

window.WombBirthReady = function(actor, readyAge)
{

    var i, ft;
    var readyCnt = 0;
    try {
        for (i in actor.womb)
        {
            ft = actor.womb[i];
            if (ft.age >= readyAge)
                  readyCnt++;
        }
    }catch(err){
        WombInit(actor);
        alert("WombBirthReady warning - " + actor.slaveName+" "+err);

        return 0;
    }

    return readyCnt;
}

window.WombGetVolume = function(actor) //most code from pregJS.tw with minor adaptation.
{
    var i, ft;
    var gestastionWeek;
    var phi = 1.618;
    var targetLen;
    var wombSize = 0;

    try{

        for (i in actor.womb)
        {
            ft = actor.womb[i];
            gestastionWeek = ft.age;

            if (gestastionWeek <= 32)
            {
                targetLen = (0.00006396 * Math.pow(gestastionWeek, 4)) - (0.005501 * Math.pow(gestastionWeek, 3)) + (0.161 * Math.pow(gestastionWeek, 2)) - (0.76 * gestastionWeek) + 0.208;
            }
            else if (gestastionWeek <= 106)
            {
                targetLen = (-0.0000004675 * Math.pow(gestastionWeek, 4)) + (0.0001905 * Math.pow(gestastionWeek, 3)) - (0.029 * Math.pow(gestastionWeek, 2)) + (2.132 * gestastionWeek) - 16.575;
            }
            else
            {
                targetLen = (-0.00003266 * Math.pow(gestastionWeek,2)) + (0.076 * gestastionWeek) + 43.843;
            }

            ft.volume = ((4 / 3) * (Math.PI) * (phi / 2) * (Math.pow((targetLen / 2), 3)));

            wombSize += ft.volume;
        }
    }catch(err){
        WombInit(actor);
        alert("WombGetVolume warning - " + actor.slaveName + " " + err);
    }

    if (wombSize < 0) //catch for strange cases, to avoid messing with outside code.
        wombSize = 0;

    return wombSize;
}

window.WombUpdatePregVars = function(actor) {

    WombSort(actor);
    if (actor.womb.length > 0)
    {
        if (actor.preg > 0 && actor.womb[0].age > 0)
        {
            actor.preg = actor.womb[0].age;
        }

        actor.pregType = actor.womb.length;

        actor.bellyPreg = WombGetVolume(actor);

    }

}

window.WombMinPreg = function(actor)
{
    WombSort(actor);

    if (actor.womb.length > 0)
        return actor.womb[actor.womb.length-1].age;
    else
        return 0;
}

window.WombMaxPreg = function(actor)
{
    WombSort(actor);
    if (actor.womb.length > 0)
        return actor.womb[0].age;
    else
        return 0;
}

window.WombNormalizePreg = function(actor)
{
//    console.log("New actor: " + actor.slaveName + " ===============" + actor.name);
    WombInit(actor);

    if (actor.womb.length == 0 && actor.broodmother >= 1) // this is broodmother on hold.
    {
        actor.pregType = 0;
        actor.pregKnown = 0;

        if (actor.preg >= 0)
            actor.preg = 0.1; //to avoid legacy code conflicts - broodmother on hold can't be impregnated, but she not on normal contraceptives. So we set this for special case.

        if (actor.pregSource > 0)
            actor.pregSource = 0;

        if (actor.pregWeek > 0)
            actor.pregWeek = 0;

        actor.broodmotherCountDown = 0;
    }

    if (actor.womb.length > 0)
    {
        var max = WombMaxPreg(actor);
//        console.log("max: " + max);
//        console.log(".preg: "+ actor.preg);
        if (actor.pregWeek < 1 )
            actor.pregWeek = 1

        if (max < actor.preg)
        {
            WombProgress(actor, actor.preg - max);
//            console.log("progressin womb");
        }
        else if ( max > actor.preg)
        {
            actor.preg = max;
//            console.log("advancing .preg");
        }

        actor.pregType = actor.womb.length;
        actor.pregSource = actor.womb[0].fatherID;
    }
    else if (actor.womb.length == 0 && actor.broodmother < 1) //not broodmother
    {
//        console.log("preg fixing");
        actor.pregType = 0;
        actor.pregKnown = 0;

        if (actor.preg > 0)
            actor.preg = 0;

        if (actor.pregSource > 0)
            actor.pregSource = 0;

        if (actor.pregWeek > 0) // We can't properly set postpartum here, but can normalize obvious error with forgotten property.
            actor.pregWeek = 0;
    }

    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);
}

/* Sorts the womb object by age with oldest and thus soonest to be born, first. This will be needed in the future once individual fertilization is a possiblity.*/
window.WombSort = function(actor)
{
	actor.womb.sort(function (a, b){return b.age - a.age});
}

window.fetalSplit = function(actor)
{
	var i, ft;
	var nft = {};
    nft.age = actor.preg;
    nft.fatherID = actor.pregSource;
	nft.sex = Math.round(Math.random())+1;
    nft.volume = 1;
	nft.identical = 0;

	actor.womb.forEach(function(s){
		if ((jsRandom(1,1000) >= 1000) && s.identical !== 1)
		{
			nft = {};
			nft.age = s.age;
			nft.fatherID = s.fatherID;
			nft.sex = s.sex;
			nft.volume = s.volume;
			actor.womb.push(nft);
			s.identical = 1;
		}
	});
	WombNormalizePreg(actor);

}

/* alt
window.fetalSplit = function(actor)
{
	var i, ft, nft;

	actor.womb.forEach(function(s){
		if ((jsRandom(1,1000) >= 1000) && s.identical !== 1)
		{
			nft = deepCopy(s);
			actor.womb.push(nft);
			s.identical = 1;
		}
	});
	WombNormalizePreg(actor);

}
*/

repo_name: Anony/fc


code:
:: Abort [nobr]

<<set $nextButton = "Back", $nextLink = "Slave Interact">>
<<ClearSummaryCache $activeSlave>>

The remote surgery makes aborting a pregnancy quick and efficient. $activeSlave.slaveName is
<<if $activeSlave.fetish == "pregnancy">>
	@@.red;fundamentally broken.@@ Her entire concept of self and sexuality was wrapped up in the life growing within her, and now it is gone.
	<<set $activeSlave.fetish = "mindbroken">>
<<elseif $activeSlave.devotion < -50>>
	@@.mediumorchid;filled with violent, consuming hatred@@. Even though she knew her baby was destined for a slave orphanage, it seems she cared for it and views you as its killer. She is @@.gold;terrified of your power@@ over her body.
	<<set $activeSlave.trust -= 10, $activeSlave.devotion -= 25>>
<<elseif $activeSlave.devotion < -20>>
	@@.mediumorchid;afflicted by desperate, inconsolable sobbing@@. Even though she knew her baby was destined for a slave orphanage, it seems she cared for it. She is @@.gold;terrified of your power@@ over her body.
	<<set $activeSlave.trust -= 10, $activeSlave.devotion -= 10>>
<<elseif $activeSlave.devotion <= 20>>
	@@.mediumorchid;consumed by muted weeping and enduring sorrow@@. Even though she knew her baby was destined for a slave orphanage, it seems she cared for it. She is @@.gold;terrified of your power@@ over her body.
	<<set $activeSlave.trust -= 10, $activeSlave.devotion -= 5>>
<<elseif $activeSlave.devotion <= 50>>
	dully obedient. She has been broken to slave life so thoroughly that even this is neither surprising nor affecting. She is @@.gold;terrified of your power@@ over her body.
	<<set $activeSlave.trust -= 10>>
<<else>>
	@@.hotpink;pleased by this stark development@@, since she is so attentive to your will. She also expects she'll be able to fuck better now.
	<<set $activeSlave.devotion += 4>>
<</if>>

<<if lastPregRule($activeSlave,$defaultRules)>><<set $activeSlave.preg = -1>><<else>><<set $activeSlave.preg = 0>><</if>>

<<if $activeSlave.reservedChildren > 0>>
	<<set $reservedChildren -= $activeSlave.reservedChildren>>
<</if>>
<<set $activeSlave.pregType = 0>>
<<set $activeSlave.pregSource = 0>>
<<set $activeSlave.pregKnown = 0>>
<<set $activeSlave.pregWeek = -2>>
<<set WombFlush($activeSlave)>>
<<SetBellySize $activeSlave>>


code:
:: Acquisition [nobr]

<<unset $slaveWithoutBonuses, $startingGirlCopied, $startingGirlRelation>>

<<set $fixedNationality = 0, $encyclopedia = " ">>

<<if $saveImported == 1>><<set _valueOwed = 5000>><<else>><<set _valueOwed = 50000>><</if>>
<<if $freshPC == 1 || $saveImported == 0>>
	<<if $PC.vagina == 1>>
		<<set $PC.births = 0>>
		<<if $PC.career == "servant">>
			<<if $PC.actualAge >= 50 >>
				<<set $PC.births = 9>>
				<<set $PC.birthMaster = 9>>
			<<elseif $PC.actualAge >= 35>>
				<<set $PC.births = 6>>
				<<set $PC.birthMaster = 6>>
			<<else>>
				<<set $PC.births = 3>>
				<<set $PC.birthMaster = 3>>
			<</if>>
			<<for $i = 0; $i < $slaves.length; $i++>>
				<<if $slaves[$i].origin == "She was another of your late master's servants. She spent nine months in your womb, courtesy of your master." || $slaves[$i].origin == "Your late master took pleasure in using his servants in creative ways. He inseminated you with your own sperm, and nine months later, your daughter was born.">>
				<<set $PC.births += 1>>
				<<set $PC.birthMaster += 1>>
				<</if>>
			<</for>>
		<<elseif $PC.career == "escort">>
			<<for $i = 0; $i < $slaves.length; $i++>>
				<<if $slaves[$i].origin == "She was the result of unprotected sex with a client. He paid you quite well to enjoy your body as you grew heavy with his child." || $slaves[$i].origin == "A client paid you a large sum of credits to prove you could literally fuck yourself. She is the result of that lucrative night.">>
				<<set $PC.births += 1>>
				<<set $PC.birthClient += 1>>
				<</if>>
			<</for>>
		<<else>>
			<<for $i = 0; $i < $slaves.length; $i++>>
				<<if $slaves[$i].mother == -1>>
				<<set $PC.births += 1>>
				<<set $PC.birthOther += 1>>
				<</if>>
			<</for>>
		<</if>>
		<<if $PC.preg > 0>>
			<<set $PC.pregWeek = $PC.preg>>
			<<set $PC.pregType = 1>>
			<<if $PC.career == "servant">>
				<<set $PC.pregSource = -3>>
				<<set $PC.pregType += random(0,0,1)>>
			<<elseif $PC.career == "escort">>
				<<set $PC.pregSource = -2>>
			<</if>>
			<<set $PC.pregKnown = 1>>
			<<set $PC.belly = getPregBellySize($PC)>>
			<<set WombImpregnate($PC, $PC.pregType, $PC.pregSource, $PC.preg)>>
		<</if>>
	<</if>>
	<<set $PC.ovaryAge = $PC.physicalAge>>
<<else>> /*testtest*/
	<<set $PC.sisters = 0>>
	<<set $PC.daughters = 0>>
<</if>> /*closes ng*/
<<if $familyTesting == 1>>
	<<set _pcMomFound = 0, _pcDadFound = 0>>
	<<if def $slaveIndices[$PC.mother]>>
		<<set _pcMomFound = 1>>
	<</if>>
	<<if def $slaveIndices[$PC.father]>>
		<<set _pcDadFound = 1>>
	<</if>>
	<<for _i = 0; _i < $slaves.length; _i++>>
		<<if $slaves[_i].mother == $PC.ID || $slaves[_i].father == $PC.ID>>
			<<set $PC.daughters += 1>>
		<</if>>
		<<if areSisters($slaves[_i], $PC) > 0>>
			<<set $PC.sisters += 1>>
		<</if>>
	<</for>>
	<<if _pcMomFound == 0 && $PC.mother > 0>>
		<<set _lostMom = $PC.mother>>
		<<set $PC.mother = $missingParentId>>
		<<for _i = 0; _i < $slaves.length; _i++>>
			<<if $slaves[_i].mother == _lostMom>>
				<<set $slaves[_i].mother = $missingParentId>>
			<</if>>
		<</for>>
		<<set $missingParentId-->>
	<</if>>
	<<if _pcDadFound == 0 && $PC.father > 0>>
		<<set _lostDad = $PC.father>>
		<<set $PC.father = $missingParentId>>
		<<for _i = 0; _i < $slaves.length; _i++>>
			<<if $slaves[_i].father == _lostDad>>
				<<set $slaves[_i].father = $missingParentId>>
			<</if>>
		<</for>>
		<<set $missingParentId-->>
	<</if>>
	<<for _i = 0; _i < $slaves.length; _i++>>
		<<set _slaveMomFound = 0, _slaveDadFound = 0>>
		<<if def $slaveIndices[$slaves[_i].mother]>>
			<<set _slaveMomFound = 1>>
		<</if>>
		<<if def $slaveIndices[$slaves[_i].father]>>
			<<set _slaveDadFound = 1>>
		<</if>>
		<<if _slaveMomFound == 0 && $slaves[_i].mother > 0>>
			<<set _lostMom = $slaves[_i].mother>>
			<<set $slaves[_i].mother = $missingParentID>>
			<<for _j = 0; _j < $slaves.length; _j++>>
				<<if $slaves[_j].mother == _lostMom>>
					<<set $slaves[_j].mother = $missingParentID>>
				<</if>>
			<</for>>
			<<set $missingParentID-->>
		<</if>>
		<<if _slaveDadFound == 0 && $slaves[_i].father > 0>>
			<<set _lostDad = $slaves[_i].father>>
			<<set $slaves[_i].father = $missingParentID>>
			<<for _j = 0; _j < $slaves.length; _j++>>
				<<if $slaves[_j].father == _lostDad>>
					<<set $slaves[_j].father = $missingParentID>>
				<</if>>
			<</for>>
			<<set $missingParentID-->>
		<</if>>
	<</for>>
<</if>>

You've done it.

You arrive at your new arcology, $arcologies[0].name, and head straight to the penthouse to enter the access codes that will tell the $arcologies[0].name systems to recognize you as their owner. The penthouse office is ready to receive the codes, and they authenticate. A voice activates in your earpiece.

//Congratulations. I am a personal assistant program, and it is my pleasure to assist you,
<<PlayerName>>
the new owner of $arcologies[0].name. I will offer useful information whenever possible in italics. Your new arcology has some unusual equipment. The previous owner kept a small stable of sex slaves. The penthouse therefore has a body modification studio for tattooing, bleaching and piercing, and an auto salon for more prosaic things like hair care. It also has a remote surgery, a small surgical theater that can be operated remotely by a qualified surgeon if you can pay the fee. Finally, it has a slave nutrition system connected to the arcology's hydroponics bays. This system produces a tasty protein-rich drink that provides the physically active female body all its necessary nutrients while leaving the lower digestive tract extremely clean. It even causes a mild increase in sex drive.

The previous owner seems to have left in something of a hurry.
<<if $cheatMode == 1>>
	Since you've elected to take over an arcology with special advantages, you've acquired a very special group of slaves.
<<elseif $saveImported == 1>>
	Since it took some time for you to ensure that your existing stable of slaves were safely moved to $arcologies[0].name, the previous owner had the time to get most of their things away.
<<elseif ($targetArcology.type != "New") && ($targetArcology.type != "Multiculturalist")>>
	<<switch $targetArcology.type>>
	<<case "Supremacist">>
		They kept a personal stable of fearful $arcologies[0].FSSupremacistRace sex slaves, but their sexual training is incomplete. Several of them are still here.
	<<case "Subjugationist">>
		They made it a special goal to enslave and whore out as many $arcologies[0].FSSubjugationistRace people as possible. Several of them are still here.
	<<case "GenderRadicalist">>
		They were in the process of building a stable of pretty young shemale whores. Several of them are still here. They're are all very attracted to men, and skilled at pleasing them.
	<<case "GenderFundamentalist">>
		They kept a personal stable of slaves for breeding purposes. Several of them are still here. They've been kept pregnant, and work as servants when they aren't being bred.
	<<case "Paternalist">>
		Their slaves were all very well treated. Several of them are still here. They were allowed to work as maids, and weren't even forced to have sex.
	<<case "Degradationist">>
		Their personal slaves were all Fuckdolls, slaves who have been permanently encased in advanced latex suits and converted into living sex toys. Several of them are still here.
	<<case "AssetExpansionist">>
		They kept a collection of bejeweled boobs for company, but they focused on breast expansion to the exclusion the slaves' emotional training. Several of them are still here.
	<<case "SlimnessEnthusiast">>
		They kept a harem of slim, pretty girls, and treated them very well. Several of them are still here. They should be very trusting of a new owner.
	<<case "TransformationFetishist">>
		They were just putting the finishing touches on a planned brothel's worth of surgically enhanced whores. Several of them are still here. They are already used to prostitution.
	<<case "BodyPurist">>
		Their slaves were trained for sexual use, but their health, fitness, and natural appearance were the main priorities. Several of them are still here.
	<<case "MaturityPreferentialist">>
		They preferred to keep their MILFs as scantily clad servants. Several of them are still here. They aren't all happy to be sex objects, but they're used to it.
	<<case "YouthPreferentialist">>
		They treated their young slaves very well. Several of them are still here. Virgins have been carefully preserved, but have learned to use their mouths through experience.
	<<case "Pastoralist">>
		Their herd of cow girls was progressing nicely, though more progress had been made on milk production than on training. Several of them are still here.
	<<case "PhysicalIdealist">>
		Their slaves worked as prostitutes, but mostly to fund a program of muscle building for all of them, which was nearing completion. Several of them are still here.
	<<case "ChattelReligionist">>
		They were recruiting a stable of slave whores by targeting people with religious complexes that made them particularly vulnerable to recruitment. Several of them are still here.
	<<case "RomanRevivalist">>
		The only one of their slaves left is the bodyguard. She should be very willing to transfer her loyalty to you, as her new owner.
	<<case "AztecRevivalist">>
		They maintained a combination of disobedient slaves, deemed incorrigible and blood priestesses. Since they offer themselves as slaves willingly, one has remained loyal to the owner of the arcology.
	<<case "EgyptianRevivalist">>
		They kept a harem of beautiful slave girls, who have been well-treated and well-trained. They should be very willing to serve you in turn.
	<<case "EdoRevivalist">>
		They put considerable effort into creating modern slave geisha, elegant Japanese slaves who were assigned to serve the public. Several of them are still here.
	<<case "ArabianRevivalist">>
		They trained slaves personally, and never kept slaves for very long. The slaves they left are all partway through being trained.
	<<case "ChineseRevivalist">>
		The only one of their slaves left is the Head Girl. She should be willing to transfer her loyalty to you, as her proper superior.
	<<case "Eugenics">>
		The only one of their slaves left is an absolute beauty of a girl. She is too smart for her own good and will likely not trust you.
	<<case "Repopulationist">>
		They kept a personal stable of slaves for breeding purposes. Several of them are still here. They've been kept heavily pregnant, and are used to being used whilst so.
	<<case "HedonisticDecadence">>
		Their slaves were heavily pampered; free to lie about, fuck, and eat as much as they wanted. Several of them are still here, too lazy and spoiled to leave. They eagerly paw at you upon your arrival, begging for their bellies to be filled with food and for a good, hard fucking.
	<<default>>
		ERROR: bad arcology type
	<</switch>>
<<else>>
	They could not get all of their personal effects away. Since they <<if $targetArcology.type == "Multiculturalist">>tried to sample different kinds of sexual slavery<<else>>did not have the time in control of the arcology to develop a specific stable of sex slaves<</if>>, their slaves were quite varied.
<</if>>

<<set $heroSlaves = $heroSlaves.shuffle()>>
<<set _valueGiven = 0>>
<<if $cheatMode == 1>>
	<<include [[Cheatmode Database]]>>
<<elseif $saveImported == 1>>
<<elseif ($targetArcology.type != "New") && ($targetArcology.type != "Multiculturalist")>>
	<<for $j = 0; $j < 5; $j++>>
	<<if _valueOwed - _valueGiven <= 5000>><<break>><</if>>
	<<switch $targetArcology.type>>
	<<case "Supremacist">>
		<<set $arcologies[0].FSSupremacistLawME = 1>><<include "Generate New Slave">><<set $arcologies[0].FSSupremacistLawME = 0>>
		<<set $activeSlave.devotion = random(25,45), $activeSlave.trust = random(-25,-45), $activeSlave.health = random(0,15)>>
		<<set $activeSlave.face = random(15,100)>>
		<<set $activeSlave.oralSkill = random(15,35), $activeSlave.analSkill = random(15,35)>>
		<<if $activeSlave.vagina > -1>>
			<<if $activeSlave.vagina == 0>><<set $activeSlave.vagina++>><</if>>
			<<set $activeSlave.vaginalSkill = random(15,35)>>
		<</if>>
		<<set $activeSlave.entertainSkill = random(15,35)>>
		<<set $activeSlave.clothes = "uncomfortable straps", $activeSlave.collar = "uncomfortable leather", $activeSlave.shoes = "flats">>
		<<set $activeSlave.assignment = "please you">>
	<<case "Subjugationist">>
		<<set $fixedRace = $activeArcology.FSSubjugationistRace>><<include "Generate New Slave">><<set $fixedRace = 0>>
		<<set $activeSlave.devotion = random(25,45), $activeSlave.trust = random(-25,-45), $activeSlave.health = random(0,15)>>
		<<set $activeSlave.face = random(15,100)>>
		<<set $activeSlave.oralSkill = random(15,35), $activeSlave.analSkill = random(15,35)>>
		<<if $activeSlave.vagina > -1>>
			<<if $activeSlave.vagina == 0>><<set $activeSlave.vagina++>><</if>>
			<<set $activeSlave.vaginalSkill = random(15,35)>>
		<</if>>
		<<set $activeSlave.whoreSkill = random(15,35)>>
		<<set $activeSlave.clothes = "uncomfortable straps", $activeSlave.collar = "uncomfortable leather", $activeSlave.shoes = "flats">>
		<<set $activeSlave.assignment = "whore">>
	<<case "GenderRadicalist">>
		<<set $activeSlaveOneTimeMaxAge = 25>>
		<<include "Generate XY Slave">>
		<<set $activeSlave.devotion = random(25,45), $activeSlave.trust = random(15,-15), $activeSlave.health = 100>>
		<<set $activeSlave.face = random(0,55)>>
		<<set $activeSlave.boobs += 100*random(2,4)>>
		<<set $activeSlave.butt += random(1,2)>>
		<<set $activeSlave.attrXY = random(70,90), $activeSlave.attrXX = 0>>
		<<set $activeSlave.oralSkill = random(35,65), $activeSlave.analSkill = random(35,65), $activeSlave.whoreSkill = random(35,65)>>
		<<SoftenSexualFlaw $activeSlave>>
		<<set $activeSlave.clothes = "uncomfortable straps", $activeSlave.collar = "stylish leather", $activeSlave.shoes = "heels">>
		<<set $activeSlave.assignment = "whore">>
	<<case "GenderFundamentalist">>
		<<set $activeSlaveOneTimeMinAge = $fertilityAge>>
		<<set $activeSlaveOneTimeMaxAge = 25>>
		<<include "Generate XX Slave">>
		<<set $activeSlave.devotion = random(25,45), $activeSlave.trust = random(-25,-45), $activeSlave.health = random(55,65)>>
		<<set $activeSlave.face = random(15,100)>>
		<<set $activeSlave.preg = random(1,40), $activeSlave.lactation = 1>>
		<<SetBellySize $activeSlave>>
		<<if $activeSlave.vagina > -1>>
			<<if $activeSlave.vagina == 0>><<set $activeSlave.vagina++>><</if>>
			<<set $activeSlave.vaginalSkill = random(15,35)>>
		<</if>>
		<<set $activeSlave.clothes = "a nice maid outfit", $activeSlave.collar = "tight steel", $activeSlave.shoes = "flats">>
		<<set $activeSlave.assignment = "be a servant">>
	<<case "Paternalist">>
		<<include "Generate New Slave">>
		<<set $activeSlave.devotion = random(25,45), $activeSlave.trust = random(55,65), $activeSlave.health = random(55,65)>>
		<<set $activeSlave.face = random(15,100)>>
		<<set $activeSlave.intelligence = random(1,3), $activeSlave.intelligenceImplant = 1>>
		<<set $activeSlave.entertainSkill = random(15,35)>>
		<<set $activeSlave.clothes = "conservative clothing", $activeSlave.collar = "none", $activeSlave.shoes = "flats">>
		<<set $activeSlave.assignment = "be a servant">>
	<<case "Degradationist">>
		<<include "Generate New Slave">>
		<<set $activeSlave.devotion = 25, $activeSlave.trust = -25, $activeSlave.health = random(0,15)>>
		<<set $activeSlave.fuckdoll = 100>>
		<<set $activeSlave.career = "a Fuckdoll">>
		<<set $activeSlave.fetish = "mindbroken">>
		<<set $activeSlave.boobs += 100*random(10,20)>>
		<<set $activeSlave.butt += random(2,3)>>
		<<set $activeSlave.lips = random(2,4)>>
		<<set $activeSlave.weight = random(-15,15)>>
		<<set $activeSlave.oralSkill = 0, $activeSlave.analSkill = 0, $activeSlave.vaginalSkill = 0, $activeSlave.entertainSkill = 0, $activeSlave.whoreSkill = 0>>
		<<set $activeSlave.behavioralFlaw = "none", $activeSlave.sexualFlaw = "none">>
		<<set $activeSlave.clothes = "a Fuckdoll suit">>
		<<set $activeSlave.assignment = "please you">>
	<<case "AssetExpansionist">>
		<<include "Generate New Slave">>
		<<set $activeSlave.devotion = random(25,45), $activeSlave.trust = random(-15,15), $activeSlave.health = random(25,45)>>
		<<set $activeSlave.chem = 50>>
		<<set $activeSlave.face = random(15,100)>>
		<<set $activeSlave.boobs += 100*random(10,20)>>
		<<set $activeSlave.butt += random(2,3)>>
		<<set $activeSlave.lips += random(0,1)>>
		<<if $activeSlave.balls > 0>><<set $activeSlave.balls++>><</if>>
		<<if $activeSlave.dick > 0>><<set $activeSlave.dick++>><</if>>
		<<set $activeSlave.weight = random(15,90)>>
		<<set $activeSlave.oralSkill = random(15,35), $activeSlave.analSkill = 0, $activeSlave.anus = 0>>
		<<if $activeSlave.vagina > -1>>
			<<if $activeSlave.vagina == 0>><<set $activeSlave.vagina++>><</if>>
			<<set $activeSlave.vaginalSkill = random(15,35)>>
		<</if>>
		<<set $activeSlave.entertainSkill = random(15,35)>>
		<<set $activeSlave.clothes = "slutty jewelry", $activeSlave.collar = "pretty jewelry", $activeSlave.shoes = "heels">>
		<<set $activeSlave.assignment = "please you">>
	<<case "SlimnessEnthusiast">>
		<<include "Generate New Slave">>
		<<set $activeSlave.devotion = random(25,45), $activeSlave.trust = random(55,65), $activeSlave.health = random(55,65)>>
		<<set $activeSlave.face = random(15,100)>>
		<<set $activeSlave.boobs = 100*random(1,4)>>
		<<set $activeSlave.butt = random(1,2)>>
		<<set $activeSlave.weight = random(-25,-15)>>
		<<set $activeSlave.oralSkill = random(15,35), $activeSlave.analSkill = 0, $activeSlave.anus = 0>>
		<<if $activeSlave.vagina > -1>>
			<<if $activeSlave.vagina == 0>><<set $activeSlave.vagina++>><</if>>
			<<set $activeSlave.vaginalSkill = random(15,35)>>
		<</if>>
		<<set $activeSlave.entertainSkill = random(15,35)>>
		<<set $activeSlave.clothes = "a leotard", $activeSlave.collar = "pretty jewelry", $activeSlave.shoes = "flats">>
		<<set $activeSlave.assignment = "please you">>
	<<case "TransformationFetishist">>
		<<include "Generate New Slave">>
		<<set $activeSlave.devotion = random(25,45), $activeSlave.trust = random(-15,15), $activeSlave.health = random(-15,0)>>
		<<set $activeSlave.faceImplant = random(40,70)>>
		<<set $activeSlave.face = Math.trunc($activeSlave.face+$activeSlave.faceImplant/2,-100,100)>>
		<<set $activeSlave.boobsImplant = 200*random(4,8)>>
		<<set $activeSlave.boobs += $activeSlave.boobsImplant>>
		<<set $activeSlave.buttImplant = random(2,4)>>
		<<set $activeSlave.butt += $activeSlave.buttImplant>>
		<<set $activeSlave.lipsImplant = random(1,2)>>
		<<set $activeSlave.lips = Math.trunc($activeSlave.lipsImplant+2,-3,3)>>
		<<set $activeSlave.weight = random(-25,-15)>>
		<<set $activeSlave.oralSkill = random(15,35), $activeSlave.analSkill = random(15,35)>>
		<<if $activeSlave.vagina > -1>>
			<<if $activeSlave.vagina == 0>><<set $activeSlave.vagina++>><</if>>
			<<set $activeSlave.vaginalSkill = random(15,35)>>
		<</if>>
		<<set $activeSlave.clothes = "a string bikini", $activeSlave.collar = "shock punishment", $activeSlave.shoes = "extreme heels">>
		<<set $activeSlave.assignment = "whore">>
	<<case "BodyPurist">>
		<<include "Generate New Slave">>
		<<set $activeSlave.devotion = random(55,65), $activeSlave.trust = random(25,45), $activeSlave.health = 100>>
		<<set $activeSlave.face = random(15,100)>>
		<<set $activeSlave.weight = random(-5,5)>>
		<<set $activeSlave.muscles = random(10,25)>>
		<<set $activeSlave.oralSkill = random(15,35), $activeSlave.analSkill = random(15,35)>>
		<<if $activeSlave.vagina > -1>>
			<<if $activeSlave.vagina == 0>><<set $activeSlave.vagina++>><</if>>
			<<set $activeSlave.vaginalSkill = random(15,35)>>
		<</if>>
		<<set $activeSlave.clothes = "a nice maid outfit", $activeSlave.collar = "pretty jewelry", $activeSlave.shoes = "heels">>
		<<set $activeSlave.assignment = "be a servant">>
	<<case "MaturityPreferentialist">>
		<<set $activeSlaveOneTimeMinAge = 36>>
		<<set $activeSlaveOneTimeMaxAge = 39>>
		<<set $one_time_age_overrides_pedo_mode = 1>>
		<<include "Generate New Slave">>
		<<set $activeSlave.devotion = random(55,65), $activeSlave.trust = random(-15,15), $activeSlave.health = random(25,45)>>
		<<set $activeSlave.face = random(15,100)>>
		<<set $activeSlave.boobs += 100*random(1,4)>>
		<<set $activeSlave.butt += random(1,2)>>
		<<set $activeSlave.weight = random(-5,90)>>
		<<set $activeSlave.oralSkill = random(15,35), $activeSlave.analSkill = random(15,35)>>
		<<if $activeSlave.vagina > -1>>
			<<if $activeSlave.vagina == 0>><<set $activeSlave.vagina++>><</if>>
			<<set $activeSlave.vaginalSkill = random(15,35)>>
		<</if>>
		<<SoftenBehavioralFlaw $activeSlave>>
		<<set $activeSlave.clothes = "a slutty maid outfit", $activeSlave.collar = "pretty jewelry", $activeSlave.shoes = "heels">>
		<<set $activeSlave.assignment = "be a servant">>
	<<case "YouthPreferentialist">>
		<<set $activeSlaveOneTimeMaxAge = 19>>
		<<include "Generate New Slave">>
		<<set $activeSlave.devotion = random(25,45), $activeSlave.trust = random(55,65), $activeSlave.health = random(25,45)>>
		<<set $activeSlave.face = random(15,100)>>
		<<set $activeSlave.boobs = 100*random(1,4)>>
		<<set $activeSlave.butt = random(1,3)>>
		<<set $activeSlave.weight = random(-25,25)>>
		<<set $activeSlave.oralSkill = random(15,35), $activeSlave.analSkill = 0, $activeSlave.anus = 0>>
		<<if $activeSlave.vagina > -1>><<set $activeSlave.vaginalSkill = 0, $activeSlave.vagina = 0>><</if>>
		<<set $activeSlave.entertainSkill = random(15,35)>>
		<<set $activeSlave.clothes = "a schoolgirl outfit", $activeSlave.collar = "pretty jewelry", $activeSlave.shoes = "heels">>
		<<set $activeSlave.assignment = "be a servant">>
	<<case "Pastoralist">>
		<<include "Generate New Slave">>
		<<set $activeSlave.devotion = random(25,45), $activeSlave.trust = random(-25,-45), $activeSlave.health = random(25,45)>>
		<<set $activeSlave.boobs += 100*random(10,20)>>
		<<if $activeSlave.balls > 0>><<set $activeSlave.balls++>><</if>>
		<<set $activeSlave.lactation = 2>>
		<<set $activeSlave.clothes = "Western clothing", $activeSlave.collar = "leather with cowbell", $activeSlave.shoes = "flats">>
		<<set $activeSlave.assignment = "get milked">>
	<<case "PhysicalIdealist">>
		<<include "Generate New Slave">>
		<<set $activeSlave.devotion = random(25,45), $activeSlave.trust = random(25,45), $activeSlave.health = 100>>
		<<set $activeSlave.muscles = random(50,100)>>
		<<set $activeSlave.oralSkill = random(15,35), $activeSlave.analSkill = random(15,35)>>
		<<if $activeSlave.vagina > -1>>
			<<if $activeSlave.vagina == 0>><<set $activeSlave.vagina++>><</if>>
			<<set $activeSlave.vaginalSkill = random(15,35)>>
		<</if>>
		<<set $activeSlave.whoreSkill = random(15,35)>>
		<<set $activeSlave.clothes = "body oil", $activeSlave.collar = "none", $activeSlave.shoes = "none">>
		<<set $activeSlave.assignment = "whore">>
	<<case "ChattelReligionist">>
		<<include "Generate New Slave">>
		<<set $activeSlave.devotion = random(55,65), $activeSlave.trust = random(55,65), $activeSlave.health = random(0,15)>>
		<<if $activeSlave.vagina == 0>><<set $activeSlave.vagina++>><</if>>
		<<set $activeSlave.whoreSkill = random(10,20)>>
		<<set $activeSlave.behavioralFlaw = "none", $activeSlave.behavioralQuirk = "sinful">>
		<<set $activeSlave.clothes = "a chattel habit", $activeSlave.collar = "heavy gold", $activeSlave.shoes = "flats">>
		<<set $activeSlave.assignment = "whore">>
	<<case "RomanRevivalist">>
		<<set $activeSlaveOneTimeMaxAge = 19>>
		<<include "Generate New Slave">>
		<<set $activeSlave.devotion = 100, $activeSlave.trust = random(55,65), $activeSlave.health = 100>>
		<<set $activeSlave.face = random(0,55)>>
		<<set $activeSlave.muscles = random(25,50)>>
		<<set $activeSlave.combatSkill = 1>>
		<<set $activeSlave.behavioralFlaw = "none", $activeSlave.behavioralQuirk = "fitness">>
		<<set $activeSlave.behavioralFlaw = "none">>
		<<set $activeSlave.clothes = "a toga", $activeSlave.collar = "pretty jewelry", $activeSlave.shoes = "flats">>
		<<set $activeSlave.assignment = "guard you", $Bodyguard = $activeSlave>>
	<<case "AztecRevivalist">>
		<<set $fixedRace = "latina">><<include "Generate New Slave">><<set $fixedRace = 0>>
		<<set $activeSlave.nationality = "Mexican">>
		<<NationalityToName $activeSlave>>
		<<set $activeSlave.accent = 0>>
		<<set $activeSlave.devotion = 75, $activeSlave.trust = 75, $activeSlave.health = random(-20,20)>>
		<<set $activeSlave.muscles = random(50,75)>>
		<<set $activeSlave.combatSkill = 1>>
		<<set $activeSlave.behavioralFlaw = "malicious", $activeSlave.behavioralQuirk = "none">>
		<<set $activeSlave.clothes = "a huipil", $activeSlave.collar = "pretty jewelry", $activeSlave.shoes = "none">>
		<<set $activeSlave.assignment = "be your Head Girl", $HeadGirl = $activeSlave>>
	<<case "EgyptianRevivalist">>
		<<include "Generate New Slave">>
		<<set $activeSlave.devotion = random(25,45), $activeSlave.trust = random(25,45), $activeSlave.health = random(25,45)>>
		<<set $activeSlave.face = random(15,100)>>
		<<set $activeSlave.oralSkill = random(15,35), $activeSlave.analSkill = random(15,35)>>
		<<if $activeSlave.vagina > -1>>
			<<if $activeSlave.vagina == 0>><<set $activeSlave.vagina++>><</if>>
			<<set $activeSlave.vaginalSkill = random(15,35)>>
		<</if>>
		<<set $activeSlave.entertainSkill = random(15,35)>>
		<<SoftenSexualFlaw $activeSlave>>
		<<set $activeSlave.clothes = "slutty jewelry", $activeSlave.collar = "ancient Egyptian", $activeSlave.shoes = "flats">>
		<<set $activeSlave.assignment = "please you">>
	<<case "EdoRevivalist">>
		<<set $fixedRace = "asian">><<include "Generate New Slave">><<set $fixedRace = 0>>
		<<set $activeSlave.nationality = "Japanese">>
		<<NationalityToName $activeSlave>>
		<<set $activeSlave.accent = 0>>
		<<set $activeSlave.devotion = random(25,45), $activeSlave.trust = random(25,45), $activeSlave.health = random(25,45)>>
		<<set $activeSlave.face = random(15,100)>>
		<<set $activeSlave.intelligence = random(1,3), $activeSlave.intelligenceImplant = 1>>
		<<set $activeSlave.entertainSkill = 100>>
		<<set $activeSlave.clothes = "a kimono", $activeSlave.collar = "satin choker", $activeSlave.shoes = "heels">>
		<<set $activeSlave.assignment = "serve the public">>
	<<case "ArabianRevivalist">>
		<<include "Generate New Slave">>
		<<set $activeSlave.devotion = random(25,45), $activeSlave.trust = random(-15,15), $activeSlave.health = random(25,45)>>
		<<set $activeSlave.face = random(15,100)>>
		<<set $activeSlave.intelligence = random(0,2), $activeSlave.intelligenceImplant = 0>>
		<<set $activeSlave.clothes = "harem gauze", $activeSlave.collar = "uncomfortable leather", $activeSlave.shoes = "flats">>
		<<set $activeSlave.assignment = "take classes">>
	<<case "ChineseRevivalist">>
		<<set $activeSlaveOneTimeMinAge = 36>>
		<<set $activeSlaveOneTimeMaxAge = 38>>
		<<set $one_time_age_overrides_pedo_mode = 1>>
		<<set $fixedRace = "asian">><<include "Generate New Slave">><<set $fixedRace = 0>>
		<<set $activeSlave.nationality = "Chinese">>
		<<NationalityToName $activeSlave>>
		<<NationalityToAccent $activeSlave>>
		<<set $activeSlave.devotion = random(55,65), $activeSlave.trust = random(25,45), $activeSlave.health = random(25,45)>>
		<<set $activeSlave.face = random(0,55)>>
		<<set $activeSlave.accent = 0>>
		<<set $activeSlave.intelligence = 3, $activeSlave.intelligenceImplant = 1>>
		<<set $activeSlave.oralSkill = 100, $activeSlave.analSkill = 100>>
		<<if $activeSlave.vagina > -1>>
			<<if $activeSlave.vagina == 0>><<set $activeSlave.vagina++>><</if>>
			<<set $activeSlave.vaginalSkill = 100>>
		<</if>>
		<<set $activeSlave.entertainSkill = 100, $activeSlave.whoreSkill = 100>>
		<<SoftenBehavioralFlaw $activeSlave>>
		<<SoftenSexualFlaw $activeSlave>>
		<<set $activeSlave.clothes = "a slutty qipao", $activeSlave.collar = "pretty jewelry", $activeSlave.shoes = "heels">>
		<<set $activeSlave.assignment = "be your Head Girl", $HeadGirl = $activeSlave>>
	<<case "Eugenics">>
		<<include "Generate New Slave">>
		<<set $activeSlave.devotion = -100, $activeSlave.trust = -100, $activeSlave.health = random(80,90)>>
		<<set $activeSlave.intelligence = 3>>
		<<set $activeSlave.intelligenceImplant = 1>>
		<<set $activeSlave.face = 100>>
		<<set $activeSlave.faceShape = "sensual">>
		<<set $activeSlave.oralSkill = random(35,75), $activeSlave.analSkill = random(35,75)>>
		<<if $activeSlave.vagina > -1>>
			<<if $activeSlave.vagina == 0>><<set $activeSlave.vagina++>><</if>>
			<<set $activeSlave.vaginalSkill = random(35,75)>>
		<</if>>
		<<set $activeSlave.entertainSkill = random(15,35)>>
		<<set $activeSlave.whoreSkill = 0>>
		<<SoftenSexualFlaw $activeSlave>>
		<<set $activeSlave.clothes = "a ball gown", $activeSlave.shoes = "flats">>
		<<set $activeSlave.assignment = "rest">>
	<<case "Repopulationist">>
		<<set $activeSlaveOneTimeMinAge = $fertilityAge+3>>
		<<set $activeSlaveOneTimeMaxAge = 25>>
		<<set $one_time_age_overrides_pedo_mode = 1>>
		<<include "Generate XX Slave">>
		<<set $activeSlave.devotion = random(25,45), $activeSlave.trust = random(-25,-45), $activeSlave.health = random(55,65)>>
		<<set $activeSlave.face = random(15,100)>>
		<<set $activeSlave.preg = random(10,40), $activeSlave.pregType = random(3,8), $activeSlave.lactation = 1>>
		<<SetBellySize $activeSlave>>
		<<set $activeSlave.birthsTotal = 5>>
		<<set $activeSlave.bellySag = 20, $activeSlave.bellySagPreg = 20>>
		<<if $activeSlave.vagina > -1>>
			<<set $activeSlave.vagina = 4>>
			<<set $activeSlave.vaginalSkill = random(15,35)>>
		<</if>>
		<<set $activeSlave.clothes = "a nice maid outfit", $activeSlave.shoes = "flats">>
		<<set $activeSlave.assignment = "please you">>
	<<case "HedonisticDecadence">>
		<<set $activeSlaveOneTimeMaxAge = 25>>
		<<include "Generate XX Slave">>
		<<set $activeSlave.devotion = random(25,45), $activeSlave.trust = random(-25,-45), $activeSlave.health = random(-20,20)>>
		<<set $activeSlave.face = random(15,40)>>
		<<set $activeSlave.boobs += 100*random(3,6)>>
		<<set $activeSlave.butt += random(2,5)>>
		<<set $activeSlave.weight = random(100,200)>>
		<<set $activeSlave.oralSkill = random(15,35), $activeSlave.analSkill = random(15,35), $activeSlave.anus = 2>>
		<<if $activeSlave.vagina > -1>><<set $activeSlave.vaginalSkill = random(15,35), $activeSlave.vagina = 3>><</if>>
		<<set $activeSlave.entertainSkill = 0>>
		<<set $activeSlave.energy = random(60,80)>>
		<<set $activeSlave.behavioralFlaw = "gluttonous">>
		<<set $activeSlave.clothes = "attractive lingerie", $activeSlave.shoes = "flats">>
		<<set $activeSlave.diet = "fattening">>
		<<set $activeSlave.livingRules = "luxurious">>
		<<set $activeSlave.assignment = "rest">>
	<<default>>
		ERROR: bad arcology type
	<</switch>>
	<<set $activeSlave.origin = "You acquired her along with the arcology.", $activeSlave.career = "a slave">>
	<<slaveCost $activeSlave>>
	<<if $targetArcology.type == "Eugenics">>
		<<set _valueGiven += $slaveCost*4>>
	<<else>>
	<<set _valueGiven += $slaveCost>>
	<</if>>
	<<AddSlave $activeSlave>>
	<</for>>
<<else>>
	<<for $j = 0; $j < $heroSlaves.length; $j++>>
	<<if _valueOwed - _valueGiven <= 5000>>
		<<break>>
	<</if>>
	<<set $activeSlave = getHeroSlave($heroSlaves[$j], $baseHeroSlave)>>
	<<set $dump = $heroSlaves.pluck($j,$j)>>
	<<slaveCost $activeSlave>>
	<<if _valueGiven + $slaveCost < _valueOwed*2>>
		<<NationalityToAccent $activeSlave>>
		<<set $activeSlave.oldDevotion = $activeSlave.devotion>>
		<<set $activeSlave.oldTrust = $activeSlave.trust>>
		<<set _valueGiven += $slaveCost>>
		<<AddSlave $activeSlave>>
		<<if $activeSlave.fetish == "mindbroken">>
			$activeSlave.slaveName is, sadly, not mentally competent, and is wandering through the penthouse at the moment.
		<<elseif $activeSlave.amp == 1>>
			$activeSlave.slaveName is a quadruple amputee and is quite helpless, so you can attend to her at your leisure.
		<<elseif $activeSlave.devotion < -50>>
			$activeSlave.slaveName is quite rebellious and was attempting to escape, so I have locked her in the slave quarters.
		<<elseif $activeSlave.devotion < -20>>
			$activeSlave.slaveName resists my orders and was considering escape, so I have locked her in the slave quarters.
		<<elseif $activeSlave.devotion <= 20>>
			$activeSlave.slaveName is reasonably obedient, and is waiting for you in the dormitory, I believe in the hope of making a good impression.
		<<elseif $activeSlave.energy > 95>>
			$activeSlave.slaveName is a remarkable sexual addict, and I believe she will be very happy to meet you.
		<<elseif $activeSlave.fetish == "pregnancy">>
			<<if $activeSlave.preg > 10>>
				$activeSlave.slaveName is currently in the dormitory masturbating over her growing pregnancy, and <<if $PC.belly >= 5000>>will certainly be eager to meet you<<else>>I believe she will be happy to show it to you<</if>>.
			<<else>>
				$activeSlave.slaveName is currently in the dormitory examining herself to try to discern her fertility, and I believe she will be <<if $PC.belly >= 5000>>eager to get acquainted with you<<else>>happy to meet you<</if>>.
			<</if>>
		<<elseif $activeSlave.belly >= 5000>> /*had to be placed after pregnancy or it would intercept*/
			$activeSlave.slaveName is currently in the dormitory massaging her greatly distended belly.
		<<elseif $activeSlave.fetish == "buttslut">>
			$activeSlave.slaveName is currently in the dormitory masturbating anally, and I believe she will be happy to meet you.
		<<elseif $activeSlave.fetish == "cumslut">>
			$activeSlave.slaveName is currently in the dormitory exhibiting oral fixation, and I believe she will be happy to meet you.
		<<elseif $activeSlave.fetish == "boobs">>
			$activeSlave.slaveName is currently in the dormitory playing with her nipples, and I believe she will be happy to meet you.
		<<elseif $activeSlave.fetish == "humiliation">>
			$activeSlave.slaveName is currently in the entryway flashing passersby, and I believe she will be happy to meet you.
		<<elseif $activeSlave.fetish == "submissive">>
			$activeSlave.slaveName is currently in the dormitory, experimenting with self-bondage using the sheets; I believe she will be happy to meet you.
		<<elseif $activeSlave.fetish == "dom">>
			$activeSlave.slaveName is currently in the exercise area keeping fit; she likes to take an active role sexually and is using this down time to work out.
		<<elseif $activeSlave.fetish == "sadist">>
			$activeSlave.slaveName is currently outside your office; she enjoys being superior to other slaves and I believe she means to ingratiate herself to you.
		<<elseif $activeSlave.fetish == "masochist">>
			$activeSlave.slaveName is a sexual masochist; she is currently in the bathroom, experimenting with auto-flagellation with a wet towel.
		<<else>>
			$activeSlave.slaveName is currently outside your office, and I believe she is attempting to maintain sexual arousal to make a good first impression on you.
		<</if>>
	<</if>>
	<</for>>
<</if>>
<<if _valueOwed-_valueGiven > 0>>
	There are some valuables present, worth <<print cashFormat(_valueOwed-_valueGiven)>>.
	<<set $cash += _valueOwed-_valueGiven>>
<</if>>
//

/* RELATIONSHIP MUTUALITY CHECK, OLDMENTAL */

<<set $averageTrust = 0>>
<<set $averageDevotion = 0>>
<<set _slavesContributing = 0>>
<<for $i = 0; $i < $slaves.length; $i++>>
	<<if $slaves[$i].relation != 0>>
		<<set $seed = $slaveIndices[$slaves[$i].relationTarget]>>
		<<if (def $seed && $slaves[$seed].relationTarget != $slaves[$i].ID) || (ndef $seed)>>
			<<set $slaves[$i].relation = 0>>
			<<set $slaves[$i].relationTarget = 0>>
			<<goto "Acquisition">>
		<</if>>
	<</if>>
	<<set $slaves[$i].oldDevotion = $slaves[$i].devotion>>
	<<set $slaves[$i].oldTrust = $slaves[$i].trust>>
	/* AVERAGE VALUES UPDATE */
	<<if $slaves[$i].assignmentVisible == 1>>
		<<set $averageTrust += $slaves[$i].trust, $averageDevotion += $slaves[$i].devotion, _slavesContributing += 1>>
	<<else>>
		<<if $slaves[$i].assignment != "be confined in the cellblock">>
		<<if $slaves[$i].assignment != "be confined in the arcade">>
		<<if ($slaves[$i].assignment != "work in the dairy") || ($dairyRestraintsSetting < 2)>>
			<<set $averageTrust += $slaves[$i].trust*0.5, $averageDevotion += $slaves[$i].devotion*0.5, _slavesContributing += 0.5>>
		<</if>>
		<</if>>
		<</if>>
	<</if>>
<</for>>
<<if $familyTesting == 1>>
	<<set $slaves.forEach(function(s) { s.sisters = 0; s.daughters = 0; })>>
	<<set $PC.daughters = 0, $PC.sisters = 0>>
	<<for _fp = 0; _fp < $slaves.length; _fp++>>
		<<if ($slaves[_fp].mother == -1 || $slaves[_fp].father == -1)>>
			<<set $PC.daughters++>>
		<</if>>
		<<if areSisters($slaves[_fp], $PC) > 0>>
			<<set $PC.sisters++>>
		<</if>>
		<<for _fpt = 0; _fpt < $slaves.length; _fpt++>>
			<<if ($slaves[_fpt].mother == $slaves[_fp].ID) || ($slaves[_fpt].father == $slaves[_fp].ID)>>
				<<set $slaves[_fp].daughters++>>
			<</if>>
			<<if areSisters($slaves[_fpt], $slaves[_fp]) > 0>>
				<<set $slaves[_fp].sisters++>>
			<</if>>
		<</for>>
	<</for>>
<</if>>
<<set $averageTrust = $averageTrust/_slavesContributing>>
<<set $averageDevotion = $averageDevotion/_slavesContributing>>
<<set $enduringTrust = $averageTrust>>
<<set $enduringDevotion = $averageDevotion>>

<<link "Continue">>
	<<set $ui = "main">>
	<<if $terrain == "urban">>
		<<set $minimumSlaveCost = 2000>>
		<<set $slaveCostFactor = 0.85>>
	<<elseif $terrain == "marine">>
		<<set $minimumSlaveCost = 2500>>
		<<set $slaveCostFactor = 1>>
	<<else>>
		<<set $minimumSlaveCost = 3000>>
		<<set $slaveCostFactor = 1.15>>
	<</if>>
	<>
	<<goto "Main">>
<</link>>