From 9c783fda6b8f05a95441a1a2dbc8d7f2eed227bb Mon Sep 17 00:00:00 2001
From: Pregmodder <pregmodder@gmail.com>
Date: Mon, 23 Mar 2020 00:13:34 -0400
Subject: [PATCH] Tiredness stuff

---
 slave variables documentation - Pregmod.txt |  7 ++++
 src/gui/Encyclopedia/encyclopedia.tw        |  2 +-
 src/uncategorized/seCoursing.tw             | 15 +++++++-
 src/uncategorized/seCoursingRace.tw         | 15 +++++++-
 src/uncategorized/slaveInteract.tw          | 38 +++++++++++++--------
 5 files changed, 59 insertions(+), 18 deletions(-)

diff --git a/slave variables documentation - Pregmod.txt b/slave variables documentation - Pregmod.txt
index ff71613537b..082c9704b3a 100644
--- a/slave variables documentation - Pregmod.txt	
+++ b/slave variables documentation - Pregmod.txt	
@@ -453,6 +453,13 @@ rules.living:
 "normal"
 "luxurious"
 
+rules.rest:
+
+"none"			- slave may be worked into exhaustion
+"restrictive"	- slave is allowed to rest when fatigued
+"permissive"	- slave is allowed to rest when tired
+"mandatory"		- day of rest each week to recover
+
 rules.relationship:
 
 "restrictive"
diff --git a/src/gui/Encyclopedia/encyclopedia.tw b/src/gui/Encyclopedia/encyclopedia.tw
index 68d55c1e109..c8438fc3e86 100644
--- a/src/gui/Encyclopedia/encyclopedia.tw
+++ b/src/gui/Encyclopedia/encyclopedia.tw
@@ -404,7 +404,7 @@ SLAVES
 	<br>Long term damage stays with your slaves and is therefore something to be aware of and try to avoid. While some long term damage accumulates passively as slaves start to get old, the most likely source of long term damage comes from slaves taking a lot of abuse without enough time to recover or from a particularly invasive surgery. While curatives and preventatives help avoid long term damage, too much short term damage will eventually bleed over and become long term damage. So even when a slave is perfectly healthy you may want to spread out surgical enhancements and allow for recovery.
 
 	<br><br>''Tiredness''
-	<br>Working hard will eventually make your slaves tired, this is only natural. Once tired they will no longer be able to perform to the best of their abilities and therefore this may be something to avoid, though a tired slave is less capable of resisting their master. A slave can either be perfectly fine, tired or exhausted. Excessive tiredness will negatively impact a slave's condition. Avoiding exhaustion can be done by taking them off tiresome assignments, letting them [[Rest|Encyclopedia][$encyclopedia = "Rest"]], preferably in the [[Spa|Encyclopedia][$encyclopedia = "Spa"]], providing them with comfortable living conditions and rewarding them with time off. The spa is particularly useful as it is not just really effective at reducing tiredness as an assignment, but also as a relaxation reward or to a lesser degree a situational reward. Be sure to have enough room in your spa for slaves deserving such rewards. A good attendant will also help.
+	<br>Working hard will eventually make your slaves tired, this is only natural. Once tired they will no longer be able to perform to the best of their abilities and therefore this may be something to avoid, though a tired slave is less capable of resisting their master. A slave can either be perfectly fine, tired, fatigued or exhausted. Excessive tiredness will negatively impact a slave's condition. Avoiding exhaustion can be done by taking them off tiresome assignments, assigning more lenient resting rules, letting them have time off, preferably in the [[Spa|Encyclopedia][$encyclopedia = "Spa"]] and providing them with comfortable living conditions. The spa is particularly useful as it is not just really effective at reducing tiredness as an assignment, but also as a relaxation reward or to a lesser degree a situational reward. Be sure to have enough room in your spa for slaves deserving such rewards. A good attendant will also help. It's worth keeping in mind that not all assignments are tiring either.
 
 	<br><br>''Illness''
 	<br>Whether we like it or not, sometimes slaves get sick. Most of the time an illness will be nothing more than a minor inconvenience that clears up by the end of the week, but occasionally a slave might catch something that is best handled with the help of a [[Clinic|Encyclopedia][$encyclopedia = "Clinic"]]. Keeping slaves in good condition goes a long way to preventing too many issues, but one thing to be aware of is that chemical carcinogen buildup is particularly dangerous and can cause illnesses to become quite serious. A simple illness may be harmless but once a slave is seriously ill their condition will rapidly deteriorate.
diff --git a/src/uncategorized/seCoursing.tw b/src/uncategorized/seCoursing.tw
index 9d8f813a6e1..cbc3e4e7e38 100644
--- a/src/uncategorized/seCoursing.tw
+++ b/src/uncategorized/seCoursing.tw
@@ -375,9 +375,12 @@ You lead your lurcher $activeLurcher.slaveName out on a leash, naked just like t
 	_He2's so skinny that it's not likely _he2's physically fit enough to be quick.
 	<<set $hareSpeed -= 1>>
 <</if>>
-<<if $activeSlave.muscles > 30>>
+<<if $activeSlave.muscles > 50>>
 	_He2's so heavily muscled that _he2's probably slower than _he2 would be if _he2 were merely fit.
 	<<set $hareSpeed -= 1>>
+<<elseif $activeSlave.muscles > 30>>
+	_He2's quite toned, which will give _him2 an edge once _he2's up to speed.
+	<<set $hareSpeed += 1>>
 <<elseif $activeSlave.muscles <= 5>>
 	_He2's soft, and _his2 legs show no sign of tone at all.
 	<<set $hareSpeed -= 1>>
@@ -421,6 +424,16 @@ You lead your lurcher $activeLurcher.slaveName out on a leash, naked just like t
 	There is a slight roundness to _his2 middle, likely an early pregnancy that will distract _him2.
 	<<set $hareSpeed -= 1>>
 <</if>>
+<<if $activeSlave.health.tired > 90>>
+	_He2 is obviously tired and will likely be a quick catch.
+	<<set $hareSpeed -= 5>>
+<<elseif $activeSlave.health.tired > 60>>
+	_He2 seems to be rather tired, which will slow _him2 out of the gate.
+	<<set $hareSpeed -= 2>>
+<<elseif $activeSlave.health.tired > 30>>
+	_He2 seems a little tired, which will slow _his2 acceleration.
+	<<set $hareSpeed -= 1>>
+<</if>>
 
 <<if _sec == 0>>
 	<<set $hare1 = $activeSlave>>
diff --git a/src/uncategorized/seCoursingRace.tw b/src/uncategorized/seCoursingRace.tw
index c53f68633ba..e2c6b91e1ca 100644
--- a/src/uncategorized/seCoursingRace.tw
+++ b/src/uncategorized/seCoursingRace.tw
@@ -25,6 +25,16 @@ You place your hand on the leash's quick release and <<if canHear($activeLurcher
 	$His poor health slows $him down.
 	<<set _LurcherSpeed -= 1>>
 <</if>>
+<<if $activeLurcher.health.tired > 90>>
+	$He is exhausted and can barely stay awake; side bets are starting up on how far $he'll make it around the track.
+	<<set _LurcherSpeed -= 5>>
+<<elseif $activeLurcher.health.tired > 60>>
+	$He is fatigued, sapping the strength $he'll need to reach $his top speed.
+	<<set _LurcherSpeed -= 2>>
+<<elseif $activeLurcher.health.tired > 30>>
+	$He is tired and liable to be a slow start.
+	<<set _LurcherSpeed -= 1>>
+<</if>>
 <<if !canSee($activeLurcher)>>
 	$His inability to see causes $him to be cautious of $his footing, making $his first several strides slow and uncertain.
 	<<set _LurcherSpeed -= 1>>
@@ -45,9 +55,12 @@ You place your hand on the leash's quick release and <<if canHear($activeLurcher
 	$He's so thin that $he lacks the vigor to run really well.
 	<<set _LurcherSpeed -= 1>>
 <</if>>
-<<if $activeLurcher.muscles > 30>>
+<<if $activeLurcher.muscles > 50>>
 	$He's muscle-bound, without the range of motion to move freely.
 	<<set _LurcherSpeed -= 1>>
+<<if $activeLurcher.muscles > 30>>
+	$He's fit, and is able to maintain $his speed quite well once $he reaches it.
+	<<set _LurcherSpeed += 1>>
 <<elseif $activeLurcher.muscles <= 5>>
 	$He's soft, and is panting desperately within a few short strides.
 	<<set _LurcherSpeed -= 1>>
diff --git a/src/uncategorized/slaveInteract.tw b/src/uncategorized/slaveInteract.tw
index 36dbabd7fce..92429ee6ed2 100644
--- a/src/uncategorized/slaveInteract.tw
+++ b/src/uncategorized/slaveInteract.tw
@@ -473,6 +473,14 @@
 			<<link "Orgasm">><<set $slaves[_i].rules.reward = "orgasm">><<replace "#standardReward">>$slaves[_i].rules.reward<</replace>><</link>> |
 			<<link "Situational">><<set $slaves[_i].rules.reward = "situational">><<replace "#standardReward">>$slaves[_i].rules.reward<</replace>><</link>>
 
+			/*
+			<br>Sleep Rules: ''<span id="restRules">$slaves[_i].rules.rest</span>.''
+			<<link "None">><<set $slaves[_i].rules.rest = "none">><<replace "#restRules">>$slaves[_i].rules.rest<</replace>><</link>> |
+			<<link "Restrictive">><<set $slaves[_i].rules.rest = "restrictive">><<replace "#restRules">>$slaves[_i].rules.rest<</replace>><</link>> |
+			<<link "Permissive">><<set $slaves[_i].rules.rest = "permissive">><<replace "#restRules">>$slaves[_i].rules.rest<</replace>><</link>> |
+			<<link "Mandatory">><<set $slaves[_i].rules.rest = "mandatory">><<replace "#restRules">>$slaves[_i].rules.rest<</replace>><</link>> |
+			*/
+
 			<<if setup.facilityHeads.includes($slaves[_i].assignment)>>
 				<<if $slaves[_i].lactation != 2>>
 					<br>Lactation maintenance for facility heads: ''<span id="lactationRules">$slaves[_i].rules.lactation</span>.''
@@ -513,6 +521,21 @@
 				<<link "Grant">><<set $slaves[_i].rules.release.master = 1>><<replace "#relMaster">>granted<</replace>><</link>> |
 				<<link "Deny">><<set $slaves[_i].rules.release.master = 0>><<replace "#relMaster">>denied<</replace>><</link>>
 			</div>
+			
+			<<if $slaves[_i].voice != 0>>
+				<br>Speech rules: ''<span id="speechRules">$slaves[_i].rules.speech</span>.''
+				<<link "Restrictive">><<set $slaves[_i].rules.speech = "restrictive">><<replace "#speechRules">>$slaves[_i].rules.speech<</replace>><</link>> |
+				<<link "Permissive">><<set $slaves[_i].rules.speech = "permissive">><<replace "#speechRules">>$slaves[_i].rules.speech<</replace>><</link>>
+				<<if $slaves[_i].accent > 0 && $slaves[_i].accent < 4>>| <<link "Accent elimination">><<set $slaves[_i].rules.speech = "accent elimination">><<replace "#speechRules">>$slaves[_i].rules.speech<</replace>><</link>>
+				<<elseif $slaves[_i].accent > 3>>| <<link "Language lessons">><<set $slaves[_i].rules.speech = "language lessons">><<replace "#speechRules">>$slaves[_i].rules.speech<</replace>><</link>>
+				<</if>>
+			<</if>>
+
+			<br>
+			Relationship rules: ''<span id="relationshipRules">$slaves[_i].rules.relationship</span>.''
+			<<link "Restrictive">><<set $slaves[_i].rules.relationship = "restrictive">><<replace "#relationshipRules">>$slaves[_i].rules.relationship<</replace>><</link>> |
+			<<link "Just friends">><<set $slaves[_i].rules.relationship = "just friends">><<replace "#relationshipRules">>$slaves[_i].rules.relationship<</replace>><</link>> |
+			<<link "Permissive">><<set $slaves[_i].rules.relationship = "permissive">><<replace "#relationshipRules">>$slaves[_i].rules.relationship<</replace>><</link>>
 		<</if>>
 
 		<<if $slaves[_i].clitPiercing == 3 || $slaves[_i].vaginalAccessory == "smart bullet vibrator">>
@@ -547,21 +570,6 @@
 			| <<link "No sex">><<set $slaves[_i].clitSetting = "none">><<replace "#setting">>$slaves[_i].clitSetting<</replace>><</link>>
 			</div>
 		<</if>>
-
-		<<if $slaves[_i].voice != 0>>
-			<br>Speech rules: ''<span id="speechRules">$slaves[_i].rules.speech</span>.''
-			<<link "Restrictive">><<set $slaves[_i].rules.speech = "restrictive">><<replace "#speechRules">>$slaves[_i].rules.speech<</replace>><</link>> |
-			<<link "Permissive">><<set $slaves[_i].rules.speech = "permissive">><<replace "#speechRules">>$slaves[_i].rules.speech<</replace>><</link>>
-			<<if $slaves[_i].accent > 0 && $slaves[_i].accent < 4>>| <<link "Accent elimination">><<set $slaves[_i].rules.speech = "accent elimination">><<replace "#speechRules">>$slaves[_i].rules.speech<</replace>><</link>>
-			<<elseif $slaves[_i].accent > 3>>| <<link "Language lessons">><<set $slaves[_i].rules.speech = "language lessons">><<replace "#speechRules">>$slaves[_i].rules.speech<</replace>><</link>>
-			<</if>>
-		<</if>>
-
-		<br>
-		Relationship rules: ''<span id="relationshipRules">$slaves[_i].rules.relationship</span>.''
-		<<link "Restrictive">><<set $slaves[_i].rules.relationship = "restrictive">><<replace "#relationshipRules">>$slaves[_i].rules.relationship<</replace>><</link>> |
-		<<link "Just friends">><<set $slaves[_i].rules.relationship = "just friends">><<replace "#relationshipRules">>$slaves[_i].rules.relationship<</replace>><</link>> |
-		<<link "Permissive">><<set $slaves[_i].rules.relationship = "permissive">><<replace "#relationshipRules">>$slaves[_i].rules.relationship<</replace>><</link>>
 	</div>
 </div>
 
-- 
GitLab