:: misc widgets [nobr widget]

/* TODO: Modularize. */

/%
 Call as <<AssayedSlaveAvailable>>
 Checks $assayedSlave for availability, e.g. not strapped to a machine or distant.
%/
<<widget "AssayedSlaveAvailable">>
<<if $assayedSlave.assignment is "be your agent">>
	<<set $assayedSlaveAvailable = 0>>
<<elseif $assayedSlave.assignment is "live with your agent">>
	<<set $assayedSlaveAvailable = 0>>
<<elseif ($assayedSlave.assignment is "work in the dairy") && ($dairyRestraintsSetting >= 2)>>
	<<set $assayedSlaveAvailable = 0>>
<<else>>
	<<set $assayedSlaveAvailable = 1>>
<</if>>
<</widget>>

/%
 Call as <<AnalVCheck 10>> or <<AnalVCheck>>
 $arg[0] is how many times to increment the Anal counts.
 if $arg[0] is left undefined it will assume it to be 1.
%/
<<widget "AnalVCheck">>
<<if canDoAnal($activeSlave) && ($activeSlave.anus eq 0)>>
	@@color:lime;This breaks in $activeSlave.slaveName's virgin ass.@@
	<<if ($activeSlave.devotion > 50) || $activeSlave.career == "a slave since birth">>
		Since it's her first time, you gently ease yourself into her butthole and gradually increase the intensity of your thrusts. Before long she's moaning loudly as you continue working away at her butthole. She thinks of losing her anal virginity to you as a @@color:hotpink;connection@@ with her beloved master. She looks forward to having her asshole fucked by you again.
		<<set $activeSlave.devotion += 4>>
	<<elseif ($activeSlave.devotion > 20)>>
		Since it's her first time, you gently ease yourself into her butthole and gradually increase the intensity of your thrusts. Her moans become louder and louder as you continue working away at her butthole. She accepts the pain and humiliation of anal sex as part of her sexual servitude, though she hopes that her next time will be less painful.
	<<elseif ($activeSlave.devotion >= -20)>>
		You force yourself into her butthole. She sobs and cries with disgust while you continue thrusting into her ass. She @@color:gold;fears@@ her next anal sex, remembering the pain of losing her anal virginity. She dreads having her ass violated by you again.
		<<set $activeSlave.trust -= 5>>
	<<else>>
		You force yourself into her butthole. She sobs and cries with disgust while you continue thrusting into her ass. She @@color:mediumorchid;hates@@ and @@color:gold;fears@@ you for violating her virgin butt. She dreads having her ass fucked by you again.
		<<set $activeSlave.trust -= 5, $activeSlave.devotion -= 5>>
	<</if>>
	<<set $activeSlave.anus to 1>>
<</if>>
<<if $args[0]>>
	<<set $analTotal += $args[0],
	$activeSlave.analCount += $args[0]>>
<<else>>
	<<set $analTotal++,
	$activeSlave.analCount++>>
<</if>>
<</widget>>

/%
 Call as <<VaginalVCheck 10>> or <<VaginalVCheck>>
 $arg[0] is how many times to increment the Vaginal counts.
 if $arg[0] is left undefined it will assume it to be 1.
 This also checks for a valid Vagina/Accessory, though most code I've seen does this already, you
 never know when someone might use the routine and forget to do such.
%/
<<widget "VaginalVCheck">>
<<if canDoVaginal($activeSlave)>>
	<<if ($activeSlave.vagina eq 0)>>
		@@color:lime;This breaks in $activeSlave.slaveName's virgin pussy.@@
		<<if ($activeSlave.devotion > 20) || $activeSlave.career == "a slave since birth">>
			You ease yourself into her pussy, since it's her first time, then gradually speed up your thrusts while she slowly learns to move her hips along with you. She moans loudly. @@color:hotpink;She enjoys losing her cherry to you.@@ She looks forward to having her pussy fucked by you again.
			<<set $activeSlave.devotion += 4>>
		<<elseif ($activeSlave.devotion < -20)>>
			You force yourself into her pussy. She sobs and cries with disgust while you continue working her fuck hole. She @@color:mediumorchid;hates@@ and @@color:gold;fears@@ you for taking her virginity.
			<<set $activeSlave.trust -= 5, $activeSlave.devotion -= 5>>
		<<else>>
			You ease yourself into her pussy, since it's her first time, then gradually speed up your thrusts while she slowly learns to move her hips along with you. She accepts losing her virginity to her owner. She looks forward to having her pussy fucked by you again.
		<</if>>
		<<set $activeSlave.vagina to 1>>
	<</if>>
	<<if $args[0]>>
		<<set $vaginalTotal += $args[0],
		$activeSlave.vaginalCount += $args[0]>>
	<<else>>
		<<set $vaginalTotal++,
		$activeSlave.vaginalCount++>>
	<</if>>
<</if>>
<</widget>>

/%
 Call as <<BothVCheck 10 5>> or <<BothVCheck>>
 $arg[0] is how many times to increment the Anal counts, if there is no Vagina available.
 $arg[1] is how many times to increment both holes counts (usually it is half of Anal).
 In both cases if left undefined it will assume it to be 1.
 This also checks for a valid Vagina/Accessory, though most code I've seen does this already, you
 never know when someone might use the routine and forget to do such.
%/
<<widget "BothVCheck">>
<<if canDoVaginal($activeSlave)>>
	<<if ($activeSlave.vagina eq 0)>>
		<<if canDoAnal($activeSlave) && ($activeSlave.anus eq 0)>>
			@@color:lime;This breaks in $activeSlave.slaveName's virgin holes.@@
			<<if ($activeSlave.devotion > 50) || $activeSlave.career == "a slave since birth">>
				As it's her first time, you ease yourself into her pussy before gradually working your way into her ass and alternate between the two holes while she moans. @@color:hotpink;She's so devoted she enjoys being fucked in both holes for the first time.@@ She looks forward to having her holes fucked by you again.
				<<set $activeSlave.devotion += 4>>
			<<elseif ($activeSlave.devotion <= 20)>>
				You force yourself into her pussy before working your way into her ass. She sobs and cries with disgust while you alternate between the two holes. She @@color:mediumorchid;hates@@ losing her virginity and anal virginity in one @@color:gold;brutal@@ incident. She dreads having her holes violated by you again.
				<<set $activeSlave.trust -= 5, $activeSlave.devotion -= 5>>
			<<else>>
				As it's her first time, you ease yourself into her pussy before gradually working your way into her ass and alternate between the two holes while she moans. She accepts being fucked in both holes for the first time. She looks forward to having her holes fucked by you again.
			<</if>>
			<<set $activeSlave.anus to 1>>
		<<elseif canDoAnal($activeSlave)>>
			@@color:lime;This breaks in $activeSlave.slaveName's virgin pussy.@@
			<<set $activeSlave.vagina++>>
			<<if ($activeSlave.devotion > 20) || $activeSlave.career == "a slave since birth">>
				As it's her first time, you ease yourself into her pussy and gradually speed up your thrusts while she slowly learns to move her hips along with you. She moans loudly. @@color:hotpink;She enjoys losing her cherry to you.@@ She looks forward to having her pussy fucked by you again.
				<<set $activeSlave.devotion += 4>>
			<<elseif ($activeSlave.devotion < -20)>>
				You force yourself into her pussy. She sobs and cries with disgust while you continue working her fuck hole. She @@color:mediumorchid;hates@@ and @@color:gold;fears@@ you for taking her virginity. She dreads having her pussy violated by you again.
				<<set $activeSlave.trust -= 5, $activeSlave.devotion -= 5>>
			<<else>>
				As it's her first time, you ease yourself into her pussy before gradually increasing the intensity of your thrusts while she softly moans. She accepts losing her virginity to her owner. She looks forward to having her pussy fucked by you again.
			<</if>>
		<</if>>
		<<set $activeSlave.vagina to 1>>
	<<elseif ($activeSlave.anus eq 0)>>
		@@color:lime;This breaks in $activeSlave.slaveName's virgin ass.@@
		<<if ($activeSlave.devotion > 50) || $activeSlave.career == "a slave since birth">>
			As it's her first time, you ease yourself into her butthole and gradually speed up your thrusts while she slowly learns to move her hips along with you. She moans loudly. She thinks of losing her anal virginity to you as a @@color:hotpink;connection@@ with her beloved master. She looks forward to having her asshole fucked by you again.
			<<set $activeSlave.devotion += 4>>
		<<elseif ($activeSlave.devotion > 20)>>
			As it's her first time, you ease yourself into her butthole and gradually increase the intensity of your thrusts. She accepts the pain and humiliation of anal sex as part of her sexual servitude, though she hopes that her next time will be less painful.
		<<elseif ($activeSlave.devotion >= -20)>>
			You force yourself into her butthole. She sobs and cries with disgust while you continue thrusting into her ass. She @@color:gold;fears@@ her next anal sex, remembering the pain of losing her anal virginity. She dreads having her ass violated by you again.
			<<set $activeSlave.trust -= 5>>
		<<else>>
			You force yourself into her butthole. She sobs and cries with disgust while you continue thrusting into her ass. She @@color:mediumorchid;hates@@ and @@color:gold;fears@@ you for violating her virgin butt. She dreads having her ass fucked by you again.
			<<set $activeSlave.trust -= 5, $activeSlave.devotion -= 5>>
		<</if>>
		<<set $activeSlave.anus to 1>>
	<</if>>
	<<if $args[1]>>
		<<set $vaginalTotal += $args[1], $analTotal += $args[1],
		$activeSlave.vaginalCount += $args[1], $activeSlave.analCount += $args[1]>>
	<<else>>
		<<set $vaginalTotal++, $analTotal++,
		$activeSlave.vaginalCount++, $activeSlave.analCount++>>
	<</if>>
<<elseif canDoAnal($activeSlave)>>
	<<if ($activeSlave.anus eq 0)>>
		@@color:lime;This breaks in $activeSlave.slaveName's virgin ass.@@
		<<if ($activeSlave.devotion > 50) || $activeSlave.career == "a slave since birth">>
			As it's her first time, you ease yourself into her butthole and gradually speed up your thrusts while she slowly learns to move her hips along with you. She moans loudly. She thinks of losing her anal virginity to you as a @@color:hotpink;connection@@ with her beloved master. She looks forward to having her asshole fucked by you again.
			<<set $activeSlave.devotion += 4>>
		<<elseif ($activeSlave.devotion > 20)>>
			As it's her first time, you ease yourself into her butthole and gradually increase the intensity of your thrusts. She accepts the pain and humiliation of anal sex as part of her sexual servitude, though she hopes that her next time will be less painful.
		<<elseif ($activeSlave.devotion >= -20)>>
			You force yourself into her butthole. She sobs and cries with disgust while you continue thrusting into her ass. She @@color:gold;fears@@ her next anal sex, remembering the pain of losing her anal virginity. She dreads having her ass violated by you again.
			<<set $activeSlave.trust -= 5>>
		<<else>>
			You force yourself into her butthole. She sobs and cries with disgust while you continue thrusting into her ass. She @@color:mediumorchid;hates@@ and @@color:gold;fears@@ you for violating her virgin butt. She dreads having her ass fucked by you again.
			<<set $activeSlave.trust -= 5, $activeSlave.devotion -= 5>>
		<</if>>
		<<set $activeSlave.anus to 1>>
	<</if>>
	<<if $args[0]>>
		<<set $analTotal += $args[0],
		$activeSlave.analCount += $args[0]>>
	<<else>>
		<<set $analTotal++,
		$activeSlave.analCount++>>
	<</if>>
<</if>>
<</widget>>

/%
 Call as <<SimpleVCheck 5>> or <<SimpleVCheck>>
 $arg[0] is how many times to increment either the Vaginal or the Anal counts, if there is no Vagina available.
 If left undefined it will assume it to be 1.
%/
<<widget "SimpleVCheck">>
<<if canDoVaginal($activeSlave)>>
	<<if ($activeSlave.vagina eq 0)>>
		@@color:lime;This breaks in $activeSlave.slaveName's virgin pussy.@@
		<<if ($activeSlave.devotion > 20) || $activeSlave.career == "a slave since birth">>
			As it's her first time, you ease yourself into her pussy and gradually speed up your thrusts while she slowly learns to move her hips along with you. Her moans become louder and louder. @@color:hotpink;She enjoys losing her cherry to you.@@ She looks forward to having her pussy fucked by you again.
			<<set $activeSlave.devotion += 4>>
		<<elseif ($activeSlave.devotion < -20)>>
			You force yourself into her pussy. She sobs and cries with disgust while you continue working her fuck hole. She @@color:mediumorchid;hates@@ and @@color:gold;fears@@ you for taking her virginity.She dreads having her pussy fucked by you again.
			<<set $activeSlave.trust -= 5, $activeSlave.devotion -= 5>>
		<<else>>
			As it's her first time, you ease yourself into her pussy and gradually speed up your thrusts while she slowly learns to move her hips along with you. She accepts losing her virginity to her owner. She looks forward to having her pussy fucked by you again.
		<</if>>
		<<set $activeSlave.vagina to 1>>
	<</if>>
	<<if $args[0]>>
		<<set $vaginalTotal += $args[0],
		$activeSlave.vaginalCount += $args[0]>>
	<<else>>
		<<set $vaginalTotal++,
		$activeSlave.vaginalCount++>>
	<</if>>
<<elseif canDoAnal($activeSlave)>>
	<<if ($activeSlave.anus eq 0)>>
		@@color:lime;This breaks in $activeSlave.slaveName's virgin ass.@@
		<<if ($activeSlave.devotion > 50) || $activeSlave.career == "a slave since birth">>
			As it's her first time, you gently ease yourself into her butthole and gradually increase the intensity of your thrusts. Before long she's moaning loudly as you continue working away at her butthole. She thinks of losing her anal virginity to you as a @@color:hotpink;connection@@ with her beloved master. She looks forward to having her asshole fucked by you again.
			<<set $activeSlave.devotion += 4>>
		<<elseif ($activeSlave.devotion > 20)>>
			As it's her first time, you gently ease yourself into her butthole and gradually increase the intensity of your thrusts. Before long she's moaning loudly as you continue working away at her butthole. She accepts the pain and humiliation of anal sex as part of her sexual servitude. She looks forward to having her asshole fucked by you again.
		<<elseif ($activeSlave.devotion >= -20)>>
			You force yourself into her butthole. She sobs and cries with disgust while you continue thrusting into her ass. She @@color:gold;fears@@ her next anal sex, remembering the pain of losing her anal virginity. She dreads having her ass fucked by you again.
			<<set $activeSlave.trust -= 5>>
		<<else>>
			You force yourself into her butthole. She sobs and cries with disgust while you continue thrusting into her ass. She @@color:mediumorchid;hates@@ and @@color:gold;fears@@ you for violating her virgin butt. She dreads having her ass fucked by you again.
			<<set $activeSlave.trust -= 5, $activeSlave.devotion -= 5>>
		<</if>>
		<<set $activeSlave.anus to 1>>
	<</if>>
	<<if $args[0]>>
		<<set $analTotal += $args[0],
		$activeSlave.analCount += $args[0]>>
	<<else>>
		<<set $analTotal++,
		$activeSlave.analCount++>>
	<</if>>
<</if>>
<</widget>>

/%
 Call as <<PartnerVCheck 10 5>> or <<PartnerVCheck>>
 $arg[0] is how many times to increment the Anal counts, if there is no Vagina available.
 $arg[1] is how many times to increment both holes counts (usually it is half of Anal).
 In both cases if left undefined it will assume it to be 1.
 This also checks for a valid Vagina/Accessory, though most code I've seen does this already, you
 never know when someone might use the routine and forget to do such.
%/
<<widget "PartnerVCheck">>

<<if canDoVaginal($partner)>>
	<<if ($partner.vagina == 0)>>
		<<if canDoAnal($partner) && ($partner.anus eq 0)>>
			Since it's $partner.slaveName's first time, you take your time and gently ease yourself into her pussy before gradually working your way into her butthole, alternating between her holes. @@color:lime;This breaks in $partner.slaveName's virgin holes.
			<<set $partner.vagina++, $partner.anus++>>
		<<else>>
			Since it's $partner.slaveName's first time, you take your time and gently ease yourself into her pussy before gradually increasing the intensity of your thrusts. @@color:lime;This breaks in $partner.slaveName's virgin pussy.
			<<set $partner.vagina++>>
		<</if>>
	<<elseif canDoAnal($partner) && ($partner.anus eq 0)>>
		Since it's $partner.slaveName's first time, you take your time and gently ease yourself into her butthole before gradually increasing the intensity of your thrusts into her ass. @@color:lime;This breaks in $partner.slaveName's virgin ass.
		<<set $partner.anus++>>
	<</if>>
	<<if $args[1]>>
		<<set $vaginalTotal += $args[1], $analTotal += $args[1],
		$partner.vaginalCount += $args[1], $partner.analCount += $args[1]>>
	<<else>>
		<<set $vaginalTotal++, $analTotal++,
		$partner.vaginalCount++, $partner.analCount++>>
	<</if>>
<<elseif canDoAnal($partner)>>
	<<if ($partner.anus eq 0)>>
		Since it's $partner.slaveName's first time, you take your time and gently ease yourself into her butthole before gradually increasing the intensity of your thrusts into her ass. This breaks in $partner.slaveName's virgin ass.
		<<set $partner.anus++>>
	<</if>>
	<<if $args[0]>>
		<<set $analTotal += $args[0],
		$partner.analCount += $args[0]>>
	<<else>>
		<<set $analTotal++,
		$partner.analCount++>>
	<</if>>
<</if>>
@@
<</widget>>

/%
 Call as <<SlaveInteractImpreg>>
%/
<<widget "SlaveInteractImpreg">>
<<replace #impreg>>
	<<if ((canGetPregnant($activeSlave)) && ($activeSlave.clothes != "a Fuckdoll suit"))>>
		<<if ($PC.dick != 0 && $activeSlave.eggType == "human")>>
		| <<link "Impregnate her yourself">><<replace "#miniscene">><<include "FPCImpreg">><br>&nbsp;&nbsp;&nbsp;&nbsp;<</replace>><<SlaveInteractImpreg>><<SlaveInteractFertility>><</link>>
		<</if>>
	| [[Use another slave to impregnate her|FSlaveImpreg]]
	<</if>>
	<<if $activeSlave.preg <= 0 && $activeSlave.bellyImplant == 0>>
	<<if $activeSlave.assignment != "work in the dairy" && $activeSlave.assignment != "be confined in the arcade">>
	<<if $enema == 1>>
	<<if $activeSlave.inflation < 3>>
	<<if $activeSlave.inflationType == "water" || $activeSlave.inflationType == "none">>
		| <<link "Fill her ass with water">><<set $activeSlave.inflationType to "water">><<set $activeSlave.inflationMethod to 2>><<replace "#miniscene">><<include "FillUpButt">><br><</replace>><<SlaveInteractImpreg>><<SlaveInteractFertility>><</link>>
	<</if>>
	<</if>>
	<</if>>
	<<if $dairyPiping == 1>>
	<<if ($milkWeek > 88 && $milkWeek != 0) || $arcologies[0].FSPastoralistLaw == 1>>
	<<if $activeSlave.inflation < 3>>
	<<if $activeSlave.inflationType == "milk" || $activeSlave.inflationType == "none">>
		| <<link "Fill her ass with milk">><<set $activeSlave.inflationType to "milk">><<set $activeSlave.inflationMethod to 2>><<replace "#miniscene">><<include "FillUpButt">><br><</replace>><<SlaveInteractImpreg>><<SlaveInteractFertility>><</link>>
		| <<link "Force feed her milk">><<set $activeSlave.inflationType to "milk">><<set $activeSlave.inflationMethod to 1>><<replace "#miniscene">><<include "FillUpFace">><br><</replace>><<SlaveInteractImpreg>><<SlaveInteractFertility>><</link>>
	<</if>>
	<</if>>
	<<else>>
		| //$dairyNameCaps is not producing enough milk to pump through the pipes//
	<</if>>
	<<if ($cumWeek > 88 && $cumWeek != 0) || $arcologies[0].FSPastoralistLaw == 1>>
	<<if $activeSlave.inflation < 3>>
	<<if $activeSlave.inflationType == "cum" || $activeSlave.inflationType == "none">>
		| <<link "Fill her ass with cum">><<set $activeSlave.inflationType to "cum">><<set $activeSlave.inflationMethod to 2>><<replace "#miniscene">><<include "FillUpButt">><br><</replace>><<SlaveInteractImpreg>><<SlaveInteractFertility>><</link>>
		| <<link "Force feed her cum">><<set $activeSlave.inflationType to "cum">><<set $activeSlave.inflationMethod to 1>><<replace "#miniscene">><<include "FillUpFace">><br><</replace>><<SlaveInteractImpreg>><<SlaveInteractFertility>><</link>>
	<</if>>
	<</if>>
	<<else>>
		| //$dairyNameCaps is not producing enough cum to pump through the pipes//
	<</if>>
	<</if>>
	<</if>>
	<</if>>
	<<if ($activeSlave.preg <= 0) && ($activeSlave.inflation == 0) && ($activeSlave.bellyImplant == 0)>>
	<<if $activeSlave.assignment != "work in the dairy" || $activeSlave.assignment != "be confined in the arcade">>
		| [[Use another slave to forcefeed her|SlaveOnSlaveFeedingWorkAround]]
	<</if>>
	<</if>>
	<</replace>>
<</widget>>

/%
 Call as <<SlaveInteractFertility>>
%/
<<widget "SlaveInteractFertility">>
<<replace #fertilityblock>>
<<if $activeSlave.fuckdoll == 0 && ($activeSlave.ovaries == 1 || $activeSlave.mpreg == 1)>>
	<<if ($activeSlave.preg < -1)>>
		//She is sterile//
	<<elseif ($activeSlave.pubertyXX == 0)>>
		//She is not yet fertile//
	<<elseif $activeSlave.physicalAge >= 47>>
		//She is too old to become pregnant//
	<<elseif ($activeSlave.preg >= -1)>>
	__Contraception__: <span id="fertility"><strong><<if $activeSlave.preg is -1>><<print "using contraceptives">><<elseif $activeSlave.preg == 0>><<print "fertile">><<elseif $activeSlave.preg < 4>><<print "may be pregnant">><<else>><<print $activeSlave.preg>><<print " weeks pregnant">><</if>></strong></span>.
	<<if ($activeSlave.preg == 0)>>
		<<link "Use contraceptives">><<set $activeSlave.preg to -1>><<SlaveInteractImpreg>><<SlaveInteractFertility>><</link>>
	<<elseif ($activeSlave.preg is -1)>>
		<<link "Let her get pregnant">><<set $activeSlave.preg to 0>><<SlaveInteractImpreg>><<SlaveInteractFertility>><</link>>
	<<elseif $activeSlave.induce == 1>>
		//Hormones are being slipped into her food, she will give birth suddenly and rapidly this week//
	<<elseif ($activeSlave.preg > 30) && ($activeSlave.pregType < 50) && ($activeSlave.labor == 0)>>
		[[Induce labor|Slave Interact][$activeSlave.labor to 1,$activeSlave.induce to 1,$birthee to 1]]
	<<elseif ($activeSlave.pregType is 50) && ($activeSlave.preg > 30)>>
		[[Induce mass childbirth|BirthStorm]]
	<<elseif ($activeSlave.preg > 0) && ($activeSlave.pregType < 50) && $activeSlave.breedingMark == 1 && $activeSlave.pregSource == -1>>
		//You are forbidden from aborting an elite child//
	<<elseif ($activeSlave.preg > 0) && ($activeSlave.pregType < 50)>>
		[[Abort her pregnancy|Abort]]
	<</if>>
	<</if>>
<<elseif ($activeSlave.ovaries == 1 || $activeSlave.mpreg == 1)>>
	<<if ($activeSlave.preg < -1)>>
		//It is sterile//
	<<elseif ($activeSlave.pubertyXX == 0)>>
		//It is not yet fertile//
	<<elseif $activeSlave.physicalAge >= 47>>
		//It is too old to become pregnant//
	<<elseif ($activeSlave.preg >= -1)>>
	__Contraception__: <span id="fertility"><strong><<if $activeSlave.preg is -1>><<print "using contraceptives">><<elseif $activeSlave.preg == 0>><<print "fertile">><<elseif $activeSlave.preg < 4>><<print "may be pregnant">><<else>><<print $activeSlave.preg>><<print " weeks pregnant">><</if>></strong></span>.
	<<if ($activeSlave.preg == 0)>>
		<<link "Use contraceptives">><<set $activeSlave.preg to -1>><<SlaveInteractFertility>><</link>>
	<<elseif ($activeSlave.preg is -1)>>
		<<link "Let her get pregnant">><<set $activeSlave.preg to 0>><<SlaveInteractFertility>><</link>>
	<<elseif ($activeSlave.pregType is 50) && ($activeSlave.preg > 30)>>
		[[Induce mass childbirth|BirthStorm]]
	<<elseif ($activeSlave.preg > 0) && ($activeSlave.pregType < 50)>>
		[[Abort her pregnancy|Abort]]
	<</if>>
	<</if>>
<</if>>
<<if ($activeSlave.preg > 1) && ($pregSpeedControl == 1) && ($activeSlave.breedingMark != 1) && ($activeSlave.indentureRestrictions < 1) && ($activeSlave.pregType < 50)>>
<br>&nbsp;&nbsp;&nbsp;&nbsp;
	__Pregnancy control__: <span id="pregControl"><<if $activeSlave.pregControl == "labor supressors">>Labor is supressed<<elseif $activeSlave.pregControl == "slow gestation">>Slowed gestation<<elseif $activeSlave.pregControl == "speed up">>Faster gestation<<else>>Normal gestation<</if>></span>
	<<if ($activeSlave.preg >= 30)>>
		<br>&nbsp;&nbsp;&nbsp;&nbsp;
		<<if $activeSlave.pregControl == "labor supressors">>
			<<link "Normal Birth">><<set $activeSlave.pregControl = "none">><<replace "#pregControl">>natural birth<</replace>><</link>>
		<<else>>
			<<link "Supress Labor">><<set $activeSlave.pregControl = "labor supressors">><<replace "#pregControl">>labor will be supressed<</replace>><</link>>
		<</if>>
	<<elseif ($activeSlave.preg < 30)>>
		<br>&nbsp;&nbsp;&nbsp;&nbsp;
		<<if $activeSlave.pregControl != "none">>
			<<link "Normal Gestation">><<set $activeSlave.pregControl = "none">><<replace "#pregControl">>normal gestation speed<</replace>><</link>> |
		<</if>>
		<<if $activeSlave.pregControl != "slow Gestation">>
			<<link "Slow Gestation">><<set $activeSlave.pregControl = "slow gestation">><<replace "#pregControl">>slowed gestation speed<</replace>><</link>> |
		<</if>>
		<<if $activeSlave.pregControl != "speed up">>
			<<link "Fast Gestation">><<set $activeSlave.pregControl = "speed up">><<replace "#pregControl">>fast gestation speed, staffed clinic recommended<</replace>><</link>>
		<</if>>
	<</if>>
<</if>>
<</replace>>
<</widget>>
/%
 Call as <<SlaveInteractSexOption>>
%/
<<widget "SlaveInteractSexOption">>
<<replace #sexoption>>
	<<if ($activeSlave.vagina > -1)>>
		<<if canDoVaginal($activeSlave)>>
		<<link "Fuck her">><<replace "#miniscene">><<include "FVagina">><br><</replace>><</link>>
		<<if canDoAnal($activeSlave)>>
			| <<link "Use her holes">><<replace "#miniscene">><<include "FButt">><br>&nbsp;&nbsp;&nbsp;&nbsp;<</replace>><</link>> |
		<</if>>
		<<else>>
		//Remove her chastity belt if you wish to fuck her// |
		<</if>>
	<</if>>
<</replace>>
<</widget>>
/%
 Call as <<SlaveInteractAnalSexOption>>
%/
<<widget "SlaveInteractAnalSexOption">>
<<replace #analsexoption>>
	<<if canDoAnal($activeSlave)>>
		<<link "Fuck her ass">><<replace "#miniscene">><<include "FAnus">><br>&nbsp;&nbsp;&nbsp;&nbsp;<</replace>><</link>>
	<<else>>
		//Remove her chastity belt if you wish to fuck her ass// |
	<</if>>
<</replace>>
<</widget>>
/%
 Call as <<SlaveInteractAnalGropeOption>>
%/
<<widget "SlaveInteractAnalGropeOption">>
<<replace #analgropeoption>>
	<<if canDoAnal($activeSlave)>>
		| <<link "Grope her butt">><<replace "#miniscene">><<include "FondleButt">><br>&nbsp;&nbsp;&nbsp;&nbsp;<</replace>><</link>>
	<</if>>
<</replace>>
<</widget>>
/%
 Call as <<SlaveInteractGropeOption>>
%/
<<widget "SlaveInteractGropeOption">>
<<replace #gropeoption>>
	<<if ($activeSlave.vagina > -1)>>
		<<if canDoVaginal($activeSlave)>>
		| <<link "Grope her pussy">><<replace "#miniscene">><<include "FondleVagina">><br>&nbsp;&nbsp;&nbsp;&nbsp;<</replace>><</link>>
		<</if>>
	<</if>>
<</replace>>
<</widget>>
/%
 Call as <<SlaveInteractDickGropeOption>>
%/
<<widget "SlaveInteractDickGropeOption">>
<<replace #dickgropeoption>>
	<<if ($activeSlave.dick >0)>>
		<<if ($activeSlave.dickAccessory != "chastity") && ($activeSlave.dickAccessory != "combined chastity")>>
		| <<link "Grope her dick">><<replace "#miniscene">><<include "FondleDick">><br>&nbsp;&nbsp;&nbsp;&nbsp;<</replace>><</link>>
		<<else>>
		| //Remove her dick chastity belt if you wish to play with her cock//
		<</if>>
	<</if>>
<</replace>>
<</widget>>
/%
 Call as <<agentLeadership>>
 Must be within $arcologies[$i] <<for>> loop
%/
<<widget "agentLeadership">>
<<set $agentBonus = 0>>
<<for _j to 1; _j < $leaders.length; _j++>>
	<<if $arcologies[$i].leaderID == $leaders[_j].ID>>
		<<set $agentBonus == $leaders[_j].intelligence>>
		<<set $agentBonus += $leaders[_j].intelligenceImplant>>
		<<if $leaders[_j].actualAge > 35>>
			<<set $agentBonus += 1>>
		<</if>>
		<<if $leaders[_j].career is "an arcology owner">>
			<<set $agentBonus += 1>>
		<<elseif $HGCareers.contains($leaders[_j].career)>>
			<<set $agentBonus += 1>>
		<</if>>
		<<if $leaders[_j].fetishStrength > 95>>
		<<if ($leaders[_j].fetish is "dom") || ($leaders[_j].fetish is "sadist")>>
			<<set $agentBonus += 1>>
		<<elseif ($leaders[_j].fetish is "dom") || ($leaders[_j].fetish is "sadist")>>
			<<set $agentBonus -= 1>>
		<</if>>
		<</if>>
		<<if $leaders[_j].energy > 95>>
			<<set $agentBonus += 1>>
		<</if>>
	<<break>>
	<</if>>
<</for>>
<<if $agentBonus > random(0,5)>>
	<<set $agentBonus = 1>>
<<else>>
	<<set $agentBonus = 0>>
<</if>>
<</widget>>

/%
 Call as <<PCTitle>>
%/
<<widget "PCTitle">>

<<set $PCTitle to $PCName>>
<<set $titles = []>>

<<if $cheater == 1>>
	<<set $PCTitle to ($PCTitle + " the Cheater")>>
<<elseif $arcologies[0].FSRestart > 10>>
	<<set $PCTitle to ($PCTitle + " of the Societal Elite")>>
<<elseif $rep > 18000>>
	<<set $PCTitle to ($PCTitle + " the Great")>>
<<elseif $rep > 17000>>
	<<set $PCTitle to ("the exalted " + $PCTitle)>>
<<elseif $rep > 16000>>
	<<set $PCTitle to ("the illustrious " + $PCTitle)>>
<<elseif $rep > 15000>>
	<<set $PCTitle to ("the prestigious " + $PCTitle)>>
<<elseif $rep > 14000>>
	<<set $PCTitle to ("the renowned " + $PCTitle)>>
<<elseif $rep > 13000>>
	<<set $PCTitle to ("the famed " + $PCTitle)>>
<<elseif $rep > 12000>>
	<<set $PCTitle to ("the celebrated " + $PCTitle)>>
<<elseif $rep > 11000>>
	<<set $PCTitle to ("the honored " + $PCTitle)>>
<<elseif $rep > 10000>>
	<<set $PCTitle to ("the acclaimed " + $PCTitle)>>
<<elseif $rep > 9000>>
	<<set $PCTitle to ("the eminent " + $PCTitle)>>
<<elseif $rep > 8250>>
	<<set $PCTitle to ("the prominent " + $PCTitle)>>
<<elseif $rep > 7500>>
	<<set $PCTitle to ("the distinguished " + $PCTitle)>>
<<elseif $rep > 6750>>
	<<set $PCTitle to ("the admired " + $PCTitle)>>
<<elseif $rep > 6000>>
	<<set $PCTitle to ("the esteemed " + $PCTitle)>>
<<elseif $rep > 5250>>
	<<set $PCTitle to ("the respected " + $PCTitle)>>
<<elseif $rep > 4500>>
	<<set $PCTitle to ("the known " + $PCTitle)>>
<<elseif $rep > 3750>>
	<<set $PCTitle to ("the recognized " + $PCTitle)>>
<<elseif $rep > 3000>>
	<<set $PCTitle to ("the rumored " + $PCTitle)>>
<</if>>

<<set $PCTitle to ($PCTitle + ", ")>>

<<if $PCName is "FC Dev">>
	<<set $titles.push("the Creator")>>
<</if>>

<<if $plot == 1>>
	<<if $invasionVictory is 3>>
	<<if $PC.title == 1>>
		<<set $titles.push("Hero of the City")>>
	<<else>>
		<<set $titles.push("Heroine of the City")>>
	<</if>>
	<<elseif $invasionVictory is 2>>
	<<set $titles.push("Defender of the City")>>
	<</if>>
	<<if $daughtersVictory is 3>>
	<<set $titles.push("Destroyer of the Daughters")>>
	<<elseif $daughtersVictory is 2>>
	<<if $PC.title == 1>>
		<<set $titles.push("Victor over the Daughters")>>
	<<else>>
		<<set $titles.push("Victrix over the Daughters")>>
	<</if>>
	<</if>>
<</if>>

<<if $mercenaries >= 5>>
	<<if $mercenariesTitle is "Evocati">>
	<<set $seed to $mercenariesTitle>>
	<<set $seed to ("Princeps of the " + $seed)>>
	<<set $titles.push($seed)>>
	<<elseif $mercenariesTitle is "Knights">>
	<<set $seed to $mercenariesTitle>>
	<<if $PC.title == 1>>
		<<set $seed to ("Lord Commander of the " + $seed)>>
	<<else>>
		<<set $seed to ("Lady Commander of the " + $seed)>>
	<</if>>
	<<set $titles.push($seed)>>
	<<elseif $mercenariesTitle is "Immortals">>
	<<set $seed to $mercenariesTitle>>
	<<set $seed to ("Tyrant of the " + $seed)>>
	<<set $titles.push($seed)>>
	<<else>>
	<<set $seed to $mercenariesTitle>>
	<<set $seed to ("Commander of the " + $seed)>>
	<<set $titles.push($seed)>>
	<</if>>
<<elseif $mercenaries >= 1>>
	<<set $titles.push("Commander of the Mercenaries")>>
<</if>>

<<if $dispensary == 1>>
	<<if $PC.title == 1>>
		<<set $titles.push("Pharmacologos")>>
	<<else>>
		<<set $titles.push("Pharmacologes")>>
	<</if>>
<</if>>

<<if $arcologies[0].FSSupremacist >= $FSLockinLevel*0.9>>
	<<set $titles.push("Grand Champion of the Blood")>>
<<elseif $arcologies[0].FSSupremacist >= $FSLockinLevel*0.6>>
	<<set $titles.push("Champion of the Blood")>>
<<elseif $arcologies[0].FSSupremacist >= $FSLockinLevel*0.3>>
	<<set $titles.push("Defender of the Blood")>>
<</if>>

<<if $arcologies[0].FSSubjugationist >= $FSLockinLevel*0.9>>
	<<set $titles.push("Grand Overseer of the Inferior Race")>>
<<elseif $arcologies[0].FSSubjugationist >= $FSLockinLevel*0.6>>
	<<set $titles.push("Overseer of the Inferior Race")>>
<<elseif $arcologies[0].FSSubjugationist >= $FSLockinLevel*0.3>>
	<<set $titles.push("Subduer of the Inferior Race")>>
<</if>>

<<if $arcologies[0].FSGenderRadicalist >= $FSLockinLevel*0.9>>
	<<set $titles.push("Buttfucker of All Slaves")>>
<<elseif $arcologies[0].FSGenderRadicalist >= $FSLockinLevel*0.6>>
	<<set $titles.push("Sodomizer of the Traps")>>
<<elseif $arcologies[0].FSGenderRadicalist >= $FSLockinLevel*0.3>>
	<<if $PC.title == 1>>
	<<set $titles.push("Penetrator of the Sissies")>>
	<<else>>
	<<set $titles.push("Penetratrix of the Sissies")>>
	<</if>>
<</if>>

<<if $arcologies[0].FSGenderFundamentalist >= $FSLockinLevel*0.9>>
	<<if $PC.title == 1>>
	<<set $titles.push("Father to the City")>>
	<<else>>
	<<set $titles.push("Mother to the City")>>
	<</if>>
<<elseif $arcologies[0].FSGenderFundamentalist >= $FSLockinLevel*0.6>>
	<<set $titles.push("Defender of Women")>>
<<elseif $arcologies[0].FSGenderFundamentalist >= $FSLockinLevel*0.3>>
	<<set $titles.push("Restorer of Morals")>>
<</if>>

<<if $arcologies[0].FSPaternalist >= $FSLockinLevel*0.9>>
	<<if $PC.title == 1>>
	<<set $titles.push("Protector to All Slaves")>>
	<<else>>
	<<set $titles.push("Protectrix to All Slaves")>>
	<</if>>
<<elseif $arcologies[0].FSPaternalist >= $FSLockinLevel*0.6>>
	<<if $PC.title == 1>>
	<<set $titles.push("Benefactor of Slaves")>>
	<<else>>
	<<set $titles.push("Benefactrix of Slaves")>>
	<</if>>
<<elseif $arcologies[0].FSPaternalist >= $FSLockinLevel*0.3>>
	<<set $titles.push("Pursuer of Justice")>>
<</if>>

<<if $arcologies[0].FSRepopulationFocus >= $FSLockinLevel*0.9>>
		<<set $titles.push("the Savior of the Future")>>
<<elseif $arcologies[0].FSRepopulationFocus >= $FSLockinLevel*0.6>>
	<<set $titles.push("the Holder of the Future")>>
<<elseif $arcologies[0].FSRepopulationFocus >= $FSLockinLevel*0.3>>
	<<set $titles.push("the Repopulist")>>
<</if>>

<<if $arcologies[0].FSDegradationist >= $FSLockinLevel*0.9>>
	<<set $titles.push("Holder of the Rod and the Lash")>>
<<elseif $arcologies[0].FSDegradationist >= $FSLockinLevel*0.6>>
	<<set $titles.push("Subduer of Slaves")>>
<<elseif $arcologies[0].FSDegradationist >= $FSLockinLevel*0.3>>
	<<set $titles.push("Pursuer of Justice")>>
<</if>>

<<if $arcologies[0].FSBodyPurist >= $FSLockinLevel*0.9>>
	<<set $titles.push("the Purifier of the Breasts")>>
<<elseif $arcologies[0].FSBodyPurist >= $FSLockinLevel*0.6>>
	<<set $titles.push("the Discerning")>>
<<elseif $arcologies[0].FSBodyPurist >= $FSLockinLevel*0.3>>
	<<set $titles.push("the Tasteful")>>
<</if>>

<<if $arcologies[0].FSAssetExpansionist >= $FSLockinLevel*0.9>>
	<<set $titles.push("the Expander of the Breasts")>>
<<elseif $arcologies[0].FSAssetExpansionist >= $FSLockinLevel*0.6>>
	<<set $titles.push("the Expander")>>
<<elseif $arcologies[0].FSAssetExpansionist >= $FSLockinLevel*0.3>>
	<<if $PC.title == 1>>
	<<set $titles.push("the Implantor")>>
	<<else>>
	<<set $titles.push("the Implantrix")>>
	<</if>>
<</if>>

<<if $arcologies[0].FSPastoralist >= $FSLockinLevel*0.9>>
	<<if $PC.title == 1>>
	<<set $titles.push("the Master of Stock")>>
	<<else>>
	<<set $titles.push("the Mistress of Stock")>>
	<</if>>
<<elseif $arcologies[0].FSPastoralist >= $FSLockinLevel*0.6>>
	<<set $titles.push("the Rancher")>>
<<elseif $arcologies[0].FSPastoralist >= $FSLockinLevel*0.3>>
	<<set $titles.push("the Farmer")>>
<</if>>

<<if $arcologies[0].FSPhysicalIdealist >= $FSLockinLevel*0.9>>
	<<set $titles.push("beloved of Brodin")>>
<<elseif $arcologies[0].FSPhysicalIdealist >= $FSLockinLevel*0.6>>
	<<if $PC.title == 1>>
	<<set $titles.push("he of the godlike Body")>>
	<<else>>
	<<set $titles.push("she of the godlike Body")>>
	<</if>>
<<elseif $arcologies[0].FSPhysicalIdealist >= $FSLockinLevel*0.3>>
	<<set $titles.push("advancer of Gains")>>
<</if>>

<<if $arcologies[0].FSMaturityPreferentialist >= $FSLockinLevel*0.9>>
	<<set $titles.push("Grand Preserver of MILFS")>>
<<elseif $arcologies[0].FSMaturityPreferentialist >= $FSLockinLevel*0.6>>
	<<set $titles.push("Fucker of MILFS")>>
<<elseif $arcologies[0].FSMaturityPreferentialist >= $FSLockinLevel*0.3>>
	<<if $PC.title == 1>>
	<<set $titles.push("he of the notorious MILF preference")>>
	<<else>>
	<<set $titles.push("she of the notorious MILF preference")>>
	<</if>>
<</if>>

<<if $arcologies[0].FSYouthPreferentialist >= $FSLockinLevel*0.9>>
	<<set $titles.push("Keeper of the Magnificent Young Harem")>>
<<elseif $arcologies[0].FSYouthPreferentialist >= $FSLockinLevel*0.6>>
	<<set $titles.push("Keeper of Virgins")>>
<<elseif $arcologies[0].FSYouthPreferentialist >= $FSLockinLevel*0.3>>
	<<set $titles.push("the Virginbreaker")>>
<</if>>

<<if $arcologies[0].FSChattelReligionistLaw == 1>>
	<<set $titles.push("the Prophet")>>
<<elseif $arcologies[0].FSChattelReligionist >= $FSLockinLevel*0.9>>
	<<set $titles.push("Keeper of the Blade and Chalice")>>
<<elseif $arcologies[0].FSChattelReligionist >= $FSLockinLevel*0.6>>
	<<set $titles.push("Champion of the Faith")>>
<<elseif $arcologies[0].FSChattelReligionist >= $FSLockinLevel*0.3>>
	<<set $titles.push("the Holy")>>
<</if>>

<<if $arcologies[0].FSRomanRevivalist >= $FSLockinLevel*0.9>>
	<<set $titles.push("First Consul")>>
<<elseif $arcologies[0].FSRomanRevivalist >= $FSLockinLevel*0.6>>
	<<set $titles.push("Aedile")>>
<<elseif $arcologies[0].FSRomanRevivalist >= $FSLockinLevel*0.3>>
	<<set $titles.push("Quaestor")>>
<</if>>

<<if $arcologies[0].FSEgyptianRevivalist >= $FSLockinLevel*0.9>>
	<<if $PC.title == 1>>
	<<set $titles.push("the Living God")>>
	<<else>>
	<<set $titles.push("the Living Goddess")>>
	<</if>>
<<elseif $arcologies[0].FSEgyptianRevivalist >= $FSLockinLevel*0.6>>
	<<set $titles.push("Pharaoh")>>
<<elseif $arcologies[0].FSEgyptianRevivalist >= $FSLockinLevel*0.3>>
	<<if $PC.title == 1>>
	<<set $titles.push("Prince of the Nile")>>
	<<else>>
	<<set $titles.push("Princess of the Nile")>>
	<</if>>
<</if>>

<<if $arcologies[0].FSEdoRevivalist >= $FSLockinLevel*0.9>>
	<<if $PC.title == 1>>
	<<set $titles.push("Emperor and Descendant of Amaterasu")>>
	<<else>>
	<<set $titles.push("Amaterasu Reborn")>>
	<</if>>
<<elseif $arcologies[0].FSEdoRevivalist >= $FSLockinLevel*0.6>>
	<<set $titles.push("Shogun")>>
<<elseif $arcologies[0].FSEdoRevivalist >= $FSLockinLevel*0.3>>
	<<set $titles.push("Daimyo")>>
<</if>>

<<if $arcologies[0].FSArabianRevivalist >= $FSLockinLevel*0.9>>
	<<if $PC.title == 1>>
	<<set $titles.push("Caliph")>>
	<<else>>
	<<set $titles.push("Handmaiden of Allah")>>
	<</if>>
<<elseif $arcologies[0].FSArabianRevivalist >= $FSLockinLevel*0.6>>
	<<if $PC.title == 1>>
	<<set $titles.push("Sultan")>>
	<<else>>
	<<set $titles.push("Sultana")>>
	<</if>>
<<elseif $arcologies[0].FSArabianRevivalist >= $FSLockinLevel*0.3>>
	<<set $titles.push("Beloved of Allah")>>
<</if>>

<<if $arcologies[0].FSChineseRevivalist >= $FSLockinLevel*0.9>>
	<<if $PC.title == 1>>
	<<set $titles.push("Emperor and Holder of the Mandate of Heaven")>>
	<<else>>
	<<set $titles.push("Empress and Holder of the Mandate of Heaven")>>
	<</if>>
<<elseif $arcologies[0].FSChineseRevivalist >= $FSLockinLevel*0.6>>
	<<if $PC.title == 1>>
	<<set $titles.push("Emperor")>>
	<<else>>
	<<set $titles.push("Empress")>>
	<</if>>
<<elseif $arcologies[0].FSChineseRevivalist >= $FSLockinLevel*0.3>>
	<<if $PC.title == 1>>
	<<set $titles.push("Governor of the Province")>>
	<<else>>
	<<set $titles.push("Governess of the Province")>>
	<</if>>
<</if>>

<<if $brothelSlaves >= 15>>
	<<if $PC.title == 1>>
	<<set $titles.push("Procurator of the Brothel")>>
	<<else>>
	<<set $titles.push("Procuratrix of the Brothel")>>
	<</if>>
<</if>>
<<if $clubSlaves >= 15>>
	<<set $titles.push("First on the Club")>>
<</if>>
<<if $dairySlaves >= 15>>
	<<set $titles.push("Keeper of the Cattle")>>
<</if>>
<<if $cumSlaves >= 15>>
	<<if $PC.title == 1>>
	<<set $titles.push("Extractor of the Ejaculate")>>
	<<else>>
	<<set $titles.push("Extractrix of the Ejaculate")>>
	<</if>>
<</if>>
<<if $servantsQuartersSlaves >= 15>>
	<<if $PC.title == 1>>
	<<set $titles.push("Director of the Servants")>>
	<<else>>
	<<set $titles.push("Directrix of the Servants")>>
	<</if>>
<</if>>
<<if $schoolroomSlaves >= 10>>
	<<if $PC.title == 1>>
	<<set $titles.push("Educator of the Slaves")>>
	<<else>>
	<<set $titles.push("Educatrix of the Slaves")>>
	<</if>>
<</if>>
<<if $spaSlaves >= 10>>
	<<set $titles.push("Order of the Bath")>>
<</if>>
<<if $arcadeSlaves >= 15>>
	<<set $titles.push("Comptroller of the Arcade")>>
<</if>>

<<set $schoolsPresent to []>>
<<set $schoolsPerfected to []>>
<<if $TSS.schoolProsperity >= 10>>
	<<set $schoolsPerfected.push("The Slave School")>>
<<elseif $TSS.schoolPresent == 1>>
	<<set $schoolsPresent.push("The Slave School")>>
<</if>>
<<if $GRI.schoolProsperity >= 10>>
	<<set $schoolsPerfected.push("The Growth Research Institute")>>
<<elseif $GRI.schoolPresent == 1>>
	<<set $schoolsPresent.push("The Growth Research Institute")>>
<</if>>
<<if $SCP.schoolProsperity >= 10>>
	<<set $schoolsPerfected.push("St. Claver Preparatory")>>
<<elseif $SCP.schoolPresent == 1>>
	<<set $schoolsPresent.push("St. Claver Preparatory")>>
<</if>>
<<if $LDE.schoolProsperity >= 10>>
	<<set $schoolsPerfected.push("L'Ecole des Enculees")>>
<<elseif $LDE.schoolPresent == 1>>
	<<set $schoolsPresent.push("L'Ecole des Enculees")>>
<</if>>
<<if $TGA.schoolProsperity >= 10>>
	<<set $schoolsPerfected.push("The Gymnasium-Academy")>>
<<elseif $TGA.schoolPresent == 1>>
	<<set $schoolsPresent.push("The Gymnasium-Academy")>>
<</if>>
<<if $schoolsPerfected.length > 0>>
	<<if $PC.title == 1>>
	<<set $schoolTitle = "Benefactor of ">>
	<<else>>
	<<set $schoolTitle = "Benefactrix of ">>
	<</if>>
	<<for $i to 0; $i < $schoolsPerfected.length; $i++>>
	<<set $seed to $schoolsPerfected[$i]>>
	<<set $schoolTitle to ($schoolTitle + $seed)>>
	<<if $i < $schoolsPerfected.length-2>>
		<<set $schoolTitle to ($schoolTitle + ", ")>>
	<<elseif $i is $schoolsPerfected.length-2>>
		<<if $schoolsPerfected.length > 2>>
		<<set $schoolTitle to ($schoolTitle + ", and ")>>
		<<else>>
		<<set $schoolTitle to ($schoolTitle + " and ")>>
		<</if>>
	<</if>>
	<</for>>
	<<set $titles.push($schoolTitle)>>
<</if>>
<<if $schoolsPresent.length > 0>>
	<<set $schoolTitle = "Supporter of ">>
	<<for $i to 0; $i < $schoolsPresent.length; $i++>>
	<<set $seed to $schoolsPresent[$i]>>
	<<set $schoolTitle to ($schoolTitle + $seed)>>
	<<if $i < $schoolsPresent.length-2>>
		<<set $schoolTitle to ($schoolTitle + ", ")>>
	<<elseif $i is $schoolsPresent.length-2>>
		<<if $schoolsPresent.length > 2>>
		<<set $schoolTitle to ($schoolTitle + ", and ")>>
		<<else>>
		<<set $schoolTitle to ($schoolTitle + " and ")>>
		<</if>>
	<</if>>
	<</for>>
	<<set $titles.push($schoolTitle)>>
<</if>>
<<if $TFS.schoolProsperity >= 10>>
	<<set $titles.push("Honorary Sibling of the Futanari Sisters")>>
<<elseif $TFS.schoolPresent == 1>>
	<<if $PC.title == 1>>
	<<set $titles.push("Protector of the Futanari Sisters")>>
	<<else>>
	<<set $titles.push("Protectrix of the Futanari Sisters")>>
	<</if>>
<</if>>

<<if $slaves.length > 50>>
	<<if $PC.title == 1>>
	<<set $titles.push("Master of Slaves")>>
	<<else>>
	<<set $titles.push("Mistress of Slaves")>>
	<</if>>
<<elseif $slaves.length > 40>>
	<<set $titles.push("Holder of Slaves")>>
<<elseif $slaves.length > 30>>
	<<set $titles.push("Keeper of Slaves")>>
<<elseif $slaves.length > 20>>
	<<set $titles.push("Manager of Slaves")>>
<<elseif $slaves.length > 10>>
	<<set $titles.push("owner of slaves")>>
<</if>>

<<if $corpValue > 500000>>
	<<set $titles.push("Corporate Titan")>>
<<elseif $corpValue > 250000>>
	<<set $titles.push("corporate innovator")>>
<<elseif $corpValue > 100000>>
	<<set $titles.push("corporate founder")>>
<<elseif $corpValue > 0>>
	<<if $PC.title == 1>>
	<<set $titles.push("noted corporate businessman")>>
	<<else>>
	<<set $titles.push("noted corporate businesswoman")>>
	<</if>>
<</if>>

<<if $titles.length > 0>>
	<<set $titles.push("and ")>>
<</if>>

<<if $rep > 18000>>
	<<if $PC.title == 1>>
	<<set $titles.push("unquestioned Master of the Arcology")>>
	<<else>>
	<<set $titles.push("unquestioned Mistress of the Arcology")>>
	<</if>>
<<elseif $rep > 15000>>
	<<if $PC.title == 1>>
	<<set $titles.push("Lord of the Arcology")>>
	<<else>>
	<<set $titles.push("Lady of the Arcology")>>
	<</if>>
<<elseif $rep > 12000>>
	<<set $titles.push("Ruler of the Arcology")>>
<<elseif $rep > 9000>>
	<<set $titles.push("chief officer of the arcology")>>
<<else>>
	<<set $titles.push("owner of the arcology")>>
<</if>>

<<for $i to 0; $i < $titles.length; $i++>>
	<<set $seed to $titles[$i]>>
	<<set $PCTitle to ($PCTitle + $seed)>>
	<<if $i < $titles.length-2>>
	<<set $PCTitle to ($PCTitle + ", ")>>
	<</if>>
<</for>>

<</widget>>

/%
 Call as <<MenialPopCap>>
 Applies the menial popcap without asking.
%/
<<widget "MenialPopCap">>

<<set _PopCap = 100*Math.trunc(($arcologies[0].ownership*$AProsperityCap)/1000)>>
<<set _OverMenialCap = ($helots+$fuckdolls+$menialBioreactors)-_PopCap>>
<<if _OverMenialCap > 0>>
	<<set _Price = Math.trunc(($slaveCostFactor*1000)/100)*100>>
	<<set _Price to Math.clamp(_Price, 500, 1500)>>
	<<if $helots > 0>>
		<<if $helots > _OverMenialCap>>
			<<set $cash += _OverMenialCap*_Price, $menialDemandFactor -= _OverMenialCap, 
			$helots -= _OverMenialCap, _OverMenialCap = 0>>
			You don't have enough room for all your menials and are obliged to sell some.
		<<else>>
			<<set $cash += $helots*_Price, $menialDemandFactor -= $helots, 
			_OverMenialCap -= $helots, $helots = 0>>
			You don't have enough room for your menials and are obliged to sell them.
		<</if>>
	<</if>>
	<<if (_OverMenialCap > 0) && ($fuckdolls > 0)>>
		<<if $fuckdolls > _OverMenialCap>>
			<<set $cash += _OverMenialCap*(_Price*2), $menialDemandFactor -= _OverMenialCap, 
			$fuckdolls -= _OverMenialCap, _OverMenialCap = 0>>
			You don't have enough room for all your fuckdolls and are obliged to sell some.
		<<else>>
			<<set $cash += $fuckdolls*(_Price*2), $menialDemandFactor -= $fuckdolls, 
			_OverMenialCap -= $fuckdolls, $fuckdolls = 0>>
			You don't have enough room for your fuckdolls and are obliged to sell them.
		<</if>>
	<</if>>
	<<if (_OverMenialCap > 0) && ($menialBioreactors > 0)>>
		<<set $cash += _OverMenialCap*(_Price-100), $menialDemandFactor -= _OverMenialCap, 
		$menialBioreactors -= _OverMenialCap>>
		You don't have enough room for all your menial bioreactors and are obliged to sell some.
	<</if>>
<</if>>

<</widget>>

/%
 Call as <<OralSkillIncrease>>
 $args[0]: Slave.
 $skillIncrease: Amount of increase.
%/
<<widget "OralSkillIncrease">>

<<if $args[0].oralSkill <= 10>>
	<<if $args[0].oralSkill+$skillIncrease > 10>>
		@@color:green;She now has basic knowledge about oral sex,@@ and can at least suck a dick without constant gagging.
	<</if>>
<<elseif $args[0].oralSkill <= 30>>
	<<if $args[0].oralSkill+$skillIncrease > 30>>
		@@color:green;She now has some oral skills,@@ and can reliably bring dicks and pussies to climax with her mouth.
	<</if>>
<<elseif $args[0].oralSkill <= 60>>
	<<if $args[0].oralSkill+$skillIncrease > 60>>
		@@color:green;She is now an oral expert,@@ and has a delightfully experienced tongue.
	<</if>>
<<elseif $args[0].oralSkill < 100>>
	<<if $args[0].oralSkill+$skillIncrease >= 100>>
		@@color:green;She has mastered oral sex,@@ and can learn nothing more about sucking dick or eating pussy.
	<</if>>
<</if>>
<<set $args[0].oralSkill += $skillIncrease>>

<</widget>>

/%
 Call as <<VaginalSkillIncrease>>
 $args[0]: Slave.
 $skillIncrease: Amount of increase.
%/
<<widget "VaginalSkillIncrease">>

<<if $args[0].vaginalSkill <= 10>>
	<<if $args[0].vaginalSkill+$skillIncrease > 10>>
		@@color:green;She now has basic knowledge about vaginal sex,@@ and can avoid some of the common pitfalls and turnoffs.
	<</if>>
<<elseif $args[0].vaginalSkill <= 30>>
	<<if $args[0].vaginalSkill+$skillIncrease > 30>>
		@@color:green;She now has some vaginal sex skills,@@ and can do more than just lie there and take it.
	<</if>>
<<elseif $args[0].vaginalSkill <= 60>>
	<<if $args[0].vaginalSkill+$skillIncrease > 60>>
		@@color:green;She is now a vaginal sex expert,@@ and has the muscular control to massage anything that's inside her.
	<</if>>
<<elseif $args[0].vaginalSkill < 100>>
	<<if $args[0].vaginalSkill+$skillIncrease >= 100>>
		@@color:green;She has mastered vaginal sex,@@ and can learn nothing more about tribbing or taking dick.
	<</if>>
<</if>>
<<set $args[0].vaginalSkill += $skillIncrease>>

<</widget>>

/%
 Call as <<AnalSkillIncrease>>
 $args[0]: Slave.
 $skillIncrease: Amount of increase.
%/
<<widget "AnalSkillIncrease">>

<<if $args[0].analSkill <= 10>>
	<<if $args[0].analSkill+$skillIncrease > 10>>
		@@color:green;She now has basic knowledge about anal sex,@@ and can accept penetration of her anus without danger.
	<</if>>
<<elseif $args[0].analSkill <= 30>>
	<<if $args[0].analSkill+$skillIncrease > 30>>
		@@color:green;She now has some anal sex skills,@@ and needs less preparation before taking rough penetration.
	<</if>>
<<elseif $args[0].analSkill <= 60>>
	<<if $args[0].analSkill+$skillIncrease > 60>>
		@@color:green;She is now a anal sex expert,@@ and knows how to use her sphincter to please.
	<</if>>
<<elseif $args[0].analSkill < 100>>
	<<if $args[0].analSkill+$skillIncrease >= 100>>
		@@color:green;She has mastered anal sex,@@ and can learn nothing more about taking it up the ass.
	<</if>>
<</if>>
<<set $args[0].analSkill += $skillIncrease>>

<</widget>>

/%
 Call as <<WhoreSkillIncrease>>
 $args[0]: Slave.
 $skillIncrease: Amount of increase.
%/
<<widget "WhoreSkillIncrease">>

<<if $args[0].whoreSkill <= 10>>
	<<if $args[0].whoreSkill+$skillIncrease > 10>>
		@@color:green;She now has basic knowledge about how to whore,@@ and can avoid some potentially dangerous situations.
	<</if>>
<<elseif $args[0].whoreSkill <= 30>>
	<<if $args[0].whoreSkill+$skillIncrease > 30>>
		@@color:green;She now has some skill as a whore,@@ and knows how to sell her body at a good price.
	<</if>>
<<elseif $args[0].whoreSkill <= 60>>
	<<if $args[0].whoreSkill+$skillIncrease > 60>>
		@@color:green;She is now an expert whore,@@ and can often make clients forget that she's a prostitute they're paying for.
	<</if>>
<<elseif $args[0].whoreSkill < 100>>
	<<if $args[0].whoreSkill+$skillIncrease >= 100>>
		@@color:green;She is now a masterful whore,@@ and can learn nothing more about prostitution.
	<</if>>
<</if>>
<<set $args[0].whoreSkill += $skillIncrease>>

<</widget>>

/%
 Call as <<EntertainSkillIncrease>>
 $args[0]: Slave.
 $skillIncrease: Amount of increase.
%/
<<widget "EntertainSkillIncrease">>

<<if $args[0].entertainSkill <= 10>>
	<<if $args[0].entertainSkill+$skillIncrease > 10>>
		@@color:green;She now has basic knowledge about how to be entertaining,@@ and can usually avoid serious faux pas.
	<</if>>
<<elseif $args[0].entertainSkill <= 30>>
	<<if $args[0].entertainSkill+$skillIncrease > 30>>
		@@color:green;She now has some skill as a entertainer,@@ and can flirt, dance, and strip acceptably.
	<</if>>
<<elseif $args[0].entertainSkill <= 60>>
	<<if $args[0].entertainSkill+$skillIncrease > 60>>
		@@color:green;She is now an expert entertainer,@@ and can flirt engagingly, dance alluringly, and strip arousingly.
	<</if>>
<<elseif $args[0].entertainSkill < 100>>
	<<if $args[0].entertainSkill+$skillIncrease >= 100>>
		@@color:green;She is now a masterful entertainer,@@ and can learn nothing more about flirting, dancing, or stripping.
	<</if>>
<</if>>
<<set $args[0].entertainSkill += $skillIncrease>>

<</widget>>

/%
 Call as <<AddSlave>>
 $args[0]: Slave.
%/
<<widget "AddSlave">>

<<if $args[0].dick > 0>>
	<<if $args[0].balls > 0>>
	<<if $args[0].devotion <= 50>>
	<<if ($args[0].fetish != "buttslut") || ($args[0].fetishKnown != 1)>>
	<<if $args[0].sexualFlaw != "hates women">>
	<<set $REFeminizationCheckinIDs.push($args[0].ID)>>
	<</if>>
	<</if>>
	<</if>>
	<</if>>
<</if>>
<<if $args[0].actualAge > 35>>
	<<if $args[0].face < 2>>
	<<if $args[0].analSkill <= 30>>
	<<set $REMILFCheckinIDs.push($args[0].ID)>>
	<</if>>
	<</if>>
<</if>>
<<if $args[0].attrXY <= 60>>
	<<if $args[0].attrXX > 60>>
		<<set $REOrientationCheckinIDs.push($args[0].ID)>>
	<</if>>
<</if>>
<<if $args[0].face < 0>>
	<<set $REUglyCheckinIDs.push($args[0].ID)>>
<</if>>
<<if $args[0].anus < 2>>
	<<set $REButtholeCheckinIDs.push($args[0].ID)>>
<</if>>
<<if $args[0].boobs < 800>>
	<<set $REReductionCheckinIDs.push($args[0].ID)>>
<</if>>

<<if $ui != "start">>
<<if $universalRulesNewSlavesRA == 1>>
<<if $autoRulesAssistant != 0>>
	<<silently>>
	<<set $activeSlave = $args[0]>>
	<<include "Check Auto Rules Activate">>
	<<include "Default Rules">>
	<<set $args[0] = $activeSlave>>
	<</silently>>
<</if>>
<</if>>
<</if>>

<<set $slaves.push($args[0]), $slavesOriginal.push($args[0]), $genePool.push($args[0])>>

<</widget>>

/%
 Call as <<Enunciate>>
 $args[0]: Slave.
%/
<<widget "Enunciate">>
	<<if SlaveStatsChecker.checkForLisp($args[0])>>
		<<if def $PC.customTitleLisp>><<set $titleEnunciate = $PC.customTitleLisp>><<elseif $PC.title != 0>><<set $titleEnunciate = "Mathter">><<else>><<set $titleEnunciate = "Mithtreth">><</if>>
		<<set $sayEnunciate = "lisp">>
		<<set $sEnunciate = "th">>
		<<set $SEnunciate = "Th">>
		<<set $ssEnunciate = "th">>
		<<set $cEnunciate = "th">>
	<<else>>
		<<if def $PC.customTitle>><<set $titleEnunciate = $PC.customTitle>><<elseif $PC.title != 0>><<set $titleEnunciate = "Master">><<else>><<set $titleEnunciate = "Mistress">><</if>>
		<<set $sayEnunciate = "say">>
		<<set $sEnunciate = "s">>
		<<set $SEnunciate = "S">>
		<<set $ssEnunciate = "ss">>
		<<set $cEnunciate = "c">>
	<</if>>
<</widget>>
<<widget "Master">>$titleEnunciate<</widget>>
<<widget "say">>$sayEnunciate<</widget>>
<<widget "s">>$sEnunciate<</widget>>
<<widget "S">>$SEnunciate<</widget>>
<<widget "ss">>$ssEnunciate<</widget>>
<<widget "c">>$cEnunciate<</widget>>

/%
 Call as <<SoftenBehavioralFlaw>>
 $args[0]: Slave.
%/
<<widget "SoftenBehavioralFlaw">>
	<<switch $args[0].behavioralFlaw>>
	<<case "arrogant">>
		<<set $args[0].behavioralQuirk = "confident">>
	<<case "bitchy">>
		<<set $args[0].behavioralQuirk = "cutting">>
	<<case "odd">>
		<<set $args[0].behavioralQuirk = "funny">>
	<<case "hates men">>
		<<set $args[0].behavioralQuirk = "adores women">>
	<<case "hates women">>
		<<set $args[0].behavioralQuirk = "adores men">>
	<<case "gluttonous">>
		<<set $args[0].behavioralQuirk = "fitness">>
	<<case "anorexic">>
		<<set $args[0].behavioralQuirk = "insecure">>
	<<case "devout">>
		<<set $args[0].behavioralQuirk = "sinful">>
	<<case "liberated">>
		<<set $args[0].behavioralQuirk = "advocate">>
	<</switch>>
	<<set $activeSlave.behavioralFlaw = "none">>
<</widget>>

/%
 Call as <<SoftenSexualFlaw>>
 $args[0]: Slave.
%/
<<widget "SoftenSexualFlaw">>
	<<switch $args[0].sexualFlaw>>
	<<case "hates oral">>
		<<set $args[0].sexualQuirk = "gagfuck queen">>
	<<case "hates anal">>
		<<set $args[0].sexualQuirk = "painal queen">>
	<<case "hates penetration">>
		<<set $args[0].sexualQuirk = "strugglefuck queen">>
	<<case "shamefast">>
		<<set $args[0].sexualQuirk = "tease">>
	<<case "idealistic">>
		<<set $args[0].sexualQuirk = "romantic">>
	<<case "repressed">>
		<<set $args[0].sexualQuirk = "perverted">>
	<<case "apathetic">>
		<<set $args[0].sexualQuirk = "caring">>
	<<case "crude">>
		<<set $args[0].sexualQuirk = "unflinching">>
	<<case "judgemental">>
		<<set $args[0].sexualQuirk = "size queen">>
	<</switch>>
	<<set $args[0].sexualFlaw = "none">>
<</widget>>

/%
 Call as <<EventFetish>>
 $args[0]: Slave.
 $args[1]: Fetish.
%/
<<widget "EventFetish">>

<<if $args[0].fetish == $args[1]>>
This experience
<<if $args[0].fetishKnown == 1>>
	<<if $args[0].fetishStrength > 95>>
		@@color:lightsalmon;<<switch $args[0].fetish>>
		<<case "submissive">>deepens her sexual need to submit.
		<<case "cumslut">>increases her appetite for oral sex.
		<<case "humiliation">>makes her even more eager to be humiliated.
		<<case "buttslut">>encourages her to focus on anal sex.
		<<case "boobs">>focuses her sexuality on her breasts and nipples.
		<<case "sadist">>titillates the sadistic part of her.
		<<case "masochist">>helps conflate pain and sexual pleasure for her.
		<<case "dom">>strengthens her desire to top other slaves.
		<<case "pregnancy">>further confuses lust and pregnancy in her mind.
		<<default>>ERROR: bad fetish
		<</switch>>@@
		<<set $args[0].fetishStrength += 10>>
	<<else>>
		is @@color:hotpink;especially enjoyable for her,@@ since
		<<switch $args[0].fetish>>
		<<case "submissive">>she's an utterly submissive little slut.
		<<case "cumslut">>her <<if $args[0].vagina > -1>>clit<<else>>frenulum<</if>> might as well be located in her throat.
		<<case "humiliation">>she has a hopeless need to be humiliated and degraded.
		<<case "buttslut">>she's completely in love with having her ass fucked.
		<<case "boobs">>she loves breast play more than any other kind of sex.
		<<case "sadist">>nothing is as titillating to her as another slave's pain can be.
		<<case "masochist">>she loves pain more than she likes pleasure.
		<<case "dom">>she lives for the times she's allowed to fuck someone.
		<<case "pregnancy">>all her deepest sexual desires involve <<if $args[0].vagina > -1>>pregnancy<<else>>impregnation<</if>>.
		<<default>>ERROR: bad fetish
		<</switch>>
		<<set $args[0].devotion += 3>>
	<</if>>
<<else>>
	was surprisingly appealing for her, revealing that she's a
	@@color:lightsalmon;<<switch $args[0].fetish>>
	<<case "submissive">>sexual submissive!
	<<case "humiliation">>humiliation slut!
	<<case "boobs">>slut for breast play!
	<<case "pregnancy">>pregslut!
	<<default>>$args[0]!
	<</switch>>@@
	<<set $args[0].fetishKnown = 1>>
<</if>>
<</if>>

<</widget>>