code:
{
	class FatGraft extends App.Medicine.Surgery.Reaction {
		get key() { return "fat graft"; }

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

			const boobFat = Math.max(V.boobFat, 0) || 0;	// FIXME: Property 'boobFat' does not exist on type 'GameVariables'.
			const buttFat = Math.max(V.buttFat, 0) || 0;	// FIXME: Property 'buttFat' does not exist on type 'GameVariables'.

			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 (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 (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 (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 (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 (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 (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 (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 (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;
		}
	}

	new FatGraft();
}


code:
{
	class Fertility extends App.Medicine.Surgery.Reaction {
		get key() { return "fert"; }

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

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

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

	new Fertility();
}

repo_name: CloudyCoffee/fc

license: mit


code:
{
	class ForeskinTuck extends App.Medicine.Surgery.Reaction {
		get key() { return "foreskinTuck"; }

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

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

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

	new ForeskinTuck();
}


code:
{
	class Fuckdoll extends App.Medicine.Surgery.Reaction {
		get key() { return "fuckdoll"; }

		get removeJob() { return true; }

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

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

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

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

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

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

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

			return reaction;
		}
	}

	new Fuckdoll();
}


code:
{
	class FuckdollExtraction extends App.Medicine.Surgery.Reaction {
		get key() { return "fuckdollExtraction"; }

		intro(slave) {
			const r = [];
			r.push(`As the remote surgery's long recovery cycle completes, ${slave.slaveName}`);
			if (!hasAnyLegs(slave)) {
				r.push(`is carried`);
			} else if (canWalk(slave)) {
				r.push(`walks`);
			} else {
				r.push(`is escorted`);
			}
			r.push(`out of the surgery room.`);
			return r;
		}

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

	new FuckdollExtraction();
}


code:
{
	class Geld extends App.Medicine.Surgery.Reaction {
		get key() { return "geld"; }

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

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

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

	new Geld();
}


code:
{
	class Herm extends App.Medicine.Surgery.Reaction {
		get key() { return "herm"; }

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

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

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

	new Herm();
}


code:
{
	class Insemination extends App.Medicine.Surgery.Reaction {
		get key() { return "insemination"; }

		get invasive() { return false; }

		get permanentChanges() { return false; }

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

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

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

	new Insemination();
}


code:
{
	class Labiaplasty extends App.Medicine.Surgery.Reaction {
		get key() { return "labiaplasty"; }

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

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

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

	new Labiaplasty();
}


code:
{
	class MaletoFemale extends App.Medicine.Surgery.Reaction {
		get key() { return "mtf"; }

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

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

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

	new MaletoFemale();
}


code:
{
	class Mindbreak extends App.Medicine.Surgery.Reaction {
		get key() { return "mindbreak"; }

		get removeJob() { return true; }

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

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

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

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

	new Mindbreak();
}


code:
{
	class MPregRemoved extends App.Medicine.Surgery.Reaction {
		get key() { return "mpreg removed"; }

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

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

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

	new MPregRemoved();
}


code:
{
	class Mute extends App.Medicine.Surgery.Reaction {
		get key() { return "mute"; }

		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} clearly feels quite normal except for a vague ache around ${his} larynx. It takes a good while for ${him} to figure out what has happened, but eventually ${he} tries to speak and makes no sound. ${He} simply keeps trying for some time before accepting this is how things are. As with all surgery ${his} health has been slightly affected.`);
			} else if (slave.devotion > 50) {
				r.push(`${He} clearly feels quite normal except for a vague ache around ${his} larynx. It takes a good while for ${him} to figure out what has happened, but eventually ${he} tries to speak and makes no sound. ${He} panics, but manages to control ${himself} at length and begins to think.`);
				if (canSee(slave)) {
					r.push(`Seeing`);
				} else {
					r.push(`Finding`);
				}
				r.push(`you, ${he} tries to ask you for instruction and realizes ${he} cannot.`);
				if (hasBothLegs(slave)) {
					r.push(`After more thought, ${he} simply gets on ${his} knees facing away from you and spreads ${his} buttocks to offer ${himself} to you.`);
				} else {
					r.push(`After more thought, ${he} simply rolls over facing away from you and winks ${his} asshole to offer ${himself} to you.`);
				}
				r.push(`${He} has become more submissive due to your radical reshaping of ${his} being. As with all surgery ${his} health has been slightly affected.`);
				reaction.devotion += 4;
			} else if (slave.devotion > 20) {
				r.push(`${He} clearly feels quite normal except for a vague ache around ${his} larynx. It takes a good while for ${him} to figure out what has happened, but eventually ${he} tries to speak and makes no sound. ${He} panics, trying to scream or protest but only managing to cry. Eventually ${he} pulls ${himself} together. ${He} will struggle with ${his} medically created disability. 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 -= 10;
			} else {
				r.push(`${He} clearly feels quite normal except for a vague ache around ${his} larynx. It takes a good while for ${him} to figure out what has happened, but eventually ${he} tries to speak and makes no sound. ${He} panics, trying to scream or protest but only managing to cry. As long as ${he} remains unbent to your will, ${he} will have a constant, inescapable reminder of who and what you are. The surgical invasion has filled ${him} with horror and anger. As with all surgery ${his} health has been slightly affected. ${He} is cripplingly afraid of your total power over ${his} body.`);
				reaction.trust -= 20;
				reaction.devotion -= 50;
			}

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

		outro(slave, previousReaction) {
			const reaction = super.outro(slave, previousReaction);
			const {He} = getPronouns(slave);

			if (slave.behavioralFlaw === "bitchy") {
				reaction.longReaction.last()
					.push(`<span class="green">${He} can hardly make sharp remarks without a voice.</span>`);
				slave.behavioralFlaw = "none";
			}

			return reaction;
		}
	}

	new Mute();
}


code:
{
	class NoneToFemale extends App.Medicine.Surgery.Reaction {
		get key() { return "ntf"; }

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

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

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

	new NoneToFemale();
}


code:
{
	class OcularImplant extends App.Medicine.Surgery.Reaction {
		get key() { return "ocular implant"; }

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

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

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

	new OcularImplant();
}


code:
{
	class OcularImplantForBlind extends App.Medicine.Surgery.Reaction {
		get key() { return "ocular implant for blind"; }

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

	new OcularImplantForBlind();
}


code:
{
	class Oral extends App.Medicine.Surgery.Reaction {
		get key() { return "oral"; }

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

			r.push(`${He} clearly feels quite normal except for a vague ache around ${his} jaw. ${He}`);
			if (canSee(slave)) {
				r.push(`checks ${himself} in the mirror`);
			} else {
				r.push(`runs ${his} tongue over ${his} teeth`);
			}
			r.push(`repeatedly before accepting that nothing too unusual has happened, and that ${he} now appears to have a fully functional set of normal teeth. Though ${he}'s surprised that nothing outlandish has been done, ${he} carries on as usual. Since the surgery was moderately invasive, ${his} health has been somewhat affected.`);

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

	new Oral();
}


code:
{
	class OvaImplantChanged extends App.Medicine.Surgery.Reaction {
		get key() { return "ovaImplant changed"; }

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

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

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

	new OvaImplantChanged();
}


code:
{
	class PLimbInterface extends App.Medicine.Surgery.Reaction {
		get key() { return "PLimb interface"; }

		reaction(slave, diff) {
			const reaction = super.reaction(slave, diff);
			const r = [];

			V.nextButton = " ";
			r.push(App.Medicine.Limbs.prosthetic(slave, V.oldLimbs, "Remote Surgery"));	// FIXME: Property 'oldLimbs' does not exist on type 'GameVariables'.
			delete V.oldLimbs;

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

	new PLimbInterface();
}


code:
{
	class PLimbInterface1 extends App.Medicine.Surgery.Reaction {
		get key() { return "PLimb interface1"; }

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

			r.push(`When ${he} is carried out of surgery ${he}`);
			if (canSee(slave)) {
				r.push(`cranes ${his} neck to better see the ports`);
			} else {
				r.push(`wiggles ${his} stumps trying to feel the ports`);
			}
			r.push(`installed in ${his} stumps. Recovery will be significant, since the surgical implantation of anchor points for the limbs themselves and the installation of nerve impulse detectors constituted major surgery.`);
			if (this._hasEmotion(slave)) {
				if (slave.devotion > 20) {
					r.push(`Nevertheless, ${he}'s overwhelmed with gratitude, and thanks you profusely the first chance ${he} gets. ${He} follows the acclimation program diligently, doing ${his} best to learn how to be a good slave despite, or sometimes even because of, ${his} disability. ${He} places more trust in you, too, since you obviously have ${his} best interests at heart.`);
					reaction.devotion += 5;
					reaction.trust += 5;
				} else if (slave.devotion >= -20) {
					r.push(`${He}'s overwhelmed with gratitude, in part because ${he} didn't think you'd do something like this for ${him}. ${He} thanks you profusely the first chance ${he} gets, and follows the acclimation program diligently, trying to deserve the expense you went to. ${He} places more trust in you, too, since you seem to have a plan for ${him}.`);
					reaction.devotion += 5;
					reaction.trust += 5;
				} else {
					r.push(`Despite ${his} hatred of you, ${he} can't help but trust you a bit more, since you clearly have a plan that involves putting a good deal of value into ${him}. Your goals might not be ${hers}, but at least ${he} has an indication that you're not toying with ${him}.`);
					reaction.trust += 5;
				}
			}

			V.prostheticsConfig = "interface";
			r.push(App.UI.prostheticsConfigPassage());
			V.nextLink = "Remote Surgery";

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

	new PLimbInterface1();
}


code:
{
	class PLimbInterface2 extends App.Medicine.Surgery.Reaction {
		get key() { return "PLimb interface2"; }

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

			r.push(`When ${he} is carried out of surgery ${he}`);
			if (canSee(slave)) {
				r.push(`cranes ${his} neck to better see the ports`);
			} else {
				r.push(`wiggles ${his} stumps trying to feel the ports`);
			}
			r.push(`installed in ${his} stumps. ${His} stumps twitch slightly as the software begins configuring. Recovery will be significant, since the surgical implantation of anchor points for the limbs themselves and the installation of nerve bridges constituted major surgery.`);
			if (this._hasEmotion(slave)) {
				if (slave.devotion > 20) {
					r.push(`Nevertheless, ${he}'s overwhelmed with gratitude, and thanks you profusely the first chance ${he} gets. ${He} follows the acclimation program diligently, doing ${his} best to learn how to be a good slave despite, or sometimes even because of, ${his} disability. ${He} places more trust in you, too, since you obviously have ${his} best interests at heart.`);
					reaction.devotion += 5;
					reaction.trust += 5;
				} else if (slave.devotion >= -20) {
					r.push(`${He}'s overwhelmed with gratitude, in part because ${he} didn't think you'd do something like this for ${him}. ${He} thanks you profusely the first chance ${he} gets, and follows the acclimation program diligently, trying to deserve the expense you went to. ${He} places more trust in you, too, since you seem to have a plan for ${him}.`);
					reaction.devotion += 5;
					reaction.trust += 5;
				} else {
					r.push(`Despite ${his} hatred of you, ${he} can't help but trust you a bit more, since you clearly have a plan that involves putting a good deal of value into ${him}. Your goals might not be ${hers}, but at least ${he} has an indication that you're not toying with ${him}.`);
					reaction.trust += 5;
				}
			}

			V.prostheticsConfig = "interface";
			r.push(App.UI.prostheticsConfigPassage());
			V.nextLink = "Remote Surgery";

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

	new PLimbInterface2();
}


code:
{
	class PLimbInterface3 extends App.Medicine.Surgery.Reaction {
		get key() { return "PLimb interface3"; }

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

			r.push(`When ${he} is carried out of surgery ${he}`);
			if (canSee(slave)) {
				r.push(`cranes ${his} neck to better see the ports`);
			} else {
				r.push(`wiggles ${his} stumps trying to feel the ports`);
			}
			r.push(`installed in ${his} stumps. ${His} stumps twitch slightly as the software begins configuring. Since ${he} already had anchors installed in previous surgery this procedure was less invasive and thus ${his} health has been only slightly affected.`);
			if (slave.fetish !== "mindbroken" && slave.fuckdoll === 0) {
				if (slave.devotion > 20) {
					r.push(`${He} is overjoyed when ${he} finds out this upgrade will allow ${him} to feel with ${his} limbs again and thanks you profusely the first chance ${he} gets. ${He} places more trust in you, too, since you obviously have ${his} best interests at heart.`);
				} else if (slave.devotion >= -20) {
					r.push(`${He}'s overwhelmed with joy and gratitude, when ${he} finds out this upgrade will allow ${him} to feel with ${his} limbs again, in part because ${he} didn't think you'd do something like this for ${him}. ${He} thanks you profusely the first chance ${he} gets and is determined to prove ${himself} worthy of the expense you went to for ${him}. ${He} places more trust in you, too, since you seem to have a plan for ${him}.`);
				} else {
					r.push(`Despite ${his} hatred of you, ${he} can't help but feel some trust and gratitude, towards you, since you clearly have a plan that involves putting a good deal of value into ${him}. Your goals might not be ${hers}, but at least ${he} has an indication that you're not toying with ${him}.`);
				}
				reaction.devotion += 5;
				reaction.trust += 5;
			}

			V.prostheticsConfig = "interface";
			r.push(App.UI.prostheticsConfigPassage());
			V.nextLink = "Remote Surgery";

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

	new PLimbInterface3();
}


code:
{
	class PLimbInterface4 extends App.Medicine.Surgery.Reaction {
		get key() { return "PLimb interface4"; }

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

			r.push(`When ${he} is carried out of surgery ${he}`);
			if (canSee(slave)) {
				r.push(`cranes ${his} neck to better see the ports`);
			} else {
				r.push(`wiggles ${his} stumps trying to feel the ports`);
			}
			r.push(`installed in ${his} stumps. ${His} stumps twitch slightly as the software begins configuring. Since ${he} already had anchors installed in previous surgery this procedure was less invasive and thus ${his} health has been only slightly affected.`);
			if (slave.fetish !== "mindbroken" && slave.fuckdoll === 0) {
				if (slave.devotion > 20) {
					r.push(`${He} trusts you enough to be not be put off by your explanation of what kind of prosthetic limbs will fit ${his} new interface. Thinking that maybe being a pet won't be so bad.`);
				} else if (slave.devotion >= -20) {
					r.push(`${He}'s <span class="devotion inc">apprehensive</span> when ${he} finds out this interface will make ${him} quadrupedal like a animal.`);
					reaction.devotion -= 5;
					reaction.trust -= 5;
				} else {
					r.push(`The flicker of gratefullness towards you is quickly replaced by hatred when ${he} finds out that this new interface will force her to walk like an animal. ${His} impression of you becomes worse now that ${he} knows that you plan to turn ${him} into a pet.`);
					reaction.devotion -= 25;
					reaction.trust -= 25;
				}
			}

			V.prostheticsConfig = "interface";
			r.push(App.UI.prostheticsConfigPassage());
			V.nextLink = "Remote Surgery";

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

	new PLimbInterface4();
}


code:
{
	class PLimbInterface5 extends App.Medicine.Surgery.Reaction {
		get key() { return "PLimb interface5"; }

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

			r.push(`When ${he} is carried out of surgery ${he}`);
			if (canSee(slave)) {
				r.push(`cranes ${his} neck to better see the ports`);
			} else {
				r.push(`wiggles ${his} stumps trying to feel the ports`);
			}
			r.push(`installed in ${his} stumps. Recovery will be significant, since the surgical implantation of anchor points for the limbs themselves and the installation of nerve impulse detectors constituted major surgery.`);
			if (this._hasEmotion(slave)) {
				if (slave.devotion > 20) {
					r.push(`Even after learning what kind of prosthetics will fit ${him}, ${he}'s still filled with gratitude, and thanks you the first chance ${he} gets. ${He} follows the acclimation program diligently, doing ${his} best to learn how to be a good pet for you. ${He} places more trust in you, too, since you gave ${him} the ability to move on ${his} own again.`);
					reaction.devotion += 5;
					reaction.trust += 5;
				} else if (slave.devotion >= -20) {
					r.push(`After learning what kind of prosthetics are awaiting ${him}, ${he}'s still relatively gratefull to you, because ${he} didn't think ${he}'d ever move on ${his} own again. ${He} thanks you sincerely, and follows the acclimation program diligently, looking forward to being able to move on ${his} own again. ${He} places more trust in you, since you don't seem to have bad things planned for ${him}.`);
					reaction.trust += 5;
				} else {
					r.push(`The slight joy of being able to have limbs again is greatly dampened when ${he} learns what kind of limbs are awaiting ${him}, ${he}'s only comforted by the thought of being able to walk on ${his} own again. The already bad impression of you worsens, now that ${he} has feels like you're toying with ${him}.`);
					reaction.devotion -= 5;
					reaction.trust -= 5;
				}
			}

			V.prostheticsConfig = "interface";
			r.push(App.UI.prostheticsConfigPassage());
			V.nextLink = "Remote Surgery";

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

	new PLimbInterface5();
}


code:
{
	class Precum extends App.Medicine.Surgery.Reaction {
		get key() { return "precum"; }

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

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

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

	new Precum();
}


code:
{
	class Preg extends App.Medicine.Surgery.Reaction {
		get key() { return "preg"; }

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

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

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

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

	new Preg();
}


code:
{
	class Preg1Hack extends App.Medicine.Surgery.Reaction {
		get key() { return "preg1hack"; }

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

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

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

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

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

	new Preg1Hack();
}


code:
{
	class PregRemove extends App.Medicine.Surgery.Reaction {
		get key() { return "pregRemove"; }

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

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

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

	new PregRemove();
}


code:
{
	class Prostate extends App.Medicine.Surgery.Reaction {
		get key() { return "prostate"; }

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

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

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

	new Prostate();
}


code:
{
	class Race extends App.Medicine.Surgery.Reaction {
		get key() { return "race"; }

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

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

	new Race();
}


code:
{
	class Relocate extends App.Medicine.Surgery.Reaction {
		get key() { return "relocate"; }

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

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

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

	new Relocate();
}


code:
{
	class RemoveBraces extends App.Medicine.Surgery.Reaction {
		get key() { return "removeBraces"; }

		get invasive() { return false; }

		get permanentChanges() { return false; }

		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} is quite quick to realize ${his} teeth are missing something.`);
			} else {
				r.push(`Quite aware that ${his} teeth are now free of ${his} braces,`);
				if (slave.devotion > 50) {
					r.push(`${he} smiles tentatively`);
					if (canSee(slave)) {
						r.push(`at ${himself} in the mirror`);
					} else {
						r.push(`and runs ${his} tongue across ${his} teeth`);
					}
					r.push(`only to find they are as crooked as ever. ${He} immediately shuts ${his} mouth, ${his} opinion of you souring, and carries on as if you had never put them on ${him} in the first place.`);
					reaction.devotion -= 4;
				} else if (slave.devotion > 20) {
					r.push(`${he} pulls ${his} lips back to`);
					if (canSee(slave)) {
						r.push(`check them out`);
					} else {
						r.push(`feel them`);
					}
					r.push(`only to find they are as crooked as ever. ${He} immediately shuts ${his} mouth, ${his} opinion of you souring, and carries on as if you had never put them on ${him} in the first place.`);
					reaction.devotion -= 2;
				} else {
					r.push(`${he} pulls ${his} lips back to`);
					if (canSee(slave)) {
						r.push(`check them out.`);
					} else {
						r.push(`feel them.`);
					}
					r.push(`${He} knows that straightening teeth is expensive and sighs, feeling that ${he}'s not worth the expense. No matter what ${he} thought of you, ${he} felt ${he} would at least benefit from having nice teeth, and now it's clear to ${him}: You don't care.`);
					reaction.devotion -= 5;
					reaction.trust -= 5;
				}
			}
			r.push(`Though unpleasant, orthodontia isn't particularly harmful; ${his} health is unaffected.`);

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

	new RemoveBraces();
}


code:
{
	class RemoveCosmeticBraces extends App.Medicine.Surgery.Reaction {
		get key() { return "removeCosmeticBraces"; }

		get invasive() { return false; }

		get permanentChanges() { return false; }

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

			if (slave.fetish === "mindbroken") {
				r.push(`${He} is quite quick to realize ${his} teeth are missing something.`);
			} else {
				r.push(`Quite aware that ${his} teeth are now free of ${his} braces,`);
				if (slave.devotion > 50) {
					r.push(`${he} smiles tentatively`);
				} else {
					r.push(`${he} pulls ${his} lips back to`);
				}
				if (canSee(slave)) {
					r.push(`check them out`);
				} else {
					r.push(`feel them`);
				}
				r.push(`and finds they are now back to normal.`);
			}
			r.push(`Though unpleasant, orthodontia isn't particularly harmful; ${his} health is unaffected.`);

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

	new RemoveCosmeticBraces();
}


code:
{
	class RetrogradeVirusInjectionNCS extends App.Medicine.Surgery.Reaction {
		get key() { return "retrograde virus injection NCS"; }

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

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

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

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

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

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

	new RetrogradeVirusInjectionNCS();
}