From 955f34ff78429413b3628739d1fe7ad544be10e3 Mon Sep 17 00:00:00 2001
From: hexall <hexall90.gmail.com>
Date: Sun, 10 Sep 2017 11:21:53 +0200
Subject: [PATCH] modified growth stimulants logic to incorporate hormonal
 balance and expected height

---
 src/uncategorized/saDrugs.tw | 62 +++++++++++++++++++++++++-----------
 1 file changed, 43 insertions(+), 19 deletions(-)

diff --git a/src/uncategorized/saDrugs.tw b/src/uncategorized/saDrugs.tw
index 23f63362d3a..78965efe9ab 100644
--- a/src/uncategorized/saDrugs.tw
+++ b/src/uncategorized/saDrugs.tw
@@ -361,16 +361,31 @@
 	<<set _growth = 1>>
 	$pronounCap receives frequent @@.lime;
 	injections of growth stimulants@@.
-	/*Hormone balance*/
+	/*Hormones*/
 	<<if $slaves[$i].hormones == 2 || $slaves[$i].hormones == -2>>
 		<<set _growth-->>
-		The massive quantities of sexual hormones flooding $possessive body limits the effectiveness of the treatment.
+		The massive quantities of sexual hormones flooding $possessive body limits the effectiveness of the treatment, <<if $slaves[$i].hormoneBalance <= -25>>but<<else>>and<</if>>
 	<<elseif $slaves[$i].hormones == 0>>
-		<<set _growth += 0.3>>
-		In the absence of significant levels of sexual hormones, the treatment is more effective.
+		<<set _growth += 0.2>>
+		In the absence of significant levels of sexual hormones, the treatment is more effective, <<if $slaves[$i].hormoneBalance <= -25>>and<<else>>but<</if>>
 	<<elseif $slaves[$i].hormones == 1 || $slaves[$i].hormones == -1>>
-		$possessiveCap hormonal balance leaves the treatment enough room to manouver.
+		$possessiveCap low level of sexual hormones allow the treatment to work undisturbed, <<if $slaves[$i].hormoneBalance <= -25>>and<<else>>but<</if>>
 	<</if>>
+	/*hormone balance*/
+	<<if $slaves[$i].hormoneBalance <= -50>>
+		$possessive heavily masculine hormonal balance supports the stimulants work.
+		<<set _growth += 0.5>>
+	<<elseif $slaves[$i].hormoneBalance <= -25>>
+		$possessive masculine hormonal balance allow the stimulants to act freely.
+		<<set _growth += 0.2>>
+	<<elseif $slaves[$i].hormoneBalance < 25>
+		$possessive neutral hormonal balance do not hinder the stimulants work.
+	<<elseif $slaves[$i].hormoneBalance < 50>>
+		$possessive feminine hormonal balance restrict the stimulants efficacy.
+		<<set _growth -= 0.2>>
+	<<else>>
+		$possessive heavily feminine hormonal balance hinder the stimulants progress.
+		<<set _growth -= 0.5>>
 	/*diet*/
 	<<if $slaves[$i].diet == "fattening">>
 		All the food $pronoun's required to consume boosts growth.
@@ -440,28 +455,32 @@
 				<<set _ageMod = 0.5>>
 			<</if>>
 		<</if>>
-		<<set _growth *= _ageMod>>	
+		/*evaluate against slave expected height ...*/
+		<<set _heightDiff = 1 - ($slaves[$i].height / Height.forAge($slaves[$i].height, $slaves[$i]))>>
+		/*... and calculates final value*/
+		<<set _growth = (_growth + _growth * _heightDiff) * _ageMod>>	/*if she is taller than the expected height the growth is reduced, if shorter accelerated*/
 		<<set _growth = Math.round(Math.clamp(_growth,0,5))>>
-		/*communicates the level of growth accomplished*/
-		<<if _growth == 1>>
-			@@.lime;$possessiveCap height slightly increased this week.@@
+		/*communicates the amount of growth*/
+		<<if _growth < 1>> 												/*in case _heightDiff manages to bring _growth down enough*/
+			Despite the treatment, $possessiveCap height does not increase this week.
+		<<elseif _growth == 1>>
+			@@.lime;$possessiveCap height slightly increases this week.@@
 		<<elseif _growth == 2>>
-			@@.lime;$possessiveCap height increased this week.@@
+			@@.lime;$possessiveCap height increases this week.@@
 		<<elseif _growth == 3>>
-			@@.lime;$possessiveCap height greatly increased this week.@@
+			@@.lime;$possessiveCap height greatly increases this week.@@
 		<<elseif _growth == 4>>
-			@@.lime;$possessiveCap height dramatically increased this week.@@
-		<<elseif _growth == 5>>
-			@@.lime;$possessiveCap body experienced explosive growth this week@@,
+			@@.lime;$possessiveCap height dramatically increases this week.@@
+		<<elseif _growth == 5>
+			@@.lime;$possessiveCap body experiences explosive growth this week@@,
 		<</if>>
 		/*health issues*/
 		<<if _growth == 5>>
-			$possessiveCap growth is so extreme that $possessive body can barely keep up, @@.red;severely damaging $possessive health@@.
-			<<set $slaves[$i].health -= 20>>
-		<</if>>
+			$possessive growth is so extreme that $possessive body can barely keep up, @@.red;severely damaging $possessive health@@.
+			<<set <<set $slaves[$i].health -= 20>>
 		<<if random(1,10) == 1 && _growth != 5>>
-			The stimulants stressed $slaves[$i].slaveName's body more than expected, causing @@.red;harm to $possessive health@@.
-			<<set $slaves[$i].health -= 10>>
+			the stimulants stressed $slaves[$i].slaveName's body more than expected, @@.red;damaging $possessive health@@.
+			<<set <<set $slaves[$i].health -= 10>>
 		<</if>>
 		<<if $slaves[$i].physicalAge > $maxGrowthAge>>
 			<<if random(1,6) == 1>>
@@ -1098,6 +1117,11 @@
 
 /* DRUG EXPIRY */
 <<switch $slaves[$i].drugs>>
+<<case "growth stimulants">>
+	<<set _maxHeight = Math.clamp((Height.mean($slaves[$i]) * 1.5),0,274)>>
+	<<if  $slaves[$i].height >= _maxHeight>>
+		$possessiveCap body has already grown far past $possessive natural limits, further injections of stimulants will have no effect. @@.yellow;$possessiveCap drug regimen has been ended.@@
+		<<set $slaves[$i].height = Math.clamp($slaves[$i].height,0,_maxHeight), $slaves[$i].drugs = "no drugs">>
 <<case "breast injections" "intensive breast injections">>
 	<<if $slaves[$i].boobs >= 50000>>
 		$possessiveCap udders are now so huge that further A-HGH treatment will not increase their size. @@.yellow;$possessiveCap drug regimen has been ended.@@
-- 
GitLab