code:
App.Facilities.Brothel.assignmentScene = function(slave) {
	const node = new DocumentFragment();

	V.nextButton = "Continue";
	V.nextLink = V.returnTo;
	const {
		He, His,
		he, him, himself, his, girl
	} = getPronouns(slave);
	const {
		say: say, title: Master
	} = getEnunciation(slave);
	const hands = hasBothArms(slave) ? "hands" : "hand";

	App.Events.drawEventArt(node, slave);
	let r = [];

	r.push(`You could direct ${V.assistant.name} to relay your orders to ${slave.slaveName}, but you've decided to avoid relying too much on machine assistance. So, ${he} is merely directed to report to your office. The`);
	if (slave.devotion > 95) {
		r.push(`worshipful ${girl}`);
		if (hasAnyLegs(slave)) {
			r.push(`hurries in as soon as ${he} possibly can,`);
		} else {
			r.push(`comes in as soon as ${he} can get another slave to carry ${him} in,`);
		}
		r.push(`happy ${his} beloved ${getWrittenTitle(slave)} is taking an interest in ${him}.`);
	} else if (slave.devotion > 50) {
		r.push(`devoted ${girl}`);
		if (hasAnyLegs(slave)) {
			r.push(`hurries in promptly,`);
		} else {
			r.push(`comes in as soon as ${he} can get another slave to carry ${him} in,`);
		}
		r.push(`eager to do whatever you demand of ${him}.`);
	} else if (slave.devotion > 20) {
		r.push(`${girl}, broken to your will,`);
		if (hasAnyLegs(slave)) {
			r.push(`comes in promptly,`);
		} else {
			r.push(`comes in as soon as ${he} can get another slave to carry ${him} in,`);
		}
		r.push(`clearly ready to follow orders.`);
	} else if (slave.trust < -20 && slave.devotion > -10) {
		r.push(`fearful slave`);
		if (hasAnyLegs(slave)) {
			r.push(`comes in promptly,`);
		} else {
			r.push(`comes in as soon as ${he} can get another slave to carry ${him} in,`);
		}
		r.push(`afraid of what will happen to ${him} if ${he} doesn't.`);
	} else if (slave.trust < -50) {
		r.push(`terrified slave`);
		if (hasAnyLegs(slave)) {
			r.push(`comes in hurriedly,`);
		} else {
			r.push(`comes in as soon as ${he} can get another slave to carry ${him} in,`);
		}
		r.push(`almost paralyzed by terror of what will happen to ${him} if ${he} doesn't.`);
	} else {
		r.push(`rebellious slave`);
		if (hasAnyLegs(slave)) {
			r.push(`comes in slowly, having decided that ${he} can always decide to resist once ${he} hears what you want.`);
		} else {
			r.push(`comes in as soon as you order another slave to carry ${him} in, since ${he} can't exactly resist this without`);
			if (isAmputee(slave)) {
				r.push(`limbs.`);
			} else {
				r.push(`legs.`);
			}
		}
	}
	r.push(`You tell ${him} ${he}'s to report to`);
	if (V.MadamID !== 0) {
		r.push(`${S.Madam.slaveName} immediately, to serve in ${V.brothelName}`);
	} else {
		r.push(`${V.brothelName} immediately, to serve there`);
	}
	r.push(`until further notice.`);

	App.Events.addParagraph(node, r);
	r = [];
	if (slave.devotion > 50) {
		if (slave.fetishKnown === 1 && slave.fetishStrength > 60 && slave.fetish !== Fetish.NONE) {
			r.push(`${He} looks excited.`);
			if (canTalk(slave)) {
				r.push(Spoken(slave, `"${Master}, I hoped you would send me down there sometime!`));
				switch (slave.fetish) {
					case "submissive":
						r.push(
							Spoken(slave, `I mean, I'll have to do whatever the customers pay for, right?"`),
							`${His} eyes go a little unfocused.`,
							Spoken(slave, `"And, they'll hold me down..."`),
							`${He} trails off.`
						);
						break;
					case "masochist":
						r.push(
							Spoken(slave, `I mean, it's hard being a brothel whore, right? And when I get tired or sore, I'll still be sold. Even when it hurts me to fuck any more."`),
							`${His} eyes glow with an unhealthy light.`
						);
						break;
					case "cumslut":
						r.push(
							Spoken(slave, `I mean,"`),
							`${he} licks ${his} lips unconsciously,`
						);
						if (slave.attrXX > slave.attrXY) {
							r.push(Spoken(slave, `"I hear there are some nice ladies that go there for lunchtime cunnilingus."`));
						} else {
							r.push(Spoken(slave, `"the blowjobs. Just, the blowjobs. That's all."`));
						}
						break;
					case "humiliation":
						r.push(Spoken(slave, `There's a window that faces the hallway there, right? ${(V.MadamID !== 0) ? `Do you think ${S.Madam.slaveName} would let me` : `Could I`} get fucked there? Where everyone could see me being fucked for money?"`));
						break;
					case "buttslut":
						r.push(
							Spoken(slave, `I mean,"`),
							`and ${he} shifts ${his} weight, ${his} mind obviously on ${his} backdoor,`
						);
						if (slave.attrXX > slave.attrXY) {
							r.push(Spoken(slave, `"there have to be ladies who want to buttfuck a whore, right? At least, I really hope there are."`));
						} else {
							r.push(Spoken(slave, `"the other slaves tell me that whores there get fucked up the ass all day and all night. Sounds like fun to me."`));
						}
						break;
					case "boobs":
						r.push(
							Spoken(slave, `I mean,"`),
							`and ${he} sticks out ${his} chest a little,`
						);
						if (slave.attrXX > slave.attrXY) {
							r.push(
								Spoken(slave, `"I hear from the other slaves there's this nice lady who goes there every morning and pay sto have a whore suck her nipples for, like, an hour. I,"`),
								`${he} licks ${his} lips,`,
								Spoken(slave, `"could do that."`)
							);
						} else {
							r.push(Spoken(slave, `"the other slaves tell me that whores there get tittyfucked all the time. Sounds like fun to me."`));
						}
						break;
					case "pregnancy":
						r.push(
							Spoken(slave, `I mean,"`),
							`${he} says meditatively,`
						);
						if (slave.attrXX > slave.attrXY) {
							r.push(Spoken(slave, `"I hear from the other slaves there's this pregnant lady who goes there every night and pays to have a whore cuddle her. Just cuddle, all night. That would be kind of hard, just cuddling, but I could do it."`));
						} else if (slave.vagina === -1) {
							r.push(Spoken(slave, `"since it's all bareback, I'm going to have a fuckton of cum in me. I wonder how much cum it takes to get a butthole pregnant? I'm gonna try, anyway."`));
						} else if (isFertile(slave)) {
							r.push(Spoken(slave, `"since it's all bareback, I'm going to have a fuckton of cum in me. I wonder how much cum it would take to get my poor womb pregnant?"`));
						} else if (slave.pregKnown === 1) {
							r.push(Spoken(slave, `"I'm going to be a pregnant whore. That's pretty fucking sexy."`));
						} else if (slave.preg > 0) {
							r.push(Spoken(slave, `"since it's all bareback, I'm going to have a fuckton of cum in me. I wonder how much cum it would take to get my poor womb pregnant?"`));
						} else if (slave.ovaries === 1 && slave.pubertyXX === 0) {
							r.push(Spoken(slave, `"I can't wait till I can get pregnant. That'd be pretty fucking sexy."`));
						} else {
							r.push(Spoken(slave, `"I hear from the other slaves there's this pregnant lady who goes there every night and pays to have a whore cuddle her. Just cuddle, all night. That would be kind of hard, just cuddling, but I could do it."`));
						}
						break;
					case "dom":
						r.push(Spoken(slave, `"I heard from the other slaves that some citizens bring their girls there. Just to make them take it from a whore."`));
						break;
					case "sadist":
						r.push(Spoken(slave, `"I heard from the other slaves that some citizens bring their girls there. Because nobody knows how to hurt a bitch like a whore does." ${He} shivers.`));
				}
			} else {
				switch (slave.fetish) {
					case "submissive":
						r.push(`${He} gestures that ${he}'ll be at the mercy of ${his} customers. ${His} eyes go a little unfocused as ${he} clearly begins to fantasize.`);
						break;
					case "masochist":
						r.push(`${He} gestures that ${he}'ll probably get roughed up by some of ${his} customers and that there will be no breaks for ${his} sore holes. ${His} eyes glow with an unhealthy light as ${he} clearly begins to fantasize.`);
						break;
					case "cumslut":
						r.push(`${He} licks ${his} lips unconsciously and motions`);
						if (slave.attrXX > slave.attrXY) {
							r.push(`tounging a clit.`);
						} else {
							r.push(`sucking cock.`);
						}
						break;
					case "humiliation":
						r.push(`${He} gestures if ${he} could be fucked in public there.`);
						break;
					case "buttslut":
						r.push(`${He} shifts ${his} weight, ${his} mind obviously on ${his} backdoor, and gestures`);
						if (slave.attrXX > slave.attrXY) {
							r.push(`if any girls would want to buttfuck ${him}.`);
						} else {
							r.push(`that ${he} knows whores take it up the ass there and can't wait to join them.`);
						}
						break;
					case "boobs":
						r.push(`${He} sticks out ${his} chest a little and gestures`);
						if (slave.attrXX > slave.attrXY) {
							r.push(`that ${he}'s heard a woman comes by each day just to have her nipples sucked. ${He} licks ${his} lips, clearly savoring the thought.`);
						} else {
							r.push(`that ${he} knows tittyfucking is popular there and can't wait to give ${his} pair up for sale.`);
						}
						break;
					case "pregnancy":
						r.push(`${He} gestures`);
						if (slave.attrXX > slave.attrXY) {
							r.push(`that ${he}'s heard that a pregnant woman has been coming every night to pay for a whore to cuddle her. ${He} asks if ${he} could be that ${girl}.`);
						} else if (slave.vagina === -1) {
							r.push(`how much ${he} wishes ${he} could get pregnant from all the cum loads ${he}'s going to get shot up ${his} rear.`);
						} else if (isFertile(slave)) {
							r.push(`that ${he} knows all the sex is bareback. By the look in ${his} eyes, you can tell ${he} is wondering how long it will take for some guy's seed to take root in ${him}.`);
						} else if (slave.pregKnown === 1) {
							r.push(`how sexy ${he} thinks pregnant whores are.`);
						} else if (slave.preg > 0) {
							r.push(`that ${he} knows all the sex is bareback. By the look in ${his} eyes, you can tell ${he} is wondering how long it will take for some guy's seed to take root in ${him}.`);
						} else if (slave.ovaries === 1 && slave.pubertyXX === 0) {
							r.push(`how excited ${he} is for the day ${he} starts ${his} menstrual cycle. Will ${he} even see ${his} first period, or will every egg ${he} makes get fertilized?`);
						} else {
							r.push(`that ${he}'s heard a pregnant woman has been coming every night to pay for a whore to cuddle her. ${He} hopes that one day ${he}'ll be chosen.`);
						}
						break;
					case "dom":
						r.push(`${He} gestures that ${he} knows citizens sometimes bring their toys there just to let them get pushed around by a whore. ${He}'d like that to be true. A lot.`);
						break;
					case "sadist":
						r.push(`${He} gestures that ${he} knows citizens sometimes bring their toys there for punishment. ${He} shivers with anticipation.`);
				}
			}
		} else {
			r.push(`${He} looks`);
			if (canTalk(slave)) {
				r.push(
					`determined.`,
					Spoken(slave, `"${Master}, I will do my best to be a good whore, and get lots of citizens to pay good money for my body."`)
				);
			} else {
				r.push(`determined and gestures that ${he}'ll do ${his} best to get lots of citizens to pay to use ${him}.`);
			}
		}
	} else if (slave.devotion > 20 || (slave.devotion >= -20 && slave.trust < -20 && slave.trust >= -50)) {
		if (canTalk(slave)) {
			if (slave.fetishKnown === 1 && slave.fetishStrength > 60 && slave.fetish !== Fetish.NONE) {
				r.push(`${He} looks cautiously excited.`);
				switch (slave.fetish) {
					case "submissive":
						r.push(
							Spoken(slave, `"${Master}, I'll have to do whatever the customers pay for, right?"`),
							`${His} eyes go a little unfocused.`,
							Spoken(slave, `"And, they'll hold me down..."`),
							`${He} trails off.`
						);
						break;
					case "masochist":
						r.push(
							Spoken(slave, `"${Master}, it's hard being a brothel whore, right? And when I get tired or sore, I'll still be sold. Even when it hurts me to fuck any more."`),
							`${His} eyes glow with an unhealthy light.`
						);
						break;
					case "cumslut":
						if (slave.attrXX > slave.attrXY) {
							r.push(Spoken(slave, `"${Master}, I hear there are some nice ladies that go there for lunchtime cunnilingus."`));
						} else {
							r.push(Spoken(slave, `"${Master}, the blowjobs. Just, the blowjobs. That's all."`));
						}
						break;
					case "humiliation":
						r.push(Spoken(slave, `"${Master}, there's a window that faces the hallway there, right? ${(V.MadamID !== 0) ? `Do you think ${S.Madam.slaveName} would let me` : `Could I`} get fucked there? Where everyone could see me being fucked for money?"`));
						break;
					case "buttslut":
						r.push(
							Spoken(slave, `"${Master}, uh,"`),
							`and ${he} shifts ${his} weight, ${his} mind obviously on ${his} backdoor,`
						);
						if (slave.attrXX > slave.attrXY) {
							r.push(Spoken(slave, `"there have to be ladies who want to buttfuck a whore, right? At least, I really hope there are."`));
						} else {
							r.push(Spoken(slave, `"the other slaves tell me that whores there get fucked up the ass all day and all night. Sounds like fun to me."`));
						}
						break;
					case "boobs":
						r.push(
							Spoken(slave, `"${Master},"`),
							`${He} sticks out ${his} chest a little and gestures`
						);
						if (slave.attrXX > slave.attrXY) {
							r.push(`that ${he}'s heard a woman comes by each day just to have her nipples sucked. ${He} licks ${his} lips, clearly savoring the thought.`);
						} else {
							r.push(`that ${he} knows tittyfucking is popular there and can't wait to give ${his} pair up for sale.`);
						}
						break;
					case "pregnancy":
						if (slave.attrXX > slave.attrXY) {
							r.push(Spoken(slave, `"${Master}, I hear from the other slaves there's this pregnant lady who goes there every night and pays to have a whore cuddle her. Just cuddle, all night. That would be kind of hard, just cuddling, but I could do it."`));
						} else if (slave.vagina === -1) {
							r.push(Spoken(slave, `"${Master}, since it's all bareback, I'm going to have a fuckton of cum in me. I wonder how much cum it takes to get a butthole pregnant? I'm gonna try, anyway."`));
						} else if (isFertile(slave)) {
							r.push(Spoken(slave, `"${Master}, since it's all bareback, I'm going to have a fuckton of cum in me. I wonder how much cum it would take to get my poor womb pregnant?"`));
						} else if (slave.pregKnown === 1) {
							r.push(Spoken(slave, `"${Master}, I'm going to be a pregnant whore. That's pretty fucking sexy."`));
						} else if (slave.preg > 0) {
							r.push(Spoken(slave, `"${Master}, since it's all bareback, I'm going to have a fuckton of cum in me. I wonder how much cum it would take to get my poor womb pregnant?"`));
						} else if (slave.ovaries === 1 && slave.pubertyXX === 0) {
							r.push(Spoken(slave, `"${Master}, I can't wait till I can get pregnant. That'd be pretty fucking sexy."`));
						} else {
							r.push(Spoken(slave, `"${Master}, I hear from the other slaves there's this pregnant lady who goes there every night and pays to have a whore cuddle her. Just cuddle, all night. That would be kind of hard, just cuddling, but I could do it."`));
						}
						break;
					case "dom":
						r.push(Spoken(slave, `"${Master}, I heard from the other slaves that some citizens bring their girls there. Just to make them take it from a whore."`));
						break;
					case "sadist":
						r.push(Spoken(slave, `"${Master}, I heard from the other slaves that some citizens bring their girls there. Because nobody knows how to hurt a bitch like a whore does." ${He} shivers.`));
				}
			} else if (slave.sexualFlaw !== "none") {
				r.push(
					Spoken(slave, `"Yes, ${Master},"`),
					`${he} says obediently. ${He} hesitates, looking concerned.`
				);
				switch (slave.sexualFlaw) {
					case "hates oral":
						r.push(
							Spoken(slave, `"I — I'm going to h-have to suck a lot of dick there, aren't I."`),
							`${He} swallows nervously. ${His} lower lip quivers, and ${he} does ${his} best not to cry in front of you.`
						);
						break;
					case "hates anal":
						r.push(
							Spoken(slave, `"C-customers are really going to ream me up the butt hole, aren't they."`),
							`${He}`
						);
						if (!hasAnyArms(slave)) {
							r.push(`shifts uncomfortably, unconsciously trying to shield ${his} rear as best ${he} can manage without`);
							if (isAmputee(slave)) {
								r.push(`limbs`);
							} else {
								r.push(`hands`);
							}
						} else {
							r.push(`unconsciously reaches around behind ${himself}, not quite shielding ${his} anus with ${his} ${hands}. ${His} lower lip quivers, and ${he} does ${his} best not to cry in front of you.`);
						}
						break;
					case "hates penetration":
						r.push(
							Spoken(slave, `"C-customers are really going to fuck me sore, aren't they."`),
							`${He}`
						);
						if (!hasAnyArms(slave)) {
							r.push(`shifts uncomfortably, unconsciously trying to shield ${his} rear as best ${he} can manage without`);
							if (isAmputee(slave)) {
								r.push(`limbs.`);
							} else {
								r.push(`hands.`);
							}
						} else if (slave.vagina > 0) {
							r.push(`unconsciously lets ${his} ${hands} fall to ${his} crotch, but catches ${himself} and doesn't quite shield ${his} pussy.`);
						} else {
							r.push(`unconsciously reaches around behind ${himself}, not quite shielding ${his} anus with ${his} ${hands}.`);
						}
						r.push(`${His} lower lip quivers, and ${he} does ${his} best not to cry in front of you.`);
						break;
					case "repressed":
						r.push(
							Spoken(slave, `"Being a whore is a sin,"`),
							`${he} ${say}s quietly, half to ${himself}.`,
							Spoken(slave, `"I'm going t-to b-be so dirty. I'm going to h-hell."`),
							`${He} starts to cry quietly.`,
							Spoken(slave, `"S-sorry, ${Master}. I'll do my best."`)
						);
						break;
					case "idealistic":
						r.push(
							Spoken(slave, `"I'm going to be sold for sex,"`),
							`${he} ${say}s quietly, half to ${himself}.`,
							Spoken(slave, `"Men are going to pay, and then they're g-going to stick their dicks in me, and then they're going to leave."`),
							`${He} starts to cry quietly.`,
							Spoken(slave, `"S-sorry, ${Master}. I'll do my best."`)
						);
						break;
					case "shamefast":
						r.push(
							Spoken(slave, `"I'm going to be meat in a brothel,"`),
							`${he} ${say}s quietly, half to ${himself}.`,
							Spoken(slave, `"I'm going to stand there naked with the other slaves, and men will pick me and then use my body. Over and over."`),
							`${He} starts to cry quietly.`,
							Spoken(slave, `"S-sorry, ${Master}. I'll do my best."`)
						);
						break;
					case "apathetic":
						r.push(
							Spoken(slave, `"I guess I'll lie there,"`),
							`${he} sighs quietly, half to ${himself}.`,
							Spoken(slave, `"A man will pay and then he'll come into my room where I'm lying on the bed, and he'll stick his cock in me and cum and leave. And then the next man will come in."`),
							Spoken(slave, `${He} starts to cry quietly.`),
							Spoken(slave, `"S-sorry, ${Master}. I'll do my best."`)
						);
						break;
					case "crude":
						r.push(
							Spoken(slave, `"Okay,"`),
							`${he} ${say}s, thinking.`,
							Spoken(slave, `"My poor cornhole is going to be such a seminal sewer."`),
							`${He} looks doubtful.`,
							Spoken(slave, `"Should I not have said that, ${Master}?"`)
						);
						break;
					case "judgemental":
						r.push(
							Spoken(slave, `"Gross,"`),
							`${he} ${say}s curtly.`,
							Spoken(slave, `"Well, no more handsome boys for me, then. Fat pathetic guys who patronize whores, all the way down. Fuck."`),
						);
						break;
				}
			} else {
				r.push(
					`${He} tries to be brave.`,
					Spoken(slave, `"${Master}, I will do my best to be a good whore."`),
					`Then, half to ${himself}, ${he} adds in a small voice,`,
					Spoken(slave, `"I can do this."`)
				);
			}
		} else {
			if (slave.fetishKnown === 1 && slave.fetishStrength > 60 && slave.fetish !== Fetish.NONE) {
				r.push(`${He} looks cautiously excited.`);
				switch (slave.fetish) {
					case "submissive":
						r.push(`${His} eyes go a little unfocused before ${he} snaps back to attention and gestures that ${he}'ll have to do whatever they want. ${His} attention wavers once more.`);
						break;
					case "masochist":
						r.push(`${He} gestures if brothel whores get breaks when they get sore. Before you can tell ${him} no, ${his} eyes glow with an unhealthy light and ${he} expresses that ${he}'d like it more if it hurt.`);
						break;
					case "cumslut":
						if (slave.attrXX > slave.attrXY) {
							r.push(`${He} gestures that ${he} heard a rumor that some ladies swing by during lunchtime for a quick eating out.`);
						} else {
							r.push(`As drool starts to leak from ${his} mouth, it's pretty obvious ${he} can't wait to start sucking.`);
						}
						break;
					case "humiliation":
						r.push(`${He} asks if there is a window that ${he} could be stationed in for all to see.`);
						break;
					case "buttslut":
						r.push(`${He} shifts ${his} weight, ${his} mind obviously on ${his} backdoor, and gestures`);
						if (slave.attrXX > slave.attrXY) {
							r.push(`if any girls would want to buttfuck ${him}.`);
						} else {
							r.push(`that ${he} knows whores take it up the ass there and can't wait to join them.`);
						}
						break;
					case "boobs":
						r.push(`${He} sticks out ${his} chest a little and gestures`);
						if (slave.attrXX > slave.attrXY) {
							r.push(`that ${he}'s heard a woman comes by each day just to have her nipples sucked. ${He} licks ${his} lips, clearly savoring the thought.`);
						} else {
							r.push(`that ${he} knows tittyfucking is popular there and can't wait to give ${his} pair up for sale.`);
						}
						break;
					case "pregnancy":
						r.push(`${He} gestures`);
						if (slave.attrXX > slave.attrXY) {
							r.push(`that ${he}'s heard that a pregnant woman has been coming every night to pay for a whore to cuddle her. ${He} asks if ${he} could be that ${girl}.`);
						} else if (slave.vagina === -1) {
							r.push(`how much ${he} wishes ${he} could get pregnant from all the cum loads ${he}'s going to get shot up ${his} rear.`);
						} else if (isFertile(slave)) {
							r.push(`that ${he} knows all the sex is bareback. By the look in ${his} eyes, you can tell ${he} is wondering how long it will take for some guy's seed to take root in ${him}.`);
						} else if (slave.pregKnown === 1) {
							r.push(`how sexy ${he} thinks pregnant whores are.`);
						} else if (slave.preg > 0) {
							r.push(`that ${he} knows all the sex is bareback. By the look in ${his} eyes, you can tell ${he} is wondering how long it will take for some guy's seed to take root in ${him}.`);
						} else if (slave.ovaries === 1 && slave.pubertyXX === 0) {
							r.push(`how excited ${he} is for the day ${he} starts ${his} menstrual cycle. Will ${he} even see ${his} first period, or will every egg ${he} makes get fertilized?`);
						} else {
							r.push(`that ${he}'s heard a pregnant woman has been coming every night to pay for a whore to cuddle her. ${He} hopes that one day ${he}'ll be chosen.`);
						}
						break;
					case "dom":
						r.push(`${He} gestures that ${he} knows citizens sometimes bring their toys there just to let them get pushed around by a whore. ${He}'d like that to be true. A lot.`);
						break;
					case "sadist":
						r.push(`${He} gestures that ${he} knows citizens sometimes bring their toys there for punishment. ${He} shivers with anticipation.`);
				}
			} else if (slave.sexualFlaw !== "none") {
				r.push(`${He} nods obediently before hesitating with a concerned look on ${his} face.`);
				switch (slave.sexualFlaw) {
					case "hates oral":
						r.push(`${He} slowly gestures if blowjobs are popular there while swallowing nervously. ${His} lower lip starts to quiver, and ${he} does ${his} best not to cry in front of you.`);
						break;
					case "hates anal":
						r.push(`${He} slowly gestures if anal is popular there and`);
						if (!hasAnyArms(slave)) {
							r.push(`shifts uncomfortably, unconsciously trying to shield ${his} rear as best ${he} can manage without`);
							if (isAmputee(slave)) {
								r.push(`limbs.`);
							} else {
								r.push(`hands.`);
							}
						} else {
							r.push(`unconsciously reaches around behind ${himself}, not quite shielding ${his} anus with ${his} ${hands}.`);
						}
						r.push(`${His} lower lip quivers, and ${he} does ${his} best not to cry in front of you.`);
						break;
					case "hates penetration":
						r.push(`${He} slowly gestures that ${he} understands that customers will expect to fuck ${him} and`);
						if (!hasAnyArms(slave)) {
							r.push(`shifts uncomfortably, unconsciously trying to shield ${his} rear as best ${he} can manage without`);
							if (isAmputee(slave)) {
								r.push(`limbs.`);
							} else {
								r.push(`hands.`);
							}
						} else if (slave.vagina > 0) {
							r.push(`unconsciously lets ${his} ${hands} fall to ${his} crotch, but catches ${himself} and doesn't quite shield ${his} pussy.`);
						} else {
							r.push(`unconsciously reaches around behind ${himself}, not quite shielding ${his} anus with ${his} ${hands}.`);
						}
						r.push(`${His} lower lip quivers, and ${he} does ${his} best not to cry in front of you.`);
						break;
					case "repressed":
						r.push(`${He} shakily gestures that ${he}'ll be a sinner, but if that's what you want, ${he}'ll do it. ${He} starts to cry quietly.`);
						break;
					case "idealistic":
						r.push(`${He} shakily gestures that ${he}'ll do ${his} best to please any men that use ${him}. ${He} starts to cry quietly.`);
						break;
					case "shamefast":
						r.push(`${He} shakily gestures that ${he}'ll do ${his} best to use ${his} naked body to attract men and entice passersby. ${He} starts to cry quietly.`);
						break;
					case "apathetic":
						r.push(`${He} shakily gestures that ${he}'ll do ${his} best to take cock. ${He} starts to cry quietly.`);
						break;
					case "crude":
						r.push(`${He} gestures that ${his} body is going to become so foul after a day's worth of fucks. ${He} pauses for a moment, doubtful over whether ${he} should have said that or not.`);
						break;
					case "judgemental":
						r.push(`${He} gestures ${his} disappointment that only the most pathetic of losers will be fucking ${him} now. ${He} pauses for a moment, doubtful over whether ${he} should have said that or not.`);
				}
			} else {
				r.push(`${He} puts on a brave face and gestures that ${he}'ll do ${his} best. As you send ${him} off, you catch sight of ${him} trying to reassure ${himself}.`);
			}
		}
	} else if (slave.trust < -20) {
		if (canTalk(slave)) {
			if (slave.sexualFlaw !== "none") {
				r.push(
					Spoken(slave, `"Yes, ${Master},"`),
					`${he} says automatically. ${He}'s badly frightened, and says in a small voice, half to ${himself},`
				);
				switch (slave.sexualFlaw) {
					case "hates oral":
						r.push(
							Spoken(slave, `"I — I'm going to h-have to suck a lot of dick, aren't I."`),
							`${He} swallows and tries to control ${himself} out of fear, but finally gasps out,`,
							Spoken(slave, `"Oh God, I'm scared," and bursts into tears.`)
						);
						break;
					case "hates anal":
						r.push(
							Spoken(slave, `"C-customers are really going to ream me up the butt hole, aren't they."`),
							`${He}`
						);
						if (!hasAnyArms(slave)) {
							r.push(`shifts uncomfortably, unconsciously trying to shield ${his} rear as best ${he} can manage without`);
							if (isAmputee(slave)) {
								r.push(`limbs.`);
							} else {
								r.push(`hands.`);
							}
						} else {
							r.push(`unconsciously reaches around behind ${himself}, not quite shielding ${his} anus with ${his} ${hands}.`);
						}
						r.push(
							`${His} lower lip quivers and ${he} tries to control ${himself} out of fear, but finally gasps out,`,
							Spoken(slave, `"Oh God, I'm scared,"`),
							`and bursts into tears.`
						);
						break;
					case "hates penetration":
						r.push(
							Spoken(slave, `"C-customers are really going to fuck me sore, aren't they."`),
							`${He}`
						);
						if (!hasAnyArms(slave)) {
							r.push(`shifts uncomfortably, unconsciously trying to shield ${his} rear as best ${he} can manage without`);
							if (isAmputee(slave)) {
								r.push(`limbs.`);
							} else {
								r.push(`hands.`);
							}
						} else if (slave.vagina > 0) {
							r.push(`unconsciously lets ${his} ${hands} fall to ${his} crotch, but catches ${himself} and doesn't quite shield ${his} pussy.`);
						} else {
							r.push(`unconsciously reaches around behind ${himself}, not quite shielding ${his} anus with ${his} ${hands}.`);
						}
						r.push(
							`${His} lower lip quivers, and ${he} tries to control ${himself} out of fear, but finally gasps out,`,
							Spoken(slave, `"Oh God, I'm scared,"`),
							`and bursts into tears.`
						);
						break;
					case "repressed":
						r.push(
							Spoken(slave, `"Being a whore is a sin,"`),
							`${he} ${say}s quietly, half to ${himself}.`,
							Spoken(slave, `"I'm going t-to b-be so dirty. I'm going to h-hell."`),
							`${He} starts to cry quietly. ${He} tries to get ${himself} back under control, out of fear, but finally wails,`,
							Spoken(slave, `"Oh God, I'm sorry, p-please forgive me God,"`),
							`and dissolves into sobbing.`
						);
						break;
					case "idealistic":
						r.push(
							Spoken(slave, `"I'm going to be sold for sex,"`),
							`${he} ${say}s quietly, half to ${himself}.`,
							Spoken(slave, `"Men are going to pay, and then they're g-going to stick their dicks in me, and then they're going to leave."`),
							`${He} starts to cry openly.`,
							Spoken(slave, `"S-sorry, ${Master}. P-please don't beat me. I'll do it."`)
						);
						break;
					case "shamefast":
						r.push(
							Spoken(slave, `"I'm going to be meat in a brothel,"`),
							`${he} ${say}s quietly, half to ${himself}.`,
							Spoken(slave, `"I'm going to stand there naked with the other slaves, and men will pick me and then use my body. Over and over."`),
							`${He} starts to cry openly.`,
							Spoken(slave, `"S-sorry, ${Master}. P-please don't beat me. I'll do it."`)
						);
						break;
					case "apathetic":
						r.push(
							Spoken(slave, `"I guess I'll lie there,"`),
							`${he} sighs quietly, half to ${himself}.`,
							Spoken(slave, `"A man will pay and then he'll come into my room where I'm lying on the bed, and he'll stick his cock in me and cum and leave. And then the next man will come in."`),
							`${He} starts to cry quietly. "S-sorry, ${Master}. P-please don't beat me. I'll let it happen."`
						);
						break;
					case "crude":
						r.push(
							Spoken(slave, `"Okay,"`),
							`${he} ${say}s, thinking.`,
							Spoken(slave, `"My poor cornhole is going to be such a seminal sewer."`),
							`${He} looks doubtful.`,
							Spoken(slave, `"Should I not have said that, ${Master}?"`)
						);
						break;
					case "judgemental":
						r.push(
							Spoken(slave, `"Gross,"`),
							`${he} ${say}s curtly.`,
							Spoken(slave, `"Well, no more handsome boys for me, then. Fat pathetic guys who patronize whores, all the way down. Fuck."`)
						);
				}
			} else {
				r.push(
					`${He} does ${his} best to control ${himself} and avoid punishment.`,
					Spoken(slave, `"${Master}, I will."`),
					`${He} holds ${himself} together until you dismiss ${him}; as ${he} turns away to go, the tears come fast, and ${he} almost runs into the door frame on ${his} way out${(canSee(slave)) ? ", blind with weeping" : ""}.`
				);
			}
		} else {
			if (slave.sexualFlaw !== "none") {
				r.push(`${He} automatically gestures consent. ${He}'s badly frightened, and gingerly continues`);
				switch (slave.sexualFlaw) {
					case "hates oral":
						r.push(`by asking if ${he}'ll have to suck a lot of dick. ${He} swallows and tries to control ${himself} out of fear, but finally loses composure and bursts into tears.`);
						break;
					case "hates anal":
						r.push(`by asking if ${he}'ll be assfucked a lot. ${He}`);
						if (!hasAnyArms(slave)) {
							r.push(`shifts uncomfortably, unconsciously trying to shield ${his} rear as best ${he} can manage without`);
							if (isAmputee(slave)) {
								r.push(`limbs.`);
							} else {
								r.push(`hands.`);
							}
						} else {
							r.push(`unconsciously reaches around behind ${himself}, not quite shielding ${his} anus with ${his} ${hands}.`);
						}
						r.push(`${His} lower lip quivers and ${he} tries to control ${himself} out of fear, but finally loses composure and bursts into tears.`);
						break;
					case "hates penetration":
						r.push(`by asking if ${he}'s going to be constantly fucked. ${He}`);
						if (!hasAnyArms(slave)) {
							r.push(`shifts uncomfortably, unconsciously trying to shield ${his} rear as best ${he} can manage without`);
							if (isAmputee(slave)) {
								r.push(`limbs.`);
							} else {
								r.push(`hands.`);
							}
						} else if (slave.vagina > 0) {
							r.push(`unconsciously lets ${his} ${hands} fall to ${his} crotch, but catches ${himself} and doesn't quite shield ${his} pussy.`);
						} else {
							r.push(`unconsciously reaches around behind ${himself}, not quite shielding ${his} anus with ${his} ${hands}.`);
						}
						r.push(`${His} lower lip quivers, and ${he} tries to control ${himself} out of fear, but finally loses composure and bursts into tears.`);
						break;
					case "repressed":
						r.push(`that being a whore is a sin. ${He} starts to cry quietly. ${He} tries to get ${himself} back under control, out of fear, but finally wails and dissolves into prayers intermixed with sobbing.`);
						break;
					case "idealistic":
						r.push(`that sex should be with the one you love, not random men. ${He} starts to cry openly while begging you not to beat ${him}.`);
						break;
					case "shamefast":
						r.push(`that ${he} doesn't want to be naked in a line up for men to choose from. ${He} starts to cry openly while begging you not to beat ${him}.`);
						break;
					case "apathetic":
						r.push(`that all ${he} has to do is lie there and take it. ${He} starts to cry quietly.`);
						break;
					case "crude":
						r.push(`by asking if men enjoy fucking a thoroughly seeded hole. ${He} pauses for a moment, doubtful over whether ${he} should have said that or not.`);
						break;
					case "judgemental":
						r.push(`by expressing ${his} disappointment with the type of men that frequent brothels.`);
				}
			} else {
				r.push(
					`${He} does ${his} best to control ${himself} and avoid punishment, nodding ${his} head. ${He} holds ${himself} together until you dismiss ${him}; as ${he} turns away to go, the tears come fast, and ${he} almost runs into the door frame on ${his} way out${(canSee(slave)) ? ", blind with weeping" : ""}.`);
			}
		}
	} else {
		r.push(`${He} manages to`);
		if (canTalk(slave)) {
			r.push(
				`get`,
				Spoken(slave, `"Oh fuck n-"`),
				`out`
			);
		} else if (hasAnyArms(slave)) {
			r.push(`flip you an incredibly rude gesture`);
		} else {
			r.push(`get an incredibly rude gesture out`);
		}
		r.push(`before the compliance systems activate and ${he}'s poleaxed to the ground. Anticipating this, you had`);
		if (V.MadamID !== 0) {
			r.push(S.Madam.slaveName);
		} else {
			r.push(`another, more obedient slave`);
		}
		r.push(`standing by to haul ${him} away. It'll take a couple of hundred customers, but being sold in a brothel for rape should knock the resistance out of ${him}.`);
	}
	App.Events.addParagraph(node, r);
	return node;
};


code:
/** @type {FC.FacilityFramework} */
App.Data.Facilities.brothel = {
	baseName: "brothel",
	genericName: null,
	jobs: {
		assignee: {
			position: "whore",
			assignment: Job.BROTHEL,
			publicSexUse: true,
			fuckdollAccepted: false
		},
	},
	defaultJob: "assignee",
	manager: {
		position: "madam",
		assignment: Job.MADAM,
		careers: App.Data.Careers.Leader.madam,
		skill: "madam",
		publicSexUse: true,
		fuckdollAccepted: false,
		broodmotherAccepted: false,
		shouldWalk: true,
		shouldHold: true,
		shouldSee: true,
		shouldHear: true,
		shouldTalk: true,
		shouldThink: true,
		requiredDevotion: 50
	},
	decorated: true
};

App.Entity.Facilities.BrothelJob = class extends App.Entity.Facilities.FacilitySingleJob {
	/**
	 * @override
	 * @param {App.Entity.SlaveState} slave
	 * @returns {string[]}
	 */
	checkRequirements(slave) {
		let r = super.checkRequirements(slave);

		// condition is the same as for the club
		if (!App.Entity.Facilities.Job._isBrokenEnough(slave, 51, -50, -20, -50, 50)) {
			r.push(App.Entity.Facilities.Job._stdBreakageMessage(slave));
		}
		return r;
	}
};

App.Entity.Facilities.MadamJob = class extends App.Entity.Facilities.ManagingJob {
	/**
	 * @param {App.Entity.SlaveState} slave
	 * @returns {string[]}
	 */
	checkRequirements(slave) {
		let r = super.checkRequirements(slave);
		if (slave.intelligence + slave.intelligenceImplant < -50) {
			r.push(`${slave.slaveName} is not intelligent enough to be the Madam.`);
		}
		return r;
	}
};

App.Entity.facilities.brothel = new App.Entity.Facilities.SingleJobFacility(
	App.Data.Facilities.brothel,
	{
		assignee: new App.Entity.Facilities.BrothelJob()
	},
	new App.Entity.Facilities.MadamJob()
);

repo_name: DontAskDontTell/fc

license: mit


code:
App.Facilities.WardenessSelect = function() {
	const f = document.createDocumentFragment();

	if (S.Wardeness) {
		f.append(`Wardeness: ${SlaveFullName(S.Wardeness)}, helps breaking your prisoners. `);
		f.append(App.UI.DOM.link("Remove Wardeness", () => {
			removeJob(S.Wardeness, Job.WARDEN);
		},
		[], "Cellblock"
		));
	} else {
		f.append(`No Wardeness assigned, appoint one from your devoted slaves.`);
	}

	f.append(App.UI.SlaveList.facilityManagerSelection(App.Entity.facilities.cellblock, "Cellblock"));
	return f;
};


code:
App.Facilities.Cellblock.cellblock = class Cellblock extends App.Facilities.Facility {
	constructor() {
		const cellblock = App.Entity.facilities.cellblock;
		const decommissionHandler = () => {
			V.cellblock = 0;
			V.cellblockDecoration = "standard";
			V.cellblockUpgrade = 0;
		};

		super(
			cellblock,
			decommissionHandler,
		);

		V.nextButton = "Back to Main";
		V.nextLink = "Main";
		V.encyclopedia = "Cellblock";
	}

	/** @returns {string} */
	get intro() {
		const text = [];

		text.push(this.facility.nameCaps, this.decorations);

		if (this.facility.hostedSlaves() > 2) {
			text.push(`${this.facility.nameCaps} is full of slaves, though it's difficult to tell at first. In many of the cells, a scene of loneliness and misery may be witnessed, but not one sound escapes them in fear of the punishment that would follow.`);
		} else if (this.facility.hostedSlaves() > 0) {
			text.push(`${this.facility.nameCaps} holds a few slaves, though it's difficult to tell at first. In several of the cells, a scene of loneliness and misery may be witnessed, but not one sound escapes them in fear of the punishment that would follow.`);
		} else if (S.Wardeness) {
			text.push(`${S.Wardeness.slaveName} is alone in ${this.facility.name}, and seems rather lonely without anyone to oppress.`);
		} else {
			text.push(`None of your slaves are confined in ${this.facility.name}.`);
		}

		return text.join(' ');
	}

	/** @returns {string} */
	get decorations() {
		/** @type {FC.Facilities.Decoration} */
		const FS = {
			"Roman Revivalist": `is designed to resemble the holding pens beneath the old Coliseum. Whenever there's a fight in the arcology, screens in each cell helpfully keep inmates informed of what awaits (otherwise) useless slaves.`,
			"Neo-Imperialist": `is designed as an ultra high-tech cellblock. Holographic shackles keep slaves locked to rough black cells, kept totally isolated from one another through the complete silence of thick metal walls.`,
			"Aztec Revivalist": `is designed to frighten the prisoners to submission. All the cells look to the center of the facility, where a sacrificial altar stands, adorned with ceremonial ${V.arcologies[0].FSPaternalist !== "unset" ? `ropes and penetrators` : `knives, ropes and blunt instruments`}.`,
			"Egyptian Revivalist": `uses the climate of Egypt as an additional source of discomfort. The air here is hot and dry, and inmates can easily imagine themselves confined in mud brick cells in a baking desert.`,
			"Edo Revivalist": `is furnished in a severely medieval Japanese style. There is one refinement, but it's of exquisite cruelty. At the end of the hall, there's a fountain with a traditional bamboo boar scarer. As it fills with water, it tips against a stone with a thunk... thunk... thunk... thunk...`,
			"Arabian Revivalist": `is furnished as imagined Arabian slave pens, all set around a central pillar. This pillar is capped by shackles, so that slaves can be bound by their hands and whipped on the backs, buttocks, and thighs in clear view of all their fellow chattel.`,
			"Chinese Revivalist": `is furnished in a severely medieval Chinese style. There is one refinement, but it's of exquisite cruelty. Somewhere out of sight, water is dripping into an urn, drop by drop... drop... drop... drop...`,
			"Chattel Religionist": `is built of cold stone. Most of the cells are unfurnished little cubes inside which the only bed is the bare floor. A few are smaller still, so that the inmates can neither stand nor lie flat.`,
			"Degradationist": `is a nightmare. Everything is made of metal, and almost everything menaces with spikes of steel. Inmates must carefully avoid the walls of their own cells if they wish to avoid being stabbed.`,
			"Asset Expansionist": `is a straightforward prison, with one exception. Each cell features a screen displaying plans for its inmate's expansion. Day and night, inmates are confronted with the sight of themselves transformed.`,
			"Transformation Fetishist": `is a straightforward prison, with one exception. Each cell features a screen displaying plans for its inmate's expansion. Day and night, inmates are confronted with the sight of themselves transformed.`,
			"Gender Radicalist": `is a straightforward prison, with one exception. Each cell features a screen displaying plans for its inmate's bimbofication. Day and night, inmates are confronted with the sight of themselves dyed, pierced, tattooed, gaped, filled with implants, or all of these.`,
			"Gender Fundamentalist": `is a block of barred cells whose sides, offering a clear view of the whole prison, provide much menace. Anyone who abuses an inmate does so in full view of every other slave here, keeping the jailbirds in a state of constant fear that they're next.`,
			"Physical Idealist": `is a block of barred cells whose sides, offering a clear view of the whole prison, provide much menace. Anyone who rapes an inmate does so in full view of every other slave here, keeping the bitches in a state of constant fear that their asses are next.`,
			"Supremacist": `is a straightforward prison whose menace is provided by context that, although subtle, adds up to a nightmare. Everyone outside the cells is ${V.arcologies[0].FSSupremacistRace}, and everyone inside them is not. The darkness of history is palpable here.`,
			"Subjugationist": `is a straightforward prison whose menace is provided by context that, although subtle, adds up to a nightmare. The inmates inside the cells are ${V.arcologies[0].FSSubjugationistRace}, and everyone outside them is not. The darkness of history is palpable here.`,
			"Repopulationist": `is a straightforward prison, with two exceptions. One cell style features a screen displaying plans for its inmate's impregnation, the other is covered with mirrors for its inmate to watch her pregnancy grow. Day and night, inmates are confronted with the sight of themselves transformed.`,
			"Eugenics": `is designed to make very clear to its inmates that they are subhuman. Many screens showcasing their inadequacy intermingled with propaganda play on nonstop loops.`,
			"Paternalist": `is a prison, but a modern and scientific one. The cells, the common areas, and even the color of the walls are all carefully designed to communicate the feeling that inmates can better themselves.`,
			"Pastoralist": `requires its inmates to drink as much breast milk as they can hold. This sounds like a small thing, but for an unbroken slave, conquering the revulsion of drinking another slave's milk is an important step.`,
			"Maturity Preferentialist": `is subtly designed to make very clear to its inmates that they are sex objects. Many screens showing pornography make it clear to the maturest slave here that they're still an object of lust, and will be used to slake others' pleasure.`,
			"Youth Preferentialist": `is subtly designed to make the breadth of sex acts performed in the arcology clear to its inmates. A cacophony of pornography makes clear to the most innocent inmate that ${V.seeDicks !== 100 ? `her pussy is a fuck hole, ` : ``}her mouth is a fuck hole, her anus is a fuck hole, and, in fact, ${V.seeDicks !== 100 ? `all three` : `both`} can be fuck holes at once.`,
			"Body Purist": `requires its inmates to drink as much filtered water as they can, all the time. This sounds like a petty thing, but most inmates are very aware that they're being flushed out. Cleaned. It is an oddly menacing thought.`,
			"Slimness Enthusiast": `is torture for chubby slaves. Fat bitches that pass through here soon learn that they're going to be slim and pretty one day, but that it isn't going to be much fun getting there.`,
			"Hedonistic": `is torture for thin slaves. The first thing they notice is the heavily reinforced cot they will reside upon. The second is the feeding tube that will be anchored in their stomach for the duration of their stay. Slaves imprisoned here will have their body stuffed to capacity with concentrated slave food, ensuring a plump, docile slave by the end of their sentence.`,
			"Intellectual Dependency": `is a straightforward prison, with one exception. Each cell comes equipped with sound dampening shutters so slaves may be cut off from all outside stimulation. They are forced to be alone with their thoughts for most of their stay.`,
			"Slave Professionalism": `is torture for dumb slaves. Everything in the cell is a puzzle, from the food dispenser to the cot cover. Slaves are frequently rotated so that they may never become accustomed to any solutions.`,
			"Petite Admiration": `is designed to make tall slaves know they are unwelcome. What amounts a basic prison for a short slave is positively torturous when one is far too large to even move in it.`,
			"Statuesque Glorification": `is designed to make short slaves know they are unwelcome. Where a tall slave will find nothing more than a standard cell, the vertically challenged while will find an insurmountable trial designed to teach them their place.`,
			"standard": `could be mistaken for a modern prison. A close inspection, however, reveals restraints in each cell that will hold inmates in sexually compromising positions, and compliance systems to force them to place their wrists and ankles in them.`,
		};

		const res = FS[V.cellblockDecoration];

		if (!res) {
			throw new Error(`Unknown V.cellblockDecoration value of '${V.cellblockDecoration}' found in decorations().`);
		}

		return res;
	}

	/** @returns {FC.Facilities.Expand} */
	get expand() {
		return {
			desc: `${capFirstChar(V.cellblockName)} has room for ${num(V.cellblock)} slaves to be kept in close confinement. There ${this.facility.hostedSlaves() === 1
				? `is currently ${num(this.facility.hostedSlaves())} slave`
				: `are currently ${num(this.facility.hostedSlaves())} slaves`} kept in close confinement in ${V.cellblockName}.`,
			removeSlave: "stay confined",
		};
	}

	/** @returns {FC.IUpgrade[]} */
	get upgrades() {
		return [
			{
				property: "cellblockUpgrade",
				tiers: [
					{
						value: 0,
						upgraded: 1,
						text: `Its compliance systems are standard.`,
						link: `Upgrade them to soften slave flaws`,
						cost: 20000 * V.upgradeMultiplierArcology * V.HackingSkillMultiplier,
						handler: () => {
							V.PC.skill.engineering += 0.1;
							V.PC.skill.hacking += 0.1;
						},
					},
					{
						value: 1,
						text: `Its compliance systems have been upgraded to allow slaves no mental respite, painstakingly correcting the tiniest misbehaviors to soften flaws into quirks at the cost of considerable anguish to inmates denied any rest from correction.`,
					},
				],
			},
		];
	}

	/** @returns {FC.Facilities.Rule[]} */
	get rules() {
		return [
			{
				property: "cellblockWardenCumsInside",
				prereqs: [
					!!S.Wardeness,
					!!S.Wardeness && canPenetrate(S.Wardeness),
				],
				options: [
					{
						get text() {
							const {his} = getPronouns(S.Wardeness);
							return `${S.Wardeness.slaveName} is not permitted to cum inside ${his} inmates.`;
						},
						link: `Forbid`,
						value: 0,
					},
					{
						get text() {
							const {his, he} = getPronouns(S.Wardeness);
							return `${S.Wardeness.slaveName} is permitted to cum inside ${his} inmates when ${he} disciplines them.`;
						},
						link: `Allow`,
						value: 1,
					},
				],
			},
		];
	}
};


code:
/** @type {FC.FacilityFramework} */
App.Data.Facilities.cellblock = {
	baseName: "cellblock",
	genericName: null,
	jobs: {
		assignee: {
			position: "confinee",
			assignment: Job.CELLBLOCK,
			publicSexUse: false,
			fuckdollAccepted: false
		},
	},
	defaultJob: "assignee",
	manager: {
		position: "wardeness",
		assignment: Job.WARDEN,
		careers: App.Data.Careers.Leader.wardeness,
		skill: "wardeness",
		publicSexUse: false,
		fuckdollAccepted: false,
		broodmotherAccepted: false,
		shouldWalk: true,
		shouldHold: true,
		shouldSee: true,
		shouldHear: true,
		shouldTalk: false,
		shouldThink: false,
		requiredDevotion: 51
	},
	decorated: true
};

App.Entity.Facilities.CellblockJob = class extends App.Entity.Facilities.FacilitySingleJob {
	/**
	 * @param {App.Entity.SlaveState} slave
	 * @returns {string[]}
	 */
	checkRequirements(slave) {
		let r = super.checkRequirements(slave);

		if (slave.trust < -50) {
			r.push(`${slave.slaveName} is too terrified for ${this.facility.name} to have an effect.`);
		} else if ((slave.devotion >= -20 || slave.trust < -20) && (slave.devotion >= -50 || slave.trust < -50)) {
			r.push(`${slave.slaveName} is not defiant enough for ${this.facility.name} to have an effect.`);
		}

		return r;
	}
};

App.Entity.facilities.cellblock = new App.Entity.Facilities.SingleJobFacility(
	App.Data.Facilities.cellblock,
	{
		assignee: new App.Entity.Facilities.CellblockJob()
	}
);


code:
App.Facilities.NurseSelect = function() {
	const f = document.createDocumentFragment();

	if (S.Nurse) {
		f.append(`${SlaveFullName(S.Nurse)} is working as your Nurse, helping to heal your slaves. `);
		f.append(App.UI.DOM.link("Remove Nurse", () => {
			removeJob(S.Nurse, Job.NURSE);
		},
		[], "Clinic"
		));
	} else {
		f.append(`No Nurse assigned, appoint one from your devoted slaves.`);
	}

	f.append(App.UI.SlaveList.facilityManagerSelection(App.Entity.facilities.clinic, "Clinic"));
	return f;
};


code:
App.Facilities.Clinic.clinic = class Clinic extends App.Facilities.Facility {
	constructor() {
		const clinic = App.Entity.facilities.clinic;
		const decommissionHandler = () => {
			V.clinic = 0;
			V.clinicDecoration = "standard";
			V.clinicUpgradeScanner = 0;
			V.clinicUpgradeFilters = 0;
			V.clinicUpgradePathogenSequencer = 0;
			V.clinicUpgradePurge = 0;
			V.clinicInflateBelly = 0;
			V.clinicSpeedGestation = 0;
		};

		super(
			clinic,
			decommissionHandler,
		);

		V.nextButton = "Back to Main";
		V.nextLink = "Main";
		V.encyclopedia = "Clinic";
	}

	/** @returns {string} */
	get intro() {
		const text = [];

		text.push(this.facility.nameCaps, this.decorations);

		if (this.facility.hostedSlaves() > 2) {
			text.push(`${this.facility.nameCaps} is busy. Patients occupy many of the beds; most are alert, but a few are dozing under medication designed to promote healing through deep rest.`);
		} else if (this.facility.hostedSlaves() > 0) {
			text.push(`${this.facility.nameCaps} is sparsely populated. Patients occupy a few of the beds; most are alert, but a few are dozing under medication designed to promote healing through deep rest.`);
		} else if (S.Nurse) {
			text.push(`${S.Nurse.slaveName} is alone in the clinic, and has nothing to do but keep the place spotlessly clean and ready for its next patients.`);
		} else {
			text.push(`${this.facility.nameCaps} is empty and quiet.`);
		}

		return text.join(' ');
	}

	/** @returns {string} */
	get decorations() {
		/** @type {FC.Facilities.Decoration} */
		const FS = {
			"Roman Revivalist": `is open and airy; a breeze wafts through the space, and Roman theories on natural cleanliness are very much on display.`,
			"Neo-Imperialist": `is white and sterile, filled with so many high-tech machines that you cannot discern the purpose of them all. The space reminds you of a laboratory, kept painstakingly clean at all time by small robotic drones.`,
			"Aztec Revivalist": `is open and airy; a light hint of herbs and natural oil permeates the air. Everything is incredibly sterile, especially the blood management equipment.`,
			"Egyptian Revivalist": `is open and airy; clean rushes are strewn across the floor, making a gentle susurration when anyone crosses the space.`,
			"Edo Revivalist": `is clean and spartan to the point of featurelessness. Spotless tatami mats cover the floor, and partitions divide the space into cubicles.`,
			"Arabian Revivalist": `is open and airy; a thin trail of smoke wafts through the space on a gentle breeze, coming from a brazier burning incense.`,
			"Chinese Revivalist": `is open and airy; a thin trail of smoke wafts through the space on a gentle breeze, coming from a brazier burning medicinal herbs.`,
			"Chattel Religionist": `is open and airy; shaded beams of sunlight shine through skylights to bathe each bed in a pool of healing warmth.`,
			"Degradationist": `is clean and cold, all scrubbed tile and cool steel. The beds have prominent restraint attachment points to force patients into any position desired.`,
			"Repopulationist": `is warm and inviting, with wide corridors and ample seating for its pregnant clientèle. All the equipment is designed to accommodate heavily pregnant women.`,
			"Eugenics": `is warm and inviting on one side, cold and utilitarian on the other. Only the toys of the elite are allowed the best of care.`,
			"Asset Expansionist": `is utilitarian, without any concession to style. Every available ${V.showInches === 2 ? `inch` : `centimeter`} of space is used for equipment specialized to support growth.`,
			"Transformation Fetishist": `is utilitarian, without any concession to style. Every available ${V.showInches === 2 ? `inch` : `centimeter`} of space is used for equipment specialized to support radical surgery.`,
			"Gender Radicalist": `is comfortable and feminine. Its curving walls and soft colors are designed to present slaves coming out of anesthesia with an impression of girlishness.`,
			"Gender Fundamentalist": `is comfortable and feminine. Its curving walls and soft colors are designed to keep slaves here for their female health nice and comfortable.`,
			"Physical Idealist": `is utilitarian, without any concession to style. Every available ${V.showInches === 2 ? `inch` : `centimeter`} of space is used for some piece of equipment useful in making the human body faster or stronger.`,
			"Supremacist": `is clean and cold, all scrubbed tile and cool steel. The only hint of its radical uses are the pseudoscientific racialist charts on the walls.`,
			"Subjugationist": `is clean and cold, all scrubbed tile and cool steel. The only hint of its radical uses are the pseudoscientific racialist charts on the walls.`,
			"Paternalist": `is warm and inviting, with curved walls and warm colors designed to put patients at their ease. Each bed is well provided with entertainment options.`,
			"Pastoralist": `is utilitarian, without any concession to style. Every available ${V.showInches === 2 ? `inch` : `centimeter`} of space is used for equipment specialized for human veterinary medicine.`,
			"Maturity Preferentialist": `is comfortable and soothing, with curved walls and cool colors designed to keep patients relaxed. Each bed is provided with refined yet invariably pornographic entertainment options.`,
			"Youth Preferentialist": `is bright and cheerful, with curved walls and pastel colors designed to keep patients in good spirits. Each bed is provided with light entertainment options.`,
			"Body Purist": `is utilitarian, without any concession to style. Every available ${V.showInches === 2 ? `inch` : `centimeter`} of space is filled with equipment designed to make medicine as low-impact as possible.`,
			"Slimness Enthusiast": `is warm and inviting, with curved walls and warm colors designed to put patients at their ease. Each bed is well provided with entertainment options.`,
			"Hedonistic": `is warm and comfortable, with extra wide, soft, heated beds and ample morphine. Pleasant smells are pumped into the recovery wards, plenty of entertainment is available and chubby nurse in a too small dress with a big bowl of slave food is only a button press away. It can be quite difficult to convince patients to leave.`,
			"Intellectual Dependency": `is bright and cheerful, with plenty of simple amusements to keep bimbos distracted and in bed. A complex locking mechanism promises no chance of a slave wandering off to slake their lust.`,
			"Slave Professionalism": `is clean and cold, all scrubbed tile and cool steel. Any delays in recovery are nothing more than time spent not honing one's talents.`,
			"Petite Admiration": `is open and airy due to all the extra space freed up by shortening the beds. A footrest is the only accommodation made for tall slaves.`,
			"Statuesque Glorification": `is warm and comfortable, if a little cramped; tall slaves require long beds, after all. A meager footstool is the only accommodation made for short slaves.`,
			"standard": `is a well-equipped modern medical facility. Each patient has their own area, with heavy automation to provide them treatment without any human intervention at all.`,
		};

		const res = FS[V.clinicDecoration];

		if (!res) {
			throw new Error(`Unknown V.clinicDecoration value of '${V.clinicDecoration}' found in decorations().`);
		}

		return res;
	}

	/** @returns {FC.Facilities.Expand} */
	get expand() {
		return {
			desc: `${this.facility.nameCaps} has room to support ${num(V.clinic)} slaves while they receive treatment. There ${this.facility.hostedSlaves() === 1 ? `is currently ${num(this.facility.hostedSlaves())} slave` : `are currently ${num(this.facility.hostedSlaves())} slaves`} receiving treatment in ${V.clinicName}.`,
		};
	}

	/** @returns {FC.IUpgrade[]} */
	get upgrades() {
		return [
			{
				property: "clinicUpgradeScanner",
				tiers: [
					{
						value: 0,
						upgraded: 1,
						text: `It mounts powerful medical scanning technology.`,
						link: `Upgrade the scanners to help detect genomic damage`,
						cost: 10000 * V.upgradeMultiplierArcology * Math.min(V.upgradeMultiplierMedicine, V.HackingSkillMultiplier),
						handler: () => V.PC.skill.hacking += 0.1,
						notes: [`increases the effectiveness of ${V.clinicName}`],
					},
					{
						value: 1,
						text: `${this.facility.nameCaps}'s scanners have been upgraded with a sampling system that can estimate carcinogenic damage to a slave's body.`,
					},
				],
			},
			{
				property: "clinicUpgradeFilters",
				tiers: [
					{
						value: 0,
						upgraded: 1,
						text: `It includes standard dialysis equipment.`,
						link: `Install advanced blood treatment equipment to help address drug side effects`,
						cost: 50000 * V.upgradeMultiplierArcology * Math.min(V.upgradeMultiplierMedicine, V.HackingSkillMultiplier),
						handler: () => {
							V.PC.skill.hacking += 0.1;

							App.UI.reload();
						},
						notes: [`increases the effectiveness of ${V.clinicName}`],
					},
					{
						value: 1,
						text: `The entire floor beneath ${V.clinicName} is occupied by a huge filtration plant that constantly cycles out the patients' blood to remove impurities.`,
					},
				],
			},
			{
				property: "clinicUpgradePathogenSequencer",
				tiers: [
					{
						value: 0,
						upgraded: 1,
						text: `It includes standard diagnostics equipment for common pathogens.`,
						link: `Install an automated sequencer connected to the Gene Lab to help identify disease-causing pathogens`,
						cost: 30000 * V.upgradeMultiplierArcology * Math.min(V.upgradeMultiplierMedicine, V.HackingSkillMultiplier),
						notes: [`helps prevent and fight illness in large slave populations`],
						prereqs: [
							V.geneticMappingUpgrade > 0
						]
					},
					{
						value: 1,
						text: `A rack of advanced rapid genetic sequencing equipment is connected to the Gene Lab and an extensive database of pathogen genes to help diagnose and fight disease outbreaks.`,
						nodes: !S.Nurse
							? [`However, without a nurse in attendance, the <span class="yellow">pathogen sequencer remains idle.</span>`]
							: null,
					}
				],
			},
			{
				property: "clinicUpgradePurge",
				tiers: [
					{
						value: 0,
						upgraded: 1,
						text: `Microscopic magnets have been added to better facilitate the leeching of impurities from cells.`,
						link: `Increase the effectiveness of the impurity purging`,
						cost: 150000 * V.upgradeMultiplierArcology * Math.min(V.upgradeMultiplierMedicine, V.HackingSkillMultiplier),
						handler: () => V.PC.skill.hacking += 0.1,
						notes: [`may cause health problems in slaves`],
						prereqs: [
							V.clinicUpgradeFilters > 0,
						],
					},
					{
						value: 1,
						upgraded: 2,
						text: `Microscopic magnets have been added to better facilitate the leeching of impurities from cells.`,
						link: `Further increase the effectiveness of the impurity purging by utilizing nano magnets`,
						cost: 300000 * V.upgradeMultiplierArcology * Math.min(V.upgradeMultiplierMedicine, V.HackingSkillMultiplier),
						handler: () => V.PC.skill.hacking += 0.1,
						notes: [`increases the effectiveness of ${V.clinicName}`],
					},
					{
						value: 2,
						text: `Microscopic magnets have been added to better facilitate the leeching of impurities from cells. The blood is intensely cleaned to greatly decrease the presence of impurities at the cost of compatibility. Patients will likely be ill for the duration of the treatment.`,
						nodes: !S.Nurse
							? [`However, without a nurse in attendance, the <span class="yellow">blood treatment equipment remains idle.</span>`]
							: null,
					},
				],
			},
		];
	}

	/** @returns {FC.Facilities.Rule[]} */
	get rules() {
		return [
			{
				property: "clinicInflateBelly",
				prereqs: [
					!!S.Nurse,
				],
				options: [
					{
						get text() { return `${capFirstChar(V.clinicName)} is useful for keeping slaves healthy during long term procedures. ${S.Nurse.slaveName} can supervise weekly filling regimens for clinic slaves with fillable belly implants during their stay to maximize growth with minimal health complications.`; },
						link: `Do not fill belly implants`,
						value: 0,
					},
					{
						get text() { return `${capFirstChar(V.clinicName)} is useful for keeping slaves healthy during long term procedures. Slaves in ${V.clinicName} with inflatable belly implants will be filled during their time under ${S.Nurse.slaveName}'s supervision to maximize growth with minimized health complications.`; },
						link: `Fill belly implants`,
						value: 1,
					},
				],
			},
			{
				property: "clinicObservePregnancy",
				prereqs: [],
				options: [
					{
						text: `Pregnant patients will not be kept under observation.`,
						link: `Stop observing pregnancies`,
						value: 0,
					},
					{
						text: `Patients undergoing a high-risk pregnancy or are close to giving birth will be kept under observation.`,
						link: `Keep high-risk pregnancies and slaves near due under observation`,
						value: 1,
					},
					{
						text: `Only patients undergoing a high-risk pregnancy will be kept under observation.`,
						link: `Keep high-risk pregnancies under observation`,
						value: 2,
					},
				],
			},
			{
				property: "clinicRegularCheckups",
				prereqs: [
					!!S.Nurse,
				],
				options: [
					{
						get text() { return `${S.Nurse.slaveName} will prioritize helping the patients in ${V.clinicName} over performing checkups on the rest of your slaves. Slaves in ${V.clinicName} will recover faster, but illnesses may start and spread rapidly in other facilities.`; },
						link: `Stop regular checkups`,
						value: 0,
					},
					{
						get text() { return `${S.Nurse.slaveName} will perform regular checkups on all your slaves in addition to treating the patients in ${V.clinicName}. This helps prevent new illnesses from gaining a foothold and spreading, but patients in ${V.clinicName} will recover more slowly.`; },
						link: `Perform regular checkups`,
						value: 1,
					},
				],
			},
			{
				property: "clinicSpeedGestation",
				prereqs: [
					!!S.Nurse,
				],
				options: [
					{
						get text() { return `${capFirstChar(V.clinicName)} is currently not applying rapid gestation agents to pregnant patients. Only individually selected slaves will undergo this procedure.`; },
						link: `Limit rapid gestation agents to selected slaves only`,
						value: 0,
					},
					{
						get text() { return `It's exceedingly dangerous to speed up gestation without constant supervision. In ${V.clinicName}, ${S.Nurse.slaveName} will monitor slaves on rapid gestation agents; making sure the growing patients' food demands are met, monitoring their skin and womb and, if need be, perform an emergency c-section should the need arise.`; },
						link: `Speed up gestation for all pregnant patients`,
						value: 1,
					}
				],
			},
		];
	}
};


code:
/** @type {FC.FacilityFramework} */
App.Data.Facilities.clinic = {
	baseName: "clinic",
	genericName: null,
	jobs: {
		patient: {
			position: "patient",
			assignment: Job.CLINIC,
			publicSexUse: false,
			fuckdollAccepted: false
		}
	},
	defaultJob: "patient",
	manager: {
		position: "nurse",
		assignment: Job.NURSE,
		careers: App.Data.Careers.Leader.nurse,
		skill: "nurse",
		publicSexUse: false,
		fuckdollAccepted: false,
		broodmotherAccepted: false,
		shouldWalk: true,
		shouldHold: true,
		shouldSee: true,
		shouldHear: true,
		shouldTalk: false,
		shouldThink: true,
		requiredDevotion: 51
	},
	decorated: true
};

App.Entity.Facilities.ClinicPatientJob = class extends App.Entity.Facilities.FacilitySingleJob {
	/**
	 * @param {App.Entity.SlaveState} slave
	 * @returns {string[]}
	 */
	checkRequirements(slave) {
		let r = super.checkRequirements(slave);

		if ((slave.health.illness === 0 && slave.health.shortDamage < 20 && slave.health.condition >= 40) &&
			(!S.Nurse || ((slave.chem <= 15 || this.facility.upgrade("Filters") !== 1) &&
				(V.bellyImplants !== 1 || slave.bellyImplant <= -1) &&
				(slave.pregKnown !== 1 || (this.facility.option("SpeedGestation") <= 0 && slave.pregControl !== "speed up")) &&
				(this.facility.option("ObservePregnancy") !== 1 || slave.pregAdaptation * 1000 >= slave.bellyPreg && slave.preg <= slave.pregData.normalBirth / 1.33)))) {
			r.push(`${slave.slaveName} cannot benefit from ${this.facility.name}.`);
		}

		return r;
	}
};

App.Entity.facilities.clinic = new App.Entity.Facilities.SingleJobFacility(
	App.Data.Facilities.clinic,
	{
		patient: new App.Entity.Facilities.ClinicPatientJob()
	}
);


code:
App.Facilities.DJSelect = function() {
	const f = document.createDocumentFragment();
	V.nextButton = "Back";
	V.nextLink = "Club";
	V.encyclopedia = "DJ";

	if (S.DJ) {
		f.append(`${SlaveFullName(S.DJ)} is working as your DJ, managing entertainment in ${V.clubName}. `);
		f.append(App.UI.DOM.link("Remove DJ", () => {
			removeJob(S.DJ, Job.DJ);
		},
		[], "Club"
		));
	} else {
		f.append(`No DJ assigned, appoint one from your devoted slaves.`);
	}

	f.append(App.UI.SlaveList.facilityManagerSelection(App.Entity.facilities.club, "Club"));
	return f;
};


code:
App.Facilities.Club.club = class Club extends App.Facilities.Facility {
	constructor() {
		const club = App.Entity.facilities.club;
		const decommissionHandler = () => {
			V.club = 0;
			V.clubDecoration = "standard";
			V.clubUpgradePDAs = 0;
			V.clubAdsSpending = 0;

			App.Arcology.cellUpgrade(V.building, App.Arcology.Cell.Shop, "Club", "Shops");
		};

		super(
			club,
			decommissionHandler,
		);

		V.nextButton = "Back to Main";
		V.nextLink = "Main";
		V.encyclopedia = "Club";
	}

	/** @returns {string} */
	get intro() {
		const text = [];

		text.push(this.facility.nameCaps, this.decorations);

		if (this.facility.hostedSlaves() > 2) {
			text.push(`${this.facility.nameCaps} is dotted with pretty, flirtatious slaves, stripping on stages, serving drinks, and dancing. They're very willing to suck patrons off in the open or give a public handjob, and there are little private rooms for them to use when engaging in heavier intercourse.`);
		} else if (this.facility.hostedSlaves() > 0) {
			text.push(`There are a few pretty, flirtatious slaves, stripping on stages, serving drinks, and dancing. They're very willing to suck patrons off in the open or give a public handjob, and there are little private rooms for them to use when engaging in heavier intercourse.`);
		} else if (S.DJ) {
			text.push(`${this.facility.nameCaps} is doing business normally, without a complement of sex slaves to spice things up. ${S.DJ.slaveName} is alone in ${V.clubName}, and can accomplish little by ${getPronouns(S.DJ).himself}.`);
		} else {
			text.push(`${this.facility.nameCaps} is doing business normally, without a complement of sex slaves to spice things up.`);
		}

		if (V.clubAdsSpending > 0) {
			text.push(`Screens outside the entrance are showing softcore music videos to advertise ${V.clubName}.`);

			if (V.clubAdsOld === 1) {
				text.push(`The featured strippers are all MILFs.`);
			} else if (V.clubAdsOld === -1) {
				text.push(`The featured strippers are all nice and young.`);
			} else if (V.clubAdsOld === -2) {
				text.push(`The featured strippers are all teenagers.`);
			} else if (V.clubAdsOld === -3) {
				text.push(`The featured strippers are all lolis.`);
			} else {
				text.push(`The featured strippers vary in age.`);
			}

			if (V.clubAdsStacked === 1) {
				text.push(`Lots of bouncing breasts and butts`);
			} else if (V.clubAdsStacked === -1) {
				text.push(`Lots of trim breasts and shapely butts`);
			} else {
				text.push(`A variety of breast and butt sizes and shapes`);
			}

			text.push(`are on display, and`);

			if (V.clubAdsImplanted === 1) {
				text.push(`most of these are augmented by implants.`);
			} else if (V.clubAdsImplanted === -1) {
				text.push(`they're all natural.`);
			} else {
				text.push(`some are augmented by implants.`);
			}

			if (V.seePreg) {
				if (V.clubAdsPreg === 1) {
					text.push(`Most of the strippers have firm, rounded bellies.`);
				} else if (V.clubAdsPreg === -1) {
					text.push(`Most of the strippers have firm, flat bellies.`);
				} else {
					text.push(`Some of the strippers are pregnant.`);
				}
			}

			if (V.clubAdsModded === 1) {
				text.push(`Everything is heavily pierced and tattooed.`);
			} else if (V.clubAdsModded === -1) {
				text.push(`Everything is free of tattoos and piercings.`);
			} else {
				text.push(`Some of these assets are tattooed and pierced, and some aren't.`);
			}

			text.push(`The strippers get naked quickly, and show off`);

			if (V.clubAdsXX === 1) {
				text.push(`their pussies and assholes.`);
			} else if (V.clubAdsXX === -1) {
				text.push(`their assholes.`);
			} else {
				text.push(`their holes.`);
			}

			text.push(`The ads are shown across the arcology.`);

			if (V.clubAdsXX === 1 && V.clubAdsImplanted === 1 && V.clubAdsStacked === 1) {
				text.push(`As a result, ${V.clubName} is known as the place to spend a night partying with ${V.clubAdsPreg === 1 ? `pregnant ` : ``}bimbos.`);
			} else if (V.clubAdsXX === 1 && V.clubAdsOld === 1) {
				text.push(`As a result, ${V.clubName} is known as the place to spend a night partying with ${V.clubAdsPreg === 1 ? `pregnant ` : ``}MILFs.`);
			} else if (V.clubAdsXX === 1 && V.clubAdsOld === -3) {
				text.push(`As a result, ${V.clubName} is known as the place to spend a night partying with ${V.clubAdsPreg === 1 ? `pregnant ` : ``}${V.clubAdsStacked === 1 ? `oppai ` : ``}lolis.`);
			} else if (V.clubAdsXX === 1 && V.clubAdsPreg === 1) {
				text.push(`As a result, ${V.clubName} is known as the place to spend a night partying with pregnant sluts.`);
			} else if (V.clubAdsXX === -1 && V.clubAdsStacked === 1) {
				text.push(`As a result, ${V.clubName} is known as the place to spend a night partying with shemales.`);
			} else if (V.clubAdsXX === -1 && V.clubAdsStacked === -1) {
				text.push(`As a result, ${V.clubName} is known as the place to spend a night partying with traps.`);
			}
		}

		if (this.facility.hostedSlaves() > 2) {
			switch (V.clubDecoration) {
				case "Chattel Religionist":
					text.push(`From one of the private rooms, praying interspersed with the slap of leather on flesh can be heard.`);
					break;
				case "Degradationist":
					text.push(`Agonized screaming can be heard from one of the private rooms.`);
					break;
				case "Repopulationist":
					text.push(`A wet slapping sound is coming from one of the private rooms, the kind of sound made by mammary intercourse with very milky breasts. Occasionally crying can be heard from one of the rooms specially designed for patrons wishing to assfuck a slave as she gives birth.`);
					break;
				case "Eugenics":
					text.push(`The slight sounds of whispering can be heard emanating from one of the restricted rooms.`);
					break;
				case "Asset Expansionist":
					text.push(`A wet slapping sound is coming from one of the private rooms, the kind of sound made by mammary intercourse with very large breasts.`);
					break;
				case "Transformation Fetishist":
					text.push(`A wet slapping sound is coming from one of the private rooms, the kind of sound made by mammary intercourse with very large fake breasts.`);
					break;
				case "Gender Radicalist":
					text.push(`Uncomfortable moaning from one of the private rooms suggests that a slave inside is taking a painfully large cock up their tight butt.`);
					break;
				case "Gender Fundamentalist":
					text.push(`The unmistakable sound of vigorous vaginal intercourse can be heard from one of the private rooms.`);
					break;
				case "Physical Idealist":
					text.push(`Bestial grunting can be heard from one of the private rooms.`);
					break;
				case "Supremacist":
				case "Subjugationist":
					text.push(`The sound of a beating, interspersed with desperate begging, can be heard from one of the private rooms.`);
					break;
				case "Paternalist":
					text.push(`The unmistakable sound of a slave experiencing an authentic orgasm can be heard from one of the private rooms.`);
					break;
				case "Body Purist":
					text.push(`The faint but unmistakable sound of a slave trying to keep quiet while orgasming can be heard from one of the private rooms.`);
					break;
				case "Slimness Enthusiast":
					text.push(`The faint but unmistakable sound of a shrill climax can be heard from one of the private rooms.`);
					break;
				case "Pastoralist":
					text.push(`A faint gushing sound is audible from one of the private rooms.`);
					break;
				case "Roman Revivalist":
					text.push(`A business meeting is just audible from one of the private rooms; only an occasional moan indicates that the businessmen are enjoying a couple of serving girls at the same time.`);
					break;
				case "Aztec Revivalist":
					text.push(`A muffled ${V.arcologies[0].FSPaternalist !== "unset" ? `moan` : `scream`}, followed by the sounds of liquid gently dripping on the stone floors denote the goings-on in the building.`);
					break;
				case "Egyptian Revivalist":
					text.push(`The smell of incense and the sounds of sex are drifting out of the private rooms.`);
					break;
				case "Edo Revivalist":
					text.push(`The faint but unmistakable sound of a slave trying to keep quiet while orgasming can be heard from one of the private rooms.`);
					break;
				case "Arabian Revivalist":
					text.push(`The faint sound of multiple slaves pleasuring a single patron can be heard from one of the private rooms.`);
					break;
				case "Chinese Revivalist":
					text.push(`The faint but unmistakable sound of a slave trying to keep quiet while orgasming can be heard from one of the private rooms.`);
					break;
				case "Maturity Preferentialist":
					text.push(`The faint sound of a well traveled slave showing off their experience can be heard from one of the private rooms.`);
					break;
				case "Youth Preferentialist":
					text.push(`The faint but unmistakable sound of a shrill climax can be heard from one of the private rooms.`);
					break;
				case "Hedonistic":
					text.push(`The sound of fat bodies fucking while feeding each other can be heard from one of the private rooms.`);
					break;
				case "Intellectual Dependency":
					text.push(`The sounds of an overstimulated bimbo can be heard from one of the private rooms.`);
					break;
				case "Slave Professionalism":
					text.push(`The sounds of an overstimulated patron can be heard from one of the private rooms.`);
					break;
				case "Petite Admiration":
					text.push(`The faint sound of a slave giving head can be heard from one of the private rooms.`);
					break;
				case "Statuesque Glorification":
					text.push(`The faint thumping of a patron banging a slave against the wall can be heard echoing from one of the private rooms.`);
					break;
				default:
					text.push(`The faint but unmistakable sound of a shrill climax can be heard from one of the private rooms.`);
					break;
			}
		}

		return text.join(' ');
	}

	/** @returns {string} */
	get decorations() {
		/** @type {FC.Facilities.Decoration} */
		const FS = {
			"Roman Revivalist": `is decorated like a Roman villa's entertainment rooms. There is a lot of white stone, plaster, and terracotta.`,
			"Neo-Imperialist": `is a genuine temple of Imperial decadence. The blaze of bright neon lights flash and strobe on a mass of sweaty bodies, sleek speakers blaring synthetic music as banners with your family's crest flutter above the serenity of mindless dance. The stoic stone figures of Imperial Knights watching the entrance provide a stark contrast to the Bacchian passion of the dancers.`,
			"Aztec Revivalist": `is decorated with obsidian figures inserted in the lime walls and giant oak pillars that give a homey feeling to the otherwise cold building.`,
			"Egyptian Revivalist": `is decorated like a room in an ancient Egyptian palace. There are columns of warm stone and pools of clear water full of aquatic plants.`,
			"Edo Revivalist": `is furnished as an Edo period theater. Performances of the traditional Japanese arts can be seen here, though more modern dancing happens in the evenings. In either case, geisha girls are present and willing.`,
			"Arabian Revivalist": `is designed like an open plaza in an Arabian palace, with a raised stage in the center for erotic dancing. Diaphanous, flowing curtains billow across the space, dispersing the narcotic smoke billowing from a score of hookahs.`,
			"Chinese Revivalist": `is furnished as an old Chinese disorderly house. It's intentionally packed in so that closeness and good cheer is obligatory here; prominent citizens share tables while their hangers-on jostle for room.`,
			"Chattel Religionist": `isn't a religious establishment, but it almost looks like one. It's clean and proper, with beams of natural light that come down to highlight holy sex slaves' bodies.`,
			"Degradationist": `has a perverted, debauched appearance. The décor is utilitarian so it can be cleaned easily, and the reason is obvious. Many patrons have brought their own slaves to publicly rape here.`,
			"Repopulationist": `has a gaudy appearance. There are lots of deep soft chairs for pregnant patrons and slaves to rest in and screens showing girls with large bellies lining the walls.`,
			"Eugenics": `has a gaudy appearance. There are screens lining the walls discouraging unprotected slave sex. The real action happens in the several exclusive rooms reserved for society's best.`,
			"Asset Expansionist": `has a gaudy appearance. There are a lot of neon lights and there are screens everywhere, showing off big tits and plush asses.`,
			"Transformation Fetishist": `has a gaudy appearance. There are a lot of neon lights and there are screens everywhere, showing off huge fake tits and plastic dick-sucking lips.`,
			"Gender Radicalist": `has a gaudy appearance. There are a lot of neon lights and there are screens everywhere, showing closeups of cocks fucking every imaginable orifice.`,
			"Gender Fundamentalist": `has an old world appearance, a decidedly throwback atmosphere harking back to the glory days of cultures past.`,
			"Physical Idealist": `isn't a gym, but it smells like one. The dancing is rough and competitive, and the drinks are rich with protein.`,
			"Supremacist": `is decorated like an upper-class gentleman's club in the old countries of ${V.arcologies[0].FSSupremacistRace} people.`,
			"Subjugationist": `is decorated like an upper-class gentleman's club in the old countries which favored ${V.arcologies[0].FSSubjugationistRace} slaves.`,
			"Paternalist": `is handsome and well-kept, even romantic. Though the slaves here are sex slaves, every provision is made to encourage them to enjoy themselves.`,
			"Pastoralist": `is decorated to resemble a frontier disorderly house. The drinks are pounded straight, and there's a set of swinging doors for bad men to part dramatically as they enter.`,
			"Maturity Preferentialist": `is surprisingly elegant. The music consists of refined remixes of traditional dance music, offering slaves and citizens the chance to dance beautifully together.`,
			"Youth Preferentialist": `is deafeningly loud. There's a bright light show running, offering staccato glimpses of the scene out on the dance floor.`,
			"Body Purist": `is gorgeous, decorated and kept in the height of fashionable night establishment style. The music is cutting edge and everything and everyone is elegant.`,
			"Slimness Enthusiast": `is distinctly gaudy, with lots of sugary drinks on offer. The music and décor are of a decidedly bubblegum quality.`,
			"Hedonistic": `has a gaudy appearance. The dance floor is extra large to accommodate its extra wide dancers, though bodies grinding against each other is an inevitability. Plenty of roomy, comfortable booths encircle the room for an exhausted citizen to relax with his plush dance partner, and a wide selection of greasy food accompanies the drinks. ${V.arcologies[0].FSHedonisticDecadenceResearch === 1 ? `Platters of food are complementary for feeding slaves` : `Feeders are available in the booths to feed tired slaves`} while they get fondled.`,
			"Intellectual Dependency": `is distinctly gaudy and easy for slaves to move around in. The dancing is as energetic and sexual, and the drinks sugary and sweet.`,
			"Slave Professionalism": `is decorated like an upper-class gentleman's club. It is where a true courtesan works their craft.`,
			"Petite Admiration": `has a gaudy appearance. The dance floor is surrounded by raised platforms so even the shortest slave can be seen by the crowd.`,
			"Statuesque Glorification": `has a tiered appearance. The booths and bar are positioned overlooking the dance floor so patrons may loom over the dancing slaves even when seated.`,
			"standard": `is set up in an uncomplicated way. There's a bar for drinks, a dance floor for slave girls, and private rooms for slave sex.`,
		};

		const res = FS[V.clubDecoration];

		if (!res) {
			throw new Error(`Unknown V.clubDecoration value of '${V.clubDecoration}' found in decorations().`);
		}

		return res;
	}

	/** @returns {FC.Facilities.Expand} */
	get expand() {
		return {
			desc: `There are rooms off ${V.clubName} to support slaves as they work as club sluts. They can support ${num(V.club)} slaves. There ${this.facility.hostedSlaves() === 1 ? `is currently ${num(this.facility.hostedSlaves())} slave` : `are currently ${num(this.facility.hostedSlaves())} slaves`} serving in ${V.clubName
			}.`,
			removeSlave: "serve the public",
		};
	}

	/** @returns {FC.IUpgrade[]} */
	get upgrades() {
		return [
			{
				property: "clubUpgradePDAs",
				tiers: [
					{
						value: 0,
						upgraded: 1,
						text: `The rooms are standard.`,
						link: `Upgrade them with PDAs to help your recruiter`,
						cost: 10000 * V.upgradeMultiplierArcology * V.HackingSkillMultiplier,
						handler: () => V.PC.skill.engineering += 0.1,
						notes: [`will increase upkeep costs`],
					},
					{
						value: 1,
						text: `${this.facility.nameCaps} has been wired for unobtrusive personal data assistants to let your sluts pass tips about enslavable people to your recruiter.`,
					},
				],
			},
		];
	}

	/** @returns {FC.Facilities.Rule[]} */
	get rules() {
		return [
			{
				property: "DJignoresFlaws",
				prereqs: [
					!!S.DJ,
				],
				options: [
					{
						get text() {
							return `${S.DJ.slaveName} will attempt to fix flaws in ${V.clubName}'s sluts.`;
						},
						link: `Fix flaws`,
						value: 0,
					},
					{
						get text() {
							return `${S.DJ.slaveName} has been instructed to ignore flaws in ${V.clubName}'s sluts.`;
						},
						link: `Ignore flaws`,
						value: 1,
					},
				],
			},
			{
				property: "DJnoSex",
				prereqs: [
					!!S.DJ,
				],
				options: [
					{
						get text() {
							const {he, him} = getPronouns(S.DJ);
							return `${S.DJ.slaveName} will slut it up when ${he} doesn't have enough sluts serving under ${him}.`;
						},
						link: `Serve clients`,
						value: 0,
					},
					{
						get text() {
							const {he, himself} = getPronouns(S.DJ);
							return `${S.DJ.slaveName} will not be slutting it up ${himself} even if ${he} has time.`;
						},
						link: `Don't serve clients`,
						value: 1,
					},
				],
			},
		];
	}

	/** @returns {HTMLDivElement} */
	get stats() {
		return App.UI.DOM.makeElement("div", App.Facilities.Club.Stats(true));
	}

	get ads() {
		const div = document.createElement("div");

		if (V.clubAdsSpending > 0) {
			div.append(`${this.facility.nameCaps} is the subject of an active ad campaign.`);
		} else {
			div.append(`${this.facility.nameCaps} is not being advertised.`);
		}

		App.UI.DOM.appendNewElement("div", div, App.UI.DOM.passageLink(`Manage club advertisements`, "Club Advertisement", () => {
			V.nextLink = passage();
			V.nextButton = "Back";
		}), ["indent"]);

		return div;
	}
};


code:
App.Facilities.Club.ads = function() {
	const node = new DocumentFragment();
	let r = [];

	const clubNameCaps = capFirstChar(V.clubName);
	switch (V.clubDecoration) {
		case "Roman Revivalist":
			r.push(`${clubNameCaps} is decorated like a Roman villa's entertainment rooms. There is a lot of white stone, plaster, and terracotta.`);
			break;
		case "Neo-Imperialist":
			r.push(`${clubNameCaps} is a genuine temple of Imperial decadence. The blaze of bright neon lights flash and strobe on a mass of sweaty bodies, sleek speakers blaring synthetic music as banners with your family's crest flutter above the serenity of mindless dance. The stoic stone figures of Imperial Knights watching the entrance provide a stark contrast to the Bacchian passion of the dancers.`);
			break;
		case "Aztec Revivalist":
			r.push(`${clubNameCaps} is decorated with obsidian figures inserted in the lime walls and giant oak pillars that give a homey feeling to the otherwise cold building.`);
			break;
		case "Egyptian Revivalist":
			r.push(`${clubNameCaps} is decorated like a room in an ancient Egyptian palace. There are columns of warm stone and pools of clear water full of aquatic plants.`);
			break;
		case "Edo Revivalist":
			r.push(`${clubNameCaps} is furnished as an Edo period theater. Performances of the traditional Japanese arts can be seen here, though more modern dancing happens in the evenings. In either case, geisha girls are present and willing.`);
			break;
		case "Arabian Revivalist":
			r.push(`${clubNameCaps} is designed like an open plaza in an Arabian palace, with a raised stage in the center for erotic dancing. Diaphanous, flowing curtains billow across the space, dispersing the narcotic smoke billowing from a score of hookahs.`);
			break;
		case "Chinese Revivalist":
			r.push(`${clubNameCaps} is furnished as an old Chinese disorderly house. It's intentionally packed in so that closeness and good cheer is obligatory here; prominent citizens share tables while their hangers-on jostle for room.`);
			break;
		case "Chattel Religionist":
			r.push(`${clubNameCaps} isn't a religious establishment, but it almost looks like one. It's clean and proper, with beams of natural light that come down to highlight holy sex slaves' bodies.`);
			break;
		case "Degradationist":
			r.push(`${clubNameCaps} has a perverted, debauched appearance. The décor is utilitarian so it can be cleaned easily, and the reason is obvious. Many patrons have brought their own slaves to publicly rape here.`);
			break;
		case "Repopulationist":
			r.push(`${clubNameCaps} has a gaudy appearance. There are lots of deep soft chairs for pregnant patrons and slaves to rest in and screens showing girls with large bellies lining the walls.`);
			break;
		case "Eugenics":
			r.push(`${clubNameCaps} has a gaudy appearance. There are screens lining the walls discouraging unprotected slave sex. The real action happens in the several exclusive rooms reserved for society's best.`);
			break;
		case "Asset Expansionist":
			r.push(`${clubNameCaps} has a gaudy appearance. There are a lot of neon lights and there are screens everywhere, showing off big tits and plush asses.`);
			break;
		case "Transformation Fetishist":
			r.push(`${clubNameCaps} has a gaudy appearance. There are a lot of neon lights and there are screens everywhere, showing off huge fake tits and plastic dick-sucking lips.`);
			break;
		case "Gender Radicalist":
			r.push(`${clubNameCaps} has a gaudy appearance. There are a lot of neon lights and there are screens everywhere, showing closeups of cocks fucking every imaginable orifice.`);
			break;
		case "Gender Fundamentalist":
			r.push(`${clubNameCaps} has an old world appearance, a decidedly throwback atmosphere harking back to the glory days of cultures past.`);
			break;
		case "Physical Idealist":
			r.push(`${clubNameCaps} isn't a gym, but it smells like one. The dancing is rough and competitive, and the drinks are rich with protein.`);
			break;
		case "Supremacist":
			r.push(`${clubNameCaps} is decorated like an upper-class gentleman's club in the old countries of ${V.arcologies[0].FSSupremacistRace} people.`);
			break;
		case "Subjugationist":
			r.push(`${clubNameCaps} is decorated like an upper-class gentleman's club in the old countries which favored ${V.arcologies[0].FSSubjugationistRace} slaves.`);
			break;
		case "Paternalist":
			r.push(`${clubNameCaps} is handsome and well-kept, even romantic. Though the slaves here are sex slaves, every provision is made to encourage them to enjoy themselves.`);
			break;
		case "Body Purist":
			r.push(`${clubNameCaps} is gorgeous, decorated and kept in the height of fashionable night establishment style. The music is cutting edge and everything and everyone is elegant.`);
			break;
		case "Slimness Enthusiast":
			r.push(`${clubNameCaps} is distinctly gaudy, with lots of sugary drinks on offer. The music and décor are of a decidedly bubblegum quality.`);
			break;
		case "Pastoralist":
			r.push(`${clubNameCaps} is decorated to resemble a frontier disorderly house. The drinks are pounded straight, and there's a set of swinging doors for bad men to part dramatically as they enter.`);
			break;
		case "Maturity Preferentialist":
			r.push(`${clubNameCaps} is surprisingly elegant. The music consists of refined remixes of traditional dance music, offering slaves and citizens the chance to dance beautifully together.`);
			break;
		case "Youth Preferentialist":
			r.push(`${clubNameCaps} is deafeningly loud. There's a bright light show running, offering staccato glimpses of the scene out on the dance floor.`);
			break;
		case "Hedonistic":
			r.push(`${clubNameCaps} has a gaudy appearance. The dance floor is extra large to accommodate its extra wide dancers, though bodies grinding against each other is an inevitability. Plenty of roomy, comfortable booths encircle the room for an exhausted citizen to relax with his plush dance partner, and a wide selection of greasy food accompanies the drinks.`);
			if (V.arcologies[0].FSHedonisticDecadenceResearch === 1) {
				r.push(`Platters of food are complementary for feeding slaves`);
			} else {
				r.push(`Feeders are available in the booths to feed tired slaves`);
			}
			r.push(`while they get fondled.`);
			break;
		case "Intellectual Dependency":
			r.push(`${clubNameCaps} is distinctly gaudy and easy for slaves to move around in. The dancing is as energetic and sexual, and the drinks sugary and sweet.`);
			break;
		case "Slave Professionalism":
			r.push(`${clubNameCaps} is decorated like an upper-class gentleman's club. It is where a true courtesan works their craft.`);
			break;
		case "Petite Admiration":
			r.push(`${clubNameCaps} has a gaudy appearance. The dance floor is surrounded by raised platforms so even the shortest slave can be seen by the crowd.`);
			break;
		case "Statuesque Glorification":
			r.push(`${clubNameCaps} has a tiered appearance. The booths and bar are positioned overlooking the dance floor so patrons may loom over the dancing slaves even when seated.`);
	}

	if (V.clubAdsSpending > 0) {
		r.push(`Screens outside the entrance are showing softcore music videos to advertise ${V.clubName}.`);
		if (V.clubAdsOld === 1) {
			r.push(`The featured strippers are all MILFs.`);
		} else if (V.clubAdsOld === -1) {
			r.push(`The featured strippers are all nice and young.`);
		} else if (V.clubAdsOld === -2) {
			r.push(`The featured strippers are all teenagers.`);
		} else if (V.clubAdsOld === -3) {
			r.push(`The featured strippers are all lolis.`);
		} else {
			r.push(`The featured strippers vary in age.`);
		}
		if (V.clubAdsStacked === 1) {
			r.push(`Lots of bouncing breasts and butts`);
		} else if (V.clubAdsStacked === -1) {
			r.push(`Lots of trim breasts and shapely butts`);
		} else {
			r.push(`A variety of breast and butt sizes and shapes`);
		}
		r.push(`are on display, and`);
		if (V.clubAdsImplanted === 1) {
			r.push(`most of these are augmented by implants.`);
		} else if (V.clubAdsImplanted === -1) {
			r.push(`they're all natural.`);
		} else {
			r.push(`some are augmented by implants.`);
		}
		if (V.seePreg === 1) {
			if (V.clubAdsPreg === 1) {
				r.push(`Most of the strippers have firm, rounded bellies.`);
			} else if (V.clubAdsPreg === -1) {
				r.push(`Most of the strippers have firm, flat bellies.`);
			} else {
				r.push(`Some of the strippers are pregnant.`);
			}
		}
		if (V.clubAdsModded === 1) {
			r.push(`Everything is heavily pierced and tattooed.`);
		} else if (V.clubAdsModded === -1) {
			r.push(`Everything is free of tattoos and piercings.`);
		} else {
			r.push(`Some of these assets are tattooed and pierced, and some aren't.`);
		}
		r.push(`The strippers get naked quickly, and show off`);
		if (V.clubAdsXX === 1) {
			r.push(`their pussies and assholes.`);
		} else if (V.clubAdsXX === -1) {
			r.push(`their assholes.`);
		} else {
			r.push(`their holes.`);
		}
	}

	if (V.clubAdsSpending >= 5000) {
		r.push(`Advertisements based on these scenes run constantly in media across ${V.arcologies[0].name}, and there's an active merchandising campaign underway to promote your club and its girls.`);
	} else if (V.clubAdsSpending >= 4000) {
		r.push(`Advertisements based on these scenes run constantly in media across ${V.arcologies[0].name}.`);
	} else if (V.clubAdsSpending >= 3000) {
		r.push(`Advertisements based on these scenes are run in media across ${V.arcologies[0].name}.`);
	} else if (V.clubAdsSpending >= 2000) {
		r.push(`Advertisements based on these scenes run regularly in arcology media.`);
	} else if (V.clubAdsSpending >= 1000) {
		r.push(`Advertisements based on these scenes run occasionally in arcology media.`);
	} else {
		r.push(`${V.arcologies[0].name} has a robust internal media that could be used to bring patrons into the club.`);
	}
	App.Events.addNode(node, r, "p", "scene-intro");

	App.Events.addNode(node, [`You are spending ${cashFormatColor(V.clubAdsSpending, true)} each week to advertise ${V.clubName}.`]);

	const linkArray = [];
	if (V.clubAdsSpending >= 1000) {
		linkArray.push(App.UI.DOM.link(`Decrease`, () => {
			V.clubAdsSpending -= 1000;
			App.UI.reload();
		}));
	} else {
		linkArray.push(App.UI.DOM.disabledLink(`Decrease`, [`Minimum reached`]));
	}
	if (V.clubAdsSpending < 5000) {
		linkArray.push(App.UI.DOM.link(`Increase`, () => {
			V.clubAdsSpending += 1000;
			App.UI.reload();
		}));
	} else {
		linkArray.push(App.UI.DOM.disabledLink(`Increase`, [`Maximum reached`]));
	}

	App.UI.DOM.appendNewElement("div", node, App.UI.DOM.generateLinksStrip(linkArray), ['indent']);

	App.UI.DOM.appendNewElement("h2", node, `Design ${clubNameCaps} Ad Campaign`);

	App.UI.DOM.appendNewElement("div", node, `Will replace relevant variety bonuses`, "note");
	node.append(App.Ads.report("club", true));

	return node;
};