From 2846651c11fe023eb57a6ca2c77c9bfbf9efa968 Mon Sep 17 00:00:00 2001
From: Pregmodder <pregmodder@gmail.com>
Date: Mon, 24 Apr 2023 01:48:51 -0400
Subject: [PATCH] Add torture personal attention

---
 CHANGELOG.md                             |   3 +
 src/endWeek/reports/personalAttention.js | 123 +++++++++++++++++------
 src/interaction/main/walkPast.js         |   2 +
 src/js/main.js                           |   2 +-
 src/js/personalAttentionFunctions.js     |   2 +-
 src/js/statsChecker/statsChecker.js      |   2 +
 src/player/personalAttentionSelect.js    |  10 +-
 7 files changed, 102 insertions(+), 42 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index ee381d15942..17a28aa6656 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -6,6 +6,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
 
 ## Unreleased
 
+* refsArtifact events
+* fixes
+
 ## 0.10.7.1-4.0.0-alpha.25 - 2023-03-12
 
 * fixes
diff --git a/src/endWeek/reports/personalAttention.js b/src/endWeek/reports/personalAttention.js
index 0d5a0458243..1bc9b84e483 100644
--- a/src/endWeek/reports/personalAttention.js
+++ b/src/endWeek/reports/personalAttention.js
@@ -77,10 +77,20 @@ App.PersonalAttention.slaveReport = function(slave) {
 	let oldSkill;
 	const hindranceMod = isHinderedDegree(V.PC);
 	const nymphoMod = isHorny(V.PC) ? .75 : 1;
+	let officeSlaves;
 	if (pa.objective === "health") {
 		r.push(App.UI.DOM.makeElement("span", `You care for`, ["bold"]));
 	} else if (pa.objective === "spar") {
 		r.push(App.UI.DOM.makeElement("span", `You train with`, ["bold"]));
+	} else if (pa.objective === "torture") {
+		if (isAmputee(slave)) {
+			r.push(`You strap down and`);
+		} else if (hasBothArms(slave)) {
+			r.push(`You chain up and`);
+		} else {
+			r.push(`You tightly bind and`);
+		}
+		r.push(App.UI.DOM.makeElement("span", `brutally torment`, ["bold"]));
 	} else {
 		r.push(App.UI.DOM.makeElement("span", `You train`, ["bold"]));
 	}
@@ -1571,45 +1581,83 @@ App.PersonalAttention.slaveReport = function(slave) {
 			slave.training = 0;
 			break;
 		case "torture":
+			officeSlaves = V.slaves.filter(s => s.assignment === Job.FUCKTOY && s.fetish !== "mindbroken" && slave.ID !== s.ID);
 			// Effectively sacrifices a slave's health to terrify your penthouse slaves. Does not affect deaf slaves. Mute slaves give no benefit.
-			if (slave.sexualFlaw === "self hating") {
-				// slave enjoys it and encourages it, unnerving your penthouse (ph dev-, slave dev+)
-			} else if (slave.fetish === Fetish.MINDBROKEN) {
-				if (nymphoMod < 1) {
-					// violently rape her reactionless body, doesn't disturb penthouse, but does disturb fucktoys that watch the event
-				} else {
-					// pointless, kicks slave from PA
-				}
+			r.push(`When you have pent up energy, you beat ${him}. When you're bored, you lash ${him}. If you even see ${him} passing out from exhaustion or pain, you shock ${him} back awake. If ${he} isn't moaning in dispair, that's all the reason you need to make ${him} bleed.`);
+			if (V.PC.energy > 20) {
+				r.push(`As an added insult, you opt to violently rape ${him} throughout the day; some by surprise, others drawn out so the fear of what's to come can supplement ${his} anguish.`);
+			}
+			r.push(`You spare ${him} no amount of`);
+			r.push(App.UI.DOM.makeElement("span", `suffering;`, "mediumorchid"));
+			r.push(`every second spent in your presence is one spent`);
+			r.push(App.UI.DOM.makeElement("span", `dreading`, "gold"));
+			r.push(`your next assault.`);
+			if (slave.fetish === Fetish.MINDBROKEN) {
+				r.push(`It's good stress release, but since ${he} shows no reaction to it, you quickly get bored.`);
+				if (slave.kindness) {
+					slave.kindness = 0;
+				}
+				if (officeSlaves.length > 0) {
+					r.push(`At least it`);
+					r.push(App.UI.DOM.makeElement("span", `frightens`, "gold"));
+					r.push(`any other slaves present.`);
+					adjustOfficeValues(officeSlaves, -5);
+				}
+			} else if (!canTalk(slave)) {
+				r.push(`It's good stress release, but since ${he} is mute and can't cry out in agony, it only really serves to lower ${his} resale value.`);
+				if (officeSlaves.length > 0) {
+					r.push(`At least those present to witness it know what`);
+					r.push(App.UI.DOM.makeElement("span", `horror`, "gold"));
+					r.push(`you can inflict on them.`);
+					adjustOfficeValues(officeSlaves, -10);
+				}
+			} else if (slave.sexualFlaw === "self hating") {
+				r.push(`The way ${he}`);
+				r.push(App.UI.DOM.makeElement("span", `enjoys and encourages it`, ["hotpink"]));
+				r.push(`is uncanny and`);
+				r.push(App.UI.DOM.makeElement("span", `unsettles slaves within earshot`, "mediumorchid"));
+				r.push(`more than`);
+				r.push(App.UI.DOM.makeElement("span", `frightens them.`, "gold"));
+				adjustPenthouseValues(-3, -10);
+				slave.devotion += 5;
+				slave.trust -= 1;
 			} else if (slave.fetish === Fetish.MASOCHIST) {
-				// slave enjoys it, penthouse ignores it as sexual play
+				r.push(`Unfortunately, ${he} gets off on it a bit too much, so the only thing echoing through the penthouse halls are`);
+				r.push(App.UI.DOM.makeElement("span", `screams of pleasure,`, ["hotpink"]));
+				r.push(`and that isn't exactly out of the ordinary.`);
+				slave.devotion += 3;
+				slave.trust -= 5;
 			} else if (slave.devotion + slave.trust > 195) {
-			} else if (slave.devotion + slave.trust < -195) {
-			} else if (slave.devotion > 50) {
-				if (slave.trust > 20) {
-				} else {
-				}
-			} else if (slave.devotion > 20) {
-				if (slave.trust > 20) {
-				} else {
-				}
-			} else if (slave.trust > 20) {
-			} else if (slave.devotion >= -50) {
+				r.push(`The baleful cries of a ${girl} betrayed reveberate throughout your penthouse`);
+				r.push(App.UI.DOM.makeElement("span", `utterly terrifying`, "gold"));
+				r.push(`those within earshot of what it means to deeply trust you.`);
+				adjustPenthouseValues(-15);
 			} else {
+				r.push(`Agonizing cries ring out through the penthouse halls at all hours of the day, keeping the slaves able to hear them`);
+				r.push(App.UI.DOM.makeElement("span", `perpetually on edge`, "gold"));
+				r.push(`around you.`);
+				adjustPenthouseValues(-10);
+			}
+			if (slave.fetish !== Fetish.MINDBROKEN && slave.fetish !== Fetish.MASOCHIST) {
+				slave.trust -= 30;
+				slave.devotion -= 30;
+			}
+			healthDamage(slave, 50);
+			slave.minorInjury = either("black eye", "bruise", "split lip");
+			r.push(`${He} ends ${his} week thoroughly`);
+			r.push(App.UI.DOM.makeElement("span", `beaten`, ["health", "dec"]));
+			r.push(`and`);
+			r.push(App.UI.DOM.makeElement("span", `exhausted.`, "red"));
+			if (slave.health.tired < 120) {
+				slave.health.tired = 120;
 			}
-			if (slave.fetish !== Fetish.MINDBROKEN || nymphoMod < 1) {
-				if (!canTalk(slave)) {
-				} else if (slave.fetish === Fetish.MINDBROKEN) {
-				}
-				if (slave.pregKnown === 1) {
-				}
-				if (slave.bellyFluid >= 500) {
-				}
-				if (slave.devotion + slave.trust < -195 || slave.devotion + trust > 195) {
-					// mindbreaks
-				} else {
-				}
-			} else {
+			if (slave.pregKnown === 1) {
+				r.push(`You took care to not harm ${his} pregnancy, but ${he} doesn't need to know that. If you really wanted to abort it in such a manner, you'd make more a show of it to ${him}.`);
+			}
+			if (slave.devotion + slave.trust < -195 || slave.devotion + slave.trust > 195) {
+				// considering MB here. Will need to circle back after reviewing how excess dev/trust is handled.
 			}
+			// add slave death here
 			break;
 		case "fix behavioral flaw":
 			if (slave.behavioralFlaw === "arrogant") {
@@ -2633,4 +2681,13 @@ App.PersonalAttention.slaveReport = function(slave) {
 		slave.training = 0;
 		return el;
 	}
+
+	function adjustPenthouseValues(fear = 0, hate = 0) {
+		// I wouldn't mind halving it for hard of hearing slaves, but do not want to deal with complicating this.
+		V.slaves.forEach(s => { if (assignmentVisible(s) && canHear(s) && V.personalAttention.slaves.find((x) => s.ID !== x.ID || x.objective !== "torture")) { s.trust += fear; s.devotion += hate; } });
+	}
+
+	function adjustOfficeValues(officeSlaves, fear = 0, hate = 0) {
+		officeSlaves.forEach(s => { if (canSee(s)) { s.trust += fear; s.devotion += hate; } });
+	}
 };
diff --git a/src/interaction/main/walkPast.js b/src/interaction/main/walkPast.js
index 9898e16458f..be96ecaa4fa 100644
--- a/src/interaction/main/walkPast.js
+++ b/src/interaction/main/walkPast.js
@@ -233,6 +233,8 @@ globalThis.walkPast = (function() {
 					t += `having some casual fun with each other in the penthouse of ${arc.name}. ${V.assistant.name} has helpfully put a live feed of their activities up on one of the large screens in your office.`;
 				} else if (partnerSlave.assignment === Job.ARCADE) {
 					t += `trying their best to maintain their relationship with ${partnerName} being nothing more than a hole in ${V.arcadeName}.`;
+				} else {
+					t += `trying their best to maintain any sort of relationship as you beat the life out of ${partnerName}.`;
 				}
 			} else if (seed >= 66) { /* SEXY TIMES */
 				let fuckSpot = "";
diff --git a/src/js/main.js b/src/js/main.js
index e577fee479c..ed81054cae0 100644
--- a/src/js/main.js
+++ b/src/js/main.js
@@ -261,7 +261,7 @@ App.MainView.full = function() {
 		const outerDiv = document.createElement("div");
 		outerDiv.id = "walkpast";
 
-		const slave = V.slaves.filter(s => ![Job.BODYGUARD, Job.FUCKTOY].includes(s.assignment)).random();
+		const slave = V.slaves.filter(s => ![Job.BODYGUARD, Job.FUCKTOY].includes(s.assignment) && V.personalAttention.slaves.find((x) => s.ID !== x.ID || x.objective !== "torture")).random();
 		if (slave) {
 			App.UI.DOM.appendNewElement("span", outerDiv, globalThis.walkPast(slave), "scene-intro");
 		}
diff --git a/src/js/personalAttentionFunctions.js b/src/js/personalAttentionFunctions.js
index 2ad338d07bb..06a2beb0340 100644
--- a/src/js/personalAttentionFunctions.js
+++ b/src/js/personalAttentionFunctions.js
@@ -82,7 +82,7 @@ App.PersonalAttention.getText = function(objective, slave) {
 		case "learn skills":
 			return `teach ${him}`;
 		case "combat training":
-			return `train ${him} in combat`;
+			return `teach ${him} combat`;
 		case "spar":
 			return `spar with ${him}`;
 		case "explore sexuality":
diff --git a/src/js/statsChecker/statsChecker.js b/src/js/statsChecker/statsChecker.js
index c37ed827c9d..c4aa8fb0661 100644
--- a/src/js/statsChecker/statsChecker.js
+++ b/src/js/statsChecker/statsChecker.js
@@ -24,6 +24,8 @@ globalThis.isSlaveAvailable = function(slave) {
 		return false;
 	} else if (slave.assignment === Job.DAIRY && V.dairyRestraintsSetting >= 2) {
 		return false;
+	} else if (V.personalAttention.slaves.find((s) => s.ID === slave.ID && s.objective === "torture")) {
+		return false;
 	}
 	return true;
 };
diff --git a/src/player/personalAttentionSelect.js b/src/player/personalAttentionSelect.js
index 57e5b4694cc..b69c65a307c 100644
--- a/src/player/personalAttentionSelect.js
+++ b/src/player/personalAttentionSelect.js
@@ -647,6 +647,9 @@ App.UI.Player.personalAttention = function() {
 					healthText(slave),
 				]);
 				links.push(attentionLink(i, `Care for ${him}`, "health"));
+				if (V.arcologies[0].FSPaternalist === "unset") {
+					links.push(attentionLink(i, `Make ${him} suffer`, "torture"));
+				}
 
 				// Behavioral Flaws
 				if (slave.behavioralFlaw !== "none") {
@@ -889,13 +892,6 @@ App.UI.Player.personalAttention = function() {
 				} else {
 					App.UI.DOM.appendNewElement("div", div, `Paraphilias can be induced from a strong fetish.`, ['note', 'margin-left']);
 				}
-
-				// sadism
-				/*
-				if (V.arcologies[0].FSPaternalist === "unset") {
-					links.push(attentionLink(i, `Make ${him} suffer`, "torture"));
-				}
-				*/
 			}
 		}
 
-- 
GitLab