code:
:: StoryJS [script]

/*config.history.tracking = false;*/
window.variableAsNumber = function(x, defaultValue, minValue, maxValue) {
	x = Number(x)
	if (x != x) {//NaN
		return defaultValue || 0;//In case the default value was not supplied.
	}
	if (x < minValue) {//Works even if minValue is undefined.
		return minValue;
	}
	if (x > maxValue) {//Works even if maxValue is undefined.
		return maxValue;
	}
	return x;
};
window.isSexuallyPure = function(slave) {
	if (!slave) {
		return null;
	}
	if (slave.vagina < 1 && slave.anus < 1 && !slave.analCount && !slave.vaginalCount && !slave.oralCount) {
		return true;
	} else {
		return false;
	}
};
if (typeof interpolate == "undefined") {
	var interpolate = function(x0,y0,x1,y1,x) {
		if(x <= x0) {
			return y0;
		} else if(x >= x1) {
			return y1;
		} else {
			return (x - x0) * ((y1 - y0) / (x1 - x0)) + y0;
		}
	};
	window.interpolate = interpolate;
}
config.history.maxStates = 1;

config.saves.autosave = "autosave";
window.isFullyPotent = function(slave) {
	if (!slave) {
		return null;
	} else if (slave.dick > 0 && slave.balls > 0 && slave.hormones <= 0) {
		return true;
	} else {
		return false;
	}
};

/* mousetrap v1.5.3 craig.is/killing/mice */
(function(C,r,g){function t(a,b,h){a.addEventListener?a.addEventListener(b,h,!1):a.attachEvent("on"+b,h)}function x(a){if("keypress"==a.type){var b=String.fromCharCode(a.which);a.shiftKey||(b=b.toLowerCase());return b}return l[a.which]?l[a.which]:p[a.which]?p[a.which]:String.fromCharCode(a.which).toLowerCase()}function D(a){var b=[];a.shiftKey&&b.push("shift");a.altKey&&b.push("alt");a.ctrlKey&&b.push("ctrl");a.metaKey&&b.push("meta");return b}function u(a){return"shift"==a||"ctrl"==a||"alt"==a||
"meta"==a}function y(a,b){var h,c,e,g=[];h=a;"+"===h?h=["+"]:(h=h.replace(/\+{2}/g,"+plus"),h=h.split("+"));for(e=0;e<h.length;++e)c=h[e],z[c]&&(c=z[c]),b&&"keypress"!=b&&A[c]&&(c=A[c],g.push("shift")),u(c)&&g.push(c);h=c;e=b;if(!e){if(!k){k={};for(var m in l)95<m&&112>m||l.hasOwnProperty(m)&&(k[l[m]]=m)}e=k[h]?"keydown":"keypress"}"keypress"==e&&g.length&&(e="keydown");return{key:c,modifiers:g,action:e}}function B(a,b){return null===a||a===r?!1:a===b?!0:B(a.parentNode,b)}function c(a){function b(a){a=
a||{};var b=!1,n;for(n in q)a[n]?b=!0:q[n]=0;b||(v=!1)}function h(a,b,n,f,c,h){var g,e,l=[],m=n.type;if(!d._callbacks[a])return[];"keyup"==m&&u(a)&&(b=[a]);for(g=0;g<d._callbacks[a].length;++g)if(e=d._callbacks[a][g],(f||!e.seq||q[e.seq]==e.level)&&m==e.action){var k;(k="keypress"==m&&!n.metaKey&&!n.ctrlKey)||(k=e.modifiers,k=b.sort().join(",")===k.sort().join(","));k&&(k=f&&e.seq==f&&e.level==h,(!f&&e.combo==c||k)&&d._callbacks[a].splice(g,1),l.push(e))}return l}function g(a,b,n,f){d.stopCallback(b,
b.target||b.srcElement,n,f)||!1!==a(b,n)||(b.preventDefault?b.preventDefault():b.returnValue=!1,b.stopPropagation?b.stopPropagation():b.cancelBubble=!0)}function e(a){"number"!==typeof a.which&&(a.which=a.keyCode);var b=x(a);b&&("keyup"==a.type&&w===b?w=!1:d.handleKey(b,D(a),a))}function l(a,c,n,f){function e(c){return function(){v=c;++q[a];clearTimeout(k);k=setTimeout(b,1E3)}}function h(c){g(n,c,a);"keyup"!==f&&(w=x(c));setTimeout(b,10)}for(var d=q[a]=0;d<c.length;++d){var p=d+1===c.length?h:e(f||
y(c[d+1]).action);m(c[d],p,f,a,d)}}function m(a,b,c,f,e){d._directMap[a+":"+c]=b;a=a.replace(/\s+/g," ");var g=a.split(" ");1<g.length?l(a,g,b,c):(c=y(a,c),d._callbacks[c.key]=d._callbacks[c.key]||[],h(c.key,c.modifiers,{type:c.action},f,a,e),d._callbacks[c.key][f?"unshift":"push"]({callback:b,modifiers:c.modifiers,action:c.action,seq:f,level:e,combo:a}))}var d=this;a=a||r;if(!(d instanceof c))return new c(a);d.target=a;d._callbacks={};d._directMap={};var q={},k,w=!1,p=!1,v=!1;d._handleKey=function(a,
c,e){var f=h(a,c,e),d;c={};var k=0,l=!1;for(d=0;d<f.length;++d)f[d].seq&&(k=Math.max(k,f[d].level));for(d=0;d<f.length;++d)f[d].seq?f[d].level==k&&(l=!0,c[f[d].seq]=1,g(f[d].callback,e,f[d].combo,f[d].seq)):l||g(f[d].callback,e,f[d].combo);f="keypress"==e.type&&p;e.type!=v||u(a)||f||b(c);p=l&&"keydown"==e.type};d._bindMultiple=function(a,b,c){for(var d=0;d<a.length;++d)m(a[d],b,c)};t(a,"keypress",e);t(a,"keydown",e);t(a,"keyup",e)}var l={8:"backspace",9:"tab",13:"enter",16:"shift",17:"ctrl",18:"alt",
20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"ins",46:"del",91:"meta",93:"meta",224:"meta"},p={106:"*",107:"+",109:"-",110:".",111:"/",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},A={"~":"`","!":"1","@":"2","#":"3",$:"4","%":"5","^":"6","&":"7","*":"8","(":"9",")":"0",_:"-","+":"=",":":";",'"':"'","<":",",">":".","?":"/","|":"\\"},z={option:"alt",command:"meta","return":"enter",
escape:"esc",plus:"+",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"},k;for(g=1;20>g;++g)l[111+g]="f"+g;for(g=0;9>=g;++g)l[g+96]=g;c.prototype.bind=function(a,b,c){a=a instanceof Array?a:[a];this._bindMultiple.call(this,a,b,c);return this};c.prototype.unbind=function(a,b){return this.bind.call(this,a,function(){},b)};c.prototype.trigger=function(a,b){if(this._directMap[a+":"+b])this._directMap[a+":"+b]({},a);return this};c.prototype.reset=function(){this._callbacks={};this._directMap=
{};return this};c.prototype.stopCallback=function(a,b){return-1<(" "+b.className+" ").indexOf(" mousetrap ")||B(b,this.target)?!1:"INPUT"==b.tagName||"SELECT"==b.tagName||"TEXTAREA"==b.tagName||b.isContentEditable};c.prototype.handleKey=function(){return this._handleKey.apply(this,arguments)};c.init=function(){var a=c(r),b;for(b in a)"_"!==b.charAt(0)&&(c[b]=function(b){return function(){return a[b].apply(a,arguments)}}(b))};c.init();C.Mousetrap=c;"undefined"!==typeof module&&module.exports&&(module.exports=
c);"function"===typeof define&&define.amd&&define(function(){return c})})(window,document);

Mousetrap.bind("enter", function () {
	$("#story-caption #endWeekButton a.macro-click").trigger("click");
});
Mousetrap.bind("space", function () {
	$("#story-caption #nextButton a.macro-click").trigger("click");
});
Mousetrap.bind("c", function () {
	$("#story-caption #manageArcology a.macro-click").trigger("click");
});
Mousetrap.bind("p", function () {
	$("#story-caption #managePenthouse a.macro-click").trigger("click");
});
Mousetrap.bind("left", function () {
	$("#prevSlave a.macro-click").trigger("click");
	$("#prevRule a.macro-click").trigger("click");
});
Mousetrap.bind("q", function () {
	$("#prevSlave a.macro-click").trigger("click");
	$("#prevRule a.macro-click").trigger("click");
});
Mousetrap.bind("shift+left", function () {
	$("#firstRule a.macro-click").trigger("click");
});
Mousetrap.bind("shift+q", function () {
	$("#firstRule a.macro-click").trigger("click");
});
Mousetrap.bind("right", function () {
	$("#nextSlave a.macro-click").trigger("click");
	$("#nextRule a.macro-click").trigger("click");
});
Mousetrap.bind("shift+right", function () {
	$("#lastRule a.macro-click").trigger("click");
});
Mousetrap.bind("e", function () {
	$("#nextSlave a.macro-click").trigger("click");
	$("#nextRule a.macro-click").trigger("click");
});
Mousetrap.bind("shift+e", function () {
	$("#lastRule a.macro-click").trigger("click");
});
Mousetrap.bind("f", function () {
	$("#walkpast a.macro-click").trigger("click");
});
Mousetrap.bind("h", function () {
	$("#manageHG a.macro-click").trigger("click");
});
Mousetrap.bind("s", function () {
	$("#buySlaves a.macro-click").trigger("click");
});
Mousetrap.bind("a", function () {
	$("#managePA a.macro-click").trigger("click");
});
Mousetrap.bind("b", function () {
	$("#manageBG a.macro-click").trigger("click");
});
Mousetrap.bind("r", function () {
	$("#manageRecruiter a.macro-click").trigger("click");
});
Mousetrap.bind("o", function () {
	$("#story-caption #optionsButton a.macro-click").trigger("click");
});
Mousetrap.bind("y", function () {
	$("#story-caption #policyButton a.macro-click").trigger("click");
});
Mousetrap.bind("f", function () {
	$("#story-caption #FSButton a.macro-click").trigger("click");
});
Mousetrap.bind("l", function () {
	$("#story-caption #LanguageButton a.macro-click").trigger("click");
});
Mousetrap.bind("t", function () {
	$("#story-caption #PAOButton a.macro-click").trigger("click");
});
Mousetrap.bind("u", function () {
	$("#story-caption #URButton a.macro-click").trigger("click");
});
Mousetrap.bind("w", function () {
	$("#story-caption #WARButton a.macro-click").trigger("click");
});

/**
 * BoobGenerator namespace.
 */
if (typeof BoobGenerator == "undefined") {
	var BoobGenerator = {
		rollBreast: function (modif) {
			var volume = [0, 300, 500, 650, 800, 1000, 1200, 1400, 1600, 1800, 2050, 2300, 2600, 2900, 3250, 3600, 3950, 4300, 4700, 5100, 5500, 5900];
			var volume_dist = [90000, 470000, 720000, 840000, 908574, 947759, 970151, 982946, 990258, 994436, 996824, 998188, 998968, 999414, 999669, 999814, 999897, 999945, 999972, 999987, 999995, 1000000];
			var randomRoll = Math.floor(Math.random() * 1000000) + 1
			var actualSize = 0
			while (randomRoll > volume_dist[actualSize]) {
				actualSize = actualSize + 1
			}
			var minorSizeAdjustment = 0
			if (Math.random()<.5) {
				minorSizeAdjustment = (Math.floor(Math.random() * 2) + 1) * 50
			}
			var volResult = volume[actualSize] + minorSizeAdjustment + modif
			if (volResult < 0) {volResult = 0}
			return volResult
		}
	};
	// Raise namespace scope to Global.
	window.BoobGenerator = BoobGenerator;
};

/**
 * Slave checker namespace.
 */
if (typeof SlaveStatsChecker == "undefined") {
	var SlaveStatsChecker = {
		checkForLisp: function (slave) {
				/* Begin mod section: toggle whether slaves lisp. */
				if (SugarCube && SugarCube.State.variables.disableLisping) {
					return false;
				}
				/* End mod section: toggle whether slaves lisp. */
				return ((slave.lips > 70) || (slave.lipsPiercing + slave.tonguePiercing > 2))
			}
	};
	// Raise namespace scope to Global.
	window.SlaveStatsChecker = SlaveStatsChecker;
};

if (typeof FertilityAge == "undefined") {
	var FertilityAge = {
		setAge: function (age) {
			age = Number(age)
				if (age != age) {
					return 13;
				} else {
				return age
			}
		}
	};
	// Raise namespace scope to Global.
	window.FertilityAge = FertilityAge;
};

window.canGetPregnant = function(slave) {
	if (!slave) {
		return null;
	} else if (slave.pubertyXX == 0){
		return false;
	} else if (slave.physicalAge >= 47) {
		return false;
	} else if (slave.inflation != 0) {
		return false;
	} else if (slave.bellyImplant != 0) {
		return false;
	} else if (slave.preg != 0) {
		return false;
	} else if ((slave.mpreg == 1) && (canDoAnal(slave) == true)) {
		return true;
	} else if (slave.ovaries != 1) {
		return false;
	} else if (canDoVaginal(slave) == false) {
		return false;
	} else {
		return true;
	}
};

window.isFertile = function(slave) {
	if (!slave) {
		return null;
	} else if (slave.pubertyXX == 0) {
		return false;
	} else if (slave.physicalAge >= 47) {
		return false;
	} else if (slave.inflation != 0) {
		return false;
	} else if (slave.bellyImplant != 0) {
		return false;
	} else if (slave.preg > 0) {
		return false;
	} else if (slave.preg < -1) {
		return false;
	} else if (slave.mpreg == 1) {
		return true;
	} else if (slave.ovaries != 1) {
		return false;
	} else {
		return true;
	}
};

window.canBreed = function(slave1, slave2) {
	if (slave1 != slave) {
		return false;
	} else if (slave2 != slave) {
		return false;
	} else if (slave1.eggType == slave2.ballType) {
		return true;
	} else {
		return false;
	}
};

window.milkAmount = function(slave) {
	var milk;
	var calcs;
	if (!slave) {
		return null;
	} else {
		calcs = slave.boobs-slave.boobsImplant
		if (calcs > 20000) {
			milk = (118+((calcs-20000)/400))
		} else if (calcs > 10000) {
			milk = (78+((calcs-10000)/300))
		} else if (calcs > 5000) {
			milk = (53+((calcs-5000)/200))
		} else if (calcs > 2000) {
			milk = (29+((calcs-2000)/125))
		} else if (calcs > 800) {
			milk = (16+((calcs-800)/80))
		} else {
			milk = (8+((calcs-400)/50))
		}
		if (slave.lactation == 2) {
			milk *= 1.2
		}
		milk += (milk*((slave.devotion-50)/200))
		if (slave.boobsImplant > 200) {
			milk *= 0.9
		}
		calcs = slave.hormones
		if (slave.balls != 0 && calcs > -2) {
			calcs -= 1
		} else if (slave.ovaries != 1 && calcs < 2) {
			calcs += 1
		}
		milk *= (1+(calcs*0.1))
		milk *= (1+(slave.preg/100))
		milk *= (1+(slave.health/50))
		milk *= (1+(slave.weight/500))
		milk *= (1+(slave.lactationAdaptation/500))
		milk = Math.trunc(milk)
		milk = Math.clamp(milk,1,1000000000000000000)
		return milk
	}
};

window.cumAmount = function(slave) {
	var cum = 0;
	var calcs = 0;
	if (!slave) {
		return null;
	} else {
		if (slave.drugs == "testicle enhancement") {
			cum = ((slave.balls*3.5)+random(0,2))
		} else if (slave.drugs == "hyper testicle enhancement") {
			cum = ((slave.balls*5)+random(0,2))
		} else {
			cum = ((slave.balls*2.5)+random(0,2))
		}
		if (slave.prostateImplant == 1) {
			cum *= 1.2
		}
		if (slave.diet == "cum production") {
			cum *= 1.2
		}
		calcs = slave.hormones
		cum *= (1-(calcs*0.1))
		if (slave.scrotum == 0) {
			cum *= 0.8
		}
		if (slave.devotion > 50) {
			cum += (cum*(slave.devotion/100))
		} else if (slave.devotion < -50) {
			cum += (cum*(slave.devotion/100))
		}
		if (slave.health > 50) {
			cum += (cum*(slave.health/50))
		} else if (slave.health < -50) {
			cum += (cum*(slave.health/50))
		}
		cum = Math.trunc(cum)
		cum = Math.clamp(cum,1,1000000000000000000)
		return cum
	}
};

window.canAchieveErection = function(slave) {
	if (!slave) {
		return null;
	} else if (slave.dick < 7 && slave.dick > 0 && (slave.balls > 0 ? slave.hormones <= 0 : slave.hormones < 0)) {
		return true;
	} else {
		return false;
	}
};

window.canSee = function(slave) {
	if (!slave) {
		return null;
	} else if (slave.eyes > -2) {
		return true;
	} else {
		return false;
	}
};

window.canWalk = function(slave) {
	if (!slave) {
		return null;
	} else if (slave.amp == 1)  {
		return false;
	} else if (slave.boobs > 9000+(slave.muscles*100) && slave.physicalAge >= 18) {
		return false;
	} else if (slave.boobs > 5000+(slave.muscles*10) && slave.physicalAge <= 3) {
		return false;
	} else if (slave.boobs > 7000+(slave.muscles*20) && slave.physicalAge <= 12) {
		return false;
	} else if (slave.boobs > 9000+(slave.muscles*50) && slave.physicalAge < 18) {
		return false;
	} else if (slave.dick >= 15+(slave.muscles*.3) && slave.physicalAge <= 3) {
		return false;
	} else if (slave.dick >= 30+(slave.muscles*.4) && slave.physicalAge <= 12) {
		return false;
	} else if (slave.dick >= 68+(slave.muscles*.5)) {
		return false;
	} else if (slave.balls >= 30+(slave.muscles*.3) && slave.physicalAge <= 3) {
		return false;
	} else if (slave.balls >= 60+(slave.muscles*.5) && slave.physicalAge <= 12) {
		return false;
	} else if (slave.balls >= 90+(slave.muscles*.7)) {
		return false;
	} else if (slave.butt > 10 && slave.physicalAge <= 3) {
		return false;
	} else if (slave.butt > 14 && slave.physicalAge <= 12) {
		return false;
	} else if (slave.preg > 20 && slave.physicalAge >= 13 && slave.pregType >= 20 && slave.height < 150) {
		return false;
	} else if (slave.preg > 30 && slave.physicalAge >= 13 && slave.pregType >= 20 && (!slave.height >= 185 || !slave.muscles > 1)) {
		return false;
	} else if (slave.preg > 20 && slave.physicalAge <= 3 && slave.pregType >= 10) {
		return false;
	} else if (slave.preg > 20 && slave.physicalAge <= 12 && slave.pregType >= 20) {
		return false;
	} else if (slave.bellyImplant > 31000+(slave.muscles*100) && slave.physicalAge >= 18) {
		return false;
	} else if (slave.bellyImplant > 31000+(slave.muscles*80) && slave.physicalAge >= 13) {
		return false;
	} else if (slave.bellyImplant > 12000+(slave.muscles*50) && slave.physicalAge <= 3) {
		return false;
	} else if (slave.bellyImplant > 16000+(slave.muscles*20) && slave.physicalAge <= 12) {
		return false;
	} else if (slave.heels == 0) {
		return true;
	} else if (slave.shoes == "heels") {
		return true;
	} else if (slave.shoes == "extreme heels") {
		return true;
	} else if (slave.shoes == "boots") {
		return true;
	} else {
		return false;
	}
};

window.canTalk = function(slave) {
	if (!slave) {
		return null;
	} else if (slave.accent > 2)  {
		return false;
	} else if (slave.voice == 0) {
		return false;
	} else if (slave.lips > 95) {
		return false;
	} else {
		return true;
	}
};

window.canDoAnal = function(slave) {
	if (!slave) {
		return null;
	} else if (slave.vaginalAccessory == "anal chastity") {
		return false;
	} else if (slave.dickAccessory == "anal chastity") {
		return false;
	} else if (slave.vaginalAccessory == "combined chastity") {
		return false;
	} else if (slave.dickAccessory == "combined chastity") {
		return false;
	}
	return true;
};

window.canDoVaginal = function(slave) {
	if (!slave) {
		return null;
	} else if (slave.vagina < 0) {
		return false;
	} else if (slave.vaginalAccessory == "chastity belt") {
		return false;
	} else if (slave.vaginalAccessory == "combined chastity") {
		return false;
	}
	return true;
};

window.tooBigBreasts = function(slave){
	if (!slave) {
		return null;
	} else if (slave.boobs > 9000+(slave.muscles*100) && slave.physicalAge >= 18) {
		return true;
	} else if (slave.boobs > 5000+(slave.muscles*10) && slave.physicalAge <= 3) {
		return true;
	} else if (slave.boobs > 7000+(slave.muscles*20) && slave.physicalAge <= 12) {
		return true;
	} else if (slave.boobs > 9000+(slave.muscles*50) && slave.physicalAge < 18) {
		return true;
	} else {
		return false;
	}
};

window.tooBigBelly = function(slave){
	if (!slave) {
		return null;
	} else if (slave.preg > 20 && slave.physicalAge >= 18 && slave.pregType >= 20 && slave.height < 150) {
		return true;
	} else if (slave.preg > 30 && slave.physicalAge >= 18 && slave.pregType >= 20 && (!slave.height >= 185 || !slave.muscles > 1)) {
		return true;
	} else if (slave.preg > 20 && slave.physicalAge <= 3 && slave.pregType >= 10) {
		return true;
	} else if (slave.preg > 20 && slave.physicalAge <= 12 && slave.pregType >= 20) {
		return true;
	} else if (slave.bellyImplant > 31000+(slave.muscles*100) && slave.physicalAge >= 18) {
		return true;
	} else if (slave.bellyImplant > 31000+(slave.muscles*80) && slave.physicalAge >= 13) {
		return true;
	} else if (slave.bellyImplant > 12000+(slave.muscles*20) && slave.physicalAge <= 3) {
		return true;
	} else if (slave.bellyImplant > 16000+(slave.muscles*50) && slave.physicalAge <= 12) {
		return true;
	} else {
		return false;
	}
};

window.tooBigBalls = function(slave){
	if (!slave) {
		return null;
	} else if (slave.balls >= 30+(slave.muscles*.3) && slave.physicalAge <= 3) {
		return true;
	} else if (slave.balls >= 60+(slave.muscles*.5) && slave.physicalAge <= 12) {
		return true;
	} else if (slave.balls >= 90+(slave.muscles*.7)) {
		return true;
	} else {
		return false;
	}
};

window.tooBigDick = function(slave){
	if (!slave) {
		return null;
	} else if (slave.dick >= 15+(slave.muscles*.3) && slave.physicalAge <= 3) {
		return true;
	} else if (slave.dick >= 30+(slave.muscles*.4) && slave.physicalAge <= 12) {
		return true;
	} else if (slave.dick >= 68+(slave.muscles*.5)) {
		return true;
	} else {
		return false;
	}
};

window.tooBigButt = function(slave){
	if (!slave) {
		return null;
	} else if (slave.butt > 10 && slave.physicalAge <= 3) {
		return true;
	} else if (slave.butt > 14 && slave.physicalAge <= 12) {
		return true;
	} else {
		return false;
	}
};

window.sameDad = function(slave1, slave2){
	if ((slave1.father == slave2.father) && (slave1.father != 0 && slave1.father != -2)) {
		return true;
	} else {
		return false;
	}
};

window.sameMom = function(slave1, slave2){
	if ((slave1.mother == slave2.mother) && (slave1.mother != 0 && slave1.mother != -2)) {
		return true;
	} else {
		return false;
	}
};

window.areTwins = function(slave1, slave2) {
	if (sameDad(slave1, slave2) == false) {
		return false;
	} else if (sameMom(slave1, slave2) == false) {
		return false;
	} else if (slave1.actualAge == slave2.actualAge && slave1.birthWeek == slave2.birthWeek) {
		return true;
	} else {
		return false;
	}
};

window.areSisters = function(slave1, slave2) {
	if (slave1.ID == slave2.ID) {
		return 0; //you are not your own sister
	} else if ((slave1.father != 0 && slave1.father != -2) || (slave1.mother != 0 && slave1.mother != -2)) {
		if (sameDad(slave1, slave2) == false && sameMom(slave1, slave2) == true) {
			return 3; //half sisters
		} else if (sameDad(slave1, slave2) == true && sameMom(slave1, slave2) == false) {
			return 3; //half sisters
		} else if (sameDad(slave1, slave2) == true && sameMom(slave1, slave2) == true) {
			if (slave1.actualAge == slave2.actualAge && slave1.birthWeek == slave2.birthWeek) {
				return 1; //twins
			} else {
				return 2; //sisters
			}
		} else {
			return 0; //not related
		}
	} else {
		return 0; //not related
	}
};

window.totalRelatives = function(slave) {
	var relatives = 0;
	if (slave.mother > 0) {
		relatives += 1
	}
	if (slave.father > 0) {
		relatives += 1
	}
	if (slave.daughters > 0) {
		relatives += slave.daughters
	}
	if (slave.sisters > 0) {
		relatives += slave.sisters
	}
	return relatives
};

if (typeof DairyRestraintsSetting == "undefined") {
	var DairyRestraintsSetting = {
		setSetting: function (setting) {
			setting = Number(setting)
			return setting
		}
	};
	// Raise namespace scope to Global.
	window.DairyRestraintsSetting = DairyRestraintsSetting;
};

window.isSlaveAvailable = function(slave) {
	if (!slave) {
		return null;
	} else if (slave.assignment == "be your agent") {
		return false;
	} else if (slave.assignment == "live with your agent") {
		return false;
	} else if (slave.assignment == "work in the dairy" && DairyRestraintsSetting >= 2) {
		return false;
	} else {
		return true;
	}
};

window.relationTargetWord = function(slave) {
	if (!slave) {
		return null;
	} else if (slave.relation == "daughter") {
		return "mother";
	} else if (slave.relation == "mother") {
		return "daughter";
	}
	return slave.relation;
};

window.ruleApplied = function(slave, ID) {
	if (!slave) {
		return null;
	}else if (!slave.currentRules) {
		return null;
	} else {
		for(var d=0; d < slave.currentRules.length; ++d){
			if(slave.currentRules[d] == ID){
				return true;
			}
		}return false;
	}
};

window.ruleAssignment = function(applyAssignment, assignment) {
	for(var d=0; d < applyAssignment.length; ++d){
		if(applyAssignment[d] == assignment){

			return true;
		}
	}return false;
};

window.ruleFacility = function(applyFacility, facility) {
	for(var d=0; d < applyFacility.length; ++d){
		if(applyFacility[d] == facility){
			return true;
		}
	}return false;
};

window.ruleExcludeSlaveFacility = function(rule, slave) {
	if (!slave) {
		return null;
	}else if (!rule) {
		return null;
	}else if (!rule.excludeFacility) {
		return false;
	} else {
		for(var d=0; d < rule.excludeFacility.length; ++d){
			if(rule.excludeFacility[d] == "hgsuite"){
				if(slave.assignment == "live with your Head Girl" ){
					return true;
				}
				else if(slave.assignment == "be your Head Girl"){
					return true;
				}
			}
			else if(rule.excludeFacility[d] == "arcade"){
				if (slave.assignment == "be confined in the arcade" ){
					return true;
				}
			}
			else if(rule.excludeFacility[d] == "mastersuite"){
				if(slave.assignment == "serve in the master suite" ){
					return true;
				}
				else if(slave.assignment == "be your Concubine"){
					return true;
				}
			}
			else if(rule.excludeFacility[d] == "clinic"){
				if(slave.assignment == "get treatment in the clinic" ){
					return true;
				}
				else if(slave.assignment == "be the Nurse"){
					return true;
				}
			}
			else if(rule.excludeFacility[d] == "spa"){
				if(slave.assignment == "rest in the spa" ){
					return true;
				}
				else if(slave.assignment == "be the Attendant"){
					return true;
				}
			}
			else if(rule.excludeFacility[d] == "brothel"){
				if(slave.assignment == "work in the brothel" ){
					return true;
				}
				else if(slave.assignment == "be the Madam"){
					return true;
				}
			}
			else if(rule.excludeFacility[d] == "club"){
				if(slave.assignment == "serve in the club" ){
					return true;
				}
				else if(slave.assignment == "be the DJ"){
					return true;
				}
			}
			else if(rule.excludeFacility[d] == "dairy"){
				if (slave.assignment == "work in the dairy"){
					return true;
				}
				else if(slave.assignment == "be the Milkmaid"){
					return true;
				}
			}
			else if(rule.excludeFacility[d] == "servantsquarters"){
				if(slave.assignment == "work as a servant"){
					return true;
				}
				else if(slave.assignment == "be the Stewardess"){
					return true;
				}
			}
			else if(rule.excludeFacility[d] == "schoolroom"){
				if(slave.assignment == "learn in the schoolroom" ){
					return true;
				}
				else if(slave.assignment == "be the Schoolteacher"){
					return true;
				}
			}
			else if(rule.excludeFacility[d] == "cellblock"){
				if(slave.assignment == "be confined in the cellblock" ){
					return true;
				}
				else if(slave.assignment == "be the Wardeness"){
					return true;
				}
			}
		}
	}
};

window.ruleAppliedToSlaveFacility = function(rule, slave) {
	if (!slave) {
		return null;
	}else if (!rule) {
		return null;
	}else if (!rule.facility) {
		return false;
	} else {
		for(var d=0; d < rule.facility.length; ++d){
			if(rule.facility[d] == "hgsuite"){
				if(slave.assignment == "live with your Head Girl" ){
					return true;
				}
				else if((rule.excludeSpecialSlaves != true) && (slave.assignment == "be your Head Girl")){
					return true;
				}
			}
			else if(rule.facility[d] == "arcade"){
				if(slave.assignment == "be confined in the arcade" ){
					return true;
				}
			}
			else if(rule.facility[d] == "mastersuite"){
				if(slave.assignment == "serve in the master suite" ){
					return true;
				}
				else if((rule.excludeSpecialSlaves != true) && (slave.assignment == "be your Concubine")){
					return true;
				}
			}
			else if(rule.facility[d] == "clinic"){
				if(slave.assignment == "get treatment in the clinic" ){
					return true;
				}
				else if((rule.excludeSpecialSlaves != true) && (slave.assignment == "be the Nurse")){
					return true;
				}
			}
			else if(rule.facility[d] == "spa"){
				if(slave.assignment == "rest in the spa" ){
					return true;
				}
				else if((rule.excludeSpecialSlaves != true) && (slave.assignment == "be the Attendant")){
					return true;
				}
			}
			else if(rule.facility[d] == "brothel"){
				if(slave.assignment == "work in the brothel" ){
					return true;
				}
				else if((rule.excludeSpecialSlaves != true) && (slave.assignment == "be the Madam")){
					return true;
				}
			}
			else if(rule.facility[d] == "club"){
				if(slave.assignment == "serve in the club" ){
					return true;
				}
				else if((rule.excludeSpecialSlaves != true) && (slave.assignment == "be the DJ")){
					return true;
				}
			}
			else if(rule.facility[d] == "dairy"){
				if (slave.assignment == "work in the dairy"){
					return true;
				}
				else if((rule.excludeSpecialSlaves != true) && (slave.assignment == "be the Milkmaid")){
					return true;
				}
			}
			else if(rule.facility[d] == "servantsquarters"){
				if(slave.assignment == "work as a servant" ){
					return true;
				}
				else if((rule.excludeSpecialSlaves != true) && (slave.assignment == "be the Stewardess")){
					return true;
				}
			}
			else if(rule.facility[d] == "schoolroom"){
				if(slave.assignment == "learn in the schoolroom" ){
					return true;
				}
				else if((rule.excludeSpecialSlaves != true) && (slave.assignment == "be the Schoolteacher")){
					return true;
				}
			}
			else if(rule.facility[d] == "cellblock"){
				if(slave.assignment == "be confined in the cellblock" ){
					return true;
				}
				else if((rule.excludeSpecialSlaves != true) && (slave.assignment == "be the Wardeness")){
					return true;
				}
			}
		}return false;
	}
};

window.ruleSlaveSelected = function(slave, rule) {
	if (!slave) {
		return null;
	}else if (!rule) {
		return null;
	}else if (!rule.selectedSlaves) {
		return false;
	} else {
		for(var d=0; d < rule.selectedSlaves.length; ++d){
			if(slave.ID == rule.selectedSlaves[d]){
				return true;
			}
		}return false;
	}
};

window.ruleSlaveExcluded = function(slave, rule) {
	if (!slave) {
		return null;
	}else if (!rule) {
		return null;
	}else if (!rule.excludedSlaves) {
		return false;
	} else {
		for(var d=0; d < rule.excludedSlaves.length; ++d){
			if(slave.ID == rule.excludedSlaves[d]){
				return true;
			}
		}return false;
	}
};
window.hasSurgeryRule = function(slave, rules) {
	if (!slave) {
		return false;
	}else if (!rules) {
		return false;
	}else if (!slave.currentRules) {
		return false;
	}else {
		for(var d=rules.length-1; d >= 0; --d){
			for(var e=0; e < slave.currentRules.length;++e){
				if(slave.currentRules[e] == rules[d].ID){
					if (rules[d].autoSurgery > 0){
						return true;
					}
				}
			}
		}return false;
	}
};

window.lastPregRule = function(slave, rules) {
	if (!slave) {
		return null;
	}else if (!rules) {
		return null;
	}else if (!slave.currentRules) {
		return false;
	}else {
		for(var d=rules.length-1; d >= 0;--d){
			for(var e=0; e < slave.currentRules.length;++e){
				if(slave.currentRules[e] == rules[d].ID){
					if (rules[d].preg == -1){
						return rules[d];
					}
				}
			}
		}return null;
	}
};

window.hasHColorRule = function(slave, rules) {
	if (!slave) {
		return false;
	}else if (!rules) {
		return false;
	}else if (!slave.currentRules) {
		return false;
	}else {
		for(var d=rules.length-1; d >= 0;--d){
			for(var e=0; e < slave.currentRules.length;++e){
				if(slave.currentRules[e] == rules[d].ID){
					if (rules[d].hColor != "no default setting"){
						return true;
					}
				}
			}
		}return false;
	}
};

window.hasHStyleRule = function(slave, rules) {
	if (!slave) {
		return false;
	}else if (!rules) {
		return false;
	}else if (!slave.currentRules) {
		return false;
	}else {
		for(var d=rules.length-1; d >= 0;--d){
			for(var e=0; e < slave.currentRules.length;++e){
				if(slave.currentRules[e] == rules[d].ID){
					if (rules[d].hStyle != "no default setting"){
						return true;
					}
				}
			}
		}return false;
	}
};

window.hasEyeColorRule = function(slave, rules) {
	if (!slave) {
		return false;
	}else if (!rules) {
		return false;
	}else if (!slave.currentRules) {
		return false;
	}else {
		for(var d=rules.length-1; d >= 0;--d){
			for(var e=0; e < slave.currentRules.length;++e){
				if(slave.currentRules[e] == rules[d].ID){
					if (rules[d].hStyle != "no default setting"){
						return true;
					}
				}
			}
		}return false;
	}
};

window.lastEyeWearRule = function(slave, rules) {
	if (!slave) {
		return null;
	}else if (!rules) {
		return null;
	}else if (!slave.currentRules) {
		return null;
	}else {
		for(var d=rules.length-1; d >= 0;--d){
			for(var e=0; e < slave.currentRules.length;++e){
				if(slave.currentRules[e] == rules[d].ID){
					if (rules[d].eyewear != "no default setting"){
						return rules[d];
					}
				}
			}
		}return null;
	}
};

window.lastEyeColorRule = function(slave, rules) {
	if (!slave) {
		return null;
	}else if (!rules) {
		return null;
	}else if (!slave.currentRules) {
		return null;
	}else {
		for(var d=rules.length-1; d >= 0;--d){
			for(var e=0; e < slave.currentRules.length;++e){
				if(slave.currentRules[e] == rules[d].ID){
					if (rules[d].eyeColor != "no default setting"){
						return rules[d];
					}
				}
			}
		}return null;
	}
};

window.lastMakeupRule = function(slave, rules) {
	if (!slave) {
		return null;
	}else if (!rules) {
		return null;
	}else if (!slave.currentRules) {
		return null;
	}else {
		for(var d=rules.length-1; d >= 0;--d){
			for(var e=0; e < slave.currentRules.length;++e){
				if(slave.currentRules[e] == rules[d].ID){
					if (rules[d].makeup != "no default setting"){
						return rules[d];
					}
				}
			}
		}return null;
	}
};

window.lastNailsRule = function(slave, rules) {
	if (!slave) {
		return null;
	}else if (!rules) {
		return null;
	}else if (!slave.currentRules) {
		return null;
	}else {
		for(var d=rules.length-1; d >= 0;--d){
			for(var e=0; e < slave.currentRules.length;++e){
				if(slave.currentRules[e] == rules[d].ID){
					if (rules[d].nails != "no default setting"){
						return rules[d];
					}
				}
			}
		}return null;
	}
};

window.lastHColorRule = function(slave, rules) {
	if (!slave) {
		return null;
	}else if (!rules) {
		return null;
	}else if (!slave.currentRules) {
		return null;
	}else {
		for(var d=rules.length-1; d >= 0;--d){
			for(var e=0; e < slave.currentRules.length;++e){
				if(slave.currentRules[e] == rules[d].ID){
					if (rules[d].hColor != "no default setting"){
						return rules[d];
					}
				}
			}
		}return null;
	}
};

window.lastHStyleRule = function(slave, rules) {
	if (!slave) {
		return null;
	}else if (!rules) {
		return null;
	}else if (!slave.currentRules) {
		return null;
	}else {
		for(var d=rules.length-1; d >= 0;--d){
			for(var e=0; e < slave.currentRules.length;++e){
				if(slave.currentRules[e] == rules[d].ID){
					if (rules[d].hStyle != "no default setting"){
						return rules[d];
					}
				}
			}
		}return null;
	}
};

window.lastHLengthRule = function(slave, rules) {
	if (!slave) {
		return null;
	}else if (!rules) {
		return null;
	}else if (!slave.currentRules) {
		return null;
	}else {
		for(var d=rules.length-1; d >= 0;--d){
			for(var e=0; e < slave.currentRules.length;++e){
				if(slave.currentRules[e] == rules[d].ID){
					if (rules[d].hLength != "no default setting"){
						return rules[d];
					}
				}
			}
		}return null;
	}
};

window.lastPubicHColorRule = function(slave, rules) {
	if (!slave) {
		return null;
	}else if (!rules) {
		return null;
	}else if (!slave.currentRules) {
		return null;
	}else {
		for(var d=rules.length-1; d >= 0;--d){
			for(var e=0; e < slave.currentRules.length;++e){
				if(slave.currentRules[e] == rules[d].ID){
					if (rules[d].pubicHColor != "no default setting"){
						return rules[d];
					}
				}
			}
		}return null;
	}
};

window.lastPubicHStyleRule = function(slave, rules) {
	if (!slave) {
		return null;
	}else if (!rules) {
		return null;
	}else if (!slave.currentRules) {
		return null;
	}else {
		for(var d=rules.length-1; d >= 0;--d){
			for(var e=0; e < slave.currentRules.length;++e){
				if(slave.currentRules[e] == rules[d].ID){
					if (rules[d].pubicHStyle != "no default setting"){
						return rules[d];
					}
				}
			}
		}return null;
	}
};

window.lastUnderArmHColorRule = function(slave, rules) {
	if (!slave) {
		return null;
	}else if (!rules) {
		return null;
	}else if (!slave.currentRules) {
		return null;
	}else {
		for(var d=rules.length-1; d >= 0;--d){
			for(var e=0; e < slave.currentRules.length;++e){
				if(slave.currentRules[e] == rules[d].ID){
					if (rules[d].underArmHColor != "no default setting"){
						return rules[d];
					}
				}
			}
		}return null;
	}
};

window.lastUnderArmHStyleRule = function(slave, rules) {
	if (!slave) {
		return null;
	}else if (!rules) {
		return null;
	}else if (!slave.currentRules) {
		return null;
	}else {
		for(var d=rules.length-1; d >= 0;--d){
			for(var e=0; e < slave.currentRules.length;++e){
				if(slave.currentRules[e] == rules[d].ID){
					if (rules[d].underArmHStyle != "no default setting"){
						return rules[d];
					}
				}
			}
		}return null;
	}
};

window.lastNipplesPiercingRule = function(slave, rules) {
	if (!slave) {
		return null;
	}else if (!rules) {
		return null;
	}else if (!slave.currentRules) {
		return null;
	}else {
		for(var d=rules.length-1; d >= 0;--d){
			for(var e=0; e < slave.currentRules.length;++e){
				if(slave.currentRules[e] == rules[d].ID){
					if (rules[d].nipplesPiercing != "no default setting"){
						return rules[d];
					}
				}
			}
		}return null;
	}
};
window.lastAreolaePiercingRule = function(slave, rules) {
	if (!slave) {
		return null;
	}else if (!rules) {
		return null;
	}else if (!slave.currentRules) {
		return null;
	}else {
		for(var d=rules.length-1; d >= 0;--d){
			for(var e=0; e < slave.currentRules.length;++e){
				if(slave.currentRules[e] == rules[d].ID){
					if (rules[d].areolaePiercing != "no default setting"){
						return rules[d];
					}
				}
			}
		}return null;
	}
};
window.lastClitPiercingRule = function(slave, rules) {
	if (!slave) {
		return null;
	}else if (!rules) {
		return null;
	}else if (!slave.currentRules) {
		return null;
	}else {
		for(var d=rules.length-1; d >= 0;--d){
			for(var e=0; e < slave.currentRules.length;++e){
				if(slave.currentRules[e] == rules[d].ID){
					if (rules[d].clitPiercing != "no default setting"){
						return rules[d];
					}
				}
			}
		}return null;
	}
};
window.lastClitSettingRule = function(slave, rules) {
    if (!slave) {
        return null;
    }else if (!rules) {
        return null;
    }else if (!slave.currentRules) {
        return null;
    }else {
        for(var d=rules.length-1; d >= 0;--d){
            for(var e=0; e < slave.currentRules.length;++e){
                if(slave.currentRules[e] == rules[d].ID){
                    if (rules[d].clitSetting != "no default setting"){
                        return rules[d];
                    }
                }
            }
        }return null;
    }
};
window.lastVaginaPiercingRule = function(slave, rules) {
	if (!slave) {
		return null;
	}else if (!rules) {
		return null;
	}else if (!slave.currentRules) {
		return null;
	}else {
		for(var d=rules.length-1; d >= 0;--d){
			for(var e=0; e < slave.currentRules.length;++e){
				if(slave.currentRules[e] == rules[d].ID){
					if (rules[d].vaginaPiercing != "no default setting"){
						return rules[d];
					}
				}
			}
		}return null;
	}
};
window.lastDickPiercingRule = function(slave, rules) {
	if (!slave) {
		return null;
	}else if (!rules) {
		return null;
	}else if (!slave.currentRules) {
		return null;
	}else {
		for(var d=rules.length-1; d >= 0;--d){
			for(var e=0; e < slave.currentRules.length;++e){
				if(slave.currentRules[e] == rules[d].ID){
					if (rules[d].dickPiercing != "no default setting"){
						return rules[d];
					}
				}
			}
		}return null;
	}
};
window.lastAnusPiercingRule = function(slave, rules) {
	if (!slave) {
		return null;
	}else if (!rules) {
		return null;
	}else if (!slave.currentRules) {
		return null;
	}else {
		for(var d=rules.length-1; d >= 0;--d){
			for(var e=0; e < slave.currentRules.length;++e){
				if(slave.currentRules[e] == rules[d].ID){
					if (rules[d].anusPiercing != "no default setting"){
						return rules[d];
					}
				}
			}
		}return null;
	}
};
window.lastLipsPiercingRule = function(slave, rules) {
	if (!slave) {
		return null;
	}else if (!rules) {
		return null;
	}else if (!slave.currentRules) {
		return null;
	}else {
		for(var d=rules.length-1; d >= 0;--d){
			for(var e=0; e < slave.currentRules.length;++e){
				if(slave.currentRules[e] == rules[d].ID){
					if (rules[d].lipsPiercing != "no default setting"){
						return rules[d];
					}
				}
			}
		}return null;
	}
};
window.lastTonguePiercingRule = function(slave, rules) {
	if (!slave) {
		return null;
	}else if (!rules) {
		return null;
	}else if (!slave.currentRules) {
		return null;
	}else {
		for(var d=rules.length-1; d >= 0;--d){
			for(var e=0; e < slave.currentRules.length;++e){
				if(slave.currentRules[e] == rules[d].ID){
					if (rules[d].tonguePiercing != "no default setting"){
						return rules[d];
					}
				}
			}
		}return null;
	}
};
window.lastEarPiercingRule = function(slave, rules) {
	if (!slave) {
		return null;
	}else if (!rules) {
		return null;
	}else if (!slave.currentRules) {
		return null;
	}else {
		for(var d=rules.length-1; d >= 0;--d){
			for(var e=0; e < slave.currentRules.length;++e){
				if(slave.currentRules[e] == rules[d].ID){
					if (rules[d].earPiercing != "no default setting"){
						return rules[d];
					}
				}
			}
		}return null;
	}
};
window.lastEyebrowPiercingRule = function(slave, rules) {
	if (!slave) {
		return null;
	}else if (!rules) {
		return null;
	}else if (!slave.currentRules) {
		return null;
	}else {
		for(var d=rules.length-1; d >= 0;--d){
			for(var e=0; e < slave.currentRules.length;++e){
				if(slave.currentRules[e] == rules[d].ID){
					if (rules[d].earPiercing != "no default setting"){
						return rules[d];
					}
				}
			}
		}return null;
	}
};
window.lastNosePiercingRule = function(slave, rules) {
	if (!slave) {
		return null;
	}else if (!rules) {
		return null;
	}else if (!slave.currentRules) {
		return null;
	}else {
		for(var d=rules.length-1; d >= 0;--d){
			for(var e=0; e < slave.currentRules.length;++e){
				if(slave.currentRules[e] == rules[d].ID){
					if (rules[d].nosePiercing != "no default setting"){
						return rules[d];
					}
				}
			}
		}return null;
	}
};
window.lastNavelPiercingRule = function(slave, rules) {
	if (!slave) {
		return null;
	}else if (!rules) {
		return null;
	}else if (!slave.currentRules) {
		return null;
	}else {
		for(var d=rules.length-1; d >= 0;--d){
			for(var e=0; e < slave.currentRules.length;++e){
				if(slave.currentRules[e] == rules[d].ID){
					if (rules[d].navelPiercing != "no default setting"){
						return rules[d];
					}
				}
			}
		}return null;
	}
};
window.lastCorsetPiercingRule = function(slave, rules) {
	if (!slave) {
		return null;
	}else if (!rules) {
		return null;
	}else if (!slave.currentRules) {
		return null;
	}else {
		for(var d=rules.length-1; d >= 0;--d){
			for(var e=0; e < slave.currentRules.length;++e){
				if(slave.currentRules[e] == rules[d].ID){
					if (rules[d].corsetPiercing != "no default setting"){
						return rules[d];
					}
				}
			}
		}return null;
	}
};
window.lastBoobsTatRule = function(slave, rules) {
	if (!slave) {
		return null;
	}else if (!rules) {
		return null;
	}else if (!slave.currentRules) {
		return null;
	}else {
		for(var d=rules.length-1; d >= 0;--d){
			for(var e=0; e < slave.currentRules.length;++e){
				if(slave.currentRules[e] == rules[d].ID){
					if (rules[d].boobsTat != "no default setting"){
						return rules[d];
					}
				}
			}
		}return null;
	}
};
window.lastButtTatRule = function(slave, rules) {
	if (!slave) {
		return null;
	}else if (!rules) {
		return null;
	}else if (!slave.currentRules) {
		return null;
	}else {
		for(var d=rules.length-1; d >= 0;--d){
			for(var e=0; e < slave.currentRules.length;++e){
				if(slave.currentRules[e] == rules[d].ID){
					if (rules[d].buttTat != "no default setting"){
						return rules[d];
					}
				}
			}
		}return null;
	}
};
window.lastVaginaTatRule = function(slave, rules) {
	if (!slave) {
		return null;
	}else if (!rules) {
		return null;
	}else if (!slave.currentRules) {
		return null;
	}else {
		for(var d=rules.length-1; d >= 0;--d){
			for(var e=0; e < slave.currentRules.length;++e){
				if(slave.currentRules[e] == rules[d].ID){
					if (rules[d].vaginaTat != "no default setting"){
						return rules[d];
					}
				}
			}
		}return null;
	}
};
window.lastDickTatRule = function(slave, rules) {
	if (!slave) {
		return null;
	}else if (!rules) {
		return null;
	}else if (!slave.currentRules) {
		return null;
	}else {
		for(var d=rules.length-1; d >= 0;--d){
			for(var e=0; e < slave.currentRules.length;++e){
				if(slave.currentRules[e] == rules[d].ID){
					if (rules[d].dickTat != "no default setting"){
						return rules[d];
					}
				}
			}
		}return null;
	}
};
window.lastAnusTatRule = function(slave, rules) {
	if (!slave) {
		return null;
	}else if (!rules) {
		return null;
	}else if (!slave.currentRules) {
		return null;
	}else {
		for(var d=rules.length-1; d >= 0;--d){
			for(var e=0; e < slave.currentRules.length;++e){
				if(slave.currentRules[e] == rules[d].ID){
					if (rules[d].anusTat != "no default setting"){
						return rules[d];
					}
				}
			}
		}return null;
	}
};
window.lastLipsTatRule = function(slave, rules) {
	if (!slave) {
		return null;
	}else if (!rules) {
		return null;
	}else if (!slave.currentRules) {
		return null;
	}else {
		for(var d=rules.length-1; d >= 0;--d){
			for(var e=0; e < slave.currentRules.length;++e){
				if(slave.currentRules[e] == rules[d].ID){
					if (rules[d].lipsTat != "no default setting"){
						return rules[d];
					}
				}
			}
		}return null;
	}
};
window.lastShouldersTatRule = function(slave, rules) {
	if (!slave) {
		return null;
	}else if (!rules) {
		return null;
	}else if (!slave.currentRules) {
		return null;
	}else {
		for(var d=rules.length-1; d >= 0;--d){
			for(var e=0; e < slave.currentRules.length;++e){
				if(slave.currentRules[e] == rules[d].ID){
					if (rules[d].shouldersTat != "no default setting"){
						return rules[d];
					}
				}
			}
		}return null;
	}
};
window.lastArmsTatRule = function(slave, rules) {
	if (!slave) {
		return null;
	}else if (!rules) {
		return null;
	}else if (!slave.currentRules) {
		return null;
	}else {
		for(var d=rules.length-1; d >= 0;--d){
			for(var e=0; e < slave.currentRules.length;++e){
				if(slave.currentRules[e] == rules[d].ID){
					if (rules[d].armsTat != "no default setting"){
						return rules[d];
					}
				}
			}
		}return null;
	}
};
window.lastLegsTatRule = function(slave, rules) {
	if (!slave) {
		return null;
	}else if (!rules) {
		return null;
	}else if (!slave.currentRules) {
		return null;
	}else {
		for(var d=rules.length-1; d >= 0;--d){
			for(var e=0; e < slave.currentRules.length;++e){
				if(slave.currentRules[e] == rules[d].ID){
					if (rules[d].legsTat != "no default setting"){
						return rules[d];
					}
				}
			}
		}return null;
	}
};
window.lastStampTatRule = function(slave, rules) {
	if (!slave) {
		return null;
	}else if (!rules) {
		return null;
	}else if (!slave.currentRules) {
		return null;
	}else {
		for(var d=rules.length-1; d >= 0;--d){
			for(var e=0; e < slave.currentRules.length;++e){
				if(slave.currentRules[e] == rules[d].ID){
					if (rules[d].stampTat != "no default setting"){
						return rules[d];
					}
				}
			}
		}return null;
	}
};

window.lastLactationSurgeryRule = function(slave, rules) {
	if (!slave) {
		return null;
	}else if (!rules) {
		return null;
	}else if (!slave.currentRules) {
		return null;
	}else {
		for(var d=rules.length-1; d >= 0;--d){
			if (!rules[d].surgery) {
				return null;
			}
			for(var e=0; e < slave.currentRules.length;++e){
				if(slave.currentRules[e] == rules[d].ID){
					if (rules[d].surgery.lactation != "no default setting"){
						return rules[d];
					}
				}
			}
		}return null;
	}
};
window.lastLipSurgeryRule = function(slave, rules) {
	if (!slave) {
		return null;
	}else if (!rules) {
		return null;
	}else if (!slave.currentRules) {
		return null;
	}else {
		for(var d=rules.length-1; d >= 0;--d){
			if (!rules[d].surgery) {
				return null;
			}
			for(var e=0; e < slave.currentRules.length;++e){
				if(slave.currentRules[e] == rules[d].ID){
					if (rules[d].surgery.lips != "no default setting"){
						return rules[d];
					}
				}
			}
		}return null;
	}
};
window.lastBoobSurgeryRule = function(slave, rules) {
	if (!slave) {
		return null;
	}else if (!rules) {
		return null;
	}else if (!slave.currentRules) {
		return null;
	}else {
		for(var d=rules.length-1; d >= 0;--d){
			if (!rules[d].surgery) {
				return null;
			}
			for(var e=0; e < slave.currentRules.length;++e){
				if(slave.currentRules[e] == rules[d].ID){
					if (rules[d].surgery.boobs != "no default setting"){
						return rules[d];
					}
				}
			}
		}return null;
	}
};
window.lastButtSurgeryRule = function(slave, rules) {
	if (!slave) {
		return null;
	}else if (!rules) {
		return null;
	}else if (!slave.currentRules) {
		return null;
	}else {
		for(var d=rules.length-1; d >= 0;--d){
			if (!rules[d].surgery) {
				return null;
			}
			for(var e=0; e < slave.currentRules.length;++e){
				if(slave.currentRules[e] == rules[d].ID){
					if (rules[d].surgery.butt != "no default setting"){
						return rules[d];
					}
				}
			}
		}return null;
	}
};

window.checkThresholds = function(number, rule) {
	if (!rule) {
		return null;
	} else {
		if ((rule.thresholdUpper != "none") && (rule.thresholdLower != "none")){
			if (!rule.eqLower && !rule.eqUpper){
				if((number < rule.thresholdUpper) && (number > rule.thresholdLower)){
					return true;
				}
			}
			else if (rule.eqLower && !rule.eqUpper){
				if((number < rule.thresholdUpper) && (number >= rule.thresholdLower)){
					return true;
				}
			}
			else if (!rule.eqLower && rule.eqUpper){
				if((number <= rule.thresholdUpper) && (number > rule.thresholdLower)){
					return true;
				}
			}
			else {
				if((number <= rule.thresholdUpper) && (number >= rule.thresholdLower)){
					return true;
				}
			}
		}
		else if (rule.thresholdUpper != "none"){
			if (!rule.eqUpper) {
				if(number < rule.thresholdUpper){
					return true;
				}
			}
			else{
				if(number <= rule.thresholdUpper){
					return true;
				}
			}
		}
		else if (rule.thresholdLower != "none"){
			if (!rule.eqLower) {
				if(number > rule.thresholdLower){
					return true;
				}
			}
			else{
				if(number >= rule.thresholdLower){
					return true;
				}
			}
		}return false;
	}
};

window.removeFromArray = function(arr, val) {
	for (var i = 0; i < arr.length; i++)
		if (val == arr[i])
			return arr.splice(i,1);
	return null;
};


code:
:: Abort

<<set $nextButton to "Back">>\
<<set $nextLink to "Slave Interact">>\
<<nobr>>
The remote surgery makes aborting a pregnancy quick and efficient. $activeSlave.slaveName is
<<if $activeSlave.fetish is "pregnancy">>
	@@color: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 to "mindbroken">>
<<elseif $activeSlave.devotion < -50>>
	@@color: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 @@color:gold;terrified of your power@@ over her body.
	<<set  $activeSlave.trust -= 10>>
	<<set  $activeSlave.devotion -= 25>>
<<elseif $activeSlave.devotion < -20>>
	@@color: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 @@color:gold;terrified of your power@@ over her body.
	<<set  $activeSlave.trust -= 10>>
	<<set  $activeSlave.devotion -= 10>>
<<elseif $activeSlave.devotion <= 20>>
	@@color: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 @@color:gold;terrified of your power@@ over her body.
	<<set  $activeSlave.trust -= 10>>
	<<set  $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 @@color:gold;terrified of your power@@ over her body.
	<<set  $activeSlave.trust -= 10>>
<<else>>
	@@color: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>>

<<set _currentRule to lastPregRule($activeSlave,$defaultRules)>>

<<if ($activeSlave.assignmentVisible == 1) && (_currentRule != null)>><<set $activeSlave.preg to -1>><<else>><<set $activeSlave.preg to 0>><</if>>
<</nobr>>

repo_name: EstaUnCachucha/fc


code:
:: Acquisition [nobr]

<<set $ui to "start">>

<<if $saveImported == 1>>
	<<set $startingValue to 5000>>
<<else>>
	<<set $startingValue to 25000>>
<</if>>
<<set $showBodyMods to 1>>
<<set $heroSlaves to $heroSlaves.shuffle()>>

<<if $PC.vagina == 1>>
<<set $PC.births = 0>>
<<if $PC.career == "servant">>
	<<if $PC.age == 1>>
		<<set $PC.births = 3>>
		<<set $birthMaster = 3>>
	<<elseif $PC.age == 2>>
		<<set $PC.births = 6>>
		<<set $birthMaster = 6>>
	<<else>>
		<<set $PC.births = 9>>
		<<set $birthMaster = 9>>
	<</if>>
	<<for $i to 0; $i < $slaves.length; $i++>>
		<<if $activeSlave.origin == "She was another of your late master's servants. She spent nine months in your womb, courtesy of your master.">>
		<<set $PC.births += 1>>
		<<set $birthMaster += 1>>
		<</if>>
	<</for>>
<<elseif $PC.career == "escort">>
	<<for $i to 0; $i < $slaves.length; $i++>>
		<<if $activeSlave.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.">>
		<<set $PC.births += 1>>
		<<set $birthClient += 1>>
		<</if>>
	<</for>>
<<elseif $PC.career == "capitalist">>
	<<for $i to 0; $i < $slaves.length; $i++>>
		<<if $activeSlave.origin == "Sometimes it pays off to use your body in business deals, and other times you end up burdened with child. She is the result of the latter.">>
		<<set $PC.births += 1>>
		<<set $birthOther += 1>>
		<</if>>
	<</for>>
<<elseif $PC.career == "mercenary">>
	<<for $i to 0; $i < $slaves.length; $i++>>
		<<if $activeSlave.origin == "Drugs and alcohol can be a potent mix; the night that followed it can sometimes be hard to remember. Needless to say, once your belly began swelling with her, you had to temporarily switch to a desk job for your mercanary group.">>
		<<set $PC.births += 1>>
		<<set $birthOther += 1>>
		<</if>>
	<</for>>
<<elseif $PC.career == "slaver">>
	<<for $i to 0; $i < $slaves.length; $i++>>
		<<if $activeSlave.origin == "A fresh capture once overpowered you and had his way with you. You kept her as a painful reminder to never lower your guard again.">>
		<<set $PC.births += 1>>
		<<set $birthOther += 1>>
		<</if>>
	<</for>>
<<elseif $PC.career == "engineer">>
	<<for $i to 0; $i < $slaves.length; $i++>>
		<<if $activeSlave.origin == "You concieved her after a male arcology owner, impressed by your work, rewarded you with a nigt you'll never forget.">>
		<<set $PC.births += 1>>
		<<set $birthOther += 1>>
		<</if>>
	<</for>>
<<elseif $PC.career == "gang">>
	<<for $i to 0; $i < $slaves.length; $i++>>
		<<if $activeSlave.origin == "She was the result of a night of hard drugs and unprotected sex after a big score.">>
		<<set $PC.births += 1>>
		<<set $birthOther += 1>>
		<</if>>
	<</for>>
<<elseif $PC.career == "medicine">>
	<<for $i to 0; $i < $slaves.length; $i++>>
		<<if $activeSlave.origin == "She was concieved after a botched birth control expirement early in your career.">>
		<<set $PC.births += 1>>
		<<set $birthOther += 1>>
		<</if>>
	<</for>>
<<elseif $PC.career == "celebrity">>
	<<for $i to 0; $i < $slaves.length; $i++>>
		<<if $activeSlave.origin == "She was concieved after a night of partying and a torn condom. She nearly killed your career.">>
		<<set $PC.births += 1>>
		<<set $birthOther += 1>>
		<</if>>
	<</for>>
<<elseif $PC.career == "wealth">>
	<<for $i to 0; $i < $slaves.length; $i++>>
		<<if $activeSlave.origin == "You bet your body on a sure hand, only to lose. Nine months later, your daughter was born.">>
		<<set $PC.births += 1>>
		<<set $birthOther += 1>>
		<</if>>
	<</for>>
<</if>>
<<if $PC.preg > 0>>
	<<if $PC.career == "servant">>
		<<set $PC.pregSource = -3>>
	<<elseif $PC.career == "escort">>
		<<set $PC.pregSource = -2>>
	<</if>>
<</if>>
<</if>>

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, $PCName, 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 $saveImported == 1>>Since it took some time for you to move your personal entourage into $arcologies[0].name, he had the time to get most of his things away.<<else>>He could not get all of his personal effects away.<</if>>//

<<if $ageMode == 1>>
	<<display [[Aging Test]]>>
<<elseif $cheatMode == 1>>
	<<display [[Cheatmode Database]]>>
<<else>>
	<<set $seed to 0>>
	<<for $j to 0; $j < $heroSlaves.length; $j++>>
	<<if $startingValue - $seed <= 5000>>
		<<break>>
	<</if>>
	<<set $activeSlave to $heroSlaves[$j]>>
	<<set $dump to $heroSlaves.pluck($j,$j)>>
	<<slaveCost $activeSlave>>
	<<if $seed + $slaveCost < $startingValue*2>>
		<<display "Nationality to Accent">>
		<<set $activeSlave.pubicHColor to $activeSlave.hColor>>
		<<set $activeSlave.pubicHStyle to "waxed">>
		<<set $activeSlave.underArmHColor to $activeSlave.hColor>>
		<<set $activeSlave.underArmHStyle to "waxed">>
		<<set $activeSlave.oldDevotion to $activeSlave.devotion>>
		<<set $activeSlave.oldTrust to $activeSlave.trust>>
		<<set $seed += $slaveCost>>
		<<set $slaves.push($activeSlave)>>
		<<if $activeSlave.fetish is "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 is "pregnancy" && $activeSlave.preg > 10>>
			//$activeSlave.slaveName is currently in the dormitory masturbating over her growing pregnancy.//
		<<elseif $activeSlave.preg > 20>>
			//$activeSlave.slaveName is currently in the dormitory massaging her pregnant belly.//
		<<elseif $activeSlave.fetish is "buttslut">>
			//$activeSlave.slaveName is currently in the dormitory masturbating anally, and I believe she will be happy to meet you.//
		<<elseif $activeSlave.fetish is "cumslut">>
			//$activeSlave.slaveName is currently in the dormitory exhibiting oral fixation, and I believe she will be happy to meet you.//
		<<elseif $activeSlave.fetish is "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 is "pregnancy">>
			//$activeSlave.slaveName is currently in the dormitory examining herself to try to discern her fertility, and I believe she will be happy to meet you.//
		<<elseif $activeSlave.fetish is "humiliation">>
			//$activeSlave.slaveName is currently in the entryway flashing passersby, and I believe she will be happy to meet you.//
		<<elseif $activeSlave.fetish is "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 is "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 is "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 is "masochist">>
			//$activeSlave.slaveName is a sexual masochist; she is currently in the bathroom, experimenting with auto-flagellation with a wet towel.//
		<<elseif $activeSlave.fetish is "none">>
			//$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 $startingValue - $seed > 0>>
	//There are some valuables present, worth ¤<<print $startingValue - $seed>>.//
	<<set $cash += $startingValue - $seed>>
	<</if>>
<</if>>

/* RELATIONSHIP MUTUALITY CHECK, OLDMENTAL */

<<set $averageTrust = 0>>
<<set $averageDevotion = 0>>
<<set _slavesContributing = 0>>
<<for $i to 0; $i < $slaves.length; $i++>>
	<<if $familyTesting == 1>>
		<<set $slaves[$i].sisters = 0>>
		<<set $slaves[$i].daughters = 0>>
		<<for $j to 0; $j < $slaves.length; $j++>>
			<<if $slaves[$j].mother == $slaves[$i].ID || $slaves[$j].father == $slaves[$i].ID>>
				<<set $slaves[$i].daughters += 1>>
			<</if>>
			<<if areSisters($slaves[$j], $slaves[$i]) > 0>>
				<<set $slaves[$i].sisters += 1>>
			<</if>>
		<</for>>
	<</if>>
	<<if $familyTesting == 1>>
		<<set $slaves[$i].sisters = 0>>
		<<set $slaves[$i].daughters = 0>>
		<<for $j to 0; $j < $slaves.length; $j++>>
			<<if $slaves[$j].mother == $slaves[$i].ID || $slaves[$j].father == $slaves[$i].ID>>
				<<set $slaves[$i].daughters += 1>>
			<</if>>
			<<if areSisters($slaves[$j], $slaves[$i]) > 0>>
				<<set $slaves[$i].sisters += 1>>
			<</if>>
		<</for>>
	<</if>>
	<<if $slaves[$i].relation != 0>>
	<<set $seed to 0>>
	<<for $j to 0; $j < $slaves.length; $j++>>
		<<if $slaves[$i].relationTarget == $slaves[$j].ID>>
		<<if $slaves[$j].relationTarget == $slaves[$i].ID>>
		<<set $seed to 1>>
		<<break>>
		<</if>>
		<</if>>
	<</for>>
	<<if $seed == 0>>
		<<set $slaves[$i].relation to 0>>
		<<set $slaves[$i].relationTarget to 0>>
		<<goto "Acquisition">>
	<</if>>
	<</if>>
	<<set $slaves[$i].oldDevotion to $slaves[$i].devotion>>
	<<set $slaves[$i].oldTrust to $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>>
<<set $averageTrust = $averageTrust/_slavesContributing>>
<<set $averageDevotion = $averageDevotion/_slavesContributing>>
<<set $enduringTrust = $averageTrust>>
<<set $enduringDevotion = $averageDevotion>>

<<click "Continue">>
	<<set $ui to "main">>
	<<set $startingGirlsNationality to 0>>
	<<if $terrain is "urban">>
	<<set $minimumSlaveCost to 2000>>
	<<set $slaveCostFactor to 0.7>>
	<<elseif $terrain is "marine">>
	<<set $minimumSlaveCost to 2500>>
	<<set $slaveCostFactor to 1>>
	<<else>>
	<<set $minimumSlaveCost to 3000>>
	<<set $slaveCostFactor to 1.3>>
	<</if>>
	<>
	<<goto "Main">>
<</click>>


code:
:: Agent Company [nobr]

<<set $nextButton to "Continue">>
<<set $nextLink to "AS Dump">>
<<set $returnTo = "Main">>

<<set $activeSlave.assignment = "live with your agent">>
<<set $activeSlave.assignmentVisible = 0>>
<<set $activeSlave.sentence = 0>>
<<if $activeSlave.rivalry > 0>>
	<<for _i to 0;_i < $slaves.length;_i++>>
	<<if $activeSlave.rivalryTarget == $slaves[_i].ID>>
		<<set $slaves[_i].rivalry = 0>>
		<<set $slaves[_i].rivalryTarget = 0>>
	<</if>>
	<</for>>
	<<set $activeSlave.rivalry = 0>>
	<<set $activeSlave.rivalryTarget = 0>>
<</if>>
<<if $activeSlave.ID is $HeadGirl.ID>>
	<<set $HeadGirl to 0>>
<</if>>
<<if $activeSlave.ID is $Recruiter.ID>>
	<<set $Recruiter to 0>>
<</if>>
<<if $activeSlave.ID is $Bodyguard.ID>>
	<<set $Bodyguard to 0>>
<</if>>

<<for _i to 0;_i < $slaves.length;_i++>>
<<if $activeSlave.relationshipTarget == $slaves[_i].ID>>
	<<set $subSlave = $slaves[_i]>>
<</if>>
<</for>>

<<for _i to 0;_i < $arcologies.length;_i++>>
<<if $subSlave.ID == $arcologies[_i].leaderID>>
	<<set $activeArcology = $arcologies[_i]>>
<</if>>
<</for>>

<<SlaveTitle $activeSlave>>

Working in $activeArcology.name's penthouse office, $subSlave.slaveName gets a video call from you. Naturally, her personal assistant program has been instructed to give these the highest priority, and your face appears in front of her immediately. She greets you properly, and asks you what she can do to serve you. You tell her you're planning to send one of your slaves over to her arcology to assist her. Exchanges of this kind are neither unusual nor particularly interesting, so a slight look of perplexity clouds $subSlave.slaveName's face as she wonders why this merits a personal call. Normally, <<if $HeadGirl != 0>>$HeadGirl.slaveName<<else>>$assistantName<</if>> would handle it with her directly.

Her question is answered when you bring $activeSlave.slaveName in close, putting her in $subSlave.slaveName's view. $subSlave.slaveName's $subSlave.eyeColor eyes fly open with pleased surprise, but before she can speak, $activeSlave.slaveName goes first.
<<if canTalk($activeSlave) == false>>
  Unable to speak herself, she simply makes a heart shape with her hands in view of the video call, and blows her <<if $activeSlave.relationship == 4>>lover<<else>>wife<</if>> a kiss.
<<elseif SlaveStatsChecker.checkForLisp($activeSlave)>>
  "Hi <<if $activeSlave.relationship == 4>>lover<<else>>thweetheart<</if>>," she lisps in a syrupy tone. "Mith me?"
<<else>>
  "Hi <<if $activeSlave.relationship == 4>>lover<<else>>sweetheart<</if>>," she says in a syrupy tone. "Miss me?"
<</if>>

$subSlave.slaveName smiles back at her, glowing with pleasure, and responds with exaggerated arousal.

<<switch $subSlave.fetish>>
<<case "submissive">>
	<<if SlaveStatsChecker.checkForLisp($activeSlave)>>
	  "Looking forward to thleeping in your armth, babe,"
	<<else>>
	  "Looking forward to sleeping in your arms, babe,"
	<</if>>
	the submissive
<<case "cumslut">>
	<<if SlaveStatsChecker.checkForLisp($activeSlave)>>
	  "Can't wait to kith you, babe,"
	<<else>>
	  "Can't wait to kiss you, babe,"
	<</if>>
	the orally fixated
<<case "humiliation">>
	<<if SlaveStatsChecker.checkForLisp($activeSlave)>>
	  "Can't wait to take you right in the middle of the platha, here,"
	<<else>>
	  "Can't wait to take you right in the middle of the plaza, here,"
	<</if>>
	the exhibitionist
<<case "buttslut">>
	<<if SlaveStatsChecker.checkForLisp($activeSlave)>>
	  "I can't wait to fuck you in your hot little butt,"
	<<else>>
	  "I can't wait to fuck you in your hot little ass,"
	<</if>>
	the anally fixated
<<case "boobs">>
	<<if SlaveStatsChecker.checkForLisp($activeSlave)>>
	  "Looking forward to feeling your breathth again,"
	<<else>>
	  "Looking forward to feeling your breasts again,"
	<</if>>
	the boob-loving
<<case "pregnancy">>
	<<if SlaveStatsChecker.checkForLisp($activeSlave)>>
	  "Can't wait to share all the pregnant girlth here with you,"
	<<else>>
	  "Can't wait to share all the pregnant girls here with you,"
	<</if>>
	the impregnation fetishist
<<case "dom">>
	<<if SlaveStatsChecker.checkForLisp($activeSlave)>>
	  "Looking forward to shoving you fathedown, bitch,"
	<<else>>
	  "Looking forward to shoving you facedown, bitch,"
	<</if>>
	the dominant
<<case "sadist">>
	"Looking forward to making you bite the pillow again, bitch," the sadistic
<<case "masochist">>
	"Can't wait to feel you hurt me again, babe," the masochistic
<<default>>
	"Babe, I can't wait to give you a hug and tell you about $activeArcology.name," the loving
<</switch>>
leader of an entire arcology says.


code:
:: Agent Retrieve [nobr]

<<silently>>

<<for $i to 0; $i < $slaves.length; $i++>>
<<if $slaves[$i].ID == $activeArcology.leaderID>>
	<<for $j to 0; $j < $slaves.length; $j++>>
	<<if $slaves[$j].assignment == "live with your agent">>
	<<if $slaves[$j].ID == $slaves[$i].relationshipTarget>>
		<<set $slaves[$j].assignment = "rest">>
		<<set $slaves[$j].assignmentVisible = 1>>
		<<set $slaves[$j].sentence = 0>>
		<<break>>
	<</if>>
	<</if>>
	<</for>>
	<<if $slaves[$i].preg > 35>>
		<<set $slaves[$i].birthsTotal += $slaves[$i].pregType>>
		<<set $slaves[$i].preg = 0>>
		<<set $slaves[$i].pregSource = 0>>
		<<set $slaves[$i].pregType = 0>>
	<</if>>
	<<set $slaves[$i].assignment = "rest">>
	<<set $slaves[$i].assignmentVisible = 1>>
	<<set $slaves[$i].sentence = 0>>
	<<break>>
<</if>>
<</for>>

<<set $activeArcology.leaderID = 0>>
<<set $activeArcology.government = "your trustees">>

<<for _i to 0;_i < $leaders.length;_i++>>
<<if $activeArcology.leaderID == $leaders[_i].ID>>
	<<set $dump to $leaders.pluck([_i], [_i])>>
	<<break>>
<</if>>
<</for>>

<<goto "Neighbor Interact">>

<</silently>>


code:
:: Agent Select

<<set $nextButton to "Back">>
<<set $nextLink to "Neighbor Interact">>
<<set $showEncyclopedia to 1>><<set $encyclopedia to "Agents">>
''Appoint an Agent from your devoted slaves:''
<<display "Slave Summary">>


code:
:: Agent Workaround [nobr]

<<set $nextButton to "Continue">>
<<set $nextLink to "AS Dump">>
<<set $returnTo = "Neighbor Interact">>

<<set $activeSlave.assignment = "be your agent">>
<<set $activeSlave.assignmentVisible = 0>>
<<set $activeSlave.sentence = 0>>
<<if $activeSlave.relationship <= 3>>
<<if $activeSlave.relationship > 0>>
	<<for _i to 0;_i < $slaves.length;_i++>>
	<<if $activeSlave.relationshipTarget == $slaves[_i].ID>>
		<<set $slaves[_i].relationship = 0>>
		<<set $slaves[_i].relationshipTarget = 0>>
	<</if>>
	<</for>>
	<<set $activeSlave.relationship = 0>>
	<<set $activeSlave.relationshipTarget = 0>>
<</if>>
<</if>>
<<if $activeSlave.rivalry > 0>>
	<<for _i to 0;_i < $slaves.length;_i++>>
	<<if $activeSlave.rivalryTarget == $slaves[_i].ID>>
		<<set $slaves[_i].rivalry = 0>>
		<<set $slaves[_i].rivalryTarget = 0>>
	<</if>>
	<</for>>
	<<set $activeSlave.rivalry = 0>>
	<<set $activeSlave.rivalryTarget = 0>>
<</if>>

<<set $leaders.push($activeSlave)>>

<<set $activeArcology.leaderID = $activeSlave.ID>>
<<set $activeArcology.government = "your agent">>

<<SlaveTitle $activeSlave>>

You order $activeSlave.slaveName to come into your office for orders. The devoted $desc has no prior warning that this is anything unusual, and from the <<if $activeSlave.energy > 95>>horny glint<<else>>glow of sexual availability<</if>> in her $activeSlave.eyeColor eyes as she <<if canWalk($activeSlave)>>enters<<else>>is helped in<</if>>, she <<if $activeSlave.energy > 95>>seems to be hoping<<else>>wouldn't mind hearing<</if>> that you've called her in for a quick fuck. In fact, the matter at hand is about as far as it could possibly be from that, on the spectrum of interactions between <<if $PC.title != 0>>master<<else>>mistress<</if>> and slave.

You offer her, without preamble, agency on your behalf in $activeArcology.name. As a woman of intelligence, she knows the basics of such an arrangement, but she's stunned into silence by the offer, so you outline it briefly. Having a slave lead an arcology would be too much, even for the most open minded of Free Cities societies. So, she would be freed, albeit subject to a set of private, restrictive contracts that would allow you to recall her if you wish, and require her to follow your directions, if you give her any. But other than that, she would be the effective leader of an entire arcology. It's an unusual arrangement, but one that's becoming more common as multiple arcologies come under united control.

She's intelligent and confident of her place within society as a valued slave, and knows that with your resources behind her, this is likely something she's capable of succeeding at. Nevertheless, her feelings are obviously mixed. It will be a challenge,
<<switch $HeadGirl.fetish>>
<<case "submissive">>
	especially for a sexual submissive like her.
<<case "cumslut">>
	and she'll have to find dominant ways to sate her oral appetites.
<<case "humiliation">>
	especially for a humiliation addict like her.
<<case "buttslut">>
	though she'll probably be able to live her anal life vicariously by buttfucking others.
<<case "boobs">>
	but she'll have a practically infinite procession of breasts to judge and fondle.
<<case "pregnancy">>
	but the potential for impregnation of hundreds of slaves excites her.
<<case "dom">>
	but the prospect of having more slaves at her whim than even she could possibly use is incredibly exciting to her.
<<case "sadist">>
	but the prospect of having more slaves at her whim than even she could possibly break is incredibly exciting to her.
<<case "masochist">>
	especially for a masochist like her.
<<default>>
	though one she's willing to take on.
<</switch>>
It will mean that she'll see much less of you, something such a devoted slave may struggle with. Oppressed by the confusion and strength of her feelings, she begins to cry.

"Thank you,
<<if SlaveStatsChecker.checkForLisp($activeSlave)>>
  <<if def $PC.customTitleLisp>>$PC.customTitleLisp<<elseif $PC.title != 0>>Mathter<<else>>Mithtreth<</if>>," she gasps out. "I'll do my betht."
<<else>>
  <<if def $PC.customTitle>>$PC.customTitle<<elseif $PC.title != 0>>Master<<else>>Mistress<</if>>," she gasps out. "I'll do my best."
<</if>>


code:
:: AS Dump

<<set $dumped to 0>>

<<for $i to 0; $i < $slaves.length; $i++>>
	<<if $activeSlave.ID == $slaves[$i].ID>>
	<<set $slaves[$i] to $activeSlave>>
	<<set $activeSlave to {}>>
	<<set $dumped to 1>>
	<<break>>
	<</if>>
<</for>>

<<if $dumped == 0>>
	<<if def $activeSlave.slaveName>>
	<<display "Checkin Checks">>
	<<set $slaves.push($activeSlave)>>
	<<set $activeSlave to {}>>
	<<set $dumped to 1>>
	<</if>>
<</if>>

<<goto $returnTo>>


code:
:: custom Slaves Database

<<set _i = 1000000>>


code:
:: DF Slaves Database

<<set _i = 700000>>
<<set _HS = clone($activeSlave)>>
<<set _HS.slaveName = "Cherry", _HS.birthName = "Cherry", _HS.ID = _i++, _HS.birthWeek = random(0,51), _HS.health = 20, _HS.devotion = 75, _HS.pubicHColor = "black", _HS.skin = "white", _HS.hColor = "black", _HS.hStyle = "long", _HS.pubicHStyle = "waxed", _HS.boobs = 500, _HS.nipplesPiercing = 1, _HS.butt = 3, _HS.lips = 35, _HS.vagina = 1, _HS.vaginaLube = 1, _HS.vaginaPiercing = 2, _HS.preg = -2, _HS.ovaries = 1, _HS.vaginalSkill = 35, _HS.attrXY = 40, _HS.fetish = "submissive", _HS.fetishKnown = 1, _HS.customTat = "Two cherries are tattooed in her right butt cheek and in her left cheek.">>
	Vag implant, vibe nips
<<set $heroSlaves.push(clone(_HS))>>

<<set _HS = clone($activeSlave)>>
<<set _HS.slaveName = "Strawberry", _HS.birthName = "Strawberry", _HS.ID = _i++, _HS.birthWeek = random(0,51), _HS.actualAge = 30, _HS.physicalAge = 30, _HS.visualAge = 30, _HS.health = 20, _HS.devotion = 40, _HS.height = 175, _HS.hColor = "blonde", _HS.pubicHColor = "blonde", _HS.skin = "tanned", _HS.hStyle = "long", _HS.pubicHStyle = "waxed", _HS.waist = 1, _HS.boobs = 1000, _HS.boobsImplant = 400, _HS.nipplesPiercing = 1, _HS.butt = 5, _HS.buttImplant = 2, _HS.lips = 35, _HS.lipsImplant = 10, _HS.vagina = 2, _HS.vaginaLube = 1, _HS.vaginaPiercing = 2, _HS.preg = -2, _HS.anus = 2, _HS.ovaries = 1, _HS.vaginalSkill = 35, _HS.oralSkill = 35, _HS.analSkill = 35, _HS.attrXY = 40, _HS.fetish = "humiliation", _HS.fetishKnown = 1, _HS.customTat = "Strawberries are tattooed on her right buttock and on her left cheek.">>
	vibe nips, muscles
<<set $heroSlaves.push(clone(_HS))>>

<<set _HS = clone($activeSlave)>>
<<set _HS.slaveName = "Melon", _HS.birthName = "Melon", _HS.ID = _i++, _HS.birthWeek = random(0,51), _HS.actualAge = 23, _HS.physicalAge = 23, _HS.visualAge = 23, _HS.health = 20, _HS.devotion = 30, _HS.height = 175, _HS.hColor = "red", _HS.pubicHColor = "red", _HS.skin = "tanned", _HS.hLength = 10, _HS.hStyle = "short", _HS.pubicHStyle = "waxed", _HS.boobs = 1800, _HS.boobsImplant = 800, _HS.nipplesPiercing = 1, _HS.butt = 4, _HS.lips = 35, _HS.lipsImplant = 10, _HS.vagina = 2, _HS.vaginaLube = 1, _HS.vaginaPiercing = 2, _HS.preg = -2, _HS.anus = 2, _HS.ovaries = 1, _HS.vaginalSkill = 15, _HS.oralSkill = 100, _HS.analSkill = 15, _HS.attrXY = 40, _HS.fetish = "submissive", _HS.fetishKnown = 1, _HS.customTat = "Watermelons are tattooed on her buttocks and on her face.">>
	vibe nips, saliva implant
<<set $heroSlaves.push(clone(_HS))>>

<<set _HS = clone($activeSlave)>>
<<set _HS.slaveName = "Carambola", _HS.birthName = "Carambola", _HS.ID = _i++, _HS.birthWeek = random(0,51), _HS.actualAge = 25, _HS.physicalAge = 25, _HS.visualAge = 25, _HS.health = 20, _HS.devotion = 50, _HS.height = 175, _HS.hColor = "dark blonde", _HS.pubicHColor = "dark blonde", _HS.skin = "tanned", _HS.hLength = 60, _HS.hStyle = "curly and long, and in pigtails", _HS.pubicHStyle = "waxed", _HS.boobs = 650, _HS.nipplesPiercing = 1, _HS.butt = 8, _HS.buttImplant = 4, _HS.lips = 35, _HS.vagina = 1, _HS.vaginaLube = 1, _HS.vaginaPiercing = 2, _HS.preg = -2, _HS.anus = 3, _HS.ovaries = 1, _HS.vaginalSkill = 15, _HS.oralSkill = 15, _HS.analSkill = 100, _HS.attrXY = 40, _HS.fetish = "buttslut", _HS.fetishKnown = 1, _HS.customTat = "Carambolas – starfruits - are tattooed on her buttocks and on her face.">>
	vibe nips, saliva implant lube
<<set $heroSlaves.push(clone(_HS))>>

<<set _HS = clone($activeSlave)>>
<<set _HS.slaveName = "Banana", _HS.birthName = "Banana", _HS.ID = _i++, _HS.birthWeek = random(0,51), _HS.actualAge = 28, _HS.physicalAge = 28, _HS.visualAge = 28, _HS.health = 20, _HS.devotion = 30, _HS.race = "latina", _HS.hColor = "black", _HS.pubicHColor = "black", _HS.skin = "light brown", _HS.hLength = 0, _HS.hStyle = "shaved bald", _HS.pubicHStyle = "waxed", _HS.boobs = 400, _HS.nipplesPiercing = 1, _HS.butt = 5, _HS.lips = 35, _HS.vagina = 2, _HS.vaginaLube = 1, _HS.vaginaPiercing = 2, _HS.preg = -2, _HS.anus = 2, _HS.ovaries = 1, _HS.vaginalSkill = 35, _HS.oralSkill = 100, _HS.analSkill = 35, _HS.attrXY = 40, _HS.fetish = "submissive", _HS.fetishKnown = 1, _HS.customTat = "Bananas are tattooed on her buttocks and on her face.">>
	vibe nips, big pusslips+clit
<<set $heroSlaves.push(clone(_HS))>>

<<set _HS = clone($activeSlave)>>
<<set _HS.slaveName = "Green Grape", _HS.birthName = "Green Grape", _HS.ID = _i++, _HS.birthWeek = random(0,51), _HS.health = 20, _HS.devotion = 40, _HS.race = "pacific islander", _HS.hColor = "black", _HS.pubicHColor = "black", _HS.skin = "pale", _HS.hStyle = "long", _HS.pubicHStyle = "waxed", _HS.boobs = 650, _HS.nipplesPiercing = 1, _HS.butt = 4, _HS.vagina = 1, _HS.vaginaLube = 1, _HS.vaginaPiercing = 2, _HS.preg = -2, _HS.anus = 1, _HS.ovaries = 1, _HS.vaginalSkill = 35, _HS.oralSkill = 35, _HS.analSkill = 35, _HS.attrXX = 80, _HS.attrXY = 40, _HS.fetishKnown = 1, _HS.customTat = "Green grapes are tattooed on her buttocks and on her face.", _HS.mother = -100000, _HS.father = -100000>>
	vibe nips, implant link to sister
<<set $heroSlaves.push(clone(_HS))>>

<<set _HS = clone($activeSlave)>>
<<set _HS.slaveName = "Purple Grape", _HS.birthName = "Purple Grape", _HS.ID = _i++, _HS.birthWeek = random(0,51), _HS.actualAge = 23, _HS.physicalAge = 23, _HS.visualAge = 23, _HS.health = 20, _HS.devotion = 40, _HS.race = "pacific islander", _HS.hColor = "black", _HS.pubicHColor = "black", _HS.skin = "light brown", _HS.hLength = 60, _HS.hStyle = "long", _HS.pubicHStyle = "waxed", _HS.boobs = 650, _HS.nipplesPiercing = 1, _HS.butt = 4, _HS.vagina = 1, _HS.vaginaLube = 1, _HS.vaginaPiercing = 2, _HS.preg = -2, _HS.anus = 1, _HS.ovaries = 1, _HS.vaginalSkill = 35, _HS.oralSkill = 35, _HS.analSkill = 35, _HS.attrXX = 80, _HS.attrXY = 40, _HS.fetishKnown = 1, _HS.customTat = "Purple grapes are tattooed on her buttocks and on her face.", _HS.mother = -100000, _HS.father = -100000>>
	vibe nips, implant link to sister
<<set $heroSlaves.push(clone(_HS))>>

<<set _HS = clone($activeSlave)>>
<<set _HS.slaveName = "Apple", _HS.birthName = "Apple", _HS.ID = _i++, _HS.birthWeek = random(0,51), _HS.actualAge = 28, _HS.physicalAge = 28, _HS.visualAge = 28, _HS.health = 20, _HS.devotion = 40, _HS.muscles = 20, _HS.pubicHColor = "black", _HS.skin = "pale", _HS.hColor = "black", _HS.hStyle = "long", _HS.pubicHStyle = "waxed", _HS.boobs = 500, _HS.nipplesPiercing = 1, _HS.butt = 3, _HS.lips = 55, _HS.lipsTat = "permanent makeup", _HS.vagina = 3, _HS.vaginaLube = 1, _HS.vaginaPiercing = 2, _HS.preg = -2, _HS.ovaries = 1, _HS.vaginalSkill = 15, _HS.oralSkill = 15, _HS.vaginalAccessory = "large dildo", _HS.buttplug = "large plug", _HS.attrXY = 40, _HS.fetish = "submissive", _HS.fetishKnown = 1, _HS.customTat = "Cored apples are tattooed on her buttocks and on her face.">>
	vibe nips, stupid, sensitive, no masturb implant
<<set $heroSlaves.push(clone(_HS))>>

<<if $seeExtreme == 1>>
<<set _HS = clone($activeSlave)>>
<<set _HS.slaveName = "Plum", _HS.birthName = "Plum", _HS.ID = _i++, _HS.birthWeek = random(0,51), _HS.actualAge = 28, _HS.physicalAge = 28, _HS.visualAge = 28, _HS.health = 20, _HS.devotion = 75, _HS.muscles = 20, _HS.hColor = "wavy brown", _HS.skin = "pale", _HS.hLength = 20, _HS.hStyle = "short", _HS.pubicHStyle = "waxed", _HS.boobs = 400, _HS.nipplesPiercing = 1, _HS.butt = 2, _HS.lips = 35, _HS.vagina = 3, _HS.vaginaLube = 1, _HS.vaginaPiercing = 2, _HS.preg = -2, _HS.anus = 2, _HS.ovaries = 1, _HS.vaginalSkill = 15, _HS.oralSkill = 15, _HS.analSkill = 15, _HS.vaginalAccessory = "large dildo", _HS.buttplug = "large plug", _HS.attrXY = 40, _HS.fetish = "mindbroken", _HS.fetishKnown = 1, _HS.customTat = "cored plums are tattooed on her buttocks and on her face.", _HS.customDesc = "She has massive C-clamp piercings in her back that allow her to act as furniture. Truly enormous vagina.">>
	vibe nips, can act as furniture
<<set $heroSlaves.push(clone(_HS))>>
<</if>>