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

		if (slave.fetish === "mindbroken") {
			r.push(`The changes to ${his} breasts are lost on ${him}. As with all surgery <span class="health dec">${his} health has been slightly affected.</span>`);
		} else if (slave.devotion > 20 && this._strongKnownFetish(slave, "boobs")) {
			if (hasAnyArms(slave)) {
				r.push(`${He}'s barely out of the surgery before ${he}'s playing with ${his} new, ${slave.boobShape} breasts despite the pain.`);
			} else {
				r.push(`${He}'s barely out of the surgery before ${he}'s rubbing ${his} new, ${slave.boobShape} breasts against anything ${he} can reach, despite the pain.`);
			}
			r.push(`${He}'s deliriously happy with your changes to what ${he} thinks of as ${his} primary sexual organs, 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;
		} else if (slave.devotion > 50) {
			if (hasAnyArms(slave)) {
				r.push(`${He} runs ${his}`);
				if (hasBothArms(slave)) {
					r.push(`hands`);
				} else {
					r.push(`hand`);
				}
				r.push(`over ${his} ${slave.boobShape} breasts experimentally and turns to you with a smile to show them off. ${He}'s still sore, so ${he} doesn't touch them much, but ${he} turns from side to side to let you see them from all angles.`);
			} else {
				r.push(`${He} bounces a little to feel ${his} ${slave.boobShape} tits move before ${he} turns ${his} torso to you with a smile to show them off. ${He}'s still sore, so ${he} doesn't move too violently, but ${he} wiggles ${himself} a little to show off.`);
			}
			r.push(`<span class="devotion inc">${He}'s happy with your changes to ${his} breasts.</span> As with all surgery <span class="health dec">${his} health has been slightly affected.</span>`);
			reaction.devotion += 4;
		} else if (slave.devotion >= -20) {
			if (canSee(slave)) {
				r.push(`${He} eyes ${his} new, ${slave.boobShape} breasts skeptically.`);
			} else {
				r.push(`The cool air flowing over the new location of ${his} nipples draws a skeptical expression to ${his} face.`);
			}
			if (hasAnyArms(slave)) {
				r.push(`${He}'s still sore, so ${he} doesn't touch them.`);
			} else {
				r.push(`${He}'s still sore, so ${he} keeps ${his} body still.`);
			}
			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} breasts reshaped. As with all surgery ${his} health has been slightly affected. ${He} is sensibly fearful of your total power over ${his} body.`);
			reaction.trust -= 5;
		} else {
			if (canSee(slave)) {
				r.push(`${He} eyes ${his} new, ${slave.boobShape} breasts`);
			} else {
				r.push(`The feel of the air running over the new location of ${his} nipples fills ${him}`);
			}
			r.push(`with resentment.`);
			if (hasAnyArms(slave)) {
				r.push(`${He}'s still sore, so ${he} doesn't touch them,`);
			} else {
				r.push(`${He}'s still sore, so ${he} keeps ${his} body still,`);
			}
			r.push(`but ${canSee(slave) ? `${he} glares daggers` : `${his} face contorts with distaste`}.`);
			r.push(`${He} still thinks of ${himself} as a person, so ${he} isn't used to the idea of being surgically altered to suit your every whim. For now, ${he} seems to view ${his} altered breasts as a cruel imposition. As with all surgery ${his} health has been slightly affected. ${He} is now terribly afraid of your total power over ${his} body.`);
			reaction.trust -= 10;
		}

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

App.Medicine.Surgery.Procedures.BreastReconstruction = class extends App.Medicine.Surgery.Procedure {
	/**
	 *
	 * @param {App.Entity.SlaveState} slave
	 * @param {FC.BreastShape} boobShape
	 */
	constructor(slave, boobShape) {
		super(slave);
		this._boobShape = boobShape;
	}

	get name() {
		switch (this._boobShape) {
			case "torpedo-shaped":
				return "Make them torpedo-shaped";
			case "perky":
				return "Reshape them to be perkier";
			case "normal":
				return "Reshape them to be more normal";
		}
		return "Invalid boobShape: " + this._boobShape;
	}

	get healthCost() {
		return 10;
	}

	apply(cheat) {
		this._slave.boobShape = this._boobShape;
		return this._assemble(new App.Medicine.Surgery.Reactions.BreastReconstruction());
	}
};


code:
App.Medicine.Surgery.Reactions.BreastShapePreservation = 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} notices almost immediately the immense soreness in ${his} breasts. ${He} can't find anything off about them, but ${he} knows you did something to them. As with all surgery ${his} health has been slightly affected.`);

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

App.Medicine.Surgery.Reactions.BreastShapePreservationFailure = class extends App.Medicine.Surgery.SimpleReaction {
	intro(slave) {
		return [];
	}

	reaction(slave, diff) {
		const reaction = super.reaction(slave, diff);
		const {He, he, His, his, him, himself} = getPronouns(slave);
		const r = [];
		const heGlaresDaggers = (canSee(slave)) ? `${he} glares daggers` : `${his} face contorts with distaste`;

		function areolaeAndNipples() {
			if (slave.areolae > 2) {
				r.push(`The emergency mastectomy also <span class="change negative">slightly reduces ${his} massive areolae.</span>`);
			}
			if (slave.nipples === "huge") {
				r.push(`The emergency mastectomy also <span class="change negative">slightly reduces ${his} massive nipples.</span>`);
			} else if (slave.nipples === "fuckable") {
				r.push(`Without the tissue needed to support their unusual shape, ${his} fuckable nipples have reverted <span class="change negative">to being huge and protruding.</span>`);
			} else if (slave.nipples === "flat") {
				r.push(`Without the ${his} massive implants forcing them flat, ${his} nipples have reverted <span class="change positive">to being huge and protruding.</span>`);
			}
		}

		function movement() {
			if (hasAnyArms(slave)) {
				r.push(`${His}`);
				if (!hasBothArms(slave)) {
					r.push(`hands immediately dart`);
				} else {
					r.push(`hand immediately darts`);
				}
				r.push(`to grope ${his} tits, but ${he} only ends up grabbing air. ${His} face twitches, ${his} mind unable to comprehend why this has happened to ${him}. ${His}`);
				if (!hasBothArms(slave)) {
					r.push(`hand falls to ${his} side`);
				} else {
					r.push(`hands fall to ${his} sides`);
				}
				r.push(`as ${his} will breaks.`);
			} else {
				r.push(`${He} tries to squirm, and finds ${he} is no longer pinned by ${his} tits. ${His} face twitches, ${his} mind unable to comprehend why this has happened to ${him}. ${He} sobs once as ${his} will to go on breaks apart.`);
			}
		}

		reaction.shortReaction.push(`mesh implantation <span class="health dec">has gone wrong, resulting in a mastectomy!</span>`);

		r.push(`${slave.slaveName}'s mesh implantation <span class="health dec">has gone wrong, resulting in a mastectomy!</span>`);
		if (slave.boobs >= 7000) {
			areolaeAndNipples();
			if (slave.fetish === "mindbroken") {
				r.push(`As with all invasive surgery <span class="health dec">${his} health has been affected.</span>`);
			} else if (slave.sexualFlaw === "breast growth") {
				if (canSee(slave)) {
					r.push(`${He} can hardly believe what ${he} is seeing. The immense bust ${he} managed to grow has been all but stripped from ${him}. ${His} face fills with disbelief as ${his} flatness dawns on ${him}.`);
				} else {
					r.push(`${He} immediately notices the lack of an immense weight hanging off ${his} chest. ${His} face fills with disbelief as ${his} flatness dawns on ${him}.`);
				}
				movement();
				r.push(`${He} loved ${his} enormous breasts, and now that they are gone, ${he} has nothing to live for. Your apparent theft of ${his} obsession has broken ${his} mind. As with all invasive surgery ${his} health has been affected.`);
				applyMindbroken(slave);
				reaction.shortReaction.push(`It broke ${his} mind.`);
			} else if (this._strongKnownFetish(slave, "boobs") && slave.devotion <= 20) {
				if (canSee(slave)) {
					r.push(`${He} can hardly believe what ${he} is seeing. ${His} once magnificent, immense bust has been all but stripped from ${him}. ${His} face fills with resentment as ${his} flatness dawns on ${him}.`);
				} else {
					r.push(`${He} immediately notices the lack of an immense weight hanging off ${his} chest. ${His} face fills with resentment as ${his} flatness dawns on ${him}.`);
				}
				if (hasAnyArms(slave)) {
					r.push(`${He}'s still sore, so ${he} doesn't touch them, but ${heGlaresDaggers}.`);
				} else {
					r.push(`${He}'s still sore, so ${he} keeps ${his} torso still, but ${heGlaresDaggers}.`);
				}
				r.push(`${He} loved ${his} enormous breasts, and they were apparently swiped from off ${his} chest by the person ${he} was just beginning to entrust ${himself} to. ${He} sees this as a betrayal by you. As with all invasive surgery ${his} health has been affected. ${He} is now terribly afraid that you may chose to steal something else ${he} loves, even though it was your intent to preserve them.`);
				reaction.trust -= 40;
				reaction.devotion -= 20;
			} else if (slave.devotion > 50) {
				if (hasAnyArms(slave)) {
					r.push(`${He} hefts ${his} new, tiny breasts experimentally and turns to you with a smile to show off ${his} new, slimmer form, completely unaware this wasn't your intent. ${He}'s still sore, so ${he} doesn't bounce or squeeze, but ${he} turns from side to side to let you see them from all angles.`);
				} else {
					r.push(`${He} bounces a little to feel ${his} tiny breasts move and turns ${his} torso to you with a smile to show them off. ${He}'s still sore, so ${he} doesn't bounce too much.`);
				}
				r.push(`${He}'s happy with your changes to ${his} boobs and thankful that you'd consider ${his} health, well being and ability to fuck. As with all invasive surgery ${his} health has been affected.`);
				reaction.devotion += 4;
				reaction.trust += 4;
			} else if (slave.devotion >= -20) {
				if (canSee(slave)) {
					r.push(`${He} eyes ${his} new, tiny breasts with appreciation.`);
				} else {
					r.push(`${He} attempts to sway ${his} big tits experimentally, only to find ${his} chest barely moves at all.`);
				}
				if (hasAnyArms(slave)) {
					r.push(`${He}'s still sore, so ${he} doesn't touch them.`);
				} else {
					r.push(`${He}'s still sore, so ${he} keeps ${his} torso still.`);
				}
				r.push(`${He}'s come to terms with the fact that ${he}'s a slave, but both your and ${him} expected something other than this when ${he} was sent to the surgery. ${He} isn't much affected mentally. As with all invasive surgery ${his} health has been affected. ${He} is thankful that you removed the literal weight off ${his} chest.`);
				reaction.trust += 5;
			} else {
				if (canSee(slave)) {
					r.push(`${He} eyes the sudden lack of ${his} former breasts with relief.`);
				} else {
					r.push(`The sudden lack of weight on ${his} chest fills ${him} with relief.`);
				}
				if (hasAnyArms(slave)) {
					r.push(`${He}'s still sore, so ${he} doesn't touch them, but ${he} breathes easier without the immense weight hanging from ${him}.`);
				} else {
					r.push(`${He}'s still sore, so ${he} keeps ${his} torso still, but ${he} breathes easier without the immense weight hanging from ${him}.`);
				}
				r.push(`${He} still thinks of ${himself} as a person, so ${he} isn't used to the idea of being surgically altered to suit your every supposed whim. For now, ${he} seems appreciative of this literal weight lifted from ${his} chest and is thankful for your consideration of ${his} health, though it may be short lived. As with all invasive surgery ${his} health has been affected.`);
				reaction.trust += 10;
				reaction.devotion += 5;
			}
		} else {
			areolaeAndNipples();
			if (slave.fetish === "mindbroken") {
				r.push(`As with all invasive surgery <span class="health dec">${his} health has been affected.</span>`);
			} else if (slave.sexualFlaw === "breast growth") {
				if (canSee(slave)) {
					r.push(`${He} can hardly believe what ${he} is seeing. ${His} once glorious bust has been all but stripped from ${him}. ${His} face fills with disbelief as ${his} flatness dawns on ${him}.`);
				} else {
					r.push(`${He} immediately notices the lack of an immense weight hanging off ${his} chest. ${His} face fills with disbelief as ${his} flatness dawns on ${him}.`);
				}
				movement();
				r.push(`${He} loved ${his} huge breasts, and now that they are gone, ${he} has nothing to live for. Your theft of ${his} obsession has broken ${his} mind. As with all invasive surgery ${his} health has been affected.`);
				applyMindbroken(slave);
				reaction.shortReaction.push(`It broke ${his} mind.`);
			} else if (this._strongKnownFetish(slave, "boobs") && slave.devotion <= 20) {
				if (canSee(slave)) {
					r.push(`${He} can hardly believe what ${he} is seeing. ${His} once magnificent bust has been all but stripped from ${him}. ${His} face fills with resentment as ${his} flatness dawns on ${him}.`);
				} else {
					r.push(`${He} immediately notices the lack of an immense weight hanging off ${his} chest. ${His} face fills with resentment as ${his} flatness dawns on ${him}.`);
				}
				if (hasAnyArms(slave)) {
					r.push(`${He}'s still sore, so ${he} doesn't touch them, but ${heGlaresDaggers}.`);
				} else {
					r.push(`${He}'s still sore, so ${he} keeps ${his} torso still, but ${heGlaresDaggers}.`);
				}
				r.push(`${He} loved ${his} huge breasts, and they were apparently swiped from off ${his} chest by the person ${he} was just beginning to entrust ${himself} to. ${He} sees this as a betrayal by you. As with all invasive surgery ${his} health has been affected. ${He} is now terribly afraid that you may chose to steal something else ${he} loves, even though it was your intent to preserve them.`);
				reaction.trust -= 40;
				reaction.devotion -= 20;
			} else if (slave.devotion > 50) {
				if (hasAnyArms(slave)) {
					r.push(`${He} hefts ${his} new, tiny breasts experimentally and turns to you with a smile to show off ${his} new, slimmer form, completely unaware this wasn't your intent. ${He}'s still sore, so ${he} doesn't bounce or squeeze, but ${he} turns from side to side to let you see them from all angles.`);
				} else {
					r.push(`${He} bounces a little to feel ${his} tiny breasts move and turns ${his} torso to you with a smile to show them off. ${He}'s still sore, so ${he} doesn't bounce too much.`);
				}
				r.push(`<span class="devotion inc">${He}'s happy with your changes to ${his} boobs.</span> As with all invasive surgery <span class="health dec">${his} health has been affected.</span>`);
				reaction.devotion += 4;
			} else if (slave.devotion >= -20) {
				if (canSee(slave)) {
					r.push(`${He} eyes ${his} new, tiny breasts skeptically.`);
				} else {
					r.push(`${He} attempts to sway ${his} big tits experimentally, only to find ${his} chest barely moves at all.`);
				}
				if (hasAnyArms(slave)) {
					r.push(`${He}'s still sore, so ${he} doesn't touch them.`);
				} else {
					r.push(`${He}'s still sore, so ${he} keeps ${his} torso still.`);
				}
				r.push(`${He}'s come to terms with the fact that ${he}'s a slave, but both your and ${him} expected something other than this when ${he} was sent to the surgery. ${He} isn't much affected mentally. As with all invasive surgery ${his} health has been affected. ${He} is sensibly fearful of your total power over ${his} body.`);
				reaction.trust -= 5;
			} else {
				if (canSee(slave)) {
					r.push(`${He} eyes the sudden lack of ${his} former breasts with resentment.`);
				} else {
					r.push(`The sudden lack of weight on ${his} chest fills ${him} with resentment.`);
				}
				if (hasAnyArms(slave)) {
					r.push(`${He}'s still sore, so ${he} doesn't touch them, but ${heGlaresDaggers}.`);
				} else {
					r.push(`${He}'s still sore, so ${he} keeps ${his} torso still, but ${heGlaresDaggers}.`);
				}
				r.push(`${He} still thinks of ${himself} as a person, so ${he} isn't used to the idea of being surgically altered to suit your every whim. For now, ${he} seems to view this apparent surgical theft as a cruel imposition. As with all invasive surgery ${his} health has been affected. ${He} is now terribly afraid of your total power over ${his} body.`);
				reaction.trust -= 10;
				reaction.devotion -= 5;
			}
		}
		reaction.longReaction.push(r);

		return reaction;
	}

	outro(slave, previousReaction) {
		return this._createReactionResult();
	}
};

App.Medicine.Surgery.Procedures.BreastShapePreservation = class extends App.Medicine.Surgery.Procedure {
	get name() {
		return "Implant a supportive mesh to preserve their shape";
	}

	get _workCost() {
		return this.originalSlave.boobs / 100;
	}

	get healthCost() {
		return 10;
	}

	apply(cheat) {
		// if health - boobs/1000 < random(-100, -70)
		if (this._slave.health.condition - this._slave.boobs / 1000 < (Math.random() * 30 - 100)) {
			// failure
			this._slave.breastMesh = 0;
			// additional unexpected damage
			surgeryDamage(this._slave, 30);
			cashX(V.surgeryCost, "slaveSurgery", this._slave);
			// breasts are gone
			this._slave.boobs = 300;
			if (this._slave.areolae > 2) {
				this._slave.areolae -= 1;
			}
			if (this._slave.nipples === "huge") {
				this._slave.nipples = "puffy";
			} else if (this._slave.nipples === "fuckable") {
				this._slave.nipples = "huge";
			} else if (this._slave.nipples === "flat") {
				this._slave.nipples = "huge";
			}
			return this._assemble(new App.Medicine.Surgery.Reactions.BreastShapePreservationFailure());
		} else {
			// success
			this._slave.breastMesh = 1;
			return this._assemble(new App.Medicine.Surgery.Reactions.BreastShapePreservation());
		}
	}
};

repo_name: Mirarara/fc

license: mit


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

		if (slave.fetish === "mindbroken") {
			r.push(`${He} doesn't notice that ${his} butt has gotten larger. As with all surgery <span class="health dec">${his} health has been slightly affected.</span>`);
		} else if (slave.devotion > 20 && this._strongKnownFetish(slave, "buttslut")) {
			r.push(`${He} gently flexes ${his} sore buttocks with a sigh of pleasure. ${He}'s deliriously happy to have a bigger butt, since ${he} confidently expects that this will mean more cocks being shoved up ${his} asshole. ${He}'s so pleased that ${he} now trusts your plans for ${his} body. As with all surgery ${his} health has been slightly affected.`);
			reaction.trust += 4;
			reaction.devotion += 4;
		} else if (slave.devotion > 50) {
			r.push(`${He} rubs ${his} new butt experimentally and turns to you with a smile to show it off. ${He}'s still sore, so ${he} doesn't bounce or squeeze, but ${he} turns from side to side to let you see it from all angles. ${He}'s happy with your changes to ${his} ass. As with all surgery ${his} health has been slightly affected.`);
			reaction.devotion += 4;
		} else if (slave.devotion >= -20) {
			if (canSee(slave)) {
				r.push(`${He} eyes ${his} new butt`);
			} else {
				r.push(`${He} shifts ${his} new butt`);
			}
			r.push(`skeptically. ${He}'s still sore, so ${he} doesn't touch it. ${He}'s come to terms with the fact that ${he}'s a slave, so ${he} expected something like this when ${he} was sent to the surgery. ${He} isn't much affected mentally. As with all surgery ${his} health has been slightly affected. ${He} is sensibly fearful of your total power over ${his} body.`);
			reaction.trust -= 5;
		} else {
			if (canSee(slave)) {
				r.push(`${He} eyes ${his} new butt`);
			} else {
				r.push(`The new weight in ${his} backside fills ${him}`);
			}
			r.push(`with resentment. ${He}'s still sore, so ${he} doesn't touch them, but ${he} glares daggers. ${He} still thinks of ${himself} as a person, so ${he} isn't used to the idea of being surgically altered to suit your every whim. For now, ${he} seems to view this fake ass 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.Reactions.ButtLoss = class extends App.Medicine.Surgery.SimpleReaction {
	reaction(slave, diff) {
		const reaction = super.reaction(slave, diff);
		const {He, he, his, himself} = getPronouns(slave);
		const r = [];

		if (slave.fetish === "mindbroken") {
			r.push(`${He} doesn't notice that ${his} butt has gotten smaller. 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(`twists to view`);
			} else {
				r.push(`${He} jiggles`);
			}
			r.push(`${his} new, sleeker derrière and turns to you with a smile and a flirty little roll of ${his} hips. ${He}'s still sore, so ${he} doesn't bounce ${his} tighter buttocks for you, but ${he} seems happy all the same. ${He}'s happy with your changes to ${his} buttocks. 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(`twists to view`);
			} else {
				r.push(`jiggles`);
			}
			r.push(`${his} new, sleeker derrière skeptically.`);
			if (hasAnyArms(slave)) {
				r.push(`${He}'s still sore, so ${he} doesn't touch it.`);
			} else {
				r.push(`${He}'s still sore, so ${he} keeps ${his} torso still.`);
			}
			r.push(`${He}'s come to terms with the fact that ${he}'s a slave, but ${he} expected something other than this when ${he} was sent to the surgery. ${He} isn't much affected mentally. As with all surgery ${his} health has been slightly affected. ${He} is sensibly fearful of your total power over ${his} body.`);
			reaction.trust -= 5;
		} else {
			r.push(`${He} shifts ${his} diminished ass with resentment.`);
			if (hasAnyArms(slave)) {
				r.push(`${He}'s still sore, so ${he} doesn't touch it,`);
			} else {
				r.push(`${He}'s still sore, so ${he} keeps ${his} torso still,`);
			}
			r.push(`but ${(canSee(slave)) ? `${he} glares daggers` : `${his} face contorts with distaste`}.`);
			r.push(`${He} still thinks of ${himself} as a person, so ${he} isn't used to the idea of being surgically altered to suit your every whim. For now, ${he} seems to view this surgical ass theft 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;
	}
};

/**
 * @type {FC.Medicine.AssetSizingProcedureSet}
 */
App.Medicine.Surgery.Procedures.buttImplantsProcedure = function() {
	/**
	 * @template {FC.Medicine.SizingImplantProcedureConstructor} T
	 * @param {T} Procedure
	 * @param {ConstructorParameters<T>} args
	 */
	 function makeButtProcedure(Procedure, args) {
		return new (class extends Procedure {
			_doTargetGain() {
				return new App.Medicine.Surgery.Reactions.ButtGain();
			}

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

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

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

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

		get name() {
			return `${this._procedureName} butt`;
		}

		get description() {
			const {his} = getPronouns(this._slave);
			return `${this._procedureName} ${his} butt`;
		}

		get healthCost() { return 5; }

		get changeValue() { return -this._amount; }

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

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

		fill: (slave, amount) =>
			makeButtProcedure(App.Medicine.Surgery.Procedures.FillSizingImplantProcedure, [slave, "butt", amount]),
		drain: (slave, amount) =>
			makeButtProcedure(App.Medicine.Surgery.Procedures.DrainSizingImplantProcedure, [slave, "butt", amount]),

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


code:
App.Medicine.Surgery.Reactions.FatGraft = class extends App.Medicine.Surgery.SimpleReaction {
	/**
	 * @param {number} boobFat
	 * @param {number} buttFat
	 */
	constructor(boobFat, buttFat) {
		super();
		this.boobFat = boobFat;
		this.buttFat = buttFat;
	}

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

		if (slave.fetish === "mindbroken") {
			r.push(`${He} notices that ${his} weight is slightly off, almost as if it were someplace else. As with all surgeries, <span class="health dec">${his} health has been affected.</span>`);
		} else if (slave.behavioralFlaw === "anorexic") {
			if (canSee(slave)) {
				r.push(`${He} looks over ${his} new thin figure experimentally`);
			} else {
				r.push(`${He} shifts ${his} weight experimentally`);
			}
			r.push(`and turns to you with a smile to show it off. As an anorexic <span class="devotion inc">${he} thinks you have brought ${him} closer to the true ideal.</span>`);
			if (this.boobFat > 0) {
				if (slave.areolae < 2) {
					if (Math.random() > 0.7) {
						r.push(`The increase in breast size <span class="change positive">stretches and broadens ${his} areolae.</span>`);
						slave.areolae += 1;
					}
				}
				if (slave.devotion > 20 && this._strongKnownFetish(slave, "boobs")) {
					if (hasAnyArms(slave)) {
						r.push(`${He}'s barely out of the surgery before ${he}'s playing with ${his} new assets.`);
					} else {
						r.push(`${He}'s barely out of the surgery before ${he}'s rubbing ${his} new assets against anything ${he} can reach.`);
					}
					r.push(`${He}'s deliriously happy with your changes to what ${he} thinks of as ${his} primary sexual organs, so much so that ${he} now trusts your plans for ${his} body.`);
					reaction.trust += 4;
					reaction.devotion += 4;
				} else {
					if (hasAnyArms(slave)) {
						r.push(`${He} hefts ${his} new breasts experimentally and turns to you to show them off. ${He}'s still sore, so ${he} doesn't bounce or squeeze, but ${he} turns from side to side to let you see them from all angles.`);
					} else {
						r.push(`${He} bounces a little to feel ${his} new breasts move and turns ${his} torso to you to show them off. ${He}'s still sore, so ${he} doesn't move too much, but ${he} wiggles ${himself} a little to make them bounce for you.`);
					}
					r.push(`${He} isn't too fond of ${his} fat being moved to ${his} breasts instead of removed completely, but it's a small price to pay to not be a blimp.`);
				}
			}
			if (this.buttFat > 0) {
				if (slave.devotion > 20 && this._strongKnownFetish(slave, "buttslut")) {
					r.push(`${He} gently flexes ${his} sore buttocks with a sigh of pleasure. ${He}'s deliriously happy to have a bigger butt, since ${he} confidently expects that this will mean more cocks being shoved up ${his} asshole. ${He}'s so pleased that ${he} now trusts your plans for ${his} body.`);
					reaction.trust += 4;
					reaction.devotion += 4;
				} else if (slave.devotion > 50) {
					r.push(`${He} rubs ${his} new butt experimentally and turns to you to show it off. ${He}'s still sore, so ${he} doesn't bounce or squeeze, but ${he} turns from side to side to let you see it from all angles. ${He} isn't too keen on the idea of ${his} fat being moved to ${his} butt instead of removed completely, but ${he} accepts that it isn't hanging from ${his} front any longer.`);
				}
			}
			r.push(`As with all surgeries, <span class="health dec">${his} health has been affected.</span>`);
			reaction.devotion += 4;
		} else if (slave.devotion > 50) {
			if (canSee(slave)) {
				r.push(`${He} looks over ${his} new thin figure experimentally`);
			} else {
				r.push(`${He} shifts ${his} weight experimentally`);
			}
			r.push(`and turns to you with a smile to show it off. ${He}'s still sore, so ${he} doesn't bend or flirt, but ${he} turns around to let you see it from all angles. ${He}'s happy with your changes to ${his} body.`);
			if (this.boobFat > 0) {
				if (slave.areolae < 2) {
					if (Math.random() > 0.7) {
						r.push(`The increase in breast size <span class="change positive">stretches and broadens ${his} areolae.</span>`);
						slave.areolae += 1;
					}
				}
				if (slave.devotion > 20 && this._strongKnownFetish(slave, "boobs")) {
					if (hasAnyArms(slave)) {
						r.push(`${He}'s barely out of the surgery before ${he}'s playing with ${his} new assets.`);
					} else {
						r.push(`${He}'s barely out of the surgery before ${he}'s rubbing ${his} new assets against anything ${he} can reach.`);
					}
					r.push(`${He}'s deliriously happy with your changes to what ${he} thinks of as ${his} primary sexual organs, so much so that ${he} now trusts your plans for ${his} body.`);
					reaction.trust += 4;
					reaction.devotion += 4;
				} else if (slave.devotion > 50) {
					if (hasAnyArms(slave)) {
						r.push(`${He} hefts ${his} new breasts experimentally and turns to you with a smile to show them off. ${He}'s still sore, so ${he} doesn't bounce or squeeze, but ${he} turns from side to side to let you see them from all angles.`);
					} else {
						r.push(`${He} bounces a little to feel ${his} new breasts move and turns ${his} torso to you with a smile to show them off. ${He}'s still sore, so ${he} doesn't move too much, but ${he} wiggles ${himself} a little to make them bounce for you.`);
					}
				}
			}
			if (this.buttFat > 0) {
				if (slave.devotion > 20 && this._strongKnownFetish(slave, "buttslut")) {
					r.push(`${He} gently flexes ${his} sore buttocks with a sigh of pleasure. ${He}'s deliriously happy to have a bigger butt, since ${he} confidently expects that this will mean more cocks being shoved up ${his} asshole. ${He}'s so pleased that ${he} now trusts your plans for ${his} body.`);
					reaction.trust += 4;
					reaction.devotion += 4;
				} else if (slave.devotion > 50) {
					r.push(`${He} rubs ${his} new butt experimentally and turns to you with a smile to show it off. ${He}'s still sore, so ${he} doesn't bounce or squeeze, but ${he} turns from side to side to let you see it from all angles.`);
				}
			}
			r.push(`As with all surgery <span class="health dec">${his} health has been affected.</span>`);
			reaction.devotion += 4;
		} else if (slave.devotion >= -20) {
			if (this.boobFat > 0) {
				if (slave.areolae < 2) {
					if (Math.random() > 0.7) {
						r.push(`The increase in breast size <span class="change positive">stretches and broadens ${his} areolae.</span>`);
						slave.areolae += 1;
					}
				}
				if (canSee(slave)) {
					r.push(`${He} eyes ${his} new breasts`);
				} else {
					r.push(`${He} shifts them`);
				}
				r.push(`skeptically.`);
				if (hasAnyArms(slave)) {
					r.push(`${He}'s still sore, so ${he} doesn't touch them.`);
				} else {
					r.push(`${He}'s still sore, so ${he} keeps ${his} torso still.`);
				}
			}
			if (this.buttFat > 0) {
				if (canSee(slave)) {
					r.push(`${He} eyes ${his} new butt`);
				} else {
					r.push(`${He} shifts ${his} new butt`);
				}
				r.push(`skeptically. ${He}'s still sore, so ${he} doesn't touch it.`);
			}
			r.push(`${He}`);
			if (canSee(slave)) {
				r.push(`eyes ${his} new thin figure`);
			} else {
				r.push(`shifts ${his} weight`);
			}
			r.push(`skeptically. ${He}'s still sore, so ${he} doesn't bend or touch ${himself}. ${He}'s come to terms with the fact that ${he}'s a slave, so ${he} expected something like this when ${he} was sent to the surgery. ${He} isn't much affected mentally. As with all surgery ${his} health has been affected. ${He} is sensibly fearful of your total power over ${his} body.`);
			reaction.trust -= 5;
		} else {
			if (this.boobFat > 0) {
				if (slave.areolae < 2) {
					if (Math.random() > 0.7) {
						r.push(`The increase in breast size <span class="change positive">stretches and broadens ${his} areolae.</span>`);
						slave.areolae += 1;
					}
				}
				if (canSee(slave)) {
					r.push(`${He} eyes ${his} new breasts`);
				} else {
					r.push(`The new weight on ${his} chest fills ${him}`);
				}
				r.push(`with resentment.`);
			}
			if (this.buttFat > 0) {
				if (canSee(slave)) {
					r.push(`${He} eyes ${his} new butt`);
				} else {
					r.push(`The new weight in ${his} backside fills ${him}`);
				}
				r.push(`with resentment.`);
			}
			if (canSee(slave)) {
				r.push(`${He} eyes ${his} new thin figure`);
			} else {
				r.push(`How light ${he} feels fills ${him}`);
			}
			r.push(`with resentment. ${He}'s still sore, so ${he} doesn't bend or touch ${himself}, but ${canSee(slave) ? `${he} glares daggers` : `${his} face contorts with distaste`}. ${He} still thinks of ${himself} as a person, so ${he} isn't used to the idea of being surgically altered to suit your every whim. For now, ${he} seems to view this model figure as a cruel imposition. As with all surgery ${his} health has been affected. ${He} is terribly afraid of your total power over ${his} body.`);
			reaction.trust -= 15;
			reaction.devotion -= 5;
		}
		if (slave.weight > 190 && slave.bellySag < 10) {
			r.push(`Due to the tremendous amount of fat removed from ${his} midsection, it sags terribly after the surgery.`);
			slave.bellySag = 10;
		} else if (slave.weight > 130 && slave.bellySag < 5) {
			r.push(`Due to the large amount of fat removed from ${his} midsection, it droops noticeably after the surgery.`);
			slave.bellySag = 5;
		}
		slave.weight = 0;

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

App.Medicine.Surgery.Procedures.FatGraft = class extends App.Medicine.Surgery.Procedure {
	/**
	 * @param {App.Entity.SlaveState} slave
	 * @param {number} boobFat
	 * @param {number} buttFat
	 */
	constructor(slave, boobFat, buttFat) {
		super(slave);
		this.boobFat = boobFat;
		this.buttFat = buttFat;
	}

	get name() {
		return "Finalize fat transfer";
	}

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

	get healthCost() {
		return 40;
	}

	apply(cheat) {
		this._slave.boobs += this.boobFat * 100;
		this._slave.butt += this.buttFat;
		this._slave.boobs = Math.clamp(this._slave.boobs, 0, 50000);
		this._slave.butt = Math.clamp(this._slave.butt, 0, 20);

		return this._assemble(new App.Medicine.Surgery.Reactions.FatGraft(this.boobFat, this.buttFat));
	}
};


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

		if (slave.boobShape === "saggy") {
			r.push(`As excess skin and flesh was removed from ${his} breasts, care was taken to <span class="lime">reshape ${his} boobs to be nice and perky.</span>`);
		}
		if (slave.areolae > 2) {
			r.push(`The breast reduction surgery also <span class="orange">slightly reduces ${his} massive areolae.</span>`);
		}
		if (slave.nipples === "huge") {
			r.push(`The breast reduction surgery also <span class="orange">slightly reduces ${his} massive nipples.</span>`);
		} else if (slave.nipples === "flat") {
			r.push(`Without the ${his} massive implants forcing them flat, ${his} nipples have reverted <span class="lime">to being huge and protruding.</span>`);
		} else if (slave.nipples === "fuckable") {
			r.push(`Without the tissue needed to support their unusual shape, ${his} fuckable nipples have reverted <span class="orange">to being huge and protruding.</span>`);
		}

		if (slave.boobs >= 7000) {
			this._largeMastectomy(slave, r, reaction);
		} else {
			this._normalMastectomy(slave, r, reaction);
		}

		return reaction;
	}

	/**
	 * @param {App.Entity.SlaveState} slave
	 * @param {string[]} r
	 * @param {reactionResult} reaction
	 * @private
	 */
	_normalMastectomy(slave, r, reaction) {
		const {He, he, His, his, him, himself} = getPronouns(slave);

		if (slave.fetish === "mindbroken") {
			r.push(`${He} shows little awareness that ${his} breasts are gone. As with all invasive surgery <span class="health dec">${his} health has been affected.</span>`);
		} else if (slave.sexualFlaw === "breast growth") {
			if (canSee(slave)) {
				r.push(`${He} can hardly believe what ${he} is seeing. ${His} once glorious bust has been all but stripped from ${him}. ${His} face fills with disbelief as ${his} flatness dawns on ${him}.`);
			} else {
				r.push(`${He} immediately notices the lack of an immense weight hanging off ${his} chest. ${His} face fills with disbelief as ${his} flatness dawns on ${him}.`);
			}
			if (hasAnyArms(slave)) {
				r.push(`${His}`);
				if (!hasBothArms(slave)) {
					r.push(`hands immediately dart`);
				} else {
					r.push(`hand immediately darts`);
				}
				r.push(`to grope ${his} tits, but ${he} only ends up grabbing air. ${His} face twitches, ${his} mind unable to comprehend why this has happened to ${him}. ${His}`);
				if (!hasBothArms(slave)) {
					r.push(`hand falls to ${his} side`);
				} else {
					r.push(`hands fall to ${his} sides`);
				}
				r.push(`as ${his} will breaks.`);
			} else {
				r.push(`${He} tries to squirm, and finds ${he} is no longer pinned by ${his} tits. ${His} face twitches, ${his} mind unable to comprehend why this has happened to ${him}. ${He} sobs once as ${his} will to go on breaks apart.`);
			}
			r.push(`${He} loved ${his} huge breasts, and now that they are gone, ${he} has nothing to live for. Your theft of ${his} obsession has broken ${his} mind. As with all invasive surgery ${his} health has been affected.`);
			applyMindbroken(slave);
			reaction.shortReaction.push(`${His} mind <span class="mindbreak">broke.</span>`);
		} else if (this._strongKnownFetish(slave, "boobs") && slave.devotion <= 20) {
			if (canSee(slave)) {
				r.push(`${He} can hardly believe what ${he} is seeing. ${His} once magnificent bust has been all but stripped from ${him}. ${His} face fills with resentment as ${his} flatness dawns on ${him}.`);
			} else {
				r.push(`${He} immediately notices the lack of an immense weight hanging off ${his} chest. ${His} face fills with resentment as ${his} flatness dawns on ${him}.`);
			}
			if (hasAnyArms(slave)) {
				r.push(`${He}'s still sore, so ${he} doesn't touch them,`);
			} else {
				r.push(`${He}'s still sore, so ${he} keeps ${his} torso still,`);
			}
			r.push(`but ${canSee(slave) ? `${he} glares daggers` : `${his} face contorts with distaste`}.`);
			r.push(`${He} loved ${his} huge breasts, and they were swiped from off ${his} chest by the person ${he} was just beginning to entrust ${himself} to. ${He} sees this as a betrayal by you. As with all invasive surgery ${his} health has been affected. ${He} is now terribly afraid that you may chose to steal something else ${he} loves.`);
			reaction.trust -= 40;
			reaction.devotion -= 20;
		} else if (slave.devotion > 50) {
			if (hasAnyArms(slave)) {
				r.push(`${He} hefts ${his} new, tiny breasts experimentally and turns to you with a smile to show off ${his} new, slimmer form. ${He}'s still sore, so ${he} doesn't bounce or squeeze, but ${he} turns from side to side to let you see them from all angles.`);
			} else {
				r.push(`${He} bounces a little to feel ${his} tiny breasts move and turns ${his} torso to you with a smile to show them off. ${He}'s still sore, so ${he} doesn't bounce too much.`);
			}
			r.push(`<span class="devotion inc">${He}'s happy with your changes to ${his} boobs.</span> As with all invasive surgery <span class="health dec">${his} health has been affected.</span>`);
			reaction.devotion += 4;
		} else if (slave.devotion >= -20) {
			if (canSee(slave)) {
				r.push(`${He} eyes ${his} new, tiny breasts skeptically.`);
			} else {
				r.push(`${He} attempts to sway ${his} big tits experimentally, only to find ${his} chest barely moves at all.`);
			}
			if (hasAnyArms(slave)) {
				r.push(`${He}'s still sore, so ${he} doesn't touch them.`);
			} else {
				r.push(`${He}'s still sore, so ${he} keeps ${his} torso still.`);
			}
			r.push(`${He}'s come to terms with the fact that ${he}'s a slave, but ${he} expected something other than this when ${he} was sent to the surgery. ${He} isn't much affected mentally. As with all invasive surgery ${his} health has been affected. ${He} is sensibly fearful of your total power over ${his} body.`);
			reaction.trust -= 5;
		} else {
			if (canSee(slave)) {
				r.push(`${He} eyes the sudden lack of ${his} former breasts with resentment.`);
			} else {
				r.push(`The sudden lack of weight on ${his} chest fills ${him} with resentment.`);
			}
			if (hasAnyArms(slave)) {
				r.push(`${He}'s still sore, so ${he} doesn't touch them,`);
			} else {
				r.push(`${He}'s still sore, so ${he} keeps ${his} torso still,`);
			}
			r.push(`but ${canSee(slave) ? `${he} glares daggers` : `${his} face contorts with distaste`}.`);
			r.push(`${He} still thinks of ${himself} as a person, so ${he} isn't used to the idea of being surgically altered to suit your every whim. For now, ${he} seems to view this surgical theft as a cruel imposition. As with all invasive surgery ${his} health has been affected. ${He} is now terribly afraid of your total power over ${his} body.`);
			reaction.trust -= 10;
			reaction.devotion -= 5;
		}
		reaction.longReaction.push(r);
	}

	/**
	 * @param {App.Entity.SlaveState} slave
	 * @param {string[]} r
	 * @param {reactionResult} reaction
	 * @private
	 */
	_largeMastectomy(slave, r, reaction) {
		const {He, he, His, his, him, himself} = getPronouns(slave);

		if (slave.fetish === "mindbroken") {
			r.push(`${He} shows little awareness that ${his} breasts are gone, despite such a massive change. As with all invasive surgery <span class="health dec">${his} health has been affected.</span>`);
		} else if (slave.sexualFlaw === "breast growth") {
			if (canSee(slave)) {
				r.push(`${He} can hardly believe what ${he} is seeing. The immense bust ${he} managed to grow has been all but stripped from ${him}. ${His} face fills with disbelief as ${his} flatness dawns on ${him}.`);
			} else {
				r.push(`${He} immediately notices the lack of an immense weight hanging off ${his} chest. ${His} face fills with disbelief as ${his} flatness dawns on ${him}.`);
			}
			if (hasAnyArms(slave)) {
				r.push(`${His}`);
				if (!hasBothArms(slave)) {
					r.push(`hands immediately dart`);
				} else {
					r.push(`hand immediately darts`);
				}
				r.push(`to grope ${his} tits, but ${he} only ends up grabbing air. ${His} face twitches, ${his} mind unable to comprehend why this has happened to ${him}. ${His}`);
				if (!hasBothArms(slave)) {
					r.push(`hand falls to ${his} side`);
				} else {
					r.push(`hands fall to ${his} sides`);
				}
				r.push(`as ${his} will breaks.`);
			} else {
				r.push(`${He} tries to squirm, and finds ${he} is no longer pinned by ${his} tits. ${His} face twitches, ${his} mind unable to comprehend why this has happened to ${him}. ${He} sobs once as ${his} will to go on breaks apart.`);
			}
			r.push(`${He} loved ${his} enormous breasts, and now that they are gone, ${he} has nothing to live for. Your theft of ${his} obsession has broken ${his} mind. As with all invasive surgery ${his} health has been affected.`);
			applyMindbroken(slave);
			reaction.shortReaction.push(`${His} mind <span class="mindbreak">broke.</span>`);
		} else if (this._strongKnownFetish(slave, "boobs") && slave.devotion <= 20) {
			if (canSee(slave)) {
				r.push(`${He} can hardly believe what ${he} is seeing. ${His} once magnificent, immense bust has been all but stripped from ${him}. ${His} face fills with resentment as ${his} flatness dawns on ${him}.`);
			} else {
				r.push(`${He} immediately notices the lack of an immense weight hanging off ${his} chest. ${His} face fills with resentment as ${his} flatness dawns on ${him}.`);
			}
			if (hasAnyArms(slave)) {
				r.push(`${He}'s still sore, so ${he} doesn't touch them,`);
			} else {
				r.push(`${He}'s still sore, so ${he} keeps ${his} torso still,`);
			}
			r.push(`but ${canSee(slave) ? `${he} glares daggers` : `${his} face contorts with distaste`}.`);
			r.push(`${He} loved ${his} enormous breasts, and they were swiped from off ${his} chest by the person ${he} was just beginning to entrust ${himself} to. ${He} sees this as a betrayal by you. As with all invasive surgery ${his} health has been affected. ${He} is now terribly afraid that you may chose to steal something else ${he} loves.`);
			reaction.trust -= 40;
			reaction.devotion -= 20;
		} else if (slave.devotion > 50) {
			if (hasAnyArms(slave)) {
				r.push(`${He} hefts ${his} new, tiny breasts experimentally and turns to you with a smile to show off ${his} new, slimmer form. ${He}'s still sore, so ${he} doesn't bounce or squeeze, but ${he} turns from side to side to let you see them from all angles.`);
			} else {
				r.push(`${He} bounces a little to feel ${his} tiny breasts move and turns ${his} torso to you with a smile to show them off. ${He}'s still sore, so ${he} doesn't bounce too much.`);
			}
			r.push(`${He}'s happy with your changes to ${his} boobs and thankful that you'd consider ${his} health, well being and ability to fuck. As with all invasive surgery ${his} health has been affected.`);
			reaction.devotion += 4;
			reaction.trust += 4;
		} else if (slave.devotion >= -20) {
			if (canSee(slave)) {
				r.push(`${He} eyes ${his} new, tiny breasts with appreciation.`);
			} else {
				r.push(`${He} attempts to sway ${his} big tits experimentally, only to find ${his} chest barely moves at all.`);
			}
			if (hasAnyArms(slave)) {
				r.push(`${He}'s still sore, so ${he} doesn't touch them.`);
			} else {
				r.push(`${He}'s still sore, so ${he} keeps ${his} torso still.`);
			}
			r.push(`${He}'s come to terms with the fact that ${he}'s a slave, but ${he} expected something other than this when ${he} was sent to the surgery. ${He} isn't much affected mentally. As with all invasive surgery ${his} health has been affected. ${He} is thankful that you removed the literal weight off ${his} chest.`);
			reaction.trust += 5;
		} else {
			if (canSee(slave)) {
				r.push(`${He} eyes the sudden lack of ${his} former breasts with relief.`);
			} else {
				r.push(`The sudden lack of weight on ${his} chest fills ${him} with relief.`);
			}
			if (hasAnyArms(slave)) {
				r.push(`${He}'s still sore, so ${he} doesn't touch them, but ${he} breathes easier without the immense weight hanging from ${him}.`);
			} else {
				r.push(`${He}'s still sore, so ${he} keeps ${his} torso still, but ${he} breathes easier without the immense weight hanging from ${him}.`);
			}
			r.push(`${He} still thinks of ${himself} as a person, so ${he} isn't used to the idea of being surgically altered to suit your every whim. For now, ${he} seems appreciative of this literal weight lifted from ${his} chest and is thankful for your consideration of ${his} health. As with all invasive surgery ${his} health has been affected.`);
			reaction.trust += 10;
			reaction.devotion += 5;
		}

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

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

	get description() {
		return "Perform Mastectomy";
	}

	get healthCost() { return 30; }

	get changeValue() { return 300 - this._slave.boobs; }

	apply(cheat) {
		if (this._slave.boobShape === "saggy") {
			this._slave.boobShape = "perky";
		}
		if (this._slave.areolae > 2) {
			this._slave.areolae -= 1;
		}
		if (this._slave.nipples === "huge") {
			this._slave.nipples = "puffy";
		} else if (this._slave.nipples === "flat") {
			this._slave.nipples = "huge";
		} else if (this._slave.nipples === "fuckable") {
			this._slave.nipples = "huge";
		}
		this._slave.boobs = 300;

		return this._assemble(new App.Medicine.Surgery.Reactions.Mastectomy());
	}
};


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

		if (slave.fetish === "mindbroken") {
			if (canSee(slave)) {
				r.push(`${He} eyes ${his} lighter belly with appreciation.`);
			} else {
				r.push(`${He} attempts to shift ${himself}, only to find ${his} middle is not as heavy as before.`);
			}
			if (hasAnyArms(slave)) {
				r.push(`${He}'s still sore, so ${he} doesn't touch it.`);
			} else {
				r.push(`${He}'s still sore, so ${he} keeps ${his} torso still.`);
			}
			r.push(`${He} can't why it is smaller now. As with all surgery <span class="health dec">${his} health has been slightly affected.</span>`);
		} else if (slave.devotion > 50) {
			if (hasAnyArms(slave)) {
				r.push(`${He} hefts ${his} lighter belly experimentally and turns to you with a smile to show off ${his} new, slimmer form. ${He}'s still sore, so ${he} doesn't bounce or stretch, but ${he} turns from side to side to let you see it from all angles.`);
			} else {
				r.push(`${He} bounces a little to feel the change in weight within ${his} middle and turns ${his} torso to you with a smile to show is off. ${He}'s still sore, so ${he} doesn't bounce too much.`);
			}
			r.push(`${He}'s happy with your changes to ${his} body and trusts that your looking out for ${his} ability to serve you. As with all surgery ${his} health has been slightly affected.`);
			reaction.devotion += 3;
			reaction.trust += 3;
		} else if (slave.devotion >= -20) {
			if (canSee(slave)) {
				r.push(`${He} eyes ${his} lighter belly with appreciation.`);
			} else {
				r.push(`${He} attempts to shift ${himself}, only to find ${his} middle is not as heavy as before.`);
			}
			if (hasAnyArms(slave)) {
				r.push(`${He}'s still sore, so ${he} doesn't touch it.`);
			} else {
				r.push(`${He}'s still sore, so ${he} keeps ${his} torso still.`);
			}
			r.push(`${He}'s come to terms with the fact that ${he}'s a slave, but ${he} expected something other than this when ${he} was sent to the surgery. ${He} isn't much affected mentally. As with all surgery ${his} health has been slightly affected. ${He} is thankful that you removed some weight off ${his} body.`);
			reaction.trust += 2;
		} else {
			if (canSee(slave)) {
				r.push(`${He} eyes ${his} lighter belly with relief.`);
			} else {
				r.push(`${He} attempts to shift ${himself}, only to find ${his} middle is not as heavy as before.`);
			}
			if (hasAnyArms(slave)) {
				r.push(`${He}'s still sore, so ${he} doesn't touch it, but ${he} breathes easier without the extra weight in ${him}.`);
			} else {
				r.push(`${He}'s still sore, so ${he} keeps ${his} torso still, but ${he} breathes easier without the extra weight in ${him}.`);
			}
			r.push(`${He} still thinks of ${himself} as a person, so ${he} isn't used to the idea of being surgically altered to suit your every whim. For now, ${he} seems appreciative of this literal weight lifted from ${him}. As with all surgery ${his} health has been slightly affected. ${He} is now terribly afraid of your total power over ${his} body.`);
			reaction.devotion += 1;
			reaction.trust -= 10;
		}

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

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

	get healthCost() {
		return 5;
	}

	apply(cheat) {
		this._slave.bellyImplant = Math.max(this._slave.bellyImplant - 200, 0);
		SetBellySize(this._slave);
		return this._assemble(new App.Medicine.Surgery.Reactions.BellyDown());
	}
};

App.Medicine.Surgery.Procedures.BellyDownLarge = class extends App.Medicine.Surgery.Procedure {
	get name() {
		return "Greatly drain implant";
	}

	get healthCost() {
		return 5;
	}

	apply(cheat) {
		this._slave.bellyImplant -= 500;
		SetBellySize(this._slave);
		return this._assemble(new App.Medicine.Surgery.Reactions.BellyDown());
	}
};


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

		if (slave.fetish === "mindbroken") {
			r.push(`${He} leaves the surgery with nothing but a nonspecific ache in ${his} lower abdomen 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 as such, knows you put something into ${his} womb. ${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 and slight weight in ${his} lower abdomen, and as such, knows you put something into ${his} womb. ${He} understands the realities of ${his} life as a slave, but ${he} is still surprised at what now resides in ${his} womb. As with all surgery ${his} health has been slightly affected. ${He} is sensibly fearful of your total power over ${his} body.`);
			reaction.trust -= 5;
		} else {
			r.push(`${He} leaves the surgery with nothing but a nonspecific ache in ${his} lower abdomen, but ${he} knows enough about surgery and sex slaves to believe that ${he} has been impregnated. ${He} does not understand the realities of ${his} life as a slave at a core level, so ${he}'s terrified and angry at the potential that ${he}'s been bred. Even after what has been implanted into ${his} womb is explained to ${him}, ${he} is no less defiant; though ${he} is relieved that ${he} isn't pregnant. As with all surgery ${his} health has been slightly affected. ${He} is sensibly fearful of your total power over ${his} body.`);
			reaction.trust -= 5;
			reaction.devotion -= 5;
		}

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

App.Medicine.Surgery.Procedures.BellyIn = class extends App.Medicine.Surgery.Procedure {
	get name() {
		return "Implant a fillable abdominal implant";
	}

	get healthCost() {
		return 10;
	}

	apply(cheat) {
		this._slave.bellyImplant = 0;
		this._slave.preg = -2;
		this._slave.bellyPain += 1;
		return this._assemble(new App.Medicine.Surgery.Reactions.BellyIn());
	}
};


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

		if (slave.fetish === "mindbroken") {
			r.push(`${He} leaves the surgery with nothing but a nonspecific ache in ${his} lower abdomen that ${he} cannot figure out the source of. As ${his} surgery was very invasive ${his} health has been greatly impacted.`);
		} else if (slave.devotion > 50) {
			r.push(`${He} leaves the surgery with nothing but a nonspecific ache in ${his} lower abdomen, and as such, knows you put something into ${his} body. ${He} is curious about the details of the implant, and eagerly awaits to see the end result. As ${his} surgery was very invasive ${his} health has been greatly impacted.`);
			reaction.devotion += 4;
		} else if (slave.devotion >= -20) {
			r.push(`${He} leaves the surgery with nothing but a nonspecific ache and slight weight in ${his} lower abdomen, and as such, knows you put something into ${his} body. ${He} understands the realities of ${his} life as a slave, but ${he} is still surprised at what now resides in ${his} middle. As ${his} surgery was very invasive ${his} health has been greatly impacted. ${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 as such, knows you put something into ${his} body. ${He} does not understand the realities of ${his} life as a slave at a core level, so ${he}'s terrified and angry at your treatment of ${his} body. As ${his} surgery was very invasive ${his} health has been greatly impacted. ${He} is sensibly fearful of your total power over ${his} body.`);
			reaction.trust -= 5;
			reaction.devotion -= 5;
		}

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

App.Medicine.Surgery.Procedures.BellyInMale = class extends App.Medicine.Surgery.Procedure {
	get name() {
		return "Implant a fillable abdominal implant";
	}

	get healthCost() {
		return 50;
	}

	apply(cheat) {
		this._slave.bellyImplant = 0;
		this._slave.bellyPain += 2;
		return this._assemble(new App.Medicine.Surgery.Reactions.BellyInMale());
	}
};


code:
App.Medicine.Surgery.Reactions.BellyOut = 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} notices almost immediately that the weight in ${his} middle is gone. ${He} shifts ${his} torso idly; it looks like ${he} doesn't know what to think about having ${his} belly implant removed. As with all surgery ${his} health has been slightly affected.`);

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

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

	get healthCost() {
		return 10;
	}

	apply(cheat) {
		this._slave.bellyImplant = -1;
		this._slave.cervixImplant = 0;
		SetBellySize(this._slave);
		return this._assemble(new App.Medicine.Surgery.Reactions.BellyOut());
	}
};


code:
App.Medicine.Surgery.Reactions.BellyUp = class extends App.Medicine.Surgery.SimpleReaction {
	reaction(slave, diff) {
		const reaction = super.reaction(slave, diff);
		const {He, he, His, his, him, himself} = getPronouns(slave);
		const heGlaresDaggers = canSee(slave) ? `${he} glares daggers` : `${his} face contorts with distaste`;
		const r = [];

		if (slave.bellyImplant >= 10000 && slave.bellyImplant < 12000) {
			r.push(`${His} bellybutton has become an outie from the size of the implant within ${him}.`);
		}
		if (slave.bellyPain === 1) {
			if (slave.fetish === "mindbroken") {
				if (canSee(slave)) {
					r.push(`${He} eyes ${his} expanded belly`);
				} else {
					r.push(`${He} shifts ${his} expanded belly`);
				}
				r.push(`skeptically.`);
				if (hasAnyArms(slave)) {
					r.push(`${He}'s still sore, so ${he} doesn't touch it.`);
				} else {
					r.push(`${He}'s still sore, so ${he} keeps ${his} torso still.`);
				}
				r.push(`${He} doesn't understand why it has gotten larger either. As with all surgery <span class="health dec">${his} health has been slightly affected.</span>`);
			} else if (slave.devotion > 50) {
				if (hasAnyArms(slave)) {
					r.push(`${He} runs ${his} fingers over ${his} expanded belly experimentally and turns to you with a smile to show it off. ${He}'s still sore, so ${he} doesn't bounce or stretch, but ${he} turns from side to side to let you see it from all angles.`);
				} else {
					r.push(`${He} bounces a little to feel the weight in ${his} expanded middle and turns ${his} torso to you with a smile to show it off. ${He}'s still sore, so ${he} doesn't move too much, but ${he} wiggles ${himself} a little to make it move for you.`);
				}
				r.push(`<span class="devotion inc">${He}'s happy with your changes to ${his} body.</span> As with all surgery <span class="health dec">${his} health has been slightly affected.</span>`);
				reaction.devotion += 4;
			} else if (slave.devotion >= -20) {
				if (canSee(slave)) {
					r.push(`${He} eyes ${his} expanded belly`);
				} else {
					r.push(`${He} shifts ${his} expanded belly`);
				}
				r.push(`skeptically.`);
				if (hasAnyArms(slave)) {
					r.push(`${He}'s still sore, so ${he} doesn't touch it.`);
				} else {
					r.push(`${He}'s still sore, so ${he} keeps ${his} torso still.`);
				}
				r.push(`${He}'s come to terms with the fact that ${he}'s a slave, so ${he} expected something like this when ${he} was sent to the surgery. ${He} isn't much affected mentally. As with all surgery ${his} health has been slightly affected. ${He} is sensibly fearful of your total power over ${his} body.`);
				reaction.trust -= 5;
			} else {
				if (canSee(slave)) {
					r.push(`${He} eyes ${his} expanded belly`);
				} else {
					r.push(`The new weight on ${his} midriff fills ${him}`);
				}
				r.push(`with resentment.`);
				if (hasAnyArms(slave)) {
					r.push(`${He}'s still sore, so ${he} doesn't touch it, but ${heGlaresDaggers}.`);
				} else {
					r.push(`${He}'s still sore, so ${he} keeps ${his} torso still, but ${heGlaresDaggers}.`);
				}
				r.push(`${He} still thinks of ${himself} as a person, so ${he} isn't used to the idea of being surgically altered to suit your every whim. For now, ${he} seems to view this rounded belly as a cruel imposition. As with all surgery ${his} health has been slightly affected. ${He} is now terribly afraid of your total power over ${his} body.`);
				reaction.trust -= 10;
				reaction.devotion -= 5;
			}
		} else if (slave.bellyPain === 2) {
			if (slave.fetish === "mindbroken") {
				if (canSee(slave)) {
					r.push(`${He} eyes ${his} painfully expanded belly`);
				} else {
					r.push(`${He} shifts ${his} painfully expanded belly`);
				}
				r.push(`skeptically.`);
				if (hasAnyArms(slave)) {
					r.push(`${He}'s extremely sore, so ${he} doesn't touch it.`);
				} else {
					r.push(`${He}'s still extremely sore, so ${he} keeps ${his} torso still.`);
				}
				r.push(`${He} can't understand how it has grown so much so fast. Since ${his} body has been pushed beyond its limits, <span class="health dec">${his} health has been notably affected.</span>`);
			} else if (slave.devotion > 50) {
				if (hasAnyArms(slave)) {
					r.push(`${He} gingerly runs ${his} fingers over ${his} painfully expanded belly and turns to you to show it off. ${He}'s extremely sore, so ${he} doesn't bounce or stretch, but ${he} tries to turn from side to side to let you see it from all angles.`);
				} else {
					r.push(`${He} is so sore, ${he} doesn't dare move the weight in ${his} expanded middle, but ${he} turns ${his} torso to you to show it off. ${He} stomachs the pain and wiggles ${himself} a little to make it move for you.`);
				}
				r.push(`${He}'s certain ${he}'ll be happy with your changes to ${his} body once the pain subsides. Since ${his} body has been pushed beyond its limits, ${his} health has been notably affected.`);
				reaction.devotion += 2;
			} else if (slave.devotion >= -20) {
				if (canSee(slave)) {
					r.push(`${He} eyes ${his} painfully expanded belly`);
				} else {
					r.push(`${He} shifts ${his} painfully expanded belly`);
				}
				r.push(`skeptically.`);
				if (hasAnyArms(slave)) {
					r.push(`${He}'s extremely sore, so ${he} doesn't touch it.`);
				} else {
					r.push(`${He}'s still extremely sore, so ${he} keeps ${his} torso still.`);
				}
				r.push(`${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. Since ${his} body has been pushed beyond its limits, ${his} health has been notably affected. ${He} is sensibly fearful of your total power over ${his} body.`);
				reaction.trust -= 7;
			} else {
				if (canSee(slave)) {
					r.push(`${He} eyes ${his} painfully expanded belly`);
				} else {
					r.push(`The new, painful weight on ${his} midriff fills ${him}`);
				}
				r.push(`with resentment.`);
				if (hasAnyArms(slave)) {
					r.push(`${He}'s still extremely sore, so ${he} doesn't touch it, but ${heGlaresDaggers}.`);
				} else {
					r.push(`${He}'s still extremely sore, so ${he} keeps ${his} torso still, but ${heGlaresDaggers}.`);
				}
				r.push(`${He} still thinks of ${himself} as a person, so ${he} isn't used to the idea of being surgically altered to suit your every whim. For now, ${he} seems to view this rounded belly as a terribly cruel imposition. Since ${his} body has been pushed beyond its limits, ${his} health has been notably affected. ${He} is now terribly afraid of your total power over ${his} body.`);
				reaction.trust -= 12;
				reaction.devotion -= 7;
			}
		}

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

App.Medicine.Surgery.Procedures.BellyUp = class extends App.Medicine.Surgery.Procedure {
	get name() {
		return "Add inert filler";
	}

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

	get healthCost() {
		return this.originalSlave.bellyPain ? 30 : 10;
	}

	apply(cheat) {
		this._slave.bellyImplant += 200;
		this._slave.bellyPain += 1;
		SetBellySize(this._slave);
		return this._assemble(new App.Medicine.Surgery.Reactions.BellyUp());
	}
};

App.Medicine.Surgery.Procedures.BellyUpLarge = class extends App.Medicine.Surgery.Procedure {
	get name() {
		return "Add a considerable amount of inert filler";
	}

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

	get healthCost() {
		return this.originalSlave.bellyPain ? 40 : 20;
	}

	apply(cheat) {
		this._slave.bellyImplant += 500;
		this._slave.bellyPain += 1;
		SetBellySize(this._slave);
		return this._assemble(new App.Medicine.Surgery.Reactions.BellyUp());
	}
};


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

		const cervixPumpAcheLocation = "vagina";
		const cervixPumpLocation = "cervix";

		if (slave.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} most private place. ${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} womb 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 vaginal 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;
		}

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

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

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

	get healthCost() {
		return 10;
	}

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


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 === "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 === "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 awhile 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());
	}
};


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:
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 === "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 === "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());
	}
};