code:
App.Medicine.Surgery.Reactions.CervixPumpAnus = 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 = [];

		// TODO: unify with normal cervix pump?

		const cervixPumpAcheLocation = "anus";
		const cervixPumpLocation = "rectum";

		if (slave.fetish === Fetish.MINDBROKEN) {
			r.push(`${He} leaves the surgery with nothing but a nonspecific ache in ${his} lower abdomen and ${cervixPumpAcheLocation} that ${he} cannot figure out the source of. As with all surgery ${his} health has been slightly affected.`);
		} else if (slave.devotion > 50) {
			r.push(`${He} leaves the surgery with nothing but a nonspecific ache in ${his} lower abdomen and ${cervixPumpAcheLocation}, and as such, knows you put something into ${his} ${cervixPumpLocation}. ${He} is curious about the details of the implant, and eagerly awaits to see the end result. 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 and ${cervixPumpAcheLocation}, and as such, knows you put something into ${his} ${cervixPumpLocation}. ${He} understands the realities of ${his} life as a slave, but ${he} is still surprised at what now resides in ${his} ${cervixPumpLocation}. 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 and ${cervixPumpAcheLocation}, but ${he} knows enough about surgery and sex slaves to believe that ${he} has modified in ${his} backdoor. ${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}'s been subject of such modifications. Even after what has been implanted into ${his} rear hole is explained to ${him}, ${he} is no less defiant; though ${he} is relieved that it isn't some permanent mutilation, ${he} only feels dirty and humiliated when ${he} thinks of anal sex slowly rounding ${his} middle. 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;
		}
		if (slave.mpreg === 1) {
			r.push(`${His} existing anal womb made the surgery <span class="health inc">slightly easier.</span>`);
		}

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

App.Medicine.Surgery.Procedures.CervixPumpAnus = class extends App.Medicine.Surgery.Procedure {
	get name() {
		return "Install rectal micropump filter";
	}

	get description() {
		const {his} = getPronouns(this.originalSlave);
		return `Will allow ${his} belly implant to slowly swell as people cum in ${his} anus`;
	}

	get healthCost() {
		return this.originalSlave.mpreg === 1 ? 10 : 20;
	}

	apply(cheat) {
		this._slave.cervixImplant = this._slave.cervixImplant === 0 ? 2 : 3;
		return this._assemble(new App.Medicine.Surgery.Reactions.CervixPumpAnus());
	}
};


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

		r.push(`${He} leaves the surgery with a soreness on ${his} lower abdomen,`);
		if (slave.fetish === Fetish.MINDBROKEN) {
			r.push(`and finds ${his} belly isn't so saggy anymore. As with all surgery <span class="health dec">${his} health has been slightly affected.</span>`);
		} else {
			r.push(`and is <span class="devotion inc">pleased</span> to find it's no longer saggy. ${He}'s happy that ${he}'ll be able to show off ${his}`);
			if (slave.weight > 95) {
				r.push(`big soft belly${(slave.weight > 130) ? `, for a while at least,` : ``}`);
			} else if (slave.weight > 30) {
				r.push(`soft belly`);
			} else if (slave.muscles > 30) {
				r.push(`muscular belly`);
			} else if (slave.muscles > 5) {
				r.push(`once again firm, ripped belly`);
			} else {
				r.push(`once again firm, flat belly`);
			}
			r.push(`without being self conscious about it. As with all surgery <span class="health dec">${his} health has been affected.</span>`);
			reaction.devotion += 2;
		}

		reaction.longReaction.push(r);
		return reaction;
	}
};
App.Medicine.Surgery.Procedures.TummyTuck = class extends App.Medicine.Surgery.Procedure {
	get name() {
		return "Tummy tuck";
	}

	get healthCost() {
		return 20;
	}

	apply(cheat) {
		this._slave.bellySag = 0;
		this._slave.bellySagPreg = 0;
		return this._assemble(new App.Medicine.Surgery.Reactions.TummyTuck());
	}
};

repo_name: Ducati/fc

license: mit


code:
App.Medicine.Surgery.Reactions.Womb = class extends App.Medicine.Surgery.SimpleReaction {
	reaction(slave, diff) {
		const reaction = super.reaction(slave, diff);
		const {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 belly. As with all invasive surgery ${his} health has been greatly affected.`);

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

App.Medicine.Surgery.Procedures.InstallMesh = class extends App.Medicine.Surgery.Procedure {
	get name() {
		return "Install reinforcing organic mesh";
	}

	get healthCost() {
		return 25;
	}

	apply(cheat) {
		this._slave.wombImplant = "restraint";
		return this._assemble(new App.Medicine.Surgery.Reactions.Womb());
	}
};

App.Medicine.Surgery.Procedures.RemoveMesh = class extends App.Medicine.Surgery.Procedure {
	get name() {
		return "Remove organic mesh";
	}

	get description() {
		return this.originalSlave.health.health < 0 ? `This may cause severe health issues` : "";
	}

	get healthCost() {
		return 50;
	}

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


code:
App.Medicine.Surgery.Reactions.Desmell = 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 nasal surgery is brief, with nothing more than minor health effects. In the sterile environment of the autosurgery, ${he}'s unable to notice any impairment to ${his} sense of smell, and so must wait to discover the change when ${he}'s released much later on.`);
		if (this._hasEmotion(slave)) {
			if (slave.devotion > 50) {
				r.push(`When ${he} finally figures it out, ${he} begins to cry, not understanding why it's necessary that ${he} be unable to smell. After a few sniffles, ${he} carries on.`);
			} else if (slave.devotion > 20) {
				r.push(`When ${he} finally figures it out, ${he} begins to tear up, not understanding what ${he} did to earn this. After a short expurgation of sadness and fear, ${he} takes a deep breath and suppresses ${his} emotions.`);
				reaction.trust -= 10;
			} else {
				r.push(`When ${he} realizes what's happened, ${his} face fills with anger. ${He} views this as another pointless way to assert your authority over ${him}. After briefly shuddering with fear at that thought, ${he} morosely returns to ${his} duties.`);
				reaction.trust -= 4;
				reaction.devotion -= 4;
			}
		}

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

App.Medicine.Surgery.Procedures.Desmell = class extends App.Medicine.Surgery.Procedure {
	get name() {
		return "Remove sense of smell";
	}

	get healthCost() {
		return 10;
	}

	apply(cheat) {
		this._slave.smells = -1;
		return this._assemble(new App.Medicine.Surgery.Reactions.Desmell());
	}
};

App.Medicine.Surgery.Reactions.Resmell = 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 nasal surgery is brief, with nothing more than minor health effects. In the sterile environment of the autosurgery, ${he}'s unable to notice any improvement to ${his} sense of smell, and so must wait to discover the change when ${he}'s released much later on.`);
		if (this._hasEmotion(slave)) {
			if (slave.devotion > 50) {
				r.push(`${He} loved you before, but ${he}'s <span class="devotion inc">still grateful,</span> and maybe even a bit <span class="trust inc">more trusting,</span> too.`);
			} else if (slave.devotion > 20) {
				r.push(`${He} accepted you as ${his} owner before, but ${he}'s <span class="devotion inc">still grateful,</span> and maybe even a bit <span class="trust inc">more trusting,</span> too.`);
			} else {
				r.push(`${He} hardly knows what to make of this present from someone ${he} hates, and questions if the gift conceals some sort of snare. After a while, though, ${he} accepts that you did help ${him}, and, perhaps, might be trustworthy.`);
			}
			reaction.devotion += 15;
			reaction.trust += 15;
		}

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

App.Medicine.Surgery.Procedures.Resmell = class extends App.Medicine.Surgery.Procedure {
	get name() {
		return "Repair sense of smell";
	}

	get healthCost() {
		return 10;
	}

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


code:
// cSpell:ignore Detaste

App.Medicine.Surgery.Reactions.Detaste = 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 oral surgery is brief, with nothing more than minor health effects. In the sterile environment of the autosurgery, ${he}'s unable to notice any impairment to ${his} sense of taste, and so must wait to discover the change when ${he}'s released much later on.`);
		if (this._hasEmotion(slave)) {
			if (slave.devotion > 50) {
				r.push(`When ${he} finally figures it out, ${he} begins to cry, not understanding why it's necessary that ${he} be unable to taste. After a few sniffles, ${he} carries on.`);
			} else if (slave.devotion > 20) {
				r.push(`When ${he} finally figures it out, ${he} begins to tear up, not understanding what ${he} did to earn this. After a short expurgation of sadness and fear, ${he} takes a deep breath and suppresses ${his} emotions.`);
				reaction.trust -= 10;
			} else {
				r.push(`When ${he} realizes what's happened, ${his} face fills with anger. ${He} views this as another pointless way to assert your authority over ${him}. After briefly shuddering with fear at that thought, ${he} morosely returns to ${his} duties.`);
				reaction.trust -= 4;
				reaction.devotion -= 4;
			}
		}

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

App.Medicine.Surgery.Procedures.Detaste = class extends App.Medicine.Surgery.Procedure {
	get name() {
		return "Remove sense of taste";
	}

	get healthCost() {
		return 10;
	}

	apply(cheat) {
		this._slave.tastes = -1;
		return this._assemble(new App.Medicine.Surgery.Reactions.Detaste());
	}
};

App.Medicine.Surgery.Reactions.Retaste = 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 oral surgery is brief, with nothing more than minor health effects. In the sterile environment of the autosurgery, ${he}'s unable to notice any improvement to ${his} sense of taste, and so must wait to discover the change when ${he}'s released much later on.`);
		if (this._hasEmotion(slave)) {
			if (slave.devotion > 50) {
				r.push(`${He} loved you before, but ${he}'s <span class="devotion inc">still grateful,</span> and maybe even a bit <span class="trust inc">more trusting,</span> too.`);
			} else if (slave.devotion > 20) {
				r.push(`${He} accepted you as ${his} owner before, but ${he}'s <span class="devotion inc">still grateful,</span> and maybe even a bit <span class="trust inc">more trusting,</span> too.`);
			} else {
				r.push(`${He} hardly knows what to make of this present from someone ${he} hates, and questions if the gift conceals some sort of snare. After a while, though, ${he} accepts that you did help ${him}, and, perhaps, might be trustworthy.`);
			}
			reaction.devotion += 15;
			reaction.trust += 15;
		}

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

App.Medicine.Surgery.Procedures.Retaste = class extends App.Medicine.Surgery.Procedure {
	get name() {
		return "Repair sense of taste";
	}

	get healthCost() {
		return 10;
	}

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


code:
App.Medicine.Surgery.Reactions.CochlearImplant = 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.hears <= -2) {
			r.push(`The implant surgery is invasive and ${he} spends some time in the autosurgery recovering. As soon as the bandages around ${his} ears are removed, ${his} head tilts towards any source of sound with manic speed as ${he} processes a nearly overwhelming amount of auditory information. Hearing the world as it is is a gift that those who do not need it cannot properly understand.`);
			if (this._hasEmotion(slave)) {
				if (slave.devotion > 50) {
					r.push(`${He} loved you before, but ${he}'s very grateful, and more trusting, too. ${He} never realized just how nice your voice was, and now ${he} can't get your words out of ${his} mind.`);
					if (slave.relationship === 0) {
						slave.relationship = -2;
					}
				} else if (slave.devotion > 20) {
					r.push(`${He} accepted you as ${his} owner before, but ${he}'s <span class="devotion inc">very grateful,</span> and <span class="trust inc">more trusting,</span> too.`);
				} else {
					r.push(`${He} hardly knows what to make of this wonderful present from someone ${he} hates, and struggles with suspicion that the gift conceals some sort of snare. After a while, though, ${he} accepts that you truly did help ${him}, and might be trustworthy.`);
				}
				reaction.devotion += 25;
				reaction.trust += 25;
			}
		} else {
			r.push(`The implant surgery is invasive and ${he} spends some time in the autosurgery recovering. When the bandages around ${his} ears are removed the amount of auditory information makes ${him} reel.`);
			if (this._hasEmotion(slave)) {
				if (slave.devotion > 50) {
					r.push(`${He} is <span class="devotion inc">grateful,</span> for ${his} improved hearing, and knowing how much you invested in ${him} makes ${him} <span class="trust inc">trust you more</span> as well.`);
					reaction.devotion += 10;
					reaction.trust += 10;
				} else if (slave.devotion > 20) {
					r.push(`${He} has mixed feelings about ${his} new implant, but ${he}'s aware how valuable such implants are, and ${he} already accepted that you have complete control over ${his} body.`);
					reaction.devotion += 5;
					reaction.trust += 10;
				} else {
					r.push(`${He} is <span class="trust dec">disturbed</span> that you've placed something mechanical in ${his} head and afraid of increased control over ${him} that such device grants.`);
					reaction.devotion -= 5;
				}
			}
		}
		reaction.longReaction.push(r);
		return reaction;
	}
};

App.Medicine.Surgery.Procedures.CochlearImplant = class extends App.Medicine.Surgery.Procedure {
	get name() {
		const {him} = getPronouns(this._slave);
		return `Give ${him} cochlear implants`;
	}

	get healthCost() {
		return 20;
	}

	apply(cheat) {
		this._slave.earImplant = 1;
		this._slave.hears = 0;
		return this._assemble(new App.Medicine.Surgery.Reactions.CochlearImplant());
	}
};


code:
App.Medicine.Surgery.Reactions.Deafen = 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(`The inner ear surgery is brief, with nothing more than minor health effects. As soon as the bandages around ${his} ears are removed, ${he} begins to twist and turn ${his} head frantically, not immediately understanding that this silence is ${his} new reality.`);
		if (this._hasEmotion(slave)) {
			if (slave.devotion > 50) {
				r.push(`When ${he} finally figures it out, ${he} begins to weep, not understanding why it's necessary that ${he} be unable to hear. After a short cry that trails off into a few sniffles, ${he} carries on.`);
			} else if (slave.devotion > 20) {
				r.push(`When ${he} finally figures it out, ${he} begins to bawl, not understanding what ${he} did to earn this. After a short expurgation of grief and terror, ${he} takes a deep breath and visibly suppresses ${his} emotions.`);
				reaction.trust -= 20;
			} else {
				r.push(`When ${he} realizes what's happened, ${his} face clouds with rage. ${He} begins to peer around, looking for the source of ${his} woes. ${He} finally understands the true use of deafness when ${he} realizes ${he} won't be able to easily tell where you are, or anyone else is for that matter. ${His} well-being is now firmly in the hands of someone ${he} distrusts. ${He} begins to shake with fear.`);
				reaction.trust -= 8;
				reaction.devotion -= 8;
			}
		}
		reaction.longReaction.push(r);
		return reaction;
	}
};

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

	get healthCost() {
		return 10;
	}

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


code:
App.Medicine.Surgery.Reactions.EarFix = 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 inner ear surgery is brief, with nothing more than minor health effects. As soon as ${he} is allowed to open ${his} eyes and look around, ${his} gaze flicks from object to object with manic speed as ${he} identifies each and every newly clear sound. Hearing the world as it is without hearing aids is a gift that those who do not need it cannot properly understand.`);
		if (this._hasEmotion(slave)) {
			if (slave.devotion > 50) {
				r.push(`${He} loved you before, but ${he}'s <span class="devotion inc">very grateful,</span> and <span class="trust inc">more trusting,</span> too.`);
			} else if (slave.devotion >= -20) {
				r.push(`${He} accepted you as ${his} owner before, but ${he}'s <span class="devotion inc">very grateful,</span> and <span class="trust inc">more trusting,</span> too.`);
			} else {
				r.push(`${He} hardly knows what to make of this wonderful present from someone ${he} hates, and struggles with suspicion that the gift conceals some sort of snare. After a while, though, ${he} accepts that you truly did help ${him}, and might be trustworthy.`);
			}
			reaction.devotion += 5;
			reaction.trust += 5;
		}

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

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

	get healthCost() {
		return 10;
	}

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


code:
App.Medicine.Surgery.Reactions.EarGone = 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 === Fetish.MINDBROKEN) {
			r.push(`${He} shows little reaction to ${his} altered ears. Since the surgery was fairly invasive, <span class="health dec">${his} health has been greatly affected.</span>`);
		} else if (slave.devotion > 50) {
			r.push(`${He} is horrified that you would disfigure ${him} but ultimately accepts it since ${he} is devoted to you. Since the surgery was fairly invasive, ${his} health has been greatly affected.`);
		} else if (slave.devotion >= -20) {
			r.push(`${He} is horrified that you would disfigure ${him}, ${he}'s come to terms with the fact that ${he}'s a slave, but ${he} is still angry that you would go this far. Since the surgery was fairly invasive, ${his} health has been greatly affected. ${He} is sensibly fearful of your total power over ${his} body.`);
			reaction.trust -= 10;
			reaction.devotion -= 10;
		} else {
			r.push(`${He} is horrified that you would disfigure ${him} and begins to weep openly as soon as ${he} discovers the loss.${He} seems to consider the loss as a cruel theft. Since the surgery was fairly invasive, ${his} health has been greatly affected. ${He} is now terribly afraid of your total power over ${his} body.`);
			reaction.trust -= 20;
			reaction.devotion -= 20;
		}
		reaction.longReaction.push(r);

		return reaction;
	}
};

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

	get healthCost() {
		return 20;
	}

	apply(cheat) {
		surgeryAmp(this._slave, "left ear");
		surgeryAmp(this._slave, "right ear");
		if (this._slave.hears !== -2 && this._slave.earImplant !== 1) {
			this._slave.hears = -1;
		}
		return this._assemble(new App.Medicine.Surgery.Reactions.EarGone());
	}
};

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

	get healthCost() {
		return 20;
	}

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


code:
App.Medicine.Surgery.Reactions.EarMajor = 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 === Fetish.MINDBROKEN) {
			r.push(`${He} shows little reaction to ${his} altered ears. Since the surgery was fairly invasive, <span class="health dec">${his} health has been greatly affected.</span>`);
		} else if (slave.devotion > 50) {
			if (canSee(slave)) {
				r.push(`${He} looks in the mirror and turns ${his} head side to side admiring ${his} new ears and they twitch in response, surprising ${him},`);
			} else {
				r.push(`${He} can't see but it's clear from the dull ache that ${his} ears have been extensively modified,`);
			}
			if (hasAnyArms(slave)) {
				r.push(`they're still a bit sore, but ${he} reaches up to feel them gently`);
			}
			r.push(`${he} turns to you with a smile, tilting ${his} head at various angles to show them off. ${His} new ears seem to respond to ${his} emotional state, with time and mild electro-stimulation ${he} will learn to control ${his} new ear muscles so ${he} can move them at will, for now ${he} seems to think ${his} new ears are cute. Since the surgery was fairly invasive, ${his} health has been greatly affected.`);
			reaction.devotion += 4;
		} else if (slave.devotion >= -20) {
			if (canSee(slave)) {
				r.push(`${He} eyes ${his} new ears disapprovingly and they twitch slightly in response.`);
			} else {
				r.push(`${He} can't see but it's clear from the dull ache that ${his} ears have been extensively modified.`);
			}
			if (hasAnyArms(slave)) {
				r.push(`${He}'s still a bit sore, but ${he} reaches up to feel them gently.`);
			}
			r.push(`${His} new ears seem to respond to ${his} emotional state, with time and mild electro-stimulation ${he} will learn to control ${his} new ear muscles so ${he} can move them at will. ${He}'s come to terms with the fact that ${he}'s a slave, but ${he} is still somewhat angry that you would go this far. Since the surgery was fairly invasive, ${his} health has been greatly affected. ${He} is sensibly fearful of your total power over ${his} body.`);
			reaction.trust -= 5;
			reaction.devotion -= 5;
		} else {
			if (canSee(slave)) {
				r.push(`${He} eyes ${his} new ears with disgust and they twitch slightly in response.`);
			} else {
				r.push(`${He} can't see but it's clear from the dull ache that ${his} ears have been extensively modified.`);
			}
			if (hasAnyArms(slave)) {
				r.push(`${He}'s still a bit sore, but ${he} reaches up to feel them gently.`);
			}
			r.push(`${His} new ears seem to respond to ${his} emotional state, with time and mild electro-stimulation ${he} will learn to control ${his} new ear muscles so ${he} can move them at will. For now, ${he} seems to view ${his} altered ears as a cruel imposition. Since the surgery was fairly invasive, ${his} health has been greatly affected. ${He} is now 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.EarMajorReshape = class extends App.Medicine.Surgery.Procedure {
	/**
	 * @param {App.Entity.SlaveState} slave
	 * @param {string} shapeName
	 * @param {FC.EarShape} newShape
	 */
	constructor(slave, shapeName, newShape) {
		super(slave);
		this.shapeName = shapeName;
		this.targetShape = newShape;
	}

	get name() {
		return `Reshape into ${this.shapeName} ears`;
	}

	get healthCost() {
		return 10;
	}

	apply(cheat) {
		this._slave.earShape = this.targetShape;
		return this._assemble(new App.Medicine.Surgery.Reactions.EarMajor());
	}
};

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

	get name() {
		return `Reshape into ${this.newShape} ears`;
	}

	get healthCost() {
		return 10;
	}

	apply(cheat) {
		this._slave.earT = this.newShape;
		return this._assemble(new App.Medicine.Surgery.Reactions.EarMajor());
	}
};


code:
App.Medicine.Surgery.Reactions.EarMinor = 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 === Fetish.MINDBROKEN) {
			r.push(`${He} shows little reaction to ${his} altered ears. The modification surgery is brief, with <span class="health dec">nothing more than minor health effects.</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 ears,`);
			} else {
				r.push(`${He} can't see but it's clear from the dull ache in ${his} ears that they have been modified,`);
			}
			if (hasAnyArms(slave)) {
				r.push(`they're still a bit sore, but ${he} reaches up to feel them gently,`);
			}
			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 ears are cute. The modification surgery is brief, with nothing more than minor health effects.`);
			reaction.devotion += 4;
		} else if (slave.devotion >= -20) {
			if (canSee(slave)) {
				r.push(`${He} eyes ${his} new ears skeptically.`);
			} else {
				r.push(`${He} can't see but it's clear from the dull ache in ${his} ears that they have been modified.`);
			}
			if (hasAnyArms(slave)) {
				r.push(`${He}'s still a bit sore, but ${he} reaches up to feel 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 ${his} ears reshaped. The modification surgery is brief, with nothing more than minor health effects. ${He} is sensibly fearful of your total power over ${his} body.`);
			reaction.trust -= 5;
		} else {
			if (canSee(slave)) {
				r.push(`${He} eyes ${his} new ears with disdain.`);
			} else {
				r.push(`${He} can't see but it's clear from the dull ache in ${his} ears that they have been modified.`);
			}
			if (hasAnyArms(slave)) {
				r.push(`${He}'s still a bit sore, but ${he} reaches up to feel them gently, as if to confirm it's not some trick.`);
			}
			r.push(`For now, ${he} seems to view ${his} altered ears as a cruel imposition. The modification surgery is brief, with nothing more than minor health effects. ${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.EarMinorReshape = class extends App.Medicine.Surgery.Procedure {
	/**
	 * @param {App.Entity.SlaveState} slave
	 * @param {string} shapeName
	 * @param {FC.EarShape} newShape
	 */
	constructor(slave, shapeName, newShape) {
		super(slave);
		this.shapeName = shapeName;
		this.targetShape = newShape;
	}

	get name() {
		return `Reshape into ${this.shapeName} ears`;
	}

	get healthCost() {
		return 10;
	}

	apply(cheat) {
		this._slave.earShape = this.targetShape;
		return this._assemble(new App.Medicine.Surgery.Reactions.EarMinor());
	}
};

App.Medicine.Surgery.Procedures.TopEarsImplantHair = class extends App.Medicine.Surgery.Procedure {
	get name() {
		return "Implant hair mimicking fibers";
	}

	get healthCost() {
		return 10;
	}

	apply(cheat) {
		this._slave.earTColor = this._slave.hColor;
		return this._assemble(new App.Medicine.Surgery.Reactions.EarMinor());
	}
};

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

	get healthCost() {
		return 10;
	}

	apply(cheat) {
		this._slave.earTColor = "hairless";
		return this._assemble(new App.Medicine.Surgery.Reactions.EarMinor());
	}
};

App.Medicine.Surgery.Procedures.OFImplantEars = class extends App.Medicine.Surgery.Procedure {
	get name() {
		return this.originalSlave.earShape === "none" ? "Attach" : "Replace";
	}

	get description() {
		return this.originalSlave.earShape === "none" ? "" : "replace current ears with normal human ears";
	}

	get healthCost() {
		return this.originalSlave.earShape === "none" ? 15 : 20;
	}

	apply(cheat) {
		this._slave.earShape = "normal";
		if (this.originalSlave.earShape === "none") {
			if (this._slave.hears === -1) {
				this._slave.hears = 0;
			}
		}
		return this._assemble(new App.Medicine.Surgery.Reactions.EarMinor());
	}
};

App.Medicine.Surgery.Procedures.OFImplantTopEars = class extends App.Medicine.Surgery.Procedure {
	get name() {
		return this.originalSlave.earT === "none" ? "Attach" : "Replace";
	}

	get description() {
		return this.originalSlave.earT === "none" ? "" : "replace current top ears with normal ears";
	}

	get healthCost() {
		return this.originalSlave.earT === "none" ? 10 : 20;
	}

	apply(cheat) {
		this._slave.earT = "normal";
		this._slave.earTColor = "hairless";
		return this._assemble(new App.Medicine.Surgery.Reactions.EarMinor());
	}
};


code:
App.Medicine.Surgery.Reactions.EarMuffle = 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 inner ear surgery is brief, with nothing more than minor health effects. As soon as ${he} is allowed to open ${his} eyes and look around, ${he} begins to glance back and forth frantically, not immediately understanding that this muffled world is ${his} new reality.`);
		if (this._hasEmotion(slave)) {
			if (slave.devotion > 50) {
				r.push(`When ${he} finally figures it out, ${he} begins to weep, not understanding why it's necessary that ${he} not be able to hear clearly. After a short cry that trails off into a few sniffles, ${he} carries on.`);
			} else if (slave.devotion > 20) {
				r.push(`When ${he} finally figures it out, ${he} begins to bawl, not understanding what ${he} did to earn this. After a short expurgation of grief and terror, ${he} takes a deep breath and visibly suppresses ${his} emotions.`);
				reaction.trust -= 5;
			} else {
				r.push(`When ${he} realizes what's happened, ${his} face clouds with rage. Reflexively, ${he} begins to peer around, looking for the source of ${his} woes. ${He} finally understands the true import of muffled hearing when your hands grab ${him} from behind, and begins to shake with fear.`);
				reaction.trust -= 10;
				reaction.devotion -= 10;
			}
		}

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

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

	get healthCost() {
		return 10;
	}

	apply(cheat) {
		this._slave.hears = -1;
		return this._assemble(new App.Medicine.Surgery.Reactions.EarMuffle());
	}
};


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

		if (slave.fetish === Fetish.MINDBROKEN) {
			r.push(`${He} shows little reaction to ${his} altered ears. Since the surgery was fairly invasive, <span class="health dec">${his} health has been greatly affected.</span>`);
		} else { // TODO: Will expand in future
			r.push(`${He} is delighted to have ${his} ears back. Since the surgery was fairly invasive, <span class="health dec">${his} health has been greatly affected.</span>`);
		}

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

App.Medicine.Surgery.Procedures.EarRestore = class extends App.Medicine.Surgery.Procedure {
	get name() {
		return this._slave.earShape === "damaged" ? "Repair" : "Restore to normal";
	}

	get healthCost() {
		return 10;
	}

	apply(cheat) {
		this._slave.earShape = "normal";
		return this._assemble(new App.Medicine.Surgery.Reactions.EarRestore());
	}
};


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

		r.push(`The implant surgery is <span class="health dec">invasive</span> and ${he} spends some time in the autosurgery recovering. As soon as the bandages around ${his} ears are removed, ${he}`);
		if (slave.fetish === Fetish.MINDBROKEN) {
			r.push(`returns to ${his} normal activities, none the wiser.`);
		} else {
			r.push(`initially believes nothing has changed, but soon discovers ${his} hearing is no longer technologically enhanced.`);
		}

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

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

	get description() {
		return "remove cochlear implants before implanting organic cochleae";
	}

	get healthCost() {
		return 20;
	}

	apply(cheat) {
		this._slave.hears = 0;
		this._slave.earImplant = 0;
		return this._assemble(new App.Medicine.Surgery.Reactions.NewEars());
	}
};


code:
App.Medicine.Surgery.Reactions.Undeafen = 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 inner ear surgery is invasive and ${he} spends some time in the autosurgery recovering. As soon as the bandages around ${his} ears are removed, ${his} head tilts towards any source of sound with manic speed as ${he} processes ${his} new hearing. Hearing the world as it is is a gift that those who do not need it cannot properly understand.`);
		if (this._hasEmotion(slave)) {
			if (slave.devotion > 50) {
				r.push(`${He} loved you before, but ${he}'s very grateful, and more trusting, too. ${He} never realized just how nice your voice was, and now ${he} can't get your words out of ${his} mind.`);
				if (slave.relationship === 0) {
					slave.relationship = -2;
				}
			} else if (slave.devotion > 20) {
				r.push(`${He} accepted you as ${his} owner before, but ${he}'s <span class="devotion inc">very grateful,</span> and <span class="trust inc">more trusting,</span> too.`);
			} else {
				r.push(`${He} hardly knows what to make of this wonderful present from someone ${he} hates, and struggles with suspicion that the gift conceals some sort of snare. After a while, though, ${he} accepts that you truly did help ${him}, and might be trustworthy.`);
			}
			reaction.devotion += 25;
			reaction.trust += 25;
		}
		reaction.longReaction.push(r);
		return reaction;
	}
};

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

	get healthCost() {
		return 20;
	}

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


code:
App.Medicine.Surgery.Reactions.Race = 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 === Fetish.MINDBROKEN) {
			if (canSee(slave)) {
				r.push(`${He} pauses when ${he} sees the changes to ${his} body, unable to comprehend them.`);
			} else {
				r.push(`${He} can't discern the changes to ${his} race and likely never will.`);
			}
			r.push(`As with all invasive surgery <span class="health dec">${his} health has been affected.</span>`);
		} else if (slave.devotion > 50) {
			r.push(`${He}`);
			if (canSee(slave)) {
				r.push(`examines ${his} new self in the mirror`);
			} else if (canHear(slave)) {
				r.push(`listens to the description of ${his} new self`);
			} else {
				r.push(`gets a feel for the changes to ${his} body`);
			}
			r.push(`with approval.`);
			if (diff.race === slave.origRace) {
				r.push(`${He} recognizes ${himself} as ${he} was, and`);
			} else {
				r.push(`${He} doesn't recognize ${himself} quite yet, but`);
			}
			r.push(`${he} hopes you'll like ${his} new appearance better and use ${him} more frequently as a result. ${He}'s happy with your changes to ${his} racial appearance. As with all invasive surgery ${his} health has been affected.`);
			reaction.devotion += 4;
		} else if (slave.devotion >= -20) {
			r.push(`${He}`);
			if (canSee(slave)) {
				r.push(`examines ${his} new self in the mirror`);
			} else if (canHear(slave)) {
				r.push(`listens to the description of ${his} new self`);
			} else {
				r.push(`gets a feel for the changes to ${his} body`);
			}
			r.push(`with hesitation.`);
			if (diff.race === slave.origRace) {
				r.push(`${He} recognizes ${himself} as ${he} was, and`);
			} else {
				r.push(`${He} doesn't recognize ${himself} quite yet, but`);
			}
			r.push(`${he} hopes you'll like ${his} new appearance better and treat ${him} more kindly as a result. 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 {
			r.push(`${He}`);
			if (canSee(slave)) {
				r.push(`examines ${his} new self in the mirror`);
			} else if (canHear(slave)) {
				r.push(`listens to the description of ${his} new self`);
			} else {
				r.push(`gets a feel for the changes to ${his} body`);
			}
			r.push(`with revulsion.`);
			if (diff.race === slave.origRace) {
				r.push(`${He} recognizes ${himself} as ${he} was, which ${he} loves, and`);
			} else {
				r.push(`${He} doesn't recognize ${himself} quite yet, which ${he} hates, though`);
			}
			r.push(`${he} hopes you'll like ${his} new appearance better and punish ${him} less cruelly as a result. For now, <span class="devotion dec">${he} seems to view this`);
			if (diff.race !== slave.origRace) {
				r.push(`fake`);
			}
			r.push(`racial appearance as a cruel imposition. As with all invasive surgery ${his} health has been 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.Race = class extends App.Medicine.Surgery.Procedure {
	/**
	 * @param {App.Entity.SlaveState} slave
	 * @param {FC.Race} race
	 */
	constructor(slave, race) {
		super(slave);
		this.race = race;
	}

	get name() {
		return App.Data.misc.filterRaces.get(this.race);
	}

	get healthCost() {
		return 20;
	}

	apply(cheat) {
		this._slave.race = this.race;
		this._slave.skin = randomRaceSkin(this.race);
		this._slave.hColor = randomRaceHair(this.race);
		setEyeColor(this._slave, randomRaceEye(this.race));
		return this._assemble(new App.Medicine.Surgery.Reactions.Race());
	}
};


code:
App.Medicine.Surgery.Reactions.RetrogradeVirusInjectionNCS = class extends App.Medicine.Surgery.SimpleReaction {
	reaction(slave, diff) {
		const reaction = super.reaction(slave, diff);
		const {He, he, his, him, himself} = getPronouns(slave);
		const pubertyAge = Math.min(slave.pubertyAgeXX, slave.pubertyAgeXY);
		const genitalChanges = [];
		const physicalChanges = [];
		const statusChanges = [];

		let hairChanges = 0;
		let hair = '';
		let sense;
		let r = [];

		r.push(`The procedure spans the week, with ${him} spending every other day in the surgery room for a series of 4 sets of injections. A few hours after each session, ${he} feels terribly ill. ${He} doesn't quite understand what it's about, just that ${he} feels pretty bad. The process involves`);
		if (V.PC.skill.medicine >= 100) {
			r.push(`you`);
		} else {
			r.push(`the remote surgeon`);
		}
		r.push(`injecting the serum across ${his} body entire body, every few`);
		if (V.showInches === 2) {
			r.push(`inches,`);
		} else {
			r.push(`centimeters,`);
		}
		r.push(`leaving small needle marks that fade out within minutes. Despite not leaving a lasting evidence, the process is very invasive work, and leaves ${him} feeling weak and tired.`);
		reaction.longReaction.push(r);
		r = [];

		// Generate the changes, into variables to set contexts.
		const hairLand = hasBothLegs(slave) ? `at ${his} feet` : `below ${him}`;
		if (slave.physicalAge > pubertyAge - 2) {
			if (slave.underArmHStyle !== "hairless" && slave.underArmHStyle !== "bald") {
				hairChanges++;
				slave.underArmHStyle = "bald";
				hair = `The first thing ${he} notices is that ${his} armpit hair has just fallen out, in a small pile ${hairLand}.`;
				if (slave.pubicHStyle !== "hairless" && slave.pubicHStyle !== "bald") {
					hairChanges++;
					slave.pubicHStyle = "bald";
					hair = `${hair} The same thing happens to ${his} pubic hair.`;
				}
			} else if (slave.pubicHStyle !== "hairless" && slave.pubicHStyle !== "bald") {
				hairChanges++;
				slave.pubicHStyle = "bald";
				hair = `The first thing ${he} notices is that ${his} pubic hair has just fallen out, in a small pile ${hairLand}.`;
			}
		}
		if (canSee(slave)) {
			sense = "see";
			r.push(`${He} inspects ${himself} in the mirror.`);
		} else if (!hasAnyArms(slave)) {
			sense = "feel";
			r.push(`${He} examines ${himself} with ${his} own ${hasBothArms(slave) ? "hands" : "hand"}.`);
		} else if (canHear(slave)) {
			sense = "hear";
			r.push(`${He} listens as a menial slave describes ${his} new looks.`);
		} else {
			sense = "sense";
			r.push(`${He} can vaguely feel the changes to ${his} body, even in ${his} current state.`);
		}
		if (slave.dick > 2) {
			genitalChanges.push('dick');
			slave.dick -= 1;
		}
		if (slave.balls > 2) {
			genitalChanges.push('balls');
			slave.balls -= 1;
		}
		if (slave.geneMods.rapidCellGrowth !== 1) {
			if (slave.scrotum > 1) {
				genitalChanges.push('scrotum');
				slave.scrotum -= 1;
			}
		}
		if (slave.clit > 1) {
			genitalChanges.push('clit');
			slave.clit -= 1;
		}
		if (slave.labia > 1) {
			genitalChanges.push('labia');
			slave.labia -= 1;
		}
		if (App.Medicine.fleshSize(slave, 'boobs') > 300) {
			genitalChanges.push('boobs');
			slave.boobs -= Math.round(App.Medicine.fleshSize(slave, 'boobs') * .1);
		}
		if ((slave.shoulders - Math.abs(slave.shouldersImplant) > -1) && (slave.hips - Math.abs(slave.hipsImplant) > -1)) {
			physicalChanges.push(`both ${his} hips and shoulders are <span class="change negative">less wide,</span>`);
			slave.hips -= 1;
			slave.shoulders -= 1;
		} else if (slave.shoulders - Math.abs(slave.shouldersImplant) > -1) {
			physicalChanges.push(`${his} shoulders are <span class="change negative">less wide,</span>`);
			slave.shoulders -= 1;
		} else if (slave.hips - Math.abs(slave.hipsImplant) > -1) {
			physicalChanges.push(`${his} hips are <span class="change negative">less wide,</span>`);
			slave.hips -= 1;
		}
		if (slave.visualAge < 18) {
			const nonsurgicalHeight = slave.height - 10 * slave.heightImplant;
			const heightDelta = nonsurgicalHeight - slave.natural.height;
			let shrinkage;
			if (nonsurgicalHeight > 126 || heightDelta > 0) {
				if (heightDelta > 15) {
					shrinkage = 5;
				} else if (heightDelta > 5) {
					shrinkage = 4;
				} else if (heightDelta > -5) {
					shrinkage = 3;
				} else if (heightDelta > -15) {
					shrinkage = 2;
				} else {
					shrinkage = 1;
				}
				physicalChanges.push(`${he} is a little <span class="change negative">shorter,</span>`);
				slave.height -= shrinkage;
			}
		}
		if (slave.visualAge > 18) {
			statusChanges.push(`${He} feels a little <span class="change negative">younger.</span>`);
			slave.visualAge -= 1;
		}
		if (slave.voice.isBetween(0, 3)) {
			let voiceReaction = [`${He} hears ${his} voice coming out as <span class="change negative">higher</span> and more ${slave.voice < 2 ? "feminine" : "girly"} than it was before.`];
			if (slave.devotion > 20) {
				voiceReaction.push(`${He} laughs at ${his} new voice happily as ${he} gets used to it.`);
			} else if (slave.devotion >= -20) {
				voiceReaction.push(`${He} laughs grimly at ${himself} as ${he} gets used to it.`);
			} else {
				voiceReaction.push(`It comes out far higher than it was before, ${he} feels this new voice does not belong to ${him}.`);
			}
			statusChanges.push(voiceReaction.join(" "));
			slave.voice += 1;
		}
		// Handle the display of the changes for the newly NCS'ed slave.
		const numberChanges = hairChanges + statusChanges.length + physicalChanges.length + genitalChanges.length;
		if (numberChanges <= 0) {
			r.push(`Despite the long and arduous treatment, ${he} has no idea what all of it was for. ${He} stands before you`);
			if (slave.devotion > 20) {
				r.push(`eager to learn what it's all about.`);
			} else if (slave.devotion >= -20) {
				r.push(`worried to discover what's happened to ${him}.`);
			} else {
				r.push(`anxious about what you did to ${him}, dreading the news.`);
			}
		} else {
			r.push(`Over the course of the treatment, ${he} begins to feel the initial effects and on inspection, 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 room, ${he} feels somehow smaller and changed in`);
			if (numberChanges === 1) {
				r.push(`at least one way.`);
			} else if (numberChanges === 2) {
				r.push(`two ways.`);
			} else {
				r.push(`several ways.`);
			}
			reaction.longReaction.push(r);
			r = [];
			if (hair !== '') {
				r.push(hair);
			}
			if (genitalChanges.length > 0) {
				r.push(`${He} can ${sense} that ${his} junk is different now, it seems ${his}`);
				if (genitalChanges.length > 2) {
					r.push(`${toSentence(genitalChanges)} have all become <span class="change negative">smaller.</span>`);
				} else if (genitalChanges.length > 1) {
					r.push(`${genitalChanges[0]}, and ${genitalChanges[1]} have both become <span class="change negative">smaller.</span>`);
				} else {
					r.push(`${genitalChanges[0]} has become <span class="change negative">smaller.</span>`);
				}
			}
			if (physicalChanges.length > 0) {
				r.push(`${He} can`);
				if (genitalChanges.length > 0 || hairChanges > 0) {
					r.push(`also`);
				}
				r.push(`${sense} that ${his} body has some physical changes, it seems to ${him} that ${toSentence(physicalChanges)}`);
				const reaction = ['comes as a bit of a surprise', 'comes as quite a shock', `confirms ${his} suspicions`, `doesn't seem to phase ${him}`, `${he} finds interesting`, `${he} can't get over`].random();
				r.push(`which ${reaction}.`);
			}
			if (statusChanges.length > 0) {
				r.push(`${He} can feel some`);
				if (genitalChanges.length > 0 || physicalChanges.length > 0 || hairChanges > 0) {
					r.push(`other`);
				}
				r.push(`changes that are a little harder to describe.`);
				r.push(...statusChanges);
			}
		}

		reaction.longReaction.push(r);
		r = [];
		r.push(`You explain that ${he}'s never going to grow older and ${he}'ll stay younger. You sit back and let ${him} absorb that data for a moment.`);
		reaction.longReaction.push(r);
		r = [];
		if (slave.fetish === Fetish.MINDBROKEN) {
			r.push(`${He} doesn't seem to comprehend what this means for ${him}.`);
		} else if (slave.devotion > 20) {
			r.push(`${He} is <span class="devotion inc">happy</span> with how young ${his} body has become${(slave.visualAge > 26) ? ` and is excited about the process continuing` : ``}. ${He} is already wondering what new kinky things you have planned for ${him}.`);
			reaction.trust += 5;
			reaction.devotion += 5;
			if (slave.visualAge > 26) {
				reaction.devotion += 5;
			}
		} else if (slave.devotion >= -20) {
			r.push(`${He} isn't thrilled with ${his} new younger body, but it doesn't bother ${him} much, since ${he} knows it just better secures ${his} position in your arcology.`);
			if (slave.visualAge > 26) {
				r.push(`${He} does feel a little extra <span class="trust inc">trust</span> that you would spend so much on an older slave like ${him}.`);
				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 curse of non-aging on ${him}.`);
			reaction.trust -= 5;
			reaction.devotion -= 5;
		}

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

App.Medicine.Surgery.Procedures.RetrogradeVirusInjectionNCS = class extends App.Medicine.Surgery.Procedure {
	get name() {
		return "Induced NCS treatment";
	}

	get description() {
		const {his} = getPronouns(this.originalSlave);
		return `This will induce NCS in ${his} genetic code`;
	}

	get healthCost() {
		return 80;
	}

	get _workCost() {
		return super._workCost * 4;
	}

	apply(cheat) {
		this._slave.geneMods.NCS = 1;
		this._slave.chem += 40;
		return this._assemble(new App.Medicine.Surgery.Reactions.RetrogradeVirusInjectionNCS());
	}
};


code:
App.Medicine.Surgery.Reactions.GeneTreatment = 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 procedure spans the week, with ${him} spending every other day in the surgery room for a series of 4 sets of injections. A few hours after each session, ${he} feels terribly ill. ${He} doesn't quite understand what it's about, just that ${he} feels pretty bad. The process involves`);
		if (V.PC.skill.medicine >= 100) {
			r.push(`you`);
		} else {
			r.push(`the remote surgeon`);
		}
		r.push(`injecting the serum across ${his} entire body, every few`);
		if (V.showInches === 2) {
			r.push(`inches,`);
		} else {
			r.push(`centimeters,`);
		}
		r.push(`leaving small needle marks that fade out within minutes. Despite not leaving a lasting evidence, the process is very invasive work, and leaves ${him} feeling weak and tired.`);

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

App.Medicine.Surgery.Procedures.ElasticityTreatment = class extends App.Medicine.Surgery.Procedure {
	get name() {
		return "Increased elasticity treatment";
	}

	get description() {
		const {his} = getPronouns(this.originalSlave);
		return `this will alter ${his} genetic code to encourage ${his} body to stretch`;
	}

	get _workCost() {
		return super._workCost * 4;
	}

	get healthCost() {
		return 40;
	}

	apply(cheat) {
		this._slave.geneMods.rapidCellGrowth = 1;
		this._slave.chem += 100;
		return this._assemble(new App.Medicine.Surgery.Reactions.GeneTreatment());
	}
};

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

	get description() {
		const {his} = getPronouns(this.originalSlave);
		return `this will alter ${his} genetic code to reverse and prevent aging, effectively thwarting the rigors of old age`;
	}

	get _workCost() {
		return super._workCost * 4;
	}

	get healthCost() {
		return 40;
	}

	get note() {
		return App.UI.DOM.makeElement("span", `Post operation, high levels of DNA toxicity may be identified within the patient. Placement within a modern and staffed Clinic is highly recommended.`, ["warning"]);
	}

	apply(cheat) {
		this._slave.geneMods.immortality = 1;
		this._slave.chem += 1000;
		if (V.clinic) {
			assignJob(this.originalSlave, Job.CLINIC);
		}
		return this._assemble(new App.Medicine.Surgery.Reactions.GeneTreatment());
	}
};

App.Medicine.Surgery.Procedures.milkFlavoring = class extends App.Medicine.Surgery.Procedure {
	get name() {
		return "Bio-engineered milk flavoring";
	}

	get description() {
		const {his} = getPronouns(this.originalSlave);
		return `this will alter ${his} genetics to allow flavored milk`;
	}

	get cost() {
		return super.cost * 1.5;
	}

	get healthCost() {
		return 15;
	}

	apply(cheat) {
		this._slave.geneMods.flavoring = 1;
		this._slave.milkFlavor = "natural";
		this._slave.chem += 100;
		return this._assemble(new App.Medicine.Surgery.Reactions.GeneTreatment());
	}
};

App.Medicine.Surgery.Procedures.OptimizedSpermTreatment = class extends App.Medicine.Surgery.Procedure {
	get name() {
		return "Optimized sperm treatment";
	}

	get description() {
		const {his} = getPronouns(this.originalSlave);
		return `this will alter ${his} genetic code to encourage ${his} body to produce far more aggressive sperm cells`;
	}

	get cost() {
		return super.cost * 4;
	}

	get healthCost() {
		return 40;
	}

	apply(cheat) {
		this._slave.geneMods.aggressiveSperm = 1;
		this._slave.chem += 100;
		return this._assemble(new App.Medicine.Surgery.Reactions.GeneTreatment());
	}
};

App.Medicine.Surgery.Procedures.EnhancedProductionTreatment = class extends App.Medicine.Surgery.Procedure {
	get name() {
		return "Enhanced production treatment";
	}

	get description() {
		const {his} = getPronouns(this.originalSlave);
		return `this will alter ${his} genetic code to encourage ${his} body to produce larger volumes of sellable resources`;
	}

	get cost() {
		return super.cost * 4;
	}

	get healthCost() {
		return 40;
	}

	apply(cheat) {
		this._slave.geneMods.livestock = 1;
		this._slave.chem += 100;
		return this._assemble(new App.Medicine.Surgery.Reactions.GeneTreatment());
	}
};

App.Medicine.Surgery.Procedures.OptimizedBreedingTreatment = class extends App.Medicine.Surgery.Procedure {
	get name() {
		return "Optimized breeding treatment";
	}

	get description() {
		const {his} = getPronouns(this.originalSlave);
		return `this will alter ${his} genetic code to encourage ${his} body to be far more efficient at bearing children`;
	}

	get cost() {
		return super.cost * 4;
	}

	get healthCost() {
		return 40;
	}

	apply(cheat) {
		this._slave.geneMods.progenitor = 1;
		this._slave.chem += 100;
		return this._assemble(new App.Medicine.Surgery.Reactions.GeneTreatment());
	}
};

App.Medicine.Surgery.Procedures.RemoveGene = class extends App.Medicine.Surgery.Procedure {
	/**
	 * @param {App.Entity.SlaveState} slave
	 * @param {string} gene
	 * @param {string} title
	 */
	constructor(slave, gene, title) {
		super(slave);
		this.gene = gene;
		this.title = title;
	}

	get name() {
		return this.title;
	}

	get description() {
		return `Applying a retro-virus treatment radically increases carcinogen buildup`;
	}

	get _workCost() {
		return super._workCost * 4;
	}

	get healthCost() {
		return 40;
	}

	apply(cheat) {
		if (this.gene === "albinism") {
			induceAlbinism(this._slave, 0);
		} else {
			this._slave.geneticQuirks[this.gene] = 0;
		}
		this._slave.chem += 100;
		return this._assemble(new App.Medicine.Surgery.Reactions.GeneTreatment());
	}
};

App.Medicine.Surgery.Procedures.AddGene = class extends App.Medicine.Surgery.Procedure {
	/**
	 * @param {App.Entity.SlaveState} slave
	 * @param {keyof FC.GeneticQuirks} gene
	 * @param {boolean} [activation=false] Activation or inducement
	 */
	constructor(slave, gene, activation = false) {
		super(slave);
		this.gene = gene;
		this.activation = activation;
		this.geneData = App.Data.geneticQuirks.get(gene);
	}

	get name() {
		if (this.activation) {
			return `${capFirstChar(this.geneData.title)} activation treatment`;
		} else {
			return `Induced ${this.geneData.title} treatment`;
		}
	}

	get description() {
		const r = [];
		if (!this.activation) {
			const {his} = getPronouns(this.originalSlave);
			r.push(`This will induce ${this.geneData.title} in ${his} genetic code.`);
		}
		r.push(`Applying a retro-virus treatment radically increases carcinogen buildup`);
		return r.join(" ");
	}

	get _workCost() {
		return super._workCost * (this.activation ? 4 : 10);
	}

	get healthCost() {
		return 40;
	}

	apply(cheat) {
		if (this.gene === "albinism") {
			induceAlbinism(this._slave, 2);
		} else {
			this._slave.geneticQuirks[this.gene] = 2;
		}
		this._slave.chem += 100;
		return this._assemble(new App.Medicine.Surgery.Reactions.GeneTreatment());
	}
};


code:
App.Medicine.Surgery.Reactions.Fuckdoll = class extends App.Medicine.Surgery.SimpleReaction {
	get removeJob() {
		return true;
	}

	intro(slave) {
		const r = [];
		r.push(`As the remote surgery's long recovery cycle completes, your new Fuckdoll`);
		if (hasAnyLegs(slave)) {
			r.push(`stumbles`);
		} else {
			r.push(`is carried`);
		}
		r.push(`out of the surgery room. The only`);
		if (slave.vagina > -1) {
			r.push(`areas of skin visible are those around its vulva and anus`);
		} else {
			r.push(`area of skin visible is that around its anus${(slave.lips > 95) ? `, though its lips are also visible as its facepussy makes the standard Fuckdoll mouth insert unnecessary` : ``}. You can see it starting to struggle against the constricting material of the Fuckdoll suit as the sedation wears off. Other than the tiny area of exposed skin and the slight movement, there's no indication that the sex doll in front of you is alive at all.`);
		}
		return r;
	}

	reaction(slave, diff) {
		const reaction = super.reaction(slave, diff);
		const {He, he, His, his, him, sister, wife} = getPronouns(slave);
		const relations = V.slaves.filter((s) => areRelated(s, slave) && (s.ID !== slave.relationshipTarget));
		let r = [];

		let relatedCount = 0;
		for (const relation of relations) {
			const {he2, his2} = getPronouns(relation).appendSuffix("2");
			if (isParentP(slave, relation) || isParentP(relation, slave)) {
				r.push(`${relation.slaveName} will be horrified and afraid when ${he2} finds out that ${his2} ${relativeTerm(relation, slave)} is now a Fuckdoll.`);
				relation.devotion -= 40;
				relation.trust -= 40;
				relatedCount++;
			}
			switch (areSisters(slave, relation)) {
				case 1:
					r.push(`${relation.slaveName} will be <span class="devotion dec">horrified</span> and <span class="trust dec">afraid</span> when ${he2} finds out that ${his2} twin is now a Fuckdoll. Is ${he2} next?`);
					relation.devotion -= 50;
					relation.trust -= 50;
					relatedCount++;
					break;
				case 2:
					r.push(`${relation.slaveName} will be <span class="devotion dec">horrified</span> and <span class="trust dec">afraid</span> when ${he2} finds out that ${his2} ${sister} is now a Fuckdoll.`);
					relation.devotion -= 40;
					relation.trust -= 40;
					relatedCount++;
					break;
				case 3:
					r.push(`${relation.slaveName} will be <span class="devotion dec">horrified</span> and <span class="trust dec">afraid</span> when ${he2} finds out that ${his2} half-${sister} is now a Fuckdoll.`);
					relation.devotion -= 30;
					relation.trust -= 30;
					relatedCount++;
			}
		}
		if (relatedCount > 0) {
			reaction.shortReaction.push(`${His} ${relatedCount > 0 ? "relatives" : "relative"} will be <span class="devotion dec">horrified</span> and <span class="trust dec">afraid</span> when they find out about ${his} fate.`);
		}
		if (slave.relationship > 0) {
			const rel = getSlave(slave.relationshipTarget);
			if (rel) {
				const {he2, his2} = getPronouns(rel).appendSuffix("2");
				const relTerm = relativeTerm(rel, slave);
				r.push(`${rel.slaveName} will be <span class="devotion dec">horrified</span> and <span class="trust dec">afraid</span> when ${he2} finds out that ${his2}`);
				if (relTerm !== null) {
					r.push(`${relTerm} and`);
				}
				let name;
				if (slave.relationship > 4) {
					name = wife;
				} else if (slave.relationship > 3) {
					name = `lover`;
				} else if (slave.relationship > 2) {
					name = `intimate friend`;
				} else if (slave.relationship > 1) {
					name = `best friend`;
				} else {
					name = `friend`;
				}
				r.push(`${name} is now a Fuckdoll.`);
				reaction.shortReaction.push(`${His} ${name} will be <span class="devotion dec">horrified</span> and <span class="trust dec">afraid</span> when they find out about ${his} fate.`);
				rel.devotion -= slave.relationship * 10;
				rel.trust -= slave.relationship * 10;
				rel.relationship = 0;
				rel.relationshipTarget = 0;
			}
		} else if (slave.relationship < 0) {
			r.push(`${His} slave relationship to you is effectively over, since everyone in the world outside ${his} suit is created equal to ${him}. ${He}'ll probably forget to distinguish your`);
			if (V.PC.dick !== 0) {
				r.push(`dick if it's pushed inside ${his}`);
			} else {
				r.push(`pussy if it's pressed against ${his} face hole`);
			}
			r.push(`soon enough.`);
		}
		if (slave.rivalry !== 0) {
			const rival = getSlave(slave.rivalryTarget);
			if (rival) {
				const {he2} = getPronouns(rival).appendSuffix("2");
				r.push(`Naturally, ${his} rivalry with ${rival.slaveName} is over. ${rival.slaveName} will be pleased ${he2} doesn't have to see ${slave.slaveName} any more, though being a Fuckdoll is terrifying enough that it's not likely ${he2}'ll derive much satisfaction from it.`);
				rival.rivalry = 0;
				rival.rivalryTarget = 0;
			}
		}
		slave.relationship = 0;
		slave.relationshipTarget = 0;
		slave.rivalry = 0;
		slave.rivalryTarget = 0;

		reaction.longReaction.push(r);
		r = [];
		r.push(`The Fuckdoll suit's systems connect to the arcology and run a full systems check. The reports waterfall down the nearest wallscreen, moving from the top of the Fuckdoll down. The simple brain activity sensor is showing elevated readings as ${slave.slaveName} desperately tries to find ${his} bearings.`);
		if (slave.hLength > 20) {
			r.push(`The twin tails of hair sticking out of the suit material that covers ${his} scalp are waving from side to side slightly as ${he} struggles.`);
		}
		if (getBestVision(slave) > 0) {
			r.push(`The suit does not have holes for vision, worsening the disorientation.`);
		}
		if (slave.voice === 0) {
			r.push(`${His} breath rushes in and`);
		} else {
			r.push(`Incoherent moans are coming`);
		}
		r.push(`out of ${his}`);
		if (slave.lips > 95) {
			r.push(`facepussy.`);
		} else {
			r.push(`mouth insert.`);
		}
		r.push(`The suit can stimulate every intimate area that it covers with vibration, electrostimulation, warmth, and cold, and ${slave.slaveName} must be in agony as it tests these systems.`);

		reaction.longReaction.push(r);
		r = [];

		r.push(`The suit includes a network of small tubes filled with hydraulic fluid, and tiny pumps to move it around. This is necessary to keep the Fuckdoll's internal temperature stable, but it can also be used to restrict ${his} movements. The suit is doing so now; the Fuckdoll is desperately attempting to move, but the suit won't let ${him}.`);
		if (hasAnyProstheticLimbs(slave)) {
			r.push(`Its P-Limbs have been removed, since they aren't compatible with Fuckdoll suits.`);
			removeLimbs(slave, "all");
		}
		if (isAmputee(slave)) {
			r.push(`The Fuckdoll's limbless torso rocks back and forth slightly.`);
		} else {
			if (hasBothLegs(slave)) {
				r.push(`${He}'s rocking back and forth slightly on ${his} heeled boots, which are designed for stability.`);
			} else if (hasAnyLegs(slave)) {
				r.push(`${He}'s rocking back and forth slightly on ${his} single heeled boot, which is designed for great stability.`);
			} else {
				r.push(`The Fuckdoll's legless torso rocks back and forth slightly.`);
			}
		}
		r.push(`The heart rate reading is so high that the Fuckdoll is receiving drugs to calm ${him} down and prevent damage; the suit can deliver these and any other necessary pharmaceuticals by intravenous shunt. Farther down, on the Fuckdoll's side over ${his} ribcage, there are a pair of metal ports. These allow ${him} to be fed.`);
		if (slave.belly > 1500) {
			r.push(`The suit does not cover ${his}`);
			if (slave.bellyPreg > 1500) {
				r.push(`pregnant`);
			} else {
				r.push(`rounded`);
			}
			r.push(`belly, which is allowed to protrude from a hole in the material.`);
		}

		reaction.longReaction.push(r);
		r = [];
		r.push(`The Fuckdoll's rear hole is extremely eye-catching from behind, since it's the only area of skin visible from that angle across ${his} body, which is a featureless expanse of dull latex-like material.`);
		if (slave.vagina > -1) {
			r.push(`From ${his} other side, ${his} front hole stands out likewise.`);
		}
		if (slave.dick > 0) {
			r.push(`${His} penis has its own pouch in the material.`);
		}
		r.push(`The Fuckdoll continues to struggle. Since ${he} is new, ${he} is not yet able to obey the tonal command system the suit uses to transfer orders to its inhabitant, who cannot otherwise hear. ${He} will have to learn by painful experience, and eventually, that is all ${he} will know.`);

		return reaction;
	}
};

App.Medicine.Surgery.Procedures.Fuckdoll = class extends App.Medicine.Surgery.Procedure {
	get name() {
		return "Encase in a Fuckdoll suit";
	}

	get _workCost() {
		return 0;
	}

	apply(cheat) {
		beginFuckdoll(this._slave);
		SetBellySize(this._slave);
		return this._assemble(new App.Medicine.Surgery.Reactions.Fuckdoll());
	}
};


code:
App.Medicine.Surgery.Reactions.FuckdollExtraction = class extends App.Medicine.Surgery.SimpleReaction {
	intro(slave) {
		const r = [];
		r.push(`As the remote surgery's long recovery cycle completes, ${slave.slaveName}`);
		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 room.`);
		return r;
	}

	reaction(slave, diff) {
		const reaction = super.reaction(slave, diff);
		const {He, he, His, his, him, himself} = getPronouns(slave);
		const r = [];
		r.push(`If you were expecting a great return to humanity after extracting ${him} from ${his} Fuckdoll suit, you're to be disappointed.`);
		if (getBestVision(slave) > 0) {
			r.push(`You're denied any reaction from ${him} to the sight of ${himself} in the mirror outside the recovery area, as ${he}'s wearing a pair of very dark glasses ${he}'ll have to keep on for a few hours yet. ${He}'s been denied almost all vision for a long time, and though ${his} recovery included light therapy, ${he}'s still very sensitive to it.`);
		}
		if (slave.fetish === Fetish.MINDBROKEN) {
			r.push(`${His} mind remains just as broken outside the suit as it was inside it. In many ways, ${he}'s as much of a living sex toy now as ${he} was when ${he} was a Fuckdoll; ${he}'s unresponsive to almost everything, though ${he} will probably still understand how to get fucked. ${His} personality is probably somewhere back there in the Fuckdoll maintenance areas, like the scraps of the suit that was just cut off ${him}. Just another piece of refuse.`);
		} else if (slave.fuckdoll > 20) {
			r.push(`Though ${he} retains possession of some of ${his} faculties, ${he}'s been severely affected by the weeks ${he}'s spent as a living sex toy. Any joy or relief at being liberated from the Fuckdoll suit is probably being suppressed by the similarity of the extraction procedure to the routine suit maintenance ${he} received weekly. If ${he} even understands that ${he}'s been freed, ${he}'s been trained so thoroughly that ${he} will struggle to adapt to life more complex than tonal commands and sexual use.`);
		} else {
			r.push(`Though ${he} hasn't been a Fuckdoll long enough to be permanently damaged, ${he}'s so emotionally exhausted by everything ${he}'s experienced over the past few weeks that ${he} betrays no relief or joy, or even any fear that ${he}'ll be turned into a Fuckdoll again. ${His} posture bespeaks something like apathy. ${He} should reawaken gradually, but for now ${he}'s still actively remembering how to live as a human, rather than as a living sex toy.`);
		}
		reaction.longReaction.push(r);
		return reaction;
	}
};

App.Medicine.Surgery.Procedures.FuckdollExtraction = class extends App.Medicine.Surgery.Procedure {
	get name() {
		const {him} = getPronouns(this.originalSlave);
		return `Extract ${him}`;
	}

	get _workCost() {
		return 0;
	}

	apply(cheat) {
		this._slave.fuckdoll = 0;
		this._slave.clothes = "no clothing";
		this._slave.shoes = "none";
		return this._assemble(new App.Medicine.Surgery.Reactions.FuckdollExtraction());
	}
};


code:
App.Medicine.Surgery.Reactions.Mindbreak = class extends App.Medicine.Surgery.SimpleReaction {
	get removeJob() {
		return true;
	}

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

		r.push(`${His} gaze is placid and empty.`);
		if (canSee(slave)) {
			r.push(`${He} looks at`);
		} else if (canHear(slave)) {
			r.push(`You cough, causing ${him} to turn to face`);
		} else {
			r.push(`${He} does not respond to your touch, so you turn ${his} head to face`);
		}
		r.push(`you, and there is nothing there: no recognition, no fear, no love. Nothing. <span class="mindbreak">${He} will forget this in a few hours. ${He} will forget everything in a few hours.</span>`);

		reaction.shortReaction.push(`${His} mind is broken, any defining characteristics <span class="mindbreak">are gone.</span>`);

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

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

	get description() {
		const {his} = getPronouns(this.originalSlave);
		return `Warning: this is permanent and irreversible. It will destroy ${his} will and ${his} ability to remember anything but the simplest skills.`;
	}

	get healthCost() {
		return 20;
	}

	apply(cheat) {
		applyMindbroken(this._slave);
		return this._assemble(new App.Medicine.Surgery.Reactions.Mindbreak());
	}
};


code:
App.Medicine.Surgery.Reactions.Blind = class extends App.Medicine.Surgery.SimpleReaction {
	get removeJob() { return true; }

	intro(slave, diff) {
		return [];
	}

	reaction(slave, diff) {
		const reaction = super.reaction(slave, diff);
		const {He, he, His, his} = getPronouns(slave);
		const r = [];
		r.push(`The laser eye surgery is brief, with nothing more than minor health effects. As soon as ${he} is allowed to open ${his} eyes and look around, ${he} begins to glance back and forth frantically,`);
		if (!canSee(slave)) {
			r.push(`not immediately understanding that this darkness is ${his} new reality.`);
		} else {
			r.push(`quickly noticing ${his} degraded vision.`);
		}
		if (this._hasEmotion(slave)) {
			if (slave.devotion > 50) {
				r.push(`When ${he} finally figures it out, ${he} begins to weep, not understanding why it's necessary that ${he} be unable to see. After a short cry that trails off into a few sniffles, ${he} carries on.`);
			} else if (slave.devotion > 20) {
				r.push(`When ${he} finally figures it out, ${he} begins to bawl, not understanding what ${he} did to earn this. After a short expurgation of grief and terror, ${he} takes a deep breath and visibly suppresses ${his} emotions.`);
				reaction.trust -= 20;
			} else {
				r.push(`When ${he} realizes what's happened, ${his} face clouds with rage. Reflexively, ${he} begins to peer around, looking for the source of ${his} woes. ${He} finally understands the true use of blindness when ${he} realizes ${he} won't be able to tell where you are, where anyone is, or even where ${he} is. ${His} well-being is now firmly in the hands of someone ${he} distrusts. ${He} begins to shake with fear.`);
				reaction.trust -= 8;
				reaction.devotion -= 8;
			}
		}
		reaction.longReaction.push(r);
		return reaction;
	}
};

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

	get name() { return `Blind ${this.side} ${this.side === "both" ? "eyes" : "eye"}`; }

	get healthCost() { return 5; }

	apply(cheat) {
		eyeSurgery(this._slave, this.side, "blind");
		return this._assemble(new App.Medicine.Surgery.Reactions.Blind());
	}
};


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

		r.push(`The laser eye surgery is brief, with nothing more than minor health effects. As soon as ${he} is allowed to open ${his} eyes and look around, ${he} begins to glance back and forth frantically, not immediately understanding that this blurred world is ${his} new reality.`);
		if (this._hasEmotion(slave)) {
			if (slave.devotion > 50) {
				r.push(`When ${he} finally figures it out, ${he} begins to weep, not understanding why it's necessary that ${he} not be able to see clearly. After a short cry that trails off into a few sniffles, ${he} carries on.`);
			} else if (slave.devotion > 20) {
				r.push(`When ${he} finally figures it out, ${he} begins to bawl, not understanding what ${he} did to earn this. After a short expurgation of grief and terror, ${he} takes a deep breath and visibly suppresses ${his} emotions.`);
				reaction.trust -= 5;
			} else {
				r.push(`When ${he} realizes what's happened, ${his} face clouds with rage. Reflexively, ${he} begins to peer around, looking for the source of ${his} woes. ${He} finally understands the true import of blurred vision when ${he} has trouble telling if anyone's close, and begins to shake with fear.`);
				reaction.trust -= 10;
				reaction.devotion -= 10;
			}
		}

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

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

	get name() { return `Blur ${this.side} ${this.side === "both" ? "eyes" : "eye"}`; }

	get healthCost() { return 5; }

	apply(cheat) {
		eyeSurgery(this._slave, this.side, "blur");
		return this._assemble(new App.Medicine.Surgery.Reactions.EyeBlur());
	}
};


code:
App.Medicine.Surgery.Reactions.EyeFix = 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 laser eye surgery is brief, with nothing more than minor health effects. As soon as ${he} is allowed to open ${his} eyes and look around, ${his} gaze flicks from object to object with manic speed as ${he} processes ${his} newly clear vision. Seeing the world as it is without glasses or contact lenses is a gift that those who do not need it cannot properly understand.`);
		if (this._hasEmotion(slave)) {
			if (slave.devotion > 50) {
				r.push(`${He} loved you before, but ${he}'s <span class="devotion inc">very grateful,</span> and <span class="trust inc">more trusting,</span> too.`);
			} else if (slave.devotion >= -20) {
				r.push(`${He} accepted you as ${his} owner before, but ${he}'s <span class="devotion inc">very grateful,</span> and <span class="trust inc">more trusting,</span> too.`);
			} else {
				r.push(`${He} hardly knows what to make of this wonderful present from someone ${he} hates, and struggles with suspicion that the gift conceals some sort of snare. After a while, though, ${he} accepts that you truly did help ${him}, and might be trustworthy.`);
			}
			reaction.devotion += 5;
			reaction.trust += 5;
		}

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

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

	get name() { return `Fix ${this.side} ${this.side === "both" ? "eyes" : "eye"}`; }

	get healthCost() { return 5; }

	apply(cheat) {
		eyeSurgery(this._slave, this.side, "fix");
		return this._assemble(new App.Medicine.Surgery.Reactions.EyeFix());
	}
};


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

		r.push(`The implant surgery is invasive and ${he} spends some time in the autosurgery recovering. As soon as ${he} is allowed to open ${his} eyes and look around, ${he} notices nothing has changed; though the next time ${he} looks in the mirror, ${he}'ll see a pair of familiar ${App.Desc.eyesColor(slave)} peering back at ${him}.`);

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

App.Medicine.Surgery.Procedures.OFNewEyes = class extends App.Medicine.Surgery.Procedure {
	/**
	 * @param {App.Entity.SlaveState} slave
	 * @param {"left"|"right"} side
	 */
	constructor(slave, side) {
		super(slave);
		this._side = side;
	}

	get name() {
		return getLeftEyeType(this.originalSlave) === 2 ? "Replace" : "Implant";
	}

	get description() {
		return getLeftEyeType(this.originalSlave) === 2 ? "replace the existing ocular implant with an organic eye" : "";
	}

	get healthCost() {
		return 10;
	}

	apply(cheat) {
		eyeSurgery(this._slave, this._side, "normal");
		return this._assemble(new App.Medicine.Surgery.Reactions.NewEyes());
	}
};


code:
App.Medicine.Surgery.Reactions.OcularImplant = 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 implant surgery is invasive and ${he} spends some time in the autosurgery recovering. When ${he} is allowed to open ${his} eyes the amount of visual information makes ${him} reel.`);
		if (this._hasEmotion(slave)) {
			if (slave.devotion > 50) {
				r.push(`${He} is <span class="devotion inc">grateful</span> for ${his} improved vision, and knowing how much you invested in ${him} makes ${him} <span class="trust inc">trust you more</span> as well.`);
				reaction.devotion += 10;
				reaction.trust += 10;
			} else if (slave.devotion > 20) {
				r.push(`${He} has mixed feelings about ${his} new eyes, but ${he}'s aware how valuable such implants are, and ${he} already accepted that you have complete control over ${his} body.`);
				reaction.devotion += 5;
				reaction.trust += 10;
			} else {
				r.push(`${He} is <span class="trust dec">disturbed</span> that you replaced ${his} eyes with artificial ones and afraid of increased control over ${him} that such device grants.`);
				reaction.trust -= 5;
			}
		}

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

App.Medicine.Surgery.Reactions.OcularImplantForBlind = 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 implant surgery is invasive and ${he} spends some time in the autosurgery recovering. As soon as ${he} is allowed to open ${his} eyes and look around, ${his} gaze flicks from object to object with manic speed as ${his} new eyes deliver nearly overwhelming amount of visual information. Seeing the world as it is is a gift that those who do not need it cannot properly understand.`);
		if (this._hasEmotion(slave)) {
			if (slave.devotion > 50) {
				r.push(`${He} loved you before, but ${he}'s very grateful, and more trusting, too. ${He} never realized just how good you looked, and now ${he} can't get your image out of ${his} mind.`);
				if (slave.relationship === 0) {
					slave.relationship = -2;
				}
			} else if (slave.devotion > 20) {
				r.push(`${He} accepted you as ${his} owner before, but ${he}'s <span class="devotion inc">very grateful,</span> and <span class="trust inc">more trusting,</span> too.`);
			} else {
				r.push(`${He} hardly knows what to make of this wonderful present from someone ${he} hates, and struggles with suspicion that the gift conceals some sort of snare. After a while, though, ${he} accepts that you truly did help ${him}, and might be trustworthy.`);
			}
			reaction.devotion += 25;
			reaction.trust += 25;
		}
		reaction.longReaction.push(r);
		return reaction;
	}
};

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

	get name() {
		if (this.side === "both") {
			return "Give both eyes ocular implants";
		}
		return `Give ${this.side} eye ocular implant`;
	}

	get healthCost() {
		return 5;
	}

	apply(cheat) {
		eyeSurgery(this._slave, this.side, "cybernetic");
		if (getBestVision(this.originalSlave) > 0) {
			return this._assemble(new App.Medicine.Surgery.Reactions.OcularImplant());
		} else {
			return this._assemble(new App.Medicine.Surgery.Reactions.OcularImplantForBlind());
		}
	}
};


code:
App.Medicine.Surgery.Reactions.RemoveEyes = class extends App.Medicine.Surgery.SimpleReaction {
	get removeJob() { return true; }

	intro(slave, diff) {
		return [];
	}

	reaction(slave, diff) {
		const reaction = super.reaction(slave, diff);
		const {He, he, His, his} = getPronouns(slave);
		const r = [];
		r.push(`Surgery doesn't take long, but since it was invasive there are <span class="health dec">moderate health consequences.</span> As anesthesia wears off ${he} tries to open ${his} eyes and finds`);
		if (!canSee(slave)) {
			r.push(`${he} is unable to.`);
		} else {
			r.push(`only one working.`);
		}
		if (this._hasEmotion(slave)) {
			if (slave.devotion > 50) {
				r.push(`When ${he} realizes why, ${he} begins to weep, not understanding what ${he} did to deserve this. After a short cry that trails off into a few sniffles, ${he} carries on.`);
			} else if (slave.devotion > 20) {
				r.push(`When ${he} realizes why, ${he} begins to bawl, not understanding what ${he} did to earn this. After a short expurgation of grief and terror, ${he} takes a deep breath and visibly suppresses ${his} emotions.`);
				reaction.trust -= 20;
			} else {
				r.push(`When ${he} realizes what's happened, ${his} face clouds with rage. Reflexively, ${he} swings ${his} head around, looking for the source of ${his} woes. ${He} finally understands the true use of blindness when ${he} realizes ${he} won't be able to tell where you are, where anyone is, or even where ${he} is. ${His} well-being is now firmly in the hands of someone ${he} distrusts. ${He} begins to shake with fear.`);
				reaction.trust -= 8;
				reaction.devotion -= 8;
			}
		}
		reaction.longReaction.push(r);
		return reaction;
	}
};

App.Medicine.Surgery.Reactions.RemoveBlindEyes = class extends App.Medicine.Surgery.SimpleReaction {
	reaction(slave, diff) {
		const reaction = super.reaction(slave, diff);
		const {he, His, his} = getPronouns(slave);
		const r = [];
		r.push(`Surgery doesn't take long, but since it was invasive there are moderate health consequences. As anesthesia wears off ${he} tries to open ${his} eyes and finds ${he} is unable to.`);
		if (this._hasEmotion(slave)) {
			if (slave.devotion > 50) {
				r.push(`When ${he} realizes why, ${he} seems surprised since ${he} doesn't see the point of such procedure. As ${he} was already blind, ${his} mental state remains unaffected.`);
			} else {
				r.push(`${His} face twists in distaste. Such pointless and invasive procedure drives home just how <span class="trust dec">expendable</span> ${he} is to you.`);
				reaction.devotion -= 5;
			}
		}
		reaction.longReaction.push(r);
		return reaction;
	}
};

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

	get name() { return `Remove ${this.side} ${this.side === "both" ? "eyes" : "eye"}`; }

	get healthCost() { return 5; }

	apply(cheat) {
		const reaction = getBestVision(this._slave) > 0
			? new App.Medicine.Surgery.Reactions.RemoveEyes()
			: new App.Medicine.Surgery.Reactions.RemoveBlindEyes();
		eyeSurgery(this._slave, this.side, "remove");
		return this._assemble(reaction);
	}
};


code:
App.Medicine.Surgery.Reactions.Unblind = 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 eye surgery is invasive and ${he} spends some time in the autosurgery recovering. As soon as ${he} is allowed to open ${his} eyes and look around, ${his} gaze flicks from object to object with manic speed as ${he} processes ${his} new vision. Seeing the world as it is is a gift that those who do not need it cannot properly understand.`);
		if (this._hasEmotion(slave)) {
			reaction.devotion += 25;
			reaction.trust += 25;
			if (slave.devotion > 50) {
				r.push(`${He} loved you before, but ${he}'s very grateful, and more trusting, too. ${He} never realized just how good you looked, and now ${he} can't get your image out of ${his} mind.`);
				if (slave.relationship === 0) {
					reaction.shortReaction.push(`${He} now loves you with all ${he} has.`);
					slave.relationship = -2;
				}
			} else if (slave.devotion > 20) {
				r.push(`${He} accepted you as ${his} owner before, but ${he}'s <span class="devotion inc">very grateful,</span> and <span class="trust inc">more trusting,</span> too.`);
			} else {
				r.push(`${He} hardly knows what to make of this wonderful present from someone ${he} hates, and struggles with suspicion that the gift conceals some sort of snare. After a while, though, ${he} accepts that you truly did help ${him}, and might be trustworthy.`);
			}
		}
		reaction.longReaction.push(r);
		return reaction;
	}
};

App.Medicine.Surgery.Procedures.OFUnblind = class extends App.Medicine.Surgery.Procedure {
	/**
	 * @param {App.Entity.SlaveState} slave
	 * @param {"left"|"right"} side
	 */
	constructor(slave, side) {
		super(slave);
		this._side = side;
	}

	get name() {
		return "Implant";
	}

	get healthCost() {
		return 10;
	}

	apply(cheat) {
		eyeSurgery(this._slave, this._side, "normal");
		return this._assemble(new App.Medicine.Surgery.Reactions.Unblind());
	}
};


code:
App.Medicine.Surgery.Reactions.Age = 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 === Fetish.MINDBROKEN) {
			r.push(`${He} doesn't notice the improvements to ${his} face, but ${he}'s not the one looking at it. As with all surgery <span class="health dec">${his} health has been slightly affected.</span>`);
		} else if (slave.devotion > 50) {
			r.push(`${He}`);
			if (canSee(slave)) {
				r.push(`examines ${his} younger self in the mirror with approval.`);
			} else {
				r.push(`listens closely to the description of ${his} new younger self with approval.`);
			}
			r.push(`${He} doesn't recognize ${his} youthful yet artificial appearance yet, but ${he} resolves to back ${his} new appearance up with youthful energy and cheer. ${He}'s very happy you used surgery to reverse ${his} apparent aging. As with all surgery ${his} health has been slightly affected.`);
			reaction.devotion += 10;
		} else if (slave.devotion >= -20) {
			r.push(`${He}`);
			if (canSee(slave)) {
				r.push(`examines youthful yet artificial appearance in the mirror`);
			} else {
				r.push(`listens to the description of ${his} youthful yet artificial appearance`);
			}
			r.push(`with hesitation. The cosmetic surgery is extremely well done, and ${he} eventually decides that being subjected to surgery without ${his} consent is acceptable, if it's being used to make ${him} look so young and pretty. As with all surgery ${his} health has been slightly affected.`);
			reaction.devotion += 4;
		} else {
			r.push(`${He}`);
			if (canSee(slave)) {
				r.push(`examines ${his} youthful yet artificial appearance in the mirror`);
			} else {
				r.push(`listens to the description of ${his} youthful yet artificial appearance`);
			}
			r.push(`with confusion. The cosmetic surgery is extremely well done, and ${he} eventually decides that being subjected to surgery without ${his} consent isn't worth fighting against, if it's being used to make ${him} look younger. 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.longReaction.push(r);
		return reaction;
	}
};

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

	get healthCost() { return 10; }

	apply(cheat) {
		applyAgeImplant(this._slave);
		this._slave.faceImplant = Math.clamp(this._slave.faceImplant + faceSurgeryArtificiality(), 0, 100);
		return this._assemble(new App.Medicine.Surgery.Reactions.Age());
	}
};


code:
App.Medicine.Surgery.Reactions.Face = 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(faceIncreaseDesc(slave, diff.face));
		if (slave.fetish === Fetish.MINDBROKEN) {
			r.push(`${He} doesn't notice the improvements to ${his} face, but ${he}'s not the one looking at it. As with all surgery <span class="health dec">${his} health has been slightly affected.</span>`);
		} else if (slave.devotion > 50) {
			r.push(`${He}`);
			if (canSee(slave)) {
				r.push(`examines ${his} new self in the mirror with approval. ${He} doesn't recognize ${himself} quite yet, but ${he}`);
			} else {
				r.push(`listens closely to the description of ${his} new face. ${He}`);
			}
			r.push(`hopes you'll like ${his} new face better and use ${him} more frequently as a result. ${He}'s happy with your changes to ${his} face. 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(`examines ${his} new self in the mirror with hesitation. ${He} doesn't recognize ${himself} quite yet, but ${he}`);
			} else {
				r.push(`listens closely to the description of ${his} new face. ${He}`);
			}
			r.push(`hopes you'll like ${his} new face better and treat ${him} more kindly as a result. 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}`);
			if (canSee(slave)) {
				r.push(`examines ${his} new self in the mirror with revulsion. ${He} doesn't recognize ${himself} quite yet,`);
			} else {
				r.push(`listens closely to the description of ${his} new face,`);
			}
			r.push(`which ${he} hates, though ${he} hopes you'll like ${his} new face better and punish ${him} less cruelly as a result. For now, ${he} seems to view this fake face 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.FaceShape = class extends App.Medicine.Surgery.Procedure {
	/**
	 * @param {App.Entity.SlaveState} slave
	 * @param {string} targetShape
	 */
	constructor(slave, targetShape) {
		super(slave);
		this.targetShape = targetShape;
	}

	get name() {
		if (this.targetShape === FaceShape.ANDRO && this._slave.faceShape === FaceShape.MASC) {
			return `Soften to androgynous`;
		} else if (this.targetShape === FaceShape.NORMAL) {
			return `Make conventionally feminine`;
		} else {
			return capFirstChar(this.targetShape);
		}
	}

	get healthCost() { return 10; }

	apply(cheat) {
		this._slave.faceShape = this.targetShape;
		faceIncreaseAction(this._slave, 20);
		this._slave.faceImplant = Math.clamp(this._slave.faceImplant + faceSurgeryArtificiality(), 0, 100);
		return this._assemble(new App.Medicine.Surgery.Reactions.Face());
	}
};

App.Medicine.Surgery.Procedures.FaceAttractiveness = class extends App.Medicine.Surgery.Procedure {
	get name() { return "Just improve attractiveness"; }

	get healthCost() { return 10; }

	apply(cheat) {
		faceIncreaseAction(this._slave, 20);
		this._slave.faceImplant = Math.clamp(this._slave.faceImplant + faceSurgeryArtificiality(), 0, 100);
		return this._assemble(new App.Medicine.Surgery.Reactions.Face());
	}
};


code:
App.Medicine.Surgery.Reactions.Lips = 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 === Fetish.MINDBROKEN) {
			r.push(`${He} vaguely realizes ${his} mouth doesn't move as well as it used to. As with all surgery <span class="health dec">${his} health has been slightly affected.</span>`);
		} else if (slave.devotion > 20 && this._strongKnownFetish(slave, Fetish.CUMSLUT)) {
			r.push(`${He} licks ${his} new lips experimentally but doesn't lose much time before turning to you with ${his} mouth open and ready. ${He}'s still sore, so ${he}'s careful, but ${he} runs ${his} wet tongue over ${his} lips, already panting at the thought of sucking dick. If ${he} had much in the way of oral skills, they've likely suffered. ${He}'s happy with your changes to ${his} 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 += 4;
			if (slave.skill.oral > 10) {
				slave.skill.oral -= 10;
			}
		} else if (slave.devotion > 50) {
			r.push(`${He} puckers ${his} new lips experimentally and turns to you with a smile to show them off. ${He}'s still sore, so ${he}'s careful as ${he} blows you an awkward kiss. If ${he} had much in the way of oral skills, they've likely suffered. ${He}'s happy with your changes to ${his} lips. As with all surgery ${his} health has been slightly affected.`);
			reaction.devotion += 4;
			if (slave.skill.oral > 10) {
				slave.skill.oral -= 10;
			}
		} else if (slave.devotion >= -20) {
			r.push(`${He}`);
			if (canSee(slave)) {
				r.push(`eyes`);
			} else {
				r.push(`puckers`);
			}
			r.push(`${his} new lips skeptically. ${He}'s still sore, so ${he} doesn't touch them. ${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, but if ${he} had much in the way of oral 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;
			if (slave.skill.oral > 10) {
				slave.skill.oral -= 10;
			}
		} else {
			r.push(`${He}`);
			if (canSee(slave)) {
				r.push(`eyes`);
			} else {
				r.push(`puckers`);
			}
			r.push(`${his} new lips with resentment. ${He}'s still sore, so ${he} doesn't touch them, 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. If ${he} had much in the way of oral skills, they've likely suffered. For now, ${he} seems to view these fake lips 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;
			if (slave.skill.oral > 10) {
				slave.skill.oral -= 10;
			}
		}

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

/**
 * @type {FC.Medicine.AssetSizingProcedureSet}
 */
App.Medicine.Surgery.Procedures.lipImplantProcedure = function() {
	class Fill extends App.Medicine.Surgery.Procedures.FillSizingImplantProcedure {
		get name() {
			return "Replace with the next size up";
		}
	}

	/**
	 * @template {FC.Medicine.SizingImplantProcedureConstructor} T
	 * @param {T} Procedure
	 * @param {ConstructorParameters<T>} args
	 */
	function makeProcedure(Procedure, args) {
		return new (class extends Procedure {
			_doTargetGain() {
				return new App.Medicine.Surgery.Reactions.Lips();
			}

			_doTargetLoss() {
				return new App.Medicine.Surgery.Reactions.Lips();
			}

			/**
			 * @param {number} volume
			 * @returns {string}
			 */
			_volumeStr(volume) {
				return '';
			}

			/**
			 * @param {number} volume
			 * @returns {string}
			 */
			_fleshExcessStr(volume) {
				return App.Utils.expandHTML(`${Math.round(100.0 * volume / App.Medicine.fleshSize(this.originalSlave, "lips"))} %`);
			}

			// overridden because slaves do not have the lipsImplantType property (yet?)
			_setSlaveImplantType() {}
		})(...args);
	}

	class Reduce extends App.Medicine.Surgery.Procedure {
		/**
		 * @param {FC.SlaveState} slave
		 * @param {string} name
		 * @param {number} amount
		 */
		constructor(slave, name, amount) {
			super(slave);
			this._name = name;
			this._amount = amount;
		}

		get name() {
			return `${this._name.toUpperFirst()} lips`;
		}

		get healthCost() {
			return 10;
		}

		apply(cheat) {
			this._slave.lips -= this._amount;
			return this._assemble(new App.Medicine.Surgery.Reactions.Lips());
		}
	}

	return {
		install: (slave, type, size, fleshExcess) =>
			makeProcedure(App.Medicine.Surgery.Procedures.InstallSizingImplantProcedure, [slave, "lips", type, size, fleshExcess]),
		replace: (slave, type, size, fleshExcess) =>
			makeProcedure(App.Medicine.Surgery.Procedures.ReplaceSizingImplantProcedure, [slave, "lips", type, size, fleshExcess]),
		remove: (slave) =>
			makeProcedure(App.Medicine.Surgery.Procedures.RemoveSizingImplantProcedure, [slave, "lips"]),

		fill: (slave, amount) =>
			makeProcedure(Fill, [slave, "lips", amount]),
		drain: (slave, amount) =>
			makeProcedure(App.Medicine.Surgery.Procedures.DrainSizingImplantProcedure, [slave, "lips", amount]),

		reduce: (slave, name, amount) => new Reduce(slave, name, amount)
	};
}();