adds a surgery to fix corruption

This commit is contained in:
DeltaFire
2020-11-13 02:24:52 +01:00
parent b9ba55a77e
commit 5af48a22dd
10 changed files with 106 additions and 11 deletions

View File

@@ -118,7 +118,7 @@
#define TRAIT_NOLIMBDISABLE "no_limb_disable"
#define TRAIT_EASYLIMBDISABLE "easy_limb_disable"
#define TRAIT_TOXINLOVER "toxinlover"
#define TRAIT_ROBOTICORGANISM "robotic_organism"
#define TRAIT_ROBOTIC_ORGANISM "robotic_organism"
#define TRAIT_NOBREATH "no_breath"
#define TRAIT_ANTIMAGIC "anti_magic"
#define TRAIT_HOLY "holy"

View File

@@ -52,7 +52,7 @@ GLOBAL_LIST_INIT(traits_by_type, list(
"TRAIT_NOLIMBDISABLE" = TRAIT_NOLIMBDISABLE,
"TRAIT_EASYLIMBDISABLE" = TRAIT_EASYLIMBDISABLE,
"TRAIT_TOXINLOVER" = TRAIT_TOXINLOVER,
"TRAIT_ROBOTICORGANISM" = TRAIT_ROBOTICORGANISM,
"TRAIT_ROBOTIC_ORGANISM" = TRAIT_ROBOTIC_ORGANISM,
"TRAIT_NOBREATH" = TRAIT_NOBREATH,
"TRAIT_ANTIMAGIC" = TRAIT_ANTIMAGIC,
"TRAIT_HOLY" = TRAIT_HOLY,

View File

@@ -155,7 +155,7 @@ GENETICS SCANNER
if(oxy_loss > 10)
msg += "\n\t<span class='info'><span class='alert'>[oxy_loss > 50 ? "Severe" : "Minor"] oxygen deprivation detected.</span>"
if(tox_loss > 10)
msg += "\n\t<span class='alert'>[tox_loss > 50 ? "Severe" : "Minor"] amount of [HAS_TRAIT(M, TRAIT_ROBOTICORGANISM) ? "system corruption" : "toxin damage"] detected.</span>"
msg += "\n\t<span class='alert'>[tox_loss > 50 ? "Severe" : "Minor"] amount of [HAS_TRAIT(M, TRAIT_ROBOTIC_ORGANISM) ? "system corruption" : "toxin damage"] detected.</span>"
if(M.getStaminaLoss())
msg += "\n\t<span class='alert'>Subject appears to be suffering from fatigue.</span>"
if(advanced)
@@ -182,7 +182,7 @@ GENETICS SCANNER
<td style='width: 90px;'><font color='#0000CC'>Damage:</font></td>\
<td style='width: 55px;'><font color='red'><b>Brute</b></font></td>\
<td style='width: 45px;'><font color='orange'><b>Burn</b></font></td>\
<td style='width: 45px;'><font color='green'><b>[HAS_TRAIT(C, TRAIT_ROBOTICORGANISM) ? "Corruption" :"Toxin"]</b></font></td>\
<td style='width: 45px;'><font color='green'><b>[HAS_TRAIT(C, TRAIT_ROBOTIC_ORGANISM) ? "Corruption" :"Toxin"]</b></font></td>\
<td style='width: 90px;'><font color='purple'><b>Suffocation</b></font></td></tr>\
<tr><td><font color='#0000CC'>Overall:</font></td>\
<td><font color='red'>[brute_loss]</font></td>\

View File

@@ -3,7 +3,7 @@
id = SPECIES_ANDROID
say_mod = "states"
species_traits = list(NOBLOOD,NOGENITALS,NOAROUSAL,ROBOTIC_LIMBS)
inherent_traits = list(TRAIT_RESISTHEAT,TRAIT_NOBREATH,TRAIT_RESISTCOLD,TRAIT_RESISTHIGHPRESSURE,TRAIT_RESISTLOWPRESSURE,TRAIT_RADIMMUNE,TRAIT_NOFIRE,TRAIT_PIERCEIMMUNE,TRAIT_NOHUNGER,TRAIT_LIMBATTACHMENT, TRAIT_ROBOTICORGANISM)
inherent_traits = list(TRAIT_RESISTHEAT,TRAIT_NOBREATH,TRAIT_RESISTCOLD,TRAIT_RESISTHIGHPRESSURE,TRAIT_RESISTLOWPRESSURE,TRAIT_RADIMMUNE,TRAIT_NOFIRE,TRAIT_PIERCEIMMUNE,TRAIT_NOHUNGER,TRAIT_LIMBATTACHMENT, TRAIT_ROBOTIC_ORGANISM)
inherent_biotypes = MOB_ROBOTIC|MOB_HUMANOID
meat = null
gib_types = /obj/effect/gibspawner/robot

View File

@@ -5,7 +5,7 @@
default_color = "00FF00"
blacklisted = 0
sexes = 0
inherent_traits = list(TRAIT_EASYDISMEMBER,TRAIT_LIMBATTACHMENT,TRAIT_NO_PROCESS_FOOD, TRAIT_ROBOTICORGANISM)
inherent_traits = list(TRAIT_EASYDISMEMBER,TRAIT_LIMBATTACHMENT,TRAIT_NO_PROCESS_FOOD, TRAIT_ROBOTIC_ORGANISM)
species_traits = list(MUTCOLORS,NOEYES,NOTRANSSTING,HAS_FLESH,HAS_BONE,HAIR,ROBOTIC_LIMBS)
hair_alpha = 210
inherent_biotypes = MOB_ROBOTIC|MOB_HUMANOID

View File

@@ -4,7 +4,7 @@
say_mod = "beeps"
default_color = "00FF00"
species_traits = list(MUTCOLORS,NOTRANSSTING,EYECOLOR,LIPS,HAIR,ROBOTIC_LIMBS,HAS_FLESH,HAS_BONE)
inherent_traits = list(TRAIT_EASYDISMEMBER,TRAIT_LIMBATTACHMENT,TRAIT_NO_PROCESS_FOOD, TRAIT_ROBOTICORGANISM)
inherent_traits = list(TRAIT_EASYDISMEMBER,TRAIT_LIMBATTACHMENT,TRAIT_NO_PROCESS_FOOD, TRAIT_ROBOTIC_ORGANISM)
inherent_biotypes = MOB_ROBOTIC|MOB_HUMANOID
mutant_bodyparts = list("ipc_antenna" = "Synthetic Lizard - Antennae","mam_tail" = "Synthetic Lizard", "mam_snouts" = "Synthetic Lizard - Snout", "legs" = "Digitigrade", "mam_body_markings" = "Synthetic Lizard - Plates", "taur" = "None")
meat = /obj/item/reagent_containers/food/snacks/meat/slab/human/mutant/ipc

View File

@@ -746,7 +746,7 @@ GLOBAL_LIST_INIT(ballmer_windows_me_msg, list("Yo man, what if, we like, uh, put
#define CORRUPTION_THRESHHOLD_CRITICAL 70 //Above: Extremely annoying stuff, possibly life-threatening
/mob/living/carbon/proc/handle_corruption()
if(!HAS_TRAIT(src, TRAIT_ROBOTICORGANISM)) //Only robot-people need to care about this
if(!HAS_TRAIT(src, TRAIT_ROBOTIC_ORGANISM)) //Only robot-people need to care about this
return
corruption_timer++
var/corruption = getToxLoss(toxins_type = TOX_SYSCORRUPT)

View File

@@ -174,7 +174,7 @@
return toxloss
var/affected_by = TOX_DEFAULT
if(HAS_TRAIT(src, TRAIT_ROBOTICORGANISM))
if(HAS_TRAIT(src, TRAIT_ROBOTIC_ORGANISM))
affected_by = TOX_SYSCORRUPT
if(toxins_type != affected_by)
@@ -186,7 +186,7 @@
if(!forced && (status_flags & GODMODE))
return FALSE
var/affected_by = TOX_DEFAULT
if(HAS_TRAIT(src, TRAIT_ROBOTICORGANISM))
if(HAS_TRAIT(src, TRAIT_ROBOTIC_ORGANISM))
affected_by = TOX_SYSCORRUPT
if(toxins_type != TOX_OMNI && toxins_type != affected_by)
return FALSE
@@ -202,7 +202,7 @@
return FALSE
var/affected_by = TOX_DEFAULT
if(HAS_TRAIT(src, TRAIT_ROBOTICORGANISM))
if(HAS_TRAIT(src, TRAIT_ROBOTIC_ORGANISM))
affected_by = TOX_SYSCORRUPT
if(toxins_type != TOX_OMNI && toxins_type != affected_by)
return FALSE

View File

@@ -0,0 +1,94 @@
/*
Timeconsuming but highly effective surgery that purges any system corruption currently present, only works on robotic organisms.
Has a version for organic people and robotic/synthetic ones, considering robotic limbs and robotic organism isn't neccessarily linked and, say, someone could surgery a synthetic's brain into a nonsynthetic head.
*/
/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."
steps = list(
/datum/surgery_step/incise,
/datum/surgery_step/retract_skin,
/datum/surgery_step/clamp_bleeders,
/datum/surgery_step/saw,
/datum/surgery_step/clamp_bleeders,
/datum/surgery_step/incise,
/datum/surgery_step/clamp_bleeders,
/datum/surgery_step/override_safeties,
/datum/surgery_step/remove_corruption,
/datum/surgery_step/close)
location = BODY_ZONE_HEAD
/datum/surgery/purge_corruption/robotic
requires_bodypart_type = BODYPART_ROBOTIC
steps = list(
/datum/surgery_step/mechanic_open,
/datum/surgery_step/open_hatch,
/datum/surgery_step/mechanic_unwrench,
/datum/surgery_step/cut_wires,
/datum/surgery_step/prepare_electronics,
/datum/surgery_step/override_safeties,
/datum/surgery_step/remove_corruption,
/datum/surgery_step/mechanic_wrench,
/datum/surgery_step/mechanic_close)
/datum/surgery/purge_corruption/can_start(mob/user, mob/living/carbon/target, obj/item/tool)
if(!(. = ..()))
return
var/obj/item/organ/brain/B = target.getorganslot(ORGAN_SLOT_BRAIN)
if(!B || !HAS_TRAIT(target, TRAIT_ROBOTIC_ORGANISM))
return FALSE
/datum/surgery_step/override_safeties
name = "Override inbuilt safeguards (multitool)"
implements = list(TOOL_MULTITOOL = 100, TOOL_WIRECUTTER = 20)
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, "<span class='notice'>You begin to override the safeties of [target]'s brain...</span>",
"[user] begins to override the hardware safeties of [target]'s brain.",
"[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, "<span class='notice'>You succeed in overriding the safeties of [target]'s brain.</span>",
"[user] successfully overrides the safeties of [target]'s posibrain!",
"[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, "<span class='notice'>You fail overriding the safeties of [target]'s brain.</span>",
"[user] fails overriding the safeties of [target]'s brain!",
"[user] completes the surgery on [target]'s brain.")
return FALSE
/datum/surgery_step/remove_corruption
name = "Initiate system purge (multitool)"
implements = list(TOOL_MULTITOOL = 95, TOOL_WIRECUTTER = 10) //You are relatively safe just using a multitool, but you should use sterilizer or simillar success chance increasing chems regardless.
time = 80 //Takes a l o n g time, but completely purges system corruption
/datum/surgery_step/remove_corruption/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
display_results(user, target, "<span class='notice'>You begin to initiate a system purge in [target]...</span>",
"[user] begins to initiate a system purge in [target].",
"[user] begins to perform surgery on [target].")
/datum/surgery_step/remove_corruption/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
if(!target.getorganslot(ORGAN_SLOT_BRAIN) || !HAS_TRAIT(target, TRAIT_ROBOTIC_ORGANISM))
user.visible_message("<span class='warning'>[user] suddenly realises that [user.p_they()] can't actually initiate a system purge in [target]...", "<span class='warning'>You suddenly realise that you cannot initiate a system purge in [target].</span>")
return FALSE
display_results(user, target, "<span class='notice'>You successfully initate a system purge in [target]...</span>",
"[user] successfully initiates a system purge in [target].",
"[user] completes the surgery on [target].")
var/purged = target.getToxLoss(TOX_SYSCORRUPT)
target.setToxLoss(0, TOX_SYSCORRUPT)
target.Sleeping(round(purged * 0.2, 1))
return TRUE
/datum/surgery_step/remove_corruption/failure(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
if(!target.getorganslot(ORGAN_SLOT_BRAIN) || !HAS_TRAIT(target, TRAIT_ROBOTIC_ORGANISM))
user.visible_message("<span class='warning'>[user] suddenly realises that [user.p_they()] can't actually initiate a system purge in [target]...", "<span class='warning'>You suddenly realise that you cannot initiate a system purge in [target].</span>")
return FALSE
display_results(user, target, "<span class='notice'>You fail purging [target]'s system of corruption, damaging [target.p_them()] instead...</span>",
"[user] fails purging [target]'s system of corruption, damaging [target.p_them()] instead.",
"[user] completes the surgery on [target].")
target.adjustOrganLoss(ORGAN_SLOT_BRAIN, 40)
target.gain_trauma_type(BRAIN_TRAUMA_SEVERE, TRAUMA_RESILIENCE_LOBOTOMY)
return FALSE

View File

@@ -3418,6 +3418,7 @@
#include "code\modules\surgery\organic_steps.dm"
#include "code\modules\surgery\plastic_surgery.dm"
#include "code\modules\surgery\prosthetic_replacement.dm"
#include "code\modules\surgery\purge_corruption.dm"
#include "code\modules\surgery\remove_embedded_object.dm"
#include "code\modules\surgery\repair_puncture.dm"
#include "code\modules\surgery\robot_brain_surgery.dm"