:: Slave Summary [nobr]

<<set setup.passagePreFilters = setup.passagePreFilters || {
	"Main":                      s => (s.assignmentVisible == 1),
	"Personal Attention Select": s => (s.assignmentVisible == 1 && s.fuckdoll <= 0),
	"Agent Select":              s => (s.fuckdoll == 0 && s.devotion >= 20 && s.intelligence > 0 && s.intelligenceImplant > 0 && canWalk(s) && canSee(s) && canTalk(s) && s.broodmother < 2 && s.breedingMark != 1),
	"BG Select":                 s => (s.assignmentVisible == 1 && s.fuckdoll == 0 && s.devotion > 50 && s.assignment != "guard you" && canWalk(s) && canSee(s) && s.breedingMark != 1),
	"Recruiter Select":          s => (s.assignmentVisible == 1 && s.fuckdoll == 0 && s.devotion > 50 && s.assignment != "recruit girls" && canWalk(s) && canSee(s) && canTalk(s)),
	"HG Select":                 s => (s.assignmentVisible == 1 && s.fuckdoll == 0 && s.devotion > 50 && s.assignment != "be your Head Girl" && canWalk(s) && canSee(s) && canTalk(s)),
	"Head Girl Suite":           s => (s.assignmentVisible == 1 && s.fuckdoll <= 0 && (
		   ($Flag == 0 && s.assignment != "be your Head Girl" && s.indentureRestrictions <= 0 && s.breedingMark != 1)
		|| ($Flag != 0 && s.assignment == "live with your Head Girl"))),
	"Subordinate Targeting":     s => (s.devotion >= -20 && s.fuckdoll == 0 && $activeSlave.ID != s.ID && ($activeSlave.amp != 1 || s.amp != 1)),
	"Spa":                       s => (s.assignmentVisible == 1 && s.fuckdoll <= 0 && (
		   ($Flag == 0 && s.assignment != "rest in the spa")
		|| ($Flag == 1 && s.assignment == "rest in the spa")
		|| ($Flag != 0 && $Flag != 1 && s.ID == $Attendant.ID))),
	"Attendant Select":          s => (s.assignmentVisible == 1 && s.fuckdoll == 0 && s.devotion > 50 && canWalk(s)),
	"Brothel":                   s => (s.assignmentVisible == 1 && s.fuckdoll <= 0 && (
		   ($Flag == 0 && s.assignment != "work in the brothel")
		|| ($Flag == 1 && s.assignment == "work in the brothel")
		|| ($Flag != 0 && $Flag != 1 && s.ID == $Madam.ID))),
	"Madam Select":              s => (s.assignmentVisible == 1 && s.fuckdoll == 0 && s.devotion > 50 && s.intelligence > -2 && canWalk(s) && canSee(s) && s.breedingMark != 1),
	"Club":                      s => (s.assignmentVisible == 1 && s.fuckdoll <= 0 && (
		   ($Flag == 0 && s.assignment != "serve in the club")
		|| ($Flag == 1 && s.assignment == "serve in the club")
		|| ($Flag != 0 && $Flag != 1 && s.ID == $DJ.ID))),
	"DJ Select":                 s => (s.assignmentVisible == 1 && s.fuckdoll == 0 && s.devotion > 50 && s.intelligence > -2 && canTalk(s) && canWalk(s) && s.breedingMark != 1),
	"Clinic":                    s => (s.assignmentVisible == 1 && s.fuckdoll <= 0 && (
		   ($Flag == 0 && s.assignment != "get treatment in the clinic")
		|| ($Flag == 1 && s.assignment == "get treatment in the clinic")
		|| ($Flag != 0 && $Flag != 1 && s.ID == $Nurse.ID))),
	"Nurse Select":              s => (s.assignmentVisible == 1 && s.fuckdoll == 0 && s.devotion > 50 && canWalk(s) && canSee(s)),
	"Schoolroom":                s => (s.assignmentVisible == 1 && s.fuckdoll <= 0 && s.fetish != "mindbroken" && (
		   ($Flag == 0 && s.assignment != "learn in the schoolroom")
		|| ($Flag == 1 && s.assignment == "learn in the schoolroom")
		|| ($Flag != 0 && $Flag != 1 && s.ID == $Schoolteacher.ID))),
	"Schoolteacher Select":      s => (s.assignmentVisible == 1 && s.fuckdoll == 0 && s.devotion > 50 && canTalk(s) && canWalk(s) && canSee(s)),
	"Dairy":                     s => (s.assignmentVisible == 1 && s.fuckdoll <= 0 && (
		   ($Flag == 0 && s.assignment != "work in the dairy")
		|| ($Flag == 1 && s.assignment == "work in the dairy")
		|| ($Flag != 0 && $Flag != 1 && s.ID == $Milkmaid.ID))),
	"Milkmaid Select":           s => (s.assignmentVisible == 1 && s.fuckdoll == 0 && s.devotion > 20 && canWalk(s) && canSee(s)),
	"Servants' Quarters":        s => (s.assignmentVisible == 1 && s.fuckdoll <= 0 && (
		   ($Flag == 0 && s.assignment != "work as a servant")
		|| ($Flag == 1 && s.assignment == "work as a servant")
		|| ($Flag != 0 && $Flag != 1 && s.ID == $Stewardess.ID))),
	"Stewardess Select":         s => (s.assignmentVisible == 1 && s.fuckdoll == 0 && s.devotion > 50 && s.intelligence > -2 && canWalk(s) && canSee(s)),
	"Master Suite":              s => (s.assignmentVisible == 1 && s.fuckdoll <= 0 && (
		   ($Flag == 0 && s.assignment != "serve in the master suite")
		|| ($Flag == 1 && s.assignment == "serve in the master suite")
		|| ($Flag != 0 && $Flag != 1 && s.ID == $Concubine.ID))),
	"Concubine Select":          s => (s.assignmentVisible == 1 && s.fuckdoll == 0 && s.devotion > 50 && s.amp != 1),
	"Cellblock":                 s => (s.assignmentVisible == 1 && s.fuckdoll <= 0 && s.fetish != "mindbroken" && (
		   ($Flag == 0 && s.assignment != "be confined in the cellblock")
		|| ($Flag == 1 && s.assignment == "be confined in the cellblock")
		|| ($Flag != 0 && $Flag != 1 && s.ID == $Wardeness.ID))),
	"Wardeness Select":          s => (s.assignmentVisible == 1 && s.fuckdoll == 0 && s.devotion > 50 && canWalk(s) & canSee(s)),
	"Arcade":                    s => (s.assignmentVisible == 1 && ($arcade >= $arcadeSlaves || $arcadeUpgradeFuckdolls == 1) && (
		   ($Flag == 0 && s.assignment != "be confined in the arcade")
		|| ($Flag != 0 && s.assignment == "be confined in the arcade"))),
	"Pit":                       s => (s.assignmentVisible == 1 && s.fuckdoll == 0 && (
		   ($Flag == 0 && !$fighterIDs.includes(s.ID) && canWalk(s) && (s.assignment != "guard you") && (s.assignment != "work in the dairy" || $dairyRestraintsSetting < 2))
		|| ($Flag != 0 && $fighterIDs.includes(s.ID)))),
	"Coursing Association":      s => (s.assignmentVisible == 1 && s.fuckdoll == 0 && (
		   ($Flag == 0 && canWalk(s) && $Lurcher.ID != s.ID)
		|| ($Flag != 0 && $Lurcher.ID == s.ID))),
	"New Game Plus":             s => (($Flag == 0 && s.assignment != "be imported") || ($Flag != 0 && s.assignment == "be imported")),
	"Rules Slave Select":        s => (($Flag == 0 && !ruleSlaveSelected(s, $currentRule)) || ($Flag != 0 && ruleSlaveSelected(s, $currentRule))),
	"Rules Slave Exclude":       s => (($Flag == 0 && !ruleSlaveExcluded(s, $currentRule)) || ($Flag != 0 && ruleSlaveExcluded(s, $currentRule))),
	"Matchmaking":               s => (s.devotion >= 100 && s.relationship == $activeSlave.relationship && s.ID != $activeSlave.ID),
}>>
<<set _Pass = passage(), _SL = $slaves.length, $assignTo = _Pass,
	_passagePreFilter = (s => s.assignment != "be your agent" && s.assignment != "live with your agent" && (!setup.passagePreFilters.hasOwnProperty(_Pass) || setup.passagePreFilters[_Pass](s))),
	_filteredSlaveIdxs = $slaves.map(function(slave, idx) { return _passagePreFilter(slave) ? idx : null; }).filter(function(idx) { return idx !== null; })>>
<<for !_.isUndefined(_ssi = _filteredSlaveIdxs.shift())>>
<<set _Slave = $slaves[_ssi]>>
<<if ["Chinese", "Japanese", "Korean", "Cambodian", "Vietnamese", "Hungarian", "Mongolian"].includes(_Slave.nationality)>>
	<<set _slaveName = [_Slave.slaveSurname || "", _Slave.slaveName].join(" ").trim()>>
<<else>>
	<<set _slaveName = [_Slave.slaveName, _Slave.slaveSurname || ""].join(" ").trim()>>
<</if>>


<<capture _ssi>>

<<switch _Pass>>
<<case "Main">>
	/*
	<<if $slaveAssignmentTab == "overview">>
		<<if $showOneSlave == "Head Girl">>
			<<if (_Slave.assignment != "be your Head Girl")>><<continue>><</if>>
		<<elseif $showOneSlave == "recruit girls">>
			<<if (_Slave.assignment != "recruit girls")>><<continue>><</if>>
		<<elseif $showOneSlave == "guard you">>
			<<if (_Slave.assignment != "guard you")>><<continue>><</if>>
		<</if>>
		
	<<elseif $slaveAssignmentTab == "resting">>
		<<if _Slave.assignment != "rest">><<continue>><</if>>
	<<elseif $slaveAssignmentTab == "stay confined">>
		<<if (_Slave.assignment != "stay confined")>><<continue>><</if>>
	<<elseif $slaveAssignmentTab == "take classes">>
		<<if (_Slave.assignment != "take classes")>><<continue>><</if>>
	<<elseif $slaveAssignmentTab == "please you">>
		<<if (_Slave.assignment != "please you")>><<continue>><</if>>
	<<elseif $slaveAssignmentTab == "whore">>
		<<if (_Slave.assignment != "whore")>><<continue>><</if>>
	<<elseif $slaveAssignmentTab == "serve the public">>
		<<if (_Slave.assignment != "serve the public")>><<continue>><</if>>
	<<elseif $slaveAssignmentTab == "be a servant">>
		<<if (_Slave.assignment != "be a servant")>><<continue>><</if>>
	<<elseif $slaveAssignmentTab == "get milked">>
		<<if (_Slave.assignment != "get milked")>><<continue>><</if>>
	<<elseif $slaveAssignmentTab == "work a glory hole">>
		<<if (_Slave.assignment != "work a glory hole")>><<continue>><</if>>
	<<elseif $slaveAssignmentTab == "be a subordinate slave">>
		<<if (_Slave.assignment != "be a subordinate slave")>><<continue>><</if>>
	<<elseif $slaveAssignmentTab == "all">>
		<<if (_Slave.assignment == "be your Head Girl")
		|| (_Slave.assignment == "recruit girls")
		|| (_Slave.assignment == "guard you")>><<continue>><</if>>
	<</if>>
	*/
	<<if (_Slave.choosesOwnClothes == 1) && (_Slave.clothes == "choosing her own clothes")>>
		<<set $i = _ssi, _oldDevotion = _Slave.devotion>>
		<<silently>><<include "SA chooses own clothes">><</silently>>
		<<set $slaves[_ssi].devotion = _oldDevotion, _Slave = $slaves[_ssi]>> /* restore devotion value so repeatedly changing clothes isn't an exploit */
	<</if>>
	<br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>>
	<<if "be your Head Girl" == _Slave.assignment>>''@@.lightcoral;HG@@''
	<<elseif "recruit girls" == _Slave.assignment>>''@@.lightcoral;RC@@''
	<<elseif "guard you" == _Slave.assignment>>''@@.lightcoral;BG@@''
	<</if>>
	<<if Array.isArray($personalAttention) && $personalAttention.findIndex(function(s) { return s.ID == _Slave.ID; }) != -1>>''@@.lightcoral;PA@@''<</if>>
	[[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]] /* lists their names */
	
<<case "Personal Attention Select">>
	<br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>>
	<<link _slaveName>>
		<<if !Array.isArray($personalAttention)>> /* first PA target */
			<<set $personalAttention = [{ID: $slaves[_ssi].ID, trainingRegimen: "undecided"}]>>
		<<else>>
			<<set _pai = $personalAttention.findIndex(function(s) { return s.ID == $slaves[_ssi].ID; })>>
			<<if _pai == -1>> /* not already a PA target; add */
				<<set $activeSlave = $slaves[_ssi], $personalAttention.push({ID: $slaves[_ssi].ID, trainingRegimen: "undecided"})>>
			<<else>> /* already a PA target; remove */
				<<set $personalAttention.deleteAt(_pai)>>
				<<if $personalAttention.length == 0>>
					<<set $personalAttention = "sex">>
				<</if>>
			<</if>>
		<</if>>
		<<goto "Personal Attention Select">>
	<</link>>
<<case "Agent Select">>
	<br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>>
	[[_slaveName|Agent Workaround][$i = _ssi]]
<<case "BG Select">>
	<br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>>
	[[_slaveName|Bodyguard Workaround][$i = _ssi]]
<<case "Recruiter Select">>
	<br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>>
	[[_slaveName|Recruiter Workaround][$i = _ssi]]
<<case "HG Select">>
	<br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>>
	[[_slaveName|HG Workaround][$i = _ssi]]
<<case "Head Girl Suite">>
<<if $Flag == 0>>
		<br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>>
		[[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]]
<<else>>
		<br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>>
		[[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]]
<</if>>
<<case "Subordinate Targeting">>
	<br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>>
	[[_slaveName|Subordinate Targeting][$activeSlave.subTarget = $slaves[_ssi].ID]]
<<case "Spa">>
<<if $Flag == 0>>
	<<if $spa <= $spaSlaves>><<continue>><</if>>
	<<if (_Slave.health < 20) || (_Slave.trust < 60) || (_Slave.devotion <= 60) || (_Slave.fetish == "mindbroken") || _Slave.sexualFlaw !== "none" || _Slave.behavioralFlaw !== "none">>
	<<if _Slave.devotion >= -20 || _Slave.fetish == "mindbroken">>
		<br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>>
		[[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]]
	<<else>>
		<br>//_Slave.slaveName cannot be trusted in the spa//
		<<continue>>
	<</if>>
	<<else>>
		<br>//_Slave.slaveName cannot benefit from the spa//
		<<continue>>
	<</if>>
<<elseif $Flag == 1>>
		<br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>>
		[[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]]
<<else>>
		<<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>>[[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]]
<</if>>
<<case "Attendant Select">>
	<br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>>
	[[_slaveName|Attendant Workaround][$i = _ssi]]
<<case "Brothel">>
<<if $Flag == 0>>
	<<if $brothel <= $brothelSlaves>><<continue>><</if>>
	<<if _Slave.breedingMark != 1>>
	<<if (_Slave.devotion > 50) || ((_Slave.devotion >= -50) && (_Slave.trust < -20)) || (_Slave.trust < -50) || (_Slave.trust > 50)>>
		<br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>>
		[[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]]
	<<else>>
		<br>//_Slave.slaveName must be either more fearful of you or devoted to you//
		<<continue>>
	<</if>>
	<<else>>
		<br>//_Slave.slaveName is for private use only//
		<<continue>>
	<</if>>
<<elseif $Flag == 1>>
		<br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>>
		[[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]]
<<else>>
		<<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>>[[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]]
<</if>>
<<case "Madam Select">>
	<br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>>
	[[_slaveName|Madam Workaround][$i = _ssi]]
<<case "Club">>
<<if $Flag == 0>>
	<<if $club <= $clubSlaves>><<continue>><</if>>
	<<if _Slave.breedingMark != 1>>
	<<if (_Slave.devotion > 50) || ((_Slave.devotion >= -50) && (_Slave.trust < -20)) || (_Slave.trust < -50) || (_Slave.trust > 50)>>
		<br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>>
		[[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]]
	<<else>>
		<br>//_Slave.slaveName must be either more fearful of you or devoted to you//
		<<continue>>
	<</if>>
	<<else>>
		<br>//_Slave.slaveName is for private use only//
		<<continue>>
	<</if>>
<<elseif $Flag == 1>>
		<br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>>
		[[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]]
<<else>>
		<br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>>
		[[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]]
<</if>>
<<case "DJ Select">>
	<br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>>
	[[_slaveName|DJ Workaround][$i = _ssi]]
<<case "Clinic">>
<<if $Flag == 0>>
	<<if $clinic <= $clinicSlaves>><<continue>><</if>>
	<<if (_Slave.health < 20) || ($Nurse != 0 && (_Slave.chem > 15 && $clinicUpgradeFilters == 1) || ($bellyImplants == 1 && _Slave.bellyImplant > -1) || (_Slave.pregKnown == 1 && ($clinicSpeedGestation >= 0 || _Slave.pregControl == "speed up")))>>
		<br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>>
		[[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]]
	<<else>>
		<br>//_Slave.slaveName cannot benefit from the clinic//
		<<continue>>
	<</if>>
<<elseif $Flag == 1>>
		<br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>>
		[[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]]
<<else>>
		<br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>>
		[[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]]
<</if>>
<<case "Nurse Select">>
	<br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>>
	[[_slaveName|Nurse Workaround][$i = _ssi]]
<<case "Schoolroom">>
<<if $Flag == 0>>
	<<if $schoolroom <= $schoolroomSlaves>><<continue>><</if>>
	<<if (_Slave.devotion >= -20) || ((_Slave.devotion >= -50) && (_Slave.trust < -20)) || (_Slave.trust < -50)>>
		<<if (_Slave.intelligenceImplant < 1) || (_Slave.voice != 0 && _Slave.accent+$schoolroomUpgradeLanguage > 2) || (_Slave.oralSkill <= 10+$schoolroomUpgradeSkills*20) || (_Slave.whoreSkill <= 10+$schoolroomUpgradeSkills*20) || (_Slave.entertainSkill <= 10+$schoolroomUpgradeSkills*20) || (_Slave.analSkill < 10+$schoolroomUpgradeSkills*20) || ((_Slave.vagina >= 0) && (_Slave.vaginalSkill < 10+$schoolroomUpgradeSkills*20))>>
			<br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>>
			[[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]]
		<<else>>
			<br>//_Slave.slaveName already has a basic education//
			<<continue>>
		<</if>>
	<<else>>
		<br>//_Slave.slaveName is too resistant to learn//
		<<continue>>
	<</if>>
<<elseif $Flag == 1>>
		<br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>>
		[[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]]
<<else>>
		<br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>>
		[[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]]
<</if>>
<<case "Schoolteacher Select">>
	<br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>>
	[[_slaveName|Schoolteacher Workaround][$i = _ssi]]
<<case "Dairy">>
<<if $Flag == 0>>
	<<set _dairySeed = $bioreactorsXY+$bioreactorsXX+$bioreactorsHerm+$bioreactorsBarren>>
	<<if _Slave.assignment == "work in the dairy">><<continue>><</if>>
	<<if $dairy <= $dairySlaves+_dairySeed>><<continue>><</if>>
	<<if (_Slave.indentureRestrictions > 0) && ($dairyRestraintsSetting > 1)>>
		<br>//_Slave.slaveName's indenture forbids extractive Dairy service.//
		<<continue>>
	<<elseif (_Slave.indentureRestrictions > 1) && ($dairyRestraintsSetting > 0)>>
		<br>//_Slave.slaveName's indenture allows only free range milking.//
		<<continue>>
	<<elseif _Slave.breedingMark == 1 && $dairyRestriantsSettings > 0>>
		<br>//_Slave.slaveName may only be a free range cow//
		<<continue>>
	<<elseif ($dairyPregSetting > 0) && ((_Slave.bellyImplant != -1) || (_Slave.broodmother != 0))>>
		<br>//_Slave.slaveName's womb cannot accommodate current machine settings//
		<<continue>>
	<<else>>
		<<if (_Slave.lactation > 0 || (($dairySlimMaintainUpgrade == 0 || $dairySlimMaintain == 0) && (_Slave.boobs > 300 || _Slave.dick == 0 || $dairyImplantsSetting == 1) && $dairyImplantsSetting != 2)) || (_Slave.balls > 0)>>
			<<if (_Slave.devotion > 20) || ((_Slave.devotion >= -50) && (_Slave.trust < -20)) ||  (_Slave.trust < -50) || (_Slave.amp == 1) || ($dairyRestraintsUpgrade == 1)>>
				<<if ($dairyStimulatorsSetting < 2) || (_Slave.anus > 2) || ($dairyPrepUpgrade == 1)>>
					<<if ($dairyPregSetting < 2) || (_Slave.vagina > 2) || (_Slave.ovaries == 0) || ($dairyPrepUpgrade == 1)>>
						<br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>>
						[[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]]
						<<else>>
							<br>//_Slave.slaveName's vagina cannot accommodate current machine settings//
							<<continue>>
						<</if>>
					<<else>>
						<br>//_Slave.slaveName's anus cannot accommodate current machine settings//
						<<continue>>
				<</if>>
			<<else>>
				<br>//_Slave.slaveName must be obedient in order to be milked here//
				<<continue>>
			<</if>>
		<<elseif (($dairySlimMaintainUpgrade == 1 && $dairySlimMaintain == 1) || ($dairyImplantsSetting == 2) || (_Slave.boobs <= 300 && _Slave.dick > 0 && $dairyImplantsSetting == 0))>>
			<br>//_Slave.slaveName is not lactating<<if $seeDicks > 0>> or producing semen<</if>>, and <<print $dairyName>>'s current settings forbid the automatic implantation of lactation inducing drugs, so she can not be a cow//
			<<continue>>
		<<else>>
			<br>//_Slave.slaveName is not lactating<<if $seeDicks > 0>> or producing semen<</if>> and cannot be a cow//
			<<continue>>
		<</if>>
	<</if>>
<<elseif $Flag == 1>>
		<br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>>
		[[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]]
<<else>>
		<br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>>
		[[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]]
<</if>>
<<case "Milkmaid Select">>
	<br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>>
	[[_slaveName|Milkmaid Workaround][$i = _ssi]]
<<case "Servants' Quarters">>
<<if $Flag == 0>>
	<<if $servantsQuarters <= $servantsQuartersSlaves>><<continue>><</if>>
	<<if (_Slave.devotion >= -20) || ((_Slave.devotion >= -50) && (_Slave.trust <= 20)) || (_Slave.trust < -20)>>
		<br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>>
		[[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]]
	<<else>>
		<br>//_Slave.slaveName must be either more fearful of you or devoted to you//
		<<continue>>
	<</if>>
<<elseif $Flag == 1>>
		<br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>>
		[[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]]
<<else>>
		<br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>>
		[[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]]
<</if>>
<<case "Stewardess Select">>
	<br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>>
	[[_slaveName|Stewardess Workaround][$i = _ssi]]
<<case "Master Suite">>
<<if $Flag == 0>>
	<<if $masterSuite <= $masterSuiteSlaves>><<continue>><</if>>
	<<if (_Slave.devotion > 20) || ((_Slave.devotion >= -50) && (_Slave.trust < -20)) || (_Slave.trust < -50)>>
		<br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>>
		[[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]]
	<<else>>
		<br>//_Slave.slaveName is not sufficiently broken for the master suite//
		<<continue>>
	<</if>>
<<elseif $Flag == 1>>
		<br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>>
		[[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]]
<<else>>
		<br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>>
		[[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]]
<</if>>
<<case "Concubine Select">>
	<br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>>
	[[_slaveName|Concubine Workaround][$i = _ssi]]
<<case "Cellblock">>
<<if _Slave.assignmentVisible != 1>><<continue>><</if>>
<<if $Flag == 0>>
	<<if $cellblock <= $cellblockSlaves>><<continue>><</if>>
	<<if (_Slave.devotion < -20 && _Slave.trust >= -20) || (_Slave.devotion < -50 && _Slave.trust >= -50)>>
		<br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>>
		[[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]]
	<<else>>
		<br>//_Slave.slaveName is sufficiently broken in so that the cellblock would have no effect//
		<<continue>>
	<</if>>
<<elseif $Flag == 1>>
		<br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>>
		[[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]]
<<else>>
		<br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>>
		[[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]]
<</if>>
<<case "Wardeness Select">>
	<br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>>
	[[_slaveName|Wardeness Workaround][$i = _ssi]]
<<case "Arcade">>
<<if $Flag == 0>>
	<<if _Slave.assignment == "be confined in the arcade">><<continue>><</if>>
	<<if $arcade <= $arcadeSlaves && $arcadeUpgradeFuckdolls != 1>><<continue>><</if>>
	<<if _Slave.breedingMark != 1>>
	<<if (_Slave.indentureRestrictions <= 0)>>
		<br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>>
		[[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]]
	<<else>>
		<br>//_Slave.slaveName's indenture forbids arcade service.//
		<<continue>>
	<</if>>
	<<else>>
		<br>//_Slave.slaveName is for private use only//
		<<continue>>
	<</if>>
<<else>>
		<br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>>
		[[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]]
<</if>>
<<case "Pit">>
<<if $Flag == 0>>
	<<if (_Slave.indentureRestrictions > 0) && ($pitLethal == 1)>>
		<br>//_Slave.slaveName's indenture forbids lethal fights.//
		<<continue>>
	<<elseif (_Slave.indentureRestrictions > 1)>>
		<br>//_Slave.slaveName's indenture forbids fighting.//
		<<continue>>
	<<elseif _Slave.breedingMark == 1>>
		<br>//_Slave.slaveName may not participate in combat//
		<<continue>>
	<<else>>
				<br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>>
				[[_slaveName|Assign][$i = _ssi]]
	<</if>>
<<else>>
		<br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>>
		[[_slaveName|Retrieve][$i = _ssi]]
<</if>>
<<case "Coursing Association">>
<<if $Flag == 0>>
		<br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>>
		[[_slaveName|Assign][$i = _ssi]]
<<else>>
		<br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>>
		[[_slaveName|Retrieve][$i = _ssi]]
<</if>>
<<case "New Game Plus">>
<<if $Flag == 0>>
		<br>__''@@.pink;_Slave.slaveName@@''__
<<else>>
		<br>__''@@.pink;_Slave.slaveName@@''__
<</if>>
<<case "Rules Slave Select">>
<<if $Flag == 0>>
		<br>__''
		[[_slaveName|Rules Slave Select Workaround][$activeSlave = $slaves[_ssi]]]''__
<<else>>
		<br>__''
		[[_slaveName|Rules Slave Deselect Workaround][$activeSlave = $slaves[_ssi]]]''__
<</if>>
<<case "Rules Slave Exclude">>
<<if $Flag == 0>>
		<br>__''
		[[_slaveName|Rules Slave Exclude Workaround][$activeSlave = $slaves[_ssi]]]''__
<<else>>
		<br>__''
		[[_slaveName|Rules Slave NoExclude Workaround][$activeSlave = $slaves+_ssi]]]''__
<</if>>
<<case "Matchmaking">>
	<br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>>
	[[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]]
<</switch>>

<<SlaveStatClamp _Slave>>

<<set _Slave.trust = Math.trunc(_Slave.trust), _Slave.devotion = Math.trunc(_Slave.devotion), _Slave.health = Math.trunc(_Slave.health)>>

<<set $slaves[_ssi] = _Slave>>

will
<<if (_Slave.assignment == "rest") && (_Slave.health >= -20)>>
	''__@@.lawngreen;rest.@@__''
<<elseif (_Slave.assignment == "stay confined") && ((_Slave.devotion > 20) || ((_Slave.trust < -20) && (_Slave.devotion >= -20)) || ((_Slave.trust < -50) && (_Slave.devotion >= -50)))>>
	''__@@.lawngreen;stay confined.@@__''<<if _Slave.sentence > 0>> (_Slave.sentence weeks)<</if>>
<<else>>
	<<if _Slave.choosesOwnAssignment == 1>>choose her own job<<else>>_Slave.assignment<<if _Slave.sentence > 0>> (_Slave.sentence weeks)<</if>><</if>>.
<</if>>

<<if ($displayAssignments == 1) && (_Pass == "Main") && (_Slave.ID != $HeadGirl.ID) && (_Slave.ID != $Recruiter.ID) && (_Slave.ID != $Bodyguard.ID)>>
	<<if _Slave.assignment != "rest">>
		[[Rest|Rest Workaround][$i = _ssi]]
	<<else>>
		Rest
	<</if>>
	<<if _Slave.assignment != "please you">>
		| [[Fucktoy|Fucktoy Workaround][$i = _ssi]]
	<<else>>
		| Fucktoy
	<</if>>
	<<if _Slave.indentureRestrictions <= 0 && _Slave.breedingMark != 1>>
		<<if _Slave.assignment != "work a glory hole">>
			| [[Gloryhole|Hole Workaround][$i = _ssi]]
		<<else>>
			| Hole
		<</if>>
	<</if>>
	<<if _Slave.fuckdoll == 0>> /* NON-FUCKDOLL ASSIGNMENTS */
		<<if (_Slave.assignment != "take classes")>>
			<<if (_Slave.intelligenceImplant != 1) && ((_Slave.devotion >= -20) || ((_Slave.trust < -20) && (_Slave.devotion >= -50)) || (_Slave.trust < -50)) && (_Slave.fetish != "mindbroken")>>
				| [[Classes|Classes Workaround][$i = _ssi]]
			<</if>>
		<<else>>
			| Classes
		<</if>>
		<<if (_Slave.assignment != "be a servant")>>
			<<if ((_Slave.devotion >= -20) || ((_Slave.trust < -20) && (_Slave.devotion >= -50)) || (_Slave.trust < -50)) && canWalk(_Slave) && canSee(_Slave)>>
				| [[House Servant|Servant Workaround][$i = _ssi]]
			<</if>>
		<<else>>
			| House Servant
		<</if>>
		<<if (_Slave.assignment != "whore") && _Slave.breedingMark != 1>>
			| [[Whore|Whore Workaround][$i = _ssi]]
		<<else>>
			| Whore
		<</if>>
		<<if (_Slave.assignment != "serve the public") && _Slave.breedingMark != 1>>
			| [[Public Servant|Public Servant Workaround][$i = _ssi]]
		<<else>>
			| Public Servant
		<</if>>
		<<if (_Slave.lactation > 0) || (_Slave.balls > 0)>>
			<<if (_Slave.assignment != "get milked")>>
				| [[Milked|Milking Workaround][$i = _ssi]]
			<<else>>
				| Milked
			<</if>>
		<</if>>
		<<if (_Slave.assignment != "stay confined")>>
			| [[Confinement|Confinement Workaround][$i = _ssi]]
		<<else>>
			| Confinement
		<</if>>
	<</if>> /* CLOSES FUCKDOLL CHECK */
<</if>>

<<set _numFacilities = $brothel+$club+$dairy+$servantsQuarters+$masterSuite+$spa+$clinic+$schoolroom+$cellblock+$arcade+$HGSuite>>
	
<<if _numFacilities > 0>>

	<<if _Pass == "Main" || _Pass == "Head Girl Suite" || _Pass == "Spa" || _Pass == "Brothel" || _Pass == "Club" || _Pass == "Arcade" || _Pass == "Clinic" || _Pass == "Schoolroom" || _Pass == "Dairy" || _Pass == "Servants' Quarters" || _Pass == "Master Suite" || _Pass == "Cellblock" >>
	<<set $returnTo=_Pass >>

	<br>Transfer to:

	<<if _Slave.assignment != "rest" && _Slave.assignment != "please you" && _Slave.assignment != "take classes" && _Slave.assignment != "be a servant" && _Slave.assignment != "whore" && _Slave.assignment != "serve the public" && _Slave.assignment != "get milked" && _Slave.assignment != "stay confined">>
		[[Penthouse|Rest Workaround][$i = _ssi]] |
	<<else>>
		Penthouse |
	<</if>>
			
	<<if $arcade != 0>>
		<<if $arcade > $arcadeSlaves && (_Slave.indentureRestrictions <= 0) && _Slave.breedingMark != 1>>
			[[Arcade|Assign][$assignTo = "Arcade", $i = _ssi]] /* $i = -1 tells Assign to use _Slave as-is */
		<<else>>Arcade<</if>>
		<<if _numFacilities-- > 1>>|<</if>>
	<</if>>

	<<if _Slave.fuckdoll == 0>> /* NON-FUCKDOLL FACILITIES */

	<<if $clinic != 0>>
		<<if $clinic > $clinicSlaves && (_Slave.health < 20 || ($Nurse != 0 && (_Slave.chem > 15 && $clinicUpgradeFilters == 1) || ($bellyImplants == 1 && _Slave.bellyImplant > -1) || (_Slave.pregKnown == 1 && ($clinicSpeedGestation >= 0 || _Slave.pregControl == "speed up"))))>>
			[[Clinic|Assign][$assignTo = "Clinic", $i = _ssi]] /* $i = -1 tells Assign to use _Slave as-is */
		<<else>>Clinic<</if>>
		<<if _numFacilities-- > 1>>|<</if>>
	<</if>>

	<<if $masterSuite != 0>>
		<<if $masterSuite > $masterSuiteSlaves && ((_Slave.devotion > 20) || ((_Slave.devotion >= -50) && (_Slave.trust < -20)) || (_Slave.trust < -50))>>
			[[Master Suite|Assign][$assignTo = "Master Suite", $i = _ssi]] /* $i = -1 tells Assign to use _Slave as-is */
		<<else>>Master Suite<</if>>
		<<if _numFacilities-- > 1>>|<</if>>
	<</if>>

	<<if $cellblock != 0>>
		<<if $cellblock > $cellblockSlaves && ((_Slave.devotion < -20 && _Slave.trust >= -20) || (_Slave.devotion < -50 && _Slave.trust >= -50))>>
			[[Cellblock|Assign][$assignTo = "Cellblock", $i = _ssi]] /* $i = -1 tells Assign to use _Slave as-is */
		<<else>>Cellblock<</if>>
		<<if _numFacilities-- > 1>>|<</if>>
	<</if>>

	<<if $schoolroom != 0>>
		<<if $schoolroom > $schoolroomSlaves && (_Slave.fetish != "mindbroken" && (_Slave.devotion >= -20 || (_Slave.devotion >= -50 && _Slave.trust < -20) || _Slave.trust < -50) && ((_Slave.intelligenceImplant < 1) || (_Slave.voice != 0 && _Slave.accent+$schoolroomUpgradeLanguage > 2) || (_Slave.oralSkill <= 10+$schoolroomUpgradeSkills*20) || (_Slave.whoreSkill <= 10+$schoolroomUpgradeSkills*20) || (_Slave.entertainSkill <= 10+$schoolroomUpgradeSkills*20) || (_Slave.analSkill < 10+$schoolroomUpgradeSkills*20) || (_Slave.vagina >= 0 && _Slave.vaginalSkill < 10+$schoolroomUpgradeSkills*20)))>>
			[[Schoolroom|Assign][$assignTo = "Schoolroom", $i = _ssi]] /* $i = -1 tells Assign to use _Slave as-is */
		<<else>>Schoolroom<</if>>
		<<if _numFacilities-- > 1>>|<</if>>
	<</if>>

	<<if $servantsQuarters != 0>>
		<<if $servantsQuarters > $servantsQuartersSlaves && (canWalk(_Slave) && canSee(_Slave) && (_Slave.devotion >= -20 || (_Slave.devotion >= -50 && _Slave.trust <= 20) || _Slave.trust < -20))>>
			[[Servants' Quarters|Assign][$assignTo = "Servants' Quarters", $i = _ssi]] /* $i = -1 tells Assign to use _Slave as-is */
		<<else>>Servants' Quarters<</if>>
		<<if _numFacilities-- > 1>>|<</if>>
	<</if>>

	<<if $brothel != 0>>
		<<if $brothel > $brothelSlaves && (((_Slave.devotion > 50) || ((_Slave.devotion >= -50) && (_Slave.trust < -20)) || (_Slave.trust < -50) || (_Slave.trust > 50)) && _Slave.breedingMark != 1)>>
			[[Brothel|Assign][$assignTo = "Brothel", $i = _ssi]] /* $i = -1 tells Assign to use _Slave as-is */
		<<else>>Brothel<</if>>
		<<if _numFacilities-- > 1>>|<</if>>
	<</if>>

	<<if $club != 0>>
		<<if $club > $clubSlaves && (((_Slave.devotion > 50) || ((_Slave.devotion >= -50) && (_Slave.trust < -20)) || (_Slave.trust < -50) || (_Slave.trust > 50)) && _Slave.breedingMark != 1)>>
			[[Club|Assign][$assignTo = "Club", $i = _ssi]] /* $i = -1 tells Assign to use _Slave as-is */
		<<else>>Club<</if>>
		<<if _numFacilities-- > 1>>|<</if>>
	<</if>>

	<<if $dairy != 0>>
		<<if $dairy > $dairySlaves && (((_Slave.indentureRestrictions > 0) && ($dairyRestraintsSetting > 1)) || ((_Slave.indentureRestrictions > 1) && ($dairyRestraintsSetting > 0)) || (_Slave.breedingMark == 1 && $dairyRestriantsSettings > 0) || (($dairyPregSetting > 0) && ((_Slave.bellyImplant != -1) || (_Slave.broodmother > 0))))>>
			Dairy
		<<elseif ((_Slave.lactation > 0) || (_Slave.balls > 0)) || (($dairyFeedersUpgrade == 1) && ($dairyFeedersSetting > 0) && ($dairySlimMaintainUpgrade == 0))>>
			 [[Dairy|Assign][$assignTo = "Dairy", $i = _ssi]] /* $i = -1 tells Assign to use _Slave as-is */
		<<else>>Dairy<</if>>
		<<if _numFacilities-- > 1>>|<</if>>
	<</if>>

	<<if $spa != 0>>
		<<if $spa > $spaSlaves && ((_Slave.devotion >= -20 || _Slave.fetish == "mindbroken") && (_Slave.health < 20 || _Slave.trust < 60 || _Slave.devotion <= 60 || _Slave.fetish == "mindbroken" || _Slave.sexualFlaw !== "none" || _Slave.behavioralFlaw !== "none"))>>
			[[Spa|Assign][$assignTo = "Spa", $i = _ssi]] /* $i = -1 tells Assign to use _Slave as-is */
		<<else>>Spa<</if>>
	<</if>>

	<</if>> /* Closes transfer options check */

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

<</if>> /* closes _numFacilities */

<br><<if $seeImages != 1 || $seeSummaryImages != 1 || $imageChoice == 1>>&nbsp;&nbsp;&nbsp;&nbsp;<</if>>

<<SlaveSummary _Slave>>

<<set $slaves[_ssi] = _Slave>>


<<switch _Pass>>
<<case "Main">>
	<<continue>>
<<case "HG Select">>
	<<if setup.HGCareers.includes(_Slave.career) || (_Slave.skillHG >= $masteredXP)>>
		<br><<if $seeImages != 1 || $seeSummaryImages != 1 || $imageChoice == 1>>&nbsp;&nbsp;&nbsp;&nbsp;<</if>>@@.lime;Has applicable career experience.@@
	<</if>>
<<case "Head Girl Suite">>
	<br><<if $seeImages != 1 || $seeSummaryImages != 1 || $imageChoice == 1>>&nbsp;&nbsp;&nbsp;&nbsp;<</if>>
	<<if $Flag == 0>>
		[[Send her to live with your Head Girl|Assign][$i = _ssi]]
	<<else>>
		[[Bring her out of the Head Girl's suite|Retrieve][$i = _ssi]]
		<<break>>
	<</if>>
<<case "Recruiter Select">>
	<<if setup.recruiterCareers.includes(_Slave.career) || (_Slave.skillRC >= $masteredXP)>>
		<br><<if $seeImages != 1 || $seeSummaryImages != 1 || $imageChoice == 1>>&nbsp;&nbsp;&nbsp;&nbsp;<</if>>@@.lime;Has applicable career experience.@@
	<</if>>
<<case "BG Select">>
	<<if setup.bodyguardCareers.includes(_Slave.career) || (_Slave.skillBG >= $masteredXP)>>
		<br><<if $seeImages != 1 || $seeSummaryImages != 1 || $imageChoice == 1>>&nbsp;&nbsp;&nbsp;&nbsp;<</if>>@@.lime;Has applicable career experience.@@
	<</if>>
<<case "Spa">>
	<br><<if $seeImages != 1 || $seeSummaryImages != 1 || $imageChoice == 1>>&nbsp;&nbsp;&nbsp;&nbsp;<</if>>
	<<if $Flag == 0>>
		[[Send her to the Spa|Assign][$i = _ssi]]
	<<elseif $Flag == 1>>
		[[Remove her from the Spa|Retrieve][$i = _ssi]]
	<<else>>
		[[Change or remove Attendant|Attendant Select]]
		<<break>>
	<</if>>
<<case "Attendant Select">>
	<<if setup.attendantCareers.includes(_Slave.career) || (_Slave.skillAT >= $masteredXP)>>
		<br><<if $seeImages != 1 || $seeSummaryImages != 1 || $imageChoice == 1>>&nbsp;&nbsp;&nbsp;&nbsp;<</if>>@@.lime;Has applicable career experience.@@
	<</if>>
<<case "Brothel">>
	<br><<if $seeImages != 1 || $seeSummaryImages != 1 || $imageChoice == 1>>&nbsp;&nbsp;&nbsp;&nbsp;<</if>>
	<<if $Flag == 0>>
		[[Send her to the Brothel|Assign][$i = _ssi]]
	<<elseif $Flag == 1>>
		[[Release her from the Brothel|Retrieve][$i = _ssi]]
	<<else>>
		[[Change or remove Madam|Madam Select]]
		<<break>>
	<</if>>
<<case "Madam Select">>
	<<if setup.madamCareers.includes(_Slave.career) || (_Slave.skillMD >= $masteredXP)>>
		<br><<if $seeImages != 1 || $seeSummaryImages != 1 || $imageChoice == 1>>&nbsp;&nbsp;&nbsp;&nbsp;<</if>>@@.lime;Has applicable career experience.@@
	<</if>>
<<case "Club">>
	<br><<if $seeImages != 1 || $seeSummaryImages != 1 || $imageChoice == 1>>&nbsp;&nbsp;&nbsp;&nbsp;<</if>>
	<<if $Flag == 0>>
		[[Send her to the Club|Assign][$i = _ssi]]
	<<elseif $Flag == 1>>
		[[Remove her from the Club|Retrieve][$i = _ssi]]
	<<else>>
		[[Change or remove DJ|DJ Select]]
		<<break>>
	<</if>>
<<case "Arcade">>
	<br><<if $seeImages != 1 || $seeSummaryImages != 1 || $imageChoice == 1>>&nbsp;&nbsp;&nbsp;&nbsp;<</if>>
	<<if $Flag == 0>>
		[[Confine her in the Arcade|Assign][$i = _ssi]]
	<<else>>
		[[Release her from the Arcade|Retrieve][$i = _ssi]]
	<</if>>
<<case "DJ Select">>
	<<if setup.DJCareers.includes(_Slave.career) || (_Slave.skillDJ >= $masteredXP)>>
		<br><<if $seeImages != 1 || $seeSummaryImages != 1 || $imageChoice == 1>>&nbsp;&nbsp;&nbsp;&nbsp;<</if>>@@.lime;Has applicable career experience.@@
	<</if>>
<<case "Clinic">>
	<br><<if $seeImages != 1 || $seeSummaryImages != 1 || $imageChoice == 1>>&nbsp;&nbsp;&nbsp;&nbsp;<</if>>
	<<if $clinicUpgradeScanner == 1>>
		@@.cyan;Estimated DNA error value: <<print Math.ceil(_Slave.chem/10)>>@@
	<</if>>
	<<if $Flag == 0>>
		[[Send her to the Clinic|Assign][$i = _ssi]]
	<<elseif $Flag == 1>>
		[[Take her out of the Clinic|Retrieve][$i = _ssi]]
	<<else>>
		[[Change or remove Nurse|Nurse Select]]
		<<break>>
	<</if>>
<<case "Nurse Select">>
	<<if setup.nurseCareers.includes(_Slave.career) || (_Slave.skillNU >= $masteredXP)>>
		<br><<if $seeImages != 1 || $seeSummaryImages != 1 || $imageChoice == 1>>&nbsp;&nbsp;&nbsp;&nbsp;<</if>>@@.lime;Has applicable career experience.@@
	<</if>>
<<case "Schoolroom">>
	<br><<if $seeImages != 1 || $seeSummaryImages != 1 || $imageChoice == 1>>&nbsp;&nbsp;&nbsp;&nbsp;<</if>>
	<<if $Flag == 0>>
		[[Assign her to the Schoolroom|Assign][$i = _ssi]]
	<<elseif $Flag == 1>>
		[[Release her from the Schoolroom|Retrieve][$i = _ssi]]
	<<else>>
		[[Change or remove Schoolteacher|Schoolteacher Select]]
		<<break>>
	<</if>>
<<case "Schoolteacher Select">>
	<<if setup.schoolteacherCareers.includes(_Slave.career) || (_Slave.skillTE >= $masteredXP)>>
		<br><<if $seeImages != 1 || $seeSummaryImages != 1 || $imageChoice == 1>>&nbsp;&nbsp;&nbsp;&nbsp;<</if>>@@.lime;Has applicable career experience.@@
	<</if>>
<<case "Dairy">>
	<br><<if $seeImages != 1 || $seeSummaryImages != 1 || $imageChoice == 1>>&nbsp;&nbsp;&nbsp;&nbsp;<</if>>
	<<if $Flag == 0>>
		[[Send her to the Dairy|Assign][$i = _ssi]]
	<<elseif $Flag == 1>>
		[[Release her from the Dairy|Retrieve][$i = _ssi]]
	<<else>>
		[[Change or remove Milkmaid|Milkmaid Select]]
		<<break>>
	<</if>>
<<case "Milkmaid Select">>
	<<if setup.milkmaidCareers.includes(_Slave.career) || (_Slave.skillMM >= $masteredXP)>>
		<br><<if $seeImages != 1 || $seeSummaryImages != 1 || $imageChoice == 1>>&nbsp;&nbsp;&nbsp;&nbsp;<</if>>@@.lime;Has applicable career experience.@@
	<</if>>
<<case "Servants' Quarters">>
	<br><<if $seeImages != 1 || $seeSummaryImages != 1 || $imageChoice == 1>>&nbsp;&nbsp;&nbsp;&nbsp;<</if>>
	<<if $Flag == 0>>
		[[Assign her to the Servants' Quarters|Assign][$i = _ssi]]
	<<elseif $Flag == 1>>
		[[Release her from the Servants' Quarters|Retrieve][$i = _ssi]]
	<<else>>
		[[Change or remove Stewardess|Stewardess Select]]
		<<break>>
	<</if>>
<<case "Stewardess Select">>
	<<if setup.stewardessCareers.includes(_Slave.career) || (_Slave.skillST >= $masteredXP)>>
		<br><<if $seeImages != 1 || $seeSummaryImages != 1 || $imageChoice == 1>>&nbsp;&nbsp;&nbsp;&nbsp;<</if>>@@.lime;Has applicable career experience.@@
	<</if>>
<<case "Master Suite">>
<br><<if $seeImages != 1 || $seeSummaryImages != 1 || $imageChoice == 1>>&nbsp;&nbsp;&nbsp;&nbsp;<</if>>
	<<if $Flag == 0>>
		[[Add her to the Suite|Assign][$i = _ssi]]
	<<elseif $Flag == 1>>
		[[Send her out of the Suite|Retrieve][$i = _ssi]]
	<<else>>
		[[Change or remove Concubine|Concubine Select]]
		<<break>>
	<</if>>
<<case "Cellblock">>
	<br><<if $seeImages != 1 || $seeSummaryImages != 1 || $imageChoice == 1>>&nbsp;&nbsp;&nbsp;&nbsp;<</if>>
	<<if $Flag == 0>>
		[[Confine her in the cellblock|Assign][$i = _ssi]]
	<<elseif $Flag == 1>>
		[[Release her from the cellblock|Retrieve][$i = _ssi]]
	<<else>>
		[[Change or remove Wardeness|Wardeness Select]]
		<<break>>
	<</if>>
<<case "Wardeness Select">>
	<<if setup.wardenessCareers.includes(_Slave.career) || (_Slave.skillWA >= $masteredXP)>>
		<br><<if $seeImages != 1 || $seeSummaryImages != 1 || $imageChoice == 1>>&nbsp;&nbsp;&nbsp;&nbsp;<</if>>@@.lime;Has applicable career experience.@@
	<</if>>
<<case "New Game Plus">>
	<br><<if $seeImages != 1 || $seeSummaryImages != 1 || $imageChoice == 1>>&nbsp;&nbsp;&nbsp;&nbsp;<</if>>
	<<if $Flag == 0>>
		[[Add to import list|NGP Workaround][$slavesToImport = 1, $i = _ssi]]
	<<else>>
		[[Remove from import list|NGP Workaround][$slavesToImport = 0, $i = _ssi]]
		<<set $slavesToImport += 1>>
	<</if>>
<<case "Matchmaking">>
	<br><<if $seeImages != 1 || $seeSummaryImages != 1 || $imageChoice == 1>>&nbsp;&nbsp;&nbsp;&nbsp;<</if>>
	[[Match them|Matchmaking][$subSlave = $slaves[_ssi]]]
<</switch>>

<</capture>>

<</for>>
<<set $activeSlave = 0, _Slave = 0>>

src/uncategorized/slaveSummary.tw