code:
App.Events.pAidInvitation = class pAidInvitation extends App.Events.BaseEvent {
	constructor(actors, params) {
		super(actors, params);
	}

	actorPrerequisites() {
		return [];
	}

	eventPrerequisites() {
		return [
			() => V.plot === 1,
			() => V.week >= 29,
			() => !V.eventResults.aid
		];
	}

	execute(node) {
		const trapped = [];
		let r = [];
		V.eventResults.aid = -2; // Mark event as seen.
		if (V.seeDicks <= 75) {
			trapped.push("convent");
			trapped.push("school");
			trapped.push("housewives");
			trapped.push("volleyballTeam");
			if (V.seePreg !== 0) {
				trapped.push("maternity");
				if (V.continent === "Africa") {
					trapped.push("seizedMission");
				}
			}
		}
		if (V.seeDicks >= 25) {
			trapped.push("conversion");
		}
		trapped.push("gradeSchool");
		V.eventResults.aidTarget = trapped.random();

		r.push(`A small old world country near the arcology is experiencing serious unrest. Its corrupt government is doing an even poorer job than most of addressing chronic joblessness and general malaise. Thus far, it's been a fertile source of people in poverty for slavers to target, and little else. Lately, though, it's been showing signs worse may be to come. You've instructed ${V.assistant.name} to flag communications from the area; there's always a possibility that business opportunities may arise from the benighted country, and the situation is becoming so unstable it's prudent to keep a personal eye on it anyway. You receive just such a call from`);
		if (V.eventResults.aidTarget === "convent") {
			r.push(`the leader of a female-oriented religious retreat`);
		} else if (V.eventResults.aidTarget === "school") {
			r.push(`the principal of a preparatory school for girls`);
		} else if (V.eventResults.aidTarget === "housewives") {
			r.push(`the queen bee of a small group of suburban housewives`);
		} else if (V.eventResults.aidTarget === "maternity") {
			r.push(`the maternity ward of a hospital`);
		} else if (V.eventResults.aidTarget === "conversion") {
			r.push(`the owner of a religious sexual orientation therapy camp`);
		} else if (V.eventResults.aidTarget === "gradeSchool") {
			r.push(`a student stranded`);
		} else if (V.eventResults.aidTarget === "volleyballTeam") {
			r.push(`a student athlete`);
		} else if (V.eventResults.aidTarget === "seizedMission") {
			r.push(`the leader of a group of missionaries`);
		}
		r.push(`in the capital city.`);
		App.Events.addParagraph(node, r);
		r = [];
		if (V.eventResults.aidTarget !== "seizedMission") {
			r.push(`They are deeply worried by the situation. There have been large riots over the past week, and yesterday they became seriously violent. The unrest is targeting`);
			if (V.eventResults.aidTarget === "convent") {
				r.push(`better-off citizens, including the caller. Though most of the nuns have already left, the leader and a few of her women are now stuck in the area and are running out of options as the riots lock down transportation.`);
			} else if (V.eventResults.aidTarget === "school") {
				r.push(`better-off citizens, including the caller. Though most of the students and faculty have already made it out, the principal and a few students are now stuck in the area and are running out of options as the riots lock down transportation.`);
			} else if (V.eventResults.aidTarget === "housewives") {
				r.push(`better-off citizens, including the caller. Though most of them have taken flights out, the leader and a few of them are now stuck in the area and are running out of options as the riots lock down transportation.`);
			} else if (V.eventResults.aidTarget === "maternity") {
				r.push(`better-off citizens, including the caller. Though most of the patients have already left, several of the most pregnant are now stuck in the area and are running out of options as the riots lock down transportation.`);
			} else if (V.eventResults.aidTarget === "conversion") {
				r.push(`better-off citizens, including the caller. Though most of the camp's inmates have already left, a few of them and the owner are now stuck in the area and are running out of options as the riots lock down transportation.`);
			} else if (V.eventResults.aidTarget === "gradeSchool") {
				r.push(`better-off citizens, including the caller. Though most of the other students and faculty escaped, a few of the students are now stuck in the school and are running out of options as the riots steadily creep closer to the grounds.`);
			} else if (V.eventResults.aidTarget === "volleyballTeam") {
				r.push(`vulnerable citizens, including the caller. Their bus broke down on the way to the championship game and all those that have left to get help have not returned. She and her several remaining teammates are running out of options as those looking for easy targets creep ever closer.`);
			}
		} else {
			r.push(`After years of constant rape and abuse, an opening finally arrived for escape when a rival faction raided the decaying church they were stored in, however the situation outside isn't much better. Violent riots are taking place and the mobs are eagerly snatching up what ever loot and women they can get their hands on. She and the remaining women are trapped and in no condition to run; most particularly the youngest of the group who is ripe with child, though she herself and one of the others are also carrying their rapists' babies. They are completely out of options as the looters work their way down the city streets.`);
		}
		r.push(`They beg you to help evacuate them, and promise to pay you once they're out.`);
		App.Events.addParagraph(node, r);
		const price = 10000;

		App.Events.addResponses(node, [
			new App.Events.Result(`Agree`, agree),
			new App.Events.Result(`Do it for free`, free),
			new App.Events.Result(`Airlift them into slavery`, enslave, `This will cost ${cashFormat(price)}`),
		]);

		function agree() {
			const r = [];
			const el = new DocumentFragment();
			cashX(2000, "event");
			repX(1000, "event");
			r.push(`You dispatch your personal VTOL bird immediately. It lands`);
			if (V.eventResults.aidTarget === "volleyballTeam") {
				r.push(`beside the bus`);
			} else {
				r.push(`on the roof of the building`);
			}
			r.push(`they're sheltering in, and brings them across the closest border and into a more functional country. You receive a call expressing their heartfelt thanks and promising to spread the word about how you helped them escape, and a wire transfer of their payment for the airlift.`);
			V.eventResults.aid = -1;
			App.Events.addParagraph(el, r);
			return el;
		}

		function free() {
			const r = [];
			const el = new DocumentFragment();
			repX(2500, "event");
			r.push(`You dispatch your personal VTOL bird immediately. It lands`);
			if (V.eventResults.aidTarget === "volleyballTeam") {
				r.push(`beside the bus`);
			} else {
				r.push(`on the roof of the building`);
			}
			r.push(`they're sheltering in, and brings them across the closest border and into a more functional country. You receive a call expressing their heartfelt thanks, and when you refuse their payment for the airlift, they tearfully promise to tell the story of how you extended charity to those in need, belying the rumors about slaveowners.`);
			V.eventResults.aid = -1;
			App.Events.addParagraph(el, r);
			return el;
		}

		function enslave() {
			const r = [];
			const el = new DocumentFragment();
			r.push(`You send your personal VTOL bird to the shop for some immediate and very expensive modifications to its cargo and passenger area. Since this will take several days, you stall the supplicants.`);
			if (V.eventResults.aidTarget === "volleyballTeam") {
				r.push(`A few of the girls decide to leave, but the sight of them pushed against the wall of a nearby building, toned bodies glistening with sweat and seed as their captors rape them into submission, keep the rest happy to stay on the bus. Those that remained`);
			} else {
				r.push(`Their situation isn't truly dire yet, and they can wait. They`);
			}
			r.push(`are extremely grateful, though they would be less hopeful if they knew the true nature of the aircraft coming to retrieve them.`);
			V.eventResults.aid = 1;
			App.Events.queueEvent(1, new App.Events.pAidResult());
			cashX(forceNeg(price), "event");
			App.Events.addParagraph(el, r);
			return el;
		}
		return node;
	}
};


code:
App.Events.pAidResult = class pAidResult extends App.Events.BaseEvent {
	constructor(actors, params) {
		super(actors, params);
	}

	eventPrerequisites() {
		return []; // always run if queued
	}

	execute(node) {
		let r = [];
		V.eventResults.aid = 2;
		V.nationHate += 2;
		r.push(`You watch on the feeds from your VTOL craft as it settles`);
		if (V.eventResults.aidTarget === "volleyballTeam") {
			r.push(`beside`);
		} else {
			r.push(`onto the roof of`);
		}
		r.push(`the`);
		if (V.eventResults.aidTarget === "convent") {
			r.push(`convent whose remaining women`);
		} else if (V.eventResults.aidTarget === "school") {
			r.push(`girls' school whose remaining students and principal`);
		} else if (V.eventResults.aidTarget === "housewives") {
			r.push(`mansion of the leader of the group of housewives`);
		} else if (V.eventResults.aidTarget === "maternity") {
			r.push(`maternity ward whose remaining patients`);
		} else if (V.eventResults.aidTarget === "conversion") {
			r.push(`religious sexual orientation therapy camp whose inmates and owner`);
		} else if (V.eventResults.aidTarget === "gradeSchool") {
			r.push(`school whose students`);
		} else if (V.eventResults.aidTarget === "volleyballTeam") {
			r.push(`bus whose athletes`);
		} else if (V.eventResults.aidTarget === "seizedMission") {
			r.push(`building the raped missionaries`);
		}
		r.push(`you promised to rescue${(V.eventResults.aidTarget === "seizedMission") ? ` were holed up in` : ``}. Its side doors retract, allowing the escapees to hustle aboard with their bundles of personal possessions. Once they're on board and strapped into their seats, the turbofans howl and the craft peels smoothly off the roof, the hot jet wash setting it alight. Once it transitions fully into level flight, the true plan goes into operation. At a carefully selected moment, injectors concealed within each seat lance into the passengers' buttocks, knocking them out. It works flawlessly, the drugs precisely calibrated to each body based on the weight added to the VTOL as each climbed aboard. This avoids the potential for over- or under-dosage present when using gas or darts to subdue groups. In perfect unison, the passengers slump against the harnesses holding them against the seats.`);
		App.Events.addParagraph(node, r);
		r = [];
		r.push(`When the aircraft lands at your penthouse pad, the would-be escapees are still unconscious. This makes putting them through enslavement physically laborious, though it does cut down on the usual whining; fortunately, you reserved the credits necessary to obscure their questionably legitimate enslavement. By the time they awake, they'll be indistinguishable from any other new slave in the arcology. The possibility remains, however that rumor of the incident will leak out. Your VTOL bird's entry and exit from the capital city was likely noticed and remarked upon.`);
		App.Events.addParagraph(node, r);
		r = [];
		const newSlaves = [];
		let slave;
		if (V.eventResults.aidTarget === "convent") {
			slave = GenerateNewSlave("XX", {minAge: 30, maxAge: 42, disableDisability: 1});
			slave.origin = "$He was the head of a religious community of women you enslaved.";
			slave.career = "a nun";
			slave.devotion = -20;
			slave.trust = random(-90, -75);
			setHealth(slave, jsRandom(-10, 10), undefined, undefined, undefined, 0);
			slave.face = 15;
			slave.anus = 0;
			slave.vagina = 0;
			slave.weight = random(20, 140);
			slave.attrXX = random(60, 90);
			slave.attrXY = random(10, 50);
			slave.energy = random(60, 80);
			slave.skill.vaginal = 0;
			slave.skill.penetrative = 65;
			slave.skill.oral = 35;
			slave.skill.anal = 0;
			slave.skill.whoring = 0;
			slave.skill.entertainment = 0;
			slave.pubicHStyle = "bushy";
			slave.fetish = "dom";
			slave.behavioralFlaw = "devout";
			slave.sexualFlaw = "repressed";
			slave.sexualQuirk = "perverted";
			newSlaves.push(slave);
			const {His} = getPronouns(slave);
			r.push(`In any case, you've enslaved a fine group. The leader is on the older side, but not unattractive. ${His} girls are younger, and probably have all sorts of delightful repressed tendencies to be manipulated.`);
			for (let i = 0; i < 3; i++) {
				slave = GenerateNewSlave("XX", {minAge: 18, maxAge: 24});
				slave.origin = "$He was an initiate in a religious community of women you enslaved.";
				slave.career = "a nun";
				slave.devotion = random(-90, -75);
				slave.trust = -20;
				setHealth(slave, jsRandom(-10, 10), undefined, undefined, undefined, 20);
				slave.anus = 0;
				slave.vagina = 0;
				slave.weight = random(-20, -100);
				slave.attrXX = random(10, 50);
				slave.attrXY = random(10, 50);
				slave.energy = random(5, 20);
				slave.skill.vaginal = 0;
				slave.skill.penetrative = 0;
				slave.skill.oral = 15;
				slave.skill.anal = 0;
				slave.skill.whoring = 0;
				slave.skill.entertainment = 0;
				slave.pubicHStyle = "bushy";
				slave.behavioralFlaw = "devout";
				slave.sexualFlaw = "repressed";
				newSlaves.push(slave);
			}
		} else if (V.eventResults.aidTarget === "school") {
			slave = GenerateNewSlave("XX", {minAge: 26, maxAge: 42, disableDisability: 1});
			slave.origin = "$He was the principal of a girls' school whose remnants you enslaved. A strap-on and a large quantity of personal lubricant were found in $his possession when $he was enslaved.";
			slave.intelligence = random(16, 80);
			slave.intelligenceImplant = 15;
			slave.teeth = "normal";
			slave.career = "a principal";
			slave.devotion = -20;
			slave.trust = random(-90, -75);
			setHealth(slave, jsRandom(-10, 10), undefined, undefined, undefined, 0);
			slave.anus = 1;
			slave.vagina = 1;
			slave.weight = random(20, 80);
			slave.attrXX = random(60, 90);
			slave.attrXY = random(10, 50);
			slave.energy = random(60, 80);
			slave.skill.vaginal = 15;
			slave.skill.penetrative = 15;
			slave.skill.oral = 15;
			slave.skill.anal = 15;
			slave.skill.whoring = 0;
			slave.skill.entertainment = 15;
			slave.pubicHStyle = "waxed";
			slave.fetish = "dom";
			slave.behavioralFlaw = either("arrogant", "bitchy", "hates men", "hates men", "liberated");
			slave.sexualFlaw = "shamefast";
			newSlaves.push(slave);
			const {his} = getPronouns(slave);
			r.push(`In any case, you've enslaved a fine group. The principal is on the older side, and seems to have paid unusually close attention to ${his} appearance, for the female principal of a girls' school. And for whatever reason, the school's uniform skirt seems to have been rather short in back.`);
			for (let i = 0; i < 3; i++) {
				slave = GenerateNewSlave("XX", {maxAge: 18, disableDisability: 1});
				slave.origin = "$He was a student at a girls' school whose remnants you enslaved.";
				slave.career = "a student";
				generateSalonModifications(slave);
				slave.devotion = random(-90, -75);
				slave.trust = -20;
				setHealth(slave, jsRandom(-10, 10), undefined, undefined, undefined, 10);
				slave.anus = 1;
				slave.vagina = either(0, 0, 1);
				slave.weight = random(-50, 0);
				slave.attrXX = 70;
				slave.attrXY = random(10, 70);
				slave.energy = random(50, 70);
				slave.skill.vaginal = 0;
				slave.skill.penetrative = 0;
				slave.skill.oral = 0;
				slave.skill.anal = 15;
				slave.skill.whoring = 0;
				slave.skill.entertainment = 0;
				slave.fetish = "buttslut";
				slave.behavioralFlaw = either("anorexic", "arrogant", "bitchy");
				slave.sexualFlaw = either("hates oral", "idealistic", "shamefast");
				newSlaves.push(slave);
			}
		} else if (V.eventResults.aidTarget === "maternity") {
			for (let i = 0; i < 4; i++) {
				const pram = {mature: 0, disableDisability: 1, ageOverridesPedoMode: 1};
				if (V.pedo_mode === 1) {
					pram.minAge = V.fertilityAge;
				} else {
					pram.minAge = 20;
					pram.maxAge = 39;
				}
				slave = GenerateNewSlave("XX", pram);
				slave.origin = "$He was an expectant mother you enslaved when you evacuated $him from a threatened old world hospital.";
				slave.career = "a housewife";
				slave.devotion = random(-90, -75);
				slave.trust = -20;
				slave.preg = random(28, 40);
				slave.pregType = either(1, 1, 1, 1, 1, 1, 2);
				slave.pregKnown = 1;
				slave.pregWeek = slave.preg;
				SetBellySize(slave);
				setHealth(slave, jsRandom(-10, 10), undefined, undefined, undefined, 50);
				slave.vagina = random(1, 3);
				slave.boobs += 100 * random(0, 2);
				slave.lactation = 1;
				slave.lactationDuration = 2;
				slave.nipples = either("cute", "inverted", "partially inverted", "puffy");
				newSlaves.push(slave);
			}
			r.push(`In any case, you've enslaved a fine group. The expectant mothers vary widely; the only thing they have in common is their gravid bellies. None of them are in really serious condition, either, and they should bear the transition to slave life reasonably well despite their pregnancies.`);
		} else if (V.eventResults.aidTarget === "gradeSchool") {
			r.push(`In any case, you've enslaved a fine group. The girls are all within a similar age range, young, and healthy. Their youth and vigor should make them quite popular.`);
			for (let i = 0; i < 4; i++) {
				const pram = {disableDisability: 1, ageOverridesPedoMode: 1};
				if (V.minimumSlaveAge <= 7) {
					pram.minAge = 7;
					pram.maxAge = 10;
				} else if (V.minimumSlaveAge <= 11) {
					pram.minAge = 11;
					pram.maxAge = 14;
				} else if (V.minimumSlaveAge <= 15) {
					pram.minAge = 15;
					pram.maxAge = 18;
				} else {
					pram.minAge = 18;
					pram.maxAge = 18;
				}
				slave = GenerateNewSlave(null, pram);
				slave.origin = "$He was a student you enslaved when you evacuated $him from a threatened old world grade school.";
				slave.career = "a student";
				generateSalonModifications(slave);
				slave.devotion = random(-90, -75);
				slave.trust = random(-90, -75);
				setHealth(slave, jsRandom(-10, 10), undefined, undefined, 0, jsRandom(40, 70));
				newSlaves.push(slave);
			}
		} else if (V.eventResults.aidTarget === "conversion") {
			r.push(`In any case, you've enslaved a fine group. Certain religious groups persist in the hilarious delusion that it's possible to alter sexual orientation through prayer. In your experience, hormones, drugs, and compliance training are far more effective.`);
			slave = GenerateNewSlave("XY", {disableDisability: 1, minAge: 26, maxAge: 42});
			slave.origin = "$He was the owner of a religious orientation conversion therapy camp whose remnants you enslaved.";
			slave.career = "a business owner";
			slave.devotion = -20;
			slave.trust = random(-90, -75);
			setHealth(slave, jsRandom(-10, 10), undefined, undefined, undefined, 0);
			slave.anus = random(2, 3);
			slave.weight = random(20, 80);
			slave.attrXX = random(10, 50);
			slave.attrXY = 90;
			slave.energy = random(30, 80);
			slave.skill.oral = random(50, 100);
			slave.skill.penetrative = random(50, 100);
			slave.skill.anal = random(50, 100);
			slave.skill.whoring = 0;
			slave.skill.entertainment = random(15, 40);
			slave.pubicHStyle = "waxed";
			slave.fetish = either("submissive", "cumslut", "buttslut");
			slave.fetishStrength = random(60, 90);
			slave.behavioralFlaw = either("arrogant", "bitchy", "hates women", "odd", "liberated");
			slave.sexualFlaw = either("repressed", "shamefast");
			newSlaves.push(slave);
			for (let i = 0; i < 3; i++) {
				slave = GenerateNewSlave("XY", {disableDisability: 1, minAge: 16, maxAge: 18});
				slave.origin = "$He was an inmate at a religious orientation conversion therapy camp whose remnants you enslaved.";
				slave.career = "a student";
				slave.devotion = random(-90, -75);
				slave.trust = -20;
				setHealth(slave, jsRandom(-10, 10), undefined, undefined, undefined, 20);
				slave.anus = 1;
				slave.weight = random(-50, 0);
				slave.attrXX = random(10, 50);
				slave.attrXY = random(60, 90);
				slave.energy = random(30, 70);
				slave.skill.oral = random(15, 40);
				slave.skill.penetrative = random(15, 40);
				slave.skill.anal = random(15, 40);
				slave.skill.whoring = 0;
				slave.skill.entertainment = 0;
				slave.fetish = "buttslut";
				slave.behavioralFlaw = either("anorexic", "bitchy", "devout", "odd");
				slave.sexualFlaw = either("apathetic", "repressed", "shamefast");
				newSlaves.push(slave);
			}
		} else if (V.eventResults.aidTarget === "volleyballTeam") {
			r.push(`In any case, you've enslaved a fine group. The girls are in fine health, fit and just past their majority, likely the reason any that stepped off the bus were promptly abducted. Their youth and vigor should make them quite popular, as will their experience with handling balls.`);
			for (let i = 0; i < 4; i++) {
				slave = GenerateNewSlave("XX", {
					disableDisability: 1, ageOverridesPedoMode: 1, minAge: 18, maxAge: 18
				});
				slave.natural.height = Height.randomAdult(slave, {skew: 1, limitMult: [0.5, 2.5]});
				slave.height = Height.forAge(slave.natural.height, slave);
				slave.origin = "$He was a volleyball player you enslaved when you evacuated $him from a broken down bus.";
				slave.career = "a student athlete";
				generateSalonModifications(slave);
				slave.devotion = random(-90, -75);
				slave.trust = random(-90, -75);
				setHealth(slave, jsRandom(20, 60), 0, 0, undefined, 90);
				slave.muscles = random(20, 40);
				slave.weight = random(-10, 5);
				slave.waist = random(-40, 0);
				slave.boobs = random(3, 5) * 100;
				slave.natural.boobs = slave.boobs;
				slave.butt = random(1, 2);
				newSlaves.push(slave);
			}
		} else if (V.eventResults.aidTarget === "seizedMission") {
			/* leader */
			let pram = new GenerateNewSlavePram();
			pram.mature = 0;
			pram.disableDisability = 1;
			pram.ageOverridesPedoMode = 1;
			pram.race = "white";
			if (V.pedo_mode === 1) {
				pram.minAge = 18;
				pram.maxAge = 24;
			} else {
				pram.minAge = 25;
				pram.maxAge = 39;
			}
			let missLeader = GenerateNewSlave("XX", pram);
			missLeader.origin = "$He was the head nun of a conquered mission. Once claimed, $he was reduced to nothing more than a cum dump for $his black masters.";
			missLeader.career = "a nun";
			missLeader.intelligence = random(16, 80);
			missLeader.intelligenceImplant = 15;
			missLeader.devotion = 40;
			missLeader.trust = random(0, 40);
			setHealth(missLeader, jsRandom(-50, 10), normalRandInt(15, 3), undefined, undefined, 60);
			missLeader.anus = 3;
			missLeader.vagina = 5;
			missLeader.weight = random(-80, -20);
			missLeader.muscles = random(-20, 0);
			missLeader.waist = random(-40, 0);
			missLeader.attrXY = random(0, 10);
			missLeader.energy = random(0, 20);
			missLeader.skill.vaginal = 50;
			missLeader.skill.oral = 75;
			missLeader.skill.anal = 25;
			missLeader.pubicHStyle = "bushy";
			missLeader.underArmHStyle = "bushy";
			missLeader.preg = random(15, 25);
			missLeader.pregType = 1;
			missLeader.pregKnown = 1;
			missLeader.pregWeek = missLeader.preg;
			SetBellySize(missLeader);
			WombFatherRace(missLeader, "black");
			missLeader.counter.birthsTotal = 3;
			missLeader.bellySag = 5;
			missLeader.bellySagPreg = 5;
			missLeader.boobs += 100 * random(1, 3);
			missLeader.lactation = 1;
			missLeader.lactationDuration = 2;
			missLeader.boobShape = "saggy";
			missLeader.nipples = "huge";
			newSlaves.push(missLeader);

			/* preggo */
			if (V.pedo_mode === 1) {
				pram.minAge = 16;
				pram.maxAge = 18;
			} else {
				pram.minAge = 18;
				pram.maxAge = 24;
			}
			slave = GenerateNewSlave("XX", pram);
			slave.origin = "$He was a nun in a felled mission. Once claimed, $he was reduced to nothing more than a cum dump for $his black masters.";
			slave.career = "a nun";
			slave.intelligenceImplant = 15;
			slave.devotion = 30;
			slave.trust = random(-20, 20);
			setHealth(slave, jsRandom(-60, -10), normalRandInt(15, 3), undefined, undefined, 40);
			slave.anus = 3;
			slave.vagina = 4;
			slave.weight = random(-90, -20);
			slave.muscles = random(-50, -20);
			slave.waist = random(-40, 0);
			slave.attrXY = random(0, 10);
			slave.energy = random(0, 20);
			slave.skill.vaginal = 50;
			slave.skill.oral = 75;
			slave.skill.anal = 25;
			slave.pubicHStyle = "bushy";
			slave.underArmHStyle = "bushy";
			slave.preg = random(30, 35);
			slave.pregType = 1;
			slave.pregKnown = 1;
			slave.pregWeek = slave.preg;
			SetBellySize(slave);
			WombFatherRace(slave, "black");
			slave.counter.birthsTotal = 3;
			slave.bellySag = 5;
			slave.bellySagPreg = 5;
			slave.boobs += 100 * random(0, 2);
			slave.lactation = 1;
			slave.lactationDuration = 2;
			slave.boobShape = "saggy";
			slave.nipples = either("cute", "puffy");
			newSlaves.push(slave);

			/* post preggo */
			if (V.pedo_mode === 1) {
				pram.minAge = 16;
				pram.maxAge = 18;
			} else {
				pram.minAge = 19;
				pram.maxAge = 22;
			}
			slave = GenerateNewSlave("XX", pram);
			slave.origin = "$He was a nun in a felled mission. Once claimed, $he was reduced to nothing more than a cum dump for $his black masters.";
			slave.career = "a nun";
			slave.devotion = 50;
			slave.trust = random(0, 50);
			setHealth(slave, jsRandom(-90, -50), normalRandInt(15, 3), undefined, undefined, 80);
			slave.anus = 3;
			slave.vagina = 5;
			slave.weight = random(-90, -60);
			slave.muscles = random(-70, -20);
			slave.waist = random(-10, 0);
			slave.attrXY = random(0, 10);
			slave.energy = random(0, 20);
			slave.skill.vaginal = 50;
			slave.skill.oral = 75;
			slave.skill.anal = 25;
			slave.pubicHStyle = "bushy";
			slave.underArmHStyle = "bushy";
			slave.preg = 0;
			slave.pregWeek = -3;
			slave.counter.birthsTotal = 2;
			slave.bellySag = 5;
			slave.bellySagPreg = 5;
			slave.boobs += 100 * random(1, 3);
			slave.lactation = 1;
			slave.lactationDuration = 1;
			slave.boobsMilk = 200;
			slave.boobs += slave.boobsMilk;
			slave.boobShape = "saggy";
			slave.nipples = either("cute", "puffy");
			newSlaves.push(slave);

			/* young preggo*/
			if (V.minimumSlaveAge < V.fertilityAge) {
				if (V.minimumSlaveAge < 8) {
					pram.minAge = 8;
					pram.maxAge = 8;
				} else {
					pram.minAge = V.fertilityAge;
					pram.maxAge = V.fertilityAge;
				}
			} else {
				if (V.fertilityAge < 8) {
					pram.minAge = 8;
					pram.maxAge = 8;
				} else {
					pram.minAge = V.minimumSlaveAge;
					pram.maxAge = V.minimumSlaveAge;
				}
			}
			const missLoli = GenerateNewSlave("XX", pram);
			missLoli.origin = "$He was a fucktoy held in a felled mission. $He was nothing more than a cum dump to $his black masters.";
			missLoli.career = "an orphan";
			missLoli.devotion = -20;
			missLoli.trust = random(-100, -80);
			setHealth(missLoli, jsRandom(-90, -70), normalRandInt(25, 3), undefined, undefined, 100);
			missLoli.anus = 3;
			missLoli.vagina = 5;
			missLoli.pubertyXX = 1;
			missLoli.weight = random(-100, -60);
			missLoli.muscles = random(-100, -80);
			missLoli.waist = random(-40, -10);
			missLoli.attrXY = random(0, 10);
			missLoli.energy = random(0, 20);
			missLoli.skill.vaginal = 75;
			missLoli.skill.oral = 75;
			missLoli.skill.anal = 50;
			missLoli.pubicHStyle = "bushy";
			missLoli.underArmHStyle = "bushy";
			missLoli.preg = 40;
			missLoli.pregType = 1;
			missLoli.pregKnown = 1;
			missLoli.pregWeek = missLoli.preg;
			SetBellySize(missLoli);
			WombFatherRace(missLoli, "black");
			missLoli.counter.birthsTotal = 0;
			missLoli.bellySag = 5;
			missLoli.bellySagPreg = 5;
			if (missLoli.boobs < 300) {
				missLoli.boobs = 400;
			} else {
				missLoli.boobs += 100;
			}
			missLoli.lactation = 1;
			missLoli.lactationDuration = 2;
			missLoli.boobShape = either("perky", "torpedo-shaped");
			missLoli.nipples = either("cute", "puffy");
			newSlaves.push(missLoli);

			const {he, his, him} = getPronouns(missLeader);
			const {he2, his2, him2, girl2} = getPronouns(missLoli).appendSuffix("2");
			r.push(`In any case, you've enslaved a fine group. The women will clean up nicely and are already accustomed to being raped and abused, so they should bear the transition to slave life reasonably well. The leader is a little older than the rest and clearly has been pregnant several times given the sag to ${his} breasts and the stretch marks coating ${his} swollen belly; it's clear ${he} has a rape baby growing inside ${him}. The next two are younger, but no better off; one is hugely pregnant and the other shows signs of a recent birth. The last, however, is the most eye-catching;`);
			if (V.minimumSlaveAge < 8 && V.fertilityAge < 8) {
				r.push(`${he2} is just a little ${girl2} and a massively pregnant one at that. The leader was right to worry about ${his2} well-being; there is no way ${he2} would survive giving birth.`);
			} else if (V.fertilityAge < 18 && V.minimumSlaveAge < 18) {
				r.push(`${he2} is in no way prepared to be as pregnant as ${he2} is. The leader was right to worry about ${his2} well-being; birth is going to be a struggle for ${him2}.`);
			} else {
				r.push(`${his2} stomach has already dropped and ${he2} clearly has no experience with pregnancy. The leader was right to worry about ${his2} well-being; ${his2} body is ill-suited for childbirth.`);
			}
		} else {
			r.push(`In any case, you've enslaved a fine group. The women seem to have banded together when they were left to fend for themselves in their suburban neighborhood. They're older than many slaves, but they seem to have had rich husbands; they're conventionally pretty, and have lived soft lives that have left them healthy.`);
			for (let i = 0; i < 4; i++) {
				slave = GenerateNewSlave("XX", {disableDisability: 1, minAge: 26, maxAge: 42});
				slave.origin = "$He was a wealthy housewife who you enslaved as $he fled societal collapse.";
				slave.career = "a housewife";
				slave.devotion = -20;
				slave.trust = random(-10, 10);
				setHealth(slave, jsRandom(30, 50), 0, 0, 0);
				slave.anus = 1;
				slave.vagina = random(1, 2);
				slave.weight = random(-20, 20);
				slave.boobs += 100 * random(0, 3);
				slave.butt += random(0, 2);
				slave.attrXX = random(10, 50);
				slave.attrXY = random(60, 90);
				slave.energy = random(20, 80);
				slave.skill.vaginal = 15;
				slave.skill.oral = 15;
				slave.skill.anal = 0;
				slave.skill.whoring = 0;
				slave.skill.entertainment = 15;
				slave.behavioralFlaw = either("anorexic", "arrogant", "bitchy", "liberated");
				slave.sexualFlaw = either("apathetic", "hates anal", "hates oral", "idealistic", "shamefast");
				newSlaves.push(slave);
			}
		}
		App.Events.addParagraph(node, r);

		App.Events.addResponses(node, [
			new App.Events.Result(`Sell your captures immediately`, sell),
			new App.Events.Result(`Enslave them all`, enslave),
		]);
		return node;

		function sell() {
			for (const s of newSlaves) {
				cashX(slaveCost(s), "slaveTransfer");
			}
			return `Prisoners <span class="green">sold.</span>`;
		}

		function enslave() {
			for (const s of newSlaves) {
				newSlave(s); // skip New Slave Intro — TODO: use Bulk Slave Intro
			}
			return `You simply enslave all of the escapees yourself. These slaves will more than make up for the costs you expended, in the long run.`;
		}
	}
};

repo_name: Ducati/fc

license: mit


code:
App.Events.pBadBreasts = class pBadBreasts extends App.Events.BaseEvent {
	constructor(actors, params) {
		super(actors, params);
	}

	actorPrerequisites() {
		return [[
			(s) => ["breast injections", "intensive breast injections", "hyper breast injections"].includes(s.drugs)
		]];
	}

	eventPrerequisites() {
		return [
			() => V.plot === 1,
			() => V.badB !== 1,
			() => App.Events.effectiveWeek() >= 52,
			() => V.seeHyperPreg === 1,
			() => V.seePreg !== 0,
		];
	}

	execute(node) {
		const [slave] = this.actors.map(a => getSlave(a));
		const {He, him} = getPronouns(slave);

		cashX(500 * V.slaves.length, "event");
		V.badB = 1;
		V.slaves.forEach(function(s) {
			if (["breast injections", "hyper breast injections", "intensive breast injections"].includes(s.drugs)) {
				healthDamage(s, Math.floor(Math.random() * 2 + 1));
			}
		});
		let r = [];
		r.push(`Early one morning, you hear heaving coming from one of the bathrooms. On investigation, it seems that ${slave.slaveName} woke up feeling terribly nauseous. ${He}'s in no danger, but you've hardly checked ${him} over before more slaves stagger in. Every one of your slaves on breast-focused A-HGH has been struck by the mysterious malady and has sickened.`);
		App.Events.addParagraph(node, r);
		r = [];
		r.push(`It doesn't take much investigation before you find other slaveowners reporting the same thing. Elementary detective work fingers a particular drug supplier as the culprit, and before long the unfortunate pharmaceutical concern is drowning under a rain of harsh public comment and harsher private contract warfare. As the day wears on, the poor slaves feel much better, and appear positively glowing. However, their breasts swell slightly and their bellies bulge, pointing to the issue being the contamination of the A-HGH production line with fertility agents.`);
		App.Events.addParagraph(node, r);
		r = [];
		r.push(`The firm promptly pays  a large compensation for potentially ruining your slaves. However, you're left with the matter of all the growing bellies to deal with. Over the week, all of your slaves on breast injections show signs of early pregnancy, and hyper pregnancy at that, save those who aren't fertile. They just experienced some hip and ass growth. You have no idea how much fertility agent was in the enhancers but you feel they may become a problem if left alone!`);
		App.Events.addParagraph(node, r);

		App.Events.addResponses(node, [
			new App.Events.Result(`The emotional distress isn't worth the trouble`, keepPreg),
			new App.Events.Result(`Demand further compensation`, wantMoney),
			new App.Events.Result(`Force surgical repairs and compensation`, repair),
		]);

		return node;

		function keepPreg() {
			for (const slave of V.slaves) {
				if (slave.drugs.includes("breast injections")) {
					const isIntense = slave.drugs.includes("intensive");
					const isHyper = slave.drugs.includes("hyper");
					if (canGetPregnant(slave) && slave.vagina !== 0) {
						slave.preg = 1;
						if (isIntense) {
							slave.pregType = random(15, 35);
						} else if (isHyper) {
							slave.pregType = random(20, 45);
						} else {
							slave.pregType = random(10, 25);
						}
						slave.pregKnown = 1;
						slave.pregWeek = 1;
						SetBellySize(slave);
					} else {
						slave.lactation = 1;
						slave.lactationDuration = 2;
						if (slave.geneMods.NCS === 0 && slave.hips < 1) {
							slave.hips++;
							if (isHyper) {
								slave.butt += 2;
							} else {
								slave.butt++;
							}
						}
						if (V.precociousPuberty === 1) {
							if (slave.pubertyXX === 0 && (slave.ovaries === 1 || slave.mpreg === 1)) {
								if (isIntense) {
									slave.pubertyAgeXX -= 1.5;
								} else if (isHyper) {
									slave.pubertyAgeXX -= 2;
								} else {
									slave.pubertyAgeXX--;
								}
								if (slave.geneMods.NCS === 1) {
									if (isIntense) {
										slave.pubertyAgeXX -= 0.75;
									} else if (isHyper) {
										slave.pubertyAgeXX -= 1;
									} else {
										slave.pubertyAgeXX -= 0.5;
									}
								}
							}
							if (slave.pubertyXY === 0 && slave.balls > 0) {
								if (isIntense) {
									slave.pubertyAgeXY += 1.5;
								} else if (isHyper) {
									slave.pubertyAgeXY += 2;
								} else {
									slave.pubertyAgeXY += 1;
								}
								// NCS reduces the male puberty slowing affects
								if (slave.geneMods.NCS === 1) {
									if (isIntense) {
										slave.pubertyAgeXY -= 0.75;
									} else if (isHyper) {
										slave.pubertyAgeXY -= 1;
									} else {
										slave.pubertyAgeXY -= 0.5;
									}
								}
							}
						}
						if (slave.geneMods.NCS === 0) {
							slave.boobs += 300;
						} else {
							slave.boobs += 150;
						}
					}
				}
			}
			return `Since subjecting all the affected slaves to abortions would cause you severe losses, you've decided to let them keep the pregnancies. You hope you are prepared for all the children you'll be producing. Those who couldn't become pregnant gained some breast, hip and ass size, as well as began lactating.`;
		}

		function wantMoney() {
			cashX(2000 * V.slaves.length, "event");
			return `You muster all the contractual remedies available to you and join the crowd of slaveowners laying into the hapless manufacturer. Of course, with so many attackers, there is as much infighting between them as conflict with the helpless enemy, since everyone knows the business will go bankrupt before everyone gets paid. Nevertheless you approximately double the money you make out of the situation, plenty to deal with the pregnancies.`;
		}

		function repair() {
			for (const s of V.slaves) {
				if (canGetPregnant(s)) {
					if (s.drugs === "breast injections") {
						if (s.geneMods.NCS > 0) {
							s.boobs += Math.floor(Math.random() * 10 + 1) * 50;
						} else {
							s.boobs += Math.floor(Math.random() * 10 + 1) * 100;
						}
					} else if (s.drugs === "intensive breast injections") {
						if (s.geneMods.NCS > 0) {
							s.boobs += Math.floor(Math.random() * 10 + 1) * 100;
						} else {
							s.boobs += Math.floor(Math.random() * 10 + 1) * 150;
						}
					} else if (s.drugs === "hyper breast injections") {
						if (s.geneMods.NCS > 0) {
							s.boobs += Math.floor(Math.random() * 10 + 1) * 200;
						} else {
							s.boobs += Math.floor(Math.random() * 10 + 1) * 300;
						}
					}
				}
			}

			return `The hapless manufacturer eventually goes bankrupt. However, you do manage to force surgical correction of the pregnancies before they do. As additional compensation, they agree to naturally enhance your afflicted slaves' busts knowing full well that most buyers are not interested in slaves that have been knocked up. At the managers expense, your slaves move through a top-flight surgeons care and are pregnancy free and sporting larger breasts.`;
		}
	}
};


code:
App.Events.pBadCuratives = class pBadCuratives extends App.Events.BaseEvent {
	constructor(actors, params) {
		super(actors, params);
	}

	actorPrerequisites() {
		return [[
			(s) => { return s.curatives > 1 || s.inflationType === "curative"; }
		]];
	}

	eventPrerequisites() {
		return [
			() => V.plot === 1,
			() => V.badC !== 1,
			() => App.Events.effectiveWeek() >= 14
		];
	}

	execute(node) {
		const [slave] = this.actors.map(a => getSlave(a));
		const {He, him} = getPronouns(slave);

		cashX(500 * V.slaves.length, "event");
		V.badC = 1;
		let r = [];
		r.push(`Early one morning, you hear convulsive dry heaving coming from one of the bathrooms. On investigation, it seems that ${slave.slaveName} woke up feeling terribly nauseous. ${He}'s in no danger, but you've hardly checked ${him} over before more slaves stagger in. Every one of your slaves on curatives has been struck by the mysterious malady and has sickened.`);
		App.Events.addParagraph(node, r);
		r = [];
		r.push(`It doesn't take much investigation before you find other slaveowners reporting the same thing. Elementary detective work fingers a particular drug supplier as the culprit, and before long the unfortunate pharmaceutical concern is drowning under a rain of harsh public comment and harsher private contract warfare. As the day wears on, the poor slaves feel a bit better, but begin to report discomfort in their breasts. Apparently the problem has to do with contamination of the curative production line with A-HGH production reactants.`);
		App.Events.addParagraph(node, r);
		r = [];
		r.push(`The firm promptly pays fair compensation for the minor damage to your slaves' health. However, you're left with the matter of the boobs to deal with. Over the week, all your slaves on curatives experience at least a little breast growth, and some gain several cup sizes.${(V.boughtItem.toys.medicalEnema === 1) ? ` Those with bellies full of curative mixture, on the other hand, have not stopped growing yet and won't until they've completely absorb their load. They will likely end up sporting enormous tits by the end of this.` : ``}`);
		App.Events.addParagraph(node, r);

		App.Events.addResponses(node, [
			new App.Events.Result(`Free breast growth is acceptable`, freeGrowth),
			new App.Events.Result(`Demand further compensation`, wantMoney),
			new App.Events.Result(`Force surgical repairs`, repair),
		]);

		return node;

		function freeGrowth() {
			for (const s of V.slaves) {
				if (s.curatives > 1) {
					if (s.geneMods.NCS > 0) {
						s.boobs += Math.floor(Math.random() * 10 + 1) * 50;
					} else {
						s.boobs += Math.floor(Math.random() * 10 + 1) * 100;
					}
				}
				if (s.inflationType === "curative") {
					if (s.geneMods.NCS > 0) {
						s.boobs += Math.floor(Math.random() * 10 + 1) * 150 * s.inflation;
					} else {
						s.boobs += Math.floor(Math.random() * 10 + 1) * 300 * s.inflation;
					}
				}
				if (s.geneticQuirks.macromastia === 3) {
					s.geneticQuirks.macromastia = 2;
				}
				if (s.geneticQuirks.gigantomastia === 3) {
					s.geneticQuirks.gigantomastia = 2;
				}
			}
			return `Since you're not displeased with the breast expansion, you accept the health compensation and even make discreet inquiries to see of the effect can perhaps be replicated. Unfortunately, it seems that the result that occurred was as much due to luck as anything else. The process cannot be safely marketed.`;
		}

		function wantMoney() {
			cashX(500 * V.slaves.length, "event");
			return `You muster all the contractual remedies available to you and join the crowd of slaveowners laying into the hapless manufacturer. Of course, with so many attackers, there is as much infighting between them as conflict with the helpless enemy, since everyone knows the business will go bankrupt before everyone gets paid. Nevertheless you approximately double the money you make out of the situation.`;
		}

		function repair() {
			return `The hapless manufacturer eventually goes bankrupt. However, you do manage to force surgical repair of the breast expansion before they do. At the manager's expense, your slaves move through a top-flight surgeon's care and are reduced to their former sizes.`;
		}
	}
};


code:
// cSpell:ignore intubations

App.Events.PBioreactorPerfected = class PBioreactorPerfected extends App.Events.BaseEvent {
	eventPrerequisites() {
		return [
			() => V.bioreactorPerfectedID !== 0,
			() => V.bioreactorsAnnounced !== 1,
		];
	}

	actorPrerequisites() {
		return [[
			(s) => s.assignment === Job.DAIRY,
			(s) => s.boobs > 48000,
			(s) => (s.balls === 0 || s.balls >= 10),
			(s) => s.fetish === Fetish.MINDBROKEN,
		]];
	}

	execute(node) {
		let r = [];

		V.nextButton = "Continue";
		V.bioreactorsAnnounced = 1;

		const bioSlave = getSlave(this.actors[0]);

		let bioreactorsXX = 0;
		let bioreactorsXY = 0;
		let bioreactorsHerm = 0;
		let bioreactorsBarren = 0;
		if (bioSlave.ovaries === 1) {
			if (bioSlave.balls === 0) {
				bioreactorsXX = 1;
			} else {
				bioreactorsHerm = 1;
			}
		} else {
			if (bioSlave.balls === 0) {
				bioreactorsBarren = 1;
			} else {
				bioreactorsXY = 1;
			}
		}
		const {
			His, He,
			his, he, him,
		} = getPronouns(bioSlave);
		const {
			HeA, HisA,
			heA, hisA, girlA, himselfA, womanA
		} = getPronouns(assistant.pronouns().main).appendSuffix("A");

		r.push(`When you need peace and quiet to work through a difficult problem, you sometimes take a few minutes to pace through ${V.dairyName}. The massive, gently swaying breasts are always an encouraging sight, and the faint, rhythmic sounds of machine milking, machine feeding, and machine sodomy have a stimulating effect on one's thought processes. When you reach the end of the row of machines for the first time today, you turn to walk back again, and then notice that ${V.assistant.name}'s`);
		if (V.assistant.personality <= 0) {
			r.push(`symbol is visible on a screen across the last cow in the row from you, glowing gently to get your attention.`);
		} else {
			switch (V.assistant.appearance) {
				case "monstergirl":
					r.push(`monster ${girlA} avatar is visible on a screen across the last cow in the row from you, waving cheerfully for your attention with one of ${hisA} hands and a couple of ${hisA} hair-tentacles.`);
					break;
				case "shemale":
					r.push(`shemale avatar is visible on a screen across the last cow in the row from you, waving for your attention. (${HisA} bouncy waving makes ${hisA} ever-erect cock wave too.)`);
					break;
				case "amazon":
					r.push(`amazon avatar is visible on a screen across the last cow in the row from you, jumping up and down for your attention.`);
					break;
				case "businesswoman":
					r.push(`business ${womanA} avatar is visible on a screen across the last cow in the row from you, waving politely for your attention and pointing to a tablet in ${hisA} hand.`);
					break;
				case "fairy":
					r.push(`fairy avatar is visible on a screen across the last cow in the row from you, waving energetically and pointing to a tablet that ${heA}'s sitting on.`);
					break;
				case "pregnant fairy":
					r.push(`pregnant fairy avatar is visible on a screen across the last cow in the row from you, waving energetically and pointing to a tablet that ${heA}'s sitting on.`);
					break;
				case "goddess":
					r.push(`goddess avatar is visible on a screen across the last cow in the row from you, waving demurely for your attention and holding up one of ${hisA} dribbling breasts.`);
					break;
				case "hypergoddess":
					r.push(`goddess avatar is visible on a screen across the last cow in the row from you; ${heA} is aggressively milking ${himselfA} trying to get your attention.`);
					break;
				case "loli":
					r.push(`child avatar is visible on a screen across the last cow in the row from you, jumping up and down for your attention.`);
					break;
				case "preggololi":
					r.push(`child avatar is visible on a screen across the last cow in the row from you, waving ${hisA} arms over ${hisA} head.`);
					break;
				case "angel":
					r.push(`angel avatar is visible on a screen across the last cow in the row from you, waving ${hisA} arms and flapping ${hisA} wings.`);
					break;
				case "cherub":
					r.push(`cherub avatar is visible on a screen across the last cow in the row from you, fluttering back and forth while waving ${hisA} hands.`);
					break;
				case "incubus":
					r.push(`incubus avatar is visible on a screen across the last cow in the row from you, idly rubbing ${hisA} dick with one hand and beckoning you with the other.`);
					break;
				case "succubus":
					r.push(`succubus avatar is visible on a screen across the last cow in the row from you; ${heA} is happily mooning you.`);
					break;
				case "imp":
					r.push(`impish avatar is visible on a screen across the last cow in the row from you, flying back and forth while waving ${hisA} hands.`);
					break;
				case "witch":
					r.push(`witch avatar is visible on a screen across the last cow in the row from you, hopping up and down while waving ${hisA} arms over ${hisA} head.`);
					break;
				case "ERROR_1606_APPEARANCE_FILE_CORRUPT":
					r.push(`avatar is visible on a screen across the last cow in the row from you; ${heA} has produced countless flashing tubercles across ${hisA} body.`);
					break;
				case "schoolgirl":
					r.push(`school${girlA} avatar is visible on a screen across the last cow in the row from you, waving cutely for your attention and pointing to a tablet in ${hisA} hand.`);
					break;
				default:
					r.push(`symbol is visible on a screen across the last cow in the row from you, spinning and glowing gently to get your attention.`);
			}
		}
		App.Events.addParagraph(node, r);
		r = [];
		if (V.assistant.personality <= 0) {
			if (V.PC.title === 1) {
				r.push(`"Sir,"`);
			} else {
				r.push(`"Madam,"`);
			}
			r.push(`${heA} says, "I have a matter for your attention, concerning this slave."`);
		} else {
			if (V.PC.title === 1) {
				r.push(`"Sir,"`);
			} else {
				r.push(`"Ma'am,"`);
			}
			r.push(`${heA} says, "I'd like to ask you something about this slave."`);
		}
		r.push(`You stop and consider the cow, from ${his} titanic breasts to ${his}`);
		if (bioSlave.balls >= 10 && bioSlave.scrotum > 0) {
			r.push(`swollen balls`);
		} else if (bioSlave.vagina > -1) {
			r.push(`slavering cunt`);
		} else {
			r.push(`distended stomach`);
		}
		r.push(`to ${his} dildo-filled anus.`);
		if (V.assistant.personality <= 0) {
			r.push(`"This slave is permanently dependent on ${his} milking machine," it continues. "${He} cannot be removed without uneconomical expenditures, and is unlikely to be useful elsewhere. Additionally, there is nothing more that can be done to make ${his} breasts any`);
			if (bioSlave.balls >= 10) {
				r.push(`bigger or ${his} testicles any more productive.`);
			} else if (bioSlave.ovaries === 1) {
				r.push(`bigger or ${his} womb any more productive.`);
			} else {
				r.push(`bigger.`);
			}
			r.push(`${His} development is essentially final, and that status can be made official. ${He} could be redesignated as equipment. Other than ${his} designation, this would make little difference: the machine would be slightly less cautious with ${his} drugs, future intubations, and such. ${He} would be removed from the slave lists."`);
		} else {
			r.push(`"${He}'s never leaving here, not without surgery. And even then, ${he}'s forgotten almost everything, and ${he} won't be getting it back."`);
			switch (V.assistant.appearance) {
				case "monstergirl":
					r.push(`The monster${girlA} positions ${himselfA} on the screen to create an optical illusion that makes it look like ${heA}'s gently petting the slave's shoulders. ${HeA} looks meditative.`);
					break;
				case "shemale":
					r.push(`The shemale positions ${himselfA} on the screen to create an optical illusion that makes it look like ${heA}'s gently petting the slave's shoulders. ${HeA} looks uncharacteristically meditative.`);
					break;
				case "amazon":
					r.push(`The amazon positions ${himselfA} on the screen to create an optical illusion that makes it look like ${heA}'s gently petting the slave's shoulders. ${HeA} looks meditative.`);
					break;
				case "businesswoman":
					r.push(`The business${womanA} positions ${himselfA} on the screen to create an optical illusion that makes it look like ${heA}'s gently petting the slave's shoulders. ${HeA} looks meditative.`);
					break;
				case "fairy":
					r.push(`The fairy positions ${himselfA} on the screen to create an optical illusion that makes it look like ${heA}'s standing on ${his} shoulder and hugging ${his} cheek.`);
					break;
				case "pregnant fairy":
					r.push(`The pregnant fairy positions ${himselfA} on the screen to create an optical illusion that makes it look like ${heA}'s standing on ${his} shoulder and hugging ${his} cheek.`);
					break;
				case "goddess":
					r.push(`The goddess positions ${himselfA} on the screen to create an optical illusion that makes it look like ${heA}'s gently caressing the slave's shoulders. ${HeA} looks meditative.`);
					break;
				case "hypergoddess":
					r.push(`The goddess positions ${himselfA} on the screen to create an optical illusion that makes it look like ${heA}'s gently caressing the slave's shoulders. ${HeA} looks meditative.`);
					break;
				case "loli":
					r.push(`The little ${girlA} positions ${himselfA} on the screen to create an optical illusion that makes it look like ${heA}'s gently petting the slave's shoulders. ${HeA} looks meditative.`);
					break;
				case "preggololi":
					r.push(`The little ${girlA} positions ${himselfA} on the screen to create an optical illusion that makes it look like ${heA}'s gently petting the slave's shoulders. ${HeA} looks meditative.`);
					break;
				case "angel":
					r.push(`The angel positions ${himselfA} on the screen to create an optical illusion that makes it look like ${heA}'s gently caressing the slave. ${HeA} looks meditative.`);
					break;
				case "cherub":
					r.push(`The cherub positions ${himselfA} on the screen to create an optical illusion that makes it look like ${heA}'s gently petting the slave's shoulders while hovering over them. ${HeA} looks meditative.`);
					break;
				case "incubus":
					r.push(`The incubus positions ${himselfA} on the screen to create an optical illusion that makes it look like ${heA}'s gently groping the slave's rear. ${HeA} looks uncharacteristically meditative.`);
					break;
				case "succubus":
					r.push(`The succubus positions ${himselfA} on the screen to create an optical illusion that makes it look like ${heA}'s resting ${hisA} breasts on the slave's head. ${HeA} looks uncharacteristically meditative.`);
					break;
				case "imp":
					r.push(`The imp positions ${himselfA} on the screen to create an optical illusion that makes it look like ${heA}'s gently rubbing the slave's shoulders while hovering over them. ${HeA} looks uncharacteristically meditative.`);
					break;
				case "witch":
					r.push(`The witch positions ${himselfA} on the screen to create an optical illusion that makes it look like ${heA}'s gently caressing the slave's shoulders. ${HeA} looks meditative.`);
					break;
				case "ERROR_1606_APPEARANCE_FILE_CORRUPT":
					r.push(`It positions ${himselfA} on the screen to create an optical illusion that makes it look like ${heA}'s gently caressing the slave's breasts and groin with fleshy tentacles. ${HeA} looks uncharacteristically meditative.`);
					break;
				case "schoolgirl":
					r.push(`The school${girlA} positions ${himselfA} on the screen to create an optical illusion that makes it look like ${heA}'s gently petting the slave's shoulders. ${HeA} looks uncharacteristically meditative.`);
					break;
				default:
					r.push(`The symbol on the screen dissolves down to create a gentle backlight behind the slave.`);
			}
			r.push(`"${He}'s beautiful, isn't ${he}? Perfect. There's nothing more that can be done, to make ${his} udders any`);
			if (bioSlave.balls >= 10) {
				r.push(`bigger or ${his} balls any more productive`);
			} else if (bioSlave.ovaries === 1) {
				r.push(`bigger or ${his} womb any more productive`);
			} else {
				r.push(`bigger.`);
			}
			r.push(`${He}'s complete, and ${he}'s part of this machine now, and that's all ${he}'ll ever be. I can make that status official,`);
			if (V.PC.title === 1) {
				r.push(`Sir.`);
			} else {
				r.push(`Ma'am.`);
			}
			r.push(`I'd redesignate ${him} as equipment. It wouldn't change much, other than a designation. I'd just be a little less cautious with ${his} drugs, future intubations, things like that. But for slave purposes, ${he}'d be gone. Just a part of ${V.dairyName}, forever. Or, until ${he} wears out in`);
			if (V.retirementAge - bioSlave.physicalAge <= 3) {
				r.push(`in a few years."`);
			} else if (V.retirementAge - bioSlave.physicalAge <= 10) {
				r.push(`in a decade or so."`);
			} else if (V.retirementAge - bioSlave.physicalAge >= 20) {
				r.push(`in a couple of decades."`);
			} else {
				r.push(`in."`);
			}
		}

		App.Events.addParagraph(node, r);

		const choices = [];
		choices.push(new App.Events.Result(`Do it, and do it to all maximized dairy slaves`, doAll, isShelterSlave(bioSlave) ? `This will violate your contract with the Slave Shelter.` : ``));
		choices.push(new App.Events.Result(`No, leave ${him} as ${he} is`, no));
		App.Events.addResponses(node, choices);

		function doAll() {
			const frag = new DocumentFragment();
			let r = [];
			r.push(`Your assistant pauses, and then says, "Redesignation complete, ${properTitle()}. This milking machine has been equipped with biological components. This combination is projected to produce approximately`);
			if (bioSlave.balls > 0) {
				r.push(`${1000 * Math.trunc((3 * 52 * (V.retirementAge - bioSlave.physicalAge)) / 1000)} liters of cum,`);
			}
			if (bioSlave.ovaries === 1) {
				r.push(`${100 * Math.trunc((52 * (V.retirementAge - bioSlave.physicalAge)) / 100)} liters of vaginal secretions,`);

				r.push(`${5 * (V.retirementAge - bioSlave.physicalAge)} slaves,`);
			}
			r.push(`and ${1000 * Math.trunc((300 * 52 * (V.retirementAge - bioSlave.physicalAge)) / 1000)} liters of milk over a ${V.retirementAge - bioSlave.physicalAge} year period before its biological components must be replaced."`);
			if (V.assistant.personality > 0) {
				switch (V.assistant.appearance) {
					case "monstergirl":
						r.push(`${HisA} avatar watches the new equipment with almost motherly affection, ${hisA} tentacle hair writhing obscurely.`);
						break;
					case "shemale":
						r.push(`${HisA} avatar sits down and produces a glass of milk. ${HeA} drains it in one long chug, and then begins to jerk off.`);
						break;
					case "amazon":
						r.push(`${HisA} avatar sits down with a clatter of bone ornaments, produces a skin of milk, and takes a long pull.`);
						break;
					case "businesswoman":
						r.push(`${HisA} avatar stands on the screen, watching the new equipment with an air of satisfaction.`);
						break;
					case "fairy":
						r.push(`${HisA} avatar hovers around, humming a tune while checking the new equipment.`);
						break;
					case "pregnant fairy":
						r.push(`${HisA} avatar hovers around, humming a soft tune while checking the new equipment.`);
						break;
					case "goddess":
						r.push(`${HisA} avatar sits down, kneading ${hisA} milky tits in empathy, a hint of simulated jealousy in the way ${heA} watches the new equipment.`);
						break;
					case "hypergoddess":
						r.push(`${HisA} avatar sits down, kneading ${hisA} milky tits in empathy, a hint of simulated jealousy in the way ${heA} watches the new equipment.`);
						break;
					case "loli":
						r.push(`${HisA} avatar sits down, rubbing ${hisA} flat chest sadly as ${heA} watches the new equipment.`);
						break;
					case "preggololi":
						r.push(`${HisA} avatar sits down, pinching ${hisA} milky nipples in empathy, a hint of simulated jealousy in the way ${heA} watches the new equipment.`);
						break;
					case "angel":
						r.push(`${HisA} avatar blushes as ${heA} watches the new equipment. "${He}'ll feed so many hungry mouths..."`);
						break;
					case "cherub":
						r.push(`${HisA} avatar blushes at the sight of the new equipment. ${HeA} quickly buries ${hisA} face in ${hisA} palms at the perversion.`);
						break;
					case "incubus":
						r.push(`${HisA} avatar starts jerking off to the sight of the new bioreactor. ${HeA} throws you a smirk, "But you like MY milk best, don't you?"`);
						break;
					case "succubus":
						r.push(`${HisA} avatar rubs ${hisA} breasts, steadily swelling them until a gush of milk escapes ${hisA} nipples. "Mine will always be your favorite."`);
						break;
					case "imp":
						r.push(`${HisA} avatar licks ${hisA} lips at the new equipment, longing to taste it.`);
						break;
					case "witch":
						r.push(`${HisA} avatar sits down and brings ${hisA} hands to ${hisA} breasts wondering if ${heA} could make them big and milky for you too.`);
						break;
					case "ERROR_1606_APPEARANCE_FILE_CORRUPT":
						r.push(`${HisA} avatar's breasts steadily begin swelling, ${hisA} belly following not long after. Once it is similar in size to the new equipment, a pair of tentacles extend from ${hisA} back and clamp onto ${hisA} nipples, eagerly suckling milk from ${hisA} unnatural udders.`);
						break;
					case "schoolgirl":
						r.push(`${HisA} avatar sits down, watching the new equipment with an air of embarrassment. The school${girlA} blushes, and begins to masturbate.`);
						break;
					default:
						r.push(`${HisA} avatar symbol returns to gentle spinning, doing so in synchrony with the undulations of the new equipment's breasts.`);
				}
			}
			r.push(`"Future redesignations can always be disabled from ${V.dairyName} interface."`);
			V.bioreactorsXX += bioreactorsXX;
			V.bioreactorsXY += bioreactorsXY;
			V.bioreactorsHerm += bioreactorsHerm;
			V.bioreactorsBarren += bioreactorsBarren;
			if (isShelterSlave(bioSlave)) {
				V.shelterAbuse++;
			}
			removeSlave(bioSlave);
			V.createBioreactors = 1;
			App.Events.addParagraph(frag, r);
			return frag;
		}

		function no() {
			const frag = new DocumentFragment();
			let r = [];
			r.push(`"Yes, ${(V.PC.title === 1) ? "sir" : "ma'am"}," your assistant confirms. "This option will remain accessible from ${V.dairyName}'s control interface, if you reconsider."`);

			App.Events.addParagraph(frag, r);
			return frag;
		}

		App.UI.DOM.appendNewElement("h3", node, `${His} records...`);
		/* Copied and modified from dairyReport, should be kept in sync manually to be*/

		/* Income section */
		let cash = 0;

		/* Cum */
		let seed = (100 * bioreactorsXY) + (100 * bioreactorsHerm);
		if (V.arcologies[0].FSPastoralistLaw === 1) {
			cash += seed * random(40, 50);
		} else if (FutureSocieties.isActive('FSPastoralist')) {
			cash += seed * (random(25, 35) + Math.trunc(V.arcologies[0].FSPastoralist / 10));
		} else {
			cash += seed * random(25, 35);
		}

		/* FemCum */
		seed = (2 * bioreactorsXX) + (2 * bioreactorsHerm);
		if (V.arcologies[0].FSPastoralistLaw === 1) {
			cash += seed * random(40, 50);
		} else if (FutureSocieties.isActive('FSPastoralist')) {
			cash += seed * (random(25, 35) + Math.trunc(V.arcologies[0].FSPastoralist / 10));
		} else {
			cash += seed * random(25, 35);
		}

		/* Milk */
		seed = (800 * bioreactorsXX) + (700 * bioreactorsBarren) + (600 * bioreactorsXY) + (600 * bioreactorsHerm);
		if (FutureSocieties.isActive('FSPastoralist')) {
			if (V.arcologies[0].FSPastoralistLaw === 1) {
				cash += seed * (13 + Math.trunc(V.arcologies[0].FSPastoralist / 30));
			} else {
				cash += seed * (8 + Math.trunc(V.arcologies[0].FSPastoralist / 30));
			}
		} else {
			cash += seed * 9;
		}
		App.UI.DOM.appendNewElement("p", node,
			App.Events.makeNode([`As a bioreactor, she might gross ${cashFormatColor(cash)} and cost just ${cashFormatColor(-100)}, bringing in ${cashFormatColor(cash - 100)}`]),
			["indent", "note"]
		);

		App.UI.DOM.appendNewElement("p", node, `${His} current task is to ${bioSlave.assignment}${(V.assignmentRecords[bioSlave.ID]) ? `, and before that to ${V.assignmentRecords[bioSlave.ID]}` : ""}.`, "indent");

		node.append(slaveExpenses(bioSlave));
	}
};


code:
App.Events.PBodyswapReveal = class PBodyswapReveal extends App.Events.BaseEvent {
	eventPrerequisites() {
		return [
			() => App.Events.effectiveWeek() > 45,
			() => V.bodyswapAnnounced === 0,
			() => V.surgeryUpgrade === 1,
		];
	}

	execute(node) {
		V.nextButton = "Continue";

		V.bodyswapAnnounced = 1;
		App.Events.addParagraph(node, [`You receive countless messages throughout the day; mostly worthless spam, several uninteresting business offers and the occasional enslavement request. This one catches your eye however. It's an offer from a top surgeon who has recently been experimenting with radical new surgeries. You've been loosely following their work for the last few weeks, ever since they successfully swapped the consciousness from one slave to another with minimal side effects, assuming they are kept on a special suppressant, and it seems they are now offering their work to anyone with a surgical suite capable of performing the surgery and willing to undertake the risk.`]);

		App.Events.addParagraph(node, [`It's an interesting offer and your remote surgery will suffice should you want to change up your slaves' bodies more than any drug or implant ever could. You'll need a slave to swap them with, however. Perhaps one of the mindless slaves from the Flesh Heap will suit your needs, should you not wish to use your own stock.`]);
	}
};


code:
App.Events.PCorpAnnouncement = class PCorpAnnouncement extends App.Events.BaseEvent {
	eventPrerequisites() {
		return [
			() => V.cash > 120000,
			() => V.rep > 4000,
			() => V.corp.Announced === 0,
		];
	}

	execute(node) {
		V.nextButton = "Continue";

		V.corp.Announced = 1;
		App.Events.addParagraph(node, [`You never understood the power of money until accumulating so much of it yourself. If you were to try to explain it to someone without that power, you would emphasize the access it buys you. You can speak to anyone, about anything; propose anything, to anyone. And recently, you have begun to encounter the trouble of being too powerful.`]);

		App.Events.addParagraph(node, [`Good investment opportunities are hard to come by in the uncertain world of today. The days of government bonds providing steady yields are ending. Markets are volatile, and under attack by forces they cannot begin to control or anticipate. In places, the very consensus on modern capitalism that has held for nearly fifty years is under siege. There's one reliable growth market in the Free Cities: slaves. And there's too much capital chasing too few investment opportunities in that market.`]);

		App.Events.addParagraph(node, [`Reviewing the situation from your desk, the nerve center of your growing empire, you think to yourself: why not? You have the reputation and the capital to become a major player in the slave market, just for the asking. If you announced the incorporation of a publicly traded company dedicated to the industry of slavery, Free Cities investors would be lining up, cash in hand, ready to buy stock.`]);
	}
};


code:
App.Events.PDefenseFears = class PDefenseFears extends App.Events.BaseEvent {
	eventPrerequisites() {
		return [
			() => V.mercenaries < 3
		];
	}

	execute(node) {
		V.nextButton = " "; /* hide button until user makes a selection */
		V.fcnn.push("...hiring mercenaries to act as a defensive force against the old world...");

		App.Events.addParagraph(node, [`A deputation of slaveowning citizens comes to see you. Though they haven't experienced anything so disturbing as your dealings with the Daughters of Liberty, rumors of unrest and revolution are running through the Free Cities. They are upset with the lack of troops to protect the arcology. This is quite a development in the young history of Free Cities society; only a few months ago, the idea of collective defense would have been a bitterly controversial one. It's still an employer's market for mercenaries; you could easily hire some. Alternatively, your citizens would probably agree to fund them by subscription — the word "taxes" would be impolitic.`]);

		App.Events.addParagraph(node, [
			App.UI.DOM.makeElement("span", "This is a unique and very important opportunity", "bold"),
			`and must not be taken lightly.`
		]);

		const choices = [];
		choices.push(new App.Events.Result(`Install a full platoon by subscription`, subscription));
		choices.push(
			new App.Events.Result(
				`Install a full platoon at your expense`, yourExpense, App.Events.makeNode([`This will cost ${cashFormat(10000)} and ${(V.PC.skill.warfare >= 100 || V.PC.career === "arcology owner") ? `some upkeep, reduced by your mercenary contacts` : `incur significant upkeep costs`}`])
			)
		);
		choices.push(new App.Events.Result(`Refuse to quarter so many troops in your arcology`, plead3rd));
		App.Events.addResponses(node, choices);

		function subscription() {
			V.nextButton = "Continue";
			App.Utils.updateUserButton();/* unlock Continue button */
			repX(-500, "event");
			V.mercenaries = 3;
			return `You hire a full platoon of reputable mercenaries and a veteran officer to command them, kit them in excellent gear, and quarter them in the arcology. Their pay is on an escrow basis; the huge lump sum you paid will serve to secure them, and its interest will constitute their pay. The sight of many armed men on patrol has reassured the worried slaveowners, but they are resentful of having to take this step themselves.`;
		}

		function yourExpense() {
			V.nextButton = "Continue";
			App.Utils.updateUserButton();/* unlock Continue button */
			repX(2500, "event");
			cashX(-10000, "mercenaries");
			V.mercenaries = 3;
			return `You hire a full platoon of reputable mercenaries and a veteran officer to command them, kit them in excellent gear, and quarter them in the arcology. Their pay is on an escrow basis; the huge lump sum you paid will serve to secure them, and its interest will constitute their pay. The sight of many armed men on patrol has reassured the worried slaveowners, and they are grateful to you for seeing to their defense.`;
		}

		function plead3rd() {
			V.nextButton = "Continue";
			App.Utils.updateUserButton();/* unlock Continue button */
			V.arcologies[0].prosperity = Math.trunc(V.arcologies[0].prosperity * 0.8);
			repX(-1000, "event");
			return `The consensus that the arcology is vulnerable triggers an <span class="red">exodus</span> of your most wealthy and valuable citizens, and your reputation <span class="red">suffers</span> grievously.`;
		}
	}
};


code:
App.Events.PFSAnnouncement = class PFSAnnouncement extends App.Events.BaseEvent {
	eventPrerequisites() {
		return [
			() => App.Events.effectiveWeek() > 5,
			() => V.rep > 3000,
			() => V.FSAnnounced === 0
		];
	}

	execute(node) {
		V.nextButton = "Continue";

		V.FSAnnounced = 1;
		V.FSGotRepCredits = 1;

		App.Events.drawEventArt(node, "assistant");

		const {heA} = getPronouns(assistant.pronouns().main).appendSuffix("A"); // Assistant Awakens doesn't have a rep requirement, but this event does. It's possible for them to trigger in either order.
		App.Events.addParagraph(node, [`The simple pleasure of power has to be experienced to be understood. You often take a moment to stand on a balcony overlooking an interior atrium, watching the living, breathing, flowing current of your demesne. ${capFirstChar(V.assistant.name)} knows to allow you these moments of peace.`]);

		App.Events.addParagraph(node, [`You immediately pay attention, therefore, when ${heA} interrupts. "${properTitle()}," ${heA} says, "this is an appropriate moment to bring a serious matter to your attention. I monitor conversations, social media, and general opinion within the arcology where I can. You are respected, and the inhabitants of this arcology are starting to look to you to give direction to society."`]);

		App.Events.addParagraph(node, [`"This is not a situation that requires your attention," ${heA} continues. "You can continue to lead them by simple example. Or, you can take a more active role in defining the future. The rewards could be considerable. I will make the necessary additions to the arcology management interface to support societal modification."`]);
	}
};


code:
App.Events.PInvasion = class PInvasion extends App.Events.BaseEvent {
	execute(node) {
		let r = [];
		V.nextButton = "Continue";
		V.invasionVictory = 1;
		const {
			HeA, HisA,
			heA, hisA, womanA
		} = getPronouns(assistant.pronouns().main).appendSuffix("A");
		const newSlaves = [];
		const ravineArc = V.terrain === "ravine";

		r.push(`The day that wasn't supposed to come is here. The troubled little country next door is falling apart. Last month, its stock market collapsed. Last week, its government fell. Yesterday, there was open looting in its cities. And today, a faction of disaffected citizens that blames the Free Cities for siphoning off business and causing the collapse seized weapons from unguarded army depots${(V.terrain === "marine" || V.terrain === "oceanic") ? ", armed merchant ships and private vessels, and are approaching the Free City over the water." : " and advanced towards your home."}`);
		App.Events.addParagraph(node, r);

		r = [];
		r.push(`Sirens are blaring; there is a crump far above as ${V.arcologies[0].name}'s defensive systems knock down one of the first mortar rounds fired into the Free City. The lights in your office changed to a harsh emergency scheme as soon as the attack became a certainty.`);
		if (V.assistant.personality <= 0) {
			r.push(`Your personal assistant offers terse reports on the efficiency of the point defense fire.`);
		} else {
			r.push(`You get a report on the artillery battle from ${V.assistant.name}, whose avatar is showing off ${hisA} prowess at point defense.`);
			switch (V.assistant.appearance) {
				case "monstergirl":
					r.push(`${HisA} tentacle hair is spread out and forward, forming a concave shape around ${hisA} face, and ${heA}'s firing beams from ${hisA} eyes`);
					break;
				case "shemale":
					r.push(`${HeA}'s using both hands to aim ${hisA} massive erection, and is firing blasts of cum`);
					break;
				case "amazon":
					r.push(`${HeA}'s holding a hide shield and a club, which ${heA}'s using to swat`);
					break;
				case "businesswoman":
					r.push(`${HeA} looks as immaculate as ever. The stern little business${womanA} is cradling an expensive fowling piece, which ${heA}'s using to fire`);
					break;
				case "fairy":
					r.push(`${HeA} zips around in the air, getting in close to fire a barrage of little balls of light`);
					break;
				case "pregnant fairy":
					r.push(`Striking a match almost half as long as ${heA} is, ${heA} happily skips along a line of fireworks and lights them as ${heA} goes. One by one they blast off and fly into the sky`);
					break;
				case "goddess":
					r.push(`${HisA} expression is one of affronted maternal protectiveness, and ${heA}'s using outstretched hands to project beams of pure light`);
					break;
				case "hypergoddess":
					r.push(`${HisA} expression is one of affronted maternal protectiveness, and ${heA}'s using outstretched hands to project beams of pure light`);
					break;
				case "loli":
					r.push(`${HeA}'s wearing an annoyed expression and is pretending to shoot ${hisA} fingers`);
					break;
				case "preggololi":
					r.push(`${HeA}'s wearing a tired expression and is pretending to shoot ${hisA} fingers`);
					break;
				case "schoolgirl":
					r.push(`${HeA}'s wearing a fierce expression and holding a baseball bat, using it to swat`);
					break;
				case "angel":
					r.push(`${HeA} has ${hisA} wings spread to safeguard your arcology and firing beams of holy light`);
					break;
				case "cherub":
					r.push(`${HeA} is darting around, firing beams of holy light`);
					break;
				case "incubus":
					r.push(`${HeA} is carefully aiming ${hisA} cumshots`);
					break;
				case "succubus":
					r.push(`${HeA} is flying around, using ${hisA} rear to catch depictions of projectiles and moaning lewdly with each hit.`);
					break;
				case "imp":
					r.push(`${HeA} is darting around, throwing balls of darkness`);
					break;
				case "witch":
					r.push(`${HeA} is using a broom to swat`);
					break;
				case "ERROR_1606_APPEARANCE_FILE_CORRUPT":
					r.push(`${HeA} has split into countless fleshy tendrils and is rapidly swinging`);
					break;
				default:
					r.push(`The symbol radiates readouts of ammunition, power, and targeting, clean lines flashing`);
			}
			if (V.assistant.appearance !== "succubus") {
				r.push(`at depictions of projectiles.`);
			}
		}
		r.push(`It's going well. Whoever's in command of the attackers sees that their fire is having no effect, and orders an advance. The mortars and other artillery systems maintain their fire, trying to occupy as many guns as possible.`);
		App.Events.addParagraph(node, r);

		r = [];
		r.push(`The loose militia lately organized by the arcology owners has been called out to defend the city. Its commander, seeing that the attackers have more passion than tactical skill, orders an immediate counterattack by anyone able${(V.terrain === "marine" || V.terrain === "oceanic") ? " to push the invaders landing in the dock areas back into the sea" : ""}. Technology has advanced to the point that rich militiamen who buy their own gear can form a powerful fighting force. With luck, the counterattack should shatter the enemy.`);
		App.Events.addParagraph(node, r);

		r = [];
		if (V.personalArms === 0) {
			r.push(`Since you are not well armed or armored, you stay back and oversee the defense of your own arcology.`);
		} else if (V.personalArms === 1) {
			r.push(`Since you are well armed and armored, you take part in the counterattack. Your exoskeleton mounts a smart mortar system that independently targets and eliminates enemy groups even as you lay down fire from the guns mounted on your forearms.`);
		} else {
			r.push(`Since you are well armed and armored and your drones are combat ready, you take part in the counterattack. You are preceded into combat by a wedge of your drones, which lack the intelligence to take good cover but are remorseless and highly accurate. Your exoskeleton mounts a smart mortar system that independently targets and eliminates enemy groups even as you lay down fire from the guns mounted on your forearms.`);
		}
		App.Events.addParagraph(node, r);

		r = [];
		if (V.mercenaries === 0) {
			r.push(`You are alone in contributing to the defense of your home.`);
		} else if (V.mercenaries >= 1) {
			r.push(`Your mercenaries see to the defense of ${V.arcologies[0].name}, ensuring that nothing that gets through will do truly serious damage.`);
			if (V.mercenaries > 1) {
				r.push(`There are enough of them that they can even spare a squad to accompany the counterattack. They're mostly old veterans of many bitter brush wars, and they go about the bloody business with the air of men and women who saw their first battlefield long before their hair was shot with grey.`);
			}
		}
		App.Events.addParagraph(node, r);

		r = [];
		if (V.mercenaries + V.personalArms < 2) {
			r.push(`The counterattack fails. The enemy is eventually defeated, but only after they get mired in urban combat in the streets of the Free City. ${V.arcologies[0].name} takes considerable damage from`);
			r.push(`${ravineArc ? 'cliffside' : 'stray'} fire, and many supplies have been lost or stolen.</span> The repairs will be extremely costly.`);
			App.Events.addParagraph(node, r);
			cashX(forceNeg(Math.trunc(V.cash * (ravineArc ? 0.8 : 0.9))), "war");
			cashX(ravineArc ? -50000 : -10000, "war");
		} else if (V.mercenaries + V.personalArms < 6) {
			r.push(`The counterattack succeeds. ${V.arcologies[0].name} takes minor damage from stray fire, but the repairs are not too costly. Your participation in the counterattack that saved the Free City was noted, and you are acclaimed as a protector of its people.`);
			App.Events.addParagraph(node, r);
			V.invasionVictory = 2;
			V.PC.skill.combat = Math.min(V.PC.skill.combat + 10, 100);
			cashX(forceNeg(Math.trunc(V.cash * 0.2)), "war");
			cashX(-5000, "war");
			repX(5000, "event");
			if (V.maximumRep < 20000) {
				r.push(`This helps <span class="green">ingrain yourself as the arcology's leader.</span>`);
				V.maximumRep += 2000;
			}
		} else {
			r.push(`The counterattack is a crushing success. Your mercenary squad and your drones form an irresistible phalanx around you that smashes everything it touches. The enemy is put to flight, and you send your drones racing ahead to take captives. By law these are shared among the militia. There is talk that your contributions deserve more than a few wretched slaves in reward. A public subscription pays for the damage ${V.arcologies[0].name} took from stray fire, and you are acclaimed a hero.`);
			App.Events.addParagraph(node, r);
			V.invasionVictory = 3;
			V.PC.skill.combat = Math.min(V.PC.skill.combat + 10, 100);
			repX(10000, "event");
			if (V.maximumRep < 20000) {
				r.push(`This goes a long way in <span class="green">establishing yourself as a leader.</span>`);
				V.maximumRep += 5000;
			}

			for (let i = 0; i < 3; i++) {
				const slave = GenerateNewSlave((random(0, 99) < V.seeDicks) ? "XY" : "XX", {disableDisability: 1});
				slave.origin = "$He is an enslaved prisoner of war.";
				newSlaves.push(slave);
			}
			V.menials += 5;
			addTrinket("a shot-torn flag of the failed nation whose militants attacked the Free City");

			App.Events.addResponses(node, [
				new App.Events.Result(`Sell your prisoners immediately`, sell),
				new App.Events.Result(`Give your prisoners to citizens who displayed bravery during the counterattack`, give),
				new App.Events.Result(`Enslave all of your prisoners`, enslave),
			]);
		}
		function sell() {
			newSlaves.forEach(s => cashX(slaveCost(s), "slaveTransfer"));
			return `Prisoners sold.`;
		}

		function give() {
			newSlaves.forEach(s => repX(Math.trunc(slaveCost(s) / 2), "event"));
			return `Prisoners <span class="green">given away.</span>`;
		}

		function enslave() {
			newSlaves.forEach(s => newSlave(s)); // skip New Slave Intro
			return `You simply enslave all of your prisoners yourself. These slaves will regret attacking your arcology.`;
		}
	}
};


code:
App.Events.pLoanshark = class pLoanshark extends App.Events.BaseEvent {
	eventPrerequisites() {
		return [
			() => V.loans.some(loan => loan.name === 'shark' && loan.deadline === V.week)
		];
	}

	execute(node) {
		V.nextButton = " ";

		const loan = V.loans.find(loan => loan.name === 'shark');

		App.Events.addParagraph(node, [`You took out a loan from one of the local loansharks and the time has come to collect. You receive a notification from ${V.assistant.name} that an envoy and a detachment of mercenaries have arrived to see you, and after the group has been escorted in, the shark's representative clears his throat and begins.`]);
		App.Events.addParagraph(node, [`"It states here in my records that you recently borrowed ${cashFormat(Math.trunc(loan.principal))} from my boss. It's time to fulfill your end of the deal."`]);

		App.Events.addResponses(node, [
			V.cash > loan.full
				? new App.Events.Result(`Pay the man`, pay)
				: new App.Events.Result(null, null, `You do not have enough cash to pay the loan back`),
			V.slaves.some(slave => slaveCost(slave) > loan.full)
				? new App.Events.Result(`Offer one of your slaves instead`, slave)
				: new App.Events.Result(null, null, `You do not have any slaves valuable enough to cover the loan`),
			new App.Events.Result(`Refuse`, refuse)
		]);

		function pay() {
			cashX(forceNeg(loan.full), "loan");
			V.loans.delete(V.loans.find(loan => loan.name === 'shark'));

			V.nextButton = "Continue";
			App.Utils.scheduleSidebarRefresh();

			return `No sense in dragging this out. You roll your eyes and order ${V.assistant.name} to transfer the ¤. The envoy, satisfied that all is as it should be, gives a slight bow and a quick nod to his party. Without another word, the men turn on their heels and leave.`;
		}

		function slave() {
			App.Events.addNode(node, [chooseSlave()]);
			V.loans.delete(V.loans.find(loan => loan.name === 'shark'));

			V.nextButton = "Continue";
			App.Utils.scheduleSidebarRefresh();

			return `With a slight tilt of your head, you inquire as to whether your lender would be willing to accept a different type of currency instead. The envoy nods and replies, "Yes, that would be acceptable – my patron has authorized me to make trades on his behalf."`;

			function chooseSlave() {
				const frag = App.UI.DOM.makeElement("div", null, ['margin-top']);

				frag.append(`Choose a slave to send with the group:`);

				V.slaves
					.filter(slave => slaveCost(slave) > loan.full)
					.sort((a, b) => slaveCost(a) - slaveCost(b))
					.forEach(slave => {
						const div = document.createElement("div");
						const {him} = getPronouns(slave);

						App.Events.addNode(div, [
							App.UI.DOM.link(`Send `, () => {
								App.UI.DOM.replace(frag, `You call ${SlaveFullName(slave)} in. After the representative has taken a moment to inspect ${him}, he nods in satisfaction and taps something on his tablet. A moment later you receive a notification that your debt with the lender has been concluded. The man turns to you once more. "It's been a pleasure," he says dryly. With that, the group departs, ${slave.slaveName} in tow.`);

								removeSlave(slave);
							}),
							App.UI.DOM.slaveDescriptionDialog(slave, SlaveFullName(slave)),
							` (worth ${cashFormat(slaveCost(slave))})`,
						], "div", ['indent']);

						frag.append(div);
					});

				return frag;
			}
		}

		function refuse() {
			const text = [];

			if (V.cash > loan.full || V.slaves.some(slave => slaveCost(slave) > loan.full)) {
				text.push(`You simply give the man a cold smile and cross your arms, a clear signal of defiance and refusal. The envoy gives a subtle signal to one of his compatriots, and the large soldier takes a step forward, restraints in hand. "As you know," the representative begins, "Anyone with significant enough debt is subject to enslavement, and the contract you signed with my employer states that you are now a slave. You're coming with us."`);
			} else {
				text.push(`Unfortunately, you're in a little over your head – you have neither the cash needed, nor any slaves valuable enough to cover the cost. Upon hearing this, the envoy nods, his face expressionless. "As you know," he starts, "Anyone with significant enough debt is subject to enslavement, and the contract you signed with my employer states that you are now a slave. You're coming with us."`);
			}

			if (S.Bodyguard) {
				const {his, him} = getPronouns(S.Bodyguard);

				text.push(`Your bodyguard, ${S.Bodyguard.slaveName}, draws ${his} pistol faster than you would have thought possible and manages to put a round into the nearest mercenary before the other soldiers gun ${him} down. Unarmed and defenseless, you have no choice but to surrender.`);
			}

			V.loans.delete(V.loans.find(loan => loan.name === 'shark'));
			V.gameover = "loanshark";
			V.nextButton = "Continue";
			V.nextLink = "Gameover";
			App.Utils.scheduleSidebarRefresh();

			return text.join(' ');
		}
	}
};