:: Cellblock Report [nobr]

<<set _slaves = App.Utils.sortedEmployees(App.Entity.facilities.cellblock)>>
<<set _DL = _slaves.length, _SL = $slaves.length, _brokenSlaves = 0, _idleBonus = 0, _softenedQuirks = 0, _trustMalus = 0, _FLsFetish = 0>>

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

<<if ($Wardeness != 0)>>
	<<set _FLs = $slaveIndices[$Wardeness.ID]>>
	<<setLocalPronouns $Wardeness>>

	<<if ($slaves[_FLs].health.condition < -80)>>
		<<run improveCondition($slaves[_FLs], 20)>>
	<<elseif ($slaves[_FLs].health.condition < -40)>>
		<<run improveCondition($slaves[_FLs], 15)>>
	<<elseif ($slaves[_FLs].health.condition < 0)>>
		<<run improveCondition($slaves[_FLs], 10)>>
	<<elseif ($slaves[_FLs].health.condition < 90)>>
		<<run improveCondition($slaves[_FLs], 7)>>
	<</if>>
	<<if ($slaves[_FLs].devotion <= 60)>>
		<<set $slaves[_FLs].devotion += 2>>
	<</if>>
	<<set $slaves[_FLs].devotion += _devBonus>>
	<<if $slaves[_FLs].trust < 60>>
		<<set $slaves[_FLs].trust += 3>>
	<</if>>
	<<if ($slaves[_FLs].rules.living != "luxurious")>>
		<<set $slaves[_FLs].rules.living = "luxurious">>
	<</if>>
	<<if $slaves[_FLs].fetishStrength <= 95>>
		<<if $slaves[_FLs].fetish != "sadist">>
			<<if fetishChangeChance($slaves[_FLs]) > random(0,100)>>
				<<set _FLsFetish = 1, $slaves[_FLs].fetishKnown = 1, $slaves[_FLs].fetish = "sadist">>
			<</if>>
		<<elseif $slaves[_FLs].fetishKnown == 0>>
			<<set _FLsFetish = 1, $slaves[_FLs].fetishKnown = 1>>
		<<else>>
			<<set _FLsFetish = 2, $slaves[_FLs].fetishStrength += 4>>
		<</if>>
	<</if>>
	<<set $Wardeness = $slaves[_FLs]>>
	<<if ($Wardeness.energy > 95) || ($Wardeness.fetish == "sadist")>>
		<<set _devBonus++, _trustMalus++, _idleBonus++>>
	<</if>>
	&nbsp;&nbsp;&nbsp;&nbsp;<<= SlaveFullName($Wardeness)>> is serving as the Wardeness.
	<<if $Wardeness.relationship == -3 && $Wardeness.devotion > 50>>
		<<set _devBonus++, _trustMalus++, _idleBonus++>>
		As your $wife, $he tries $his best to break the disobedient slaves to your will.
	<</if>>
	<<if (_FLsFetish == 1)>>
		One day $he demands obedience. The next day $he strikes a slave when it isn't given. The next, $he seems more excited than embarrassed when beating a prisoner. Soon, $he's looking for an excuse to punish. $He's @@.pink;become more of a sadist.@@
	<<elseif (_FLsFetish == 2)>>
		Being not only allowed but encouraged to get off while punishing prisoners @@.lightsalmon;deepens $his sadism.@@
	<</if>>
	<<if setup.wardenessCareers.includes($Wardeness.career)>>
		<<set _devBonus++, _trustMalus++, _idleBonus++>>
		$He has experience with detecting security issues and grinding down potential miscreants from $his life before $he was a slave, making $him more effective.
	<<elseif $Wardeness.skill.wardeness >= $masteredXP>>
		<<set _devBonus++, _trustMalus++, _idleBonus++>>
		$He has experience with detecting security issues and grinding down potential miscreants from working for you, making $him more effective.
	<<else>>
		<<set $slaves[_FLs].skill.wardeness += random(1,Math.ceil(($Wardeness.intelligence+$Wardeness.intelligenceImplant)/15) + 8)>>
	<</if>>
	<<if $Wardeness.fetish == "sadist">>
		$He uses the prisoners to gratify $his sadism, terrifying them and quickly breaking their resistance.
	<<elseif $Wardeness.energy > 95>>
		$He is so sexually depraved that $he constantly molests the prisoners, breaking them to a life of servitude.
	<</if>>
	<<if $Wardeness.sexualFlaw == "malicious" || $Wardeness.sexualFlaw == "abusive">>
		<<set _devBonus++, _trustMalus += 2, _idleBonus += 2>>
		Sexual abuse of prisoners has become an end for $him, not a means. $He inspires $his prisoners to do everything possible to qualify to get away from $him, even as $he slowly grinds away their interest in sex to do it.
	<<elseif $Wardeness.sexualQuirk == "caring">>
		<<set _devBonus--, _trustMalus--, _idleBonus-->>
		$His kindness sometimes shows through $his tough facade, letting prisoners get off easier than they should.
	<</if>>
	<<if ($Wardeness.dick > 2) && (canPenetrate($Wardeness))>>
		<<set _devBonus++, _trustMalus++, _idleBonus++>>
		$His molestation of the prisoners is more varied and effective because $he has a dick to fuck them with.
	<</if>>
	<<if ($Wardeness.muscles > 35)>>
		<<set _devBonus++, _trustMalus++, _idleBonus++>>
		$He is strong enough to restrain anyone that tries anything with $his own hands.
	<</if>>
	<<if ($Wardeness.devotion > 95)>>
		<<set _devBonus++, _trustMalus++, _idleBonus++>>
		$His devotion to you is so absolute that $he sees breaking bitches for your service as a noble calling.
	<</if>>
	<<for _slave range _slaves>>
		<<if $Wardeness.rivalryTarget == _slave.ID>>
			$He greatly enjoys breaking $his <<print rivalryTerm($Wardeness)>>, _slave.slaveName's will.
			<<set _slave.devotion++, _slave.trust -= 3>>
			<<if random(1,100) > 30>>
				<<set $Wardeness.rivalry++, $slaves[_FLs].rivalry++, _slave.rivalry++>>
			<</if>>
		<<elseif $Wardeness.relationshipTarget == _slave.ID>>
			$He hates having to break $his <<print relationshipTerm($Wardeness)>>, _slave.slaveName, but $his devotion to you wins out in the end.
			<<set _slave.devotion++, _slave.trust -= 3>>
			<<if random(1,100) >= 50>>
				$His and _slave.slaveName's relationship has been shattered by these events.
				<<set $Wardeness.relationship = 0, $Wardeness.relationshipTarget = 0, $slaves[_FLs].relationship = 0, $slaves[_FLs].relationshipTarget = 0, _slave.relationship = 0, _slave.relationshipTarget = 0>>
			<</if>>
		<<elseif areRelated($Wardeness, _slave)>>
			<<setLocalPronouns _slave 2>>
			$He shows $his <<print relativeTerm($Wardeness,_slave)>> _slave.slaveName no mercy, making sure _he2 understands _his2 place.
			<<set _slave.devotion++, _slave.trust-->>
		<</if>>
	<</for>>
	<<if (_DL < $cellblock)>>
		<<set _seed = random(1,10)+(($cellblock-_DL)*(random(150,170)+(_idleBonus*10)))>>
		<<run cashX(_seed, "cellblock", $Wardeness)>>
		<br>&nbsp;&nbsp;&nbsp;&nbsp;Since $he doesn't have enough prisoners to manage to keep $him busy, $he works on citizens' slaves, earning @@.yellowgreen;<<print cashFormat(_seed)>>.@@
	<</if>>
	<<if (_DL > 0)>><br><br><</if>>
<</if>>

<<if (_DL > 0)>>
	&nbsp;&nbsp;&nbsp;&nbsp;<<if (_DL == 1)>>''One slave is being confined in $cellblockName until they are willing to obey.''<<else>>''_DL slaves are being confined in $cellblockName until they are willing to obey.''<</if>>
<</if>>

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

<<for _slave range _slaves>>
	<<set $i = $slaveIndices[_slave.ID]>>
	<<setLocalPronouns _slave>>
	<<if (_slave.devotion <= 20)>>
		<<if (_slave.trust >= -20)>>
			<<if ((_slave.hears == -1 && _slave.earwear != "hearing aids") || (_slave.hears == 0 && _slave.earwear == "muffling ear plugs") ||(_slave.hears == -2))>>
				<<set _slave.devotion -= 2, _slave.trust -= 2>>
			<<else>>
				<<set _slave.devotion -= 4, _slave.trust -= 4>>
			<</if>>
		<<else>>
			<<set _slave.devotion++>>
		<</if>>
	<</if>>
	<<switch $cellblockDecoration>>
	<<case "Paternalist">>
		<<set _slave.rules.living = "normal">>
		<<if (_slave.inflation > 0)>>
			<<set _slave.inflation = 0, _slave.inflationType = "none", _slave.inflationMethod = 0, _slave.milkSource = 0>>
			<<run SetBellySize(_slave)>>
		<</if>>
	<<case "Pastoralist">>
		<<set _slave.rules.living = "spare">>
		<<if _slave.inflation == 0>>
			<<if _slave.pregKnown == 0 && _slave.bellyImplant < 1500>>
				<<set _slave.inflation = 2, _slave.inflationType = "milk", _slave.inflationMethod = 1>>
			<<else>>
				<<set _slave.inflation = 1, _slave.inflationType = "milk", _slave.inflationMethod = 1>>
			<</if>>
			<<run SetBellySize(_slave)>>
		<</if>>
	<<case "Hedonistic">>
		<<set _slave.rules.living = "spare">>
		<<if _slave.weight < 200>>
			<<if _slave.weightDirection == 1>>
				<<set _slave.weight += 5>>
			<<elseif _slave.weightDirection == -1>>
				<<set _slave.weight += 1>>
			<<else>>
				<<set _slave.weight += 3>>
			<</if>>
		<</if>>
		<<if _slave.muscles > -100>>
			<<set _slave.muscles -= 2>>
		<</if>>
		<<if _slave.inflation == 0>>
			<<if _slave.pregKnown == 0 && _slave.bellyImplant < 1500>>
				<<set _slave.inflation = 3, _slave.inflationType = "food", _slave.inflationMethod = 1>>
			<<else>>
				<<set _slave.inflation = 1, _slave.inflationType = "food", _slave.inflationMethod = 1>>
			<</if>>
			<<run SetBellySize(_slave)>>
		<</if>>
	<<default>>
		<<set _slave.rules.living = "spare">>
		<<if (_slave.inflation > 0)>>
			<<set _slave.inflation = 0, _slave.inflationType = "none", _slave.inflationMethod = 0, _slave.milkSource = 0>>
			<<run SetBellySize(_slave)>>
		<</if>>
	<</switch>>
	<<if $cellblockUpgrade == 1>>
		<<if (_slave.behavioralFlaw != "none") && (_slave.behavioralQuirk == "none")>>
			<<run SoftenBehavioralFlaw(_slave)>>
			<<set _slave.devotion -= 10, _softenedQuirks++>>
		<<elseif (_slave.sexualFlaw != "none") && (_slave.sexualQuirk == "none")>>
			<<run SoftenSexualFlaw(_slave)>>
			<<set _slave.devotion -= 10, _softenedQuirks++>>
		<</if>>
	<</if>>
	<<set _slave.devotion += _devBonus, _slave.trust -= _trustMalus>>
	<<if ($Wardeness != 0) && ($Wardeness.sexualFlaw == "malicious") && (_slave.energy >= 2)>>
		<<set _slave.energy -= 2>>
	<</if>>
	<<if (_slave.health.condition < -80)>>
		<<run improveCondition(_slave, 20)>>
	<<elseif (_slave.health.condition < -40)>>
		<<run improveCondition(_slave, 15)>>
	<<elseif (_slave.health.condition < 0)>>
		<<run improveCondition(_slave, 10)>>
	<<elseif (_slave.health.condition < 40)>>
		<<run improveCondition(_slave, 7)>>
	<<elseif (_slave.health.condition < 100)>>
		<<run improveCondition(_slave, 3)>>
	<</if>>
	<<if $showEWD != 0>>
		<br><br>
		/* 000-250-006 */
		<<if $seeImages && $seeReportImages>>
		<div class="imageRef tinyImg">
			<<= 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 confined in $cellblockName.
		<</if>>
		<br>&nbsp;&nbsp;&nbsp;&nbsp;$He <<= App.SlaveAssignment.stayConfined(_slave)>>
		<br>&nbsp;&nbsp;&nbsp;
		<<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.stayConfined(_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 (_softenedQuirks) || (_brokenSlaves)>>
	<br><br>&nbsp;&nbsp;&nbsp;&nbsp;
	<<if (_softenedQuirks > 0)>>
		$cellblockNameCaps's advanced compliance systems successfully softened
		<<if (_softenedQuirks == 1)>>
			one slave's mental flaw into an @@.green;appealing quirk,@@ though the constant correction caused them @@.mediumorchid;considerable anguish.@@
		<<else>>
			_softenedQuirks slaves' mental flaws into @@.green;appealing quirks,@@ though the constant correction caused them @@.mediumorchid;considerable anguish.@@
		<</if>>
	<</if>>
	<<if (_brokenSlaves > 0)>>
		<<if (_brokenSlaves == 1)>>
			One slave is now willing to @@.hotpink;do as they're told@@ and has been released.
		<<else>>
			_brokenSlaves slaves are now willing to @@.hotpink;do as they're told@@ and have been released.
		<</if>>
		<<if $cellblockDecoration != "standard">>
			<br><br>&nbsp;&nbsp;&nbsp;&nbsp;$cellblockNameCaps's $cellblockDecoration atmosphere @@.hotpink;had an impact on them while they were@@ imprisoned.
		<</if>>
	<</if>>
<</if>>
<<if _DL > 0 || $Wardeness != 0>>
	<br><br>
<</if>>

src/uncategorized/cellblockReport.tw