From f4792a7ee674a46104cd7aad3ba137d312f6aa4e Mon Sep 17 00:00:00 2001
From: klorpa <30924131+klorpa@users.noreply.github.com>
Date: Tue, 4 Sep 2018 21:47:35 -0500
Subject: [PATCH] Vignette6

---
 devNotes/twine JS.txt            | 36 +++++++++----
 src/js/vignettes.tw              | 38 ++++++++++----
 src/uncategorized/RETS.tw        | 16 +++---
 src/uncategorized/saGetMilked.tw | 88 ++++++++++++++++++++++++++++++--
 src/uncategorized/saWhore.tw     |  2 +-
 5 files changed, 147 insertions(+), 33 deletions(-)

diff --git a/devNotes/twine JS.txt b/devNotes/twine JS.txt
index c746c14002e..466e923fcd1 100644
--- a/devNotes/twine JS.txt	
+++ b/devNotes/twine JS.txt	
@@ -25904,11 +25904,19 @@ window.GetVignette = function GetVignette(slave) {
 				effect: 1,
 			});
 		} else if (slave.livingRules === "spare") {
-			vignettes.push({
-				text: `${he} got a poor night's sleep in the noisy dormitory, which took the shine off ${his} efforts for the whole day,`,
-				type: "rep",
-				effect: -1,
-			});
+			if (canHear(slave)) {
+				vignettes.push({
+					text: `${he} got a poor night's sleep in the noisy dormitory, which took the shine off ${his} efforts for the whole day,`,
+					type: "rep",
+					effect: -1,
+				});
+			} else {
+				vignettes.push({
+					text: `the noise from the dormitory could not possibly disturb ${his} sleep, so ${he} got much better sleep than ${he} would have otherwise,`,
+					type: "rep",
+					effect: 1,
+				});
+			}
 		}
 		if (slave.releaseRules === "permissive" || slave.releaseRules === "masturbation") {
 			vignettes.push({
@@ -27429,11 +27437,19 @@ window.GetVignette = function GetVignette(slave) {
 				effect: 1,
 			});
 		} else if (slave.livingRules === "spare") {
-			vignettes.push({
-				text: `${he} got a poor night's sleep in the noisy dormitory, which took the shine off ${his} efforts for the whole day`,
-				type: "rep",
-				effect: -1,
-			});
+			if (canHear(slave)) {
+				vignettes.push({
+					text: `${he} got a poor night's sleep in the noisy dormitory, which took the shine off ${his} efforts for the whole day,`,
+					type: "rep",
+					effect: -1,
+				});
+			} else {
+				vignettes.push({
+					text: `the noise from the dormitory could not possibly disturb ${his} sleep, so ${he} got much better sleep than ${he} would have otherwise,`,
+					type: "rep",
+					effect: 1,
+				});
+			}
 		}
 		if (slave.releaseRules === "permissive" || slave.releaseRules === "masturbation") {
 			vignettes.push({
diff --git a/src/js/vignettes.tw b/src/js/vignettes.tw
index 8868824c22c..cf12d4917ea 100644
--- a/src/js/vignettes.tw
+++ b/src/js/vignettes.tw
@@ -719,11 +719,19 @@ window.GetVignette = function GetVignette(slave) {
 				effect: 1,
 			});
 		} else if (slave.livingRules === "spare") {
-			vignettes.push({
-				text: `${he} got a poor night's sleep in the noisy dormitory, which took the shine off ${his} efforts for the whole day,`,
-				type: "rep",
-				effect: -1,
-			});
+			if (canHear(slave)) {
+				vignettes.push({
+					text: `${he} got a poor night's sleep in the noisy dormitory, which took the shine off ${his} efforts for the whole day,`,
+					type: "rep",
+					effect: -1,
+				});
+			} else {
+				vignettes.push({
+					text: `the noise from the dormitory could not possibly disturb ${his} sleep, so ${he} got much better sleep than ${he} would have otherwise,`,
+					type: "rep",
+					effect: 1,
+				});
+			}
 		}
 		if (slave.releaseRules === "permissive" || slave.releaseRules === "masturbation") {
 			vignettes.push({
@@ -2239,16 +2247,24 @@ window.GetVignette = function GetVignette(slave) {
 		}
 		if (slave.livingRules === "luxurious") {
 			vignettes.push({
-				text: `${he} got a truly perfect night's sleep, which put ${his} in the right frame of mind for the whole day,`,
+				text: `${he} got a truly perfect night's sleep, which put ${him} in the right frame of mind for the whole day,`,
 				type: "rep",
 				effect: 1,
 			});
 		} else if (slave.livingRules === "spare") {
-			vignettes.push({
-				text: `${he} got a poor night's sleep in the noisy dormitory, which took the shine off ${his} efforts for the whole day`,
-				type: "rep",
-				effect: -1,
-			});
+			if (canHear(slave)) {
+				vignettes.push({
+					text: `${he} got a poor night's sleep in the noisy dormitory, which took the shine off ${his} efforts for the whole day,`,
+					type: "rep",
+					effect: -1,
+				});
+			} else {
+				vignettes.push({
+					text: `the noise from the dormitory could not possibly disturb ${his} sleep, so ${he} got much better sleep than ${he} would have otherwise,`,
+					type: "rep",
+					effect: 1,
+				});
+			}
 		}
 		if (slave.releaseRules === "permissive" || slave.releaseRules === "masturbation") {
 			vignettes.push({
diff --git a/src/uncategorized/RETS.tw b/src/uncategorized/RETS.tw
index e332a519ce4..b3c82ad5bf8 100644
--- a/src/uncategorized/RETS.tw
+++ b/src/uncategorized/RETS.tw
@@ -725,28 +725,28 @@ Mere moments after you absorb this arresting scene, $subSlave.slaveName thrusts
 <<set $activeSlave.penetrativeCount++, $penetrativeTotal++>>
 <<set _vaginal = 0>>
 <<if $subSlave.vagina != 0 && canDoVaginal($subSlave)>><<set _vaginal = 1>><</if>>
-You round a corner and almost trip over <<EventNameLink $activeSlave>>. $He's on top of another slave, humping away; her <<if $activeSlave.butt > 8>>monstrous, naked ass jiggles lewdly<<elseif $activeSlave.anus > 2>>loose asspussy winks lewdly<<elseif $activeSlave.muscles > 30>>heavily muscled butt flexes powerfully<<elseif $activeSlave.butt > 3>>big butt pumps energetically<<else>>nice little butt flexes cutely<</if>> as she thrusts. You can't see much of the slave <<if _vaginal>>lying on her back<<else>>face-down<</if>> underneath $activeSlave.slaveName, but you recognize her as $subSlave.slaveName by her sobbing. _He2's struggling a little, but $activeSlave.slaveName has her pinned to the floor by her wrists, and $activeSlave.slaveName is quickly raping the resistance out of the <<print SlaveTitle($subSlave)>>.
+You round a corner and almost trip over <<EventNameLink $activeSlave>>. $He's on top of another slave, humping away; $his <<if $activeSlave.butt > 8>>monstrous, naked ass jiggles lewdly<<elseif $activeSlave.anus > 2>>loose asspussy winks lewdly<<elseif $activeSlave.muscles > 30>>heavily muscled butt flexes powerfully<<elseif $activeSlave.butt > 3>>big butt pumps energetically<<else>>nice little butt flexes cutely<</if>> as $he thrusts. You can't see much of the slave <<if _vaginal>>lying on _his2 back<<else>>face-down<</if>> underneath $activeSlave.slaveName, but you recognize _him2 as $subSlave.slaveName by _his2 sobbing. _He2's struggling a little, but $activeSlave.slaveName has _him2 pinned to the floor by _his2 wrists, and $activeSlave.slaveName is quickly raping the resistance out of the <<print SlaveTitle($subSlave)>>.
 <br><br>
-$activeSlave.slaveName senses your presence above and behind $him, and twists her $activeSlave.hColor head around to <<if canSee($activeSlave)>>see who it is. She sees that it's you<<else>>discern who it is. She realizes that it's you<</if>>, and greets you cheerfully. "Hi, <<Master>>," she trills.
+$activeSlave.slaveName senses your presence above and behind $him, and twists $his $activeSlave.hColor head around to <<if canSee($activeSlave)>>see who it is. $He sees that it's you<<else>>discern who it is. $He realizes that it's you<</if>>, and greets you cheerfully. "Hi, <<Master>>," $he trills.
 <<if $activeSlave.fetishKnown && $activeSlave.fetish == "sadist">>
 	"Thi<<s>> i<<s>> <<s>>o awe<<s>>ome," the sadistic $desc gushes. "The crying, the <<s>>truggling. Thank you for letting u<<s>> do thi<<s>>."
 <<elseif $activeSlave.fetishKnown && $activeSlave.fetish == "dom">>
 	"The crying almo<<s>>t make<<s>> me feel bad, but fucking a bitch feel<<s>> <<s>>o, <<s>>o good," the dominant $desc admits conversationally.
 <<elseif $activeSlave.fetishKnown && $activeSlave.fetish == "pregnancy" && _vaginal == 1 && canImpreg($subSlave, $activeSlave)>>
-	"I couldn't help my<<s>>elf," the $desc admits. "<<Sh>>e'd look <<s>>o pretty with a pregnant belly and I ju<<s>>t couldn't re<<s>>i<<s>>t giving her one. <<Sh>>e tried to <<s>>ay <<sh>>e didn't want to be a mother, <<s>>o..."
+	"I couldn't help my<<s>>elf," the $desc admits. "_He2'd look <<s>>o pretty with a pregnant belly and I ju<<s>>t couldn't re<<s>>i<<s>>t giving _him2 one. _He2 tried to <<s>>ay _he2 didn't want to be a mother, <<s>>o..."
 <<elseif $activeSlave.energy > 95>>
 	"I can't help my<<s>>elf," the nymphomaniac $desc admits breathlessly. "Thank you for letting me take what I need from the other girl<<s>>."
 <<elseif $activeSlave.energy > 60>>
-	"I couldn't help my<<s>>elf," the $desc admits. "I wa<<s>> really, really horny and she was ju<<s>>t, um, there. And <<sh>>e tried to <<s>>ay no."
+	"I couldn't help my<<s>>elf," the $desc admits. "I wa<<s>> really, really horny and _he2 was ju<<s>>t, um, there. And _he2 tried to <<s>>ay no."
 <<else>>
-	"I know it'<<s>> not like me," the $desc admits. "But I a<<s>>ked her, like, mo<<s>>tly joking, and she tried to <<s>>ay no."
+	"I know it'<<s>> not like me," the $desc admits. "But I a<<s>>ked _him2, like, mo<<s>>tly joking, and _he2 tried to <<s>>ay no."
 <</if>>
 <br><br>
 <<run Enunciate($subSlave)>>
-$subSlave.slaveName <<if _vaginal>>looks out from under $activeSlave.slaveName<<else>>turns her head<</if>> and <<if canSee($subSlave)>>looks at<<else>>faces<</if>> you too. "<<Master $subSlave>>, plea<<s>>e," she begs. "P-plea<<s>>e, make her <<s>>-<<s>>top - mhhh -" $activeSlave.slaveName shuts her up by <<if _vaginal>>kissing her unwilling mouth<<else>>shoving her face back against the floor<</if>>. Once she has $subSlave.slaveName back under control, $activeSlave.slaveName slows her thrusting, reaches around behind herself, and <<if $activeSlave.vagina != 0 && canDoVaginal($activeSlave)>>spreads her futa pussy for you.<<else>>pulls one asscheek aside to offer you her anus. To make the offer extra clear, she starts winking it lewdly.<</if>>
+$subSlave.slaveName <<if _vaginal>>looks out from under $activeSlave.slaveName<<else>>turns _his2 head<</if>> and <<if canSee($subSlave)>>looks at<<else>>faces<</if>> you too. "<<Master $subSlave>>, plea<<s>>e," _he2 begs. "P-plea<<s>>e, make $him <<s>>-<<s>>top - mhhh -" $activeSlave.slaveName shuts _him2 up by <<if _vaginal>>kissing _his2 unwilling mouth<<else>>shoving _his2 face back against the floor<</if>>. Once $he has $subSlave.slaveName back under control, $activeSlave.slaveName slows $his thrusting, reaches around behind $himself, and <<if $activeSlave.vagina != 0 && canDoVaginal($activeSlave)>>spreads $his futa pussy for you.<<else>>pulls one asscheek aside to offer you $his anus. To make the offer extra clear, $he starts winking it lewdly.<</if>>
 <br><br>
 <<run Enunciate($activeSlave)>>
-"Plea<<s>>e fuck me while I rape her, <<Master>>," $activeSlave.slaveName <<say>>s in a mockery of $subSlave.slaveName's <<if $subSlave.voice > 2>>high-pitched whining<<elseif $subSlave.voice > 1>>begging<<else>>deep-voiced begging<</if>>. "Ooh, or, plea<<s>>e, <<Master>>, may I flip her over? I'd love to feel <<if $PC.dick>>your cock in<<s>>ide her along<<s>>ide mine<<else>>that <<s>>trap-on you u<<s>>e in<<s>>ide her along<<s>>ide my cock<</if>>!"
+"Plea<<s>>e fuck me while I rape _him2, <<Master>>," $activeSlave.slaveName <<say>>s in a mockery of $subSlave.slaveName's <<if $subSlave.voice > 2>>high-pitched whining<<elseif $subSlave.voice > 1>>begging<<else>>deep-voiced begging<</if>>. "Ooh, or, plea<<s>>e, <<Master>>, may I flip _him2 over? I'd love to feel <<if $PC.dick>>your cock in<<s>>ide _him2 along<<s>>ide mine<<else>>that <<s>>trap-on you u<<s>>e in<<s>>ide _him2 along<<s>>ide my cock<</if>>!"
 <br><br>
 <<run Enunciate($subSlave)>>
 "Plea<<s>>e, no," sobs $subSlave.slaveName.
@@ -1761,7 +1761,7 @@ she adds impishly. Hearing this, $subSlave.slaveName lets the breast pop free of
 	<<replace "#result">>
 	You order $activeSlave.slaveName to stop raping $subSlave.slaveName.
 	<<run Enunciate($activeSlave)>>
-	"Ye<<s>>, <<Master>>," she <<say>>s automatically, and gets up, pulling her dick out of $subSlave.slaveName's poor <<if _vaginal>>pussy<<else>>asshole<</if>>. $activeSlave.slaveName doesn't understand, and her prick softens quickly with her confusion. She thought she didn't need consent to fuck other slaves, and she @@.gold;doubts herself.@@
+	"Ye<<s>>, <<Master>>," $he <<say>>s automatically, and gets up, pulling her dick out of $subSlave.slaveName's poor <<if _vaginal>>pussy<<else>>asshole<</if>>. $activeSlave.slaveName doesn't understand, and her prick softens quickly with her confusion. $He thought $he didn't need consent to fuck other slaves, and $he @@.gold;doubts $himself.@@
 	<br><br>
 	<<run Enunciate($subSlave)>>
 	$subSlave.slaveName gets to her feet too, using a hand to massage her outraged hole. "Thank you, <<Master $subSlave>>, thank you," she repeats over and over, @@.mediumaquamarine;weeping with relief.@@
diff --git a/src/uncategorized/saGetMilked.tw b/src/uncategorized/saGetMilked.tw
index c32e534f1fe..ed03976d401 100644
--- a/src/uncategorized/saGetMilked.tw
+++ b/src/uncategorized/saGetMilked.tw
@@ -375,15 +375,15 @@ gets milked this week.
 
 	<<if ($arcologies[0].FSPastoralist == "unset")>>
 		<<set _cumSale = ($cum*random(15,25))>>
-		<<if  $slaves[$i].vasectomy == 1 || $slaves[$i].ballType == "sterile">><<set _cumSale *= 0.2>><<elseif $slaves[$i].prostate == 3>><<set _cumSale *= 0.5>><</if>>
+		<<if $slaves[$i].vasectomy == 1 || $slaves[$i].ballType == "sterile">><<set _cumSale *= 0.2>><<elseif $slaves[$i].prostate == 3>><<set _cumSale *= 0.5>><</if>>
 		$He produces <<print $cum>> deciliters of cum over the week; the fresh ejaculate is sold for @@.yellowgreen;<<print cashFormat(_cumSale)>>.@@
 	<<elseif $arcologies[0].FSPastoralistLaw == 1>>
 		<<set _cumSale = ($cum*(random(20,40)))>>
-		<<if  $slaves[$i].vasectomy == 1 || $slaves[$i].ballType == "sterile">><<set _cumSale *= 0.2>><<elseif $slaves[$i].prostate == 3>><<set _cumSale *= 0.5>><</if>>
+		<<if $slaves[$i].vasectomy == 1 || $slaves[$i].ballType == "sterile">><<set _cumSale *= 0.2>><<elseif $slaves[$i].prostate == 3>><<set _cumSale *= 0.5>><</if>>
 		$He produces <<print $cum>> deciliters of cum over the week; the fresh ejaculate, which is in extremely high demand as one of $arcologies[0].name's few legal sources of animal protein, is sold for @@.yellowgreen;<<print cashFormat(_cumSale)>>.@@
 	<<else>>
 		<<set _cumSale = ($cum*(random(10,20)+Math.trunc($arcologies[0].FSPastoralist/10)))>>
-		<<if  $slaves[$i].vasectomy == 1 || $slaves[$i].ballType == "sterile">><<set _cumSale *= 0.2>><<elseif $slaves[$i].prostate == 3>><<set _cumSale *= 0.5>><</if>>
+		<<if $slaves[$i].vasectomy == 1 || $slaves[$i].ballType == "sterile">><<set _cumSale *= 0.2>><<elseif $slaves[$i].prostate == 3>><<set _cumSale *= 0.5>><</if>>
 		$He produces <<print $cum>> deciliters of cum over the week; the fresh ejaculate, which is in high demand given the new cultural preference for slave products, is sold for @@.yellowgreen;<<print cashFormat(_cumSale)>>.@@
 	<</if>>
 	<<set $cash += _cumSale>>
@@ -467,6 +467,88 @@ gets milked this week.
 	<<set $slaves[$i].devotion += 1>>
 <</if>>
 
+<<if ($showVignettes == 1)>>
+	<<set _vignette = GetVignette($slaves[$i])>>
+	__This week__ _vignette.text
+	<<if (_vignette.type == "cash")>>
+		<<if (_vignette.effect > 0)>>
+			@@.yellowgreen;making you an extra <<print cashFormat(Math.trunc($FResult*_vignette.effect))>>.@@
+		<<elseif (_vignette.effect < 0)>>
+			@@.red;losing you <<print cashFormat(Math.abs(Math.trunc($FResult*_vignette.effect)))>>.@@
+		<<else>>
+			an incident without lasting effect.
+		<</if>>
+		<<set $cash += Math.trunc($FResult*_vignette.effect)>>
+	<<set _incomeStats.income += Math.trunc($FResult*_vignette.effect)>>
+	<<elseif (_vignette.type == "devotion")>>
+		<<if (_vignette.effect > 0)>>
+			<<if $slaves[$i].devotion > 50>>
+		@@.hotpink;increasing $his devotion to you.@@
+			<<elseif $slaves[$i].devotion >= -20>>
+		@@.hotpink;increasing $his acceptance of you.@@
+		<<elseif $slaves[$i].devotion > -10>>
+		@@.hotpink;reducing $his dislike of you.@@
+			<<else>>
+		@@.hotpink;reducing $his hatred of you.@@
+			<</if>>
+		<<elseif (_vignette.effect < 0)>>
+			<<if $slaves[$i].devotion > 50>>
+		@@.mediumorchid;reducing $his devotion to you.@@
+			<<elseif $slaves[$i].devotion >= -20>>
+		@@.mediumorchid;reducing $his acceptance of you.@@
+		<<elseif $slaves[$i].devotion > -10>>
+		@@.mediumorchid;increasing $his dislike of you.@@
+			<<else>>
+		@@.mediumorchid;increasing $his hatred of you.@@
+			<</if>>
+		<<else>>
+			an incident without lasting effect.
+		<</if>>
+		<<set $slaves[$i].devotion += 1*_vignette.effect>>
+	<<elseif (_vignette.type == "trust")>>
+		<<if (_vignette.effect > 0)>>
+			<<if $slaves[$i].trust > 20>>
+		@@.mediumaquamarine;increasing $his trust in you.@@
+		<<elseif $slaves[$i].trust > -10>>
+		@@.mediumaquamarine;reducing $his fear of you.@@
+			<<else>>
+		@@.mediumaquamarine;reducing $his terror of you.@@
+			<</if>>
+		<<elseif (_vignette.effect < 0)>>
+			<<if $slaves[$i].trust > 20>>
+		@@.gold;reducing $his trust in you.@@
+			<<elseif $slaves[$i].trust > -20>>
+		@@.gold;increasing $his fear of you.@@
+			<<else>>
+		@@.gold;increasing $his terror of you.@@
+			<</if>>
+		<<else>>
+			an incident without lasting effect.
+		<</if>>
+		<<set $slaves[$i].trust += 1*_vignette.effect>>
+	<<elseif (_vignette.type == "health")>>
+		<<if (_vignette.effect > 0)>>
+		@@.green;improving $his health.@@
+		<<elseif (_vignette.effect < 0)>>
+		@@.red;affecting $his health.@@
+		<<else>>
+			an incident without lasting effect.
+		<</if>>
+		<<set $slaves[$i].health += 2*_vignette.effect>>
+	<<else>>
+		<<if (_vignette.effect > 0)>>
+			@@.green;gaining you a bit of reputation.@@
+		<<elseif (_vignette.effect < 0)>>
+			@@.red;losing you a bit of reputation.@@
+		<<else>>
+			an incident without lasting effect.
+		<</if>>
+		<<set $rep += Math.trunc($FResult*_vignette.effect*0.1)>>
+	<<set _incomeStats.rep += Math.trunc($FResult*_vignette.effect*0.1)>>
+	<</if>>
+
+<</if>>
+
 /* FACILITY DECORATION IMPACTS */
 
 <<if $slaves[$i].assignment == "work in the dairy">>
diff --git a/src/uncategorized/saWhore.tw b/src/uncategorized/saWhore.tw
index c48f774e076..b0d60573cee 100644
--- a/src/uncategorized/saWhore.tw
+++ b/src/uncategorized/saWhore.tw
@@ -951,7 +951,7 @@ $His appearance attracted $beauty customers (<<print Math.trunc($beauty/7)>> a d
 <<elseif ($slaves[$i].behavioralQuirk == "cutting")>>
 	$He gets a lot of attention for $his ability to joke at a customer's expense.
 <<elseif ($slaves[$i].behavioralQuirk == "funny")>>
-	$He brings unintentional comic relief to the hard work  of prostitution.
+	$He brings unintentional comic relief to the hard work of prostitution.
 <<elseif ($slaves[$i].behavioralQuirk == "adores women")>>
 	$He's a favorite among female customers, whom $he greets with real enthusiasm.
 <<elseif ($slaves[$i].behavioralQuirk == "adores men")>>
-- 
GitLab