From 2b011e294279fc32b205f3a678d60dab2b5c132c Mon Sep 17 00:00:00 2001
From: lowercasedonkey <lowercasedonkey@gmail.com>
Date: Wed, 30 Jun 2021 23:43:31 -0400
Subject: [PATCH] whore

---
 js/003-data/gameVariableData.js               |   1 -
 src/endWeek/reports/clubReport.js             |   7 --
 src/events/RE/reLegendaryEntertainer.js       | 106 ++++++++++++++++++
 src/js/eventSelectionJS.js                    |   6 -
 src/uncategorized/randomNonindividualEvent.tw |   3 -
 src/uncategorized/reLegendaryEntertainer.tw   |  84 --------------
 6 files changed, 106 insertions(+), 101 deletions(-)
 create mode 100644 src/events/RE/reLegendaryEntertainer.js
 delete mode 100644 src/uncategorized/reLegendaryEntertainer.tw

diff --git a/js/003-data/gameVariableData.js b/js/003-data/gameVariableData.js
index e131762af30..a8fa870372d 100644
--- a/js/003-data/gameVariableData.js
+++ b/js/003-data/gameVariableData.js
@@ -700,7 +700,6 @@ App.Data.resetOnNGPlus = {
 	pregInventorID: 0,
 	pregInventions: 0,
 
-	legendaryEntertainerID: 0,
 	legendaryWombID: 0,
 
 	FSAnnounced: 0,
diff --git a/src/endWeek/reports/clubReport.js b/src/endWeek/reports/clubReport.js
index 172bf78bbae..de05d196f86 100644
--- a/src/endWeek/reports/clubReport.js
+++ b/src/endWeek/reports/clubReport.js
@@ -6,7 +6,6 @@ App.EndWeek.clubReport = function() {
 	let r;
 
 	const slaves = App.Utils.sortedEmployees(App.Entity.facilities.club);
-	V.legendaryEntertainerID = 0;
 	V.legendaryWombID = 0;
 
 	// Statistics gathering; income is rep boosts in numbers, and profit will be rep per cash unit, or cash unit per rep
@@ -109,9 +108,6 @@ App.EndWeek.clubReport = function() {
 		}
 		App.Events.addNode(el, r, "p", "indent");
 		if (slaves.length + V.clubSlavesGettingHelp < 10 && V.DJnoSex !== 1 && !slaveResting(S.DJ)) {
-			if (V.legendaryEntertainerID === 0 && S.DJ.prestige === 0 && S.DJ.skill.entertainment >= 100 && S.DJ.devotion > 50) {
-				V.legendaryEntertainerID = S.DJ.ID;
-			}
 			App.Events.addNode(
 				el,
 				[`Since ${he} doesn't have enough sluts in ${V.clubName} to make it worthwhile for ${him} to be on stage 24/7, ${he} spends ${his} extra time slutting it up ${himself}. ${He} has sex with ${S.DJ.sexAmount} citizens, <span class="green">pleasing them immensely,</span> since it's more appealing to fuck the DJ than some club slut.`],
@@ -169,9 +165,6 @@ App.EndWeek.clubReport = function() {
 
 	if (slaves.length > 0) {
 		for (const slave of App.SlaveAssignment.reportSlaves(slaves)) {
-			if (V.legendaryEntertainerID === 0 && slave.prestige === 0 && slave.skill.entertainment >= 100 && slave.devotion > 50) {
-				V.legendaryEntertainerID = slave.ID;
-			}
 			if (V.legendaryWombID === 0 && !isAmputee(slave) && slave.preg > slave.pregData.normalBirth / 1.33 && slave.broodmother === 0 && slave.eggType === "human" && slave.counter.births > 10 && slave.devotion > 50 && slave.prestige === 0) {
 				V.legendaryWombID = slave.ID;
 			}
diff --git a/src/events/RE/reLegendaryEntertainer.js b/src/events/RE/reLegendaryEntertainer.js
new file mode 100644
index 00000000000..d7ebbae206d
--- /dev/null
+++ b/src/events/RE/reLegendaryEntertainer.js
@@ -0,0 +1,106 @@
+App.Events.RELegendaryEntertainer = class RELegendaryEntertainer extends App.Events.BaseEvent {
+	actorPrerequisites() {
+		return [[
+			(s) => s.devotion > 50,
+			(s) => s.trust > 50,
+			(s) => s.prestige === 0,
+			(s) => s.skill.entertainment >= 100,
+			(s) => [Job.CLUB, Job.DJ].includes(s.assignment)
+		]];
+	}
+
+	execute(node) {
+		V.nextButton = "Continue";
+		V.nextLink = "RIE Eligibility Check";
+		const slave = getSlave(this.actors[0]);
+		let r = [];
+
+		const {
+			His,
+			he, his, him
+		} = getPronouns(slave);
+
+		App.Events.drawEventArt(node, slave);
+
+		slave.devotion += 4;
+
+		r.push(
+			`The Free Cities fashion scene extends to slave bodies, of course; stopping at mere clothes and behaviors is an old world conceit. This week,`,
+			App.UI.DOM.slaveDescriptionDialog(slave),
+			`is in vogue. Such a crowd of gawkers and hangers-on follows ${him} around the club that the fine citizens who have a chance at an hour of ${his} time must shoulder their way through the throng.`
+		);
+
+		App.Events.addParagraph(node, r);
+		r = [];
+
+		r.push(`This is a rare opportunity. Such popularity and fame is here today, and gone tomorrow. It might be possible, with a serious investment of funds in publicity, to really fix ${him} in the public mind as a courtesan of note. There's no guarantee of success, but if you are successful, ${his} value will increase a great deal.`);
+
+		App.Events.addParagraph(node, r);
+
+		const cashSmall = 5000;
+		const cashBig = 10000;
+		const choices = [];
+		choices.push(new App.Events.Result(`Just capitalize on ${his} popularity as it is`, asIs));
+		if (V.cash > cashSmall) {
+			choices.push(new App.Events.Result(`Invest ${cashFormat(cashSmall)} in ${his} notoriety`, investSmall));
+			if (V.cash > cashBig) {
+				choices.push(new App.Events.Result(`Lavish ${cashFormat(cashBig)} on ${his} fame`, investBig));
+			} else {
+				choices.push(new App.Events.Result(null, null, `Not enough cash to lavishly invest`));
+			}
+		} else {
+			choices.push(new App.Events.Result(null, null, `Not enough cash to invest`));
+		}
+
+		App.Events.addResponses(node, choices);
+
+		function asIs() {
+			const frag = new DocumentFragment();
+			let r = [];
+			r.push(`You decide to limit your advantage on ${his} temporary popularity to a little publicity and some advertising. You've gained a little <span class="green">notoriety.</span>`);
+			repX(1000, "event", slave);
+			App.Events.addParagraph(frag, r);
+			return frag;
+		}
+
+		function investSmall() {
+			const frag = new DocumentFragment();
+			let r = [];
+			cashX(-cashSmall, "event", slave);
+			repX(1000, "event", slave);
+			if (random(1, 100) > 50) {
+				r.push(`You buy media coverage of ${him}, invest in an ad campaign, and even arrange for persons of influence and taste to sample and review ${his} gentle caresses. Your efforts are a success. ${His} current extreme popularity will fade in time, but you have managed to arrange for ${him} a permanent place as a <span class="prestigious">respected and famous courtesan.</span> As ${his} owner, your reputation has <span class="reputation inc">also increased.</span>`);
+				if (slave.prestige <= 1) {
+					slave.prestige = 1;
+					slave.prestigeDesc = "$He is a famed Free Cities slut, and can please anyone.";
+				}
+				V.trinkets.push(`a framed article written about ${slave.slaveName} when ${he} debuted as a famous courtesan`);
+			} else {
+				r.push(`You buy media coverage of ${him}, invest in an ad campaign, and even arrange for persons of influence and taste to sample and review ${his} gentle caresses. Unfortunately, popularity remains an art, not a science; though you do your best, the public mind's fancy eludes your grasp. As ${his} owner, your reputation has <span class="green">increased,</span> but in a week ${he}'ll be forgotten.`);
+			}
+
+			App.Events.addParagraph(frag, r);
+			return frag;
+		}
+
+		function investBig() {
+			const frag = new DocumentFragment();
+			let r = [];
+			cashX(-cashBig, "event", slave);
+			if (random(1, 100) > 10) {
+				r.push(`You buy prime media coverage of ${him}, invest in a lavish ad campaign, and even arrange for persons of great influence and fine taste to sample and review ${his} gentle caresses. Your efforts are a success. ${His} current extreme popularity will fade in time, but you have managed to arrange for ${him} a permanent place as a <span class="green">respected and famous courtesan.</span> As ${his} owner, your reputation has <span class="reputation inc">also increased.</span>`);
+				repX(2000, "event", slave);
+				if (slave.prestige <= 1) {
+					slave.prestige = 1;
+					slave.prestigeDesc = "$He is a famed Free Cities slut, and can please anyone.";
+				}
+				V.trinkets.push(`a framed article written about ${slave.slaveName} when ${he} debuted as a famous courtesan`);
+			} else {
+				r.push(`You buy prime media coverage of ${him}, invest in a lavish ad campaign, and even arrange for persons of great influence and fine taste to sample and review ${his} gentle caresses. Unfortunately, popularity remains an art, not a science; though you do your best, the public mind's fancy eludes your grasp. As ${his} owner, your reputation has <span class="reputation">increased,</span> but in a week ${he}'ll be forgotten.`);
+				repX(2000, "event", slave);
+			}
+			App.Events.addParagraph(frag, r);
+			return frag;
+		}
+	}
+};
diff --git a/src/js/eventSelectionJS.js b/src/js/eventSelectionJS.js
index 06c98cca5b3..057130cdc7e 100644
--- a/src/js/eventSelectionJS.js
+++ b/src/js/eventSelectionJS.js
@@ -1087,12 +1087,6 @@ if(eventSlave.drugs === "breast injections") {
 		if (eventSlave.prestige === 0 && eventSlave.assignment !== Job.QUARTER) {
 			if (eventSlave.devotion > 50) {
 				if (eventSlave.trust > 50) {
-					if (eventSlave.skill.entertainment >= 100) {
-						if (eventSlave.assignment === Job.PUBLIC) {
-							V.events.push("RE legendary entertainer");
-						}
-					}
-
 					if (eventSlave.bellyPreg >= 14000) {
 						if (eventSlave.broodmother === 0) {
 							if (eventSlave.counter.births > 10) {
diff --git a/src/uncategorized/randomNonindividualEvent.tw b/src/uncategorized/randomNonindividualEvent.tw
index 0a006f4acbd..504f3ec3690 100644
--- a/src/uncategorized/randomNonindividualEvent.tw
+++ b/src/uncategorized/randomNonindividualEvent.tw
@@ -30,9 +30,6 @@
 	<</if>>
 
 	<<set $legendaryFacility = 1>>
-	<<if $legendaryEntertainerID != 0>>
-		<<set $events.push("RE legendary entertainer")>>
-	<</if>>
 	<<if $legendaryWombID != 0>>
 		<<set $events.push("RE legendary womb")>>
 	<</if>>
diff --git a/src/uncategorized/reLegendaryEntertainer.tw b/src/uncategorized/reLegendaryEntertainer.tw
deleted file mode 100644
index 7e3c672f60c..00000000000
--- a/src/uncategorized/reLegendaryEntertainer.tw
+++ /dev/null
@@ -1,84 +0,0 @@
-:: RE legendary entertainer [nobr]
-
-<<set $nextButton = "Continue", $nextLink = "AS Dump", $returnTo = "RIE Eligibility Check", $activeSlave = ($legendaryFacility == 1) ? getSlave($legendaryEntertainerID) : $eventSlave>>
-
-<<if (ndef $activeSlave)>> /* not found — reset variable and stop event */
-	<<set $legendaryEntertainerID = 0>>
-	<<goto "RIE Eligibility Check">>
-<<else>>
-
-<<run App.Utils.setLocalPronouns($activeSlave)>>
-<<set $activeSlave.devotion += 4>>
-
-<span id="art-frame">
-/* 000-250-006 */
-<<if $seeImages == 1>>
-	<<if $imageChoice == 1>>
-		<div class="imageRef lrgVector"><div class="mask">&nbsp;</div><<SlaveArt $activeSlave 3 0>></div>
-	<<else>>
-		<div class="imageRef lrgRender"><div class="mask">&nbsp;</div><<SlaveArt $activeSlave 3 0>></div>
-	<</if>>
-<</if>>
-/* 000-250-006 */
-</span>
-
-The Free Cities fashion scene extends to slave bodies, of course; stopping at mere clothes and behaviors is an old world conceit. This week, <<= App.UI.slaveDescriptionDialog($activeSlave)>> is in vogue. Such a crowd of gawkers and hangers-on follows $him around the club that the fine citizens who have a chance at an hour of $his time must shoulder their way through the throng.
-
-<br><br>
-
-This is a rare opportunity. Such popularity and fame is here today, and gone tomorrow. It might be possible, with a serious investment of funds in publicity, to really fix $him in the public mind as a courtesan of note. There's no guarantee of success, but if you are successful, $his value will increase a great deal.
-
-<br><br>
-
-<span id="result">
-<<link "Just capitalize on $his popularity as it is">>
-	<<replace "#result">>
-	You decide to limit your advantage on $his temporary popularity to a little publicity and some advertising. You've gained a little @@.green;notoriety.@@
-	<<run repX(1000, "event", $activeSlave)>>
-	<</replace>>
-<</link>>
-<br><<link "Invest <<print cashFormat(5000)>> in $his image">>
-	<<if random(1,100) > 50>>
-		<<replace "#result">>
-		You buy media coverage of $him, invest in an ad campaign, and even arrange for persons of influence and taste to sample and review $his gentle caresses. Your efforts are a success. $His current extreme popularity will fade in time, but you have managed to arrange for $him a permanent place as a @@.green;respected and famous courtesan.@@ As $his owner, your reputation has @@.green;also increased.@@
-		<<run cashX(-5000, "event", $activeSlave)>>
-		<<run repX(1000, "event", $activeSlave)>>
-		<<if $activeSlave.prestige <= 1>>
-			<<set $activeSlave.prestige = 1>>
-			<<set $activeSlave.prestigeDesc = "$He is a famed Free Cities slut, and can please anyone.">>
-		<</if>>
-		<<set $desc = "a framed article written about " + $activeSlave.slaveName + " when " + getPronouns($activeSlave).pronoun + " debuted as a famous courtesan">>
-		<<set $trinkets.push($desc)>>
-		<</replace>>
-	<<else>>
-		<<replace "#result">>
-		You buy media coverage of $him, invest in an ad campaign, and even arrange for persons of influence and taste to sample and review $his gentle caresses. Unfortunately, popularity remains an art, not a science; though you do your best, the public mind's fancy eludes your grasp. As $his owner, your reputation has @@.green;increased,@@ but in a week $he'll be forgotten.
-		<<run cashX(-5000, "event", $activeSlave)>>
-		<<run repX(1000, "event", $activeSlave)>>
-		<</replace>>
-	<</if>>
-<</link>>
-<br><<link "Lavish <<print cashFormat(10000)>> on $his fame">>
-	<<if random(1,100) > 10>>
-		<<replace "#result">>
-		You buy prime media coverage of $him, invest in a lavish ad campaign, and even arrange for persons of great influence and fine taste to sample and review $his gentle caresses. Your efforts are a success. $His current extreme popularity will fade in time, but you have managed to arrange for $him a permanent place as a @@.green;respected and famous courtesan.@@ As $his owner, your reputation has @@.green;also increased.@@
-		<<run cashX(-10000, "event", $activeSlave)>>
-		<<run repX(2000, "event", $activeSlave)>>
-		<<if $activeSlave.prestige <= 1>>
-			<<set $activeSlave.prestige = 1>>
-			<<set $activeSlave.prestigeDesc = "$He is a famed Free Cities slut, and can please anyone.">>
-		<</if>>
-		<<set $desc = "a framed article written about " + $activeSlave.slaveName + " when " + getPronouns($activeSlave).pronoun + " debuted as a famous courtesan">>
-		<<set $trinkets.push($desc)>>
-		<</replace>>
-	<<else>>
-		<<replace "#result">>
-		You buy prime media coverage of $him, invest in a lavish ad campaign, and even arrange for persons of great influence and fine taste to sample and review $his gentle caresses. Unfortunately, popularity remains an art, not a science; though you do your best, the public mind's fancy eludes your grasp. As $his owner, your reputation has @@.green;increased,@@ but in a week $he'll be forgotten.
-		<<run cashX(-10000, "event", $activeSlave)>>
-		<<run repX(2000, "event", $activeSlave)>>
-		<</replace>>
-	<</if>>
-<</link>>
-</span>
-
-<</if>> /* closes validity check */
-- 
GitLab