code:
:: rules autosurgery js [script]

window.rulesAutosurgery = (function() {
	"use strict";
	let V;
	let r;
	return rulesAutoSurgery;

	function rulesAutoSurgery(slave) {
		V = State.variables;
		r = "";
		const surgeries = [];
		const thisSurgery = ProcessHGTastes(slave);
		if (slave.health > 20)
			CommitSurgery(slave, thisSurgery, surgeries);
		if (surgeries.length > 0)
			PrintResult(slave, thisSurgery, surgeries);
		return r;
	}

	function autoSurgerySelector(slave, ruleset) {
		const surgery = {};
		ruleset.forEach(rule => {
			Object.keys(rule)
				.filter(key => key.startsWith("surgery_") && rule[key] !== "no default setting")
				.forEach(key => {
					surgery[key] = rule[key];
				});
		});
		return surgery;
	}

	function ProcessHGTastes(slave) {
		let thisSurgery;
		switch (V.HGTastes) {
		case 1:
			thisSurgery = {
				surgery_lactation: 0,
				surgery_cosmetic: 1,
				surgery_faceShape: "cute",
				surgery_lips: 10,
				surgery_hips: 0,
				surgery_hipsImplant: 0,
				surgery_butt: 0,
				surgery_accent: 0,
				surgery_shoulders: 0,
				surgery_shouldersImplant: 0,
				surgery_boobs: 0,
				surgery_holes: 0
			};
			break ;
		case 2:
			thisSurgery = {
				surgery_lactation: 0,
				surgery_cosmetic: 1,
				surgery_faceShape: "cute",
				surgery_lips: 60,
				surgery_hips: 0,
				surgery_hipsImplant: 0,
				surgery_butt: 4,
				surgery_accent: 0,
				surgery_shoulders: 0,
				surgery_shouldersImplant: 0,
				surgery_boobs: 1200,
				surgery_holes: 0
			};
			break;
		case 3:
			thisSurgery = {
				surgery_lactation: 0,
				surgery_cosmetic: 1,
				surgery_faceShape: "cute",
				surgery_lips: 95,
				surgery_hips: 0,
				surgery_hipsImplant: 0,
				surgery_butt: 8,
				surgery_accent: 0,
				surgery_shoulders: 0,
				surgery_shouldersImplant: 0,
				surgery_boobs: 10000,
				surgery_holes: 2
			};
			break;
		case 4:
			thisSurgery = {
				surgery_lactation: 1,
				surgery_cosmetic: 1,
				surgery_faceShape: "cute",
				surgery_lips: 10,
				surgery_hips: 3,
				surgery_hipsImplant: 0,
				surgery_butt: 0,
				surgery_accent: 0,
				surgery_shoulders: 0,
				surgery_shouldersImplant: 0,
				surgery_boobs: 0,
				surgery_holes: 0
			};
			break;
		default:
			thisSurgery = autoSurgerySelector(
				slave,
				V.defaultRules
					.filter(x => ruleApplied(slave, x) && x.set.autoSurgery === 1)
					.map(x => x.set));
			if ((thisSurgery.surgery_hips !== "no default setting") && (thisSurgery.surgery_butt !== "no default setting")) {
				if (slave.hips < -1) {
					if (thisSurgery.surgery_butt > 2)
						thisSurgery.surgery_butt = 2;
				} else if (slave.hips < 0) {
					if (thisSurgery.surgery_butt > 4)
						thisSurgery.surgery_butt = 4;
				} else if (slave.hips > 0) {
					if (thisSurgery.surgery_butt > 8)
						thisSurgery.surgery_butt = 8;
				} else if (slave.hips > 1) {
					true;
				} else {
					if (thisSurgery.surgery_butt > 6)
						thisSurgery.surgery_butt = 6;
				}
			}
			break;
		}
		return thisSurgery;
	}

	function CommitSurgery(slave, thisSurgery, surgeries) {
		if ((slave.eyes == -1) && (thisSurgery.surgery_eyes == 1)) {
			surgeries.push("surgery to correct her vision");
			slave.eyes = 1;
			V.cash -= V.surgeryCost;
			if (V.PC.medicine >= 100) slave.health -= 5;
			else slave.health -= 10;

		} else if ((slave.eyes == 1) && (thisSurgery.surgery_eyes == -1)) {
			surgeries.push("surgery to blur her vision");
			slave.eyes = -1;
			V.cash -= V.surgeryCost;
			if (V.PC.medicine >= 100) slave.health -= 5;
			else slave.health -= 10;

		} else if ((slave.hears == -1) && (thisSurgery.surgery_hears == 1)) {
			surgeries.push("surgery to correct her hearing");
			slave.hears = 0;
			V.cash -= V.surgeryCost;
			if (V.PC.medicine >= 100) slave.health -= 5;
			else slave.health -= 10;

		} else if ((slave.hears == 0) && (thisSurgery.surgery_hears == -1)) {
			surgeries.push("surgery to muffle her hearing");
			slave.hears = -1;
			V.cash -= V.surgeryCost;
			if (V.PC.medicine >= 100) slave.health -= 5;
			else slave.health -= 10;

		} else if ((slave.lactation == 2) && (thisSurgery.surgery_lactation == 0)) {
			surgeries.push("surgery to remove her lactation implants");
			slave.lactation = 0;
			V.cash -= V.surgeryCost;
			if (V.PC.medicine >= 100) slave.health -= 5;
			else slave.health -= 10;

		} else if (slave.lactation != 2 && (thisSurgery.surgery_lactation == 1)) {
			surgeries.push("lactation inducing implanted drugs");
			slave.lactation = 2;
			V.cash -= V.surgeryCost;
			if (V.PC.medicine >= 100) slave.health -= 5;
			else slave.health -= 10;

		} else if ((slave.prostate == 2) && (thisSurgery.surgery_prostate == 0)) {
			surgeries.push("surgery to remove her prostate implant");
			slave.prostate = 0;
			V.cash -= V.surgeryCost;
			if (V.PC.medicine >= 100) slave.health -= 5;
			else slave.health -= 10;

		} else if (slave.prostate == 1 && (thisSurgery.surgery_prostate == 1)) {
			surgeries.push("a precum production enhancing drug implant");
			slave.prostate = 2;
			V.cash -= V.surgeryCost;
			if (V.PC.medicine >= 100) slave.health -= 5;
			else slave.health -= 10;

		} else if ((slave.anus > 3) && (thisSurgery.surgery_cosmetic > 0)) {
			surgeries.push("a restored anus");
			slave.anus = 3;
			if (slave.analSkill > 10)
				slave.analSkill -= 10;
			V.cash -= V.surgeryCost;
			if (V.PC.medicine >= 100) slave.health -= 5;
			else slave.health -= 10;

		} else if ((slave.vagina > 3) && (thisSurgery.surgery_cosmetic > 0)) {
			surgeries.push("a restored pussy");
			slave.vagina = 3;
			if (slave.vaginalSkill > 10)
				slave.vaginalSkill -= 10;
			V.cash -= V.surgeryCost;
			if (V.PC.medicine >= 100) slave.health -= 5;
			else slave.health -= 10;

		} else if ((slave.faceImplant <= 15) && (slave.face <= 95) && (thisSurgery.surgery_cosmetic > 0)) {
			surgeries.push("a nicer face");
			if (slave.faceShape == "masculine") slave.faceShape = "androgynous";
			slave.faceImplant += 25-5*Math.trunc(V.PC.medicine/50)-5*V.surgeryUpgrade;
			slave.face = Math.clamp(slave.face+20,-100,100);
			V.cash -= V.surgeryCost;
			if (V.PC.medicine >= 100) slave.health -= 5;
			else slave.health -= 10;

		} else if ((slave.faceImplant <= 15) && (slave.ageImplant != 1) && (slave.visualAge >= 25) && (thisSurgery.surgery_cosmetic > 0)) {
			surgeries.push("an age lift");
			slave.ageImplant = 1;
			slave.faceImplant += 25-5*Math.trunc(V.PC.medicine/50)-5*V.surgeryUpgrade;
			if (slave.visualAge > 80) slave.visualAge -= 40;
			else if (slave.visualAge >= 70) slave.visualAge -= 30;
			else if (slave.visualAge > 50) slave.visualAge -= 20;
			else if (slave.visualAge > 36) slave.visualAge -= 10;
			else slave.visualAge -= 5;
			V.cash -= V.surgeryCost;
			if (V.PC.medicine >= 100) slave.health -= 5;
			else slave.health -= 10;

		} else if (((slave.underArmHStyle != "bald" && slave.underArmHStyle != "hairless") || (slave.pubicHStyle != "bald" && slave.pubicHStyle != "hairless")) && (thisSurgery.surgery_bodyhair == 2)) {
			surgeries.push("body hair removal");
			if (slave.underArmHStyle != "hairless") slave.underArmHStyle = "bald";
			if (slave.pubicHStyle != "hairless") slave.pubicHStyle = "bald";
			V.cash -= V.surgeryCost;

		} else if ((slave.bald == 0 || slave.hStyle != "bald" || slave.eyebrowHStyle != "bald") && (thisSurgery.surgery_hair == 2)) {
			surgeries.push("hair removal");
			slave.eyebrowHStyle = "bald";
			slave.hStyle = "bald";
			slave.bald = 1;
			V.cash -= V.surgeryCost;

		} else if ((slave.weight >= 10) && (thisSurgery.surgery_cosmetic > 0)) {
			surgeries.push("liposuction");
			slave.weight -= 50;
			V.cash -= V.surgeryCost;
			if (V.PC.medicine >= 100) slave.health -= 5;
			else slave.health -= 10;

		} else if ((slave.voice == 1) && (slave.voiceImplant == 0) && (thisSurgery.surgery_cosmetic > 0)) {
			surgeries.push("a feminine voice");
			slave.voice += 1;
			slave.voiceImplant += 1;
			V.cash -= V.surgeryCost;
			if (V.PC.medicine >= 100) slave.health -= 5;
			else slave.health -= 10;

		} else if ((slave.waist >= -10) && (thisSurgery.surgery_cosmetic > 0)) {
			surgeries.push("a narrower waist");
			slave.waist -= 20;
			V.cash -= V.surgeryCost;
			if (V.PC.medicine >= 100) slave.health -= 5;
			else slave.health -= 10;

		} else if (((slave.boobShape == "saggy") || (slave.boobShape == "downward-facing")) && (thisSurgery.surgery_cosmetic > 0) && (slave.breastMesh != 1)) {
			surgeries.push("a breast lift");
			slave.boobShape = "normal";
			V.cash -= V.surgeryCost;
			if (V.PC.medicine >= 100) slave.health -= 5;
			else slave.health -= 10;

		} else if (((slave.boobShape == "normal") || (slave.boobShape == "wide-set")) && (thisSurgery.surgery_cosmetic > 0) && (slave.breastMesh != 1)) {
			if (slave.boobs > 800)
				slave.boobShape = "torpedo-shaped";
			else
				slave.boobShape = "perky";
			surgeries.push("more interestingly shaped breasts");
			V.cash -= V.surgeryCost;
			if (V.PC.medicine >= 100) slave.health -= 5;
			else slave.health -= 10;

		} else if ((thisSurgery.surgery_lips == 0) && (slave.lipsImplant > 0)) {
			surgeries.push("surgery to remove her lip implants");
			slave.lips -= slave.lipsImplant;
			slave.lipsImplant = 0;
			if (slave.oralSkill > 10)
				slave.oralSkill -= 10;
			V.cash -= V.surgeryCost;
			if (V.PC.medicine >= 100) slave.health -= 5;
			else slave.health -= 10;

		} else if ((slave.lips <= 95) && (slave.lips < thisSurgery.surgery_lips)) {
			if (thisSurgery.surgery_lips !== "no default setting") {
				surgeries.push("bigger lips");
				slave.lipsImplant += 10;
				slave.lips += 10;
				if (slave.oralSkill > 10)
					slave.oralSkill -= 10;
				V.cash -= V.surgeryCost;
				if (V.PC.medicine >= 100) slave.health -= 5;
				else slave.health -= 10;
			}

		} else if ((slave.faceImplant <= 45) && (slave.face <= 95) && (thisSurgery.surgery_cosmetic == 2)) {
			surgeries.push("a nicer face");
			if (slave.faceShape == "masculine") slave.faceShape = "androgynous";
			slave.faceImplant += 25-5*Math.trunc(V.PC.medicine/50)-5*V.surgeryUpgrade;
			slave.face = Math.clamp(slave.face+20,-100,100);
			V.cash -= V.surgeryCost;
			if (V.PC.medicine >= 100) slave.health -= 5;
			else slave.health -= 10;

		} else if ((slave.hips < 1) && (slave.hips < thisSurgery.surgery_hips) && (V.surgeryUpgrade == 1)) {
			surgeries.push("wider hips");
			slave.hips++;
			slave.hipsImplant++;
			V.cash -= V.surgeryCost;
			if (V.PC.medicine >= 100) slave.health -= 5;
			else slave.health -= 10;

		} else if ((slave.faceImplant <= 45) && (slave.ageImplant != 1) && (slave.visualAge >= 25) && (thisSurgery.surgery_cosmetic == 2)) {
			surgeries.push("an age lift");
			slave.ageImplant = 1;
			if (slave.visualAge > 80) {
				slave.visualAge -= 40;
			} else if (slave.visualAge >= 70) {
				slave.visualAge -= 30;
			} else if (slave.visualAge > 50) {
				slave.visualAge -= 20;
			} else if (slave.visualAge > 36) {
				slave.visualAge -= 10;
			} else {
				slave.visualAge -= 5;
			}
			slave.faceImplant += 25-5*Math.trunc(V.PC.medicine/50)-5*V.surgeryUpgrade;
			V.cash -= V.surgeryCost;
			if (V.PC.medicine >= 100) slave.health -= 5;
			else slave.health -= 10;

		} else if ((slave.waist >= -95) && (thisSurgery.surgery_cosmetic == 2) && (V.seeExtreme == 1)) {
			surgeries.push("a narrower waist");
			slave.waist = Math.clamp(slave.waist-20,-100,100);
			V.cash -= V.surgeryCost;
			if (V.PC.medicine >= 100) slave.health -= 5;
			else slave.health -= 10;

		} else if ((slave.voice < 3) && (slave.voiceImplant == 0) && (thisSurgery.surgery_cosmetic == 2)) {
			surgeries.push("a bimbo's voice");
			slave.voice += 1;
			slave.voiceImplant += 1;
			V.cash -= V.surgeryCost;
			if (V.PC.medicine >= 100) slave.health -= 5;
			else slave.health -= 10;

		} else if ((thisSurgery.surgery_butt == 0) && (slave.buttImplant > 0)) {
			surgeries.push("surgery to remove her butt implants");
			slave.butt -= slave.buttImplant;
			slave.buttImplant = 0;
			slave.buttImplantType = 0;
			V.cash -= V.surgeryCost;
			if (V.PC.medicine >= 100) slave.health -= 5;
			else slave.health -= 10;

		} else if ((thisSurgery.surgery_boobs == 0) && (slave.boobsImplant > 0)) {
			surgeries.push("surgery to remove her boob implants");
			slave.boobs -= slave.boobsImplant;
			slave.boobsImplant = 0;
			slave.boobsImplantType = 0;
			V.cash -= V.surgeryCost;
			if (V.PC.medicine >= 100) slave.health -= 5;
			else slave.health -= 10;
		} else if ((slave.butt <= 3) && (slave.butt < thisSurgery.surgery_butt)) {
			if (thisSurgery.surgery_butt !== "no default setting") {
				surgeries.push("a bigger butt");
				slave.buttImplant = 1;
				slave.butt += 1;
				V.cash -= V.surgeryCost;
				if (V.PC.medicine >= 100) slave.health -= 5;
				else slave.health -= 10;
			}
		} else if ((slave.boobs <= 600) && (slave.lactation < 2) && (slave.boobs+400 <= thisSurgery.surgery_boobs)) {
			if (thisSurgery.surgery_boobs !== "no default setting") {
				surgeries.push("bigger boobs");
				slave.boobsImplant += 400;
				slave.boobs += 400;
				V.cash -= V.surgeryCost;
				if (V.PC.medicine >= 100) slave.health -= 5;
				else slave.health -= 10;
			}
		} else if ((slave.boobs <= 600) && (slave.lactation < 2) && (slave.boobs+200 <= thisSurgery.surgery_boobs)) {
			if (thisSurgery.surgery_boobs !== "no default setting") {
				surgeries.push("modestly bigger boobs");
				slave.boobsImplant += 200;
				slave.boobs += 200;
				V.cash -= V.surgeryCost;
				if (V.PC.medicine >= 100) slave.health -= 5;
				else slave.health -= 10;
			}

		} else if ((slave.butt <= 5) && (slave.butt < thisSurgery.surgery_butt)) {
			if (thisSurgery.surgery_butt !== "no default setting") {
				surgeries.push("a bigger butt");
				slave.buttImplant = 1;
				slave.butt += 1;
				V.cash -= V.surgeryCost;
				if (V.PC.medicine >= 100) slave.health -= 5;
				else slave.health -= 10;
			}

		} else if ((slave.boobs <= 2000) && (slave.lactation < 2) && (slave.boobs+400 < thisSurgery.surgery_boobs)) {
			if (thisSurgery.surgery_boobs !== "no default setting") {
				surgeries.push("bigger boobs");
				slave.boobsImplant += 400;
				slave.boobs += 400;
				V.cash -= V.surgeryCost;
				if (V.PC.medicine >= 100) slave.health -= 5;
				else slave.health -= 10;
			}

		} else if ((slave.anus > 0) && (V.surgeryUpgrade == 1) && (thisSurgery.surgery_holes == 2)) {
			surgeries.push("a virgin anus");
			slave.anus = 0;
			if (slave.analSkill > 10) {
				slave.analSkill -= 10;
			}
			V.cash -= V.surgeryCost;
			if (V.PC.medicine >= 100) slave.health -= 5;
			else slave.health -= 10;

		} else if ((slave.vagina > 0) && (V.surgeryUpgrade == 1) && (thisSurgery.surgery_holes == 2)) {
			surgeries.push("a virgin pussy");
			slave.vagina = 0;
			if (slave.vaginalSkill > 10)
				slave.vaginalSkill -= 10;
			V.cash -= V.surgeryCost;
			if (V.PC.medicine >= 100) slave.health -= 5;
			else slave.health -= 10;

		} else if ((slave.hips < 2) && (slave.hips < thisSurgery.surgery_hips) && (V.surgeryUpgrade == 1)) {
			surgeries.push("wider hips");
			slave.hips++;
			slave.hipsImplant++;
			V.cash -= V.surgeryCost;
			if (V.PC.medicine >= 100) slave.health -= 5;
			else slave.health -= 10;

		} else if ((slave.anus > 1) && (thisSurgery.surgery_holes == 1)) {
			surgeries.push("a tighter anus");
			slave.anus = 1;
			if (slave.analSkill > 10) {
				slave.analSkill -= 10;
			}
			V.cash -= V.surgeryCost;
			if (V.PC.medicine >= 100) slave.health -= 5;
			else slave.health -= 10;

		} else if ((slave.vagina > 1) && (thisSurgery.surgery_holes == 1)) {
			surgeries.push("a tighter pussy");
			slave.vagina = 1;
			if (slave.vaginalSkill > 10) {
				slave.vaginalSkill -= 10;
			}
			V.cash -= V.surgeryCost;
			if (V.PC.medicine >= 100) slave.health -= 5;
			else slave.health -= 10;

		} else if ((slave.butt <= 8) && (slave.butt < thisSurgery.surgery_butt)) {
			if (thisSurgery.surgery_butt !== "no default setting") {
				surgeries.push("a bigger butt");
				slave.buttImplant = 1;
				slave.butt += 1;
				V.cash -= V.surgeryCost;
				if (V.PC.medicine >= 100) slave.health -= 5;
				else slave.health -= 10;
			}

		} else if ((slave.boobs <= 9000) && (slave.lactation < 2) && (slave.boobs < thisSurgery.surgery_boobs)) {
			if (thisSurgery.surgery_boobs !== "no default setting") {
				surgeries.push("bigger boobs");
				slave.boobsImplant += 200;
				slave.boobs += 200;
				V.cash -= V.surgeryCost;
				if (V.PC.medicine >= 100) slave.health -= 5;
				else slave.health -= 10;
			}

		} else if ((slave.hips < 3) && (slave.hips < thisSurgery.surgery_hips) && (V.surgeryUpgrade == 1)) {
			surgeries.push("wider hips");
			slave.hips++;
			slave.hipsImplant++;
			V.cash -= V.surgeryCost;
			if (V.PC.medicine >= 100) slave.health -= 5;
			else slave.health -= 10;

		} else if (slave.bellyImplant < 0 && V.bellyImplants > 0 && thisSurgery.surgery_bellyImplant == "install" && slave.womb.length == 0 && slave.broodmother == 0) {
			slave.bellyImplant = 100;
			slave.preg = -2;
			V.cash -= V.surgeryCost;
			if (slave.ovaries == 1 || slave.mpreg == 1) {
				surgeries.push("belly implant");
				V.surgeryType = "bellyIn";
				if (V.PC.medicine >= 100) slave.health -= 5;
				else slave.health -= 10;
			} else {
				surgeries.push("male belly implant");
				V.surgeryType = "bellyInMale";
				if (V.PC.medicine >= 100) slave.health -= 25;
				else slave.health -= 50;
			}
			bellyIn(slave);

		} else if (slave.bellyImplant >= 0 && thisSurgery.surgery_bellyImplant == "remove") {
			surgeries.push("belly implant removal");
			V.surgeryType = "bellyOut";
			if (V.PC.medicine >= 100)
				slave.health -= 5;
			else
				slave.health -= 10;
			slave.preg = 0;
			slave.bellyImplant = -1;
			V.cash -= V.surgeryCost;
		} else if (slave.balls > 0 && slave.vasectomy === 0 && thisSurgery.surgery_vasectomy === true) {
			surgeries.push("vasectomy");
			V.surgeryType = "vasectomy";
			if (V.PC.medicine >= 100)
				slave.health -= 5;
			else
				slave.health -= 10;
			slave.vasectomy = 1;
			V.cash -= V.surgeryCost;
		} else if (slave.balls > 0 && slave.vasectomy === 1 && thisSurgery.surgery_vasectomy === false) {
			surgeries.push("undo vasectomy");
			V.surgeryType = "vasectomy undo";
			if (V.PC.medicine >= 100)
				slave.health -=5;
			else
				slave.health -= 10;
			slave.vasectomy = 0;
			V.cash -= V.surgeryCost;
		}
	}

	function PrintResult(slave, thisSurgery, surgeries) {
		let surgeriesDisplay = "";
		if (surgeries.length === 1)
			surgeriesDisplay = surgeries[0];
		else {
			surgeriesDisplay = surgeries.slice(0, surgeries.length - 1).join(", ");
			surgeriesDisplay += ", and" + surgeries[surgeries.length - 1];
		}
		r += `${V.assistantName === "your personal assistant" ? "Your personal assistant" : V.assistantName}, ordered to apply surgery, gives ${slave.slaveName} <span class="lime">${surgeriesDisplay}.</span>`;
	}

	function bellyIn(slave) {
		// less hacky version of calling surgery degradation silently
		if (slave.devotion > 50)
			slave.devotion += 4;
		else if (slave.devotion >= -20)
			slave.trust -= 5;
		else {
			slave.trust -= 5;
			slave.devotion -= 5;
		}
	}
})();


code:
:: sexActJS [script]

/*
 times is how many times to increment the anal counts.
 if left undefined it will assume it to be 1.
*/
window.AnalVCheck = function AnalVCheck(times) {
	const V = State.variables;
	const slave = V.activeSlave;
	let r = ``;
	if (canDoAnal(slave) && slave.anus === 0) {
		r += `@@.lime;This breaks in ${slave.slaveName}'s virgin ass.@@ `;
		if (slave.devotion > 50 || slave.career == "a slave since birth") {
			r += `Since it's her first time, you gently ease yourself into her butthole and gradually increase the intensity of your thrusts. Before long she's moaning loudly as you continue working away at her butthole. `;
			if (slave.tankBaby == 2) {
				r += `She thinks of losing her anal virginity to her ${WrittenMaster(slave)} a @@.hotpink;necessity.@@ She expects her asshole to be seeing a lot more attention now.`;
			}
			else {
				r += `She thinks of losing her anal virginity to you as a @@.hotpink;connection@@ with her beloved ${WrittenMaster(slave)}. `;
				if ((slave.fetishKnown && slave.fetish == "buttslut") || (slave.energy > 95) || (slave.attrXX >= 85 && V.PC.dick === 0)) {
					r += `She can't wait to be fucked in the ass by you again.`;
				}
				else {
					r += `She looks forward to having her asshole fucked by you again.`;
				}
			}
			slave.devotion += 4;
		}
		else if (slave.devotion > 20) {
			r += `Since it's her first time, you gently ease yourself into her butthole and gradually increase the intensity of your thrusts. Her moans become louder and louder as you continue working away at her butthole. She accepts the pain and humiliation of anal sex as part of her sexual servitude, though she hopes that her next time will be less painful.`;
		}
		else if (slave.devotion >= -20) {
			r += `You force yourself into her butthole. She sobs and cries with disgust while you continue thrusting into her ass. She @@.gold;fears@@ her next anal sex, remembering the pain of losing her anal virginity. She dreads having her ass violated by you again.`;
			slave.trust -= 5;
		}
		else {
			r += `You force yourself into her butthole. She sobs and cries with disgust while you continue thrusting into her ass. She @@.mediumorchid;hates@@ and @@.gold;fears@@ you for violating her virgin butt. She dreads having her ass fucked by you again.`;
			slave.trust -= 5;
			slave.devotion -= 5;
		}
		slave.anus = 1;
	}
	if (canDoAnal(slave)) {
		if (canImpreg(slave, V.PC)) {
			r += knockMeUp(slave, 10, 1, -1, 1);
		}
		if (!times) {
			V.analTotal += 1;
			slave.analCount += 1;
		}
		else {
			V.analTotal += times;
			slave.analCount += times;
		}
	}
	return r;
}

/*
 times is how many times to increment the vaginal counts.
 if left undefined it will assume it to be 1.
*/
window.VaginalVCheck = function VaginalVCheck(times) {
	const V = State.variables;
	const slave = V.activeSlave;
	let r = ``;
	if (canDoVaginal(slave) && slave.vagina === 0) {
		r += `@@.lime;This breaks in ${slave.slaveName}'s virgin pussy.@@ `;
		if (slave.devotion > 50 || slave.career == "a slave since birth") {
			r += `You ease yourself into her pussy, since it's her first time, then gradually speed up your thrusts while she slowly learns to move her hips along with you. She moans loudly. `;
			if (slave.tankBaby == 2) {
				r += `She thinks of losing her virginity to her ${WrittenMaster(slave)} a @@.hotpink;necessity to be happy.@@ She expects her pussy to be seeing a lot more attention in the future.`;
			}
			else {
				r += `@@.hotpink;She enjoys losing her cherry to you.@@ `;
				if ((slave.fetishKnown && slave.fetish == "pregnancy") || (slave.energy > 95) || (slave.attrXY >= 85 && V.PC.dick === 1)) {
					r += `She can't wait to have her pussy fucked by you again.`;
				}
				else {
					r += `She looks forward to having her pussy fucked by you again.`;
				}
			}
			slave.devotion += 4;
		}
		else if (slave.devotion > 20) {
			r += `You ease yourself into her pussy, since it's her first time, then gradually speed up your thrusts while she slowly learns to move her hips along with you. She accepts losing her virginity to her owner and she looks forward to having her pussy fucked by you again.`;
		}
		else if (slave.devotion >= -20) {
			r += `You force yourself into her pussy. She sobs and cries with disgust while you continue thrusting into her fuck hole. She @@.mediumorchid;hates@@ losing her virginity this way and @@.gold;fears@@ the next time you'll conquer her. She dreads getting violated by you again.`;
			slave.trust -= 5;
			slave.devotion -= 5;
		}
		else {
			r += `You force yourself into her pussy. She sobs and cries with disgust while you continue working her fuck hole. She tries to struggle, but you only pound harder. She @@.mediumorchid;hates@@ and @@.gold;fears@@ you for robbing her of her virginity. She dreads getting fucked by you again.`;
			slave.trust -= 10;
			slave.devotion -= 15;
		}
		slave.vagina = 1;
	}
	if (canDoVaginal(slave)) {
		if (canImpreg(slave, V.PC)) {
			r += knockMeUp(slave, 10, 0, -1, 1);
		}
		if (!times) {
			V.vaginalTotal += 1;
			slave.vaginalCount += 1;
		}
		else {
			V.vaginalTotal += times;
			slave.vaginalCount += times;
		}
	}

	return r;
}

/*
 analTimes is how many times to increment the anal counts, if there is no vagina available.
 bothTimes is how many times to increment both holes counts (usually it is half of analTimes).
 In both cases if left undefined it will assume it to be 1.
*/
window.BothVCheck = function BothVCheck(analTimes, bothTimes) {
	const V = State.variables;
	const slave = V.activeSlave;
	let r = ``;
	if (canDoVaginal(slave)) {
		if (slave.vagina === 0) {
			if (canDoAnal(slave) && slave.anus == 0) {
				r += `@@.lime;This breaks in ${slave.slaveName}'s virgin holes.@@ `;
				if (slave.devotion > 50 || slave.career == "a slave since birth") {
					r += `As it's her first time, you ease yourself into her pussy before gradually working your way into her ass and alternate between the two holes while she moans. `;
					if (slave.tankBaby == 2) {
						r += `She believes you taking her virgin holes @@.hotpink;will keep her from suffering.@@ She expects you to require her holes as tribute again soon.`;
					}
					else {
						r += `@@.hotpink;She's so devoted she enjoys being fucked in both holes for the first time.@@ She looks forward to having her holes fucked by you again.`;
					}
					slave.devotion += 4;
				}
				else if (slave.devotion <= 20) {
					r += `You force yourself into her pussy before working your way into her ass. She sobs and cries with disgust while you alternate between the two holes. She @@.mediumorchid;hates@@ losing her virginity and anal virginity in one @@.gold;brutal@@ incident. She dreads having her holes violated by you again.`;
					slave.trust -= 5;
					slave.devotion -= 5;
				}
				else {
					r += `As it's her first time, you ease yourself into her pussy before gradually working your way into her ass and alternate between the two holes while she moans. She accepts being fucked in both holes for the first time. She looks forward to having her holes fucked by you again.`;
				}
				slave.anus = 1;
			}
			else {
				r += `@@.lime;This breaks in ${slave.slaveName}'s virgin pussy.@@ `;
				if (slave.devotion > 50 || slave.career == "a slave since birth") {
					r += `As it's her first time, you ease yourself into her pussy and gradually speed up your thrusts while she slowly learns to move her hips along with you. She moans loudly. `;
					if (slave.tankBaby == 2) {
						r += `She thinks of losing her virginity to her ${WrittenMaster(slave)} a @@.hotpink;necessity to be happy.@@ She expects her pussy to be seeing a lot more attention in the future.`;
					}
					else {
						r += `@@.hotpink;She enjoys losing her cherry to you.@@ She looks forward to having her pussy fucked by you again.`;
					}
					slave.devotion += 4;
				}
				else if (slave.devotion <= 20) {
					r += `You force yourself into her pussy. She sobs and cries with disgust while you continue working her fuck hole. She @@.mediumorchid;hates@@ and @@.gold;fears@@ you for taking her virginity. She dreads having her pussy violated by you again.`;
					slave.trust -= 5;
					slave.devotion -= 5;
				}
				else {
					r += `As it's her first time, you ease yourself into her pussy before gradually increasing the intensity of your thrusts while she softly moans. She accepts losing her virginity to her owner and she looks forward to having her pussy fucked by you again.`;
				}
			}
			slave.vagina = 1;
		}
		else if (canDoAnal(slave) && slave.anus == 0) {
			r += `@@.lime;This breaks in ${slave.slaveName}'s virgin ass.@@ `;
			if (slave.devotion > 50 || slave.career == "a slave since birth") {
				r += `As it's her first time, you ease yourself into her butthole and gradually speed up your thrusts while she slowly learns to move her hips along with you. She moans loudly. `;
				if (slave.tankBaby == 2) {
					r += `She thinks of losing her anal virginity to her ${WrittenMaster(slave)} a @@.hotpink;necessity.@@ She expects her asshole to be seeing a lot more attention now.`;
				}
				else {
					r += `She thinks of losing her anal virginity to you as a @@.hotpink;connection@@ with her beloved ${WrittenMaster(slave)}. She looks forward to having her asshole fucked by you again.`
				}
				slave.devotion += 4;
			}
			else if (slave.devotion > 20){
				r += `As it's her first time, you ease yourself into her butthole and gradually increase the intensity of your thrusts. She accepts the pain and humiliation of anal sex as part of her sexual servitude, though she hopes that her next time will be less painful.`;
			}
			else if (slave.devotion >= -20) {
				r += `You force yourself into her butthole. She sobs and cries with disgust while you continue thrusting into her ass. She @@.gold;fears@@ her next anal sex, remembering the pain of losing her anal virginity. She dreads having her ass violated by you again.`;
				slave.trust -= 5;
			}
			else {
				r += `You force yourself into her butthole. She sobs and cries with disgust while you continue thrusting into her ass. She @@.mediumorchid;hates@@ and @@.gold;fears@@ you for violating her virgin butt. She dreads having her ass fucked by you again.`;
				slave.trust -= 5;
				slave.devotion -= 5;
			}
			slave.anus = 1;
		}
		if (canDoAnal(slave)) {
			if (!bothTimes) {
				V.vaginalTotal += 1;
				V.analTotal += 1;
				slave.vaginalCount += 1;
				slave.analCount += 1;
			}
			else {
				V.vaginalTotal += bothTimes;
				V.analTotal += bothTimes;
				slave.vaginalCount += bothTimes;
				slave.analCount += bothTimes;
			}
			if (canImpreg(slave, V.PC)) {
				r += knockMeUp(slave, 10, 2, -1, 1);
			}
		}
		else {
			if (!bothTimes) {
				V.vaginalTotal += 1;
				slave.vaginalCount += 1;
			}
			else {
				V.vaginalTotal += bothTimes;
				slave.vaginalCount += bothTimes;
			}
			if (canImpreg(slave, V.PC)) {
				r += knockMeUp(slave, 10, 0, -1, 1);
			}
		}
	}
	else if (canDoAnal(slave)) {
		if (slave.anus == 0) {
			r += `@@.lime;This breaks in ${slave.slaveName}'s virgin ass.@@ `;
			if (slave.devotion > 50 || slave.career == "a slave since birth") {
				r += `As it's her first time, you ease yourself into her butthole and gradually speed up your thrusts while she slowly learns to move her hips along with you. She moans loudly. `;
				if (slave.tankBaby == 2) {
					r += `She thinks of losing her anal virginity to her ${WrittenMaster(slave)} a @@.hotpink;necessity.@@ She expects her asshole to be seeing a lot more attention now.`;
				}
				else {
					r += `She thinks of losing her anal virginity to you as a @@.hotpink;connection@@ with her beloved ${WrittenMaster(slave)}. She looks forward to having her asshole fucked by you again.`;
				}
				slave.devotion += 4;
			}
			else if (slave.devotion > 20) {
				r += `As it's her first time, you ease yourself into her butthole and gradually increase the intensity of your thrusts. She accepts the pain and humiliation of anal sex as part of her sexual servitude, though she hopes that her next time will be less painful.`;
			}
			else if (slave.devotion >= -20) {
				r += `You force yourself into her butthole. She sobs and cries with disgust while you continue thrusting into her ass. She @@.gold;fears@@ her next anal sex, remembering the pain of losing her anal virginity. She dreads having her ass violated by you again.`;
				slave.trust -= 5;
			}
			else {
				r += `You force yourself into her butthole. She sobs and cries with disgust while you continue thrusting into her ass. She @@.mediumorchid;hates@@ and @@.gold;fears@@ you for violating her virgin butt. She dreads having her ass fucked by you again.`
				slave.trust -= 5;
				slave.devotion -= 5;
			}
			slave.anus = 1;
		}
		if (!analTimes) {
			V.analTotal += 1;
			slave.analCount += 1;
		}
		else {
			V.analTotal += analTimes;
			slave.analCount += analTimes;
		}
		if (canImpreg(slave, V.PC)) {
			r += knockMeUp(slave, 10, 1, -1, 1);
		}
	}
	return r;
}

/*
 times is how many times to increment either the Vaginal or the Anal counts, if there is no Vagina available.
 If left undefined it will assume it to be 1.
*/
window.SimpleVCheck = function SimpleVCheck(times) {
	let r = ``;
	if (canDoVaginal(State.variables.activeSlave)) {
		r += VaginalVCheck(times);
	}
	else if (canDoAnal(State.variables.activeSlave)) {
		r += AnalVCheck(times);
	}
	return r;
}

/*
 Before using this function, set $partner to the index of the partner in the $slaves array
 analTimes is how many times to increment the Anal counts, if there is no Vagina available.
 bothTimes is how many times to increment both holes counts (usually it is half of Anal).
 In both cases if left undefined it will assume it to be 1.
 This also checks for a valid Vagina/Accessory, though most code I've seen does this already, you
 never know when someone might use the routine and forget to do such.
*/
window.PartnerVCheck = function PartnerVCheck(analTimes, bothTimes) {
	const V = State.variables;
	const partner = V.slaves[V.partner];
	let r = ``;

	if (V.partner < 0 || V.partner >= V.slaves.length) {
		r += `@@.red;PartnerVCheck called with invalid partner '$partner' from passage ${passage()}.@@`;
	}
	else if (canDoVaginal(partner)) {
		if (partner.vagina === 0) {
			if (canDoAnal(partner) && partner.anus === 0) {
				r += `Since it's ${partner.slaveName}'s first time, you take your time and gently ease yourself into her pussy before gradually working your way into her butthole, alternating between her holes. @@.lime;This breaks in ${partner.slaveName}'s virgin holes.@@ `;
				partner.vagina = 1;
				partner.anus = 1;
			}
			else {
				r += `Since it's ${partner.slaveName}'s first time, you take your time and gently ease yourself into her pussy before gradually increasing the intensity of your thrusts. @@.lime;This breaks in ${partner.slaveName}'s virgin pussy.@@ `;
				partner.vagina = 1;
			}
		}
		else if (canDoAnal(partner) && partner.anus == 0) {
			r += `Since it's ${partner.slaveName}'s first time, you take your time and gently ease yourself into her butthole before gradually increasing the intensity of your thrusts into her ass. @@.lime;This breaks in ${partner.slaveName}'s virgin ass.@@ `;
			partner.anus = 1;
		}

		if (canDoAnal(partner)) {
			if (!bothTimes) {
				V.vaginalTotal += 1;
				V.analTotal += 1;
				partner.vaginalCount += 1;
				partner.analCount += 1;
			}
			else {
				V.vaginalTotal += bothTimes;
				V.analTotal += bothTimes;
				partner.vaginalCount += bothTimes;
				partner.analCount += bothTimes;
			}
			if (canImpreg(partner, V.PC)) {
				r += knockMeUp(partner, 10, 2, -1);
			}
		}
		else {
			if (!bothTimes) {
				V.vaginalTotal += 1;
				partner.vaginalCount += 1;
			}
			else {
				V.vaginalTotal += bothTimes;
				partner.vaginalCount += bothTimes;
			}
			if (canImpreg(partner, V.PC)) {
				r += knockMeUp(partner, 10, 0, -1);
			}
		}
	}
	else if (canDoAnal(partner)) {
		if (partner.anus === 0) {
			r += `Since it's ${partner.slaveName}'s first time, you take your time and gently ease yourself into her butthole before gradually increasing the intensity of your thrusts into her ass. @@.lime;This breaks in ${partner.slaveName}'s virgin ass.@@ `;
			partner.anus = 1;
		}
		if (!analTimes) {
			V.analTotal += 1;
			partner.analCount += 1;
		}
		else {
			V.analTotal += analTimes;
			partner.analCount += analTimes;
		}
		if (canImpreg(partner, V.PC)) {
			r += knockMeUp(partner, 10, 1, -1);
		}
	}
	return r;
}

/*
 count is how many times to increment either the Vaginal, Anal, or Oral counts, depending on availability of slave.
 If count is left undefined it will assume it to be 1.
 Intended to be a simple "I want to fuck x and not have to code a bunch of logic for it".
*/
window.SimpleSexAct = function SimpleSexAct(slave, count) {
	const V = State.variables;
	let fuckTarget = 0;
	let fuckCount = 1;
	let r = ``;
	if (count) {
		fuckCount = count;
	}
	for (var i = 0; i < fuckCount; i++) {
		fuckTarget = jsRandom(1,100);
		if (slave.nipples == "fuckable" && V.PC.dick === 1 && fuckTarget > 80) {
			V.mammaryTotal += 1;
			slave.mammaryCount += 1;
		}
		else if (canDoVaginal(slave) && slave.vagina > 0 && fuckTarget > 33) {
			V.vaginalTotal += 1;
			slave.vaginalCount += 1;
			if (canImpreg(slave, V.PC)) {
				r += knockMeUp(slave, 10, 0, -1, 1);
			}
		}
		else if (canDoAnal(slave) && slave.anus > 0 && fuckTarget > 10) {
			V.analTotal += 1;
			slave.analCount += 1;
			if (canImpreg(slave, V.PC)) {
				r += knockMeUp(slave, 10, 1, -1, 1);
			}
		}
		else {
			V.oralTotal += 1;
			slave.oralCount += 1;
		}
	}
	return r;
}

/*
 count is how many times to increment either the Vaginal, Anal, or Oral counts, depending on availability of slave.
 If count is left undefined it will assume it to be 1.
 Intended to be a simple "x got fucked y times and I don't want to keep coding it".
 Pregnancy chance is handled in saLongTermEffects.tw.
*/
window.SimpleSlaveFucking = function SimpleSlaveFucking(slave, count) {
	const V = State.variables;
	let fuckTarget = 0;
	let fuckCount = 1;
	if (count) {
		fuckCount = count;
	}
	for (var i = 0; i < fuckCount; i++) {
		fuckTarget = jsRandom(1,100);
		if (slave.nipples == "fuckable" && fuckTarget > 80) {
			V.mammaryTotal += 1;
			slave.mammaryCount += 1;
		}
		else if (canDoVaginal(slave) && slave.vagina > 0 && fuckTarget > 33) {
			V.vaginalTotal += 1;
			slave.vaginalCount += 1;
		}
		else if (canDoAnal(slave) && slave.anus > 0 && fuckTarget > 10) {
			V.analTotal += 1;
			slave.analCount += 1;
		}
		else {
			V.oralTotal += 1;
			slave.oralCount += 1;
		}
	}
	return;
}

/*
 count is how many times to increment either the Vaginal, Anal, or Oral counts, depending on availability of slave.
 If count is left undefined it will assume it to be 1.
 Intended to be a simple "x got fucked y times by z and I don't want to keep coding it".
*/
window.SimpleSlaveSlaveFucking = function SimpleSlaveSlaveFucking(subslave, domslave, count) {
	const V = State.variables;
	let fuckTarget = 0;
	let fuckCount = 1;
	let r = ``;
	if (count) {
		fuckCount = count;
	}
	for (var j = 0; j < fuckCount; j++) {
		//there is a reason randomization happens inside cycle - to spread fuck around, otherwise cycle isn't even needed
		fuckTarget = jsRandom(1,100);
		if (subslave.nipples === "fuckable" && canPenetrate(domslave) && fuckTarget > 80) {
			if (passage() === "SA serve your other slaves") {
				if (subslave.ID == V.slaves[V.i].ID) {
					V.slaves[V.i].mammaryCount++;
					V.mammaryTotal++;
					domslave.penetrativeCount++;
					V.penetrativeTotal++;
				}
				else {
					subslave.mammaryCount++;
					V.mammaryTotal++;
					V.slaves[V.i].penetrativeCount++;
					V.penetrativeTotal++;
				}
			}
			else {
				V.mammaryTotal++;
				V.penetrativeTotal++;
				subslave.mammaryCount++;
				domslave.penetrativeCount++;
			}
		}
		else if (canDoVaginal(subslave) && subslave.vagina > 0 && canPenetrate(domslave) && fuckTarget > 33) {
			if (passage() === "SA serve your other slaves") {
				if (subslave.ID == V.slaves[V.i].ID) {
					V.slaves[V.i].vaginalCount++;
					V.vaginalTotal++;
					V.penetrativeTotal++;
					domslave.penetrativeCount++;
				}
				else {
					V.slaves[V.i].penetrativeCount++;
					V.penetrativeTotal++;
					subslave.vaginalCount++;
					V.vaginalTotal++;
				}
			}
			else {
				V.vaginalTotal++;
				subslave.vaginalCount++;
				V.penetrativeTotal++;
				domslave.penetrativeCount++;
			}
			if (canImpreg(subslave, domslave)) {
				r += knockMeUp(subslave, 3, 0, domslave.ID, 1);
			}
		}
		else if (canDoAnal(subslave) && subslave.anus > 0 && canPenetrate(domslave) && fuckTarget > 10) {
			//i think would impregnate from anal here even without .mpreg? same in original widget too
			if (canImpreg(subslave, domslave) && subslave.mpreg == 1) {
				r += knockMeUp(subslave, 3, 1, domslave.ID, 1);
			}
			if (passage() === "SA serve your other slaves") {
				if (subslave.ID == V.slaves[V.i].ID) {
					V.slaves[V.i].analCount++;
					V.analTotal++;
					V.penetrativeTotal++;
					domslave.penetrativeCount++;
				}
				else {
					V.slaves[V.i].penetrativeCount++;
					V.penetrativeTotal++;
					V.analTotal++;
					subslave.analCount++;
				}
			}
			else {
				V.analTotal++;
				subslave.analCount++;
				V.penetrativeTotal++;
				domslave.penetrativeCount++;
			}
		}
		else {
			V.oralTotal++;
			subslave.oralCount++;
		}
	}
	return r;
}

window.SimpleVaginaFuck = function SimpleVaginaFuck(slave, count) {
	if (count) {
		State.variables.vaginalTotal += count;
		slave.vaginalCount += count;
	}
	else {
		State.variables.vaginalTotal++;
		slave.vaginalCount++;
	}
}

window.SimpleAssFuck = function SimpleAssFuck(slave, count) {
	if (count) {
		State.variables.analTotal += count;
		slave.analCount += count;
	}
	else {
		State.variables.analTotal++;
		slave.analCount++;
	}
}


code:
:: Slave Generation JS [script]

window.nationalityToRace = function nationalityToRace(slave) {
	slave.race = hashChoice(setup.raceSelector[slave.nationality] || setup.raceSelector[""]);
};

window.generateName = function generateName(nationality, race, male, filter) {
	filter = filter || _.stubTrue; /* default: allow all */
	const lookup = (male ? setup.malenamePoolSelector : setup.namePoolSelector);
	const result = jsEither(
		(lookup[nationality + "." + race] || lookup[nationality] ||
		(male ? setup.whiteAmericanMaleNames : setup.whiteAmericanSlaveNames)).filter(filter));
	/* fallback for males without specific male name sets: return female name */
	if(male && !result) {
		return generateName(nationality, race, false);
	}
	return result;
};

window.generateSurname = function generateSurname(nationality, race, male, filter) {
	filter = filter || _.stubTrue; /* default: allow all */
	const result = jsEither(
		(setup.surnamePoolSelector[nationality + "." + race] ||
		setup.surnamePoolSelector[nationality] ||
		setup.whiteAmericanSlaveSurnames).filter(filter));
	if(male) {
		/* see if we have male equivalent of that surname, and return that if so */
		const maleLookup = setup.maleSurnamePoolSelector[nationality + "." + race] || setup.maleSurnamePoolSelector[nationality];
		if(maleLookup && maleLookup[result]) {
			return maleLookup[result];
		}
	}
	return result || 0;
};

window.isMaleName = function isMaleName(name, nationality, race) {
	const names = setup.malenamePoolSelector[nationality + "." + race] ||
		setup.malenamePoolSelector[nationality] ||
		setup.whiteAmericanMaleNames;
	return names && names.includes(name);
};

window.nationalityToName = function nationalityToName(slave) {
	const V = State.variables;
	const male = (slave.genes === "XY");

	slave.birthName = generateName(slave.nationality, slave.race, male);
	slave.birthSurname = generateSurname(slave.nationality, slave.race, male);
	if(male && isMaleName(slave.birthName, slave.nationality, slave.race) && !V.allowMaleSlaveNames) {
		slave.slaveName = generateName(slave.nationality, slave.race, false);
	} else {
		slave.slaveName = slave.birthName;
	}
	slave.slaveSurname = slave.birthSurname;
	if (V.useFSNames === 1) {
		if (V.arcologies[0].FSChattelReligionist > 20) {
			slave.slaveName = jsEither(setup.chattelReligionistSlaveNames), slave.slaveSurname = 0;
		} else if (V.arcologies[0].FSRomanRevivalist > 20) {
			slave.slaveName = jsEither(setup.romanSlaveNames), slave.slaveSurname = jsEither(setup.romanSlaveSurnames);
		} else if (V.arcologies[0].FSAztecRevivalist > 20) {
			slave.slaveName = jsEither(setup.aztecSlaveNames), slave.slaveSurname = 0;
		} else if (V.arcologies[0].FSEgyptianRevivalist > 20) {
			slave.slaveName = jsEither(setup.ancientEgyptianSlaveNames), slave.slaveSurname = 0;
		} else if (V.arcologies[0].FSEdoRevivalist > 20) {
			slave.slaveName = jsEither(setup.edoSlaveNames), slave.slaveSurname = jsEither(setup.edoSlaveSurnames);
		} else if (V.arcologies[0].FSDegradationist !== "unset") {
			DegradingName(slave);
		}
	}
};

window.nationalityToAccent = function nationalityToAccent(slave) {
	const V = State.variables;
	const naturalAccent = jsEither([0, 1, 1, 2, 2, 2, 3, 3, 3, 3]);

	switch (slave.nationality) {
		case "Afghan":
			slave.accent = (V.language === "Pashto") ? jsEither([0, 0, 0, 1]) : naturalAccent;
			break;
		case "Albanian":
			slave.accent = naturalAccent;
			break;
		case "Algerian":
			slave.accent = (V.language === "Arabic") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "American":
			if (V.language === "English") {
				slave.accent = jsEither([0, 0, 0, 1]);
			} else if (V.language === "Spanish" && slave.race === "latina") {
				slave.accent = jsEither([0, 1, 2, 2, 2, 3, 3]);
			} else if (V.language === "Chinese" && slave.race === "asian") {
				slave.accent = jsEither([0, 1, 2, 2, 2, 3, 3]);
			} else if (V.language === "Arabic" && slave.race === "middle eastern") {
				slave.accent = jsEither([0, 1, 2, 2, 2, 3, 3]);
			} else {
				slave.accent = naturalAccent;
			}
			break;
		case "Andorran":
			slave.accent = (V.language === "Catalan") ? jsEither([0, 0, 0, 1]) : naturalAccent;
			break;
		case "Angolan":
			slave.accent = (V.language === "Portuguese") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "Antiguan":
			slave.accent = (V.language === "English") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "Argentinian":
			slave.accent = (V.language === "Spanish") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "Armenian":
			if (V.language === "Russian") {
				slave.accent = jsEither([0, 1, 2, 2, 2, 3, 3]);
			} else if (V.language === "English") {
				slave.accent = jsEither([0, 1, 2, 2, 2, 3, 3]);
			} else {
				slave.accent = naturalAccent;
			}
			break;
		case "Aruban":
			if (V.language === "Dutch") {
				slave.accent = jsEither([0, 1, 1, 1, 2]);
			} else if (V.language === "English") {
				slave.accent = jsEither([0, 1, 2, 2, 2, 3, 3]);
			} else if (V.language === "Portuguese") {
				slave.accent = jsEither([0, 1, 2, 2, 2, 3, 3]);
			} else {
				slave.accent = naturalAccent;
			}
			break;
		case "Australian":
			slave.accent = (V.language === "English") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "Austrian":
			if (V.language === "German") {
				slave.accent = jsEither([0, 1, 1, 1, 2]);
			} else if (V.language === "Serbian") {
				slave.accent = jsEither([0, 1, 2, 2, 2, 3, 3]);
			} else if (V.language === "Slovene") {
				slave.accent = jsEither([0, 1, 2, 2, 2, 3, 3]);
			} else if (V.language === "Turkish" && slave.race === "middle eastern") {
				slave.accent = jsEither([0, 1, 2, 2, 2, 3, 3]);
			} else {
				slave.accent = naturalAccent;
			}
			break;
		case "Azerbaijani":
			slave.accent = naturalAccent;
			break;
		case "Bahamian":
			slave.accent = (V.language === "English") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "Bahraini":
			slave.accent = (V.language === "Arabic") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "Bangladeshi":
			if (V.language === "Bengali") {
				slave.accent = jsEither([0, 0, 0, 1]);
			} else if (V.language === "Hindi") {
				slave.accent = jsEither([0, 1, 2, 2, 2, 3, 3]);
			} else {
				slave.accent = naturalAccent;
			}
			break;
		case "Barbadian":
			slave.accent = naturalAccent;
			break;
		case "Belarusian":
			slave.accent = naturalAccent;
			break;
		case "Belgian":
			if (V.language === "Dutch") {
				slave.accent = jsEither([0, 1, 1, 1, 2]);
			} else if (V.language === "French") {
				slave.accent = jsEither([0, 1, 1, 1, 2]);
			} else if (V.language === "German") {
				slave.accent = jsEither([0, 1, 2, 2, 2, 3, 3]);
			} else {
				slave.accent = naturalAccent;
			}
			break;
		case "Belizean":
			slave.accent = (V.language === "English") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "Beninese":
			slave.accent = (V.language === "French") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "Bermudian":
			slave.accent = (V.language === "English") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "Bhutanese":
			slave.accent = (V.language === "Dzongkha") ? jsEither([0, 0, 0, 1]) : naturalAccent;
			break;
		case "Bissau-Guinean":
			slave.accent = (V.language === "Portuguese") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "Bolivian":
			slave.accent = (V.language === "Spanish") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "Bosnian":
			slave.accent = naturalAccent;
			break;
		case "Brazilian":
			slave.accent = (V.language === "Portuguese") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "British":
			slave.accent = (V.language === "English") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "Bruneian":
			if (V.language === "Malay") {
				slave.accent = jsEither([0, 1, 1, 1, 2]);
			} else if (V.language === "English") {
				slave.accent = jsEither([0, 1, 2, 2, 2, 3, 3]);
			} else {
				slave.accent = naturalAccent;
			}
			break;
		case "Bulgarian":
			slave.accent = naturalAccent;
			break;
		case "Burkinabé":
			slave.accent = (V.language === "French") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "Burmese":
			slave.accent = naturalAccent;
			break;
		case "Burundian":
			slave.accent = (V.language === "Kirundi") ? jsEither([0, 0, 0, 1]) : naturalAccent;
			break;
		case "Cambodian":
			if (V.language === "Khmer") {
				slave.accent = jsEither([0, 0, 0, 1]);
			} else if (V.language === "Cham") {
				slave.accent = jsEither([0, 1, 1, 1, 2]);
			} else if (V.language === "French") {
				slave.accent = jsEither([0, 1, 2, 2, 2, 3, 3]);
			} else {
				slave.accent = naturalAccent;
			}
			break;
		case "Cameroonian":
			slave.accent = (V.language === "French") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "Canadian":
			if (V.language === "English") {
				slave.accent = jsEither([0, 0, 0, 1]);
			} else if (V.language === "French") {
				slave.accent = jsEither([0, 1, 1, 1, 2]);
			} else {
				slave.accent = naturalAccent;
			}
			break;
		case "Cape Verdean":
			slave.accent = (V.language === "Portuguese") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "Catalan":
			slave.accent = (V.language === "Spanish") ? jsEither([0, 0, 0, 1]) : naturalAccent;
			break;
		case "Central African":
			slave.accent = (V.language === "French") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "Chadian":
			slave.accent = (V.language === "Arabic") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "Chilean":
			slave.accent = (V.language === "Spanish") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "Chinese":
			if (V.language === "Tibetan") {
				slave.accent = jsEither([0, 1, 2, 2, 2, 3, 3]);
			} else if (V.language === "Korean") {
				slave.accent = jsEither([0, 1, 2, 2, 2, 3, 3]);
			} else if (V.language === "Kazakh") {
				slave.accent = jsEither([0, 1, 2, 2, 2, 3, 3]);
			} else {
				slave.accent = naturalAccent;
			}
			break;
		case "Colombian":
			slave.accent = (V.language === "Spanish") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "Comorian":
			if (V.language === "Arabic") {
				slave.accent = jsEither([0, 1, 2, 2, 2, 3, 3]);
			} else if (V.language === "French") {
				slave.accent = jsEither([0, 1, 2, 2, 2, 3, 3]);
			} else {
				slave.accent = naturalAccent;
			}
			break;
		case "Congolese":
			if (V.language === "Lingala") {
				slave.accent = jsEither([0, 0, 0, 1]);
			} else if (V.language === "Kikongo") {
				slave.accent = jsEither([0, 0, 0, 1]);
			} else if (V.language === "French") {
				slave.accent = jsEither([0, 1, 1, 1, 2]);
			} else {
				slave.accent = naturalAccent;
			}
			break;
		case "a Cook Islander":
			if (V.language === "Cook Islands Māori") {
				slave.accent = jsEither([0, 0, 0, 1]);
			} else if (V.language === "English") {
				slave.accent = jsEither([0, 1, 1, 1, 2]);
			} else {
				slave.accent = naturalAccent;
			}
			break;
		case "Costa Rican":
			slave.accent = (V.language === "Spanish") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "Croatian":
			slave.accent = naturalAccent;
			break;
		case "Cuban":
			slave.accent = (V.language === "Spanish") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "Cypriot":
			if (V.language === "Greek") {
				slave.accent = jsEither([0, 1, 1, 1, 2]);
			} else if (V.language === "Turkish") {
				slave.accent = jsEither([0, 1, 1, 1, 2]);
			} else if (V.language === "English") {
				slave.accent = jsEither([0, 1, 2, 2, 2, 3, 3]);
			} else {
				slave.accent = naturalAccent;
			}
			break;
		case "Czech":
			slave.accent = naturalAccent;
			break;
		case "Danish":
			slave.accent = naturalAccent;
			break;
		case "Djiboutian":
			slave.accent = (V.language === "French") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "Dominican":
			slave.accent = (V.language === "Spanish") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "Dominiquais":
			slave.accent = (V.language === "English") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "Dutch":
			slave.accent = naturalAccent;
			break;
		case "East Timorese":
			if (V.language === "Tetum") {
				slave.accent = jsEither([0, 0, 0, 1]);
			} else if (V.language === "Portuguese") {
				slave.accent = jsEither([0, 1, 1, 1, 2]);
			} else if (V.language === "Malay") {
				slave.accent = jsEither([0, 1, 2, 2, 2, 3, 3]);
			} else {
				slave.accent = naturalAccent;
			}
			break;
		case "Ecuadorian":
			slave.accent = (V.language === "Spanish") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "Egyptian":
			slave.accent = (V.language === "Arabic") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "Emirati":
			slave.accent = (V.language === "Arabic") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "Equatoguinean":
			slave.accent = (V.language === "Spanish") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "Eritrean":
			if (V.language === "Tigrinya") {
				slave.accent = jsEither([0, 0, 0, 1]);
			} else if (V.language === "Arabic") {
				slave.accent = jsEither([0, 1, 1, 1, 2]);
			} else if (V.language === "English") {
				slave.accent = jsEither([0, 1, 2, 2, 2, 3, 3]);
			} else {
				slave.accent = naturalAccent;
			}
			break;
		case "Estonian":
			slave.accent = (V.language === "Russian") ? jsEither([0, 1, 2, 2, 2, 3, 3]) : naturalAccent;
			break;
		case "Ethiopian":
			if (V.language === "Amharic") {
				slave.accent = jsEither([0, 0, 0, 1]);
			} else if (V.language === "Arabic") {
				slave.accent = jsEither([0, 1, 2, 2, 2, 3, 3]);
			} else if (V.language === "Tigrinya") {
				slave.accent = jsEither([0, 1, 2, 2, 2, 3, 3]);
			} else {
				slave.accent = naturalAccent;
			}
			break;
		case "Fijian":
			slave.accent = (V.language === "English") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "Filipina":
			if (V.language === "Filipino") {
				slave.accent = jsEither([0, 0, 0, 1]);
			} else if (V.language === "English") {
				slave.accent = jsEither([0, 1, 1, 1, 2]);
			} else if (V.language === "Tagalog") {
				slave.accent = jsEither([0, 1, 1, 1, 2]);
			} else if (V.language === "Arabic") {
				slave.accent = jsEither([0, 1, 2, 2, 2, 3, 3]);
			} else if (V.language === "Spanish") {
				slave.accent = jsEither([0, 1, 2, 2, 2, 3, 3]);
			} else {
				slave.accent = naturalAccent;
			}
			break;
		case "Finnish":
			slave.accent = (V.language === "Swedish") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "French":
			if (V.language === "English") {
				slave.accent = jsEither([0, 1, 2, 2, 2, 3, 3]);
			} else if (V.language === "Spanish") {
				slave.accent = jsEither([0, 1, 2, 2, 2, 3, 3]);
			} else if (V.language === "German") {
				slave.accent = jsEither([0, 1, 2, 2, 2, 3, 3]);
			} else if (V.language === "Arabic" && slave.race === "middle eastern") {
				slave.accent = jsEither([0, 1, 2, 2, 2, 3, 3]);
			} else if (V.language === "Catalan") {
				slave.accent = jsEither([0, 1, 2, 2, 2, 3, 3]);
			} else {
				slave.accent = naturalAccent;
			}
			break;
		case "French Guianan":
			slave.accent = (V.language === "French") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "French Polynesian":
			slave.accent = (V.language === "French") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "Gabonese":
			slave.accent = (V.language === "French") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "Gambian":
			slave.accent = (V.language === "English") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "Georgian":
			slave.accent = (V.language === "Abkhaz") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "German":
			if (V.language === "English") {
				slave.accent = jsEither([0, 1, 2, 2, 2, 3, 3]);
			} else if (V.language === "French") {
				slave.accent = jsEither([0, 1, 2, 2, 2, 3, 3]);
			} else if (V.language === "Turkish" && slave.race === "middle eastern") {
				slave.accent = jsEither([0, 1, 2, 2, 2, 3, 3]);
			} else {
				slave.accent = naturalAccent;
			}
			break;
		case "Ghanan":
			if (V.language === "English") {
				slave.accent = jsEither([0, 1, 1, 1, 2]);
			} else if (V.language === "Hausa") {
				slave.accent = jsEither([0, 1, 2, 2, 2, 3, 3]);
			} else if (V.language === "Arabic") {
				slave.accent = jsEither([0, 1, 2, 2, 2, 3, 3]);
			} else {
				slave.accent = naturalAccent;
			}
			break;
		case "Greek":
			slave.accent = naturalAccent;
			break;
		case "Greenlandic":
			slave.accent = (V.language === "Danish") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "Grenadian":
			slave.accent = (V.language === "English") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "Guamanian":
			slave.accent = (V.language === "English") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "Guatemalan":
			slave.accent = (V.language === "Spanish") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "Guinean":
			slave.accent = (V.language === "French") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "Guyanese":
			slave.accent = (V.language === "English") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "Haitian":
			slave.accent = (V.language === "French") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "Honduran":
			slave.accent = (V.language === "Spanish") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "Hungarian":
			slave.accent = naturalAccent;
			break;
		case "I-Kiribati":
			if (V.language === "Gilbertese") {
				slave.accent = jsEither([0, 0, 0, 1]);
			} else if (V.language === "English") {
				slave.accent = jsEither([0, 1, 1, 1, 2]);
			} else {
				slave.accent = naturalAccent;
			}
			break;
		case "Icelandic":
			if (V.language === "Danish") {
				slave.accent = jsEither([0, 1, 2, 2, 2, 3, 3]);
			} else if (V.language === "English") {
				slave.accent = jsEither([0, 1, 2, 2, 2, 3, 3]);
			} else {
				slave.accent = naturalAccent;
			}
			break;
		case "Indian":
			if (V.language === "Hindi") {
				slave.accent = jsEither([0, 0, 0, 1]);
			} else if (V.language === "English") {
				slave.accent = jsEither([0, 1, 1, 1, 2]);
			} else {
				slave.accent = naturalAccent;
			}
			break;
		case "Indonesian":
			slave.accent = (V.language === "Malay") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "Iranian":
			if (V.language === "Persian") {
				slave.accent = jsEither([0, 0, 0, 1]);
			} else if (V.language === "Arabic") {
				slave.accent = jsEither([0, 1, 2, 2, 2, 3, 3]);
			} else {
				slave.accent = naturalAccent;
			}
			break;
		case "Iraqi":
			if (V.language === "Arabic") {
				slave.accent = jsEither([0, 1, 1, 1, 2]);
			} else if (V.language === "Kurdish") {
				slave.accent = jsEither([0, 1, 2, 2, 2, 3, 3]);
			} else {
				slave.accent = naturalAccent;
			}
			break;
		case "Irish":
			slave.accent = (V.language === "English") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "Israeli":
			if (V.language === "Hebrew") {
				slave.accent = jsEither([0, 0, 0, 1]);
			} else if (V.language === "Arabic") {
				slave.accent = jsEither([0, 1, 1, 1, 2]);
			} else {
				slave.accent = naturalAccent;
			}
			break;
		case "Italian":
			slave.accent = naturalAccent;
			break;
		case "Ivorian":
			slave.accent = (V.language === "French") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "Jamaican":
			slave.accent = (V.language === "English") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "Japanese":
			slave.accent = naturalAccent;
			break;
		case "Jordanian":
			slave.accent = (V.language === "Arabic") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "Kazakh":
			slave.accent = (V.language === "Russian") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "Kenyan":
			slave.accent = (V.language === "Arabic") ? jsEither([0, 1, 2, 2, 2, 3, 3]) : naturalAccent;
			break;
		case "Kittitian":
			slave.accent = (V.language === "English") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "Korean":
			slave.accent = (V.language === "Chinese") ? jsEither([0, 1, 2, 2, 2, 3, 3]) : naturalAccent;
			break;
		case "Kosovan":
			if (V.language === "Albanian") {
				slave.accent = jsEither([0, 1, 1, 1, 2]);
			} else if (V.language === "Serbian") {
				slave.accent = jsEither([0, 1, 1, 1, 2]);
			} else {
				slave.accent = naturalAccent;
			}
			break;
		case "Kurdish":
			slave.accent = (V.language === "Arabic") ? jsEither([0, 1, 2, 2, 2, 3, 3]) : naturalAccent;
			break;
		case "Kuwaiti":
			slave.accent = (V.language === "Arabic") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "Kyrgyz":
			slave.accent = (V.language === "Russian") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "Laotian":
			if (V.language === "Lao") {
				slave.accent = jsEither([0, 0, 0, 1]);
			} else if (V.language === "Khmu") {
				slave.accent = jsEither([0, 1, 1, 1, 2]);
			} else if (V.language === "French") {
				slave.accent = jsEither([0, 1, 2, 2, 2, 3, 3]);
			} else {
				slave.accent = naturalAccent;
			}
			break;
		case "Latvian":
			slave.accent = naturalAccent;
			break;
		case "Lebanese":
			slave.accent = (V.language === "Arabic") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "Liberian":
			slave.accent = (V.language === "English") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "Libyan":
			slave.accent = (V.language === "Arabic") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "a Liechtensteiner":
			slave.accent = (V.language === "German") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "Lithuanian":
			slave.accent = naturalAccent;
			break;
		case "Luxembourgian":
			if (V.language === "German") {
				slave.accent = jsEither([0, 1, 1, 1, 2]);
			} else if (V.language === "French") {
				slave.accent = jsEither([0, 1, 1, 1, 2]);
			} else {
				slave.accent = naturalAccent;
			}
			break;
		case "Macedonian":
			slave.accent = naturalAccent;
			break;
		case "Malagasy":
			slave.accent = naturalAccent;
			break;
		case "Malawian":
			slave.accent = naturalAccent;
			break;
		case "Malaysian":
			slave.accent = (V.language === "Malay") ? jsEither([0, 0, 0, 1]) : naturalAccent;
			break;
		case "Maldivian":
			slave.accent = naturalAccent;
			break;
		case "Malian":
			slave.accent = (V.language === "Arabic") ? jsEither([0, 1, 2, 2, 2, 3, 3]) : naturalAccent;
			break;
		case "Maltese":
			if (V.language === "English") {
				slave.accent = jsEither([0, 1, 1, 1, 2]);
			} else if (V.language === "Italian") {
				slave.accent = jsEither([0, 1, 1, 1, 2]);
			} else {
				slave.accent = naturalAccent;
			}
			break;
		case "Marshallese":
			slave.accent = (V.language === "English") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "Mauritanian":
			slave.accent = (V.language === "Arabic") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "Mauritian":
			if (V.language === "English") {
				slave.accent = jsEither([0, 1, 1, 1, 2]);
			} else if (V.language === "French") {
				slave.accent = jsEither([0, 1, 1, 1, 2]);
			} else {
				slave.accent = naturalAccent;
			}
			break;
		case "Mexican":
			slave.accent = (V.language === "Spanish") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "Micronesian":
			slave.accent = (V.language === "English") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "Moldovan":
			slave.accent = naturalAccent;
			break;
		case "Monégasque":
			slave.accent = (V.language === "French") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "Mongolian":
			slave.accent = naturalAccent;
			break;
		case "Montenegrin":
			slave.accent = naturalAccent;
			break;
		case "Moroccan":
			slave.accent = (V.language === "Arabic") ? jsEither([0, 1, 2, 2, 2, 3, 3]) : naturalAccent;
			break;
		case "Mosotho":
			slave.accent = naturalAccent;
			break;
		case "Motswana":
			slave.accent = (V.language === "English") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "Mozambican":
			slave.accent = (V.language === "Portuguese") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "Namibian":
			if (V.language === "English") {
				slave.accent = jsEither([0, 1, 1, 1, 2]);
			} else if (V.language === "Afrikaans") {
				slave.accent = jsEither([0, 1, 2, 2, 2, 3, 3]);
			} else {
				slave.accent = naturalAccent;
			}
			break;
		case "Nauruan":
			slave.accent = naturalAccent;
			break;
		case "Nepalese":
			slave.accent = naturalAccent;
			break;
		case "New Caledonian":
			slave.accent = (V.language === "French") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "a New Zealander":
			slave.accent = (V.language === "English") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "Ni-Vanuatu":
			if (V.language === "French") {
				slave.accent = jsEither([0, 1, 1, 1, 2]);
			} else if (V.language === "English") {
				slave.accent = jsEither([0, 1, 1, 1, 2]);
			} else {
				slave.accent = naturalAccent;
			}
			break;
		case "Nicaraguan":
			slave.accent = (V.language === "Spanish") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "Nigerian":
			if (V.language === "English") {
				slave.accent = jsEither([0, 1, 1, 1, 2]);
			} else if (V.language === "Hausa") {
				slave.accent = jsEither([0, 1, 1, 1, 2]);
			} else if (V.language === "Arabic") {
				slave.accent = jsEither([0, 1, 2, 2, 2, 3, 3]);
			} else {
				slave.accent = naturalAccent;
			}
			break;
		case "Nigerien":
			if (V.language === "French") {
				slave.accent = jsEither([0, 1, 1, 1, 2]);
			} else if (V.language === "Hausa") {
				slave.accent = jsEither([0, 1, 1, 1, 2]);
			} else if (V.language === "Arabic") {
				slave.accent = jsEither([0, 1, 2, 2, 2, 3, 3]);
			} else {
				slave.accent = naturalAccent;
			}
			break;
		case "Niuean":
			slave.accent = (V.language === "English") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "Norwegian":
			slave.accent = naturalAccent;
			break;
		case "Omani":
			slave.accent = (V.language === "Arabic") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "Pakistani":
			slave.accent = (V.language === "Arabic") ? jsEither([0, 1, 2, 2, 2, 3, 3]) : naturalAccent;
			break;
		case "Palauan":
			if (V.language === "English") {
				slave.accent = jsEither([0, 1, 1, 1, 2]);
			} else if (V.language === "Sonsorolese") {
				slave.accent = jsEither([0, 1, 1, 1, 2]);
			} else if (V.language === "Tobian") {
				slave.accent = jsEither([0, 1, 1, 1, 2]);
			} else if (V.language === "Japanese") {
				slave.accent = jsEither([0, 1, 2, 2, 2, 3, 3]);
			} else {
				slave.accent = naturalAccent;
			}
			break;
		case "Palestinian":
			slave.accent = (V.language === "Arabic") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "Panamanian":
			slave.accent = (V.language === "Spanish") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "Papua New Guinean":
			slave.accent = naturalAccent;
			break;
		case "Paraguayan":
			slave.accent = (V.language === "Spanish") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "Peruvian":
			slave.accent = (V.language === "Spanish") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "Polish":
			slave.accent = naturalAccent;
			break;
		case "Portuguese":
			slave.accent = (V.language === "Spanish") ? jsEither([0, 1, 2, 2, 2, 3, 3]) : naturalAccent;
			break;
		case "Puerto Rican":
			if (V.language === "Spanish") {
				slave.accent = jsEither([0, 1, 1, 1, 2]);
			} else if (V.language === "English") {
				slave.accent = jsEither([0, 1, 2, 2, 2, 3, 3]);
			} else {
				slave.accent = naturalAccent;
			}
			break;
		case "Qatari":
			slave.accent = (V.language === "Arabic") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "Romanian":
			slave.accent = naturalAccent;
			break;
		case "Russian":
			slave.accent = naturalAccent;
			break;
		case "Rwandan":
			slave.accent = (V.language === "Kinyarwanda") ? jsEither([0, 0, 0, 1]) : naturalAccent;
			break;
		case "Sahrawi":
			slave.accent = (V.language === "Arabic") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "Saint Lucian":
			slave.accent = (V.language === "English") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "Salvadoran":
			slave.accent = (V.language === "Spanish") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "Sammarinese":
			slave.accent = (V.language === "Italian") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "Samoan":
			slave.accent = (V.language === "English") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "São Toméan":
			slave.accent = (V.language === "Portuguese") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "Saudi":
			slave.accent = (V.language === "Arabic") ? jsEither([0, 0, 0, 1]) : naturalAccent;
			break;
		case "Scottish":
			slave.accent = (V.language === "English") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "Senegalese":
			slave.accent = (V.language === "French") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "Serbian":
			slave.accent = naturalAccent;
			break;
		case "Seychellois":
			if (V.language === "French") {
				slave.accent = jsEither([0, 1, 1, 1, 2]);
			} else if (V.language === "English") {
				slave.accent = jsEither([0, 1, 2, 2, 2, 3, 3]);
			} else {
				slave.accent = naturalAccent;
			}
			break;
		case "Sierra Leonean":
			slave.accent = (V.language === "English") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "Singaporean":
			if (V.language === "English") {
				slave.accent = jsEither([0, 1, 1, 1, 2]);
			} else if (V.language === "Chinese") {
				slave.accent = jsEither([0, 1, 1, 1, 2]);
			} else if (V.language === "Malay") {
				slave.accent = jsEither([0, 1, 1, 1, 2]);
			} else if (V.language === "Tamil") {
				slave.accent = jsEither([0, 1, 1, 1, 2]);
			} else {
				slave.accent = naturalAccent;
			}
			break;
		case "Slovak":
			slave.accent = naturalAccent;
			break;
		case "Slovene":
			slave.accent = naturalAccent;
			break;
		case "a Solomon Islander":
			slave.accent = (V.language === "English") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "Somali":
			slave.accent = (V.language === "Arabic") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "South African":
			if (V.language === "English") {
				slave.accent = jsEither([0, 1, 1, 1, 2]);
			} else if (V.language === "Afrikaans") {
				slave.accent = jsEither([0, 0, 0, 1]);
			} else {
				slave.accent = naturalAccent;
			}
			break;
		case "South Sudanese":
			slave.accent = (V.language === "English") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "Spanish":
			slave.accent = (V.language === "Catalan") ? jsEither([0, 1, 2, 2, 2, 3, 3]) : naturalAccent;
			break;
		case "Sri Lankan":
			if (V.language === "Sinhalese") {
				slave.accent = jsEither([0, 0, 0, 1]);
			} else if (V.language === "Tamil") {
				slave.accent = jsEither([0, 0, 0, 1]);
			} else if (V.language === "English") {
				slave.accent = jsEither([0, 1, 2, 2, 2, 3, 3]);
			} else {
				slave.accent = naturalAccent;
			}
			break;
		case "Sudanese":
			slave.accent = (V.language === "Arabic") ? jsEither([0, 1, 2, 2, 2, 3, 3]) : naturalAccent;
			break;
		case "Surinamese":
			slave.accent = (V.language === "Dutch") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "Swazi":
			slave.accent = naturalAccent;
			break;
		case "Swedish":
			if (V.language === "English") {
				slave.accent = jsEither([0, 1, 2, 2, 2, 3, 3]);
			} else if (V.language === "Finnish") {
				slave.accent = jsEither([0, 1, 2, 2, 2, 3, 3]);
			} else if (V.language === "Norwegian") {
				slave.accent = jsEither([0, 1, 2, 2, 2, 3, 3]);
			} else if (V.language === "German") {
				slave.accent = jsEither([0, 1, 2, 2, 2, 3, 3]);
			} else {
				slave.accent = naturalAccent;
			}
			break;
		case "Swiss":
			if (V.language === "German") {
				slave.accent = jsEither([0, 1, 1, 1, 2]);
			} else if (V.language === "French") {
				slave.accent = jsEither([0, 1, 1, 1, 2]);
			} else if (V.language === "Italian") {
				slave.accent = jsEither([0, 1, 2, 2, 2, 3, 3]);
			} else {
				slave.accent = naturalAccent;
			}
			break;
		case "Syrian":
			slave.accent = (V.language === "Arabic") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "Taiwanese":
			slave.accent = (V.language === "Chinese") ? jsEither([0, 0, 0, 1]) : naturalAccent;
			break;
		case "Tajik":
			slave.accent = (V.language === "Russian") ? jsEither([0, 1, 2, 2, 2, 3, 3]) : naturalAccent;
			break;
		case "Tanzanian":
			slave.accent = (V.language === "Swahili") ? jsEither([0, 0, 0, 1]) : naturalAccent;
			break;
		case "Thai":
			if (V.language === "Chinese") {
				slave.accent = jsEither([0, 1, 2, 2, 2, 3, 3]);
			} else if (V.language === "Malay") {
				slave.accent = jsEither([0, 1, 2, 2, 2, 3, 3]);
			} else if (V.language === "Khmer") {
				slave.accent = jsEither([0, 1, 2, 2, 2, 3, 3]);
			} else {
				slave.accent = naturalAccent;
			}
			break;
		case "Tibetan":
			slave.accent = (V.language === "Chinese") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "Togolese":
			slave.accent = (V.language === "French") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "Tongan":
			slave.accent = (V.language === "English") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "Trinidadian":
			slave.accent = (V.language === "English") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "Tunisian":
			slave.accent = (V.language === "Arabic") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "Turkish":
			slave.accent = naturalAccent;
			break;
		case "Turkmen":
			slave.accent = (V.language === "Russian") ? jsEither([0, 1, 2, 2, 2, 3, 3]) : naturalAccent;
			break;
		case "Tuvaluan":
			slave.accent = (V.language === "English") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "Ugandan":
			slave.accent = (V.language === "Swahili") ? jsEither([0, 0, 0, 1]) : naturalAccent;
			break;
		case "Ukrainian":
			slave.accent = (V.language === "Russian") ? jsEither([0, 1, 2, 2, 2, 3, 3]) : naturalAccent;
			break;
		case "Uruguayan":
			slave.accent = (V.language === "Spanish") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "Uzbek":
			slave.accent = (V.language === "Russian") ? jsEither([0, 1, 2, 2, 2, 3, 3]) : naturalAccent;
			break;
		case "Vatican":
			slave.accent = (V.language === "Italian") ? jsEither([0, 0, 0, 1]) : naturalAccent;
			break;
		case "Venezuelan":
			slave.accent = (V.language === "Spanish") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "Vietnamese":
			slave.accent = (V.language === "Chinese") ? jsEither([0, 1, 2, 2, 2, 3, 3]) : naturalAccent;
			break;
		case "Vincentian":
			slave.accent = (V.language === "English") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "Yemeni":
			slave.accent = (V.language === "Arabic") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "Zairian":
			if (V.language === "Lingala") {
				slave.accent = jsEither([0, 0, 0, 1]);
			} else if (V.language === "Kikongo") {
				slave.accent = jsEither([0, 1, 1, 1, 2]);
			} else if (V.language === "Swahili") {
				slave.accent = jsEither([0, 1, 1, 1, 2]);
			} else if (V.language === "French") {
				slave.accent = jsEither([0, 1, 1, 1, 2]);
			} else {
				slave.accent = naturalAccent;
			}
			break;
		case "Zambian":
			slave.accent = (V.language === "English") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "Zimbabwean":
			slave.accent = (V.language === "English" && slave.race === "white") ? jsEither([0, 1, 1, 1, 2]) : naturalAccent;
			break;
		case "Ancient Chinese Revivalist":
			slave.accent = (V.language === "Chinese") ? jsEither([0, 0, 0, 1]) : naturalAccent;
			break;
		case "Ancient Egyptian Revivalist":
			slave.accent = (V.language === "Ancient Egyptian") ? jsEither([0, 0, 0, 1]) : naturalAccent;
			break;
		case "Arabian Revivalist":
			slave.accent = (V.language === "Arabic") ? jsEither([0, 0, 0, 1]) : naturalAccent;
			break;
		case "Aztec Revivalist":
			slave.accent = (V.language === "Nahuatl") ? jsEither([0, 0, 0, 1]) : naturalAccent;
			break;
		case "Edo Revivalist":
			slave.accent = (V.language === "Japanese") ? jsEither([0, 0, 0, 1]) : naturalAccent;
			break;
		case "Roman Revivalist":
			slave.accent = (V.language === "Latin") ? jsEither([0, 0, 0, 1]) : naturalAccent;
			break;
		default:
			slave.accent = naturalAccent;
			break;
	}

	if (slave.nationality === V.language) {
		slave.accent = jsEither([0, 0, 0, 0, 0, 0, 0, 0, 1]);
	}
};

/*
Backup and then apply gingering modifiers to $activeSlave - no changes should be made to $activeSlave until after calling removeGingering() to restore the backup
Called from lawCompliance
*/
window.checkForGingering = function checkForGingering() {
	const V = State.variables;
	let r = "";
	const pronouns = getPronouns(V.activeSlave);
	const he = pronouns.pronoun;
	const him = pronouns.object;
	const his = pronouns.possessive;
	const He = capFirstChar(he);
	const His = capFirstChar(his);

	/* reset in case gingered slaves were viewed but not purchased (no newSlaveIntro) */
	V.gingering = 0, V.gingeringDetected = 0, V.gingeringDetection = 0, V.toSearch = V.activeSlave.origin;
	if (V.applyLaw === 1 && V.HonestySMR === 1) {
		/* SMR prohibits gingering and is enforced for this slave - do nothing */
	} else if (V.activeSlave.indenture > 0) {
		/* indentured servants cannot be gingered */
	} else if (V.toSearch !== 0 && V.toSearch.indexOf("Shelter") !== -1) {
		/* is a Shelter slave - do nothing */
	} else {
		V.beforeGingering = clone(V.activeSlave);
		if (V.activeSlave.trust < -20 && jsRandom(1, 3) === 1) {
			V.gingering = "antidepressant";
			V.activeSlave.trust += jsRandom(10, 40);
		} else if (V.activeSlave.devotion < -20 && jsRandom(1, 3) === 1) {
			V.gingering = "depressant";
			V.activeSlave.devotion += jsRandom(10, 40);
		} else if (V.activeSlave.health < 60 && jsRandom(1, 3) === 1) {
			V.gingering = "stimulant";
			V.activeSlave.health += jsRandom(20, 40);
		} else if (V.activeSlave.balls > 0 && V.activeSlave.dick > 2 && jsRandom(1, 3) === 1) {
			V.gingering = "vasoconstrictor";
			V.activeSlave.dick -= jsRandom(1, 2);
		} else if (V.activeSlave.balls > 0 && V.activeSlave.dick < 5 && jsRandom(1, 3) === 1) {
			V.gingering = "vasodilator";
			V.activeSlave.dick += jsRandom(1, 2);
		} else if (V.activeSlave.attrKnown === 0 && jsRandom(1, 3) === 1) {
			V.gingering = "aphrodisiac";
			V.activeSlave.aphrodisiacs = 2;
			V.activeSlave.attrKnown = 1;
			V.activeSlave.attrXX = jsRandom(60, 90);
			V.activeSlave.attrXY = jsRandom(60, 90);
			V.activeSlave.energy = jsRandom(50, 90);
		} else if (V.activeSlave.anus > 0 && V.activeSlave.fetishKnown === 0 && jsRandom(1, 3) === 1) {
			V.gingering = "ginger";
			V.activeSlave.fetish = "buttslut";
			V.activeSlave.fetishKnown = 1;
			V.activeSlave.fetishStrength = 65;
		}
	}
	if (V.gingering !== 0) {
		if (V.PC.slaving >= 100) {
			V.gingeringDetected = 1, V.gingeringDetection = "slaver";
			switch (V.gingering) {
				case "antidepressant":
					r += `${He} is acting dazed and unfocused. ${He}'s obviously been given antidepressants to make ${him} appear less fearful, and will be considerably less trusting than ${he} seems.`;
					break;
				case "depressant":
					r += `${He} is acting languid and drugged. ${He}'s obviously been given a depressant to make ${him} appear less hateful, and will be considerably less accepting of slavery than ${he} seems.`;
					break;
				case "stimulant":
					r += `${He} is acting twitchy and hyperactive. ${He}'s obviously been given a stimulant to make ${him} seem healthier and more energetic, and is a lot less healthy than ${he} looks.`;
					break;
				case "vasoconstrictor":
					r += `${His} lips have the slightest blue tinge, making it obvious ${he}'s been given a vasoconstrictor. ${His} cock is a lot less of a girldick than it looks right now.`;
					break;
				case "vasodilator":
					r += `${He} has an impressive erection, but it seems quite unconnected to the rest of ${him}, as if ${he} doesn't know what to do with it. ${He}'s obviously been given a vasodilator to make ${his} dick seem a little less pathetic.`;
					break;
				case "aphrodisiac":
					r += `${His} pupils are slightly dilated, ${his} breath comes in fast pants, and ${his} skin is flushed. ${He}'s obviously been given as big of a dose of aphrodisiacs as ${he} can handle without a heart attack.`;
					break;
				default:
					r += `${He} is acting oddly, presenting ${his} ass in an awkward way and acting uncomfortable. ${He}'s obviously had an irritant shoved up ${his} butt to make ${him} act like an anal whore.`;
			}
			r += ` It's a trick you're very familiar with, given your <span class="springgreen">training as a slaver.</span>`;
		} else {
			/* not slaver */
			if (V.PC.warfare >= 100 && jsRandom(1, 2) === 1) {
				V.gingeringDetected = 1, V.gingeringDetection = "mercenary";
			} else if (V.PC.rumor === "force" && jsRandom(1, 2) === 1) {
				V.gingeringDetected = 1, V.gingeringDetection = "force";
			} else if (jsRandom(1, 3) === 1) {
				V.gingeringDetected = 1;
			}
			if (V.gingeringDetected === 1) {
				switch (V.gingering) {
					case "antidepressant":
						r += `${He} is acting dazed and unfocused, like ${he}'s been given antidepressants to make ${him} appear less fearful. ${He} may be considerably less trusting than ${he} seems. `;
						break;
					case "depressant":
						r += `${He} is acting languid and drugged, like ${he}'s been given a depressant to make ${him} appear less hateful. ${He} may be considerably less accepting of slavery than ${he} seems. `;
						break;
					case "stimulant":
						r += `${He} is acting twitchy and hyperactive, like ${he}'s been given a stimulant to make ${him} seem healthier and more energetic. ${He} may be considerably less vital than ${he} seems. `;
						break;
					case "vasoconstrictor":
						r += `${His} lips have the slightest blue tinge, suggesting that ${he} may have been given a vasoconstrictor. If ${he} has, ${his} cock may be considerably less feminine and demure than it now seems. `;
						break;
					case "vasodilator":
						r += `${He} has an impressive erection, but it seems quite unconnected to the rest of ${him}, as if ${he} doesn't know what to do with it. ${He} may have been given a vasodilator. If ${he} has, ${his} cock may be considerably less impressive than it now seems. `;
						break;
					case "aphrodisiac":
						r += `${His} pupils are slightly dilated, ${his} breath comes in fast pants, and ${his} skin is flushed. These are the characteristic symptoms of a dose of aphrodisiacs limited only by a desire to avoid giving ${him} a heart attack. `;
						break;
					default:
						r += `${He} is acting oddly, presenting ${his} ass in an awkward way and acting uncomfortable. ${He} may be considerably less interested in anal sex than ${he} seems. `;
				}
				if (V.gingeringDetection === "mercenary") {
					r += `The nervous seller confirms this in response to a direct inquiry. Your intimidating reputation from your <span class="springgreen">extensive combat training</span> has its uses.`;
				} else if (V.gingeringDetection === "force") {
					r += `The nervous seller confirms this in response to a direct inquiry. Your reputation as a <span class="springgreen"> ${V.PCTitle ? "man" : "woman"} of blood</span> has its uses.`;
				}
			}
		} /* gingering detected */
	} /* gingering !== 0 */
	return r;
};

/*
Retrieve original $activeSlave without gingering modifiers
Call as removeGingering()
Called from newSlaveIntro, bulkSlaveGenerate
*/
window.removeGingering = function removeGingering() {
	const V = State.variables;
	if (V.gingering !== 0 && V.beforeGingering !== 0 && V.activeSlave !== 0 && V.beforeGingering.ID === V.activeSlave.ID) {
		/* extra checks to ensure gingering state is not left over from a different slave that was inspected but not purchased */
		V.activeSlave = V.beforeGingering, V.beforeGingering = 0;
	} else {
		/* clear left over state from a different slave without modifying activeSlave */
		V.gingering = 0, V.beforeGingering = 0;
	}
};

window.randomizeAttraction = function randomizeAttraction(slave) {
	const sexuality = jsRandom(0, 100);
	let attraction = Math.clamp(slave.energy * 2, 60, 180);

	if (slave.balls > 0) {
		if (sexuality > 90) {
			slave.attrXY = Math.clamp(attraction, 0, 100);
			attraction -= slave.attrXY;
			slave.attrXX = Math.clamp(attraction, 0, 100);
		} else if (sexuality > 70) {
			slave.attrXY = Math.clamp(attraction + jsRandom(-5, 5), 0, 100);
			slave.attrXX = Math.clamp(attraction + jsRandom(-5, 5), 0, 100);
		} else {
			slave.attrXX = Math.clamp(attraction, 0, 100);
			attraction -= slave.attrXX;
			slave.attrXY = Math.clamp(attraction, 0, 100);
		}
	} else {
		if (sexuality > 90) {
			slave.attrXX = Math.clamp(attraction, 0, 100);
			attraction -= slave.attrXX;
			slave.attrXY = Math.clamp(attraction, 0, 100);
		} else if (sexuality > 60) {
			slave.attrXY = Math.clamp(attraction + jsRandom(-5, 5), 0, 100);
			slave.attrXX = Math.clamp(attraction + jsRandom(-5, 5), 0, 100);
		} else {
			slave.attrXY = Math.clamp(attraction, 0, 100);
			attraction -= slave.attrXY;
			slave.attrXX = Math.clamp(attraction, 0, 100);
		}
	}
	slave.attrXX = Math.clamp(slave.attrXX + jsRandom(-5, 5), 0, 100);
	slave.attrXY = Math.clamp(slave.attrXY + jsRandom(-5, 5), 0, 100);
};

window.BaseSlave = function BaseSlave() {
	State.variables.activeSlave = {
		slaveName: "blank",
		slaveSurname: 0,
		birthName: "blank",
		birthSurname: 0,
		genes: "XX",
		pronoun: "she",
		possessive: "her",
		possessivePronoun: "hers",
		objectReflexive: "herself",
		object: "her",
		noun: "girl",
		weekAcquired: 0,
		origin: 0,
		career: 0,
		ID: 0,
		prestige: 0,
		pornFeed: 0,
		pornFame: 0,
		pornFameSpending: 0,
		pornPrestige: 0,
		pornPrestigeDesc: 0,
		pornFameType: "none",
		pornFocus: "none",
		pornTypeGeneral: 0,
		pornTypeFuckdoll: 0,
		pornTypeRape: 0,
		pornTypePreggo: 0,
		pornTypeBBW: 0,
		pornTypeGainer: 0,
		pornTypeStud: 0,
		pornTypeLoli: 0,
		pornTypeDeepThroat: 0,
		pornTypeStruggleFuck: 0,
		pornTypePainal: 0,
		pornTypeTease: 0,
		pornTypeRomantic: 0,
		pornTypePervert: 0,
		pornTypeCaring: 0,
		pornTypeUnflinching: 0,
		pornTypeSizeQueen: 0,
		pornTypeNeglectful: 0,
		pornTypeCumAddict: 0,
		pornTypeAnalAddict: 0,
		pornTypeAttentionWhore: 0,
		pornTypeBreastGrowth: 0,
		pornTypeAbusive: 0,
		pornTypeMalicious: 0,
		pornTypeSelfHating: 0,
		pornTypeBreeder: 0,
		pornTypeSub: 0,
		pornTypeCumSlut: 0,
		pornTypeAnal: 0,
		pornTypeHumiliation: 0,
		pornTypeBoobs: 0,
		pornTypeDom: 0,
		pornTypeSadist: 0,
		pornTypeMasochist: 0,
		pornTypePregnancy: 0,
		prestigeDesc: 0,
		recruiter: 0,
		relation: 0,
		relationTarget: 0,
		relationship: 0,
		relationshipTarget: 0,
		rivalry: 0,
		rivalryTarget: 0,
		subTarget: 0,
		father: 0,
		mother: 0,
		daughters: 0,
		sisters: 0,
		canRecruit: 0,
		choosesOwnAssignment: 0,
		assignment: "rest",
		assignmentVisible: 1,
		sentence: 0,
		training: 0,
		toyHole: "all her holes",
		indenture: -1,
		indentureRestrictions: 0,
		birthWeek: random(0,51),
		actualAge: 18,
		visualAge: 18,
		physicalAge: 18,
		ovaryAge: 18,
		ageImplant: 0,
		health: 0,
		minorInjury: 0,
		trust: 0,
		oldTrust: 0,
		devotion: 0,
		oldDevotion: 0,
		weight: 0,
		muscles: 0,
		height: 170,
		heightImplant: 0,
		nationality: "slave",
		race: "white",
		origRace: "white",
		markings: "none",
		eyes: 1,
		eyeColor: "brown",
		origEye: "brown",
		pupil: "circular",
		sclerae: "white",
		eyewear: "none",
		hears: 0,
		earwear: "none",
		earImplant: 0,
		origHColor: "brown",
		hColor: "brown",
		pubicHColor: "brown",
		underArmHColor: "brown",
		eyebrowHColor: "brown",
		origSkin: "light",
		skin: "light",
		hLength: 60,
		eyebrowFullness: "natural",
		hStyle: "short",
		pubicHStyle: "neat",
		underArmHStyle: "neat",
		eyebrowHStyle: "natural",
		waist: 0,
		corsetPiercing: 0,
		PLimb: 0,
		amp: 0,
		heels:0,
		voice: 2,
		voiceImplant: 0,
		accent: 0,
		shoulders: 0,
		shouldersImplant: 0,
		boobs: 0,
		boobsImplant: 0,
		boobsImplantType: 0,
		boobShape: "normal",
		nipples: "cute",
		nipplesPiercing: 0,
		nipplesAccessory: "none",
		areolae: 0,
		areolaePiercing: 0,
		areolaeShape: "circle",
		boobsTat: 0,
		lactation: 0,
		lactationAdaptation: 0,
		milk: 0,
		cum: 0,
		hips: 0,
		hipsImplant: 0,
		butt: 0,
		buttImplant: 0,
		buttImplantType: 0,
		buttTat: 0,
		face: 0,
		faceImplant: 0,
		faceShape: "normal",
		lips: 15,
		lipsImplant: 0,
		lipsPiercing: 0,
		lipsTat: 0,
		teeth: "normal",
		tonguePiercing: 0,
		vagina: 0,
		vaginaLube: 0,
		vaginaPiercing: 0,
		vaginaTat: 0,
		preg: -1,
		pregSource: 0,
		pregType: 0,
		pregAdaptation: 50,
		superfetation: 0,
		ovaImplant: 0,
		wombImplant: "none",
		broodmother: 0,
		broodmotherFetuses: 0,
		broodmotherOnHold: 0,
		broodmotherCountDown: 0,
		labor: 0,
		births: 0,
		laborCount: 0,
		cSec: 0,
		bellyAccessory: "none",
		labia: 0,
		clit: 0,
		clitPiercing: 0,
		clitSetting: "vanilla",
		foreskin: 0,
		anus: 0,
		dick: 0,
		analArea: 1,
		dickPiercing: 0,
		dickTat: 0,
		prostate: 0,
		balls: 0,
		scrotum: 0,
		ovaries: 0,
		anusPiercing: 0,
		anusTat: 0,
		makeup: 0,
		nails: 0,
		brand: 0,
		brandLocation: 0,
		earPiercing: 0,
		nosePiercing: 0,
		eyebrowPiercing: 0,
		navelPiercing: 0,
		shouldersTat: 0,
		armsTat: 0,
		legsTat: 0,
		backTat: 0,
		stampTat: 0,
		vaginalSkill: 0,
		oralSkill: 0,
		analSkill: 0,
		whoreSkill: 0,
		entertainSkill: 0,
		combatSkill: 0,
		livingRules: "spare",
		speechRules: "restrictive",
		releaseRules: "restrictive",
		relationshipRules: "restrictive",
		standardPunishment: "situational",
		standardReward: "situational",
		useRulesAssistant: 1,
		diet: "healthy",
		dietCum: 0,
		dietMilk: 0,
		tired: 0,
		hormones: 0,
		drugs: "no drugs",
		curatives: 0,
		chem: 0,
		aphrodisiacs: 0,
		addict: 0,
		fuckdoll: 0,
		choosesOwnClothes: 0,
		clothes: "no clothing",
		collar: "none",
		shoes: "none",
		vaginalAccessory: "none",
		dickAccessory: "none",
		legAccessory: "none",
		buttplug: "none",
		buttplugAttachment: "none",
		intelligence: 0,
		intelligenceImplant: 0,
		energy: 50,
		need: 0,
		attrXX: 0,
		attrXY: 0,
		attrKnown: 0,
		fetish: "none",
		fetishStrength: 70,
		fetishKnown: 0,
		behavioralFlaw: "none",
		behavioralQuirk: "none",
		sexualFlaw: "none",
		sexualQuirk: "none",
		oralCount: 0,
		vaginalCount: 0,
		analCount: 0,
		mammaryCount: 0,
		penetrativeCount: 0,
		publicCount: 0,
		pitKills: 0,
		customTat: "",
		customLabel: "",
		customDesc: "",
		customTitle: "",
		customTitleLisp: "",
		rudeTitle: 0,
		customImage: 0,
		currentRules: [],
		bellyTat: 0,
		induce: 0,
		mpreg: 0,
		inflation: 0,
		inflationType: "none",
		inflationMethod: 0,
		milkSource: 0,
		cumSource: 0,
		burst: 0,
		pregKnown: 0,
		pregWeek: 0,
		belly: 0,
		bellyPreg: 0,
		bellyFluid: 0,
		bellyImplant: -1,
		bellySag: 0,
		bellySagPreg: 0,
		bellyPain: 0,
		cervixImplant: 0,
		birthsTotal: 0,
		pubertyAgeXX: 13,
		pubertyAgeXY: 13,
		scars: 0,
		breedingMark: 0,
		bodySwap: 0,
		HGExclude: 0,
		ballType: "human",
		eggType: "human",
		reservedChildren: 0,
		reservedChildrenNursery: 0,
		choosesOwnChastity: 0,
		pregControl: "none",
		readyLimbs: [],
		ageAdjust: 0,
		bald: 0,
		origBodyOwner: "",
		origBodyOwnerID: 0,
		death: "",
		hormoneBalance: 0,
		onDiet: 0,
		breastMesh: 0,
		slavesFathered: 0,
		PCChildrenFathered: 0,
		slavesKnockedUp: 0,
		PCKnockedUp: 0,
		prematureBirth: 0,
		premature: 0,
		vasectomy: 0,
		haircuts: 0,
		newGamePlus: 0,
		skillHG: 0,
		skillRC: 0,
		skillBG: 0,
		skillMD: 0,
		skillDJ: 0,
		skillNU: 0,
		skillTE: 0,
		skillAT: 0,
		skillMT: 0,
		skillST: 0,
		skillMM: 0,
		skillWA: 0,
		skillS: 0,
		skillE: 0,
		skillW: 0,
		tankBaby: 0,
		geneMods: {NCS: 0, rapidCellGrowth: 0},
		NCSyouthening: 0,
		override_Race: 0,
		override_Skin: 0,
		override_Eye_Color: 0,
		override_H_Color: 0,
		override_Pubic_H_Color: 0,
		override_Arm_H_Color: 0,
		override_Brow_H_Color: 0,
		missingEyes: 0,
		missingArms: 0,
		missingLegs: 0
	};
};

window.generatePronouns = function generatePronouns(slave) {
	if (slave.fuckdoll > 0) {
		slave.pronoun = "it";
		slave.possessivePronoun = "its";
		slave.possessive = "its";
		slave.object = "it";
		slave.objectReflexive = "itself";
		slave.noun = "toy";
	} else if (slave.dick > 0 && slave.vagina == -1 && State.variables.diversePronouns == 1) {
		slave.pronoun = "he";
		slave.possessivePronoun = "his";
		slave.possessive = "his";
		slave.object = "him";
		slave.objectReflexive = "himself";
		slave.noun = "boy";
	} else {
		slave.pronoun = "she";
		slave.possessivePronoun = "hers";
		slave.possessive = "her";
		slave.object = "her";
		slave.objectReflexive = "herself";
		slave.noun = "girl";
	}
};