code:
:: assignJob [script]

window.assignJob = function assignJob(slave, job) {
	"use strict";
	const V = State.variables;
	let r = "";

	if (job === "Pit" || job === "Coursing Association")
		return r;

	removeJob(slave, slave.assignment);
	const idx = V.slaveIndices[slave.ID];

	/* use .toLowerCase() to get rid of a few dupe conditions. */
	switch (job.toLowerCase()) {
		case "be confined in the arcade":
		case "arcade":
			slave.assignment = "be confined in the arcade";
			slave.assignmentVisible = 0;
			V.arcadeSlaves++;
			V.ArcadeiIDs.push(slave.ID);
			slave.clothing = "none";
			slave.shoes = "none";
			slave.collar = "none";
			slave.livingRules = "spare";
			break;

		case "work in the brothel":
		case "brothel":
			slave.assignment = "work in the brothel";
			slave.assignmentVisible = 0;
			V.brothelSlaves++;
			V.BrothiIDs.push(slave.ID);
			switch (V.brothelDecoration) {
				case "Degradationist":
				case "standard":
					slave.livingRules = "spare";
					break;
				default:
					slave.livingRules = "normal";
					break;
			}
			break;

		case "be confined in the cellblock":
		case "cellblock":
			slave.assignment = "be confined in the cellblock";
			slave.assignmentVisible = 0;
			V.cellblockSlaves++;
			V.CellBiIDs.push(slave.ID);
			switch (V.cellblockDecoration) {
				case "Paternalist":
					slave.livingRules = "normal";
					break;
				default:
					slave.livingRules = "spare";
					break;
			}
			break;

		case "get treatment in the clinic":
		case "clinic":
			slave.assignment = "get treatment in the clinic";
			slave.assignmentVisible = 0;
			V.clinicSlaves++;
			V.CliniciIDs.push(slave.ID);
			switch (V.clinicDecoration) {
				case "Repopulation Focus":
				case "Eugenics":
				case "Gender Radicalist":
				case "Gender Fundamentalist":
				case "Paternalist":
				case "Maturity Preferentialist":
				case "Youth Preferentialist":
				case "Slimness Enthusiast":
				case "Hedonistic":
					slave.livingRules = "luxurious";
					break;

				case "Roman Revivalist":
				case "Aztec Revivalist":
				case "Egyptian Revivalist":
				case "Arabian Revivalist":
				case "Chinese Revivalist":
				case "Chattel Religionist":
				case "Edo Revivalist":
					slave.livingRules = "normal";
					break;

				default:
					slave.livingRules = "spare";
					break;
			}
			break;

		case "serve in the club":
		case "club":
			slave.assignment = "serve in the club";
			slave.assignmentVisible = 0;
			V.clubSlaves++;
			V.ClubiIDs.push(slave.ID);
			slave.livingRules = "normal";
			break;

		case "work in the dairy":
		case "dairy":
			slave.assignment = "work in the dairy";
			slave.assignmentVisible = 0;
			V.dairySlaves++;
			V.DairyiIDs.push(slave.ID);
			switch (V.dairyDecoration) {
				case "Roman Revivalist":
				case "Aztec Revivalist":
				case "Chinese Revivalist":
				case "Chattel Religionist":
				case "Edo Revivalist":
				case "Arabian Revivalist":
				case "Egyptian Revivalist":
				case "Supremacist":
				case "Subjugationist":
				case "Degradationist":
					slave.livingRules = "spare";
					break;
				default:
					slave.livingRules = "normal";
					break;
			}
			break;

		case "live with your head girl":
		case "head girl suite":
		case "hgsuite":
			slave.assignment = "live with your Head Girl";
			slave.assignmentVisible = 0;
			V.HGSuiteSlaves++;
			V.HGSuiteiIDs.push(slave.ID);
			slave.livingRules = "luxurious";
			break;

		case "serve in the master suite":
		case "master suite":
		case "mastersuite":
			slave.assignment = "serve in the master suite";
			slave.assignmentVisible = 0;
			V.masterSuiteSlaves++;
			V.MastSiIDs.push(slave.ID);
			if(V.masterSuiteUpgradeLuxury > 0)
				slave.livingRules = "luxurious";
			else
				slave.livingRules = "spare";
			break;

		case "learn in the schoolroom":
		case "schoolroom":
			slave.assignment = "learn in the schoolroom";
			slave.assignmentVisible = 0;
			V.schoolroomSlaves++;
			V.SchlRiIDs.push(slave.ID);
			slave.livingRules = "normal";
			break;

		case "work as a servant":
		case "servants' quarters":
		case "servantsquarters":
			slave.assignment = "work as a servant";
			slave.assignmentVisible = 0;
			V.servantsQuartersSlaves++;
			V.ServQiIDs.push(slave.ID);
			switch (V.servantsQuartersDecoration) {
				case "Roman Revivalist":
				case "Aztec Revivalist":
				case "Chinese Revivalist":
				case "Chattel Religionist":
				case "Edo Revivalist":
				case "Supremacist":
				case "Subjugationist":
				case "Degradationist":
				case "Arabian Revivalist":
				case "Egyptian Revivalist":
					slave.livingRules = "spare";
					break;
				default:
					slave.livingRules = "normal";
					break;
			}
			break;

		case "rest in the spa":
		case "spa":
			slave.assignment = "rest in the spa";
			slave.assignmentVisible = 0;
			V.spaSlaves++;
			V.SpaiIDs.push(slave.ID);
			switch (V.spaDecoration) {
				case "Chattel Religionist":
				case "Chinese Revivalist":
					slave.livingRules = "normal";
					break;
				case "Degradationist":
					slave.livingRules = "spare";
					break;
				default:
					slave.livingRules = "luxurious";
					break;
			}
			break;

		case "be the attendant":
		case "be the dj":
		case "be the madam":
		case "be the milkmaid":
		case "be the nurse":
		case "be the schoolteacher":
		case "be the stewardess":
		case "be the wardeness":
			slave.assignment = job;
			slave.assignmentVisible = 0;     /* non-visible leadership roles */
			slave.livingRules = "luxurious";
			break;

		case "be your concubine":
			slave.assignment = job;
			slave.assignmentVisible = 0;     /* non-visible leadership roles */
			if(V.masterSuiteUpgradeLuxury > 0)
				slave.livingRules = "luxurious";
			else
				slave.livingRules = "normal";
			break;

		case "be your head girl":
			slave.assignment = job;
			if (V.HGSuite === 1) {
				slave.livingRules = "luxurious";
			}
			break;

		case "guard you":
			slave.assignment = job;
			if (V.dojo > 1) {
				slave.livingRules = "luxurious";
			}
			if (V.pitBG == 1 && V.fighterIDs.includes(slave.ID))
				V.fighterIDs.delete(slave.ID);
			break;

		case "be your agent":
		case "live with your agent":
			slave.assignment = job;
			slave.assignmentVisible = 0;
			slave.useRulesAssistant = 0; /* non-visible roles exempt from Rules Assistant */
			if (job === "be your agent") {
				V.leaders.push(slave);
			}
			break;

		case "choose her own job":
			slave.assignment = job;
			slave.choosesOwnAssignment = 1;  /* removeJob already set assignmentVisible = 1 */
			break;

		default:
			slave.assignment = job; /* removeJob already set assignmentVisible = 1 and choosesOwnAssignment = 0 */
			break;
	}

	if (slave.assignmentVisible === 0 && Array.isArray(V.personalAttention)) {
		const awi = V.personalAttention.findIndex(function(s) { return s.ID === slave.ID; });
		if (awi != -1) {
			V.personalAttention.deleteAt(awi);
			if (V.personalAttention.length === 0) {
				if (V.PC.career === "escort")
					V.personalAttention = "whoring";
				else if (V.PC.career === "servant")
					V.personalAttention = "upkeep";
				else
					V.personalAttention = "business";
				r += `${slave.slaveName} no longer has your personal attention; you plan to focus on ${V.personalAttention}.`;
			} else
				r += `${slave.slaveName} no longer has your personal attention.`;
		}
	}
	if (idx >= 0)
		V.slaves[idx] = slave;

	return r;
};

window.removeJob = function removeJob(slave, assignment) {
	"use strict";
	const V = State.variables;
	let r = "";

	const idx = V.slaveIndices[slave.ID];

	if (assignment === "Pit")
		V.fighterIDs.delete(slave.ID);

	else if (assignment === "Coursing Association")
		V.Lurcher = 0;

	else {
		if (V.HeadGirl !== 0 && slave.ID === V.HeadGirl.ID)
			V.HeadGirl = 0;
		if (V.Recruiter !== 0 && slave.ID == V.Recruiter.ID)
			V.Recruiter = 0;
		if (V.Bodyguard !== 0 && slave.ID === V.Bodyguard.ID)
			V.Bodyguard = 0;
		if (V.Madam !== 0 && slave.ID === V.Madam.ID)
			V.Madam = 0;
		if (V.DJ !== 0 && slave.ID === V.DJ.ID)
			V.DJ = 0;
		if (V.Milkmaid !== 0 && slave.ID === V.Milkmaid.ID)
			V.Milkmaid = 0;
		if (V.Schoolteacher !== 0 && slave.ID === V.Schoolteacher.ID)
			V.Schoolteacher = 0;
		if (V.Attendant !== 0 && slave.ID === V.Attendant.ID)
			V.Attendant = 0;
		if (V.Nurse !== 0 && slave.ID === V.Nurse.ID)
			V.Nurse = 0;
		if (V.Stewardess !== 0 && slave.ID === V.Stewardess.ID)
			V.Stewardess = 0;
		if (V.Wardeness !== 0 && slave.ID === V.Wardeness.ID)
			V.Wardeness = 0;
		if (V.Concubine !== 0 && slave.ID === V.Concubine.ID)
			V.Concubine = 0;
		if (V.Collectrix !== 0 && slave.ID === V.Collectrix.ID)
			V.Collectrix = 0;

		/* use .toLowerCase() to get rid of a few dupe conditions. */
		switch (assignment.toLowerCase()) {
		case "be confined in the arcade":
		case "arcade":
			slave.assignment = "work a glory hole";
			V.ArcadeiIDs.delete(slave.ID);
			V.arcadeSlaves--;
			break;

		case "work in the brothel":
		case "brothel":
			slave.assignment = "whore";
			V.BrothiIDs.delete(slave.ID);
			V.brothelSlaves--;
			break;

		case "be confined in the cellblock":
		case "cellblock":
			slave.assignment = "rest";
			if (slave.inflation > 0) {
				slave.inflation = 0;
				slave.inflationType = "none";
				slave.inflationMethod = 0;
				SetBellySize(slave);
			}
			V.CellBiIDs.delete(slave.ID);
			V.cellblockSlaves--;
			break;

		case "get treatment in the clinic":
		case "clinic":
			slave.assignment = "rest";
			V.CliniciIDs.delete(slave.ID);
			V.clinicSlaves--;
			break;

		case "serve in the club":
		case "club":
			slave.assignment = "serve the public";
			V.ClubiIDs.delete(slave.ID);
			V.clubSlaves--;
			break;

		case "work in the dairy":
		case "dairy":
			slave.assignment = "get milked";
			V.DairyiIDs.delete(slave.ID);
			V.dairySlaves--;
			break;

		case "learn in the schoolroom":
		case "schoolroom":
			slave.assignment = "rest";
			V.SchlRiIDs.delete(slave.ID);
			V.schoolroomSlaves--;
			break;

		case "rest in the spa":
		case "spa":
			slave.assignment = "rest";
			V.SpaiIDs.delete(slave.ID);
			V.spaSlaves--;
			break;

		case "work as a servant":
		case "servants' quarters":
		case "servantsquarters":
			slave.assignment = "be a servant";
			V.ServQiIDs.delete(slave.ID);
			V.servantsQuartersSlaves--;
			break;

		case "serve in the master suite":
		case "master suite":
		case "mastersuite":
			slave.assignment = "please you";
			V.MastSiIDs.delete(slave.ID);
			V.masterSuiteSlaves--;
			break;

		case "live with your head girl":
		case "head girl suite":
		case "hgsuite":
			slave.assignment = "rest";
			V.HGSuiteiIDs.delete(slave.ID);
			V.HGSuiteSlaves--;
			break;

		case "be your head girl":
			slave.assignment = "rest";
			if (V.HGSuiteEquality === 0 && V.personalAttention === "HG") {
				if (V.PC.career === "escort")
					V.personalAttention = "whoring";
				else if (V.PC.career === "servant")
					V.personalAttention = "upkeep";
				else
					V.personalAttention = "business";

				r += `You no longer have a slave assigned to be your Head Girl, so you turn your personal attention to focus on ${V.personalAttention}.`;
			}
			break;

		case "be your agent":
		case "live with your agent":
			slave.assignment = "rest";
			const _leaderIndex = V.leaders.findIndex(function(x) { return x.ID === slave.ID; });
			if (_leaderIndex !== -1)
				V.leaders.deleteAt(_leaderIndex);

			if (slave.relationshipTarget > 0) { /* following code assumes there can be at most one companion */
				const _lover = V.slaves.findIndex(function(s) { return haveRelationshipP(s, slave) && s.assignment === "live with your agent"; });
				if (_lover !== -1) {
					V.slaves[_lover].assignment = "rest";
					V.slaves[_lover].assignmentVisible = 1;
				}
			}
			break;

		default:
			slave.assignment = "rest";
			break;
		}

		if (slave.livingRules === "luxurious" && slave.assignmentVisible !== 1)
			slave.livingRules = "normal";

		slave.assignmentVisible = 1;
		slave.choosesOwnAssignment = 0;
		slave.sentence = 0;
	}
	if (idx >= 0)
		V.slaves[idx] = slave;

	return r;
};


code:
:: clothingSelectionJS [script]

window.todaysOutfit = function(slave) {
	var ArcologyZero = State.variables.arcologies[0];
	var player = State.variables.PC;
	var clothing = [];
	var wardrobeAssignment = [];
	var wardrobeFS = [];
	var wardrobeTastes = [];
	var selection;

	const pronouns = getPronouns(slave);
	const he = pronouns.pronoun;
	const him = pronouns.object;
	const his = pronouns.possessive;
	const hers = pronouns.posessivePronoun;
	const himself = pronouns.objectReflexive;
	const boy = pronouns.noun;
	const He = capFirstChar(he);
	const His = capFirstChar(his);

	if(slave.fetish == 'mindbroken') {
		if(ArcologyZero.FSChattelReligionist > 0) {
			selection = {text: `${he} commonly sees others wearing chattel habits and is drawn to doing so ${himself}.`, clothes: "a chattel habit"};
		} else {
			clothing.push('panties');
			if(ArcologyZero.FSEgyptianRevivalist > 0) {
				clothing.push('egyptian');
			} else if(ArcologyZero.FSRomanRevivalist > 0) {
				clothing.push('roman');
			} else if(ArcologyZero.FSAztecRevivalist > 0) {
				clothing.push('aztec');
			} else if(ArcologyZero.FSEdoRevivalist > 0) {
				clothing.push('edo');
			} else if(ArcologyZero.FSArabianRevivalist > 0) {
				clothing.push('arabic');
			} else if(ArcologyZero.FSChineseRevivalist > 0) {
				clothing.push('chinese');
			}
			if(ArcologyZero.FSGenderFundamentalist > 0) {
				clothing.push('genderFund');
			}
			if(ArcologyZero.FSPaternalist > 0) {
				clothing.push('paternalist');
			} else if(ArcologyZero.FSDegradationist > 0) {
				clothing.push('degradationist');
			}
			if(ArcologyZero.FSMaturityPreferentialist > 0) {
				clothing.push('mature');
			} else if(ArcologyZero.FSYouthPreferentialist > 0) {
				clothing.push('youth');
			}
			if(ArcologyZero.FSPhysicalIdealist > 0) {
				clothing.push('physicalIdealist');
			}
			if(ArcologyZero.FSPastoralist > 0) {
				clothing.push('pastoralist');
			}
			if(ArcologyZero.FSBodyPurist > 0) {
				clothing.push('bodyPurist');
			}
			clothing = jsEither(clothing);
			switch(clothing) {
			case 'egyptian':
				selection = {text: `${he} commonly sees others wearing nothing but jewelry and is drawn to doing so ${himself}.`, clothes: "slutty jewelry"};
				break;
			case 'roman':
				selection = {text: `${he} commonly sees others wearing togas and is drawn to doing so ${himself}.`, clothes: "a toga"};
				break;
			case 'aztec':
				selection = {text: `${he} commonly sees others wearing huipils and is drawn to doing so ${himself}.`, clothes: "a huipil"};
				break;
			case 'edo':
				selection = {text: `${he} commonly sees others wearing kimonos and is drawn to doing so ${himself}.`, clothes: "a kimono"};
				break;
			case 'arabic':
				selection = {text: `${he} commonly sees others wearing silk and is drawn to doing so ${himself}.`, clothes: "harem gauze"};
				break;
			case 'chinese':
				selection = {text: `${he} commonly sees others wearing qipaos and is drawn to doing so ${himself}.`, clothes: "a slutty qipao"};
				break;
			case 'genderFund':
				if(jsRandom(1,2) == 1) {
					selection = {text: `${he} commonly sees cheerleaders around and instinctually follows along.`, clothes: jsEither(['a cheerleader outfit', 'a schoolgirl outfit'])};
				} else {
					selection = {text: `${he} commonly sees bunnies around and instinctually follows along.`, clothes: "a bunny outfit"};
				}
				break;
			case 'paternalist':
				selection = {text: `${he} commonly sees others wearing clothing and is drawn to doing so ${himself}.`, clothes: "conservative clothing"};
				break;
			case 'degradationist':
				selection = {text: `${he} commonly sees others wearing chains and is drawn to doing so ${himself}.`, clothes: jsEither(['chains', 'uncomfortable straps', 'shibari ropes'])};
				break;
			case 'mature':
				selection = {text: `${he} commonly sees others wearing suits and is drawn to doing so ${himself}.`, clothes: jsEither(['slutty business attire', 'a nice maid outfit', 'a military uniform', 'a schutzstaffel uniform', 'a slutty schutzstaffel uniform', 'a red army uniform', 'a mounty outfit', 'nice business attire'])};
				break;
			case 'youth':
				selection = {text: `${he} commonly sees schoolgirls around and instinctually follows along.`, clothes: jsEither(['a schoolgirl outfit', 'a cheerleader outfit'])};
				break;
			case 'physicalIdealist':
				selection = {text: `${he} commonly sees naked girls around and seldom realizes they are coated in oil.`, clothes: jsEither(['body oil', 'no clothing', 'no clothing'])};
				break;
			case 'pastoralist':
				selection = {text: `${he} commonly sees cowgirls around and instinctually follows along.`, clothes: "Western clothing"};
				break;
			case 'bodyPurist':
				selection = {text: `${he} commonly sees others wearing tight, form-fitting clothes and is drawn to doing so ${himself}.`, clothes: jsEither(['a leotard', 'a string bikini', 'a slave gown', 'a comfortable bodysuit', 'restrictive latex', 'clubslut netting', 'a leotard', 'a halter top dress'])};
				break;
			default:
				selection = {text: `${he} chooses to put on underwear, the reasons lost to ${him}, and moves on.`, clothes: "attractive lingerie"};
				break;
			}
		}
	} else if(slave.devotion <= 20) {
		clothing.push({text: `${He} uses the ability to select outfits to cover up with comfortable cutoffs and a t-shirt,`, clothes: "cutoffs and a t-shirt"});
		if(isItemAccessible("conservative clothing")) {
			wardrobeAssignment.push({text: `${He} uses the ability to select outfits to cover up with the most conservative clothing ${he} can find.`, clothes: "conservative clothing"});
		}
		if(isItemAccessible("a kimono")) {
			wardrobeAssignment.push({text: `${He} uses the ability to select outfits to cover ${himself} with a kimono.`, clothes: "a kimono"});
		}
		if(isItemAccessible("stretch pants and a crop-top")) {
			wardrobeAssignment.push({text: `${He} uses the ability to select outfits to cover up with stretch pants and a crop-top, though ${he} wishes it didn't have lewd comments printed on it.`, clothes: "stretch pants and a crop-top"});
		}
		selection = jsEither(clothing);
	} else {
		if(ArcologyZero.FSChattelReligionist > 0) {
			clothing.push({text: "and wears a chattel habit to conform to your arcology's culture.", clothes: "a chattel habit"});
		}
		/*Chooses clothes according to assignment (no exceptions)*/
		else if(slave.assignment == "be the Nurse") {
			if(slave.energy > 95 || slave.need > 100) {
				wardrobeAssignment.push({text: `and wears a slutty nurse outfit to make it clear just how much this nurse needs ${his} daily lay.`, clothes: "a slutty nurse outfit"});
			} else if(slave.energy > 80) {
				wardrobeAssignment.push({text: `and wears a slutty nurse outfit to show off ${his} body and arouse ${his} patients.`, clothes: "a slutty nurse outfit"});
				wardrobeAssignment.push({text: `and wears a nice nurse outfit to look professional before ${his} patients.`, clothes: "a nice nurse outfit"});
				wardrobeAssignment.push({text: `and wears a slutty nurse outfit to show to a little skin as ${he} cares for ${his} patients.`, clothes: "a slutty nurse outfit"});
			} else {
				wardrobeAssignment.push({text: `and wears a nice nurse outfit to look professional before ${his} patients.`, clothes: "a nice nurse outfit"});
				wardrobeAssignment.push({text: `and wears a slutty nurse outfit to show to a little skin as ${he} cares for ${his} patients.`, clothes: "a slutty nurse outfit"});
			}
		} else if(slave.assignment == "be the Madam") {
			if(slave.energy > 95 || slave.need > 100) {
				wardrobeAssignment.push({text: `and wears a slutty suit to be certain nothing blocks ${his} from getting the sex ${he} needs.`, clothes: "slutty business attire"});
			} else if(slave.energy > 80) {
				wardrobeAssignment.push({text: `and wears a nice suit to show ${he} means business.`, clothes: "nice business attire"});
				wardrobeAssignment.push({text: "and wears a slutty suit to entice and arouse while still looking managerial.", clothes: "slutty business attire"});
				wardrobeAssignment.push({text: "and wears a slutty suit to entice and arouse while still looking managerial.", clothes: "slutty business attire"});
			} else {
				wardrobeAssignment.push({text: `and wears a nice suit to show ${he} means business.`, clothes: "nice business attire"});
				wardrobeAssignment.push({text: "and wears a slutty suit to entice and arouse while still looking managerial.", clothes: "slutty business attire"});
			}
		} else if(slave.assignment == "be the Milkmaid") {
			if(slave.energy > 95 || slave.need > 100) {
				if(isItemAccessible("body oil")) {
					wardrobeAssignment.push({text: `and coats ${himself} with oil to better slip between ${his} cows as ${he} pleasures them.`, clothes: "body oil"});
				}
				wardrobeAssignment.push({text: `but goes nude to not be slowed down while moving between ${his} charges.`, clothes: "no clothing"});
			} else {
				wardrobeAssignment.push({text: `and wears a sturdy maid outfit, since anything else might be damaged by ${his} hard work with the cows.`, clothes: "a nice maid outfit"});
				wardrobeAssignment.push({text: "and decides to call it Casual Friday and wear nothing but cutoffs and a t-shirt. Not like the cows will mind.", clothes: "cutoffs and a t-shirt"});
				wardrobeAssignment.push({text: "and opts to don a cheerleader outfit to help cheer the cows on.", clothes: "a cheerleader outfit"});
				wardrobeAssignment.push({text: `and dresses up as a succubus since ${he}'ll be drawing plenty of fluids.`, clothes: "a succubus outfit"});
				wardrobeAssignment.push({text: `and slips into some spats and a tank top since ${he} feels a workout coming on.`, clothes: "spats and a tank top"});
				if(isItemAccessible("Western clothing")) {
					wardrobeAssignment.push({text: `and wears an appropriate cowgirl outfit. ${His} bare ass walking past is sure to amuse ${his} charges.`, clothes: "Western clothing"});
				}
				if(isItemAccessible("stretch pants and a crop-top")) {
					wardrobeAssignment.push({text: `and slips into some comfy stretch pants to relax as ${he} works the cows.`, clothes: "stretch pants and a crop-top"});
				}
				if(State.variables.cumSlaves > 2) {
					wardrobeAssignment.push({text: `and wears a slutty nurse outfit to help keep ${his} charges hard.`, clothes: "a slutty nurse outfit"});
					wardrobeAssignment.push({text: `and wears nothing but sexy lingerie to help keep ${his} charges hard.`, clothes: "attractive lingerie"});
					wardrobeAssignment.push({text: `and wears the skimpiest bikini on hand to help keep ${his} charges hard.`, clothes: "a string bikini"});
					if(isItemAccessible("body oil")) {
						wardrobeAssignment.push({text: `and coats ${himself} in oil for ${his} charges to savor.`, clothes: "body oil"});
					}
				}
			}
		} else if(slave.assignment == "be your Head Girl") {
			wardrobeAssignment.push({text: `and wears a military uniform to give ${his} that extra touch of authority.`, clothes: "a military uniform"});
			wardrobeAssignment.push({text: `and wears a schutzstaffel uniform to give ${his} that extra touch of authority.`, clothes: "a schutzstaffel uniform"});
			wardrobeAssignment.push({text: `and wears a slutty schutzstaffel uniform to give ${his} that extra touch of authority.`, clothes: "a slutty schutzstaffel uniform"});
			wardrobeAssignment.push({text: `and wears a red army uniform to give ${his} that extra touch of authority.`, clothes: "a red army uniform"});
			wardrobeAssignment.push({text: `and wears a mounty outfit to give ${his} that extra touch of authority.`, clothes: "a mounty outfit"});
			wardrobeAssignment.push({text: `and wears a handsome suit to give ${his} that extra touch of authority.`, clothes: "nice business attire"});
			if(canPenetrate(slave)){
				wardrobeAssignment.push({text: `and wears a slutty suit to make it perfectly clear that ${his} dick is ${his} main tool in ${his} job.`, clothes: "slutty business attire"});
			}
		} else if(slave.assignment == "be the Schoolteacher") {
			wardrobeAssignment.push({text: `and wears a handsome suit to give ${his} that teacherly authority.`, clothes: "nice business attire"});
			wardrobeAssignment.push({text: `and wears a slutty suit to give ${his} an air of authority will keeping all eyes focused on ${him}.`, clothes: "slutty business attire"});
			wardrobeAssignment.push({text: `and wears a schoolgirl outfit to help keep ${his} charges focused on ${him}.`, clothes: "a schoolgirl outfit"});
			wardrobeAssignment.push({text: `and dresses up as a succubus to give ${his} sex lessons an extra kick.`, clothes: "a succubus outfit"});
			if(isItemAccessible("conservative clothing")) {
				wardrobeAssignment.push({text: "and wears conservative clothes to not detract from this week's lesson.", clothes: "conservative clothing"});
			}
			if(isItemAccessible("a toga")) {
				wardrobeAssignment.push({text: `and wraps ${himself} in a toga to model ${himself} after the philosophers of yore.`, clothes: "a toga"});
			}
			if(isItemAccessible("a maternity dress") && slave.belly >= 10000) {
				wardrobeAssignment.push({text: `and settles for a comfortable maternity dress to support ${his} middle while ${he} lectures in front of the class all week.`, clothes: "a maternity dress"});
			}
		} else if(slave.assignment == "be the Wardeness") {
			wardrobeAssignment.push({text: "and dons battledress, the better to intimidate the prisoners.", clothes: "battledress"});
			wardrobeAssignment.push({text: "and slips into a scalemail bikini, the better to intimidate the prisoners.", clothes: "a scalemail bikini"});
			wardrobeAssignment.push({text: "and dons a scandalous habit to make it perfectly clear that crossing this nun will result in sexual punishment.", clothes: "a fallen nuns habit"});
			if(isItemAccessible("stretch pants and a crop-top")) {
				wardrobeAssignment.push({text: "and decides to take it easy by slipping into some stretch pants. They come off just as quickly as they come on, just in case.", clothes: "stretch pants and a crop-top"});
			}
		} else if(slave.assignment == "be the Attendant") {
			wardrobeAssignment.push({text: `and wears a string bikini, since it's all ${he} can wear that won't be ruined by all the moisture in the spa.`, clothes: "a string bikini"});
			wardrobeAssignment.push({text: `but decides to go nude, since ${he}'ll be spending so much time in the water.`, clothes: "no clothing"});
		} else if(slave.assignment == "rest") {
			wardrobeAssignment.push({text: "and wears a comfortable t-shirt and cutoffs to relax.", clothes: "cutoffs and a t-shirt"});
			wardrobeAssignment.push({text: `and slips into some attractive lingerie to enjoy ${himself} as ${he} unwinds.`, clothes: "attractive lingerie"});
			wardrobeAssignment.push({text: "but decides that clothing takes too much work and would rather sleep nude.", clothes: "no clothing"});
			if(isItemAccessible("stretch pants and a crop-top")) {
				wardrobeAssignment.push({text: "and slips into some comfy stretch pants to relax.", clothes: "stretch pants and a crop-top"});
			}
			if(isItemAccessible("attractive lingerie for a pregnant woman") && slave.belly >= 1500) {
				wardrobeAssignment.push({text: `and slips into some attractive lingerie to enjoy ${himself} as ${he} unwinds.`, clothes: "attractive lingerie for a pregnant woman"});
			}
			if(slave.fetish == "submissive") {
				wardrobeAssignment.push({text: "and decides the best way to relax is tied up nice and tight.", clothes: "shibari ropes"});
			}
		} else if(slave.assignment == "get milked" || slave.assignment == "work in the dairy") {
			wardrobeAssignment.push({text: `and wears sturdy lingerie to offer the best support to ${his} sore, milk-filled udders.`, clothes: "attractive lingerie"});
			if(isItemAccessible("attractive lingerie for a pregnant woman") && slave.belly >= 1500) {
				wardrobeAssignment.push({text: "and wears lingerie designed for milky mothers.", clothes: "attractive lingerie for a pregnant woman"});
			}
			if(isItemAccessible("a maternity dress") && slave.belly >= 10000) {
				wardrobeAssignment.push({text: `and chooses a maternity dress since it is easy to free ${his} breasts from.`, clothes: "a maternity dress"});
			}
			wardrobeAssignment.push({text: `and wears a string bikini for easy access to ${his} udders.`, clothes: "a string bikini"});
			if(slave.lactation > 1) {
				wardrobeAssignment.push({text: `but goes nude. There's no time for clothing, ${his} udders need to be drained now!`, clothes: "no clothing"});
			}
			wardrobeAssignment.push({text: `and dons a slutty outfit. If ${his} breasts are going to hang out, might as well wear something to complement them.`, clothes: "a slutty outfit"});
		} else if(slave.assignment == "guard you") {
			wardrobeAssignment.push({text: `and wears a bodysuit to show off ${his} curves without hindering ${his} deadliness.`, clothes: "a comfortable bodysuit"});
			wardrobeAssignment.push({text: "and wears a military uniform to look the part of the honor guard.", clothes: "a military uniform"});
			wardrobeAssignment.push({text: "and wears a schutzstaffel uniform to look the part of the honor guard.", clothes: "a schutzstaffel uniform"});
			wardrobeAssignment.push({text: "and wears a slutty schutzstaffel uniform to look the part of the honor guard.", clothes: "a slutty schutzstaffel uniform"});
			wardrobeAssignment.push({text: "and wears a red army uniform to look the part of the honor guard.", clothes: "a red army uniform"});
			wardrobeAssignment.push({text: "and wears a nice suit to make it clear you mean business.", clothes: "nice business attire"});
			wardrobeAssignment.push({text: "and wears a mounty outfit to make it clear you mean business.", clothes: "a mounty outfit"});
			wardrobeAssignment.push({text: `and wears a scalemail bikini to make ${himself} look fierce.`, clothes: "a scalemail bikini"});
			if(isItemAccessible("a kimono")) {
				wardrobeAssignment.push({text: "and wears a nice kimono to add an air of elegance to your presence.", clothes: "a kimono"});
			}
		} else {
			/*Chooses clothes according to assignment (exceptions allowed)*/
			if(slave.assignment == "recruit girls") {
				wardrobeAssignment.push({text: "and wears a flattering mini dress to appear sexy and carefree before those desperately seeking a better life.", clothes: "a mini dress"});
				wardrobeAssignment.push({text: "and wears a cutoffs and a t-shirt to appear sexy and carefree before those desperately seeking a better life.", clothes: "cutoffs and a t-shirt"});
				wardrobeAssignment.push({text: "and wears a nice suit to appear trustworthy before those desperately seeking a better life.", clothes: "nice business attire"});
				wardrobeAssignment.push({text: "and wears a schoolgirl outfit to appear sexy and carefree before those desperately seeking a better life.", clothes: "a schoolgirl outfit"});
				wardrobeAssignment.push({text: "and wears an opulent gown to showcase your wealth before those desperately seeking a better life.", clothes: "a ball gown"});
				wardrobeAssignment.push({text: "and dresses as a succubus to attempt to lure any potential catches.", clothes: "a succubus outfit"});
				if(isItemAccessible("harem gauze")) {
					wardrobeAssignment.push({text: `and dons ${his} finest silks to showcase the luxuries waiting would-be slaves.`, clothes: "harem gauze"});
				}
				if(isItemAccessible("stretch pants and a crop-top")) {
					wardrobeAssignment.push({text: "and wears comfortable stretch pants to and crop-top to appear carefree before those desperately seeking a better life.", clothes: "stretch pants and a crop-top"});
				}
				if(isItemAccessible("conservative clothing")) {
					wardrobeAssignment.push({text: "and wears normal clothing to suggest to those desperately seeking a better life that they can find it here with you.", clothes: "conservative clothing"});
				}
			} else if(slave.assignment == "be the DJ") {
				wardrobeAssignment.push({text: "and wears clubslut netting to look like the perfect easy club girl.", clothes: "clubslut netting"});
				wardrobeAssignment.push({text: "and wears cutoffs and a t-shirt to look like the perfect easy club girl.", clothes: "cutoffs and a t-shirt"});
				wardrobeAssignment.push({text: `and wears the slutty outfit ${he} can find to look like the perfect easy club girl.`, clothes: "a slutty outfit"});
				wardrobeAssignment.push({text: `and wears nothing but slutty jewelry since ${he} loves the way it jingles to ${his} moves.`, clothes: "slutty jewelry"});
				wardrobeAssignment.push({text: `and wears a skin tight bodysuit so nothing gets in the way of ${his} moves.`, clothes: "a comfortable bodysuit"});
				if(slave.boobs > 1000) {
					wardrobeAssignment.push({text: `but decides to go naked and let ${his} girls bounce free as ${he} dances.`, clothes: "no clothing"});
				}
				if(isItemAccessible("harem gauze")) {
					wardrobeAssignment.push({text: `and wears the finest available silks to give ${his} moves a sensual grace.`, clothes: "harem gauze"});
				}
			} else if(slave.assignment == "be your Concubine") {
				wardrobeAssignment.push({text: `and goes naked, since it's ${his} honored role to be the chief object of your desire.`, clothes: "no clothing"});
				wardrobeAssignment.push({text: `and dresses as a slutty nurse as your genitals are always in need of ${his} special treatment.`, clothes: "a slutty nurse outfit"});
				wardrobeAssignment.push({text: `and dresses as a schoolgirl in the hopes that you teach ${his} how to be a woman.`, clothes: "a schoolgirl outfit"});
				wardrobeAssignment.push({text: `and dresses as a cheerleader so ${he} may cheer you on as you blow ${his} mind.`, clothes: "a cheerleader outfit"});
				if(player.dick == 1) {
					wardrobeAssignment.push({text: "and dresses as a slutty maid as you always come home with a stiff package that needs a thorough polishing.", clothes: "a slutty maid outfit"});
				}
				wardrobeAssignment.push({text: `and, since you personally see that ${he} never goes hungry, ${he} dresses like the sex demoness ${he} is.`, clothes: "a succubus outfit"});
				if(isItemAccessible("attractive lingerie for a pregnant woman") && slave.belly >= 10000 && slave.pregSource == -1) {
					wardrobeAssignment.push({text: `and chooses attractive lingerie to showcase the body you've given ${his} in the hopes that you ravish ${him}.`, clothes: "attractive lingerie for a pregnant woman"});
				}
				if(slave.toyHole == "dick" && canPenetrate(slave)) {
					wardrobeAssignment.push({text: `and slips into a scalemail bikini so ${he} can act the role of your conqueror as ${he} bends you over.`, clothes: "a scalemail bikini"});
				}
			} else if(slave.assignment == "be a subordinate slave") {
				wardrobeAssignment.push({text: `but gives up and goes naked after the other slaves constantly tear whatever ${he}'s wearing off ${him}.`, clothes: "no clothing"});
				if(isItemAccessible("Western clothing")) {
					wardrobeAssignment.push({text: `and chooses a pair of crotchless chaps so your other slaves don't have to waste time undressing ${him}.`, clothes: "Western clothing"});
				}
				if(slave.fetish == "submissive") {
					wardrobeAssignment.push({text: `and chooses to slip on a pair of spats and a tank top in the hopes that ${he} gets to be a violated schoolgirl.`, clothes: "spats and a tank top"});
					wardrobeAssignment.push({text: `and chooses to slip on a schoolgirl outfit in the hope that ${he} gets held down and raped.`, clothes: "a schoolgirl outfit"});
					wardrobeAssignment.push({text: `and chooses to wear the sluttiest outfit available to make it clear what ${he} wants done to ${him}.`, clothes: "a slutty outfit"});
				}
			} else if(slave.assignment == "work a glory hole") {
				wardrobeAssignment.push({text: `but doesn't bother wearing anything, since no one can see ${his} clothing when ${he}'s immured inside a glory hole.`, clothes: "no clothing"});
			} else if(slave.assignment == "take classes" || slave.assignment == "learn in the schoolroom") {
				wardrobeAssignment.push({text: "and wears a schoolgirl outfit, since it seems most appropriate.", clothes: "a schoolgirl outfit"});
				wardrobeAssignment.push({text: `and wears a cheerleader outfit, since ${he} might as well be one of the popular girls.`, clothes: "a cheerleader outfit"});
				if(isItemAccessible("conservative clothing")) {
					wardrobeAssignment.push({text: `and wears normal clothing to not distract from ${his} lessons.`, clothes: "conservative clothing"});
				}
			} else if((slave.assignment == "whore") || (slave.assignment == "work in the brothel")) {
				 if(slave.belly >= 5000 && isItemAccessible("attractive lingerie for a pregnant woman")) {
					wardrobeAssignment.push({text: `and wears pretty lingerie to show off ${his} merchandise and accentuate ${his} pregnancy while still looking a little classy.`, clothes: "attractive lingerie for a pregnant woman"});
				}
				wardrobeAssignment.push({text: `and wears pretty lingerie to show off ${his} merchandise and still look a little classy.`, clothes: "attractive lingerie"});
				if(isItemAccessible("harem gauze")) {
					wardrobeAssignment.push({text: `and dresses ${himself} with harem gauze to add an exotic charm to ${his} display.`, clothes: "harem gauze"});
				}
				if(isItemAccessible("a kimono")) {
					wardrobeAssignment.push({text: `and wraps ${himself} in a kimono to add some elegance to ${his} display.`, clothes: "a kimono"});
				}
				wardrobeAssignment.push({text: `and adorns ${himself} in fine dress to show off how much of a high class whore ${he} is.`, clothes: "a slave gown"});
				wardrobeAssignment.push({text: `and dresses ${himself} in a slutty suit to show ${he}'s in it for the ¤.`, clothes: "slutty business attire"});
				wardrobeAssignment.push({text: `and wears a flattering mini dress to really strut ${his} stuff.`, clothes: "a mini dress"});
			} else if(slave.assignment == "serve the public" || slave.assignment == "serve in the club") {
				wardrobeAssignment.push({text: "and wears string lingerie to look fun and fuckable.", clothes: "a string bikini"});
				wardrobeAssignment.push({text: "and throws together the sluttiest outfit since if you're going to slut you might as well go all out.", clothes: "a slutty outfit"});
				wardrobeAssignment.push({text: `and tosses on a slutty suit that screams ${he} needs a good fuck after a long day.`, clothes: "slutty business attire"});
				wardrobeAssignment.push({text: `and dresses up as a slutty nurse; ${he} has just the technique to cure penile swelling.`, clothes: "a slutty nurse outfit"});
				wardrobeAssignment.push({text: "and wears a cheerleader outfit to look energetic and fuckable.", clothes: "a cheerleader outfit"});
				if(isItemAccessible("a bunny outfit")) {
					wardrobeAssignment.push({text: `and slips into a teddy to add some class to ${his} post.`, clothes: "a bunny outfit"});
				}
				wardrobeAssignment.push({text: `and dresses up as a succubus to clearly advertise ${his} promiscuity.`, clothes: "a succubus outfit"});
				if(slave.bellyPreg >= 10000) {
					wardrobeAssignment.push({text: `and struggles into a schoolgirl outfit. ${His} gravid belly just screams that ${he} is a slutty little student who cares more for dick than lessons.`, clothes: "a succubus outfit"});
				}
			} else if(slave.assignment == "be a servant" || slave.assignment == "work as a servant") {
				if(slave.energy > 95 || slave.need > 100) {
					wardrobeAssignment.push({text: `and wears a skimpy maid outfit hoping that someone sneaks up behind ${his} as ${he} works and fulfills ${his} desires.`, clothes: "a slutty maid outfit"});
				} else if(slave.energy > 80) {
					wardrobeAssignment.push({text: `and wears a skimpy maid outfit to tempt anyone watching ${his} work.`, clothes: "a slutty maid outfit"});
					wardrobeAssignment.push({text: `and wears a sturdy maid outfit, since anything else might be damaged by ${his} hard work around the penthouse.`, clothes: "a nice maid outfit"});
					wardrobeAssignment.push({text: `and wears a skimpy maid outfit to tempt anyone watching ${his} work.`, clothes: "a slutty maid outfit"});
				} else {
					wardrobeAssignment.push({text: `and wears a sturdy maid outfit, since anything else might be damaged by ${his} hard work around the penthouse.`, clothes: "a nice maid outfit"});
					wardrobeAssignment.push({text: `and wears a skimpy maid outfit to tempt anyone watching ${his} work.`, clothes: "a slutty maid outfit"});
				}
			}

			/* Chooses clothes according to FS*/
			if(ArcologyZero.FSEgyptianRevivalist > 0) {
				wardrobeFS.push({text: "and complements it with golden bangles, since no clothing is necessary for a sex slave in your warm and sunny arcology.", clothes: "slutty jewelry"});
			} else if(ArcologyZero.FSRomanRevivalist > 0) {
				wardrobeFS.push({text: "and wears a toga to take part in your Roman revivalism.", clothes: "a toga"});
			} else if(ArcologyZero.FSEdoRevivalist > 0) {
				wardrobeFS.push({text: "and wears a kimono, overjoyed that such lovely clothing is now appropriate.", clothes: "a kimono"});
			} else if(ArcologyZero.FSArabianRevivalist > 0) {
				wardrobeFS.push({text: "and wears a harem outfit to look like a slave girl fit for a Sultan.", clothes: "harem gauze"});
			} else if(ArcologyZero.FSChineseRevivalist > 0) {
				wardrobeFS.push({text: "and wears a brief qipao to show off and look Chinese at the same time.", clothes: "a slutty qipao"});
			} else if(ArcologyZero.FSAztecRevivalist > 0) {
				wardrobeFS.push({text: `and drapes a huipil over ${himself} to fit in with your Aztec revivalism.`, clothes: "a huipil"});
			}
			if(ArcologyZero.FSGenderFundamentalist > 0) {
				wardrobeFS.push({text: "and wears a cheerleader outfit to look like a hot slut.", clothes: "a cheerleader outfit"});
				wardrobeFS.push({text: "and wears a bunny outfit to look like a slut from the glory days.", clothes: "a bunny outfit"});
				if(slave.bellyPreg >= 5000) {
					wardrobeFS.push({text: `but decides to wear nothing at all; ${he}'s already pregnant, so ${he} just needs to be barefoot and naked to complete ${his} look.`, clothes: "no clothing"});
				}
			} else if(ArcologyZero.FSGenderRadicalist > 0) {
				wardrobeFS.push({text: `and eagerly slips into a skimpy maid outfit so ${he} can take advantage of its short skirt and ${his} lack of underwear`, clothes: "a slutty maid outfit"});
				wardrobeFS.push({text: `and wears a cheerleader outfit that clearly shows off ${his} ass.`, clothes: "a cheerleader outfit"});
				wardrobeFS.push({text: "and settles for some sexy succubutt.", clothes: "a succubus outfit"});
			}
			if(ArcologyZero.FSPaternalist > 0) {
				wardrobeFS.push({text: "and wears conservative clothing, as permitted by your paternalism.", clothes: "conservative clothing"});
				if(isItemAccessible("stretch pants and a crop-top")) {
					wardrobeAssignment.push({text: `and wears the most comfortable stretch pants ${he} can find.`, clothes: "stretch pants and a crop-top"});
				}
			} else if(ArcologyZero.FSDegradationist > 0) {
				wardrobeFS.push({text: `and wears chains, to degrade ${himself} as required by your societal goals.`, clothes: "chains"});
			}
			if(ArcologyZero.FSMaturityPreferentialist > 0) {
				if(slave.visualAge >= 30) {
					wardrobeFS.push({text: "and wears a slutty suit to look like the ideal horny older woman.", clothes: "slutty business attire"});
					wardrobeFS.push({text: `and wears only an apron to make ${himself} seem more matronly.`, clothes: "an apron"});
				} else {
					wardrobeFS.push({text: "and wears a formal suit to look more mature.", clothes: "nice business attire"});
				}
			} else if(ArcologyZero.FSYouthPreferentialist > 0) {
				wardrobeFS.push({text: "and wears a schoolgirl outfit to look younger.", clothes: "a schoolgirl outfit"});
				wardrobeFS.push({text: "and wears a cheerleader outfit to look younger and more energetic.", clothes: "a cheerleader outfit"});
				wardrobeFS.push({text: "and wears spats and a tank top to look younger and more energetic.", clothes: "spats and a tank top"});
			}
			if(ArcologyZero.FSPhysicalIdealist > 0) {
				wardrobeFS.push({text: `and coats ${himself} in body oil to show off how ${he}'s part of your physical idealism.`, clothes: "body oil"});
				wardrobeFS.push({text: `and slips into some spats for ${his} next workout.`, clothes: "spats and a tank top"});
			} else if(ArcologyZero.FSHedonisticDecadence > 0) {
				wardrobeFS.push({text: "and throws on a very casual getup.", clothes: "stretch pants and a crop-top"});
				wardrobeFS.push({text: "but decides against putting forth the effort and goes nude.", clothes: "no clothing"});
			}
			if(ArcologyZero.FSPastoralist > 0) {
				wardrobeFS.push({text: `and wears Western clothing, since ${he} thinks it fits with pastoralism.`, clothes: "Western clothing"});
				wardrobeFS.push({text: `and wears a swimsuit that leaves ${his} breasts uncovered.`, clothes: "a monokini"});
				if(slave.lactation > 0) {
					wardrobeFS.push({text: "and dresses up as a slutty wet nurse.", clothes: "a slutty nurse outfit"});
				}
				wardrobeFS.push({text: `but decides to let ${his} breasts be free. Clothes will just get in the way.`, clothes: "no clothing"});
			}
			if(ArcologyZero.FSBodyPurist > 0) {
				wardrobeFS.push({text: `and wears a leotard to show off the purity of ${his} body.`, clothes: "a leotard"});
				wardrobeFS.push({text: `but decides ${his} body is too nice to hide with clothing.`, clothes: "no clothing"});
			} else if(ArcologyZero.FSTransormationFetishest > 0) {
				if(isItemAccessible("body oil")) {
					wardrobeAssignment.push({text: `and coats ${his} assets in body oil to give them some extra shine.`, clothes: "body oil"});
				}
				wardrobeFS.push({text: `and decides squeezing into a latex suit will only complement ${his} unnatural appearance.`, clothes: "restrictive latex"});
			}
			if(ArcologyZero.FSAssetExpansioninst > 0) {
				wardrobeFS.push({text: "and decides to dress up like a young man's wet dream.", clothes: "a succubus outfit"});
				wardrobeFS.push({text: `and decides to wear a skimpy bikini to make ${his} assets look even larger.`, clothes: "a string bikini"});
				wardrobeFS.push({text: `and decides to throw together a slutty outfit that highlight ${his} assets.`, clothes: "a slutty outfit"});
				wardrobeFS.push ({text: "and decides to wear a monokini that clings to the assets it actually does conceal.", clothes: "a monokini"});
			} else if(ArcologyZero.FSSlimnessEnthusiast > 0) {
				if(slave.boobs < 300) {
					wardrobeFS.push({text: `and wears a string bikini to show off just how flat ${he} is.`, clothes: "a string bikini"});
				}
				if(slave.boobs < 600 && slave.butt < 3) {
					wardrobeFS.push({text: `and wears a leotard to show off ${his} lithe body.`, clothes: "a leotard"});
					wardrobeFS.push({text: `and wears a form fitting bodysuit to show off ${his} lithe figure.`, clothes: "a comfortable bodysuit"});
					wardrobeFS.push({text: `and wears spats to hug ${his} tight butt.`, clothes: "spats and a tank top"});
					wardrobeFS.push({text: `and wears an apron that covers ${his} front while leaving ${his} rear free.`, clothes: "an apron"});
				} else {
					wardrobeFS.push({text: `and squeezes into a form fitting bodysuit in the hopes that it squishes down ${his} assets.`, clothes: "restrictive latex"});
				}
			}

			/*Chooses clothes according to fetishes, quirks, etc.*/
			if(slave.attrXY > 70) {
				if(slave.attrKnown == 1) {
					wardrobeTastes.push({text: "and wears a schoolgirl outfit to show off a some T&A to attract boys.", clothes: "a schoolgirl outfit"});
					wardrobeTastes.push({text: "and wears nothing but pretty lingerie to attract boys.", clothes: "attractive lingerie"});
					wardrobeTastes.push({text: "and selects a slutty outfit that's sure to have men drooling.", clothes: "a slutty outfit"});
					if(slave.butt > 3){
						wardrobeTastes.push({text: `and slips on some cutoffs that are sure to have men checking out ${his} ass.`, clothes: "cutoffs and a t-shirt"});
					}
					if(isItemAccessible("a bunny outfit")) {
						wardrobeAssignment.push({text: `and slips into a bunny outfit that ${he} knows will have men lining up.`, clothes: "a bunny outfit"});
					}
					if(slave.boobs > 800) {
						wardrobeTastes.push({text: `and dresses up as a busty succubus that pulls eyes the ${his} chest and leaves pants feeling tight.`, clothes: "a succubus outfit"});
					}
				} else {
					wardrobeTastes.push({text: "and selects a schoolgirl outfit that shows off some T&A.", clothes: "a schoolgirl outfit"});
					wardrobeTastes.push({text: `and wears pretty lingerie that shows off ${his} body.`, clothes: "attractive lingerie"});
					wardrobeTastes.push({text: "and selects a slutty outfit that's sure to draw attention.", clothes: "a slutty outfit"});
					if(slave.butt > 3){
						wardrobeTastes.push({text: `and slips on some cutoffs that shows off ${his} ass.`, clothes: "cutoffs and a t-shirt"});
					}
					if(isItemAccessible("a bunny outfit")) {
						wardrobeAssignment.push({text: `and slips into a bunny outfit that hugs ${his} curves.`, clothes: "a bunny outfit"});
					}
					if(slave.boobs > 800) {
						wardrobeTastes.push({text: "and dresses up as a busty succubus that's sure to draw eyes.", clothes: "a succubus outfit"});
					}
				}
			}
			if(slave.attrXX > 70) {
				if(slave.attrKnown == 1) {
					wardrobeTastes.push({text: "and wears a fashionable gown, since girls appreciate nice clothes.", clothes: "a slave gown"});
					wardrobeTastes.push({text: "and wears nothing but pretty lingerie to give the girls a show.", clothes: "attractive lingerie"});
					wardrobeTastes.push({text: "and wears a nice suit, since girls appreciate nice clothes.", clothes: "nice business attire"});
				} else {
					wardrobeTastes.push({text: "and wears a fashionable gown.", clothes: "a slave gown"});
					wardrobeTastes.push({text: `and wears pretty lingerie that shows off ${his} body.`, clothes: "attractive lingerie"});
					wardrobeTastes.push({text: "and wears a nice suit, the reasons not entirely clear to you.", clothes: "nice business attire"});
				}
			}

			/* need */
			if(slave.need > 90) {
				wardrobeTastes.push({text: `but goes naked. ${He} needs sex now and clothing will only get in the way.`, clothes: "no clothing"});
				wardrobeTastes.push({text: `and throws on a slutty suit. ${He} hopes that it gets the point across that ${he} needs sex now.`, clothes: "slutty business attire"});
				wardrobeTastes.push({text: `and dons a slutty nurse outfit. ${He}'s been infected and the only cure is a strong dicking.`, clothes: "a slutty nurse outfit"});
				wardrobeTastes.push({text: `and dresses up as a slutty maid. Maybe if ${he} does ${his} job poorly enough, someone will bend ${his} over and fuck some sense into ${him}.`, clothes: "a slutty maid outfit"});
				wardrobeTastes.push({text: `and dresses up as a succubus in the hopes it screams that ${he} needs sex now.`, clothes: "a succubus outfit"});
			}

			/* quirks n flaws */
			if(slave.behavioralQuirk == "sinful") {
				wardrobeTastes.push({text: "and dresses up like a succubus because it makes $object feel naughty.", clothes: "a succubus outfit"});
			} else if(slave.behavioralQuirk == "fitness") {
				wardrobeTastes.push({text: `and wears spats and a tank top to give ${himself} a sporty look.`, clothes: "spats and a tank top"});
			}

			/* age stuff */
			if(slave.actualAge < 10) {
				wardrobeTastes.push({text: `and puts on a pretty dress so ${he} can be a princess.`, clothes: "a ball gown"});
				wardrobeTastes.push({text: `and dresses up like a cheerleader since ${he} thinks it looks cute.`, clothes: "a cheerleader outfit"});
				if(isItemAccessible("a kimono")) {
					wardrobeAssignment.push({text: `and wraps ${himself} in a kimono, since it feels so good on ${his} skin.`, clothes: "a kimono"});
				}
			}

			/* fetishes */
			if(slave.fetishKnown == 1) {
				if(slave.fetish == "submissive") {
					wardrobeTastes.push({text: `and wears restrictive latex to encourage others to dominate ${him}.`, clothes: "restrictive latex"});
					wardrobeTastes.push({text: `and wears shibari ropes to encourage others to dominate ${him}.`, clothes: "shibari ropes"});
				} else if(slave.fetish == "dom") {
					wardrobeTastes.push({text: `and wears a handsome suit, since ${he} likes other slaves to look up to ${him}.`, clothes: "nice business attire"});
					wardrobeTastes.push({text: "and wears a full body latex catsuit to look the part of the whip cracking dom.", clothes: "a latex catsuit"});
				} else if(slave.fetish == "masochist") {
					wardrobeTastes.push({text: `and wears painfully restrictive bondage gear, since ${he} likes the torment.`, clothes: "uncomfortable straps"});
					if(isItemAccessible("chains")) {
						wardrobeAssignment.push({text: `and wears painfully tight chains, since ${he} likes the torment.`, clothes: "chains"});
					}
				} else if(slave.fetish == "sadist") {
					wardrobeTastes.push({text: `and wears an elegant gown, since ${he} thinks it makes ${his} look the part of the femme fatale.`, clothes: "a slave gown"});
					wardrobeTastes.push({text: `and wears a scalemail bikini, since ${he} thinks it makes ${his} look fierce.`, clothes: "a scalemail bikini"});
				} else if(slave.fetish == "cumslut") {
					wardrobeTastes.push({text: `and wears cutoffs and a t-shirt, because the fun yet relatively conservative outfit seems to encourage others to ask ${his} for blowjobs.`, clothes: "cutoffs and a t-shirt"});
				} else if(slave.fetish == "humiliation") {
					wardrobeTastes.push({text: `and wears leather straps with rings over ${his} private parts because ${he} enjoys the embarrassment such a humiliating outfit causes ${him}.`, clothes: "uncomfortable straps"});
				} else if(slave.fetish == "buttslut") {
					wardrobeTastes.push({text: `and wears nothing other than slutty bangles, because ${he} likes to catch the eye without putting anything between cocks and ${his} rear end.`, clothes: "slutty jewelry"});
				} else if(slave.fetish == "pregnancy") {
					wardrobeTastes.push({text: `and wears a short maid dress, because ${he} wants to look motherly and fuckable at the same time.`, clothes: "a slutty maid outfit"});
					if(isItemAccessible("a maternity dress") && canGetPregnant(slave)) {
						wardrobeAssignment.push({text: "and wears a maternity dress in the hope someone fills out its middle.", clothes: "a maternity dress"});
					}
				} else if(slave.fetish == "boobs") {
					wardrobeTastes.push({text: `and wears a cheerleader outfit, since ${he} loves the way it hugs ${his} tits as ${he} moves.`, clothes: "a cheerleader outfit"});
					wardrobeTastes.push({text: `and wears a monokini, since ${he} loves how it leaves ${his} breasts totally bare.`, clothes: "a monokini"});
				}
			} else {
				if(slave.fetish == "submissive") {
					wardrobeTastes.push({text: "and strangely opts for restrictive latex.", clothes: "restrictive latex"});
					wardrobeTastes.push({text: "and strangely opts for shibari ropes.", clothes: "shibari ropes"});
				} else if(slave.fetish == "dom") {
					wardrobeTastes.push({text: `and wears a handsome suit; ${he} seems to think highly of ${himself} in it.`, clothes: "nice business attire"});
					wardrobeTastes.push({text: `and wears a full body latex catsuit; there is a strange look on ${his} face as ${he} wears it.`, clothes: "a latex catsuit"});
				} else if(slave.fetish == "masochist") {
					wardrobeTastes.push({text: "and strangely opts for painfully restrictive bondage gear.", clothes: "uncomfortable straps"});
					if(isItemAccessible("chains")) {
						wardrobeAssignment.push({text: "and strangely opts for painfully tight chains.", clothes: "chains"});
					}
				} else if(slave.fetish == "sadist") {
					wardrobeTastes.push({text: "and wears an elegant gown for some reason.", clothes: "a slave gown"});
					wardrobeTastes.push({text: "and wears a scalemail bikini; an odd choice.", clothes: "a scalemail bikini"});
				} else if(slave.fetish == "cumslut") {
					wardrobeTastes.push({text: `and wears cutoffs and a t-shirt; ${he} can't stop licking ${his} lips.`, clothes: "cutoffs and a t-shirt"});
				} else if(slave.fetish == "humiliation") {
					wardrobeTastes.push({text: `and strangely opts for leather straps with rings over ${his} private parts.`, clothes: "uncomfortable straps"});
				} else if(slave.fetish == "buttslut") {
					wardrobeTastes.push({text: `and wears nothing other than slutty bangles, an odd choice; ${his} ass is completely exposed.`, clothes: "slutty jewelry"});
				} else if(slave.fetish == "pregnancy") {
					wardrobeTastes.push({text: `and wears a short maid dress; you frequently notice ${his} observing ${his} stomach.`, clothes: "a slutty maid outfit"});
					if(isItemAccessible("a maternity dress") && canGetPregnant(slave)) {
						wardrobeAssignment.push({text: `and wears a maternity dress even though ${he} isn't pregnant.`, clothes: "a maternity dress"});
					}
				} else if(slave.fetish == "boobs") {
					wardrobeTastes.push({text: `and wears a cheerleader outfit; ${he} seems to enjoy jiggling ${his} breasts in it.`, clothes: "a cheerleader outfit"});
					wardrobeTastes.push({text: `and strangely decides to wear a monokini, which leaves ${his} breasts totally bare.`, clothes: "a cheerleader outfit"});
				}
			}

			/* energy */
			if(slave.energy > 95) {
				wardrobeTastes.push({text: `but goes nude, since as a nympho ${he} gets plenty of attention anyway, and considers clothes an unnecessary hindrance.`, clothes: "no clothing"});
			}

			/* pregnancy */
			if(slave.belly >= 5000) {
				wardrobeTastes.push({text: `and wears pretty lingerie to show off ${his} merchandise while giving ${his} protruding belly plenty of room to hang free.`, clothes: "attractive lingerie"});
				if(isItemAccessible("attractive lingerie for a pregnant woman") && slave.energy > 70) {
					wardrobeTastes.push({text: `and wears pretty lingerie to show off ${his} merchandise and accentuate ${his} pregnancy while giving it plenty of room to hang free.`, clothes: "attractive lingerie for a pregnant woman"});
				} else if(isItemAccessible("a maternity dress")) {
					wardrobeTastes.push({text: `and wears a conservative dress with plenty of give for ${his} belly to stretch it.`, clothes: "a maternity dress"});
				}
				wardrobeTastes.push({text: `and wears string lingerie to look fun and fuckable while giving ${his} protruding belly plenty of room to hang free.`, clothes: "a string bikini"});
			} else {
				wardrobeTastes.push({text: `and wears string lingerie to show off ${his} body.`, clothes: "a string bikini"});
			}
		}
		/*Separated in three categories in case you want to, say, increase the probability of choosing _wardrobeAssignment to look more professional*/
		if(wardrobeAssignment.length > 0) {
			for (let i = 0; i < wardrobeAssignment.length; i++) {
				clothing.push(wardrobeAssignment[i]);
			}
		}
		if(wardrobeFS.length > 0) {
			for (let i = 0; i < wardrobeFS.length; i++) {
				clothing.push(wardrobeFS[i]);
			}
		}
		if(wardrobeTastes.length > 0) {
			for (let i = 0; i < wardrobeTastes.length; i++) {
				clothing.push(wardrobeTastes[i]);
			}
		}
		selection = jsEither(clothing);
	}

	return selection;
};

window.todaysShoes = function(slave) {
	var ArcologyZero = State.variables.arcologies[0];
	var player = State.variables.PC;
	var shoes = [];

	const pronouns = getPronouns(slave);
	const he = pronouns.pronoun;
	const him = pronouns.object;
	const his = pronouns.possessive;
	const hers = pronouns.posessivePronoun;
	const himself = pronouns.objectReflexive;
	const boy = pronouns.noun;
	const He = capFirstChar(he);
	const His = capFirstChar(his);

	if(slave.fetish == 'mindbroken') {
		if(slave.amp != 1 && slave.heels == 1) {
			shoes.push({text: `${He} finds ${he} can inexplicably walk if ${he} wears heels; a daily lesson for ${him}, as ${he} forgets shortly after leaving.`, shoes: jsEither(["heels", "pumps", "extreme heels", "boots"])});
		}
		shoes.push({text: `${He} vaguely remembers putting things on ${his} feet, so ${he} does.`, shoes: jsEither(["heels", "pumps", "extreme heels", "boots", "flats"])});
		shoes.push({text: `${He} entered without shoes, and will leave the same.`, shoes: "none"});
	} else if(slave.devotion <= 20) {
		if(slave.heels == 0) {
			shoes.push({text: "and wears comfortable flats,", shoes: "flats"});
		} else {
			shoes.push({text: `and angrily wears the heels ${he} needs to walk,`, shoes: "heels"});
		}
	} else {
		if(slave.fetishKnown == 1 && slave.fetish == "dom") {
			shoes.push({text: `${He} wears boots to look like a proper dominant.`, shoes: "boots"});
		} else if(slave.fetishKnown == 1 && slave.fetish == "sadist") {
			shoes.push({text: `${He} wears boots, since ${he} thinks they make ${his} look dangerous.`, shoes: "boots"});
		} else if(slave.fetishKnown == 1 && slave.fetish == "masochist") {
			shoes.push({text: `${He} wears painfully tall heels, since ${he} enjoys the twinge of pain with each step.`, shoes: "extreme heels"});
		} else if(slave.heels == 1) {
			shoes.push({text: `${He} wears the heels ${he} needs to walk.`, shoes: "heels"});
		} else if(slave.fetishKnown == 1 && slave.fetish == "pregnancy" && slave.bellyPreg >= 500) {
			shoes.push({text: `${He} goes barefoot to complement ${his} pregnancy.`, shoes: "none"});
		} else if(slave.fetishKnown == 1 && slave.fetish == "none") {
			shoes.push({text: `${He} wears comfortable flats, since ${he} doesn't have a fetish to show off.`, shoes: "flats"});
		} else if(slave.actualAge < 13){
			shoes.push({text: `${He} puts on boots so ${he} can stomp around.`, shoes: "boots"});
			shoes.push({text: `${He} playfully puts on heels to be like all the other girls.`, shoes: "heels"});
			shoes.push({text: `${He} wears flats as they are comfortable and easy to take on and off.`, shoes: "flats"});
			shoes.push({text: `Going barefoot is fun, so no shoes for ${him}.`, shoes: "none"});
		} else {
			shoes.push({text: `${He} wears heels to strut ${his} stuff.`, shoes: "heels"});
			shoes.push({text: `${He} wears comfortable flats to take it easy.`, shoes: "flats"});
			shoes.push({text: `${He} goes barefoot to show off ${his} toes.`, shoes: "none"});
		}
	}
	return jsEither(shoes);
};

window.todaysCollar = function(slave) {
	var ArcologyZero = State.variables.arcologies[0];
	var player = State.variables.PC;
	var neck = [];

	const pronouns = getPronouns(slave);
	const he = pronouns.pronoun;
	const him = pronouns.object;
	const his = pronouns.possessive;
	const hers = pronouns.posessivePronoun;
	const himself = pronouns.objectReflexive;
	const boy = pronouns.noun;
	const He = capFirstChar(he);
	const His = capFirstChar(his);

	if(slave.fetish == 'mindbroken') {

	} else if(slave.devotion <= 20) {

	} else {
		if(ArcologyZero.FSEgyptianRevivalist > 0) {
			neck.push({text: "dons a wesekh to support your ancient Egyptian pretensions,", collar: "ancient Egyptian"});
		}
		if(slave.fetish == "masochist") {
			neck.push({text: `dons a tight steel collar around ${his} neck,`, collar: "tight steel"});
			neck.push({text: "dons a painful leather collar,", collar: "uncomfortable leather"});
			neck.push({text: "dons a painfully tight neck corset,", collar: "neck corset"});
		} else if(slave.fetish == "pregnancy" && (canGetPregnant(slave) || slave.pregKnown == 1)) {
			neck.push({text: `dons a digital display that tells everything about ${his} womb,`, collar: "preg biometrics"});
		} else if(slave.fetish == "boobs" && slave.boobs >= 1000) {
			neck.push({text: `dons a cowbell to draw attention to ${his} luscious udders,`, collar: "leather with cowbell"});
		}
		neck.push({text: `decides ${his} neck needs no accenting,`, collar: "none"});
		neck.push({text: "dons some pretty jewelry,", collar: "pretty jewelry"});
		neck.push({text: "dons a lovely gold collar,", collar: "heavy gold"});
		neck.push({text: `dons a simple silk ribbon around ${his} neck,`, collar: "silk ribbon"});
	}
	return jsEither(neck);
};

window.todaysCorset = function(slave) {
	var ArcologyZero = State.variables.arcologies[0];
	var player = State.variables.PC;
	var belly = [];
	var empathyBellies = ["a small empathy belly", "a medium empathy belly", "a large empathy belly", "a huge empathy belly"];

	const pronouns = getPronouns(slave);
	const he = pronouns.pronoun;
	const him = pronouns.object;
	const his = pronouns.possessive;
	const hers = pronouns.posessivePronoun;
	const himself = pronouns.objectReflexive;
	const boy = pronouns.noun;
	const He = capFirstChar(he);
	const His = capFirstChar(his);

	if(slave.fetish == 'mindbroken') {
		if(ArcologyZero.FSRepopulationFocus > 0 && slave.belly < 1500) {
			if(slave.weight > 130) {
				belly.push({text: `${He} notices the fake bellies; since every girl ${he} has ever met has a rounded middle, it's only natural ${he} is compelled to wear one. ${He} struggles to fit it around ${his} huge gut, only stopping when another slave takes it away from ${his} so ${he} moves on and stops blocking the wardrobe with ${his} fat ass.`, bellyAccessory: "none"});
			} else {
				belly.push({text: `${He} notices the fake bellies; since every girl ${he} has ever met has a rounded middle, it's only natural ${he} is compelled to wear one.`, bellyAccessory: jsEither(["a small empathy belly", "a medium empathy belly", "a large empathy belly", "a huge empathy belly"])});
			}
		} else {
			belly.push({text: "", bellyAccessory: slave.bellyAccessory}); /*compatibility for no output, will likely get deprecated in the future as content is added*/
		}
	} else if(slave.devotion <= 20) {

	} else {
		if(ArcologyZero.FSRepopulationFocus > 0 && slave.belly < 1500 && slave.sexualFlaw != "breeder") {
			if(slave.weight > 130) {
				belly.push({text: `struggles to fit a fake pregnant belly around ${his} gut before giving up and hoping ${he} can pass as fecund,`, bellyAccessory: "none"});
			} else {
				belly.push({text: "straps on a fake pregnant belly to fit in with all the other pregnant girls,", bellyAccessory: jsEither(["a small empathy belly", "a medium empathy belly", "a large empathy belly"])});
			}
		} else if(slave.belly < 1500 && slave.fetish == "pregnancy" && isItemAccessible("a small empathy belly") && slave.sexualFlaw != "breeder" && slave.weight <= 130) {
			if(slave.fetishStrength <= 30) {
				belly.push({text: `straps on a 1st trimester belly to sate ${his} curiosity,`, bellyAccessory: "a small empathy belly"});
				belly.push({text: `straps on a 2nd trimester belly to sate ${his} curiosity,`, bellyAccessory: "a medium empathy belly"});
				belly.push({text: `straps on a 3rd trimester belly to sate ${his} curiosity,`, bellyAccessory: "a large empathy belly"});
			} else if(slave.fetishStrength <= 95) {
				belly.push({text: `straps on a 3rd trimester belly to satisfy ${his} pregnancy fetish,`, bellyAccessory: "a large empathy belly"});
			} else if(slave.fetishStrength > 95) {
				belly.push({text: `straps on the largest belly ${he} can find to satisfy ${his} pregnancy fetish,`, bellyAccessory: "a huge empathy belly"});
			}
		} else if(empathyBellies.includes(slave.bellyAccessory) && slave.fetish != "pregnancy") {
			belly.push({text: `removes ${his} fake belly, since ${he} dislikes it,`, bellyAccessory: "none"});
		} else if(empathyBellies.includes(slave.bellyAccessory) && slave.sexualFlaw == "breeder") {
			belly.push({text: `pulls ${his} fake belly off, disgusted by it,`, bellyAccessory: "none"});
		} else {
			belly.push({text: "", bellyAccessory: slave.bellyAccessory}); /*compatibility for no output, will likely get deprecated in the future as content is added*/
		}
	}
	return jsEither(belly);
};

repo_name: PresidentConvert/fc


code:
:: colorModeJS [script]

window.setColors = function(colorMap){
    let styleSheetArray = Array.from(document.styleSheets);
    styleSheetArray.forEach( styleSheet => {
        let cssRules = Array.from(styleSheet.cssRules);
        cssRules.forEach( cssRule => {
            if ( cssRule.type === 1 ){
                let color = cssRule.style.color;
                let bgcolor = cssRule.style.backgroundColor;
                if (
                    color != "" &&
                    color != "inherit" ){
                    cssRule.style.color = colorMap[color] || color;
                    console.log('color: ',color);
                }
                if (
                    bgcolor != "" &&
                    bgcolor != "inherit" &&
                    bgcolor != "transparent" ){
                    cssRule.style.backgroundColor = colorMap[bgcolor] || bgcolor;
                    console.log('color: ',color);
                }
            }
        });
    });
}


code:
:: EconomyJS [script]

window.LivingRule = Object.freeze({LUXURIOUS: 'luxurious', NORMAL: 'normal', SPARE: 'spare'});
window.Job = Object.freeze({
	DAIRY: 'work in the dairy', MILKMAID: 'be the Milkmaid', MASTER_SUITE: 'serve in the master suite', CONCUBINE: 'be your Concubine',
	BABY_FACTORY: 'labor in the production line', BROTHEL: 'work in the brothel', MADAM: 'be the Madam', ARCADE: 'be confined in the arcade',
	SERVANT: 'work as a servant', SERVER: 'be a servant', STEWARD: 'be the Stewardess', CLUB: 'serve in the club', DJ: 'be the DJ',
	JAIL: 'be confined in the cellblock', WARDEN: 'be the Wardeness', CLINIC: 'get treatment in the clinic', NURSE: 'be the Nurse',
	HGTOY: 'live with your Head Girl', SCHOOL: 'learn in the schoolroom', TEACHER: 'be the Schoolteacher', SPA: 'rest in the spa', ATTEND: 'be the Attendant'});
window.PersonalAttention = Object.freeze({TRADE: 'trading', WAR: 'warfare', SLAVEING: 'slaving', ENGINEERING: 'engineering', MEDICINE: 'medicine', MAID: 'upkeep', HACKING: 'hacking'});

window.getCost = function(array) {
	var rulesCost = State.variables.rulesCost;
	var foodCost = State.variables.foodCost;
	var drugsCost = State.variables.drugsCost;
	var facilityCost = State.variables.facilityCost;
	var economy = State.variables.economy;
	var brothel = State.variables.brothel;
	var arcade = State.variables.arcade;
	var club = State.variables.club;
	var dairy = State.variables.dairy;
	var servantsQuarters = State.variables.servantsQuarters;
	var incubator = State.variables.incubator;
	var mercCosts = State.variables.mercenaries * 2000;
	var policyCost = State.variables.policyCost;
	var costs = (State.variables.brothel * facilityCost)
		+ (State.variables.arcade * facilityCost * 0.5)
		+ (State.variables.club * facilityCost)
		+ (State.variables.dairy * facilityCost)
		+ (State.variables.incubator * facilityCost * 10);
	var secExpCost = 0;
	var soldierMod = 0;

	//facility expenses
	costs += (0.1 * State.variables.brothelUpgradeDrugs * brothel * facilityCost)
	+ (0.2 * State.variables.arcadeUpgradeInjectors * arcade * facilityCost)
	+ (0.2 * State.variables.arcadeUpgradeCollectors * arcade * facilityCost)
	+ (0.2 * State.variables.clubUpgradePDAs * club * facilityCost)
	+ (0.2 * State.variables.dairyFeedersUpgrade * dairy * facilityCost)
	+ (0.1 * State.variables.dairyPregUpgrade * dairy * facilityCost)
	+ (0.2 * State.variables.dairyStimulatorsUpgrade * facilityCost)
	+ (0.2 * State.variables.servantsQuartersUpgradeMonitoring *  servantsQuarters * facilityCost)
	+ (0.2 * State.variables.incubatorUpgradeWeight * incubator * facilityCost)
	+ (0.2 * State.variables.incubatorUpgradeMuscles * incubator * facilityCost)
	+ (0.2 * State.variables.incubatorUpgradeReproduction * incubator * facilityCost)
	+ (0.2 * State.variables.incubatorUpgradeGrowthStims * incubator * facilityCost)
	+ (0.5 * State.variables.incubatorUpgradeSpeed * incubator * facilityCost);

	if(dairy > 0) {
		costs += ((State.variables.bioreactorsXY + State.variables.bioreactorsXX + State.variables.bioreactorsHerm + State.variables.bioreactorsBarren) * 100);
	}
	if(brothel > 0) {
		costs += State.variables.brothelAdsSpending;
	}
	if(club > 0) {
		costs += State.variables.clubAdsSpending;
	}
	if(incubator > 0) {
		costs += ((State.variables.incubatorWeightSetting + State.variables.incubatorMusclesSetting + State.variables.incubatorReproductionSetting + State.variables.incubatorGrowthStimsSetting) * 500);
	}
	if(State.variables.masterSuitePregnancySlaveLuxuries === 1) {
		costs += 500;
	}
	if(State.variables.masterSuitePregnancyFertilitySupplements === 1) {
		costs += 1000;
	}

	//security expansion
	if(State.variables.secExp == 1) {
		if(State.variables.edictsUpkeep > 0) {
			secExpCost += State.variables.edictsUpkeep;
		}
		if(State.variables.SFSupportUpkeep > 0) {
			secExpCost += State.variables.SFSupportUpkeep;
		}
		if(State.variables.propHub > 0) {
			secExpCost += State.variables.propHubUpkeep;
		}
		if(State.variables.secHQ > 0) {
			secExpCost += State.variables.secHQUpkeep + 20 * state.variables.secHelots;
		}
		if(State.variables.secBarracks > 0) {
			secExpCost += State.variables.secBarracksUpkeep;
		}
		if(State.variables.riotCenter > 0) {
			secExpCost += State.variables.riotUpkeep;
		}
		if(State.variables.soldierWages == 0) {
			soldierMod = 1;
		}
		else if(State.variables.soldierWages == 1) {
			soldierMod = 1.5;
		}
		else {
			soldierMod = 2;
		}
		if (State.variables.militiaUnits != null) {
			for (var i = 0; i < State.variables.militiaUnits.length; i++) {
				if( !(State.variables.militiaUnits[i] === null) ){
					secExpCost += State.variables.militiaUnits[i].troops * State.variables.soldierUpkeep * soldierMod;
				}
			}
		}
		if (State.variables.slaveUnits != null) {
			for (var i = 0; i < State.variables.slaveUnits.length; i++) {
				if( !( State.variables.slaveUnits[i] === null) ){
					secExpCost +=  State.variables.slaveUnits[i].troops * State.variables.soldierUpkeep * 0.5 * soldierMod;
				}
			}
		}
		if (State.variables.mercUnits != null) {
			for (var i = 0; i < State.variables.mercUnits.length; i++) {
				if( !(State.variables.mercUnits[i] === null) ){
					secExpCost += State.variables.mercUnits[i].troops * State.variables.soldierUpkeep * 1.5 * soldierMod;
				}
			}
		}
		costs += secExpCost;
	}

	//general arcology costs
	costs += (State.variables.girls * (250 + (economy * 500)));

	if(State.variables.arcologies[0].FSRepopulationFocusLaw === 1 && State.variables.PC.pregKnown == 1) {
		costs -= 500;
	}

	costs += State.variables.citizenOrphanageTotal * 100;
	costs += State.variables.privateOrphanageTotal * 500;
	if(State.variables.breederOrphanageTotal > 0) {
		costs += 50;
	}

	if(State.variables.peacekeepers !== 0 && State.variables.peacekeepers.undermining !== 0) {
		costs += State.variables.peacekeepers.undermining;
	}

	if(State.variables.mercenaries > 0) {
		if(State.variables.barracks) {
			mercCosts *= 0.5;
		}
		if((State.variables.PC.warfare >= 100) || (State.variables.PC.career === 'arcology owner')) {
			mercCosts *= 0.5;
		}
		costs += mercCosts;
	}

	costs += State.variables.FSSpending;

	//slave expenses
	for (var slave of array) {
		costs += getSlaveCost(slave);
		if(slave.assignment === Job.SERVANT || slave.assignment === Job.SERVER) {
			if(slave.trust < -20) {
				costs -= rulesCost * 4;
			} else if(slave.devotion < -20) {
				costs -= rulesCost * 2;
			} else if(slave.devotion <= 20) {
				costs -= rulesCost * 3;
			} else if(slave.devotion <= 50) {
				costs -= rulesCost * 4;
			} else {
				costs -= rulesCost * 5;
			}
			if(slave.fetish === 'submissive') {
				costs -= rulesCost;
			} else if(slave.fetish === 'dom') {
				costs += rulesCost;
			}
			if(slave.relationship < -1) {
				costs -= rulesCost;
			}
			if(slave.energy < 20) {
				costs -= rulesCost;
			} else if(slave.energy < 40) {
				costs -= rulesCost / 2;
			}
			if(slave.lactation > 0) {
				costs -= 25;
			}
			if(slave.assignment === Job.SERVANT) {
				costs -= rulesCost;
			}
			if(setup.servantCareers.includes(slave.career) || slave.skillS >= State.variables.masteredXP) {
				costs -= rulesCost;
			}
		}
	}

	// policy and other expenses
	if(State.variables.Recruiter !== 0) {
		costs += 250;
	}
	if(State.variables.TSS.schoolPresent === 1) {
		costs += 1000;
	}
	if(State.variables.GRI.schoolPresent === 1) {
		costs += 1000;
	}
	if(State.variables.SCP.schoolPresent === 1) {
		costs += 1000;
	}
	if(State.variables.LDE.schoolPresent === 1) {
		costs += 1000;
	}
	if(State.variables.TGA.schoolPresent === 1) {
		costs += 1000;
	}
	if(State.variables.HA.schoolPresent === 1) {
		costs += 1000;
	}
	if(State.variables.TCR.schoolPresent === 1) {
		costs += 1000;
	}
	if((State.variables.TFS.schoolPresent === 1) && ((State.variables.PC.dick === 0) || (State.variables.PC.vagina === 0) || (State.variables.PC.boobs === 0))) {
		costs += 1000;
	}
	if(State.variables.TSS.subsidize !== 0) {
		costs += 1000;
	}
	if(State.variables.GRI.subsidize !== 0) {
		costs += 1000;
	}
	if(State.variables.SCP.subsidize !== 0) {
		costs += 1000;
	}
	if(State.variables.LDE.subsidize !== 0) {
		costs += 1000;
	}
	if(State.variables.TGA.subsidize !== 0) {
		costs += 1000;
	}
	if(State.variables.HA.subsidize !== 0) {
		costs += 1000;
	}
	if(State.variables.TCR.subsidize !== 0) {
		costs += 1000;
	}
	if(State.variables.TFS.subsidize !== 0) {
		costs += 1000;
	}

	if(State.variables.alwaysSubsidizeGrowth === 1) {
		costs += policyCost;
	}
	if(State.variables.alwaysSubsidizeRep === 1) {
		costs += policyCost;
	}
	if(State.variables.RegularParties === 1) {
		costs += policyCost;
	}

	if(State.variables.ProImmigrationCash === 1) {
		costs += policyCost;
	}
	if(State.variables.AntiEnslavementCash === 1) {
		costs += policyCost;
	}

	if(State.variables.CoursingAssociation === 1) {
		costs += 1000;
	}

	if(State.variables.PC.actualAge >= State.variables.IsInPrimePC && State.variables.PC.actualAge < State.variables.IsPastPrimePC) {
	if(State.variables.personalAttention === PersonalAttention.TRADE) {
		costs += 10000*State.variables.AgeEffectOnTrainerPricingPC;
	} else if(State.variables.personalAttention === PersonalAttention.WAR) {
		costs += 10000*State.variables.AgeEffectOnTrainerPricingPC;
	} else if(State.variables.personalAttention === PersonalAttention.SLAVING) {
		costs += 10000*State.variables.AgeEffectOnTrainerPricingPC;
	} else if(State.variables.personalAttention === PersonalAttention.ENGINEERING) {
		costs += 10000*State.variables.AgeEffectOnTrainerPricingPC;
	} else if(State.variables.personalAttention === PersonalAttention.MEDICINE) {
		costs += 10000*State.variables.AgeEffectOnTrainerPricingPC;
	} else if(State.variables.personalAttention === PersonalAttention.HACKING) {
		costs += 10000*State.variables.AgeEffectOnTrainerPricingPC;
	}
	}

	if(State.variables.cyberMod !== 0 && State.variables.researchLab.built === 'true') {
		costs += ((100 * State.variables.researchLab.maxSpace) + (300 * State.variables.researchLab.hired) + (100 * State.variables.researchLab.hired));
	}

	//player expenses

	if(State.variables.PC.preg === -1) {
		costs += 25;
	} else if(State.variables.PC.fertDrugs === 1) {
		costs += 50;
	} else if(State.variables.PC.preg >= 16) {
		costs += 100;
	}
	if(State.variables.PC.staminaPills === 1) {
		costs += 50;
	}

	if(State.variables.PC.career === 'servant') {
		if(State.variables.personalAttention === PersonalAttention.MAID) {
			if(State.variables.PC.belly >= 5000) {
				costs *= 0.80;
			} else {
				costs *= 0.75;
			}
		} else {
			costs *= 0.9;
		}
	}

	if(State.variables.secExp == 1) {
		if(State.variables.terrain === 'oceanic' || State.variables.terrain === 'marine') {
			if(State.variables.docks > 0) {
				costs *= (1 - State.variables.docks * 0.05);
			}
		} else if(State.variables.railway > 0) {
			costs *= (1 - State.variables.railway * 0.05);
		}
	}

	// clean up
	if(costs < 0) {
		costs = 0;
	} else {
		costs = Math.trunc(costs);
	}

	return costs;
}

window.getSlaveCost = function(s) {
	if(!s) { return 0; }
	// Data duplicated from Cost Report
	var cost = 0;
	var rulesCost = State.variables.rulesCost;
	var foodCost = State.variables.foodCost;
	var drugsCost = State.variables.drugsCost;

	// Living expenses
	switch(s.assignment) {
	case Job.ARCADE:
		cost += rulesCost * .75;
		break;
	case Job.DAIRY:
		if(State.variables.dairyRestraintsSetting >= 2) {
			cost += rulesCost * .75;
		} else if(s.livingRules == LivingRule.NORMAL) {
			cost += rulesCost * 1.5;
		} else if(State.variables.dairyDecoration === 'Degradationist') {
			cost += rulesCost * .90;
		} else {
			cost += rulesCost;
		}
		break;
	case Job.BROTHEL:
		if(s.livingRules == LivingRule.NORMAL) {
			cost += rulesCost * 1.5;
		} else {
			cost += rulesCost;
		}
		break;
	case Job.SCHOOL: case Job.CLUB:
		cost += rulesCost * 1.5;
		break;
	case Job.CLINIC:
		if(s.livingRules === LivingRule.LUXURIOUS) {
			cost += rulesCost * 2;
		} else if(s.livingRules == LivingRule.NORMAL) {
			cost += rulesCost * 1.5;
		} else {
			cost += rulesCost;
		}
		break;
	case Job.SPA:
		if(s.livingRules === LivingRule.LUXURIOUS) {
			cost += rulesCost * 1.75;
		} else if(s.livingRules == LivingRule.NORMAL) {
			cost += rulesCost * 1.5;
		} else {
			cost += rulesCost;
		}
		break;
	case Job.SERVANT:
		if(s.livingRules == LivingRule.NORMAL) {
			cost += rulesCost * 1.5;
		} else {
			if(State.variables.servantsQuartersDecoration === 'Degradationist') {
				cost += rulesCost * .90;
			} else {
				cost += rulesCost;
			}
		}
		break;
	case Job.JAIL:
		if(s.livingRules == LivingRule.NORMAL) {
			cost += rulesCost * 1.25;
		} else {
			cost += rulesCost * .90;
		}
		break;
	case Job.MADAM: case Job.DJ: case Job.NURSE: case Job.WARDEN:
	case Job.ATTEND: case Job.STEWARD: case Job.MILKMAID: case Job.TEACHER:
		cost += rulesCost * 2;
		break;
	default:
		if(s.livingRules === LivingRule.LUXURIOUS) {
			cost += rulesCost * (s.relationship >= 4 ? 3 : 4);
		} else if(s.livingRules == LivingRule.NORMAL) {
			cost += rulesCost * 2;
		} else {
			cost += rulesCost;
		}
		break;
	}

	// Food
	cost += foodCost * 4;
	switch(s.diet) {
		case 'fattening': case 'muscle building':
			cost += foodCost;
			break;
		case 'restricted': case 'slimming':
			cost -= foodCost;
			break;
	}
	if(s.weight > 130) {
		cost += foodCost * 2;
	} else if(s.weight > 50) {
		cost += foodCost;
	} else if(s.weight < -50) {
		cost -= foodCost;
	}
	if(s.drugs === 'appetite suppressors') {
		cost -= foodCost;
	}
	if(s.lactation > 0) {
		cost += foodCost * s.lactation * (1 + Math.trunc(s.boobs/10000));
	}
	if(s.preg > 5) {
		if(s.assignment === Job.DAIRY && State.variables.dairyFeedersSetting > 0) {
			// Extra feeding costs to support pregnancy are covered by dairy feeders.
			// TODO: Include them here anyway?
		} else if((s.assignment === Job.MASTER_SUITE || s.assignment === Job.CONCUBINE)
			&& State.variables.masterSuiteUpgradePregnancy === 1) {
			// Extra feeding costs to support pregnancy are covered by master suite luxuries.
			// TODO: Include them here anyway?
		} else {
			cost += foodCost * s.pregType * (s.pregControl === 'speed up' ? 3 : 1);
		}
	}
	if(s.diet === 'XX' || s.diet === 'XY' || s.diet === 'fertility') {
		cost += 25;
	} else if(s.diet === 'cleansing') {
		cost += 50;
	} else if(s.diet === 'XXY') {
		cost += 75;
	}

	// Accessibility costs
	if(State.variables.boobAccessibility !== 1 && s.boobs > 20000
		&& (s.assignment != Job.DAIRY || State.variables.dairyRestraintsSetting < 2) && (s.assignment != Job.ARCADE)) {
		cost += 50;
	}
	if(State.variables.pregAccessibility !== 1
		&& (s.belly >= 60000) && s.assignment != Job.BABY_FACTORY && (s.assignment != Job.DAIRY || State.variables.dairyRestraintsSetting < 2) && (s.assignment != Job.ARCADE)) {
		cost += 100;
	}
	if(State.variables.dickAccessibility != 1 && s.dick > 45 && (s.assignment != Job.DAIRY || State.variables.dairyRestraintsSetting < 2) && (s.assignment != Job.ARCADE)) {
		cost += 50;
	}
	if(State.variables.ballsAccessibility != 1 && s.balls > 90 && (s.assignment != Job.DAIRY || State.variables.dairyRestraintsSetting < 2) && (s.assignment != Job.ARCADE)) {
		cost += 50;
	}
	if(State.variables.buttAccessibility != 1 && s.butt > 15 && (s.assignment != Job.DAIRY || State.variables.dairyRestraintsSetting < 2) && (s.assignment != Job.ARCADE)) {
		cost += 50;
	}
	if(!canSee(s) && (s.assignment != Job.DAIRY || State.variables.dairyRestraintsSetting < 2) && (s.assignment != Job.ARCADE)) {
		cost += 50;
	} else if(s.eyes <= -1 &&	s.eyewear !== 'corrective glasses' && s.eyewear !== 'corrective contacts') {
		cost += 25;
	} else if(s.eyewear === 'blurring glasses' || s.eyewear === 'blurring contacts') {
		cost += 25;
	}
	if((s.assignment !== Job.DAIRY || State.variables.dairyRestraintsSetting < 2) && (s.assignment !== Job.ARCADE)) {
		if(s.amp !== 0) {
			if(s.amp === 1) {
				cost += rulesCost;
			} else {
				cost += rulesCost / 2;
			}
		} else if(!canWalk(s)) {
			cost += rulesCost;
		}
	}

	// Maintenance
	if(s.boobs > 10000 && s.boobsImplantType === 1) {
		cost += 50;
	}
	if(s.butt > 10 && s.buttImplantType === 1) {
		cost += 50;
	}
	if((s.assignment !== Job.DAIRY || State.variables.dairyRestraintsSetting < 2) && (s.assignment !== Job.ARCADE)) {
		if(s.preg > 35 && State.variables.universalRulesBirthing === 1) {
			cost += 50;
		}
	}

	// Retirement account
	if(State.variables.CitizenRetirement === 1) {
		cost += 250;
	}

	// Enemas
	if(s.inflation === 3) {
		switch(s.inflationType) {
		case 'water':
			cost += 100;
			break;
		case 'food':
			cost += (foodCost * 4);
			break;
		case 'curative': case 'aphrodisiac': case 'tightener':
			cost += (100 + (drugsCost * 2));
			break;
		}
	} else if(s.inflation === 2) {
		switch(s.inflationType) {
		case 'water':
			cost += 50;
			break;
		case 'food':
			cost += (foodCost * 2);
			break;
		case 'curative': case 'aphrodisiac': case 'tightener':
			cost += (50 + (drugsCost * 2));
			break;
		}
	} else if(s.inflation === 1) {
		switch(s.inflationType) {
		case 'water':
			cost += 25;
			break;
		case 'food':
			cost += (foodCost);
			break;
		case 'curative': case 'aphrodisiac': case 'tightener':
			cost += (25 + (drugsCost * 2));
			break;
		}
	}

	// Drugs
	switch(s.drugs) {
	case 'anti-aging cream':
		cost += drugsCost * 10;
		break;
	case 'female hormone injections': case 'male hormone injections': case 'intensive breast injections':
	case 'intensive butt injections': case 'intensive penis enhancement': case 'intensive testicle enhancement':
	case 'intensive lip injections': case 'hyper breast injections': case 'hyper butt injections':
	case 'hyper penis enhancement': case 'hyper testicle enhancement': case 'hyper lip injections':
	case 'growth stimulants':
		cost += drugsCost * 5;
		break;
	case 'sag-B-gone':
		cost += drugsCost * .1;
		break;
	case 'no drugs': case 'none':
		break;
	default:
		cost += drugsCost * 2;
		break;
	}
	if(s.curatives > 0 && s.assignmentVisible === 1) {
		cost += drugsCost * s.curatives;
	}
	if(s.aphrodisiacs !== 0) {
		cost += drugsCost * Math.abs(s.aphrodisiacs);
	}
	if(s.hormones !== 0) {
		cost += (drugsCost * Math.abs(s.hormones) * 0.5);
	}
	if(s.bodySwap > 0) {
		cost += (drugsCost * s.bodySwap * 10);
	}
	if(s.preg === -1 && isFertile(s)) {
		cost += (drugsCost * 0.5);
	}

	// Promotion costs
	if(State.variables.studio === 1) {
		if(s.pornFameSpending > 0) {
			cost += s.pornFameSpending;
		}
	}

	if(isNaN(cost)) {
		throw new Error('Cost calculation for slave ' + s.slaveName + ' (' + s.ID + ') failed.');
	}
	return cost;
};

window.menialSlaveCost = function() {
	var df = State.variables.menialDemandFactor;
	return random(998,1001) + Math.trunc(Math.sign(df) * Math.sqrt(1 - Math.exp(-1*Math.pow(df/500, 2)*(4/Math.PI + 0.140012 * Math.pow(df/500, 2))/(1 + 0.140012 * Math.pow(df/500, 2))))*150); /* https://en.wikipedia.org/wiki/Error_function */
};

window.getSlaveStatisticData = function(s, facility) {
	if(!s || !facility) {
		// Base data, even without facility
		return {
			ID: s.ID, slaveName: s.slaveName, customLabel: s.customLabel,
			income: 0, adsIncome: 0, rep: 0, cost: getSlaveCost(s),
			customers: 0 /* brothel, club, ... */
		};
	}

	if(!facility.income) {
		facility.income = new Map();
	}

	if(facility.income.has(s.ID)) {
		return facility.income.get(s.ID);
	} else {
		var data = {
			ID: s.ID, slaveName: s.slaveName, customLabel: s.customLabel,
			income: 0, adsIncome: 0, rep: 0, cost: getSlaveCost(s),
			customers: 0 /* brothel, club, ... */
		};
		facility.income.set(s.ID, data);
		return data;
	}
};

window.initFacilityStatistics = function(facility) {
	facility = facility || {};
	facility.adsIncome = 0;
	facility.maintenance = 0;
	facility.totalIncome = 0;
	facility.totalExpenses = 0;
	facility.profit = 0;
	facility.income = new Map();
	return facility;
}

Number.prototype.toFixedHTML = function() {
	return commaNum(Number.prototype.toFixed.apply(this, arguments)).replace(/\.0+$/, '$&');
}