:: Spa Report [nobr]

<<set _slaves = App.Utils.sortedEmployees(App.Entity.facilities.spa)>>
<<set _DL = _slaves.length, _SL = $slaves.length, _bonusToggle = 0, _healthBonus = 0, _idleBonus = 0, _restedSlaves = 0, _trustBonus = 0>>

<<if $spaDecoration != "standard">>
	<<set _devBonus = 1>>
<<else>>
	<<set _devBonus = 0>>
<</if>>

<<if $AttendantID != 0>>
	<<if (_S.Attendant.health.condition < 100)>>
		<<run improveCondition(_S.Attendant, normalRandInt(20))>>
	<</if>>
	<<if (_S.Attendant.devotion <= 60)>>
		<<set _S.Attendant.devotion++>>
	<</if>>
	<<if _S.Attendant.trust < 60>>
		<<set _S.Attendant.trust++>>
	<</if>>
	<<if _S.Attendant.rules.living != "luxurious">>
		<<set _S.Attendant.rules.living = "luxurious">>
	<</if>>
	<<set _FLsFetish = 0>>
	<<if _S.Attendant.fetishStrength <= 95>>
		<<if _S.Attendant.fetish != "submissive">>
			<<if fetishChangeChance(_S.Attendant) > random(0,100)>>
				<<set _FLsFetish = 1, _S.Attendant.fetishKnown = 1, _S.Attendant.fetish = "submissive">>
			<</if>>
		<<elseif _S.Attendant.fetishKnown == 0>>
			<<set _FLsFetish = 1, _S.Attendant.fetishKnown = 1>>
		<<else>>
			<<set _FLsFetish = 2, _S.Attendant.fetishStrength += 4>>
		<</if>>
	<</if>>
	<<if (_S.Attendant.fetish == "none") || (_S.Attendant.fetish == "submissive")>>
		<<set _devBonus++>>
	<</if>>
	<<set _S.Attendant.devotion += _devBonus>>
	<<setLocalPronouns _S.Attendant>>
	&nbsp;&nbsp;&nbsp;&nbsp;<<= SlaveFullName(_S.Attendant)>> is serving as the spa attendant.<<if _S.Attendant.relationship == -3 && _S.Attendant.devotion > 50>> $He tries $his best to be your perfect attentive, caring and loving $wife.<</if>>
	<<if (_FLsFetish == 1)>>
		When $he is paid a visit by a slave with sexual issues to work out, $he provides them with an understanding, willing, giving partner. $He finds real satisfaction in helping your slaves find sexual gratification, and @@.lightsalmon;becomes a submissive.@@
	<<elseif (_FLsFetish == 2)>>
		Every new slave in the spa is a new person $he gets to connect with and serve. Sexually. @@.lightsalmon;$He becomes more submissive.@@
	<</if>>
	<<if setup.attendantCareers.includes(_S.Attendant.career)>>
		$He has experience with counseling from $his life before $he was a slave, making $him better at building rapport with troubled slaves, and giving $him a better chance of softening flaws into beneficial quirks.
		<<set _bonusToggle = 1, _idleBonus++>>
	<<elseif _S.Attendant.skill.attendant >= $masteredXP>>
		$He has experience with counseling from working for you, making $him better at building rapport with troubled slaves, and giving $him a better chance of softening flaws into beneficial quirks.
		<<set _bonusToggle = 1, _idleBonus++>>
	<<else>>
		<<set _S.Attendant.skill.attendant += random(1,Math.ceil((_S.Attendant.intelligence+_S.Attendant.intelligenceImplant)/15) + 8)>>
	<</if>>
	<<if !canSee(_S.Attendant)>>
		$His blindness allows $him to deeply connect with $his charges.
		<<set _idleBonus++>>
	<</if>>
	<<if (_S.Attendant.fetish == "none")>>
		_S.Attendant.slaveName respects the slaves lounging in the spa, allowing them to relax completely.
		<<set _idleBonus++>>
	<<elseif (_S.Attendant.fetish == "submissive")>>
		_S.Attendant.slaveName lets the slaves resting in the spa take the lead sexually, doing $his best to please them.
		<<set _idleBonus++>>
	<<elseif (_S.Attendant.fetishKnown == 1)>>
		_S.Attendant.slaveName can't keep $his hand<<if hasBothArms(_S.Attendant)>>s<</if>> to $himself, preventing the slaves in the spa from relaxing completely.
	<</if>>
	<<if (_S.Attendant.visualAge > 35)>>
		$His apparent maturity encourages the slaves in the spa to relax and pour out their troubles to $him.
		<<set _healthBonus++, _idleBonus++>>
	<</if>>
	<<if (_S.Attendant.intelligence+_S.Attendant.intelligenceImplant > 15)>>
		$He's so intelligent $he can suss out the cause of slaves' emotional issues and counsel them effectively.
		<<set _idleBonus++>>
	<</if>>
	<<if isFertile(_S.Attendant) || (_S.Attendant.bellyPreg >= 1500) || (_S.Attendant.counter.birthsTotal > 0) || (_S.Attendant.bellyImplant >= 1500)>>
		$He has a natural mothering instinct and really makes $his charges feel at home.
		<<set _idleBonus++, _healthBonus++>>
	<</if>>
	<<set _attendantUsedCure = 0>>
	<<for _slave range _slaves>>
		<<set $i = $slaveIndices[_slave.ID]>>
		<<setLocalPronouns _slave 2>>
		<<if (_slave.fetish == "mindbroken") && (_slave.health.condition > 20) && (_attendantUsedCure == 0) && ($spaFix != 2)>>
			<<set _attendantUsedCure = 1>>
			<<if (random(1,100) > 90-_S.Attendant.devotion)>>
				<br>&nbsp;&nbsp;&nbsp;&nbsp;@@.green;Something almost miraculous has happened.@@ _S.Attendant.slaveName has always refused to believe that _slave.slaveName could not be reached, and has lavished patient tenderness on _him2 in $spaName. _slave.slaveName has begun to respond, and is stirring from _his2 mental torpor.
				<<set _slave.devotion = -3, _slave.sexualFlaw = "apathetic", _slave.behavioralFlaw = either("hates men", "odd"), _slave.fetish = "none", _slave.fetishKnown = 1>>
				<<set _spr = $genePool.findIndex(function(s) { return s.ID == _slave.ID; })>>
				<<if $genePool[_spr].intelligence >= -95>>
					<<set _slave.intelligence = $genePool[_spr].intelligence-30>>
				<</if>>
				<<if ($arcologies[0].FSPaternalist > 0)>>
					Society @@.green;strongly approves@@ of _slave.slaveName being restored to sanity, which advances ideals about enlightened slaveownership.
					<<set $arcologies[0].FSPaternalist += 0.01*$FSSingleSlaveRep>>
					<<run repX(2*$FSSingleSlaveRep*($arcologies[0].FSPaternalist/$FSLockinLevel), "spa", _slave)>>
				<</if>>
			<</if>>
		<</if>>
		<<set _seed = _bonusToggle * 10>>
		<<if _bonusToggle == 1 && _slave.trust < 60>>
			<<set _slave.trust++>>
		<</if>>
		<<if _S.Attendant.rivalryTarget == _slave.ID>>
			$He constantly harasses $his <<print rivalryTerm(_S.Attendant)>>, _slave.slaveName, preventing _him2 from getting comfortable and forcing _him2 to keep _his2 guard up.
			<<set _slave.devotion -= 4, _slave.trust -= 4>>
			<<if random(1,100) > 35>>
				<<set _S.Attendant.rivalry++, _S.Attendant.rivalry++, _slave.rivalry++>>
			<</if>>
		<<elseif _S.Attendant.relationshipTarget == _slave.ID>>
			$He dedicates most of $his attention to $his <<print relationshipTerm(_S.Attendant)>>, _slave.slaveName, making _his2 stress, both physical and mental, wash away.
			<<set _slave.devotion += 3, _slave.trust += 3>>
		<<elseif areRelated(_S.Attendant, _slave)>>
			$He makes sure to spend extra time caring for $his <<print relativeTerm(_S.Attendant,_slave)>>, _slave.slaveName.
			<<set _slave.trust++>>
			<<run improveCondition(_slave, 1)>>
		<</if>>
		<<switch _slave.prestigeDesc>>
		<<case "$He is a famed Free Cities whore, and commands top prices.">>
			$He does $his best to relax the famous whore, _slave.slaveName, making sure to
			<<if _slave.vagina > 2 || _slave.anus > 2>>
				pay special attention to _his2 worn holes.
			<<else>>
				get _him2 clean and relaxed for _his2 next usage.
			<</if>>
			<<set _slave.devotion += 3, _slave.trust += 3>>
		<<case "$He is a famed Free Cities slut, and can please anyone.">>
			$He does $his best to soothe the famous entertainer, _slave.slaveName, letting _him2 relax in blissful peace.
			<<set _slave.devotion += 3, _slave.trust += 3>>
		<<case "$He is remembered for winning best in show as a cockmilker.">>
			<<if (_slave.balls > 6) && (_slave.dick != 0)>>
				<<if _S.Attendant.fetish == "cumslut">>
					$He can't keep $his hand<<if hasBothArms(_S.Attendant)>>s<</if>> off _slave.slaveName's cock and balls, but _he2 doesn't mind being milked constantly. Before long, strands of cum can be found floating all throughout the bath.
					<<set _S.Attendant.fetishStrength += 4>>
				<<else>>
					$He does $his best to accommodate _slave.slaveName's massive genitals and tends to _him2 whenever _he2 feels a need for release.
					<<if random(1,100) > 65 && _S.Attendant.fetish == "none">>
						After taking several massive loads to the face, _S.Attendant.slaveName begins to find satisfaction in being coated in cum.
						<<set _S.Attendant.fetish = "cumslut">>
					<</if>>
				<</if>>
			<</if>>
			<<set _slave.devotion += 3, _slave.trust += 3>>
		<<case "$He is remembered for winning best in show as a dairy cow.">>
			<<if (_slave.lactation > 0) && ((_slave.boobs-_slave.boobsImplant) > 6000)>>
				<<if _S.Attendant.fetish == "boobs">>
					$He can't keep $his hand<<if hasBothArms(_S.Attendant)>>s<</if>> off _slave.slaveName's huge breasts, but _he2 doesn't mind being milked constantly. Before long the bath gains a white tint.
					<<set _S.Attendant.fetishStrength += 4, _S.Attendant.fetishStrength += 4>>
				<<else>>
					$He does $his best to accommodate _slave.slaveName's massive breasts and tends to _him2 whenever _he2 feels a need for release.
					<<if random(1,100) > 65 && _S.Attendant.fetish == "none">>
						After multiple milking sessions, _S.Attendant.slaveName begins to find $himself fantasizing about having giant milky breasts too.
						<<set _S.Attendant.fetish = "boobs">>
					<</if>>
				<</if>>
				<<set _slave.devotion += 3, _slave.trust += 3, _slave.lactationDuration = 2, _slave.boobs -= _slave.boobsMilk, _slave.boobsMilk = 0>>
			<</if>>
		<<case "$He is remembered for winning best in show as a breeder.">>
			<<if _slave.bellyPreg >= 5000>>
				<<if _S.Attendant.fetish == "pregnancy">>
					$He can't keep $his hand<<if hasBothArms(_S.Attendant)>>s<</if>> off _slave.slaveName's pregnancy, but _he2 doesn't mind _his2 full belly being fondled.
					<<set _S.Attendant.fetishStrength += 4, _S.Attendant.fetishStrength += 4>>
				<<else>>
					$He does $his best to accommodate _slave.slaveName's pregnancy and to make sure the mother-to-be is happy and comfortable.
					<<if random(1,100) > 65 && _S.Attendant.fetish == "none">>
						After massaging _slave.slaveName's growing belly multiple times, _S.Attendant.slaveName begins to find $himself fantasizing about being swollen with life too.
						<<set _S.Attendant.fetish = "pregnancy">>
					<</if>>
				<</if>>
				<<set _slave.devotion += 3, _slave.trust += 3>>
			<<else>>
				<<if _S.Attendant.fetish == "pregnancy">>
					$He can't help but pester _slave.slaveName with questions about _his2 famous pregnancy, limiting _his2 ability to truly relax.
					<<set _slave.devotion += 1, _slave.trust += 1>>
				<<elseif canGetPregnant(_slave)>>
					$He does $his best to encourage _slave.slaveName's fertilization by performing any fertility boosting actions $he can.
					<<set _slave.devotion += 3, _slave.trust += 3>>
				<</if>>
			<</if>>
		<</switch>>
		<<if (_S.Attendant.intelligence+_S.Attendant.intelligenceImplant > 15) && (_attendantUsedCure == 0) && ((_S.Attendant.intelligence+_S.Attendant.intelligenceImplant)+_seed) > random(1,200) && ($spaFix == 0)>>
			<<if _slave.behavioralFlaw != "none">>
				<<run SoftenBehavioralFlaw(_slave)>>
				<<set _attendantUsedCure += 1>>
				<br>&nbsp;&nbsp;&nbsp;&nbsp;_S.Attendant.slaveName works carefully with _slave.slaveName, and successfully @@.green;softens _his2 behavioral flaw@@ into an appealing quirk.
			<<elseif _slave.sexualFlaw != "none">>
				<<run SoftenSexualFlaw(_slave)>>
				<<set _attendantUsedCure += 1>>
				<br>&nbsp;&nbsp;&nbsp;&nbsp;_S.Attendant.slaveName works carefully with _slave.slaveName, and successfully @@.green;softens _his2 sexual flaw@@ into an appealing quirk.
			<</if>>
		<</if>>
		<<if _slave.lactation > 0>>
			_S.Attendant.slaveName takes care to keep _slave.slaveName's breasts comfortably drained.
			<<set _slave.lactationDuration = 2, _slave.boobs -= _slave.boobsMilk, _slave.boobsMilk = 0>>
		<</if>>
	<</for>>
	<<if (_DL < $spa)>>
		<<set _seed = random(1,10)+(($spa-_DL)*(random(150,170)+(_idleBonus*10)))>>
		<<run cashX(_seed, "spa", _S.Attendant)>>
		<br>&nbsp;&nbsp;&nbsp;&nbsp;Since $he doesn't have enough slaves to occupy all $his time, the spa takes in citizens' slaves on a contract basis and $he helps them too, earning @@.yellowgreen;<<print cashFormat(_seed)>>.@@
		<<if ($arcologies[0].FSHedonisticDecadence > 0) && (_DL == 0)>>
			Society @@.green;loves@@ being allowed to lounge in your spa, greatly advancing your laid back culture.
			<<= FutureSocieties.Change("Hedonistic", 2)>>
		<</if>>
	<</if>>
	<<if (_DL > 0)>><br><br><</if>>
<</if>>

<<if (_DL > 0)>>
	&nbsp;&nbsp;&nbsp;&nbsp;''<<if (_DL > 1)>>There are _DL slaves<<else>>There is one slave<</if>> resting and recuperating in the spa.''
	<<if ($arcologies[0].FSHedonisticDecadence > 0) && (_DL == 0)>>
		Society @@.green;approves@@ of your slaves being pampered this way, greatly advancing your laid back culture.
		<<= FutureSocieties.Change("Hedonistic", 1)>>
	<</if>>
<</if>>

<<if _S.Attendant>>
	<<set $i = $slaveIndices[$AttendantID]>> /* apply following SA passages to facility leader */
	<<if $showEWD != 0>>
		<br><br>
		/* 000-250-006 */
		<<if $seeImages && $seeReportImages>>
		<div class="imageRef smlImg">
			<<= SlaveArt(_S.Attendant, 0, 0)>>
		</div>
		<</if>>
		/* 000-250-006 */
		<span class='slave-name'><<= SlaveFullName(_S.Attendant)>></span> is serving as the Attendant in $spaName.
		<br>&nbsp;&nbsp;&nbsp;
		<<= App.SlaveAssignment.choosesOwnClothes(_S.Attendant)>>
		<<run tired(_S.Attendant)>>
		<<include "SA rules">>
		<<include "SA diet">>
		<<include "SA long term effects">>
		<<= App.SlaveAssignment.drugs(_S.Attendant)>>
		<<include "SA relationships">>
		<<include "SA rivalries">>
		<br><<include "SA devotion">>
	<<else>>
		<<silently>>
		<<run App.SlaveAssignment.choosesOwnClothes(_S.Attendant)>>
		<<run tired(_S.Attendant)>>
		<<include "SA rules">>
		<<include "SA diet">>
		<<include "SA long term effects">>
		<<run App.SlaveAssignment.drugs(_S.Attendant)>>
		<<include "SA relationships">>
		<<include "SA rivalries">>
		<<include "SA devotion">>
		<</silently>>
	<</if>>
<</if>>

<<for _slave range _slaves>>
	<<set $i = $slaveIndices[_slave.ID]>>
	<<setLocalPronouns _slave>>
	<<set _slave.devotion += _devBonus, _slave.trust += _trustBonus>>
	<<run improveCondition(_slave, 5 + _healthBonus)>>
	<<if (_slave.health.condition < -80)>>
		<<run improveCondition(_slave, 15)>>
	<<elseif _slave.health.condition < -40>>
		<<run improveCondition(_slave, 10)>>
	<<elseif _slave.health.condition < 0>>
		<<run improveCondition(_slave, 5)>>
	<</if>>
	<<if ($spaUpgrade == 1) && (_slave.health.condition < 100)>>
		<<run improveCondition(_slave, normalRandInt(8))>>
	<</if>>
	<<if (_slave.devotion < 60) && (_slave.trust < 60)>>
		<<set _slave.devotion++, _slave.trust++>>
	<<elseif (_slave.trust < 40)>>
		<<set _slave.trust += 10>>
	<<elseif (_slave.devotion < 40)>>
		<<set _slave.devotion += 10>>
	<</if>>
	<<switch $spaDecoration>>
	<<case "Chattel Religionist" "Chinese Revivalist">>
		<<set _slave.rules.living = "normal">>
	<<case "Degradationist">>
		<<set _slave.rules.living = "spare">>
	<<default>>
		<<set _slave.rules.living = "luxurious">>
	<</switch>>
	<<if (_slave.health.condition >= 20) && (_slave.health.tired < 20) && (_slave.trust > 60) && (_slave.devotion > 60) && (_slave.fetish != "mindbroken") && (_slave.sexualFlaw == "none") && (_slave.behavioralFlaw == "none")>>
		<p>
			<span class="slave-name">_slave.slaveName</span> is feeling well enough to leave $spaName,
			<span class="noteworthy">
				<<if $assignmentRecords[_slave.ID]>>
					<<set _oldJob = $assignmentRecords[_slave.ID]>>
					<<= assignJobSafely(_slave, _oldJob)>>
					<<if _slave.choosesOwnAssignment === 1>>
						and $he is resting before choosing another task.
					<<elseif _slave.assignment === "rest">>
						<<if _oldJob != "rest">>
							and since $he was unable to return to $his old task to <<print _oldJob>>, $his assignment has defaulted to rest.
						<<else>>
							so $he has returned to rest.
						<</if>>
					<<else>>
						so $he goes back to <<print _slave.assignment>>.
					<</if>>
				<<else>>
					so $his assignment has defaulted to rest.
					<<= removeJob(_slave, "rest in the spa")>>
				<</if>>
			</span>
		</p>
		<<set _restedSlaves++, _DL--, _dI-->>
		<<continue>>
	<</if>>
	<<if $showEWD != 0>>
		<br><br>
		/* 000-250-006 */
		<<if $seeImages && $seeReportImages>>
		<div class="imageRef smlImg">
			<<= SlaveArt(_slave, 0, 0)>>
		</div>
		<</if>>
		/* 000-250-006 */
		<span class='slave-name'><<= SlaveFullName(_slave)>></span>
		<<if _slave.choosesOwnAssignment == 2>>
			<<include "SA chooses own job">>
		<<else>>
			is resting in $spaName.
		<</if>>
		<br>&nbsp;&nbsp;&nbsp;&nbsp;$He <<= App.SlaveAssignment.rest(_slave)>>
		<<if (_slave.fetish == "mindbroken")>>
			$He remains in the Spa, completely mindbroken.
		<<elseif(_slave.sexualFlaw != "none") || (_slave.behavioralFlaw != "none")>>
			$He remains in the Spa, stubborn in $his flaw.
		<<elseif (_slave.trust < 60) || (_slave.devotion < 60)>>
			$He remains in the Spa, as $he is still learning to accept life as a slave.
		<<elseif (_slave.health.condition < 20)>>
			$He remains in the Spa, as $he is benefiting from its healing properties.
		<</if>>
		<br>&nbsp;&nbsp;&nbsp;
		<<= App.SlaveAssignment.choosesOwnClothes(_slave)>>
		<<include "SA rules">>
		<<include "SA diet">>
		<<include "SA long term effects">>
		<<= App.SlaveAssignment.drugs(_slave)>>
		<<include "SA relationships">>
		<<include "SA rivalries">>
		<br><<include "SA devotion">>
	<<else>>
		<<silently>>
		<<include "SA chooses own job">>
		<<run App.SlaveAssignment.choosesOwnClothes(_slave)>>
		<<run App.SlaveAssignment.rest(_slave)>>
		<<include "SA rules">>
		<<include "SA diet">>
		<<include "SA long term effects">>
		<<run App.SlaveAssignment.drugs(_slave)>>
		<<include "SA relationships">>
		<<include "SA rivalries">>
		<<include "SA devotion">>
		<</silently>>
	<</if>>
<</for>>
<<if (_restedSlaves > 0)>>
	<br><br>&nbsp;&nbsp;&nbsp;
	<<if (_restedSlaves == 1)>>
		One slave has rested until $he reached a state of @@.hotpink;devotion@@ and @@.mediumaquamarine;trust@@ and will leave the spa before the end of the week.
	<<else>>
		_restedSlaves slaves have rested until they reached a state of @@.hotpink;devotion@@ and @@.mediumaquamarine;trust@@ and will leave the spa before the end of the week.
	<</if>>
	<<if $spaDecoration != "standard">>
		<br><br>&nbsp;&nbsp;&nbsp;&nbsp;$spaNameCaps's $spaDecoration atmosphere @@.hotpink;had an impact on <<if _restedSlaves == 1>>$him while $he was<<else>>them while they were<</if>>@@ resting.
	<</if>>
<</if>>
<<if _DL > 0 || _S.Attendant>>
	<br><br>
<</if>>

src/uncategorized/spaReport.tw