code:
App.Events.REReputedDaughter = class REReputedDaughter extends App.Events.BaseEvent {
	eventPrerequisites() {
		return [
			() => !onBedRest(V.PC),
		];
	}

	actorPrerequisites() {
		return [
			[
				(s) => s.skill.penetrative > 60 || s.fetish === Fetish.MINDBROKEN,
				(s) => s.dick > 3,
				(s) => s.actualAge > V.fertilityAge, // the slave is older than the addict daughter
				(s) => s.visualAge > V.minimumSlaveAge,
				(s) => s.prestige > 0 || s.porn.prestige > 0 || slaveCost(s) > 20000 || Beauty(s) > 150, // the slave must be worth a minimum or be very attractive
				(s) => isFullyPotent(s) ? V.week - s.weekAcquired > 12 : V.week - s.weekAcquired > 8, // if the slave is potent must have been able to impregnate the daughter to the point of showing
				canWalk,
				canPenetrate,
				(s) => [Job.BROTHEL, Job.CLUB, Job.WHORE, Job.PUBLIC].includes(s.assignment),
			]
		];
	}

	execute(node) {
		const PC = V.PC;
		const [slave] = this.actors.map(a => getSlave(a));
		const {His, He, he, his, him, himself} = getPronouns(slave);
		const {HeF, heF, hisF, himF, womanF, fatherF} = getNonlocalPronouns(PC.title === 0 && FutureSocieties.isActive("FSGenderRadicalist") ? 0 : 100).appendSuffix('F');
		const newAge = Math.max(V.minimumSlaveAge, V.fertilityAge - (V.precociousPuberty ? V.pubertyHormones ? 3 : 1 : 0));
		const rDaughter = GenerateNewSlave("XX", {
			minAge: newAge, maxAge: newAge, race: "nonslave", disableDisability: 1
		});
		const {HisD, HeD, heD, hisD, himD, girlD, daughterD} = getPronouns(rDaughter).appendSuffix('D');
		const kid = rDaughter.actualAge > 12 ? rDaughter.actualAge < 18 ? "teenager" : "young "+ girlD : "kid";
		const child = rDaughter.actualAge > 12 ? girlD : "child";
		const VIP = FutureSocieties.isActive("FSRestart") ? V.arcologies[0].FSNeoImperialistLaw2 === 1 ? "Baron" : "member of the Social Elite" : "slaveowner";
		const VIPs = FutureSocieties.isActive("FSRestart") ? V.arcologies[0].FSNeoImperialistLaw2 === 1 ? "Barons" : "members of the Social Elite" : "slaveowners";

		rDaughter.anus = slave.dick > 5 ? 3 : 2;
		rDaughter.analArea = either(1, 1, 2);
		rDaughter.vagina = slave.dick > 5 ? 4 : 3;
		rDaughter.vaginaLube = either(1, 2);
		rDaughter.pubertyXX = 1;
		rDaughter.preg = 0;
		rDaughter.attrXY = 100;
		rDaughter.energy = 100;
		rDaughter.addict = 12;
		rDaughter.canRecruit = 0;
		const attitude = random(0, 20);
		rDaughter.devotion = -40 - attitude;
		rDaughter.trust = 60 - attitude;
		rDaughter.fetish = Fetish.PREGNANCY;
		rDaughter.behavioralFlaw = either(BehavioralFlaw.ARROGANT, BehavioralFlaw.ARROGANT, BehavioralFlaw.BITCHY, BehavioralFlaw.ODD, BehavioralFlaw.HATESWOMEN, rDaughter.behavioralFlaw);
		rDaughter.behavioralQuirk = either(BehavioralQuirk.ADORESMEN, BehavioralQuirk.FUNNY, BehavioralQuirk.SINFUL, rDaughter.behavioralQuirk);
		rDaughter.sexualFlaw = either(SexualFlaw.ATTENTION, SexualFlaw.BREEDER, SexualFlaw.JUDGEMENT, rDaughter.sexualFlaw);
		rDaughter.sexualQuirk = either(SexualQuirk.PERVERT, SexualQuirk.TEASE, SexualQuirk.UNFLINCHING, SexualQuirk.SIZEQUEEN, SexualQuirk.SIZEQUEEN, rDaughter.sexualQuirk);
		rDaughter.career = V.AgePenalty === 0 ? either("a student council president", "a student council president", "a girl scout", "a scholar") : "from an upper class family";
		rDaughter.clothes = either("a cheerleader outfit", "a schoolgirl outfit");
		rDaughter.intelligenceImplant = Math.min(12 + newAge, 30);
		rDaughter.intelligence = random(30, 95 - rDaughter.intelligenceImplant); // intelligence + education = smart or very smart
		rDaughter.prestige = 2;
		rDaughter.prestigeDesc = `$He was a member of an illustrious well-off household.`;
		rDaughter.origin = `$He was the ${daughterD} of a prestigious family, until $his ${fatherF} disinherited $him and sold $him into slavery due to $his addiction to drugs and sex.`;
		rDaughter.custom.tattoo = `$He has $his family emblem tattooed on $his right wrist.`;
		rDaughter.skill.anal = Math.max(rDaughter.anus * 15, rDaughter.skill.anal);
		rDaughter.skill.vaginal = Math.max(rDaughter.vagina * 20, rDaughter.skill.vaginal);
		rDaughter.skill.oral = Math.max(rDaughter.skill.oral, 15);
		rDaughter.skill.whoring = 0;
		rDaughter.skill.entertainment = Math.max(rDaughter.skill.entertainment, 40);
		const genetics = random(0, 12);
		if (genetics === 0) {
			rDaughter.geneticQuirks.fertility = 2;
		} else if (genetics === 1 && V.seeHyperPreg) {
			rDaughter.geneticQuirks.hyperFertility = 2;
		} else if (genetics <= 3) {
			rDaughter.geneticQuirks.uterineHypersensitivity = 2;
		} else if (genetics <= 5) {
			rDaughter.geneticQuirks.pFace = 2;
			rDaughter.face = 100;
		} else if (genetics === 6) {
			rDaughter.geneticQuirks.albinism = 2;
			rDaughter.albinismOverride = makeAlbinismOverride(rDaughter.race);
			applyGeneticColor(rDaughter);
		}
		const sDrugs = random(0, 10);
		if (sDrugs < 3) {
			rDaughter.hormoneBalance = Math.min(rDaughter.hormoneBalance + random(400, 600), 1000); // took femenine hormones
		} else if (sDrugs < 5) {
			rDaughter.lips = Math.min(rDaughter.lips + random(40, 70), 100); // took lips growth
		} else if (sDrugs < 7) {
			rDaughter.boobs = Math.min(rDaughter.boobs + random(500, 900), 1200); // took boobs growth
		} else if (sDrugs === 7) {
			rDaughter.clit = either(3, 4, 5); // took clit enhancer
			rDaughter.foreskin = either(rDaughter.foreskin, rDaughter.clit, rDaughter.clit - 1, Math.min(rDaughter.clit + 1, 5));
			rDaughter.skill.penetrative = rDaughter.skill.penetrative + random(30, 50);
		} else if (sDrugs === 8) {
			rDaughter.butt = Math.min(rDaughter.butt + random(2, 4), 7); // took butt growth
		} else if (sDrugs === 9) {
			rDaughter.drugs = V.superFertilityDrugs ? Drug.SUPERFERTILITY : Drug.FERTILITY; // took fertility drugs
		} else if (sDrugs === 10) {
			rDaughter.nipples = "huge"; // took nipple enhancer
		}
		if (canImpreg(rDaughter, slave)) {
			WombImpregnate(rDaughter, setPregType(rDaughter), slave.ID, random(12, Math.min(V.week - slave.weekAcquired, 20)));
			SetBellySize(rDaughter);
		}
		rDaughter.drugs = Drug.NONE;
		setHealth(rDaughter);
		const preggers = rDaughter.preg > 0;
		const mindbroken = slave.fetish === Fetish.MINDBROKEN;
		const rumored = V.policies.sexualOpenness === 0 && getRumors("penetrative") > 2 && penetrativeSocialUse() < 40;
		App.Events.drawEventArt(node, [slave, rDaughter]);

		let r = [];

		r.push(`You have a meeting with several prominent ${VIPs} of your arcology detailing the progress and improvements you have made lately; lending them an ear to voice their opinions helps garner their favor, even if it's just for show. The last attendee to arrive is the leader of an influential local family accompanied, oddly enough, by ${hisD} ${rDaughter.actualAge}-year-old ${daughterD} and your slave,`, contextualIntro(PC, slave, true, true), ".");
		r.push(`The ${womanF} openly expresses ${hisF} anger towards your slave, blaming ${him} for corrupting and ruining ${hisF} ${daughterD}. ${HeF} alleges that the ${girlD}`);
		if (preggers) {
			r.push(`is carrying ${slave.slaveName}'s child and that ${heD}`);
		}
		r.push(`has spent a significant sum of money on${V.policies.sexualOpenness === 0 ? ` aberrant` : ""} sex, aphrodisiacs and other drugs meant for slaves. Before your other guests, ${heF} declares that ${heF} no longer regards ${himD} as ${hisF} ${daughterD} and that ${heD} has been banished from the family registry. Furthermore, even though ${heF} would prefer to never see ${himD} again, ${heD} will be serving as a slave in ${hisF} household going forward as repayment.`);
		App.Events.addParagraph(node, r);
		r = [];
		r.push(`You observe the ${kid}, who appears to be simultaneously nervous and excited. ${HisD} blatant dependence on aphrodisiacs is unmistakable. Considering ${hisD} privileged upbringing and reputable background, it is reasonable to assume that ${heD} has the capacity to excel as a sexual slave, rather than merely serving as a domestic servant.`);
		r.push(`Turning to face you, the ${fatherF} demands that you make up for the harm your slave has caused to ${himF} and ${hisF} family. While doing so, ${heF} leers at ${slave.slaveName} with a lascivious expression${rumored ? `, which conjures up rumors about the peculiar sexual preferences that have been circulating about ${himF}` : ""}.`);
		App.Events.addParagraph(node, r);
		r = [];

		const compensation = 1000 + (Math.min(Math.round(V.cash / 5000), 4) * 500); // from 1,000 to 3,000
		const value = 30000 + Math.clamp((Math.round(((slaveCost(rDaughter) - 35000) * .9) / 500) * 500), 0, 30000); // from 30,000 to 60,000
		const canBuy = !getSlaves().some(s => s.origin.includes("disinherited $him and sold $him into slavery") && V.week - s.weekAcquired < 6) && V.seeDicks !== 100; // we don't want a legion of reputed daughters
		const choices = [];
		choices.push(V.cash > compensation
			? new App.Events.Result(`Offer ${himF} ${cashFormat(compensation)} as financial compensation.`, money)
			: new App.Events.Result(null, null, `You lack the funds needed to adequately recompense ${himF}.`));
		choices.push(new App.Events.Result(`Offer to give ${himF} ${slave.slaveName} as compensation.`, giveSlave));
		if (canBuy) {
			choices.push(V.cash > value
				? new App.Events.Result(`Offer ${himF} ${cashFormat(value)} ${V.debugMode ? `(of ${slaveCost(rDaughter)})` : ""} to purchase ${hisF} ${daughterD}.`, buyDaughter)
				: new App.Events.Result(null, null, `You lack the necessary funds to buy the ${daughterD}'s debt.`));
			choices.push(new App.Events.Result(`Offer ${himF} ${slave.slaveName} in return for ${hisF} ${daughterD}.`, trade));
		}
		choices.push(new App.Events.Result(`You're not responsible for ${hisF} ${daughterD}'s actions.`, evade));
		choices.push(new App.Events.Result(`Blame ${himF} for ${hisF} ${daughterD}'s inadequate education.`, blame));
		if (canPenetrate(PC) && isFullyPotent(PC) && canBreed(slave, PC) && preggers) {
			choices.push(new App.Events.Result(`It's actually yours.`, oops));
		}
		choices.push(new App.Events.Result(`Punish your slave.`, punish));
		App.Events.addResponses(node, choices);

		return;

		/** @returns {DocumentFragment} */
		function money() {
			let frag = new DocumentFragment();
			let r = [];
			r.push(`You don't want to take the risk of angering one of the most influential ${VIPs} in your arcology, so you offer to provide priority access to the medical and pharmacological resources needed to treat ${hisF} ${daughterD}, in addition to some generous financial compensation. ${HeF} accepts the offer, seemingly content, and instructs the ${kid} to wait outside. Word spreads quickly that you are a conscientious ${properMaster()} and are committed to rectifying any damage caused by your slaves.`);
			// FUTURE: lower authority. Allowing your slaves to do such things is a no no. Likewise in the other routes.
			repX(900, "event");
			App.Events.addParagraph(frag, r);
			r = [];
			r.push(`You dispatch ${slave.slaveName} back to ${his} duties.`);
			r = r.concat(slavesReaction("unpunished"));
			App.Events.addParagraph(frag, r);
			r = [];
			r.push(`When the meeting comes to a close, you are shocked to see one of the other guests purchase the ${girlD}'s debt for an absurdly low sum.`);
			cashX(forceNeg(compensation), "event", slave);
			App.Events.addParagraph(frag, r);
			return frag;
		}

		/** @returns {DocumentFragment} */
		function giveSlave() {
			let frag = new DocumentFragment();
			let r = [];
			r.push(`Since you don't want to risk upsetting one of the most influential ${VIPs} in your arcology, you offer to transfer ownership of ${slave.slaveName} to ${himF}, as well as priority access to the medical and pharmaceutical resources needed to treat ${hisF} ${daughterD}. Satisfied, ${heF} nods and tells the ${kid} and ${hisF} new slave to wait outside. Your former slave`);
			if (mindbroken) {
				r.push(`seems to understand, with ${his} limited mind, that you are no longer ${his} master and`);
			} else {
				r.push(slave.devotion > 50 ? `sorrowfully` : slave.devotion > -50 ? `reluctantly` : `contemptuously`);
			}
			r.push(`obeys your final order. <span class="reputation inc">Word gets out that you are a conscientious ${properMaster()}</span> and that you bear liability for any harm that your slaves may inflict.`);
			repX(1000, "event");
			App.Events.addParagraph(frag, r);
			r = [];
			r = r.concat(slavesReaction("given"));
			App.Events.addParagraph(frag, r);
			r = [];
			r.push(`When the meeting comes to a close, you are shocked to see one of the other guests purchase the ${girlD}'s debt for an absurdly low sum.`);
			if (rumored) {
				r.push(`Rumor quickly spreads that the citizen who sold ${hisF} ${daughterD} into slavery enjoys spending the day with ${slave.slaveName}'s turgid dick buried in ${hisF} asshole, drawing attention away from your own predilections.`);
				softenRumors.penetrative(5);
				App.Events.addParagraph(frag, r);
			}
			removeSlave(slave);
			App.Events.addParagraph(frag, r);
			return frag;
		}

		/** @returns {DocumentFragment} */
		function buyDaughter() {
			let frag = new DocumentFragment();
			let r = [];
			r.push(`Since you don't want to risk upsetting one of the most influential ${VIPs} in your arcology, you make a generous offer to buy ${hisF} ${daughterD} and eliminate ${hisD} debt. Satisfied, ${heF} signs the documents transferring ownership of the ${child} to you. Word gets out that you are a giving and conscientious ${properMaster()} who accepts accountability for whatever harm their slaves may inflict.`);
			repX(500, "event");
			cashX(forceNeg(value), "slaveTransfer", rDaughter);
			newSlave(rDaughter); // skip new slave intro
			App.Events.addParagraph(frag, r);
			r = [];
			r.push(`You give your new slave and ${slave.slaveName} the order to wait outside the room until the meeting is over.`);
			if (!mindbroken && slave.devotion <= 50) {
				r.push(`${slave.slaveName} feels like that ${he} <span class="trust inc">got away with something ${he} shouldn't have</span>`);
				if (slave.rules.relationship === "restrictive" || slave.relationship !== 0) {
					if (slave.rules.release.slaves === 0) {
						r.push(`and is <span class="devotion dec">annoyed</span> that your rules mean ${he} can't keep fucking the ${kid}.`);
						slave.devotion -= 5;
						slave.trust += 3;
					} else {
						r.push(`and is <span class="devotion inc">thrilled</span> that ${he} can now freely access ${his} little fucktoy${V.universalRulesConsent === 0 ? `, even when ${heD} doesn't feel like it` : ""}.`);
						slave.devotion += 3;
						slave.trust += 5;
					}
				} else {
					slave.relationship = slave.rules.relationship === "just friends" ? App.Utils.sexAllowed(slave, rDaughter) ? 3 : 2 : 4;
					slave.relationshipTarget = rDaughter.ID;
					rDaughter.relationship = slave.relationship;
					rDaughter.relationshipTarget = slave.ID;
					r.push(`and you can tell from the glances the two are exchanging that their relationship goes beyond just sex.`);
					if (App.Utils.sexAllowed(slave, rDaughter)) {
						r.push(`${He}'s <span class="devotion inc">grateful</span> that ${he} can now freely access ${his} little fucktoy.`);
						slave.devotion += 5;
						slave.trust += 5;
					} else {
						r.push(`But that's just too bad for ${him}, since <span class="devotion dec">${he} can't fuck the ${kid} anymore</span> because of your rules.`);
						slave.devotion -= 10;
						slave.trust += 5;
					}
				}
			}
			App.Events.addParagraph(frag, r);
			return frag;
		}

		/** @returns {DocumentFragment} */
		function trade() {
			let frag = new DocumentFragment();
			let r = [];
			r.push(`Since you don't want to risk upsetting one of the most influential ${VIPs} in your arcology, you offer to exchange ${slave.slaveName} for ${his} ${daughterD}; ${he} never has to see ${himD} again and ${heF} gets to do as ${heD} sees fit to the slave that caused all these problems. ${HeF} rushes to sign the contract with you, clearly excited by the outcome. Word gets out that you are a just and liable ${properMaster()} who accepts accountability for whatever harm their slaves may inflict.`);
			repX(500, "event");
			newSlave(rDaughter); // skip new slave intro
			App.Events.addParagraph(frag, r);
			r = [];
			r.push(`You order your new slave to wait outside the room until the meeting is over.`);
			r = r.concat(slavesReaction("given"));
			App.Events.addParagraph(frag, r);
			r = [];
			if (rumored) {
				App.Events.addParagraph(frag, r);
				r = [];
				r.push(`Rumor quickly spreads that the citizen who sold ${hisF} ${daughterD} into slavery enjoys spending the day with ${slave.slaveName}'s turgid dick buried in ${hisF} asshole, drawing attention away from your own predilections.`);
				softenRumors.penetrative(5);
				App.Events.addParagraph(frag, r);
			}
			removeSlave(slave);
			return frag;
		}

		/** @returns {DocumentFragment} */
		function evade() {
			let frag = new DocumentFragment();
			let r = [];
			r.push(`You respond angrily to the ${VIP}, informing ${himF} that ${slave.slaveName}'s job is to sexually please your citizens, and judging from the ${child}'s lustful face${preggers ? ` and  swollen tummy` : ""}, ${he} succeeded at it. You explain to the ${VIP} that ${hisF} ${daughterD}'s actions are entirely ${hisD} responsibility, not ${hisF}, not yours, and especially not your slave's. Nevertheless, you tell ${himF} that since ${heF} is who ${heF} is, you will grant ${himF} priority access to the pharmaceutical and medical resources needed to treat ${hisF} ${daughterD} at a discounted rate, should ${heF} so desire.`);
			App.Events.addParagraph(frag, r);
			r = [];
			r.push(`You dispatch ${slave.slaveName} back to ${his} duties.`);
			r = r.concat(slavesReaction("unpunished"));
			App.Events.addParagraph(frag, r);
			r = [];
			r.push(`Tensions only rise during the meeting; no doubt rumors will be spread that are a conniving ${properMaster()} who does not own up to the issues their slaves may cause.`);
			repX(-700, "event");
			r.push(`When the meeting comes to a close, you are shocked to see one of the other guests purchase the ${girlD}'s debt for an absurdly low sum.`);
			App.Events.addParagraph(frag, r);
			return frag;
		}

		/** @returns {DocumentFragment} */
		function blame() {
			let frag = new DocumentFragment();
			let r = [];
			r.push(`You retort angrily at the ${VIP}, telling ${himF} that ${hisF} failure to properly teach ${hisF} ${daughterD} impulse control is the real problem, not anything your slave has done. You lecture ${himF} that ${hisF} ${daughterD}'s actions are entirely ${hisF} responsibility, not yours and especially not your slave's. Not giving ${himF} the opportunity to reply, you instruct ${slave.slaveName} to return to ${his} duties and then proceed to address the other attendees, initiating the meeting.`);
			App.Events.addParagraph(frag, r);
			r = [];
			r = r.concat(slavesReaction("unpunished"));
			App.Events.addParagraph(frag, r);
			r = [];
			if (random(0, V.rep) < 3000) {
				r.push(`Tensions rise during the session; no doubt <span class="reputation dec">rumors will be spread that you are a despotic ${properMaster()}</span> and inconsiderate of the matters of the ${VIPs}.`);
				repX(-700, "event");
			} else if (random(0, V.rep) < 5000) {
				r.push(`The session goes by uncomfortably; you have suspicions that <span class="reputation dec">word will get out that you behaved in an unpleasant and abrupt manner</span> with the ${VIPs}.`);
				repX(-300, "event");
			} else {
				r.push(`Throughout the session, no one says anything. <span class="reputation inc">Word gets out that you're a hard-to-break, strict arcology owner with character.</span>`);
				repX(700, "event");
			}
			r.push(`When the meeting comes to a close, you are shocked to see one of the other guests purchase the ${girlD}'s debt for an absurdly low sum.`);
			App.Events.addParagraph(frag, r);
			return frag;
		}

		/** @returns {DocumentFragment} */
		function oops() {
			let frag = new DocumentFragment();
			let r = [];
			r.push(`You explain to the ${VIP} that ${slave.slaveName} has no way of accessing the drugs ${hisF} ${daughterD} has become hooked on, before sheepishly letting it slip that the baby is probably yours. ${HeD} has been working as a Free Whore, likely in exchange for ${hisD} vices, and you've been making frequent use of ${himD} while touring the streets. Nevertheless, you let ${himF} know that you will grant ${himF} priority access to the pharmaceutical and medical resources needed to treat ${hisF} ${daughterD} for free, if ${heF} should desire.`);
			App.Events.addParagraph(frag, r);
			r = [];
			r.push(`You dispatch ${slave.slaveName} back to ${his} duties.`);
			if (!mindbroken && slave.devotion <= 50) {
				r.push(`Given that ${slave.slaveName} effectively <span class="trust inc">got away with being naughty,</span> ${he} seems oddly <span class="devotion dec">miffed</span> over the revelation.`);
				slave.devotion -= 5;
				slave.trust += 5;
			}
			App.Events.addParagraph(frag, r);
			r = [];
			r.push(`Several jokes are made at your expense during the session; you get the feeling fathers will be trying to keep their ${daughterD}s away from you, lest you accidentally knock them up.`);
			repX(-300, "event");
			r.push(`When the meeting comes to a close, you are shocked to see one of the other guests purchase the ${girlD}'s debt for an absurdly low sum.`);
			App.Events.addParagraph(frag, r);
			return frag;
		}

		/** @returns {DocumentFragment} */
		function punish() {
			let frag = new DocumentFragment();
			let r = [];
			r.push(`Despite your doubts, it's better to punish your slave than risk offending one of your arcology's most influential ${VIPs}.`);
			App.Events.addParagraph(frag, r);

			const choices = [];
			choices.push(new App.Events.Result(`Sentence ${him} to two weeks ${V.cellblock ? `in ${V.cellblockName}` : `of confinement`}.`, confine));
			choices.push(new App.Events.Result(`Sentence ${him} to two weeks in ${V.arcade > 0 && (slave.indenture < 0 || slave.indentureRestrictions === 0) ? V.arcadeName : `a gloryhole`}.`, sentence));
			if (slave.indenture > 0 && slave.indentureRestrictions !== 0) {
				choices.push(new App.Events.Result(null, null, `${His} indenture limits how far ${he} may be punished for such a minor offense.`));
			} else if (V.cash < V.surgeryCost) {
				choices.push(new App.Events.Result(null, null, `You lack the funds needed to mutilate ${him}.`));
			} else {
				if (V.seeExtreme) {
					choices.push(new App.Events.Result(`Remove ${his} penis.`, penis));
					choices.push(new App.Events.Result(`Remove ${his} genitalia.`, genitalia));
					if (slave.scrotum > 0) {
						choices.push(new App.Events.Result(`Geld ${him}`, geld));
					}
					if (slave.vagina < 0) {
						choices.push(new App.Events.Result(`Turn ${his} penis from the outside in.`, vagina));
					}
				}
			}
			choices.push(new App.Events.Result(`Lock ${him} in chastity.`, chastity));
			choices.push(new App.Events.Result(`Let the ${VIP} punish ${him}.`, VIPPunish));
			App.Events.addResponses(frag, choices);
			return frag;
		}

		/** @returns {DocumentFragment} */
		function confine() {
			let frag2 = new DocumentFragment();
			let r = [];
			if (mindbroken) {
				r.push(`The broken mind of ${slave.slaveName} accepts ${his} fate without any emotion; remaining confined will probably have no effect on ${him}.`);
			} else {
				r.push(`${slave.slaveName} cries and begs when you tell ${him} what ${his} punishment will be, but you don't give in.`);
				r.push(`For the next two weeks, ${slave.slaveName} will spend ${his} time isolated in ${V.cellblock ? V.cellblockName : `a room`}, reflecting on what ${he} supposedly did wrong.`);
				slave.devotion -= V.cellblock ? 10 : 5;
				slave.trust -= 5;
			}
			assignJob(slave, V.cellblock ? Job.CELLBLOCK : Job.CONFINEMENT);
			slave.sentence = 3;
			r = r.concat(slavesReaction("punished"));
			App.Events.addParagraph(frag2, r);
			r = [];
			r.push(`When the meeting comes to a close, you are shocked to see one of the other guests purchase the ${girlD}'s debt for an absurdly low sum.`);
			App.Events.addParagraph(frag2, r);
			return frag2;
		}

		/** @returns {DocumentFragment} */
		function sentence() {
			let frag2 = new DocumentFragment();
			let r = [];
			const arcade = V.arcade > 0 && (slave.indenture < 0 || slave.indentureRestrictions === 0);
			if (mindbroken) {
				r.push(`The broken mind of ${slave.slaveName} accepts ${his} fate without any emotion, just as ${he} would accept any other task given to ${him}.`);
			} else {
				r.push(`${slave.slaveName} ${canTalk(slave) ? "screams and " : ""}begs when ${he} realizes what ${his} punishment is, but you are obdurate.`);
				if (arcade) {
					if (slave.muscles > 30) {
						r.push(`${His} powerful form has to be sedated for immurement in ${V.arcadeName}.`);
					} else if (slave.weight >= 190) {
						r.push(`${He} is so massively fat that immuring ${him} in ${V.arcadeName} is a struggle, even when ${he} isn't trying to.`);
					} else if (slave.belly >= 120000) {
						r.push(`${He} is so enormously gravid that immuring ${him} in ${V.arcadeName} is a hassle, even though ${his} ${bellyAdjective(slave)} middle limits ${his} ability to struggle.`);
					} else if (slave.weight >= -10) {
						r.push(`${His} desperate struggles make immuring ${him} in ${V.arcadeName} difficult.`);
					} else if (slave.belly >= 1500) {
						r.push(`${His}`);
						if (slave.bellyPreg >= 3000) {
							r.push(`pregnant`);
						} else {
							r.push(bellyAdjective(slave));
						}
						r.push(`body makes it slightly difficult to fit ${him} properly into the restraints for immurement in ${V.arcadeName}.`);
					} else if (slave.muscles < -15) {
						r.push(`${His} weak body makes immuring ${him} in ${V.arcadeName} pathetically easy.`);
					} else {
						r.push(`${His} thin form makes immuring ${him} in ${V.arcadeName} pathetically easy.`);
					}
					r.push(`After ${he}'s properly confined, the only sign of ${his} discomfiture is a slight movement of ${his} ${slave.skin} butt as ${he} wriggles desperately against ${his} restraints.`);
				} else {
					let holes = ["mouth"];
					if (slave.vagina >= 0 && slave.chastityVagina === 0) {
						holes.push("cunt");
					}
					if (slave.chastityAnus === 0) {
						holes.push("ass");
					}
					r.push(`For the next two weeks, ${he} will be locked within a dark box with nothing to do but let cock after cock come in through the holes, eager to use ${his} ${toSentence(holes)}.`);
				}
				slave.devotion -= arcade ? 15 : 10;
				slave.trust -= 10;
			}
			assignJob(slave, arcade ? Job.ARCADE : Job.GLORYHOLE);
			slave.sentence = 3;
			r = r.concat(slavesReaction("punished"));
			App.Events.addParagraph(frag2, r);
			r = [];
			r.push(`When the meeting comes to a close, you are shocked to see one of the other guests purchase the ${girlD}'s debt for an absurdly low sum.`);
			App.Events.addParagraph(frag2, r);
			return frag2;
		}

		/** @returns {DocumentFragment} */
		function VIPPunish() {
			let frag2 = new DocumentFragment();
			let r = [`You offer the offended ${fatherF} the freedom to punish ${slave.slaveName} however ${heF} wants, directing ${himF} to an adjacent room for privacy. However, the sounds emanating from the room suggest a more sexual punishment over the expected corporal one. After a while, the ${VIP} returns to the meeting and sits down, at which point a wet fart is heard and the unmistakable smell of semen fills the room. The other attendees stare at ${himF}; some with surprise, others with disgust and most with amusement. One of them bursts out laughing, and it is contagious, causing everyone to join in. The ${womanF}, red with shame, quickly flees the room, leaving ${hisF} ${daughterD} behind.`];
			if (rumored) {
				r.push(`The populace will now have something new to talk about, <span class="change positive">instead of focusing on your unconventional sexual preferences.</span>`);
				softenRumors.penetrative(10);
			}
			r.push(`You and your remaining guests are left to discuss what to do with the ${kid}.`);
			App.Events.addParagraph(frag2, r);
			const choices = [];
			choices.push(new App.Events.Result(`Let them take care of ${himD}.`, giveDaughter));
			choices.push(new App.Events.Result(`Send ${himD} to ${hisD} ${fatherF}.`, returnDaughter));
			if (canBuy) {
				choices.push(new App.Events.Result(`Send ${slave.slaveName} to ${hisD} ${fatherF} instead of ${himD}.`, tradeBis));
			}
			choices.push(new App.Events.Result(`Keep the ${girlD} for yourself.`, keepDaughter));
			App.Events.addResponses(frag2, choices);
			return frag2;
		}

		/** @returns {DocumentFragment} */
		function chastity() {
			let frag2 = new DocumentFragment();
			let r = [];
			r.push(`You lock ${his} dick in a chastity cage and tuck away the key; ${he} won't be fucking anyone until you change your mind.`);
			if (!mindbroken) {
				r.push(`Even though ${slave.slaveName} enjoys a good fuck, ${he} feels that this is not truly a punishment.`);
			}
			r = r.concat(slavesReaction("unpunished"));
			App.Events.addParagraph(frag2, r);
			r = [];
			r.push(`When the meeting comes to a close, you are shocked to see one of the other guests purchase the ${girlD}'s debt for an absurdly low sum.`);
			slave.chastityPenis = 1;
			App.Events.refreshEventArt([slave, rDaughter]);
			App.Events.addParagraph(frag2, r);
			return frag2;
		}

		/** @returns {DocumentFragment} */
		function penis() {
			let frag2 = new DocumentFragment();
			let r = [];
			r.push(`You arrange for ${him} to be sent the remote surgery after determining that the best way to nip this problem in the bud is to snip off ${his} dick.`);
			let procedure = new App.Medicine.Surgery.Procedures.ChopPenis(slave);
			const result = App.Medicine.Surgery.apply(procedure, false);
			if (result === null) {
				r.push(`${slave.slaveName} <span class="health dec">dies from complications of surgery.</span>`);
				r.push(`This denouement caught the ${VIPs} off guard. A melancholic grimace appears on the ${girlD}'s face. Unexpectedly, the same goes for ${hisD} ${fatherF}'s.`);
				r = r.concat(slavesReaction("exitus"));
				App.Events.addParagraph(frag2, r);
				r = [];
				removeSlave(slave, {dead: true});
			} else {
				const [diff, reaction] = result;
				if (FutureSocieties.isActive("FSPaternalist") && V.arcologies[0].FSPaternalist > 60) {
					r.push(`The ${VIPs} are <span class="rep dec">horrified</span> by such a severe punishment being handed out so trivially.`);
					repX(-200, "event");
				} else if (FutureSocieties.isActive("FSDegradationist") && V.arcologies[0].FSDegradationist > 60) {
					r.push(`The ${VIPs} seem <span class="rep dec">pleased</span> with the punishment being so severe.`);
					repX(200, "event");
				}
				r.push(`A grimace of displeasure appears on the ${girlD}'s face. Unexpectedly, the same goes for ${hisD} ${fatherF}'s.`);
				r = r.concat(slavesReaction("mutilated"));
				App.Events.addParagraph(frag2, r);
				r = [];
				App.Events.addParagraph(frag2, [App.Medicine.Surgery.makeSlaveReaction(procedure.originalSlave, diff, reaction)]);
				r = [];
				App.Utils.Diff.applyDiff(procedure.originalSlave, diff);
				App.Events.refreshEventArt([slave, rDaughter]);
			}
			r.push(`When the meeting comes to a close, you are shocked to see one of the other guests purchase the ${girlD}'s debt for an absurdly low sum.`);
			App.Events.addParagraph(frag2, r);
			return frag2;
		}

		/** @returns {DocumentFragment} */
		function geld() {
			let frag2 = new DocumentFragment();
			let r = [];
			r.push(`You arrange for ${him} to be sent the remote surgery after determining that the best way to nip this problem in the bud is to cut off ${his} balls.`);
			slave.balls = 0;
			slave.ballType = "human";
			slave.scrotum = 0;
			slave.vasectomy = 0;
			if ([Drug.GROWTESTICLE, Drug.HYPERTESTICLE, Drug.ATROPHYTESTICLE].includes(slave.drugs)) {
				slave.drugs = Drug.NONE;
			}
			if (FutureSocieties.isActive("FSPaternalist") && V.arcologies[0].FSPaternalist > 60) {
				r.push(`The ${VIPs} are <span class="rep dec">horrified</span> by such a severe punishment being handed out so trivially.`);
				repX(-200, "event");
			} else if (FutureSocieties.isActive("FSDegradationist") && V.arcologies[0].FSDegradationist > 60) {
				r.push(`The ${VIPs} seem <span class="rep dec">pleased</span> with the punishment being so severe.`);
				repX(200, "event");
			}
			r.push(`A grimace of displeasure appears on the ${girlD}'s face. Unexpectedly, the same goes for ${hisD} ${fatherF}'s.`);
			r = r.concat(slavesReaction("mutilated"));
			App.Events.addParagraph(frag2, r);
			r = [];
			App.Events.refreshEventArt([slave, rDaughter]);
			r.push(`When the meeting comes to a close, you are shocked to see one of the other guests purchase the ${girlD}'s debt for an absurdly low sum.`);
			App.Events.addParagraph(frag2, r);
			return frag2;
		}

		/** @returns {DocumentFragment} */
		function genitalia() {
			let frag2 = new DocumentFragment();
			let r = [];
			r.push(`You arrange for ${him} to be sent the remote surgery after determining that the best way to deal with this is to just strip ${him} of ${his} genitals.`);
			let procedure = new App.Medicine.Surgery.Procedures.ChopPenis(slave); // the most important part removed, since there is no surgery for convert to null
			if (slave.vagina >= 0) {
				surgeryAmp(slave, "vagina"); // make sure vagina, ovaries and related attributes are set to 0 and the health damage is applied
			}
			slave.balls = 0;
			slave.ballType = "human";
			slave.scrotum = 0;
			slave.vasectomy = 0;
			if ([Drug.GROWTESTICLE, Drug.HYPERTESTICLE, Drug.ATROPHYTESTICLE].includes(slave.drugs)) {
				slave.drugs = Drug.NONE;
			}
			const result = App.Medicine.Surgery.apply(procedure, false);
			if (result === null) {
				r.push(`${slave.slaveName} <span class="health dec">dies from complications of surgery.</span>`);
				r.push(`This denouement caught the ${VIPs} off guard. A melancholic grimace appears on the ${girlD}'s face. Unexpectedly, the same goes for ${hisD} ${fatherF}'s.`);
				r = r.concat(slavesReaction("exitus"));
				App.Events.addParagraph(frag2, r);
				r = [];
				removeSlave(slave, {dead: true});
			} else {
				const [diff, reaction] = result;
				if (FutureSocieties.isActive("FSPaternalist") && V.arcologies[0].FSPaternalist > 60) {
					r.push(`The ${VIPs} are <span class="rep dec">horrified</span> by such a severe punishment being handed out so trivially.`);
					repX(-200, "event");
				} else if (FutureSocieties.isActive("FSDegradationist") && V.arcologies[0].FSDegradationist > 60) {
					r.push(`The ${VIPs} seem <span class="rep dec">pleased</span> with the punishment being so severe.`);
					repX(200, "event");
				}
				r.push(`A grimace of displeasure appears on the ${girlD}'s face. Unexpectedly, the same goes for ${hisD} ${fatherF}'s.`);
				r = r.concat(slavesReaction("mutilated"));
				App.Events.addParagraph(frag2, r);
				r = [];
				App.Events.addParagraph(frag2, [App.Medicine.Surgery.makeSlaveReaction(procedure.originalSlave, diff, reaction)]);
				r = [];
				App.Utils.Diff.applyDiff(procedure.originalSlave, diff);
				App.Events.refreshEventArt([slave, rDaughter]);
			}
			r.push(`When the meeting comes to a close, you are shocked to see one of the other guests purchase the ${girlD}'s debt for an absurdly low sum.`);
			App.Events.addParagraph(frag2, r);
			return frag2;
		}

		/** @returns {DocumentFragment} */
		function vagina() {
			let frag2 = new DocumentFragment();
			let r = [];
			r.push(`You arrange for ${him} to be sent the remote surgery after determining that the proper punishment is to replace ${his} penis with a vagina.`);
			let procedure = new App.Medicine.Surgery.Procedures.MaleToFemale(slave);
			const keepBalls = slave.balls;
			const keepSperm = slave.ballType;
			const keepProstate = slave.prostate;
			const keepScrotum = slave.balls >= 2 ? slave.scrotum : 0;
			const keepVasectomy = slave.vasectomy;
			const keepDrugs = slave.drugs.includes("penis") ? Drug.NONE : slave.drugs;
			const result = App.Medicine.Surgery.apply(procedure, false);
			if (result === null) {
				r.push(`[${slave.slaveName} <span class="health dec">dies from complications of surgery.</span>`);
				r.push(`This denouement caught the ${VIPs} off guard. A melancholic grimace appears on the ${girlD}'s face. Unexpectedly, the same goes for ${hisD} ${fatherF}'s.`);
				r = r.concat(slavesReaction("exitus"));
				App.Events.addParagraph(frag2, r);
				r = [];
				removeSlave(slave, {dead: true});
			} else {
				const [diff, reaction] = result;
				diff.balls = keepBalls;
				diff.ballType = keepSperm;
				diff.prostate = keepProstate;
				diff.scrotum = keepScrotum;
				diff.vasectomy = keepVasectomy;
				diff.drugs = keepDrugs;
				if (FutureSocieties.isActive("FSPaternalist") && V.arcologies[0].FSPaternalist > 60) {
					r.push(`The ${VIPs} are <span class="rep dec">horrified</span> by such a severe punishment being handed out so trivially.`);
					repX(-200, "event");
				} else if (FutureSocieties.isActive("FSDegradationist") && V.arcologies[0].FSDegradationist > 60) {
					r.push(`The ${VIPs} seem <span class="rep dec">pleased</span> with the punishment being so severe.`);
					repX(200, "event");
				}
				r.push(`A grimace of displeasure appears on the ${girlD}'s face. Unexpectedly, the same goes for ${hisD} ${fatherF}'s.`);
				r = r.concat(slavesReaction("mutilated"));
				App.Events.addParagraph(frag2, r);
				r = [];
				App.Events.addParagraph(frag2, [App.Medicine.Surgery.makeSlaveReaction(procedure.originalSlave, diff, reaction)]);
				r = [];
				App.Utils.Diff.applyDiff(procedure.originalSlave, diff);
				App.Events.refreshEventArt([slave, rDaughter]);
			}
			r.push(`When the meeting comes to a close, you are shocked to see one of the other guests purchase the ${girlD}'s debt for an absurdly low sum.`);
			App.Events.addParagraph(frag2, r);
			return frag2;
		}

		/** @returns {DocumentFragment} */
		function giveDaughter() {
			let frag2 = new DocumentFragment();
			let r = [`You end the meeting by informing the ${VIPs} that you have other matters to take care of. They assure you that they'll take the ${kid} back to ${hisD} ${fatherF}'s house. From their lewd gestures and filthy comments as they make their way out, you are certain that the journey will be an entertaining one.`];
			repX(100, "event");
			App.Events.addParagraph(frag2, r);
			return frag2;
		}

		/** @returns {DocumentFragment} */
		function returnDaughter() {
			let frag2 = new DocumentFragment();
			let r = [`You end the meeting by informing the ${VIPs} that you have other matters to take care of, and that you will see the return of the ${daughterD} to ${hisD} ${fatherF} later that day. You order ${V.BodyguardID !== 0 ? "your bodyguard" : "one of your most trusted slaves"} to escort the ${child}, making sure ${heD} doesn't get into any more trouble involving you. The ${VIPs} seem disappointed by your decision, but you are not having any more problems involving this ${girlD} thrown at you; if they want to be lecherous, there are plenty of public sluts that would be glad to service them.`];
			repX(-200, "event");
			App.Events.addParagraph(frag2, r);
			return frag2;
		}

		/** @returns {DocumentFragment} */
		function tradeBis() {
			let frag2 = new DocumentFragment();
			let r = [];
			r.push(`You end the meeting by informing the ${VIPs} that you have other matters to take care of, and that you will take care of the abandoned ${daughterD} personally. There is a clear air of jealousy about them. You send ${slave.slaveName}, along with ${his} slave contract, while you keep the ${child}. The ${fatherF} hastily sends you the contract, seemingly eager to officially get ${his} hands on ${slave.slaveName}.`);
			repX(-400, "event");
			newSlave(rDaughter); // skip new slave intro
			App.Events.addParagraph(frag2, r);
			r = [];
			r = r.concat(slavesReaction("given"));
			App.Events.addParagraph(frag2, r);
			r = [];
			removeSlave(slave);
			return frag2;
		}

		/** @returns {DocumentFragment} */
		function keepDaughter() {
			let frag2 = new DocumentFragment();
			let r = [];
			r.push(`You end the meeting by informing the ${VIPs} that you have other matters to take care of, and that you will take care of the abandoned ${daughterD} personally. There is a clear air of jealousy about them. You barely have time to start your inspection of your new toy before ${hisD} ${fatherF} transfers ${hisD} ownership to you. ${HeF} probably expects something in return, but should have thought of that before presenting you with this gift.`);
			repX(-800, "event");
			newSlave(rDaughter); // skip new slave intro
			App.Events.addParagraph(frag2, r);
			return frag2;
		}

		/**
		 * @param {"unpunished" | "given" | "punished" | "mutilated" | "exitus"} action
		 * @returns {string[]|undefined}
		 */
		function slavesReaction(action) {
			let r = [];
			if (action === "unpunished") {
				if (mindbroken) {
					r.push(`Unable to understand what is happening, your slave heads back to offer ${his} body to whoever ${[Job.WHORE, Job.CLUB].includes(slave.assignment) ? "will pay for it" : "asks"}. `);
				} else {
					r.push(`${He} feared that you would punish ${him} in some cruel manner,`);
					if (slave.devotion <= -20) {
						if (slave.trust > 20) {
							r.push(`and since you haven't, ${he} begins to wonder what ${he} <span class="trust inc">could possibly get away with.</span>`);
							slave.trust += 2;
						} else {
							r.push(`working ${himself} up into a <span class="trust dec">paranoid state.</span> ${He} <span class="devotion dec">hates</span> knowing that you may change you mind at any point.`);
							slave.devotion -=2;
							slave.trust -= 2;
						}
					} else if (slave.devotion <= 20) {
						r.push(`but because you haven't, <span class="trust inc">perhaps you find ${him} valuable?</span>`);
						slave.trust += 5;
					} else if (slave.devotion > 95) {
						r.push(`but you haven't, <span class="trust inc">reassuring ${him}</span> that you will stand up for ${him} if ${he} is unfairly accused.`);
						slave.trust += 5;
					} else if (slave.trust <= 50) {
						r.push(`and although you haven't, ${he} fears the consequences that another accusation from one of ${his} ${[Job.WHORE, Job.CLUB].includes(slave.assignment) ? "clients" : "users"} could have.`);
						slave.trust -= 3;
					} else {
						r.push(`but ${he} is relieved that you didn't.`);
					}
				}
				r.push(`When they learn what has happened, your other slaves are glad that you'd protect them from false accusations, although the more rebellious ones feel they can take advantage of your benevolence.`);
				getSlaves().forEach(s => {
					if (s.devotion < -20 && s.trust > 50) {
						s.devotion--;
						s.trust += 5;
					} else {
						s.devotion++;
					}
				});
				return r;
			} else if (action === "given" || action === "punished") {
				r.push(`After learning of what happened to ${slave.slaveName}, your other slaves are afraid that any accusation against them, no matter how fabricated, could have unpredictable consequences. Those not devoted to you begin to have serious doubts about their futures.`);
				getSlaves().forEach(s => {
					s.trust -= 5;
					if (s.devotion <= 50) {
						s.devotion -= 5;
					}
				});
				if (action === "punished") {
					return r;
				}
				if (slave.relationship > 0) {
					const relationSlave = getSlave(slave.relationshipTarget);
					const {he2, his2} = getPronouns(relationSlave).appendSuffix('2');
					const family = relativeTerm(relationSlave, slave);
					let relation = relationshipTerm(relationSlave);
					if (family) {
						relation += ` and ${family}`;
					}
					if (relationSlave.fetish !== Fetish.MINDBROKEN) {
						if (relationSlave.devotion > 50) {
							r.push(relationSlave.slaveName + ` accepts with resignation your decision to get rid of ${his2} ${relation}, but ${he2} is terrified to think that ${he2} could be the next to be handed over to a stranger.`);
							relationSlave.trust -= (20 + slave.relationship * 5);
						} else if (relationSlave.devotion >= -50) {
							r.push(relationSlave.slaveName + ` is saddened by your decision to get rid of ${his2} ${relation}, and ${he2} is terrified to think that ${he2} could be the next to be handed over to a stranger.`);
							relationSlave.devotion -= slave.relationship * 5;
							relationSlave.trust -= (20 + slave.relationship * 5);
						} else {
							r.push(relationSlave.slaveName + ` <span class="devotion dec">hates you for your decision</span> to get rid of ${his2} ${relation}, and <span class="trust inc">thoughts of revenge come to ${his2} mind.</span>`);
							relationSlave.devotion -= (10 + slave.relationship * 5);
							relationSlave.trust += (20 + slave.relationship * 5);
						}
					} else {
						r.push(`The broken mind of ${relationSlave.slaveName} won't even notice that ${his2} ${relation} is gone.`);
					}
				}
				if (slave.rivalry > 0) {
					const rival = getSlave(slave.rivalryTarget);
					const {he2, his2} = getPronouns(rival).appendSuffix('2');
					if (rival.fetish !== Fetish.MINDBROKEN) {
						r.push(`${rival.slaveName} is pleased that ${he2} won't have to deal with ${his2} ${rivalryTerm(rival)} any more, and hopes this means ${his} life will now be easier.`);
						rival.devotion += rival.rivalry;
						rival.trust += rival.rivalry;
					}
				}
				return r;
			} else if (action === "mutilated" || action === "exitus") {
				const exitus = action === "exitus";
				r.push(`After learning of what happened to ${slave.slaveName}, <span class="trust dec">${his} peers are terrified</span> that any accusation against them, no matter how fabricated, ${exitus ? `could lead to their death` : `could have serious consequences`}. Those not devoted to you begin to believe that <span class="devotion dec">you'll be their demise.</span>`);
				if (mindbroken) {
					r.push(`This opinion of you is further tarnished by the fact that ${slave.slaveName} ${exitus ? "was" : "is"} mindbroken and incapable of doing anything wrong on purpose.`);
				}
				getSlaves().forEach(s => {
					s.trust -= (8 + (exitus ? 2 : 0) + (mindbroken ? 1 : 0));
					s.devotion -= ((exitus ? 1 : 0) + (mindbroken ? 2 : 0));
					if (s.devotion <=51) {
						s.devotion -= (6 + (exitus ? 2 : 0) + (mindbroken ? 1 : 0));
					}
				});
				return r;
			}
		}
	}
};


code:
App.Events.RERoyalBlood = class RERoyalBlood extends App.Events.BaseEvent {
	eventPrerequisites() {
		return [
			() => ((V.rep - 10000 > random(1, 12500)) || (V.debugMode > 0 && V.debugModeEventSelection > 0))
		];
	}

	execute(el) {
		const activeSF = V.SF.Toggle && V.SF.Active >= 1;

		const king = generateKing(); // King first to get his ID for the Queens pregSource and the children's father id

		const queen = generateQueen(); // Queen second to get an ID for her children to relate to.
		const {
			He3,
			his3, he3, him3, himself3, wife3
		} = getPronouns(queen).appendSuffix('3');

		const prince = generatePrince();
		const {
			His2,
			his2, he2, himself2
		} = getPronouns(prince || {pronoun: 1}).appendSuffix('2');

		const princess = generatePrincess();
		const {
			His,
			his, he, him, girl
		} = getPronouns(princess);

		finalTweaks();

		const {HeA, heA} = getPronouns(assistant.pronouns().main).appendSuffix("A");

		const r = [];
		r.push(`One unfortunate consequence of existing in a global world is that business opportunities continue to crop up unabated by the onset of night in one corner of the world or another, an inconsiderate phenomenon for arcology owners who happen to be asleep when an event of importance takes place outside the walls of their arcology. This particular evening you are awoken by an alert from ${V.assistant.name}, unusually intense for this late hour.`);
		if (V.assistant.personality > 0) {
			r.push(`"${properMaster()}, there is a time sensitive enslavement opportunity available if you're interested." ${HeA} pauses before continuing. "You're going to want to see this one ${properMaster()}."`);
		} else {
			r.push(`${HeA} informs you that there is a time sensitive enslavement opportunity for you to peruse, and that ${heA} has calculated the potential rewards are worthy of your consideration even in the middle of the night.`);
		}
		App.Events.addParagraph(el, r);

		App.Events.addParagraph(el, [`A convenient video feed is brought up, displaying a quick visual summary of the opportunity at hand.`]);

		App.Events.addParagraph(el, [`It seems a bastion of the old world has fallen; a royal family of ancient blood and reputation has been overthrown by a local populist leader and his fellow revolutionaries. Furthermore, the leader of the revolution has designs to transform the outmoded monarchy into an arcology of his own, and has transmitted a request for aid to his new peers in the Free Cities.`]);

		App.Events.addParagraph(el, [`Of course, nothing in the Free Cities is free and international aid is no exception. This new arcology owner is no fool, however, and has outlined a number of rewards to be delivered to his most generous benefactors.`]);

		App.Events.addParagraph(el, [`Though the ${aNational(king.nationality)} King himself is dead, murdered in his bed by bloodthirsty revolutionaries, the rest of his family and the majority of his court have been captured and enslaved by their former subjects. The new arcology owner, having decided that a large injection of credits or a shipment of goods is superior to deflowering a royal pussy or asshole, has directed his followers to slake their lust and vengeance on the King's ${wife3} and court rather than his children, though they too are past the age of majority.`]);

		App.Events.addParagraph(el, [`Time is short, but you are well placed to acquire some choice slaves. With an adequate donation${(activeSF) ? `, or the use of ${V.SF.Lower}` : ``}, of course.`]);

		const choices = [];
		choices.push(new App.Events.Result(
			"Go back to sleep",
			() => {
				return `You inform your personal assistant that you aren't planning to take any action. It's not every day that a monarchy collapses in the old world, but it's also not particularly uncommon either.`;
			}
		));

		// PRINCESS
		const princessCashCost = 50000;
		const princessRepCost = 2000;
		const princessSF = 18000;
		if (V.cash >= princessCashCost && V.rep >= princessRepCost) {
			choices.push(new App.Events.Result(
				"Leverage your reputation and credits to aid the new arcology in exchange for a pretty princess.",
				getPrincess,
				`You will need to utilize a portion of your reputation and ${cashFormat(princessCashCost)} to enslave ${him}.`
			));
		} else {
			choices.push(new App.Events.Result(null, null, `You lack the necessary funds and reputation to enslave a princess.`));
		}

		if (activeSF) {
			if (V.rep > princessSF) {
				choices.push(new App.Events.Result(
					`Dispatch a ${V.SF.Lower} on a night time raid to acquire a pretty princess.`,
					() => getPrincess(false),
					`You will be despised for this action, and trade will be greatly damaged.`));
			} else {
				choices.push(new App.Events.Result(null, null, `You lack the reputation to capture and enslave a princess with ${V.SF.Lower}.`));
			}
		}

		const princeCost = 35000;
		const princeSF = 18000;
		const princeAndPrincessCash = 100000;
		const princeAndPrincessRep = 10000;
		const princeAndPrincessSF = 18000;
		if (V.seeDicks > 0) {
			// PRINCE
			if (V.cash >= princeCost) {
				choices.push(new App.Events.Result(
					`Dispatch a sizable amount of aid in exchange for the crown prince.`,
					getPrince,
					`Purchasing the goods and hiring the VTOLs will cost about ${cashFormat(princeCost)}.`
				));
			} else {
				choices.push(new App.Events.Result(null, null, `You lack the necessary funds to enslave the crown prince.`));
			}

			if (activeSF) {
				if (V.rep > princeSF) {
					choices.push(new App.Events.Result(
						`Dispatch ${V.SF.Lower} on a night time raid to acquire the crown prince.`,
						() => getPrince(false),
						`You will be despised for this action, and trade will be greatly damaged.`
					));
				} else {
					choices.push(new App.Events.Result(null, null, `You lack the necessary reputation to capture and enslave the crown prince with ${V.SF.Lower}.`));
				}
			}

			// PRINCE AND PRINCESS
			if (V.cash >= princeAndPrincessCash && V.rep >= princeAndPrincessRep) {
				choices.push(new App.Events.Result(
					`Leverage your substantial reputation and a huge sum of credits to aid the new arcology in exchange for both the prince and princess.`,
					getPrinceAndPrincess,
					`You will need to utilize a sizable portion of your reputation and ${cashFormat(princeAndPrincessCash)} to enslave them.`
				));
			} else {
				choices.push(new App.Events.Result(null, null, `You lack the necessary funds and reputation to enslave both the crown prince and princess.`));
			}

			if (activeSF) {
				if (V.rep > princeAndPrincessSF) {
					choices.push(new App.Events.Result(
						`Dispatch ${V.SF.Lower} on a night time raid to acquire both the prince and princess.`,
						() => getPrinceAndPrincess(false),
						`You will be despised for this action, and trade will be greatly damaged.`
					));
				} else {
					choices.push(new App.Events.Result(null, null, `You lack the necessary reputation to capture and enslave both the crown prince and princess with ${V.SF.Lower}.`));
				}
			}
		}

		// COURT LADIES
		const courtLadiesCost = 25000;
		const courtLadiesCostSF = 10000;
		const courtLadiesName = (V.pedoMode ? "the princess's friends" : "court ladies");
		if (V.cash >= courtLadiesCost) {
			choices.push(new App.Events.Result(
				`Transfer a respectable quantity of credits for a handful of ${courtLadiesName}.`,
				getCourtLadies,
				`It will cost about ${cashFormat(courtLadiesCost)} to enslave them.`
			));
		} else {
			choices.push(new App.Events.Result(null, null, `You lack the necessary funds to enslave a handful of ${courtLadiesName}.`));
		}

		if (activeSF) {
			if (V.rep > courtLadiesCostSF) {
				choices.push(new App.Events.Result(
					`Dispatch ${V.SF.Lower} on a night time raid to acquire a handful of ${courtLadiesName}.`,
					() => getCourtLadies(false),
					`You will be disliked for this action and trade will be damaged.`
				));
			} else {
				choices.push(new App.Events.Result(null, null, `You lack the necessary reputation to capture and enslave a handful of ${courtLadiesName} with ${V.SF.Lower}.`));
			}
		}

		// PRINCESS AND COURT
		const princessAndCourtCost = 500000;
		const princessAndCourtSF = 15000;
		if (V.pedoMode) {
			if (V.cash >= princessAndCourtCost) {
				choices.push(new App.Events.Result(
					`Offer a generous amount of cash to aid the new arcology in exchange for both the princess and ${his} friends.`,
					getPrincessAndCourt,
					`It will cost about ${cashFormat(princessAndCourtCost)} to enslave the princess and ${his} friends.`
				));
			} else {
				choices.push(new App.Events.Result(null, null, `You lack the necessary funds to enslave the princess and ${his} friends.`));
			}
		}

		if (V.pedoMode && activeSF) {
			if (V.rep >= princessAndCourtSF) {
				choices.push(new App.Events.Result(
					`Dispatch ${V.SF.Lower} on a night time raid to acquire the princess and ${his} friends.`,
					() => getPrincessAndCourt(false),
					`You will be despised for this action, and trade will be greatly damaged.`
				));
			} else {
				choices.push(new App.Events.Result(null, null, `You lack the necessary reputation to capture and enslave the princess and ${his} friends with ${V.SF.Lower}.`));
			}
		}

		// HOLD THE QUEEN ALONE
		const queenCash = 15000;
		const queenSF = 12000;
		if (V.cash >= queenCash) {
			choices.push(new App.Events.Result(
				`Transfer a modest quantity of credits for the Queen ${himself3}.`,
				getQueen,
				`It will cost about ${cashFormat(queenCash)} to enslave ${him3}.`
			));
		} else {
			choices.push(new App.Events.Result(null, null, `You lack the necessary funds to enslave the Queen.`));
		}

		if (activeSF) {
			if (V.rep >= queenSF) {
				choices.push(new App.Events.Result(
					`Dispatch ${V.SF.Lower} on a night time raid to acquire the Queen ${himself3}.`,
					() => getQueen(false),
					`You will be despised for this action, and trade will be greatly damaged.`
				));
			} else {
				choices.push(new App.Events.Result(null, null, `You lack the necessary reputation to capture and enslave the Queen with ${V.SF.Lower}.`));
			}
		}

		// PRINCESS AND QUEEN
		// repX is called within the get* function
		const princessAndQueenCash = 500000;
		const princessAndQueenSF = 13000;
		if (V.cash >= princessAndQueenCash) {
			choices.push(new App.Events.Result(
				`Send a large amount of credits and goods to retrieve both the princess and Queen.`,
				getPrincessAndQueen,
				`It will cost about ${cashFormat(princessAndQueenCash)} to enslave both the princess and Queen.`
			));
		} else {
			choices.push(new App.Events.Result(null, null, `You lack the necessary funds and reputation to enslave both the Queen and princess.`));
		}

		if (activeSF) {
			if (V.rep >= princessAndQueenSF) {
				choices.push(new App.Events.Result(
					`Dispatch ${V.SF.Lower} on a night time raid to acquire both the princess and Queen.`,
					() => getPrincessAndQueen(false),
					`You will be despised for this action, and trade will be greatly damaged.`
				));
			} else {
				choices.push(new App.Events.Result(null, null, `You lack the necessary reputation to capture and enslave both the Queen and princess with ${V.SF.Lower}.`));
			}
		}

		// QUEEN AND COURT
		const queenAndCourtCost = 500000;
		const queenAndCourtSF = 13000;
		if (!V.pedoMode) {
			if (V.cash >= queenAndCourtCost) {
				choices.push(new App.Events.Result(
					`Offer a generous amount of cash in exchange for both the Queen and ${his3} court ladies.`,
					getQueenAndCourt,
					`It will cost about ${cashFormat(queenAndCourtCost)} to enslave the Queen and ${his3} court ladies.`
				));
			} else {
				choices.push(new App.Events.Result(null, null, `You lack the necessary funds to enslave the Queen and ${his3} ladies.`));
			}
		}

		if (!V.pedoMode && activeSF) {
			if (V.rep >= queenAndCourtSF) {
				choices.push(new App.Events.Result(
					`Dispatch ${V.SF.Lower} on a night time raid to acquire the Queen and ${his3} court ladies.`,
					() => getQueenAndCourt(false),
					`You will be despised for this action, and trade will be greatly damaged.`
				));
			} else {
				choices.push(new App.Events.Result(null, null, `You lack the necessary reputation to capture and enslave the Queen and ${his3} ladies with ${V.SF.Lower}.`));
			}
		}

		// ENTIRE COURT
		const entireCourtCost = 2500000;
		if (V.limitFamilies !== 1) {
			if (V.cash >= entireCourtCost) {
				choices.push(new App.Events.Result(
					`Send an unheard amount of credits and goods to retrieve the entire court.`,
					getEntireCourt,
					`It will cost about ${cashFormat(entireCourtCost)} to enslave the entire court.`
				));
			}

			if (activeSF) {
				choices.push(new App.Events.Result(
					`Dispatch ${V.SF.Lower} on a night time raid to take everyone and everything of value.`,
					() => getEntireCourt(false),
					`You will be loathed for this action and trade will be crippled.`
				));
			}
		}

		App.Events.addResponses(el, choices);
		return el;

		function commitKingToMissingTable() {
			V.missingTable[king.ID] = missingTableRecordFromHumanState(king, king.ID, {yours: false, dead: true}, "King");
		}

		function getPrincess(buy = true) {
			const text = new DocumentFragment();
			if (buy) {
				App.UI.DOM.appendNewElement("p", text, `You seize a tablet and practically roll out of your bed, working furiously and using every feature of ${V.assistant.name} to the utmost. It's not easy, but you call in a number of favors and grease a handful of palms, and soon a flight of VTOLs are landing in the new arcology laden with goods. When they take off again they have the princess aboard clad in chains, and make a direct course towards your waiting penthouse.`);

				// Princess
				cashX(-princessCashCost, "slaveTransfer", princess);
				repX(-princessRepCost, "event", princess);
			} else {
				App.UI.DOM.appendNewElement("p", text, `Seizing a tablet, you quickly send a message to ${App.Mods.SF.SFC()}. After dark, a flight of VTOLs land in the new arcology laden with troops. When they take off again they have the princess aboard clad in chains and make a direct course towards your waiting penthouse.`);
				V.arcologies[0].prosperity -= 15;

				// Princess
				repX(-princessSF, "event", princess);
			}
			App.UI.DOM.appendNewElement("p", text, `Eventually ${he} arrives in your penthouse, the perfect image of a demure yet composed princess. ${His} clearly practiced façade of poise and grace fades under scrutiny, however. ${princessArrives()}`);

			orphan(princess);
			text.append(App.UI.newSlaveIntro(princess));

			return text;
		}

		function getPrince(buy = true) {
			const text = new DocumentFragment();
			if (buy) {
				App.UI.DOM.appendNewElement("p", text, `You seize a tablet and practically roll out of your bed, working vigorously and using every feature of ${V.assistant.name} to the utmost. It's not easy, but your credits pave your way to sending a flight of VTOLs laden with goods to the new arcology. They take off again with the crown prince aboard and in chains, where ${he2} rails against the uncaring metal walls of the VTOL for the length of ${his2} journey to your penthouse.`);

				// Prince
				cashX(-princeCost, "slaveTransfer", prince);
			} else {
				App.UI.DOM.appendNewElement("p", text, `Seizing a tablet, you quickly send a message to The Colonel. After dark, a flight of VTOLs land in the new arcology laden with troops. They take off again with the crown prince aboard and in chains, where ${he2} rails against the uncaring metal walls of the VTOL for the breadth of ${his2} journey to your penthouse.`);
				prince.origin = `$He was the crown prince of a royal kingdom, till $his family was overthrown and $he was acquired by ${V.SF.Lower}.`;
				V.arcologies[0].prosperity -= 15;
				// Prince
				repX(-princeSF, "event", prince);
			}

			App.UI.DOM.appendNewElement("p", text, princeArrives());

			orphan(prince);
			text.append(App.UI.newSlaveIntro(prince));

			return text;
		}

		function getPrinceAndPrincess(buy = true) {
			const text = new DocumentFragment();
			if (buy) {
				App.UI.DOM.appendNewElement("p", text, `You seize a tablet and practically roll out of your bed, working furiously and using every feature of ${V.assistant.name} to the utmost. It's not easy, but you call in a number of favors and grease a handful of palms, and soon a flight of VTOLs are landing in the new arcology laden with goods. When they take off again they have the prince and princess aboard, clad in chains and bound face to face in a forced embrace, and make a direct course towards your waiting penthouse.`);
				const cashShares = princeAndPrincessCash / 5;
				const repShares = princeAndPrincessRep / 5;

				// Princess
				cashX(-cashShares * 3, "slaveTransfer", princess);
				repX(-repShares * 3, "event", princess);
				newSlave(princess); // skip New Slave Intro

				// Prince
				cashX(-cashShares * 2, "slaveTransfer", prince);
				repX(-repShares * 2, "event", prince);
				newSlave(prince); // skip New Slave Intro
			} else {
				App.UI.DOM.appendNewElement("p", text, `Seizing a tablet, you quickly send a message to The Colonel. After dark, a flight of VTOLs land in the new arcology laden with troops. When they take off again they have the prince and princess aboard, clad in chains and bound face to face in a forced embrace, and make a direct course towards your waiting penthouse.`);
				prince.origin = `$He was the crown prince of a royal kingdom, till $his family was overthrown and $he was acquired by ${V.SF.Lower}.`;
				V.arcologies[0].prosperity -= 15;
				const shares = princeAndPrincessSF / 9;

				// Princess
				repX(-shares * 5, "event", princess);
				newSlave(princess); // skip New Slave Intro

				// Prince
				repX(-shares * 4, "event", prince);
				newSlave(prince); // skip New Slave Intro
			}

			App.UI.DOM.appendNewElement("p", text, `Eventually they arrive in your penthouse, faces flushed with embarrassment at their compromising position. The former prince is beside ${himself2} with rage, but seems to be holding ${himself2} back for ${his2} little ${relativeTerm(prince, princess)}'s sake, while ${he} struggles to maintain a façade of poise and grace. ${princessArrives()} However, the prince's submission to life as a slave is another question entirely.`);

			// the queen is missing
			princess.mother = SID.GENERIC;
			setMissingParents(princess);
			prince.mother = princess.mother;
			commitKingToMissingTable();

			return text;
		}

		function getCourtLadies(buy = true) {
			const text = new DocumentFragment();
			const ladiesName = (V.pedoMode ? "friends of the princess" : "court ladies");
			const arrivalDesc = (V.pedoMode
				? `When the young noblewomen arrive at your penthouse, they're decidedly disoriented.`
				: `When the ladies arrive at your penthouse, they seem almost relieved at the opulence of their new surroundings.`
			);
			if (buy) {
				App.UI.DOM.appendNewElement("p", text, `You take a tablet and peruse the various ${ladiesName} on offer by the fledgling arcology. You single out a few interesting individuals for purchase that might suit your tastes, but the slapdash descriptions provided for each slave by the revolutionaries make it likely that any similarities to your aesthetic leanings will be coincidental. Once you are satisfied with your selection, you electronically transfer the credits to the new arcology and soon receive a receipt for your donation and an estimated delivery schedule.`);
				const share = Math.trunc(courtLadiesCost / 3);

				// Ladies
				for (let i = 0; i < 3; i++) {
					const slave = generateOneCourtLady();
					cashX(-share, "slaveTransfer", slave);
					newSlave(slave); // skip New Slave Intro
				}
			} else {
				App.UI.DOM.appendNewElement("p", text, `You take a tablet and peruse the various ${ladiesName} on offer by the fledgling arcology. You single out a few interesting individuals for acquisition that might suit your tastes, but the slapdash descriptions provided for each by ${V.SF.Lower} Intelligence make it likely that any similarities to your aesthetic leanings will be coincidental. Once you are satisfied with your selection, you electronically transfer the order to The Colonel and soon receive a mission success notice along with an estimated delivery schedule.`);
				const share = Math.trunc(courtLadiesCostSF / 3);

				// Ladies
				for (let i = 0; i < 3; i++) {
					const slave = generateOneCourtLady();
					repX(-share, "event", slave);
					newSlave(slave); // skip New Slave Intro
				}
				V.arcologies[0].prosperity -= 10;
			}

			App.UI.DOM.appendNewElement("p", text, `${arrivalDesc} ${ladiesArrive()}`);

			return text;
		}

		function getPrincessAndCourt(buy = true) {
			const text = new DocumentFragment();
			if (buy) {
				App.UI.DOM.appendNewElement("p", text, `You take a tablet and transmit a communication request to the new arcology owner with your intent. Once his shock wears off, he readily accepts with little need for negotiation. Soon, a flight of VTOLs land in the new arcology laden with goods. When they take off again they have the princess and a gaggle of ${his} terrified friends chained together.`);
				const costShare = queenAndCourtCost / 5;

				// Friends
				for (let i = 0; i < 3; i++) {
					const slave = generateOneCourtLady();
					cashX(-costShare, "slaveTransfer", slave);
					newSlave(slave); // skip New Slave Intro
				}

				// Princess
				cashX(-costShare * 2, "slaveTransfer", queen);
				newSlave(princess); // skip New Slave Intro
			} else {
				App.UI.DOM.appendNewElement("p", text, `Seizing a tablet, you quickly send a message to The Colonel. After dark, a flight of VTOLs land in the new arcology laden with troops. When they take off again they have the princess and a gaggle of ${his} terrified friends chained together.`);
				V.arcologies[0].prosperity -= 17;
				const share = queenAndCourtSF / 17;

				// Friends
				for (let i = 0; i < 3; i++) {
					const slave = generateOneCourtLady();
					repX(-share * 4, "event", slave);
					newSlave(slave); // skip New Slave Intro
				}

				// Princess
				repX(-share * 5, "event", queen);
				newSlave(princess); /* skip New Slave Intro */
			}

			App.UI.DOM.appendNewElement("p", text, `Eventually they all arrive in your penthouse. The princess presents the perfect image of a demure yet composed royal. ${His} clearly practiced façade of poise and grace fades under scrutiny, however. ${princessArrives()} Meanwhile, ${his} friends are decidedly disoriented. ${ladiesArrive()}`);

			return text;
		}

		function getQueen(buy = true) {
			const text = new DocumentFragment();
			if (buy) {
				App.UI.DOM.appendNewElement("p", text, `You take a tablet and transmit a communication request to the new arcology owner. It doesn't take long for him to accept but when his video feed connects on your screen, you find yourself staring at the pained expression of the Queen ${himself3}. It becomes abundantly clear that someone is mounting ${him3} from behind as ${his3} body shakes and spasms from the intensity of their thrusts. You note that the Queen appears to be getting fucked on an extravagant, yet bloodstained, four-poster bed, likely the site of ${his3} former husband's demise. The mysterious individual unsurprisingly turns out to be the new arcology owner, revealing himself by shoving the Queen's face down against the stained bed sheets as he lowers his own face into frame. "How can I help you?"`);
				App.UI.DOM.appendNewElement("p", text, `The man seems somewhat surprised that you want to purchase the Queen and the Queen alone, given the breadth and quality of his other merchandise available, but not unduly so. Soon enough negotiations begin and a short time later an equitable price is agreed upon. Your new peer even throws in a slight discount, in exchange for allowing him to use the Queen himself for the remainder of the night.`);

				// Queen
				cashX(-queenCash, "slaveTransfer", queen);
			} else {
				App.UI.DOM.appendNewElement("p", text, `Seizing a tablet, you quickly send a message to The Colonel. After dark, a flight of VTOLs land in the new arcology laden with troops. When they take off again they have the Queen aboard and make a direct course towards your waiting penthouse.`);
				V.arcologies[0].prosperity -= 12;

				// Queen
				repX(-queenSF, "event", queen);
			}

			commitKingToMissingTable();

			App.UI.DOM.appendNewElement("p", text, `When the Queen arrives at your penthouse, ${he3} seems almost relieved and almost basks in the opulence of ${his3} new surroundings. ${queenArrives()}`);
			text.append(App.UI.newSlaveIntro(queen));

			return text;
		}

		function getPrincessAndQueen(buy = true) {
			const text = new DocumentFragment();
			if (buy) {
				App.UI.DOM.appendNewElement("p", text, `You take a tablet and transmit a communication request to the new arcology owner with your intent. Once his shock wears off, he readily accepts with little need for negotiation. Soon, a flight of VTOLs land in the new arcology laden with goods. When they take off again they have the princess and the Queen, who is resigned to ${his3} fate, clad in chains then bound face to face in a forced embrace.`);
				const shares = princessAndQueenCash / 5;

				// Princess
				cashX(-shares * 4, "slaveTransfer", princess);
				newSlave(princess); // skip New Slave Intro

				// Queen
				cashX(-shares, "slaveTransfer", queen);
				newSlave(queen); // skip New Slave Intro
			} else {
				App.UI.DOM.appendNewElement("p", text, `Seizing a tablet, you quickly send a message to The Colonel. After dark, a flight of VTOLs land in the new arcology laden with troops. When they take off again they have the princess and Queen aboard, making a direct course towards your waiting penthouse.`);
				V.arcologies[0].prosperity -= 13;
				const shares = princessAndQueenSF / 13;

				// Princess
				repX(-shares * 10, "event", princess);
				newSlave(princess);

				// Queen
				repX(-shares * 3, "event", queen);
				newSlave(queen);
			}

			commitKingToMissingTable();

			App.UI.DOM.appendNewElement("p", text, `Eventually they both arrive in your penthouse. The princess is flushed with embarrassment at ${his} compromising position, struggling to maintain a façade of poise and grace. ${princessArrives()} The Queen, on the other hand, seems almost relieved and basks in the opulence of ${his3} new surroundings. ${queenArrives()}`);

			return text;
		}

		function getQueenAndCourt(buy = true) {
			const text = new DocumentFragment();
			if (buy) {
				App.UI.DOM.appendNewElement("p", text, `You take a tablet and transmit a communication request to the new arcology owner with your intent. Once his shock wears off, he readily accepts with little need for negotiation. Soon, a flight of VTOLs land in the new arcology laden with goods. When they take off again they have the Queen, who is resigned to ${his3} fate, and a gaggle of terrified court ladies chained together.`);
				const costShare = queenAndCourtCost / 5;

				// Ladies
				for (let i = 0; i < 3; i++) {
					const slave = generateOneCourtLady();
					cashX(-costShare, "slaveTransfer", slave);
					newSlave(slave); // skip New Slave Intro
				}

				// Queen
				cashX(-costShare * 2, "slaveTransfer", queen);
				newSlave(queen); // skip New Slave Intro
			} else {
				App.UI.DOM.appendNewElement("p", text, `Seizing a tablet, you quickly send a message to The Colonel. After dark, a flight of VTOLs land in the new arcology laden with troops. When they take off again they have the Queen, who is resigned to ${his3} fate, and a gaggle of terrified court ladies chained together.`);
				V.arcologies[0].prosperity -= 13;
				const share = queenAndCourtSF / 13;

				// Ladies
				for (let i = 0; i < 3; i++) {
					const slave = generateOneCourtLady();
					repX(-share * 3, "event", slave);
					newSlave(slave); // skip New Slave Intro
				}

				App.UI.DOM.appendNewElement("p", text, `Eventually they all arrive in your penthouse. The Queen seems almost relieved and basks in the opulence of ${his3} new surroundings. ${queenArrives()} Meanwhile, the ladies seem comforted by the opulence of their new surroundings. ${ladiesArrive()}`);

				// Queen
				repX(-share * 4, "event", queen);
				newSlave(queen); /* skip New Slave Intro */

				commitKingToMissingTable();
			}

			return text;
		}

		function getEntireCourt(buy = true) {
			function everyoneArrives() {
				const r = [];
				r.push(`Eventually they all arrive in your penthouse. The`);
				if (V.seeDicks > 0) {
					r.push(`prince and princess`);
				} else {
					r.push(`princess and queen`);
				}
				r.push(`are flushed with embarrassment in their compromising position.`);
				if (V.seeDicks > 0) {
					r.push(`The former prince is beside ${himself2} with rage, but seems to be holding ${himself2} back for ${his2} little ${relativeTerm(prince, princess)}'s sake, while ${he} struggles to maintain a façade of poise and grace.`);
				} else {
					r.push(`The princess struggles to maintain a façade of poise and grace.`);
				}
				r.push(princessArrives());
				if (V.seeDicks > 0) {
					r.push(`However, the prince's submission to life as a slave is another question entirely. The Queen, on the other hand,`);
				} else {
					r.push(`The Queen`);
				}
				const ladiesArrivalDesc = (V.pedoMode
					? `the friends of the princess are decidedly disoriented`
					: `the ladies seem comforted by the opulence of their new surroundings`
				);
				r.push(`seems almost relieved and basks in the opulence of ${his3} new surroundings. ${queenArrives()} Lastly, ${ladiesArrivalDesc}. ${ladiesArrive()}`);
				return r;
			}

			const text = new DocumentFragment();
			const r = [];
			const ladiesName = (V.pedoMode ? "friends of the princess" : "court ladies");
			if (buy) {
				r.push(`You take a tablet and transmit a communication request to the new arcology owner with your intent. Once his shock wears off, he readily accepts with little need for negotiation. Soon, a flight of VTOLs land in the new arcology laden with goods. When they take off again they have the`);
				if (V.seeDicks > 0) {
					r.push(`prince and princess, clad in chains and bound face to face in a forced embrace, the Queen, who is resigned to ${his3} fate,`);
				} else {
					r.push(`princess and ${his} mother, clad in chains and bound face to face in a forced embrace,`);
				}
				r.push(`and a gaggle of terrified ${ladiesName}.`);
				App.Events.addParagraph(text, r);
				App.Events.addParagraph(text, everyoneArrives());
				const costShare = entireCourtCost / 250;

				// Princess
				cashX(-costShare * 110, "slaveTransfer", princess);
				newSlave(princess); // skip New Slave Intro

				// Prince
				if (V.seeDicks > 0) {
					cashX(-costShare * 75, "slaveTransfer", prince);
					newSlave(prince); // skip New Slave Intro
				}

				// Queen
				cashX(-costShare * 25, "slaveTransfer", queen);
				newSlave(queen); /* skip New Slave Intro */

				// Ladies
				const ladiesCost = Math.trunc(costShare * 40 / 3);
				for (let i = 0; i < 3; i++) {
					const slave = generateOneCourtLady();
					cashX(-ladiesCost, "slaveTransfer", slave);
					newSlave(slave); // skip New Slave Intro
				}
			} else {
				const loot = random(10, 300) * 100;
				r.push(`Seizing a tablet, you quickly send a message to The Colonel. After dark, a flight of VTOLs land in the new arcology laden with troops. When they take off again they have the`);
				if (V.seeDicks > 0) {
					r.push(`prince and princess, clad in chains and bound face to face in a forced embrace, the Queen, who is resigned to ${his3} fate,`);
				} else {
					r.push(`princess and ${his} mother, clad in chains and bound face to face in a forced embrace,`);
				}
				r.push(`a gaggle of terrified ${ladiesName}, and as much loot as they could carry.`);
				App.Events.addParagraph(text, r);
				App.Events.addParagraph(text, [...everyoneArrives(), `You also scored <span class="cash inc">${cashFormat(loot)}</span> in valuables from the raid.`]);

				V.arcologies[0].prosperity = 2;
				cashX(loot, "event");
				const repShares = Math.trunc(V.rep / -15);
				/* this event is supposed to end in reputation at 0. In order to slice up that pie, we find shares of "everything" here and give them out later, before finally setting leftovers to 0. 3 ladies at one share each, +3 for prince, +4 for queen, +5 for princess is 15 shares.*/

				// Ladies
				for (let i = 0; i < 3; i++) {
					const slave = generateOneCourtLady();
					repX(repShares, "event", slave);
					newSlave(slave); // skip New Slave Intro
				}
				// Princess
				repX((5 * repShares), "event", princess);
				newSlave(princess); // skip New Slave Intro

				// Prince
				if (V.seeDicks > 0) {
					repX((3 * repShares), "event", prince);
					newSlave(prince); /* skip New Slave Intro */
				}

				// Queen
				repX((4 * repShares), "event", queen);
				newSlave(queen); /* skip New Slave Intro */

				repX(0 - V.rep, "event"); /* Round off any remaining rep due to the trunc on shares */
			}

			commitKingToMissingTable();

			return text;
		}

		/**
		 * @param {"XY"|"XX"} sex
		 */
		function generateTemplate(sex) {
			let slave;

			/* We set the minimum age high enough to make sure that she was at least 19 when the prince was born, *and* to minimize the chance of the prince-princess age gap
				being compressed so far that the two become twins.
			*/
			const minQueenAge = V.minimumSlaveAge + 21;

			if (sex === "XX") { // queen is generated after king, so we can key her race/nationality to his
				slave = GenerateNewSlave(sex, {
					minAge: minQueenAge, maxAge: 43, ageOverridesPedoMode: 1, disableDisability: 1, nationality: king.nationality, race: king.race
				});
				slave.slaveSurname = slave.birthSurname = king.birthSurname; // can this be made to account for languages with different male/female surnames?
			} else if (V.realRoyalties === 1) {
				/** @type {FC.Race} */
				let race;
				const nationality = App.Data.misc.royalNationalities.random();
				switch (nationality) {
					case "Japanese":
					case "Cambodian":
					case "Bhutanese":
					case "Thai":
						race = "asian";
						break;
					case "Luxembourgian":
					case "Belgian":
					case "Danish":
					case "Dutch":
					case "Swedish":
					case "Norwegian":
					case "British":
					case "Monégasque":
						race = "white";
						break;
					case "Spanish":
						race = "southern european";
						break;
					case "Moroccan":
					case "Omani":
					case "Jordanian":
					case "Bahraini":
					case "Kuwaiti":
					case "Qatari":
					case "Saudi":
						race = "middle eastern";
						break;
					case "Bruneian":
					case "Malaysian":
						race = "malay";
						break;
					case "Emirati":
						race = "indo-aryan";
						break;
					case "Tongan":
						race = "pacific islander";
						break;
					case "Swazi":
					case "Mosotho":
						race = "black";
						break;
				}
				slave = GenerateNewSlave(sex, {
					minAge: minQueenAge, maxAge: 43, ageOverridesPedoMode: 1, disableDisability: 1, nationality: nationality, race: race
				});
				if (slave.nationality === "Japanese") {
					slave.birthSurname = "Yamato";
				} else if (slave.nationality === "Luxembourgian") {
					slave.birthSurname = "Luxembourg-Nassau";
				} else if (slave.nationality === "Belgian") {
					slave.birthSurname = "Saxe-Coburg and Gotha";
				} else if (slave.nationality === "Danish") {
					slave.birthSurname = "Glücksburg";
				} else if (slave.nationality === "Dutch") {
					slave.birthSurname = "Orange-Nassau";
				} else if (slave.nationality === "Swedish") {
					slave.birthSurname = "Bernadotte";
				} else if (slave.nationality === "Spanish") {
					slave.birthSurname = "Bourbon";
				} else if (slave.nationality === "Norwegian") {
					slave.birthSurname = "Glücksburg";
				} else if (slave.nationality === "Cambodian") {
					slave.birthSurname = "Norodom";
				} else if (slave.nationality === "Moroccan") {
					slave.birthSurname = "Alawi";
				} else if (slave.nationality === "Omani") {
					slave.birthSurname = "Al Said";
				} else if (slave.nationality === "Jordanian") {
					slave.birthSurname = "Hāshim";
				} else if (slave.nationality === "Bruneian") {
					slave.birthSurname = "Bolkiah";
				} else if (slave.nationality === "Emirati") {
					slave.birthSurname = "Al Nahyan";
				} else if (slave.nationality === "Bahraini") {
					slave.birthSurname = "Al Khalifah";
				} else if (slave.nationality === "Kuwaiti") {
					slave.birthSurname = "Al Sabah";
				} else if (slave.nationality === "Malaysian") {
					slave.birthSurname = "Pahang";
				} else if (slave.nationality === "Qatari") {
					slave.birthSurname = "Al Thani";
				} else if (slave.nationality === "Saudi") {
					slave.birthSurname = "Al Saud";
				} else if (slave.nationality === "Tongan") {
					slave.birthSurname = "Tupou";
				} else if (slave.nationality === "Swazi") {
					slave.birthSurname = "Dlamini";
				} else if (slave.nationality === "Mosotho") {
					slave.birthSurname = "Moshesh";
				} else if (slave.nationality === "British") {
					slave.birthSurname = "Windsor";
				} else if (slave.nationality === "Monégasque") {
					slave.birthSurname = "Grimaldi";
				} else if (slave.nationality === "Bhutanese") {
					slave.birthSurname = "Wangchuck";
				} else if (slave.nationality === "Thai") {
					slave.birthSurname = "Chakri";
				}
				slave.slaveSurname = slave.birthSurname;
			} else {
				slave = GenerateNewSlave(sex, {
					minAge: minQueenAge, maxAge: 43, ageOverridesPedoMode: 1, disableDisability: 1
				});
			}
			slave.anus = 0;
			slave.weight = 0;
			slave.prestige = 2;
			slave.skill.whoring = 0;
			slave.canRecruit = 0;

			return slave;
		}

		/** @returns {FC.SlaveState} */
		function generatePrincess() {
			const slave = generateRelatedSlave(prince, "younger sister", undefined, 0, 2, 3);
			slave.career = "a princess";
			slave.origin = "$He was a princess of a royal kingdom, till $his family was overthrown and $he was sold to you in exchange for aid.";
			slave.prestigeDesc = "$He was the princess of an ancient kingdom.";
			slave.devotion = random(-80, -60);
			slave.trust = random(-50, -60);
			slave.face = random(25, 100);
			if (["crooked", "gapped"].includes(slave.teeth)){
				slave.teeth = "normal";
			}
			slave.boobs = Math.min(slave.boobs, 400);
			slave.vagina = 0;
			slave.preg = -1;
			if (slave.physicalAge < slave.pubertyAgeXX) {
				slave.pubertyXX = 0;
				slave.preg = 0;
			}
			slave.pubicHStyle = "waxed";
			slave.underArmHStyle = "waxed";
			slave.hips = 0;
			slave.butt = random(1, 2);
			slave.intelligence = random(15, 100);
			slave.intelligenceImplant = 15;
			slave.skill.entertainment = 45;
			slave.skill.anal = 0;
			slave.skill.oral = 0;
			setHealth(slave, jsRandom(30, 60), 0, 0, 0, 0);
			slave.behavioralFlaw = either("arrogant", "bitchy");

			return slave;
		}

		/** @returns {FC.SlaveState} */
		function generatePrince() {
			const slave = generateRelatedSlave(queen, "son", undefined, 0, 19);
			slave.father = king.ID;
			slave.career = "a prince";
			slave.origin = "$He was the crown prince of a royal kingdom, till $his family was overthrown and $he was sold to you in exchange for aid.";
			slave.prestigeDesc = "$He was the crown prince of an ancient kingdom.";
			if (["crooked", "gapped"].includes(slave.teeth)){
				slave.teeth = "normal";
			}
			slave.devotion = random(-80, -60);
			slave.trust = random(-50, -60);
			if (slave.physicalAge < slave.pubertyAgeXY) {
				slave.pubertyXY = 0;
			}
			slave.butt = random(0, 1);
			// moved to finalTweaks(): muscles = 50
			slave.intelligence = random(15, 100);
			slave.intelligenceImplant = 15;
			// skills moved to finalTweaks(): anal 0, oral 0, combat 40
			setHealth(slave, jsRandom(30, 60), 0, 0, 0, 0);
			slave.behavioralFlaw = either("arrogant", "bitchy");
			setMissingParents(slave); // set .father so the princess will be a full sibling

			return slave;
		}

		/** @returns {FC.SlaveState} */
		function generateQueen() {
			const slave = generateTemplate("XX");
			slave.career = "a Queen";
			slave.origin = "$He was the Queen of a royal kingdom, till $his husband was overthrown and $he was sold to you in exchange for credits.";
			slave.prestigeDesc = "$He was the Queen of an ancient kingdom.";
			slave.face = random(25, 100);
			slave.faceImplant = 0;
			if (["crooked", "gapped"].includes(slave.teeth)){
				slave.teeth = "normal";
			}
			slave.devotion = random(10, 20);
			slave.trust = random(-20, -30);
			while (slave.boobs < 300 || slave.boobs > 1000) {
				slave.boobs = rollBreast(0);
			}
			slave.natural.boobs = Math.max(300, slave.boobs - 200);
			slave.vagina = 2;
			slave.pubicHStyle = "waxed";
			slave.underArmHStyle = "waxed";
			slave.shoulders = either(-1, 0, 1);
			slave.hips = 1;
			slave.butt = random(2, 4);
			slave.intelligence = random(15, 100);
			slave.intelligenceImplant = 30;
			// skills moved to finalTweaks(): entertainment 45
			slave.counter.birthsTotal = 2;
			setHealth(slave, jsRandom(30, 60), 0, 0, 0, 0);
			slave.behavioralFlaw = either("arrogant", "bitchy");
			if (V.seePreg !== 0) {
				slave.pregSource = king.ID;
				slave.preg = 7;
				slave.pregType = 1;
				slave.pregWeek = 7;
				slave.pregKnown = 1;
				SetBellySize(slave);
			}

			return slave;
		}

		/** @returns {FC.SlaveState} */
		function generateKing() {
			const slave = generateTemplate("XY");
			// give the king a missing parent ID
			slave.ID = generateMissingParentID();
			return slave;
		}

		/** @returns {FC.SlaveState} */
		function generateOneCourtLady() {
			const minAge = (V.pedoMode ? princess.actualAge - 3 : 21);
			const maxAge = (V.pedoMode ? princess.actualAge + 3 : V.retirementAge -2);
			const slave = GenerateNewSlave("XX", {
				minAge: minAge, maxAge: maxAge, disableDisability: 1, nationality: princess.nationality
			});
			slave.origin = "$He was a member of the court in an ancient kingdom, till it was overthrown and $he was sold to you in exchange for credits.";
			slave.career = "a lady courtier";
			slave.prestige = 1;
			const ladyName = (V.pedoMode ? "friend of the princess" : "lady of the court");
			slave.prestigeDesc = `$He was once a ${ladyName} of an ancient kingdom.`;
			slave.face = random(25, 76);
			if (["crooked", "gapped"].includes(slave.teeth)){
				slave.teeth = "normal";
			}
			if (V.pedoMode) {
				slave.devotion = random(-80, -60);
				slave.trust = random(-50, -60);
			} else {
				slave.devotion = random(10, 20);
				slave.trust = random(-20, -30);
			}
			slave.vagina = Math.min(slave.vagina, 1);
			slave.pubicHStyle = "waxed";
			slave.underArmHStyle = "waxed";
			slave.shoulders = jsEither([-1, 0, 1]);
			while (slave.natural.boobs < 300 || slave.natural.boobs > 1000) {
				slave.natural.boobs = rollBreast(0);
			}
			if (slave.actualAge <= 15) {
				slave.boobs = Math.min(slave.boobs, slave.natural.boobs);
				slave.butt = Math.min(slave.butt, 1);
			} else {
				slave.boobs = slave.natural.boobs;
				slave.butt = 1;
			}
			if (slave.actualAge <= 13) {
				slave.hips = /** @type {FC.GenePoolRecord["hips"]} */ (Math.min(slave.hips, 1));
			} else {
				slave.hips = 1;
			}
			slave.anus = 0;
			slave.weight = 0;
			slave.intelligence = random(-50, 70);
			slave.intelligenceImplant = 15;
			slave.skill.entertainment = 25;
			slave.skill.whoring = 0;
			setHealth(slave, jsRandom(30, 60), 0, 0, 0, 0);
			slave.canRecruit = 0;
			slave.behavioralFlaw = either("arrogant", "bitchy");
			return slave;
		}

		// apply some prince and queen traits after princess generated, to prevent unintentional inheritance
		function finalTweaks() {
			queen.skill.entertainment = 45;
			prince.muscles = 50;
			prince.skill.anal = 0;
			prince.skill.oral = 0;
			prince.skill.combat = 40;
		}

		/** @param {FC.SlaveState} slave */
		function orphan(slave) {
			// Remove family links from 'child' slaves acquired without their parents
			slave.mother = SID.GENERIC;
			slave.father = SID.GENERIC;
		}

		function queenArrives() {
			return `Yet, it seems likely that ${his3} relief has more to do with saving ${him3} from a lifetime of gang rape at the mercy of ${his3} former subjects, than it does the familiar luxury. ${He3} submits to biometric scanning obediently and without ${(V.seePreg !== 0) ? `fuss, during which you discover to ${his3} surprise that ${he3} is pregnant with the child of the former King. You notice ${he3} cradles ${his3} ever so slightly rounded stomach protectively.` : `fuss.`}`;
		}

		function princessArrives() {
			return `The slightest trembling of ${his} balled up fists, the minute tremors that mar ${his} immaculate posture, ${his} inability to meet your eyes with ${his} own — all signs that ${he} is still a scared ${girl} despite all ${his} royal trappings. Nonetheless, though the princess's court training is unlikely to be very beneficial to ${him} in ${his} new life in the penthouse, it does stand in stark contrast to ${his} more common slave peers.`;
		}

		function princeArrives() {
			return `When ${he2} arrives in your penthouse, the former prince is beside ${himself2} with rage. As soon as he sees a chance, ${he2} breaks free and attempts to fight ${his2} way out of your penthouse. ${His2} attempt at freedom is futile, however, and ${he2} is soon overwhelmed by your guards and dragged back to your office for punishment. It will take some times before the valiant princes submits to life as a slave.`;
		}

		function ladiesArrive() {
			const arrivalText = (V.pedoMode
				? `You're faced with a little knot of profoundly frightened but defiant girls. Ripped suddenly from their families and lives of luxury, they have no idea how to face their new circumstances.`
				: `Though they still retain much of their aristocratic arrogance, they each submit to biometric scanning with relative obedience. It seems likely that their obedience is borne out of a delusional rationalization that enslavement by one wealthy master is better than enslavement by the unwashed masses they once lorded over.`
			);
			return arrivalText;
		}
	}
};

repo_name: Nithhogg/fc

license: mit