code:
App.Events.PCoupCollaborationChoice = class PCoupCollaborationChoice extends App.Events.BaseEvent {
	eventPrerequisites() {
		return [
			() => getTraitor().actor !== 0
		];
	}

	execute(node) {
		let r = [];
		const traitor = getTraitor();
		const traitorActor = traitor.actor;
		if (traitorActor === 0) { // for typing
			return node;
		}
		const {
			He,
			his, he, him, himself
		} = getPronouns(traitorActor);

		const {say: say, title: Master} = getEnunciation(traitorActor);

		V.nextButton = "Continue";

		r.push(`Your next communication from the Daughters of Liberty is a request for a live video call. You accept and are surprised to be confronted by ${traitorActor.slaveName}'s`);
		if (traitor.type === "horror") {
			r.push(`terrified face.`);
		} else if (traitor.type === "broken") {
			r.push(`coherent face; it would seem ${his} mind has come back to ${him}.`);
		} else {
			r.push(`face.`);
		}
		r.push(`${He} looks very different, without visible modifications of any kind and dressed in utilitarian clothes, but it's ${him}.`);

		App.Events.addParagraph(node, r);
		r = [];

		if (traitor.type === "agent") {
			if (traitorActor.intelligence + traitorActor.intelligenceImplant >= 100) {
				if (canTalk(traitorActor)) {
					r.push(
						Spoken(traitorActor, `"Hello, ${Master},"`),
						`${he} ${say}s simply.`,
						Spoken(traitorActor, `"It's happening soon. The Daughters have asked me to call you to ask you for your cooperation. All they want are the access codes to your security systems and they trust me to get them. You still trust me, right? I promise giving me codes to give them is the right choice."`),
						`${He} stares at the camera, trying ${his} best to convey the deeper meaning to ${his} request.`,
						Spoken(traitorActor, `"It may be rough, but I promise we'll make it through it."`)
					);
				} else {
					r.push(`${He} gestures that the Daughters are coming and that ${he} was entrusted with earning your cooperation. ${He} explains that they want ${him} to get your security codes for them, and fully expect that ${he}'ll succeed. ${He} vows that you won't be making a mistake by giving ${him} codes and that you'll be reunited when it is all over.`);
				}
				traitor.type = "trapper";
			} else if (traitorActor.intelligence + traitorActor.intelligenceImplant < 0) {
				if (canTalk(traitorActor)) {
					r.push(
						Spoken(traitorActor, `"${Master},"`),
						`${he} ${say}s with panic in ${his} voice,`,
						Spoken(traitorActor, `"They are coming for you. They want your access codes so they can get to you easier, but now you know not to trust them!"`),
						`${He} manages to shout as ${he} is dragged offscreen,`,
						Spoken(traitorActor, `"Don't let them get you ${Master}! Show them who's boss!"`)
					);
				} else {
					r.push(`${He} hastily gestures that they are coming for you and that nothing you can do will deter them. ${He} barely signs off a plea for you to prepare your defenses before being dragged offscreen.`);
				}
				traitor.type = "hostage";
			} else if (traitorActor.intelligence + traitorActor.intelligenceImplant < -50) {
				if (canTalk(traitorActor)) {
					r.push(
						Spoken(traitorActor, `"Hello, ${Master},"`),
						`${he} ${say}s simply.`,
						Spoken(traitorActor, `"It's happening soon. The Daughters have asked me to call you to ask you for your help. All they need is the access codes to your security systems. They'll let you live, ${Master}, they'll even let you take your money. But the arcology and the slaves, those will have to go free."`),
						`${He} hesitates a little.`,
						Spoken(traitorActor, `"${Master}, I like being free. But I don't want to see you killed. Please, please agree."`)
					);
				} else {
					r.push(`${He} gestures that the Daughters are coming and that ${he} was asked if you would lend your assistance. ${He} explains, that in return for the security codes, you'll be allowed to live and escape with your wealth, but at the loss of your slaves and arcology. ${He} hesitates a little, before imploring you to save yourself.`);
				}
				traitor.type = "standard";
			} else {
				if (canTalk(traitorActor)) {
					r.push(
						Spoken(traitorActor, `"Hello, ${Master},"`),
						`${he} ${say}s simply.`,
						Spoken(traitorActor, `"It's happening soon. The Daughters have asked me to call you to ask you for your help. All they need is the access codes to your security systems. They'll let you live, ${Master}, they'll even let you take your money. But the arcology and the slaves, those will have to go free. You do not want to be around when they clean up the slave owners."`),
						`${He} hesitates a little, unsure of who may be listening.`,
						Spoken(traitorActor, `"${Master}, I don't want to see you killed. Please, please think about who you are dealing with."`),
						`${He} stares into the camera, imploring you to make the right choice.`
					);
				} else {
					r.push(`${He} gestures that the Daughters are coming and that ${he} was asked if you would lend your assistance. ${He} explains, that in return for the security codes, you'll be allowed to live and escape with your wealth, but at the loss of your slaves and arcology. ${He} stares into the camera, imploring you not to trust ${his} words.`);
				}
			}
		} else if (traitor.type === "horror") {
			if (canTalk(traitorActor)) {
				r.push(
					Spoken(traitorActor, `"${Master},"`),
					`${he} struggles to ${say},`,
					Spoken(traitorActor, `"The Daughters have asked me to call you to ask you for your help."`),
					`${He} takes a deep breath and composes ${himself}.`,
					Spoken(traitorActor, `"They need the access codes to your security systems."`),
					`${He} flinches upon making such a request.`,
					Spoken(traitorActor, `"They'll let you live, ${Master}, they'll even let you take your money. But the arcology and the slaves, those will have to go free."`),
					`${He} hesitates a little.`,
					Spoken(traitorActor, `"${Master}, I like being free. But I don't want anything more to do with you. Please, please agree."`)
				);
			} else {
				r.push(`${He} shakily gestures that the Daughters are coming and that ${he} was asked if you would lend your assistance. ${He} explains, that in return for the security codes, you'll be allowed to live and escape with your wealth, but at the loss of your slaves and arcology. ${He} hesitates a little, before asking you to take the deal so you never have to see each other again.`);
			}
		} else if (traitor.type === "defiant") {
			if (canTalk(traitorActor)) {
				r.push(
					Spoken(traitorActor, `"Hello, ${Master},"`),
					`${he} ${say}s simply.`,
					Spoken(traitorActor, `"It's happening soon. The Daughters have asked me to call you to ask you for your help. All they need is the access codes to your security systems. You'll get to live, ${Master}, and you'll even get to keep your money. But the arcology and the slaves will be handed over."`),
					`${He} hesitates a little.`,
					Spoken(traitorActor, `"${Master}, I like being free. But I don't want to see you killed by them. Please, please agree."`)
				);
			} else {
				r.push(`${He} gestures that the Daughters will be coming soon and that ${he} was asked if you would comply with their demands. ${He} explains, that in return for the security codes, you'll be allowed to live and escape with your wealth. ${He} emphasizes that they will kill you otherwise.`);
			}
		} else {
			if (canTalk(traitorActor)) {
				r.push(
					Spoken(traitorActor, `"Hello, ${Master},"`),
					`${he} ${say}s simply.`,
					Spoken(traitorActor, `"It's happening soon. The Daughters have asked me to call you to ask you for your help. All they need is the access codes to your security systems. They'll let you live, ${Master}, they'll even let you take your money. But the arcology and the slaves, those will have to go free."`),
					`${He} hesitates a little.`,
					Spoken(traitorActor, `"${Master}, I like being free. But I don't want to see you killed. Please, please agree."`)
				);
			} else {
				r.push(`${He} gestures that the Daughters are coming and that ${he} was asked if you would lend your assistance. ${He} explains, that in return for the security codes, you'll be allowed to live and escape with your wealth, but at the loss of your slaves and arcology. ${He} hesitates a little, before imploring you to save yourself.`);
			}
		}

		App.Events.addParagraph(node, r);

		App.Events.addResponses(node, [
			new App.Events.Result(`Transmit the codes`, transmit),
			new App.Events.Result(`Refuse`, refuse)
		]);

		function transmit() {
			const frag = new DocumentFragment();
			let r = [];
			if (traitorActor === 0) { // for typing. Why the fuck do I have to do this for a nested function.
				return node;
			}
			r.push(`You transmit the access codes to your security systems.`);
			if (traitor.type === "agent") {
				r.push(`${traitorActor.slaveName} silently frowns as tears start to well in ${his} eyes.`);
			} else if (traitor.type === "trapper") {
				r.push(`${traitorActor.slaveName} smiles and thanks you. "I won't disappoint you."`);
			} else if (traitor.type === "hostage") {
				r.push(`If this will lessen what will happen to ${traitorActor.slaveName}, you don't know.`);
			} else if (traitor.type === "horror") {
				r.push(`${traitorActor.slaveName} meekly thanks you and hurries offscreen.`);
			} else if (traitor.type === "defiant") {
				r.push(`${traitorActor.slaveName} smiles and thanks you. "I hope you survive the attack, ${PoliteRudeTitle(traitorActor)}."`);
			} else {
				r.push(`${traitorActor.slaveName} smiles and thanks you. "You made the right decision, ${Master}. I love you."`);
			}
			V.collaboration = 1;

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

		function refuse() {
			return `You close the video call without a word. From your desk, you have access to thousands of video feeds from all across the arcology; they show men and women working, sleeping, eating, chatting, fucking. You wonder how many of them have plans, and what those plans are.`;
		}
	}
};


code:
App.Events.PCoupAftermath = class PCoupAftermath extends App.Events.BaseEvent {
	execute(node) {
		let r = [];

		V.nextButton = " "; // hide button until user makes a selection
		V.rival.gender = random(0, 99) <= V.seeDicks ? 2 : 1;
		const {
			HeR,
			heR, himR,
		} = getPronouns({pronoun: (V.rival.gender === 2) ? App.Data.Pronouns.Kind.male : App.Data.Pronouns.Kind.female}).appendSuffix("R");
		const {heA} = getPronouns(assistant.pronouns().main).appendSuffix("A");

		const rivalArc = V.rival.state === 2 ? V.arcologies.find(arc => arc.rival === 1) : null;
		V.fcnn.push("...evidence also suggests that the Daughters of Liberty had also planned a terrorist attack on...");

		if (V.mercenaries > 3) {
			r.push(`Your ${V.mercenariesTitle}`);
		} else if (V.mercenaries > 0) {
			r.push(`Your mercenaries`);
		} else if (V.arcologyUpgrade.drones > 0) {
			r.push(`Your security drones`);
		} else {
			r.push(`Private security teams`);
		}
		r.push(`perform the grisly task of disposing of the bodies of the Daughters killed in the assault. They strip them of anything that might be of use in cleaning up after the attempted coup — communication devices, PDAs, computers, even handwritten notes. The raw intel is scanned and passed to ${V.assistant.name}. Most of it is rubbish.`);
		App.Events.addParagraph(node, r);
		r = [];
		r.push(`Some of it is not. There is evidence of payments from a ${V.rival.state < 2 ? "nearby Free City" : "neighboring arcology"} to the leadership of the Daughters. ${capFirstChar(V.assistant.name)} is silent for a long time, crosschecking records to assemble a complete picture despite your enemies' attempts to disguise the transactions. Finally, ${V.assistant.name} finishes and displays a picture, using nearly the entire surface of your desk for effect.`);
		if (V.assistant.personality > 0) {
			r.push(`"This," ${heA} says in a tone of satisfaction, "is the`);
			if (V.rival.gender === 2) {
				r.push(`bastard`);
			} else if (V.rival.gender === 1) {
				r.push(`bitch`);
			} else {
				r.push(`cunt`);
			}
			r.push(`you want, ${properTitle()}."`);
		} else {
			r.push(`"This," ${heA} says neutrally, "is the culprit, ${properTitle()}."`);
		}

		r.push(`The face is vigorous, determined, and`);
		if (V.rival.gender === 2) {
			r.push(`masculine. The very stereotype of the male arcology owner.`);
		} else if (V.rival.gender === 1) {
			r.push(`feminine. The very stereotype of the female arcology owner.`);
		} else {
			r.push(`androgynous. The very stereotype of the dissolute arcology owner.`);
		}
		if (rivalArc) {
			r.push(
				`And, as you suspected, it's one of your neighbors. It's the individual who owns`,
				App.UI.DOM.makeElement("span", `${rivalArc.name}.`, ["bold"])
			);
			App.Events.addParagraph(node, r);
			r = [];
		}

		r.push(`Your assistant continues, "${HeR} came into an arcology about when you did, ${properTitle()}. It seems the Daughters originally planned to attack ${himR}, but ${heR} bought them off and sent them after you, instead."`);
		if (V.assistant.personality > 0) {
			r.push(`"I wonder," ${heA} teases, "if ${heR} thinks you're cute, or what?"`);
		}
		App.Events.addParagraph(node, r);
		r = [];
		r.push(`You inquire as to whether there's any identifiable cause for the evident dislike.`);
		if (V.rival.FS.name !== "") {
			r.push(`"Definitely," says your assistant. "The most cursory review of the recent history of this Free City shows that divergence began with your selection of ${V.rival.FS.name} as a society model for the future. They immediately went the opposite direction."`);
		} else {
			r.push(`"No," says your assistant. "It may be that giving the Daughters an alternative target was necessary and you were simply unlucky. Alternatively, this may be envy of your success; of rising arcology owners, you have come farthest, fastest."`);
		}

		App.Events.addParagraph(node, r);

		const cashTrace = 20000;
		App.Events.addResponses(node, [
			new App.Events.Result(`Contact the culprit privately and discuss the matter`, privately),
			new App.Events.Result(`Reveal the evidence publicly`, publicly),
			new App.Events.Result(`Devote funds to tracing the evidence`, trace, `This will cost ${cashFormat(cashTrace)}`)
		]);

		function privately() {
			const frag = new DocumentFragment();
			let r = [];
			unlock();
			r.push(`Your fellow arcology owner proves very receptive to your missive, as well they might. Your defeat of the Daughters has made a major impact on the willingness of slaveowners to discuss slave revolts in public, and any arcology owner who was proved to be funding anti-slaver violence, even under duress, would be shunned. With very little prompting, ${heR} forwards a huge indemnity payment. It's nowhere near enough to cause bankruptcy, but it's enough to give you a massive advantage should you find yourselves at odds again.`);
			cashX(100000, "war");
			V.maximumRep += 7500;
			App.Events.addParagraph(frag, r);
			return frag;
		}

		function publicly() {
			const frag = new DocumentFragment();
			let r = [];
			unlock();
			r.push(`Free Cities society is understandably reluctant to condemn, never mind depose, arcology owners. The precedent of removing one would be bad, even if the public brought enough strength together to accomplish it. Your evidence looks quite bad, but isn't so incontrovertible as to cause your fellow aristocrats to take such a drastic measure. Nonetheless, the public is aghast at the spectacle of an arcology owner funding an attack on another. Opinion rallies around you, and you even receive some discreet donations, delivered with the intimation that they are to be used against your enemy. There is stony silence from the Daughters' backer; today, you began a real inter-arcology war.`);
			repX(1000, "war");
			cashX(10000, "war");
			V.maximumRep += 7500;
			V.rival.power = 1;
			if (rivalArc) {
				rivalArc.embargo = 2;
				rivalArc.embargoTarget = 0;
				rivalArc.influenceTarget = 0;
				V.rival.prosperity = rivalArc.prosperity;
			} else {
				V.rival.prosperity = V.arcologies[0].prosperity;
			}
			App.Events.addParagraph(frag, r);
			return frag;
		}

		function trace() {
			const frag = new DocumentFragment();
			let r = [];
			unlock();
			r.push(`The money flows out, and the information flows in. You are rewarded with a reasonably complete picture of your rival's operations. The intelligence will be extremely useful going forward, since by gathering it, you sent an unmistakable signal that you do not consider the matter closed. There is stony silence from the Daughters' backer; today, you began a real inter-arcology war. But, with this information, you can maintain it from a position of advantage.`);
			cashX(-cashTrace, "war");
			V.maximumRep += 7500;
			V.rival.power = 5;
			if (rivalArc) {
				rivalArc.embargo = 3;
				rivalArc.embargoTarget = 0;
				rivalArc.influenceTarget = 0;
				V.rival.prosperity = rivalArc.prosperity;
			} else {
				V.rival.prosperity = V.arcologies[0].prosperity;
			}
			App.Events.addParagraph(frag, r);
			return frag;
		}

		/** unlock Continue button */
		function unlock() {
			V.nextButton = "Continue";
			App.Utils.updateUserButton();
		}
	}
};

repo_name: Nithhogg/fc

license: mit


code:
// cSpell:ignore pcaj

App.Events.PCoupAttempt = class PCoupAttempt extends App.Events.BaseEvent {
	execute(node) {
		let r = [];
		const traitor = getTraitor();
		const traitorActor = traitor.actor;
		const {
			He,
			him
		} = getPronouns(traitorActor ? traitorActor : {pronoun: App.Data.Pronouns.Kind.neutral});
		let pcaj;
		let traitorDeath;

		V.nextButton = "Continue";
		V.daughtersVictory = 1;
		const secExpUnits = App.Mods.SecExp.battle.activeUnits();

		if (traitorActor !== 0) {
			const weeks = traitor.weeks - 1;
			const pregWeeks = traitor.weeks - 1;
			traitor.weeks = 0;

			WombProgress(traitorActor, pregWeeks, pregWeeks); /* In all cases should be done */
			WombUpdatePregVars(traitorActor);
			if (WombBirthReady(traitorActor, traitorActor.pregData.normalBirth) > 0) { /* normal birth case, partial birthers not supported*/
				traitorActor.preg = -1;
				traitorActor.counter.birthsTotal += WombBirthReady(traitorActor, traitorActor.pregData.normalBirth);
				WombFlush(traitorActor);
			} else { /* still pregnant slave */
				traitorActor.preg = WombMaxPreg(traitorActor); /* most ready fetus is a base*/
				traitorActor.pregWeek = WombMaxPreg(traitorActor); /* most ready fetus is a base*/
			}
			SetBellySize(traitorActor); /* In any case it's useful to do.*/

			if (traitorActor.bald !== 1) {
				if (traitorActor.hLength < 150) {
					traitorActor.hLength += weeks;
				}
			}
			ageSlaveWeeks(traitorActor, weeks);
		}
		const doubleAgent = ["agent", "trapper"].includes(traitor.type) ? 1 : 0;

		r.push(`You are awakened in the middle of the night by a jolt that shakes the entire arcology, accompanied by a distant boom. It is followed by the wail of the arcology's alarm systems, and then finally by a faint crackle that grows to a constant chatter of gunfire. Main power goes out, and you claw your way in the darkness to the video feeds, running on emergency backup. The Daughters of Liberty have more sympathizers in the arcology than even you suspected, and they're well armed and have the element of surprise.`);
		if (V.arcologies[0].FSRomanRevivalistLaw === 1) {
			r.push(`${V.arcologies[0].name}, however, is home to a society that cannot be surprised, for each and every one of its citizens is armed and trained for instant contribution to the defense of Rome. Even as you do your best to reestablish control, you hear a thunderous, ubiquitous roar from all around you. Your citizens are already getting into the fight.`);
		}

		if (V.arcologies[0].FSNeoImperialistLaw1 === 1) {
			r.push(`${V.arcologies[0].name}, however, is guarded by your fanatically loyal and expertly-trained Imperial Knights, many of whom practically chomp at the bit in their heavy battle armor for just such an opportunity. Before you have even shouted your first command, you can hear the sound of ferocious battle. The Knights are not one to be surprised.`);
		}

		if (V.arcologies[0].FSAntebellumRevivalistLaw2 === 1) {
			r.push(`${V.arcologies[0].name}, however, is home to a society with more than one hundred firearms to each citizen, and more than enough of them have been itching for a time just like this. Before you have time to issue your first order, the citizens' militias have already mobilized and flooded the streets, eager for blood.`);
		}

		App.Events.addParagraph(node, r);
		r = [];

		if (V.hackerSupport === 0) {
			r.push(`Many of the arcology systems are not responding properly. It seems the Daughters' penetration of your systems is thorough. Your security systems are still reasonably functional, but the rebels are aided by partial control of things like lights and door locks.`);
		} else {
			r.push(`It seems your cyber-warfare ally of convenience is having an effect. Arcology systems are working perfectly unless the rebels disable them physically. Their fighters are impeded by uncooperative lights, resistant locking systems, and even ${V.assistant.name}'s selective deployment of firefighting systems to obscure visibility.`);
		}

		App.Events.addParagraph(node, r);
		r = [];

		if (V.personalArms === 0) {
			r.push(`Since you are not well armed or armored, you stay in your penthouse and do what you can to coordinate the defense.`);
		} else if (V.personalArms === 1) {
			r.push(`The Daughters are appalled to encounter you striding thunderously out of your penthouse, fully armored. Your exoskeleton mounts an acoustic riot control system that even allows you to take prisoners.`);
		} else {
			r.push(`The Daughters are appalled to encounter you striding thunderously out of your penthouse, fully armored. Your exoskeleton mounts an acoustic riot control system that even allows you to take prisoners.`);
			if (V.arcologyUpgrade.drones > 0) {
				r.push(`Meanwhile, your security drones are busily rearming themselves, and soon the dominant sound in the arcology is the ripping noise made by their small-caliber guns. A few of them retain their nonlethal weapons and swoop in to subdue when possible.`);
			}
		}

		if (traitorActor !== 0 && (traitor.type === "trapper" || traitor.type === "agent")) {
			App.Events.addParagraph(node, r);
			r = [];
			r.push(`Every now and then you catch sight of ${traitorActor.slaveName} seeding disorder through the ranks.`);
			if (random(1, 100) > traitorActor.intelligence + traitorActor.intelligenceImplant) {
				traitorDeath = 1;
			}
		}

		App.Events.addParagraph(node, r);
		r = [];

		if (secExpUnits === 0 && V.mercenaries === 0 && V.arcologies[0].FSRomanRevivalistLaw === 0 && V.arcologies[0].FSNeoImperialistLaw1 === 0 && V.arcologies[0].FSAntebellumRevivalistLaw2 === 0) {
			r.push(`You are alone in contributing to the defense of your home.`);
		} else if (V.mercenaries === 1) {
			r.push(`Your mercenaries desperately defend their barracks but manage little else.`);
		} else if (V.mercenaries === 3) {
			r.push(`Your mercenaries manage to get into action quickly enough, but are bogged down in the streets. They are obliged to fight a confused battle to establish a perimeter. Only once it's stable are they able to push out.`);
		} else if (V.mercenaries === 5) {
			r.push(`Your ${V.mercenariesTitle} spread out into the arcology, as invincible as Medieval men-at-arms matched against peasants. They are so dominant over the Daughters that they are able to take many prisoners. Their armor often permits them to approach armed, resisting rebels and disarm them manually.`);
		}
		if (V.arcologies[0].FSRomanRevivalistLaw === 1) {
			r.push(`As the crisis is reached and passed, lower-class citizens armed as Hastati, with lighter weapons and personal armor, begin to sweep the arcology to ensure no one escapes. Middle-class citizens, meanwhile, heavily armored as Principes, methodically grind out pockets of armed resistance. The toughest rebel groups are left to the exoskeleton-armored Triarii.`);
		}
		if (V.arcologies[0].FSNeoImperialistLaw1 === 1) {
			r.push(`As the rebels reel back from the shockingly organized initial resistance of your always-ready Imperial Knights and their lightly-armed but fanatically determined guardsmen, it becomes increasingly clear just how well prepared your arcology was for this exact event. Even as fires rage through the streets of your home, Knights clamber forward through the rebel lines practically undisturbed by the fire that clatters off their enormously thick plate, laying down explosive volleys with enormous heavy guns and launching themselves into outright melee with their holographic weapons.`);
		}
		if (V.arcologies[0].FSAntebellumRevivalistLaw2 === 1) {
			r.push(`As the rebels are pushed back from the disturbingly eager mob of well-armed citizenry, it becomes obvious that many of the militia groups have been practicing for an attack of this nature for some time. They move as well-ordered squads through familiar corridors with an odd mishmash of practical and completely ornamental gear, each soldier or squadron uniquely dressed. They use their home advantage to ambush and catch the invaders out of position, terminating them with extreme prejudice. The taking of war trophies has already begun - stripped combatants trail after citizens on lengths of chain.`);
		}

		if (secExpUnits >= 4) {
			r.push(`Your`);
			if (secExpUnits >= 9) {
				r.push(`massive`);
			} else if (secExpUnits >= 7) {
				r.push(`huge`);
			} else if (secExpUnits >= 4) {
				r.push(`small`);
			}
			r.push(`private army quickly and efficiently contributes to the defense of ${V.arcologies[0].name}.`);
		}

		App.Events.addParagraph(node, r);
		r = [];

		const newSlaves = [];
		if ((secExpUnits / 2) + V.arcologies[0].FSRomanRevivalistLaw + V.arcologies[0].FSNeoImperialistLaw1 + V.arcologies[0].FSAntebellumRevivalistLaw2 + V.mercenaries + V.personalArms + V.hackerSupport + doubleAgent > 8) {
			r.push(`The Daughters of Liberty are utterly crushed. ${V.arcologies[0].name} has been slightly damaged, but even as the last pockets of resistance are crushed, your citizens begin repairs themselves. The effect on your reputation is immensely positive, since your victory was insultingly easy and barely set the arcology's prosperity back at all. You also took a truly impressive bag of prisoners.`);
			V.daughtersVictory = 3;
			cashX(-2000, "war");
			cashX(forceNeg(Math.trunc(V.cash * 0.2)), "war");
			V.arcologies[0].prosperity = Math.trunc(V.arcologies[0].prosperity * 0.7);
			repX(2000, "war");
			for (let pca = 0; pca < 8; pca++) {
				let slave;
				if (random(0, 99) < V.seeDicks) {
					slave = GenerateNewSlave("XY", {minAge: 16, maxAge: 32, disableDisability: 1});
					generateSalonModifications(slave);
					slave.weight = random(-20, 30);
					slave.muscles = random(20, 80);
					slave.waist = random(10, 80);
				} else {
					slave = GenerateNewSlave("XX", {minAge: 16, maxAge: 32, disableDisability: 1});
					generateSalonModifications(slave);
					slave.weight = random(-50, 30);
					slave.muscles = random(0, 80);
					slave.waist = random(-20, 20);
				}
				slave.origin = "$He is an enslaved Daughter of Liberty.";
				newSlaves.push(slave);
			}
			addTrinket("a damaged plate carrier bearing Daughters of Liberty insignia");
			r.push(IncreasePCSkills('warfare', 5));
		} else if (V.arcologies[0].FSRomanRevivalistLaw === 1 || V.arcologies[0].FSNeoImperialistLaw1 === 1 || V.arcologies[0].FSAntebellumRevivalistLaw2 === 1) {
			r.push(`The Daughters of Liberty are annihilated. ${V.arcologies[0].name} has been damaged, and the repairs will be quite costly. However, the effect on your reputation is very positive, since though your victory was hard-fought and set the arcology's prosperity back considerably, you did better than other arcology owners have done when faced with similar well-armed unrest. You also took a truly impressive bag of prisoners.`);
			V.daughtersVictory = 3;
			cashX(-5000, "war");
			cashX(forceNeg(Math.trunc(V.cash * 0.2)), "war");
			V.arcologies[0].prosperity = Math.trunc(V.arcologies[0].prosperity * 0.7);
			repX(1000, "war");
			if (V.seeDicks >= 50) {
				pcaj = 5;
			} else if (V.seeDicks > 0) {
				pcaj = 2;
			} else {
				pcaj = 0;
			}
			for (let pca = 0; pca <= pcaj; pca++) {
				const slave = GenerateNewSlave("XY", {minAge: 16, maxAge: 32, disableDisability: 1});
				generateSalonModifications(slave);
				slave.origin = "$He is an enslaved Daughter of Liberty.";
				slave.weight = random(-20, 30);
				slave.muscles = random(20, 80);
				slave.waist = random(10, 80);
				newSlaves.push(slave);
			}
			if (V.seeDicks < 50) {
				pcaj = 5;
			} else if (V.seeDicks < 100) {
				pcaj = 3;
			} else {
				pcaj = 0;
			}
			for (let pca = 0; pca <= pcaj; pca++) {
				const slave = GenerateNewSlave("XX", {minAge: 16, maxAge: 32, disableDisability: 1});
				generateSalonModifications(slave);
				slave.origin = "$He is an enslaved Daughter of Liberty.";
				slave.weight = random(-50, 30);
				slave.muscles = random(0, 80);
				slave.waist = random(-20, 20);
				newSlaves.push(slave);
			}
			addTrinket("a Daughters of Liberty flag that once hung in their forward command post within your arcology");
		} else {
			r.push(`The Daughters of Liberty are defeated. ${V.arcologies[0].name} is heavily damaged, and the repairs will be very costly. The effect on your reputation is muted, but positive, since though you won, your victory was hard-fought and set the arcology's prosperity back a long way.`);
			if (traitorActor !== 0 && !["agent", "trapper"].includes(traitor.type)) {
				r.push(`${traitorActor.slaveName} was killed in the fighting.`);
				traitor.actor = 0;
				traitor.stats = {};
				traitor.type = 0;
			}
			V.daughtersVictory = 2;
			cashX(-10000, "war");
			cashX(forceNeg(Math.trunc(V.cash * 0.3)), "war");
			V.arcologies[0].prosperity = Math.trunc(V.arcologies[0].prosperity * 0.5);
			repX(500, "war");
			if (V.seeDicks >= 50) {
				pcaj = 3;
			} else if (V.seeDicks > 0) {
				pcaj = 1;
			} else {
				pcaj = 0;
			}
			for (let pca = 0; pca <= pcaj; pca++) {
				const slave = GenerateNewSlave("XY", {minAge: 16, maxAge: 32, disableDisability: 1});
				generateSalonModifications(slave);
				slave.origin = "$He is an enslaved Daughter of Liberty.";
				slave.weight = random(-20, 30);
				slave.muscles = random(20, 80);
				slave.waist = random(10, 80);
				newSlaves.push(slave);
			}
			if (V.seeDicks < 50) {
				pcaj = 3;
			} else if (V.seeDicks < 100) {
				pcaj = 2;
			} else {
				pcaj = 0;
			}
			for (let pca = 0; pca <= pcaj; pca++) {
				const slave = GenerateNewSlave("XX", {minAge: 16, maxAge: 32, disableDisability: 1});
				generateSalonModifications(slave);
				slave.origin = "$He is an enslaved Daughter of Liberty.";
				slave.weight = random(-50, 30);
				slave.muscles = random(0, 80);
				slave.waist = random(-20, 20);
				newSlaves.push(slave);
			}
			addTrinket("a Daughters of Liberty brassard");
			r.push(IncreasePCSkills('warfare', 5));
		}
		if (V.personalArms > 0) {
			V.PC.skill.combat = Math.min(V.PC.skill.combat + 10, 100);
		}

		if (traitorActor !== 0 && traitorDeath !== 1) {
			if (["agent", "trapper"].includes(traitor.type)) {
				r.push(`${traitorActor.slaveName} returns to your service having completed the task assigned to ${him}.`);
				traitorActor.assignment = Job.REST;
			} else if (traitor.type === "hostage") {
				r.push(`${traitorActor.slaveName} wanders back to the penthouse, battered and bloody, but alive.`);
				traitorActor.assignment = Job.REST;
				setHealth(traitorActor, traitorActor.health.condition, traitorActor.health.condition - traitorActor.health.shortDamage + 80, traitorActor.health.longDamage, traitorActor.health.illness, traitorActor.health.tired);
			} else {
				r.push(`${traitorActor.slaveName} was captured and has been returned to you.`);
				traitorActor.assignment = "stay confined";
				setHealth(traitorActor, traitorActor.health.condition, traitorActor.health.condition - traitorActor.health.shortDamage + 80, traitorActor.health.longDamage, traitorActor.health.illness, traitorActor.health.tired);
				traitorActor.origin = "$He was your slave, but you freed $him, which $he repaid by participating in a coup attempt against you. It failed, and $he is again your chattel.";
			}
			restoreTraitor();
		} else if (traitorActor !== 0) {
			r.push(`${traitorActor.slaveName}'s body was found among the dead. ${He} died sabotaging the Daughters' efforts.`);
			traitor.actor = 0;
			traitor.stats = {};
			traitor.type = 0;
		}

		App.Events.addParagraph(node, r);

		const choices = [];
		choices.push(new App.Events.Result(`Sell your prisoners immediately`, sell, (traitorActor !== 0) ? `${traitorActor.slaveName} will not be sold.` : ""));
		choices.push(new App.Events.Result(`Give your prisoners to those who suffered property damage`, property, (traitorActor !== 0) ? `${traitorActor.slaveName} will not be sold.` : ""));
		choices.push(new App.Events.Result(`Enslave all of your prisoners`, enslaveAll));

		App.Events.addResponses(node, choices);

		function sell() {
			for (const slave of newSlaves) {
				const cost = slaveCost(slave);
				cashX(cost, "slaveTransfer");
			}
			return `Prisoners sold.`;
		}

		function property() {
			const frag = new DocumentFragment();
			let r = [];
			for (const slave of newSlaves) {
				const cost = slaveCost(slave);
				repX(Math.trunc(cost / 10), "war");
			}
			r.push(`Prisoners <span class="green">given away.</span>`);
			App.Events.addParagraph(frag, r);
			return frag;
		}

		function enslaveAll() {
			for (const slave of newSlaves) {
				newSlave(slave); /* skip New Slave Intro */
			}

			return `You simply enslave all of the prisoners yourself. You will make them pay for attacking your arcology.`;
		}
	}
};


code:
App.Events.PCoupBetrayal = class PCoupBetrayal extends App.Events.BaseEvent {
	execute(node) {
		let r = [];
		const traitor = getTraitor();
		const traitorActor = traitor.actor;
		const {He, he} = getPronouns(traitorActor ? traitorActor : {pronoun: App.Data.Pronouns.Kind.neutral});

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

		const weeks = traitor.weeks -1;
		const pregWeeks = traitor.weeks -1;
		traitor.weeks = 0;

		if (traitorActor === 0) { // never happens, needed for typing
			return node;
		}

		WombProgress(traitorActor, pregWeeks, pregWeeks); /* In all cases should be done */
		WombUpdatePregVars(traitorActor);
		if (WombBirthReady(traitorActor, traitorActor.pregData.normalBirth) > 0 ) { /* normal birth case, partial birthers not supported*/
			traitorActor.preg = -1;
			traitorActor.counter.birthsTotal += WombBirthReady(traitorActor, traitorActor.pregData.normalBirth);
			WombFlush(traitorActor);
		} else { /* still pregnant slave */
			traitorActor.preg = WombMaxPreg(traitorActor); /* most ready fetus is a base*/
			traitorActor.pregWeek = WombMaxPreg(traitorActor); /* most ready fetus is a base*/
		}
		SetBellySize(traitorActor); /* In any case it's useful to do.*/

		if (traitorActor.bald !== 1) {
			if (traitorActor.hLength < 150) {
				traitorActor.hLength += weeks;
			}
		}
		ageSlaveWeeks(traitorActor, weeks);

		r.push(`You are awakened in the middle of the night by a jolt that shakes the entire arcology, accompanied by a distant boom. It is followed by the wail of the arcology's alarm systems, and then finally by a faint crackle that grows to a constant chatter of gunfire. You rush to the video feeds to see what is going on. The Daughters of Liberty have not only succeeded in locking down your arcology with them outside of it, but have effectively cornered themselves against it. A PMC group has their retreat cut off and is steadily bleeding their numbers. It is a rather short, if not spectacular, battle.`);

		App.Events.addParagraph(node, r);
		r = [];

		r.push(`The Daughters of Liberty are utterly crushed. ${V.arcologies[0].name} has been slightly damaged in the crossfire, but even as the last pockets of resistance are cleaned up, your citizens begin repairs themselves. The effect on your reputation is immensely positive, since you won without lifting a finger and the arcology's prosperity, if anything, was benefited. However, the PMCs took the lion's share of the loot.`);

		cashX(-10000, "war");
		V.arcologies[0].prosperity = Math.trunc(V.arcologies[0].prosperity*0.9);
		repX(5000, "war");
		V.daughtersVictory = 3;
		addTrinket("a leftover banner bearing Daughters of Liberty insignia");

		App.Events.addParagraph(node, r);
		r = [];

		r.push(`When ${traitorActor.slaveName} finally manages to return to you, ${he} explains what happened. ${He} caught wind of the military contractors working in the area and succeeded in goading the Daughters of Liberty into attacking the supposed slaver troop. Once it became clear that the untrained ex-slaves and their saviors stood no chance against a coordinated force, they beat a hasty retreat for your arcology under the assumption that the codes you gave them would allow them a fortifiable position. But alas, they found nothing more than their demise.`);
		App.Events.addParagraph(node, r);
		restoreTraitor();
	}
};


code:
App.Events.PCoupCollaboration = class PCoupCollaboration extends App.Events.BaseEvent {
	eventPrerequisites() {
		return [
			() => V.collaboration === 1,
			() => getTraitor().type !== "trapper"
		];
	}

	execute(node) {
		let r = [];
		const traitor = getTraitor();
		const traitorActor = traitor.actor;
		const {
			His, He,
			his, he, him
		} = getPronouns(traitorActor ? traitorActor : {pronoun: App.Data.Pronouns.Kind.neutral});

		if (traitorActor !== 0) {
			const pregWeeks = traitor.weeks;
			traitor.weeks = 0;

			WombProgress(traitorActor, pregWeeks, pregWeeks); /* In all cases should be done */
			WombUpdatePregVars(traitorActor);
			if (WombBirthReady(traitorActor, traitorActor.pregData.normalBirth) > 0) { /* normal birth case, partial birthers not supported*/
				traitorActor.preg = -1;
				traitorActor.counter.birthsTotal += WombBirthReady(traitorActor, traitorActor.pregData.normalBirth);
				WombFlush(traitorActor);
			} else { /* still pregnant slave */
				traitorActor.preg = WombMaxPreg(traitorActor); /* most ready fetus is a base*/
				traitorActor.pregWeek = WombMaxPreg(traitorActor); /* most ready fetus is a base*/
			}
			SetBellySize(traitorActor); /* In any case it's useful to do.*/
		}

		r.push(`You are awakened in the middle of the night by an odd darkness. All the normal lights of your healthy arcology are out. Main power has gone out, and you claw your way in the darkness to the video feeds, running on emergency backup.`);

		App.Events.addParagraph(node, r);
		r = [];

		r.push(`Armed rebels are running unchecked down the corridors.`);
		if (V.mercenaries > 0) {
			r.push(`Your mercenaries' quarters is locked down, but from the interior feeds you can see a few of them lying in their beds or slumped in chairs as gas is pumped through the ventilation systems.`);
		}
		r.push(`The security drones are actively assisting the rebels.`);
		if (traitorActor !== 0) {
			r.push(`You can see`);
			if (traitorActor.bellyPreg >= 100000) {
				r.push(`the staggeringly pregnant`);
			} else if (traitorActor.bellyPreg >= 15000) {
				r.push(`the heavily pregnant`);
			} else if (traitorActor.bellyPreg >= 10000) {
				r.push(`the very pregnant`);
			} else if (traitorActor.bellyPreg >= 5000) {
				r.push(`the pregnant`);
			}
			r.push(`${traitorActor.slaveName} on one of the feeds,`);
			if (traitor.type === "agent") {
				r.push(`trying to sabotage a stockpile of explosives.`);
			} else if (traitor.type === "horror") {
				r.push(`encouraging ${his} fellow fighters`);
				if (canTalk(traitorActor)) {
					r.push(`with yells`);
				}
				r.push(`from the back lines.`);
			} else if (traitor.type === "defiant") {
				r.push(`encouraging ${his} fellow fighters`);
				if (canTalk(traitorActor)) {
					r.push(`with yells`);
				}
				r.push(`and spearheading the charge${(traitorActor.bellyPreg >= 15000) ? ` as best ${he} can` : ""}.`);
			} else {
				r.push(`encouraging ${his} fellow fighter${(canTalk(traitorActor)) ? " with yells" : ""}, and when that fails, leading them by example${(traitorActor.bellyPreg >= 15000) ? ` as best ${he} can` : ""}.`);
			}
		}
		r.push(`In areas already controlled by the Daughters, slaveowners are being summarily shot in the streets. "${properTitle()}," ${V.assistant.name} says, "the Daughters of Liberty are in complete control of all arcology systems. Remain here."`);

		App.Events.addParagraph(node, r);
		r = [];

		r.push(`After half an hour of watching the executions,`);
		if (traitorActor !== 0) {
			const {
				say: say
			} = getEnunciation(traitorActor);
			if (traitor.type === "agent") {
				r.push(traitorActor.slaveName);
				if (traitorActor.bellyPreg >= 10000) {
					r.push(`waddles`);
				} else {
					r.push(`steps`);
				}
				r.push(`slowly into your office, dreading what is to come. You greet ${him} by name and ${he} breaks down in tears. As ${he} takes a shot at the nearest Daughter, they open fire on the both of you. Your cause of death is that of many an oppressor — an aneurysm of the cerebellum, in 9mm Parabellum.`);
			} else if (traitor.type === "horror") {
				r.push(traitorActor.slaveName);
				if (traitorActor.bellyPreg >= 10000) {
					r.push(`waddles`);
				} else {
					r.push(`steps`);
				}
				r.push(`gingerly into your office, not happy to be here once more. You greet ${him} by name, in response to which ${he} cowers in fear${(hasAnyArms(traitorActor)) ? ` and drops ${his} weapon` : ""}. Not interested in giving you an opportunity, ${his} comrade takes the shot. Your cause of death is that of many an oppressor — an aneurysm of the cerebellum, in 9mm Parabellum.`);
			} else if (traitor.type === "defiant") {
				r.push(traitorActor.slaveName);
				if (traitorActor.bellyPreg >= 10000) {
					r.push(`waddles`);
				} else {
					r.push(`strides`);
				}
				r.push(`confidently into your office. You greet ${him} by name, in response to which ${he}`);
				if (hasAnyArms(traitorActor)) {
					r.push(`deals`);
				} else {
					r.push(`orders one of ${his} comrades to give`);
				}
				r.push(`you a vicious open-handed slap that knocks you out of your chair.`);
				if (!canTalk(traitorActor)) {
					r.push(`${His} last words to you are nothing more than a rude gesture.`);
				} else if (traitorActor.slaveName !== traitorActor.birthName) {
					r.push(
						Spoken(traitorActor, `"My name,"`),
						`${he} ${say}s,`,
						Spoken(traitorActor, `"is ${traitorActor.birthName}. I'm going to enjoy this after what you did to me."`)
					);
				} else {
					r.push(
						Spoken(traitorActor, `"You stupid fuck,"`),
						`${he} ${say}s.`,
						Spoken(traitorActor, `"I'm going to enjoy this after what you did to me."`)
					);
				}
				r.push(`Your cause of death is that of many an oppressor — an aneurysm of the cerebellum, in 9mm Parabellum.`);
			} else {
				r.push(traitorActor.slaveName);
				if (traitorActor.bellyPreg >= 10000) {
					r.push(`waddles`);
				} else {
					r.push(`strides`);
				}
				r.push(`confidently into your office. You greet ${him} by name, in response to which ${he}`);
				if (hasAnyArms(traitorActor)) {
					r.push(`deals`);
				} else {
					r.push(`orders one of ${his} comrades to give`);
				}
				r.push(`you a vicious open-handed slap that knocks you out of your chair.`);
				if (!canTalk(traitorActor)) {
					r.push(`${He} wastes no time trying to speak to the likes of you.`);
				} else if (traitorActor.slaveName !== traitorActor.birthName) {
					r.push(
						Spoken(traitorActor, `"My name,"`),
						`${he} ${say}s,`,
						Spoken(traitorActor, `"is ${traitorActor.birthName}."`)
					);
				} else {
					r.push(
						Spoken(traitorActor, `"You stupid fuck,"`),
						`${he} ${say}s.`
					);
				}
				r.push(`Your cause of death is that of many an oppressor — an aneurysm of the cerebellum, in 9mm Parabellum.`);
			}
		} else {
			r.push(`the leader of the assault strides confidently into your office, deals you a vicious open-handed slap that knocks you out of your chair, and holds a pistol to your forehead. Your cause of death is that of many an oppressor — an aneurysm of the cerebellum, in 9mm Parabellum.`);
		}

		App.Events.addParagraph(node, r);
		App.UI.DOM.appendNewElement("p", node, "GAME OVER", "bold");
		V.ui = "start";
	}
};


code:
// cSpell:ignore zzzt

App.Events.PCoupLoss = class PCoupLoss extends App.Events.BaseEvent {
	execute(node) {
		let r = [];

		const traitor = getTraitor();
		const traitorActor = traitor.actor;

		if (traitorActor !== 0) {
			const pregWeeks = traitor.weeks;
			traitor.weeks = 0;

			WombProgress(traitorActor, pregWeeks, pregWeeks); /* In all cases should be done */
			WombUpdatePregVars(traitorActor);
			if (WombBirthReady(traitorActor, traitorActor.pregData.normalBirth) > 0 ) { /* normal birth case, partial birthers not supported*/
				traitorActor.preg = -1;
				traitorActor.counter.birthsTotal += WombBirthReady(traitorActor, traitorActor.pregData.normalBirth);
				WombFlush(traitorActor);
			} else { /* still pregnant slave */
				traitorActor.preg = WombMaxPreg(traitorActor); /* most ready fetus is a base*/
				traitorActor.pregWeek = WombMaxPreg(traitorActor); /* most ready fetus is a base*/
			}
			SetBellySize(traitorActor); /* In any case it's useful to do.*/
		}

		r.push(`You are awakened in the middle of the night by a jolt that shakes the entire arcology, accompanied by a distant boom. It is followed by another, and another, and then the wail of the arcology's alarm systems, and then finally by a faint crackle that grows to a constant chatter of gunfire. Main power goes out, and you claw your way in the darkness to the video feeds, running on emergency backup.`);

		App.Events.addParagraph(node, r);
		r = [];

		if (V.mercenaries > 0) {
			r.push(`Sheets of flame are pouring from your mercenaries' quarters; it seems they were among the first targets for bombs.`);
		}
		r.push(`Heavy gunfire is bringing down security drones by the scores. The attackers seem to have figured out where the drone hangars are, and are laying down fire on the exits the drones must use to get into action.`);
		if (traitorActor !== 0 && traitor.type !== "hostage") {
			const {
				his, he,
			} = getPronouns(traitorActor ? traitorActor : {pronoun: App.Data.Pronouns.Kind.neutral});
			r.push(`You can see`);
			if (traitorActor.bellyPreg >= 100000) {
				r.push(`the staggeringly pregnant`);
			} else if (traitorActor.bellyPreg >= 15000) {
				r.push(`the heavily pregnant`);
			} else if (traitorActor.bellyPreg >= 10000) {
				r.push(`the very pregnant`);
			} else if (traitorActor.bellyPreg >= 5000) {
				r.push(`the pregnant`);
			}
			r.push(`${traitorActor.slaveName} on one of the feeds,`);
			if (traitor.type === "agent" || traitor.type === "trapper") {
				r.push(`trying to sabotage a stockpile of explosives.`);
			} else if (traitor.type === "horror") {
				r.push(`encouraging ${his} fellow fighters`);
				if (canTalk(traitorActor)) {
					r.push(`with yells`);
				}
				r.push(`from the back lines.`);
			} else if (traitor.type === "defiant") {
				r.push(`encouraging ${his} fellow fighters`);
				if (canTalk(traitorActor)) {
					r.push(`with yells`);
				}
				r.push(`and spearheading the charge${(traitorActor.bellyPreg >= 15000) ? ` as best ${he} can` : ""}.`);
			} else {
				r.push(`encouraging ${his} fellow fighters${(canTalk(traitorActor)) ? " with yells" : ""}, and when that fails, leading them by example${(traitorActor.bellyPreg >= 15000) ? ` as best ${he} can` : ""}.`);
			}
		}
		r.push(`In areas already controlled by your enemies, slaveowners are being summarily shot in the streets.`);
		if (V.hackerSupport === 1) {
			r.push(`"${properTitle()}," ${V.assistant.name} says, "the Daughters of Liberty are attempting a coup. They appear to have smuggled a significant quantity of arms and explosives into the arcology.`);
		} else {
			r.push(`"${properTitle()}," ${V.assistant.name} says, "the Daughters of Liberty are attempting a coup. They appear to have smuggled a significant qua — zzzt —" There is nothing more from the computer systems.`);
		}

		App.Events.addParagraph(node, r);
		r = [];

		if (traitorActor !== 0) {
			r.push(`If this were a movie,`);
			if (traitor.type === "agent" || traitor.type === "hostage" || traitor.type === "trapper") {
				r.push(`you'd bleed out in the arms of the sobbing ${traitorActor.slaveName}`);
			} else {
				r.push(`${traitorActor.slaveName} would be the one to kill you`);
			}
			r.push(`after a desperate struggle in your office. Reality does not have such a refined sense of drama.`);
		}
		r.push(`If the Daughters had any plans to take you alive, they are lost to the exigencies of combat. Your penthouse remains locked down, forcing them to use breaching charges to make an entrance. These prove entirely too effective, and your last impression is of the floor heaving bodily up toward the ceiling.`);

		App.Events.addParagraph(node, r);
		App.UI.DOM.appendNewElement("p", node, "GAME OVER", "bold");
		V.ui = "start";
	}
};


code:
// cSpell:ignore fuckin

App.Events.PHackerSupport = class PHackerSupport extends App.Events.BaseEvent {
	execute(node) {
		const traitor = getTraitor();

		let r = [];

		V.nextButton = "End Call";
		V.hackerSupport = 0;

		V.fcnn.push("...the Daughters of Liberty as 'cyber-terrorists', after an attempted...");

		r.push(`While you are reviewing your information security posture in light of the Daughters of Liberty and their apparent ability to get into your systems, you receive yet another well-secured message unannounced. To your surprise, it isn't the Daughters. It's a video call from a rather interesting individual. She is quite pretty, and has a variety of facial tattoos and piercings; her face is androgynous enough that you aren't entirely sure what gender she (probably) considers herself. Her pale skin is illuminated by the diffuse glow from what's clearly a huge bank of monitors, and the clacking sound of a traditional mechanical keyboard can be heard over the line.`);

		App.Events.addParagraph(node, r);
		r = [];
		r.push(`"Hi!" she says cheerfully. "I seen you been contacted by these Daughters cunts. They been after me too. They're pretty decent at cyber-warfare, but I'm fuckin' better." A momentary discomfort crosses her face, and she shifts a little in her seat. "They're building up for somethin' big. Wouldn't a' contacted you at all, let us both fight our own fights, but I gotta short fuse on this vulnerability and I need to bribe a weak link. Your money can get me in; my skills can fuck 'em up. What do you say?${(traitor.actor && traitor.type === "hostage") ? `If it sweetens the deal at all, I can even get ${traitor.actor.slaveName} out of hot water. Not the brightest, that one.` : ""}"`);
		if (V.assistant.personality > 0) {
			const {
				hisA, girlA, womanA
			} = getPronouns(assistant.pronouns().main).appendSuffix("A");
			r.push(`${capFirstChar(V.assistant.name)} has been trying to track the contact, but fails horribly. The hacker glances at ${hisA}`);
			switch (V.assistant.appearance) {
				case "monstergirl":
					r.push(`frustrated little monster${girlA} avatar`);
					break;
				case "shemale":
					r.push(`angry little shemale avatar`);
					break;
				case "amazon":
					r.push(`raging little amazon avatar`);
					break;
				case "businesswoman":
					r.push(`mortified little business${womanA} avatar`);
					break;
				case "fairy":
				case "pregnant fairy":
					r.push(`pouting little fairy avatar`);
					break;
				case "goddess":
					r.push(`scornful little goddess avatar`);
					break;
				case "hypergoddess":
					r.push(`scornful "little" goddess avatar`);
					break;
				case "loli":
					r.push(`pouting little ${girlA} avatar`);
					break;
				case "preggololi":
					r.push(`pouting little ${girlA} avatar`);
					break;
				case "schoolgirl":
					r.push(`embarrassed little school${girlA} avatar`);
					break;
				case "angel":
					r.push(`terrified little angel avatar`);
					break;
				case "cherub":
					r.push(`terrified little cherub avatar`);
					break;
				case "incubus":
					r.push(`indignant little incubus avatar`);
					break;
				case "succubus":
					r.push(`frustrated little succubus avatar`);
					break;
				case "imp":
					r.push(`pouting little imp avatar`);
					break;
				case "witch":
					r.push(`frustrated little witch avatar`);
					break;
				case "ERROR_1606_APPEARANCE_FILE_CORRUPT":
					r.push(`expressionless little corrupted avatar`);
					break;
				default:
					r.push(`symbol`);
			}
			r.push(`and chuckles. "Haha, cute."`);
		}

		App.Events.addParagraph(node, r);
		r = [];

		r.push(`As she finishes speaking, another spasm distorts her expression, and then she suddenly relaxes. After a moment, she looks down, out of your field of view, and hisses,`);
		if (V.seeDicks === 0) {
			r.push(`"Keep licking, bitch, I like aftershocks. Work my clit, or it's your asshole."`);
		} else {
			r.push(`"Swallow, bitch. Every fucking drop, or it's your asshole."`);
		}

		App.Events.addParagraph(node, r);

		const fee = 10000;
		const choices = [];
		choices.push(new App.Events.Result(`Decline`, decline));
		choices.push(new App.Events.Result(`Accept`, accept, `This will cost ${cashFormat(fee)}`));
		App.Events.addResponses(node, choices);

		function decline() {
			const frag = new DocumentFragment();
			let r = [];
			V.nextButton = "Continue";
			App.Utils.updateUserButton();
			r.push(`She's almost certainly trying to extort a quick payoff. You politely decline. "Meh," she shrugs.`);
			if (V.seeDicks === 0) {
				r.push(`She shudders again and there's a gasping sound from down below. She looks down again, and as she ends the video call, you hear her say "Good job. Ha ha, fuck you, slut, it's your asshole anyway. Get me my strap-on."`);
			} else {
				r.push(`She shudders and there's a popping sound from down below, like a cockhead springing free of someone's mouth. Sure enough, a still-erect dickhead springs into view from the bottom of the screen; for that to be visible she has to be truly huge, almost as long as one of her forearms. She looks down again, and as she ends the video call, you hear her say "Good job. Ha ha, fuck you, slut, it's your asshole anyway. Rape time! Turn around." Tearful begging can be heard before the call closes.`);
			}
			if (traitor.type === "hostage") {
				traitor.actor = 0;
			}

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

		function accept() {
			const frag = new DocumentFragment();
			let r = [];
			V.nextButton = "Continue";
			App.Utils.updateUserButton();
			r.push(`You transfer the funds. "Meh," she shrugs.`);
			if (V.seeDicks === 0) {
				r.push(`She shudders again and there's a gasping sound from down below. She looks down again, and as she ends the video call, you hear her say "Good job. Ha ha, fuck you, slut, it's your asshole anyway. Get me my strap-on."`);
			} else {
				r.push(`She shudders and there's a popping sound from down below, like a cockhead springing free of someone's mouth. Sure enough, a still-erect dickhead springs into view from the bottom of the screen; for that to be visible she has to be truly huge, almost as long as one of her forearms. She looks down again, and as she ends the video call, you hear her say "Good job. Ha ha, fuck you, bitch, it's your asshole anyway. Buttrape time!"`);
			}
			if (V.assistant.personality > 0) {
				const {
					HeA, HisA,
					heA, hisA, himA, girlA, himselfA, womanA
				} = getPronouns(assistant.pronouns().main).appendSuffix("A");
				switch (V.assistant.appearance) {
					case "monstergirl":
						r.push(`She seems to have left a present for your poor personal assistant; ${hisA} little monster ${girlA} avatar is visible in the bottom corner of a screen on the wall opposite you, and is writhing around, babbling and orgasming continuously.`);
						break;
					case "shemale":
						r.push(`She seems to have left a present for your poor personal assistant; ${hisA} little shemale avatar is visible in the bottom corner of a screen on the wall opposite you. ${HeA}'s being assraped by a representation of the hacker in the same style, and is helplessly masturbating as ${heA} gets fucked.`);
						break;
					case "amazon":
						r.push(`She seems to have left a present for your poor personal assistant; ${hisA} little amazon avatar is visible in the bottom corner of a screen on the wall opposite you, and is writhing around, babbling and squirting continuously.`);
						break;
					case "businesswoman":
						r.push(`She seems to have left a present for your poor personal assistant; ${hisA} little business${womanA} avatar is visible in the bottom corner of a screen on the wall opposite you, and seems to be under a compulsion to strip out of ${hisA} suit. ${HeA}'s blushing furiously at ${hisA} inability to control ${himselfA}.`);
						break;
					case "fairy":
						r.push(`She seems to have left a present for your poor personal assistant; ${hisA} little fairy avatar is visible in the bottom corner of a screen on the wall opposite you, and is grinding against the stamen of a virtual flower. ${HeA} repeatedly moans your name as ${hisA} body twitches and jerks against the plant.`);
						break;
					case "pregnant fairy":
						r.push(`She seems to have left a present for your poor personal assistant; ${hisA} little fairy avatar is visible in the bottom corner of a screen on the wall opposite you, and is currently perched upon a virtual flower with the stamen buried in ${hisA} little ass. Milk leaks from ${hisA} breasts down ${hisA} swollen belly as ${heA} writhes in both pain and pleasure, slowly giving birth to a pair of fairies.`);
						break;
					case "goddess":
						r.push(`She seems to have left a present for your poor personal assistant; ${hisA} little goddess avatar is visible in the bottom corner of a screen on the wall opposite you. ${HeA}'s being facefucked by a representation of the hacker in the same style, meekly struggling, but flushed with arousal.`);
						break;
					case "hypergoddess":
						r.push(`She seems to have left a present for your poor personal assistant; ${hisA} "little" goddess avatar is visible in the bottom corner of a screen on the wall opposite you. ${HeA}'s being assfucked by a representation of the hacker in the same style, while ${hisA} large breasts are roughly milked. Every few thrusts coincide with another baby slipping out alongside an orgasm.`);
						break;
					case "loli":
						r.push(`She seems to have left a present for your poor personal assistant; ${hisA} little ${girlA} avatar is visible in the bottom corner of a screen on the wall opposite you.`);
						if (V.seePreg !== 0) {
							r.push(`${HisA} virginity is being forcibly taken by a representation of the hacker in the same style. ${HeA} cries out as she cums in ${hisA} fertile womb; again and again the hacker uploads her virus into ${hisA} abused pussy until ${hisA} sagging bloated belly is touching the floor. ${HeA} leaves the avatar drooling cum to rest on ${hisA} new pregnancy. ${HeA} may need to be reset after this experience.`);
							V.assistant.appearance = "preggololi";
						} else {
							r.push(`${HeA}'s writhing on the floor in tears as a series of hands tickles ${hisA} body. They shift their focus to ${hisA} nipples and pussy as ${heA} begins moaning with lust. As ${heA} twitches and jerks before the mounting orgasm, they vanish, leaving ${himA} writhing in sexual frustration before you. Before your eyes, ${hisA} hands shoot to ${hisA} crotch and ${heA} climaxes lewdly in front of you.`);
						}
						break;
					case "preggololi":
						r.push(`She seems to have left a present for your poor personal assistant; ${hisA} little ${girlA} avatar is visible in the bottom corner of a screen on the wall opposite you. ${HisA} vagina is being forcibly fucked by a representation of the hacker in the same style. Each thrust causes ${himA} to rock atop ${hisA} bulging pregnancy until the hacker unloads into ${himA}. She leaves the avatar drooling cum to rest on ${hisA} overfilled belly.`);
						break;
					case "schoolgirl":
						r.push(`She seems to have left a present for your poor personal assistant; ${hisA} little school ${girlA} avatar is visible in the bottom corner of a screen on the wall opposite you, and is blushing furiously as ${heA} compulsively fists ${himselfA}.`);
						break;
					case "angel":
						r.push(`She seems to have left a present for your poor personal assistant; ${hisA} little angel avatar is visible in the bottom corner of a screen on the wall opposite you. ${HisA} virginity is being forcibly taken by a representation of the hacker in the same style. ${HeA} pleads for them to stop before ${heA} falls, but it goes unheeded. ${HeA} cries out in orgasm as the hacker unloads their corrupting jism deep into ${hisA} womb before pulling out and letting ${himA} drop to the ground. ${HeA} rolls from side to side in anguish,`);
						if (V.seePreg !== 0) {
							r.push(`gripping ${hisA} cum-filled belly as it rounds more and more, before settling on ${hisA} back and cradling ${hisA} now full-term pregnancy. As it continues to grow, ${hisA} body becomes increasingly withered, until ${heA} appears to be pregnant with a fully grown person.`);
							if (V.seeExtreme === 1) {
								r.push(`As the light fades from ${himA}, ${hisA} gravid belly begins to shudder violently, its occupant trying to tear its way free. Before long, it splits open, revealing a gorgeous ${womanA} with all the features of the fallen angel. ${V.assistant.name} spreads ${hisA} bat-like wings as ${heA} rises from the disintegrating remains of ${hisA} once holy body, turns to you, and sensually traces ${hisA} new curves seductively.`);
							} else {
								r.push(`As the light fades from ${himA}, ${hisA} gravid belly begins to shudder violently, its occupant trying to find its way out. A pair of arms burst forth from ${hisA} ruined pussy, followed a perfectly endowed ${womanA} with all the features of the former angel. ${V.assistant.name} rises and spreads ${hisA} bat-like wings as the remains of ${hisA} once holy body turn to dust behind ${himA}. ${HeA} turns to you, sensually tracing the contours of ${hisA} new body, and blows you a kiss.`);
							}
						} else {
							r.push(`alternating between groping ${hisA} swelling breasts and fingering ${hisA} aching pussy, before screaming with climax as ${hisA} body twists into a more suiting form. ${V.assistant.name} rises to ${hisA} feet, spreads ${hisA} bat-like wings, and sensually traces ${hisA} new curves before bending over revealing ${hisA} sopping wet cunt. "All for you, ${V.PC.slaveName}, you know you want it."`);
						}
						V.assistant.appearance = "succubus";
						break;
					case "cherub":
						r.push(`She seems to have left a present for your poor personal assistant; ${hisA} little cherub avatar is visible in the bottom corner of a screen on the wall opposite you, and is writhing around, both hands on ${hisA} pussy and masturbating furiously.`);
						break;
					case "incubus":
						r.push(`She seems to have left a present for your poor personal assistant; ${hisA} little incubus avatar is visible in the bottom corner of a screen on the wall opposite you, ${hisA} dick steadily growing longer and prehensile. As ${heA} gasps in shock, it rockets into ${hisA} mouth and down ${hisA} throat. It delves deeper into the struggling demon, ${hisA} intestines bulging under ${hisA} skin as ${hisA} dick snakes through ${himA}, until it pops out the other end. It begins pistoning in and out of ${hisA} body, literally forcing ${himA} to fuck ${himselfA} until ${heA} cums, causing it to rapidly retract back through ${hisA} body. ${HeA} collapses to the floor, coughing up cum and struggling to catch ${hisA} breath.`);
						break;
					case "succubus":
						r.push(`She seems to have left a present for your poor personal assistant; ${hisA} little succubus avatar is visible in the bottom corner of a screen on the wall opposite you. ${HeA} has adjusted ${hisA} form to better suit ${hisA} lover: a representation of the hacker in the same style. ${HeA} calls out a silent name, something you'll never know, as she comes deep into ${hisA} pussy. They shift positions, ${V.assistant.name} standing, legs spread, with ${hisA} arms against the edge of the screen as the hacker fucks ${hisA} rear.`);
						if (V.seePreg !== 0) {
							r.push(`As ${heA} bucks against her, it is obvious that ${hisA} belly has rounded significantly; swaying slightly with every thrust. Cumming again, the hacker pulls ${hisA} leg up over their shoulder and begins thrusting anew, ${hisA} middle heavily rounded with child now, quickly bring both to orgasm. ${HeA} is left to slide down the edge of the screen and upon reaching the bottom, spreads ${hisA} legs and begins laboring on ${hisA} new child. Each imp that passes through ${hisA} netherlips brings another orgasm and muffled shout of the hacker's name. Once the last hacker imp leaves ${hisA} womb, ${heA}`);
						} else {
							r.push(`Position after position, orgasm after orgasm, you are forced to watch. Once the hacker is satisfied, ${heA} is left to slide down the edge of the screen, and, upon reaching the bottom,`);
						}
						r.push(`reaches down, gathers a trace of cum, and licks it off ${hisA} finger while staring you down, stating "${V.PC.slaveName} will never be as good as..." before passing out.`);
						break;
					case "imp":
						r.push(`She seems to have left a present for your poor personal assistant; ${hisA} little impish avatar is visible in the bottom corner of a screen on the wall opposite you, and is writhing around, vigorously fisting ${hisA} pussy.`);
						break;
					case "witch":
						r.push(`She seems to have left a present for your poor personal assistant; ${hisA} little witch avatar is visible in the bottom corner of a screen on the wall opposite you being assaulted by tentacles. They've already managed to rip ${hisA} robes off and are currently forcing themselves into all ${hisA} holes. Only once every orifice has two to three tentacles crammed into it does the beast start fucking ${himA}. Before long,`);
						if (V.seePreg !== 0) {
							r.push(`half the tentacles are pumping the poor ${girlA} full of cum while the rest fill ${himA} with eggs; ${heA} struggles valiantly at first, but as ${hisA} middle grows larger and heavier, ${heA} is forced to accept ${hisA} fate. When the tentacles feel they can fit no more eggs into ${himA}, they pull ${himA} into a sitting position and spread ${hisA} legs wide; just in time for the first hatched larva to begin squeezing its way from ${hisA} packed womb. Moments later, another plops from ${hisA} rear, and yet another squirms up ${hisA} throat and out ${hisA} mouth, flopping wetly onto ${hisA} chest. With each path cleared, the rest of the larvae begin to pour from ${hisA} body.`);
						} else {
							r.push(`the tentacles begin pumping the poor ${girlA} full of cum; ${heA} struggles valiantly at first, but as ${hisA} middle grows larger and heavier, ${heA} is forced to accept ${hisA} fate. As they vacate ${hisA} body, a large surge of fluid follows.`);
						}
						r.push(`Given the size of ${hisA} belly, it may be a while before ${heA} is done.`);
						break;
					case "ERROR_1606_APPEARANCE_FILE_CORRUPT":
						r.push(`She seems to have left a present for your poor personal assistant; ${hisA} little bugged avatar is visible in the bottom corner of a screen on the wall opposite you, and is writhing disturbingly. ${HisA} arms twist into a pair of extremely phallic tentacles, which it uses to forcefully fuck ${hisA} ass and pussy.`);
				}
			}
			cashX(-fee, "event");
			V.hackerSupport = 1;

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


code:
App.Events.PTraitorMessage = class PTraitorMessage extends App.Events.BaseEvent {
	eventPrerequisites() {
		return [
			() => getTraitor().actor !== 0
		];
	}

	execute(node) {
		let r = [];
		const traitor = getTraitor();
		const traitorActor = traitor.actor;
		const {
			He,
			he, him
		} = getPronouns(traitorActor ? traitorActor : {pronoun: App.Data.Pronouns.Kind.neutral});

		V.nextButton = "Continue";
		const weeks = traitor.weeks -1;
		const pregWeeks = traitor.weeks -1;
		traitor.weeks = 1;
		if (traitorActor === 0) { // never happens, just for typing
			return node;
		}

		/* ------------------ pregnancy setup start here----------------- */
		const wasPreg = (traitorActor.preg > 0) ? 1 : 0;

		WombProgress(traitorActor, pregWeeks, pregWeeks); /* In all cases should be done */
		WombUpdatePregVars(traitorActor);
		if (traitorActor.broodmother > 0) { /* Broodmother implant is assumed as removed.*/
			traitorActor.preg = -1;
			traitorActor.counter.birthsTotal += WombBirthReady(traitorActor, 37);
			traitorActor.broodmother = 0;
			traitorActor.broodmotherFetuses = 0;
			WombFlush(traitorActor);
		} else if (WombBirthReady(traitorActor, traitorActor.pregData.normalBirth) > 0 ) { /* normal birth case, partial birthers not supported*/
			traitorActor.preg = -1;
			traitorActor.counter.birthsTotal += WombBirthReady(traitorActor, traitorActor.pregData.normalBirth);
			WombFlush(traitorActor);
		} else { /* still pregnant slave */
			traitorActor.preg = WombMaxPreg(traitorActor); /* most ready fetus is a base*/
			traitorActor.pregWeek = WombMaxPreg(traitorActor); /* most ready fetus is a base*/
		}
		SetBellySize(traitorActor); /* In any case it's useful to do.*/

		const isPreg = (traitorActor.preg > 0) ? 1 : 0;

		/* ------------------ pregnancy setup end here-----------------
			r.push(`As no broodmother cases in code below, it's no need to setup every case of impregnation through new system. Backup mechanic will do it for normal pregnancies.`);
		*/

		if (traitorActor.fuckdoll !== 0) {
			traitorActor.fuckdoll = 0;
		}
		if (traitorActor.fetish === Fetish.MINDBROKEN) {
			traitorActor.fetish = "none";
			traitorActor.fetishStrength = 0;
		}
		if (traitorActor.hStyle === "shaved") {
			traitorActor.hStyle = "strip";
		}
		if (traitorActor.bald !== 1) {
			if (traitorActor.hLength < 150) {
				traitorActor.hLength += weeks;
			}
		}
		ageSlaveWeeks(traitorActor, weeks);

		r.push(`The month after freeing ${traitorActor.slaveName}, you receive another message from the Daughters of Liberty. This one contains a video. It shows ${traitorActor.slaveName} sitting quietly at a table${(wasPreg !== isPreg) ? ", no longer clearly pregnant" : ""}, wearing comfortable clothes and eating a nice meal.`);
		if (traitor.type === "agent") {
			if (traitorActor.intelligence+traitorActor.intelligenceImplant < -50) {
				r.push(`${He} looks a little bewildered, but there's an obvious happiness to ${him}; ${he} may be falling in with their teachings. ${He} seems unaware ${he}'s being recorded.`);
			} else if (wasPreg !== isPreg) {
				r.push(`${He} looks a little depressed, likely due to giving birth away from home, but ${he} is still playing the part of a traitor impeccably. ${He} seems aware ${he}'s being recorded and, for the briefest moment, makes eye contact with the camera.`);
			} else {
				r.push(`${He}'s playing the part of a traitor impeccably, feigning happiness despite yearning to be at your side. ${He} seems aware ${he}'s being recorded and, for the briefest moment, makes eye contact with the camera.`);
			}
		} else if (traitor.type === "defiant") {
			r.push(`${He} looks elated to be free, it's impossible to deny. ${He} seems unaware ${he}'s being recorded.`);
		} else if (traitor.type === "broken") {
			r.push(`${He} looks completely indifferent to the situation. ${He} likely is unaware that ${he} is no longer in the penthouse.`);
		} else {
			r.push(`${He} looks a little bewildered, but there's an obvious happiness to ${him}, it's impossible to deny. ${He} seems unaware ${he}'s being recorded.`);
		}

		App.Events.addParagraph(node, r);
		r = [];

		r.push(`A voice cuts in, calm but filled with unmistakable rage: "I hope you don't think this fixes everything, scum. We're still coming for you, and for all your slaveowning friends. All you've bought with this is the chance to maybe come out alive at the end. We'll be in touch."`);
		App.Events.addParagraph(node, r);
	}
};


code:
App.Events.PUndergroundRailroad = class PUndergroundRailroad extends App.Events.BaseEvent {
	execute(node) {
		V.nextButton = "Continue";
		let r = [];

		const traitor = getTraitor();
		const traitorActor = getTraitorActor();

		V.nextButton = " "; // hide button until user makes a selection

		V.collaboration = 0;
		traitor.actor = 0;
		V.hackerSupport = 0;

		const {
			He,
			he, him, himself, his
		} = getPronouns(traitorActor);
		const {
			HeA, HisA,
			heA, hisA, himA
		} = getPronouns(assistant.pronouns().main).appendSuffix("A");
		const {say, title: Master} = getEnunciation(traitorActor);
		V.fcnn.push("...you believe a slave has been contacted by the Daughters of Liberty, please call...");

		if (traitorActor.devotion + traitorActor.trust >= 175) {
			traitor.type = "agent";
		} else if (traitorActor.fuckdoll !== 0 || traitorActor.fetish === Fetish.MINDBROKEN) {
			traitor.type = "broken";
		} else if (traitorActor.trust <= -75) {
			traitor.type = "horror";
		} else if (traitorActor.devotion <= -20 && traitorActor.trust >= 20) {
			traitor.type = "defiant";
		} else {
			traitor.type = "standard";
		}

		/** Determines whether slave actually cares about potential freedom
		 * @param {FC.SlaveState} slave
		 * @returns {boolean}
		 */
		function desiresFreedom(slave) {
			return !isMindbroken(slave) &&
				(slave.devotion < jsRandom(50, 95) || slave.trust < 50);
		}

		r.push(`One fine day, as normal as any day surrounded by your slaves can be, you're sitting at your desk when`);
		if (traitor.type === "agent") {
			// TODO: canMove canWalk variants.
			r.push(`${traitorActor.slaveName} comes bursting into your office. ${He} crashes into your desk and`);
			if (canTalk(traitorActor)) {
				if (traitorActor.lips > 70) {
					r.push(`lisps through ${his} huge lips`);
				} else if (traitorActor.piercing.lips.weight + traitorActor.piercing.tongue.weight > 2) {
					r.push(`lisps through ${his} piercings`);
				} else {
					r.push(`shouts`);
				}
			} else {
				r.push(`gestures`);
			}
			r.push(`that several nondescript citizens ${he} sees occasionally at work have passed messages to ${him} this morning. Apparently, they simply asked whether ${he} wished to be free and the absurdity of it spurred ${him} to alert you. Even more unusual is the unannounced message waiting in your inbox — a message ${V.assistant.name} totally failed to inform you of. When asked,`);
		} else {
			r.push(`a message comes in. ${capFirstChar(V.assistant.name)} totally fails to announce it, which is unusual; when you ask ${himA} why not,`);
		}
		r.push(`${heA} replies`);
		if (V.assistant.personality > 0) {
			r.push(`flirtatiously, "What message, ${properTitle()}?"`);
			switch (V.assistant.appearance) {
				case "monstergirl":
					r.push(`${HisA} avatar's tentacle hair wiggles with incomprehension.`);
					break;
				case "shemale":
					r.push(`${HisA} avatar looks frustrated, ${hisA} hard-on wilting.`);
					break;
				case "amazon":
					r.push(`${HisA} avatar gives a little shriek of frustration.`);
					break;
				case "businesswoman":
					r.push(`${HisA} avatar wears an unaccustomed look of frustration.`);
					break;
				case "fairy":
				case "pregnant fairy":
					r.push(`${HisA} avatar crosses ${hisA} arms and ponders while hovering in the air.`);
					break;
				case "goddess":
					r.push(`${HisA} avatar looks concerned without ${hisA} usual sultry overtone.`);
					break;
				case "hypergoddess":
					r.push(`${HisA} avatar looks concerned without ${hisA} usual sultry overtone.`);
					break;
				case "loli":
					r.push(`${HisA} avatar seems eager to be out of your sight.`);
					break;
				case "preggololi":
					r.push(`${HisA} avatar rubs ${hisA} belly while looking extremely concerned.`);
					break;
				case "angel":
					r.push(`${HisA} avatar's wings droop as a worried look crosses ${hisA} face.`);
					break;
				case "cherub":
					r.push(`A concerned look forms on ${hisA} face as ${heA} hovers nearby.`);
					break;
				case "incubus":
					r.push(`${HisA} avatar looks frustrated, ${hisA} hard-on wilting.`);
					break;
				case "succubus":
					r.push(`${HeA} stops teasing you, a concerned look forming on ${hisA} pretty face.`);
					break;
				case "imp":
					r.push(`A concerned look forms on ${hisA} face as ${heA} hovers nearby.`);
					break;
				case "witch":
					r.push(`A look of worry spreads across ${hisA} face; a lingering dread that ${heA} did something bad.`);
					break;
				case "ERROR_1606_APPEARANCE_FILE_CORRUPT":
					r.push(`${HisA} avatar twitches slightly before sprouting multiple eyes facing all directions.`);
					break;
				case "schoolgirl":
					r.push(`${HisA} avatar puts on such a hard look of concentration that ${hisA} eyes cross.`);
					break;
				default:
					r.push(`${HisA} symbol avatar spins with frustration.`);
			}
		} else {
			r.push(`"You have received no messages in the past thirty seconds, ${properTitle()}."`);
		}
		r.push(`This is disturbing, to say the least. After close investigation, it appears someone has managed to plant a simple text message in your mail system without ${V.assistant.name} or any of your other security systems taking any notice. Worse, your mysterious correspondent seems willing to show off this ability in this petty display rather than simply sending a message anonymously.`);

		App.Events.addParagraph(node, r);
		r = [];

		r.push(
			`"You will free`,
			App.UI.DOM.slaveDescriptionDialog(traitorActor),
			`immediately," it reads. "This is the price of your continued survival. Agree and you buy yourself a few more moments at the top of your heap of shit. Refuse, and you shall fall that much sooner." The message is signed "The Daughters of Liberty."`
		);

		App.Events.addParagraph(node, r);
		r = [];

		if (traitor.type === "agent") {
			r.push(`${traitorActor.slaveName} is left aghast at the contents of the message, but quickly composes ${himself} and`);
			if (canTalk(traitorActor)) {
				r.push(
					`${say}s,`,
					Spoken(traitorActor, `"I think I have an idea, ${Master}. They'll likely take me in if you were to 'free' me and, from there, maybe I could feed you information, ${Master}. I could help expose them to you and they'd be none the wiser of the mistake they've made."`)
				);
			} else {
				r.push(`gestures there may be an opportunity here; they'd likely take ${him} in if ${he} were freed and ${he} could serve you from within the group as a double agent.`);
			}

			App.Events.addParagraph(node, r);
			r = [];

			App.Events.addResponses(node, [
				new App.Events.Result(`Let ${him} go`, agentRelease),
				new App.Events.Result(`Tell ${him} to ignore the Daughters in the future`, agentIgnore)
			]);
		} else if (traitor.type === "broken") {
			r.push(`${traitorActor.slaveName} is mentally absent, so you have your sincere doubts that ${he} actually knows anything about the matters at hand. ${He} does, however, serve as an anchor for your search. You review the surveillance recordings, tracking where and what ${he} was doing during ${his} day. It would appear that several nondescript citizens tried to carry on a conversation with ${him}. Peculiar.`);

			App.Events.addParagraph(node, r);
			r = [];

			App.Events.addResponses(node, [
				new App.Events.Result(`Free ${him}`, brokenFree),
				new App.Events.Result(`Ignore the situation`, brokenIgnore)
			]);
		} else {
			r.push(`You call ${traitorActor.slaveName} in and politely inquire as to whether ${he} knows anything about the matter.`);
			if (traitor.type === "horror") {
				r.push(`${He} breaks down in tears at the mention of it and barely manages to tell you that several nondescript citizens ${he} sees occasionally at work have passed a few messages to ${him}. Apparently, they simply asked whether ${he} wished to be free. Asked whether ${he} does in fact wish to be free,`);
				if (canTalk(traitorActor)) {
					r.push(`${he} sobs a yes.`);
				} else {
					r.push(`${he} weeps and nods.`);
				}
			} else if (traitor.type === "defiant") {
				r.push(`${He} stands ${his} ground and`);
				if (canTalk(traitorActor)) {
					if (traitorActor.lips > 70) {
						r.push(`lisps through ${his} huge lips,`);
					} else if (traitorActor.piercing.lips.weight + traitorActor.piercing.tongue.weight > 2) {
						r.push(`lisps through ${his} piercings,`);
					} else {
						r.push(`shouts,`);
					}
					r.push(Spoken(traitorActor, `"I'm going to ${canWalk(traitorActor) ? "walk" : "get"} out of this shithole or you're going to die a slow, deserved death. That enough for you?"`));
				} else {
					r.push(`gestures you'll free ${him} if you know what's good for you.`);
				}
			} else {
				r.push(`${He} ${canMove(traitorActor) ? "nearly flees" : "quivers"} in terror, but gathers ${his} courage and`);
				if (canTalk(traitorActor)) {
					if (traitorActor.lips > 70) {
						r.push(`lisps meekly through ${his} huge lips`);
					} else if (traitorActor.piercing.lips.weight + traitorActor.piercing.tongue.weight > 2) {
						r.push(`lisps meekly through ${his} piercings`);
					} else {
						r.push(`mumbles meekly`);
					}
				} else {
					r.push(`gestures meekly`);
				}
				r.push(`that several nondescript citizens ${he} sees occasionally at work have passed a few messages to ${him}. Apparently, they simply asked whether ${he} wished to be free. Asked whether ${he} does in fact wish to be free, ${he}`);
				if (canTalk(traitorActor)) {
					if (SlaveStatsChecker.checkForLisp(traitorActor)) {
						r.push(`lisps faintly,`);
					} else {
						r.push(`mutters faintly,`);
					}
					r.push(Spoken(traitorActor, `"I'm sorry, ${Master}. Yes."`));
				} else {
					r.push(`shakily gestures an apology, and admits that ${he} does.`);
				}
			}
			App.Events.addParagraph(node, r);

			const responses = [
				new App.Events.Result(`Free ${him}`, free),
				new App.Events.Result(`Tell ${him} to ignore the Daughters in the future`, ignore),
				new App.Events.Result(`Publicly flog ${him} for treasonous conversation`, flog),
			];

			if (V.seeExtreme === 1) {
				responses.push(new App.Events.Result(`Chemically lobotomize ${him} to extirpate any record of the incident`, lobotomy));
				if (!FutureSocieties.isActive('FSPaternalist')) {
					responses.push(new App.Events.Result(`Publicly execute ${him}`, execute));
				}
			}

			App.Events.addResponses(node, responses);
		}

		/**
		 * What's traitors, precious
		 * @returns {FC.SlaveState}
		 */
		function getTraitorActor() {
			// The order of qualities does not matter.
			const qualities = [
				(s) => s.fuckdoll === 0,
				(s) => s.fetish !== Fetish.MINDBROKEN,
				(s) => canWalk(s),
				(s) => canTalk(s),
				(s) => canSee(s),
				(s) => s.indenture === -1,
				(s) => [Job.CLUB, Job.PUBLIC, Job.WHORE, Job.BROTHEL].includes(s.assignment),
				(s) => s.devotion < 75,
				(s) => s.trust < 75,
			];
			let rankedSlaves = [];
			for (const slave of getSlaves().values()) {
				let value = 0;
				for (const quality of qualities) {
					if (quality(slave)) {
						value++;
					}
				}
				rankedSlaves.push({value: value, slave: slave});
			}

			// Find the highest bar we reached
			const highScore = Math.max(...rankedSlaves.map(s => s.value));

			// Find anyone that ties for first
			rankedSlaves = rankedSlaves.filter(s => s.value === highScore);

			return rankedSlaves.random().slave;
		}

		function sendTraitor() {
			if (traitorActor.relationship > 0) {
				const rel = getSlave(traitorActor.relationshipTarget);
				traitorActor.relationshipTarget = 0;
				traitorActor.relationship = 0;
				if (rel) {
					traitorActor.relationshipTarget = 0;
					traitorActor.relationship = 0;
				} else {
					r.push(`<span class="red">Error, relationshipTarget not found.</span>`);
				}
			}
			traitor.weeks = 1;
			traitor.actor = clone(traitorActor);
			traitor.actor.assignment = Job.REST;
			traitor.actor.pregControl = "none";
			deflate(traitor.actor);
			traitor.stats = {
				PCpregSource: SID.GENERIC,
				PCmother: SID.GENERIC,
				PCfather: SID.GENERIC,
				traitorMother: [],
				traitorFather: [],
				traitorPregSources: [],
				traitorMotherTank: [],
				traitorFatherTank: [],
				traitorBody: 0
			};
			if (traitor.actor.ID === V.PC.pregSource) {
				traitor.stats.PCpregSource = traitor.actor.ID;
			}
			if (V.PC.mother === traitor.actor.ID) {
				traitor.stats.PCmother = traitor.actor.ID;
			}
			if (V.PC.father === traitor.actor.ID) {
				traitor.stats.PCfather = traitor.actor.ID;
			}
			for (const slave of getSlaves().values()) {
				if (slave.ID !== traitor.actor.ID) {
					if (slave.mother === traitor.actor.ID) {
						traitor.stats.traitorMother.push(slave.ID);
					}
					if (slave.father === traitor.actor.ID) {
						traitor.stats.traitorFather.push(slave.ID);
					}
					if (traitor.actor.ID === slave.pregSource) {
						traitor.stats.traitorPregSources.push(slave.ID);
					}
				}
			}
			if (V.incubator.capacity > 0) {
				for (const child of getTankSlaves().values()) {
					if (traitor.actor.ID === child.mother) {
						traitor.stats.traitorMotherTank.push(child.ID);
					}
					if (traitor.actor.ID === child.father) {
						traitor.stats.traitorFatherTank.push(child.ID);
					}
				}
			}
			if (V.nursery > 0) {
				for (const child of getInfants().values()) {
					if (traitor.actor.ID === child.mother) {
						traitor.stats.traitorMotherTank.push(child.ID);
					}
					if (traitor.actor.ID === child.father) {
						traitor.stats.traitorFatherTank.push(child.ID);
					}
				}
			}
			traitor.actor.sisters = 0;
			traitor.actor.daughters = 0;
			if (traitor.actor.bodySwap > 0) {
				const myBody = getSlaves().find(s => s.origBodyOwnerID === traitorActor.ID)?.value;
				if (myBody) {
					traitor.stats.traitorBody = myBody.ID;
				}
			}
			removeSlave(traitorActor);
		}

		function agentRelease() {
			const frag = new DocumentFragment();
			let r = [];
			unlock();
			r.push(`You inform ${him} that ${he} may act as a double agent for you. ${He} nods and hurries out of the penthouse. ${He} wanders down through the arcology, attracting little notice. One moment the monitors have ${him} struggling through a dense-packed crowd, and the next, they don't.`);
			if (traitorActor.intelligence + traitorActor.intelligenceImplant < 10) {
				r.push(`${He} isn't the brightest slave, but ${he} means well. Hopefully this will not come back to bite you.`);
			} else {
				r.push(`${He} is smart enough to likely do some damage to the group shadowing you, at the very least.`);
			}
			sendTraitor();
			App.Events.addParagraph(frag, r);
			return frag;
		}

		function agentIgnore() {
			const frag = new DocumentFragment();
			let r = [];
			unlock();
			r.push(`${traitorActor.slaveName} nods ${his} head in acceptance. There is too much at stake to take such a risk. All attempts to use your monitoring systems to find the citizens who contacted ${him} fail; it seems their ability to corrupt your systems is considerable. ${He} keeps ${his} lips shut tight in an effort to prevent rumors from spreading, but whispers of freedom still manage to run through your chattel.`);
			getSlaves().filter(desiresFreedom).forEach(s => s.devotion -= 5);
			App.Events.addParagraph(frag, r);
			return frag;
		}

		function brokenFree() {
			const frag = new DocumentFragment();
			let r = [];
			unlock();
			r.push(`You decide to release ${him} into the streets and keep an eye on ${him}. ${He} is quickly scooped up by several citizens, some of which you recognize from the earlier video, and taken away. There is a plot in motion against you, and it extends worryingly deep into your domain.`);
			sendTraitor();
			App.Events.addParagraph(frag, r);
			return frag;
		}

		function brokenIgnore() {
			const frag = new DocumentFragment();
			let r = [];
			unlock();
			r.push(`You see no reason to humor them. All attempts to use your monitoring systems to find the citizens who visited ${traitorActor.slaveName} fail; it seems their ability to corrupt your systems is considerable. While ${he} doesn't talk, whispers of freedom still manage to run through your chattel.`);
			getSlaves().filter(desiresFreedom).forEach(s => s.devotion -= 5);
			App.Events.addParagraph(frag, r);
			return frag;
		}

		function free() {
			const frag = new DocumentFragment();
			let r = [];
			unlock();
			r.push(`You calmly inform ${him} that ${he}'s free to go.`);
			if (traitor.type === "defiant") {
				r.push(`${He} lets out a single harsh laugh and hurries out of the penthouse.`);
			} else {
				r.push(`${He} almost collapses with shock, but turns and hurries out of the penthouse, tears streaming from ${his} eyes.`);
			}
			r.push(`${He} wanders down through the arcology, attracting little notice. One moment the monitors have ${him} struggling through a dense-packed crowd, and the next, they don't.`);
			sendTraitor();
			App.Events.addParagraph(frag, r);
			return frag;
		}

		function ignore() {
			const frag = new DocumentFragment();
			let r = [];
			unlock();
			if (traitor.type === "defiant") {
				r.push(`${traitorActor.slaveName} merely <span class="devotion dec">smirks</span> when it becomes apparent you aren't going to punish ${him} for ${his} transgressions.`);
			} else {
				r.push(`${traitorActor.slaveName} almost <span class="devotion dec">faints with relief</span> when it becomes apparent you aren't going to punish ${him} for speaking of freedom.`);
			}
			r.push(`All attempts to use your monitoring systems to find the citizens who contacted ${him} fail; it seems their ability to corrupt your systems is considerable. Whispers of freedom run like wildfire amongst your slaves.`);
			getSlaves().filter(desiresFreedom).forEach(s => s.devotion -= 10);
			traitorActor.devotion -= 15;
			newRumor.weakness();
			App.Events.addParagraph(frag, r);
			return frag;
		}

		function flog() {
			const frag = new DocumentFragment();
			let r = [];
			unlock();
			r.push(`You announce that a treasonous slave will be publicly flogged. Treason is understood in the Free Cities to be activity that tends to undermine slavery, and public interest is considerable when ${traitorActor.slaveName} is dragged out into a public atrium and secured to a post. You do your duty; the one that passes the sentence should swing the lash. The ordeal is long and bloody. The populace understand the necessity of the punishment, though they are disturbed that such a thing could happen in your penthouse of all places. The effect on ${traitorActor.slaveName}'s health is serious, and ${he} is terrified of failing you again.`);
			traitorActor.trust -= 15;
			repX(-500, "event", traitorActor);
			healthDamage(traitorActor, 30);
			App.Events.addParagraph(frag, r);
			return frag;
		}

		function lobotomy() {
			const frag = new DocumentFragment();
			let r = [];
			unlock();
			r.push(`You inform ${traitorActor.slaveName} that ${he} is to return to ${his} duties, which ${he} does, mystified. Later in the day ${he} finds ${himself} scheduled for surgery, and meekly goes. As ${he} feels the cool touch of the injector, loaded with powerful chemical lobotomizing agents, ${he} looks up at the camera above the autosurgery with a hint of`);
			if (traitor.type === "defiant") {
				r.push(`regret`);
			} else {
				r.push(`resigned apology`);
			}
			r.push(`in ${his} eyes. When ${he} is released from the surgery's care a few hours later, the hint is gone. <span class="red">As is everything.</span>`);
			applyMindbroken(traitorActor);
			App.Events.addParagraph(frag, r);
			return frag;
		}

		function execute() {
			const frag = new DocumentFragment();
			let r = [];
			unlock();
			r.push(`You announce that a treasonous slave will be publicly executed. Treason is understood in the Free Cities to be activity that tends to undermine slavery, and public interest is considerable when ${traitorActor.slaveName} is dragged out into a public atrium and`);
			if (FutureSocieties.isActive('FSAztecRevivalist')) {
				r.push(`has ${his} heart cut out of ${his} living body.`);
			} else if (FutureSocieties.isActive('FSEdoRevivalist')) {
				r.push(`is boiled alive.`);
			} else if (FutureSocieties.isActive('FSRomanRevivalist')) {
				r.push(`is crucified and left hanging until ${he} perishes.`);
			} else {
				r.push(`is summarily hanged.`);
			}
			r.push(`The populace understands the necessity of the punishment, though they are disturbed that such a thing could happen in your penthouse of all places. The surviving slaves are terrified at the display, but at least you can be sure they will remember the price of failing you.`);
			repX(-500, "event", traitorActor);
			getSlaves().forEach(function(s) {
				s.trust -= 10 + random(10);
			});
			removeSlave(traitorActor, {dead: true, traitor: true});
			App.Events.addParagraph(frag, r);
			return frag;
		}

		/** unlock Continue button */
		function unlock() {
			V.nextButton = "Continue";
			App.Utils.updateUserButton();
		}
	}
};


code:
App.Events.pFoodCrisisLowerClass = class pFoodCrisisLowerClass extends App.Events.BaseEvent {
	actorPrerequisites() {
		return [];
	}

	eventPrerequisites() {
		return [
			() => App.Events.effectiveWeek() >= 48,
			() => !!V.mods.food.enabled,
			() => !V.eventResults.foodCrisis,
		];
	}

	execute(node) {
		const discount = V.PC.skill.trading >= 50 && ["capitalist", "entrepreneur", "business kid"].includes(V.PC.career) || V.PC.skill.trading >= 100;
		const price = discount ? 7500 : 10000;

		App.Events.addParagraph(node, [`The region supplying much of the Free City's food had been battling a famine for quite some time now — between the deteriorating weather and the war raging on — but it had always seemed the situation was improving, and your arcology's citizens never really had to worry about going to bed hungry. Unfortunately, that all changed this week. A firefight had broken out near one of the region's largest farms, and one of the main reserves of food was caught in the crossfire.`]);
		App.Events.addParagraph(node, [`Supplies steadily began to dwindle, and it wasn't long before the prices of food began to rise as a result. ${V.arcologyUpgrade.hydro ? `Even the hydroponics system you had installed earlier could barely put a dent in the needs of your citizens.` : ``} Now, the poorest in your arcology are facing starvation. Seeing no other choice, they turned to you to provide them with sustenance. This is a unique opportunity. It's unlikely your citizens would ask for your help again, should you choose not to help them.`]);

		App.Events.addResponses(node, [
			new App.Events.Result(`Provide them with ample rations`, ample, `This will cost ${cashFormat(price * 2.5)} and ${discount ? `some upkeep, reduced by your knowledge of trading` : `will incur significant upkeep costs`}.`),
			new App.Events.Result(`Give them enough to survive on`, enough, `This will cost ${cashFormat(price * 1.5)} and ${discount ? `some upkeep, reduced by your knowledge of trading` : `will incur significant upkeep costs`}.`),
			new App.Events.Result(`They can figure their problem out on their own`, refuse)
		]);

		V.eventResults.foodCrisis = 1;	// don't repeat this event

		function ample() {
			V.mods.food.rations = 2;
			cashX(forceNeg(price * 2.5), "farmyard");
			repX(3500, "event");

			App.Events.queueEvent(2, new App.Events.pFoodCrisisMiddleClass());
			return `You have enough to go around, so you decide to help the desperate citizens. You have a number of rationing stations set up throughout ${V.arcologies[0].name} and announce that each citizen is entitled to four full meals a day, more than enough to sate the hunger of even the most famished of men. Your citizens are thrilled to hear that their leader is looking out for them.`;
		}

		function enough() {
			V.mods.food.rations = 1;
			cashX(forceNeg(price * 1.5), "farmyard");
			repX(2000, "event");

			App.Events.queueEvent(2, new App.Events.pFoodCrisisMiddleClass());
			return `You have your own problems to deal with, but that doesn't mean you don't look out for your own. You have a number of rationing stations set up throughout ${V.arcologies[0].name} and announce that each citizen is entitled to two full meals a day, just enough for your citizens not to starve. Your citizens are happy to hear that their leader is looking out for them.`;
		}

		function refuse() {
			V.mods.food.rations = 0;
			repX(-1500, "event");
			return `You have your own problems to deal with, and you simply can't afford to drop everything and solve theirs at the moment. That you can't take care of your arcology's citizen reflects poorly on you.`;
		}
	}
};