diff --git a/code/__DEFINES/DNA.dm b/code/__DEFINES/DNA.dm
index 62438ac7c1..a5f2c5d0f6 100644
--- a/code/__DEFINES/DNA.dm
+++ b/code/__DEFINES/DNA.dm
@@ -171,6 +171,7 @@
#define ORGAN_SLOT_HEART_AID "heartdrive"
#define ORGAN_SLOT_BRAIN_ANTIDROP "brain_antidrop"
#define ORGAN_SLOT_BRAIN_ANTISTUN "brain_antistun"
+#define ORGAN_SLOT_BRAIN_ROBOT_RADSHIELDING "brain_robot_radshielding"
#define ORGAN_SLOT_TAIL "tail"
#define ORGAN_SLOT_PENIS "penis"
#define ORGAN_SLOT_WOMB "womb"
diff --git a/code/__DEFINES/radiation.dm b/code/__DEFINES/radiation.dm
index ece997a7fc..01612f2c05 100644
--- a/code/__DEFINES/radiation.dm
+++ b/code/__DEFINES/radiation.dm
@@ -18,6 +18,8 @@ Ask ninjanomnom if they're around
#define RAD_BURN_THRESHOLD 1000 // Applied radiation must be over this to burn
#define RAD_MOB_SAFE 500 // How much stored radiation in a mob with no ill effects
+#define RAD_DEFAULT_ROBOT_SAFE 250 // Like above, except for robotic carbons. Far more susceptible to corruption from radiation.
+#define RAD_UPGRADED_ROBOT_SAFE 750 // If the robot has been upgraded via an implant, their radiation threshold is raised to be somewhat above that of organics.
#define RAD_MOB_HAIRLOSS 800 // How much stored radiation to check for hair loss
diff --git a/code/__DEFINES/traits.dm b/code/__DEFINES/traits.dm
index d92456cc9f..4b08dbc446 100644
--- a/code/__DEFINES/traits.dm
+++ b/code/__DEFINES/traits.dm
@@ -119,6 +119,7 @@
#define TRAIT_EASYLIMBDISABLE "easy_limb_disable"
#define TRAIT_TOXINLOVER "toxinlover"
#define TRAIT_ROBOTIC_ORGANISM "robotic_organism"
+#define TRAIT_ROBOT_RADSHIELDING "robot_radshielding"
#define TRAIT_NOBREATH "no_breath"
#define TRAIT_ANTIMAGIC "anti_magic"
#define TRAIT_HOLY "holy"
@@ -308,6 +309,7 @@
#define LOCKED_HELMET_TRAIT "locked-helmet"
#define NINJA_SUIT_TRAIT "ninja-suit"
#define ANTI_DROP_IMPLANT_TRAIT "anti-drop-implant"
+#define ROBOT_RADSHIELDING_IMPLANT_TRAIT "robot-radshielding-implant"
#define MARTIAL_ARTIST_TRAIT "martial_artist"
#define SLEEPING_CARP_TRAIT "sleeping_carp"
#define RISING_BASS_TRAIT "rising_bass"
@@ -319,7 +321,7 @@
#define MEGAFAUNA_TRAIT "megafauna"
#define DEATHSQUAD_TRAIT "deathsquad"
#define SLIMEPUDDLE_TRAIT "slimepuddle"
-#define CORRUPTED_SYSTEM "corrupted_system"
+#define CORRUPTED_SYSTEM "corrupted-system"
/// This trait is added by the active directional block system.
#define ACTIVE_BLOCK_TRAIT "active_block"
/// This trait is added by the parry system.
diff --git a/code/_globalvars/traits.dm b/code/_globalvars/traits.dm
index 27dd17eabb..d32eae3be3 100644
--- a/code/_globalvars/traits.dm
+++ b/code/_globalvars/traits.dm
@@ -53,6 +53,7 @@ GLOBAL_LIST_INIT(traits_by_type, list(
"TRAIT_EASYLIMBDISABLE" = TRAIT_EASYLIMBDISABLE,
"TRAIT_TOXINLOVER" = TRAIT_TOXINLOVER,
"TRAIT_ROBOTIC_ORGANISM" = TRAIT_ROBOTIC_ORGANISM,
+ "TRAIT_ROBOT_RADSHIELDING" = TRAIT_ROBOT_RADSHIELDING,
"TRAIT_NOBREATH" = TRAIT_NOBREATH,
"TRAIT_ANTIMAGIC" = TRAIT_ANTIMAGIC,
"TRAIT_HOLY" = TRAIT_HOLY,
diff --git a/code/modules/mob/living/carbon/life.dm b/code/modules/mob/living/carbon/life.dm
index 53f25dd776..e0fab331a6 100644
--- a/code/modules/mob/living/carbon/life.dm
+++ b/code/modules/mob/living/carbon/life.dm
@@ -443,8 +443,10 @@
if(radiation > RAD_MOB_SAFE)
if(!HAS_TRAIT(src, TRAIT_ROBOTIC_ORGANISM))
adjustToxLoss(log(radiation-RAD_MOB_SAFE)*RAD_TOX_COEFFICIENT)
- else if(radiation > RAD_MOB_SAFE * 3)
- adjustToxLoss(log(radiation-RAD_MOB_SAFE*3)*RAD_TOX_COEFFICIENT, toxins_type = TOX_SYSCORRUPT) //Robots are more resistant to rads, but in the end suffer slow corruption at high levels.
+ else
+ var/rad_threshold = HAS_TRAIT(src, TRAIT_ROBOT_RADSHIELDING) ? RAD_UPGRADED_ROBOT_SAFE : RAD_DEFAULT_ROBOT_SAFE
+ if(radiation > rad_threshold)
+ adjustToxLoss(log(radiation-rad_threshold)*RAD_TOX_COEFFICIENT, toxins_type = TOX_SYSCORRUPT) //Robots are less resistant to rads, unless upgraded in which case they are fine at higher levels than organics.
/mob/living/carbon/handle_stomach()
set waitfor = 0
diff --git a/code/modules/research/designs/medical_designs.dm b/code/modules/research/designs/medical_designs.dm
index b178f936b7..445ce39ce5 100644
--- a/code/modules/research/designs/medical_designs.dm
+++ b/code/modules/research/designs/medical_designs.dm
@@ -522,6 +522,17 @@
category = list("Misc", "Medical Designs")
departmental_flags = DEPARTMENTAL_FLAG_MEDICAL
+/datum/design/cyberimp_robot_radshielding
+ name = "ECC System Guard Implant"
+ desc = "This implant can counteract the effects of harmful radiation in robots, effectively increasing their radiation tolerance significantly."
+ id = "ci-robot-radshielding"
+ build_type = PROTOLATHE | MECHFAB
+ construction_time = 40
+ materials = list(/datum/material/iron = 500, /datum/material/glass = 400, /datum/material/silver = 350, /datum/material/gold = 1000, /datum/material/diamond = 100)
+ build_path = /obj/item/organ/cyberimp/brain/robot_radshielding
+ category = list("Misc", "Medical Designs")
+ departmental_flags = DEPARTMENTAL_FLAG_MEDICAL
+
/datum/design/cyberimp_nutriment
name = "Nutriment Pump Implant"
desc = "This implant with synthesize and pump into your bloodstream a small amount of nutriment when you are starving."
diff --git a/code/modules/research/techweb/nodes/medical_nodes.dm b/code/modules/research/techweb/nodes/medical_nodes.dm
index 7b9b2f2923..2c0240f1da 100644
--- a/code/modules/research/techweb/nodes/medical_nodes.dm
+++ b/code/modules/research/techweb/nodes/medical_nodes.dm
@@ -96,7 +96,7 @@
display_name = "Advanced Cybernetic Implants"
description = "Upgraded and more powerful cybernetic implants."
prereq_ids = list("neural_programming", "cyber_implants","integrated_HUDs")
- design_ids = list("ci-toolset", "ci-surgery", "ci-reviver", "ci-nutrimentplus")
+ design_ids = list("ci-toolset", "ci-surgery", "ci-reviver", "ci-nutrimentplus", "ci-robot-radshielding")
research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500)
/datum/techweb_node/combat_cyber_implants
diff --git a/code/modules/surgery/organs/augments_internal.dm b/code/modules/surgery/organs/augments_internal.dm
index 5861f0e48b..7af25d3f71 100644
--- a/code/modules/surgery/organs/augments_internal.dm
+++ b/code/modules/surgery/organs/augments_internal.dm
@@ -118,6 +118,35 @@
crit_fail = FALSE
organ_flags &= ~ORGAN_FAILING
+/obj/item/organ/cyberimp/brain/robot_radshielding
+ name = "ECC System Guard implant"
+ desc = "This implant can counteract the effects of harmful radiation in robots, effectively increasing their radiation tolerance significantly."
+ implant_color = "#0066ff"
+ slot = ORGAN_SLOT_BRAIN_ROBOT_RADSHIELDING
+
+/obj/item/organ/cyberimp/brain/robot_radshielding/emp_act(severity)
+ . = ..()
+ if(!owner || . & EMP_PROTECT_SELF)
+ return
+ if(!HAS_TRAIT(owner, TRAIT_ROBOTIC_ORGANISM))
+ return //Why did you even get yourself implanted this if you aren't a robot?
+ owner.adjustToxLoss(severity / 10, toxins_type = TOX_SYSCORRUPT)
+ to_chat(owner, "Your ECC implant suddenly behaves very erratically, scrambling your system.")
+
+/obj/item/organ/cyberimp/brain/robot_radshielding/Insert(mob/living/carbon/M, special = 0, drop_if_replaced = TRUE)
+ . = ..()
+ if(!.)
+ return
+ ADD_TRAIT(owner, TRAIT_ROBOT_RADSHIELDING, ROBOT_RADSHIELDING_IMPLANT_TRAIT) //Organics can get this, but it does literally nothing for them except cause more pain if EMPd, so uh, good on you?
+
+/obj/item/organ/cyberimp/brain/robot_radshielding/Remove(special = FALSE)
+ . = ..()
+ if(!.)
+ return
+ var/mob/living/carbon/C = .
+ REMOVE_TRAIT(C, TRAIT_ROBOT_RADSHIELDING, ROBOT_RADSHIELDING_IMPLANT_TRAIT)
+
+
//[[[[MOUTH]]]]
/obj/item/organ/cyberimp/mouth
diff --git a/code/modules/surgery/purge_corruption.dm b/code/modules/surgery/purge_corruption.dm
index 031cbc884c..3668d9dcff 100644
--- a/code/modules/surgery/purge_corruption.dm
+++ b/code/modules/surgery/purge_corruption.dm
@@ -4,7 +4,7 @@ Has a version for organic people and robotic/synthetic ones, considering robotic
*/
/datum/surgery/purge_corruption
name = "Purge corruption"
- desc = "A highly complex and time-consuming surgery used to purge any corruption currently present in a robotic organism. Will knock the target out for an amount of time proportional to corruption purged."
+ desc = "A highly complex and time-consuming surgery used to purge any corruption currently present in a robot. Will knock out the patient for an amount of time proportional to corruption purged."
steps = list(
/datum/surgery_step/incise,
/datum/surgery_step/retract_skin,
@@ -16,7 +16,8 @@ Has a version for organic people and robotic/synthetic ones, considering robotic
/datum/surgery_step/override_safeties,
/datum/surgery_step/remove_corruption,
/datum/surgery_step/close)
- location = BODY_ZONE_HEAD
+ possible_locs = list(BODY_ZONE_HEAD)
+ target_mobtypes = list(/mob/living/carbon/human, /mob/living/carbon/monkey) //If admins made a monkey into a robotic supersoldier or something.
/datum/surgery/purge_corruption/robotic
requires_bodypart_type = BODYPART_ROBOTIC
@@ -32,7 +33,8 @@ Has a version for organic people and robotic/synthetic ones, considering robotic
/datum/surgery_step/mechanic_close)
/datum/surgery/purge_corruption/can_start(mob/user, mob/living/carbon/target, obj/item/tool)
- if(!(. = ..()))
+ . = ..()
+ if(!.)
return
var/obj/item/organ/brain/B = target.getorganslot(ORGAN_SLOT_BRAIN)
if(!B || !HAS_TRAIT(target, TRAIT_ROBOTIC_ORGANISM))
@@ -44,19 +46,19 @@ Has a version for organic people and robotic/synthetic ones, considering robotic
time = 50
/datum/surgery_step/override_safeties/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
- display_results(user, target, "You begin to override the safeties of [target]'s brain...",
- "[user] begins to override the hardware safeties of [target]'s brain.",
+ display_results(user, target, "You begin to override the safeties of [target]...",
+ "[user] begins to override the hardware safeties of [target].",
"[user] begins to perform surgery on [target]'s brain.")
/datum/surgery_step/override_safeties/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
- display_results(user, target, "You succeed in overriding the safeties of [target]'s brain.",
- "[user] successfully overrides the safeties of [target]'s posibrain!",
+ display_results(user, target, "You succeed in overriding the safeties of [target].",
+ "[user] successfully overrides the safeties of [target]!",
"[user] completes the surgery on [target]'s brain.")
return TRUE
/datum/surgery_step/override_safeties/failure(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
- display_results(user, target, "You fail overriding the safeties of [target]'s brain.",
- "[user] fails overriding the safeties of [target]'s brain!",
+ display_results(user, target, "You fail overriding the safeties of [target].",
+ "[user] fails overriding the safeties of [target]",
"[user] completes the surgery on [target]'s brain.")
return FALSE