diff --git a/src/npc/surgery/organs.js b/src/npc/surgery/organs.js index 3e0b26555e1b8ecd3b62b42fa08749860d09e60e..4fa95eee6bb8004dd08358128a98d57255ce25de 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"); }