:: Default Rules [nobr]

<<for _r to 0; _r < $defaultRules.length; _r++>>
<<set _currentRule to $defaultRules[_r]>>
<<if !ruleApplied($activeSlave, _currentRule.ID)>><<continue>><</if>>
<<if (def _currentRule.facility) && (_currentRule.facility.length > 1) and !ruleAppliedToSlaveFacility(_currentRule, $activeSlave)>><<continue>><</if>>

<<if $activeSlave.fuckdoll == 0>>

<<if (_currentRule.choosesOwnAssignment == 1)>>
 <<if ($activeSlave.choosesOwnAssignment == 0)>>
 <<if ($activeSlave.assignmentVisible == 1)>>
 <<if ($activeSlave.assignment != "recruit girls")>>
 <<if ($activeSlave.assignment != "be your Head Girl")>>
 <<if ($activeSlave.assignment != "guard you")>>
	<br>$activeSlave.slaveName is now allowed to select her own assignments.
	<<set $activeSlave.choosesOwnAssignment to 1>>
	<<set $activeSlave.assignment to "choose her own job">>
 <</if>>
 <</if>>
 <</if>>
 <</if>>
 <</if>>
<</if>>

<<if (_currentRule.clothes isnot "no default setting")>>
<<if (_currentRule.choosesOwnClothes == 1)>>
 <<if ($activeSlave.choosesOwnClothes == 0)>>
	<br>$activeSlave.slaveName is now allowed to choose her own clothes.
	<<set $activeSlave.choosesOwnClothes to 1>>
	<<set $activeSlave.clothes to "choosing her own clothes">>
  <</if>>
<<elseif ($activeSlave.clothes isnot _currentRule.clothes)>>
	<<set $activeSlave.clothes to _currentRule.clothes>>
	<br>$activeSlave.slaveName is now wearing $activeSlave.clothes.
	<<set $activeSlave.choosesOwnClothes to 0>>
<</if>>
<</if>>

<<if (_currentRule.collar isnot "no default setting")>>
<<if ($activeSlave.collar isnot _currentRule.collar)>>
	<<set $activeSlave.collar to _currentRule.collar>>
	<<if ($activeSlave.collar is "none")>>
		<br>$activeSlave.slaveName has been given no collar.
	<<else>>
		<br>$activeSlave.slaveName has been given a $activeSlave.collar collar.
	<</if>>
<</if>>
<</if>>

<<set _tmp to lastEyeWearRule($activeSlave, $defaultRules)>>
<<if (_tmp != null) && (_tmp.ID is _currentRule.ID)>>
<<if (_currentRule.eyewear isnot "no default setting")>>
	<<if _currentRule.eyewear is "correct with glasses">>
	<<if $activeSlave.eyes <= -1>>
		<<if $activeSlave.eyewear != "corrective glasses">>
		<<set $activeSlave.eyewear to "corrective glasses">>
		<<set $cash -= $modCost>>
		<br>$activeSlave.slaveName has been given corrective glasses.
		<</if>>
	<<else>>
		<<if $activeSlave.eyewear != "none">>
		<<set $activeSlave.eyewear to "none">>
		<br>$activeSlave.slaveName's eyewear has been removed.
		<</if>>
	<</if>>
	<<elseif _currentRule.eyewear is "correct with contacts">>
	<<if $activeSlave.eyes <= -1>>
		<<if $activeSlave.eyewear != "corrective contacts">>
		<<set $activeSlave.eyewear to "corrective contacts">>
		<<set $cash -= $modCost>>
		<br>$activeSlave.slaveName has been given corrective contacts.
	  <</if>>
	<<else>>
		<<if $activeSlave.eyewear != "none">>
		<<set $activeSlave.eyewear to "none">>
		<br>$activeSlave.slaveName's eyewear has been removed.
	  <</if>>
	<</if>>
	<<elseif _currentRule.eyewear is "blur with glasses">>
	<<if $activeSlave.eyes > -1>>
		<<if $activeSlave.eyewear != "blurring glasses">>
		<<set $activeSlave.eyewear to "blurring glasses">>
		<<set $cash -= $modCost>>
		<br>$activeSlave.slaveName has been given blurring glasses.
	  <</if>>
	<<else>>
		<<if $activeSlave.eyewear != "none">>
		<<set $activeSlave.eyewear to "none">>
		<br>$activeSlave.slaveName's eyewear has been removed.
		<</if>>
	<</if>>
	<<elseif _currentRule.eyewear is "blur with contacts">>
	<<if $activeSlave.eyes > -1>>
	  <<if $activeSlave.eyewear != "blurring contacts">>
		<<set $activeSlave.eyewear to "blurring contacts">>
		<<set $cash -= $modCost>>
		<br>$activeSlave.slaveName has been given blurring contacts.
	  <</if>>
	<<else>>
	  <<if $activeSlave.eyewear != "none">>
		<<set $activeSlave.eyewear to "none">>
		<br>Since $activeSlave.slaveName's eyewear has been removed.
	  <</if>>
	<</if>>
	<<elseif _currentRule.eyewear is "universal glasses">>
	<<if $activeSlave.eyes <= -1>>
	  <<if $activeSlave.eyewear != "corrective glasses">>
		<<set $activeSlave.eyewear to "corrective glasses">>
		<<set $cash -= $modCost>>
		<br>$activeSlave.slaveName has been given corrective glasses.
	  <</if>>
	<<else>>
	  <<if $activeSlave.eyewear != "glasses">>
		<<set $activeSlave.eyewear to "glasses">>
		<<set $cash -= $modCost>>
		<br>$activeSlave.slaveName has been given decorative glasses.
	  <</if>>
	<</if>>
  <<else>>
	  <<if $activeSlave.eyewear != "none">>
		<<set $activeSlave.eyewear to "none">>
		<br>$activeSlave.slaveName's eyewear has been removed.
	  <</if>>
  <</if>>
<</if>>
<</if>>

<<if $activeSlave.vagina == 0>>
<<if _currentRule.virginAccessory isnot "no default setting">>
<<if $activeSlave.vaginalAccessory isnot _currentRule.virginAccessory>>
	<<set $activeSlave.vaginalAccessory to _currentRule.virginAccessory>>
	<<if $activeSlave.vaginalAccessory is "huge dildo">>
		<br>$activeSlave.slaveName has been given a
		<<if $activeSlave.vagina >= 3>>
			massive dildo to permanently gape her cunt,
		<<else>>
			large dildo for her pussy, since it must be stretched before it can accommodate a huge one,
			<<set $activeSlave.vaginalAccessory to "large dildo">>
		<</if>>
	<<elseif $activeSlave.vaginalAccessory is "none">>
		<br>$activeSlave.slaveName's item for her pussy has been changed to be nothing.
	<<else>>
		<br>$activeSlave.slaveName has been given a $activeSlave.vaginalAccessory for her pussy,
	<</if>>
<</if>>
<</if>>
<<elseif ($activeSlave.vagina > 0) && ($activeSlave.anus == 0)>>
<<if _currentRule.aVirginAccessory isnot "no default setting">>
<<if $activeSlave.vaginalAccessory isnot _currentRule.aVirginAccessory>>
	<<set $activeSlave.vaginalAccessory to _currentRule.aVirginAccessory>>
	<<if $activeSlave.vaginalAccessory is "huge dildo">>
		<br>$activeSlave.slaveName has been given a
		<<if $activeSlave.vagina >= 3>>
			massive dildo to permanently gape her cunt.
		<<else>>
			large dildo for her pussy, since it must be stretched before it can accommodate a huge one.
			<<set $activeSlave.vaginalAccessory to "large dildo">>
		<</if>>
	<<elseif $activeSlave.vaginalAccessory is "none">>
		<br>$activeSlave.slaveName's item for her pussy has been changed to be nothing.
	<<else>>
		<br>$activeSlave.slaveName has been given a $activeSlave.vaginalAccessory for her pussy,
	<</if>>
<</if>>
<</if>>
<<elseif $activeSlave.vagina > 0>>
<<if _currentRule.vaginalAccessory isnot "no default setting">>
<<if $activeSlave.vaginalAccessory isnot _currentRule.vaginalAccessory>>
	<<set $activeSlave.vaginalAccessory to _currentRule.vaginalAccessory>>
	<<if $activeSlave.vaginalAccessory is "huge dildo">>
		<br>$activeSlave.slaveName has been given a
		<<if $activeSlave.vagina >= 3>>
			massive dildo to permanently gape her cunt.
		<<else>>
			large dildo for her pussy, since it must be stretched before it can accommodate a huge one.
			<<set $activeSlave.vaginalAccessory to "large dildo">>
		<</if>>
	<<elseif $activeSlave.vaginalAccessory is "none">>
		<br>$activeSlave.slaveName's item for her pussy has been changed to be nothing.
	<<else>>
		<br>$activeSlave.slaveName has been given a $activeSlave.vaginalAccessory for her pussy,
	<</if>>
<</if>>
<</if>>
<</if>>

<<if ($activeSlave.dick > 0)>>
<<if $activeSlave.anus == 0>>
<<if (_currentRule.aVirginDickAccessory isnot "no default setting")>>
<<if ($activeSlave.dickAccessory isnot _currentRule.aVirginDickAccessory)>>
	<<set $activeSlave.dickAccessory to _currentRule.aVirginDickAccessory>>
	<<if $activeSlave.dickAccessory is "none">>
		<br>$activeSlave.slaveName's dick accessory has been changed to be nothing.
	<<else>>
		<br>$activeSlave.slaveName has been given a $activeSlave.dickAccessory for her cock.
	<</if>>
<</if>>
<</if>>
<<else>>
<<if (_currentRule.dickAccessory isnot "no default setting")>>
<<if ($activeSlave.dickAccessory isnot _currentRule.dickAccessory)>>
	<<set $activeSlave.dickAccessory to _currentRule.dickAccessory>>
	<<if $activeSlave.dickAccessory is "none">>
		<br>$activeSlave.slaveName's dick accessory has been changed to be nothing.
	<<else>>
		<br>$activeSlave.slaveName has been given a $activeSlave.dickAccessory for her cock.
	<</if>>
<</if>>
<</if>>
<</if>>
<</if>>

<<if ($activeSlave.vaginalAccessory isnot "anal chastity") && ($activeSlave.vaginalAccessory isnot "combined chastity") && ($activeSlave.dickAccessory isnot "anal chastity") && ($activeSlave.dickAccessory isnot "combined chastity")>>
<<if $activeSlave.anus == 0>>
<<if (_currentRule.aVirginButtplug isnot "no default setting")>>
<<if ($activeSlave.buttplug isnot _currentRule.aVirginButtplug)>>
	<<set $activeSlave.buttplug to _currentRule.aVirginButtplug>>
	<<if ($activeSlave.buttplug is "huge plug")>>
		<br>$activeSlave.slaveName has been given a
		<<if ($activeSlave.anus >= 3)>>
			massive plug to permanently gape her asshole.
		<<else>>
			<<set $activeSlave.buttplug to "large plug">>
			large buttplug for her asshole, since it must be stretched before it can accommodate a huge one.
		<</if>>
	<<elseif $activeSlave.buttplug is "none">>
		<br>$activeSlave.slaveName's item for her pussy has been changed to be nothing.
	<<else>>
		<br>$activeSlave.slaveName has been given a $activeSlave.buttplug for her asshole.
	<</if>>
<</if>>
<</if>>
<<else>>
<<if (_currentRule.buttplug isnot "no default setting")>>
<<if ($activeSlave.buttplug isnot _currentRule.buttplug)>>
	<<set $activeSlave.buttplug to _currentRule.buttplug>>
	<<if ($activeSlave.buttplug is "huge plug")>>
		<br>$activeSlave.slaveName has been given a
		<<if ($activeSlave.anus >= 3)>>
			massive plug to permanently gape her asshole.
		<<else>>
			<<set $activeSlave.buttplug to "large plug">>
			large buttplug for her asshole, since it must be stretched before it can accommodate a huge one.
		<</if>>
	<<elseif $activeSlave.buttplug is "none">>
		<br>$activeSlave.slaveName's item for her pussy has been changed to be nothing.
	<<else>>
		<br>$activeSlave.slaveName has been given a $activeSlave.buttplug for her asshole.
	<</if>>
<</if>>
<</if>>
<</if>>
<</if>>

<<if (_currentRule.shoes isnot "no default setting")>>
<<if ($activeSlave.shoes isnot _currentRule.shoes)>>
<<if ($activeSlave.amp != 1)>>
	<<set $activeSlave.shoes to _currentRule.shoes>>
	<br>$activeSlave.slaveName's shoes have been set to $activeSlave.shoes.
<</if>>
<</if>>
<</if>>

<<if (_currentRule.bellyAccessory isnot "no default setting")>>
<<if ($activeSlave.bellyAccessory isnot _currentRule.bellyAccessory)>>
    <<if ( (($activeSlave.preg >= 10) and ($activeSlave.bellyImplant >= 2000)) and ( (_currentRule.bellyAccessory is "a small empathy belly") or (_currentRule.bellyAccessory is "a medium empathy belly") or (_currentRule.bellyAccessory is "a large empathy belly") or (_currentRule.bellyAccessory is "a huge empathy belly") ) )>>
	<br>$activeSlave.slaveName's natural belly is too big to properly wear an empathy belly.
    <<else>>
	<<set $activeSlave.bellyAccessory to _currentRule.bellyAccessory>>
	<br>$activeSlave.slaveName has been given the proper belly accessory to wear.
    <</if>>
<</if>>
<</if>>

<</if>> /* CLOSES FUCKDOLL CHECK */

<<if (_currentRule.growth isnot "no default setting")>>
<<if ($activeSlave.indentureRestrictions < 2)>>
<<if (_currentRule.growth is "girlish")>>
	<<if ($activeSlave.butt < 2)>>
		<<set $activeSlave.drugs to "butt injections">>
		<br>$activeSlave.slaveName's butt is tiny, so she's been put on buttock growth drugs.
	<<elseif ($activeSlave.boobs < 350)>>
		<<set $activeSlave.drugs to "breast injections">>
		<br>$activeSlave.slaveName's tits are tiny, so she's been put on breast growth drugs.
	<<elseif ($activeSlave.lips <= 20)>>
		<<set $activeSlave.drugs to "lip injections">>
		<br>$activeSlave.slaveName's lips are average, so she's been put on lip growth injections.
	<<elseif ($activeSlave.drugs is "lip injections") || ($activeSlave.drugs is "breast injections") || ($activeSlave.drugs is "butt injections")>>
		<<set $activeSlave.drugs to "no drugs">>
		<br>$activeSlave.slaveName has reached growth targets and has been taken off growth injections.
	<</if>>
<<elseif (_currentRule.growth is "stacked")>>
	<<if ($activeSlave.butt < 2)>>
		<<set $activeSlave.drugs to "butt injections">>
		<br>$activeSlave.slaveName's butt is tiny, so she's been put on buttock growth drugs.
	<<elseif ($activeSlave.butt < 4) && ($activeSlave.hips > -2)>>
		<<set $activeSlave.drugs to "butt injections">>
		<br>$activeSlave.slaveName's hips can support a bigger butt, so she's been put on buttock growth drugs.
	<<elseif ($activeSlave.boobs < 1000)>>
		<<set $activeSlave.drugs to "breast injections">>
		<br>$activeSlave.slaveName's tits aren't large, so she's been put on breast growth drugs.
	<<elseif ($activeSlave.dick > 0) && ($activeSlave.dick < 4) && ($activeSlave.balls > 0)>>
		<<set $activeSlave.drugs to "penis enhancement">>
		<br>$activeSlave.slaveName's dick isn't large, so she's been put on penis enhancement.
	<<elseif ($activeSlave.lips <= 20)>>
		<<set $activeSlave.drugs to "lip injections">>
		<br>$activeSlave.slaveName's has been put on lip growth injections.
	<<elseif ($activeSlave.scrotum > 0) && ($activeSlave.balls < 4) && ($activeSlave.balls > 0)>>
		<<set $activeSlave.drugs to "testicle enhancement">>
		<br>$activeSlave.slaveName's balls aren't large, so she's been put on testicle enhancement.
	<<elseif $activeSlave.drugs != "no drugs">>
		<<set $activeSlave.drugs to "no drugs">>
		<br>$activeSlave.slaveName has reached growth targets and has been taken off growth injections.
	<</if>>
<<else>>
	<<if ($activeSlave.hips > -1) && ($activeSlave.butt < 6) && ($activeSlave.butt < ($activeSlave.boobs/500))>>
		<<set $activeSlave.drugs to "butt injections">>
		<br>$activeSlave.slaveName's hips can support a bigger butt, and her butt is behind her tits, so she's been put on butt injections.
	<<elseif ($activeSlave.hips > 0) && ($activeSlave.butt < 8) && ($activeSlave.butt < ($activeSlave.boobs/500))>>
		<<set $activeSlave.drugs to "butt injections">>
		<br>$activeSlave.slaveName's hips can support a bigger butt, and her butt is behind her tits, so she's been put on butt injections.
	<<elseif ($activeSlave.hips > 1) && ($activeSlave.butt < 9) && ($activeSlave.butt < ($activeSlave.boobs/500))>>
		<<set $activeSlave.drugs to "butt injections">>
		<br>$activeSlave.slaveName's hips can support a bigger butt, and her butt is behind her tits, so she's been put on butt injections.
	<<elseif ($activeSlave.boobs <= 9000) && ($activeSlave.boobs < ($activeSlave.butt*500))>>
		<<set $activeSlave.drugs to "breast injections">>
		<br>$activeSlave.slaveName's boobs could be bigger and are behind her butt, so she's been put on breast injections.
	<<elseif ($activeSlave.lips <= 40)>>
		<<set $activeSlave.drugs to "lip injections">>
		<br>$activeSlave.slaveName has been put on lip growth injections.
	<<elseif ($activeSlave.dick > 0) && ($activeSlave.dick < 6)>>
		<<set $activeSlave.drugs to "penis enhancement">>
		<br>$activeSlave.slaveName's dick could be bigger and still function, so she's been put on penis enhancement.
	<<elseif ($activeSlave.scrotum > 0) && ($activeSlave.balls < 6) && ($activeSlave.balls > 0)>>
		<<set $activeSlave.drugs to "testicle enhancement">>
		<br>$activeSlave.slaveName's balls could be bigger, so she's been put on testicle enhancement.
	<<elseif ($activeSlave.butt < 9)>>
		<<set $activeSlave.drugs to "butt injections">>
		<br>$activeSlave.slaveName's butt could be bigger, so she's been put on butt injections.
	<<elseif ($activeSlave.boobs <= 9000)>>
		<<set $activeSlave.drugs to "breast injections">>
		<br>$activeSlave.slaveName could handle bigger tits, so she's been put on breast injections.
	<<elseif ($activeSlave.dick > 0) && ($activeSlave.dick < 10) && (_currentRule.growth is "unlimited")>>
		<<set $activeSlave.drugs to "penis enhancement">>
		<br>$activeSlave.slaveName's dick could be bigger, so she's been put on penis enhancement.
	<<elseif ($activeSlave.boobs < 24000) && (_currentRule.growth is "unlimited")>>
		<<set $activeSlave.drugs to "breast injections">>
		<br>$activeSlave.slaveName's boobs could be bigger, so she's been put on breast injections.
	<<elseif $activeSlave.drugs != "no drugs">>
		<<set $activeSlave.drugs to "no drugs">>
		<br>$activeSlave.slaveName has reached growth targets and has been taken off growth injections.
	<</if>>
<</if>>
<</if>>
<</if>>

<<if (_currentRule.curatives != "no default setting")>>
<<if $activeSlave.curatives != _currentRule.curatives>>
	<<if _currentRule.curatives == 2>>
		<<if $activeSlave.health > 100>>
			<br>$activeSlave.slaveName has been	put on preventatives, since curatives cannot improve her health further.
			<<set $activeSlave.curatives = 1>>
		<<else>>
			<br>$activeSlave.slaveName has been	put on curatives.
			<<set $activeSlave.curatives = _currentRule.curatives>>
		<</if>>
	<<else>>
		<br>$activeSlave.slaveName has been	<<if _currentRule.aphrodisiacs > 0>>put on preventatives<<else>>taken off health drugs<</if>>.
		<<set $activeSlave.curatives = _currentRule.curatives>>
	<</if>>
<</if>>
<</if>>

<<if (_currentRule.aphrodisiacs != "no default setting")>>
<<if $activeSlave.aphrodisiacs != _currentRule.aphrodisiacs>>
	<br>$activeSlave.slaveName has been	<<if _currentRule.aphrodisiacs > 0>>put on the proper<<else>>taken off<</if>> aphrodisiacs.
	<<set $activeSlave.aphrodisiacs = _currentRule.aphrodisiacs>>
<</if>>
<</if>>

<<if ($activeSlave.dick > 0)>>
<<if ($activeSlave.balls == 0)>>
<<if (_currentRule.gelding isnot "no default setting")>>
<<if ($activeSlave.hormones isnot _currentRule.gelding)>>
	<<set $activeSlave.hormones to _currentRule.gelding>>
	<<if $activeSlave.indentureRestrictions >= 2>>
		<<set $activeSlave.hormones to Math.clamp($activeSlave.hormones, -1, 1)>>
	<</if>>
	<br>$activeSlave.slaveName is a gelding, so she has been put on the appropriate hormones.
<</if>>
<</if>>
<<elseif ($activeSlave.balls > 0)>>
<<if (_currentRule.XY isnot "no default setting")>>
<<if ($activeSlave.hormones isnot _currentRule.XY)>>
<<if ($activeSlave.assignment != "recruit girls")>>
<<if ($activeSlave.assignment != "be the Wardeness")>>
<<if ($activeSlave.assignment != "be the Madam")>>
<<if ($activeSlave.assignment != "be the Collectrix")>>
	<<set $activeSlave.hormones to _currentRule.XY>>
	<<if $activeSlave.indentureRestrictions >= 2>>
		<<set $activeSlave.hormones to Math.clamp($activeSlave.hormones, -1, 1)>>
	<</if>>
	<br>$activeSlave.slaveName is a shemale, so she has been put on the appropriate hormones.
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>

<<if ($activeSlave.vagina > -1)>>
<<if ($activeSlave.dick == 0)>>
<<if (_currentRule.XX isnot "no default setting")>>
<<if ($activeSlave.hormones isnot _currentRule.XX)>>
	<<set $activeSlave.hormones to _currentRule.XX>>
	<<if $activeSlave.indentureRestrictions >= 2>>
		<<set $activeSlave.hormones to Math.clamp($activeSlave.hormones, -1, 1)>>
	<</if>>
	<br>$activeSlave.slaveName is a female, so she has been put on the appropriate hormonal regime.
	<</if>>
<</if>>
<</if>>
<<if ($activeSlave.ovaries == 1)>>
<<if ($activeSlave.preg > -2)>>
<<if ($activeSlave.preg < 1)>>
<<if (_currentRule.preg isnot "no default setting")>>
<<if (_currentRule.preg is -1)>>
	<<set $activeSlave.preg to -1>>
	<<if $activeSlave.drugs is "fertility drugs">>
		<<set $activeSlave.drugs to "no drugs">>
	<</if>>
	<br>$activeSlave.slaveName is a fertile female, so she has been put on the appropriate contraceptive regime.
<<elseif (_currentRule.preg == 0)>>
	<<set $activeSlave.preg to 0>>
	<<if $activeSlave.drugs is "fertility drugs">>
		<<set $activeSlave.drugs to "no drugs">>
	<</if>>
	<br>$activeSlave.slaveName is a fertile female, so she has been put on the appropriate contraceptive regime.
<<elseif (_currentRule.preg == 1)>>
	<<set $activeSlave.preg to 0>>
	<<set $activeSlave.drugs to "fertility drugs">>
	<<set $activeSlave.hormones to 0>>
	<br>$activeSlave.slaveName is a fertile female, so she has been put on the appropriate contraceptive regime.
<<elseif (_currentRule.preg is 2)>>
	<<set $activeSlave.drugs to "fertility drugs">>
	<<set $activeSlave.hormones to 2>>
	<<set $activeSlave.preg to 0>>
	<br>$activeSlave.slaveName is a fertile female, so she has been put on the appropriate contraceptive regime.
<<elseif (_currentRule.preg is 3) and $activeSlave.indentureRestrictions < 1>>
	<<set $activeSlave.drugs to "super fertility drugs">>
	<<set $activeSlave.hormones to 0>>
	<<set $activeSlave.preg to 0>>
	<br>$activeSlave.slaveName is a fertile female, so she has been put on the appropriate contraceptive regime.
<<elseif (_currentRule.preg is 4) and $activeSlave.indentureRestrictions < 1>>
	<<set $activeSlave.drugs to "super fertility drugs">>
	<<set $activeSlave.hormones to 2>>
	<<set $activeSlave.preg to 0>>
	<br>$activeSlave.slaveName is a fertile female, so she has been put on the appropriate contraceptive regime.
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>

<<if $activeSlave.fuckdoll == 0>>

<<if (_currentRule.livingRules isnot "no default setting")>>
<<if ($activeSlave.fetish is "mindbroken")>>
	<<if ($activeSlave.livingRules isnot "spare")>>
	<<set $activeSlave.livingRules to "spare">>
	<br>Since $activeSlave.slaveName is mindbroken her living standard has been set to spare.
	<</if>>
<<elseif $activeSlave.livingRules isnot _currentRule.livingRules>>
	<<if _currentRule.livingRules isnot "luxurious">>
		<<if $roomsPopulation <= $rooms-0.5>>
			<<set $activeSlave.livingRules to _currentRule.livingRules>>
			<br>$activeSlave.slaveName's living standard has been set to _currentRule.livingRules.
			<<if $activeSlave.relationship >= 4>><<set $roomsPopulation += 0.5>><<else>><<set $roomsPopulation += 1>><</if>>
		<<else>>
			<<set $activeSlave.livingRules to "normal">>
			<br>$activeSlave.slaveName's living standard has been set to normal, since there is no room for her to occupy.
		<</if>>
	<<else>>
		<<set $activeSlave.livingRules to _currentRule.livingRules>>
		<br>$activeSlave.slaveName's living standard has been set to _currentRule.livingRules.
	<</if>>
<</if>>
<</if>>

<<if (_currentRule.speechRules isnot "no default setting")>>
<<if ($activeSlave.fetish is "mindbroken")>>
	<<if ($activeSlave.speechRules isnot "restrictive")>>
	<<set $activeSlave.speechRules to "restrictive">>
	<br>Since $activeSlave.slaveName is mindbroken her speech rules have been set to restrictive.
	<</if>>
<<elseif ($activeSlave.speechRules isnot _currentRule.speechRules)>>
	<<set $activeSlave.speechRules to _currentRule.speechRules>>
	<br>$activeSlave.slaveName's speech rules have been set to _currentRule.speechRules.
<</if>>
<</if>>

<<if ($activeSlave.fetish isnot "mindbroken")>>
 <<if (_currentRule.relationshipRules isnot "no default setting")>>
 <<if ($activeSlave.relationshipRules isnot _currentRule.relationshipRules )>>
 	<<set $activeSlave.relationshipRules to _currentRule.relationshipRules >>
 	<br>$activeSlave.slaveName's relationship rules have been set to _currentRule.relationshipRules.
 <</if>>
 <</if>>
<</if>>

<<if (_currentRule.releaseRules isnot "no default setting")>>
	<<if (_currentRule.releaseRules is "restrictive")>>
	<<SexualRelease $activeSlave>>
	<<else>>
		<<set $release to 1>>
	<</if>>
	<<if ($activeSlave.fetish is "mindbroken") && ($activeSlave.releaseRules isnot "permissive")>>
		<<set $activeSlave.releaseRules to "permissive">>
		<br>Since $activeSlave.slaveName is mindbroken her masturbation rules have been set to permissive.
	<<elseif ($release != 0) && ($activeSlave.releaseRules isnot _currentRule.releaseRules)>>
	  <<set $activeSlave.releaseRules to _currentRule.releaseRules>>
	  <br>$activeSlave.slaveName's masturbation rules have been set to _currentRule.releaseRules.
	<</if>>
<</if>>

<<if (_currentRule.standardPunishment isnot "no default setting")>>
 <<if ($activeSlave.standardPunishment isnot _currentRule.standardPunishment)>>
 	<<set $activeSlave.standardPunishment to _currentRule.standardPunishment >>
 	<br>$activeSlave.slaveName's typical punishment has been updated to _currentRule.standardPunishment.
 <</if>>
<</if>>

<<if (_currentRule.standardReward isnot "no default setting")>>
 <<if ($activeSlave.standardReward isnot _currentRule.standardReward)>>
 	<<set $activeSlave.standardReward to _currentRule.standardReward >>
 	<br>$activeSlave.slaveName's typical reward has been updated to _currentRule.standardReward.
 <</if>>
<</if>>

<</if>> /* CLOSES FUCKDOLL CHECK */

<<if (_currentRule.diet isnot "no default setting")>>
	<<if ($activeSlave.boobs >= 1600) && ($activeSlave.muscles <= 5) && ($activeSlave.amp != 1) && ((_currentRule.muscles is "no default setting") || (_currentRule.muscles == 0))>>
		<<if ($activeSlave.diet isnot "muscle building")>>
			<<set $activeSlave.diet to "muscle building">>
			<br>$activeSlave.slaveName has big tits and no back muscles, so she's been assigned to gain some.
		<</if>>
	<<elseif ($activeSlave.boobs >= 1600) && ($activeSlave.muscles > 5) && ($activeSlave.diet is "muscle building") && ((_currentRule.muscles is "no default setting") || (_currentRule.muscles == 0))>>
		<<set $activeSlave.diet to "healthy">>
		<br>$activeSlave.slaveName has huge boobs, but she already has the back muscles to bear them, so she's been assigned to stop working out so hard.
	<<elseif (_currentRule.dietGrowthSupport == 1) && (($activeSlave.drugs is "breast injections") || ($activeSlave.drugs is "butt injections")) && ($activeSlave.weight <= 95)>>
		<<if $activeSlave.diet isnot "fattening">>
			<<set $activeSlave.diet to "fattening">>
			<br>$activeSlave.slaveName is on drugs designed to expand major body parts, so she's been put on a fattening diet to provide her body as much fuel for growth as possible.
		<</if>>
	<<else>>
		<<if (_currentRule.diet == 0)>>
			<<if ($activeSlave.weight > 10)>>
				<<if ($activeSlave.diet isnot "restricted")>>
					<<set $activeSlave.diet to "restricted">>
					<br>$activeSlave.slaveName is too fat so her diet has been set to restricted.
				<</if>>
			<<elseif ($activeSlave.weight < -10)>>
				<<if ($activeSlave.diet isnot "fattening")>>
					<<set $activeSlave.diet to "fattening">>
					<br>$activeSlave.slaveName is too skinny so her diet has been set to fattening.
				<</if>>
			<<elseif (_currentRule.muscles isnot "no default setting") && ($activeSlave.amp != 1)>>
				<<if ($activeSlave.muscles >= _currentRule.muscles+5)>>
					<<if ($activeSlave.diet isnot "slimming")>>
						<<set $activeSlave.diet to "slimming">>
						<br>$activeSlave.slaveName has been put on a slimming exercise regime.
					<</if>>
				<<elseif ($activeSlave.muscles <= _currentRule.muscles-5)>>
					<<if ($activeSlave.diet isnot "muscle building")>>
						<<set $activeSlave.diet to "muscle building">>
						<br>$activeSlave.slaveName has been put on a muscle building exercise regime.
					<</if>>
				<<else>>
					<<if ($activeSlave.diet isnot "healthy")>>
						<<set $activeSlave.diet to "healthy">>
						<br>$activeSlave.slaveName is at the target weight, so her diet has been normalized.
					<</if>>
				<</if>>
			<<else>>
				<<if ($activeSlave.diet isnot "healthy")>>
					<<set $activeSlave.diet to "healthy">>
					<br>$activeSlave.slaveName is at the target weight, so her diet has been normalized.
				<</if>>
			<</if>>
		<<elseif (_currentRule.diet == 30)>>
			<<if ($activeSlave.weight > 30)>>
				<<if ($activeSlave.diet isnot "restricted")>>
					<<set $activeSlave.diet to "restricted">>
					<br>$activeSlave.slaveName is too fat so her diet has been set to restricted.
				<</if>>
			<<elseif ($activeSlave.weight < 20)>>
				<<if ($activeSlave.diet isnot "fattening")>>
					<<set $activeSlave.diet to "fattening">>
					<br>$activeSlave.slaveName is too skinny so her diet has been set to fattening.
				<</if>>
			<<elseif (_currentRule.muscles isnot "no default setting") && ($activeSlave.amp != 1)>>
				<<if ($activeSlave.muscles >= _currentRule.muscles+5)>>
					<<if ($activeSlave.diet isnot "slimming")>>
						<<set $activeSlave.diet to "slimming">>
						<br>$activeSlave.slaveName has been put on a slimming exercise regime.
					<</if>>
				<<elseif ($activeSlave.muscles <= _currentRule.muscles-5)>>
					<<if ($activeSlave.diet isnot "muscle building")>>
						<<set $activeSlave.diet to "muscle building">>
						<br>$activeSlave.slaveName has been put on a muscle building exercise regime.
					<</if>>
				<<else>>
					<<if ($activeSlave.diet isnot "healthy")>>
						<<set $activeSlave.diet to "healthy">>
						<br>$activeSlave.slaveName is at the target weight, so her diet has been normalized.
					<</if>>
				<</if>>
			<<else>>
				<<if ($activeSlave.diet isnot "healthy")>>
					<<set $activeSlave.diet to "healthy">>
					<br>$activeSlave.slaveName is at the target weight, so her diet has been normalized.
				<</if>>
			<</if>>
		<<elseif (_currentRule.diet == -30)>>
			<<if ($activeSlave.weight > -20)>>
				<<if ($activeSlave.diet isnot "restricted")>>
					<<set $activeSlave.diet to "restricted">>
					<br>$activeSlave.slaveName is too fat so her diet has been set to restricted.
				<</if>>
			<<elseif ($activeSlave.weight < -30)>>
				<<if ($activeSlave.diet isnot "fattening")>>
					<<set $activeSlave.diet to "fattening">>
					<br>$activeSlave.slaveName is too skinny so her diet has been set to fattening.
				<</if>>
			<<elseif (_currentRule.muscles isnot "no default setting") && ($activeSlave.amp != 1)>>
				<<if ($activeSlave.muscles >= _currentRule.muscles+5)>>
					<<if ($activeSlave.diet isnot "slimming")>>
						<<set $activeSlave.diet to "slimming">>
						<br>$activeSlave.slaveName has been put on a slimming exercise regime.
					<</if>>
				<<elseif ($activeSlave.muscles <= _currentRule.muscles-5)>>
					<<if ($activeSlave.diet isnot "muscle building")>>
						<<set $activeSlave.diet to "muscle building">>
						<br>$activeSlave.slaveName has been put on a muscle building exercise regime.
					<</if>>
				<<else>>
					<<if ($activeSlave.diet isnot "healthy")>>
						<<set $activeSlave.diet to "healthy">>
						<br>$activeSlave.slaveName is at the target weight, so her diet has been normalized.
					<</if>>
				<</if>>
			<<else>>
				<<if ($activeSlave.diet isnot "healthy")>>
					<<set $activeSlave.diet to "healthy">>
					<br>$activeSlave.slaveName is at the target weight, so her diet has been normalized.
				<</if>>
			<</if>>
		<<elseif (_currentRule.diet is "attractive")>>
			<<if (($activeSlave.weight > 95) || (($activeSlave.weight > 30) && ($activeSlave.hips < 2)))>>
				<<if ($activeSlave.diet isnot "restricted")>>
					<<set $activeSlave.diet to "restricted">>
					<br>$activeSlave.slaveName is too fat so her diet has been set to restricted.
				<</if>>
			<<elseif (($activeSlave.weight < -95) || (($activeSlave.weight < -30) && ($activeSlave.hips > -2)))>>
				<<if ($activeSlave.diet isnot "fattening")>>
					<<set $activeSlave.diet to "fattening">>
					<br>$activeSlave.slaveName is too skinny so her diet has been set to fattening.
				<</if>>
			<<elseif (_currentRule.muscles isnot "no default setting") && ($activeSlave.amp != 1)>>
				<<if ($activeSlave.muscles >= _currentRule.muscles+5)>>
					<<if ($activeSlave.diet isnot "slimming")>>
						<<set $activeSlave.diet to "slimming">>
						<br>$activeSlave.slaveName has been put on a slimming exercise regime.
					<</if>>
				<<elseif ($activeSlave.muscles <= _currentRule.muscles-5)>>
					<<if ($activeSlave.diet isnot "muscle building")>>
						<<set $activeSlave.diet to "muscle building">>
						<br>$activeSlave.slaveName has been put on a muscle building exercise regime.
					<</if>>
				<<else>>
					<<if ($activeSlave.diet isnot "healthy")>>
						<<set $activeSlave.diet to "healthy">>
						<br>$activeSlave.slaveName is at the target weight, so her diet has been normalized.
					<</if>>
				<</if>>
			<<else>>
				<<if ($activeSlave.diet isnot "healthy")>>
					<<set $activeSlave.diet to "healthy">>
					<br>$activeSlave.slaveName is at the target weight, so her diet has been normalized.
				<</if>>
			<</if>>
		<<elseif (_currentRule.diet is "XX")>>
			<<if ($activeSlave.diet isnot "XX")>>
				<<set $activeSlave.diet to "XX">>
				<br>$activeSlave.slaveName has been put on a diet that favors feminine development.
			<</if>>
		<<elseif (_currentRule.diet is "XY")>>
			<<if ($activeSlave.diet isnot "XY")>>
				<<set $activeSlave.diet to "XY">>
				<br>$activeSlave.slaveName has been put on a diet that favors masculine development.
			<</if>>
		<<elseif (_currentRule.diet is "XXY")>>
			<<if ($activeSlave.diet isnot "XXY")>>
				<<set $activeSlave.diet to "XXY">>
				<br>$activeSlave.slaveName has been put on a diet that enhances a herm's unique sexuality.
			<</if>>
		<</if>>
	<</if>>
<</if>>

<<if (_currentRule.dietCum isnot "no default setting")>>
	<<if $activeSlave.dietCum != _currentRule.dietCum>>
		<<set $activeSlave.dietCum = _currentRule.dietCum>>
		<<if $activeSlave.dietCum == 2>>
			<br>$activeSlave.slaveName has been put on a diet based on cum.
			<<set $activeSlave.dietMilk = 0>>
		<<elseif $activeSlave.dietCum == 1>>
			<br>$activeSlave.slaveName has had cum added to her diet.
		<<else>>
			<br>$activeSlave.slaveName has had cum removed from her diet.
		<</if>>
	<</if>>
<</if>>

<<if (_currentRule.dietMilk isnot "no default setting")>>
	<<if $activeSlave.dietMilk != _currentRule.dietMilk>>
		<<set $activeSlave.dietMilk = _currentRule.dietMilk>>
		<<if $activeSlave.dietMilk == 2>>
			<br>$activeSlave.slaveName has been put on a diet based on human milk.
			<<set $activeSlave.dietCum = 0>>
		<<elseif $activeSlave.dietMilk == 1>>
			<br>$activeSlave.slaveName has had human milk added to her diet.
		<<else>>
			<br>$activeSlave.slaveName has had human milk removed from her diet.
		<</if>>
	<</if>>
<</if>>

<<if (_currentRule.teeth isnot "no default setting")>>
  <<if (_currentRule.teeth is "universal")>>
	<<if ($activeSlave.teeth is "crooked")>>
		<<set $activeSlave.teeth to "straightening braces">>
		<<set $cash -= $surgeryCost>>
		<br>$activeSlave.slaveName has been given braces for her crooked teeth.
	<<elseif ($activeSlave.teeth is "normal")>>
		<<set $activeSlave.teeth to "cosmetic braces">>
		<<set $cash -= $surgeryCost>>
		<br>$activeSlave.slaveName has been given cosmetic braces.
	<</if>>
  <<elseif (_currentRule.teeth is "straighten")>>
	<<if ($activeSlave.teeth is "crooked")>>
		<<set $activeSlave.teeth to "straightening braces">>
		<<set $cash -= $surgeryCost>>
		<br>$activeSlave.slaveName has been given braces for her crooked teeth.
	<<elseif ($activeSlave.teeth is "cosmetic braces")>>
		<<set $activeSlave.teeth to "normal">>
		<br>$activeSlave.slaveName has gotten her braces off, since her teeth are straight.
	<</if>>
  <<elseif (_currentRule.teeth is "none")>>
	<<if ($activeSlave.teeth is "straightening braces")>>
		<<set $activeSlave.teeth to "crooked">>
		<br>$activeSlave.slaveName has gotten her braces off.
	<<elseif ($activeSlave.teeth is "cosmetic braces")>>
		<<set $activeSlave.teeth to "normal">>
		<br>$activeSlave.slaveName has gotten her braces off.
	<</if>>
	<</if>>
<</if>>

<<set _tmp to lastEyeColorRule($activeSlave, $defaultRules)>>
<<if (_tmp != null) && (_tmp.ID is _currentRule.ID)>>
<<if (_currentRule.eyeColor isnot "no default setting")>>
<<if ($activeSlave.eyeColor isnot _currentRule.eyeColor)>>
  <<set $activeSlave.eyeColor to _currentRule.eyeColor>>
	<<set $cash -= $modCost>>
	<br>$activeSlave.slaveName has been given $activeSlave.eyeColor contact lenses.
<</if>>
<</if>>
<</if>>

<<set _tmp to lastMakeupRule($activeSlave, $defaultRules)>>
<<if (_tmp != null) && (_tmp.ID is _currentRule.ID)>>
<<if (_currentRule.makeup isnot "no default setting")>>
<<if ($activeSlave.makeup isnot _currentRule.makeup)>>
  <<set $activeSlave.makeup to _currentRule.makeup>>
	<<set $cash -= $modCost>>
	<br>$activeSlave.slaveName has been assigned the standard makeup.
<</if>>
<</if>>
<</if>>

<<set _tmp to lastNailsRule($activeSlave, $defaultRules)>>
<<if (_tmp != null) && (_tmp.ID is _currentRule.ID)>>
<<if ($activeSlave.amp != 1)>>
<<if (_currentRule.nails isnot "no default setting")>>
<<if ($activeSlave.nails isnot _currentRule.nails)>>
  <<set $activeSlave.nails to _currentRule.nails>>
  <<set $cash -= $modCost>>
	<br>$activeSlave.slaveName has been assigned the standard nails.
<</if>>
<</if>>
<</if>>
<</if>>

<<set _tmp to lastHColorRule($activeSlave, $defaultRules)>>
<<if (_tmp != null) && (_tmp.ID is _currentRule.ID)>>
<<if (_currentRule.hColor isnot "no default setting")>>
<<if ($activeSlave.hColor isnot _currentRule.hColor)>>
  <<set $activeSlave.hColor to _currentRule.hColor>>
	<<set $cash -= $modCost>>
	<br>$activeSlave.slaveName's hair has been dyed _currentRule.hColor.
<</if>>
<</if>>
<</if>>

<<set _tmp to lastHStyleRule($activeSlave, $defaultRules)>>
<<if (_tmp != null) && (_tmp.ID is _currentRule.ID)>>
<<if (_currentRule.hStyle isnot "no default setting")>>
<<if ($activeSlave.hStyle isnot _currentRule.hStyle)>>
<br>$activeSlave.slaveName's hair has been
<<if (_currentRule.hStyle is "shaved")>>
	<<set $activeSlave.hLength to 0>>
	shaved.
<<else>>
	restyled.
<</if>>
<<set $activeSlave.hStyle to _currentRule.hStyle>>
<<set $cash -= $modCost>>
<</if>>
<</if>>
<</if>>

<<set _tmp to lastHLengthRule($activeSlave, $defaultRules)>>
<<if (_tmp != null) && (_tmp.ID is _currentRule.ID)>>
<<if (_currentRule.hLength isnot "no default setting")>>
<<if ($activeSlave.hLength isnot _currentRule.hLength)>>
<<if ($activeSlave.hLength > _currentRule.hLength)>>
	<<set $cash -= $modCost>>
	<br>$activeSlave.slaveName's hair has been cut; it
<<else>>
	<<set $cash -= $modCost*Math.trunc((_currentRule.hLength-$activeSlave.hLength)/10)>>
	<br>$activeSlave.slaveName has been given extensions; her hair
<</if>>
is now _currentRule.hLength cm long.
<<set $activeSlave.hLength to _currentRule.hLength>>
<</if>>
<</if>>
<</if>>

<<set _tmp to lastPubicHColorRule($activeSlave, $defaultRules)>>
<<if (_tmp != null) && (_tmp.ID is _currentRule.ID)>>
<<if (_currentRule.pubicHColor isnot "no default setting")>>
<<if ($activeSlave.pubicHColor isnot _currentRule.pubicHColor)>>
  <<set $activeSlave.pubicHColor to _currentRule.pubicHColor>>
	<<set $cash -= $modCost>>
	<br>$activeSlave.slaveName's pubic hair, if present, has been dyed _currentRule.pubicHColor.
<</if>>
<</if>>
<</if>>

<<set _tmp to lastPubicHStyleRule($activeSlave, $defaultRules)>>
<<if (_tmp != null) && (_tmp.ID is _currentRule.ID)>>
<<if (_currentRule.pubicHStyle isnot "no default setting")>>
<<if ($activeSlave.pubicHStyle isnot _currentRule.pubicHStyle)>>
  <<set $activeSlave.pubicHStyle to _currentRule.pubicHStyle>>
  <<set $cash -= $modCost>>
	<br>$activeSlave.slaveName's pubic hair has been restyled; it is now _currentRule.pubicHStyle.
<</if>>
<</if>>
<</if>>

<<set _tmp to lastUnderArmHColorRule($activeSlave, $defaultRules)>>
<<if (_tmp != null) && (_tmp.ID is _currentRule.ID)>>
<<if (_currentRule.underArmHColor isnot "no default setting")>>
<<if ($activeSlave.underArmHColor isnot _currentRule.underArmHColor)>>
  <<set $activeSlave.underArmHColor to _currentRule.underArmHColor>>
	<<set $cash -= $modCost>>
	<br>$activeSlave.slaveName's underarm hair, if present, has been dyed _currentRule.underArmHColor.
<</if>>
<</if>>
<</if>>

<<set _tmp to lastUnderArmHStyleRule($activeSlave, $defaultRules)>>
<<if (_tmp != null) && (_tmp.ID is _currentRule.ID)>>
<<if (_currentRule.underArmHStyle isnot "no default setting")>>
<<if ($activeSlave.underArmHStyle isnot _currentRule.underArmHStyle)>>
  <<set $activeSlave.underArmHStyle to _currentRule.underArmHStyle>>
  <<set $cash -= $modCost>>
	<br>$activeSlave.slaveName's underarm hair has been restyled; it is now _currentRule.underArmHStyle.
<</if>>
<</if>>
<</if>>

<<if (_currentRule.nipplesPiercing == 0)>>
<<if $activeSlave.nipplesPiercing != 0>>
	<<set $activeSlave.nipplesPiercing to 0>>
	<br>$activeSlave.slaveName's nipple piercings have been removed.
<</if>>
<</if>>
<<if (_currentRule.areolaePiercing == 0)>>
<<if $activeSlave.areolaePiercing != 0>>
	<<set $activeSlave.areolaePiercing to 0>>
	<br>$activeSlave.slaveName's areolae piercings have been removed.
<</if>>
<</if>>
<<if (_currentRule.clitPiercing == 0)>>
<<if $activeSlave.clitPiercing != 0>>
	<<set $activeSlave.clitPiercing to 0>>
	<<if $activeSlave.dick > 0>>
		<br>$activeSlave.slaveName's frenulum piercing has been removed.
	<<else>>
		<br>$activeSlave.slaveName's clit piercing has been removed.
	<</if>>
<</if>>
<</if>>
<<if (_currentRule.vaginaPiercing == 0)>>
<<if $activeSlave.vaginaPiercing != 0>>
	<<set $activeSlave.vaginaPiercing to 0>>
	<br>$activeSlave.slaveName's labia piercings have been removed.
<</if>>
<</if>>
<<if (_currentRule.dickPiercing == 0)>>
<<if $activeSlave.dickPiercing != 0>>
	<<set $activeSlave.dickPiercing to 0>>
	<br>$activeSlave.slaveName's shaft piercings have been removed.
<</if>>
<</if>>
<<if (_currentRule.anusPiercing == 0)>>
<<if $activeSlave.anusPiercing != 0>>
	<<set $activeSlave.anusPiercing to 0>>
	<br>$activeSlave.slaveName's asshole piercings have been removed.
<</if>>
<</if>>
<<if (_currentRule.lipsPiercing == 0)>>
<<if $activeSlave.lipsPiercing != 0>>
	<<set $activeSlave.lipsPiercing to 0>>
	<br>$activeSlave.slaveName's lip piercings have been removed.
<</if>>
<</if>>
<<if (_currentRule.tonguePiercing == 0)>>
<<if $activeSlave.tonguePiercing != 0>>
	<<set $activeSlave.tonguePiercing to 0>>
	<br>$activeSlave.slaveName's tongue piercings have been removed.
<</if>>
<</if>>
<<if (_currentRule.earPiercing == 0)>>
<<if $activeSlave.earPiercing != 0>>
	<<set $activeSlave.earPiercing to 0>>
	<br>$activeSlave.slaveName's ear piercings have been removed.
<</if>>
<</if>>
<<if (_currentRule.nosePiercing == 0)>>
<<if $activeSlave.nosePiercing != 0>>
	<<set $activeSlave.nosePiercing to 0>>
	<br>$activeSlave.slaveName's nose piercing has been removed.
<</if>>
<</if>>
<<if (_currentRule.eyebrowPiercing == 0)>>
<<if $activeSlave.eyebrowPiercing != 0>>
	<<set $activeSlave.eyebrowPiercing to 0>>
	<br>$activeSlave.slaveName's eyebrow piercings have been removed.
<</if>>
<</if>>
<<if (_currentRule.navelPiercing == 0)>>
<<if $activeSlave.navelPiercing != 0>>
	<<set $activeSlave.navelPiercing to 0>>
	<br>$activeSlave.slaveName's navel piercing have been removed.
<</if>>
<</if>>
<<if (_currentRule.corsetPiercing == 0)>>
<<if $activeSlave.corsetPiercing != 0>>
	<<set $activeSlave.corsetPiercing to 0>>
	<br>$activeSlave.slaveName's corset piercings have been removed.
<</if>>
<</if>>

<<set _tmp to lastNipplesPiercingRule($activeSlave, $defaultRules)>>
<<if (_tmp != null) && (_tmp.ID is _currentRule.ID)>>
<<if (_currentRule.nipplesPiercing isnot "no default setting")>>
<<if (_currentRule.nipplesPiercing != 0)>>
<<if $activeSlave.nipplesPiercing isnot _currentRule.nipplesPiercing>>
	<<set $activeSlave.nipplesPiercing to _currentRule.nipplesPiercing>>
	<<set $cash -= $modCost>>
	<br>$activeSlave.slaveName's nipples have been pierced.
<</if>>
<</if>>
<</if>>
<</if>>

<<set _tmp to lastAreolaePiercingRule($activeSlave, $defaultRules)>>
<<if (_tmp != null) && (_tmp.ID is _currentRule.ID)>>
<<if (_currentRule.areolaePiercing isnot "no default setting")>>
<<if (_currentRule.areolaePiercing != 0)>>
<<if $activeSlave.areolaePiercing isnot _currentRule.areolaePiercing>>
	<<set $activeSlave.areolaePiercing to _currentRule.areolaePiercing>>
	<<set $cash -= $modCost>>
	<br>$activeSlave.slaveName's areolae have been given stud piercings.
<</if>>
<</if>>
<</if>>
<</if>>

<<set _tmp to lastClitPiercingRule($activeSlave, $defaultRules)>>
<<if (_tmp != null) && (_tmp.ID is _currentRule.ID)>>
<<if (_currentRule.clitPiercing isnot "no default setting")>>
<<if ($activeSlave.clitPiercing != 3)>>
<<if (_currentRule.clitPiercing != 0)>>
<<if $activeSlave.clitPiercing isnot _currentRule.clitPiercing>>
	<<set $activeSlave.clitPiercing to _currentRule.clitPiercing>>
	<<if $activeSlave.dick > 0>>
		<br>$activeSlave.slaveName's frenulum has been pierced.
	<<else>>
		<br>$activeSlave.slaveName's clit has been pierced.
	<</if>>
	<<if _currentRule.clitPiercing is 3>>
	 <<set $cash -= 1000>>
	<<else>>
	 <<set $cash -= $modCost>>
	<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>

<<set _tmp to lastClitSettingRule($activeSlave, $defaultRules)>>
<<if (_tmp != null) && (_tmp.ID is _currentRule.ID)>>
<<if ($activeSlave.clitPiercing == 3)>>
<<if (_currentRule.clitSetting isnot "no default setting")>>
<<if $activeSlave.clitSetting isnot _currentRule.clitSetting>>
	<<set $activeSlave.clitSetting to _currentRule.clitSetting>>
	<br>$activeSlave.slaveName's smart piercing has been set to $activeSlave.clitSetting.
<</if>>
<</if>>
<</if>>
<</if>>

<<set _tmp to lastVaginaPiercingRule($activeSlave, $defaultRules)>>
<<if (_tmp != null) && (_tmp.ID is _currentRule.ID)>>
<<if $activeSlave.vagina != -1>>
<<if (_currentRule.vaginaPiercing isnot "no default setting")>>
<<if (_currentRule.vaginaPiercing != 0)>>
<<if $activeSlave.vaginaPiercing isnot _currentRule.vaginaPiercing>>
	<<set $activeSlave.vaginaPiercing to _currentRule.vaginaPiercing>>
	<<set $cash -= $modCost>>
	<br>$activeSlave.slaveName's pussylips have been pierced.
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>

<<set _tmp to lastDickPiercingRule($activeSlave, $defaultRules)>>
<<if (_tmp != null) && (_tmp.ID is _currentRule.ID)>>
<<if $activeSlave.dick > 0>>
<<if (_currentRule.dickPiercing isnot "no default setting")>>
<<if (_currentRule.dickPiercing != 0)>>
<<if $activeSlave.dickPiercing isnot _currentRule.dickPiercing>>
	<<set $activeSlave.dickPiercing to _currentRule.dickPiercing>>
	<<set $cash -= $modCost>>
	<br>$activeSlave.slaveName's shaft has been pierced.
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>

<<set _tmp to lastAnusPiercingRule($activeSlave, $defaultRules)>>
<<if (_tmp != null) && (_tmp.ID is _currentRule.ID)>>
<<if (_currentRule.anusPiercing isnot "no default setting")>>
<<if (_currentRule.anusPiercing != 0)>>
<<if $activeSlave.anusPiercing isnot _currentRule.anusPiercing>>
	<<set $activeSlave.anusPiercing to _currentRule.anusPiercing>>
	<<set $cash -= $modCost>>
	<br>$activeSlave.slaveName's asshole has been pierced.
<</if>>
<</if>>
<</if>>
<</if>>

<<set _tmp to lastLipsPiercingRule($activeSlave, $defaultRules)>>
<<if (_tmp != null) && (_tmp.ID is _currentRule.ID)>>
<<if (_currentRule.lipsPiercing isnot "no default setting")>>
<<if (_currentRule.lipsPiercing != 0)>>
<<if $activeSlave.lipsPiercing isnot _currentRule.lipsPiercing>>
	<<set $activeSlave.lipsPiercing to _currentRule.lipsPiercing>>
	<<set $cash -= $modCost>>
	<br>$activeSlave.slaveName's lips have been pierced.
<</if>>
<</if>>
<</if>>
<</if>>

<<set _tmp to lastTonguePiercingRule($activeSlave, $defaultRules)>>
<<if (_tmp != null) && (_tmp.ID is _currentRule.ID)>>
<<if (_currentRule.tonguePiercing isnot "no default setting")>>
<<if (_currentRule.tonguePiercing != 0)>>
<<if $activeSlave.tonguePiercing isnot _currentRule.tonguePiercing>>
	<<set $activeSlave.tonguePiercing to _currentRule.tonguePiercing>>
	<<set $cash -= $modCost>>
	<br>$activeSlave.slaveName's tongue has been pierced.
<</if>>
<</if>>
<</if>>
<</if>>

<<set _tmp to lastEarPiercingRule($activeSlave, $defaultRules)>>
<<if (_tmp != null) && (_tmp.ID is _currentRule.ID)>>
<<if (_currentRule.earPiercing isnot "no default setting")>>
<<if (_currentRule.earPiercing != 0)>>
<<if $activeSlave.earPiercing isnot _currentRule.earPiercing>>
	<<set $activeSlave.earPiercing to _currentRule.earPiercing>>
	<<set $cash -= $modCost>>
	<br>$activeSlave.slaveName's ears have been pierced.
<</if>>
<</if>>
<</if>>
<</if>>

<<set _tmp to lastNosePiercingRule($activeSlave, $defaultRules)>>
<<if (_tmp != null) && (_tmp.ID is _currentRule.ID)>>
<<if (_currentRule.nosePiercing isnot "no default setting")>>
<<if (_currentRule.nosePiercing != 0)>>
<<if $activeSlave.nosePiercing isnot _currentRule.nosePiercing>>
	<<set $activeSlave.nosePiercing to _currentRule.nosePiercing>>
	<<set $cash -= $modCost>>
	<br>$activeSlave.slaveName's nose has been pierced.
<</if>>
<</if>>
<</if>>
<</if>>

<<set _tmp to lastEyebrowPiercingRule($activeSlave, $defaultRules)>>
<<if (_tmp != null) && (_tmp.ID is _currentRule.ID)>>
<<if (_currentRule.eyebrowPiercing isnot "no default setting")>>
<<if (_currentRule.eyebrowPiercing != 0)>>
<<if $activeSlave.eyebrowPiercing isnot _currentRule.eyebrowPiercing>>
	<<set $activeSlave.eyebrowPiercing to _currentRule.eyebrowPiercing>>
	<<set $cash -= $modCost>>
	<br>$activeSlave.slaveName's eyebrows have been pierced.
<</if>>
<</if>>
<</if>>
<</if>>

<<set _tmp to lastNavelPiercingRule($activeSlave, $defaultRules)>>
<<if (_tmp != null) && (_tmp.ID is _currentRule.ID)>>
<<if (_currentRule.navelPiercing isnot "no default setting")>>
<<if (_currentRule.navelPiercing != 0)>>
<<if $activeSlave.navelPiercing isnot _currentRule.navelPiercing>>
	<<set $activeSlave.navelPiercing to _currentRule.navelPiercing>>
	<<set $cash -= $modCost>>
	<br>$activeSlave.slaveName's navel has been pierced.
<</if>>
<</if>>
<</if>>
<</if>>

<<set _tmp to lastCorsetPiercingRule($activeSlave, $defaultRules)>>
<<if (_tmp != null) && (_tmp.ID is _currentRule.ID)>>
<<if (_currentRule.corsetPiercing isnot "no default setting")>>
<<if (_currentRule.corsetPiercing != 0)>>
<<if $activeSlave.corsetPiercing isnot _currentRule.corsetPiercing>>
	<<set $activeSlave.corsetPiercing to _currentRule.corsetPiercing>>
	<<set $cash -= $modCost>>
	<br>$activeSlave.slaveName has been given a set of corset piercings.
<</if>>
<</if>>
<</if>>
<</if>>

<<set _tmp to lastBoobsTatRule($activeSlave, $defaultRules)>>
<<if (_tmp != null) && (_tmp.ID is _currentRule.ID)>>
<<if (_currentRule.boobsTat isnot "no default setting")>>
<<if ($activeSlave.boobsTat isnot _currentRule.boobsTat)>>
	<<set $activeSlave.boobsTat to _currentRule.boobsTat>>
	<<set $cash -= $modCost>>
  <br>$activeSlave.slaveName's chest has been tattooed.
<</if>>
<</if>>
<</if>>

<<set _tmp to lastButtTatRule($activeSlave, $defaultRules)>>
<<if (_tmp != null) && (_tmp.ID is _currentRule.ID)>>
<<if (_currentRule.buttTat isnot "no default setting")>>
<<if ($activeSlave.buttTat isnot _currentRule.buttTat)>>
	<<set $activeSlave.buttTat to _currentRule.buttTat>>
	<<set $cash -= $modCost>>
  <br>$activeSlave.slaveName's butt has been tattooed.
<</if>>
<</if>>
<</if>>

<<set _tmp to lastVaginaTatRule($activeSlave, $defaultRules)>>
<<if (_tmp != null) && (_tmp.ID is _currentRule.ID)>>
<<if (_currentRule.vaginaTat isnot "no default setting")>>
<<if ($activeSlave.vaginaTat isnot _currentRule.vaginaTat)>>
	<<set $activeSlave.vaginaTat to _currentRule.vaginaTat>>
	<<set $cash -= $modCost>>
  <br>$activeSlave.slaveName's abdomen has been tattooed.
<</if>>
<</if>>
<</if>>

<<set _tmp to lastDickTatRule($activeSlave, $defaultRules)>>
<<if (_tmp != null) && (_tmp.ID is _currentRule.ID)>>
<<if ($activeSlave.dick > 0)>>
<<if (_currentRule.dickTat isnot "no default setting")>>
<<if ($activeSlave.dickTat isnot _currentRule.dickTat)>>
	<<set $activeSlave.dickTat to _currentRule.dickTat>>
	<<set $cash -= $modCost>>
  <br>$activeSlave.slaveName's dick has been tattooed.
<</if>>
<</if>>
<</if>>
<</if>>

<<set _tmp to lastLipsTatRule($activeSlave, $defaultRules)>>
<<if (_tmp != null) && (_tmp.ID is _currentRule.ID)>>
<<if (_currentRule.lipsTat isnot "no default setting")>>
<<if ($activeSlave.lipsTat isnot _currentRule.lipsTat)>>
	<<set $activeSlave.lipsTat to _currentRule.lipsTat>>
	<<set $cash -= $modCost>>
  <br>$activeSlave.slaveName's face has been tattooed.
<</if>>
<</if>>
<</if>>

<<set _tmp to lastAnusTatRule($activeSlave, $defaultRules)>>
<<if (_tmp != null) && (_tmp.ID is _currentRule.ID)>>
<<if (_currentRule.anusTat isnot "no default setting")>>
<<if ($activeSlave.anusTat isnot _currentRule.anusTat)>>
	<<set $activeSlave.anusTat to _currentRule.anusTat>>
	<<set $cash -= $modCost>>
  <br>$activeSlave.slaveName's asshole has been modded.
<</if>>
<</if>>
<</if>>

<<set _tmp to lastShouldersTatRule($activeSlave, $defaultRules)>>
<<if (_tmp != null) && (_tmp.ID is _currentRule.ID)>>
<<if (_currentRule.shouldersTat isnot "no default setting")>>
<<if ($activeSlave.shouldersTat isnot _currentRule.shouldersTat)>>
	<<set $activeSlave.shouldersTat to _currentRule.shouldersTat>>
	<<set $cash -= $modCost>>
  <br>$activeSlave.slaveName's shoulders have been tattooed.
<</if>>
<</if>>
<</if>>

<<set _tmp to lastArmsTatRule($activeSlave, $defaultRules)>>
<<if (_tmp != null) && (_tmp.ID is _currentRule.ID)>>
<<if (_currentRule.armsTat isnot "no default setting")>>
<<if ($activeSlave.armsTat isnot _currentRule.armsTat)>>
	<<set $activeSlave.armsTat to _currentRule.armsTat>>
	<<set $cash -= $modCost>>
  <br>$activeSlave.slaveName's arms have been tattooed.
<</if>>
<</if>>
<</if>>

<<set _tmp to lastLegsTatRule($activeSlave, $defaultRules)>>
<<if (_tmp != null) && (_tmp.ID is _currentRule.ID)>>
<<if (_currentRule.legsTat isnot "no default setting")>>
<<if ($activeSlave.legsTat isnot _currentRule.legsTat)>>
	<<set $activeSlave.legsTat to _currentRule.legsTat>>
	<<set $cash -= $modCost>>
  <br>$activeSlave.slaveName's legs have been tattooed.
<</if>>
<</if>>
<</if>>

<<set _tmp to lastStampTatRule($activeSlave, $defaultRules)>>
<<if (_tmp != null) && (_tmp.ID is _currentRule.ID)>>
<<if (_currentRule.stampTat isnot "no default setting")>>
<<if ($activeSlave.stampTat isnot _currentRule.stampTat)>>
	<<set $activeSlave.stampTat to _currentRule.stampTat>>
	<<set $cash -= $modCost>>
  <br>$activeSlave.slaveName's lower back has been tattooed.
<</if>>
<</if>>
<</if>>

<<if (_currentRule.pornFameSpending isnot "no default setting")>>
<<if ($activeSlave.devotion > 95)>>
<<if ($activeSlave.trust > 95)>>
<<if ($activeSlave.prestige < 3)>>
<<if ($activeSlave.pornFameSpending isnot _currentRule.pornFameSpending)>>
  <<set $activeSlave.pornFameSpending to _currentRule.pornFameSpending>>
  <br>$activeSlave.slaveName's porn publicity has been corrected.
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>

<<if (_currentRule.autoBrand == 1)>>
<<if ($activeSlave.brand == 0)>>
<<if ($activeSlave.health > -20)>>
	<<set $activeSlave.brand to $brandDesign>>
	<<set $activeSlave.brandLocation to $brandTarget>>
	<<if ($activeSlave.devotion < 18)>><<set $activeSlave.devotion -= 5>><</if>>
	<<set $activeSlave.trust -= 5>>
	<<set $activeSlave.health -= 10>>
	<br>$activeSlave.slaveName has been branded, with @@color:gold;fear@@<<if ($activeSlave.devotion < 18)>>, @@color:mediumorchid;regard@@,<</if>> and @@color:red;health@@
consequences.
<</if>>
<</if>>
<</if>>

<<set _exclude to false>>
<<if _currentRule.excludeSpecialSlaves>>
	<<if (($HeadGirl != 0) && ($HeadGirl.ID is $activeSlave.ID)) || (($Bodyguard != 0) && ($Bodyguard.ID is $activeSlave.ID)) || (($Recruiter != 0) && ($Recruiter.ID is $activeSlave.ID)) || (($Concubine != 0) && ($Concubine.ID is $activeSlave.ID)) || (($Nurse != 0) && ($Nurse.ID is $activeSlave.ID)) || (($Attendant != 0) and($Attendant.ID is $activeSlave.ID)) || (($Madam != 0) || ($Madam.ID is $activeSlave.ID)) || (($DJ != 0) && ($DJ.ID is $activeSlave.ID)) || (($Milkmaid != 0) && ($Milkmaid.ID is $activeSlave.ID)) || (($Stewardess != 0 ) && ($Stewardess.ID is $activeSlave.ID)) || (($Schoolteacher != 0) && ($Schoolteacher.ID is $activeSlave.ID)) || (($Wardeness != 0) && ($Wardeness.ID is $activeSlave.ID))>>
		<<set _exclude to true>>
	<</if>>
<</if>>

<<if $activeSlave.assignmentVisible != 1>>
	<<set _exclude to true>>
<</if>>

<<if !_exclude>>
<<switch _currentRule.assignFacility>>
<<case "hgsuite">>
	<<if ($activeSlave.indentureRestrictions <= 0)>>
	<<if ($activeSlave.assignment != "live with your Head Girl")>>
		<<set $activeSlave.assignment to "live with your Head Girl">>
		<<set $activeSlave.assignmentVisible to 0>>
		<br>$activeSlave.slaveName has automatically been assigned to $activeSlave.assignment.
		<<if ($personalAttention is $activeSlave.ID)>>
			$activeSlave.slaveName no longer has your personal attention; you plan to focus on business.
			<<set $personalAttention to "business">>
		<</if>>
	<</if>>
	<</if>>
<<case "arcade">>
	<<if ($arcade > $arcadeSlaves) && ($activeSlave.indentureRestrictions <= 0)>>
	<<if ($activeSlave.assignment != "be confined in the arcade")>>
		<<set $activeSlave.assignment to "be confined in the arcade">>
		<<set $activeSlave.assignmentVisible to 0>>
		<br>$activeSlave.slaveName has automatically been assigned to $activeSlave.assignment.
		<<if ($personalAttention is $activeSlave.ID)>>
			$activeSlave.slaveName no longer has your personal attention; you plan to focus on business.
			<<set $personalAttention to "business">>
		<</if>>
	<</if>>
	<</if>>
<<case "mastersuite">>
	<<if ($masterSuite > $masterSuiteSlaves) && ($activeSlave.devotion > 20) || (($activeSlave.devotion >= -50) && ($activeSlave.trust < -20)) or  ($activeSlave.trust < -50)>>
	<<if ($activeSlave.assignment != "serve in the master suite")>>
		<<set $activeSlave.assignment to "serve in the master suite">>
		<<set $activeSlave.assignmentVisible to 0>>
		<br>$activeSlave.slaveName has automatically been assigned to $activeSlave.assignment.
		<<if ($personalAttention is $activeSlave.ID)>>
			$activeSlave.slaveName no longer has your personal attention; you plan to focus on business.
			<<set $personalAttention to "business">>
		<</if>>
	<</if>>
	<<else>>
		<<if ($activeSlave.assignment == "serve in the master suite")>>
			<<include "Rules Facility Remove">>
		<</if>>
	<</if>>
<<case "clinic">>
	<<if ($clinic > $clinicSlaves) && ($activeSlave.health < 20) || (($activeSlave.chem > 15) && ($clinicUpgradeFilters == 1))>>
	<<if ($activeSlave.assignment != "get treatment in the clinic")>>
		<<set $activeSlave.assignment to "get treatment in the clinic">>
		<<set $activeSlave.assignmentVisible to 0>>
		<br>$activeSlave.slaveName has automatically been assigned to $activeSlave.assignment.
		<<if ($personalAttention is $activeSlave.ID)>>
			$activeSlave.slaveName no longer has your personal attention; you plan to focus on business.
			<<set $personalAttention to "business">>
		<</if>>
	<</if>>
	<<else>>
		<<if ($activeSlave.assignment == "get treatment in the clinic")>>
			<<include "Rules Facility Remove">>
		<</if>>
	<</if>>
<<case "spa">>
	<<if ($spa > $spaSlaves) && ($activeSlave.health < 20) || ($activeSlave.trust < 60) || ($activeSlave.devotion <= 60) || ($activeSlave.fetish is "mindbroken") && ($activeSlave.devotion >= -20)>>
	<<if ($activeSlave.assignment != "rest in the spa")>>
		<<set $activeSlave.assignment to "rest in the spa">>
		<<set $activeSlave.assignmentVisible to 0>>
		<br>$activeSlave.slaveName has automatically been assigned to $activeSlave.assignment.
		<<if ($personalAttention is $activeSlave.ID)>>
			$activeSlave.slaveName no longer has your personal attention; you plan to focus on business.
			<<set $personalAttention to "business">>
		<</if>>
	<</if>>
	<<else>>
		<<if ($activeSlave.assignment == "rest in the spa")>>
			<<include "Rules Facility Remove">>
		<</if>>
	<</if>>
<<case "brothel">>
	<<if ($brothel > $brothelSlaves) && ($activeSlave.devotion > 50) || (($activeSlave.devotion >= -50) && ($activeSlave.trust < -20)) or  ($activeSlave.trust < -50) || ($activeSlave.trust > 50)>>
	<<if ($activeSlave.assignment != "work in the brothel")>>
		<<set $activeSlave.assignment to "work in the brothel">>
		<<set $activeSlave.assignmentVisible to 0>>
		<br>$activeSlave.slaveName has automatically been assigned to $activeSlave.assignment.
		<<if ($personalAttention is $activeSlave.ID)>>
			$activeSlave.slaveName no longer has your personal attention; you plan to focus on business.
			<<set $personalAttention to "business">>
		<</if>>
	<</if>>
	<<else>>
		<<if ($activeSlave.assignment == "work in the brothel")>>
			<<include "Rules Facility Remove">>
		<</if>>
	<</if>>
<<case "club">>
	<<if ($club > $clubSlaves)  && ($activeSlave.devotion > 50) || (($activeSlave.devotion >= -50) && ($activeSlave.trust < -20)) || ($activeSlave.trust < -50) || ($activeSlave.trust > 50)>>
	<<if ($activeSlave.assignment != "serve in the club")>>
		<<set $activeSlave.assignment to "serve in the club">>
		<<set $activeSlave.assignmentVisible to 0>>
		<br>$activeSlave.slaveName has automatically been assigned to $activeSlave.assignment.
		<<if ($personalAttention is $activeSlave.ID)>>
			$activeSlave.slaveName no longer has your personal attention; you plan to focus on business.
			<<set $personalAttention to "business">>
		<</if>>
	<</if>>
	<<else>>
		<<if ($activeSlave.assignment == "serve in the club")>>
			<<include "Rules Facility Remove">>
		<</if>>
	<</if>>
<<case "dairy">>
	<<if ($dairy > $dairySlaves+$bioreactorsXY+$bioreactorsXX+$bioreactorsHerm+$bioreactorsBarren)>>
	<<if ($activeSlave.indentureRestrictions > 0) && ($dairyRestraintsSetting > 1)>>
	<<elseif ($activeSlave.indentureRestrictions > 1) && ($dairyRestraintsSetting > 0)>>
	<<else>>
		<<if ($activeSlave.lactation > 0) || ($activeSlave.balls > 0) || (($dairyFeedersUpgrade == 1) && ($dairyFeedersSetting > 0))>>
		<<if ($activeSlave.devotion > 20) || (($activeSlave.devotion >= -50) && ($activeSlave.trust < -20)) or  ($activeSlave.trust < -50) || ($activeSlave.amp == 1) || ($dairyRestraintsUpgrade == 1)>>
		<<if ($dairyStimulatorsSetting < 2) || ($activeSlave.anus > 2) || ($dairyPrepUpgrade == 1)>>
		<<if ($dairyPregSetting < 2) || ($activeSlave.vagina > 2) || ($activeSlave.ovaries == 0) || ($dairyPrepUpgrade == 1)>>
	<<if ($activeSlave.assignment != "work in the dairy")>>
		<<set $activeSlave.assignment to "work in the dairy">>
		<<set $activeSlave.assignmentVisible to 0>>
		<br>$activeSlave.slaveName has automatically been assigned to $activeSlave.assignment.
		<<if ($personalAttention is $activeSlave.ID)>>
			$activeSlave.slaveName no longer has your personal attention; you plan to focus on business.
			<<set $personalAttention to "business">>
		<</if>>
	<</if>>
		<<else>>
			<<if ($activeSlave.assignment == "work in the dairy")>>
				<<include "Rules Facility Remove">>
			<</if>>
		<</if>>
		<<else>>
			<<if ($activeSlave.assignment == "work in the dairy")>>
				<<include "Rules Facility Remove">>
			<</if>>
		<</if>>
		<<else>>
			<<if ($activeSlave.assignment == "work in the dairy")>>
				<<include "Rules Facility Remove">>
			<</if>>
		<</if>>
		<<else>>
			<<if ($activeSlave.assignment == "work in the dairy")>>
				<<include "Rules Facility Remove">>
			<</if>>
		<</if>>
	<</if>>
	<</if>>
<<case "servantsquarters">>
	<<if ($servantsQuarters > $servantsQuartersSlaves) && ($activeSlave.devotion >= -20) || (($activeSlave.devotion >= -50) && ($activeSlave.trust <= 20)) or  ($activeSlave.trust < -20)>>
	<<if ($activeSlave.assignment != "work as a servant")>>
		<<set $activeSlave.assignment to "work as a servant">>
		<<set $activeSlave.assignmentVisible to 0>>
		<br>$activeSlave.slaveName has automatically been assigned to $activeSlave.assignment.
		<<if ($personalAttention is $activeSlave.ID)>>
			$activeSlave.slaveName no longer has your personal attention; you plan to focus on business.
			<<set $personalAttention to "business">>
		<</if>>
	<</if>>
	<<else>>
		<<if ($activeSlave.assignment == "work as a servant")>>
			<<include "Rules Facility Remove">>
		<</if>>
	<</if>>
<<case "schoolroom">>
	<<if ($schoolroom > $schoolroomSlaves) && ($activeSlave.devotion >= -20) || (($activeSlave.devotion >= -50) && ($activeSlave.trust < -20)) || ($activeSlave.trust < -50)>>
	<<if ($activeSlave.intelligenceImplant < 1) || ($activeSlave.accent+$schoolroomUpgradeLanguage > 2) || ($activeSlave.oralSkill <= 10) || ($activeSlave.whoreSkill <= 10) || ($activeSlave.entertainSkill <= 10) || ($activeSlave.analSkill < 1) || (($activeSlave.vaginalSkill < 1) && ($activeSlave.vagina > 0))>>
	<<if ($activeSlave.assignment != "learn in the schoolroom")>>
		<<set $activeSlave.assignment to "learn in the schoolroom">>
		<<set $activeSlave.assignmentVisible to 0>>
		<br>$activeSlave.slaveName has automatically been assigned to $activeSlave.assignment.
		<<if ($personalAttention is $activeSlave.ID)>>
			$activeSlave.slaveName no longer has your personal attention; you plan to focus on business.
			<<set $personalAttention to "business">>
		<</if>>
	<</if>>
	<<else>>
		<<if ($activeSlave.assignment == "learn in the schoolroom")>>
			<<include "Rules Facility Remove">>
		<</if>>
	<</if>>
	<<else>>
		<<if ($activeSlave.assignment == "learn in the schoolroom")>>
			<<include "Rules Facility Remove">>
		<</if>>
	<</if>>
<<case "cellblock">>
	<<if ($cellblock > $cellblockSlaves ) && (($activeSlave.devotion < -20) && ($activeSlave.trust >= -20)) || (($activeSlave.devotion < -50) && ($activeSlave.trust >= -50))>>
	<<if ($activeSlave.assignment != "be confined in the cellblock")>>
		<<set $activeSlave.assignment to "be confined in the cellblock">>
		<<set $activeSlave.assignmentVisible to 0>>
		<br>$activeSlave.slaveName has automatically been assigned to $activeSlave.assignment.
		<<if ($personalAttention is $activeSlave.ID)>>
			$activeSlave.slaveName no longer has your personal attention; you plan to focus on business.
			<<set $personalAttention to "business">>
			<</if>>
		<</if>>
	<<else>>
		<<if ($activeSlave.assignment == "be confined in the cellblock")>>
			<<include "Rules Facility Remove">>
		<</if>>
	<</if>>
<</switch>>
<</if>>

<<if !_exclude>>
<<if def _currentRule.setAssignment and _currentRule.setAssignment isnot"none">>
	<<if ($activeSlave.assignment isnot _currentRule.setAssignment)>>
		<<set $activeSlave.assignment to _currentRule.setAssignment>>
		<br>$activeSlave.slaveName has automatically been assigned to $activeSlave.assignment.
	<</if>>
<</if>>
<</if>>

<</for>>
src/uncategorized/defaultRules.tw