From 3ed4567792406ca5e46a3cd5ea735bc3ae27786a Mon Sep 17 00:00:00 2001
From: Arkerthan <arkerthan@gmail.com>
Date: Tue, 23 Apr 2019 00:51:03 +0200
Subject: [PATCH] fixes

---
 src/interaction/prostheticConfig.tw     |  5 +-
 src/uncategorized/buildingWidgets.tw    |  2 +-
 src/uncategorized/surgeryDegradation.tw | 90 +++++++++++++++++++++++++
 3 files changed, 95 insertions(+), 2 deletions(-)

diff --git a/src/interaction/prostheticConfig.tw b/src/interaction/prostheticConfig.tw
index 6c13e9d0938..4ecb8e9b0e8 100644
--- a/src/interaction/prostheticConfig.tw
+++ b/src/interaction/prostheticConfig.tw
@@ -146,7 +146,6 @@ This room is lined with shelves and cabinets, it could be easily mistaken for a
 	<</if>>
 <</if>>
 
-
 <<if $activeSlave.readyProsthetics.length > 0>>
 	<br><br>
 	<<if $activeSlave.fuckdoll != 0>>
@@ -166,6 +165,10 @@ This room is lined with shelves and cabinets, it could be easily mistaken for a
 			<<case -5>> <<= addA(setup.prosthetics.cyberneticL.name)>>
 			<</switch>>
 			installed.//<br>
+			<<link "Detach <<= $his>> limbs" "Prosthetics Config">>
+				<<set $activeSlave.amp = 0, $prostheticsConfig = "removeLimbs">>
+			<</link>>
+			<br><br>
 		<</if>>
 		/*TODO save .legsTat and .armsTat / link them to prosthetic*/
 		<<if $activeSlave.amp != -1 && $activeSlave.readyProsthetics.findIndex(function(p) {return p.id == "basicL"}) != -1>>
diff --git a/src/uncategorized/buildingWidgets.tw b/src/uncategorized/buildingWidgets.tw
index 1dcb4df1235..384355f5569 100644
--- a/src/uncategorized/buildingWidgets.tw
+++ b/src/uncategorized/buildingWidgets.tw
@@ -149,7 +149,7 @@ if(!Macro.has('sectorblock')) {
 				<<if $schoolroom>> <<print SchoolRoomUIName()>> ($schoolroomSlaves/$schoolroom<<if $Schoolteacher>>, L<</if>>)<</if>>
 				<<if $cellblock>> <<print CellblockUIName()>> ($cellblockSlaves/$cellblock<<if $Wardeness>>, L<</if>>)<</if>>
 				<<if $incubator>> <<print IncubatorUIName()>> (<<if $incubator-$incubatorSlaves == 0>>No empty tanks<<elseif $incubator-$incubatorSlaves == 1>>1 empty tank<<else>><<print $incubator-$incubatorSlaves>> empty tanks<</if>>)<</if>>
-				<<if $researchLab.level > 0>>[[Research Lab]]<</if>>
+				<<if $researchLab.level > 0>>[[Prosthetic Lab]]<</if>>
 			<</if>>
 		</td>
 		<td colspan="3"></td>
diff --git a/src/uncategorized/surgeryDegradation.tw b/src/uncategorized/surgeryDegradation.tw
index 938ed4e7b98..4b0c0fc2b4a 100644
--- a/src/uncategorized/surgeryDegradation.tw
+++ b/src/uncategorized/surgeryDegradation.tw
@@ -1942,6 +1942,96 @@ As the remote surgery's long recovery cycle completes,
 		<</if>>
 	<</if>>
 
+/* This was moved to prostheticsConfig.tw
+<<case "basicPLimbs">>
+	$He exits the surgery hesitantly, the software of $his prosthetic limbs and the wetware of $his brain working together to figure out how to walk together under the tutelage of a prescribed tutorial. Recovery will be @@.red;significant,@@ since the surgical implantation of anchor points for the limbs themselves and the installation of nerve impulse detectors constituted major surgery.
+	<<if $activeSlave.fetish != "mindbroken" && $activeSlave.fuckdoll == 0>>
+		<<if $activeSlave.devotion > 20>>
+			Nevertheless, $he's @@.hotpink;overwhelmed with gratitude,@@ and thanks you profusely the first chance $he gets. $He follows the acclimation program diligently, doing $his best to learn how to be a good slave despite, or sometimes even because of, $his artificial arms and legs. $He @@.mediumaquamarine;places more trust in you,@@ too, since you obviously have $his best interests at heart.
+			<<set $activeSlave.devotion += 5, $activeSlave.trust += 5>>
+		<<elseif $activeSlave.devotion >= -20>>
+			$He's @@.hotpink;overwhelmed with gratitude,@@ in part because $he didn't think you'd do something like this for $him. $He thanks you profusely the first chance $he gets, and follows the acclimation program diligently, trying to deserve the expense you went to. $He @@.mediumaquamarine;places more trust in you,@@ too, since you seem to have a plan for $him.
+			<<set $activeSlave.devotion += 5, $activeSlave.trust += 5>>
+		<<else>>
+			Despite $his hatred of you, $he can't help but @@.mediumaquamarine;trust you a bit more,@@ since you clearly have a plan that involves putting a good deal of value into $him. Your goals might not be $hers, but at least $he has an indication that you're not toying with $him.
+			<<set $activeSlave.trust += 5>>
+		<</if>>
+	<</if>>
+
+<<case "sexPLimbs">>
+	$His Limb upgrades took place in the surgery, since its manipulators are well suited to delicate work on circuitry and ceramics as well as on flesh. $He exits the surgery experimenting with $his new arms and legs.
+	<<if $activeSlave.fetish != "mindbroken" && $activeSlave.fuckdoll == 0>>
+		<<if $activeSlave.devotion <= 20>>
+			$He rapidly discovers that $his fingertips are now vibrators, and then makes a mess when $he figures out that $his hands can dispense lube without figuring out how to make them stop dispensing lube. $He's frustrated and @@.gold;frightened,@@ realizing that even $his prosthetics are now customized to suit $his purpose as a human sex toy. $He knew $he was a toy before, but somehow, being a literal vibrator is a bit much for $him.
+			<<set $activeSlave.trust -= 5>>
+		<<elseif $activeSlave.energy > 95>>
+			Since $he's a nympho, $he discovers $his new sexual functions in a hurry. They trigger in part is based on arousal, and $he's never not aroused, so they activate one by one as $he leaves the surgery. The vibration, lube, and other dirty functions surprise $him, and it takes $him a moment to realize what's going on, but $he begins to breathe hard when $he understands. $He runs off to try them out, and @@.hotpink;thanks you profusely,@@ if tiredly, the next time $he sees you.
+			<<set $activeSlave.devotion += 5>>
+		<<else>>
+			$He discovers $his sexy new functions one by one. The vibration, lube, and other dirty functions surprise $him, and it takes $him a moment to realize what's going on, but $he begins to shake with amusement when $he understands. $He heads off to try them out, and @@.hotpink;thanks you politely@@ the next time $he sees you.
+			<<set $activeSlave.devotion += 3>>
+		<</if>>
+	<</if>>
+
+<<case "beautyPLimbs">>
+	$His Limb upgrades took place in the surgery, since its manipulators are well suited to delicate work on circuitry and ceramics as well as on flesh. $He exits the surgery <<if canSee($activeSlave)>>marveling at the beautiful, natural appearance of $his new arms and legs<<else>>thanking you for $his new arms and legs, unaware of how natural they look<</if>>.
+	<<if $activeSlave.fetish != "mindbroken" && $activeSlave.fuckdoll == 0>>
+		<<if $activeSlave.devotion <= 20>>
+			$He's @@.mediumaquamarine;more willing to trust you@@ after this. If $he doubts that you have some sort of long term plan for $him, all $he has to do is <<if canSee($activeSlave)>>look down and examine<<else>>feel<</if>> $his elegant, natural prosthetics, which are often mistaken for the genuine article. Even $he makes the mistake at times as $he gets used to them.
+			<<set $activeSlave.trust += 5>>
+		<<elseif $activeSlave.skill.entertainment >= 100>>
+			Since $he's a masterful entertainer, $he knows multiple styles of dance, though $his straightforward modern prosthetics never allowed $him to be anything more than a mechanically competent dancer. $He finds that $he has far better balance now, in addition to looking more natural. Before long, $he goes //en pointe// and holds the position, before collapsing in a heap. It soon becomes apparent that this wasn't due to clumsiness: $he's sobbing so hard $he can barely breathe. $He @@.hotpink;thanks you profusely@@ the next time $he sees you, eyes still puffy with tears of joy.
+			<<set $activeSlave.devotion += 5>>
+		<<else>>
+			When $he first <<if canSee($activeSlave)>>catches sight of $himself in a mirror<<else>>runs a new finger over $his natural feeling skin<</if>>, $he begins to cry. Terribly complex emotions war across $his face: gratitude, joy, regret, and something undefinable. Blinking, $he uses newly elegant fingertips to trace the scarcely visible seams where $his artificial and natural skin meet. $He @@.hotpink;thanks you profusely@@ the next time $he sees you, eyes still puffy with tears.
+			<<set $activeSlave.devotion += 3>>
+		<</if>>
+	<</if>>
+
+<<case "combatPLimbs">>
+	$His Limb upgrades took place in the surgery, since its manipulators are well suited to delicate work on circuitry and ceramics as well as on flesh. $He exits the surgery wondering at the bulky <<if canSee($activeSlave)>>appearance<<else>>weight<</if>> of $his reinforced arms and legs.
+	<<if $activeSlave.fetish != "mindbroken" && $activeSlave.fuckdoll == 0>>
+		<<if $activeSlave.devotion <= 20>>
+			$He's @@.gold;frightened,@@ once $he discovers what $he can do, and what $he is. $His integral weapons are locked out by the arcology systems, for now, but $he quickly realizes what they are. $He is not, to say the least, thrilled by the revelation that $he is now a living weapon, and is kept awake by thoughts of what you might be planning for $him.
+			<<set $activeSlave.trust -= 5>>
+		<<elseif ($activeSlave.skill.combat == 1) && ($activeSlave.devotion > 75)>>
+			$He leaves the surgery with a purpose, $his footsteps a bit heavier than before. $He heads down to the armory's range, still naked, and when $he gets there, $he places $his dominant hand over $his thigh on that side. It folds open, revealing a handgun, which $he draws and empties into a <<if canSee($activeSlave)>>target<<else>>beeping target<</if>>; as $he fires the last rounds, $he uses $his off hand to reach down to that thigh, which folds open and reveals spare magazines. $He @@.hotpink;thanks you profusely@@ the next time $he sees you. $He knows that $his prosthetics are a wash, at best, in terms of actual combat effectiveness; they'll never match the reliability and dexterity of the genuine article. But $he thinks they are //cool.//
+			<<set $activeSlave.devotion += 5>>
+		<<else>>
+			$He has mixed feelings about what $he soon discovers. $He's a living weapon now, and has to live with the constant knowledge that $he can incapacitate or kill with nothing more than what's contained within $his arms and legs. $He's @@.hotpink;touched,@@ though, by the tremendous trust this shows. $He knows that the arcology would instantly lock out $his weapons if $he were to misbehave, but $he's still affected.
+			<<set $activeSlave.devotion += 3>>
+		<</if>>
+	<</if>>
+
+<<case "cyberPLimbs">>
+	$His Limb upgrades were performed in the surgery, since its manipulators are well suited to delicate work on their circuitry as well as on flesh. $He exits the surgery marveling <<if canSee($activeSlave)>>at the shiny artificial skin of $his new arms and legs<<else>>at the feel of the artificial skin of $his new arms and legs under $his new fingers<</if>>.
+	<<if $activeSlave.fetish != "mindbroken" && $activeSlave.fuckdoll == 0>>
+		<<if $activeSlave.devotion <= 20>>
+			$He's @@.gold;frightened,@@ once $he discovers what $he can do, and what $he is. $His cybernetic limbs are restricted by the arcology systems, for now, but $he quickly realizes what they are. $He is not, to say the least, thrilled by the revelation that $he is now a living weapon, and is kept awake by thoughts of what you might be planning for $him.
+			<<set $activeSlave.trust -= 5>>
+		<<elseif ($activeSlave.skill.combat == 1) && ($activeSlave.devotion > 75)>>
+			$He leaves the surgery with a purpose, $his footsteps a bit heavier than before. $He heads down to the armory's range, still naked, and when $he gets there, $he places $his dominant hand over $his thigh on that side. It folds open, revealing a handgun, which $he draws and empties into a <<if canSee($activeSlave)>>target<<else>>beeping target<</if>>; as $he fires the last rounds, $he uses $his off hand to reach down to that thigh, which folds open and reveals spare magazines. $He @@.hotpink;thanks you profusely@@ the next time $he sees you. $He knows that $his prosthetics will enhance $his combat effectiveness and $he thinks they are //cool.//
+			<<set $activeSlave.devotion += 5>>
+		<<else>>
+			$He has mixed feelings about what $he soon discovers. $He's a living weapon now, and has to live with the constant knowledge that $he can incapacitate or kill with nothing more than $his arms and legs themselves. $He's @@.hotpink;touched,@@ though, by the tremendous trust this shows. $He knows that the arcology would instantly lock out $his limbs if $he were to misbehave, but $he's still affected.
+			<<set $activeSlave.devotion += 3>>
+		<</if>>
+	<</if>>
+
+<<case "removeLimbs">>
+	<<if $activeSlave.fetish == "mindbroken">>
+		Of course, $he could not walk out of the surgery; you carried $him. $He squirms the entire time trying to move the arms and legs that $he used to have. As with all surgery @@.red;$his health has been slightly affected.@@
+	<<elseif ($activeSlave.devotion > 50)>>
+		Of course, $he could not walk out of the surgery; you carried $him. $He knows what a slave's life is, but $he did not really expect $his artificial limbs would be removed again so suddenly. After a long, silent <<if canSee($activeSlave)>>stare at<<else>>consideration of<</if>> $his limbless torso, $he squares $his shoulders and visibly resolves to carry on being a good slave as best $he can. As $he was already amputated, there was no lasting effect. As with all surgery @@.red;$his health has been slightly affected.@@
+	<<elseif ($activeSlave.devotion > 20)>>
+		Of course, $he could not walk out of the surgery; you carried $him. Despite $his obedience, $he cries softly the whole time, shoulder and hip stumps moving occasionally as $he reflexively tries to stand — to walk — to touch $himself — to gesture — all things that $he had to learn to do again. Your removal of $his prosthetic limbs has caused @@.mediumorchid;$his devotion to drop@@ and @@.gold;$his trust to drop.@@ As with all surgery @@.red;$his health has been slightly affected.@@
+		<<set $activeSlave.trust -= 5, $activeSlave.devotion -= 5>>
+	<<else>>
+		Of course, $he could not walk out of the surgery; you carried $him. It seems that $his mistrust of you was well founded and this removal of $his artificial limbs has caused @@.mediumorchid;$his devotion to drop@@ and @@.gold;$his trust to drop.@@ As with all surgery @@.red;$his health has been slightly affected.@@
+		<<set $activeSlave.trust -= 5, $activeSlave.devotion -= 5>>
+	<</if>>
+*/
+
 <<case "ster">>
 	<<if $activeSlave.fetish == "mindbroken">>
 		$He leaves the surgery with nothing but a nonspecific ache in $his lower abdomen, but lacks the mental faculties to know that $he'll never have a child now. As with all surgery @@.red;$his health has been slightly affected.@@
-- 
GitLab