From 7e23195bedaaf4fd6a9c32afbae9186adfd571be Mon Sep 17 00:00:00 2001
From: Skriv <skrivelese@gmail.com>
Date: Thu, 13 May 2021 22:40:59 +0000
Subject: [PATCH] bondageGear to js

---
 src/events/RESS/bondageGear.js | 214 +++++++++++++++++++++++++++++++++
 src/events/randomEvent.js      |   3 +-
 src/js/eventSelectionJS.js     |   8 --
 src/uncategorized/RESS.tw      | 102 +---------------
 4 files changed, 217 insertions(+), 110 deletions(-)
 create mode 100644 src/events/RESS/bondageGear.js

diff --git a/src/events/RESS/bondageGear.js b/src/events/RESS/bondageGear.js
new file mode 100644
index 00000000000..d819e3bc69d
--- /dev/null
+++ b/src/events/RESS/bondageGear.js
@@ -0,0 +1,214 @@
+App.Events.RESSBondageGear = class RESSBondageGear extends App.Events.BaseEvent {
+	eventPrerequisites() {
+		return []; // always valid if sufficient actors can be cast successfully
+	}
+
+	actorPrerequisites() {
+		return [
+			[ // single event slave
+				s => s.fetish !== "mindbroken",
+				s => s.devotion < -20,
+				s => s.trust >= -20,
+				s => s.clothes === "uncomfortable straps",
+				hasAnyArms,
+				hasAnyLegs,
+			]
+		];
+	}
+
+	execute(node) {
+		/** @type {Array<App.Entity.SlaveState>} */
+		let [eventSlave] = this.actors.map(a => getSlave(a));
+		const {He, he, His, his, him} = getPronouns(eventSlave);
+		const {title: Master, say} = getEnunciation(eventSlave);
+		const belly = bellyAdjective(eventSlave);
+		const hands = hasBothArms(eventSlave) ? "hands" : "hand";
+		App.Events.drawEventArt(node, eventSlave, "no clothing");
+
+		V.nextLink = "Next Week";
+
+		let t = [];
+		t.push(`One day, you catch sight of`);
+		t.push(contextualIntro(V.PC, eventSlave, "DOM"));
+		if (eventSlave.heels === 1 && shoeHeelCategory(eventSlave) === 0) {
+			t.push(`crawling`);
+		} else if (shoeHeelCategory(eventSlave) > 1) {
+			t.push(`tottering`);
+		} else {
+			t.push(`walking`);
+		}
+		t.push(`around stark naked. This is unacceptable, as ${he} has been ordered to wear humiliating and uncomfortable bondage gear. When confronted,`);
+		if (!canTalk(eventSlave)) {
+			if (!hasAnyArms(eventSlave)) {
+				t.push(`${he} tries to communicate ${his} reluctance to wear the clothing as best as ${he} can with various head movements and facial`);
+				if (eventSlave.bellyPreg >= 5000) {
+					t.push(`expressions, including several nods towards ${his} rounded middle.`);
+				} else {
+					t.push("expressions.");
+				}
+			} else {
+				t.push(`${he} uses gestures to communicate ${his} embarrassment with ${his} clothing, covering ${his} nipples, crotch, and anus with ${his} ${hands} one after the other, and begging for clothes that do the same.`);
+				if (eventSlave.bellyPreg >= 5000) {
+					t.push(`${He} also gestures to ${his} rounded belly with a look of concern.`);
+				}
+			}
+		} else {
+			t.push(`${he} ${say}s fearfully,`);
+			if (eventSlave.bellyPreg >= 5000) {
+				t.push(Spoken(eventSlave, `"I'm sorry, ${Master}, but those things are just so embarrassing! I'm also worried for my ${eventSlave.pregType > 1 ? "babies'" : "baby's"} safety."`));
+			} else {
+				t.push(Spoken(eventSlave, `"I'm sorry, ${Master}, but those things are just so embarrassing!"`));
+			}
+		}
+
+		App.Events.addParagraph(node, t);
+		App.Events.addResponses(node, [
+			new App.Events.Result(`Let ${him} go naked`, naked),
+			new App.Events.Result(`Force ${him} to choose between ${his} straps and public nudity`, publicNude),
+			(eventSlave.buttplug === "none" && (eventSlave.vagina < 0 || (eventSlave.vaginalAccessory === "none" && eventSlave.vaginalAttachment === "none")))
+				? new App.Events.Result(`Add dildos to ${his} gear`, dildos, (eventSlave.anus === 0 && canDoAnal(eventSlave)) || (eventSlave.vagina === 0 && canDoVaginal(eventSlave)) ? `This option will take ${his} virginity` : null)
+				: new App.Events.Result(),
+			(V.arcade > 0)
+				? new App.Events.Result(`Sentence ${him} to a month in the arcade`, arcade)
+				: new App.Events.Result(),
+
+		]);
+
+		function naked() {
+			t = [];
+			if (canWalk(eventSlave)) {
+				t.push(`${He} skips away happily,`);
+			} else if (isAmputee(eventSlave)) {
+				t.push(`${He} wriggles ${his} stumps with pleasure,`);
+			} else {
+				t.push(`${He} cheerfully leaves your office,`);
+			}
+			t.push(`overjoyed to be free of the clothing you ordered ${him} to wear. ${His} obedience to you <span class="mediumorchid">has decreased,</span> as has <span class="mediumaquamarine">${his} fear</span> of you.`);
+			eventSlave.devotion -= 5;
+			eventSlave.trust += 4;
+			return t;
+		}
+
+		function publicNude() {
+			t = [];
+			t.push(`You tell ${him} that you understand, and that ${he} can go naked; ${he} looks thrilled until you tell ${him} ${he}'ll be walking every hallway in ${V.arcologies[0].name} today, nude. Before ${he} can protest, you add that ${his} only other option is to put ${his} proper clothes back on and be a good little bitch.`);
+			if (eventSlave.fetish === "humiliation") {
+				t.push(`${He} <span class="hotpink">happily accepts the alternative,</span>`);
+				if (canAchieveErection(eventSlave) && !(eventSlave.chastityPenis)) {
+					t.push(`${his} dick hardening`);
+				} else if (eventSlave.dick > 0) {
+					t.push(`${his} dick leaking precum`);
+				} else if (eventSlave.vagina > 0) {
+					t.push(`${his} pussy moistening`);
+				} else {
+					t.push(`${his} nipples`);
+					if (eventSlave.nipples !== "fuckable") {
+						t.push(`hardening`);
+					} else {
+						t.push(`swelling`);
+					}
+				}
+				t.push(`with anticipation.`);
+				eventSlave.devotion += 4;
+				eventSlave.clothes = "no clothing";
+				if (eventSlave.fetishKnown === 0) {
+					t.push(`That was not the response you expected; turns out ${he} has a <span class="lightcoral">humiliation fetish.</span>`);
+					eventSlave.fetishKnown = 1;
+				}
+			} else {
+				t.push(`${He} shudders and <span class="gold">hurries to get ${his} straps back on.</span>`);
+				eventSlave.trust -= 5;
+			}
+			return t;
+		}
+
+		function dildos() {
+			t = [];
+			t.push(`You tell ${him} that you understand, and that you will get ${him} some new clothing. ${He} is thrilled, but ${his} pleasure turns to horror when ${he} sees that the new clothes are a version of the same slave bondage gear, just with inward-facing dildos for ${his}`);
+			if (eventSlave.vagina > -1) {
+				t.push(`pussy and`);
+			}
+			t.push(`asshole.`);
+			if (eventSlave.anus === 0 && eventSlave.vagina === 0 && canDoAnal(eventSlave) && canDoVaginal(eventSlave)) {
+				t.push(`You pause before getting ${him} dressed; there's little reason to waste virginities on plugs. You`);
+				if (V.PC.dick !== 0) {
+					t.push(`stroke yourself to erection`);
+				} else {
+					t.push(`don a strap-on`);
+				}
+				t.push(`and bend ${him} over, opting to start with ${his} tight pussy.`);
+				t.push(VCheck.Both(eventSlave, 1));
+			} else if (eventSlave.anus === 0 && canDoAnal(eventSlave)) {
+				t.push(`You pause before getting ${him} dressed; there's little reason to waste ${his} anal virginity on a plug. You `);
+				if (V.PC.dick !== 0) {
+					t.push(`stroke yourself to erection`);
+				} else {
+					t.push(`don a strap-on`);
+				}
+				t.push(`and bend ${him} over before working your way into ${his} tight anus.`);
+				t.push(VCheck.Anal(eventSlave, 1));
+			} else if (eventSlave.vagina === 0 && canDoVaginal(eventSlave)) {
+				t.push(`You pause before getting ${him} dressed; there's little reason to waste ${his} virginity on a plug. You`);
+				if (V.PC.dick !== 0) {
+					t.push(`stroke yourself to erection`);
+				} else {
+					t.push(`don a strap-on`);
+				}
+				t.push(` and bend ${him} over before working your way into ${his} tight pussy.`);
+				t.push(VCheck.Vaginal(eventSlave, 1));
+			}
+			t.push(`For the rest of the week, ${he} walks around awkwardly, unable to find a comfortable position`);
+			if (eventSlave.belly >= 1500) {
+				t.push(`between`);
+			} else {
+				t.push(`since`);
+			}
+			t.push(`${his}`);
+			if (V.seeRace === 1) {
+				t.push(`${eventSlave.race}`);
+			}
+			t.push(`body`);
+			if (eventSlave.belly < 1500) {
+				t.push(`is`);
+			}
+			if (eventSlave.belly >= 1500) {
+				t.push(`being penetrated by ${his} own clothing and the straps digging into ${his} ${belly} rounded belly`);
+			} else {
+				t.push(`being penetrated by ${his} own clothing.`);
+			}
+			t.push(`<span class="hotpink">${He} has become more submissive.</span>`);
+			eventSlave.devotion += 4;
+			return t;
+		}
+
+		function arcade() {
+			t = [];
+			t.push(`${eventSlave.slaveName} screams and begs when ${he} realizes what ${his} punishment is, but you are obdurate.`);
+			if (eventSlave.muscles > 30) {
+				t.push(`${His} powerful form has to be sedated for immurement in the arcade.`);
+			} else if ((eventSlave.weight >= 190)) {
+				t.push(`${He} is so massively fat that immuring ${him} in the arcade is a struggle, even when ${he} isn't trying to.`);
+			} else if (eventSlave.belly >= 120000) {
+				t.push(`${He} is so enormously gravid that immuring ${him} in the arcade is a hassle, even though ${his} ${belly} middle limits ${his} ability to struggle.`);
+			} else if ((eventSlave.weight >= -10)) {
+				t.push(`${His} desperate struggles make immuring ${him} in the arcade difficult.`);
+			} else if (eventSlave.belly >= 1500) {
+				t.push(`${His}`);
+				if (eventSlave.bellyPreg >= 3000) {
+					t.push(`pregnant`);
+				} else {
+					t.push(belly);
+				}
+				t.push(`body makes it slightly difficult to fit ${him} properly into the restraints for immurement in the arcade.`);
+			} else if (eventSlave.muscles < -15) {
+				t.push(`${His} weak body makes immuring ${him} in the arcade pathetically easy.`);
+			} else {
+				t.push(`${His} thin form makes immuring ${him} in the arcade pathetically easy.`);
+			}
+			t.push(`After ${he}'s properly confined, the only sign of ${his} discomfiture is a slight movement of ${his} ${eventSlave.skin} butt as ${he} wriggles desperately against ${his} restraints.`);
+			assignJob(eventSlave, "be confined in the arcade");
+			eventSlave.sentence = 4;
+			return t;
+		}
+	}
+};
diff --git a/src/events/randomEvent.js b/src/events/randomEvent.js
index 100e737caf4..26183c8d757 100644
--- a/src/events/randomEvent.js
+++ b/src/events/randomEvent.js
@@ -10,12 +10,13 @@ App.Events.getIndividualEvents = function() {
 	return [
 		// instantiate all possible random individual events here
 		// example: new App.Events.TestEvent(),
-		new App.Events.RESSDevotedFearfulSlave(),
 		new App.Events.RESSAssFitting(),
+		new App.Events.RESSBondageGear(),
 		new App.Events.RESSCockFeederResistance(),
 		new App.Events.RESSComfortableSeat(),
 		new App.Events.RESSDevotedAnalVirgin(),
 		new App.Events.RESSDevotedEducated(),
+		new App.Events.RESSDevotedFearfulSlave(),
 		new App.Events.RESSDevotedShortstack(),
 		new App.Events.RESSDevotedVirgin(),
 		new App.Events.RESSDevotedWaist(),
diff --git a/src/js/eventSelectionJS.js b/src/js/eventSelectionJS.js
index 38230dced5b..29694cd0b65 100644
--- a/src/js/eventSelectionJS.js
+++ b/src/js/eventSelectionJS.js
@@ -754,14 +754,6 @@ if(eventSlave.drugs === "breast injections") {
 				}
 			}
 
-			if (eventSlave.devotion < -20) {
-				if (eventSlave.trust >= -20) {
-					if (eventSlave.clothes === "uncomfortable straps") {
-						V.RESSevent.push("bondage gear");
-					}
-				}
-			}
-
 			if (eventSlave.labia > 1 && eventSlave.vagina >= 0) {
 				if (eventSlave.muscles > 5 || eventSlave.diet === "muscle building") {
 					if (eventSlave.belly < 10000) {
diff --git a/src/uncategorized/RESS.tw b/src/uncategorized/RESS.tw
index 3de2220374b..d5d4971cd3b 100644
--- a/src/uncategorized/RESS.tw
+++ b/src/uncategorized/RESS.tw
@@ -44,7 +44,7 @@
 <<set _clothesTemp = $activeSlave.clothes>>
 <<switch $RESSevent>>
 /*Some events start with the slave naked (any event that starts with the daily inspection, for example). Here we switch their clothing just for the image to load, then switch it back quickly so the player's choice is not messed up.*/
-<<case "age implant" "ara ara" "back stretch" "bad dream" "bed snuggle" "bondage gear" "bonded love" "breast expansion blues" "confident tanning" "devoted exhibition" "devoted lotion" "desperate null" "devoted nympho" "extreme aphrodisiacs" "fearful balls" "fucktoy tribbing" "gaped asshole" "happy dance" "heavy piercing" "huge naturals" "huge tits" "hugely pregnant" "ignorant horny" "implant inspection" "language lesson" "mindbroken morning" "modest clothes" "mods please" "old PC age difference" "orchiectomy please" "PA flirting" "penitent" "permitted masturbation" "plimb help" "rebellious arrogant" "resistant gelding" "resistant shower" "resting amp" "restricted profession" "restricted smart" "sexy succubus" "shaped areolae" "shift masturbation" "shift sleep" "shower slip" "slave dick huge" "sleeping ambivalent" "sore shoulders" "spa boobs" "subjugation blues" "tendon fall" "terrified inspection" "tittymonster inspection" "torpedo squeeze" "transition anxiety" "trusting HG" "unhappy virgin" "used whore" "vocal disobedience" "young PC age difference">>
+<<case "age implant" "ara ara" "back stretch" "bad dream" "bed snuggle" "bonded love" "breast expansion blues" "confident tanning" "devoted exhibition" "devoted lotion" "desperate null" "devoted nympho" "extreme aphrodisiacs" "fearful balls" "fucktoy tribbing" "gaped asshole" "happy dance" "heavy piercing" "huge naturals" "huge tits" "hugely pregnant" "ignorant horny" "implant inspection" "language lesson" "mindbroken morning" "modest clothes" "mods please" "old PC age difference" "orchiectomy please" "PA flirting" "penitent" "permitted masturbation" "plimb help" "rebellious arrogant" "resistant gelding" "resistant shower" "resting amp" "restricted profession" "restricted smart" "sexy succubus" "shaped areolae" "shift masturbation" "shift sleep" "shower slip" "slave dick huge" "sleeping ambivalent" "sore shoulders" "spa boobs" "subjugation blues" "tendon fall" "terrified inspection" "tittymonster inspection" "torpedo squeeze" "transition anxiety" "trusting HG" "unhappy virgin" "used whore" "vocal disobedience" "young PC age difference">>
 	<<set $activeSlave.clothes = "no clothing">>
 <<case "whore rebellious">>
 	/* this scene states they are wearing "thick, durable latex with temperature regulation and anchor points for restraint" no matter what they are assigned to wear. */
@@ -927,27 +927,6 @@ One day, you give $him inconsequential orders, naturally addressing $him by $his
 <</if>>
 $He sets $his jaw and <<if canSee($activeSlave)>>manages to meet your eyes without flinching<<else>>meets your glare with a look of defiance<</if>>.
 
-<<case "bondage gear">>
-
-One day, you catch sight of <<= App.UI.slaveDescriptionDialog($activeSlave)>>
-<<if ($activeSlave.heels == 1 && shoeHeelCategory($activeSlave) == 0)>>
-	crawling
-<<elseif shoeHeelCategory($activeSlave) > 1>>
-	tottering
-<<else>>
-	walking
-<</if>>
-around stark naked. This is unacceptable, as $he has been ordered to wear humiliating and uncomfortable bondage gear. When confronted,
-<<if !canTalk($activeSlave)>>
-	<<if !hasAnyArms($activeSlave)>>
-		$he tries to communicate $his reluctance to wear the clothing as best as $he can with various head movements and facial expressions<<if $activeSlave.bellyPreg >= 5000>>, including several nods towards $his rounded middle<</if>>.
-	<<else>>
-		$he uses gestures to communicate $his embarrassment with $his clothing, covering $his nipples, crotch, and anus with $his hand<<if hasBothArms($activeSlave)>>s<</if>> one after the other, and begging for clothes that do the same.<<if $activeSlave.bellyPreg >= 5000>> $He also gestures to $his rounded belly with a look of concern.<</if>>
-	<</if>>
-<<else>>
-	$he <<say>>s fearfully, "I'm <<s>>orry, <<Master>>, but tho<<s>>e thing<<s>> are ju<<s>>t <<s>>o embarra<<ss>>ing!<<if $activeSlave.bellyPreg >= 5000>> I'm al<<s>>o worried for my <<if $activeSlave.pregType > 1>>babie<<s>>'<<else>>baby'<<s>><</if>> <<s>>afety.<</if>>"
-<</if>>
-
 <<case "vocal disobedience">>
 
 One morning, despite the fact that $he is not allowed to speak without being spoken to, <<= App.UI.slaveDescriptionDialog($activeSlave)>> <<if canSee($activeSlave)>>looks you directly in the eye<<else>>faces you<</if>> and asks
@@ -6817,85 +6796,6 @@ $He cranes $his neck, glancing over $his shoulder to give you a pleading look.
 	<</link>>
 <</if>>
 
-<<case "bondage gear">>
-
-<<link "Let $him go naked">>
-	<<replace "#result">>
-		<<if canWalk($activeSlave)>>$He skips away happily,<<elseif isAmputee($activeSlave)>>$He wriggles $his stumps with pleasure,<<else>>$He cheerfully leaves your office,<</if>> overjoyed to be free of the clothing you ordered $him to wear. $His obedience to you @@.mediumorchid;has decreased,@@ as has @@.mediumaquamarine;$his fear@@ of you.
-		<<set $activeSlave.devotion -= 5, $activeSlave.trust += 4>>
-	<</replace>>
-<</link>>
-<br><<link "Force $him to choose between $his straps and public nudity">>
-	<<replace "#result">>
-		You tell $him that you understand, and that $he can go naked; $he looks thrilled until you tell $him $he'll be walking every hallway in $arcologies[0].name today, nude. Before $he can protest, you add that $his only other option is to put $his proper clothes back on and be a good little bitch.
-		<<if $activeSlave.fetish == "humiliation">>
-			$He @@.hotpink;happily accepts the alternative,@@
-			<<if canAchieveErection($activeSlave) && !($activeSlave.chastityPenis)>>
-				$his dick hardening
-			<<elseif $activeSlave.dick > 0>>
-				$his dick leaking precum
-			<<elseif $activeSlave.vagina > 0>>
-				$his pussy moistening
-			<<else>>
-				$his nipples <<if $activeSlave.nipples != "fuckable">>hardening<<else>>swelling<</if>>
-			<</if>>
-			with anticipation.
-			<<set $activeSlave.devotion += 4, $activeSlave.clothes = "no clothing">>
-			<<if $activeSlave.fetishKnown == 0>>
-				That was not the response you expected; turns out $he has a @@.lightcoral;humiliation fetish.@@
-				<<set $activeSlave.fetishKnown = 1>>
-			<</if>>
-		<<else>>
-			$He shudders and @@.gold;hurries to get $his straps back on.@@
-			<<set $activeSlave.trust -= 5>>
-		<</if>>
-	<</replace>>
-<</link>>
-<<if $activeSlave.buttplug == "none" && ($activeSlave.vagina < 0 || ($activeSlave.vaginalAccessory == "none" && $activeSlave.vaginalAttachment == "none"))>>
-	<br><<link "Add dildos to $his gear">>
-		<<replace "#result">>
-			You tell $him that you understand, and that you will get $him some new clothing. $He is thrilled, but $his pleasure turns to horror when $he sees that the new clothes are a version of the same slave bondage gear, just with inward-facing dildos for $his <<if $activeSlave.vagina > -1>>pussy and <</if>> asshole.
-			<<if $activeSlave.anus == 0 && $activeSlave.vagina == 0 && canDoAnal($activeSlave) && canDoVaginal($activeSlave)>>
-				You pause before getting $him dressed; there's little reason to waste virginities on plugs. You <<if $PC.dick != 0>>stroke yourself to erection<<else>>don a strap-on<</if>> and bend $him over, opting to start with $his tight pussy.
-				<<= VCheck.Both($activeSlave, 1)>>
-			<<elseif $activeSlave.anus == 0 && canDoAnal($activeSlave)>>
-				You pause before getting $him dressed; there's little reason to waste $his anal virginity on a plug. You <<if $PC.dick != 0>>stroke yourself to erection<<else>>don a strap-on<</if>> and bend $him over before working your way into $his tight anus.
-				<<= VCheck.Anal($activeSlave, 1)>>
-			<<elseif $activeSlave.vagina == 0 && canDoVaginal($activeSlave)>>
-				You pause before getting $him dressed; there's little reason to waste $his virginity on a plug. You <<if $PC.dick != 0>>stroke yourself to erection<<else>>don a strap-on<</if>> and bend $him over before working your way into $his tight pussy.
-				<<= VCheck.Vaginal($activeSlave, 1)>>
-			<</if>>
-			For the rest of the week, $he walks around awkwardly, unable to find a comfortable position <<if $activeSlave.belly >= 1500>>between<<else>>since<</if>> $his <<if $seeRace == 1>>$activeSlave.race <</if>>body <<if $activeSlave.belly < 1500>>is<</if>> being penetrated by $his own clothing<<if $activeSlave.belly >= 1500>> and the straps digging into $his _belly rounded belly<</if>>. @@.hotpink;$He has become more submissive.@@
-		<</replace>>
-		<<set $activeSlave.devotion += 4>>
-	<</link>><<if ($activeSlave.anus == 0 && canDoAnal($activeSlave)) || ($activeSlave.vagina == 0 && canDoVaginal($activeSlave))>> //This option will take $his virginity//<</if>>
-<</if>>
-<<if $arcade > 0>>
-	<br><<link "Sentence $him to a month in the arcade">>
-		<<replace "#result">>
-			$activeSlave.slaveName screams and begs when $he realizes what $his punishment is, but you are obdurate.
-			<<if ($activeSlave.muscles > 30)>>
-				$His powerful form has to be sedated for immurement in the arcade.
-			<<elseif ($activeSlave.weight >= 190)>>
-				$He is so massively fat that immuring $him in the arcade is a struggle, even when $he isn't trying to.
-			<<elseif $activeSlave.belly >= 120000>>
-				$He is so enormously gravid that immuring $him in the arcade is a hassle, even though $his _belly middle limits $his ability to struggle.
-			<<elseif ($activeSlave.weight >= -10)>>
-				$His desperate struggles make immuring $him in the arcade difficult.
-			<<elseif $activeSlave.belly >= 1500>>
-				$His <<if $activeSlave.bellyPreg >= 3000>>pregnant<<else>>_belly<</if>> body makes it slightly difficult to fit $him properly into the restraints for immurement in the arcade.
-			<<elseif $activeSlave.muscles < -15>>
-				$His weak body makes immuring $him in the arcade pathetically easy.
-			<<else>>
-				$His thin form makes immuring $him in the arcade pathetically easy.
-			<</if>>
-			After $he's properly confined, the only sign of $his discomfiture is a slight movement of $his $activeSlave.skin butt as $he wriggles desperately against $his restraints.
-			<<= assignJob($activeSlave, "be confined in the arcade")>>
-			<<set $activeSlave.sentence = 4>>
-		<</replace>>
-	<</link>>
-<</if>>
-
 <<case "vocal disobedience">>
 
 <<link "Give $him a rough spanking">>
-- 
GitLab