From 12a691d9501e19e8ea504d3e61de8f25887178a4 Mon Sep 17 00:00:00 2001 From: AnturK Date: Fri, 12 Oct 2018 10:42:48 +0200 Subject: [PATCH 01/14] Surgery cleanup (#40788) * Surgery cleanup * Proper mobtype --- code/__DEFINES/mobs.dm | 1 - code/__DEFINES/traits.dm | 2 +- code/modules/mob/living/carbon/examine.dm | 1 + .../mob/living/carbon/human/examine.dm | 2 ++ code/modules/mob/mob_helpers.dm | 7 +++++++ .../research/designs/medical_designs.dm | 2 +- .../advanced/bioware/bioware_surgery.dm | 2 ++ .../bioware/experimental_dissection.dm | 19 ++++++++----------- code/modules/surgery/advanced/brainwashing.dm | 4 ++-- code/modules/surgery/advanced/lobotomy.dm | 2 +- code/modules/surgery/advanced/pacification.dm | 5 +++-- .../surgery/advanced/reconstruction.dm | 2 +- code/modules/surgery/advanced/revival.dm | 3 ++- .../modules/surgery/advanced/viral_bonding.dm | 3 ++- code/modules/surgery/amputation.dm | 2 +- code/modules/surgery/brain_surgery.dm | 3 ++- code/modules/surgery/cavity_implant.dm | 2 +- code/modules/surgery/core_removal.dm | 4 +++- code/modules/surgery/eye_surgery.dm | 2 +- code/modules/surgery/helpers.dm | 12 ++++++++---- code/modules/surgery/implant_removal.dm | 2 +- code/modules/surgery/limb_augmentation.dm | 2 +- code/modules/surgery/organ_manipulation.dm | 6 +++--- .../modules/surgery/prosthetic_replacement.dm | 2 +- code/modules/surgery/surgery.dm | 5 +++-- 25 files changed, 58 insertions(+), 39 deletions(-) diff --git a/code/__DEFINES/mobs.dm b/code/__DEFINES/mobs.dm index 6143047275..6ad0ed6d95 100644 --- a/code/__DEFINES/mobs.dm +++ b/code/__DEFINES/mobs.dm @@ -117,7 +117,6 @@ #define BIOWARE_NERVES "nerves" #define BIOWARE_CIRCULATION "circulation" #define BIOWARE_LIGAMENTS "ligaments" -#define BIOWARE_DISSECTION "dissected" //Health hud screws for carbon mobs #define SCREWYHUD_NONE 0 diff --git a/code/__DEFINES/traits.dm b/code/__DEFINES/traits.dm index e198041c6e..e49da2374f 100644 --- a/code/__DEFINES/traits.dm +++ b/code/__DEFINES/traits.dm @@ -109,7 +109,7 @@ #define TRAIT_NODEATH "nodeath" #define TRAIT_NOHARDCRIT "nohardcrit" #define TRAIT_NOSOFTCRIT "nosoftcrit" -#define TRAIT_MINDSHIELD "mindshield" +#define TRAIT_DISSECTED "dissected" #define TRAIT_FEARLESS "fearless" #define TRAIT_UNSTABLE "unstable" #define TRAIT_PARALYSIS_L_ARM "para-l-arm" //These are used for brain-based paralysis, where replacing the limb won't fix it diff --git a/code/modules/mob/living/carbon/examine.dm b/code/modules/mob/living/carbon/examine.dm index 22da46346c..c029eac12b 100644 --- a/code/modules/mob/living/carbon/examine.dm +++ b/code/modules/mob/living/carbon/examine.dm @@ -91,6 +91,7 @@ if(combatmode) msg += "[t_He] [t_is] visibly tense[resting ? "." : ", and [t_is] standing in combative stance."]\n" + msg += common_trait_examine() GET_COMPONENT_FROM(mood, /datum/component/mood, src) if(mood) diff --git a/code/modules/mob/living/carbon/human/examine.dm b/code/modules/mob/living/carbon/human/examine.dm index 5b224444e0..6ebc4f8a32 100644 --- a/code/modules/mob/living/carbon/human/examine.dm +++ b/code/modules/mob/living/carbon/human/examine.dm @@ -335,6 +335,8 @@ if(digitalcamo) msg += "[t_He] [t_is] moving [t_his] body in an unnatural and blatantly inhuman manner.\n" + msg += common_trait_examine() + var/traitstring = get_trait_string() if(ishuman(user)) var/mob/living/carbon/human/H = user diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index 776bd04935..df86756676 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -486,3 +486,10 @@ It's fairly easy to fix if dealing with single letters but not so much with comp /mob/proc/can_hear() . = TRUE + +//Examine text for traits shared by multiple types. I wish examine was less copypasted. +/mob/proc/common_trait_examine() + . = "" + + if(has_trait(TRAIT_DISSECTED)) + . += "This body has been dissected and analyzed. It is no longer worth experimenting on.
" \ No newline at end of file diff --git a/code/modules/research/designs/medical_designs.dm b/code/modules/research/designs/medical_designs.dm index 301d2de279..989f3ce273 100644 --- a/code/modules/research/designs/medical_designs.dm +++ b/code/modules/research/designs/medical_designs.dm @@ -728,7 +728,7 @@ name = "Experimental Dissection" desc = "A surgical procedure which deeply analyzes the biology of a corpse, and automatically adds new findings to the research database." id = "surgery_exp_dissection" - surgery = /datum/surgery/advanced/bioware/experimental_dissection + surgery = /datum/surgery/advanced/experimental_dissection research_icon_state = "surgery_chest" /datum/design/surgery/lobotomy diff --git a/code/modules/surgery/advanced/bioware/bioware_surgery.dm b/code/modules/surgery/advanced/bioware/bioware_surgery.dm index 86817b9b09..eb8f739193 100644 --- a/code/modules/surgery/advanced/bioware/bioware_surgery.dm +++ b/code/modules/surgery/advanced/bioware/bioware_surgery.dm @@ -5,6 +5,8 @@ /datum/surgery/advanced/bioware/can_start(mob/user, mob/living/carbon/human/target) if(!..()) return FALSE + if(!istype(target)) + return FALSE for(var/X in target.bioware) var/datum/bioware/B = X if(B.mod_type == bioware_target) diff --git a/code/modules/surgery/advanced/bioware/experimental_dissection.dm b/code/modules/surgery/advanced/bioware/experimental_dissection.dm index 6266480baf..8406f2496e 100644 --- a/code/modules/surgery/advanced/bioware/experimental_dissection.dm +++ b/code/modules/surgery/advanced/bioware/experimental_dissection.dm @@ -1,4 +1,4 @@ -/datum/surgery/advanced/bioware/experimental_dissection +/datum/surgery/advanced/experimental_dissection name = "Experimental Dissection" desc = "A surgical procedure which deeply analyzes the biology of a corpse, and automatically adds new findings to the research database." steps = list(/datum/surgery_step/incise, @@ -8,10 +8,12 @@ /datum/surgery_step/dissection, /datum/surgery_step/close) possible_locs = list(BODY_ZONE_CHEST) - bioware_target = BIOWARE_DISSECTION + target_mobtypes = list(/mob/living/carbon) //Feel free to dissect devils but they're magic. -/datum/surgery/advanced/bioware/experimental_dissection/can_start(mob/user, mob/living/carbon/target) +/datum/surgery/advanced/experimental_dissection/can_start(mob/user, mob/living/carbon/target) . = ..() + if(target.has_trait(TRAIT_DISSECTED)) + return FALSE if(iscyborg(user)) return FALSE //robots cannot be creative //(also this surgery shouldn't be consistently successful, and cyborgs have a 100% success rate on surgery) @@ -53,7 +55,7 @@ SSresearch.science_tech.add_point_list(list(TECHWEB_POINT_TYPE_GENERIC = check_value(target))) var/obj/item/bodypart/L = target.get_bodypart(BODY_ZONE_CHEST) target.apply_damage(80, BRUTE, L) - new /datum/bioware/dissected(target) + target.add_trait(TRAIT_DISSECTED) return TRUE /datum/surgery_step/dissection/failure(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) @@ -63,10 +65,5 @@ SSresearch.science_tech.add_point_list(list(TECHWEB_POINT_TYPE_GENERIC = (check_value(target) * 0.2))) var/obj/item/bodypart/L = target.get_bodypart(BODY_ZONE_CHEST) target.apply_damage(80, BRUTE, L) - new /datum/bioware/dissected(target) - return TRUE - -/datum/bioware/dissected - name = "Dissected" - desc = "This body has been dissected and analyzed. It is no longer worth experimenting on." - mod_type = BIOWARE_DISSECTION \ No newline at end of file + target.add_trait(TRAIT_DISSECTED) + return TRUE \ No newline at end of file diff --git a/code/modules/surgery/advanced/brainwashing.dm b/code/modules/surgery/advanced/brainwashing.dm index 730a912189..d76c6367c5 100644 --- a/code/modules/surgery/advanced/brainwashing.dm +++ b/code/modules/surgery/advanced/brainwashing.dm @@ -12,8 +12,8 @@ /datum/surgery_step/clamp_bleeders, /datum/surgery_step/brainwash, /datum/surgery_step/close) - - species = list(/mob/living/carbon/human) + + target_mobtypes = list(/mob/living/carbon/human) possible_locs = list(BODY_ZONE_HEAD) /datum/surgery/advanced/brainwashing/can_start(mob/user, mob/living/carbon/target) if(!..()) diff --git a/code/modules/surgery/advanced/lobotomy.dm b/code/modules/surgery/advanced/lobotomy.dm index 1c09f5f7da..37f13239db 100644 --- a/code/modules/surgery/advanced/lobotomy.dm +++ b/code/modules/surgery/advanced/lobotomy.dm @@ -9,7 +9,7 @@ /datum/surgery_step/lobotomize, /datum/surgery_step/close) - species = list(/mob/living/carbon/human, /mob/living/carbon/monkey) + target_mobtypes = list(/mob/living/carbon/human, /mob/living/carbon/monkey) possible_locs = list(BODY_ZONE_HEAD) requires_bodypart_type = 0 /datum/surgery/advanced/lobotomy/can_start(mob/user, mob/living/carbon/target) diff --git a/code/modules/surgery/advanced/pacification.dm b/code/modules/surgery/advanced/pacification.dm index d5585d71a8..36f5b6b4f1 100644 --- a/code/modules/surgery/advanced/pacification.dm +++ b/code/modules/surgery/advanced/pacification.dm @@ -7,7 +7,8 @@ /datum/surgery_step/clamp_bleeders, /datum/surgery_step/pacify, /datum/surgery_step/close) - species = list(/mob/living/carbon/human, /mob/living/carbon/monkey) + + target_mobtypes = list(/mob/living/carbon/human, /mob/living/carbon/monkey) possible_locs = list(BODY_ZONE_HEAD) requires_bodypart_type = 0 /datum/surgery/advanced/pacify/can_start(mob/user, mob/living/carbon/target) @@ -37,4 +38,4 @@ "[user] screws up, causing brain damage!", "[user] completes the surgery on [target]'s brain.") target.gain_trauma_type(BRAIN_TRAUMA_SEVERE, TRAUMA_RESILIENCE_LOBOTOMY) - return FALSE + return FALSE diff --git a/code/modules/surgery/advanced/reconstruction.dm b/code/modules/surgery/advanced/reconstruction.dm index 84d9f5b9f8..f3534402e0 100644 --- a/code/modules/surgery/advanced/reconstruction.dm +++ b/code/modules/surgery/advanced/reconstruction.dm @@ -11,7 +11,7 @@ /datum/surgery_step/reconstruct, /datum/surgery_step/close) - species = list(/mob/living/carbon/human, /mob/living/carbon/monkey) + target_mobtypes = list(/mob/living/carbon/human, /mob/living/carbon/monkey) possible_locs = list(BODY_ZONE_CHEST) requires_bodypart_type = 0 diff --git a/code/modules/surgery/advanced/revival.dm b/code/modules/surgery/advanced/revival.dm index 01c30f174a..4120e31db6 100644 --- a/code/modules/surgery/advanced/revival.dm +++ b/code/modules/surgery/advanced/revival.dm @@ -8,7 +8,8 @@ /datum/surgery_step/incise, /datum/surgery_step/revive, /datum/surgery_step/close) - species = list(/mob/living/carbon/human, /mob/living/carbon/monkey) + + target_mobtypes = list(/mob/living/carbon/human, /mob/living/carbon/monkey) possible_locs = list(BODY_ZONE_HEAD) requires_bodypart_type = 0 /datum/surgery/advanced/revival/can_start(mob/user, mob/living/carbon/target) diff --git a/code/modules/surgery/advanced/viral_bonding.dm b/code/modules/surgery/advanced/viral_bonding.dm index b87d5e001c..49c85f4bff 100644 --- a/code/modules/surgery/advanced/viral_bonding.dm +++ b/code/modules/surgery/advanced/viral_bonding.dm @@ -7,7 +7,8 @@ /datum/surgery_step/incise, /datum/surgery_step/viral_bond, /datum/surgery_step/close) - species = list(/mob/living/carbon/human, /mob/living/carbon/monkey) + + target_mobtypes = list(/mob/living/carbon/human, /mob/living/carbon/monkey) possible_locs = list(BODY_ZONE_CHEST) /datum/surgery/advanced/viral_bonding/can_start(mob/user, mob/living/carbon/target) if(!..()) diff --git a/code/modules/surgery/amputation.dm b/code/modules/surgery/amputation.dm index 01cf6ae112..d491a3f729 100644 --- a/code/modules/surgery/amputation.dm +++ b/code/modules/surgery/amputation.dm @@ -1,7 +1,7 @@ /datum/surgery/amputation name = "Amputation" steps = list(/datum/surgery_step/incise, /datum/surgery_step/clamp_bleeders, /datum/surgery_step/retract_skin, /datum/surgery_step/saw, /datum/surgery_step/clamp_bleeders, /datum/surgery_step/sever_limb) - species = list(/mob/living/carbon/human, /mob/living/carbon/monkey) + target_mobtypes = list(/mob/living/carbon/human, /mob/living/carbon/monkey) possible_locs = list(BODY_ZONE_R_ARM, BODY_ZONE_L_ARM, BODY_ZONE_L_LEG, BODY_ZONE_R_LEG, BODY_ZONE_HEAD) requires_bodypart_type = 0 /datum/surgery_step/sever_limb diff --git a/code/modules/surgery/brain_surgery.dm b/code/modules/surgery/brain_surgery.dm index e65271576d..50ac89647e 100644 --- a/code/modules/surgery/brain_surgery.dm +++ b/code/modules/surgery/brain_surgery.dm @@ -7,7 +7,8 @@ /datum/surgery_step/clamp_bleeders, /datum/surgery_step/fix_brain, /datum/surgery_step/close) - species = list(/mob/living/carbon/human, /mob/living/carbon/monkey) + + target_mobtypes = list(/mob/living/carbon/human, /mob/living/carbon/monkey) possible_locs = list(BODY_ZONE_HEAD) requires_bodypart_type = 0 /datum/surgery_step/fix_brain diff --git a/code/modules/surgery/cavity_implant.dm b/code/modules/surgery/cavity_implant.dm index 4c65b56962..e50f8ddcac 100644 --- a/code/modules/surgery/cavity_implant.dm +++ b/code/modules/surgery/cavity_implant.dm @@ -1,7 +1,7 @@ /datum/surgery/cavity_implant name = "Cavity implant" steps = list(/datum/surgery_step/incise, /datum/surgery_step/clamp_bleeders, /datum/surgery_step/retract_skin, /datum/surgery_step/incise, /datum/surgery_step/handle_cavity, /datum/surgery_step/close) - species = list(/mob/living/carbon/human, /mob/living/carbon/monkey) + target_mobtypes = list(/mob/living/carbon/human, /mob/living/carbon/monkey) possible_locs = list(BODY_ZONE_CHEST) //handle cavity /datum/surgery_step/handle_cavity diff --git a/code/modules/surgery/core_removal.dm b/code/modules/surgery/core_removal.dm index 6243405f8d..06aa66a161 100644 --- a/code/modules/surgery/core_removal.dm +++ b/code/modules/surgery/core_removal.dm @@ -1,8 +1,10 @@ /datum/surgery/core_removal name = "Core removal" steps = list(/datum/surgery_step/incise, /datum/surgery_step/extract_core) - species = list(/mob/living/simple_animal/slime) + target_mobtypes = list(/mob/living/simple_animal/slime) possible_locs = list(BODY_ZONE_R_ARM,BODY_ZONE_L_ARM,BODY_ZONE_R_LEG,BODY_ZONE_L_LEG,BODY_ZONE_CHEST,BODY_ZONE_HEAD) + lying_required = FALSE + ignore_clothes = TRUE /datum/surgery/core_removal/can_start(mob/user, mob/living/target) if(target.stat == DEAD) diff --git a/code/modules/surgery/eye_surgery.dm b/code/modules/surgery/eye_surgery.dm index 85142e7bb1..bd4a2531e3 100644 --- a/code/modules/surgery/eye_surgery.dm +++ b/code/modules/surgery/eye_surgery.dm @@ -1,7 +1,7 @@ /datum/surgery/eye_surgery name = "Eye surgery" steps = list(/datum/surgery_step/incise, /datum/surgery_step/retract_skin, /datum/surgery_step/clamp_bleeders, /datum/surgery_step/fix_eyes, /datum/surgery_step/close) - species = list(/mob/living/carbon/human, /mob/living/carbon/monkey) + target_mobtypes = list(/mob/living/carbon/human, /mob/living/carbon/monkey) possible_locs = list(BODY_ZONE_PRECISE_EYES) requires_bodypart_type = 0 //fix eyes diff --git a/code/modules/surgery/helpers.dm b/code/modules/surgery/helpers.dm index 0419a4c73f..73596466e5 100644 --- a/code/modules/surgery/helpers.dm +++ b/code/modules/surgery/helpers.dm @@ -10,9 +10,6 @@ C = M affecting = C.get_bodypart(check_zone(selected_zone)) - if(!M.lying && !isslime(M)) //if they're prone or a slime - return - var/datum/surgery/current_surgery for(var/datum/surgery/S in M.surgeries) @@ -35,13 +32,18 @@ continue else if(C && S.requires_bodypart) //mob with no limb in surgery zone when we need a limb continue + if(S.lying_required && !(M.mobility_flags & MOBILITY_STAND)) + continue if(!S.can_start(user, M)) continue - for(var/path in S.species) + for(var/path in S.target_mobtypes) if(istype(M, path)) available_surgeries[S.name] = S break + if(!available_surgeries.len) + return + var/P = input("Begin which procedure?", "Surgery", null, null) as null|anything in available_surgeries if(P && user && user.Adjacent(M) && (I in user)) var/datum/surgery/S = available_surgeries[P] @@ -60,6 +62,8 @@ return else if(C && S.requires_bodypart) return + if(S.lying_required && !(M.mobility_flags & MOBILITY_STAND)) + return if(!S.can_start(user, M)) return diff --git a/code/modules/surgery/implant_removal.dm b/code/modules/surgery/implant_removal.dm index 05119b365d..e963402634 100644 --- a/code/modules/surgery/implant_removal.dm +++ b/code/modules/surgery/implant_removal.dm @@ -1,7 +1,7 @@ /datum/surgery/implant_removal name = "implant removal" steps = list(/datum/surgery_step/incise, /datum/surgery_step/clamp_bleeders, /datum/surgery_step/retract_skin, /datum/surgery_step/extract_implant, /datum/surgery_step/close) - species = list(/mob/living/carbon/human, /mob/living/carbon/monkey) + target_mobtypes = list(/mob/living/carbon/human, /mob/living/carbon/monkey) possible_locs = list(BODY_ZONE_CHEST) //extract implant /datum/surgery_step/extract_implant diff --git a/code/modules/surgery/limb_augmentation.dm b/code/modules/surgery/limb_augmentation.dm index 7ba8dbc49d..136e1093b9 100644 --- a/code/modules/surgery/limb_augmentation.dm +++ b/code/modules/surgery/limb_augmentation.dm @@ -38,7 +38,7 @@ /datum/surgery/augmentation name = "Augmentation" steps = list(/datum/surgery_step/incise, /datum/surgery_step/clamp_bleeders, /datum/surgery_step/retract_skin, /datum/surgery_step/replace, /datum/surgery_step/saw, /datum/surgery_step/replace_limb) - species = list(/mob/living/carbon/human) + target_mobtypes = list(/mob/living/carbon/human) possible_locs = list(BODY_ZONE_R_ARM,BODY_ZONE_L_ARM,BODY_ZONE_R_LEG,BODY_ZONE_L_LEG,BODY_ZONE_CHEST,BODY_ZONE_HEAD) requires_real_bodypart = TRUE //SURGERY STEP SUCCESSES diff --git a/code/modules/surgery/organ_manipulation.dm b/code/modules/surgery/organ_manipulation.dm index 6bffed7452..fe6139cc0e 100644 --- a/code/modules/surgery/organ_manipulation.dm +++ b/code/modules/surgery/organ_manipulation.dm @@ -1,6 +1,6 @@ /datum/surgery/organ_manipulation - name = "Organ manipulation" - species = list(/mob/living/carbon/human, /mob/living/carbon/monkey) + name = "organ manipulation" + target_mobtypes = list(/mob/living/carbon/human, /mob/living/carbon/monkey) possible_locs = list(BODY_ZONE_CHEST, BODY_ZONE_HEAD) requires_real_bodypart = 1 steps = list( @@ -26,7 +26,7 @@ /datum/surgery/organ_manipulation/alien name = "Alien organ manipulation" possible_locs = list(BODY_ZONE_CHEST, BODY_ZONE_HEAD, BODY_ZONE_PRECISE_GROIN, BODY_ZONE_PRECISE_EYES, BODY_ZONE_PRECISE_MOUTH, BODY_ZONE_L_ARM, BODY_ZONE_R_ARM) - species = list(/mob/living/carbon/alien/humanoid) + target_mobtypes = list(/mob/living/carbon/alien/humanoid) steps = list( /datum/surgery_step/saw, /datum/surgery_step/incise, diff --git a/code/modules/surgery/prosthetic_replacement.dm b/code/modules/surgery/prosthetic_replacement.dm index fdceb1fb1f..8efa40a70a 100644 --- a/code/modules/surgery/prosthetic_replacement.dm +++ b/code/modules/surgery/prosthetic_replacement.dm @@ -1,7 +1,7 @@ /datum/surgery/prosthetic_replacement name = "Prosthetic replacement" steps = list(/datum/surgery_step/incise, /datum/surgery_step/clamp_bleeders, /datum/surgery_step/retract_skin, /datum/surgery_step/add_prosthetic) - species = list(/mob/living/carbon/human, /mob/living/carbon/monkey) + target_mobtypes = list(/mob/living/carbon/human, /mob/living/carbon/monkey) possible_locs = list(BODY_ZONE_R_ARM, BODY_ZONE_L_ARM, BODY_ZONE_L_LEG, BODY_ZONE_R_LEG, BODY_ZONE_HEAD) requires_bodypart = FALSE //need a missing limb requires_bodypart_type = 0 diff --git a/code/modules/surgery/surgery.dm b/code/modules/surgery/surgery.dm index b013e7f252..ccf5ad4386 100644 --- a/code/modules/surgery/surgery.dm +++ b/code/modules/surgery/surgery.dm @@ -5,8 +5,8 @@ var/list/steps = list() //Steps in a surgery var/step_in_progress = 0 //Actively performing a Surgery var/can_cancel = 1 //Can cancel this surgery after step 1 with cautery - var/list/species = list(/mob/living/carbon/human) //Acceptable Species - var/location = BODY_ZONE_CHEST //Surgery location + var/list/target_mobtypes = list(/mob/living/carbon/human) //Acceptable Species + var/location = BODY_ZONE_CHEST //Surgery location var/requires_bodypart_type = BODYPART_ORGANIC //Prevents you from performing an operation on incorrect limbs. 0 for any limb type var/list/possible_locs = list() //Multiple locations var/ignore_clothes = 0 //This surgery ignores clothes @@ -15,6 +15,7 @@ var/requires_bodypart = TRUE //Surgery available only when a bodypart is present, or only when it is missing. var/success_multiplier = 0 //Step success propability multiplier var/requires_real_bodypart = 0 //Some surgeries don't work on limbs that don't really exist + var/lying_required = TRUE //Does the vicitm needs to be lying down. /datum/surgery/New(surgery_target, surgery_location, surgery_bodypart) ..() From 4878472aa43df290873b874de46f1830fe8f01b5 Mon Sep 17 00:00:00 2001 From: Linzolle Date: Sun, 22 Sep 2019 17:39:37 -0500 Subject: [PATCH 02/14] fixes --- code/__DEFINES/traits.dm | 1 + code/modules/mob/mob_helpers.dm | 2 +- .../surgery/advanced/bioware/experimental_dissection.dm | 6 +++--- code/modules/surgery/advanced/toxichealing.dm | 2 +- code/modules/surgery/embalming.dm | 2 +- code/modules/surgery/helpers.dm | 4 ++-- 6 files changed, 9 insertions(+), 8 deletions(-) diff --git a/code/__DEFINES/traits.dm b/code/__DEFINES/traits.dm index e49da2374f..8d05c06977 100644 --- a/code/__DEFINES/traits.dm +++ b/code/__DEFINES/traits.dm @@ -109,6 +109,7 @@ #define TRAIT_NODEATH "nodeath" #define TRAIT_NOHARDCRIT "nohardcrit" #define TRAIT_NOSOFTCRIT "nosoftcrit" +#define TRAIT_MINDSHIELD "mindshield" #define TRAIT_DISSECTED "dissected" #define TRAIT_FEARLESS "fearless" #define TRAIT_UNSTABLE "unstable" diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index df86756676..9501a56992 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -491,5 +491,5 @@ It's fairly easy to fix if dealing with single letters but not so much with comp /mob/proc/common_trait_examine() . = "" - if(has_trait(TRAIT_DISSECTED)) + if(HAS_TRAIT(src, TRAIT_DISSECTED)) . += "This body has been dissected and analyzed. It is no longer worth experimenting on.
" \ No newline at end of file diff --git a/code/modules/surgery/advanced/bioware/experimental_dissection.dm b/code/modules/surgery/advanced/bioware/experimental_dissection.dm index 8406f2496e..77f6847832 100644 --- a/code/modules/surgery/advanced/bioware/experimental_dissection.dm +++ b/code/modules/surgery/advanced/bioware/experimental_dissection.dm @@ -12,7 +12,7 @@ /datum/surgery/advanced/experimental_dissection/can_start(mob/user, mob/living/carbon/target) . = ..() - if(target.has_trait(TRAIT_DISSECTED)) + if(HAS_TRAIT(target, TRAIT_DISSECTED)) return FALSE if(iscyborg(user)) return FALSE //robots cannot be creative @@ -55,7 +55,7 @@ SSresearch.science_tech.add_point_list(list(TECHWEB_POINT_TYPE_GENERIC = check_value(target))) var/obj/item/bodypart/L = target.get_bodypart(BODY_ZONE_CHEST) target.apply_damage(80, BRUTE, L) - target.add_trait(TRAIT_DISSECTED) + ADD_TRAIT(target, TRAIT_DISSECTED, "surgery") return TRUE /datum/surgery_step/dissection/failure(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) @@ -65,5 +65,5 @@ SSresearch.science_tech.add_point_list(list(TECHWEB_POINT_TYPE_GENERIC = (check_value(target) * 0.2))) var/obj/item/bodypart/L = target.get_bodypart(BODY_ZONE_CHEST) target.apply_damage(80, BRUTE, L) - target.add_trait(TRAIT_DISSECTED) + ADD_TRAIT(target, TRAIT_DISSECTED, "surgery") return TRUE \ No newline at end of file diff --git a/code/modules/surgery/advanced/toxichealing.dm b/code/modules/surgery/advanced/toxichealing.dm index a82287831c..10fd624f9d 100644 --- a/code/modules/surgery/advanced/toxichealing.dm +++ b/code/modules/surgery/advanced/toxichealing.dm @@ -11,7 +11,7 @@ /datum/surgery_step/toxichealing, /datum/surgery_step/close) - species = list(/mob/living/carbon/human, /mob/living/carbon/monkey) + target_mobtypes = list(/mob/living/carbon/human, /mob/living/carbon/monkey) possible_locs = list(BODY_ZONE_CHEST) requires_bodypart_type = 0 diff --git a/code/modules/surgery/embalming.dm b/code/modules/surgery/embalming.dm index f74d864245..f7e64f12a0 100644 --- a/code/modules/surgery/embalming.dm +++ b/code/modules/surgery/embalming.dm @@ -5,7 +5,7 @@ /datum/surgery_step/embalming, /datum/surgery_step/close) - species = list(/mob/living/carbon/human, /mob/living/carbon/monkey) + target_mobtypes = list(/mob/living/carbon/human, /mob/living/carbon/monkey) possible_locs = list(BODY_ZONE_CHEST) requires_bodypart_type = 0 diff --git a/code/modules/surgery/helpers.dm b/code/modules/surgery/helpers.dm index 73596466e5..f52bf97147 100644 --- a/code/modules/surgery/helpers.dm +++ b/code/modules/surgery/helpers.dm @@ -32,7 +32,7 @@ continue else if(C && S.requires_bodypart) //mob with no limb in surgery zone when we need a limb continue - if(S.lying_required && !(M.mobility_flags & MOBILITY_STAND)) + if(S.lying_required && !(M.lying)) continue if(!S.can_start(user, M)) continue @@ -62,7 +62,7 @@ return else if(C && S.requires_bodypart) return - if(S.lying_required && !(M.mobility_flags & MOBILITY_STAND)) + if(S.lying_required && !(M.lying)) return if(!S.can_start(user, M)) return From 129e3a9fc9a4160777b3a94fdebf0b956bf2983c Mon Sep 17 00:00:00 2001 From: terranaut1 <48527763+terranaut1@users.noreply.github.com> Date: Sat, 29 Jun 2019 01:48:46 +0200 Subject: [PATCH 03/14] make dissection available early --- code/modules/research/designs/medical_designs.dm | 2 +- code/modules/research/techweb/all_nodes.dm | 2 +- .../surgery/{advanced/bioware => }/experimental_dissection.dm | 4 ++-- tgstation.dme | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) rename code/modules/surgery/{advanced/bioware => }/experimental_dissection.dm (95%) diff --git a/code/modules/research/designs/medical_designs.dm b/code/modules/research/designs/medical_designs.dm index 989f3ce273..96f9c11e17 100644 --- a/code/modules/research/designs/medical_designs.dm +++ b/code/modules/research/designs/medical_designs.dm @@ -728,7 +728,7 @@ name = "Experimental Dissection" desc = "A surgical procedure which deeply analyzes the biology of a corpse, and automatically adds new findings to the research database." id = "surgery_exp_dissection" - surgery = /datum/surgery/advanced/experimental_dissection + surgery = /datum/surgery/experimental_dissection research_icon_state = "surgery_chest" /datum/design/surgery/lobotomy diff --git a/code/modules/research/techweb/all_nodes.dm b/code/modules/research/techweb/all_nodes.dm index 038a41b3cd..93370af547 100644 --- a/code/modules/research/techweb/all_nodes.dm +++ b/code/modules/research/techweb/all_nodes.dm @@ -115,7 +115,7 @@ display_name = "Advanced Surgery" description = "When simple medicine doesn't cut it." prereq_ids = list("adv_biotech") - design_ids = list("surgery_lobotomy", "surgery_reconstruction", "surgery_toxinhealing", "organbox", "surgery_exp_dissection") + design_ids = list("surgery_lobotomy", "surgery_reconstruction", "surgery_toxinhealing", "organbox") research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500) export_price = 5000 diff --git a/code/modules/surgery/advanced/bioware/experimental_dissection.dm b/code/modules/surgery/experimental_dissection.dm similarity index 95% rename from code/modules/surgery/advanced/bioware/experimental_dissection.dm rename to code/modules/surgery/experimental_dissection.dm index 77f6847832..c8daf9412e 100644 --- a/code/modules/surgery/advanced/bioware/experimental_dissection.dm +++ b/code/modules/surgery/experimental_dissection.dm @@ -1,4 +1,4 @@ -/datum/surgery/advanced/experimental_dissection +/datum/surgery/experimental_dissection name = "Experimental Dissection" desc = "A surgical procedure which deeply analyzes the biology of a corpse, and automatically adds new findings to the research database." steps = list(/datum/surgery_step/incise, @@ -10,7 +10,7 @@ possible_locs = list(BODY_ZONE_CHEST) target_mobtypes = list(/mob/living/carbon) //Feel free to dissect devils but they're magic. -/datum/surgery/advanced/experimental_dissection/can_start(mob/user, mob/living/carbon/target) +/datum/surgery/experimental_dissection/can_start(mob/user, mob/living/carbon/target) . = ..() if(HAS_TRAIT(target, TRAIT_DISSECTED)) return FALSE diff --git a/tgstation.dme b/tgstation.dme index f1430cebf2..638e35da5d 100755 --- a/tgstation.dme +++ b/tgstation.dme @@ -2749,6 +2749,7 @@ #include "code\modules\surgery\core_removal.dm" #include "code\modules\surgery\dental_implant.dm" #include "code\modules\surgery\embalming.dm" +#include "code\modules\surgery\experimental_dissection.dm" #include "code\modules\surgery\eye_surgery.dm" #include "code\modules\surgery\helpers.dm" #include "code\modules\surgery\implant_removal.dm" @@ -2774,7 +2775,6 @@ #include "code\modules\surgery\advanced\viral_bonding.dm" #include "code\modules\surgery\advanced\bioware\bioware.dm" #include "code\modules\surgery\advanced\bioware\bioware_surgery.dm" -#include "code\modules\surgery\advanced\bioware\experimental_dissection.dm" #include "code\modules\surgery\advanced\bioware\ligament_hook.dm" #include "code\modules\surgery\advanced\bioware\ligament_reinforcement.dm" #include "code\modules\surgery\advanced\bioware\nerve_grounding.dm" From f61e598dbce3370a41483d9d849f8c55ec377a1f Mon Sep 17 00:00:00 2001 From: moo <11748095+ExcessiveUseOfCobblestone@users.noreply.github.com> Date: Mon, 8 Jul 2019 19:57:26 -0400 Subject: [PATCH 04/14] Experimental Cobbisection [150+ Hours and Ready] (#44821) About The Pull Request & Why Dissection (Prev Experimental Dissection) Is Now Roundstart Goal:give medbay a task they can do outside of normal healing on the off chance they're overstaffed and/or are in need of work. Dissection (Prev Experimental Dissection) Is Now Tiered Goal: I'm still not seeing competition in the medical tree that I'd like to see. Now that science benefits from going to this tree, I expect it to be a prominent if not the main pick. Goal: Provide Medical bargaining power with Science. Want you cool gear bros? Better indulge us a bit if you want us to farm corpses. NOTE: You will NOT be punished for doing low tiered surgeries then unlocking further tiers. It adjusts your rewards depending on if the body has been experimented on before and gives you the difference, it will not block you from doing the surgery entirely. Repeatability Goal: Make it less balanced around the all/nothing mechanic and more with rewarding constantly running the surgery. Failing the surgery will give you a pity amount (1%, something slightly more than none in grand scheme) but more importantly will NOT add the trait that disables you from using that body for the surgery again. Silicons can now perform dissection Since It's not All/Nothing I decided to allow silicons to be able to help out. This is the first (and only) surgery that they can potentially fail. Nerfs (yikes!) Needed to nerf it to compensate for the fact that it was now roundstart. The hardest one was pointgain. I decided to mega nerf it so tiered would be desired. This was also a result in the shift of balance off the RNG and more on the repeatability. Dissection Can Now Be Performed on ANY LIVING MOB Goal: Cooperation between Mining (returning Mobs) and Medbay (turning these mobs into points) The foundation is really lacking imo since I didn't want to dance around with numbers in this PR. Currently all mobs that aren't human and aren't explicitly listed in check_value are 300 points per surgery. I hope you guys can add more mobs to the pool with better rewards (imagine dissecting the dragon for science!) Dissection Surgery Minor Edits Step Configuration Edit Needed to change just for repeatability in the dissect step (didn't like the end step being the proceeding step). I replaced the incision step with a post-dissection clamp step to keep the theme of scalpel > hemo (dissection uses scalpel) Implement Changes / Probability Effects Rewards using the researched tools (further integrates medsci coop), lowers standard gear to appropriately balance higher tiers. MISC Prices are Define Bound Everything is relative to a single number via calculating off a define instead of independent values. Balance discussion shifts from "Is X number fair" to a more tangible "Is this mob worth X times the amount of a normal human". If everything is strong/low we can just edit a single number! Let me know if there's any undoc'd changes! Changelog cl Cobby x Medbay balance: (Experimental) Dissection is now roundstart. balance: (Experimental) Dissection is now tiered and give higher point outputs than their predecessors. add: All living mobs with corpses can be dissected. code: Attention, all ss13 gamers! I need YOUR help adding mobs to the pool so they don't get the lame 60% of normal human pricing! You can dissect DRAGONS FOR CRY IT OUT LOUD! balance: You are NOT punished for doing the lower tier surgeries then unlocking higher ones! add: Borgs can perform dissection but they are not 100% successful. tweak: Shifts balance of dissection surgery towards spammability vs. rng mechanic. balance: All point rewards are severely nerfed to promote doing this multiple times (since it's now available from the getgo). tweak: If you fail the dissection step, you get a pity reward (1% credits) and can repeat the step until you successfully dissect the being. tweak: Lowered probabilty of success on default tools, increased probability for researched tools. tweak: removed 2nd incision step, added clamp step post dissection (repeatability purposes). /cl --- .../research/designs/medical_designs.dm | 18 +- code/modules/research/techweb/all_nodes.dm | 6 +- .../surgery/experimental_dissection.dm | 105 ++++++++--- code/modules/surgery/surgery.dm | 177 ++++++++++++++++++ code/modules/surgery/surgery_step.dm | 20 +- 5 files changed, 282 insertions(+), 44 deletions(-) diff --git a/code/modules/research/designs/medical_designs.dm b/code/modules/research/designs/medical_designs.dm index 96f9c11e17..c53ba430e0 100644 --- a/code/modules/research/designs/medical_designs.dm +++ b/code/modules/research/designs/medical_designs.dm @@ -725,12 +725,22 @@ var/surgery /datum/design/surgery/experimental_dissection - name = "Experimental Dissection" - desc = "A surgical procedure which deeply analyzes the biology of a corpse, and automatically adds new findings to the research database." - id = "surgery_exp_dissection" - surgery = /datum/surgery/experimental_dissection + name = "Advanced Dissection" + desc = "A surgical procedure which analyzes the biology of a corpse, and automatically adds new findings to the research database." + id = "surgery_adv_dissection" + surgery = /datum/surgery/advanced/experimental_dissection/adv research_icon_state = "surgery_chest" +/datum/design/surgery/experimental_dissection/exp + name = "Experimental Dissection" + id = "surgery_exp_dissection" + surgery = /datum/surgery/advanced/experimental_dissection/exp + +/datum/design/surgery/experimental_dissection/exp + name = "Extraterrestrial Dissection" + id = "surgery_ext_dissection" + surgery = /datum/surgery/advanced/experimental_dissection/alien + /datum/design/surgery/lobotomy name = "Lobotomy" desc = "An invasive surgical procedure which guarantees removal of almost all brain traumas, but might cause another permanent trauma in return." diff --git a/code/modules/research/techweb/all_nodes.dm b/code/modules/research/techweb/all_nodes.dm index 93370af547..cb5112353e 100644 --- a/code/modules/research/techweb/all_nodes.dm +++ b/code/modules/research/techweb/all_nodes.dm @@ -115,7 +115,7 @@ display_name = "Advanced Surgery" description = "When simple medicine doesn't cut it." prereq_ids = list("adv_biotech") - design_ids = list("surgery_lobotomy", "surgery_reconstruction", "surgery_toxinhealing", "organbox") + design_ids = list("surgery_lobotomy", "surgery_reconstruction", "surgery_toxinhealing", "organbox", "surgery_adv_dissection") research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500) export_price = 5000 @@ -124,7 +124,7 @@ display_name = "Experimental Surgery" description = "When evolution isn't fast enough." prereq_ids = list("adv_surgery") - design_ids = list("surgery_revival","surgery_pacify","surgery_vein_thread","surgery_nerve_splice","surgery_nerve_ground","surgery_ligament_hook","surgery_ligament_reinforcement","surgery_viral_bond") + design_ids = list("surgery_revival","surgery_pacify","surgery_vein_thread","surgery_nerve_splice","surgery_nerve_ground","surgery_ligament_hook","surgery_ligament_reinforcement","surgery_viral_bond", "surgery_exp_dissection") research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 5000) export_price = 5000 @@ -133,7 +133,7 @@ display_name = "Alien Surgery" description = "Abductors did nothing wrong." prereq_ids = list("exp_surgery", "alientech") - design_ids = list("surgery_brainwashing","surgery_zombie") + design_ids = list("surgery_brainwashing","surgery_zombie", "surgery_ext_dissection") research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 10000) export_price = 5000 diff --git a/code/modules/surgery/experimental_dissection.dm b/code/modules/surgery/experimental_dissection.dm index c8daf9412e..6dc9441b0c 100644 --- a/code/modules/surgery/experimental_dissection.dm +++ b/code/modules/surgery/experimental_dissection.dm @@ -1,61 +1,87 @@ -/datum/surgery/experimental_dissection - name = "Experimental Dissection" - desc = "A surgical procedure which deeply analyzes the biology of a corpse, and automatically adds new findings to the research database." +#define BASE_HUMAN_REWARD 500 +#define EXPDIS_FAIL_MSG "You dissect [target], but do not find anything particularly interesting." + +/datum/surgery/advanced/experimental_dissection + name = "Dissection" + desc = "A surgical procedure which analyzes the biology of a corpse, and automatically adds new findings to the research database." steps = list(/datum/surgery_step/incise, /datum/surgery_step/retract_skin, /datum/surgery_step/clamp_bleeders, - /datum/surgery_step/incise, /datum/surgery_step/dissection, + /datum/surgery_step/clamp_bleeders, /datum/surgery_step/close) possible_locs = list(BODY_ZONE_CHEST) - target_mobtypes = list(/mob/living/carbon) //Feel free to dissect devils but they're magic. + target_mobtypes = list(/mob/living) //Feel free to dissect devils but they're magic. + replaced_by = /datum/surgery/advanced/experimental_dissection/adv + requires_tech = FALSE + var/value_multiplier = 1 -/datum/surgery/experimental_dissection/can_start(mob/user, mob/living/carbon/target) +/datum/surgery/advanced/experimental_dissection/can_start(mob/user, mob/living/target) . = ..() - if(HAS_TRAIT(target, TRAIT_DISSECTED)) + if(HAS_TRAIT_FROM(target, TRAIT_DISSECTED,"[name]")) return FALSE - if(iscyborg(user)) - return FALSE //robots cannot be creative - //(also this surgery shouldn't be consistently successful, and cyborgs have a 100% success rate on surgery) if(target.stat != DEAD) return FALSE /datum/surgery_step/dissection name = "dissection" - implements = list(/obj/item/scalpel = 60, /obj/item/kitchen/knife = 30, /obj/item/shard = 15) + implements = list(/obj/item/scalpel/augment = 75, /obj/item/scalpel/advanced = 60, /obj/item/scalpel = 45, /obj/item/kitchen/knife = 20, /obj/item/shard = 10)// special tools not only cut down time but also improve probability time = 125 + silicons_obey_prob = TRUE + repeatable = TRUE /datum/surgery_step/dissection/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) display_results(user, target, "You start dissecting [target].", "[user] starts dissecting [target].", "[user] starts dissecting [target].") -/datum/surgery_step/dissection/proc/check_value(mob/living/carbon/target) +/datum/surgery_step/dissection/proc/check_value(mob/living/target, datum/surgery/advanced/experimental_dissection/ED) + var/cost = BASE_HUMAN_REWARD + var/multi_surgery_adjust = 0 + + //determine bonus applied if(isalienroyal(target)) - return 10000 + cost = (BASE_HUMAN_REWARD*10) else if(isalienadult(target)) - return 5000 + cost = (BASE_HUMAN_REWARD*5) else if(ismonkey(target)) - return 1000 + cost = (BASE_HUMAN_REWARD*0.5) else if(ishuman(target)) var/mob/living/carbon/human/H = target - if(H.dna && H.dna.species) + if(H?.dna?.species) if(isabductor(H)) - return 8000 - if(isgolem(H) || iszombie(H)) - return 4000 - if(isjellyperson(H) || ispodperson(H)) - return 3000 - return 2000 + cost = (BASE_HUMAN_REWARD*4) + else if(isgolem(H) || iszombie(H)) + cost = (BASE_HUMAN_REWARD*3) + /*else if(isjellyperson(H) || ispodperson(H)) CITADEL CHANGE: jelly and pod being available roundstart shouldn't give additional points + cost = (BASE_HUMAN_REWARD*2)*/ + else + cost = (BASE_HUMAN_REWARD * 0.6) -/datum/surgery_step/dissection/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) - display_results(user, target, "You dissect [target], and add your discoveries to the research database!", - "[user] dissects [target], adding [user.p_their()] discoveries to the research database!", + + + //now we do math for surgeries already done (no double dipping!). + for(var/i in typesof(/datum/surgery/advanced/experimental_dissection)) + var/datum/surgery/advanced/experimental_dissection/cringe = i + if(HAS_TRAIT_FROM(target,TRAIT_DISSECTED,"[initial(cringe.name)]")) + multi_surgery_adjust = max(multi_surgery_adjust,initial(cringe.value_multiplier)) - 1 + + multi_surgery_adjust *= cost + + //multiply by multiplier in surgery + cost *= ED.value_multiplier + return (cost-multi_surgery_adjust) + +/datum/surgery_step/dissection/success(mob/user, mob/living/target, target_zone, obj/item/tool, datum/surgery/surgery) + var/points_earned = check_value(target, surgery) + display_results(user, target, "You dissect [target], and add your [points_earned] point\s worth of discoveries to the research database!", + "[user] dissects [target], discovering [points_earned] point\s of data!", "[user] dissects [target]!") - SSresearch.science_tech.add_point_list(list(TECHWEB_POINT_TYPE_GENERIC = check_value(target))) + SSresearch.science_tech.add_point_list(list(TECHWEB_POINT_TYPE_GENERIC = points_earned)) var/obj/item/bodypart/L = target.get_bodypart(BODY_ZONE_CHEST) target.apply_damage(80, BRUTE, L) - ADD_TRAIT(target, TRAIT_DISSECTED, "surgery") + ADD_TRAIT(target, TRAIT_DISSECTED, "[surgery.name]") + repeatable = FALSE return TRUE /datum/surgery_step/dissection/failure(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) @@ -63,7 +89,28 @@ "[user] dissects [target], however it seems [user.p_they()] didn't find anything useful.", "[user] dissects [target], but looks a little dissapointed.") SSresearch.science_tech.add_point_list(list(TECHWEB_POINT_TYPE_GENERIC = (check_value(target) * 0.2))) + SSresearch.science_tech.add_point_list(list(TECHWEB_POINT_TYPE_GENERIC = (round(check_value(target, surgery) * 0.01)))) var/obj/item/bodypart/L = target.get_bodypart(BODY_ZONE_CHEST) target.apply_damage(80, BRUTE, L) - ADD_TRAIT(target, TRAIT_DISSECTED, "surgery") - return TRUE \ No newline at end of file + return TRUE + +/datum/surgery/advanced/experimental_dissection/adv + name = "Thorough Dissection" + value_multiplier = 2 + replaced_by = /datum/surgery/advanced/experimental_dissection/exp + requires_tech = TRUE + +/datum/surgery/advanced/experimental_dissection/exp + name = "Experimental Dissection" + value_multiplier = 5 + replaced_by = /datum/surgery/advanced/experimental_dissection/alien + requires_tech = TRUE + +/datum/surgery/advanced/experimental_dissection/alien + name = "Extraterrestrial Dissection" + value_multiplier = 10 + requires_tech = TRUE + + +#undef BASE_HUMAN_REWARD +#undef EXPDIS_FAIL_MSG diff --git a/code/modules/surgery/surgery.dm b/code/modules/surgery/surgery.dm index ccf5ad4386..a220abba6c 100644 --- a/code/modules/surgery/surgery.dm +++ b/code/modules/surgery/surgery.dm @@ -1,3 +1,4 @@ +<<<<<<< HEAD /datum/surgery var/name = "surgery" var/desc = "surgery description" @@ -154,3 +155,179 @@ //RESOLVED ISSUES //"Todo" jobs that have been completed //combine hands/feet into the arms - Hands/feet were removed - RR //surgeries (not steps) that can be initiated on any body part (corresponding with damage locations) - Call this one done, see possible_locs var - c0 +======= +/datum/surgery + var/name = "surgery" + var/desc = "surgery description" + var/status = 1 + var/list/steps = list() //Steps in a surgery + var/step_in_progress = FALSE //Actively performing a Surgery + var/can_cancel = TRUE //Can cancel this surgery after step 1 with cautery + var/list/target_mobtypes = list(/mob/living/carbon/human) //Acceptable Species + var/location = BODY_ZONE_CHEST //Surgery location + var/requires_bodypart_type = BODYPART_ORGANIC //Prevents you from performing an operation on incorrect limbs. 0 for any limb type + var/list/possible_locs = list() //Multiple locations + var/ignore_clothes = FALSE //This surgery ignores clothes + var/mob/living/carbon/target //Operation target mob + var/obj/item/bodypart/operated_bodypart //Operable body part + var/requires_bodypart = TRUE //Surgery available only when a bodypart is present, or only when it is missing. + var/success_multiplier = 0 //Step success propability multiplier + var/requires_real_bodypart = FALSE //Some surgeries don't work on limbs that don't really exist + var/lying_required = TRUE //Does the vicitm needs to be lying down. + var/self_operable = FALSE //Can the surgery be performed on yourself. + 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) + +/datum/surgery/New(surgery_target, surgery_location, surgery_bodypart) + ..() + if(surgery_target) + target = surgery_target + target.surgeries += src + if(surgery_location) + location = surgery_location + if(surgery_bodypart) + operated_bodypart = surgery_bodypart + +/datum/surgery/Destroy() + if(target) + target.surgeries -= src + target = null + operated_bodypart = null + return ..() + + +/datum/surgery/proc/can_start(mob/user, mob/living) //FALSE to not show in list + . = TRUE + if(replaced_by == /datum/surgery) + return FALSE + + if(HAS_TRAIT(user, TRAIT_SURGEON) || HAS_TRAIT(user.mind, TRAIT_SURGEON)) + if(replaced_by) + return FALSE + else + return TRUE + + if(!requires_tech && !replaced_by) + return TRUE + // True surgeons (like abductor scientists) need no instructions + + if(requires_tech) + . = FALSE + + if(iscyborg(user)) + var/mob/living/silicon/robot/R = user + var/obj/item/surgical_processor/SP = locate() in R.module.modules + if(!SP || (replaced_by in SP.advanced_surgeries)) + return FALSE + if(type in SP.advanced_surgeries) + return TRUE + + + var/turf/T = get_turf(target) + var/obj/structure/table/optable/table = locate(/obj/structure/table/optable, T) + if(table) + if(!table.computer) + return FALSE + if(table.computer.stat & (NOPOWER|BROKEN) || (replaced_by in table.computer.advanced_surgeries)) + return FALSE + if(type in table.computer.advanced_surgeries) + return TRUE + + +/datum/surgery/proc/next_step(mob/user, intent) + if(step_in_progress) + return TRUE + + var/try_to_fail = FALSE + if(intent == INTENT_DISARM) + try_to_fail = TRUE + + var/datum/surgery_step/S = get_surgery_step() + if(S) + var/obj/item/tool = user.get_active_held_item() + if(S.try_op(user, target, user.zone_selected, tool, src, try_to_fail)) + return TRUE + if(iscyborg(user) && user.a_intent != INTENT_HARM) //to save asimov borgs a LOT of heartache + return TRUE + if(tool.item_flags & SURGICAL_TOOL) //Just because you used the wrong tool it doesn't mean you meant to whack the patient with it + to_chat(user, "This step requires a different tool!") + return TRUE + return FALSE + +/datum/surgery/proc/get_surgery_step() + var/step_type = steps[status] + return new step_type + +/datum/surgery/proc/get_surgery_next_step() + if(status < steps.len) + var/step_type = steps[status + 1] + return new step_type + else + return null + +/datum/surgery/proc/complete() + SSblackbox.record_feedback("tally", "surgeries_completed", 1, type) + qdel(src) + +/datum/surgery/proc/get_propability_multiplier() + var/propability = 0.5 + var/turf/T = get_turf(target) + + if(locate(/obj/structure/table/optable, T)) + propability = 1 + else if(locate(/obj/machinery/stasis, T)) + propability = 0.9 + else if(locate(/obj/structure/table, T)) + propability = 0.8 + else if(locate(/obj/structure/bed, T)) + propability = 0.7 + + return propability + success_multiplier + +/datum/surgery/advanced + name = "advanced surgery" + requires_tech = TRUE + +/obj/item/disk/surgery + name = "Surgery Procedure Disk" + desc = "A disk that contains advanced surgery procedures, must be loaded into an Operating Console." + icon_state = "datadisk1" + materials = list(MAT_METAL=300, MAT_GLASS=100) + var/list/surgeries + +/obj/item/disk/surgery/debug + name = "Debug Surgery Disk" + desc = "A disk that contains all existing surgery procedures." + icon_state = "datadisk1" + materials = list(MAT_METAL=300, MAT_GLASS=100) + +/obj/item/disk/surgery/debug/Initialize() + . = ..() + surgeries = list() + var/list/req_tech_surgeries = subtypesof(/datum/surgery) + for(var/i in req_tech_surgeries) + var/datum/surgery/beep = i + if(beep.requires_tech) + surgeries += beep + +//INFO +//Check /mob/living/carbon/attackby for how surgery progresses, and also /mob/living/carbon/attack_hand. +//As of Feb 21 2013 they are in code/modules/mob/living/carbon/carbon.dm, lines 459 and 51 respectively. +//Other important variables are var/list/surgeries (/mob/living) and var/list/internal_organs (/mob/living/carbon) +// var/list/bodyparts (/mob/living/carbon/human) is the LIMBS of a Mob. +//Surgical procedures are initiated by attempt_initiate_surgery(), which is called by surgical drapes and bedsheets. + + +//TODO +//specific steps for some surgeries (fluff text) +//more interesting failure options +//randomised complications +//more surgeries! +//add a probability modifier for the state of the surgeon- health, twitching, etc. blindness, god forbid. +//helper for converting a zone_sel.selecting to body part (for damage) + + +//RESOLVED ISSUES //"Todo" jobs that have been completed +//combine hands/feet into the arms - Hands/feet were removed - RR +//surgeries (not steps) that can be initiated on any body part (corresponding with damage locations) - Call this one done, see possible_locs var - c0 +>>>>>>> 8fcf42eff9... Experimental Cobbisection [150+ Hours and Ready] (#44821) diff --git a/code/modules/surgery/surgery_step.dm b/code/modules/surgery/surgery_step.dm index c5a944fbb2..71f813a5b5 100644 --- a/code/modules/surgery/surgery_step.dm +++ b/code/modules/surgery/surgery_step.dm @@ -8,7 +8,9 @@ var/repeatable = FALSE //can this step be repeated? Make shure it isn't last step, or it used in surgery with `can_cancel = 1`. Or surgion will be stuck in the loop var/list/chems_needed = list() //list of chems needed to complete the step. Even on success, the step will have no effect if there aren't the chems required in the mob. var/require_all_chems = TRUE //any on the list or all on the list? -/datum/surgery_step/proc/try_op(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery, try_to_fail = FALSE) + var/silicons_obey_prob = FALSE + +/datum/surgery_step/proc/try_op(mob/user, mob/living/target, target_zone, obj/item/tool, datum/surgery/surgery, try_to_fail = FALSE) var/success = FALSE if(accept_hand) if(!tool) @@ -46,7 +48,8 @@ else surgery.status-- return FALSE -/datum/surgery_step/proc/initiate(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery, try_to_fail = FALSE) + +/datum/surgery_step/proc/initiate(mob/user, mob/living/target, target_zone, obj/item/tool, datum/surgery/surgery, try_to_fail = FALSE) surgery.step_in_progress = TRUE var/speed_mod = 1 var/advance = FALSE @@ -60,7 +63,8 @@ if(implement_type) //this means it isn't a require hand or any item step. prob_chance = implements[implement_type] prob_chance *= surgery.get_propability_multiplier() - if((prob(prob_chance) || iscyborg(user)) && chem_check(target) && !try_to_fail) + + if((prob(prob_chance) || (iscyborg(user) && !silicons_obey_prob)) && chem_check(target) && !try_to_fail) if(success(user, target, target_zone, tool, surgery)) advance = TRUE else @@ -73,19 +77,18 @@ surgery.step_in_progress = FALSE return advance - -/datum/surgery_step/proc/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) +/datum/surgery_step/proc/preop(mob/user, mob/living/target, target_zone, obj/item/tool, datum/surgery/surgery) display_results(user, target, "You begin to perform surgery on [target]...", "[user] begins to perform surgery on [target].", "[user] begins to perform surgery on [target].") -/datum/surgery_step/proc/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) +/datum/surgery_step/proc/success(mob/user, mob/living/target, target_zone, obj/item/tool, datum/surgery/surgery) display_results(user, target, "You succeed.", "[user] succeeds!", "[user] finishes.") return TRUE -/datum/surgery_step/proc/failure(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) +/datum/surgery_step/proc/failure(mob/user, mob/living/target, target_zone, obj/item/tool, datum/surgery/surgery) display_results(user, target, "You screw up!", "[user] screws up!", "[user] finishes.", TRUE) //By default the patient will notice if the wrong thing has been cut @@ -93,7 +96,8 @@ /datum/surgery_step/proc/tool_check(mob/user, obj/item/tool) return TRUE -/datum/surgery_step/proc/chem_check(mob/living/carbon/target) + +/datum/surgery_step/proc/chem_check(mob/living/target) if(!LAZYLEN(chems_needed)) return TRUE if(require_all_chems) From 3c526d9dbd784f271ddcc5ef0ab8ef4b58ccf4f8 Mon Sep 17 00:00:00 2001 From: moo <11748095+ExcessiveUseOfCobblestone@users.noreply.github.com> Date: Sun, 11 Aug 2019 19:39:25 -0400 Subject: [PATCH 05/14] Dissection Examine + Logic Fix + Ayy (#45807) clDissectby add: Examining a dissected body will provide insight on the highest tier performed. fix: You can do ayy dissection now if you get the tech fix: FINALLY fixed the surgery logic correctly /cl --- code/modules/mob/mob_helpers.dm | 10 +- .../surgery/experimental_dissection.dm | 1 + code/modules/surgery/surgery.dm | 202 ++---------------- 3 files changed, 28 insertions(+), 185 deletions(-) diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index 9501a56992..78b7bc81da 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -492,4 +492,12 @@ It's fairly easy to fix if dealing with single letters but not so much with comp . = "" if(HAS_TRAIT(src, TRAIT_DISSECTED)) - . += "This body has been dissected and analyzed. It is no longer worth experimenting on.
" \ No newline at end of file + . += "This body has been dissected and analyzed. It is no longer worth experimenting on.
" + var/dissectionmsg = "" + if(HAS_TRAIT_FROM(src, TRAIT_DISSECTED,"Extraterrestrial Dissection")) + dissectionmsg = " via Extraterrestrial Dissection. It is no longer worth experimenting on" + else if(HAS_TRAIT_FROM(src, TRAIT_DISSECTED,"Experimental Dissection")) + dissectionmsg = " via Experimental Dissection" + else if(HAS_TRAIT_FROM(src, TRAIT_DISSECTED,"Thorough Dissection")) + dissectionmsg = " via Thorough Dissection" + . += "This body has been dissected and analyzed[dissectionmsg].
" \ No newline at end of file diff --git a/code/modules/surgery/experimental_dissection.dm b/code/modules/surgery/experimental_dissection.dm index 6dc9441b0c..8179a91336 100644 --- a/code/modules/surgery/experimental_dissection.dm +++ b/code/modules/surgery/experimental_dissection.dm @@ -110,6 +110,7 @@ name = "Extraterrestrial Dissection" value_multiplier = 10 requires_tech = TRUE + replaced_by = null #undef BASE_HUMAN_REWARD diff --git a/code/modules/surgery/surgery.dm b/code/modules/surgery/surgery.dm index a220abba6c..4ac1c4d246 100644 --- a/code/modules/surgery/surgery.dm +++ b/code/modules/surgery/surgery.dm @@ -1,182 +1,23 @@ -<<<<<<< HEAD -/datum/surgery - var/name = "surgery" - var/desc = "surgery description" - var/status = 1 - var/list/steps = list() //Steps in a surgery - var/step_in_progress = 0 //Actively performing a Surgery - var/can_cancel = 1 //Can cancel this surgery after step 1 with cautery - var/list/target_mobtypes = list(/mob/living/carbon/human) //Acceptable Species - var/location = BODY_ZONE_CHEST //Surgery location - var/requires_bodypart_type = BODYPART_ORGANIC //Prevents you from performing an operation on incorrect limbs. 0 for any limb type - var/list/possible_locs = list() //Multiple locations - var/ignore_clothes = 0 //This surgery ignores clothes - var/mob/living/carbon/target //Operation target mob - var/obj/item/bodypart/operated_bodypart //Operable body part - var/requires_bodypart = TRUE //Surgery available only when a bodypart is present, or only when it is missing. - var/success_multiplier = 0 //Step success propability multiplier - var/requires_real_bodypart = 0 //Some surgeries don't work on limbs that don't really exist - var/lying_required = TRUE //Does the vicitm needs to be lying down. - -/datum/surgery/New(surgery_target, surgery_location, surgery_bodypart) - ..() - if(surgery_target) - target = surgery_target - target.surgeries += src - if(surgery_location) - location = surgery_location - if(surgery_bodypart) - operated_bodypart = surgery_bodypart - -/datum/surgery/Destroy() - if(target) - target.surgeries -= src - target = null - operated_bodypart = null - return ..() - - -/datum/surgery/proc/can_start(mob/user, mob/living/carbon/target) - // if 0 surgery wont show up in list - // put special restrictions here - return 1 - -/datum/surgery/proc/next_step(mob/user, intent) - if(step_in_progress) - return 1 - - var/try_to_fail = FALSE - if(intent == INTENT_DISARM) - try_to_fail = TRUE - - var/datum/surgery_step/S = get_surgery_step() - if(S) - var/obj/item/tool = user.get_active_held_item() - if(S.try_op(user, target, user.zone_selected, tool, src, try_to_fail)) - return TRUE - if(iscyborg(user) && user.a_intent != INTENT_HARM) //to save asimov borgs a LOT of heartache - return TRUE - if(tool.item_flags & SURGICAL_TOOL) //Just because you used the wrong tool it doesn't mean you meant to whack the patient with it - to_chat(user, "This step requires a different tool!") - return TRUE - -/datum/surgery/proc/get_surgery_step() - var/step_type = steps[status] - return new step_type - -/datum/surgery/proc/get_surgery_next_step() - if(status < steps.len) - var/step_type = steps[status + 1] - return new step_type - else - return null - -/datum/surgery/proc/complete() - SSblackbox.record_feedback("tally", "surgeries_completed", 1, type) - qdel(src) - -/datum/surgery/proc/get_propability_multiplier() - var/propability = 0.5 - var/turf/T = get_turf(target) - - if(locate(/obj/structure/table/optable, T)) - propability = 1 - else if(locate(/obj/structure/table, T)) - propability = 0.8 - else if(locate(/obj/structure/bed, T)) - propability = 0.7 - - return propability + success_multiplier - -/datum/surgery/advanced - name = "advanced surgery" - -/datum/surgery/advanced/can_start(mob/user, mob/living/carbon/target) - if(!..()) - return FALSE - //Abductor scientists need no instructions - if(isabductor(user)) - var/mob/living/carbon/human/H = user - var/datum/species/abductor/S = H.dna.species - if(S.scientist) - return TRUE - - if(iscyborg(user)) - var/mob/living/silicon/robot/R = user - var/obj/item/surgical_processor/SP = locate() in R.module.modules - if(!SP) - return FALSE - if(type in SP.advanced_surgeries) - return TRUE - - var/turf/T = get_turf(target) - var/obj/structure/table/optable/table = locate(/obj/structure/table/optable, T) - if(!table || !table.computer) - return FALSE - if(table.computer.stat & (NOPOWER|BROKEN)) - return FALSE - if(type in table.computer.advanced_surgeries) - return TRUE - -/obj/item/disk/surgery - name = "Surgery Procedure Disk" - desc = "A disk that contains advanced surgery procedures, must be loaded into an Operating Console." - icon_state = "datadisk1" - materials = list(MAT_METAL=300, MAT_GLASS=100) - var/list/surgeries - -/obj/item/disk/surgery/debug - name = "Debug Surgery Disk" - desc = "A disk that contains all existing surgery procedures." - icon_state = "datadisk1" - materials = list(MAT_METAL=300, MAT_GLASS=100) - -/obj/item/disk/surgery/debug/Initialize() - . = ..() - surgeries = subtypesof(/datum/surgery/advanced) - -//INFO -//Check /mob/living/carbon/attackby for how surgery progresses, and also /mob/living/carbon/attack_hand. -//As of Feb 21 2013 they are in code/modules/mob/living/carbon/carbon.dm, lines 459 and 51 respectively. -//Other important variables are var/list/surgeries (/mob/living) and var/list/internal_organs (/mob/living/carbon) -// var/list/bodyparts (/mob/living/carbon/human) is the LIMBS of a Mob. -//Surgical procedures are initiated by attempt_initiate_surgery(), which is called by surgical drapes and bedsheets. - - -//TODO -//specific steps for some surgeries (fluff text) -//more interesting failure options -//randomised complications -//more surgeries! -//add a probability modifier for the state of the surgeon- health, twitching, etc. blindness, god forbid. -//helper for converting a zone_sel.selecting to body part (for damage) - - -//RESOLVED ISSUES //"Todo" jobs that have been completed -//combine hands/feet into the arms - Hands/feet were removed - RR -//surgeries (not steps) that can be initiated on any body part (corresponding with damage locations) - Call this one done, see possible_locs var - c0 -======= /datum/surgery var/name = "surgery" var/desc = "surgery description" var/status = 1 var/list/steps = list() //Steps in a surgery - var/step_in_progress = FALSE //Actively performing a Surgery - var/can_cancel = TRUE //Can cancel this surgery after step 1 with cautery + var/step_in_progress = 0 //Actively performing a Surgery + var/can_cancel = 1 //Can cancel this surgery after step 1 with cautery var/list/target_mobtypes = list(/mob/living/carbon/human) //Acceptable Species var/location = BODY_ZONE_CHEST //Surgery location var/requires_bodypart_type = BODYPART_ORGANIC //Prevents you from performing an operation on incorrect limbs. 0 for any limb type var/list/possible_locs = list() //Multiple locations - var/ignore_clothes = FALSE //This surgery ignores clothes + var/ignore_clothes = 0 //This surgery ignores clothes var/mob/living/carbon/target //Operation target mob var/obj/item/bodypart/operated_bodypart //Operable body part var/requires_bodypart = TRUE //Surgery available only when a bodypart is present, or only when it is missing. var/success_multiplier = 0 //Step success propability multiplier - var/requires_real_bodypart = FALSE //Some surgeries don't work on limbs that don't really exist + var/requires_real_bodypart = 0 //Some surgeries don't work on limbs that don't really exist var/lying_required = TRUE //Does the vicitm needs to be lying down. - var/self_operable = FALSE //Can the surgery be performed on yourself. - 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/requires_tech = FALSE + var/replaced_by /datum/surgery/New(surgery_target, surgery_location, surgery_bodypart) ..() @@ -201,7 +42,7 @@ if(replaced_by == /datum/surgery) return FALSE - if(HAS_TRAIT(user, TRAIT_SURGEON) || HAS_TRAIT(user.mind, TRAIT_SURGEON)) + if(HAS_TRAIT(user, TRAIT_SURGEON)) if(replaced_by) return FALSE else @@ -217,10 +58,11 @@ if(iscyborg(user)) var/mob/living/silicon/robot/R = user var/obj/item/surgical_processor/SP = locate() in R.module.modules - if(!SP || (replaced_by in SP.advanced_surgeries)) - return FALSE - if(type in SP.advanced_surgeries) - return TRUE + if(SP) + if (replaced_by in SP.advanced_surgeries) + return FALSE + if(type in SP.advanced_surgeries) + return TRUE var/turf/T = get_turf(target) @@ -228,15 +70,16 @@ if(table) if(!table.computer) return FALSE - if(table.computer.stat & (NOPOWER|BROKEN) || (replaced_by in table.computer.advanced_surgeries)) + if(table.computer.stat & (NOPOWER|BROKEN)) + return . + if(replaced_by in table.computer.advanced_surgeries) return FALSE if(type in table.computer.advanced_surgeries) return TRUE - /datum/surgery/proc/next_step(mob/user, intent) if(step_in_progress) - return TRUE + return 1 var/try_to_fail = FALSE if(intent == INTENT_DISARM) @@ -252,7 +95,6 @@ if(tool.item_flags & SURGICAL_TOOL) //Just because you used the wrong tool it doesn't mean you meant to whack the patient with it to_chat(user, "This step requires a different tool!") return TRUE - return FALSE /datum/surgery/proc/get_surgery_step() var/step_type = steps[status] @@ -275,8 +117,6 @@ if(locate(/obj/structure/table/optable, T)) propability = 1 - else if(locate(/obj/machinery/stasis, T)) - propability = 0.9 else if(locate(/obj/structure/table, T)) propability = 0.8 else if(locate(/obj/structure/bed, T)) @@ -303,12 +143,7 @@ /obj/item/disk/surgery/debug/Initialize() . = ..() - surgeries = list() - var/list/req_tech_surgeries = subtypesof(/datum/surgery) - for(var/i in req_tech_surgeries) - var/datum/surgery/beep = i - if(beep.requires_tech) - surgeries += beep + surgeries = subtypesof(/datum/surgery/advanced) //INFO //Check /mob/living/carbon/attackby for how surgery progresses, and also /mob/living/carbon/attack_hand. @@ -329,5 +164,4 @@ //RESOLVED ISSUES //"Todo" jobs that have been completed //combine hands/feet into the arms - Hands/feet were removed - RR -//surgeries (not steps) that can be initiated on any body part (corresponding with damage locations) - Call this one done, see possible_locs var - c0 ->>>>>>> 8fcf42eff9... Experimental Cobbisection [150+ Hours and Ready] (#44821) +//surgeries (not steps) that can be initiated on any body part (corresponding with damage locations) - Call this one done, see possible_locs var - c0 \ No newline at end of file From 4b36e6263e46c75ae0ed4863ca21bc430da348f5 Mon Sep 17 00:00:00 2001 From: Jack Edge Date: Fri, 7 Dec 2018 18:06:10 +0000 Subject: [PATCH 06/14] ABDUCTOR SHIT I GUESS --- code/__DEFINES/traits.dm | 5 ++ code/datums/traits.dm | 75 +++++++++++++++++++ code/modules/antagonists/abductor/abductor.dm | 18 +++-- .../abductor/equipment/abduction_gear.dm | 26 ++++--- .../antagonists/abductor/equipment/gland.dm | 18 +++++ .../antagonists/abductor/machinery/camera.dm | 3 +- .../antagonists/abductor/machinery/console.dm | 2 +- .../antagonists/abductor/machinery/pad.dm | 2 +- .../carbon/human/species_types/abductors.dm | 4 - 9 files changed, 127 insertions(+), 26 deletions(-) create mode 100644 code/datums/traits.dm diff --git a/code/__DEFINES/traits.dm b/code/__DEFINES/traits.dm index 8d05c06977..dd498017d3 100644 --- a/code/__DEFINES/traits.dm +++ b/code/__DEFINES/traits.dm @@ -122,6 +122,9 @@ #define TRAIT_STRONG_GRABBER "strong_grabber" #define TRAIT_CALCIUM_HEALER "calcium_healer" #define TRAIT_CAPTAIN_METABOLISM "captain-metabolism" +#define TRAIT_ABDUCTOR_TRAINING "abductor-training" +#define TRAIT_ABDUCTOR_SCIENTIST_TRAINING "abductor-scientist-training" +#define TRAIT_SURGEON "surgeon" //non-mob traits #define TRAIT_PARALYSIS "paralysis" //Used for limb-based paralysis, where replacing the limb will fix it @@ -187,6 +190,7 @@ #define STASIS_MUTE "stasis" #define GENETICS_SPELL "genetics_spell" #define EYES_COVERED "eyes_covered" +<<<<<<< HEAD #define CULT_TRAIT "cult" #define CLOWN_NUKE_TRAIT "clown-nuke" #define STICKY_MOUSTACHE_TRAIT "sticky-moustache" @@ -208,3 +212,4 @@ #define LOCKED_HELMET_TRAIT "locked-helmet" #define NINJA_SUIT_TRAIT "ninja-suit" #define ANTI_DROP_IMPLANT_TRAIT "anti-drop-implant" +#define ABDUCTOR_ANTAGONIST "abductor-antagonist" \ No newline at end of file diff --git a/code/datums/traits.dm b/code/datums/traits.dm new file mode 100644 index 0000000000..15715c3c88 --- /dev/null +++ b/code/datums/traits.dm @@ -0,0 +1,75 @@ +/datum/proc/add_trait(trait, source) + LAZYINITLIST(status_traits) + + if(!status_traits[trait]) + status_traits[trait] = list(source) + else + status_traits[trait] |= list(source) + + +/datum/proc/remove_trait(trait, list/sources, force) + if(!status_traits) + return //nothing to remove + + if(!status_traits[trait]) + return + + if(locate(ROUNDSTART_TRAIT) in status_traits[trait] && !force) //mob traits applied through roundstart cannot normally be removed + return + + if(!sources) // No defined source cures the trait entirely. + status_traits -= trait + return + + if(!islist(sources)) + sources = list(sources) + + if(LAZYLEN(sources)) + for(var/S in sources) + if(S in status_traits[trait]) + status_traits[trait] -= S + else + status_traits[trait] = list() + + if(!LAZYLEN(status_traits[trait])) + status_traits -= trait + +/datum/proc/has_trait(trait, list/sources) + if(!status_traits) + return FALSE //well of course it doesn't have the trait + + if(!status_traits[trait]) + return FALSE + + . = FALSE + + if(sources && !islist(sources)) + sources = list(sources) + if(LAZYLEN(sources)) + for(var/S in sources) + if(S in status_traits[trait]) + return TRUE + else if(LAZYLEN(status_traits[trait])) + return TRUE + +/datum/proc/remove_all_traits(remove_species_traits = FALSE, remove_organ_traits = FALSE, remove_quirks = FALSE) + if(!status_traits) + return //nothing to remove + + var/list/blacklisted_sources = list() + if(!remove_species_traits) + blacklisted_sources += SPECIES_TRAIT + if(!remove_organ_traits) + blacklisted_sources += ORGAN_TRAIT + if(!remove_quirks) + blacklisted_sources += ROUNDSTART_TRAIT + + for(var/kebab in status_traits) + var/skip + for(var/S in blacklisted_sources) + if(S in status_traits[kebab]) + skip = TRUE + break + if(!skip) + remove_trait(kebab, null, TRUE) + CHECK_TICK diff --git a/code/modules/antagonists/abductor/abductor.dm b/code/modules/antagonists/abductor/abductor.dm index 0fca957ffe..c13106ce02 100644 --- a/code/modules/antagonists/abductor/abductor.dm +++ b/code/modules/antagonists/abductor/abductor.dm @@ -44,6 +44,7 @@ owner.assigned_role = "[name] [sub_role]" owner.objectives += team.objectives finalize_abductor() + owner.add_trait(TRAIT_ABDUCTOR_TRAINING, ABDUCTOR_ANTAGONIST) return ..() /datum/antagonist/abductor/on_removal() @@ -51,6 +52,7 @@ if(owner.current) to_chat(owner.current,"You are no longer the [owner.special_role]!") owner.special_role = null + owner.remove_trait(TRAIT_ABDUCTOR_TRAINING, ABDUCTOR_ANTAGONIST) return ..() /datum/antagonist/abductor/greet() @@ -75,11 +77,15 @@ update_abductor_icons_added(owner,"abductor") -/datum/antagonist/abductor/scientist/finalize_abductor() - ..() - var/mob/living/carbon/human/H = owner.current - var/datum/species/abductor/A = H.dna.species - A.scientist = TRUE +/datum/antagonist/abductor/scientist/on_gain() + owner.add_trait(TRAIT_ABDUCTOR_SCIENTIST_TRAINING, ABDUCTOR_ANTAGONIST) + owner.add_trait(TRAIT_SURGEON, ABDUCTOR_ANTAGONIST) + . = ..() + +/datum/antagonist/abductor/scientist/on_removal() + owner.remove_trait(TRAIT_ABDUCTOR_SCIENTIST_TRAINING, ABDUCTOR_ANTAGONIST) + owner.remove_trait(TRAIT_SURGEON, ABDUCTOR_ANTAGONIST) + . = ..() /datum/antagonist/abductor/admin_add(datum/mind/new_owner,mob/admin) var/list/current_teams = list() @@ -214,4 +220,4 @@ /datum/antagonist/proc/update_abductor_icons_removed(datum/mind/alien_mind) var/datum/atom_hud/antag/hud = GLOB.huds[ANTAG_HUD_ABDUCTOR] hud.leave_hud(alien_mind.current) - set_antag_hud(alien_mind.current, null) \ No newline at end of file + set_antag_hud(alien_mind.current, null) diff --git a/code/modules/antagonists/abductor/equipment/abduction_gear.dm b/code/modules/antagonists/abductor/equipment/abduction_gear.dm index 1573204d88..9072e1b263 100644 --- a/code/modules/antagonists/abductor/equipment/abduction_gear.dm +++ b/code/modules/antagonists/abductor/equipment/abduction_gear.dm @@ -132,22 +132,24 @@ /obj/item/abductor icon = 'icons/obj/abductor.dmi' -/obj/item/abductor/proc/AbductorCheck(user) - if(isabductor(user)) +/obj/item/abductor/proc/AbductorCheck(mob/user) + if(user.has_trait(TRAIT_ABDUCTOR_TRAINING)) return TRUE to_chat(user, "You can't figure how this works!") return FALSE -/obj/item/abductor/proc/ScientistCheck(user) - if(!AbductorCheck(user)) - return FALSE +/obj/item/abductor/proc/ScientistCheck(mob/user) + var/training = user.has_trait(TRAIT_ABDUCTOR_TRAINING) + var/sci_training = user.has_trait(TRAIT_ABDUCTOR_SCIENTIST_TRAINING) - var/mob/living/carbon/human/H = user - var/datum/species/abductor/S = H.dna.species - if(S.scientist) - return TRUE - to_chat(user, "You're not trained to use this!") - return FALSE + if(training && !sci_training) + to_chat(user, "You're not trained to use this!") + . = FALSE + else if(!training && !sci_training) + to_chat(user, "You can't figure how this works!") + . = FALSE + else + . = TRUE /obj/item/abductor/gizmo name = "science tool" @@ -683,7 +685,7 @@ Congratulations! You are now trained for invasive xenobiology research!"} desc = "Abduct with style - spiky style. Prevents digital tracking." icon_state = "alienhelmet" item_state = "alienhelmet" - blockTracking = 1 + blockTracking = TRUE flags_inv = HIDEMASK|HIDEEARS|HIDEEYES|HIDEFACE|HIDEHAIR|HIDEFACIALHAIR // Operating Table / Beds / Lockers diff --git a/code/modules/antagonists/abductor/equipment/gland.dm b/code/modules/antagonists/abductor/equipment/gland.dm index 72edb18020..0b3f3ed595 100644 --- a/code/modules/antagonists/abductor/equipment/gland.dm +++ b/code/modules/antagonists/abductor/equipment/gland.dm @@ -5,6 +5,7 @@ icon_state = "gland" status = ORGAN_ROBOTIC beating = TRUE + var/true_name = "baseline placebo referencer" var/cooldown_low = 300 var/cooldown_high = 300 var/next_activation = 0 @@ -16,6 +17,11 @@ var/mind_control_duration = 1800 var/active_mind_control = FALSE +/obj/item/organ/heart/gland/examine(mob/user) + . = ..() + if(user.has_trait(TRAIT_ABDUCTOR_SCIENTIST_TRAINING) || isobserver(user)) + to_chat(user, "It is \a [true_name].") + /obj/item/organ/heart/gland/proc/ownerCheck() if(ishuman(owner)) return TRUE @@ -95,6 +101,7 @@ return /obj/item/organ/heart/gland/heals + true_name = "coherency harmonizer" cooldown_low = 200 cooldown_high = 400 uses = -1 @@ -109,6 +116,7 @@ owner.adjustOxyLoss(-20) /obj/item/organ/heart/gland/slime + true_name = "gastric animation galvanizer" cooldown_low = 600 cooldown_high = 1200 uses = -1 @@ -130,6 +138,7 @@ Slime.Leader = owner /obj/item/organ/heart/gland/mindshock + true_name = "neural crosstalk uninhibitor" cooldown_low = 400 cooldown_high = 700 uses = -1 @@ -156,6 +165,7 @@ H.hallucination += 60 /obj/item/organ/heart/gland/pop + true_name = "anthropmorphic translocator" cooldown_low = 900 cooldown_high = 1800 uses = -1 @@ -171,6 +181,7 @@ owner.set_species(species) /obj/item/organ/heart/gland/ventcrawling + true_name = "pliant cartilage enabler" cooldown_low = 1800 cooldown_high = 2400 uses = 1 @@ -183,6 +194,7 @@ owner.ventcrawler = VENTCRAWLER_ALWAYS /obj/item/organ/heart/gland/viral + true_name = "contamination incubator" cooldown_low = 1800 cooldown_high = 2400 uses = 1 @@ -217,6 +229,7 @@ return A /obj/item/organ/heart/gland/trauma + true_name = "white matter randomiser" cooldown_low = 800 cooldown_high = 1200 uses = 5 @@ -235,6 +248,7 @@ owner.gain_trauma_type(BRAIN_TRAUMA_MILD, rand(TRAUMA_RESILIENCE_BASIC, TRAUMA_RESILIENCE_LOBOTOMY)) /obj/item/organ/heart/gland/spiderman + true_name = "araneae cloister accelerator" cooldown_low = 450 cooldown_high = 900 uses = -1 @@ -249,6 +263,7 @@ S.directive = "Protect your nest inside [owner.real_name]." /obj/item/organ/heart/gland/egg + true_name = "roe/enzymatic synthesizer" cooldown_low = 300 cooldown_high = 400 uses = -1 @@ -264,6 +279,7 @@ new /obj/item/reagent_containers/food/snacks/egg/gland(T) /obj/item/organ/heart/gland/electric + true_name = "electron accumulator/discharger" cooldown_low = 800 cooldown_high = 1200 uses = -1 @@ -289,6 +305,7 @@ playsound(get_turf(owner), 'sound/magic/lightningshock.ogg', 50, 1) /obj/item/organ/heart/gland/chem + true_name = "intrinsic pharma-provider" cooldown_low = 50 cooldown_high = 50 uses = -1 @@ -315,6 +332,7 @@ ..() /obj/item/organ/heart/gland/plasma + true_name = "effluvium sanguine-synonym emitter" cooldown_low = 1200 cooldown_high = 1800 uses = -1 diff --git a/code/modules/antagonists/abductor/machinery/camera.dm b/code/modules/antagonists/abductor/machinery/camera.dm index 41cfa6a954..3c2ce5f840 100644 --- a/code/modules/antagonists/abductor/machinery/camera.dm +++ b/code/modules/antagonists/abductor/machinery/camera.dm @@ -55,8 +55,7 @@ actions += set_droppoint_action /obj/machinery/computer/camera_advanced/abductor/proc/IsScientist(mob/living/carbon/human/H) - var/datum/species/abductor/S = H.dna.species - return S.scientist + return H.has_trait(TRAIT_ABDUCTOR_SCIENTIST_TRAINING) /datum/action/innate/teleport_in name = "Send To" diff --git a/code/modules/antagonists/abductor/machinery/console.dm b/code/modules/antagonists/abductor/machinery/console.dm index 46d69ba9bb..0c74686a8f 100644 --- a/code/modules/antagonists/abductor/machinery/console.dm +++ b/code/modules/antagonists/abductor/machinery/console.dm @@ -28,7 +28,7 @@ . = ..() if(.) return - if(!isabductor(user)) + if(!user.has_trait(TRAIT_ABDUCTOR_TRAINING)) to_chat(user, "You start mashing alien buttons at random!") if(do_after(user,100, target = src)) TeleporterSend() diff --git a/code/modules/antagonists/abductor/machinery/pad.dm b/code/modules/antagonists/abductor/machinery/pad.dm index 1cb95fbf05..ab636f7d0e 100644 --- a/code/modules/antagonists/abductor/machinery/pad.dm +++ b/code/modules/antagonists/abductor/machinery/pad.dm @@ -53,4 +53,4 @@ . = ..() var/datum/effect_system/spark_spread/S = new S.set_up(10,0,loc) - S.start() \ No newline at end of file + S.start() diff --git a/code/modules/mob/living/carbon/human/species_types/abductors.dm b/code/modules/mob/living/carbon/human/species_types/abductors.dm index ad1f5c9190..ffd129ebf7 100644 --- a/code/modules/mob/living/carbon/human/species_types/abductors.dm +++ b/code/modules/mob/living/carbon/human/species_types/abductors.dm @@ -6,10 +6,6 @@ species_traits = list(NOBLOOD,NOEYES,NOGENITALS,NOAROUSAL) inherent_traits = list(TRAIT_VIRUSIMMUNE,TRAIT_NOGUNS,TRAIT_NOHUNGER,TRAIT_NOBREATH) mutanttongue = /obj/item/organ/tongue/abductor - var/scientist = FALSE // vars to not pollute spieces list with castes - -/datum/species/abductor/copy_properties_from(datum/species/abductor/old_species) - scientist = old_species.scientist /datum/species/abductor/on_species_gain(mob/living/carbon/C, datum/species/old_species) . = ..() From 81bb4b4c316748cff8cadec1ea33a812097901e3 Mon Sep 17 00:00:00 2001 From: Linzolle Date: Sun, 22 Sep 2019 19:20:05 -0500 Subject: [PATCH 07/14] fix --- code/__DEFINES/traits.dm | 1 - code/modules/antagonists/abductor/abductor.dm | 12 ++++++------ .../antagonists/abductor/equipment/abduction_gear.dm | 6 +++--- code/modules/antagonists/abductor/equipment/gland.dm | 2 +- .../modules/antagonists/abductor/machinery/camera.dm | 2 +- .../antagonists/abductor/machinery/console.dm | 2 +- code/modules/surgery/experimental_dissection.dm | 2 +- 7 files changed, 13 insertions(+), 14 deletions(-) diff --git a/code/__DEFINES/traits.dm b/code/__DEFINES/traits.dm index dd498017d3..05fbfb7fe6 100644 --- a/code/__DEFINES/traits.dm +++ b/code/__DEFINES/traits.dm @@ -190,7 +190,6 @@ #define STASIS_MUTE "stasis" #define GENETICS_SPELL "genetics_spell" #define EYES_COVERED "eyes_covered" -<<<<<<< HEAD #define CULT_TRAIT "cult" #define CLOWN_NUKE_TRAIT "clown-nuke" #define STICKY_MOUSTACHE_TRAIT "sticky-moustache" diff --git a/code/modules/antagonists/abductor/abductor.dm b/code/modules/antagonists/abductor/abductor.dm index c13106ce02..80eb007605 100644 --- a/code/modules/antagonists/abductor/abductor.dm +++ b/code/modules/antagonists/abductor/abductor.dm @@ -44,7 +44,7 @@ owner.assigned_role = "[name] [sub_role]" owner.objectives += team.objectives finalize_abductor() - owner.add_trait(TRAIT_ABDUCTOR_TRAINING, ABDUCTOR_ANTAGONIST) + ADD_TRAIT(owner, TRAIT_ABDUCTOR_TRAINING, ABDUCTOR_ANTAGONIST) return ..() /datum/antagonist/abductor/on_removal() @@ -52,7 +52,7 @@ if(owner.current) to_chat(owner.current,"You are no longer the [owner.special_role]!") owner.special_role = null - owner.remove_trait(TRAIT_ABDUCTOR_TRAINING, ABDUCTOR_ANTAGONIST) + REMOVE_TRAIT(owner, TRAIT_ABDUCTOR_TRAINING, ABDUCTOR_ANTAGONIST) return ..() /datum/antagonist/abductor/greet() @@ -78,13 +78,13 @@ update_abductor_icons_added(owner,"abductor") /datum/antagonist/abductor/scientist/on_gain() - owner.add_trait(TRAIT_ABDUCTOR_SCIENTIST_TRAINING, ABDUCTOR_ANTAGONIST) - owner.add_trait(TRAIT_SURGEON, ABDUCTOR_ANTAGONIST) + ADD_TRAIT(owner, TRAIT_ABDUCTOR_SCIENTIST_TRAINING, ABDUCTOR_ANTAGONIST) + ADD_TRAIT(owner, TRAIT_SURGEON, ABDUCTOR_ANTAGONIST) . = ..() /datum/antagonist/abductor/scientist/on_removal() - owner.remove_trait(TRAIT_ABDUCTOR_SCIENTIST_TRAINING, ABDUCTOR_ANTAGONIST) - owner.remove_trait(TRAIT_SURGEON, ABDUCTOR_ANTAGONIST) + REMOVE_TRAIT(owner, TRAIT_ABDUCTOR_SCIENTIST_TRAINING, ABDUCTOR_ANTAGONIST) + REMOVE_TRAIT(owner, TRAIT_SURGEON, ABDUCTOR_ANTAGONIST) . = ..() /datum/antagonist/abductor/admin_add(datum/mind/new_owner,mob/admin) diff --git a/code/modules/antagonists/abductor/equipment/abduction_gear.dm b/code/modules/antagonists/abductor/equipment/abduction_gear.dm index 9072e1b263..7620aa752b 100644 --- a/code/modules/antagonists/abductor/equipment/abduction_gear.dm +++ b/code/modules/antagonists/abductor/equipment/abduction_gear.dm @@ -133,14 +133,14 @@ icon = 'icons/obj/abductor.dmi' /obj/item/abductor/proc/AbductorCheck(mob/user) - if(user.has_trait(TRAIT_ABDUCTOR_TRAINING)) + if(HAS_TRAIT(user, TRAIT_ABDUCTOR_TRAINING)) return TRUE to_chat(user, "You can't figure how this works!") return FALSE /obj/item/abductor/proc/ScientistCheck(mob/user) - var/training = user.has_trait(TRAIT_ABDUCTOR_TRAINING) - var/sci_training = user.has_trait(TRAIT_ABDUCTOR_SCIENTIST_TRAINING) + var/training = HAS_TRAIT(user, TRAIT_ABDUCTOR_TRAINING) + var/sci_training = HAS_TRAIT(user, TRAIT_ABDUCTOR_SCIENTIST_TRAINING) if(training && !sci_training) to_chat(user, "You're not trained to use this!") diff --git a/code/modules/antagonists/abductor/equipment/gland.dm b/code/modules/antagonists/abductor/equipment/gland.dm index 0b3f3ed595..9fae638ba3 100644 --- a/code/modules/antagonists/abductor/equipment/gland.dm +++ b/code/modules/antagonists/abductor/equipment/gland.dm @@ -19,7 +19,7 @@ /obj/item/organ/heart/gland/examine(mob/user) . = ..() - if(user.has_trait(TRAIT_ABDUCTOR_SCIENTIST_TRAINING) || isobserver(user)) + if(HAS_TRAIT(user, TRAIT_ABDUCTOR_SCIENTIST_TRAINING) || isobserver(user)) to_chat(user, "It is \a [true_name].") /obj/item/organ/heart/gland/proc/ownerCheck() diff --git a/code/modules/antagonists/abductor/machinery/camera.dm b/code/modules/antagonists/abductor/machinery/camera.dm index 3c2ce5f840..00e48cb1c7 100644 --- a/code/modules/antagonists/abductor/machinery/camera.dm +++ b/code/modules/antagonists/abductor/machinery/camera.dm @@ -55,7 +55,7 @@ actions += set_droppoint_action /obj/machinery/computer/camera_advanced/abductor/proc/IsScientist(mob/living/carbon/human/H) - return H.has_trait(TRAIT_ABDUCTOR_SCIENTIST_TRAINING) + return HAS_TRAIT(H, TRAIT_ABDUCTOR_SCIENTIST_TRAINING) /datum/action/innate/teleport_in name = "Send To" diff --git a/code/modules/antagonists/abductor/machinery/console.dm b/code/modules/antagonists/abductor/machinery/console.dm index 0c74686a8f..30b82398ff 100644 --- a/code/modules/antagonists/abductor/machinery/console.dm +++ b/code/modules/antagonists/abductor/machinery/console.dm @@ -28,7 +28,7 @@ . = ..() if(.) return - if(!user.has_trait(TRAIT_ABDUCTOR_TRAINING)) + if(!HAS_TRAIT(user, TRAIT_ABDUCTOR_TRAINING)) to_chat(user, "You start mashing alien buttons at random!") if(do_after(user,100, target = src)) TeleporterSend() diff --git a/code/modules/surgery/experimental_dissection.dm b/code/modules/surgery/experimental_dissection.dm index 8179a91336..e32ea4a6b6 100644 --- a/code/modules/surgery/experimental_dissection.dm +++ b/code/modules/surgery/experimental_dissection.dm @@ -25,7 +25,7 @@ /datum/surgery_step/dissection name = "dissection" - implements = list(/obj/item/scalpel/augment = 75, /obj/item/scalpel/advanced = 60, /obj/item/scalpel = 45, /obj/item/kitchen/knife = 20, /obj/item/shard = 10)// special tools not only cut down time but also improve probability + implements = list(/obj/item/scalpel/augment = 75, /obj/item/scalpel/adv = 60, /obj/item/scalpel = 45, /obj/item/kitchen/knife = 20, /obj/item/shard = 10)// special tools not only cut down time but also improve probability time = 125 silicons_obey_prob = TRUE repeatable = TRUE From 6f4ba5a1b88225711d2502a29af311d353a927e5 Mon Sep 17 00:00:00 2001 From: Linzolle Date: Sun, 22 Sep 2019 19:47:41 -0500 Subject: [PATCH 08/14] make it actually work lol --- code/modules/mob/mob_helpers.dm | 3 --- code/modules/surgery/surgery.dm | 11 ++++++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index 78b7bc81da..aeeb86ed8e 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -489,10 +489,7 @@ It's fairly easy to fix if dealing with single letters but not so much with comp //Examine text for traits shared by multiple types. I wish examine was less copypasted. /mob/proc/common_trait_examine() - . = "" - if(HAS_TRAIT(src, TRAIT_DISSECTED)) - . += "This body has been dissected and analyzed. It is no longer worth experimenting on.
" var/dissectionmsg = "" if(HAS_TRAIT_FROM(src, TRAIT_DISSECTED,"Extraterrestrial Dissection")) dissectionmsg = " via Extraterrestrial Dissection. It is no longer worth experimenting on" diff --git a/code/modules/surgery/surgery.dm b/code/modules/surgery/surgery.dm index 4ac1c4d246..5504d56310 100644 --- a/code/modules/surgery/surgery.dm +++ b/code/modules/surgery/surgery.dm @@ -37,7 +37,7 @@ return ..() -/datum/surgery/proc/can_start(mob/user, mob/living) //FALSE to not show in list +/datum/surgery/proc/can_start(mob/user, mob/living/patient) //FALSE to not show in list . = TRUE if(replaced_by == /datum/surgery) return FALSE @@ -65,7 +65,7 @@ return TRUE - var/turf/T = get_turf(target) + var/turf/T = get_turf(patient) var/obj/structure/table/optable/table = locate(/obj/structure/table/optable, T) if(table) if(!table.computer) @@ -143,7 +143,12 @@ /obj/item/disk/surgery/debug/Initialize() . = ..() - surgeries = subtypesof(/datum/surgery/advanced) + surgeries = list() + var/list/req_tech_surgeries = subtypesof(/datum/surgery) + for(var/i in req_tech_surgeries) + var/datum/surgery/beep = i + if(initial(beep.requires_tech)) + surgeries += beep //INFO //Check /mob/living/carbon/attackby for how surgery progresses, and also /mob/living/carbon/attack_hand. From 947bb8cc69e97bef1e93c39fc46d1a03508d38fe Mon Sep 17 00:00:00 2001 From: XDTM Date: Wed, 19 Jun 2019 01:37:29 +0200 Subject: [PATCH 09/14] port muscled veins too why not --- code/__DEFINES/traits.dm | 2 + code/game/machinery/cloning.dm | 21 +++++++--- code/game/machinery/exp_cloner.dm | 11 ++--- code/modules/mob/living/carbon/life.dm | 2 +- .../chemistry/reagents/medicine_reagents.dm | 6 ++- .../research/designs/medical_designs.dm | 7 ++++ code/modules/research/techweb/all_nodes.dm | 2 +- .../surgery/advanced/bioware/muscled_veins.dm | 42 +++++++++++++++++++ tgstation.dme | 1 + 9 files changed, 80 insertions(+), 14 deletions(-) create mode 100644 code/modules/surgery/advanced/bioware/muscled_veins.dm diff --git a/code/__DEFINES/traits.dm b/code/__DEFINES/traits.dm index 05fbfb7fe6..e8d6e756ec 100644 --- a/code/__DEFINES/traits.dm +++ b/code/__DEFINES/traits.dm @@ -81,6 +81,7 @@ #define TRAIT_PUSHIMMUNE "push_immunity" #define TRAIT_SHOCKIMMUNE "shock_immunity" #define TRAIT_STABLEHEART "stable_heart" +#define TRAIT_STABLELIVER "stable_liver" #define TRAIT_RESISTHEAT "resist_heat" #define TRAIT_RESISTHEATHANDS "resist_heat_handsonly" //For when you want to be able to touch hot things, but still want fire to be an issue. #define TRAIT_RESISTCOLD "resist_cold" @@ -182,6 +183,7 @@ // unique trait sources, still defines #define STATUE_MUTE "statue" +#define CLONING_POD_TRAIT "cloning-pod" #define CHANGELING_DRAIN "drain" #define CHANGELING_HIVEMIND_MUTE "ling_mute" #define ABYSSAL_GAZE_BLIND "abyssal_gaze" diff --git a/code/game/machinery/cloning.dm b/code/game/machinery/cloning.dm index a175558f74..d6bc859cb6 100644 --- a/code/game/machinery/cloning.dm +++ b/code/game/machinery/cloning.dm @@ -175,11 +175,12 @@ //Get the clone body ready maim_clone(H) - ADD_TRAIT(H, TRAIT_STABLEHEART, "cloning") - ADD_TRAIT(H, TRAIT_EMOTEMUTE, "cloning") - ADD_TRAIT(H, TRAIT_MUTE, "cloning") - ADD_TRAIT(H, TRAIT_NOBREATH, "cloning") - ADD_TRAIT(H, TRAIT_NOCRITDAMAGE, "cloning") + ADD_TRAIT(H, TRAIT_STABLEHEART, CLONING_POD_TRAIT) + ADD_TRAIT(H, TRAIT_STABLELIVER, CLONING_POD_TRAIT) + ADD_TRAIT(H, TRAIT_EMOTEMUTE, CLONING_POD_TRAIT) + ADD_TRAIT(H, TRAIT_MUTE, CLONING_POD_TRAIT) + ADD_TRAIT(H, TRAIT_NOBREATH, CLONING_POD_TRAIT) + ADD_TRAIT(H, TRAIT_NOCRITDAMAGE, CLONING_POD_TRAIT) H.Unconscious(80) clonemind.transfer_to(H) @@ -355,12 +356,22 @@ if(!mob_occupant) return +<<<<<<< HEAD REMOVE_TRAIT(mob_occupant, TRAIT_STABLEHEART, "cloning") REMOVE_TRAIT(mob_occupant, TRAIT_EMOTEMUTE, "cloning") REMOVE_TRAIT(mob_occupant, TRAIT_MUTE, "cloning") REMOVE_TRAIT(mob_occupant, TRAIT_NOCRITDAMAGE, "cloning") REMOVE_TRAIT(mob_occupant, TRAIT_NOBREATH, "cloning") +======= + current_insurance = null + REMOVE_TRAIT(mob_occupant, TRAIT_STABLEHEART, CLONING_POD_TRAIT) + REMOVE_TRAIT(mob_occupant, TRAIT_STABLELIVER, CLONING_POD_TRAIT) + REMOVE_TRAIT(mob_occupant, TRAIT_EMOTEMUTE, CLONING_POD_TRAIT) + REMOVE_TRAIT(mob_occupant, TRAIT_MUTE, CLONING_POD_TRAIT) + REMOVE_TRAIT(mob_occupant, TRAIT_NOCRITDAMAGE, CLONING_POD_TRAIT) + REMOVE_TRAIT(mob_occupant, TRAIT_NOBREATH, CLONING_POD_TRAIT) +>>>>>>> 5c41cc6f52... Muscled Veins experimental surgery (#44481) if(grab_ghost_when == CLONER_MATURE_CLONE) mob_occupant.grab_ghost() diff --git a/code/game/machinery/exp_cloner.dm b/code/game/machinery/exp_cloner.dm index e8364d2271..4d6853f8a1 100644 --- a/code/game/machinery/exp_cloner.dm +++ b/code/game/machinery/exp_cloner.dm @@ -42,11 +42,12 @@ icon_state = "pod_1" //Get the clone body ready maim_clone(H) - ADD_TRAIT(H, TRAIT_STABLEHEART, "cloning") - ADD_TRAIT(H, TRAIT_EMOTEMUTE, "cloning") - ADD_TRAIT(H, TRAIT_MUTE, "cloning") - ADD_TRAIT(H, TRAIT_NOBREATH, "cloning") - ADD_TRAIT(H, TRAIT_NOCRITDAMAGE, "cloning") + ADD_TRAIT(H, TRAIT_STABLEHEART, CLONING_POD_TRAIT) + ADD_TRAIT(H, TRAIT_STABLELIVER, CLONING_POD_TRAIT) + ADD_TRAIT(H, TRAIT_EMOTEMUTE, CLONING_POD_TRAIT) + ADD_TRAIT(H, TRAIT_MUTE, CLONING_POD_TRAIT) + ADD_TRAIT(H, TRAIT_NOBREATH, CLONING_POD_TRAIT) + ADD_TRAIT(H, TRAIT_NOCRITDAMAGE, CLONING_POD_TRAIT) H.Unconscious(80) var/list/candidates = pollCandidatesForMob("Do you want to play as [clonename]'s defective clone?", null, null, null, 100, H) diff --git a/code/modules/mob/living/carbon/life.dm b/code/modules/mob/living/carbon/life.dm index 7a3405cc09..6289a17309 100644 --- a/code/modules/mob/living/carbon/life.dm +++ b/code/modules/mob/living/carbon/life.dm @@ -671,7 +671,7 @@ GLOBAL_LIST_INIT(ballmer_windows_me_msg, list("Yo man, what if, we like, uh, put /mob/living/carbon/proc/liver_failure() reagents.end_metabolization(src, keep_liverless = TRUE) //Stops trait-based effects on reagents, to prevent permanent buffs reagents.metabolize(src, can_overdose=FALSE, liverless = TRUE) - if(HAS_TRAIT(src, TRAIT_STABLEHEART)) + if(HAS_TRAIT(src, TRAIT_STABLELIVER)) return adjustToxLoss(4, TRUE, TRUE) if(prob(30)) diff --git a/code/modules/reagents/chemistry/reagents/medicine_reagents.dm b/code/modules/reagents/chemistry/reagents/medicine_reagents.dm index 4dc0d145dc..5adb61c464 100644 --- a/code/modules/reagents/chemistry/reagents/medicine_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/medicine_reagents.dm @@ -1287,10 +1287,12 @@ /datum/reagent/medicine/corazone/on_mob_metabolize(mob/living/M) ..() - ADD_TRAIT(M, TRAIT_STABLEHEART, id) + ADD_TRAIT(M, TRAIT_STABLEHEART, type) + ADD_TRAIT(M, TRAIT_STABLELIVER, type) /datum/reagent/medicine/corazone/on_mob_end_metabolize(mob/living/M) - REMOVE_TRAIT(M, TRAIT_STABLEHEART, id) + REMOVE_TRAIT(M, TRAIT_STABLEHEART, type) + REMOVE_TRAIT(M, TRAIT_STABLELIVER, type) ..() /datum/reagent/medicine/muscle_stimulant diff --git a/code/modules/research/designs/medical_designs.dm b/code/modules/research/designs/medical_designs.dm index c53ba430e0..86b457d3fa 100644 --- a/code/modules/research/designs/medical_designs.dm +++ b/code/modules/research/designs/medical_designs.dm @@ -811,6 +811,13 @@ surgery = /datum/surgery/advanced/bioware/vein_threading research_icon_state = "surgery_chest" +/datum/design/surgery/muscled_veins + name = "Vein Muscle Membrane" + desc = "A surgical procedure which adds a muscled membrane to blood vessels, allowing them to pump blood without a heart." + id = "surgery_muscled_veins" + surgery = /datum/surgery/advanced/bioware/muscled_veins + research_icon_state = "surgery_chest" + /datum/design/surgery/ligament_hook name = "Ligament Hook" desc = "A surgical procedure which reshapes the connections between torso and limbs, making it so limbs can be attached manually if severed. \ diff --git a/code/modules/research/techweb/all_nodes.dm b/code/modules/research/techweb/all_nodes.dm index cb5112353e..e4aeeda90f 100644 --- a/code/modules/research/techweb/all_nodes.dm +++ b/code/modules/research/techweb/all_nodes.dm @@ -124,7 +124,7 @@ display_name = "Experimental Surgery" description = "When evolution isn't fast enough." prereq_ids = list("adv_surgery") - design_ids = list("surgery_revival","surgery_pacify","surgery_vein_thread","surgery_nerve_splice","surgery_nerve_ground","surgery_ligament_hook","surgery_ligament_reinforcement","surgery_viral_bond", "surgery_exp_dissection") + design_ids = list("surgery_revival","surgery_pacify","surgery_vein_thread","surgery_muscled_veins","surgery_nerve_splice","surgery_nerve_ground","surgery_ligament_hook","surgery_ligament_reinforcement","surgery_viral_bond", "surgery_exp_dissection") research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 5000) export_price = 5000 diff --git a/code/modules/surgery/advanced/bioware/muscled_veins.dm b/code/modules/surgery/advanced/bioware/muscled_veins.dm new file mode 100644 index 0000000000..592a02b8d1 --- /dev/null +++ b/code/modules/surgery/advanced/bioware/muscled_veins.dm @@ -0,0 +1,42 @@ +/datum/surgery/advanced/bioware/muscled_veins + name = "Vein Muscle Membrane" + desc = "A surgical procedure which adds a muscled membrane to blood vessels, allowing them to pump blood without a heart." + steps = list(/datum/surgery_step/incise, + /datum/surgery_step/retract_skin, + /datum/surgery_step/clamp_bleeders, + /datum/surgery_step/incise, + /datum/surgery_step/incise, + /datum/surgery_step/thread_veins, + /datum/surgery_step/close) + possible_locs = list(BODY_ZONE_CHEST) + bioware_target = BIOWARE_CIRCULATION + +/datum/surgery_step/muscled_veins + name = "shape vein muscles" + accept_hand = TRUE + time = 125 + +/datum/surgery_step/muscled_veins/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) + display_results(user, target, "You start wrapping muscles around [target]'s circulatory system.", + "[user] starts wrapping muscles around [target]'s circulatory system.", + "[user] starts manipulating [target]'s circulatory system.") + +/datum/surgery_step/muscled_veins/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) + display_results(user, target, "You reshape [target]'s circulatory system, adding a muscled membrane!", + "[user] reshapes [target]'s circulatory system, adding a muscled membrane!", + "[user] finishes manipulating [target]'s circulatory system.") + new /datum/bioware/muscled_veins(target) + return TRUE + +/datum/bioware/muscled_veins + name = "Threaded Veins" + desc = "The circulatory system is woven into a mesh, severely reducing the amount of blood lost from wounds." + mod_type = BIOWARE_CIRCULATION + +/datum/bioware/muscled_veins/on_gain() + ..() + ADD_TRAIT(owner, TRAIT_STABLEHEART, "muscled_veins") + +/datum/bioware/muscled_veins/on_lose() + ..() + REMOVE_TRAIT(owner, TRAIT_STABLEHEART, "muscled_veins") \ No newline at end of file diff --git a/tgstation.dme b/tgstation.dme index 638e35da5d..82841f486c 100755 --- a/tgstation.dme +++ b/tgstation.dme @@ -2777,6 +2777,7 @@ #include "code\modules\surgery\advanced\bioware\bioware_surgery.dm" #include "code\modules\surgery\advanced\bioware\ligament_hook.dm" #include "code\modules\surgery\advanced\bioware\ligament_reinforcement.dm" +#include "code\modules\surgery\advanced\bioware\muscled_veins.dm" #include "code\modules\surgery\advanced\bioware\nerve_grounding.dm" #include "code\modules\surgery\advanced\bioware\nerve_splicing.dm" #include "code\modules\surgery\advanced\bioware\vein_threading.dm" From a2007dc20f027b30a9562bb4a6a73a6c237dbc0f Mon Sep 17 00:00:00 2001 From: Linzolle Date: Sun, 22 Sep 2019 20:30:16 -0500 Subject: [PATCH 10/14] oops --- code/game/machinery/cloning.dm | 9 --------- code/modules/surgery/advanced/bioware/muscled_veins.dm | 2 +- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/code/game/machinery/cloning.dm b/code/game/machinery/cloning.dm index d6bc859cb6..66c314c650 100644 --- a/code/game/machinery/cloning.dm +++ b/code/game/machinery/cloning.dm @@ -356,22 +356,13 @@ if(!mob_occupant) return -<<<<<<< HEAD - REMOVE_TRAIT(mob_occupant, TRAIT_STABLEHEART, "cloning") - REMOVE_TRAIT(mob_occupant, TRAIT_EMOTEMUTE, "cloning") - REMOVE_TRAIT(mob_occupant, TRAIT_MUTE, "cloning") - REMOVE_TRAIT(mob_occupant, TRAIT_NOCRITDAMAGE, "cloning") - REMOVE_TRAIT(mob_occupant, TRAIT_NOBREATH, "cloning") -======= - current_insurance = null REMOVE_TRAIT(mob_occupant, TRAIT_STABLEHEART, CLONING_POD_TRAIT) REMOVE_TRAIT(mob_occupant, TRAIT_STABLELIVER, CLONING_POD_TRAIT) REMOVE_TRAIT(mob_occupant, TRAIT_EMOTEMUTE, CLONING_POD_TRAIT) REMOVE_TRAIT(mob_occupant, TRAIT_MUTE, CLONING_POD_TRAIT) REMOVE_TRAIT(mob_occupant, TRAIT_NOCRITDAMAGE, CLONING_POD_TRAIT) REMOVE_TRAIT(mob_occupant, TRAIT_NOBREATH, CLONING_POD_TRAIT) ->>>>>>> 5c41cc6f52... Muscled Veins experimental surgery (#44481) if(grab_ghost_when == CLONER_MATURE_CLONE) mob_occupant.grab_ghost() diff --git a/code/modules/surgery/advanced/bioware/muscled_veins.dm b/code/modules/surgery/advanced/bioware/muscled_veins.dm index 592a02b8d1..81212019a8 100644 --- a/code/modules/surgery/advanced/bioware/muscled_veins.dm +++ b/code/modules/surgery/advanced/bioware/muscled_veins.dm @@ -6,7 +6,7 @@ /datum/surgery_step/clamp_bleeders, /datum/surgery_step/incise, /datum/surgery_step/incise, - /datum/surgery_step/thread_veins, + /datum/surgery_step/muscled_veins, /datum/surgery_step/close) possible_locs = list(BODY_ZONE_CHEST) bioware_target = BIOWARE_CIRCULATION From 323460efee0c81f0e84fe065b7f128de512eecd5 Mon Sep 17 00:00:00 2001 From: Linzolle Date: Sun, 22 Sep 2019 20:35:49 -0500 Subject: [PATCH 11/14] how did you get here --- code/datums/traits.dm | 75 ------------------------------------------- 1 file changed, 75 deletions(-) delete mode 100644 code/datums/traits.dm diff --git a/code/datums/traits.dm b/code/datums/traits.dm deleted file mode 100644 index 15715c3c88..0000000000 --- a/code/datums/traits.dm +++ /dev/null @@ -1,75 +0,0 @@ -/datum/proc/add_trait(trait, source) - LAZYINITLIST(status_traits) - - if(!status_traits[trait]) - status_traits[trait] = list(source) - else - status_traits[trait] |= list(source) - - -/datum/proc/remove_trait(trait, list/sources, force) - if(!status_traits) - return //nothing to remove - - if(!status_traits[trait]) - return - - if(locate(ROUNDSTART_TRAIT) in status_traits[trait] && !force) //mob traits applied through roundstart cannot normally be removed - return - - if(!sources) // No defined source cures the trait entirely. - status_traits -= trait - return - - if(!islist(sources)) - sources = list(sources) - - if(LAZYLEN(sources)) - for(var/S in sources) - if(S in status_traits[trait]) - status_traits[trait] -= S - else - status_traits[trait] = list() - - if(!LAZYLEN(status_traits[trait])) - status_traits -= trait - -/datum/proc/has_trait(trait, list/sources) - if(!status_traits) - return FALSE //well of course it doesn't have the trait - - if(!status_traits[trait]) - return FALSE - - . = FALSE - - if(sources && !islist(sources)) - sources = list(sources) - if(LAZYLEN(sources)) - for(var/S in sources) - if(S in status_traits[trait]) - return TRUE - else if(LAZYLEN(status_traits[trait])) - return TRUE - -/datum/proc/remove_all_traits(remove_species_traits = FALSE, remove_organ_traits = FALSE, remove_quirks = FALSE) - if(!status_traits) - return //nothing to remove - - var/list/blacklisted_sources = list() - if(!remove_species_traits) - blacklisted_sources += SPECIES_TRAIT - if(!remove_organ_traits) - blacklisted_sources += ORGAN_TRAIT - if(!remove_quirks) - blacklisted_sources += ROUNDSTART_TRAIT - - for(var/kebab in status_traits) - var/skip - for(var/S in blacklisted_sources) - if(S in status_traits[kebab]) - skip = TRUE - break - if(!skip) - remove_trait(kebab, null, TRUE) - CHECK_TICK From 9ac22a9fc513bbb8d80f8a8838376a856f9e2152 Mon Sep 17 00:00:00 2001 From: Linzolle Date: Fri, 11 Oct 2019 20:19:22 -0500 Subject: [PATCH 12/14] god damn it fermis --- code/modules/surgery/graft_synthtissue.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/modules/surgery/graft_synthtissue.dm b/code/modules/surgery/graft_synthtissue.dm index 8826de7171..eef73d30b5 100644 --- a/code/modules/surgery/graft_synthtissue.dm +++ b/code/modules/surgery/graft_synthtissue.dm @@ -4,7 +4,7 @@ /datum/surgery/graft_synthtissue name = "Graft synthtissue" - species = list(/mob/living/carbon/human, /mob/living/carbon/monkey) + target_mobtypes = list(/mob/living/carbon/human, /mob/living/carbon/monkey) possible_locs = list(BODY_ZONE_CHEST, BODY_ZONE_PRECISE_GROIN, BODY_ZONE_PRECISE_EYES) steps = list( /datum/surgery_step/incise, @@ -19,7 +19,7 @@ //repair organs /datum/surgery_step/graft_synthtissue name = "graft synthtissue" - implements = list(/obj/item/hemostat = 100, TOOL_SCREWDRIVER = 35, /obj/item/pen = 15) + implements = list(TOOL_HEMOSTAT = 100, TOOL_SCREWDRIVER = 35, /obj/item/pen = 15) repeatable = TRUE time = 75 chems_needed = list("synthtissue") From d2ea3b0165a232a762239001dba2c4d7e9162e3e Mon Sep 17 00:00:00 2001 From: Linzolle Date: Fri, 11 Oct 2019 20:53:19 -0500 Subject: [PATCH 13/14] one letter off --- code/modules/research/designs/medical_designs.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/research/designs/medical_designs.dm b/code/modules/research/designs/medical_designs.dm index 5e500e1f21..d8b00ddd61 100644 --- a/code/modules/research/designs/medical_designs.dm +++ b/code/modules/research/designs/medical_designs.dm @@ -740,7 +740,7 @@ id = "surgery_exp_dissection" surgery = /datum/surgery/advanced/experimental_dissection/exp -/datum/design/surgery/experimental_dissection/exp +/datum/design/surgery/experimental_dissection/ext name = "Extraterrestrial Dissection" id = "surgery_ext_dissection" surgery = /datum/surgery/advanced/experimental_dissection/alien From 730ca35a31d9e954fe58fbe28056834b07f9318d Mon Sep 17 00:00:00 2001 From: Linzolle Date: Fri, 11 Oct 2019 21:10:10 -0500 Subject: [PATCH 14/14] this really shuoldn't be here --- code/modules/surgery/experimental_dissection.dm | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/code/modules/surgery/experimental_dissection.dm b/code/modules/surgery/experimental_dissection.dm index 44519e85f1..3172496146 100644 --- a/code/modules/surgery/experimental_dissection.dm +++ b/code/modules/surgery/experimental_dissection.dm @@ -1,5 +1,4 @@ #define BASE_HUMAN_REWARD 500 -#define EXPDIS_FAIL_MSG "You dissect [target], but do not find anything particularly interesting." /datum/surgery/advanced/experimental_dissection name = "Dissection" @@ -88,7 +87,6 @@ display_results(user, target, "You dissect [target], but do not find anything particularly interesting.", "[user] dissects [target], however it seems [user.p_they()] didn't find anything useful.", "[user] dissects [target], but looks a little dissapointed.") - SSresearch.science_tech.add_point_list(list(TECHWEB_POINT_TYPE_GENERIC = (check_value(target) * 0.2))) SSresearch.science_tech.add_point_list(list(TECHWEB_POINT_TYPE_GENERIC = (round(check_value(target, surgery) * 0.01)))) var/obj/item/bodypart/L = target.get_bodypart(BODY_ZONE_CHEST) target.apply_damage(80, BRUTE, L) @@ -112,6 +110,4 @@ requires_tech = TRUE replaced_by = null - -#undef BASE_HUMAN_REWARD -#undef EXPDIS_FAIL_MSG +#undef EXPDIS_FAIL_MSG \ No newline at end of file