code:
// TODO: add devotion and trust effects to animal variant
App.Facilities.Pit.lethalFight = function(fighters) {
	const frag = new DocumentFragment();

	const animals = [];
	/** @type {FC.AnimalState} */
	let animal = null;

	if (V.active.canine) {
		animals.push(V.active.canine);
	}
	if (V.active.hooved) {
		animals.push(V.active.hooved);
	}
	if (V.active.feline) {
		animals.push(V.active.feline);
	}

	if (V.pit.fighters === 2  || V.pit.slaveFightingAnimal) {
		animal = V.pit.animal === 'random'
			? getAnimal(animals.random())
			: getAnimal(V.pit.animal);
	}

	let winner;
	let loser;

	if (animal) {
		winner = getWinner() ? getSlave(fighters[0]) : animal;
		loser = winner.hasOwnProperty('species') ? getSlave(fighters[0]) : animal;
	} else {
		winner = getWinner() ? getSlave(fighters[0]) : getSlave(fighters[1]);
		loser = winner.ID === fighters[0] ? getSlave(fighters[1]) : getSlave(fighters[0]);
	}

	if (V.debugMode) {
		console.log(winner, loser, animal);
	}

	intro(frag);
	fighterDeadliness(frag, getSlave(fighters[0]));
	if (!animal) {
		fighterDeadliness(frag, getSlave(fighters[1]));
	}
	fight(frag);
	postFight(frag);

	V.pit.slaveFightingBodyguard = null;
	V.pit.slaveFightingAnimal = null;
	V.pit.slavesFighting = [];

	return frag;

	/** @param {DocumentFragment} parent */
	function intro(parent) {
		const fighterOne = getSlave(fighters[0]);
		const fighterTwo = getSlave(fighters[1]) || null;

		if (V.debugMode) {
			console.log(fighterOne, fighterTwo);
		}

		const r = [];

		App.Events.drawEventArt(parent, fighters.map(id => getSlave(id)), "no clothing");

		const anAnimal = animal ? `${animal.articleAn} ${animal.name}.` : null;

		r.push(`This week's fight is between`,
			App.UI.DOM.slaveDescriptionDialog(fighterOne), `and`,
			animal
				? anAnimal
				: App.UI.DOM.combineNodes(contextualIntro(fighterOne, fighterTwo, true), "."));

		if (V.pit.audience === "none") {
			r.push(`You are alone above the pit, left to watch them kill and die in private.`);
		} else if (V.pit.audience === "free") {
			r.push(`Your guests line the rim of the pit, joking and betting, nervous and excited by the close prospect of watching a slave die.`);
		} else {
			r.push(`The attendees line the rim of the pit, betting and arguing, nervous and excited by the close prospect of watching a slave die.`);
		}

		if (V.arcologies[0].FSRomanRevivalist !== "unset") {
			r.push(`They `, App.UI.DOM.makeElement("span", `passionately approve`, ['reputation', 'inc']), ` of your hosting lethal combat between slaves; this advances ideas from antiquity about what public events should be.`);

			repX(20 * V.FSSingleSlaveRep * (V.arcologies[0].FSRomanRevivalist / V.FSLockinLevel), "pit");
			V.arcologies[0].FSRomanRevivalist += (0.4 * V.FSSingleSlaveRep);
		} else if (V.arcologies[0].FSAztecRevivalist !== "unset") {
			r.push(`They `, App.UI.DOM.makeElement("span", `approve`, ['reputation', 'inc']), ` of your hosting lethal combat; this advances ideas that blood must flow as it did in ancient times.`);

			repX(10 * V.FSSingleSlaveRep * (V.arcologies[0].FSAztecRevivalist / V.FSLockinLevel), "pit");
			V.arcologies[0].FSAztecRevivalist += (0.2 * V.FSSingleSlaveRep);
		}

		if (animal) {
			const slave = getSlave(fighters[0]);
			const {he, him, his} = getPronouns(slave);

			r.push(`You review the rules — the slave will use ${his} choice of swords, and the fight will be to the death. If ${he} wins, ${he} will earn two complete days of rest, not to mention continued life. You take a moment to look over ${fighterOne.slaveName} one more time before giving the word. After all, it might be the last time you'll see ${him} alive.`);
		} else {
			r.push(`You review the rules — the combatants will use their choice of swords, and the fight will be to the death, with both fighters executed if no decision is reached. The winner will earn two complete days of rest, not to mention continued life. You take a moment to look over your fighters one more time before giving the word. After all, this is likely the last time you'll see one of them alive.`);
		}

		App.Events.addParagraph(parent, r);
	}

	/**
	 * @param {DocumentFragment} parent
	 * @param {App.Entity.SlaveState} fighter
	 */
	function fighterDeadliness(parent, fighter) {
		const {he, his, him, himself, He, His} = getPronouns(fighter);
		const fighterDeadliness = deadliness(fighter);

		const r = [];

		r.push(
			confidence(),
			willingness(),
			skill(),
			age(),
			muscles(),
			height(),
			health(),
			weight(),
			tired(),
			pregnancy(),
			labor(),
			bellyFluid(),
			sight(),
			hearing(),
			prosthetics(),
		);

		App.Events.addParagraph(parent, r);

		function confidence() {
			if (fighter.fetish === "mindbroken") {
				return `${fighter.slaveName} is too broken to care about whether ${he} lives or dies;`;
			} else if (fighterDeadliness > 5) {
				return `${fighter.slaveName} seems very confident;`;
			} else if (fighterDeadliness > 3) {
				return `${fighter.slaveName} seems nervous, but steels ${himself};`;
			} else if (fighterDeadliness > 1) {
				return `${fighter.slaveName} seems hesitant and unsure;`;
			} else {
				return `${fighter.slaveName} is obviously terrified, and might flee if there were a way out of the pit;`;
			}
		}

		function willingness() {
			if (fighter.fetish === "mindbroken") {
				return `${he} is indifferent to the prospect of killing, as well.`;
			} else if (fighter.devotion > 95) {
				return `${he} is clearly willing to do ${his} best to kill for you.`;
			} else if (fighter.fetish === "sadist" && fighter.fetishKnown && fighter.fetishStrength > 60) {
				return `the prospect of killing does not seem to concern ${him}.`;
			} else if (fighter.devotion > 50) {
				return `${he} obviously does not want to kill, but will do as you order.`;
			} else if (fighter.devotion > -20) {
				return `${he} is clearly unhappy at the prospect of killing, but knows that the alternative is death.`;
			} else {
				return `${he} knows that it's kill or be killed, and puts aside ${his} hatred of you in an effort to live.`;
			}
		}

		function skill() {
			if (fighter.skill.combat > 0) {
				return `${His} grip on ${his} sword is sure and easy.`;
			}
		}

		function age() {
			if (V.AgePenalty !== 0) {
				if (fighter.physicalAge >= 100) {
					return `${He} seems prepared for death, in a way.`;
				} else if (fighter.physicalAge >= 85) {
					return `${He} tries not to waste ${his} strength before the fight, knowing that ${his} extreme age won't allow ${him} a second wind.`;
				} else if (fighter.physicalAge >= 70) {
					return `${He} steadies ${himself} as well as ${he} can in ${his} advanced age.`;
				}
			}
		}

		function muscles() {
			if (fighter.muscles > 95) {
				return `${He} is wielding a massive two-handed blade few others could even heft.`;
			} else if (fighter.muscles > 30) {
				return `${He} is strong enough to handle a bastard sword.`;
			} else if (fighter.muscles > 5) {
				return `${He} has selected a longsword suited to ${his} strength.`;
			} else if (fighter.muscles < -95) {
				return `${He} has selected a meager dagger; even then ${he} can barely wield it.`;
			} else if (fighter.muscles < -30) {
				return `${He} has selected a dagger, the heaviest weapon ${he} can manage.`;
			} else if (fighter.muscles < -5) {
				return `${He} has selected a short sword, despite being able to barely lift it.`;
			} else {
				return `${He} has selected a short sword, the heaviest weapon ${he} can manage.`;
			}
		}

		function height() {
			if (fighter.height > 170) {
				return `${His} height gives ${him} a reach advantage.`;
			}
		}

		function health() {
			if (fighter.health.condition > 50) {
				return `${His} shining health makes ${him} a better fighter.`;
			} else if (fighter.health.condition) {
				return `${His} poor health makes ${him} a weaker combatant.`;
			}
		}

		function weight() {
			if (fighter.weight > 190) {
				return `${His} extreme weight nearly immobilizes ${him}. ${He} struggles to move let alone fight.`;
			} else if (fighter.weight > 160) {
				return `${His} extreme weight limits ${his} mobility and range of motion, making ${him} an easy target.`;
			} else if (fighter.weight > 130) {
				return `${His} extreme weight holds ${him} back as a pit fighter.`;
			} else if (fighter.weight > 30) {
				return `${His} heavy weight is an impediment as a pit fighter.`;
			} else if (fighter.weight < -10) {
				return `${His} light weight is an impediment as a pit fighter.`;
			}
		}

		function tired() {
			if (fighter.health.tired > 90) {
				return `${He} is exhausted and can barely stay awake; ${he} won't put up a fight.`;
			} else if (fighter.health.tired > 60) {
				return `${He} is fatigued, sapping the strength ${he}'ll need to strike true.`;
			} else if (fighter.health.tired > 30) {
				return `${He} is tired and more likely to take a hit then to give one.`;
			}
		}

		function pregnancy() {
			if (fighter.pregKnown || fighter.bellyPreg > 1500) {
				if (fighter.bellyPreg > 750000) {
					return `${His} monolithic pregnancy guarantees ${his} and ${his} many, many children's deaths; not only is ${he} on the verge of splitting open, but it is an unmissable, indefensible target. ${He} has no hope of attacking around the straining mass, let alone stopping ${his} opponent. ${He} is damned.`;
				} else if (fighter.bellyPreg > 600000) {
					return `${His} titanic pregnancy is practically a death sentence; not only does ${he} risk bursting, but it is an unmissable, indefensible target. ${He} can barely keep it together while thinking about the lives of ${his} brood.`;
				} else if (fighter.bellyPreg > 450000) {
					return `${His} gigantic pregnancy practically damns ${him}; it presents an unmissable, indefensible target for ${his} adversary. ${He} can barely keep it together while thinking about the lives of ${his} brood.`;
				} else if (fighter.bellyPreg > 300000) {
					return `${His} massive pregnancy obstructs ${his} movement and greatly hinders ${him}. ${He} struggles to think of how ${he} could even begin to defend it from harm.`;
				} else if (fighter.bellyPreg > 150000) {
					return `${His} giant pregnancy obstructs ${his} movement and greatly slows ${him} down. ${He} tries not to think of how many lives are depending on ${him}.`;
				} else if (fighter.bellyPreg > 100000) {
					return `${His} giant belly gets in ${his} way and weighs ${him} down. ${He} is terrified for the lives of ${his} many children.`;
				} else if (fighter.bellyPreg > 10000) {
					return `${His} huge belly gets in ${his} way and weighs ${him} down. ${He} is terrified for the ${fighter.pregType > 1 ? `lives of ${his} children` : `life of ${his} child`}.`;
				} else if (fighter.bellyPreg > 5000) {
					return `${His} advanced pregnancy makes ${him} much less effective, not to mention terrified for ${his} child${fighter.pregType > 1 ? `ren` : ``}.`;
				} else if (fighter.bellyPreg > 1500) {
					return `${His} growing pregnancy distracts ${him} with concern over the life growing within ${him}.`;
				} else {
					return `The life just beginning to grow inside ${him} distracts ${him} from the fight.`;
				}
			} else if (fighter.bellyImplant > 1500) {
				if (fighter.bellyImplant > 750000) {
					return `${His} monolithic, ${fighter.bellyImplant}cc implant-filled belly guarantees ${his} death; not only is ${he} on the verge of splitting open, but it is an unmissable, indefensible target that threatens to drag ${him} to the ground. ${He} has no hope of attacking around the straining mass, let alone stopping ${his} opponent.`;
				} else if (fighter.bellyImplant > 600000) {
					return `${His} titanic, ${fighter.bellyImplant}cc implant-filled belly is practically a guaranteed death; ${he} can barely stand let alone fight. Not only is it cripplingly heavy, unwieldy and an easy target, but ${he} can feel it straining to hold the sheer amount of filler forced into it.`;
				} else if (fighter.bellyImplant > 450000) {
					return `${His} gigantic, ${fighter.bellyImplant}cc implant-filled belly is nearly a guaranteed death; it presents an unmissable, indefensible target for ${his} adversary.`;
				} else if (fighter.bellyImplant > 300000) {
					return `${His} massive, ${fighter.bellyImplant}cc implant-filled belly is extremely heavy, unwieldy and an easy target, practically damning ${him} in combat.`;
				} else if (fighter.bellyImplant > 150000) {
					return `${His} giant, ${fighter.bellyImplant}cc implant-filled belly obstructs ${his} movement and greatly slows ${him} down.`;
				} else if (fighter.bellyImplant > 100000) {
					return `${His} giant, ${fighter.bellyImplant}cc implant-filled belly is very heavy and unwieldy, throwing off ${his} weight and making ${him} far less effective.`;
				} else if (fighter.bellyImplant > 10000) {
					return `${His} huge, ${fighter.bellyImplant}cc implant-filled belly is very heavy and unwieldy, throwing off ${his} weight and making ${him} far less effective.`;
				} else if (fighter.bellyImplant > 5000) {
					return `${His} large, ${fighter.bellyImplant}cc implant-filled belly is heavy and unwieldy, rendering ${him} less effective.`;
				} else if (fighter.bellyImplant > 1500) {
					return `${His} swollen, ${fighter.bellyImplant}cc implant-filled belly is heavy and makes ${him} less effective.`;
				}
			}
		}

		function labor() {
			if (isInLabor(fighter)) {
				return `${He}'s feeling labor pains. ${His} ${fighter.pregType > 1 ? `children are` : `child is`} ready to be born, oblivious to the fact that it will mean the death of ${fighter.pregType > 1 ? `their` : `its`} mother.`;
			} else if (fighter.preg > fighter.pregData.normalBirth && fighter.pregControl !== "labor suppressors") {
				return `${He}'ll be going into labor any time now and ${he} knows it. ${He}'s terrified of the thought of ${his} water breaking during the fight.`;
			}
		}

		function bellyFluid() {
			if (fighter.bellyFluid > 10000) {
				return `${His} hugely bloated, ${fighter.inflationType}-filled belly is taut and painful, hindering ${his} ability to fight.`;
			} else if (fighter.bellyFluid > 5000) {
				return `${His} bloated, ${fighter.inflationType}-stuffed belly is constantly jiggling and moving, distracting ${him} and throwing off ${his} weight.`;
			} else if (fighter.bellyFluid > 2000) {
				return `${His} distended, ${fighter.inflationType}-belly is uncomfortable and heavy, distracting ${him}.`;
			}
		}

		function sight() {
			if (!canSee(fighter)) {
				return `${His} lack of eyesight is certain death.`;
			} else if (!canSeePerfectly(fighter)) {
				return `${His} poor eyesight makes ${him} a weaker combatant.`;
			}
		}

		function hearing() {
			if (!canHear(fighter)) {
				return `${His} lack of hearing is a major detriment.`;
			} else if ((fighter.hears === -1 && fighter.earwear !== "hearing aids") || (fighter.hears === 0 && fighter.earwear === "muffling ear plugs")) {		// TODO: replace with canHearPerfectly
				return `${His} poor hearing is a minor detriment.`;
			}
		}

		function prosthetics() {
			if (hasAnyProstheticLimbs(fighter) && !hasAnyQuadrupedLimbs(fighter)) {
				const r = [];

				r.push(`The pit lights gleam on ${his} P-Limbs.`);

				if (getLimbCount(fighter, 6) > 0) {
					r.push(`The limits on ${his} cybernetic limbs have been lifted, turning them deadly.`);
				} else if (getLimbCount(fighter, 5) > 0) {
					r.push(`Their integral weapons are fully uncaged.`);
				}

				return r.join(' ');
			}
			if (hasAnyProstheticLimbs(fighter) && hasAnyQuadrupedLimbs(fighter)) {
				const r = [];

				r.push(`The pit lights gleam on ${his} quadrupedal limbs. The retractable claws of ${his} paws have been fully extended, ready to rip and tear.`);
				return r.join(' ');
			}
		}
	}

	/** @param {DocumentFragment} parent */
	function fight(parent) {
		const r = [];

		r.push(`In any case, ${animal ? `the slave and the ${animal.name} have both` : `both of the slaves`} been dosed with aggression enhancers and inhibition blockers; they'll fight to kill.`);

		if (animal) {
			if (winner.hasOwnProperty('slaveName')) {
				const {he, his, him, himself, girl, He} = getPronouns(winner);

				if (!canSee(winner)) {
					r.push(`${winner.slaveName} centers ${himself} and hones in on the ${animal.name}'s rapid breath. ${He} readies ${himself}, knowing ${he} has a single chance to live. With heavy steps, the ${animal.species} rushes at ${him}, fully prepared to slaughter the helpless combatant. ${winner.slaveName} gambles everything on a single high slash, a slash that cuts the ${animal.species}'s undefended neck wide open. ${winner.slaveName} collapses to the ground, fully aware of the ${animal.species}'s final gurgles and the `, App.UI.DOM.makeElement('span', `deep scratch in ${his} side.`, ['health', 'dec']), ` ${He} lived this time, barely, but ${he} doubts ${he} can do it again.`);

					healthDamage(winner, 75);

					if (V.pit.audience === 'paid') {
						r.push(`The audience is awestruck by the blind ${girl}'s triumph, and your`, App.UI.DOM.makeElement('span', `cut of the betting`, ['cash', 'inc']), ` is enormous.`);

						cashX(10000, "pit", winner);
					} else if (V.pit.audience === "free") {
						r.push(`The audience is `, App.UI.DOM.makeElement("span", `awestruck`, ['reputation', 'inc']), `by the blind ${girl}'s triumph.`);

						repX(1000, "pit", winner);
					}
				} else if (winner.muscles) {
					r.push(`${winner.slaveName} is so massively muscular that ${he}'s actually impeded by ${his} lack of speed and flexibility. The ${animal.species} is suitably cautious, and it does its best to avoid ${his} sword. The two go back and forth for a while – the slave slashing and swinging, the animal leaping out of the way. ${winner.slaveName} finally manages to get the better of the ${animal.species}, though, and manages to catch the tip of ${his} sword on the animal's leg. With a loud ${animal.type === 'canine' ? `yelp` : animal.type === 'hooved' ? `whinny` : `howl`}, the ${animal.species} stumbles back, giving the slave a chance to bring ${his} sword down in an overhead swing, nearly removing the ${animal.species}'s head.`);

					if (V.pit.audience === 'paid') {
						r.push(`The audience is awestruck by the blind ${girl}'s triumph, and your`, App.UI.DOM.makeElement('span', `cut of the betting`, ['cash', 'inc']), ` is enormous.`);

						cashX(10000, "pit", winner);
					} else if (V.pit.audience === "free") {
						r.push(`The audience is `, App.UI.DOM.makeElement("span", `awestruck`, ['reputation', 'inc']), `by the blind ${girl}'s triumph.`);

						repX(1000, "pit", winner);
					}
				} else {
					if (V.pit.audience === 'paid') {
						r.push(`The audience is awestruck by the blind ${girl}'s triumph, and your`, App.UI.DOM.makeElement('span', `cut of the betting`, ['cash', 'inc']), ` is enormous.`);

						cashX(10000, "pit", winner);
					} else if (V.pit.audience === "free") {
						r.push(`The audience is `, App.UI.DOM.makeElement("span", `awestruck`, ['reputation', 'inc']), `by the blind ${girl}'s triumph.`);

						repX(1000, "pit", winner);
					}
				}
			} else {
				const {he, his, him, He} = getPronouns(loser);

				if (!canSee(loser)) {
					r.push(`The ${animal.species} isn't aware that its opponent is blind, and either way, it wouldn't have cared. It slowly paces around the flailing ${loser.slaveName}, looking for an opening. Seeing one, the ${animal.species} ${animal.type === "hooved" ? `rushes` : `lunges`} at ${him}, ending ${his} life in one fell swoop.`);

					if (V.pit.audience === "paid") {
						r.push(`The audience found the fight embarrassing, and your `, App.UI.DOM.makeElement("span", `cut of the betting`, ['cash', 'inc']), ` is pitiful.`);

						cashX(40, "pit", loser);
					} else if (V.pit.audience === "free") {
						r.push(`The audience is `, App.UI.DOM.makeElement("span", `annoyed`, ["reputation", "dec"]), ` by this waste of a fight.`);

						repX(-20, "pit", loser);
					}
				} else if (deadliness(winner) < deadliness(loser) + 3) {
					if (loser.skill.combat > 0) {
						r.push(`${loser.slaveName} is fairly confident in ${his} fighting abilities, and ${he} knows that this fight is fairly evenly matched.`);
					} else {
						r.push(`${loser.slaveName} doesn't know how to handle a sword, but ${he} feels fairly confident in ${his} chances all the same.`);
					}

					r.push(`${He} doesn't know how to go about attacking an animal, though, so ${he} decides to play it safe and keep the ${animal.species} at sword's length. The ${animal.species} make a few false lunges at the slave, all the while keeping out of reach. After a few minutes of this, though, it's evident that ${loser.slaveName} is beginning to tire: ${his} sword is beginning to swing slower and slower, and ${his} stance isn't as straight. The animal seems to sense this, and, spotting an opening, makes a final lunge. Its ${animal.type === "hooved" ? `hooves connect with ${his} skull` : `teeth sink into ${his} throat`}, ending ${his} life almost immediately.`);
				} else if (loser.belly > 300000) {
					r.push(`${loser.slaveName}'s belly is too big to possibly defend, so ${he} can't help but ${canSee(loser) ? `watch` : `cringe`} in horror as the ${animal.species} lunges at ${him}, ${animal.type === "hooved" ? `headfirst` : `fangs and claws outstretched`}. ${loser.slaveName}'s belly ruptures like a popped water balloon, showering the animal with`);

					if (loser.pregType > 0) {
						r.push(`blood. ${loser.slaveName} collapses into the pile of organs and babies released from ${his} body.`);
					} else if (loser.bellyImplant > 0) {
						r.push(`blood and filler. ${loser.slaveName} collapses into the pool of organs and fluid released from ${his} body.`);
					} else {
						r.push(`blood and ${loser.inflationType}. ${loser.slaveName} collapses into the pool of organs and fluid released from ${his} body.`);
					}

					r.push(`With a ${animal.type === "hooved" ? `growl` : `snort`}, the ${animal.species} quickly finishes ${him} off${animal.type === "hooved" ? ` with a swift kick to the head` : ``}.`);

					if (V.pit.audience === "paid") {
						r.push(`The audience is not very impressed by this easy kill, and your `, App.UI.DOM.makeElement("span", `cut of the betting`, ['cash', 'inc']), ` is also unimpressive.`);

						cashX(2000, "pit", loser);
					} else if (V.pit.audience === "free") {
						r.push(`the audience is `, App.UI.DOM.makeElement("span", `not very impressed`, ['reputation', 'inc']), ` by this easy kill.`);

						repX(100, "pit", loser);
					}
				} else if (loser.boobs > 1200) {
					r.push(`${loser.slaveName}'s tits are too big to possibly defend, so ${he} can't help but ${canSee(loser) ? `watch` : `cringe`} in horror in horror as the ${animal.species} lunges at ${him}, ${animal.type === "hooved" ? `headfirst` : `fangs and claws outstretched`}. ${loser.slaveName}'s reflexively drops ${his} sword to clasp ${his} ${hasBothArms(loser) ? `hands` : `hand`} over ${his} ruined breasts, gushing blood${loser.boobsImplant > 400 ? ` and implant fluid` : ``}. The ${animal.species} follows up with a ${animal.type === "hooved"
						? `fierce bite to ${hasBothLegs(loser) ? `one of ${his} legs` : hasAnyLegs(loser) ? `${his} leg` : `${his} rear`}, causing ${him} to collapse. A second later, than animal's fangs have finished ${him} off.`
						: `swift kick to the chest, causing ${him} to drop like a rock. Another blow to the head finishes ${him} off.`}`);

					if (V.pit.audience === "paid") {
						r.push(`The audience is not very impressed by this easy kill, and your `, App.UI.DOM.makeElement("span", `cut of the betting`, ['cash', 'inc']), ` is also unimpressive.`);

						cashX(2000, "pit", loser);
					} else if (V.pit.audience === "free") {
						r.push(`The audience is `, App.UI.DOM.makeElement("span", `not very impressed`, ['reputation', 'inc']), ` by this easy kill.`);

						repX(100, "pit", loser);
					}
				} else {
					if (loser.skill.combat > 0) {
						r.push(`${loser.slaveName} is reasonably confident in ${his} fighting abilities, but ${he} isn't sure how to go about attacking the ${animal.species}. ${He} decides to open with a series of wide horizontal slashes, but the beast manages to stay out of range of ${his} sword. Realizing this isn't working, ${he} lunges at the animal, leaving ${his} side exposed. The ${animal.species} sees this and ${animal.type === "hooved"
							? `headbutts ${him} as hard as it can, sending ${him} flying into the side of ${V.pit.name}. Battered`
							: `leaves some ${App.UI.DOM.makeElement("span", `deep claw marks in ${his} side.`, ['health', 'dec'])} Bleeding`} and unable to stand, ${loser.slaveName} can do little to stop the ${animal.species} from finishing ${him} off with a ${animal.type === "canine" ? `fierce bite of its fangs to ${his} throat.` : animal.type === "hooved" ? `swift kick to the head.` : `ferocious swipe of its claws to ${his} throat.`}`);

						if (V.pit.audience === "paid") {
							r.push(`The audience is reasonably impressed by the blood, and your `, App.UI.DOM.makeElement("span", `cut of the betting`, ['cash', 'inc']), ` is reasonable.`);

							cashX(5000, "pit", loser);
						} else if (V.pit.audience === "free") {
							r.push(`The audience is `, App.UI.DOM.makeElement("span", `reasonably impressed`, ['reputation', 'inc']), ` by the blood.`);

							repX(250, "pit", loser);
						}
					} else {
						r.push(animal.type === "hooved"
							? `The ${animal.species} paws at the ground for a few seconds before launching itself at ${loser.slaveName}. ${He} just barely manages to get out of the way, and the ${animal.species} has to backpedal to avoid smashing into the wall. ${loser.slaveName} isn't out of danger just yet, though — ${he} is still standing directly behind the ${animal.species}. ${He} realizes this too late, as both of the its hooves connect with ${his} jaw. With a sickening ${App.UI.DOM.makeElement("span", `crunch`, ["note"])}, ${he} flies backwards, ${his} body slamming into the other wall of ${V.pit.name} before crumpling in a heap on the ground.`
							: `${loser.slaveName} doesn't stand a chance, and ${he} knows it. ${He} comes in with a furious overhead slash, which the ${animal.species} dodges with ease. It also dodges the next few slashes before coming to a standstill. With a furious growl, it runs around ${him}, just out of reach of ${his} sword, before jumping at the wall of ${V.pit.name} and launching itself off. Its ${animal.type === "canine" ? `teeth` : `claws`} connect with ${loser.slaveName}'s throat, completely severing ${his} windpipe. ${He} falls to ${his} knees, eyes wide and clutching ${his} throat, before completely collapsing.`,
						);

						if (V.pit.audience === "paid") {
							r.push(`The audience is reasonably impressed by the violence, and your `, App.UI.DOM.makeElement("span", `cut of the betting`, ['cash', 'inc']), ` is also reasonable.`);

							cashX(5000, "pit", loser);
						} else if (V.pit.audience === "free") {
							r.push(`The audience is `, App.UI.DOM.makeElement("span", `reasonably impressed`, ['reputation', 'inc']), ` by the violence.`);

							repX(250, "pit", loser);
						}
					}
				}
			}
		} else {
			const winnerDeadliness = deadliness(winner);
			const loserDeadliness = deadliness(loser);

			const {he, his, him, himself, girl, He} = getPronouns(winner);
			const {He: He2, he: he2, his: his2, him: him2, girl: girl2} = getPronouns(loser);

			if (!canSee(winner) && !canSee(loser)) {
				r.push(`${winner.slaveName} and ${loser.slaveName} are both blind, making the fight a staredown. Neither slave wants to make the first move, especially with the drowning cacophony coming from the jeering crowd. Slowly, ${winner.slaveName} moves forward, waving ${his} sword side to side in the hopes of finding ${his} opponent before ${he} ${himself} gets found. ${loser.slaveName}'s sword clips the tip of ${winner.slaveName}'s setting off a surprisingly brutal series of slashes. The two slaves violently lay into each other, suffering more and more strikes as the struggle goes on. Less than a minute from first contact, both slaves are lying in their combined blood. As you begin to call it a draw, you notice ${winner.slaveName} start to stir. ${He} staggers to ${his} feet, coated in ${his} and ${loser.slaveName}'s blood, before dropping back to ${his} knees. It seems ${he} lived through this fight; odds aren't likely ${he}'ll do it again.`);

				healthDamage(winner, 50);

				if (V.pit.audience === "free") {
					r.push(`The audience is surprised by the sudden violence after so much standing around, and your `, App.UI.DOM.makeElement("span", `cut of the betting`, ['cash', 'inc']), ` is modest.`);

					cashX(5000, "pit", winner);
				} else if (V.pit.audience === "paid") {
					r.push(`The audience is `, App.UI.DOM.makeElement("span", `surprised`, ['reputation', 'inc']), ` by the sudden violence after so much standing around.`);

					repX(250, "pit", winner);
				}
			} else if (winnerDeadliness > (loserDeadliness + 1) && getArmCount(winner, 6) > 1) {
				r.push(`Upon your word the two combatants approach each other. ${winner.slaveName} does not carry a sword, raising only ${his} hands, but these are terrifying, modern weapons themselves. ${loser.slaveName} tries a probing sweep, but ${winner.slaveName} catches ${his2} blade in one hand, slides it down to the hilt with a shriek of metal on metal, and snaps the blade cleanly. ${loser.slaveName} ${canSee(loser) ? `watches this` : `freezes in place`}, dumbstruck, before regaining composure and taking a fighting stance again. ${winner.slaveName} manages to touch ${his} opponent's bare skin with ${his} own cybernetics, incapacitating ${loser.slaveName} with an electric shock. While ${loser.slaveName} is temporarily stunned, ${winner.slaveName} strikes ${loser.slaveName} on the head with deadly force, crushing ${his} opponent's skull. Though the fight was short,`);

				if (V.pit.audience === "free") {
					r.push(`the audience is `, App.UI.DOM.makeElement("span", `very impressed`, ['reputation', 'inc']), ` by the display.`);

					repX(500, "pit", winner);
				} else if (V.pit.audience === "paid") {
					r.push(`the audience is quite impressed by the display, and your `, App.UI.DOM.makeElement("span", `cut of the betting`, ['cash', 'inc']), ` is quite good.`);

					cashX(10000, "pit", winner);
				}
			} else if (winnerDeadliness > (loserDeadliness + 1) && getArmCount(winner, 5) > 1) {
				r.push(`Upon your word the two combatants approach each other. ${winner.slaveName} drops ${his} sword as ${he} comes, raising only ${his} hands, but these are terrifying, modern weapons themselves. ${loser.slaveName} tries a probing sweep, but ${winner.slaveName} catches ${his2} blade in one hand, slides it down to the hilt with a shriek of metal on metal, and snaps the blade cleanly. As ${loser.slaveName} watches this, dumbstruck, ${winner.slaveName} places a gentle hand under ${his2} chin and then extends that arm's integral blade up and through ${his} opponent's skull. Though the fight was short,`);

				if (V.pit.audience === "free") {
					r.push(`the audience is `, App.UI.DOM.makeElement("span", `very impressed`, ['reputation', 'inc']), ` by the display.`);

					repX(500, "pit", winner);
				} else if (V.pit.audience === "paid") {
					r.push(`the audience is quite impressed by the display, and your `, App.UI.DOM.makeElement("span", `cut of the betting`, ['cash', 'inc']), ` is quite good.`);

					cashX(10000, "pit", winner);
				}
			} else if (!canSee(winner)) {
				r.push(`${winner.slaveName} centers ${himself} and hones in on ${loser.slaveName}'s rapid breath. ${He} readies ${himself}, knowing ${he} has a single chance to live. With heavy steps, ${loser.slaveName} rushes ${him}, fully prepared to slaughter the helpless combatant. ${winner.slaveName} gambles everything on a single high slash, a slash that cut ${loser.slaveName}'s undefended neck wide open. ${winner.slaveName} collapses to the ground, fully aware of ${loser.slaveName}'s final gurgles, and the sword `, App.UI.DOM.makeElement("span", `firmly planted in ${his} side.`, ['health', 'dec']), ` ${He} lived this time, barely, but ${he} doubts ${he} can do it again.`);

				healthDamage(winner, 80);

				if (V.pit.audience === "free") {
					r.push(`The audience is `, App.UI.DOM.makeElement("span", `awestruck`, ['reputation', 'inc']), ` by the blind ${girl}'s triumph.`);

					repX(2000, "pit", winner);
				} else if (V.pit.audience === "paid") {
					r.push(`The audience is awestruck by the blind ${girl}'s triumph, and your `, App.UI.DOM.makeElement("span", `cut of the betting`, ['cash', 'inc']), ` is enormous.`);

					cashX(40000, "pit", winner);
				}
			} else if (!canSee(loser)) {
				r.push(`${winner.slaveName} sighs at ${loser.slaveName}'s random slashing and calmly struts around the panicking slave. In one quick swoop, ${he} buries ${his} blade in ${loser.slaveName}'s back, ending the poor ${girl2}'s flailing.`);

				if (V.pit.audience === "free") {
					r.push(`The audience is `, App.UI.DOM.makeElement("span", `annoyed`, ["reputation", "dec"]), ` by this waste of a fight.`);

					repX(-20, "pit", winner);
				} else if (V.pit.audience === "paid") {
					r.push(`The audience found the fight embarrassing, and your `, App.UI.DOM.makeElement("span", `cut of the betting`, ['cash', 'inc']), ` is pitiful.`);

					cashX(40, "pit", winner);
				}
			} else if (winnerDeadliness > (loserDeadliness + 3)) {
				if (winner.skill.combat > 0) {
					r.push(`${winner.slaveName} wants to win, and ${he} opens the fight with a furious attack. ${loser.slaveName} manages to get ${his2} blade up, blocking a strike with a ringing clash and a few sparks, but by doing so leaves ${his2} abdomen open and obscures ${his2} vision enough that ${he2} is unprepared for the following horizontal slash, which opens ${his2} belly wide. The stricken ${girl2} collapses, feebly trying to push ${his2} viscera back into place. Whether out of mercy or a desire to get it over with, ${winner.slaveName} quickly removes the dying ${girl2}'s head.`);

					if (V.pit.audience === "free") {
						r.push(`The audience is `, App.UI.DOM.makeElement("span", `reasonably impressed`, ['reputation', 'inc']), ` by the gore.`);

						repX(200, "pit", winner);
					} else if (V.pit.audience === "paid") {
						r.push(`The audience is reasonably impressed by the gore, and your `, App.UI.DOM.makeElement("span", `cut of the betting`, ['cash', 'inc']), ` is reasonable.`);

						cashX(4000, "pit", winner);
					}
				} else {
					r.push(`${winner.slaveName} wants to win and is confident ${he} will, but ${he} isn't particularly sure about how to do so. ${He} fights cautiously, swinging ${his} sword in powerful but inaccurate strokes. It is only a matter of time before one of these strikes gets through; it's telling that rather than hitting what ${he} aimed at, ${winner.slaveName} accidentally opens a massive gash down ${loser.slaveName}'s thigh. Realizing ${he2} has to do something, ${loser.slaveName} makes a desperate counterattack, pouring blood as ${he2} goes. ${winner.slaveName} panics and fails to parry one of the last counterstrikes before loss of blood ends the attack, suffering a `, App.UI.DOM.makeElement("span", `terrible cut`, ['health', 'dec']), ` to ${his} shoulder. Down to one arm, ${winner.slaveName} is forced to make a long, loud butchery of ending the fight.`);

					healthDamage(winner, 20);

					if (V.pit.audience === "free") {
						r.push(`The audience is `, App.UI.DOM.makeElement("span", `reasonably impressed`, ['reputation', 'inc']), ` by the blood.`);

						repX(200, "pit", winner);
					} else if (V.pit.audience === "paid") {
						r.push(`The audience is reasonably impressed by the blood, and your `, App.UI.DOM.makeElement("span", `cut of the betting`, ['cash', 'inc']), ` is reasonable.`);

						cashX(4000, "pit", winner);
					}
				}
			} else if (winner.skill.combat > 0 && loser.skill.combat > 0) {
				r.push(`Upon your word the two combatants approach each other warily, both knowing the other is reasonably competent. Before long they are trading thrust and parry, swing and block. ${winner.slaveName} is slowly pressed back, so ${he} decides to change the nature of the fight. After three tries ${he} manages to force ${loser.slaveName} to close, suffering a `, App.UI.DOM.makeElement("span", `nearly severed ear`, ['health', 'dec']), ` as ${he} does. ${loser.slaveName} realizes ${he2} only retains an advantage at long range but cannot back up fast enough to avoid close combat. ${loser.slaveName} is forced back fast enough that ${he2} trips; ${he2}'s barely fallen on ${his2} back before ${he2} grunts with shock and pain, dying with a look of surprise as ${he2} stares at the sword growing out of ${his2} chest.`);

				if (V.pit.audience === "free") {
					r.push(`The audience is `, App.UI.DOM.makeElement("span", `very impressed`, ['reputation', 'inc']), ` by the expert fight.`);

					repX(500, "pit", winner);
				} else if (V.pit.audience === "paid") {
					r.push(`The audience is quite impressed by the expert fight, and your `, App.UI.DOM.makeElement("span", `cut of the betting`, ['cash', 'inc']), ` is quite good.`);

					cashX(10000, "pit", winner);
				}
			} else if (winner.height - loser.height < -10) {
				r.push(`${winner.slaveName} realizes that ${loser.slaveName}'s wingspan gives ${him2} a huge reach advantage. ${He} bores straight in, taking `, App.UI.DOM.makeElement("span", `a glancing scalp wound`, ['health', 'dec']), ` but coming on regardless. ${loser.slaveName} understands ${his2} opponent's intention and backs off, but the pit is small and there isn't much room to retreat. When ${his2} back hits a padded wall, ${winner.slaveName} aims a gutting cut that ${loser.slaveName} struggles to block. ${He2} manages it, but the wall catches ${his2} point, so the block is with ${his2} wrist, not ${his2} sword. The sharp blade cuts almost all the way through the joint, leaving ${him2} in agony and totally incapable of defense. ${winner.slaveName} pushes ${his2} head back against the wall and cuts ${his2} throat down to the spine.`);

				if (V.pit.audience === "free") {
					r.push(`The audience is `, App.UI.DOM.makeElement("span", `reasonably impressed`, ['reputation', 'inc']), ` by the blood.`);

					repX(200, "pit", winner);
				} else if (V.pit.audience === "paid") {
					r.push(`The audience is reasonably impressed by the blood, and your `, App.UI.DOM.makeElement("span", `cut of the betting`, ['cash', 'inc']), ` is reasonable.`);

					cashX(4000, "pit", winner);
				}
			} else if (winner.muscles > 30) {
				r.push(`${winner.slaveName} is so massively muscular that ${he}'s actually impeded by ${his} lack of speed and flexibility. ${loser.slaveName} is properly afraid of ${his2} strength, though, so ${he2} tries to stay away as much as ${he2} can. The few times their blades clash reinforces this approach, since ${winner.slaveName} is able to beat ${his} opponent's blocks out of the way with contemptuous ease. The fight takes a long, long time, but it takes more out of ${loser.slaveName} to survive than it takes out of ${winner.slaveName} to keep swinging. Eventually the gasping, weeping ${loser.slaveName} trips and does not struggle to ${his2} feet in time. It takes ${his2} tired opponent several overhead butcher's cleaves to end it.`);

				if (V.pit.audience === "free") {
					r.push(`The audience is `, App.UI.DOM.makeElement("span", `reasonably impressed`, ['reputation', 'inc']), ` by the show of strength.`);

					repX(50, "pit", winner);
				} else if (V.pit.audience === "paid") {
					r.push(`The audience is reasonably impressed by the show of strength, and your `, App.UI.DOM.makeElement("span", `cut of the betting`, ['cash', 'inc']), ` is reasonable.`);

					cashX(1000, "pit", winner);
				}
			} else if (loser.belly > 300000) {
				r.push(`${winner.slaveName} wants to live badly enough that ${he} takes an extremely brutal shortcut to victory. The instant the fight starts, ${he} quickly slices right across ${loser.slaveName}'s massive belly, which is far too large to possibly defend. ${loser.slaveName}'s belly ruptures like a popped water balloon, showering ${winner.slaveName} with`);

				if (loser.pregType > 0) {
					r.push(`blood. ${loser.slaveName} collapses into the pile of organs and babies released from ${his2} body.`);
				} else if (loser.bellyImplant > 0) {
					r.push(`blood and filler. ${loser.slaveName} collapses into the pool of organs and fluid released from ${his2} body.`);
				} else {
					r.push(`blood and ${loser.inflationType}. ${loser.slaveName} collapses into the pool of organs and fluid released from ${his2} body.`);
				}

				r.push(`${winner.slaveName} walks over to the bleeding out slave and quickly cuts ${his2} throat.`);

				if (V.pit.audience === "free") {
					r.push(`the audience is `, App.UI.DOM.makeElement("span", `not very impressed`, ['reputation', 'inc']), ` by this easy kill.`);

					repX(100, "pit", winner);
				} else if (V.pit.audience === "paid") {
					r.push(`The audience is not very impressed by this easy kill, and your `, App.UI.DOM.makeElement("span", `cut of the betting`, ['cash', 'inc']), ` is unimpressive.`);

					cashX(2000, "pit", winner);
				}
			} else if (loser.boobs > 1200) {
				r.push(`${winner.slaveName} takes an extremely simple shortcut to victory. The instant the fight starts, ${he} slices ${loser.slaveName} right across ${his2} huge tits, which are so large they cannot properly be defended. ${loser.slaveName} reflexively drops ${his2} sword to clasp ${his2} ${hasBothArms(loser) ? `hands` : `hand`} over ${his2} ruined breasts, gushing blood${loser.boobsImplant > 400 ? ` and implant fluid` : ``}. ${winner.slaveName}'s follow-up is neither artful nor particularly well planned, but it is effective. ${He} hits the distracted ${girl2}'s neck from the side, almost but not quite separating ${his2} head from ${his2} body.`);

				if (V.pit.audience === "free") {
					r.push(`The audience is `, App.UI.DOM.makeElement("span", `not very impressed`, ['reputation', 'inc']), ` by this easy kill.`);

					repX(100, "pit", winner);
				} else if (V.pit.audience === "paid") {
					r.push(`The audience is not very impressed by this easy kill, and your `, App.UI.DOM.makeElement("span", `cut of the betting`, ['cash', 'inc']), ` is unimpressive.`);

					cashX(2000, "pit", winner);
				}
			} else if (loser.dick > 0) {
				r.push(`${winner.slaveName} wants to live badly enough that ${he} takes an extremely brutal shortcut to victory. The instant the fight starts, ${he} furiously swings for ${loser.slaveName}'s face. ${loser.slaveName} reflexively raises ${his2} sword to block, at which point ${winner.slaveName} simply kicks ${him2} in the dick. ${loser.slaveName} goes down like a marionette with cut strings, ${his2} mouth soundlessly opening and closing and tears leaking from ${his2} closed eyes. ${winner.slaveName} walks over to the prostrate slave and cuts ${his2} throat without much trouble.`);

				if (V.pit.audience === "free") {
					r.push(`The audience is `, App.UI.DOM.makeElement("span", `not very impressed`, ['reputation', 'inc']), ` by this easy kill.`);

					repX(100, "pit", winner);
				} else if (V.pit.audience === "paid") {
					r.push(`The audience is not very impressed by this easy kill, and your `, App.UI.DOM.makeElement("span", `cut of the betting`, ['cash', 'inc']), ` is unimpressive.`);

					cashX(2000, "pit", winner);
				}
			} else {
				r.push(`${winner.slaveName} wants to live badly enough that ${he} takes an extremely brutal shortcut to victory. The instant the fight starts, ${he} furiously swings for ${loser.slaveName}'s face. ${loser.slaveName} reflexively raises ${his2} sword to block, at which point ${winner.slaveName} simply kicks ${him2} in the cunt. ${loser.slaveName} goes down like a marionette with cut strings, ${his2} mouth soundlessly opening and closing and tears leaking from ${his2} closed eyes. ${winner.slaveName} walks over to the prostrate slave and cuts ${his2} throat without much trouble.`);

				if (V.pit.audience === "free") {
					r.push(`The audience is `, App.UI.DOM.makeElement("span", `not very impressed`, ['reputation', 'inc']), ` by this easy kill.`);

					repX(100, "pit", winner);
				} else if (V.pit.audience === "paid") {
					r.push(`The audience is not very impressed by this easy kill, and your `, App.UI.DOM.makeElement("span", `cut of the betting`, ['cash', 'inc']), ` is unimpressive.`);

					cashX(2000, "pit", winner);
				}
			}
		}

		App.Events.addParagraph(parent, r);
	}

	/** @param {DocumentFragment} parent */
	function postFight(parent) {
		const mindbrokenSpan = App.UI.DOM.makeElement("span", `no longer capable`, ["red"]);
		const experienceSpan = App.UI.DOM.makeElement("span", `learned basic combat skills.`, ["improvement"]);

		const r = [];

		if (animal) {
			if (winner.hasOwnProperty('slaveName')) {
				const {he, his, himself, hers, He} = getPronouns(winner);

				r.push(`You let the winner ${winner.slaveName}, shaking as ${he} comes off the adrenaline, drugs, and fear, exit the pit.`);

				if (winner.fetish === "mindbroken") {
					r.push(`${He} was already so broken before today that ${he} will not be seriously affected by having killed another creature with ${his} own ${hasBothArms ? `hands` : `hand`}.`);
				} else if (winner.devotion > 50) {
					r.push(`${He} is so devoted that ${he} doesn't see anything wrong with killing another creature.`);
				} else {
					r.push(`${He} isn't happy about having to have taken another creature's life, and tells ${himself} that it was the animal's life or ${hers}.`);
				}
			} else {
				r.push(`Another week, another slave killed by your animals.`);
			}
		} else {
			const {he, his, him, himself, He} = getPronouns(winner);
			const {sister: sister2} = getPronouns(loser);

			r.push(`You let the winner ${winner.slaveName}, shaking as ${he} comes off the adrenaline, drugs, and fear, exit the pit.`);

			if (winner.fetish === "mindbroken") {
				r.push(`${He} was already so broken before today that ${he} will not be seriously affected by having killed with ${his} own ${hasBothArms(winner) ? `hands` : `hand`}.`);
			} else if (winner.devotion > 95) {
				r.push(`${He} is so worshipful of you that ${he} does not see killing ${loser.slaveName} as special in ${his} own internal listing of things that ${he} has willingly done and would willingly do again on your behalf.`);
			} else if (winner.devotion > 80) {
				r.push(`${He} will never forget having killed ${loser.slaveName} with ${his} own ${hasBothArms(winner) ? `hands` : `hand`}. The only way ${he} will be able to live with ${himself} is to `, App.UI.DOM.makeElement("span", `subsume ${his} will to yours,`, ["devotion", "inc"]), ` telling ${himself} that the killing was to serve and obey you.`);

				winner.devotion += 10;
			} else if (winner.fetish === "sadist" && winner.fetishKnown && winner.fetishStrength > 60) {
				r.push(`${He} has sunk even deeper into cruelty, callousness, and a total disregard of the value of other slaves' lives. Going forward, ${he}'s even `, App.UI.DOM.makeElement("span", `less likely to question`, ["devotion", "inc"]), ` even the most abominable commands.`);

				winner.devotion += 10;
			} else if (winner.devotion > 50) {
				r.push(`${He} will never forget having killed ${loser.slaveName} with ${his} own ${hasBothArms(winner) ? `hands` : `hand`}. The only way ${he} will be able to live with ${himself} is to tell ${himself} that the killing was done on your orders.`);
			} else {
				r.push(`${He} will never forget having killed ${loser.slaveName} with ${his} own ${hasBothArms(winner) ? `hands` : `hand`}. The only way ${he} will be able to live with ${himself} is to `, App.UI.DOM.makeElement("span", `blame you,`, ["devotion", "dec"]), ` telling ${himself} that the killing was the only choice you gave ${him} if ${he} wanted to live.`);

				winner.devotion -= 10;
			}

			if (winner.fetish !== "sadist") {
				if (random(1, 100) > 50) {
					r.push(`Cruelty and callousness seeps its way into ${his} sexuality; ${he} has become a `, App.UI.DOM.makeElement("span", `bloody sadist.`, ["fetish", "gain"]));

					winner.fetish = "sadist";
					winner.fetishKnown = 1;
					winner.fetishStrength = 65;
				}
			}

			if (winner.rivalry && loser.ID === winner.rivalryTarget) {
				if (winner.devotion > 75) {
					r.push(`${He} is so accepting of the low value of slave life that ${he} `, App.UI.DOM.makeElement("span", `is pleased`, ["devotion", "inc"]), ` to have killed ${his} rival ${loser.slaveName}.`);

					winner.devotion += 4;
				}
			} else if (winner.relationship && loser.ID === winner.relationshipTarget) {
				if (winner.devotion > 95) {
					r.push(`${He} is so worshipful of you that ${he} sees the death of ${his} only friend at ${his} own hand as an `, App.UI.DOM.makeElement("span", `honorable`, ["devotion", "inc"]), ` end to their doomed slave relationship.`);

					winner.devotion += 4;
				} else {
					r.push(`${He} shows little reaction to the death of ${his} only friend at ${his} own hand. In the coming days, it becomes clear that this is because ${he} is `, mindbrokenSpan, ` of reacting to anything on an emotional level. Ever again.`);

					applyMindbroken(winner);
					winner.fetishKnown = 1;
				}
			} else if (isParentP(winner, loser) || isParentP(loser, winner)) {
				if (winner.devotion > 95) {
					r.push(`${He} is so worshipful of you that ${he} sees the death of ${his} ${relativeTerm(winner, loser)} at ${his} own hand as an `, App.UI.DOM.makeElement("span", `honorable`, ["devotion", "inc"]), ` end to their doomed family.`);

					winner.devotion += 4;
				} else {
					r.push(`${He} shows little reaction to the death of ${his} ${relativeTerm(winner, loser)} at ${his} own hand. In the coming days, it becomes clear that this is because ${he} is `, mindbrokenSpan, ` of reacting to anything on an emotional level. Ever again.`);

					applyMindbroken(winner);
					winner.fetishKnown = 1;
				}
			} else if (winner.sisters > 0) {
				switch (areSisters(winner, loser)) {
					case 1:
						if (winner.devotion > 95) {
							r.push(`${He} is so worshipful of you that ${he} sees the death of ${his} ${relativeTerm(winner, loser)} at ${his} own hand as an `, App.UI.DOM.makeElement("span", `honorable`, ["devotion", "inc"]), ` end to their doomed family.`);

							winner.devotion += 4;
						} else {
							r.push(`${He} shows little reaction to the death of ${his} ${relativeTerm(winner, loser)} at ${his} own hand. In the coming days, it becomes clear that this is because ${he} is `, mindbrokenSpan, ` of reacting to anything on an emotional level. Ever again.`);

							applyMindbroken(winner);
							winner.fetishKnown = 1;
						}
						break;
					case 2:
						if (winner.devotion > 90) {
							r.push(`${He} is so worshipful of you that ${he} sees the death of ${his} ${relativeTerm(winner, loser)} at ${his} own hand as an `, App.UI.DOM.makeElement("span", `honorable`, ["devotion", "inc"]), ` end to their doomed family.`);

							winner.devotion += 4;
						} else {
							r.push(`${He} shows little reaction to the death of ${his} ${relativeTerm(winner, loser)} at ${his} own hand. In the coming days, it becomes clear that this is because ${he} is `, mindbrokenSpan, ` of reacting to anything on an emotional level. Ever again.`);

							applyMindbroken(winner);
							winner.fetishKnown = 1;
						}
						break;
					case 3:
						if (winner.devotion > 85) {
							r.push(`${He} is so worshipful of you that ${he} sees the death of ${his} half-${sister2} at ${his} own hand as an `, App.UI.DOM.makeElement("span", `honorable`, ["devotion", "inc"]), ` end to their doomed family.`);

							winner.devotion += 4;
						} else {
							r.push(`${He} is `, App.UI.DOM.makeElement("span", `utterly devastated`, ["devotion", "dec"]), ` at being forced to take the life of ${his} half-${sister2}.`);

							winner.devotion -= 50;
						}
						break;
				}
			}

			V.pit.slaveFightingBodyguard = null;

			if (winner.skill.combat === 0) {
				r.push(`With lethal experience in ${V.pit.name}, ${winner.slaveName} has `, experienceSpan);

				winner.skill.combat++;
			}

			winner.counter.pitKills++;
			winner.counter.pitWins++;
		}

		V.pitKillsTotal++;
		V.pitFightsTotal++;

		if (loser.hasOwnProperty('slaveName')) {
			V.pit.fighterIDs.delete(loser.ID);

			if (V.pit.slavesFighting.length > 0) {
				V.pit.slavesFighting = [];
			}

			removeSlave(loser);
		}

		App.Events.addParagraph(parent, r);
	}

	// Helper Functions

	/** @returns {boolean} Returns true if fighters[0] won */
	function getWinner() {
		if (animal) {
			if (deadliness(getSlave(fighters[0])) > animal.deadliness) {
				return random(1, 100) > 20;	// 80% chance of winning
			} else if (deadliness(getSlave(fighters[0])) < animal.deadliness) {
				return random(1, 100) > 80;	// 20% chance of winning
			} else if (random(1, 100) > 50) { // 50/50
				return true;
			}

			return false;
		}

		if (deadliness(getSlave(fighters[0])) > deadliness(getSlave(fighters[1]))) {
			return random(1, 100) > 20;	// 80% chance of winning
		} else if (deadliness(getSlave(fighters[0])) < deadliness(getSlave(fighters[1]))) {
			return random(1, 100) > 80;	// 20% chance of winning
		} else if (random(1, 100) > 50) { // 50/50
			return true;
		}

		return false;
	}
};


code:
App.Events.SEPoorKnight = class SEPoorKnight extends App.Events.BaseEvent {
	eventPrerequisites() {
		return [
			() => App.Events.effectiveWeek() >= 37,
			() => V.arcologies[0].FSNeoImperialistLaw1 === 1,
			() => V.arcologies[0].FSNeoImperialistLaw2 === 1,
			() => V.poorKnight !== 1,
			() => App.Events.effectiveWeek() >= V.imperialEventWeek + 3,
		];
	}

	execute(node) {
		V.poorKnight = 1;
		V.imperialEventWeek = App.Events.effectiveWeek();

		App.Events.addParagraph(node, [`Word reaches your ears through the idle gossip of your well-to-do Barons of a particular citizen whose name has been on everyone's lips the last few days. During the visit of a wealthy trader from a neighboring arcology, the merchant, supposedly at the prompting of one particularly pompous Knight of yours who referred to the peasantry as "little more than mindless toys", had his guards beat some of your lower-class citizens for amusement, molesting a young girl and treating them generally as slaves.`]);

		App.Events.addParagraph(node, [`The cruel rambunctiousness of this trader and your own Knights continued for a few hours, with nearby guards both pretending not to notice and not reporting their activities to you, until a factory-working peasant by the name of Valentin approached them in the marketplace and demanded they stop. When the merchant's guards attempted to apprehend him, although you aren't clear on the exact details, it seems he managed to somehow strike down all five, despite being both unarmed and unarmored. The present Knight promptly challenged him to fight, out-of-armor and one-on-one, and was then knocked flat by the peasant in front of the watching marketplace as well.`]);

		App.Events.addParagraph(node, [`This "Valentin", a quiet man built like a mountain, has very rapidly become a local hero to your peasantry. You have heard petitions calling for him to be Knighted, and the public has nearly immediately come to see him as a courageous fighter against the various injustices of your hierarchical Imperial society. Your Barons, on the other hand, murmur that he is a rabblerouser, a peasant who has clearly forgotten his station at the bottom of the pyramid, and that to do anything but punish him for his insolence will surely lead to riots and unrest. Such a man would surely be a proud and capable Imperial Knight, but to Knight him would undoubtedly be seen as condoning liberal freedoms in your lower classes, and a Knight drawn from the filthy, unwashed peasants is totally unheard of.`]);

		const festiveCost = 5000;
		const quietCost = 500;
		const choices = [];
		if (V.cash >= festiveCost) {
			choices.push(new App.Events.Result(`Knight him in a grand festival`, festival, `Costs ${cashFormat(festiveCost)}.`));
		} else {
			choices.push(new App.Events.Result(null, null, `Cannot afford a grand festival.`));
		}
		if (V.cash >= quietCost) {
			choices.push(new App.Events.Result(`Knight him in a quiet ceremony`, quiet, `Costs ${cashFormat(quietCost)}.`));
		} else {
			choices.push(new App.Events.Result(null, null, `Cannot afford even a quiet ceremony. Maybe, uh, Valentin could spot you a few ¤?`));
		}
		choices.push(new App.Events.Result(`Have him flogged for attacking your honored guests`, floggingMeat));
		App.Events.addResponses(node, choices);

		function festival() {
			cashX(-festiveCost, "event");
			V.arcologies[0].prosperity -= 2;
			repX(5000, "event");
			return `You make your stance on the issue known with a large public ceremony, awarding Valentin with his own private apartment, coat of arms, and a set of Imperial Plate in the very marketplace where he bested a group of brutish foreign thugs and an overly-cocky Knight. A swarm of peasantry surround every inch of the ceremony, cheering your name and celebrating Sir Valentin as you demonstrate that skill and courage is more important than social station. The furious foreign merchant sends you a message a few days later swearing to never return to your arcology, and the Barons grumble about the wildly dancing and celebrating peasants undermining your authority.`;
		}

		function quiet() {
			cashX(-quietCost, "event");
			V.arcologies[0].prosperity -= 1;
			repX(2000, "event");
			return `You quietly award the brave peasant a set of Imperial Plate and his own apartment in a private ceremony attended only by a handful of your Barons and Knights. Many of the watching oligarchs seem thoroughly unenthusiastic about the enormous, grease-stained man joining their hallowed ranks, but politely clap and congratulate him nevertheless. Even the pompous Knight who he beat a few days ago, still sporting a black eye, claps him on the back after you have him rise as Sir Valentin and congratulates him on a fight "befitting of a real man". Word of your decision soon reaches the peasantry, who celebrate the rewards given for honor, but you later receive a message from the foreign merchant infuriated that you would reward such insolence and claiming that he'll hike his prices for you.`;
		}

		function floggingMeat() {
			repX(-2000, "event");
			V.arcologies[0].prosperity += 1;
			return `You have the uppity peasant flogged for a few hours in the marketplace where he beat the merchant's guards. He accepts the punishment quietly and without any protest, submitting his muscled back to the bite of the lash as your Barons nod their head in agreement with your decision. The watching peasants are utterly horrified at your treatment of one of their heroes, but a day later you receive a message from the pleased merchant saying that he'll be sure to give you a steep discount the next time he visits your arcology for 'putting that uppity vermin in its place - beneath us.'`;
		}
	}
};

repo_name: Fekenol/fc

license: mit