From 210643e5baeec3b4dc1728624ba321b68aee1168 Mon Sep 17 00:00:00 2001 From: Tyranicranger4 <80382633+Tyranicranger4@users.noreply.github.com> Date: Sun, 13 Aug 2023 01:02:26 -0700 Subject: [PATCH 1/7] Initial --- code/__DEFINES/traits.dm | 3 ++- code/_globalvars/traits.dm | 1 + code/modules/antagonists/abductor/abductor.dm | 4 ++-- code/modules/surgery/surgery.dm | 21 ++++++++++++++++--- 4 files changed, 23 insertions(+), 6 deletions(-) diff --git a/code/__DEFINES/traits.dm b/code/__DEFINES/traits.dm index e689ee8e7c0cb..a90ffc7f24bf0 100644 --- a/code/__DEFINES/traits.dm +++ b/code/__DEFINES/traits.dm @@ -208,7 +208,8 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai #define TRAIT_THERMAL_VISION "thermal_vision" #define TRAIT_ABDUCTOR_TRAINING "abductor-training" #define TRAIT_ABDUCTOR_SCIENTIST_TRAINING "abductor-scientist-training" -#define TRAIT_SURGEON "surgeon" +#define TRAIT_SURGEON "surgeon" //Grants access to all surgeries +#define TRAIT_ABDUCTOR_SURGEON "abductor-surgery-training" //Grants access to all surgeries except for certain blacklisted ones #define TRAIT_STRONG_GRABBER "strong_grabber" #define TRAIT_CALCIUM_HEALER "calcium_healer" #define TRAIT_MAGIC_CHOKE "magic_choke" diff --git a/code/_globalvars/traits.dm b/code/_globalvars/traits.dm index a5d41e1e507d3..a307fb935c902 100644 --- a/code/_globalvars/traits.dm +++ b/code/_globalvars/traits.dm @@ -85,6 +85,7 @@ GLOBAL_LIST_INIT(traits_by_type, list( "TRAIT_ABDUCTOR_TRAINING" = TRAIT_ABDUCTOR_TRAINING, "TRAIT_ABDUCTOR_SCIENTIST_TRAINING" = TRAIT_ABDUCTOR_SCIENTIST_TRAINING, "TRAIT_SURGEON" = TRAIT_SURGEON, + "TRAIT_ABDUCTOR_SURGEON" = TRAIT_ABDUCTOR_SURGEON, "TRAIT_STRONG_GRABBER" = TRAIT_STRONG_GRABBER, "TRAIT_CALCIUM_HEALER" = TRAIT_CALCIUM_HEALER, "TRAIT_MAGIC_CHOKE" = TRAIT_MAGIC_CHOKE, diff --git a/code/modules/antagonists/abductor/abductor.dm b/code/modules/antagonists/abductor/abductor.dm index a7a0854c31ca2..c5604b4248201 100644 --- a/code/modules/antagonists/abductor/abductor.dm +++ b/code/modules/antagonists/abductor/abductor.dm @@ -100,12 +100,12 @@ /datum/antagonist/abductor/scientist/on_gain() ADD_TRAIT(owner, TRAIT_ABDUCTOR_SCIENTIST_TRAINING, ABDUCTOR_ANTAGONIST) - ADD_TRAIT(owner, TRAIT_SURGEON, ABDUCTOR_ANTAGONIST) + ADD_TRAIT(owner, TRAIT_ABDUCTOR_SURGEON, ABDUCTOR_ANTAGONIST) . = ..() /datum/antagonist/abductor/scientist/on_removal() REMOVE_TRAIT(owner, TRAIT_ABDUCTOR_SCIENTIST_TRAINING, ABDUCTOR_ANTAGONIST) - REMOVE_TRAIT(owner, TRAIT_SURGEON, ABDUCTOR_ANTAGONIST) + REMOVE_TRAIT(owner, TRAIT_ABDUCTOR_SURGEON, ABDUCTOR_ANTAGONIST) . = ..() /datum/antagonist/abductor/admin_add(datum/mind/new_owner,mob/admin) diff --git a/code/modules/surgery/surgery.dm b/code/modules/surgery/surgery.dm index 215d4f1a5dea7..393e238620037 100644 --- a/code/modules/surgery/surgery.dm +++ b/code/modules/surgery/surgery.dm @@ -20,6 +20,9 @@ var/requires_tech = FALSE //handles techweb-oriented surgeries, previously restricted to the /advanced subtype (You still need to add designs) var/replaced_by //type; doesn't show up if this type exists. Set to /datum/surgery if you want to hide a "base" surgery (useful for typing parents IE healing.dm just make sure to null it out again) var/failed_step = FALSE //used for bypassing the 'poke on help intent' on failing a surgery step and forcing the doctor to damage the patient + var/abductor_surgery_blacklist = list(/datum/surgery/advanced/necrotic_revival) + //Surgeries in this list aren't automatically available to those with the ABDUCTOR_SURGEON trait + //However, they can still be used by them if they meet the normal requirements to access the surgery /datum/surgery/New(surgery_target, surgery_location, surgery_bodypart) ..() @@ -44,15 +47,22 @@ if(replaced_by == /datum/surgery) return FALSE - if(HAS_TRAIT(user, TRAIT_SURGEON) || (user.mind && HAS_TRAIT(user.mind, TRAIT_SURGEON))) + if(HAS_TRAIT(user, TRAIT_SURGEON) || user.mind && HAS_TRAIT(user.mind, TRAIT_SURGEON)) if(replaced_by) return FALSE else return TRUE + //Grants the user innate access to all surgeries + + if(HAS_TRAIT(user, TRAIT_ABDUCTOR_SURGEON) || user.mind && HAS_TRAIT(user.mind, TRAIT_ABDUCTOR_SURGEON)) + if(replaced_by) + return FALSE + else if(!locate(src) in abductor_surgery_blacklist) + return TRUE + //Grants the user innate access to all surgeries except for certain blacklisted ones. Used by Abductors if(!requires_tech && !replaced_by) return TRUE - // True surgeons (like abductor scientists) need no instructions if(requires_tech) . = FALSE @@ -138,9 +148,14 @@ if(!..()) return FALSE // True surgeons (like abductor scientists) need no instructions - if(HAS_TRAIT(user, TRAIT_SURGEON) || HAS_TRAIT(user.mind, TRAIT_SURGEON)) + if(HAS_TRAIT(user, TRAIT_SURGEON) || user.mind && HAS_TRAIT(user.mind, TRAIT_SURGEON)) return TRUE + if(HAS_TRAIT(user, TRAIT_ABDUCTOR_SURGEON) || user.mind && HAS_TRAIT(user.mind, TRAIT_ABDUCTOR_SURGEON)) + if(!locate(src) in abductor_surgery_blacklist && !replaced_by) + return(TRUE) + //Grants the user innate access to all surgeries except for certain blacklisted ones. Used by Abductors + if(iscyborg(user)) var/mob/living/silicon/robot/R = user var/obj/item/surgical_processor/SP = locate() in R.module.modules From b6272fd938f73b234e6493f71d6494d5618f875a Mon Sep 17 00:00:00 2001 From: Tyranicranger4 <80382633+Tyranicranger4@users.noreply.github.com> Date: Sun, 13 Aug 2023 02:01:47 -0700 Subject: [PATCH 2/7] Update surgery.dm Don't need this --- code/modules/surgery/surgery.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/surgery/surgery.dm b/code/modules/surgery/surgery.dm index 393e238620037..62518b8be966d 100644 --- a/code/modules/surgery/surgery.dm +++ b/code/modules/surgery/surgery.dm @@ -152,7 +152,7 @@ return TRUE if(HAS_TRAIT(user, TRAIT_ABDUCTOR_SURGEON) || user.mind && HAS_TRAIT(user.mind, TRAIT_ABDUCTOR_SURGEON)) - if(!locate(src) in abductor_surgery_blacklist && !replaced_by) + if(!locate(src) in abductor_surgery_blacklist) return(TRUE) //Grants the user innate access to all surgeries except for certain blacklisted ones. Used by Abductors From 17a87094e02172b245887e7821acfcce2b817762 Mon Sep 17 00:00:00 2001 From: Tyranicranger4 <80382633+Tyranicranger4@users.noreply.github.com> Date: Mon, 14 Aug 2023 21:01:24 -0700 Subject: [PATCH 3/7] Requested-Changes Changes requested by Dragonfiend --- code/modules/surgery/advanced/necrotic_revival.dm | 1 + code/modules/surgery/surgery.dm | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/code/modules/surgery/advanced/necrotic_revival.dm b/code/modules/surgery/advanced/necrotic_revival.dm index 449065ba487f3..87e7e8f8ff0e1 100644 --- a/code/modules/surgery/advanced/necrotic_revival.dm +++ b/code/modules/surgery/advanced/necrotic_revival.dm @@ -9,6 +9,7 @@ /datum/surgery_step/close) possible_locs = list(BODY_ZONE_HEAD) + abductor_surgery_blacklist = TRUE /datum/surgery/advanced/necrotic_revival/can_start(mob/user, mob/living/carbon/target) . = ..() diff --git a/code/modules/surgery/surgery.dm b/code/modules/surgery/surgery.dm index 62518b8be966d..fae8f1c08f017 100644 --- a/code/modules/surgery/surgery.dm +++ b/code/modules/surgery/surgery.dm @@ -20,9 +20,9 @@ var/requires_tech = FALSE //handles techweb-oriented surgeries, previously restricted to the /advanced subtype (You still need to add designs) var/replaced_by //type; doesn't show up if this type exists. Set to /datum/surgery if you want to hide a "base" surgery (useful for typing parents IE healing.dm just make sure to null it out again) var/failed_step = FALSE //used for bypassing the 'poke on help intent' on failing a surgery step and forcing the doctor to damage the patient - var/abductor_surgery_blacklist = list(/datum/surgery/advanced/necrotic_revival) - //Surgeries in this list aren't automatically available to those with the ABDUCTOR_SURGEON trait - //However, they can still be used by them if they meet the normal requirements to access the surgery + var/abductor_surgery_blacklist = FALSE + //Blacklisted surgeries aren't innately known by Abductor Scientists, but can still be used if connected to an operating table with the surgery researched + /datum/surgery/New(surgery_target, surgery_location, surgery_bodypart) ..() @@ -57,7 +57,7 @@ if(HAS_TRAIT(user, TRAIT_ABDUCTOR_SURGEON) || user.mind && HAS_TRAIT(user.mind, TRAIT_ABDUCTOR_SURGEON)) if(replaced_by) return FALSE - else if(!locate(src) in abductor_surgery_blacklist) + else if(!abductor_surgery_blacklist) return TRUE //Grants the user innate access to all surgeries except for certain blacklisted ones. Used by Abductors @@ -152,7 +152,7 @@ return TRUE if(HAS_TRAIT(user, TRAIT_ABDUCTOR_SURGEON) || user.mind && HAS_TRAIT(user.mind, TRAIT_ABDUCTOR_SURGEON)) - if(!locate(src) in abductor_surgery_blacklist) + if(!abductor_surgery_blacklist) return(TRUE) //Grants the user innate access to all surgeries except for certain blacklisted ones. Used by Abductors From 57df9ff8b3c6e4db0b4d370c47933e79de0e01bc Mon Sep 17 00:00:00 2001 From: Tyranicranger4 <80382633+Tyranicranger4@users.noreply.github.com> Date: Mon, 14 Aug 2023 21:04:43 -0700 Subject: [PATCH 4/7] Comment Like this one better --- code/modules/surgery/surgery.dm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/modules/surgery/surgery.dm b/code/modules/surgery/surgery.dm index fae8f1c08f017..c8ff49833226b 100644 --- a/code/modules/surgery/surgery.dm +++ b/code/modules/surgery/surgery.dm @@ -21,7 +21,8 @@ var/replaced_by //type; doesn't show up if this type exists. Set to /datum/surgery if you want to hide a "base" surgery (useful for typing parents IE healing.dm just make sure to null it out again) var/failed_step = FALSE //used for bypassing the 'poke on help intent' on failing a surgery step and forcing the doctor to damage the patient var/abductor_surgery_blacklist = FALSE - //Blacklisted surgeries aren't innately known by Abductor Scientists, but can still be used if connected to an operating table with the surgery researched + //Blacklisted surgeries aren't innately known by Abductor Scientists + //However, they can still be used by them if they meet the normal requirements to access the surgery /datum/surgery/New(surgery_target, surgery_location, surgery_bodypart) From c30013d425530912148254e72c98235e52b6c846 Mon Sep 17 00:00:00 2001 From: Tyranicranger4 <80382633+Tyranicranger4@users.noreply.github.com> Date: Mon, 14 Aug 2023 22:39:09 -0700 Subject: [PATCH 5/7] Oops --- code/modules/surgery/surgery.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/surgery/surgery.dm b/code/modules/surgery/surgery.dm index c8ff49833226b..9949711a2c808 100644 --- a/code/modules/surgery/surgery.dm +++ b/code/modules/surgery/surgery.dm @@ -154,7 +154,7 @@ if(HAS_TRAIT(user, TRAIT_ABDUCTOR_SURGEON) || user.mind && HAS_TRAIT(user.mind, TRAIT_ABDUCTOR_SURGEON)) if(!abductor_surgery_blacklist) - return(TRUE) + return TRUE //Grants the user innate access to all surgeries except for certain blacklisted ones. Used by Abductors if(iscyborg(user)) From c89a1ed34354990f9f34b3b2a13c8370b4e51a3f Mon Sep 17 00:00:00 2001 From: Tyranicranger4 <80382633+Tyranicranger4@users.noreply.github.com> Date: Tue, 15 Aug 2023 21:43:50 -0700 Subject: [PATCH 6/7] wrap Requested change --- code/modules/surgery/surgery.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/surgery/surgery.dm b/code/modules/surgery/surgery.dm index 9949711a2c808..0d4b630d87f98 100644 --- a/code/modules/surgery/surgery.dm +++ b/code/modules/surgery/surgery.dm @@ -48,7 +48,7 @@ if(replaced_by == /datum/surgery) return FALSE - if(HAS_TRAIT(user, TRAIT_SURGEON) || user.mind && HAS_TRAIT(user.mind, TRAIT_SURGEON)) + if(HAS_TRAIT(user, TRAIT_SURGEON) || (user.mind && HAS_TRAIT(user.mind, TRAIT_SURGEON))) if(replaced_by) return FALSE else From 22d8f1104fa723cf8c1fcd24edf04145d0df5745 Mon Sep 17 00:00:00 2001 From: Tyranicranger4 <80382633+Tyranicranger4@users.noreply.github.com> Date: Tue, 15 Aug 2023 23:59:03 -0700 Subject: [PATCH 7/7] wrap-x2 Should do these too probably. --- code/modules/surgery/surgery.dm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/modules/surgery/surgery.dm b/code/modules/surgery/surgery.dm index 0d4b630d87f98..d829cc8afff28 100644 --- a/code/modules/surgery/surgery.dm +++ b/code/modules/surgery/surgery.dm @@ -55,7 +55,7 @@ return TRUE //Grants the user innate access to all surgeries - if(HAS_TRAIT(user, TRAIT_ABDUCTOR_SURGEON) || user.mind && HAS_TRAIT(user.mind, TRAIT_ABDUCTOR_SURGEON)) + if(HAS_TRAIT(user, TRAIT_ABDUCTOR_SURGEON) || (user.mind && HAS_TRAIT(user.mind, TRAIT_ABDUCTOR_SURGEON))) if(replaced_by) return FALSE else if(!abductor_surgery_blacklist) @@ -149,10 +149,10 @@ if(!..()) return FALSE // True surgeons (like abductor scientists) need no instructions - if(HAS_TRAIT(user, TRAIT_SURGEON) || user.mind && HAS_TRAIT(user.mind, TRAIT_SURGEON)) + if(HAS_TRAIT(user, TRAIT_SURGEON) || (user.mind && HAS_TRAIT(user.mind, TRAIT_SURGEON))) return TRUE - if(HAS_TRAIT(user, TRAIT_ABDUCTOR_SURGEON) || user.mind && HAS_TRAIT(user.mind, TRAIT_ABDUCTOR_SURGEON)) + if(HAS_TRAIT(user, TRAIT_ABDUCTOR_SURGEON) || (user.mind && HAS_TRAIT(user.mind, TRAIT_ABDUCTOR_SURGEON))) if(!abductor_surgery_blacklist) return TRUE //Grants the user innate access to all surgeries except for certain blacklisted ones. Used by Abductors