From 8c46af48b76ecb22f3477ad954433e6069c97945 Mon Sep 17 00:00:00 2001
From: Pregmodder <pregmodder@gmail.com>
Date: Mon, 30 Dec 2019 04:01:21 -0500
Subject: [PATCH] Tweaked HG application

---
 src/uncategorized/hgApplication.tw          |  5 +-
 src/uncategorized/slaveAssignmentsReport.tw | 66 +++++++++++----------
 2 files changed, 38 insertions(+), 33 deletions(-)

diff --git a/src/uncategorized/hgApplication.tw b/src/uncategorized/hgApplication.tw
index 7baa53ecf0f..7895c10c15e 100644
--- a/src/uncategorized/hgApplication.tw
+++ b/src/uncategorized/hgApplication.tw
@@ -15,7 +15,9 @@
 <<if $HeadGirl.sexualFlaw == "abusive" && $HGSeverity >= 0>>
 	<<set _effectiveness += 10>>
 <</if>>
-/* <<set _effectiveness *= healthPenalty($HeadGirl)>> - TODO: Pregmodder wants to rework this (!5671) */
+<<if $HGtraining != "health">>
+	<<set $activeSlave.health.tired += 25>>
+<</if>>
 
 &nbsp;&nbsp;&nbsp;&nbsp;''Your Head Girl __@@.pink;$HeadGirl.slaveName@@__'' notices that ''__@@.pink;$activeSlave.slaveName@@__''
 <<switch $HGtraining>>
@@ -45,6 +47,7 @@
 
 $He helps $activeSlave.slaveName however $he can. The tender care has @@.green;improved $activeSlave.slaveName's health.@@
 <<run improveCondition($activeSlave, 10)>>
+<<set $activeSlave.health.tired = Math.clamp($activeSlave.health.tired-10, 0, 1000)>>
 <<set $activeSlave.training = 0>>
 
 <<else>>
diff --git a/src/uncategorized/slaveAssignmentsReport.tw b/src/uncategorized/slaveAssignmentsReport.tw
index e3d83d5911e..5d0a815b053 100644
--- a/src/uncategorized/slaveAssignmentsReport.tw
+++ b/src/uncategorized/slaveAssignmentsReport.tw
@@ -934,46 +934,48 @@ $sexDemandResult.topClass = Math.trunc((($NPCSexSupply.topClass + $slaveJobValue
 			<<continue>>
 		<</if>>
 
-		<<set _hasParaphilia = (["abusive", "anal addict", "attention whore", "breast growth", "breeder", "cum addict", "malicious", "neglectful", "self hating"].includes(_Slave.sexualFlaw))>>
-		<<if ($headGirlTrainsParaphilias && _hasParaphilia)>>
-			<<set _HGPossibleSlaves[1].push({ID: _Slave.ID, training: "paraphilia"})>>
-			<<continue>>
-		<</if>>
+		<<if _Slave.health.tired < 50>>
+			<<set _hasParaphilia = (["abusive", "anal addict", "attention whore", "breast growth", "breeder", "cum addict", "malicious", "neglectful", "self hating"].includes(_Slave.sexualFlaw))>>
+			<<if ($headGirlTrainsParaphilias && _hasParaphilia)>>
+				<<set _HGPossibleSlaves[1].push({ID: _Slave.ID, training: "paraphilia"})>>
+				<<continue>>
+			<</if>>
 
-		<<if $headGirlTrainsFlaws || $headGirlSoftensFlaws>>
-			<<if _Slave.behavioralFlaw != "none" || (_Slave.sexualFlaw != "none" && !_hasParaphilia)>>
-				<<if $headGirlSoftensFlaws>>
-					<<if _Slave.devotion > 20>>
-						<<if (_Slave.behavioralFlaw != "none" && _Slave.behavioralQuirk == "none") || (_Slave.sexualFlaw != "none" && _Slave.sexualQuirk == "none" && !_hasParaphilia)>>
-							<<set _HGPossibleSlaves[3].push({ID: _Slave.ID, training: "soften"})>>
-						<<else>>
-							<<set _HGPossibleSlaves[3].push({ID: _Slave.ID, training: "flaw"})>>
+			<<if $headGirlTrainsFlaws || $headGirlSoftensFlaws>>
+				<<if _Slave.behavioralFlaw != "none" || (_Slave.sexualFlaw != "none" && !_hasParaphilia)>>
+					<<if $headGirlSoftensFlaws>>
+						<<if _Slave.devotion > 20>>
+							<<if (_Slave.behavioralFlaw != "none" && _Slave.behavioralQuirk == "none") || (_Slave.sexualFlaw != "none" && _Slave.sexualQuirk == "none" && !_hasParaphilia)>>
+								<<set _HGPossibleSlaves[3].push({ID: _Slave.ID, training: "soften"})>>
+							<<else>>
+								<<set _HGPossibleSlaves[3].push({ID: _Slave.ID, training: "flaw"})>>
+							<</if>>
+							<<continue>>
 						<</if>>
+					<<elseif $headGirlTrainsFlaws>>
+						<<set _HGPossibleSlaves[2].push({ID: _Slave.ID, training: "flaw"})>>
 						<<continue>>
 					<</if>>
-				<<elseif $headGirlTrainsFlaws>>
-					<<set _HGPossibleSlaves[2].push({ID: _Slave.ID, training: "flaw"})>>
-					<<continue>>
 				<</if>>
 			<</if>>
-		<</if>>
 
-		<<if ($headGirlTrainsObedience && _Slave.devotion <= 20 && _Slave.trust >= -20)>>
-			<<set _HGPossibleSlaves[4].push({ID: _Slave.ID, training: "obedience"})>>
-			<<continue>>
-		<</if>>
+			<<if ($headGirlTrainsObedience && _Slave.devotion <= 20 && _Slave.trust >= -20)>>
+				<<set _HGPossibleSlaves[4].push({ID: _Slave.ID, training: "obedience"})>>
+				<<continue>>
+			<</if>>
 
-		<<if ($headGirlTrainsSkills)>>
-			<<if (_Slave.skill.oral < $HeadGirl.skill.oral)>>
-				<<set _HGPossibleSlaves[5].push({ID: _Slave.ID, training: "oral skill"})>>
-			<<elseif (_Slave.skill.vaginal < $HeadGirl.skill.vaginal) && (_Slave.vagina > 0) && (canDoVaginal(_Slave))>>
-				<<set _HGPossibleSlaves[5].push({ID: _Slave.ID, training: "fuck skill"})>>
-			<<elseif (_Slave.skill.anal < $HeadGirl.skill.anal) && (_Slave.anus > 0) && (canDoAnal(_Slave))>>
-				<<set _HGPossibleSlaves[5].push({ID: _Slave.ID, training: "anal skill"})>>
-			<<elseif (_Slave.skill.whoring < $HeadGirl.skill.whoring)>>
-				<<set _HGPossibleSlaves[5].push({ID: _Slave.ID, training: "whore skill"})>>
-			<<elseif (_Slave.skill.entertainment < $HeadGirl.skill.entertainment) && !isAmputee(_Slave)>>
-				<<set _HGPossibleSlaves[5].push({ID: _Slave.ID, training: "entertain skill"})>>
+			<<if ($headGirlTrainsSkills)>>
+				<<if (_Slave.skill.oral < $HeadGirl.skill.oral)>>
+					<<set _HGPossibleSlaves[5].push({ID: _Slave.ID, training: "oral skill"})>>
+				<<elseif (_Slave.skill.vaginal < $HeadGirl.skill.vaginal) && (_Slave.vagina > 0) && (canDoVaginal(_Slave))>>
+					<<set _HGPossibleSlaves[5].push({ID: _Slave.ID, training: "fuck skill"})>>
+				<<elseif (_Slave.skill.anal < $HeadGirl.skill.anal) && (_Slave.anus > 0) && (canDoAnal(_Slave))>>
+					<<set _HGPossibleSlaves[5].push({ID: _Slave.ID, training: "anal skill"})>>
+				<<elseif (_Slave.skill.whoring < $HeadGirl.skill.whoring)>>
+					<<set _HGPossibleSlaves[5].push({ID: _Slave.ID, training: "whore skill"})>>
+				<<elseif (_Slave.skill.entertainment < $HeadGirl.skill.entertainment) && !isAmputee(_Slave)>>
+					<<set _HGPossibleSlaves[5].push({ID: _Slave.ID, training: "entertain skill"})>>
+				<</if>>
 			<</if>>
 		<</if>>
 	<</for>>
-- 
GitLab