From 6fb851f5f1ac3e16d2942d88cbf6fe13d3c35f19 Mon Sep 17 00:00:00 2001
From: Svornost <11434-svornost@users.noreply.gitgud.io>
Date: Thu, 13 Feb 2020 10:56:27 -0800
Subject: [PATCH] Use unblind only for totally blind slaves; a slave with sight
 in one eye will still use newEye.  Prevents double dev/trust gain.

---
 src/npc/surgery/organs.js | 24 ++++++++++++++++++++----
 1 file changed, 20 insertions(+), 4 deletions(-)

diff --git a/src/npc/surgery/organs.js b/src/npc/surgery/organs.js
index 3e0b26555e1..4fa95eee6bb 100644
--- a/src/npc/surgery/organs.js
+++ b/src/npc/surgery/organs.js
@@ -201,10 +201,18 @@ App.Medicine.OrganFarm.init = function() {
 	new App.Medicine.OrganFarm.Organ({
 		type: "leftEye", name: "Left Eye", cost: 5000, time: 10,
 		actions: [
+			new App.Medicine.OrganFarm.OrganImplantAction({
+				name: "Implant", healthImpact: 10, surgeryType: "newEyes",
+				canImplant: s => (getLeftEyeVision(s) === 0 && getBestVision(s) !== 0 && getLeftEyeType(s) !== 2),
+				implantError: s => getLeftEyeVision(s) !== 0 ? "Slave has a working left eye." : "",
+				implant: s => {
+					eyeSurgery(s, "left", "normal");
+				}
+			}),
 			new App.Medicine.OrganFarm.OrganImplantAction({
 				name: "Implant", healthImpact: 10, surgeryType: "unblind",
-				canImplant: s => (getLeftEyeVision(s) === 0 && getLeftEyeType(s) !== 2),
-				implantError: () => "Slave has a working left eye.",
+				canImplant: s => (getBestVision(s) === 0 && getLeftEyeType(s) !== 2),
+				implantError: () => "",
 				implant: s => {
 					eyeSurgery(s, "left", "normal");
 				}
@@ -223,10 +231,18 @@ App.Medicine.OrganFarm.init = function() {
 	new App.Medicine.OrganFarm.Organ({
 		type: "rightEye", name: "Right Eye", cost: 5000, time: 10,
 		actions: [
+			new App.Medicine.OrganFarm.OrganImplantAction({
+				name: "Implant", healthImpact: 10, surgeryType: "newEyes",
+				canImplant: s => (getRightEyeVision(s) === 0 && getBestVision(s) !== 0 && getRightEyeType(s) !== 2),
+				implantError: s => getRightEyeVision(s) !== 0 ? "Slave has a working right eye." : "",
+				implant: s => {
+					eyeSurgery(s, "right", "normal");
+				}
+			}),
 			new App.Medicine.OrganFarm.OrganImplantAction({
 				name: "Implant", healthImpact: 10, surgeryType: "unblind",
-				canImplant: s => (getRightEyeVision(s) === 0 && getRightEyeType(s) !== 2),
-				implantError: () => "Slave has a working right eye.",
+				canImplant: s => (getBestVision(s) === 0 && getRightEyeType(s) !== 2),
+				implantError: () => "",
 				implant: s => {
 					eyeSurgery(s, "right", "normal");
 				}
-- 
GitLab