:: SA take classes [nobr]

<<set _learning = 1>>

<<if $slaves[$i].fetish == "mindbroken">>
	is no longer mentally capable and @@.yellow;has been dropped from class.@@
	<<if $slaves[$i].assignment == "take classes">>
		<<= removeJob($slaves[$i], "take classes")>>
	<</if>>
<<elseif ($slaves[$i].assignment == "learn in the schoolroom")>>
	<<if ($Schoolteacher != 0)>>
		<<setLocalPronouns $Schoolteacher 2>>
		<<set _teaching = $Schoolteacher.intelligence+$Schoolteacher.intelligenceImplant>>
		<<if ($Schoolteacher.visualAge > 35)>>
			<<set _teaching += 10>>
		<</if>>
		<<if setup.schoolteacherCareers.includes($Schoolteacher.career)>>
			<<set _teaching += 10>>
		<</if>>
		<<if ($Schoolteacher.face > 40)>>
			<<set _teaching += 10>>
		<</if>>
		<<if random(1,150) < _teaching>>
			<<set _learning += 1>>
		<</if>>
		takes courses in slavery<<if $schoolroomUpgradeSkills + $schoolroomUpgradeRemedial + $schoolroomUpgradeLanguage != 0>>, using $schoolroomName's improved educational materials, <</if>> under $Schoolteacher.slaveName's supervision;
		<<if ($slaves[$i].devotion > 20)>>
			$he is such an obedient slave that _he2 @@.hotpink;encourages $him@@ to be the best slave $he can.
			<<set $slaves[$i].devotion += 2>>
		<<elseif ($slaves[$i].trust < -20)>>
			$he obeys out of fear, so _he2 @@.hotpink;encourages $him@@ to be a better slave.
			<<set $slaves[$i].devotion += 1>>
		<<else>>
			$he is resistant, so _he2 ends up mostly @@.gold;punishing $him,@@ increasing $his @@.mediumorchid;dislike for slavery.@@
			<<set $slaves[$i].devotion -= 2>>
			<<set $slaves[$i].trust -= 4>>
		<</if>>
	<<else>>
		takes courses in slavery<<if $schoolroomUpgradeSkills + $schoolroomUpgradeRemedial + $schoolroomUpgradeLanguage != 0>>, using $schoolroomName's improved educational materials, <</if>> under $assistantName's supervision;
		<<if ($slaves[$i].devotion > 20)>>
			$he is such an obedient slave that your assistant mostly @@.hotpink;encourages $him.@@
			<<set $slaves[$i].devotion += 2>>
		<<elseif ($slaves[$i].trust < -20)>>
			$he obeys out of fear, so your assistant mostly @@.hotpink;encourages $him.@@
			<<set $slaves[$i].devotion += 1>>
		<<else>>
			$he is resistant, so your assistant mostly @@.gold;punishes $him,@@ increasing $his @@.mediumorchid;dislike for slavery.@@
			<<set $slaves[$i].devotion -= 2>>
			<<set $slaves[$i].trust -= 4>>
		<</if>>
	<</if>>
<<else>>
	takes courses in slavery<<if $schoolroomUpgradeSkills + $schoolroomUpgradeRemedial + $schoolroomUpgradeLanguage != 0>>, using $schoolroomName's improved educational materials, <</if>> under $assistantName's supervision;
	<<if ($slaves[$i].devotion > 20)>>
		$he is such an obedient slave that your assistant mostly @@.hotpink;encourages $him.@@
		<<set $slaves[$i].devotion += 2>>
	<<elseif ($slaves[$i].trust < -20)>>
		$he obeys out of fear, so your assistant mostly @@.hotpink;encourages $him.@@
		<<set $slaves[$i].devotion += 1>>
	<<else>>
		$he is resistant, so your assistant mostly @@.gold;punishes $him,@@ increasing $his @@.mediumorchid;dislike for slavery.@@
		<<set $slaves[$i].devotion -= 2>>
		<<set $slaves[$i].trust -= 4>>
	<</if>>
<</if>>

<<if !canHear($slaves[$i]) && !canSee($slaves[$i])>>
	With $his inability to hear and see, absorbing the content is extremely difficult.
	<<set _learning = -2>>
<<elseif !canHear($slaves[$i]) || !canSee($slaves[$i])>>
	With $his impairements, $he needs special lessons to properly learn.
	<<set _learning = 0>>
<</if>>

<<if $slaves[$i].fetish != "mindbroken">>
	<<if ($slaves[$i].intelligence > 95)>>
		$He is a genius,
		<<set _learning += 1>>
	<<elseif ($slaves[$i].intelligence > 50)>>
		$He is highly intelligent
		<<set _learning += 1>>
	<<elseif ($slaves[$i].intelligence > 15)>>
		$He is of above average intelligence
		<<if (random(1,100) < 70)>>
			<<set _learning += 1>>
		<</if>>
	<<elseif ($slaves[$i].intelligence >= -15)>>
		$He is of average intelligence
		<<if (random(1,100) < 50)>>
			<<set _learning += 1>>
		<</if>>
	<<else>>
		<<set _slaveDensity = 50 + $slaves[$i].intelligence>>
		<<if ($schoolroomUpgradeRemedial == 1) && random(1,100) < 50>>
			<<set _slaveDensity = 55>>
		<</if>>
		<<if (random(1,100) > _slaveDensity)>>
			<<set _learning += 1>>
		<</if>>
		<<if ($slaves[$i].intelligence >= -50)>>
			$He is of below average intelligence
		<<elseif ($slaves[$i].intelligence >= -95)>>
			$He is quite stupid
		<<else>>
			$He is an imbecile,
		<</if>>
	<</if>>

	<<if ($slaves[$i].devotion > 95)>>
		and worshipful of you,
		<<set _learning += 1>>
	<<elseif ($slaves[$i].devotion > 50)>>
		and devoted to you,
		<<if (random(1,100) < 70)>>
			<<set _learning += 1>>
		<</if>>
	<<elseif ($slaves[$i].devotion > 20)>>
		and obedient to you,
		<<if (random(1,100) < 50)>>
			<<set _learning += 1>>
		<</if>>
	<<elseif ($slaves[$i].trust < -20)>>
		and frightened of you,
		<<if (random(1,100) < 50)>>
			<<set _learning += 1>>
		<</if>>
	<<else>>
		and neither likes you nor is afraid of you,
	<</if>>

	<<if (_learning <= 1)>>
		and $he learns slowly this week.
	<<elseif (_learning == 2)>>
		and $he does well with $his studies this week.
	<<else>>
		and $he is perfectly studious this week.
	<</if>>

	<<set _seed = 0>>
	<<set $skillIncrease = 10+Math.floor(($slaves[$i].intelligence+$slaves[$i].intelligenceImplant)/32)>>
	<<for _j = 0; _j < _learning; _j++>>
		<<if ($slaves[$i].devotion <= 20) && (_seed == 0)>>
			Since $he is wanting in basic obedience, $he suffers through courses on @@.hotpink;$his place@@ in the Free Cities world.
			<<set $slaves[$i].devotion += 10>>
			<<set _seed = 1>>
		<<elseif ($slaves[$i].oralSkill <= 10)>>
			Since $he is orally incompetent, $he is taught basic gag reflex suppression exercises and other simple oral things.
			<<OralSkillIncrease $slaves[$i]>>
		<<elseif ($slaves[$i].vaginalSkill <= 10) && ($slaves[$i].vagina > 0) && canDoVaginal($slaves[$i])>>
			Since $he is unskilled at using $his pussy, $he is taught kegel exercises and other simple vaginal skills.
			<<VaginalSkillIncrease $slaves[$i]>>
		<<elseif ($slaves[$i].vaginalSkill <= 10) && ($slaves[$i].vagina >= 0)>>
			Since $he is unskilled at using $his pussy and not permitted to learn through practice, $he is taught kegel exercises, vaginal basics and several new positions.
			<<VaginalSkillIncrease $slaves[$i]>>
		<<elseif ($slaves[$i].analSkill <= 10) && ($slaves[$i].anus > 0) && canDoAnal($slaves[$i])>>
			Since $he is a novice at taking it up $his butt, $he is taught relaxation exercises and other simple anal basics.
			<<AnalSkillIncrease $slaves[$i]>>
		<<elseif ($slaves[$i].analSkill <= 10) && ($slaves[$i].anus >= 0)>>
			Since $he is a novice at taking it up $his butt and not permitted to learn through practice, $he is taught relaxation exercises and other simple anal basics.
			<<AnalSkillIncrease $slaves[$i]>>
		<<elseif ($slaves[$i].whoreSkill <= 10)>>
			Since $he has little idea what's involved in selling $his body, $he is taught basic safety practices and other simple prostitution skills.
			<<WhoreSkillIncrease $slaves[$i]>>
		<<elseif ($slaves[$i].entertainSkill <= 10)>>
			Since $his entertainment value is limited to $his holes, $he is taught simple conversational skills and other courtesan's essentials.
			<<EntertainSkillIncrease $slaves[$i]>>
		<<elseif ($schoolroomUpgradeSkills == 1)>>
			<<if ($slaves[$i].oralSkill <= 30)>>
				Having completed the basic sex slave curriculum, $he studies more advanced ways to use $his lips and tongue to please cocks, cunts, and asses.
				<<OralSkillIncrease $slaves[$i]>>
			<<elseif ($slaves[$i].whoreSkill <= 30)>>
				Having completed the basic sex slave curriculum, $he studies intermediate prostitution, including how to stay as safe as possible and maximize $his efficiency.
				<<WhoreSkillIncrease $slaves[$i]>>
			<<elseif ($slaves[$i].entertainSkill <= 30)>>
				Having completed the basic sex slave curriculum, $he studies courtesanship, including social dynamics and flirtation more subtle than straightforward begging for sex.
				<<EntertainSkillIncrease $slaves[$i]>>
			<<elseif ($slaves[$i].vaginalSkill <= 30) && ($slaves[$i].vagina >= 0)>>
				Having completed the basic sex slave curriculum, $he studies more advanced techniques and exotic positions to make use of $his <<if $slaves[$i].vagina == 0>>virgin pussy for use in $his first time<<else>>pussy<</if>>.
				<<VaginalSkillIncrease $slaves[$i]>>
			<<elseif ($slaves[$i].analSkill <= 30)>>
				Having completed the basic sex slave curriculum, $he studies more advanced techniques and exotic positions to make use of $his <<if $slaves[$i].vagina == 0>>virgin ass for use in $his first time<<else>>ass<</if>>.
				<<AnalSkillIncrease $slaves[$i]>>
			<</if>>
		<</if>>
	<</for>>

	<<if ($slaves[$i].intelligenceImplant < 30) && ($slaves[$i].assignment == "learn in the schoolroom")>>
		$He makes some progress
		<<if $slaves[$i].intelligenceImplant < 15>>
			towards a basic education.
		<<else>>
			in furthering $his education.
		<</if>>
		<<set $slaves[$i].intelligenceImplant += 1*_learning>>
		<<if ($slaves[$i].intelligenceImplant >= 30)>>
			<<set $slaves[$i].intelligenceImplant = 30>>
			$He has completed $his advanced education, and for most purposes $he has become @@.deepskyblue;more intelligent.@@
		<</if>>
	<<elseif ($slaves[$i].intelligenceImplant < 15) && ($slaves[$i].assignment == "take classes")>>
		$He makes some progress towards a basic education.
		<<set $slaves[$i].intelligenceImplant += 1*_learning>>
		<<if ($slaves[$i].intelligenceImplant >= 15)>>
			<<set $slaves[$i].intelligenceImplant = 15>>
			$He has completed a course of slave education, and for most purposes $he has become @@.deepskyblue;more intelligent.@@
		<</if>>
	<</if>>

	<<if ($slaves[$i].intelligenceImplant >= 15)>>
		<<if $slaves[$i].voice != 0>>
			<<if ($slaves[$i].intelligence > random(-110,110))>>
				<<if ($schoolroomUpgradeLanguage == 0)>>
					<<if ($slaves[$i].accent > 3) && ($week-$slaves[$i].weekAcquired > 24)>>
						$He has @@.green;learned some $language,@@ and can make $his point with some gesturing, though $he speaks $language horribly.
						<<set $slaves[$i].accent -= 1>>
						<<if $slaves[$i].speechRules == "language lessons">>
							<<set $slaves[$i].speechRules = "accent elimination">>
						<</if>>
					<<elseif ($slaves[$i].accent == 3)>>
						$He has @@.green;learned functional $language,@@ and can make $himself understood, though $his $slaves[$i].nationality accent is still quite heavy.
						<<set $slaves[$i].accent -= 1>>
					<</if>>
				<<else>>
					<<if ($slaves[$i].accent > 3)>>
						<<if ($week-$slaves[$i].weekAcquired > 16)>>
							$He has @@.green;learned some $language,@@ and can make $his point with some gesturing, though $he speaks $language horribly.
							<<set $slaves[$i].accent -= 1>>
							<<if $slaves[$i].speechRules == "language lessons">>
								<<set $slaves[$i].speechRules = "accent elimination">>
							<</if>>
						<</if>>
					<<elseif ($slaves[$i].accent >= 2)>>
						$He has @@.green;learned decent $language,@@ though $he retains enough of $his $slaves[$i].nationality accent to make $his voice distinctly sexy.
						<<set $slaves[$i].accent = 1>>
					<</if>>
				<</if>>
			<</if>>
		<</if>>
	<</if>>


	<<if ($slaves[$i].intelligenceImplant >= 15) && ($slaves[$i].assignment == "take classes")>>
	<<if ($slaves[$i].voice == 0) || ($slaves[$i].accent <= 1) || (($schoolroomUpgradeLanguage == 0) && ($slaves[$i].accent <= 2))>>
	<<if ($slaves[$i].oralSkill > 30) || (($schoolroomUpgradeSkills == 0) && ($slaves[$i].oralSkill > 10))>>
	<<if ($slaves[$i].whoreSkill > 30) || (($schoolroomUpgradeSkills == 0) && ($slaves[$i].whoreSkill > 10))>>
	<<if ($slaves[$i].entertainSkill > 30) || (($schoolroomUpgradeSkills == 0) && ($slaves[$i].entertainSkill > 10))>>
	<<if ($slaves[$i].analSkill > 30) || (($schoolroomUpgradeSkills == 0) && ($slaves[$i].analSkill > 10))>>
	<<if ($slaves[$i].vaginalSkill > 30) || (($schoolroomUpgradeSkills == 0) && ($slaves[$i].vaginalSkill > 10)) || ($slaves[$i].vagina < 0)>>
		$He can learn little from further classes, so @@.yellow;$his assignment has defaulted to rest.@@
		<<= removeJob($slaves[$i], "take classes")>>
	<</if>>
	<</if>>
	<</if>>
	<</if>>
	<</if>>
	<</if>>
	<</if>>
<</if>>
