code:
App.Events.RERelativeRecruiter = class RERelativeRecruiter extends App.Events.BaseEvent {
	eventPrerequisites() {
		return []; // always valid if sufficient actors can be cast successfully
	}

	actorPrerequisites() {
		return [
			[ // first actor - recruiter
				s => s.fetish !== "mindbroken",
				s => s.fuckdoll === 0,
				s => s.devotion > 50,
				canWalk, /* TODO: not sure why this requirement exists */
				s => s.canRecruit === 1 && (totalRelatives(s) === 0 || V.limitFamilies !== 1),
				s => this._chooseTargetRelative(s)
			]
		];
	}

	/** pick a target relative and store it in the event parameters
	 * @param {App.Entity.SlaveState} slave who's doing the recruiting (should be first actor)
	 * @returns {boolean} success or failure
	 */
	_chooseTargetRelative(slave) {
		// make sure the slave has a genepool entry (everyone should)
		const gp = V.genePool.find(s => s.ID === slave.ID);
		if (!gp) {
			console.log(`Slave with ID ${slave.ID} is missing her genepool entry.`);
			slave.canRecruit = 0;
			return false;
		}
		const choices = this._getTargetRelativeChoices(slave);
		if (choices.length === 0) {
			slave.canRecruit = 0; // slave has exhausted possible relatives, can't recruit any longer
			return false;
		}
		this.params.relative = choices.random();
		return true;
	}

	/** find all eligible target relatives for a slave; one will be selected randomly (or by cheating)
	 * @param {App.Entity.SlaveState} slave who's doing the recruiting (should be first actor)
	 * @returns {string[]}
	 */
	_getTargetRelativeChoices(slave) {
		let recruit = [];

		const pushWeight = (value, weight=1) => recruit.push(...Array(weight).fill(value));

		if (slave.mother === 0 && slave.actualAge < 24 && V.seeDicks !== 100) {
			pushWeight("mother", 3);
		}
		if (slave.father === 0 && slave.actualAge < 24 && V.seeDicks !== 0) {
			pushWeight("father");
		}

		// TODO: age/fertility/virginity/potency should probably be checking genepool, not current state, since the child would have been born before the event slave was in your possession
		if (slave.daughters < 3 && (slave.actualAge > V.minimumSlaveAge + V.fertilityAge) && isFertile(slave) && slave.trueVirgin !== 1) {
			if (V.seeDicks !== 100) {
				pushWeight("daughter", 2);
			}
			if (V.seeDicks !== 0) {
				pushWeight("son");
			}
		} else if (slave.daughters < 3 && (slave.actualAge > V.minimumSlaveAge + V.potencyAge) && slave.balls > 0) {
			if (V.seeDicks !== 100) {
				pushWeight("daughter", 2);
			}
			if (V.seeDicks !== 0) {
				pushWeight("son");
			}
		}

		if (slave.sisters < 3) {
			if (slave.actualAge < V.retirementAge - 2) {
				if (V.seeDicks !== 100) {
					pushWeight("older sister", 2);
				}
				if (V.seeDicks !== 0) {
					pushWeight("older brother", 2);
				}
			}
			if (slave.actualAge > V.minimumSlaveAge + 1) {
				if (V.seeDicks !== 100) {
					pushWeight("younger sister", 2);
				}
				if (V.seeDicks !== 0) {
					pushWeight("younger brother", 2);
				}
			}
			pushWeight("twin");
		}

		return recruit;
	}

	/** returns a description for a given background
	 * @param {App.Entity.SlaveState} slave (relative)
	 * @param {string} background
	 * @returns {string} description
	 */
	_getBackgroundDescription(slave, background) {
		const {His, he, his} = getPronouns(slave);
		const backgroundDescriptions = {
			"prostitute": `${he} was used as a prostitute by ${his} previous owner`,
			"shemale prostitute": `${he} was used as a shemale prostitute by ${his} previous owner`,
			"bed MILF": `${he} was used as a bed slave by ${his} MILF-loving owner`,
			"gelded servant": `${he} was gelded and used as a house servant`,
			"sex toy": `${he} was kept as a personal sex toy by ${his} previous owner`,
			"flat toy": `${he} was kept as a bedslave by an owner that loves flat chests`,
			"bimbo toy": `${he} was kept as a personal toy by ${his} bimbo-loving owner`,
		};
		if (backgroundDescriptions[background]) {
			return `${His} listing states that ${backgroundDescriptions[background]}.`;
		}
		return ``; // twin, for example, has no specific background
	}

	/** returns the possible backgrounds for a given relative type; one will be selected randomly (or by cheating)
	 * Currently super simple (returns exactly one element) to emulate the old twine event, but may easily be expanded if more backgrounds are written
	 * @param {string} relative
	 * @returns {string[]}
	 */
	_getRelativeBackgrounds(relative) {
		let bgs = [];
		const pushWeight = (value, weight=1) => bgs.push(...Array(weight).fill(value));

		if (relative === "daughter") {
			pushWeight("prostitute");
		} else if (relative === "son") {
			pushWeight("shemale prostitute");
		} else if (relative === "mother") {
			pushWeight("bed MILF");
		} else if (relative === "father") {
			pushWeight("gelded servant");
		} else if (relative === "older sister" || relative === "older brother") {
			pushWeight("sex toy");
		} else if (relative === "younger sister") {
			pushWeight("flat toy");
		} else if (relative === "younger brother") {
			pushWeight("bimbo toy");
		} else if (relative === "twin") {
			pushWeight("twin");
		}
		return bgs;
	}

	execute(node) {
		const [eventSlave] = this.actors.map(a => getSlave(a));
		const {He, he, his} = getPronouns(eventSlave);
		let newSlave;

		V.nextLink = "RIE Eligibility Check";

		let artDiv = document.createElement("div"); // named container so we can replace it later
		App.Events.drawEventArt(artDiv, eventSlave);
		node.appendChild(artDiv);

		// re-choose the relative (a valid one was assigned during her casting, but the last slave to go through casting might not have been the one selected)
		this._chooseTargetRelative(eventSlave);
		// pick a random background for the selected relative
		this.params.background = this._getRelativeBackgrounds(this.params.relative).random();

		let _this = this; // fuck javascript's half-assed classes
		let cost = 0; // will be filled out later

		let cheatDiv = App.UI.DOM.makeElement("div", (V.cheatMode === 1) ? cheatModeSelectors() : '');
		node.appendChild(cheatDiv);

		let eventTextDiv = App.UI.DOM.makeElement("div", eventText());
		node.appendChild(eventTextDiv);

		/** produce the event text and response links.  might be regenerated by changing slave selection in cheat mode
		 * @returns {DocumentFragment}
		 */
		function eventText() {
			let frag = document.createDocumentFragment();

			newSlave = makeSlave();
			cost = slaveCost(newSlave);
			const {He: He2, him: him2, his: his2, he: he2, daughter: daughter2, sister: sister2} = getPronouns(newSlave);

			const {title: Master} = getEnunciation(eventSlave);

			let t = [];
			t.push(App.UI.DOM.slaveDescriptionDialog(eventSlave));
			t.push(`requests an interview with you. ${He}'s a devoted slave, and you grant it, and are happy you did when you see the troubled expression on ${his} face. ${He} explains`);
			if (!canTalk(eventSlave)) {
				t.push("with desperate gestures");
			}
			t.push(`that`);
			switch (_this.params.relative) {
				case "daughter":
				case "son":
					t.push(`${he} had a ${daughter2}, who was sent to the slave orphanages. ${He}'s heard a rumor through other slaves that ${his} ${daughter2} will go up for sale soon.`);
					break;
				case "mother":
				case "father":
					t.push(`${his} ${_this.params.relative} might be getting sold soon. ${He2} has been a slave for some time. ${He}'s heard a rumor through other slaves that ${his} ${_this.params.relative} will go up for sale soon.`);
					break;
				case "older sister":
				case "older brother":
					t.push(`${his} older ${sister2} is being sold. ${He2} was likely to be enslaved the last ${eventSlave.slaveName} knew of ${him2}, and now ${he}'s heard a rumor through other slaves that ${his} big ${sister2} is going to be sold to a new owner.`);
					break;
				case "younger sister":
				case "younger brother":
					t.push(`${his} younger ${sister2} is being sold. ${He2} was likely to be enslaved the last ${eventSlave.slaveName} knew of ${him2}, and now ${he}'s heard a rumor through other slaves that ${his} little ${sister2} is going to be sold to a new owner.`);
					break;
				case "twin":
					t.push(`${he} has a twin ${sister2}, who was still free the last ${eventSlave.slaveName} knew of ${him2}. ${He}'s heard a rumor through other slaves that ${his} twin has finally been enslaved, and will soon go up for sale.`);
					break;
				default:
					throw `Unknown relative type: ${_this.params.relative}`;
			}

			if (!canTalk(eventSlave)) {
				t.push(`${He} urgently gestures for permission to write. It's unusual, but ${he} seems quite serious, so you grant it. ${He} writes,`);
			}
			t.push(Spoken(eventSlave, `"You've been so good to me, ${Master}. I'm sure ${he2} looks like I did when you bought me. Please, ${Master}, will you buy ${newSlave.slaveName} like you bought me? I'm afraid ${he2}'ll go to a cruel master."`));
			t.push(`${He} bites ${his} lip.`);
			t.push(Spoken(eventSlave, `"And, ${Master}, I'm sure ${he2}'d learn to love`));

			if (eventSlave.fetish === "cumslut") {
				t.push(Spoken(eventSlave, `the taste of your cum`));
			} else if (eventSlave.fetish === "submissive") {
				t.push(Spoken(eventSlave, `submission`));
			} else if (eventSlave.fetish === "humiliation") {
				t.push(Spoken(eventSlave, `being treated like a dirty slut`));
			} else if (eventSlave.fetish === "buttslut") {
				t.push(Spoken(eventSlave, `the feeling of your cock in ${his2} butt`));
			} else if (eventSlave.fetish === "sadist") {
				t.push(Spoken(eventSlave, `hurting your other slaves`));
			} else if (eventSlave.fetish === "pregnancy" && newSlave.genes !== "XY") {
				t.push(Spoken(eventSlave, `being pregnant`));
			} else if (eventSlave.fetish === "masochist") {
				t.push(Spoken(eventSlave, `being beaten`));
			} else if (eventSlave.fetish === "dom") {
				t.push(Spoken(eventSlave, `fucking your other slaves`));
			} else if (eventSlave.energy > 95) {
				t.push(Spoken(eventSlave, `being a good nympho slut`));
			} else if (eventSlave.addict > 2) {
				t.push(Spoken(eventSlave, `being a druggie whore`));
			} else if (eventSlave.counter.birthsTotal > 3 && newSlave.genes !== "XY") {
				t.push(Spoken(eventSlave, `bearing children`));
			} else if (eventSlave.bellyPreg >= 50 && eventSlave.pregKnown === 1 && newSlave.genes !== "XY") {
				t.push(Spoken(eventSlave, `swelling with life`));
			} else if (eventSlave.anus > 2) {
				t.push(Spoken(eventSlave, `getting ${his2} butt stretched out`));
			} else if (eventSlave.boobsImplant > 500) {
				t.push(Spoken(eventSlave, `getting turned into a bimbo slut`));
			} else {
				t.push(Spoken(eventSlave, `the feeling of your cock in ${him2}`)); /* TODO: assumes PC has cock!? */
			}
			t.push(Spoken(eventSlave, `as much as I do.`));

			if (eventSlave.fetish === "cumslut") {
				t.push(Spoken(eventSlave, `We could blow you at the same time, ${Master}! And share cum!"`));
			} else if (eventSlave.fetish === "submissive") {
				t.push(Spoken(eventSlave, `You could use us together, ${Master}!"`));
			} else if (eventSlave.fetish === "humiliation") {
				t.push(Spoken(eventSlave, `You could make us fuck each other in public, ${Master}!"`));
			} else if (eventSlave.fetish === "buttslut") {
				t.push(Spoken(eventSlave, `You could fuck our butts right next to each other, ${Master}!"`));
			} else if (eventSlave.fetish === "pregnancy" && newSlave.genes !== "XY") {
				t.push(Spoken(eventSlave, `You could knock us up next to each other, ${Master}!"`));
			} else if (eventSlave.fetish === "sadist") {
				t.push(Spoken(eventSlave, `I'm sure ${he2}'d love to help me, ${Master}!"`));
			} else if (eventSlave.fetish === "masochist") {
				t.push(Spoken(eventSlave, `You could whip us both, ${Master}!"`));
			} else if (eventSlave.fetish === "dom") {
				t.push(Spoken(eventSlave, `I'm sure ${he2}'d love to help me use other slaves, ${Master}!"`));
			} else if (eventSlave.energy > 95) {
				t.push(Spoken(eventSlave, `I'm sure ${he2}'d love to have threesomes, ${Master}!"`));
			} else if (eventSlave.counter.birthsTotal > 3 && newSlave.genes !== "XY") {
				if (V.PC.dick !== 0) {
					t.push(Spoken(eventSlave, `We could compete over who carried more of your children, ${Master}!"`));
				} else {
					t.push(Spoken(eventSlave, `We could compete over who carried more children for you, ${Master}!"`));
				}
			} else if (eventSlave.bellyPreg >= 50 && eventSlave.pregKnown === 1 && newSlave.genes !== "XY") {
				t.push(Spoken(eventSlave, `You could compare how big our bellies are next to each other, ${Master}!"`));
			} else {
				t.push(Spoken(eventSlave, `You could fuck us together, ${Master}!"`));
			}

			t.push(`${He} waits anxiously for your decision.`);
			App.Events.addParagraph(frag, t);

			t = [];
			t.push(`You look up the ${_this.params.relative}. ${He2} costs ${cashFormat(cost)}, a bargain, but you won't be able to inspect ${him2} beyond ${his2} likely resemblance to ${eventSlave.slaveName}.`);
			t.push(_this._getBackgroundDescription(newSlave, _this.params.background));
			App.Events.addParagraph(frag, t);

			App.Events.addResponses(frag, [
				new App.Events.Result(`Buy ${him2}`, buySlave),
			]);

			return frag;
		}

		/** fill in the relationship/background selectors for cheat mode
		 * @returns {DocumentFragment}
		 */
		function cheatModeSelectors() {
			const refreshCallback = (effect) => { effect(); $(cheatDiv).empty().append(cheatModeSelectors); $(eventTextDiv).empty().append(eventText); };

			let relativeTypeLinks = _.uniq(_this._getTargetRelativeChoices(getSlave(_this.actors[0]))).map((choice) =>
				App.UI.DOM.link(choice, refreshCallback, [() => { _this.params.relative = choice; _this.params.background = _this._getRelativeBackgrounds(choice).random(); }])
			);
			let backgroundTypeLinks = _.uniq(_this._getRelativeBackgrounds(_this.params.relative)).map((choice) =>
				App.UI.DOM.link(choice, refreshCallback, [() => { _this.params.background = choice; }])
			);

			let frag = document.createDocumentFragment();
			$(frag).append(
				`Relative Type: <strong>${_this.params.relative}</strong> `, App.UI.DOM.generateLinksStrip(relativeTypeLinks),
				"<br>",
				`Background: <strong>${_this.params.background}</strong> `, App.UI.DOM.generateLinksStrip(backgroundTypeLinks)
			);
			return frag;
		}

		/** make the target relative slave
		 * @returns {App.Entity.SlaveState}
		 */
		function makeSlave() {
			/** @param {App.Entity.SlaveState} slave */
			function clearMods(slave) {
				slave.ageImplant = 0;
				slave.boobsImplant = 0;
				slave.boobsImplantType = "none";
				slave.buttImplant = 0;
				slave.buttImplantType = "none";
				slave.earImplant = 0;
				slave.faceImplant = 0;
				slave.hipsImplant = 0;
				slave.lipsImplant = 0;
				slave.shouldersImplant = 0;
				slave.voiceImplant = 0;
				slave.areolaePiercing = 0;
				slave.anusPiercing = 0;
				slave.clitPiercing = 0;
				slave.corsetPiercing = 0;
				slave.dickPiercing = 0;
				slave.earPiercing = 0;
				slave.eyebrowPiercing = 0;
				slave.lipsPiercing = 0;
				slave.navelPiercing = 0;
				slave.nipplesPiercing = 0;
				slave.nosePiercing = 0;
				slave.tonguePiercing = 0;
				slave.vaginaPiercing = 0;
				slave.anusTat = 0;
				slave.armsTat = 0;
				slave.backTat = 0;
				slave.bellyTat = 0;
				slave.boobsTat = 0;
				slave.buttTat = 0;
				slave.dickTat = 0;
				slave.lipsTat = 0;
				slave.legsTat = 0;
				slave.shouldersTat = 0;
				slave.stampTat = 0;
				slave.vaginaTat = 0;
				if (slave.nipples === "fuckable") {
					slave.nipples = either("cute", "inverted", "partially inverted", "puffy");
				}
			}

			function relativeOrigin() {
				switch (_this.params.relative) {
					case "mother":
					case "father":
						return "$He was recruited into your service by $his child.";
					case "son":
					case "daughter":
						return "$He was recruited into your service by $his parent.";
					case "younger brother":
					case "younger sister":
						return "$He was recruited into your service by $his older sibling.";
					case "older brother":
					case "older sister":
						return "$He was recruited into your service by $his younger sibling.";
					case "twin":
						return "$He was recruited into your service by $his twin.";
				}
				throw `Unknown relative type: ${_this.params.relative}`;
			}

			/** @param {App.Entity.SlaveState} slave */
			function applyBackground(slave) {
				function applyProstitute() { // assumes XX
					slave.boobsImplant = 600;
					slave.boobsImplantType = "normal";
					slave.boobs += slave.boobsImplant;
					slave.skill.oral += random(30, 50);
					slave.skill.vaginal += random(30, 50);
					slave.skill.anal += random(30, 50);
					slave.skill.entertainment += random(0, 20);
					slave.skill.whoring += random(30, 50);
					slave.nipplesPiercing = 1;
					slave.lipsPiercing = 1;
					slave.tonguePiercing = 1;
					slave.vaginaPiercing = 1;
					slave.earPiercing = 1;
					slave.makeup = 1;
					slave.nails = 4;
					slave.hStyle = either("luxurious", "neat", "tails", "up");
					slave.stampTat = "advertisements";
				}

				function applyShemaleWhore() { // assumes XY
					slave.vagina = random(1, 2);
					slave.boobsImplant = 600;
					slave.boobsImplantType = "normal";
					slave.boobs += slave.boobsImplant;
					slave.skill.oral += random(30, 50);
					slave.skill.vaginal += random(30, 50);
					slave.skill.anal += random(30, 50);
					slave.skill.entertainment += random(0, 20);
					slave.skill.whoring += random(30, 50);
					slave.lips = random(60, 90);
					slave.lipsImplant = 40;
					slave.lipsPiercing = 1;
					slave.tonguePiercing = 1;
					slave.vaginaPiercing = 1;
					slave.earPiercing = 1;
					slave.makeup = 1;
					slave.nails = 4;
					slave.hStyle = "tails";
					slave.stampTat = "advertisements";
				}

				function applyBedMILF() { // assumes XX
					slave.anus = 1;
					slave.vagina = 3;
					if (V.seePreg !== 0) {
						slave.preg = random(5, 39);
						slave.pregType = 1;
						slave.pregKnown = 1;
						slave.pregSource = 0;
						slave.pregWeek = slave.preg;
						SetBellySize(slave);
					}
					slave.weight = random(30, 135);
					slave.muscles = random(0, 15);
					slave.skill.oral = 15;
					slave.skill.vaginal = 30;
					slave.skill.anal = 15;
					slave.skill.entertainment = 10;
					slave.skill.whoring = 10;
					slave.boobs = (random(12, 20)*100);
					slave.butt = random(4, 6);
					slave.boobShape = "saggy";
					slave.lactation = 1;
					slave.lactationDuration = 2;
					slave.markings = "birthmark";
					slave.hLength = random(50, 100);
					slave.hStyle = either("bun", "luxurious", "neat", "up");
					slave.voice = 2;
					slave.counter.birthsTotal = 5;
					slave.bellySag = 4;
					slave.bellySagPreg = 4;
					slave.energy = 65;
					slave.bellyTat = "a heart";
				}

				function applyGeldedServant() { // assumes XY
					slave.anus = 2;
					slave.weight = random(70, 180);
					slave.skill.oral = 35;
					slave.skill.anal = 75;
					slave.hLength = random(10, 20);
					slave.hStyle = either("buzzcut", "long", "neat", "trimmed");
					slave.voice = 1;
					slave.energy = 0;
					slave.balls = 0;
				}

				function applySexToy() { // either sex
					slave.tonguePiercing = 1;
					slave.makeup = 1;
					if (slave.balls < 4 && slave.balls > 0) {
						slave.balls = 4;
						slave.scrotum = slave.balls;
					}
					if (slave.dick < 5 && slave.dick > 0) {
						slave.dick = 5;
					}
					if (slave.vagina > -1) {
						slave.vagina = 2;
					}
				}

				function applyFlatToy() { // either sex
					slave.boobs = Math.min(slave.boobs, (random(1, 4)*100));
					slave.butt = random(1, 2);
					slave.hips = random(-2, 0);
					slave.shoulders = random(-2, 0);
					slave.skill.entertainment += random(0, 20);
					if (slave.vagina > -1) {
						slave.anus = 0;
						slave.vagina = 1;
					} else {
						slave.anus = 1;
					}
				}

				function applyBimboToy() { // either sex
					slave.boobsImplant = (random(20, 40)*100);
					slave.boobsImplantType = "string";
					slave.boobs += slave.boobsImplant;
					slave.buttImplant = random(5, 7);
					slave.buttImplantType = "string";
					slave.butt += slave.buttImplant;
					slave.lipsImplant = random(60, 80);
					slave.lips = Math.clamp(slave.lips + slave.lipsImplant, 0, 100);
					slave.nipplesPiercing = 2;
					if (slave.vagina > -1) {
						slave.vagina = 3;
					}
					slave.anus = 3;
					slave.makeup = 3;
					slave.nails = 5;
					slave.skill.anal = 70;
					slave.skill.oral = 70;
					slave.skill.whoring = 100;
					slave.energy = 100;
					slave.skill.entertainment += random(0, 20);
				}

				function applyTwin() {
					// no changes for this case
				}

				const backgroundDispatch = {
					"prostitute": applyProstitute,
					"shemale prostitute": applyShemaleWhore,
					"bed MILF": applyBedMILF,
					"gelded servant": applyGeldedServant,
					"sex toy": applySexToy,
					"flat toy": applyFlatToy,
					"bimbo toy": applyBimboToy,
					"twin": applyTwin
				};
				backgroundDispatch[_this.params.background]();
			}

			/** @param {App.Entity.SlaveState} slave */
			function applyCommon(slave) {
				slave.devotion = random(25, 45);
				slave.trust = random(-15, 15);
				slave.oldDevotion = slave.devotion;
				slave.oldTrust = slave.trust;
				configureLimbs(slave, "all", 1, true);
				slave.career = "a slave";
				setHealth(slave, jsRandom(20, 40));
				slave.skill.combat = 0;
				slave.addict = 0;
				slave.chem = 0;
				slave.weekAcquired = V.week;
				randomizeAttraction(slave); // already randomized by generateRelatedSlave, but energy might have changed, so do it again
			}

			/** @param {App.Entity.SlaveState} slave - record cloned from genepool */
			function updateGPRecordAgeFromEventSlave(slave) {
				// recruitable slave is carrying cloned age data from the original recruitment (since genepool records don't age)
				// we need to update the age based on the "live" copy of the event slave, otherwise we won't get age gaps right
				const elapsedSinceRecruitment = eventSlave.actualAge - slave.actualAge;
				for (let i = 0; i < elapsedSinceRecruitment; ++i) {
					ageSlave(slave);
				}

				// copy updated birthweek (really "weeks until birthday") too, so birthdays and twins work right
				slave.birthWeek = eventSlave.birthWeek;
			}

			const origSlave = BaseSlave();
			const genepoolRec = V.genePool.find(s => s.ID === _this.actors[0]);
			App.Entity.Utils.GenePoolRecordCleanup(genepoolRec);
			Object.assign(origSlave, genepoolRec);
			updateGPRecordAgeFromEventSlave(origSlave);

			const newSlave = generateRelatedSlave(origSlave, _this.params.relative);
			clearMods(newSlave);
			newSlave.origin = relativeOrigin();
			applyBackground(newSlave);
			if (_this.params.relative === "mother") {
				newSlave.counter.birthsTotal += V.slaves.reduce((acc, cur) => acc + (sameDad(eventSlave, cur) ? 1 : 0), 0);
			}
			applyCommon(newSlave);
			return newSlave;
		}

		/** we need to record any new parent information for existing slaves into the genepool as well as directly into the slave in question
		 * @param {App.Entity.SlaveState} slave
		 * @param {object} parentIDs
		 * @param {number} [parentIDs.mother]
		 * @param {number} [parentIDs.father]
		 */
		function setUnknownParents(slave, parentIDs = {}) {
			const gp = V.genePool.find(s => s.ID === slave.ID);

			if (parentIDs.mother && slave.mother === 0) {
				slave.mother = parentIDs.mother;
				if (gp) {
					gp.mother = parentIDs.mother;
				}
			}
			if (parentIDs.father && slave.father === 0) {
				slave.father = parentIDs.father;
				if (gp) {
					gp.father = parentIDs.father;
				}
			}
		}

		function buySlave() {
			// kill the cheat div (no going back now!)
			$(cheatDiv).empty();

			// the new slave is already set up to be related to the existing slave, but we're responsible for making sure the existing slave (and any others in our stable) gets *their* relatives set correctly
			switch (_this.params.relative) {
				case "mother": {
					setUnknownParents(eventSlave, {mother: newSlave.ID} );
					for (const slave of V.slaves) {
						if (sameDad(eventSlave, slave)) {
							setUnknownParents(slave, {mother: newSlave.ID} );
						}
					}
					break;
				}
				case "father": {
					setUnknownParents(eventSlave, {father: newSlave.ID} );
					for (const slave of V.slaves) {
						if (sameMom(eventSlave, slave)) {
							setUnknownParents(slave, {father: newSlave.ID} );
						}
					}
					break;
				}
				case "older sister":
				case "younger sister":
				case "older brother":
				case "younger brother":
				case "twin": { // siblings
					if (eventSlave.father === 0 && eventSlave.mother === 0) {
						setMissingParents(eventSlave);
						setUnknownParents(newSlave, {mother: eventSlave.mother, father: eventSlave.father});
					} else if (eventSlave.father === 0) {
						setMissingParents(eventSlave);
						setUnknownParents(newSlave, {father: eventSlave.father});
						for (const slave of V.slaves) {
							if (sameMom(eventSlave, slave)) {
								setUnknownParents(slave, {father: eventSlave.father});
							}
						}
					} else if (eventSlave.mother === 0) {
						setMissingParents(eventSlave);
						setUnknownParents(newSlave, {mother: eventSlave.mother});
						for (const slave of V.slaves) {
							if (sameDad(eventSlave, slave)) {
								setUnknownParents(slave, {mother: eventSlave.mother});
							}
						}
					}
					break;
				}
				default: // nothing needed for son/daughter
			}

			cashX(forceNeg(cost), "slaveTransfer", newSlave);

			// replace slave art
			$(artDiv).empty();
			App.Events.drawEventArt(artDiv, [newSlave, eventSlave]);

			const {he: he2} = getPronouns(newSlave);

			let elements = [];
			elements.push(`You complete the legalities and biometric scanning quickly and without fuss. ${newSlave.slaveName} arrives shortly. The two slaves remember each other only dimly — they parted a long time ago — but they embrace. The devoted ${SlaveTitle(eventSlave)} explains the situation and encourages ${his} ${_this.params.relative} to be a good slave to you. ${newSlave.slaveName} looks a little fearful but clearly realizes that ${he2}'s lucky to be here.`);

			elements.push(App.UI.newSlaveIntro(newSlave, eventSlave));

			return elements;
		}
	}
};


code:
:: RE snatch and grab followup [nobr]

<<set $nextButton = "Continue", $nextLink = "AS Dump", $returnTo = "RIE Eligibility Check", $eventResults.snatch = 2>>

<<set _slave = $activeSlave = $eventSlave>>
<<setLocalPronouns _slave>>

<<set _clothesTemp = _slave.clothes, _slave.clothes = "no clothing">>

	<<if $seeImages == 1>>

				<<= SlaveArt(_slave, 2, 0)>>

	<</if>>

<<set _slave.clothes = _clothesTemp>>

<<= App.UI.slaveDescriptionDialog(_slave)>> is next on your inspection schedule this morning, and you've finished with the previous slave more quickly than expected, so you find yourself thinking about the circumstances of $his acquisition.

The laboratory $he was recovered from was performing illegal genetic experiments...something with which you now also have some personal experience. It occurs to you that there might be something interesting left unexplored in $his genome, so when $he arrives, you inform $him that you're going to the surgery together.
<<if _slave.trust < 50>>
	Worried, $he <<if !canTalk(_slave)>>wordlessly<</if>> asks whether something is wrong, and you fill $him in on your thoughts.
<<else>>
	Although $he immediately and unquestioningly complies, you occupy a few free moments to fill $him in on your thoughts.
<</if>>
<<if _slave.behavioralFlaw === "odd">>
	$He has always acted a bit odd, and today $he is pretending to play an air harmonica as you <<if canWalk(_slave)>>walk<<else>>travel<</if>> together.
<<elseif _slave.behavioralQuirk === "funny">>
	$He acted quite odd when you first acquired $him, but <<if canWalk(_slave)>>walking<<else>>traveling<</if>> with $him now, you find that $he's actually very funny.
<<else>>
	$He acted quite odd when you first acquired $him, but you note with some pride that $he has learned to behave more normally during $his time with you.
<</if>>

After spending some time prowling around $his genome in your genetic sequencer, you find one particularly interesting sequence. $He has a unique sequence of genes in a chromosomal region which significantly increases $his cognitive ability, but it's only partially activated. You could, with a little bit of time, either completely activate it, or deactivate it entirely, with corresponding dramatic effects on $his intelligence. However, such therapy is not free, and the remote surgery software warns that rapid changes to cognition may cause significant changes in behavior.

	<<link "Finish activating the sequence">>
		<<run cashX(forceNeg($surgeryCost*4), "slaveSurgery", _slave), surgeryDamage(_slave,40), _slave.chem += 100, _slave.intelligence += Math.min(25, 100-_slave.intelligence)>>
		<<replace "#result">>

The procedure spans the week, with $him spending every other day in the surgery room for a series of four sets of injections. A few hours after each session, $he feels terribly ill. The process involves <<if ($PC.skill.medicine >= 100)>>you<<else>>the remote surgeon<</if>> injecting the serum across $his entire body, every few <<if $showInches == 2>>inches<<else>>centimeters<</if>>, leaving small needle marks that fade out within minutes. Despite not leaving lasting evidence, the process is very invasive work, and leaves $him feeling weak and tired. Gradually, though, you begin to notice a marked increase in $his cognitive function.

			<<if _slave.behavioralQuirk === "none">>
				<<if _slave.behavioralFlaw === "odd">>
					<<set _slave.behavioralFlaw = "none">>
				<</if>>
				<<set _slave.behavioralQuirk = "funny">>

Over the next few weeks, you also begin to notice some significant changes in behavior. _slave.slaveName is now funny.

			<<elseif _slave.sexualQuirk === "none">>
				<<if _slave.sexualFlaw === "repressed">>
					<<set _slave.sexualFlaw = "none">>
				<</if>>
				<<set _slave.sexualQuirk = "perverted">>

Over the next few weeks, you also begin to notice some significant changes in behavior. Although _slave.slaveName has always been remarkably horny, $he has become much more perverted.

			<</if>>
		<</replace>>
	<</link>> //This will cost <<= cashFormat($surgeryCost*4)>>//

	<<link "Completely deactivate the sequence">>
		<<run cashX(forceNeg($surgeryCost*4), "slaveSurgery", _slave), surgeryDamage(_slave,40), _slave.chem += 100, _slave.intelligence -= Math.min(25, 100+_slave.intelligence)>>
		<<replace "#result">>

The procedure spans the week, with $him spending every other day in the surgery room for a series of four sets of injections. A few hours after each session, $he feels terribly ill. The process involves <<if ($PC.skill.medicine >= 100)>>you<<else>>the remote surgeon<</if>> injecting the serum across $his entire body, every few <<if $showInches == 2>>inches<<else>>centimeters<</if>>, leaving small needle marks that fade out within minutes. Despite not leaving lasting evidence, the process is very invasive work, and leaves $him feeling weak and tired. Gradually, though, you begin to notice a marked decline in $his cognitive function.

			<<if _slave.behavioralQuirk === "none">>
				<<if _slave.behavioralFlaw === "odd">>
					<<set _slave.behavioralFlaw = "none">>
				<</if>>
				<<set _slave.behavioralQuirk = "funny">>

Over the next few weeks, you also begin to notice some significant changes in behavior. _slave.slaveName is now funny.

			<<elseif _slave.sexualQuirk === "none">>
				<<if _slave.sexualFlaw === "repressed">>
					<<set _slave.sexualFlaw = "none">>
				<</if>>
				<<set _slave.sexualQuirk = "perverted">>

Over the next few weeks, you also begin to notice some significant changes in behavior. Although _slave.slaveName has always been remarkably horny, $he has become much more perverted.

			<</if>>
		<</replace>>
	<</link>> //This will cost <<= cashFormat($surgeryCost*4)>>//

	<<link "Let it be">>
		<<replace "#result">>

You file your findings, and within a few days, both you and _slave.slaveName have forgotten all about them.

		<</replace>>
	<</link>>

repo_name: Welptard/fc

license: mit


code:
App.Events.REStaffedMorning = class REStaffedMorning extends App.Events.BaseEvent {
	eventPrerequisites() {
		return [
			() => V.fuckSlaves >= 4,
		];
	}

	actorPrerequisites() {
		const req = [
			s => s.devotion > 50,
			s => s.fuckdoll === 0,
			s => ["please you", "serve in the master suite", "be your Concubine"].includes(s.assignment),
			s => s.rules.release.master === 1,
			canMove,
			hasAllLimbs,
		];

		return [
			req,
			req,
			req,
			req,
		];
	}

	execute(node) {
		let bedSlaves = this.actors.map(getSlave);

		const {
			He, he, his, him, girl
		} = getPronouns(bedSlaves[0]);

		const {
			He2, his2, him2, girl2
		} = getPronouns(bedSlaves[1]).appendSuffix('2');

		const {
			He3, he3, his3, him3, girl3
		} = getPronouns(bedSlaves[2]).appendSuffix('3');

		const {
			He4, his4, him4, himself4
		} = getPronouns(bedSlaves[3]).appendSuffix('4');
		let playerPronouns = getPronouns(V.PC);

		V.nextLink = "RIE Eligibility Check";

		App.Events.drawEventArt(node, bedSlaves.slice(0, 2), "no clothing");

		let t = [
			`Sleep leaves you quickly one morning to the sensation of two of your fucktoys performing human alarm clock duty. You open your eyes and look down: it's ${bedSlaves[0].slaveName} and ${contextualIntro(bedSlaves[0], bedSlaves[1])} today.`
		];

		if (V.PC.dick !== 0) {
			t.push(`${bedSlaves[0].slaveName} is ${(bedSlaves[0].fetish === "cumslut") ? "rapturously" : "industriously"} sucking your dick as it rapidly hardens in ${his} `);
			if (V.PC.vagina !== -1) {
				 t.push(`mouth, occasionally letting it pop free so ${he} can run ${his} tongue up and down your cunt.`);
			} else {
				 t.push(`mouth.`);
			}
			t.push(`Meanwhile, ${bedSlaves[1].slaveName} is ${(bedSlaves[1].fetish === "cumslut") ? "hungrily" : "gently"} sucking your nuts.`);
			t.push(`The two slaves have crowded close together, and not just so they can both have access to your cock and balls. They're`);
			if (((canAchieveErection(bedSlaves[0]) && bedSlaves[0].chastityPenis === 0) || bedSlaves[0].clit > 3) && ((canAchieveErection(bedSlaves[1]) && bedSlaves[1].chastityPenis === 0) || bedSlaves[1].clit > 3)) {
				t.push(`jerking each other off`);
			} else {
				t.push(`manually stimulating each other`);
			}
			t.push(`as they work.`);
		} else {
			t.push(`An absolutely wonderful mélange of sensations rises to meet you. Each slave is gently sucking one of your hardening nipples, and one hand from each slave is moving delicately across your womanhood, kindling a fire in your lower `);
			if (V.PC.preg > 0 && V.PC.pregData.normalBirth / 1.75) {
				 t.push(`belly and exciting the occupant${V.PC.pregType > 1 ? "s" : ""} in your womb.`);
			} else {
				 t.push(`belly.`);
			}
			t.push(`They're cuddled up closely under your arms, with a warm body pressed against each side of you. You can feel`);
			if (bedSlaves[0].belly + bedSlaves[1].belly >= 10000 && bedSlaves[0].belly > 4000) {
				t.push(`their swollen middles`);
				if (bedSlaves[0].belly + bedSlaves[1].belly >= 1000000) {
					t.push(`pushing against each other upon you`);
				} else if (bedSlaves[0].belly + bedSlaves[1].belly >= 100000) {
					t.push(`resting against you`);
				} else {
					t.push(`against your ribcage`);
				}
			} else if (bedSlaves[0].belly >= 10000) {
				t.push(`${bedSlaves[0].slaveName}'s ${bellyAdjective(bedSlaves[0])} belly`);
				if (bedSlaves[0].belly >= 100000) {
					t.push(`resting heavily on you`);
				} else {
					t.push(`against your ribcage`);
				}
			} else if (bedSlaves[1].belly >= 10000) {
				t.push(`${bedSlaves[1].slaveName}'s ${bellyAdjective(bedSlaves[1])} belly`);
				if (bedSlaves[1].belly >= 100000) {
					t.push(`resting heavily on you`);
				} else {
					t.push(`against your ribcage`);
				}
			} else if ((bedSlaves[0].boobs > 300 && bedSlaves[1].boobs > 300)) {
				t.push(`their`);
				if (bedSlaves[0].boobsImplant / bedSlaves[0].boobs >= .60 && bedSlaves[1].boobsImplant / bedSlaves[1].boobs >= .60) {
					t.push(`firm`);
				} else {
					t.push(`soft`);
				}
				t.push(`breasts`);
			} else {
				t.push(`steady breathing`);
			}
			if (canAchieveErection(bedSlaves[0]) && bedSlaves[0].chastityPenis === 0 && canAchieveErection(bedSlaves[1]) && bedSlaves[1].chastityPenis === 0) {
				t.push(`and the twin erections resting against your thighs.`);
			} else {
				t.push(`and the heat between their legs against your thighs.`);
			}
			t.push(`You feel absolutely buried in attentive slave.`);
		}

		t.push(`The bathroom door is open and the shower is running. Though the steam is beginning to fill the glass-walled shower, you can see a pair of naked bodies in there; that would be ${bedSlaves[2].slaveName} and ${contextualIntro(bedSlaves[2], bedSlaves[3])}, ready to attend you as you bathe.`);

		App.Events.addParagraph(node, t);

		App.Events.addResponses(node, [
			new App.Events.Result("Leave them satisfied", satisfied),
			new App.Events.Result("Leave them exhausted", exhausted)
		]);

		function satisfied() {
			const frag = document.createDocumentFragment();
			let sexTarget = "";
			t = [];

			if (V.PC.dick !== 0) {
				t.push(`You begin to thrust gently into ${bedSlaves[0].slaveName}'s mouth. ${girl === girl2 ? `The ${girl}` : "Your bedmate"}s moan and giggle into you at the signal that you're not going to get up right this instant, and`);
				if (((canAchieveErection(bedSlaves[0]) && bedSlaves[0].chastityPenis === 0) || bedSlaves[0].clit > 3) && ((canAchieveErection(bedSlaves[1]) && bedSlaves[1].chastityPenis === 0) || bedSlaves[1].clit > 3)) {
					 t.push(`start jerking each other off harder, making lewd noises and humping each other's hands.`);
				} else {
					 t.push(`start really exploring each other's body, jerking around lewdly as their arousal builds.`);
				}
				if (V.PC.vagina !== -1) {
					 t.push(`They always spare at least one hand for your cunt, despite your thrusting.`);
				}
				t.push(`When you climax, they do, too, one after the other. They quickly switch mouth positions and suck you back to full mast so you can enjoy your shower.`);
				seX(bedSlaves[0], "oral", V.PC, "penetrative");
				seX(bedSlaves[1], "oral", V.PC, "penetrative");
			} else {
				t.push(`You reach down and run a possessive hand across each slave's scalp, neck, and back, eliciting shivers. Then, you gently hook them under the armpits and pull them up a bit, without breaking their lip locks with your nipples, or forcing them to stop playing with your cunt. Each slave ends curled up, mostly face-down, with their mouths still sucking on your ${V.PC.boobs >= 300 ? "boobs" : "chest"} and their free hands trapped between their legs. They get the message and begin to look after themselves, too; their resultant moaning against your nipples grows when you reach down and start teasing their butts. The three of you climax more or less together, and you bounce up with undiminished arousal to enjoy your shower.`);
				seX(bedSlaves[0], "oral", V.PC, "vaginal");
				seX(bedSlaves[1], "oral", V.PC, "vaginal");
			}
			App.Events.addParagraph(frag, t);

			t = [];
			t.push(`By now, the shower is an impenetrable fog of steam. The wet, soapy bodies inside are easy to find, though. ${bedSlaves[2].slaveName} happens to be closest, so you kiss ${his3} laughing mouth`);
			if (V.PC.dick !== 0) {
				if ((canDoVaginal(bedSlaves[2]) && bedSlaves[2].vagina > 0) || (canDoAnal(bedSlaves[2]) && bedSlaves[2].anus > 0)) {
					t.push(`hard and fuck ${him3}`);
					if (bedSlaves[2].belly < 30000) {
						t.push(`with ${his3} back against the shower`);
						if (bedSlaves[2].boobs > 10000) {
							t.push(`wall, ${his3} giant soapy tits wobbling around you deliciously.`);
						} else if (bedSlaves[2].boobs > 2000) {
							t.push(`wall, ${his3} huge soapy tits sliding around deliciously.`);
						} else if (bedSlaves[2].weight > 95) {
							t.push(`wall, ${his3} plush belly sliding around delightfully against you.`);
						} else if (canAchieveErection(bedSlaves[2]) && bedSlaves[2].chastityPenis === 0) {
							t.push(`wall, ${his3} lathered up erection rubbing lasciviously between you.`);
						} else {
							t.push(`wall.`);
						}
					} else {
						t.push(`with ${his3} expansive flank against the shower`);
						if (bedSlaves[2].boobs > 2000) {
							t.push(`wall, ${his3} huge soapy tits flopping around deliciously.`);
						} else if (bedSlaves[2].weight > 95) {
							t.push(`wall, ${his3} plush belly wobbling around delightfully beneath ${him3}.`);
						} else {
							t.push(`wall.`);
						}
					}
					if (canDoVaginal(bedSlaves[2]) && bedSlaves[2].vagina > 0) {
						t.push(VCheck.Vaginal(bedSlaves[2], 1));
					} else {
						t.push(VCheck.Anal(bedSlaves[2], 1));
					}
				} else if (bedSlaves[2].weight > 95 && bedSlaves[2].belly < 1500) {
					t.push(`hard, sandwich your dick with ${his3} soft belly, and fuck ${his3} soapy, jiggly body against the shower wall.`);
					seX(bedSlaves[2], "mammary", V.PC, "penetrative");
				} else {
					t.push(`hard and, not finding anything to stick your erection into, guide ${his3} hand down to your wanting dick.`);
					seX(bedSlaves[2], "oral", V.PC, "penetrative");
				}
				t.push(`${He3} does ${his3} best to soap your front while ${he3}`);
				if ((canDoVaginal(bedSlaves[2]) && bedSlaves[2].vagina > 0) || (canDoAnal(bedSlaves[2]) && bedSlaves[2].anus > 0)) {
					t.push(`takes`);
				} else {
					t.push(`rubs`);
				}
				t.push(`cock, and ${bedSlaves[3].slaveName} washes your back${V.PC.vagina !== -1 ? ", reaching under your butt to tease your pussy" : ""}. After a short while, you let ${him3} down and seize ${bedSlaves[3].slaveName}, sliding your cock`);
				if (bedSlaves[3].vagina > 0 && canDoVaginal(bedSlaves[3])) {
					t.push(`into ${his4} willing pussy,`);
				} else if (bedSlaves[3].anus > 0 && canDoAnal(bedSlaves[3])) {
					t.push(`${bedSlaves[3].butt > 4 ? `between ${his4} huge buttocks and` : ""} up ${his4} willing ass,`);
				} else if (bedSlaves[3].butt > 4) {
					t.push(`between ${his4} huge buttocks,`);
				} else {
					t.push(`between ${his4} thighs,`);
				}
				if (canDoVaginal(bedSlaves[3]) && bedSlaves[3].vagina > 0) {
					t.push(VCheck.Vaginal(bedSlaves[3], 1));
				} else {
					t.push(VCheck.Anal(bedSlaves[3], 1));
				}
				t.push(`taking ${him4} from behind while ${bedSlaves[2].slaveName} does ${his3} best to get ${his3} wits back and take over washing duty. They towel you together, and you head back out of the bathroom.`);
			} else {
				if ((bedSlaves[2].toyHole === "dick" || V.policies.sexualOpenness === 1) && canPenetrate(bedSlaves[2]) && (V.PC.vagina > 0 || V.PC.anus > 0) && bedSlaves[2].belly + V.PC.belly < 30000) {
					sexTarget = "penetrative";
					if (V.PC.vagina > 0) {
						t.push(`hard, slip ${his2} dick into your pussy, and ride ${him3}`);
						seX(bedSlaves[2], "penetrative", V.PC, "vaginal");
						if (canImpreg(V.PC, bedSlaves[2])) {
							knockMeUp(V.PC, 5, 0, 0);
						}
					} else {
						t.push(`hard, slip ${his2} dick up your ass, and ride ${him3}`);
						seX(bedSlaves[2], "penetrative", V.PC, "anal");
						if (canImpreg(V.PC, bedSlaves[2])) {
							knockMeUp(V.PC, 5, 1, 0);
						}
					}
					t.push(`with ${his3} back against the shower`);
					if (bedSlaves[2].boobs > 10000) {
						t.push(`wall, ${his3} giant soapy tits wobbling around you deliciously.`);
					} else if (bedSlaves[2].boobs > 2000) {
						t.push(`wall, ${his3} huge soapy tits sliding around deliciously.`);
					} else if (bedSlaves[2].weight > 95) {
						t.push(`wall, ${his3} plush belly sliding around delightfully against you.`);
					} else {
						t.push(`wall.`);
					}
				} else if (canDoVaginal(bedSlaves[2])) {
					t.push(`hard and trib ${him3}`);
					if (bedSlaves[2].belly < 30000) {
						t.push(`with ${his3} back against the shower`);
						if (bedSlaves[2].boobs > 10000) {
							t.push(`wall, ${his3} giant soapy tits wobbling around you deliciously.`);
						} else if (bedSlaves[2].boobs > 2000) {
							t.push(`wall, ${his3} huge soapy tits sliding around deliciously.`);
						} else if (bedSlaves[2].weight > 95) {
							t.push(`wall, ${his3} plush belly sliding around delightfully against you.`);
						} else if (canAchieveErection(bedSlaves[2]) && bedSlaves[2].chastityPenis === 0) {
							t.push(`wall, ${his3} lathered up erection rubbing lasciviously between you.`);
						} else {
							t.push(`wall.`);
						}
					} else {
						t.push(`with ${his3} expansive flank against the shower`);
						if (bedSlaves[2].boobs > 2000) {
							t.push(`wall, ${his3} huge soapy tits flopping around deliciously.`);
						} else if (bedSlaves[2].weight > 95) {
							t.push(`wall, ${his3} plush belly wobbling around delightfully beneath ${him3}.`);
						} else {
							t.push(`wall.`);
						}
					}
					seX(bedSlaves[2], "vaginal", V.PC, "vaginal");
				} else {
					t.push(`hard and guide ${his3} hand down to your wanting pussy.`);
					seX(bedSlaves[2], "oral", V.PC, "vaginal");
				}
				t.push(`${He3} does ${his3} best to soap your front while`);
				if (sexTarget === "penetrative") {
					t.push(`fucking you`);
				} else if (canDoVaginal(bedSlaves[2])) {
					t.push(`you hump ${his3} thigh${bedSlaves[2].vagina > 0 ? " and pussy" : ""},`);
				} else {
					t.push(`teasing your pussy`);
				}
				t.push(`and ${bedSlaves[3].slaveName} washes your back. After a short while,`);
				if (sexTarget === "penetrative") {
					t.push(`${he3} comes inside you and slides out so you may`);
				} else if (canDoVaginal(bedSlaves[2])) {
					t.push(`you let ${him3} down and`);
				} else {
					t.push(`you let ${him3} stop and`);
				}
				t.push(`seize ${bedSlaves[3].slaveName}, pushing ${his4} face against the wall and`);
				if (canDoVaginal(bedSlaves[3]) || canDoAnal(bedSlaves[3])) {
					t.push(`sliding your fingers inside ${him4} while you`);
				}
				t.push(`straddle one of ${his4} legs. ${bedSlaves[2].slaveName} does ${his3} best to get ${his3} wits back and take over washing duty. They towel you together, and you head back out of the bathroom.`);
			}
			App.Events.addParagraph(frag, t);

			t = [];
			t.push(`Your clothes have been laid out, ready for ${bedSlaves[0].slaveName} and ${bedSlaves[1].slaveName} to dress you, but`);
			if (V.PC.dick !== 0) {
				t.push(`next to the neat stack of clothes, the two slaves are bent over the bed with their buttocks spread. You select ${bedSlaves[1].slaveName}`);
				if (bedSlaves[1].vagina > 0 && canDoVaginal(bedSlaves[1])) {
					t.push(`and slide your dick into ${his2} ${bedSlaves[1].vagina > 2 ? "loose pussy" : (bedSlaves[1].vagina > 1 ? "inviting pussy" : "tight pussy")}, fucking ${him2}`);
					t.push(VCheck.Vaginal(bedSlaves[1], 1));
				} else if (bedSlaves[1].anus > 0 && canDoAnal(bedSlaves[1])) {
					t.push(`and slide your dick up ${his2} ${bedSlaves[1].anus > 2 ? "welcoming asspussy" : (bedSlaves[1].anus > 1 ? "soft butthole" : "tight anus")}, sodomizing ${him2}`);
					t.push(VCheck.Anal(bedSlaves[1], 1));
				} else {
					t.push(`and turn ${him2} around before sliding your dick into ${his2} welcoming mouth`);
					seX(bedSlaves[1], "oral", V.PC, "penetrative");
				}
				t.push(`while ${bedSlaves[0].slaveName} buttons your shirt. When it's done, you push ${him} down next to ${bedSlaves[1].slaveName} and switch partners, letting ${bedSlaves[1].slaveName} up to do ${his2} best to help you into your trousers in the meantime. ${He2} gets them on and fastens everything, except the fly, of course.`);
				SimpleSexAct.Player(bedSlaves[0]);
			} else {
				t.push(`next to the neat stack of clothes, the two slaves are kneeling on the floor and looking at you with mock innocence. You select ${bedSlaves[1].slaveName} and straddle ${his2} face, letting ${him2}`);
				if (bedSlaves[1].lips > 40) {
					t.push(`use ${his2} big soft lips to`);
				}
				t.push(`eat you out while ${bedSlaves[0].slaveName}`);
				if (V.PC.career === "servant") {
					t.push(`helps you into your dress. Once ${he} straightens out your apron,`);
				} else if (V.PC.career === "escort") {
					if (V.PC.boobs >= 1400) {
						t.push(`gropes your huge breasts in a losing battle to get them to stay in your barely-there top. Once they've stopped popping out,`);
					} else if (V.PC.boobs >= 1200) {
						t.push(`spends an invigoratingly long time wrestling your big tits into your way too small top. Once they're content to stay put,`);
					} else if (V.PC.boobs >= 1000) {
						t.push(`struggles to shove your breasts into your too small top. Once they're content to stay put,`);
					} else if (V.PC.boobs >= 300) {
						t.push(`wrangles your breasts into your revealing top. Once they're situated perfectly,`);
					} else {
						t.push(`ties your skimpy top over your flat chest. Once it's situated perfectly,`);
					}
				} else {
					t.push(`helps you into your top. When you're buttoned,`);
				}
				t.push(`you take ${his} face in your hands and kiss ${him} deeply, favoring ${him} with the sensation of kissing ${his} ${getWrittenTitle(bedSlaves[0])} while ${playerPronouns.he} orgasms. You keep making out with ${him} while ${bedSlaves[1].slaveName}`);
				if (V.PC.career === "servant") {
					t.push(`slips out from beneath your skirt.`);
				} else if (V.PC.career === "escort") {
					t.push(`tries to find the perfect balance between your extra short skirt showing either your pussy or butthole.`);
				} else {
					t.push(`dresses your lower half.`);
				}
				seX(bedSlaves[1], "oral", V.PC, "vaginal");
			}

			t.push(`When you finally leave the suite, ${bedSlaves[0].slaveName} and ${bedSlaves[1].slaveName} head into the shower for their turn, while ${bedSlaves[2].slaveName} and ${bedSlaves[3].slaveName} have finished drying each other off so they can`);
			if (App.Utils.sexAllowed(bedSlaves[2], bedSlaves[3])) {
				t.push(`have sex`);
				SimpleSexAct.Slaves(bedSlaves[2], bedSlaves[3]);
			} else {
				t.push(`nap together in the afterglow`);
			}
			t.push(`on the bed without getting the sheets wet. They pause for a moment to wave at you as you go, though. <span class="trust inc">Your fucktoys are very satisfied with their morning routine.</span>`);
			if (App.Utils.sexAllowed(bedSlaves[0], bedSlaves[1])) {
				SimpleSexAct.Slaves(bedSlaves[0], bedSlaves[1]);
			}
			bedSlaves.forEach(s => (s.trust += 4));

			App.Events.addParagraph(frag, t);

			return frag;
		}

		function exhausted() {
			const frag = document.createDocumentFragment();
			let noShowerSex = 0;
			t = [];

			if (V.PC.dick !== 0) {
				t.push(`${bedSlaves[0].slaveName} feels a hand snake behind ${his} head and relaxes ${his} throat, knowing what's coming. You fuck the bitch's mouth hard, and since the pounding pulls your balls out of ${bedSlaves[1].slaveName}'s mouth,`);
				t.push(`you yank ${him2} up towards you so you can`); // strength check
				if (bedSlaves[1].boobs > 300) {
					t.push(`maul ${his2} breasts. The compliant slave thrusts out ${his2} chest, presenting ${his2} tits`);
				} else {
					t.push(`torment ${his2} flat breasts. The compliant slave thrusts out ${his2} chest, presenting ${his2} nipples`);
				}
				t.push(`for use as toys, and then gasps as you pinch, squeeze, and twist. You blow your load down ${bedSlaves[0].slaveName}'s throat`);
				seX(bedSlaves[0], "oral", V.PC, "penetrative");
			} else {
				t.push(`You shove ${bedSlaves[0].slaveName} down towards your pussy and grab`);
				if (bedSlaves[0].hLength > 10) {
					t.push(`${his} hair.`);
				} else if (bedSlaves[0].bald === 1) {
					t.push(`${his} bald head.`);
				} else {
					t.push(`the back of ${his} head.`);
				}
				t.push(`${He} takes a deep breath, knowing what's coming. You grind your cunt against the bitch's mouth hard, and since there's no room for ${bedSlaves[1].slaveName}'s hand there any more,`);
				t.push(`you yank ${him2} up towards you so you can`); // strength check
				if (bedSlaves[1].boobs > 300) {
					t.push(`maul ${his2} breasts. The compliant slave thrusts out ${his2} chest, presenting ${his2} tits`);
				} else {
					t.push(`torment ${his2} flat breasts. The compliant slave thrusts out ${his2} chest, presenting ${his2} nipples`);
				}
				t.push(`for use as toys, and then gasps as you pinch, squeeze, and twist. You climax against ${bedSlaves[0].slaveName}'s face`);
				seX(bedSlaves[0], "oral", V.PC, "vaginal");
			}
			t.push(`and bounce up to fuck bitches in the shower, knocking ${bedSlaves[0].slaveName} aside and sending ${bedSlaves[1].slaveName} sprawling. As you go, you tell them they've got ten minutes to get your clothes laid out and their bodies ready for more. They nod furiously and scramble.`);
			App.Events.addParagraph(frag, t);

			t = [];
			t.push(`By now, the shower is an impenetrable fog of steam. The wet, soapy bodies inside are easy to find, though. ${bedSlaves[2].slaveName} happens to be closest, so you`);
			t.push(`grab ${him3} and shove ${him3} into a corner of the`); // strength
			if (bedSlaves[2].belly >= 10000) {
				t.push(`shower, ${his3} ${bellyAdjective(bedSlaves[2])} soapy belly pushing uncomfortably against the glass.`);
			} else if (bedSlaves[2].boobs > 2000) {
				t.push(`shower, ${his3} huge soapy tits slapping painfully against the glass.`);
			} else if (bedSlaves[2].weight > 95) {
				t.push(`${his3} fat soapy gut slapping painfully against the glass.`);
			} else {
				t.push(`shower.`);
			}
			if (V.PC.dick !== 0) {
				t.push(`${He3} does ${his3} best to angle ${his3} hips for you as you push your cock`);
				if (bedSlaves[2].vagina > 0 && canDoVaginal(bedSlaves[2])) {
					t.push(`into ${his3} pussy to give ${him3} a good hard fuck.`);
					t.push(VCheck.Vaginal(bedSlaves[2], 1));
				} else if (bedSlaves[2].anus > 0 && canDoAnal(bedSlaves[2])) {
					t.push(`up ${his3} ass and give ${him3} a good hard reaming.`);
					t.push(VCheck.Anal(bedSlaves[2], 1));
				} else {
					t.push(`between ${his4} thighs and go to town.`);
					seX(bedSlaves[2], "anal", V.PC, "penetrative", );
				}
				t.push(`${bedSlaves[3].slaveName} does ${his4} best to wash your`);
				if (V.PC.vagina > -1) {
					t.push(`back and give your pussy some manual attention,`);
				} else {
					t.push(`back,`);
				}
				t.push(`but finds ${himself4} taking ${bedSlaves[2].slaveName}'s place soon enough, smashed into the corner with your dick pistoning`);
				if (bedSlaves[3].vagina > 0 && canDoVaginal(bedSlaves[3])) {
					t.push(`in and out of ${his4} holes.`);
					t.push(VCheck.Vaginal(bedSlaves[3], 1));
				} else if (bedSlaves[3].anus > 0 && canDoAnal(bedSlaves[3])) {
					t.push(`in and out of ${his4} holes.`);
					t.push(VCheck.Anal(bedSlaves[3], 1));
				} else {
					t.push(`between ${his4} legs.`);
					seX(bedSlaves[3], "anal", V.PC, "penetrative");
				}
			} else {
				t.push(`${He3} does ${his3} best to angle ${his3} hips for you as you`);
				if (canDoVaginal(bedSlaves[2])) {
					t.push(`fingerfuck ${him3},`);
					seX(bedSlaves[2], "vaginal", V.PC, "penetrative");
				} else if (canDoAnal(bedSlaves[2])) {
					t.push(`fingerfuck ${him3},`);
					seX(bedSlaves[2], "anal", V.PC, "penetrative");
				} else {
					t.push(`molest ${him3},`);
					noShowerSex++;
				}
				t.push(`forcing complete submission out of the compliant ${girl3}. ${bedSlaves[3].slaveName} does ${his4} best to wash your back, but finds ${himself4} taking ${bedSlaves[2].slaveName}'s place soon enough, smashed into the corner with your fingers`);
				if (bedSlaves[3].vagina > 0 && canDoVaginal(bedSlaves[3])) {
					t.push(`pistoning in and out of ${his4} holes.`);
					seX(bedSlaves[3], "vaginal", V.PC, "penetrative");
				} else if (bedSlaves[3].anus > 0 && canDoAnal(bedSlaves[3])) {
					t.push(`pistoning in and out of ${his4} holes.`);
					seX(bedSlaves[3], "anal", V.PC, "penetrative");
				} else {
					t.push(`running across every ${V.showInches === 2 ? "inch" : "centimeter"} of ${his4} body.`);
					noShowerSex++;
				}
			}
			t.push(`You're in a hurry, but it'll be a sad day when you aren't able to ${noShowerSex > 1 ? "push" : "fuck"} a slave into total submission in five minutes. You release ${bedSlaves[3].slaveName} to drop to the shower floor and let ${bedSlaves[2].slaveName} towel you off.`);
			if (V.PC.dick === 0 && ((bedSlaves[3].anus > 0 && canDoAnal(bedSlaves[3])) || (bedSlaves[3].vagina > 0 && canDoVaginal(bedSlaves[3])))) {
				t.push(`${bedSlaves[3].slaveName}`);
				if (canStand(bedSlaves[3])) {
					t.push(`gets to ${his4} feet`);
				} else {
					t.push(`hoists ${himself4} upright`);
				}
				t.push(`and helpfully holds up a strap-on questioningly; you shake your head and point to another, larger one. ${He4} helps you into it, and you ram it up ${his4}`);
				if (bedSlaves[3].vagina > 0 && canDoVaginal(bedSlaves[3])) {
					t.push(`loosened pussy`);
					seX(bedSlaves[3], "vaginal", V.PC, "penetrative");
				} else {
					t.push(`loosened ass`);
					seX(bedSlaves[3], "anal", V.PC, "penetrative");
				}
				t.push(`experimentally, nodding in satisfaction when the big phallus forces a pained gasp out of ${him4}.`);
			}
			App.Events.addParagraph(frag, t);

			t = [];
			t.push(`Back in the bedroom, your clothes have been laid out, ready for ${bedSlaves[0].slaveName} and ${bedSlaves[1].slaveName} to dress you.`);

			let dick = V.PC.dick !== 0 ? "dick" : "strap-on";

			t.push(`Next to the neat stack of clothes, the two slaves are bent over the bed with their buttocks spread. They're perfectly still, awaiting your pleasure. You select ${bedSlaves[1].slaveName} and`);
			if (bedSlaves[1].vagina > 0 && canDoVaginal(bedSlaves[1])) {
				t.push(`push your ${dick} up ${his2} ${bedSlaves[1].vagina > 2 ? "loose pussy" : (bedSlaves[1].vagina > 1 ? "inviting pussy" : "tight pussy")}, raping ${him2} without mercy`);
				t.push(VCheck.Vaginal(bedSlaves[1], 1));
			} else if (bedSlaves[1].anus > 0 && canDoAnal(bedSlaves[1])) {
				t.push(`ram your ${dick} up ${his2} ${bedSlaves[1].anus > 2 ? "welcoming asspussy" : (bedSlaves[1].anus > 1 ? "soft butthole" : "tight anus")}, assraping ${him2} without mercy`);
				t.push(VCheck.Anal(bedSlaves[1], 1));
			} else {
				t.push(`spin ${him2} around, then push your ${dick} down ${his2} throat, facefucking ${him2} without mercy`);
				seX(bedSlaves[1], "oral", V.PC, "penetrative");
			}
			t.push(`while ${bedSlaves[0].slaveName}`);
			if (V.PC.dick !== 0) {
				t.push(`buttons your shirt.`);
			} else if (V.PC.career === "servant") {
				t.push(`helps you into your dress.`);
			} else if (V.PC.career === "escort") {
				if (V.PC.boobs >= 1400) {
					t.push(`faces a losing battle to get your huge breasts to stay in your barely-there top.`);
				} else if (V.PC.boobs >= 1200) {
					t.push(`wrestles your big tits into your way too small top.`);
				} else if (V.PC.boobs >= 1000) {
					t.push(`struggles to shove your breasts into your too small top.`);
				} else if (V.PC.boobs >= 300) {
					t.push(`wrangles your breasts into your revealing top.`);
				} else {
					t.push(`ties your skimpy top over your flat chest.`);
				}
			} else {
				t.push(`helps you into your top.`);
			}
			t.push(`When it's done, you push ${him} down next to ${bedSlaves[1].slaveName} and switch partners, letting ${bedSlaves[1].slaveName} up to do ${his2} best to`);
			if (V.PC.dick !== 0) {
				t.push(`help you into your trousers in the meantime. ${He2} gets them on and fastens everything, except the fly, of course.`);
			} else if (V.PC.career === "servant") {
				t.push(`tie your apron and keep it out of the way.`);
			} else if (V.PC.career === "escort") {
				t.push(`dress your lower half. ${He2} gets your skimpy bottom on, thong not included of course, quickly enough.`);
			} else {
				t.push(`dress your lower half.`);
			}
			t.push(`When ${bedSlaves[0].slaveName} has been fucked into helplessness, you throw ${him} away like the human sex toy ${he} is and pound ${bedSlaves[1].slaveName} and then the dried-off ${bedSlaves[3].slaveName} and ${bedSlaves[2].slaveName} senseless, careful to frequently pull far enough out that the slaves have to take the pain of initial penetration again.`);
			SimpleSexAct.Player(bedSlaves[0]);
			SimpleSexAct.Player(bedSlaves[1]);
			SimpleSexAct.Player(bedSlaves[2]);
			SimpleSexAct.Player(bedSlaves[3]);
			t.push(`When you finally leave the suite, all four slaves are lying like discarded tissues on the bed, face-down and spread-eagled, carefully avoiding resting on any sensitive parts. <span class="devotion inc">Your fucktoys are reminded of who you are.</span>`);

			App.Events.addParagraph(frag, t);
			bedSlaves.forEach(s => (s.devotion += 4));

			return frag;
		}
	}
};


code:
:: SE assholeknight [nobr]

<<set $nextButton = "Continue", $nextLink = "Scheduled Event">>

The group of citizens you hand-picked as your Knights have quickly proven themselves a reliable staple of the Arcology. Being visibly a league above the common citizen with their heavy Imperial Plate decorated with glimmering pendants and marks of their individual, flowery coats of arms, their mere presence is enough to make most common criminals cower and keep merchants selling their wares at fair prices. The tenets of neo-Imperial hierarchy and their own social prestige have already gone to their heads, and many Knights are now recognized immediately by the common citizens as heroic, uncowed citizen-soldiers.

Despite the noble reputations of many of your Knights, their image as defenders of the downtrodden and honest protectors of the Arcology is not universal. Although you Knighted every last one of them yourself, it seems you might have made a misjudgement on the character of one of your new servants; a stream of minor offenses from one Knight in particular has been building up in your inbox for quite some time, and reviewing the whole dossier now paints a portrait of abuses and misconduct.

This singular Knight has apparently been using their position to extort and bully the populace, demanding unreasonably steep discounts from merchants and regularly beating the peasantry - often for no reason other than momentary amusement, and treating them as "less than even slaves". A number of frustrated citizens have sent you a petition demanding that you denounce and punish them for their petty offenses - a picture of a woman with her face blurred out and a trail of bruises over every inch of her naked body is attached. No names have been attached to the petition, apparently for fear of what the Knight in question will do to them should their attempts be uncovered. Whatever you decide to do with this man will undoubtedly set the precedent for how you deal with Knights who abuse their station in the future.

    <<link "Remove his title and confiscate his weapons">>
	<<replace "#result">>
	You have the insolent Knight's plate armor confiscated, his apartment seized and his right to bear a coat of arms redacted. The knight is nothing short of utterly furious, but puts up no fight as your guards seize his advanced weaponry; to do so would be suicidal. While he swears revenge against you for taking away his "noble rights", you receive a letter from a relieved merchant @@.green;thanking you@@ for putting the jumped-up bandit down.
    <<run repX(2500, "event")>>
	<</replace>>
<</link>>

    <<link "Have him publicly flogged, then enslaved">>
	<<replace "#result">>
	You have the insolent Knight's gear and weapons confiscated, then publicly flog him in the plaza and announce that he's to be enslaved for crimes against the people of $arcologies[0].name. Although the watching peasants are clearly @@.green;relieved@@ that the cruel bully is off the streets, some of them, those who did not feel the fist of the howling man on their own neck, @@.red;recoil@@ somewhat at the sudden brutality against a class that most of them idolize and romanticize.
    <<run repX(1000, "event")>>
    <<set $activeSlaveOneTimeMinAge = 22>>
    <<set $activeSlaveOneTimeMaxAge = 34>>
	<<set $oneTimeDisableDisability = 1>>
	<<set $activeSlave = GenerateNewSlave("XY")>>
	<<set $activeSlave.prestige = 1>>
    <<set $activeSlave.prestigeDesc = "$He was formerly an Imperial Knight, a highly prestigious position indicating both nobility and exceptional combat prowess. Although $he has had $his coat of arms stripped, many still recognize $him from his former Knighthood.">>
	<<set $activeSlave.origin = "$He used to be a Knight within your arcology, until you had $him stripped of $his title and summarily enslaved for cruelly abusing citizens beneath $his stature.">>
	<<set $activeSlave.career = "spec ops">>
    <<set $activeSlave.devotion = random(-80,-60)>>
    <<set $activeSlave.muscles = random(50,75)>>
    <<set $activeSlave.skill.combat = 1>>
    <<set $activeSlave.behavioralFlaw = "malicious">>
	<<set $activeSlave.behavioralQuirk = "none">>
	<<set $activeSlave.trust = random(-30,-20)>>
	<<set $activeSlave.boobs = 150>>
	<<set $activeSlave.butt = random(0,1)>>
	<<set $activeSlave.faceShape = "masculine">>
	<<set $activeSlave.height = random(175,195)>>
	<<set $activeSlave.fetish = "sadist">>
	<<set $activeSlave.fetishStrength = 80>>
	<<set $activeSlave.preg = 0>>
	<<set $activeSlave.dick = random(3,5)>>
	<<set $activeSlave.balls = random(2,4)>>
	<<set $activeSlave.scrotum = $activeSlave.balls>>
	<<set $activeSlave.prostate = 1>>
	<<includeDOM App.UI.newSlaveIntro($activeSlave)>>
	<</replace>>
<</link>>

    <<link "Turn a blind eye">>
	<<replace "#result">>
    You opt to ignore the abuses of the cruel knight completely. Every few weeks, you receive another @@.red;pleading@@ message in your inbox about the Knight, until they simply stop coming as the lower class accepts the random abuse of their betters. A few days later, as you socialize with your upper-class, the Knight in question passes you a @@.green;full envelope@@ and winks with no further explanation.
    <<run cashX(500, "bribe")>>
    <<run repX(-2000, "event")>>
	<</replace>>
<</link>>


code:
globalThis.allBursts = function() {
	const el = new DocumentFragment();
	for (const slave of V.slaves) {
		if (burstCheck(slave)) {
			if (slave.womb.length > 0) {
				el.append(birth(slave));
			} else {
				el.append(pop(slave));
			}
			removeSlave(slave);
			el.append(sectionBreak());
		}
	}
	V.burstee = 0;

	return el;

	/**
	 *
	 * @param {App.Entity.SlaveState} slave
	 * @returns {DocumentFragment}
	 */
	function pop(slave) {
		const el = new DocumentFragment();
		const r = [];
		const {
			He, His,
			he, his, him
		} = getPronouns(slave);
		if (V.seeImages && V.seeReportImages) {
			r.push(
				App.UI.DOM.makeElement("div", App.Art.SlaveArtElement(slave, 0, 0), ["imageRef", "medImg"])
			);
		}
		r.push(`As ${slave.slaveName} is going about ${his} business with ${his} overfilled`);
		if (slave.inflation !== 0) {
			r.push(slave.inflationType);
		}
		r.push(`belly, ${he} can't help but feel exhausted. ${His} health has been poor lately and the pressure in ${his} organs is not helping things. ${He} immediately knows something is wrong when an intense pain runs through ${his} middle and ${his} load shifts threateningly.`);
		if (slave.inflation !== 0) {
			r.push(`Blood and ${slave.inflationType} leak`);
		} else {
			r.push(`Blood leaks`);
		}
		(`from ${his} rear as ${his} body cavity fills with the contents of ${his} digestive tract. The skin of ${his} taut belly reddens as the pressure against it builds. As ${he} takes ${his} last breath, ${he} falls forward, ${his} weight landing upon ${his} straining stomach. With a gush, ${he} ruptures, flooding the area around ${him} with`);
		if (slave.inflation !== 0) {
			r.push(`blood, guts and ${slave.inflationType}.`);
		} else {
			r.push(`blood and guts.`);
		}
		el.append(r.join(" "));
		el.append(horrifiedSlaves(slave));
		return el;
	}

	function sectionBreak() {
		const hr = document.createElement("hr");
		hr.style.margin = "0";
		return hr;
	}
};

/**
 *
 * @param {App.Entity.SlaveState} slave
 * @returns {HTMLElement}
 */
globalThis.horrifiedSlaves = function(slave) {
	const el = document.createElement("p");
	const {his} = getPronouns(slave);
	el.append(`Word of the late slave and ${his} gruesome fate spread fast, `);
	App.UI.DOM.appendNewElement("span", el, "terrifying", "gold");
	el.append(` your untrusting slaves.`);
	for (const bystander of V.slaves) {
		if (bystander.trust <= 50) {
			if (slave.inflation > 0) {
				bystander.trust -= (Math.pow(slave.inflation, 3) * 5);
			} else {
				bystander.trust -= 10;
			}
		}
	}
	return el;
};


code:
:: SE Burst [nobr]

<<set $nextButton = "Continue", $nextLink = "Scheduled Event">>

<<includeDOM allBursts()>>


code:
App.Events.murderAttempt = function() {
	// setup next time, 2-4 months
	V.murderAttemptWeek += 26 + Math.floor(Math.random() * 26);
	// disable Continue
	V.nextButton = " ";
	App.Utils.updateUserButton();
	const nextPassage = "Random Nonindividual Event";
	const perceptiveCareers = ["mercenary", "gang", "escort"];
	// event unique
	const variation = jsEither(["trade", "slave", "drug", "military"]);
	let isSincere = Math.random() > 0.6;
	// actual deals can only trigger once
	if (isSincere) {
		switch (variation) {
			case "trade":
				isSincere = V.illegalDeals.trade === 0;
				break;
			case "slave":
				isSincere = V.illegalDeals.slave === 0;
				break;
			case "drug":
				isSincere = V.illegalDeals.menialDrug === 0;
				break;
			case "military":
				isSincere = V.illegalDeals.military === 0;
				break;
		}
	}
	const companyName = ["RealTec", "Horizons Unlimited", "Dix Trade", "TA Technology"].random() + ["", " Inc."].random();
	const {he, He, his, him, woman, himself} = getPronouns((V.arcologies[0].FSGenderFundamentalist !== "unset" || V.seeDicks > random(0, 99))
		? {pronoun: App.Data.Pronouns.Kind.male} : {pronoun: App.Data.Pronouns.Kind.female});
	const {womanPC} = getPronouns(V.PC).appendSuffix("PC");
	let heBG, HeBG, himBG, hisBG;

	const documentFragment = document.createDocumentFragment();
	intro(documentFragment);
	return documentFragment;

	function perceptionChance() {
		return (perceptiveCareers.includes(V.PC.career) || V.PC.skill.warfare >= 60 || V.PC.skill.slaving >= 60 || V.PC.skill.medicine >= 60);
	}

	function intro(fragment) {
		const r = [];
		r.push(`As per routine, you are sifting through the messages ${V.assistant.name} has flagged as relevant from the mass that fills your inbox each day.`);
		r.push(`One is a request from a company called ${companyName} for a personal meeting to propose some kind of`);
		switch (variation) {
			case "trade":
				r.push("business venture.");
				break;
			case "slave":
				r.push("unique slave trade.");
				break;
			case "drug":
				r.push("deal for a new drug.");
				break;
			case "military":
				r.push("military endeavour.");
				break;
		}
		r.push("Despite being incredibly vague about the details of said business opportunity, they have references from multiple reputable businesses in the");
		switch (variation) {
			case "trade":
				r.push("trading");
				break;
			case "slave":
				r.push("arcology");
				break;
			case "drug":
				r.push("medical");
				break;
			case "military":
				r.push("military");
				break;
		}
		r.push("and slavery sectors. Some of them are known for dealing in less than legal business regularly, so the lack of information may just be either an attempt to distance themselves from seedy dealings or something truly lucrative, if slightly dirty.");
		App.Events.addParagraph(fragment, r);

		let yesText, noText;
		switch (variation) {
			case "trade":
				yesText = "New business is always good";
				noText = "profitable business venture";
				break;
			case "slave":
				yesText = "Unique slaves are always interesting";
				noText = "special slave";
				break;
			case "drug":
				yesText = "Special drugs unavailable to the public are always interesting";
				noText = "new drug";
				break;
			case "military":
				yesText = "A profitable use for your mercenary troops is always good";
				noText = "profitable military venture";
				break;
		}
		App.Events.addResponses(fragment, [
			new App.Events.Result(`${yesText}; invite them to a private meeting.`, invite),
			new App.Events.Result(`You are not going to waste your time on something as vague as a "${noText}".`, endEvent)
		], "invite");
	}

	function invite() {
		const fragment = document.createDocumentFragment();

		let r = [];
		r.push(`${capFirstChar(V.assistant.name)} schedules a meeting a few days later to take place in your personal office, an oddity given these meetings are usually conducted in a more neutral, albeit less secure location, but ${companyName} insisted on it.`);
		if (["capitalist", "mercenary", "slaver", "engineer", "escort"].includes(V.PC.career)) {
			r.push("You should prepare for anything; it's better to be prepared in case something goes awry.");
		} else {
			r.push("You can't really complain; it's easier for you and cheaper should nothing come of it.");
		}
		App.Events.addParagraph(fragment, r);

		r = [];
		r.push(`When it comes time for the meeting, a ${woman} arrives at the entryway of the penthouse and is escorted to your office by one of your slaves as you watch ${him} on your monitor. The ${woman} is distinctively average looking, as if you took all business men that did their job well, but did not overachieve, and created the perfect average of it. Someone trying this hard to appear average is certainly anything but average.`);
		App.Events.addParagraph(fragment, r);

		r = [];
		r.push(`Once ${he} reaches your office, you settle down after a short greeting for ${him} to begin`);
		switch (variation) {
			case "trade":
			case "military":
				r.push("showing you the plans they have.");
				break;
			case "slave":
				r.push("explaining the uniqueness of their slaves.");
				break;
			case "drug":
				r.push("showing you the effects of their new drug.");
				break;
		}

		if (S.Bodyguard) {
			({
				heBG, HeBG, himBG, hisBG
			} = getPronouns(S.Bodyguard).appendSuffix("BG"));
			r.push(`Before getting anywhere though, ${he} interrupts ${himself}, gesturing at your bodyguard.`);
			r.push(`"I'm sorry, this is meant only for your ears, can you please send your bodyguard outside?"`);
			App.Events.addParagraph(fragment, r);

			App.Events.addResponses(fragment, [
				new App.Events.Result(`Order ${him} to leave for making such a request.`, endEvent),
				new App.Events.Result(`${S.Bodyguard.slaveName} goes everywhere and does everything with you. ${HeBG} stays.`, bgStaysRoute),
				new App.Events.Result(`This better be worth it. Order ${S.Bodyguard.slaveName} to leave.`, bgLeavesRoute)
			], "bodyguard");
		} else {
			noSlaveRoute(fragment, r, false);
		}

		return fragment;
	}

	/**
	 * @param {DocumentFragment} fragment
	 * @param {Array<string>} paragraphStart
	 * @param {boolean} slaveLeft only relevant for murder attempt
	 */
	function noSlaveRoute(fragment, paragraphStart, slaveLeft) {
		if (isSincere) {
			sincereProposal(fragment, paragraphStart);
		} else {
			paragraphStart.push(`For the next few hours ${he} talks in circles, making grand gestures here and there but not really saying anything of substance to the point it starts to bore you.`);
			if (perceptionChance()) {
				paragraphStart.push(`That is, up until one of ${his} wide motions drops something in your drink. When you confront ${him} about it, ${he} draws a weapon and shoots you before you have a chance to react.`);
				if (V.PC.career === "gang") {
					paragraphStart.push(`You have the last laugh, though, as you draw your own weapon and gun ${him} down before you succumb to your wound.`);
				// } else if (V.PC.skill.medicine >= 100) {
					// allow for gravely wounded state during player update
				} else if (slaveLeft) { // BG must be able to walk, so we should assume that if this is true, she is actually lurking
					paragraphStart.push(`While ${S.Bodyguard.slaveName} may storm in and cut ${him} down, it will not bring you back to life.`);
				} else {
					paragraphStart.push(`Before ${he} can leave the building, your security detains ${him}, but this won't help a dead ${womanPC}.`);
				}
				App.Events.addParagraph(fragment, paragraphStart);
				gameOver(fragment);
			} else {
				poisoned(fragment, paragraphStart);
			}
		}
	}

	function bgStaysRoute() {
		const fragment = document.createDocumentFragment();

		if (isSincere) {
			let r = [];
			r.push(`"Very good," ${he} smiles, seeing your confused look, "We are not interested in dealing with someone who isn't in control of their own affairs." Seems like you just passed some sort of test.`);
			App.Events.addParagraph(fragment, r);
			r = [];
			r.push(`Satisfied, ${he} begins explaining:`);
			sincereProposal(fragment, r);
		} else {
			let r = [];
			r.push(`"If you say so..." ${He} continues and starts ${his} explanation anew, sometimes with great gestures, but never actually getting to the point. You start to grow bored of ${his} drivel`);
			if (S.Bodyguard.intelligence + S.Bodyguard.intelligenceImplant + (30 * S.Bodyguard.skill.combat) > 60) {
				r.push(`until ${he} does one of ${his} grand motions again and ${S.Bodyguard.slaveName} jumps forward,`);
				if (perceptionChance()) {
					r.push("just a moment faster than you,");
				}
				if (canTalk(S.Bodyguard)) {
					r.push(`demanding to know what ${he} just put in your drink.`);
				} else {
					r.push(`snatching the glass and taking an aggressive stance.`);
				}
				bgDefense(fragment, r);
			} else if (perceptionChance()) {
				r.push(`until, on of ${his} grand motions, you notice ${he} slips something in your drink and you confront ${him} about what ${he} just did.`);
				bgDefense(fragment, r);
			} else {
				r.push(r.pop() + ".");
				poisoned(fragment, r);
			}
		}
		return fragment;
	}

	function bgDefense(fragment, paragraphStart) {
		paragraphStart.push(`Before you can react, the ${woman} draws a weapon and`);
		if (S.Bodyguard.muscles > 95 || S.Bodyguard.muscles < -30 || S.Bodyguard.boobs > 4000 || S.Bodyguard.weight > 130 || S.Bodyguard.health.tired > 30 || S.Bodyguard.belly >= 100000) { // BG is too big or weak to draw fast enough to matter
			paragraphStart.push("shoots you through the heart; having a bodyguard who cannot actually defend you might have been a poor choice in retrospect.");
			paragraphStart.push(`With you dead, ${S.Bodyguard.slaveName} knows ${heBG} has to put this to rest.`);
			if (deadliness(S.Bodyguard) > 1) {
				paragraphStart.push(`Out of ammo, your murderer moves to grab ${himBG} by the head and introduce ${hisBG} skull to the corner of your table. ${S.Bodyguard.slaveName} may have been slow on the draw, but is not incompetent. ${HeBG} subdues ${him}, pinning ${him} down until security may collect ${him}, but it's all in vain when ${he} starts convulsing and quickly perishes to the contents of a false tooth. With nothing left, ${S.Bodyguard.slaveName} readies ${hisBG} weapon, puts it under ${hisBG} chin, and pulls the trigger.`);
			} else {
				paragraphStart.push(`Alas, ${heBG} is too incompetent to even do that. By the time ${heBG} manages to get a steady grip on ${hisBG} weapon, your murderer is already introducing ${hisBG} skull to the corner of your table. Sure ${he} is detained before ${he} makes it out of the building, but does that really matter when you're dead?`);
			}
			App.Events.addParagraph(fragment, paragraphStart);
			gameOver(fragment);
		} else {
			paragraphStart.push(paragraphStart.pop() + ",");
			if (deadliness(S.Bodyguard) > 1) {
				paragraphStart.push(`just a little quicker, ${S.Bodyguard.slaveName} draws ${hisBG} own, shooting ${him} in the shoulder. Screaming in pain, ${he} drops ${his} weapon and ${S.Bodyguard.slaveName} swiftly moves to secure ${him}.`);
				App.Events.addParagraph(fragment, paragraphStart);
				let r = [];
				r.push(`After the initial shock has waned and you ready to begin interrogating ${him}, ${he} clamps ${his} jaw down hard, foams for several seconds and dies. Seems like whomever sent ${him} cares a lot about not being tracked down. And indeed, all the already sparse information about ${companyName} is gone and any leads you may have had are useless. You task ${V.assistant.name} to continue searching for the one behind this, but you don't expect anything to come out of it. Someone wanting you dead isn't all that surprising, and without any idea as to why, there are thousands of small groups and individuals who want arcology owners, owners like you, or maybe just you personally, dead.`);
				App.Events.addParagraph(fragment, r);
				continueButton(fragment);
			} else {
				paragraphStart.push(`just a moment too slow, ${S.Bodyguard.slaveName} draws ${hisBG} own, shooting ${him} in the chest, but not before you already have a bullet through your heart. Seeing you fall down, ${heBG} sets ${hisBG} weapon to automatic, puts it under ${hisBG} chin, and pulls the trigger.`);
				App.Events.addParagraph(fragment, paragraphStart);
				gameOver(fragment);
			}
		}
	}

	function bgLeavesRoute() {
		const fragment = document.createDocumentFragment();
		if (isSincere) {
			let r = [];
			r.push(`After your bodyguard leaves, ${he} stares at you for a while, before stating, "I don't believe you are ready to do business with us." When questioned why, ${he} answers, "If you can't trust your bodyguard with sensitive information, you clearly have bigger problems to worry about than our small proposal." ${He} leaves your office without waiting for anyone to see ${him} off.`);
			App.Events.addParagraph(fragment, r);
			continueButton(fragment);
		} else {
			let r = [];
			r.push(`"Thank you," ${he} states, before continuing.`);
			noSlaveRoute(fragment, r, true);
		}
		return fragment;
	}

	function poisoned(fragment, paragraphStart) {
		let r = paragraphStart;
		r.push(`After a while, ${he} finishes ${his} seemingly unending pitch, begins packing up and tells you to call ${him} if you are interested. You certainly will not be; if you wanted to hear someone talk for hours without saying anything, you would tune into a political debate out of one of the nearby old world counties.`);
		App.Events.addParagraph(fragment, r);
		r = [];
		r.push("Several hours later you start to feel strange. A few minutes after that, you collapse. You are dead long before help can arrive. Later autopsy reveals your cause of death to be poisoning.");
		App.Events.addParagraph(fragment, r);
		gameOver(fragment);
	}

	function sincereProposal(fragment, paragraphStart) {
		const options = [];
		switch (variation) {
			case "trade":
				paragraphStart.push(`${companyName} is planning a trade deal with an old world corporation that wants to expand into the Free Cities, but with the added twist of effectively robbing them during this. Their problem is they need something to show them and your arcology would ideal for this. Your role would be simple, just follow a short script before leaving both sides to negotiate. If everything goes well, your share could be in the six digit realm, but if something goes wrong, your reputation would be severely damaged.`);
				options.push(
					new App.Events.Result("A windfall like this doesn't come by every day. Of course you'll take this opportunity.", accept()),
					new App.Events.Result("The potential winnings are not worth the risk. You will not be a part of their plans.", refused)
				);
				break;
			case "slave":
				paragraphStart.push(`${companyName} is dealing in a special kind of enslavement. Rather than searching for buyers for the slaves they already have, they instead find potential buyers and acquire those they want to buy. And while there are means to order slaves with certain traits, ${companyName} enslaves the exact individuals you want through fabricated debt, kidnapping or any means necessary.`);
				if (V.cash >= 50000) {
					options.push(new App.Events.Result( // age needs to be checked here
						"Enslaving that annoying girl from high school might be petty, but it will be worth it nonetheless.",
						accept("school"), `Costs ${cashFormat(50000)}`));
				}
				if (V.cash >= 250000) {
					options.push(new App.Events.Result(
						"There is a rising star in the music industry that would fit perfectly in your stable.",
						accept("star"), `Costs ${cashFormat(250000)}`));
				}
				if (V.cash < 50000) {
					options.push(new App.Events.Result("You couldn't afford to enslave someone even if you wanted to.", refused));
				} else {
					options.push(new App.Events.Result(`You'll pass on the offer.`, refused));
				}
				break;
			case "drug":
				paragraphStart.push(`${companyName} has developed a new performance enhancing drug that can greatly improve one's productivity. It does however come with serious drawbacks, making it unsuitable for sex slaves, but it could immensely boost the efficiency of your menial slaves.`);
				if (V.cash >= 100000) {
					options.push(new App.Events.Result("Making more money from your menials is always good. Buy the drug.", accept(), `Costs ${cashFormat(100000)}`));
				} else {
					options.push(new App.Events.Result(null, null, "You don't have the cash required to buy the drug."));
				}
				options.push(
					new App.Events.Result("The downsides are not worth it.", refused)
				);
				break;
			case "military":
				paragraphStart.push(`${companyName} is part of an endeavor to carve out a new Free City in the old world. While being too far away to influence your local political climate, it is certainly a new milestone in their growing dominance over the old world. Your mercenaries are known to be veterans in fighting in such territory and that you supply them with state-of-the-art equipment, so it is only natural for the company to ask you to join in this operation. Shipping your mercenaries around the globe would be a big expense, but all participants who don't get a share of the colony itself will receive hefty compensation.`);
				options.push(
					new App.Events.Result("This is a worthy endeavor. Of course you will help out.", accept()),
					new App.Events.Result("Military operations tend to be a net loss most of the time. You will watch with interest, but not a vested one.", refused)
				);
				break;
		}
		App.Events.addParagraph(fragment, paragraphStart);
		App.Events.addResponses(fragment, options, "deal");
	}

	/**
	 * @param {string} [argument]
	 * @returns {function(): DocumentFragment}
	 */
	function accept(argument) {
		return function() {
			const r = [];
			switch (variation) {
				case "trade":
					r.push(`You discuss the details of the operation before ${he} leaves. You will have a guest soon.`);
					V.illegalDeals.trade = {week: V.week + 2, company: companyName};
					break;
				case "slave":
					r.push(`You tell ${him} your target and he nods. "A great idea. It should take no longer than a few weeks."`);
					V.illegalDeals.slave = {type: argument, company: companyName};
					break;
				case "drug":
					r.push("The drug will be delivered within the week.");
					V.illegalDeals.menialDrug = 1;
					break;
				case "military":
					r.push("You order your mercenaries to prepare and a few days later they depart, leaving enough men behind to keep your arcology secure. You do not expect to hear much in the next few months; military operations of this size simply take time.");
					V.illegalDeals.military = {week: V.week + 16, company: companyName};
					break;
			}
			const fragment = document.createDocumentFragment();
			App.Events.addParagraph(fragment, r);
			continueButton(fragment);
			return fragment;
		};
	}

	function refused() {
		// TODO flavor text
		return endEvent();
	}

	/* End event functions */

	function gameOver(fragment) {
		App.Events.addParagraph(fragment, ["GAME OVER"]);
		V.ui = "start";
		App.Utils.scheduleSidebarRefresh();
	}

	function endEvent() {
		Engine.play(nextPassage);
		return [];
	}

	function continueButton(fragment) {
		fragment.append(App.UI.DOM.passageLink("Continue", nextPassage));
		V.nextButton = "Continue";
		V.nextLink = nextPassage;
		App.Utils.scheduleSidebarRefresh();
	}
};

/**
 * @param {string} variation
 * @param {string} companyName
 * @param {string} [type] only required when variation = "slave"
 * @returns {DocumentFragment}
 */
App.Events.murderAttemptFollowup = function(variation, companyName, type) {
	V.nextButton = "Continue";
	V.nextLink = "Random Nonindividual Event";
	App.Utils.updateUserButton();

	const fragment = document.createDocumentFragment();
	switch (variation) {
		case "trade":
			App.Events.addParagraph(fragment, tradeDeal());
			break;
		case "slave":
			App.Events.addParagraph(fragment, slaveDeal(type));
			break;
		case "military":
			App.Events.addParagraph(fragment, militaryDeal());
			break;
	}

	return fragment;

	function tradeDeal() {
		V.illegalDeals.trade = -1;
		let r = [];
		r.push(`Today you are receiving the delegation from the old world company wanting to buy into the lucrative Free Cities market. After showing them around your logistic centers and the cleaner industry areas, you leave them alone with the representatives from ${companyName}.`);
		if (random(1, 100) > 20) {
			r.push(`The next day you receive a transaction of ${cashFormatColor(270000)}.`);
			cashX(270000, "event");
		} else {
			r.push("A few hours later you receive a message that tricking the old world company into giving them money for nothing didn't quite work out as hoped. And truly, the next day your uncompetitive behavior is all over the media. This inflicts lasting harm on your reputation and severely damages your economy as your arcology is now seen as a place to go to be cheated.");
			repX(-20000, "event");
			V.enduringRep *= 0.5;
			V.arcologies[0].prosperity *= 0.7;
		}
		return r;
	}

	function slaveDeal(type) {
		V.illegalDeals.slave = -1;
		let slave;
		let relation;
		if (type === "school") {
			slave = GenerateNewSlave(null, {
				minAge: V.PC.actualAge - 1,
				maxAge: V.PC.actualAge + 1,
				mature: 0,
				ageOverridesPedoMode: 1,
				nationality: V.PC.nationality,
				race: V.PC.race // Same school does not imply same race, but with PC nationality defaulting to
				                // Stateless it's better than nothing.
			});
			slave.origin = "You were in the same class and seeing $him as your slave fills you with endless satisfaction.";
			slave.behavioralFlaw = "arrogant";
			relation = "your former schoolmate";
		} else if (type === "star") {
			slave = GenerateNewSlave('XX');
			slave.origin = "You bought $her enslavement in an illegal deal.";
			slave.voice = 3;
			slave.skill.entertainment = 60;
			slave.face = 96 + Math.floor(Math.random() * 5); // Math.random() is always < 1, so range is 0<=x<=4
			slave.intelligence = Math.abs(slave.intelligence); // never dumb, but no guarantee on smart
			slave.weight = Math.clamp(slave.weight, -30, 30);
			slave.waist = Math.clamp(slave.waist, -50, 10);
			slave.career = "an actress";
			slave.prestige = 2;
			slave.prestigeDesc = "$He was once a rising star in the music business, but was illegally enslaved on your command.";
			relation = "the former rising star";
		}
		let r = [];
		r.push(`Today ${relation}, whose enslavement you purchased, arrives at your penthouse complete with forged documents and no connections to their past life.`);
		r.push(App.UI.newSlaveIntro(slave));
		return r;
	}

	function militaryDeal() {
		V.illegalDeals.military = -1;
		let r = [];
		if (random(1, 100) > 10) {
			r.push(`After several months of fighting, the new Free City in the old world is finally established. While small scale conflicts will likely continue for years to come, local forces can easily manage them, leaving external forces, like your own mercenaries, to withdraw with their spoils. For your participation you get ${cashFormatColor(1000000)} and several hundred new bodies to add to your menial stock.`);
			cashX(1000000, "event");
			V.menials += 500;
		} else {
			r.push("Despite great efforts, the coalition of forces trying to establish a new Free City in the old world finally announces their failure. May the reason be that the old world military still has enough power to stop the establishment of a colony or simple mismanagement by the powers at hand is a topic for debate, but the fact remains that months were wasted on a fruitless war. Luckily you didn't invest too much, so the cost for failure is a meager ${cashFormatColor(40000, true)} and some reputation.");
			cashX(-40000, "event");
			repX(forceNeg(V.rep / 8), "event");
		}
		return r;
	}
};


code:
:: Murder Attempt [nobr]

<<if $event == "slave trade">>
	<<includeDOM App.Events.murderAttemptFollowup("slave", V.illegalDeals.slave.company, V.illegalDeals.slave.type)>>
<<elseif $event == "trade deal">>
	<<includeDOM App.Events.murderAttemptFollowup("trade", V.illegalDeals.trade.company)>>
<<elseif $event == "military deal">>
	<<includeDOM App.Events.murderAttemptFollowup("military", V.illegalDeals.military.company)>>
<<else>>
	<<includeDOM App.Events.murderAttempt()>>
<</if>>


code:
:: SE newBaron [nobr]

<<set $nextButton = "Continue", $nextLink = "Scheduled Event">>

$arcologies[0].name is prospering. New citizens flood to your gates, filling out the marketplaces and houses with new goods, slaves, and desires. Although every new citizen and visitor on the bustling trams lines more money into your pocket, it also comes with the challenge of new bureaucracy. The original group of Barons you appointed to micromanage each district has been valiantly struggling to manage increasingly larger clusters of people, but it has become quite clear, even if the Barons refuse to admit it, that a new addition to their hallowed ranks is needed to administrate your ever-greater Arcology.

The appointment of a new Baron is not something to be taken lightly; it is undoubtedly the most desired title in your arcology, and a veritable horde of citizens and millionaires hound your inbox and parties with hints and implications, subtly attempting to display their qualifications, because the Barons posses something even the wealthiest trillionaire in the Free Cities does not - security. The golden band of office of an Imperial Baron brings with it a penthouse, a sense of nobility, and a guaranteed sector of people to rule; so long as the Arcology continues to exist, the Barons will rule in your name, free from worries about petty market fluctuations and slave prices. Short of your personal intervention or the total collapse of the Arcology, nothing can unseat a Baron once they're appointed.

The hunger for such security among your upper class leaves you in an interesting position. You have dozens of citizens that you could give the title to, with various skills and proficiencies from your diverse arcology, and anyone who's handed a noble title will be certain to show their gratitude. The only real question on your mind - and on the minds of the waiting elites - is who you plan to promote.

    <<link "Appoint a wealthy executive">>
	<<replace "#result">>
	You select one of your loyal executives, an ultra-wealthy trader within the arcology who made a fortune in the sale of human bodies, for the new Barony. The man, a portly and unintimidating man that hides a razor-sharp mind behind his fat and an expensive suit, smiles full of teeth as you announce your decision to a waiting crowd of elites. After you go through the formalities and hand him the golden band that'll represent his symbol of office, he shakes your hand vigorously, still smiling devilishly. The next day, the newly-appointed Baron sends you a platter of expensive gifts and foreign candies, complimented with a @@.green;massive direct deposit to your bank account.@@ You can't help but feel that such a crafty fox might use his new power to @@.red;corner the market@@ in his barony, though.
	<<run cashX(5000, "Baron gift")>>
    <<run $arcologies[0].prosperity -= 1>>
	<</replace>>
<</link>>

    <<link "Appoint a competent bureaucrat">>
	<<replace "#result">>
	You select an unimportant but accomplished bureaucrat within the lower ranks of your administration, one of the cornerstone accountants that keeps the trains running on time. The rail-thin woman is clearly surprised that you'd choose her over a wealthier, more influential elite, but nevertheless accepts the golden band with overflowing joy. Although she may not turn any eyebrows, you can tell without a fact that she'll @@.green;keep your arcology efficient and prosperous@@ - after all, if it collapses, then her 'guaranteed' barony vanishes too.
    <<run $arcologies[0].prosperity += 3>>
	<</replace>>
<</link>>

    <<link "Appoint a veteran Knight">>
	<<replace "#result">>
    You select one of your Imperial Knights, a heavily scarred and muscular man who bears his rose-and-hawk coat of arms like a purple heart on his broad chest. The grizzled soldier is somewhat taken aback at your decision, but regains his composure almost immediately and accepts the golden band of a Baron with a scarred-over smirk. The ex-Knight takes to his new duty with surprising gusto, and quickly proves himself an @@.green;extraordinarily popular figure@@ among the commoners, who see the scarred and athletic figure both as proof that duty is rewarded in your arcology and as an example of what a proper Imperial noble should be - martial, confident, and nearly unbeatable in a duel.
    <<run repX(+2500, "event")>>
	<<run $arcologies[0].prosperity += 1>>
	<</replace>>
<</link>>


code:
App.Facilities.Pit.fight = function(lethal) {
	const frag = new DocumentFragment();
	/** @type {number[]} */
	const fighters = [];
	const animal = V.pit.animal;

	V.nextButton = "Continue";
	V.nextLink = "Scheduled Event";
	V.returnTo = "Scheduled Event";

	V.pit.fought = true;

	if (V.pit.slaveFightingBodyguard) {	// slave is fighting bodyguard for their life
		fighters.push(S.Bodyguard.ID, V.pit.slaveFightingBodyguard);
	} else {
		if (V.pit.bodyguardFights) {
			fighters.push(S.Bodyguard.ID, V.pit.fighterIDs.pluck());
		} else {
			if (S.Bodyguard) {
				V.pit.fighterIDs = V.pit.fighterIDs.filter(id => id !== S.Bodyguard.ID);
			}

			if (animal) {
				fighters.push(V.pit.fighterIDs.pluck());
			} else {
				fighters.push(V.pit.fighterIDs.pluck(), V.pit.fighterIDs.pluck());	// TODO: more concise way?
			}
		}
	}

	frag.appendChild(lethal ? App.Facilities.Pit.fight.lethal(fighters) : App.Facilities.Pit.fight.nonlethal(fighters));

	return frag;
};