code:
:: Brothel Assignment Scene

<<nobr>>

<<set $nextButton to "Continue">>
<<set $nextLink to $returnTo>>

You could direct $assistantName to relay your orders to $activeSlave.slaveName, but you've decided to avoid relying too much on machine assistance. So, she is merely directed to report to your office. The
<<if $activeSlave.devotion > 95>>
	worshipful girl <<if $activeSlave.amp != 1>>hurries in as soon as she possibly can<<else>>comes in as soon as she can get another slave to carry her in<</if>>, happy her beloved <<if $PC.title == 1>>Master<<else>>Mistress<</if>> is taking an interest in her.
<<elseif $activeSlave.devotion > 50>>
	devoted girl <<if $activeSlave.amp != 1>>hurries in promptly<<else>>comes in as soon as she can get another slave to carry her in<</if>>, eager to do whatever you demand of her.
<<elseif $activeSlave.devotion > 20>>
	girl, broken to your will, <<if $activeSlave.amp != 1>>comes in promptly<<else>>comes in as soon as she can get another slave to carry her in<</if>>, clearly ready to follow orders.
<<elseif ($activeSlave.trust < -20) && ($activeSlave.devotion > -10)>>
	fearful slave <<if $activeSlave.amp != 1>>comes in promptly<<else>>comes in as soon as she can get another slave to carry her in<</if>>, afraid of what will happen to her if she doesn't.
<<elseif ($activeSlave.trust < -50)>>
	terrified slave <<if $activeSlave.amp != 1>>comes in hurriedly<<else>>comes in as soon as she can get another slave to carry her in<</if>>, almost paralyzed by terror of what will happen to her if she doesn't.
<<else>>
	rebellious slave <<if $activeSlave.amp != 1>>comes in slowly, having decided that she can always decide to resist once she hears what you want<<else>>comes in as soon as you order another slave to carry her in, since she can't exactly resist this without limbs<</if>>.
<</if>>
You tell her she's to report to <<if $Madam != 0>>$Madam.slaveName immediately, to serve in the $brothelName<<else>>the $brothelName immediately, to serve there<</if>> until further notice.

<<if $activeSlave.devotion > 50>>

<<if ($activeSlave.fetishKnown == 1) && ($activeSlave.fetishStrength > 60) && ($activeSlave.fetish != "none")>>
	She looks excited. "<<if SlaveStatsChecker.checkForLisp($activeSlave)>><<if def $PC.customTitleLisp>>$PC.customTitleLisp<<elseif $PC.title != 0>>Mathter<<else>>Mithtreth<</if>><<else>><<if def $PC.customTitle>>$PC.customTitle<<elseif $PC.title != 0>>Master<<else>>Mistress<</if>><</if>>, I hoped you would <<if SlaveStatsChecker.checkForLisp($activeSlave)>>thend<<else>>send<</if>> me down there <<if SlaveStatsChecker.checkForLisp($activeSlave)>>thometime<<else>>sometime!<</if>>
	<<if ($activeSlave.fetish is "submissive")>>
		I mean, I'll have to do whatever the customer<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> pay for, right?" Her eyes go a little unfocused. "And, they'll hold me down..." She trails off.
	<<elseif ($activeSlave.fetish is "masochist")>>
		I mean, it'<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> hard being a brothel whore, right? And when I get tired or <<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>ore, I'll <<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>till be <<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>old. Even when it hurt<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> me to fuck any more." Her eyes glow with an unhealthy light.
	<<elseif ($activeSlave.fetish is "cumslut")>>
		I mean," she licks her lips unconsciously,
		<<if $activeSlave.attrXX > $activeSlave.attrXY>>
			"I hear there are <<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>ome nice ladie<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> that go there for lunchtime cunnilingu<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>."
		<<else>>
			"the blowjob<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>. Ju<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>t, the blowjob<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>. That'<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> all."
		<</if>>
	<<elseif ($activeSlave.fetish is "humiliation")>>
		There'<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> a window that face<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> the hallway there, right? <<if $Madam != 0>>Do you think $Madam.slaveName would let me<<else>>Could I<</if>> get fucked there? Where everyone could <<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>ee me being fucked for money?"
	<<elseif ($activeSlave.fetish is "buttslut")>>
		I mean," and she shifts her weight, her mind obviously on her backdoor,
		<<if $activeSlave.attrXX > $activeSlave.attrXY>>
			"there have to be ladie<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> who want to buttfuck a whore, right? At lea<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>t, I really hope there are."
		<<else>>
			"the other girl<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> tell me that whore<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> there get fucked up the a<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>ss<</if>> all day and all night. <<if SlaveStatsChecker.checkForLisp($activeSlave)>>Th<<else>>S<</if>>ounds like fun to me."
		<</if>>
	<<elseif ($activeSlave.fetish is "boobs")>>
		I mean," and she sticks out her chest a little,
		<<if $activeSlave.attrXX > $activeSlave.attrXY>>
			"I hear from the other girl<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> there'<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> thi<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> nice lady who goes there every morning and pay<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> to have a whore <<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>uck her nipple<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> for, like, an hour. I," she licks her lips, "could do that."
		<<else>>
			"the other girl<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> tell me that whore<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> there get tittyfucked all the time. <<if SlaveStatsChecker.checkForLisp($activeSlave)>>Th<<else>>S<</if>>ounds like fun to me."
		<</if>>
	<<elseif ($activeSlave.fetish is "pregnancy")>>
		I mean," she says meditatively,
		<<if $activeSlave.attrXX > $activeSlave.attrXY>>
			"I hear from the other girl<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> there'<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> thi<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> pregnant lady who goes there every night and pay<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> to have a whore cuddle her. Ju<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>t cuddle, all night. That would be kind of hard, ju<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>t cuddling, but I could do it."
		<<elseif $activeSlave.vagina is -1>>
			"<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>ince it'<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> all bareback, I'm going to have a fuckton of cum in me. I wonder how much cum it take<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> to get a butthole pregnant? I'm gonna try, anyway."
		<<elseif isFertile($activeSlave)>>
			"<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>ince it'<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> 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?"
		<<elseif $activeSlave.preg > 0>>
			"I'm going to be a pregnant whore. That'<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> pretty fucking <<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>exy."
		<<else>>
			"I'm can't wait till I can get pregnant. That'd be pretty fucking <<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>exy."
		<</if>>
	<<elseif ($activeSlave.fetish is "dom")>>
		I heard from the other girl<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> that <<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>ome citizen<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> bring their girl<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> there. Ju<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>t to make them take it from a whore."
	<<elseif ($activeSlave.fetish is "sadist")>>
		I heard from the other girl<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> that <<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>ome citizen<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> bring their girl<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> there. Because nobody know<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> how to hurt a bitch like a whore doe<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>." She shivers.
	<</if>>
<<else>>
	She looks determined. "<<if SlaveStatsChecker.checkForLisp($activeSlave)>><<if def $PC.customTitleLisp>>$PC.customTitleLisp<<elseif $PC.title != 0>>Mathter<<else>>Mithtreth<</if>><<else>><<if def $PC.customTitle>>$PC.customTitle<<elseif $PC.title != 0>>Master<<else>>Mistress<</if>><</if>>, I will do my be<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>t to be a good whore, and get lot<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> of citizen<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> to pay good money for my body."
<</if>>

<<elseif ($activeSlave.devotion > 20) || (($activeSlave.devotion >= -20) && ($activeSlave.trust < -20) && ($activeSlave.trust >= -50))>>

<<if ($activeSlave.fetishKnown == 1) && ($activeSlave.fetishStrength > 60) && ($activeSlave.fetishStrength > 60) && ($activeSlave.fetish != "none")>>
	She looks cautiously excited. "<<if SlaveStatsChecker.checkForLisp($activeSlave)>><<if def $PC.customTitleLisp>>$PC.customTitleLisp<<elseif $PC.title != 0>>Mathter<<else>>Mithtreth<</if>><<else>><<if def $PC.customTitle>>$PC.customTitle<<elseif $PC.title != 0>>Master<<else>>Mistress<</if>><</if>>,
	<<if ($activeSlave.fetish is "submissive")>>
		I'll have to do whatever the customer<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> pay for, right?" Her eyes go a little unfocused. "And, they'll hold me down..." She trails off.
	<<elseif ($activeSlave.fetish is "masochist")>>
		it'<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> hard being a brothel whore, right? And when I get tired or <<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>ore, I'll <<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>till be <<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>old. Even when it hurt<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> me to fuck any more." Her eyes glow with an unhealthy light.
	<<elseif ($activeSlave.fetish is "cumslut")>>
		<<if $activeSlave.attrXX > $activeSlave.attrXY>>
			"I hear there are <<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>ome nice ladie<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> that go there for lunchtime cunnilingu<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>."
		<<else>>
			"the blowjob<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>. Ju<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>t, the blowjob<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>. That'<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> all."
		<</if>>
	<<elseif ($activeSlave.fetish is "humiliation")>>
		there'<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> a window that face<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> the hallway there, right? <<if $Madam != 0>>Do you think $Madam.slaveName would let me<<else>>Could I<</if>> get fucked there? Where everyone could <<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>ee me being fucked for money?"
	<<elseif ($activeSlave.fetish is "buttslut")>>
		uh," and she shifts her weight, her mind obviously on her backdoor,
		<<if $activeSlave.attrXX > $activeSlave.attrXY>>
			"there have to be ladie<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> who want to buttfuck a whore, right? At lea<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>t, I really hope there are."
		<<else>>
			"the other girl<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> tell me that whore<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> there get fucked up the a<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>ss<</if>> all day and all night. <<if SlaveStatsChecker.checkForLisp($activeSlave)>>Th<<else>>S<</if>>ounds like fun to me."
		<</if>>
	<<elseif ($activeSlave.fetish is "boobs")>>
		er," and she sticks out her chest a little,
		<<if $activeSlave.attrXX > $activeSlave.attrXY>>
			"I hear from the other girl<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> there'<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> thi<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> nice lady who goes there every morning and pay<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> to have a whore <<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>uck her nipple<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> for, like, an hour. I," she licks her lips, "could do that."
		<<else>>
			"the other girl<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> tell me that whore<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> there get tittyfucked all the time. <<if SlaveStatsChecker.checkForLisp($activeSlave)>>Th<<else>>S<</if>>ounds like fun to me."
		<</if>>
	<<elseif ($activeSlave.fetish is "pregnancy")>>
		<<if $activeSlave.attrXX > $activeSlave.attrXY>>
			I hear from the other girl<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> there'<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> thi<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> pregnant lady who goes there every night and pay<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> to have a whore cuddle her. Ju<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>t cuddle, all night. That would be kind of hard, ju<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>t cuddling, but I could do it."
		<<elseif $activeSlave.vagina is -1>>
			<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>ince it'<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> all bareback, I'm going to have a fuckton of cum in me. I wonder how much cum it take<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> to get a butthole pregnant? I'm gonna try, anyway."
		<<elseif isFertile($activeSlave)>>
			<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>ince it'<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> 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?"
		<<elseif $activeSlave.preg > 0>>
			I'm going to be a pregnant whore. That'<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> pretty fucking <<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>exy."
		<<else>>
			"I'm can't wait till I can get pregnant. That'd be pretty fucking <<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>exy."
		<</if>>
	<<elseif ($activeSlave.fetish is "dom")>>
		I heard from the other girl<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> that <<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>ome citizen<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> bring their girl<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> there. Ju<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>t to make them take it from a whore."
	<<elseif ($activeSlave.fetish is "sadist")>>
		I heard from the other girl<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> that <<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>ome citizen<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> bring their girl<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> there. Because nobody know<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> how to hurt a bitch like a whore doe<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>." She shivers.
	<</if>>
<<elseif $activeSlave.sexualFlaw != "none">>
	"Yes, <<if SlaveStatsChecker.checkForLisp($activeSlave)>><<if def $PC.customTitleLisp>>$PC.customTitleLisp<<elseif $PC.title != 0>>Mathter<<else>>Mithtreth<</if>><<else>><<if def $PC.customTitle>>$PC.customTitle<<elseif $PC.title != 0>>Master<<else>>Mistress<</if>><</if>>," she says obediently. She hesitates, looking concerned.
	<<if ($activeSlave.sexualFlaw is "hates oral")>>
		"I - I'm going to h-have to <<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>uck a lot of dick there, aren't I." She swallows nervously. Her lower lip quivers, and she does her best not to cry in front of you.
	<<elseif ($activeSlave.sexualFlaw is "hates anal")>>
		"<<if SlaveStatsChecker.checkForLisp($activeSlave)>>C-cuthtomerth<<else>>C-customers<</if>> are really going to ream me up the butt hole, aren't they." She <<if $activeSlave.amp == 1>>shifts uncomfortably, unconsciously trying to shield her rear as best she can manage without limbs.<<else>>unconsciously reaches around behind herself, not quite shielding her anus with her hands.<</if>> Her lower lip quivers, and she does her best not to cry in front of you.
	<<elseif ($activeSlave.sexualFlaw is "hates penetration")>>
		"<<if SlaveStatsChecker.checkForLisp($activeSlave)>>C-cuthtomerth<<else>>C-customers<</if>> are really going to fuck me <<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>ore, aren't they." She <<if $activeSlave.amp == 1>>shifts uncomfortably, unconsciously trying to shield her rear as best she can manage without limbs.<<elseif $activeSlave.vagina > 0>>unconsciously lets her hands fall to her crotch, but catches herself and doesn't quite shield her pussy.<<else>>unconsciously reaches around behind herself, not quite shielding her anus with her hands.<</if>> Her lower lip quivers, and she does her best not to cry in front of you.
	<<elseif ($activeSlave.sexualFlaw is "repressed")>>
		"Being a whore is a <<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>in," she says quietly, half to herself. "I'm going t-to b-be <<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>o dirty. I'm going to h-hell." She starts to cry quietly. "<<if SlaveStatsChecker.checkForLisp($activeSlave)>>Th-th<<else>>S-s<</if>>orry, <<if SlaveStatsChecker.checkForLisp($activeSlave)>><<if def $PC.customTitleLisp>>$PC.customTitleLisp<<elseif $PC.title != 0>>Mathter<<else>>Mithtreth<</if>><<else>><<if def $PC.customTitle>>$PC.customTitle<<elseif $PC.title != 0>>Master<<else>>Mistress<</if>><</if>>. I'll do my be<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>t."
	<<elseif ($activeSlave.sexualFlaw is "idealistic")>>
		"I'm going to be <<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>old for <<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>ex," she says quietly, half to herself. "Men are going to pay, and then they're g-going to <<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>tick their dick<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> in me, and then they're going to leave." She starts to cry quietly. "<<if SlaveStatsChecker.checkForLisp($activeSlave)>>Th-th<<else>>S-s<</if>>orry, <<if SlaveStatsChecker.checkForLisp($activeSlave)>><<if def $PC.customTitleLisp>>$PC.customTitleLisp<<elseif $PC.title != 0>>Mathter<<else>>Mithtreth<</if>><<else>><<if def $PC.customTitle>>$PC.customTitle<<elseif $PC.title != 0>>Master<<else>>Mistress<</if>><</if>>. I'll do my be<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>t."
	<<elseif ($activeSlave.sexualFlaw is "shamefast")>>
		"I'm going to be meat in a brothel," she says quietly, half to herself. "I'm going to <<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>tand there naked with the other girl<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>, and men will pick me and then u<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>e my body. Over and over." She starts to cry quietly. "<<if SlaveStatsChecker.checkForLisp($activeSlave)>>Th-th<<else>>S-s<</if>>orry, <<if SlaveStatsChecker.checkForLisp($activeSlave)>><<if def $PC.customTitleLisp>>$PC.customTitleLisp<<elseif $PC.title != 0>>Mathter<<else>>Mithtreth<</if>><<else>><<if def $PC.customTitle>>$PC.customTitle<<elseif $PC.title != 0>>Master<<else>>Mistress<</if>><</if>>. I'll do my be<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>t."
	<<elseif ($activeSlave.sexualFlaw is "apathetic")>>
		"I gue<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>ss<</if>> I'll lie there," she sighs quietly, half to herself. "A man will pay and then he'll come in to my room where I'm lying on the bed, and he'll <<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>tick his cock in me and cum and leave. And then the next man will come in." She starts to cry quietly. "<<if SlaveStatsChecker.checkForLisp($activeSlave)>>Th-th<<else>>S-s<</if>>orry, <<if SlaveStatsChecker.checkForLisp($activeSlave)>><<if def $PC.customTitleLisp>>$PC.customTitleLisp<<elseif $PC.title != 0>>Mathter<<else>>Mithtreth<</if>><<else>><<if def $PC.customTitle>>$PC.customTitle<<elseif $PC.title != 0>>Master<<else>>Mistress<</if>><</if>>. I'll do my be<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>t."
	<<elseif ($activeSlave.sexualFlaw is "crude")>>
		"Okay," she says, thinking. "My poor cornhole is going to be <<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>uch a <<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>eminal <<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>ewer." She looks doubtful. "Should I not have <<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>aid that, <<if SlaveStatsChecker.checkForLisp($activeSlave)>><<if def $PC.customTitleLisp>>$PC.customTitleLisp<<elseif $PC.title != 0>>Mathter<<else>>Mithtreth<</if>><<else>><<if def $PC.customTitle>>$PC.customTitle<<elseif $PC.title != 0>>Master<<else>>Mistress<</if>><</if>>?"
	<<elseif ($activeSlave.sexualFlaw is "judgemental")>>
		"Gro<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>ss<</if>>," she says curtly. "Well, no more hand<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>ome boy<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> for me, then. Fat pathetic guy<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> who patronize whore<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>, all the way down. Fuck."
	<</if>>
<<else>>
	She tries to be brave. "<<if SlaveStatsChecker.checkForLisp($activeSlave)>><<if def $PC.customTitleLisp>>$PC.customTitleLisp<<elseif $PC.title != 0>>Mathter<<else>>Mithtreth<</if>><<else>><<if def $PC.customTitle>>$PC.customTitle<<elseif $PC.title != 0>>Master<<else>>Mistress<</if>><</if>>, I will do my be<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>t to be a good whore." Then, half to herself, she adds in a small voice, "I can do thi<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>."
<</if>>

<<elseif ($activeSlave.trust < -20)>>

<<if $activeSlave.sexualFlaw != "none">>
	"Yes, <<if SlaveStatsChecker.checkForLisp($activeSlave)>><<if def $PC.customTitleLisp>>$PC.customTitleLisp<<elseif $PC.title != 0>>Mathter<<else>>Mithtreth<</if>><<else>><<if def $PC.customTitle>>$PC.customTitle<<elseif $PC.title != 0>>Master<<else>>Mistress<</if>><</if>>," she says automatically. She's badly frightened, and says in a small voice, half to herself,
	<<if ($activeSlave.sexualFlaw is "hates oral")>>
		"I - I'm going to h-have to <<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>uck a lot of dick, aren't I." She swallows and tries to control herself out of fear, but finally gasps out, "Oh God, I'm <<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>cared," and bursts into tears.
	<<elseif ($activeSlave.sexualFlaw is "hates anal")>>
		"<<if SlaveStatsChecker.checkForLisp($activeSlave)>>C-cuthtomerth<<else>>C-customers<</if>> are really going to ream me up the butt hole, aren't they." She <<if $activeSlave.amp == 1>>shifts uncomfortably, unconsciously trying to shield her rear as best she can manage without limbs.<<else>>unconsciously reaches around behind herself, not quite shielding her anus with her hands.<</if>> Her lower lip quivers and she tries to control herself out of fear, but finally gasps out, "Oh God, I'm <<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>cared," and bursts into tears.
	<<elseif ($activeSlave.sexualFlaw is "hates penetration")>>
		"<<if SlaveStatsChecker.checkForLisp($activeSlave)>>C-cuthtomerth<<else>>C-customers<</if>> are really going to fuck me <<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>ore, aren't they." She <<if $activeSlave.amp == 1>>shifts uncomfortably, unconsciously trying to shield her rear as best she can manage without limbs.<<elseif $activeSlave.vagina > 0>>unconsciously lets her hands fall to her crotch, but catches herself and doesn't quite shield her pussy.<<else>>unconsciously reaches around behind herself, not quite shielding her anus with her hands.<</if>> Her lower lip quivers, and she tries to control herself out of fear, but finally gasps out, "Oh God, I'm <<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>cared," and bursts into tears.
	<<elseif ($activeSlave.sexualFlaw is "repressed")>>
		"Being a whore is a <<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>in," she says quietly, half to herself. "I'm going t-to b-be <<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>o dirty. I'm going to h-hell." She starts to cry quietly. She tries to get herself back under control, out of fear, but finally wails, "Oh God, I'm <<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>orry, p-plea<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>e forgive me God," and dissolves into sobbing.
	<<elseif ($activeSlave.sexualFlaw is "idealistic")>>
		"I'm going to be <<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>old for <<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>ex," she says quietly, half to herself. "Men are going to pay, and then they're g-going to <<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>tick their dick<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> in me, and then they're going to leave." She starts to cry openly. "<<if SlaveStatsChecker.checkForLisp($activeSlave)>>Th-th<<else>>S-s<</if>>orry, <<if SlaveStatsChecker.checkForLisp($activeSlave)>><<if def $PC.customTitleLisp>>$PC.customTitleLisp<<elseif $PC.title != 0>>Mathter<<else>>Mithtreth<</if>><<else>><<if def $PC.customTitle>>$PC.customTitle<<elseif $PC.title != 0>>Master<<else>>Mistress<</if>><</if>>. P-plea<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>se don't beat me. I'll do it."
	<<elseif ($activeSlave.sexualFlaw is "shamefast")>>
		"I'm going to be meat in a brothel," she says quietly, half to herself. "I'm going to <<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>tand there naked with the other girl<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>, and men will pick me and then u<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>e my body. Over and over." She starts to cry openly. "<<if SlaveStatsChecker.checkForLisp($activeSlave)>>Th-th<<else>>S-s<</if>>orry, <<if SlaveStatsChecker.checkForLisp($activeSlave)>><<if def $PC.customTitleLisp>>$PC.customTitleLisp<<elseif $PC.title != 0>>Mathter<<else>>Mithtreth<</if>><<else>><<if def $PC.customTitle>>$PC.customTitle<<elseif $PC.title != 0>>Master<<else>>Mistress<</if>><</if>>. P-plea<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>se don't beat me. I'll do it."
	<<elseif ($activeSlave.sexualFlaw is "apathetic")>>
		"I gue<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>ss<</if>> I'll lie there," she sighs quietly, half to herself. "A man will pay and then he'll come in to my room where I'm lying on the bed, and he'll <<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>tick his cock in me and cum and leave. And then the next man will come in." She starts to cry quietly. "<<if SlaveStatsChecker.checkForLisp($activeSlave)>>Th-th<<else>>S-s<</if>>orry, <<if SlaveStatsChecker.checkForLisp($activeSlave)>><<if def $PC.customTitleLisp>>$PC.customTitleLisp<<elseif $PC.title != 0>>Mathter<<else>>Mithtreth<</if>><<else>><<if def $PC.customTitle>>$PC.customTitle<<elseif $PC.title != 0>>Master<<else>>Mistress<</if>><</if>>. P-plea<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>se don't beat me. I'll let it happen."
	<<elseif ($activeSlave.sexualFlaw is "crude")>>
		"Okay," she says, thinking. "My poor cornhole is going to be <<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>uch a <<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>eminal <<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>ewer." She looks doubtful. "Should I not have <<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>aid that, <<if SlaveStatsChecker.checkForLisp($activeSlave)>><<if def $PC.customTitleLisp>>$PC.customTitleLisp<<elseif $PC.title != 0>>Mathter<<else>>Mithtreth<</if>><<else>><<if def $PC.customTitle>>$PC.customTitle<<elseif $PC.title != 0>>Master<<else>>Mistress<</if>><</if>>?"
	<<elseif ($activeSlave.sexualFlaw is "judgemental")>>
		"Gro<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>ss<</if>>," she says curtly. "Well, no more hand<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>ome boy<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> for me, then. Fat pathetic guy<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> who patronize whore<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>, all the way down. Fuck."
	<</if>>
<<else>>
	She does her best to control herself and avoid punishment. "<<if SlaveStatsChecker.checkForLisp($activeSlave)>><<if def $PC.customTitleLisp>>$PC.customTitleLisp<<elseif $PC.title != 0>>Mathter<<else>>Mithtreth<</if>><<else>><<if def $PC.customTitle>>$PC.customTitle<<elseif $PC.title != 0>>Master<<else>>Mistress<</if>><</if>>, I will." She holds herself together until you dismiss her; as she turns away to go, the tears come fast, and she almost runs into the doorframe on her way out, blind with weeping.
<</if>>

<<else>>

She manages to get "Oh fuck n-" out before the compliance systems activate and she's poleaxed to the ground. Anticipating this, you had <<if $Madam != 0>>$Madam.slaveName <<else>>another, more obedient slave<</if>> standing by to haul her away. It'll take a couple of hundred customers, but being sold in a brothel for rape should knock the resistance out of her.

<</if>> /* CLOSES DEVOTION */

<</nobr>>


code:
:: accordionStyleSheet [stylesheet]
/* Accordion 000-250-006 */

@import url('https://fonts.googleapis.com/css?family=Share+Tech|Share+Tech+Mono');

.passage h1 {
    font-family: 'Share Tech Mono', monospace;
    text-align: right;
}

button.accordion {
    cursor: pointer;
    padding: 5px;
    width: 100%;
    margin-bottom: 10px;
    border-bottom: 2px double grey;
    border-right: none;
    border-left: none;
    border-top: none;
    text-align: left;
    outline: none;
    transition: 0.4s;
    -webkit-transition-duration: 0.4s; /* Safari */
    background-color: transparent;
    font-weight: 900;
}

button.accordion.active {
    background-color: transparent;
}

button.accordion:hover {
    background-color: #2E2E2E;
}

button.accordion:before {
    content: '\002B';
    color: #777;
    font-weight: bold;
    float: left;
    margin-right: 5px;
}

.unStaffed {
    background-color: transparent;
    padding: .5em .2em;
    margin-bottom: 1em;
    border-bottom: thin inset grey;
}

.unStaffed:before {
    content: '\00D7';
    color: #777;
    font-weight: bold;
    color: red;
    float: left;
    margin-right: 5px;
}

.unStaffed:after {
    content: attr(data-after);
    float: right;
    margin-left: 2em;
    font-weight: strong;
    color: green;
}

button.accordion:after {
    content: attr(data-after);
    float: right;
    margin-left: 2em;
    font-weight: normal;
    color: green;
}

button.accordion.active:before {
    content: "\2212";
}

.accHidden {
    padding: 0 18px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.2s ease-out;
}

.macro-include {
    clear: both;
}

repo_name: thisisawittyname/fc


code:
:: Main stylesheet [stylesheet]

/* clears SugarCube's default transition */
.passage {
    transition: none;
    -webkit-transition: none;
}

/* default is 54em */
#passages {
    max-width: 76em;
}

.imageRef {
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    align-items: flex-start;
    position: relative;
}

.tinyImg {
    height: 120px;
    width: 120px;
    float: left;
}
.smlImg {
    height: 150px;
    width: 150px;
    float: left;
}

.medImg {
    height: 300px;
    width: 300px;
    float: right;
}

.lrgImg {
    height: 600px;
    width: 600px;
	margin-right: -100px;
	margin-left: -100px;
    float: right;
}

object {
    object-fit: scale-down;
    position: absolute;
}


code:
:: Alpha disclaimer

<<set $ui to "start">>\
//v. $ver//
@@color:green;//Mod: expanded age ranges and other tweaks 2016-08-30//@@ @@color:darkred;+SV@@
@@color:green;//Mod: extra preg content and other crap//@@

''This is an alpha.'' That means the game is missing content, is full of bugs, is imbalanced, and is generally in an incomplete state. The game will keep a start of turn autosave. If you encounter a bug, I strongly recommend you reload your start of turn autosave immediately. Bugs will occasionally cause a bugged slave named $activeSlave.slaveName (or similar) to appear. If this happens, use the "Discard her" option on the slave menu to get rid of her. Then, please report the circumstances (especially what random event you just saw) to the dev. Please submit your feedback and bug reports at https://www.reddit.com/r/freecitiesgame/ or at http://freecitiesblog.blogspot.com/.

An in-game encyclopedia is available from the sidebar (or [[here|Encyclopedia][$nextButton to "Back", $nextLink to passage()]] if you'd prefer to have a look before starting), with answers to most basic gameplay questions.

__Important note for new players, and a reminder for FC veterans:__ when the player is offered a set of choices, the ''Continue'' button at the top of the left sidebar will almost always remain available. Using this to decline all the options presented is //not cheating.// If it's available, it's supposed to be available. It represents the player character politely bowing out of the situation.

If you enjoy FC and feel like using your real-life ¤ to express gratitude, you can do so at https://www.patreon.com/freecitiesdev?ty=h. It's a tip jar, not support for more content. I'm doing this for fun; let's keep it that way.

''Saves from versions prior to 0.6 are not compatible.''

@@color:yellow;This is a text-based game that includes descriptions of sexual activity, graphic violence, drug use, and other subjects not suitable for persons under the age of 18. This is a work of fiction; any resemblance to actual persons, places, or events is unintended.@@

[[I am 18 or more years of age, I understand, and I wish to continue|Economy Intro]]


code:
:: accordionJS.tw [script]
/* Accordion 000-250-006 */

/*
 * We're making changes to the DOM, so we need to make them *after* everything has been generated
 * Sticking this all in postdisplay calls reduces the chance of there being a timing conflict
 *   with other scripts, since anything poking the DOM here will be done last
 *
 * Dev Note: The accordion mod should be able to turn *anything* into an accordion. This iteration
 *   is configured tightly for the end of week report runs, but it shouldn't be that hard to adapt for
 *   other uses, like character bios. For now, I'll see what other extra-long passages of cosmetic text
 *   might benefit.
 *
 * 000-250-006 03092017
*/

postdisplay["doAccordionSet"] = function (content) {
    if (variables().useAccordion == 1) {
        Array.prototype.slice.call(document.querySelectorAll('.macro-include'))
        .forEach(function(element) {
            element.classList.add('accHidden');
        });
    }
}

postdisplay["doAccordion"] = function (content) {
    var acc = document.getElementsByClassName("accordion");
    var i;

    for (i = 0; i < acc.length; i += 1) {
        acc[i].onclick = function () {
            this.classList.toggle("active");
            var panel = this.nextElementSibling;
            if (panel.style.maxHeight) {
                panel.style.maxHeight = null;
            } else {
                panel.style.maxHeight = panel.scrollHeight + "px";
            }
        };
    }
};


code:
:: BetterRA_JS [script]
//Imported to pregmod from unknown author added this to original FC at some point (0.9.5.4). I don't write this by myself (pregmodfan).

// Implements a Top Down Operator Precedence parser, also know as a Pratt
// parser, after its "inventor", Vaughan Pratt.  The one implemented here
// closely follows what's presented here,
//     * http://javascript.crockford.com/tdop/tdop.html
// by Douglas Crockford.  He uses that parser in JSLint.  Other relevant
// resources on the interweb
//     * http://effbot.org/zone/simple-top-down-parsing.htm
//     * http://eli.thegreenplace.net/2010/01/02/top-down-operator-precedence-parsing
//     * http://journal.stuffwithstuff.com/2011/03/19/pratt-parsers-expression-parsing-made-easy/
//     * https://higherlogics.blogspot.gr/2009/11/extensible-statically-typed-pratt.html
//     * https://github.com/fholm/Vaughan
// included here mostly as bookmarks for potential future reference.
//
// With regards to the lexer, I mostly copied
//     * http://eli.thegreenplace.net/2013/06/25/regex-based-lexical-analysis-in-python-and-javascript/
// not without changes though.
//
// Other useful things, to complement my lacking JavaScript knowledge were
//     * https://plainjs.com/javascript/utilities/merge-two-javascript-objects-19/
//     * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions
// Some I actually use, some I do not

function panic(index, msg) {
    throw {index: index, message: msg};
}

function escapeRegExp(s){
    return s.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
}

var Lexer = function(skipWhitespace) {
    this.rules = [];
    this.index = 0;
    this.buffer = "";
    this.skipWhitespace = skipWhitespace ? /\S/ : null;
}

Lexer.prototype.addRule = function(id, defn) {
    var pattern = (defn && defn.pattern) || escapeRegExp(id);
    this.rules.push({
        id: id,
        pattern: new RegExp('^' + pattern)
    });
}

Lexer.prototype.feed = function(buffer) {
    this.buffer = buffer;
    this.index = 0;
}

Lexer.prototype.nextInterestingChar = function() {
    if (this.skipWhitespace) {
        var match = this.skipWhitespace.exec(this.buffer.substr(this.index));
        return match ? this.index + match.index
                     : this.buffer.length;
    }
    return this.index;
}

Lexer.prototype.next = function() {
    this.index = this.nextInterestingChar();

    if (this.index >= this.buffer.length)
        return { done: true };

    for (var i = 0; i < this.rules.length; ++i) {
        var rule = this.rules[i],
            match = rule.pattern.exec(this.buffer.substr(this.index));
        if (match) {
            var token = {
                id: rule.id,
                value: match[0],
                index: this.index,
            };
            this.index += token.value.length;
            return { done: false, value: token };
        }
    }

    panic(this.index, "illegal character");
}

var BaseSymbol = {
    lbp: 0,
    nud: function() { panic(this.index, "Undefined"); },
    led: function() { panic(this.index, "Missing operator"); }
};

var Parser = function(eofToken) {
    this.lexer = new Lexer(true);
    this.currentSymbol = null;

    this.eofToken = eofToken;
    this.symbolTable = {
        [this.eofToken]: Object.create(BaseSymbol, {id: {value: this.eofToken}})
    };
}

Parser.prototype.addSymbol = function(id, defn) {
    var s = this.symbolTable[id];
    if (s) {
        if (defn && defn.lbp !== undefined && defn.lbp >= s.lbp) s.lbp = defn.lbp;
        if (defn && defn.nud !== undefined) s.nud = defn.nud;
        if (defn && defn.led !== undefined) s.led = defn.led;
    } else {
        s = Object.create(BaseSymbol);
        s.id = id;
        if (defn && defn.lbp !== undefined) s.lbp = defn.lbp;
        if (defn && defn.nud) s.nud = defn.nud;
        if (defn && defn.led) s.led = defn.led;
        this.symbolTable[id] = s;
        this.lexer.addRule(id, defn);
    }
    return this;
}

Parser.prototype.addInfix = function(id, lbp, callback) {
    this.addSymbol(id, {
        lbp: lbp,
        led: function(p, left) { return callback(this, left, p.parse(lbp)); }
    });
    return this;
}

Parser.prototype.addInfixR = function(id, lbp, callback) {
    this.addSymbol(id, {
        lbp: lbp,
        led: function(p, left) { return callback(this, left, p.parse(lbp-1)); }
    });
    return this;
}

Parser.prototype.addPrefix = function(id, callback) {
    this.addSymbol(id, {
        // FIXME: is the rbp (in parse) always 70?
        nud: function (p) { return callback(p.parse(70)); }
    });
    return this;
}

Parser.prototype.advance = function(id) {
    if (id && this.currentSymbol.id !== id)
        panic(this.currentSymbol.index, "expected '" + id + "'");

    var iter = this.lexer.next(),
        token = iter.value;
    if (iter.done)
        token = {
            id: this.eofToken,
            value: "",
            index: this.lexer.buffer.length
        };

    var symbol = this.symbolTable[iter.done ? this.eofToken : token.id];
    if (!symbol)
        panic(token.index, "unknown token " + token.id);

    var newSymbol = Object.create(symbol);
    newSymbol.value = token.value;
    newSymbol.index = token.index;
    return this.currentSymbol = newSymbol;
}

Parser.prototype.parse = function(rbp) {
    var symbol = this.currentSymbol;
    this.advance();
    var left = symbol.nud(this);

    rbp = rbp || 0;
    while (rbp < this.currentSymbol.lbp) {
        symbol = this.currentSymbol;
        this.advance();
        left = symbol.led(this, left);
    }
    return left;
}

Parser.prototype.parseString = function(string) {
    this.lexer.feed(string);
    this.advance();  // "kickstart" the lexer
    return this.parse();
}

var BaseExpression = {
    check: function(env) { panic("Wrong!"); },
    eval: function(env) { panic("Do no know how to eval " + this); }
};

var DeferredEvalParserBuilder = function(eofToken) {
    this.parser = new Parser(eofToken);
}

DeferredEvalParserBuilder.prototype.addSymbol = function(id, extra) {
    this.parser.addSymbol(id, extra);
    return this;
}

DeferredEvalParserBuilder.prototype.addInfix = function(id, lbp, func) {
    this.parser.addInfix(id, lbp, function(symbol, left, right) {
        var expr = Object.create(BaseExpression);
        expr.first = left;
        expr.second = right;
        expr.eval = function(env) {
            return func(this.first.eval(env), this.second.eval(env));
        };
        return expr;
    });
    return this;
}

DeferredEvalParserBuilder.prototype.addInfixR = function(id, lbp, func) {
    this.parser.addInfixR(id, lbp, function(symbol, left, right) {
        var expr = Object.create(BaseExpression);
        expr.first = left;
        expr.second = right;
        expr.eval = function(env) {
            return func(this.first.eval(env), this.second.eval(env));
        };
        return expr;
    });
    return this;
}

DeferredEvalParserBuilder.prototype.addPrefix = function(id, func) {
    this.parser.addPrefix(id, function (symbol) {
        var expr = Object.create(BaseExpression);
        expr.val = symbol;
        expr.eval = function(env) { return func(this.val.eval(env)); };
        return expr;
    });
    return this;
}

var op = {
    add: function(a, b) { return a + b; },
    sub: function(a, b) { return a - b; },
    mul: function(a, b) { return a * b; },
    div: function(a, b) { return a / b; },
    pow: function(a, b) { return Math.pow(a, b); },  // for completeness

    neg: function(a) { return -a; },

    lt: function(a, b) { return a < b; },
    le: function(a, b) { return a <= b; },
    gt: function(a, b) { return a > b; },
    ge: function(a, b) { return a >= b; },
    eq: function(a, b) { return a === b; },
    neq: function(a, b) { return a !== b; },

    not: function(a) { return !a; },
    or: function(a, b) { return a || b; },
    and: function(a, b) { return a && b; },
};

var parserBuilder = new DeferredEvalParserBuilder('(end)')
    .addSymbol('(int)', {
        pattern: '\\d+',
        nud: function() {
            var expr = Object.create(BaseExpression);
            expr.val = parseInt(this.value);
            expr.eval = function() { return this.val; };
            return expr;
        }
    })
    .addSymbol('(name)', {
        pattern: '[a-zA-Z]\\w*',
        nud: function(p) {
            var expr = Object.create(BaseExpression);
            expr.name = this.value;
            expr.eval = function(env) { return env[this.name]; };
            return expr;
        }
    })

    .addInfix("+", 50,  op.add)
    .addInfix("-", 50,  op.sub)
    .addInfix("*", 60,  op.mul)
    .addInfix("/", 60,  op.div)
    .addInfixR("^", 70, op.pow)

    .addPrefix("-", op.neg)

    .addInfix("<=", 30, op.le)
    .addInfix("<",  30, op.lt)
    .addInfix(">=", 30, op.ge)
    .addInfix(">",  30, op.gt)
    .addInfix("!=", 30, op.neq)
    .addInfix('=',  30, op.eq)

    .addPrefix("!", op.not)
    .addInfix('||', 30, op.or)
    .addInfix('&&', 30, op.and)

    .addSymbol(")")
    .addSymbol("(", {
        nud: function(p) {
            var expr = p.parse(0);
            p.advance(")");
            return expr;
        }
    });

window.parser = parserBuilder.parser;
window.parseAndEvaluate = function(text, env) {
    var expr = parser.parseString(text);
    return expr.eval(env);
}


code:
:: EconomyJS [script]

window.LivingRule = Object.freeze({LUXURIOUS: 'luxurious', NORMAL: 'normal', SPARSE: 'sparse'});
window.Job = Object.freeze({
	DAIRY: 'work in the dairy', MASTER_SUITE: 'serve in the master suite', CONCUBINE: 'be your concubine',
	BABY_FACTORY: 'labor in the production line', BROTHEL: 'work in the brothel'});

window.getSlaveCost = function(s) {
	if(!s) { return 0; }
	// Data duplicated from Cost Report
	var cost = 0;
	var rulesCost = State.variables.rulesCost;
	var foodCost = State.variables.foodCost;
	var drugsCost = State.variables.drugsCost;

	// Living expenses
	if(s.livingRules === LivingRule.LUXURIOUS) {
		cost += rulesCost * (s.relationship >= 4 ? 3 : 4);
	} else if(s.livingRules == LivingRule.NORMAL) {
		cost += rulesCost * 2;
	} else {
		cost += rulesCost;
	}

	// Food
	cost += foodCost * 4;
	switch(s.diet) {
		case 'fattening': case 'muscle building':
			cost += foodCost;
			break;
		case 'restricted': case 'slimming':
			cost -= foodCost;
	}
	if(s.weight > 50) {
		cost += foodCost;
	} else if(s.weight < -50) {
		cost -= foodCost;
	}
	if(s.lactation > 0) {
		cost += foodCost * (1 + s.lactation * (1 + Math.trunc(s.boobs/10000)));
	}
	if(s.preg > 5) {
		if(s.assignment === Job.DAIRY && State.variables.dairyFeedersSetting > 0) {
			// Extra feeding costs to support pregnancy are covered by dairy feeders.
			// TODO: Include them here anyway?
		} else if((s.assignment === Job.MASTER_SUITE || s.assignment === Job.CONCUBINE)
			&& State.variables.masterSuiteUpgradePregnancy === 1) {
			// Extra feeding costs to support pregnancy are covered by master suite luxuries.
			// TODO: Include them here anyway?
		} else {
			cost += foodCost * s.pregType * (s.pregControl === 'speed up' ? 3 : 1);
		}
	}
	if(s.diet === 'XX' || s.diet === 'XY') {
		cost += 25;
	} else if(s.diet === 'XXY') {
		cost += 75;
	}

	// Accessibility costs
	if(State.variables.boobAccessibility !== 1 && s.boobs > 7500
		&& (s.assignment != Job.DAIRY || State.variables.dairyRestraintsSetting < 2)) {
		cost += 50;
	}
	if(State.variables.pregAccessibility !== 1
		&& ((s.preg > 30 && s.pregType >= 2) || (s.preg > 20 && s.pregType >= 10) || (s.preg > 10 && s.pregType >= 20) || s.bellyImplant >= 10000)
		&& s.assignment != Job.BABY_FACTORY) {
		cost += 100;
	}
	if(State.variables.dickAccessibility != 1 && s.dick > 45) {
		cost += 50;
	}
	if(State.variables.ballsAccessibility != 1 && s.balls > 90) {
		cost += 50;
	}
	if(State.variables.buttAccessibility != 1 && s.butt > 15) {
		cost += 50;
	}
	if(!canSee(s)) {
		cost += 50;
	} else if(s.eyes <= -1) {
		cost += 25;
	} else if(s.eyewear === 'blurring glasses' || s.eyewear === 'blurring contacts') {
		cost += 25;
	}
	if(s.amp !== 0) {
		if(s.amp === 1) {
			cost += rulesCost;
		} else {
			cost += rulesCost / 2;
		}
	} else if(!canWalk(s)) {
		cost += rulesCost;
	}

	// Maintenance
	if(s.boobs > 10000 && s.boobsImplantType === 1) {
		cost += 50;
	}
	if(s.butt > 10 && s.buttImplantType === 1) {
		cost += 50;
	}
	if(s.preg > 25 && s.universalRulesBirthing === 1) {
		cost += 50;
	}

	// Retirement account
	if(State.variables.CitizenRetirement === 1) {
		cost += 250;
	}

	if(s.inflationType === 'water') {
		switch(s.inflation) {
			case 3:
				cost += 100;
				break;
			case 2:
				cost += 50;
				break;
			case 1:
				cost += 25;
				break;
		}
	}

	// Drugs
	if(s.drugs === 'anti-aging cream') {
		cost += drugsCost * 10;
	} else if(s.drugs === 'female hormone injections' || s.drugs === 'male hormone injections') {
		cost += drugsCost * 5;
	} else if(s.drugs != 'no drugs') {
		cost += drugsCost + 2;
	}
	if(s.curatives > 0) {
		cost += drugsCost * (1 + s.curatives);
	}
	if(s.aphrodisiacs > 0) {
		cost += drugsCost * s.aphrodisiacs;
	}
	if(s.hormones !== 0) {
		cost += Math.trunc(drugsCost * Math.abs(s.hormones) * 0.5);
	}
	if(s.preg === -1 && isFertile(s)) {
		cost += Math.trunc(drugsCost * 0.5);
	}

	// Promotion costs
	if(State.variables.studio === 1) {
		if(s.pornFameSpending > 0) {
			cost += s.pornFameSpending;
		}
	}

	if(isNaN(cost)) {
		throw new Error('Cost calculation for slave ' + s.slaveName + ' (' + s.ID + ') failed.');
	}
	return cost;
};

window.getSlaveStatisticData = function(s, facility) {
	if(!s || !facility) {
		// Base data, even without facility
		return {
			ID: s.ID, slaveName: s.slaveName, customLabel: s.customLabel,
			income: 0, adsIncome: 0, rep: 0, cost: getSlaveCost(s),
			customers: 0 /* brothel, club, ... */
		};
	}

	if(!facility.income) {
		facility.income = new Map();
	}

	if(facility.income.has(s.ID)) {
		return facility.income.get(s.ID);
	} else {
		var data = {
			ID: s.ID, slaveName: s.slaveName, customLabel: s.customLabel,
			income: 0, adsIncome: 0, rep: 0, cost: getSlaveCost(s),
			customers: 0 /* brothel, club, ... */
		};
		facility.income.set(s.ID, data);
		return data;
	}
};

window.initFacilityStatistics = function(facility) {
	facility = facility || {};
	facility.adsIncome = 0;
	facility.maintenance = 0;
	facility.totalIncome = 0;
	facility.totalExpenses = 0;
	facility.profit = 0;
	facility.income = new Map();
	return facility;
}

Number.prototype.toFixedHTML = function() {
	return Number.prototype.toFixed.apply(this, arguments).replace(/\.0+$/, '$&');
}