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

	/**
	 * @param {App.Entity.SlaveState} slave
	 * @returns {string}
	 */
	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;
	}

	/**
	 * @param {App.Entity.SlaveState} slave
	 * @param {Object[]} ruleset
	 * @returns {Object}
	 */
	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;
	}

	/**
	 * @param {App.Entity.SlaveState} slave
	 * @returns {Object}
	 */
	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;
	}

	/**
	 * @param {App.Entity.SlaveState} slave
	 * @param {Object} thisSurgery
	 * @param {string[]} surgeries
	 */
	function CommitSurgery(slave, thisSurgery, surgeries) {
		if (slave.health > 20 && surgeries.length < 3) {
			if (slave.eyes === -1 && thisSurgery.surgery_eyes === 1) {
				surgeries.push("surgery to correct her vision");
				slave.eyes = 1;
				cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave);
				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;
				cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave);
				if (V.PC.medicine >= 100) slave.health -= 5;
				else slave.health -= 10;
			} else if (slave.hears === -1 && thisSurgery.surgery_hears === 0) {
				surgeries.push("surgery to correct her hearing");
				slave.hears = 0;
				cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave);
				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;
				cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave);
				if (V.PC.medicine >= 100) slave.health -= 5;
				else slave.health -= 10;
			} else if (slave.smells === -1 && thisSurgery.surgery_smells === 0) {
				surgeries.push("surgery to correct her sense of smell");
				slave.smells = 0;
				cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave);
				if (V.PC.medicine >= 100) slave.health -= 5;
				else slave.health -= 10;
			} else if (slave.smells === 0 && thisSurgery.surgery_smells === -1) {
				surgeries.push("surgery to muffle her sense of smell");
				slave.smells = -1;
				cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave);
				if (V.PC.medicine >= 100) slave.health -= 5;
				else slave.health -= 10;
			} else if (slave.tastes === -1 && thisSurgery.surgery_tastes === 0) {
				surgeries.push("surgery to correct her sense of taste");
				slave.tastes = 0;
				cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave);
				if (V.PC.medicine >= 100) slave.health -= 5;
				else slave.health -= 10;
			} else if (slave.tastes === 0 && thisSurgery.surgery_tastes === -1) {
				surgeries.push("surgery to muffle her sense of taste");
				slave.tastes = -1;
				cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave);
				if (V.PC.medicine >= 100) slave.health -= 5;
				else slave.health -= 10;
			}
		}
		if (slave.health > 20 && surgeries.length < 3) {
			if (slave.lactation === 2 && thisSurgery.surgery_lactation === 0) {
				surgeries.push("surgery to remove her lactation implants");
				slave.lactation = 0;
				cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave);
				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;
				cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave);
				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";
				cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave);
				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");
				cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave);
				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;
				cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave);
				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)) {
				surgeries.push("bigger boobs");
				slave.boobsImplant += 400;
				slave.boobs += 400;
				cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave);
				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)) {
				surgeries.push("modestly bigger boobs");
				slave.boobsImplant += 200;
				slave.boobs += 200;
				cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave);
				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)) {
				surgeries.push("bigger boobs");
				slave.boobsImplant += 400;
				slave.boobs += 400;
				cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave);
				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)) {
				surgeries.push("bigger boobs");
				slave.boobsImplant += 200;
				slave.boobs += 200;
				cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave);
				if (V.PC.medicine >= 100) slave.health -= 5;
				else slave.health -= 10;
			}
		}
		if (slave.health > 20 && surgeries.length < 3) {
			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;
				cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave);
				if (V.PC.medicine >= 100) slave.health -= 5;
				else slave.health -= 10;
			} else if (slave.butt <= 3 && (slave.butt < thisSurgery.surgery_butt)) {
				surgeries.push("a bigger butt");
				slave.buttImplant = 1;
				slave.butt += 1;
				cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave);
				if (V.PC.medicine >= 100) slave.health -= 5;
				else slave.health -= 10;
			} else if (slave.butt <= 5 && (slave.butt < thisSurgery.surgery_butt)) {
				surgeries.push("a bigger butt");
				slave.buttImplant = 1;
				slave.butt += 1;
				cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave);
				if (V.PC.medicine >= 100) slave.health -= 5;
				else slave.health -= 10;
			} else if (slave.butt <= 8 && (slave.butt < thisSurgery.surgery_butt)) {
				surgeries.push("a bigger butt");
				slave.buttImplant = 1;
				slave.butt += 1;
				cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave);
				if (V.PC.medicine >= 100) slave.health -= 5;
				else slave.health -= 10;
			}
		}
		if (slave.health > 20 && surgeries.length < 3) {
			if (slave.anus > 3 && thisSurgery.surgery_cosmetic > 0) {
				surgeries.push("a restored anus");
				slave.anus = 3;
				if (slave.skill.anal > 10) {
					slave.skill.anal -= 10;
				}
				cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave);
				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.skill.vaginal > 10) {
					slave.skill.vaginal -= 10;
				}
				cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave);
				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.skill.anal > 10) {
					slave.skill.anal -= 10;
				}
				cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave);
				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.skill.vaginal > 10) {
					slave.skill.vaginal -= 10;
				}
				cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave);
				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.skill.anal > 10) {
					slave.skill.anal -= 10;
				}
				cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave);
				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.skill.vaginal > 10) {
					slave.skill.vaginal -= 10;
				}
				cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave);
				if (V.PC.medicine >= 100) slave.health -= 5;
				else slave.health -= 10;
			}
		}
		if (slave.health > 20 && surgeries.length < 3) {
			if (slave.prostate === 2 && thisSurgery.surgery_prostate === 0) {
				surgeries.push("surgery to remove her prostate implant");
				slave.prostate = 0;
				cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave);
				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;
				cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave);
				if (V.PC.medicine >= 100) slave.health -= 5;
				else slave.health -= 10;
			} 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;
				cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave);
			} 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;
				cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave);
			}
		}
		if (slave.health > 20 && surgeries.length < 3) {
			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);
				cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave);
				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;
				cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave);
				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";
				cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave);
			} 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;
				cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave);
			} else if (slave.weight >= 10 && thisSurgery.surgery_cosmetic > 0) {
				surgeries.push("liposuction");
				slave.weight -= 50;
				cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave);
				if (V.PC.medicine >= 100) slave.health -= 5;
				else slave.health -= 10;
			} else if ((slave.bellySagPreg > 0 || slave.bellySag > 0) && thisSurgery.surgery_cosmetic > 0) {
				surgeries.push("a tummy tuck");
				slave.bellySag = 0;
				slave.bellySagPreg = 0;
				cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave);
				if (V.PC.medicine >= 100) slave.health -= 10;
				else slave.health -= 20;
			} else if (slave.voice === 1 && slave.voiceImplant === 0 && thisSurgery.surgery_cosmetic > 0) {
				surgeries.push("a feminine voice");
				slave.voice += 1;
				slave.voiceImplant += 1;
				cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave);
				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.skill.oral > 10) {
					slave.skill.oral -= 10;
				}
				cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave);
				if (V.PC.medicine >= 100) slave.health -= 5;
				else slave.health -= 10;
			} else if (slave.lips <= 95 && (slave.lips < thisSurgery.surgery_lips)) {
				surgeries.push("bigger lips");
				slave.lipsImplant += 10;
				slave.lips += 10;
				if (slave.skill.oral > 10) {
					slave.skill.oral -= 10;
				}
				cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave);
				if (V.PC.medicine >= 100) slave.health -= 5;
				else slave.health -= 10;
			} else if (slave.cSec === 1 && thisSurgery.surgery_cosmetic > 0) {
				surgeries.push("surgery to remove a c-section scar");
				slave.cSec = 0;
				cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave);
				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);
				cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave);
				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;
				cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave);
				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;
				cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave);
				if (V.PC.medicine >= 100) slave.health -= 5;
				else slave.health -= 10;
			}
		}
		if (slave.health > 20 && surgeries.length < 3) {
			if (slave.waist >= -10 && thisSurgery.surgery_cosmetic > 0) {
				surgeries.push("a narrower waist");
				slave.waist -= 20;
				cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave);
				if (V.PC.medicine >= 100) slave.health -= 5;
				else slave.health -= 10;
			} else if (slave.hips < 1 && V.surgeryUpgrade === 1 && (slave.hips < thisSurgery.surgery_hips)) {
				surgeries.push("wider hips");
				slave.hips++;
				slave.hipsImplant++;
				cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave);
				if (V.PC.medicine >= 100) slave.health -= 5;
				else slave.health -= 10;
			} else if (slave.waist >= -95 && V.seeExtreme === 1 && thisSurgery.surgery_cosmetic === 2) {
				surgeries.push("a narrower waist");
				slave.waist = Math.clamp(slave.waist-20, -100, 100);
				cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave);
				if (V.PC.medicine >= 100) slave.health -= 5;
				else slave.health -= 10;
			} else if (slave.hips < 2 && V.surgeryUpgrade === 1 && (slave.hips < thisSurgery.surgery_hips)) {
				surgeries.push("wider hips");
				slave.hips++;
				slave.hipsImplant++;
				cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave);
				if (V.PC.medicine >= 100) slave.health -= 5;
				else slave.health -= 10;
			} else if (slave.hips < 3 && V.surgeryUpgrade === 1 && (slave.hips < thisSurgery.surgery_hips)) {
				surgeries.push("wider hips");
				slave.hips++;
				slave.hipsImplant++;
				cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave);
				if (V.PC.medicine >= 100) slave.health -= 5;
				else slave.health -= 10;
			}
		}
		if (slave.health > 20 && surgeries.length < 3) {
			if (slave.bellyImplant < 0 && V.bellyImplants > 0 && thisSurgery.surgery_bellyImplant === "install" && slave.womb.length === 0 && slave.broodmother === 0) {
				slave.bellyImplant = 100;
				slave.preg = -2;
				cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave);
				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;
				slave.cervixImplant = 0;
				cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave);
			}
		}
	}

	/**
	 * @param {App.Entity.SlaveState} slave
	 * @param {Object} thisSurgery
	 * @param {string[]} surgeries
	 */
	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>`;
	}

	/** @param {App.Entity.SlaveState} slave */
	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;
		}
	}
})();

repo_name: Littlefootlittleguy/fc


code:
/*
 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 = 1) {
	const V = State.variables;
	const slave = V.activeSlave;
	const pronouns = getPronouns(slave);
	const he = pronouns.pronoun;
	//him = pronouns.object,
	const his = pronouns.possessive;
	// hers = pronouns.possessivePronoun,
	// himself = pronouns.objectReflexive,
	// boy = pronouns.noun;
	const He = capFirstChar(he);
	const His = capFirstChar(his);
	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 ${his} first time, you gently ease yourself into ${his} butthole and gradually increase the intensity of your thrusts. Before long ${he}'s moaning loudly as you continue working away at ${his} butthole. `;
			if (slave.tankBaby === 2) {
				r += `${He} thinks of losing ${his} anal virginity to ${his} ${WrittenMaster(slave)} a @@.hotpink;necessity.@@ ${He} expects ${his} asshole to be seeing a lot more attention now.`;
			} else {
				r += `${He} thinks of losing ${his} anal virginity to you as a @@.hotpink;connection@@ with ${his} beloved ${WrittenMaster(slave)}. `;
				if ((slave.fetishKnown && slave.fetish === "buttslut") || (slave.energy > 95) || (slave.attrXX >= 85 && V.PC.dick === 0)) {
					r += `${He} can't wait to be fucked in the ass by you again.`;
				} else {
					r += `${He} looks forward to having ${his} asshole fucked by you again.`;
				}
			}
			slave.devotion += 4;
		} else if (slave.devotion > 20) {
			r += `Since it's ${his} first time, you gently ease yourself into ${his} butthole and gradually increase the intensity of your thrusts. ${His} moans become louder and louder as you continue working away at ${his} butthole. ${He} accepts the pain and humiliation of anal sex as part of ${his} sexual servitude, though ${he} hopes that ${his} next time will be less painful.`;
		} else if (slave.devotion >= -20) {
			r += `You force yourself into ${his} butthole. ${He} sobs and cries with disgust while you continue thrusting into ${his} ass. ${He} @@.gold;fears@@ ${his} next anal sex, remembering the pain of losing ${his} anal virginity. ${He} dreads having ${his} ass violated by you again.`;
			slave.trust -= 5;
		} else {
			r += `You force yourself into ${his} butthole. ${He} sobs and cries with disgust while you continue thrusting into ${his} ass. ${He} @@.mediumorchid;hates@@ and @@.gold;fears@@ you for violating ${his} virgin butt. ${He} dreads having ${his} 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);
		}
		V.analTotal += times;
		slave.counter.anal += 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 = 1) {
	const V = State.variables;
	const slave = V.activeSlave;
	const pronouns = getPronouns(slave);
	const he = pronouns.pronoun;
	const him = pronouns.object;
	const his = pronouns.possessive;
	const hers = pronouns.possessivePronoun;
	const himself = pronouns.objectReflexive;
	const boy = pronouns.noun;
	const He = capFirstChar(he);
	const His = capFirstChar(his);
	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 ${his} pussy, since it's ${his} first time, then gradually speed up your thrusts while ${he} slowly learns to move ${his} hips along with you. ${He} moans loudly. `;
			if (slave.tankBaby === 2) {
				r += `${He} thinks of losing ${his} virginity to ${his} ${WrittenMaster(slave)} a @@.hotpink;necessity to be happy.@@ ${He} expects ${his} pussy to be seeing a lot more attention in the future.`;
			} else {
				r += `@@.hotpink;${He} enjoys losing ${his} cherry to you.@@ `;
				if ((slave.fetishKnown && slave.fetish === "pregnancy") || (slave.energy > 95) || (slave.attrXY >= 85 && V.PC.dick === 1)) {
					r += `${He} can't wait to have ${his} pussy fucked by you again.`;
				} else {
					r += `${He} looks forward to having ${his} pussy fucked by you again.`;
				}
			}
			slave.devotion += 4;
		} else if (slave.devotion > 20) {
			r += `You ease yourself into ${his} pussy, since it's ${his} first time, then gradually speed up your thrusts while ${he} slowly learns to move ${his} hips along with you. ${He} accepts losing ${his} virginity to ${his} owner and ${he} looks forward to having ${his} pussy fucked by you again.`;
		} else if (slave.devotion >= -20) {
			r += `You force yourself into ${his} pussy. ${He} sobs and cries with disgust while you continue thrusting into ${his} fuck hole. ${He} @@.mediumorchid;hates@@ losing ${his} virginity this way and @@.gold;fears@@ the next time you'll conquer ${him}. ${He} dreads getting violated by you again.`;
			slave.trust -= 5;
			slave.devotion -= 5;
		} else {
			r += `You force yourself into ${his} pussy. ${He} sobs and cries with disgust while you continue working ${his} fuck hole. ${He} tries to struggle, but you only pound harder. ${He} @@.mediumorchid;hates@@ and @@.gold;fears@@ you for robbing ${his} of ${his} virginity. ${He} 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);
		}
		V.vaginalTotal += times;
		slave.counter.vaginal += 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 = 1, bothTimes = 1) {
	const V = State.variables;
	const slave = V.activeSlave;
	const pronouns = getPronouns(slave);
	const he = pronouns.pronoun;
	const him = pronouns.object;
	const his = pronouns.possessive;
	const hers = pronouns.possessivePronoun;
	const himself = pronouns.objectReflexive;
	const boy = pronouns.noun;
	const He = capFirstChar(he);
	const His = capFirstChar(his);
	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 ${his} first time, you ease yourself into ${his} pussy before gradually working your way into ${his} ass and alternate between the two holes while ${he} moans. `;
					if (slave.tankBaby === 2) {
						r += `${He} believes you taking ${his} virgin holes @@.hotpink;will keep ${him} from suffering.@@ ${He} expects you to require ${his} holes as tribute again soon.`;
					} else {
						r += `@@.hotpink;${He}'s so devoted ${he} enjoys being fucked in both holes for the first time.@@ ${He} looks forward to having ${his} holes fucked by you again.`;
					}
					slave.devotion += 4;
				} else if (slave.devotion <= 20) {
					r += `You force yourself into ${his} pussy before working your way into ${his} ass. ${He} sobs and cries with disgust while you alternate between the two holes. ${He} @@.mediumorchid;hates@@ losing ${his} virginity and anal virginity in one @@.gold;brutal@@ incident. ${He} dreads having ${his} holes violated by you again.`;
					slave.trust -= 5;
					slave.devotion -= 5;
				} else {
					r += `As it's ${his} first time, you ease yourself into ${his} pussy before gradually working your way into ${his} ass and alternate between the two holes while ${he} moans. ${He} accepts being fucked in both holes for the first time. ${He} looks forward to having ${his} 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 ${his} first time, you ease yourself into ${his} pussy and gradually speed up your thrusts while ${he} slowly learns to move ${his} hips along with you. ${He} moans loudly. `;
					if (slave.tankBaby === 2) {
						r += `${He} thinks of losing ${his} virginity to ${his} ${WrittenMaster(slave)} a @@.hotpink;necessity to be happy.@@ ${He} expects ${his} pussy to be seeing a lot more attention in the future.`;
					} else {
						r += `@@.hotpink;${He} enjoys losing ${his} cherry to you.@@ ${He} looks forward to having ${his} pussy fucked by you again.`;
					}
					slave.devotion += 4;
				} else if (slave.devotion <= 20) {
					r += `You force yourself into ${his} pussy. ${He} sobs and cries with disgust while you continue working ${his} fuck hole. ${He} @@.mediumorchid;hates@@ and @@.gold;fears@@ you for taking ${his} virginity. ${He} dreads having ${his} pussy violated by you again.`;
					slave.trust -= 5;
					slave.devotion -= 5;
				} else {
					r += `As it's ${his} first time, you ease yourself into ${his} pussy before gradually increasing the intensity of your thrusts while ${he} softly moans. ${He} accepts losing ${his} virginity to ${his} owner and ${he} looks forward to having ${his} 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 ${his} first time, you ease yourself into ${his} butthole and gradually speed up your thrusts while ${he} slowly learns to move ${his} hips along with you. ${He} moans loudly. `;
				if (slave.tankBaby === 2) {
					r += `${He} thinks of losing ${his} anal virginity to ${his} ${WrittenMaster(slave)} a @@.hotpink;necessity.@@ ${He} expects ${his} asshole to be seeing a lot more attention now.`;
				} else {
					r += `${He} thinks of losing ${his} anal virginity to you as a @@.hotpink;connection@@ with ${his} beloved ${WrittenMaster(slave)}. ${He} looks forward to having ${his} asshole fucked by you again.`;
				}
				slave.devotion += 4;
			} else if (slave.devotion > 20) {
				r += `As it's ${his} first time, you ease yourself into ${his} butthole and gradually increase the intensity of your thrusts. ${He} accepts the pain and humiliation of anal sex as part of ${his} sexual servitude, though ${he} hopes that ${his} next time will be less painful.`;
			} else if (slave.devotion >= -20) {
				r += `You force yourself into ${his} butthole. ${He} sobs and cries with disgust while you continue thrusting into ${his} ass. ${He} @@.gold;fears@@ ${his} next anal sex, remembering the pain of losing ${his} anal virginity. ${He} dreads having ${his} ass violated by you again.`;
				slave.trust -= 5;
			} else {
				r += `You force yourself into ${his} butthole. ${He} sobs and cries with disgust while you continue thrusting into ${his} ass. ${He} @@.mediumorchid;hates@@ and @@.gold;fears@@ you for violating ${his} virgin butt. ${He} dreads having ${his} ass fucked by you again.`;
				slave.trust -= 5;
				slave.devotion -= 5;
			}
			slave.anus = 1;
		}
		if (canDoAnal(slave)) {
			V.vaginalTotal += bothTimes;
			V.analTotal += bothTimes;
			slave.counter.vaginal += bothTimes;
			slave.counter.anal += bothTimes;
			if (canImpreg(slave, V.PC)) {
				r += knockMeUp(slave, 10, 2, -1, 1);
			}
		} else {
			V.vaginalTotal += bothTimes;
			slave.counter.vaginal += 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 ${his} first time, you ease yourself into ${his} butthole and gradually speed up your thrusts while ${he} slowly learns to move ${his} hips along with you. ${He} moans loudly. `;
				if (slave.tankBaby === 2) {
					r += `${He} thinks of losing ${his} anal virginity to ${his} ${WrittenMaster(slave)} a @@.hotpink;necessity.@@ ${He} expects ${his} asshole to be seeing a lot more attention now.`;
				} else {
					r += `${He} thinks of losing ${his} anal virginity to you as a @@.hotpink;connection@@ with ${his} beloved ${WrittenMaster(slave)}. ${He} looks forward to having ${his} asshole fucked by you again.`;
				}
				slave.devotion += 4;
			} else if (slave.devotion > 20) {
				r += `As it's ${his} first time, you ease yourself into ${his} butthole and gradually increase the intensity of your thrusts. ${He} accepts the pain and humiliation of anal sex as part of ${his} sexual servitude, though ${he} hopes that ${his} next time will be less painful.`;
			} else if (slave.devotion >= -20) {
				r += `You force yourself into ${his} butthole. ${He} sobs and cries with disgust while you continue thrusting into ${his} ass. ${He} @@.gold;fears@@ ${his} next anal sex, remembering the pain of losing ${his} anal virginity. ${He} dreads having ${his} ass violated by you again.`;
				slave.trust -= 5;
			} else {
				r += `You force yourself into ${his} butthole. ${He} sobs and cries with disgust while you continue thrusting into ${his} ass. ${He} @@.mediumorchid;hates@@ and @@.gold;fears@@ you for violating ${his} virgin butt. ${He} dreads having ${his} ass fucked by you again.`;
				slave.trust -= 5;
				slave.devotion -= 5;
			}
			slave.anus = 1;
		}
		V.analTotal += analTimes;
		slave.counter.anal += 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 = 1, bothTimes = 1) {
	const V = State.variables;
	const partner = V.slaves[V.partner];
	const pronouns = getPronouns(partner);
	const he = pronouns.pronoun;
	const him = pronouns.object;
	const his = pronouns.possessive;
	const hers = pronouns.possessivePronoun;
	const himself = pronouns.objectReflexive;
	const boy = pronouns.noun;
	const He = capFirstChar(he);
	const His = capFirstChar(his);
	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 ${his} pussy before gradually working your way into ${his} butthole, alternating between ${his} 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 ${his} 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 ${his} butthole before gradually increasing the intensity of your thrusts into ${his} ass. @@.lime;This breaks in ${partner.slaveName}'s virgin ass.@@ `;
			partner.anus = 1;
		}

		if (canDoAnal(partner)) {
			V.vaginalTotal += bothTimes;
			V.analTotal += bothTimes;
			partner.counter.vaginal += bothTimes;
			partner.counter.anal += bothTimes;
			if (canImpreg(partner, V.PC)) {
				r += knockMeUp(partner, 10, 2, -1);
			}
		} else {
			V.vaginalTotal += bothTimes;
			partner.counter.vaginal += 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 ${his} butthole before gradually increasing the intensity of your thrusts into ${his} ass. @@.lime;This breaks in ${partner.slaveName}'s virgin ass.@@ `;
			partner.anus = 1;
		}
		V.analTotal += analTimes;
		partner.counter.anal += 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".
 @param {App.Entity.SlaveState} slave */
window.SimpleSexAct = function SimpleSexAct(slave, fuckCount = 1) {
	const V = State.variables;
	let fuckTarget = 0;
	let r = "";

	for (let i = 0; i < fuckCount; i++) {
		fuckTarget = jsRandom(1, 100);
		if (slave.nipples === "fuckable" && V.PC.dick === 1 && fuckTarget > 80) {
			V.mammaryTotal += 1;
			slave.counter.mammary += 1;
		} else if (canDoVaginal(slave) && slave.vagina > 0 && fuckTarget > 33) {
			V.vaginalTotal += 1;
			slave.counter.vaginal += 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.counter.anal += 1;
			if (canImpreg(slave, V.PC)) {
				r += knockMeUp(slave, 10, 1, -1, 1);
			}
		} else {
			V.oralTotal += 1;
			slave.counter.oral += 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.
 @param {App.Entity.SlaveState} slave
*/
window.SimpleSlaveFucking = function SimpleSlaveFucking(slave, fuckCount = 1) {
	const V = State.variables;
	let fuckTarget = 0;

	for (let i = 0; i < fuckCount; i++) {
		fuckTarget = jsRandom(1, 100);
		if (slave.nipples === "fuckable" && fuckTarget > 80) {
			V.mammaryTotal += 1;
			slave.counter.mammary += 1;
		} else if (canDoVaginal(slave) && slave.vagina > 0 && fuckTarget > 33) {
			V.vaginalTotal += 1;
			slave.counter.vaginal += 1;
		} else if (canDoAnal(slave) && slave.anus > 0 && fuckTarget > 10) {
			V.analTotal += 1;
			slave.counter.anal += 1;
		} else {
			V.oralTotal += 1;
			slave.counter.oral += 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".
 @param {App.Entity.SlaveState} subslave
 @param {App.Entity.SlaveState} domslave
*/
window.SimpleSlaveSlaveFucking = function SimpleSlaveSlaveFucking(subslave, domslave, fuckCount = 1) {
	const V = State.variables;
	let fuckTarget = 0;
	let r = "";

	for (let 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].counter.mammary++;
					V.mammaryTotal++;
					domslave.counter.penetrative++;
					V.penetrativeTotal++;
				} else {
					subslave.counter.mammary++;
					V.mammaryTotal++;
					V.slaves[V.i].counter.penetrative++;
					V.penetrativeTotal++;
				}
			} else {
				V.mammaryTotal++;
				V.penetrativeTotal++;
				subslave.counter.mammary++;
				domslave.counter.penetrative++;
			}
		} 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].counter.vaginal++;
					V.vaginalTotal++;
					V.penetrativeTotal++;
					domslave.counter.penetrative++;
				} else {
					V.slaves[V.i].counter.penetrative++;
					V.penetrativeTotal++;
					subslave.counter.vaginal++;
					V.vaginalTotal++;
				}
			} else {
				V.vaginalTotal++;
				subslave.counter.vaginal++;
				V.penetrativeTotal++;
				domslave.counter.penetrative++;
			}
			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].counter.anal++;
					V.analTotal++;
					V.penetrativeTotal++;
					domslave.counter.penetrative++;
				} else {
					V.slaves[V.i].counter.penetrative++;
					V.penetrativeTotal++;
					V.analTotal++;
					subslave.counter.anal++;
				}
			} else {
				V.analTotal++;
				subslave.counter.anal++;
				V.penetrativeTotal++;
				domslave.counter.penetrative++;
			}
		} else {
			V.oralTotal++;
			subslave.counter.oral++;
		}
	}
	return r;
};

/** @param {App.Entity.SlaveState} slave */
window.SimpleVaginaFuck = function SimpleVaginaFuck(slave, count = 1) {
	State.variables.vaginalTotal += count;
	slave.counter.vaginal += count;
};

/** @param {App.Entity.SlaveState} slave */
window.SimpleAssFuck = function SimpleAssFuck(slave, count = 1) {
	State.variables.analTotal += count;
	slave.counter.anal += count;
};