code:
App.Medicine.Surgery.Reactions.Fertility = class extends App.Medicine.Surgery.SimpleReaction {
	reaction(slave, diff) {
		const reaction = super.reaction(slave, diff);
		const {He, he, his, him} = getPronouns(slave);
		const r = [];

		if (slave.fetish === "mindbroken") {
			r.push(`${He} leaves the surgery with nothing but a nonspecific ache in ${his} lower abdomen, but lacks the mental faculties to realize that ${he} now has a chance to get pregnant. As with all surgery ${his} health has been slightly affected.`);
		} else if (this._strongKnownFetish(slave, "pregnancy") || slave.origin === "$He sold $himself to you in the hope of someday bearing children.") {
			r.push(`${He} leaves the surgery with nothing but a nonspecific ache in ${his} lower abdomen, but ${he} knows enough about surgery and sex slaves to know that it means ${he} now has a chance to get pregnant. ${He} is filled with joy whenever ${he} thinks about the fact that feeling a life growing within ${him} is now, at last, a possibility. ${He}'s so pleased that ${he} now trusts your plans for ${his} body. As with all surgery ${his} health has been slightly affected.`);
			reaction.trust += 4;
			reaction.devotion += 5;
		} else if (slave.devotion > 50) {
			r.push(`${He} leaves the surgery with nothing but a nonspecific ache in ${his} lower abdomen, but ${he} knows enough about surgery and sex slaves to know that it means ${he} now has a chance to get pregnant. ${He}'s grateful that you think ${him} worthy of breeding, and even a little nervous about how ${he}'ll perform as a breeder. As with all surgery ${his} health has been slightly affected.`);
			reaction.devotion += 4;
		} else if (slave.devotion >= -20) {
			r.push(`${He} leaves the surgery with nothing but a nonspecific ache in ${his} lower abdomen, but ${he} knows enough about surgery and sex slaves to know that it means ${he} may now be impregnated. ${He} understands the realities of ${his} life as a slave, and that being bred was a possibility, so it isn't much of a shock. As with all surgery ${his} health has been slightly affected. ${He} is sensibly fearful of your total power over ${his} body.`);
			reaction.trust -= 5;
		} else {
			r.push(`${He} leaves the surgery with nothing but a nonspecific ache in ${his} lower abdomen, but ${he} knows enough about surgery and sex slaves to know that it means ${he} may now be impregnated. ${He} does not understand the realities of ${his} life as a slave at a core level, so ${he}'s terrified and angry at the potential that ${he}'ll be bred. As with all surgery ${his} health has been slightly affected. ${He} is sensibly fearful of your total power over ${his} body.`);
			reaction.trust -= 5;
			reaction.devotion -= 5;
		}

		reaction.longReaction.push(r);
		return reaction;
	}
};

App.Medicine.Surgery.Procedures.RestoreFertility = class extends App.Medicine.Surgery.Procedure {
	get name() {
		return "Restore fertility";
	}

	get healthCost() {
		return 10;
	}

	apply(cheat) {
		this._slave.preg = 0;
		return this._assemble(new App.Medicine.Surgery.Reactions.Fertility());
	}
};


code:
App.Medicine.Surgery.Reactions.ForeskinTuck = class extends App.Medicine.Surgery.SimpleReaction {
	reaction(slave, diff) {
		const reaction = super.reaction(slave, diff);
		const {He, he, his, himself} = getPronouns(slave);
		const r = [];

		if (slave.fetish === "mindbroken") {
			r.push(`${He} exits the surgery gingerly, since ${he} can feel that something was done to ${his} dick. Since it is still there, ${he} doesn't understand what changed. ${his} health has been slightly affected.`);
		} else if (slave.devotion > 50) {
			r.push(`${He} exits the surgery gingerly, since ${he} can feel that something was done to ${his} dick. ${He} examines it carefully`);
			if (canSee(slave)) {
				r.push(`in the mirror.`);
			} else {
				r.push(`by feeling alone.`);
			}
			r.push(`Realizing that ${his} foreskin fits comfortably, ${he}'s very happy you'd take an interest in ${his} penis, and looks forward to having a slightly easier time keeping ${himself} clean through ${his} life as a sex slave.`);
			if (canAchieveErection(slave)) {
				r.push(`${He} also can't wait`);
				if (canSee(slave)) {
					r.push(`for the show during`);
				} else {
					r.push(`to feel`);
				}
				r.push(`${his} next erection.`);
			}
			r.push(`<span class="health dec">${his} health has been slightly affected.</span>`);
			reaction.devotion += 4;
		} else if (slave.devotion > 20) {
			r.push(`${He} exits the surgery gingerly, since ${he} can feel that something was done to ${his} dick. ${He} examines it carefully`);
			if (canSee(slave)) {
				r.push(`in the mirror.`);
			} else {
				r.push(`by feeling alone.`);
			}
			r.push(`Realizing that ${his} foreskin fits comfortably, ${he}'s flooded with relief. ${He}'s so elated that ${he} hasn't been severely damaged that ${he} doesn't mind your taking surgical control of ${his} member. ${his} health has been slightly affected.`);
		} else {
			r.push(`${He} exits the surgery gingerly, since ${he} can feel that something was done to ${his} dick. ${He} examines it carefully`);
			if (canSee(slave)) {
				r.push(`in the mirror.`);
			} else {
				r.push(`by feeling alone.`);
			}
			r.push(`Realizing that ${his} foreskin fits comfortably, ${he}'s flooded with relief, since ${he} was afraid that you'd done something far more terrible. Once ${he} has time to think about it, though, ${he}'s somewhat resentful, since ${he} naturally feels a certain proprietary interest in ${his} own penis. ${his} health has been slightly affected.`);
			reaction.devotion -= 5;
		}

		reaction.longReaction.push(r);
		return reaction;
	}
};

App.Medicine.Surgery.Procedures.ForeskinTuck = class extends App.Medicine.Surgery.Procedure {
	get name() {
		return "Remove excess foreskin";
	}

	get healthCost() {
		return 5;
	}

	apply(cheat) {
		this._slave.foreskin = this._slave.dick;
		return this._assemble(new App.Medicine.Surgery.Reactions.ForeskinTuck());
	}
};

license: mit


code:
App.Medicine.Surgery.Reactions.Geld = class extends App.Medicine.Surgery.SimpleReaction {
	reaction(slave, diff) {
		const reaction = super.reaction(slave, diff);
		const {He, he, His, his, him} = getPronouns(slave);
		const r = [];

		if (slave.fetish === "mindbroken") {
			r.push(`Surprisingly, ${he} already realized while exiting that ${his} scrotum was gone. The reasons why are lost to ${him}, though. Since the surgery was invasive, ${his} health has been greatly affected.`);
		} else if (slave.devotion > 50) {
			r.push(`Of course, ${he} already realized while exiting that ${his} scrotum was gone. ${He} was already accepting of ${his} role as an effectively female slave, a receptacle for cock, and ${he} now understands that you no longer think it will ever again be necessary for ${him} to cum. ${He} has become more submissive due to your radical reshaping of ${his} body. Since the surgery was invasive, ${his} health has been greatly affected.`);
			reaction.devotion += 4;
		} else if (slave.devotion > 20) {
			r.push(`Of course, ${he} already realized while exiting that ${his} scrotum was gone. ${He} was already struggling to accept ${his} role as a female slave, a receptacle for cock, and ${he} now understands it better. ${He} has not yet accepted that ${he} will never again fuck, though, that ${his} future is nothing but getting fucked. ${He} will struggle with feelings of confusion and loss. Since the surgery was invasive, ${his} health has been greatly affected. ${He} is terribly afraid of your total power over ${his} body.`);
			reaction.trust -= 10;
			reaction.devotion -= 5;
		} else {
			r.push(`Of course, ${he} already realized while exiting that ${his} scrotum was gone. ${He} cannot accept that it is no longer ${his} role to fuck holes, but rather to provide a hole for others to fuck.`);
			if (hasAnyArms(slave)) {
				r.push(`${He} absently moves a hand to where ${his} balls would have been and snatches it away with a sob.`);
			}
			r.push(`The surgical invasion has filled ${him} with horror and anger. Since the surgery was invasive, ${his} health has been greatly affected. ${He} is cripplingly afraid of your total power over ${his} body.`);
			reaction.trust -= 20;
			reaction.devotion -= 20;
		}
		if ((slave.assignment === Job.MILKED || slave.assignment === Job.DAIRY) && slave.lactation === 0) {
			r.push(`<span class="job change">${His} assignment has defaulted to rest.</span>`);
			reaction.shortReaction.push(`<span class="job change">${His} assignment has defaulted to rest.</span>`);
			removeJob(slave, slave.assignment);
		}

		reaction.longReaction.push(r);
		return reaction;
	}
};

App.Medicine.Surgery.Procedures.Geld = class extends App.Medicine.Surgery.Procedure {
	get name() {
		return "Geld";
	}

	get healthCost() {
		return 40;
	}

	apply(cheat) {
		this._slave.balls = 0;
		this._slave.ballType = "human";
		this._slave.scrotum = 0;
		this._slave.vasectomy = 0;
		if (this._slave.drugs === "testicle enhancement" ||
			this._slave.drugs === "hyper testicle enhancement" ||
			this._slave.drugs === "testicle atrophiers") {
			this._slave.drugs = "no drugs";
		}
		return this._assemble(new App.Medicine.Surgery.Reactions.Geld());
	}
};


code:
App.Medicine.Surgery.Reactions.Herm = class extends App.Medicine.Surgery.SimpleReaction {
	reaction(slave, diff) {
		const reaction = super.reaction(slave, diff);
		const {He, he, His, his, him, himself} = getPronouns(slave);
		const {he: heP} = getPronouns(V.PC);
		const r = [];

		if (slave.fetish === "mindbroken") {
			r.push(`Surprisingly, ${he} already realized while exiting that ${his} genitalia has been heavily augmented. The reasons why are lost to ${him}, though. Since the surgery was invasive, ${his} health has been greatly affected.`);
		} else if (slave.devotion > 50) {
			r.push(`${He} already realized while exiting that ${his} genitalia has been heavily augmented. ${He}'s almost beside ${himself} with joy: ${he} now has three holes for ${his} beloved ${getWrittenTitle(slave)} to fuck, and ${heP} even allowed ${him} to retain ${his} dick! ${He} has become more submissive due to your radical reshaping of ${his} body. Since the surgery was invasive, ${his} health has been greatly affected.`);
			reaction.devotion += 10;
		} else if (slave.devotion > 20) {
			r.push(`${He} already realized while exiting that ${his} genitalia has been heavily augmented. ${His} efforts to cope with this radical development are palpable. ${He} retains ${his} penis, to ${his} considerable surprise; and ${he} also has a pussy. ${He} hardly knows what to think or who to be. ${He} has become more submissive due to your radical reshaping of ${his} body. Since the surgery was invasive, ${his} health has been greatly affected.`);
			reaction.devotion += 4;
		} else {
			r.push(`${He} already realized while exiting that ${his} genitalia has been heavily augmented. The surgical invasion has filled ${him} with horror and anger. ${He} is not as angry as ${he} might otherwise have been, since you left ${him} ${his} dick, but ${he} has a hole where there was none before. ${He} views it with hatred and revulsion. Since the surgery was invasive, ${his} health has been greatly affected. ${He} is terribly afraid of your total power over ${his} body.`);
			reaction.trust -= 10;
			reaction.devotion -= 10;
		}

		reaction.longReaction.push(r);
		return reaction;
	}
};

App.Medicine.Surgery.Procedures.Herm = class extends App.Medicine.Surgery.Procedure {
	get name() {
		return "Create surgical hermaphrodite";
	}

	get healthCost() {
		return 40;
	}

	apply(cheat) {
		this._slave.vagina = 0;
		this._slave.skill.vaginal = 0;
		return this._assemble(new App.Medicine.Surgery.Reactions.Herm());
	}
};


code:
App.Medicine.Surgery.Reactions.Insemination = class extends App.Medicine.Surgery.SimpleReaction {
	/**
	 * @param {App.Entity.SlaveState} seedSource
	 */
	constructor(seedSource) {
		super();
		this.seedSource = seedSource;
	}

	get invasive() {
		return false;
	}

	get permanentChanges() {
		return false;
	}

	reaction(slave, diff) {
		const reaction = super.reaction(slave, diff);
		const {He, he, his, him} = getPronouns(slave);
		const r = [];

		if (slave.fetish === "mindbroken") {
			r.push(`${He} leaves the surgery with a certain warmth in ${his} lower abdomen, ${he} knows that ${he} has been impregnated.`);
		} else if (this._strongKnownFetish(slave, "pregnancy")) {
			if (canSee(slave)) {
				r.push(`Since the surgery required only a local anesthetic, ${he} remained fully aware throughout the procedure. From the selection of the sperm, to its introduction to ${his} waiting ${(slave.pregType > 1) ? `eggs` : `egg`}, ${he} was eagerly watching.`);
			} else {
				r.push(`${He} leaves the surgery with a certain warmth in ${his} lower abdomen, ${he} knows that ${he} has been impregnated.`);
			}
			r.push(`${He} is filled with joy over the life settling into ${his} womb and can't wait to see the result. ${He}'s so pleased that ${he} now trusts your plans for ${his} body.`);
			reaction.trust += 4;
			reaction.devotion += 10;
		} else if (slave.devotion > 50) {
			if (canSee(slave)) {
				r.push(`Since the surgery required only a local anesthetic, ${he} remained fully aware throughout the procedure. From the selection of the sperm, to its delivery into ${his} womb, ${he} was watching with rapt attention.`);
			} else {
				r.push(`${He} leaves the surgery with a certain warmth in ${his} lower abdomen, ${he} knows that ${he} has been impregnated.`);
			}
			r.push(`${He}'s <span class="devotion inc">grateful</span> that you think ${him} worthy of carrying`);
			if (slave.pregSource === -1) {
				r.push(`your`);
			} else {
				r.push(`${this.seedSource.slaveName}'s`);
			}
			r.push(`${(slave.pregType > 1) ? `children` : `child`}, and a little nervous about how ${he}'ll perform as a mother.`);
			reaction.devotion += 4;
		} else if (slave.devotion >= -20) {
			if (canSee(slave)) {
				r.push(`Since the surgery required only a local anesthetic, ${he} remained fully aware throughout the procedure. From the selection of the sperm, to its delivery into ${his} womb and ${his} subsequent impregnation, ${he} couldn't look away.`);
			} else {
				r.push(`${He} leaves the surgery with a certain warmth in ${his} lower abdomen, ${he} knows that ${he} has been impregnated.`);
			}
			r.push(`${He} understands the realities of ${his} life as a slave, so it isn't much of a shock. ${He} is <span class="trust dec">sensibly fearful</span> of your total power over ${his} body.`);
			reaction.trust -= 10;
		} else {
			if (canSee(slave)) {
				r.push(`Since the surgery required only a local anesthetic, ${he} remained fully aware throughout the procedure. The moment ${he} realized what was happening, ${he} shut ${his} eyes tight, only opening them again as ${he} feels the slight tingle of the injector exiting ${his} lower abdomen.`);
			} else {
				r.push(`${He} leaves the surgery with a certain warmth in ${his} lower abdomen, ${he} knows that ${he} has been impregnated.`);
			}
			r.push(`${He} does not understand the realities of ${his} life as a slave at a core level, so ${he}'s terrified and angry that you have forced ${him} to become a mother, even more so as ${he} realizes ${he} doesn't know who the father is. ${He} is sensibly fearful of your total power over ${his} body and the future of the life ${he} now harbors within ${him}.`);
			reaction.trust -= 15;
			reaction.devotion -= 15;
		}

		reaction.longReaction.push(r);
		return reaction;
	}
};

App.Medicine.Surgery.Procedures.Insemination = class extends App.Medicine.Surgery.Procedure {
	/**
	 * @param {App.Entity.SlaveState} slave
	 * @param {string} name
	 * @param {App.Entity.SlaveState} seedSource
	 */
	constructor(slave, name, seedSource) {
		super(slave);
		this._name = name;
		this.seedSource = seedSource;
	}

	get name() {
		return this._name;
	}

	apply(cheat) {
		this._slave.preg = 1;
		this._slave.pregType = setPregType(this._slave);
		this._slave.pregWeek = 1;
		this._slave.pregKnown = 1;
		this._slave.pregSource = this.seedSource.ID;
		WombImpregnate(this._slave, this._slave.pregType, this._slave.pregSource, 1);
		return this._assemble(new App.Medicine.Surgery.Reactions.Insemination(this.seedSource));
	}
};

App.Medicine.Surgery.Procedures.InseminationFromStored = class extends App.Medicine.Surgery.Procedures.Insemination {
	apply(cheat) {
		V.PC.counter.storedCum--;
		return super.apply(cheat);
	}
};


code:
App.Medicine.Surgery.Reactions.Labiaplasty = class extends App.Medicine.Surgery.SimpleReaction {
	reaction(slave, diff) {
		const reaction = super.reaction(slave, diff);
		const {He, he, his} = getPronouns(slave);
		const r = [];

		if (slave.fetish === "mindbroken") {
			r.push(`${He} leaves the surgery with a terribly sore pussy and little desire to mess with it. As with all surgery <span class="health dec">${his} health has been slightly affected.</span>`);
		} else if (slave.energy > 95) {
			r.push(`${He} leaves the surgery with a terribly sore pussy. ${He} is filled with joy at the thought that ${his} pussy will now be more appealing to ${his} ${getWrittenTitle(slave)}; ${he}'s already anticipating recovering enough to feel your cockhead pressing past ${his} new lips, so much so that ${he} now trusts your plans for ${his} body. As with all surgery ${his} health has been slightly affected.`);
			reaction.trust += 4;
			reaction.devotion += 10;
		} else if (slave.devotion > 50) {
			r.push(`${He} leaves the surgery with a terribly sore pussy. ${He}'s happy that you think ${his} pussy worth the effort of surgical improvement, and a little excited at the idea that ${he} now has what you consider good-looking pussylips. As with all surgery ${his} health has been slightly affected.`);
			reaction.devotion += 4;
		} else if (slave.devotion >= -20) {
			r.push(`${He} leaves the surgery with a terribly sore pussy. ${He}'s somewhat revolted by the surgery, but as far as ${he}'s concerned, the short recovery period will mean a time during which ${he} can be sure no one will use ${his} pussy. As with all surgery ${his} health has been slightly affected. ${He} is sensibly fearful of your total power over ${his} body.`);
			reaction.trust -= 5;
		} else {
			r.push(`${He} leaves the surgery with a terribly sore pussy. ${He}'s horrified at surgical alteration of ${his} womanhood; this is probably more of an invasion than ${he} could readily imagine before today. As with all surgery ${his} health has been slightly affected. ${He} is terribly afraid of your total power over ${his} most intimate parts.`);
			reaction.trust -= 10;
			reaction.devotion -= 5;
		}

		reaction.longReaction.push(r);
		return reaction;
	}
};

App.Medicine.Surgery.Procedures.Labiaplasty = class extends App.Medicine.Surgery.Procedure {
	get name() {
		return "Apply labiaplasty";
	}

	get healthCost() {
		return 10;
	}

	apply(cheat) {
		this._slave.labia = 0;
		return this._assemble(new App.Medicine.Surgery.Reactions.Labiaplasty());
	}
};

App.Medicine.Surgery.Procedures.IncreaseLabia = class extends App.Medicine.Surgery.Procedure {
	get name() {
		return "Increase labia";
	}

	get healthCost() {
		return 10;
	}

	apply(cheat) {
		this._slave.labia +=1;
		return this._assemble(new App.Medicine.Surgery.Reactions.Labiaplasty());
	}
};


code:
App.Medicine.Surgery.Reactions.MaletoFemale = class extends App.Medicine.Surgery.SimpleReaction {
	reaction(slave, diff) {
		const reaction = super.reaction(slave, diff);
		const {He, he, His, his, him, himself} = getPronouns(slave);
		const r = [];

		if (slave.fetish === "mindbroken") {
			r.push(`Surprisingly, ${he} already realized while exiting that ${his} genitalia was completely reshaped. The reasons why are lost to ${him}, though. Since the surgery was invasive, ${his} health has been greatly affected.`);
		} else if (slave.devotion > 50) {
			r.push(`Of course, ${he} already realized while exiting that ${his} genitalia was completely reshaped. As a shemale slave ${he} knew this day might come, and ${his} face is a strange mix of hope, happiness, satisfaction, and the tiniest tinge of soul-crushing sadness as ${he}`);
			if (canSee(slave)) {
				r.push(`views`);
			} else {
				r.push(`feels`);
			}
			r.push(`the vagina that has replaced ${his} penis. ${He} has become more submissive due to your radical reshaping of ${his} body. Since the surgery was invasive, ${his} health has been greatly affected.`);
			reaction.devotion += 4;
		} else if (slave.devotion > 20) {
			r.push(`Of course, ${he} already realized while exiting that ${his} genitalia was completely reshaped. As a shemale slave ${he} knew this day might come, and ${his} face is a strange mix of fear, hope, and resignation as ${he}`);
			if (canSee(slave)) {
				r.push(`views`);
			} else {
				r.push(`feels`);
			}
			r.push(`the vagina that has replaced ${his} penis. Eventually ${his} shoulders slump and ${he} tries to carry on. ${He} will struggle with feelings of confusion and loss. Since the surgery was invasive, ${his} health has been greatly affected. ${He} is terribly afraid of your total power over ${his} body.`);
			reaction.trust -= 10;
			reaction.devotion -= 5;
		} else {
			r.push(`Of course, ${he} already realized while exiting that ${his} genitalia was completely reshaped. As a shemale slave ${he} knew this day might come, but expectations and the reality are two different things. ${He}'s beside ${himself}, weeping gently. ${He} absently moves a hand to where ${his} penis would have been and snatches it away with a sob. The surgical invasion has filled ${him} with horror and anger. Since the surgery was invasive, ${his} health has been greatly affected. ${He} is cripplingly afraid of your total power over ${his} body.`);
			reaction.trust -= 20;
			reaction.devotion -= 20;
		}
		if ((slave.assignment === Job.MILKED || slave.assignment === Job.DAIRY) && slave.lactation === 0) {
			r.push(`<span class="job change">${His} assignment has defaulted to rest.</span>`);
			reaction.shortReaction.push(`<span class="job change">${His} assignment has defaulted to rest.</span>`);
			removeJob(slave, slave.assignment);
		}

		reaction.longReaction.push(r);
		return reaction;
	}
};

App.Medicine.Surgery.Procedures.MaletoFemale = class extends App.Medicine.Surgery.Procedure {
	get name() {
		return "Convert genitalia to female";
	}

	get healthCost() {
		return 40;
	}

	apply(cheat) {
		surgeryAmp(this._slave, "dick");
		this._slave.scrotum = 0;
		this._slave.balls = 0;
		this._slave.ballType = "human";
		this._slave.vasectomy = 0;
		this._slave.vagina = 0;
		this._slave.preg = -2;
		if (this._slave.drugs === "testicle enhancement" ||
			this._slave.drugs === "hyper testicle enhancement" ||
			this._slave.drugs === "testicle atrophiers") {
			this._slave.drugs = "no drugs";
		}
		return this._assemble(new App.Medicine.Surgery.Reactions.MaletoFemale());
	}
};


code:
App.Medicine.Surgery.Reactions.MPregRemoved = class extends App.Medicine.Surgery.SimpleReaction {
	reaction(slave, diff) {
		const reaction = super.reaction(slave, diff);
		const {He, his} = getPronouns(slave);
		const r = [];

		r.push(`${He} notices quickly that ${his} stomach is slightly flatter than before. ${He} ponders this change for a moment, unsure of what to think of this occurrence. As with all surgery ${his} health has been slightly affected.`);

		reaction.longReaction.push(r);
		return reaction;
	}
};

App.Medicine.Surgery.Procedures.RemoveMPreg = class extends App.Medicine.Surgery.Procedure {
	get name() {
		return "Remove anal reproductive organs";
	}

	get healthCost() {
		return 30;
	}

	apply(cheat) {
		this._slave.mpreg = 0;
		this._slave.ovaImplant = 0;
		this._slave.wombImplant = "none";
		return this._assemble(new App.Medicine.Surgery.Reactions.MPregRemoved());
	}
};


code:
App.Medicine.Surgery.Reactions.NoneToFemale = class extends App.Medicine.Surgery.SimpleReaction {
	reaction(slave, diff) {
		const reaction = super.reaction(slave, diff);
		const {He, he, his, him, himself, hers} = getPronouns(slave);
		const r = [];

		if (slave.fetish === "mindbroken") {
			r.push(`Surprisingly, ${he} already realized while exiting that ${his} genitalia was completely reshaped. The reasons why are lost to ${him}, though. Since the surgery was invasive, ${his} health has been greatly affected.`);
		} else if (slave.devotion > 50) {
			r.push(`Of course, ${he} already realized while exiting that ${his} genitalia was completely reshaped. ${He} can only be happy that ${he}`);
			if (slave.genes === "XX") {
				r.push(`once again has a vagina and now has a means of release again.`);
			} else {
				r.push(`now has a hole other than ${his} anus to pleasure ${himself} with.`);
			}
			r.push(`${He} has become more submissive due to your radical reshaping of ${his} body. Since the surgery was invasive, ${his} health has been greatly affected.`);
			reaction.devotion += 4;
		} else if (slave.devotion > 20) {
			r.push(`Of course, ${he} already realized while exiting that ${his} genitalia was completely reshaped. ${He} didn't expect`);
			if (slave.genes === "XX") {
				r.push(`to ever have a pussy again,`);
			} else {
				r.push(`to be given a hole other than ${his} anus,`);
			}
			r.push(`and ${his} face is a strange mix of fear, hope, and resignation as ${he}`);
			if (canSee(slave)) {
				r.push(`views`);
			} else {
				r.push(`feels`);
			}
			r.push(`the vagina that now adorns ${his} formerly featureless crotch. Eventually ${his} shoulders slump and ${he} tries to carry on knowing that this is just another hole for your amusement, not ${hers}. ${He} will struggle with feelings of confusion over just what your plans for ${him} are. Since the surgery was invasive, ${his} health has been greatly affected. ${He} is terribly afraid of your total power over ${his} body.`);
			reaction.trust -= 10;
			reaction.devotion -= 5;
		} else {
			r.push(`Of course, ${he} already realized while exiting that ${his} genitalia was completely reshaped. ${He} didn't expect`);
			if (slave.genes === "XX") {
				r.push(`to ever have a pussy again,`);
			} else {
				r.push(`to be given a hole other than ${his} anus,`);
			}
			r.push(`but expectations and the reality are two different things. ${He}'s beside ${himself}, weeping gently. ${He} absently moves a hand to where there used to be nothing and snatches it away with a sob, knowing this was done for yourself, not ${him}. The surgical invasion has filled ${him} with horror and anger. Since the surgery was invasive, ${his} health has been greatly affected. ${He} is cripplingly afraid of your total power over ${his} body.`);
			reaction.trust -= 20;
			reaction.devotion -= 20;
		}

		reaction.longReaction.push(r);
		return reaction;
	}
};

App.Medicine.Surgery.Procedures.NoneToFemale = class extends App.Medicine.Surgery.Procedure {
	get name() {
		return "Create a vagina";
	}

	get healthCost() {
		return 40;
	}

	apply(cheat) {
		this._slave.vagina = 0;
		this._slave.skill.vaginal = 0;
		return this._assemble(new App.Medicine.Surgery.Reactions.NoneToFemale());
	}
};


code:
App.Medicine.Surgery.Reactions.OvaImplantChanged = class extends App.Medicine.Surgery.SimpleReaction {
	reaction(slave, diff) {
		const reaction = super.reaction(slave, diff);
		const {He, he, his, him} = getPronouns(slave);
		const r = [];

		r.push(`It's not immediately apparent to ${him} what kind of surgery ${he} received, since all ${he}'s left with is a terrible nonspecific ache in ${his} lower abdomen.`);
		if (slave.devotion > 50) {
			r.push(`${He}'s <span class="devotion inc">grateful</span> that you think ${him} worthy of surgically modifying. As with all surgery <span class="health dec">${his} health has been slightly affected.</span>`);
			reaction.devotion += 4;
		} else if (slave.devotion >= -20) {
			r.push(`${He} understands the realities of ${his} life as a slave, but didn't expect to undergo a mysterious procedure like this. As with all surgery ${his} health has been slightly affected. ${He} is sensibly fearful of your total power over ${his} body.`);
			reaction.trust -= 5;
		} else {
			r.push(`${He} does not understand the realities of ${his} life as a slave at a core level, so ${he}'s terrified and angry at what you could have possibly done to ${him}. As with all surgery ${his} health has been slightly affected. ${He} is sensibly fearful of your total power over ${his} body.`);
			reaction.trust -= 5;
			reaction.devotion -= 5;
		}

		reaction.longReaction.push(r);
		return reaction;
	}
};

App.Medicine.Surgery.Procedures.RemoveOvaImplant = class extends App.Medicine.Surgery.Procedure {
	get name() {
		return "Remove implants";
	}

	get healthCost() {
		return 10;
	}

	apply(cheat) {
		this._slave.ovaImplant = 0;
		return this._assemble(new App.Medicine.Surgery.Reactions.OvaImplantChanged());
	}
};

App.Medicine.Surgery.Procedures.InstallOvaImplant = class extends App.Medicine.Surgery.Procedure {
	/**
	 * @param {App.Entity.SlaveState} slave
	 * @param {FC.OvaryImplantType} type
	 */
	constructor(slave, type) {
		super(slave);
		this.type = type;
	}

	get name() {
		switch (this.type) {
			case "fertility":
				return "Install fertility implants";
			case "sympathy":
				return "Install sympathetic ovulation implants";
			default:
				throw new Error("Invalid OvaryImplantType: " + this.type);
		}
	}

	get healthCost() {
		return 10;
	}

	apply(cheat) {
		this._slave.ovaImplant = this.type;
		return this._assemble(new App.Medicine.Surgery.Reactions.OvaImplantChanged());
	}
};


code:
App.Medicine.Surgery.Reactions.Precum = class extends App.Medicine.Surgery.SimpleReaction {
	reaction(slave, diff) {
		const reaction = super.reaction(slave, diff);
		const {He, he, His, his, him, himself} = getPronouns(slave);
		const r = [];

		r.push(`${His} groin is a little sore, and ${he} examines it closely, but ${he} can't find much difference. Near the end of ${his} close inspection of ${his} own private parts, though, ${he} happens to stimulate ${himself}, unintentionally, and just a little. That's enough. ${He} begins to leak precum, and it doesn't stop until ${his} confusion snuffs out the slight arousal that got it started.`);
		if (this._hasEmotion(slave)) {
			if (slave.devotion > 50) {
				r.push(`${He}'s delighted. ${He}'s such a good sex slave that the lewdness of making extra fluid when ${he}'s ready to fuck is exciting to ${him}. That, and extra lubrication is always welcome.`);
				if (slave.dick > 2) {
					r.push(`One of the first things ${he} tries is guiding ${his} flaccid dick back to apply some to ${his} asspussy. It works, to ${his} naughty satisfaction.`);
				}
				reaction.devotion += 4;
			} else if (slave.devotion >= -20) {
				r.push(`${He} obviously doesn't know what to think at first. ${He} does ${his} best not to make a mess, and is mostly successful, but ${he}'s realizing that this is going to be somewhat inconvenient. Still, having such a lewd change made to ${his} body affects ${his} feelings towards you; ${he} is sensibly fearful of your total power over ${him}.`);
				reaction.trust -= 5;
			} else {
				r.push(`${He} feared the worst when ${he} realized that something had been done to ${him} down there, and ${he}'s initially relieved to find that ${he}'s intact and apparently functional. But ${he}'s been invaded in an extremely personal way, and resents having you tamper with ${his} private parts. Furthermore, ${he} is sensibly fearful of your total power over ${him}.`);
				reaction.trust -= 5;
				reaction.devotion -= 5;
			}
		}
		r.push(`As with all surgery <span class="health dec">${his} health has been slightly affected.</span>`);

		reaction.longReaction.push(r);
		return reaction;
	}
};

App.Medicine.Surgery.Procedures.Precum = class extends App.Medicine.Surgery.Procedure {
	get name() {
		return "Implant slow-release productivity drugs";
	}

	get description() {
		return "This may cause some leaking";
	}

	get healthCost() {
		return 10;
	}

	apply(cheat) {
		this._slave.prostate = 2;
		return this._assemble(new App.Medicine.Surgery.Reactions.Precum());
	}
};


code:
App.Medicine.Surgery.Reactions.Preg = class extends App.Medicine.Surgery.SimpleReaction {
	reaction(slave, diff) {
		const reaction = super.reaction(slave, diff);
		const {He, he, his, him} = getPronouns(slave);
		let r = [];

		r.push(`${He} leaves the surgery with a certain warmth in ${his} lower abdomen, ${he} knows that ${he} has been impregnated.`);
		if (slave.fetish === "mindbroken") {
			r.push(`As with all surgery <span class="health dec">${his} health has been slightly affected.</span>`);
		} else if (this._strongKnownFetish(slave, "pregnancy")) {
			r.push(`${He} is  filled with joy about being swollen with life and gleefully rubs ${his} soon to be huge belly. ${He}'s so pleased that ${he} now trusts your plans for ${his} body. As with all surgery ${his} health has been slightly affected.`);
			reaction.trust += 4;
			reaction.devotion += 10;
		} else if (slave.devotion > 50) {
			r.push(`${He}'s grateful that you think ${his} offspring are valuable, and a little nervous about how ${he}'ll perform as a breeder. As with all surgery ${his} health has been slightly affected.`);
			reaction.devotion += 4;
		} else if (slave.devotion >= -20) {
			r.push(`${He} understands the realities of ${his} life as a slave, so it isn't much of a shock. As with all surgery ${his} health has been slightly affected. ${He} is sensibly fearful of your total power over ${his} body and how big ${he} will get.`);
			reaction.trust -= 10;
		} else {
			r.push(`${He} does not understand the realities of ${his} life as a slave at a core level, so ${he}'s terrified and angry that you have forced ${him} to be a broodmother. As with all surgery ${his} health has been slightly affected. ${He} is sensibly fearful of your total power over ${his} body and ${his} rapidly filling womb.`);
			reaction.trust -= 15;
			reaction.devotion -= 15;
		}
		if (V.PC.dick !== 0) {
			reaction.longReaction.push(r);
			r = [];
			const seed = App.UI.DOM.makeElement("span", `The implant is highly receptive to fresh sperm right now; it would be trivial to seed it with yours and force ${him} to bear hundreds of your children.`);
			r.push(seed);
			App.UI.DOM.appendNewElement("div", seed, App.UI.DOM.link(
				`Seed ${his} pregnancy implant with your genetic material`,
				() => {
					const r = [];
					r.push(`You simply take ${him} on the spot, using ${him} to your liking and shooting a load deep into ${his} receptive pussy. The implant rewards ${him} upon successful fertilization, so ${his} moans of pleasure as you pull out of ${him} inform you ${he}'ll soon`);
					if (slave.broodmother === 2) {
						r.push(`be greatly swollen`);
					} else {
						r.push(`grow heavy`);
					}
					r.push(`with <span class="pregnant">your brood.</span>`);
					slave.pregSource = -1;
					WombImpregnate(slave, 1, -1, 1);
					/* to ensure player paternity we need actual fetus here */
					r.push(VCheck.Vaginal(slave, 1));

					const div = document.createElement("div");
					App.Events.addNode(div, r);
					App.UI.DOM.replace(seed, div);
				}
			));
		}

		reaction.longReaction.push(r);
		return reaction;
	}
};

App.Medicine.Surgery.Procedures.ImplantPregGenerator = class extends App.Medicine.Surgery.Procedure {
	get name() {
		return "Implant a pregnancy generator";
	}

	get description() {
		const {his} = getPronouns(this.originalSlave);
		return `This will have severe effects on ${his} health and mind`;
	}

	get healthCost() {
		return 10;
	}

	apply(cheat) {
		this._slave.preg = 1;
		this._slave.pregWeek = 1;
		this._slave.pregKnown = 1;
		this._slave.pregType = 1;
		this._slave.broodmother = 1;
		this._slave.broodmotherFetuses = 1;
		this._slave.pregControl = "none";
		return this._assemble(new App.Medicine.Surgery.Reactions.Preg());
	}
};


code:
App.Medicine.Surgery.Reactions.Preg1Hack = class extends App.Medicine.Surgery.SimpleReaction {
	reaction(slave, diff) {
		const reaction = super.reaction(slave, diff);
		const {He, he, his, him} = getPronouns(slave);
		const r = [];

		r.push(`The hacking process is brief, being little more than inserting the actuator into ${his} vagina, and leaves ${him} with nothing more than minor health effects from the altered implant functions. ${He} leaves the surgery without any specific feeling, but ${he} knows that something has been done to ${his} implant.`);

		// My testing shows that 2 or 3 is relatively safe for generic adult slave with effective curatives or clinic, 4 - high risk of bursting. So there is a catch with it.
		slave.broodmotherFetuses = [2, 2, 2, 2, 3, 3, 4].random();

		if (slave.fetish === "mindbroken") {
			/* nothing*/
		} else if (this._strongKnownFetish(slave, "pregnancy")) {
			r.push(`${He} is filled with joy about being even more swollen with life and gleefully rubs ${his} soon-to-be-larger belly. ${He}'s so pleased that ${he} now trusts your plans for ${his} body. As with all surgery ${his} health has been slightly affected.`);
			reaction.trust += 4;
			reaction.devotion += 10;
		} else if (slave.devotion > 50) {
			r.push(`${He}'s <span class="devotion inc">grateful</span> that you think ${his} offspring are valuable, but is a little afraid about how ${his} body will catch up with ${his} hacked implant.`);
			reaction.devotion += 2;
			reaction.trust -= 2;
		} else if (slave.devotion >= -20) {
			r.push(`${He} understands the realities of ${his} life as a slave, so even this isn't much of a shock. ${He} is sensibly fearful of your total power over ${his} body and how big ${he} will get.`);
			reaction.trust -= 10;
		} else {
			r.push(`${He} does not understand the realities of ${his} life as a slave at a core level, so ${he}'s terrified and angry that you not only have forced ${him} to be a broodmother but also messed with the implant, with no thought for ${his} safety. ${He} is sensibly fearful of your total power over ${his} body and ${his} even more rapidly filling womb.`);
			reaction.trust -= 15;
			reaction.devotion -= 15;
		}

		reaction.longReaction.push(r);
		return reaction;
	}
};

App.Medicine.Surgery.Procedures.HackPregGenerator = class extends App.Medicine.Surgery.Procedure {
	get name() {
		return "Hack the pregnancy generator";
	}

	get description() {
		return `This will trick the generator ova release logic, forcing it to release more than one ova each week. This is an untested override and can cause severe health problems.`;
	}

	get healthCost() {
		return 1; // Yes, 1
	}

	apply(cheat) {
		this._slave.pregControl = "none";
		return this._assemble(new App.Medicine.Surgery.Reactions.Preg1Hack());
	}
};


code:
App.Medicine.Surgery.Reactions.PregRemove = class extends App.Medicine.Surgery.SimpleReaction {
	reaction(slave, diff) {
		const reaction = super.reaction(slave, diff);
		const {He, he, his, him} = getPronouns(slave);
		const r = [];

		r.push(`${He} leaves the surgery with a certain soreness and minor pain in ${his} lower abdomen, ${he} knows that ${his} days as broodmother are finished.`);
		if (slave.fetish === "mindbroken") {
			r.push(`As with all surgery <span class="health dec">${his} health has been slightly affected.</span>`);
		} else if (this._strongKnownFetish(slave, "pregnancy")) {
			r.push(`${He} is filled with despair about missing being swollen with life and rubs ${his} flat belly with sorrow. Only one fact slightly soothes ${him} and allows ${him} to remain sane — at least ${he} will not become infertile and still can get pregnant naturally. As with all surgery ${his} health has been slightly affected.`);
			reaction.trust -= 10;
			reaction.devotion -= 30;
		} else if (slave.devotion > 50) {
			r.push(`${He}'s grateful that you allowed ${his} body to be free of constant pregnancy stress, and a little nervous about if you will appreciate ${him} enough without such dedication. As with all surgery ${his} health has been slightly affected.`);
			reaction.devotion += 4;
		} else if (slave.devotion >= -20) {
			r.push(`${He} understands the realities of ${his} life as a slave, so it isn't much of a shock. As with all surgery ${his} health has been slightly affected. ${He} is sensibly fearful of your total power over ${his} body.`);
			reaction.trust -= 10;
		} else {
			r.push(`${He} does not understand the realities of ${his} life as a slave at a core level, so ${he}'s terrified and angry that you can change ${his} body so radically just at your will. As with all surgery ${his} health has been slightly affected. ${He} is sensibly fearful of your total power over ${his} body and ${his} now empty womb.`);
			reaction.trust -= 15;
			reaction.devotion -= 15;
		}

		reaction.longReaction.push(r);
		return reaction;
	}
};

App.Medicine.Surgery.Procedures.RemovePregGenerator = class extends App.Medicine.Surgery.Procedure {
	get name() {
		return "Remove the pregnancy generator";
	}

	get healthCost() {
		return 10;
	}

	apply(cheat) {
		this._slave.preg = 0;
		this._slave.pregWeek = -1;
		this._slave.pregSource = 0;
		this._slave.pregKnown = 0;
		this._slave.pregType = 0;
		this._slave.broodmother = 0;
		this._slave.broodmotherFetuses = 0;
		this._slave.broodmotherOnHold = 0;
		this._slave.pregControl = "none";
		return this._assemble(new App.Medicine.Surgery.Reactions.PregRemove());
	}
};


code:
App.Medicine.Surgery.Reactions.Prostate = class extends App.Medicine.Surgery.SimpleReaction {
	reaction(slave, diff) {
		const reaction = super.reaction(slave, diff);
		const {He, he, his, him, himself} = getPronouns(slave);
		const r = [];

		r.push(`It's not immediately apparent to ${him} what kind of surgery ${he} received, since all ${he}'s left with is a terrible nonspecific ache in ${his} lower parts. Since the surgery was invasive, ${his} health has been greatly affected.`);
		if (this._hasEmotion(slave)) {
			if (slave.devotion > 50) {
				if (slave.anus === 0) {
					r.push(`Since ${he}'s still an anal virgin, ${he} doesn't have any immediate way to discover what's been taken from ${him}. Thus, ${he} carries on, accepting what you did to ${him} out of simple ignorance.`);
				} else if (this._strongKnownFetish(slave, "buttslut")) {
					r.push(`${He} realizes that ${his} prostate's gone the first time ${he} takes it up the butt, though. The incorrigible buttslut is crushed, but ${he}'s devoted to you, so ${he} resolves to carry on regardless. If anything, ${he} does ${his} best to push ${himself} to consider other kinks, now that a hard anal pounding isn't as fun for ${him} as it once was.`);
					slave.fetishStrength -= 40;
				} else {
					r.push(`${He} realizes that ${his} prostate's gone the first time ${he} takes it up the butt, though. Awed by your permeating control over ${him}, even down to ${his} internal organs, ${he} accepts that you've decided to make buttsex less fun for ${him}.`);
					reaction.devotion += 4;
				}
			} else if (slave.devotion > 20) {
				if (slave.anus === 0) {
					r.push(`Since ${he}'s still an anal virgin, ${he} doesn't have any immediate way to discover what's been taken from ${him}. Not knowing what you did, ${he}'s afraid, realizing that you can toy with ${his} internal makeup at a whim.`);
					reaction.trust -= 5;
				} else if (this._strongKnownFetish(slave, "buttslut")) {
					r.push(`${He} realizes that ${his} prostate's gone the first time ${he} takes it up the butt, though. The buttslut is crushed, and infuriated, because in effect you've taken ${his} favorite pastime away from ${him}. For now, ${he} defiantly does ${his} best to keep orgasming to anal, but it remains to be seen whether ${he} can maintain ${his} enthusiasm.`);
					reaction.devotion -= 10;
				} else {
					r.push(`${He} realizes that ${his} prostate's gone the first time ${he} takes it up the butt, though. ${He} wasn't attached to it in a particular way, but it was part of ${his} body, and now it's gone. It frightens ${him} to be reduced in this way, and ${he} wonders what it means that you apparently want ${him} to enjoy being assfucked less.`);
					reaction.trust -= 5;
				}
			} else {
				r.push(`${He} doesn't have to know exactly what you did, though, to be mortified and infuriated by your messing around inside ${his} body. ${He} hasn't yet learned to accept that you control ${him} completely, down to the arrangement and even presence of ${his} internal organs.`);
				reaction.trust -= 10;
				reaction.devotion -= 10;
			}
		}

		reaction.longReaction.push(r);
		return reaction;
	}
};

App.Medicine.Surgery.Procedures.RemoveProstate = class extends App.Medicine.Surgery.Procedure {
	get name() {
		return "Remove prostate";
	}

	get healthCost() {
		return 40;
	}

	apply(cheat) {
		this._slave.prostate = 0;
		return this._assemble(new App.Medicine.Surgery.Reactions.Prostate());
	}
};


code:
App.Medicine.Surgery.Reactions.Relocate = class extends App.Medicine.Surgery.SimpleReaction {
	reaction(slave, diff) {
		const reaction = super.reaction(slave, diff);
		const {He, he, his, him} = getPronouns(slave);
		const r = [];

		if (slave.fetish === "mindbroken") {
			r.push(`When ${he} begins surgical recovery, ${his} groin hurts quite a lot, and ${he} can't quite tell what's going on down there. Since the surgery was invasive, ${his} health has been seriously affected.`);
		} else if (slave.devotion > 50) {
			r.push(`When ${he} begins surgical recovery, ${his} groin hurts quite a lot, and ${he} can't quite tell what's going on down there. However, ${he} was able to follow enough of the surgery to understand that ${he} still has ${his} balls, even if they're no longer visible. ${He}'s eager to`);
			if (canSee(slave)) {
				r.push(`see, and when ${he}'s recovered enough, ${he}'s pleased by the sight`);
			} else {
				r.push(`feel, and when ${he}'s recovered enough, ${he}'s pleased by the sensation`);
			}
			r.push(`of the smooth skin`);
			if (slave.dick > 0) {
				r.push(`beneath ${his} still-functional cock.`);
			} else {
				r.push(`where ${his} testicles used to be.`);
			}
			r.push(`${He} has become more submissive due to your reshaping of ${his} body. Since the surgery was invasive, ${his} health has been seriously affected.`);
			reaction.devotion += 4;
		} else if (slave.devotion > 20) {
			r.push(`When ${he} begins surgical recovery, ${his} groin hurts quite a lot, and ${he} can't quite tell what's going on down there. However, ${he} was able to follow enough of the surgery to understand that ${he} still has ${his} balls, even if they're no longer visible. ${He}'s relieved ${he} hasn't been gelded, but ${he}'s still quite horrified. ${He} blames you for changing ${him} so radically. Since the surgery was invasive, ${his} health has been seriously affected. ${He} is terribly afraid of your total power over ${his} body.`);
			reaction.trust -= 5;
			reaction.devotion -= 5;
		} else {
			r.push(`When ${he} begins surgical recovery, ${his} groin hurts quite a lot, and ${he} can't quite tell what's going on down there. ${He} spends a long time in terror, wondering whether ${he}'s been gelded, but ${he} eventually realizes that ${his} balls have merely been relocated. The surgical invasion has filled ${him} with horror and anger. Since the surgery was invasive, ${his} health has been seriously affected. ${He} is very afraid of your total power over ${his} body.`);
			reaction.trust -= 20;
			reaction.devotion -= 20;
		}

		reaction.longReaction.push(r);
		return reaction;
	}
};

App.Medicine.Surgery.Procedures.RelocateBalls = class extends App.Medicine.Surgery.Procedure {
	get name() {
		return "Move them inside abdomen and remove scrotum";
	}

	get description() {
		return `This will have a negative impact on cum production`;
	}

	get healthCost() {
		return 20;
	}

	apply(cheat) {
		this._slave.scrotum = 0;
		return this._assemble(new App.Medicine.Surgery.Reactions.Relocate());
	}
};


code:
App.Medicine.Surgery.Reactions.ScrotalTuck = class extends App.Medicine.Surgery.SimpleReaction {
	reaction(slave, diff) {
		const reaction = super.reaction(slave, diff);
		const {He, he, his} = getPronouns(slave);
		const r = [];

		if (slave.fetish === "mindbroken") {
			r.push(`When ${he} begins surgical recovery, ${his} groin hurts quite a lot, and ${he} can't quite tell what's going on down there. Since the surgery was invasive, ${his} health has been seriously affected.`);
		} else if (slave.devotion > 50) {
			r.push(`${He} exits the surgery gingerly, since ${he} can feel that something was done to ${his} testicles. ${He} examines them carefully`);
			if (canSee(slave)) {
				r.push(`in the mirror.`);
			} else {
				r.push(`by feeling alone.`);
			}
			r.push(`Realizing that ${his} balls fit ${his} scrotum perfectly, ${he}'s very happy you'd take an interest in ${his} balls, and looks forward to discovering how it moves during sex. ${his} health has been slightly affected.`);
			reaction.devotion += 4;
		} else if (slave.devotion > 20) {
			r.push(`${He} exits the surgery gingerly, since ${he} can feel that something was done to ${his} testicles. ${He} examines them carefully`);
			if (canSee(slave)) {
				r.push(`in the mirror.`);
			} else {
				r.push(`by feeling alone.`);
			}
			r.push(`Realizing that ${his} balls fit ${his} scrotum perfectly, ${he}'s flooded with relief. ${He}'s so elated that ${he} hasn't been severely damaged that ${he} doesn't mind your taking surgical control of ${his} genitals. ${his} health has been slightly affected.`);
		} else {
			r.push(`${He} exits the surgery gingerly, since ${he} can feel that something was done to ${his} testicles. ${He} examines them carefully`);
			if (canSee(slave)) {
				r.push(`in the mirror.`);
			} else {
				r.push(`by feeling alone.`);
			}
			r.push(`Realizing that ${his} balls fit ${his} scrotum perfectly, ${he}'s flooded with relief, since ${he} was afraid that you'd done something far more terrible. Once ${he} has time to think about it, though, ${he}'s somewhat resentful, since ${he} naturally feels a certain proprietary interest in ${his} own genitals. ${his} health has been slightly affected.`);
			reaction.devotion -= 5;
		}

		reaction.longReaction.push(r);
		return reaction;
	}
};

App.Medicine.Surgery.Procedures.ScrotalTuck = class extends App.Medicine.Surgery.Procedure {
	get name() {
		return "Remove excess scrotal skin";
	}

	get healthCost() {
		return 5;
	}

	apply(cheat) {
		this._slave.scrotum = this._slave.balls;
		return this._assemble(new App.Medicine.Surgery.Reactions.ScrotalTuck());
	}
};


code:
App.Medicine.Surgery.Reactions.Sterilize = class extends App.Medicine.Surgery.SimpleReaction {
	reaction(slave, diff) {
		const reaction = super.reaction(slave, diff);
		const {He, he, his, him} = getPronouns(slave);
		const r = [];

		if (slave.fetish === "mindbroken") {
			r.push(`${He} leaves the surgery with nothing but a nonspecific ache in ${his} lower abdomen, but lacks the mental faculties to know that ${he}'ll never have a child now. As with all surgery ${his} health has been slightly affected.`);
		} else if (this._strongKnownFetish(slave, "pregnancy")) {
			r.push(`${He} leaves the surgery with nothing but a nonspecific ache in ${his} lower abdomen, but ${he} knows enough about surgery and sex slaves to know that it means ${he}'ll never have a child. ${He} is filled with grief whenever ${he} thinks about the fact that feeling a life growing within ${him} is now, finally and forever, beyond ${him}. As with all surgery ${his} health has been slightly affected. ${He} is terribly afraid of your total power over ${his} body.`);
			reaction.trust -= 10;
			reaction.devotion -= 20;
		} else if (slave.energy > 95) {
			r.push(`${He} leaves the surgery with nothing but a nonspecific ache in ${his} lower abdomen, but ${he} knows enough about surgery and sex slaves to know that it means ${he}'ll never have to worry about a pussyfuck getting ${him} pregnant again. As far as ${he}'s concerned, easier, less worrisome vaginal intercourse is a good thing; one less thing to keep in mind when a guy blows his load inside ${him}. As with all surgery ${his} health has been slightly affected.`);
			reaction.devotion += 4;
		} else if (slave.devotion > 50) {
			r.push(`${He} leaves the surgery with nothing but a nonspecific ache in ${his} lower abdomen, but ${he} knows enough about surgery and sex slaves to know that it means ${he}'ll never have to worry about a pregnancy, ever again. ${He} has many rules and duties to worry about as a slave, so ${he}'s grateful that ${he} has one less thing to worry about as ${he} serves you. As with all surgery ${his} health has been slightly affected.`);
			reaction.devotion += 4;
		} else if (slave.devotion >= -20) {
			r.push(`${He} leaves the surgery with nothing but a nonspecific ache in ${his} lower abdomen, but ${he} knows enough about surgery and sex slaves to know that it means ${he}'ll never get pregnant. ${He} understands the realities of ${his} life as a slave, and that a traditional life with a child was never going to happen for ${him} anyway, so it isn't much of a shock. As with all surgery ${his} health has been slightly affected. ${He} is sensibly fearful of your total power over ${his} body.`);
			reaction.trust -= 5;
		} else {
			r.push(`${He} leaves the surgery with nothing but a nonspecific ache in ${his} lower abdomen, but ${he} knows enough about surgery and sex slaves to know that it means ${he}'ll never get pregnant. ${He} does not understand the realities of ${his} life as a slave at a core level, so despite the fact that ${he} was never going to have a family, fertile or not, ${he}'s resentful of the surgical invasion. As with all surgery ${his} health has been slightly affected. ${He} is sensibly fearful of your total power over ${his} body.`);
			reaction.trust -= 5;
			reaction.devotion -= 5;
		}

		reaction.longReaction.push(r);
		return reaction;
	}
};

App.Medicine.Surgery.Procedures.Sterilize = class extends App.Medicine.Surgery.Procedure {
	get name() {
		return "Sterilize";
	}

	get healthCost() {
		return 10;
	}

	apply(cheat) {
		this._slave.preg = -2;
		return this._assemble(new App.Medicine.Surgery.Reactions.Sterilize());
	}
};

App.Medicine.Surgery.Procedures.Oophorectomy = class extends App.Medicine.Surgery.Procedure {
	get name() {
		return "Oophorectomy";
	}

	get healthCost() {
		return 10;
	}

	apply(cheat) {
		this._slave.ovaries = 0;
		this._slave.ovaImplant = 0;
		this._slave.wombImplant = "none";
		return this._assemble(new App.Medicine.Surgery.Reactions.Sterilize());
	}
};


code:
App.Medicine.Surgery.Reactions.Vagina = class extends App.Medicine.Surgery.SimpleReaction {
	reaction(slave, diff) {
		const reaction = super.reaction(slave, diff);
		const {He, he, his, him} = getPronouns(slave);
		const r = [];

		if (slave.fetish === "mindbroken") {
			r.push(`${He} leaves the surgery with a terribly sore pussy and little desire to mess with it. As with all surgery <span class="health dec">${his} health has been slightly affected.</span>`);
		} else {
			if (slave.energy > 95) {
				r.push(`${He} leaves the surgery with a terribly sore pussy. ${He} is filled with joy at the prospect of having a tight cunt again, so much so that ${he} now trusts your plans for ${his} body. If ${he} had much in the way of vanilla sex skills, they've likely suffered. As with all surgery ${his} health has been slightly affected.`);
				reaction.trust += 4;
				reaction.devotion += 10;
			} else if (slave.devotion > 50) {
				r.push(`${He} leaves the surgery with a terribly sore pussy. ${He}'s happy that you think ${him} worth the effort of surgical improvement, and a little excited to feel like ${he}'s a girl again. If ${he} had much in the way of vanilla sex skills, they've likely suffered. As with all surgery ${his} health has been slightly affected.`);
				reaction.devotion += 4;
			} else if (slave.devotion >= -20) {
				r.push(`${He} leaves the surgery with a terribly sore pussy. ${He}'s somewhat revolted by the surgery, but as far as ${he}'s concerned, the short recovery period will mean a time during which ${he} can be sure no one will use ${his} pussy. If ${he} had much in the way of vanilla sex skills, they've likely suffered. As with all surgery ${his} health has been slightly affected. ${He} is sensibly fearful of your total power over ${his} body.`);
				reaction.trust -= 5;
			} else {
				r.push(`${He} leaves the surgery with a terribly sore pussy. ${He}'s horrified at surgical alteration of ${his} womanhood; this is probably more of an invasion than ${he} could readily imagine before today. If ${he} had much in the way of vanilla sex skills, they've likely suffered. As with all surgery ${his} health has been slightly affected. ${He} is terribly afraid of your total power over ${his} most intimate parts.`);
				reaction.trust -= 10;
				reaction.devotion -= 5;
			}
			if (slave.skill.vaginal > 10) {
				slave.skill.vaginal -= 10;
			}
		}

		reaction.longReaction.push(r);
		return reaction;
	}
};

App.Medicine.Surgery.Procedures.RepairVagina = class extends App.Medicine.Surgery.Procedure {
	get name() {
		return "Repair pussy";
	}

	get description() {
		const {his} = getPronouns(this.originalSlave);
		return `This will reduce ${his} vaginal skills`;
	}

	get healthCost() {
		return 10;
	}

	apply(cheat) {
		this._slave.vagina = 3;
		return this._assemble(new App.Medicine.Surgery.Reactions.Vagina());
	}
};

App.Medicine.Surgery.Procedures.TightenVagina = class extends App.Medicine.Surgery.Procedure {
	get name() {
		return "Tighten pussy";
	}

	get description() {
		const {his} = getPronouns(this.originalSlave);
		return `This will reduce ${his} vaginal skills`;
	}

	get healthCost() {
		return 10;
	}

	apply(cheat) {
		this._slave.vagina = 1;
		return this._assemble(new App.Medicine.Surgery.Reactions.Vagina());
	}
};

App.Medicine.Surgery.Procedures.RestoreVirginity = class extends App.Medicine.Surgery.Procedure {
	get name() {
		return "Restore virginity";
	}

	get description() {
		const {his} = getPronouns(this.originalSlave);
		return `This will reduce ${his} vaginal skills`;
	}

	get healthCost() {
		return 10;
	}

	apply(cheat) {
		this._slave.vagina = 0;
		return this._assemble(new App.Medicine.Surgery.Reactions.Vagina());
	}
};


code:
App.Medicine.Surgery.Reactions.VaginaRemoval = class extends App.Medicine.Surgery.SimpleReaction {
	reaction(slave, diff) {
		const reaction = super.reaction(slave, diff);
		const {He, he, His, his, him, himself} = getPronouns(slave);
		const r = [];

		if (slave.fetish === "mindbroken") {
			r.push(`Surprisingly, ${he} already realized while exiting that ${his} genitalia was completely reshaped. The reasons why are lost to ${him}, though.`);
		} else if (slave.dick === 0) {
			r.push(`Of course, ${he} already realized while exiting that something very dear to ${him} has been taken away.`);
			if (slave.devotion > 50 && slave.sexualFlaw === "self hating") {
				r.push(`Strong emotions play out on ${his} face as ${he} experiences a watershed in ${his} life of sexual slavery, perhaps the most radical one ${he}'ll ever experience. ${He} loves you with all ${his} being, and truly hates ${himself}. ${He} finds ${himself} in an emotional place where ${he}'s willing to accept having ${his} womanhood torn out. ${He} knows ${he}'s a worthless piece of trash, and realizes that if you feel like removing the parts of ${his} body that can feel sexual pleasure, that's your prerogative. In moments, ${he}'s confirmed in total, final, fanatical submission to your will. It's almost frightening.`);
				reaction.devotion += 50;
			} else if (slave.devotion > 20 && slave.fetishKnown === 1 && slave.fetishStrength > 95 && slave.fetish === "buttslut") {
				r.push(`${He}'s such a complete buttslut, though, that ${he} finds ${he} doesn't really care. ${He} never really paid much attention to ${his} front hole; it got wet when ${he} got buttfucked, but that was mostly useful to provide a little lube for phalli that fucked it before switching to ${his} ass. If anything, ${he}'s reassured by the implication that ${his} asshole is all that matters about ${him}, and of course is forced even further into submission to your will.`);
				reaction.devotion += 8;
				reaction.trust += 8;
			} else if (slave.devotion > 20 && slave.fetishKnown === 1 && slave.fetishStrength > 95 && slave.fetish === "cumslut") {
				r.push(`${He}'s such an oral slut, though, that ${he} finds ${he} doesn't really care. ${He} viewed ${his} pussy as a nice place for stimulation while ${he} licked, blew, and sucked; if ${he} has to learn to get off from throat stimulation ${he} will. As far as ${he}'s concerned, you've simply confirmed that ${his} most important hole is the one in ${his} face. If anything, ${he}'s reassured by the implication that ${his} real pussy has always been the one in the middle of ${his} face, and of course, ${he}'s forced even further into submission to your will.`);
				reaction.devotion += 8;
				reaction.trust += 8;
			} else if (slave.devotion > 20 && slave.fetishKnown === 1 && slave.fetishStrength > 95 && slave.fetish === "submissive") {
				r.push(`${He}'s such a total submissive, though, that ${he} accepts even this. Having ${his} womanhood torn out, greatly curtailing ${his} physical ability to enjoy sex, is perhaps the final step in sexual slavery, and ${he}'s a little awed by it. If anything, ${he}'s reassured by the implicit promise that ${his} body exists for the degrading sexual gratification of others, and of course, ${he}'s forced even further into submission to your will.`);
				reaction.devotion += 8;
				reaction.trust += 8;
			} else if (slave.devotion > 95) {
				r.push(`Doubt, fear, and even nausea play across ${his} face, but ${he}'s so worshipful of you that ${he} masters them all, accepting that this is your will. There's surprisingly little mental effect on ${him}. The horror of having ${his} womanhood torn out is so strong that it breaks through to ${him}, and the only way ${he} can find to deal with it is to think about it as little as possible. ${He} falls back on worshipful duty.`);
			} else if (slave.devotion > 50) {
				r.push(`${He}'s devoted to you, but doubt and fear play across ${his} face as ${he} comes to terms with what's happened. ${He} does not see how having ${his} womanhood torn out will improve ${his} sexual slavery. ${He} does not rage or scream, but ${he} does cry, sadly wondering whether ${he}'s valuable to you at all, or if ${he}'s just a surgical plaything to be degraded. ${He}'s very frightened that you'll cut up more of ${him}.`);
				reaction.trust -= 10;
				reaction.devotion -= 10;
			} else if (slave.devotion > 20) {
				r.push(`${He}'s properly broken to slavery, but this is much too far. Having ${his} womanhood torn out cuts straight through ${his} conditioning, and tears roll down ${his} face as the horrible permanence of what's happened to ${him} really sinks in. Open anger begins to become apparent through ${his} tears; ${he} thought that ${his} obedience merited better than this, and ${he}'s extremely terrified to find that despite being a decent slave, ${he} remains a surgical playground.`);
				reaction.trust -= 20;
				reaction.devotion -= 20;
			} else {
				r.push(`${He}'s horrified almost beyond the ability of ${his} mind to comprehend. ${His} face takes on a blank look as ${he} goes into shock. There's no screaming and no tears, not yet; it will take ${him} time to process what's happened to ${him}. Without a doubt, ${he}'ll be absolutely filled by rage and terror.`);
				reaction.trust -= 40;
				reaction.devotion -= 40;
			}
		} else {
			r.push(`Of course, ${he} already realized while exiting that ${his} genitalia has been radically simplified. As a herm slave ${he} knew this day might come,`);
			if (slave.devotion > 50) {
				r.push(`and ${his} face is a strange mix of hope, happiness, satisfaction, and the tiniest tinge of soul-crushing sadness as ${he}`);
				if (canSee(slave)) {
					r.push(`views`);
				} else {
					r.push(`feels`);
				}
				r.push(`the cock that is all that remains of ${his} once-unique hermaphroditic genitalia. ${He} has become more submissive due to your radical reshaping of ${his} body. Since the surgery was invasive, ${his} health has been greatly affected.`);
				reaction.devotion += 4;
			} else if (slave.devotion > 20) {
				r.push(`and ${his} face is a strange mix of fear, hope, and resignation as ${he}`);
				if (canSee(slave)) {
					r.push(`views`);
				} else {
					r.push(`feels`);
				}
				r.push(`the cock that is all that remains of ${his} once-unique hermaphroditic genitalia. Eventually ${his} shoulders slump and ${he} tries to carry on. ${He} will struggle with feelings of confusion and loss. Since the surgery was invasive, ${his} health has been greatly affected. ${He} is terribly afraid of your total power over ${his} body.`);
				reaction.trust -= 10;
				reaction.devotion -= 5;
			} else {
				r.push(`but expectations and the reality are two different things. ${He}'s beside ${himself}, weeping gently.`);
				if (hasAnyArms(slave)) {
					r.push(`${He} absently moves a hand to where ${his} pussy would have been and snatches it away with a sob.`);
				}
				r.push(`<span class="devotion dec">The surgical invasion has filled ${him} with horror and anger.</span> ${He} is <span class="trust dec">cripplingly afraid</span> of your total power over ${his} body.`);
				reaction.trust -= 20;
				reaction.devotion -= 20;
			}
		}
		r.push(`Naturally, <span class="health dec">${his} health has been greatly affected</span> by such serious surgery.`);

		reaction.longReaction.push(r);
		return reaction;
	}
};

App.Medicine.Surgery.Procedures.VaginaRemoval = class extends App.Medicine.Surgery.Procedure {
	get name() {
		return "Remove pussy";
	}

	get description() {
		const {his} = getPronouns(this.originalSlave);
		return (this.originalSlave.ovaries === 1) ? `This will remove ${his} ovaries as well` : "";
	}

	get invasive() {
		return true;
	}

	apply(cheat) {
		surgeryAmp(this._slave, "vagina");
		return this._assemble(new App.Medicine.Surgery.Reactions.VaginaRemoval());
	}
};


code:
App.Medicine.Surgery.Reactions.Vasectomy = class extends App.Medicine.Surgery.SimpleReaction {
	reaction(slave, diff) {
		const reaction = super.reaction(slave, diff);
		const {He, he, His, his} = getPronouns(slave);
		const r = [];

		r.push(`${His} groin is a little sore, and ${he} examines it closely, but ${he} can't find much difference. ${He} likely won't realize what happened${(slave.ballType === "sterile") ? ` given that ${he} couldn't get girls pregnant in the first place` : `, but may piece things together when ${he} realizes the girls ${he} fucks never get pregnant`}. As with all surgery <span class="health dec">${his} health has been slightly affected.</span>`);

		reaction.longReaction.push(r);
		return reaction;
	}
};

App.Medicine.Surgery.Reactions.VasectomyUndo = class extends App.Medicine.Surgery.SimpleReaction {
	reaction(slave, diff) {
		const reaction = super.reaction(slave, diff);
		const {He, he, His, his} = getPronouns(slave);
		const r = [];

		r.push(`${His} groin is a little sore, and ${he} examines it closely, but ${he} can't find much difference. ${He} likely won't ever realize what happened`);
		if (slave.ballType === "sterile") {
			r.push(`since ${his} balls don't work in the first place.`);
		} else {
			r.push(`until ${he} gets a girl pregnant.`);
		}
		r.push(`As with all surgery <span class="health dec">${his} health has been slightly affected.</span>`);

		reaction.longReaction.push(r);
		return reaction;
	}
};

App.Medicine.Surgery.Procedures.Vasectomy = class extends App.Medicine.Surgery.Procedure {
	get name() {
		return `Clamp vas deferens ${this.originalSlave.ballType === "sterile" ? "" : "to cull potency"}`;
	}

	get healthCost() {
		return 10;
	}

	apply(cheat) {
		this._slave.vasectomy = 1;
		return this._assemble(new App.Medicine.Surgery.Reactions.Vasectomy());
	}
};

App.Medicine.Surgery.Procedures.VasectomyUndo = class extends App.Medicine.Surgery.Procedure {
	get name() {
		return "Reverse vasectomy";
	}

	get healthCost() {
		return 10;
	}

	apply(cheat) {
		this._slave.vasectomy = 0;
		return this._assemble(new App.Medicine.Surgery.Reactions.VasectomyUndo());
	}
};


code:
App.Medicine.Surgery.Reactions.BodyHairRemoval = class extends App.Medicine.Surgery.SimpleReaction {
	get invasive() { return false; }

	reaction(slave, diff) {
		const reaction = super.reaction(slave, diff);
		const {He, he, His, his, him} = getPronouns(slave);
		let r = [];

		r.push(`When ${he}`);
		if (!hasAnyLegs(slave)) {
			r.push(`is carried`);
		} else if (canWalk(slave)) {
			r.push(`walks`);
		} else {
			r.push(`is escorted`);
		}
		r.push(`out of the surgery ${he} feels the breeze on ${his} skin and realizes that`);
		if (slave.hStyle !== "bald" && slave.eyebrowHStyle !== "bald") {
			r.push(`all hair below ${his} neck is missing.`);
		} else {
			r.push(`${he} is now completely hairless.`);
		}
		if (this._hasEmotion(slave)) {
			reaction.longReaction.push(r);
			r = [];
			if (slave.devotion > 50) {
				r.push(`${He} is <span class="devotion inc">happy</span> with how smooth ${his} body has become and is already <span class="trust inc">wondering</span> what new kinky things you have planned for ${him}.`);
				reaction.trust += 5;
				reaction.devotion += 5;
			} else if (slave.devotion >= -20) {
				r.push(`${His} new lack of body hair doesn't bother ${him} much, since it just means ${he} needs to spend less time getting rid of any unseemly hairs.`);
				reaction.trust += 5;
			} else {
				r.push(`${He} is <span class="devotion dec">sad</span> and <span class="trust dec">frightened</span> that you would force this on ${him}.`);
				reaction.trust -= 5;
				reaction.devotion -= 5;
			}
		}
		reaction.longReaction.push(r);
		r = [];
		r.push(`As this was a non-invasive procedure, ${his} health was not affected.`);

		reaction.longReaction.push(r);
		return reaction;
	}
};

App.Medicine.Surgery.Procedures.BodyHairRemoval = class extends App.Medicine.Surgery.Procedure {
	get name() {
		const {his} = getPronouns(this._slave);
		return `Surgically remove ${his} ability to grow body hair`;
	}

	get healthCost() { return 0; }

	apply(cheat) {
		if (this._slave.underArmHStyle !== "hairless") {
			this._slave.underArmHStyle = "bald";
		}
		if (this._slave.pubicHStyle !== "hairless") {
			this._slave.pubicHStyle = "bald";
		}
		return this._assemble(new App.Medicine.Surgery.Reactions.BodyHairRemoval());
	}
};


code:
App.Medicine.Surgery.Reactions.EyebrowRemoval = class extends App.Medicine.Surgery.SimpleReaction {
	get invasive() { return false; }

	reaction(slave, diff) {
		const reaction = super.reaction(slave, diff);
		const {He, he, His, his, him} = getPronouns(slave);
		let r = [];

		r.push(`When ${he}`);
		if (!hasAnyLegs(slave)) {
			r.push(`is carried`);
		} else if (canWalk(slave)) {
			r.push(`walks`);
		} else {
			r.push(`is escorted`);
		}
		r.push(`out of the surgery ${he} feels the breeze on ${his} face and realizes that ${his} eyebrows are gone, permanently.`);
		if (this._hasEmotion(slave)) {
			reaction.longReaction.push(r);
			r = [];
			if (slave.devotion > 50) {
				r.push(`${He} is <span class="trust inc">thrilled</span> at how easy it will be to do ${his} makeup for up now that ${he} doesn't have to worry about ${his} eyebrows any longer.`);
				reaction.trust += 2;
			} else if (slave.devotion >= -20) {
				r.push(`${His} missing facial feature <span class="devotion dec">unnerves ${him}</span> a little. ${He} <span class="trust dec">shudders nervously</span> about what plans you may have to replace them.`);
				reaction.trust -= 2;
				reaction.devotion -= 2;
			} else {
				r.push(`${He} is <span class="devotion dec">sad</span> and <span class="trust dec">frightened</span> that you would force this on ${him}.`);
				reaction.trust -= 5;
				reaction.devotion -= 5;
			}
		}
		reaction.longReaction.push(r);
		r = [];
		r.push(`As this was a non-invasive procedure, ${his} health was not affected.`);

		reaction.longReaction.push(r);
		return reaction;
	}
};

App.Medicine.Surgery.Procedures.EyebrowRemoval = class extends App.Medicine.Surgery.Procedure {
	get name() {
		const {his} = getPronouns(this._slave);
		return `Surgically remove ${his} ability to grow eyebrows`;
	}

	get healthCost() { return 0; }

	apply(cheat) {
		this._slave.eyebrowHStyle = "bald";
		return this._assemble(new App.Medicine.Surgery.Reactions.EyebrowRemoval());
	}
};


code:
App.Medicine.Surgery.Reactions.HairRemoval = class extends App.Medicine.Surgery.SimpleReaction {
	get invasive() { return false; }

	reaction(slave, diff) {
		const reaction = super.reaction(slave, diff);
		const {He, he, his, him} = getPronouns(slave);
		let r = [];

		r.push(`When ${he}`);
		if (!hasAnyLegs(slave)) {
			r.push(`is carried`);
		} else if (canWalk(slave)) {
			r.push(`walks`);
		} else {
			r.push(`is escorted`);
		}
		r.push(`out of the surgery ${he} immediately notices the chill on ${his} head and realizes that ${he} is bald.`);
		if (this._hasEmotion(slave)) {
			reaction.longReaction.push(r);
			r = [];
			if (slave.devotion > 50) {
				if (slave.fetish === "humiliation" && slave.fetishStrength > 50) {
					r.push(`${He} is <span class="devotion inc">turned on</span> by how humiliating this is for ${him} and <span class="trust inc">can't wait</span> for the next time you decide to show ${him} off.`);
					reaction.trust += 5;
					reaction.devotion += 5;
				} else {
					r.push(`${He} is very devoted to you so ${his} new condition doesn't affect ${him} as much as it would other slaves.`);
				}
			} else if (slave.devotion >= -20) {
				if (slave.fetish === "humiliation" && slave.fetishStrength > 50) {
					r.push(`${He} is both <span class="devotion inc">turned on</span> and <span class="trust dec">horrified</span> by this humiliation.`);
					reaction.trust -= 5;
					reaction.devotion += 5;
				} else {
					r.push(`${He} thought ${he} was used to slavery but this is <span class="trust dec">too much.</span>`);
					reaction.trust -= 5;
				}
			} else {
				r.push(`${He} is <span class="trust dec">horrified</span> and <span class="devotion dec">angry</span> at this new humiliation.`);
				reaction.trust -= 5;
				reaction.devotion -= 5;
			}
		}
		reaction.longReaction.push(r);
		r = [];
		r.push(`As this was a non-invasive procedure, ${his} health was not affected.`);

		reaction.longReaction.push(r);
		return reaction;
	}
};

App.Medicine.Surgery.Procedures.HairRemoval = class extends App.Medicine.Surgery.Procedure {
	get name() {
		const {his} = getPronouns(this._slave);
		return `Surgically remove ${his} ability to grow hair`;
	}

	get healthCost() { return 0; }

	apply(cheat) {
		this._slave.bald = 1;
		this._slave.hStyle = "bald";
		this._slave.eyebrowHStyle = "bald";
		return this._assemble(new App.Medicine.Surgery.Reactions.HairRemoval());
	}
};


code:
App.Medicine.Surgery.Reactions.RestoreHairBrow = class extends App.Medicine.Surgery.SimpleReaction {
	intro(slave) {
		return [`As the remote surgery's long recovery cycle completes, ${slave.slaveName} begins to stir.`];
	}

	reaction(slave, diff) {
		const reaction = super.reaction(slave, diff);
		const {He, he, his} = getPronouns(slave);
		const r = [];

		r.push(`${He} awakens from surgery to an unfamiliar, rather irritating, itch above ${his} eyes.`);
		if (hasAnyArms(slave)) {
			r.push(`As ${he} reaches to scratch it,`);
		} else if (canSee(slave)) {
			r.push(`When ${he} investigates,`);
		} else {
			r.push(`As ${he} struggles to rub it against something,`);
		}
		if (slave.fetish === "mindbroken") {
			r.push(`${he} fails to realize ${he} now has eyebrows.`);
		} else {
			r.push(`${he} is <span class="devotion inc">delighted</span> to find ${he} now has eyebrows.`);
			reaction.devotion += 2;
		}
		r.push(`As with all surgery <span class="health dec">${his} health has been slightly affected.</span>`);

		reaction.longReaction.push(r);
		return reaction;
	}
};

App.Medicine.Surgery.Procedures.OFRestoreHairBrow = class extends App.Medicine.Surgery.Procedure {
	get name() {
		return "Brow";
	}

	get healthCost() {
		return 5;
	}

	apply(cheat) {
		this._slave.eyebrowHStyle = "natural";
		this._slave.eyebrowFullness = "natural";
		this._slave.eyebrowHColor = getGeneticHairColor(this._slave);
		return this._assemble(new App.Medicine.Surgery.Reactions.RestoreHairBrow());
	}
};


code:
App.Medicine.Surgery.Reactions.RestoreHairHead = class extends App.Medicine.Surgery.SimpleReaction {
	intro(slave) {
		return [`As the remote surgery's long recovery cycle completes, ${slave.slaveName} begins to stir.`];
	}

	reaction(slave, diff) {
		const reaction = super.reaction(slave, diff);
		const {He, he, his} = getPronouns(slave);
		const r = [];

		r.push(`${He} awakens from surgery to an unfamiliar, rather irritating, itch coming from the top of ${his} head.`);
		if (hasAnyArms(slave)) {
			r.push(`As ${he} reaches to scratch it,`);
		} else if (canSee(slave)) {
			r.push(`When ${he} investigates,`);
		} else {
			r.push(`As ${he} struggles to rub it against something,`);
		}
		if (slave.fetish === "mindbroken") {
			r.push(`${he} fails to realize ${he} now has a head of short hair.`);
		} else {
			r.push(`${he} is <span class="devotion inc">delighted</span> to find ${he} now has hair.`);
			reaction.devotion += 2;
		}
		r.push(`As with all surgery <span class="health dec">${his} health has been slightly affected.</span>`);

		reaction.longReaction.push(r);
		return reaction;
	}
};

App.Medicine.Surgery.Procedures.OFRestoreHairHead = class extends App.Medicine.Surgery.Procedure {
	get name() {
		return "Scalp";
	}

	get healthCost() {
		return 10;
	}

	apply(cheat) {
		this._slave.bald = 0;
		this._slave.hLength = 1;
		this._slave.hStyle = "neat";
		this._slave.hColor = getGeneticHairColor(this._slave);
		return this._assemble(new App.Medicine.Surgery.Reactions.RestoreHairHead());
	}
};


code:
App.Medicine.Surgery.Reactions.RestoreHairPits = class extends App.Medicine.Surgery.SimpleReaction {
	intro(slave) {
		return [`As the remote surgery's long recovery cycle completes, ${slave.slaveName} begins to stir.`];
	}

	reaction(slave, diff) {
		const reaction = super.reaction(slave, diff);
		const {He, he, his} = getPronouns(slave);
		const pubertyAge = Math.min(slave.pubertyAgeXX, slave.pubertyAgeXY);
		const r = [];

		r.push(`${He} awakens from surgery to an unfamiliar, rather irritating, itch`);
		if (hasAnyArms(slave)) {
			r.push(`under ${his} ${(hasBothArms(slave)) ? `arms` : `arm`}`);
		} else {
			r.push(`below where ${his} arms used to be.`);
		}
		if (hasAnyArms(slave)) {
			r.push(`As ${he} reaches to scratch it,`);
		} else if (canSee(slave)) {
			r.push(`When ${he} investigates,`);
		} else {
			r.push(`As ${he} struggles to rub it against something,`);
		}
		if (slave.fetish === "mindbroken") {
			r.push(`${he} fails to realize ${he} now has underarm hair.`);
		} else {
			if (slave.physicalAge < pubertyAge - 2) {
				r.push(`${he} finds nothing unusual; ${his} hair is still growing in.`);
			} else if (slave.physicalAge < pubertyAge - 1) {
				r.push(`${he} is surprised to find a few new hairs.`);
			} else if (slave.physicalAge < pubertyAge) {
				r.push(`${he} is surprised to find two patches of hair.`);
			} else {
				r.push(`${he} is shocked to find two dense patches of hair; a trip to the autosalon to manage it may be in order.`);
			}
		}
		r.push(`As with all surgery <span class="health dec">${his} health has been slightly affected.</span>`);

		reaction.longReaction.push(r);
		return reaction;
	}
};

App.Medicine.Surgery.Procedures.OFRestoreHairPits = class extends App.Medicine.Surgery.Procedure {
	get name() {
		return "Axillary";
	}

	get healthCost() {
		return 5;
	}

	apply(cheat) {
		this._slave.underArmHStyle = "bushy";
		this._slave.underArmHColor = getGeneticHairColor(this._slave);
		return this._assemble(new App.Medicine.Surgery.Reactions.RestoreHairPits());
	}
};


code:
App.Medicine.Surgery.Reactions.RestoreHairPubes = class extends App.Medicine.Surgery.SimpleReaction {
	intro(slave) {
		return [`As the remote surgery's long recovery cycle completes, ${slave.slaveName} begins to stir.`];
	}

	reaction(slave, diff) {
		const reaction = super.reaction(slave, diff);
		const {He, he, his} = getPronouns(slave);
		const pubertyAge = Math.min(slave.pubertyAgeXX, slave.pubertyAgeXY);
		const r = [];

		r.push(`${He} awakens from surgery to an unfamiliar, rather irritating, itch above ${his} crotch.`);
		if (hasAnyArms(slave)) {
			r.push(`As ${he} reaches to scratch it,`);
		} else if (canSee(slave)) {
			r.push(`When ${he} looks in the mirror,`);
		} else {
			r.push(`As ${he} struggles to rub it against something,`);
		}
		if (slave.fetish === "mindbroken") {
			r.push(`${he} fails to realize ${he} now has pubic hair.`);
		} else {
			if (slave.physicalAge < pubertyAge - 2) {
				r.push(`${he} finds nothing unusual; ${his} hair is still growing in.`);
			} else if (slave.physicalAge < pubertyAge - 1) {
				r.push(`${he} is surprised to find a few new hairs.`);
			} else if (slave.physicalAge < pubertyAge) {
				r.push(`${he} is surprised to find a patch of pubic hair.`);
			} else {
				r.push(`${he} is shocked to find a dense bush of hair trailing up to ${his} navel; a trip to the autosalon to style ${his} new pubes may be in order.`);
			}
		}
		r.push(`As with all surgery <span class="health dec">${his} health has been slightly affected.</span>`);

		reaction.longReaction.push(r);
		return reaction;
	}
};

App.Medicine.Surgery.Procedures.OFRestoreHairPubes = class extends App.Medicine.Surgery.Procedure {
	get name() {
		return "Pubic";
	}

	get healthCost() {
		return 5;
	}

	apply(cheat) {
		this._slave.pubicHStyle = "very bushy";
		this._slave.pubicHColor = getGeneticHairColor(this._slave);
		return this._assemble(new App.Medicine.Surgery.Reactions.RestoreHairPubes());
	}
};


code:
App.Medicine.Surgery.Reactions.Horn = class extends App.Medicine.Surgery.SimpleReaction {
	reaction(slave, diff) {
		const reaction = super.reaction(slave, diff);
		const {He, he, his} = getPronouns(slave);
		const r = [];

		if (slave.fetish === "mindbroken") {
			r.push(`${He} shows little reaction to ${his} new head ornamentation. As with all invasive surgery <span class="health dec">${his} health has been affected.</span>`);
		} else if (slave.devotion > 20) {
			if (canSee(slave)) {
				r.push(`${He} looks in the mirror and turns ${his} head side to side admiring ${his} new ${slave.hornColor} ${slave.horn},`);
			} else {
				r.push(`${He} can't see but it's clear from the dull ache that something has been done to ${his} head,`);
			}
			if (hasAnyArms(slave)) {
				r.push(`the base is still a bit sore, but ${he} reaches up to feel their shape,`);
			}
			r.push(`${he} turns to you with a smile, tilting ${his} head at various angles to show them off. ${He} seems to think ${his} new horns are cute. As with all invasive surgery ${his} health has been affected.`);
			reaction.devotion += 4;
		} else if (slave.devotion >= -20) {
			if (canSee(slave)) {
				r.push(`${He} eyes ${his} new ${slave.hornColor} ${slave.horn} disapprovingly`);
			} else {
				r.push(`${He} can't see but it's clear from the dull ache that something has been done to ${his} head,`);
			}
			if (hasAnyArms(slave)) {
				r.push(`the base is still a bit sore, but ${he} reaches up to tug on them gently,`);
			}
			r.push(`${He}'s come to terms with the fact that ${he}'s a slave, so ${he} isn't much affected mentally despite the surprise of having horns attached to ${his} head. As with all invasive surgery ${his} health has been affected. ${He} is sensibly fearful of your total power over ${his} body.`);
			reaction.trust -= 5;
		} else {
			if (canSee(slave)) {
				r.push(`${He} eyes ${his} new ${slave.hornColor} ${slave.horn} with disgust.`);
			} else {
				r.push(`${He} can't see but it's clear from the dull ache that something has been done to ${his} head, and probably not for the better.`);
			}
			if (hasAnyArms(slave)) {
				r.push(`The base is still a bit sore, but ${he} reaches up to tug on them, as if to confirm it's not some trick.`);
			}
			r.push(`For now, ${he} seems to view ${his} head ornamentation as a cruel imposition. As with all invasive surgery ${his} health has been affected. ${He} is now terribly afraid of your total power over ${his} body.`);
			reaction.trust -= 10;
			reaction.devotion -= 5;
		}
		reaction.longReaction.push(r);
		return reaction;
	}
};

App.Medicine.Surgery.Procedures.Horn = class extends App.Medicine.Surgery.Procedure {
	/**
	 * @param {App.Entity.SlaveState} slave
	 * @param {string} name
	 * @param {FC.HornType} hornType
	 * @param {string} hornColor
	 */
	constructor(slave, name, hornType, hornColor) {
		super(slave);
		this._name = name;
		this.type = hornType;
		this.color = hornColor;
	}

	get name() {
		return this._name;
	}

	get healthCost() {
		return 10;
	}

	apply(cheat) {
		this._slave.horn = this.type;
		this._slave.hornColor = this.color;
		return this._assemble(new App.Medicine.Surgery.Reactions.Horn());
	}
};


code:
App.Medicine.Surgery.Reactions.HornGone = class extends App.Medicine.Surgery.SimpleReaction {
	reaction(slave, diff) {
		const reaction = super.reaction(slave, diff);
		const {He, he, his} = getPronouns(slave);
		const r = [];

		if (slave.fetish === "mindbroken") {
			r.push(`${He} shows little reaction to the removal of ${his} head ornamentation. As with all invasive surgery <span class="health dec">${his} health has been affected.</span>`);
		} else if (slave.devotion > 20) {
			r.push(`${He} is a little sad ${his} head ornaments are gone but since ${he} is attentive to your will it doesn't have a great impact on ${his} mental state. As with all invasive surgery ${his} health has been affected.`);
		} else {
			r.push(`${He} is glad to be rid of the horns but any happiness is tempered by ${his} general dissatisfaction of being treated as your surgical plaything. As with all invasive surgery ${his} health has been affected. ${He} is sensibly fearful of your total power over ${his} body.`);
			reaction.trust -= 5;
		}

		reaction.longReaction.push(r);
		return reaction;
	}
};

App.Medicine.Surgery.Procedures.HornGone = class extends App.Medicine.Surgery.Procedure {
	get name() {
		return this._slave.horn === "one long oni horn" ? "Remove it" : "Remove them";
	}

	get healthCost() {
		return 10;
	}

	apply(cheat) {
		this._slave.horn = "none";
		this._slave.hornColor = "none";
		return this._assemble(new App.Medicine.Surgery.Reactions.HornGone());
	}
};


code:
App.Medicine.Surgery.Reactions.Liposuction = class extends App.Medicine.Surgery.SimpleReaction {
	reaction(slave, diff) {
		const reaction = super.reaction(slave, diff);
		const {He, he, his, him, himself} = getPronouns(slave);
		const r = [];

		if (slave.fetish === "mindbroken") {
			r.push(`${He} notices that ${he} is quite lighter than ${he} used to be. As with all surgeries, <span class="health dec">${his} health has been affected.</span>`);
		} else if (slave.behavioralFlaw === "anorexic") {
			if (canSee(slave)) {
				r.push(`${He} looks over ${his} new thin figure experimentally`);
			} else {
				r.push(`${He} shifts ${his} weight experimentally`);
			}
			r.push(`and turns to you with a smile to show it off. As an anorexic ${he} thinks you have brought ${him} closer to the true ideal. As with all surgeries, ${his} health has been affected.`);
			reaction.devotion += 4;
		} else if (slave.devotion > 50) {
			if (canSee(slave)) {
				r.push(`${He} looks over ${his} new thin figure experimentally`);
			} else {
				r.push(`${He} shifts ${his} weight experimentally`);
			}
			r.push(`and turns to you with a smile to show it off. ${He}'s still sore, so ${he} doesn't bend or flirt, but ${he} turns around to let you see it from all angles. ${He}'s happy with your changes to ${his} body. As with all surgery ${his} health has been affected.`);
			reaction.devotion += 4;
		} else if (slave.devotion >= -20) {
			r.push(`${He}`);
			if (canSee(slave)) {
				r.push(`eyes ${his} new thin figure`);
			} else {
				r.push(`shifts ${his} weight`);
			}
			r.push(`skeptically. ${He}'s still sore, so ${he} doesn't bend or touch ${himself}. ${He}'s come to terms with the fact that ${he}'s a slave, so ${he} expected something like this when ${he} was sent to the surgery. ${He} isn't much affected mentally. As with all surgery ${his} health has been affected. ${He} is sensibly fearful of your total power over ${his} body.`);
			reaction.trust -= 5;
		} else {
			if (canSee(slave)) {
				r.push(`${He} eyes ${his} new thin figure`);
			} else {
				r.push(`How light ${he} feels fills ${him}`);
			}
			r.push(`with resentment. ${He}'s still sore, so ${he} doesn't bend or touch ${himself}, but ${canSee(slave) ? `${he} glares daggers` : `${his} face contorts with distaste`}. ${He} still thinks of ${himself} as a person, so ${he} isn't used to the idea of being surgically altered to suit your every whim. For now, ${he} seems to view this model figure as a cruel imposition. As with all surgery ${his} health has been affected. ${He} is terribly afraid of your total power over ${his} body.`);
			reaction.trust -= 10;
			reaction.devotion -= 5;
		}
		if (slave.weight > 190 && slave.bellySag < 10) {
			r.push(`Due to the tremendous amount of fat removed from ${his} midsection, it sags terribly after the surgery.`);
			slave.bellySag = 10;
		} else if (slave.weight > 130 && slave.bellySag < 5) {
			r.push(`Due to the large amount of fat removed from ${his} midsection, it droops noticeably after the surgery.`);
			slave.bellySag = 5;
		}

		reaction.longReaction.push(r);
		return reaction;
	}
};

App.Medicine.Surgery.Procedures.Liposuction = class extends App.Medicine.Surgery.Procedure {
	get name() {
		if (this.originalSlave.weight > 190) {
			return "Major liposuction";
		} else if (this.originalSlave.weight > 130) {
			return "Heavy liposuction";
		} else {
			return "Liposuction";
		}
	}

	get healthCost() {
		if (this.originalSlave.weight > 190) {
			return 40;
		} else if (this.originalSlave.weight > 130) {
			return 20;
		} else {
			return 10;
		}
	}

	apply(cheat) {
		this._slave.weight = 0;
		return this._assemble(new App.Medicine.Surgery.Reactions.Liposuction());
	}
};


code:
App.Medicine.Surgery.Reactions.Ribs = class extends App.Medicine.Surgery.SimpleReaction {
	reaction(slave, diff) {
		const reaction = super.reaction(slave, diff);
		const {He, he, his, him, himself} = getPronouns(slave);
		const r = [];

		if (slave.fetish === "mindbroken") {
			r.push(`${He}'s desperately stiff and sore. It takes a good while for ${him} to figure out what has happened, but eventually ${his} careful investigations discern that the cause is ${his} new extremely narrow waist. Since the surgery was invasive, ${his} health has been greatly affected.`);
		} else if (slave.behavioralFlaw === "anorexic") {
			r.push(`${He}'s desperately stiff and sore. It takes a good while for ${him} to figure out what has happened, but eventually ${his} careful investigations discern that the cause of ${his} extremely narrow waist is that ${his} ribcage has been shortened. ${He} gasps with shock, and when ${he}`);
			if (canSee(slave)) {
				r.push(`looks at you, you see awe in ${his} eyes.`);
			} else {
				r.push(`turns to face you, you see awe on ${his} face.`);
			}
			r.push(`As an anorexic ${he} thinks you have brought ${him} closer to the true ideal. Since the surgery was invasive, ${his} health has been greatly affected.`);
			reaction.devotion += 4;
		} else if (slave.devotion > 50) {
			r.push(`${He}'s desperately stiff and sore. It takes a good while for ${him} to figure out what has happened, but eventually ${his} careful investigations discern that the cause of ${his} extremely narrow waist is that ${his} ribcage has been shortened. ${He} gasps with shock, and when ${he}`);
			if (canSee(slave)) {
				r.push(`looks at you, you see awe and fear in ${his} eyes.`);
			} else {
				r.push(`turns to you, you see awe and fear on ${his} face.`);
			}
			r.push(`${He} has become more submissive due to your radical reshaping of ${his} body. Since the surgery was invasive, ${his} health has been greatly affected.`);
			reaction.devotion += 4;
		} else if (slave.devotion > 20) {
			r.push(`${He}'s desperately stiff and sore. It takes a good while for ${him} to figure out what has happened, but eventually ${his} careful investigations discern that the cause of ${his} extremely narrow waist is that ${his} ribcage has been shortened. ${He} gasps with shock, but eventually ${his} shoulders slump and ${he} tries to carry on. ${He} isn't much affected mentally. Since the surgery was invasive, ${his} health has been greatly affected.`);
		} else {
			r.push(`${He}'s desperately stiff and sore. It takes a good while for ${him} to figure out what has happened, but eventually ${his} careful investigations discern that the cause of ${his} extremely narrow waist is that ${his} ribcage has been shortened. ${He} gasps with shock, wobbles a little, gasps with pain at the soreness as ${he} does, and then manages to hold ${himself} upright and still as ${he} sobs. The surgical invasion has filled ${him} with horror and anger. Since the surgery was invasive, ${his} health has been greatly affected. ${He} is terribly afraid of your total power over ${his} body.`);
			reaction.trust -= 10;
			reaction.devotion -= 10;
		}

		reaction.longReaction.push(r);
		return reaction;
	}
};

App.Medicine.Surgery.Procedures.Ribs = class extends App.Medicine.Surgery.Procedure {
	get name() {
		const {his} = getPronouns(this.originalSlave);
		return `Remove ribs to severely narrow ${his} waist`;
	}

	get healthCost() {
		return 40;
	}

	apply(cheat) {
		this._slave.waist = -100;
		return this._assemble(new App.Medicine.Surgery.Reactions.Ribs());
	}
};


code:
App.Medicine.Surgery.Reactions.Waist = class extends App.Medicine.Surgery.SimpleReaction {
	reaction(slave, diff) {
		const reaction = super.reaction(slave, diff);
		const {He, he, his, him, himself} = getPronouns(slave);
		const r = [];

		if (slave.fetish === "mindbroken") {
			r.push(`While ${he} notices how sore ${his} waist is, ${he} fails to find the reason why. Since the surgery was invasive, <span class="health dec">${his} health has been greatly affected.</span>`);
		} else if (slave.behavioralFlaw === "anorexic") {
			if (canSee(slave)) {
				r.push(`${He} looks over ${his} new waist experimentally`);
			} else {
				r.push(`${He} shifts ${his} weight experimentally`);
			}
			r.push(`and turns to you with a smile to show it off. As an anorexic ${he} thinks you have brought ${him} closer to the true ideal. Since the surgery was invasive, ${his} health has been greatly affected.`);
			reaction.devotion += 4;
		} else if (slave.devotion > 50) {
			if (canSee(slave)) {
				r.push(`${He} looks over ${his} new waist experimentally`);
			} else {
				r.push(`${He} shifts ${his} weight experimentally`);
			}
			r.push(`and turns to you with a smile to show it off. ${He}'s still sore, so ${he} doesn't bend or flirt, but ${he} turns around to let you see it from all angles. ${He}'s happy with your changes to ${his} waist. As with all surgery ${his} health has been slightly affected.`);
			reaction.devotion += 4;
		} else if (slave.devotion >= -20) {
			r.push(`${He}`);
			if (canSee(slave)) {
				r.push(`eyes ${his} new waist`);
			} else {
				r.push(`shifts ${his} weight`);
			}
			r.push(`skeptically. ${He}'s still sore, so ${he} doesn't bend or touch ${himself}. ${He}'s come to terms with the fact that ${he}'s a slave, so ${he} expected something like this when ${he} was sent to the surgery. ${He} isn't much affected mentally. As with all surgery ${his} health has been slightly affected. ${He} is sensibly fearful of your total power over ${his} body.`);
			reaction.trust -= 5;
		} else {
			if (canSee(slave)) {
				r.push(`${He} eyes ${his} new waist`);
			} else {
				r.push(`How light ${he} feels fills ${him}`);
			}
			r.push(`with resentment. ${He}'s still sore, so ${he} doesn't bend or touch ${himself}, but ${canSee(slave) ? `${he} glares daggers` : `${his} face contorts with distaste`}. ${He} still thinks of ${himself} as a person, so ${he} isn't used to the idea of being surgically altered to suit your every whim. For now, ${he} seems to view this fake figure as a cruel imposition. As with all surgery ${his} health has been slightly affected. ${He} is terribly afraid of your total power over ${his} body.`);
			reaction.trust -= 10;
			reaction.devotion -= 5;
		}

		reaction.longReaction.push(r);
		return reaction;
	}
};

App.Medicine.Surgery.Procedures.WaistReduction = class extends App.Medicine.Surgery.Procedure {
	get name() {
		return "Liposuction";
	}

	get healthCost() {
		return 10;
	}

	apply(cheat) {
		this._slave.waist -= 20;
		return this._assemble(new App.Medicine.Surgery.Reactions.Waist());
	}
};