Standardized Robotic Organ Checking--Removes Mechassited Organs

This commit is contained in:
Fox McCloud
2018-07-07 21:33:42 -04:00
parent 2a0eee38b0
commit 27ebe7a6fe
46 changed files with 114 additions and 174 deletions
@@ -7,8 +7,6 @@
var/implant_color = "#FFFFFF"
var/implant_overlay
tough = TRUE // Immune to damage
sterile = TRUE // Doesn't accumulate germs
robotic = 2 // these are cybernetic after all
/obj/item/organ/internal/cyberimp/New(var/mob/M = null)
. = ..()
+1 -1
View File
@@ -64,7 +64,7 @@
var/obj/item/organ/external/BP = X
var/brutedamage = BP.brute_dam
if(BP.status & ORGAN_ROBOT)
if(BP.is_robotic())
continue
//We want an accurate reading of .len
+13 -41
View File
@@ -13,7 +13,6 @@
var/organ_tag = "organ"
var/parent_organ = "chest"
var/robotic = 0 //For being a robot
var/list/datum/autopsy_data/autopsy_data = list()
var/list/trace_chemicals = list() // traces of chemicals in the organ,
@@ -75,7 +74,7 @@
blood_DNA[dna.unique_enzymes] = dna.b_type
/obj/item/organ/proc/necrotize(update_sprite=TRUE)
if(status & ORGAN_ROBOT)
if(is_robotic())
return
damage = max_damage
status |= ORGAN_DEAD
@@ -95,7 +94,7 @@
return
//Process infections
if((status & ORGAN_ROBOT) || sterile || (owner && (IS_PLANT in owner.species.species_traits)))
if(is_robotic() || sterile || (owner && (IS_PLANT in owner.species.species_traits)))
germ_level = 0
return
@@ -175,10 +174,8 @@
/obj/item/organ/proc/rejuvenate()
damage = 0
germ_level = 0
if(status & ORGAN_ROBOT) //Robotic organs stay robotic.
if(is_robotic()) //Robotic organs stay robotic.
status = ORGAN_ROBOT
else if(status & ORGAN_ASSISTED) //Assisted organs stay assisted.
status = ORGAN_ASSISTED
else
status = 0
if(!owner)
@@ -224,7 +221,7 @@
/obj/item/organ/proc/receive_damage(amount, silent = 0)
if(tough)
return
if(status & ORGAN_ROBOT)
if(is_robotic())
damage = between(0, damage + (amount * 0.8), max_damage)
else
damage = between(0, damage + amount, max_damage)
@@ -240,21 +237,12 @@
necrotize()
/obj/item/organ/proc/robotize() //Being used to make robutt hearts, etc
robotic = 2
status &= ~ORGAN_BROKEN
status &= ~ORGAN_SPLINTED
status |= ORGAN_ROBOT
/obj/item/organ/proc/mechassist() //Used to add things like pacemakers, etc
robotize(1) //Skip the icon/name setting that occurs in robotize to avoid having to reset the icon file.
status &= ~ORGAN_ROBOT
status |= ORGAN_ASSISTED
robotic = 1
min_bruised_damage = 15
min_broken_damage = 35
/obj/item/organ/external/emp_act(severity)
if(!(status & ORGAN_ROBOT) || emp_proof)
if(!is_robotic() || emp_proof)
return
if(tough)
switch(severity)
@@ -274,25 +262,21 @@
receive_damage(0, 7)
/obj/item/organ/internal/emp_act(severity)
if(!robotic || emp_proof)
if(!is_robotic() || emp_proof)
return
if(robotic == 2)
if(is_robotic())
switch(severity)
if(1.0)
if(1)
receive_damage(20, 1)
if(2.0)
if(2)
receive_damage(7, 1)
else if(robotic == 1)
receive_damage(11, 1)
/obj/item/organ/internal/heart/emp_act(intensity)
if(emp_proof)
return
if(owner && robotic == 2)
if(owner && is_robotic())
Stop() // In the name of looooove~!
owner.visible_message("<span class='danger'>[owner] clutches [owner.p_their()] chest and gasps!</span>","<span class='userdanger'>You clutch your chest in pain!</span>")
else if(owner && robotic == 1)
receive_damage(11,1)
/obj/item/organ/proc/remove(var/mob/living/user,special = 0)
if(!istype(owner))
@@ -335,20 +319,15 @@ I use this so that this can be made better once the organ overhaul rolls out --
return 0
return src == O.get_int_organ(organ_tag)
/obj/item/organ/proc/is_robotic(var/purist = FALSE)
if(purist && (robotic > 1 || status & (ORGAN_ROBOT))) //Only the robotiest.
/obj/item/organ/proc/is_robotic()
if(status & ORGAN_ROBOT)
return TRUE
if(robotic || status & (ORGAN_ROBOT|ORGAN_ASSISTED)) //Any tech will do.
return TRUE
return FALSE
/obj/item/organ/serialize()
var/data = ..()
if(status != 0)
data["status"] = status
if(robotic > 0)
data["robotic"] = robotic
// Save the DNA datum if: The owner doesn't exist, or the dna doesn't match
// the owner
@@ -356,14 +335,7 @@ I use this so that this can be made better once the organ overhaul rolls out --
data["dna"] = dna.serialize()
return data
/obj/item/organ/deserialize(var/data)
switch(data["robotic"])
if(1)
mechassist()
if(2)
robotize()
else
// Nothing
/obj/item/organ/deserialize(data)
if(isnum(data["status"]))
status = data["status"]
if(islist(data["dna"]))
+17 -19
View File
@@ -241,7 +241,7 @@
#undef LIMB_DMG_PROB
/obj/item/organ/external/proc/heal_damage(brute, burn, internal = 0, robo_repair = 0)
if(status & ORGAN_ROBOT && !robo_repair)
if(is_robotic() && !robo_repair)
return
brute_dam = max(brute_dam - brute, 0)
@@ -260,10 +260,8 @@ This function completely restores a damaged organ to perfect condition.
*/
/obj/item/organ/external/rejuvenate()
damage_state = "00"
if(status & ORGAN_ROBOT) //Robotic organs stay robotic.
if(is_robotic()) //Robotic organs stay robotic.
status = ORGAN_ROBOT
else if(status & ORGAN_ASSISTED) //Assisted organs stay assisted.
status = ORGAN_ASSISTED
else
status = 0
germ_level = 0
@@ -330,7 +328,7 @@ Note that amputating the affected organ does in fact remove the infection from t
*/
/obj/item/organ/external/proc/update_germs()
if((status & ORGAN_ROBOT) || (IS_PLANT in owner.species.species_traits)) //Robotic limbs shouldn't be infected, nor should nonexistant limbs.
if(is_robotic() || (IS_PLANT in owner.species.species_traits)) //Robotic limbs shouldn't be infected, nor should nonexistant limbs.
germ_level = 0
return
@@ -381,12 +379,12 @@ Note that amputating the affected organ does in fact remove the infection from t
//spread the infection to child and parent organs
if(children)
for(var/obj/item/organ/external/child in children)
if(child.germ_level < germ_level && !(child.status & ORGAN_ROBOT))
if(child.germ_level < germ_level && !child.is_robotic())
if(child.germ_level < INFECTION_LEVEL_ONE*2 || prob(30))
child.germ_level++
if(parent)
if(parent.germ_level < germ_level && !(parent.status & ORGAN_ROBOT))
if(parent.germ_level < germ_level && !parent.is_robotic())
if(parent.germ_level < INFECTION_LEVEL_ONE*2 || prob(30))
parent.germ_level++
@@ -398,14 +396,14 @@ Note that amputating the affected organ does in fact remove the infection from t
//Updates brute_damn and burn_damn from wound damages. Updates BLEEDING status.
/obj/item/organ/external/proc/check_fracture()
if(config.bones_can_break && brute_dam > min_broken_damage && !(status & ORGAN_ROBOT))
if(config.bones_can_break && brute_dam > min_broken_damage && !is_robotic())
fracture()
/obj/item/organ/external/proc/check_for_internal_bleeding(damage)
if(NO_BLOOD in owner.species.species_traits)
return
var/local_damage = brute_dam + damage
if(damage > 15 && local_damage > 30 && prob(damage) && !(status & ORGAN_ROBOT))
if(damage > 15 && local_damage > 30 && prob(damage) && !is_robotic())
internal_bleeding = TRUE
owner.custom_pain("You feel something rip in your [name]!")
@@ -462,20 +460,20 @@ Note that amputating the affected organ does in fact remove the infection from t
switch(disintegrate)
if(DROPLIMB_SHARP)
if(!clean)
var/gore_sound = "[(status & ORGAN_ROBOT) ? "tortured metal" : "ripping tendons and flesh"]"
var/gore_sound = "[is_robotic() ? "tortured metal" : "ripping tendons and flesh"]"
owner.visible_message(
"<span class='danger'>\The [owner]'s [src.name] flies off in an arc!</span>",\
"<span class='moderate'><b>Your [src.name] goes flying off!</b></span>",\
"<span class='danger'>You hear a terrible sound of [gore_sound].</span>")
if(DROPLIMB_BURN)
var/gore = "[(status & ORGAN_ROBOT) ? "": " of burning flesh"]"
var/gore = "[is_robotic() ? "" : " of burning flesh"]"
owner.visible_message(
"<span class='danger'>\The [owner]'s [src.name] flashes away into ashes!</span>",\
"<span class='moderate'><b>Your [src.name] flashes away into ashes!</b></span>",\
"<span class='danger'>You hear a crackling sound[gore].</span>")
if(DROPLIMB_BLUNT)
var/gore = "[(status & ORGAN_ROBOT) ? "": " in shower of gore"]"
var/gore_sound = "[(status & ORGAN_ROBOT) ? "rending sound of tortured metal" : "sickening splatter of gore"]"
var/gore = "[is_robotic() ? "": " in shower of gore"]"
var/gore_sound = "[is_robotic() ? "rending sound of tortured metal" : "sickening splatter of gore"]"
owner.visible_message(
"<span class='danger'>\The [owner]'s [src.name] explodes[gore]!</span>",\
"<span class='moderate'><b>Your [src.name] explodes[gore]!</b></span>",\
@@ -573,7 +571,7 @@ Note that amputating the affected organ does in fact remove the infection from t
//empties the bodypart from its organs and other things inside it
/obj/item/organ/external/proc/drop_organs(mob/user)
var/turf/T = get_turf(src)
if(status != ORGAN_ROBOT)
if(!is_robotic())
playsound(T, 'sound/effects/splat.ogg', 25, 1)
for(var/obj/item/I in src)
I.forceMove(T)
@@ -598,7 +596,7 @@ Note that amputating the affected organ does in fact remove the infection from t
holder.unEquip(holder.legcuffed)
/obj/item/organ/external/proc/fracture()
if(status & ORGAN_ROBOT)
if(is_robotic())
return //ORGAN_BROKEN doesn't have the same meaning for robot limbs
if((status & ORGAN_BROKEN) || cannot_break)
@@ -620,7 +618,7 @@ Note that amputating the affected organ does in fact remove the infection from t
release_restraints()
/obj/item/organ/external/proc/mend_fracture()
if(status & ORGAN_ROBOT)
if(is_robotic())
return 0 //ORGAN_BROKEN doesn't have the same meaning for robot limbs
if(brute_dam > min_broken_damage)
return 0 //will just immediately fracture again
@@ -679,12 +677,12 @@ Note that amputating the affected organ does in fact remove the infection from t
return FALSE
/obj/item/organ/external/proc/is_usable()
if(((status & ORGAN_ROBOT) && get_damage() >= max_damage) && !tough) //robot limbs just become inoperable at max damage
if((is_robotic() && get_damage() >= max_damage) && !tough) //robot limbs just become inoperable at max damage
return
return !(status & (ORGAN_MUTATED|ORGAN_DEAD))
/obj/item/organ/external/proc/is_malfunctioning()
return ((status & ORGAN_ROBOT) && (brute_dam + burn_dam) >= 10 && prob(brute_dam + burn_dam) && !tough)
return (is_robotic() && (brute_dam + burn_dam) >= 10 && prob(brute_dam + burn_dam) && !tough)
/obj/item/organ/external/remove(var/mob/living/user, var/ignore_children)
@@ -766,7 +764,7 @@ Note that amputating the affected organ does in fact remove the infection from t
/obj/item/organ/external/serialize()
var/list/data = ..()
if(robotic == 2)
if(is_robotic())
data["company"] = model
// If we wanted to store wound information, here is where it would go
return data
+5 -5
View File
@@ -25,7 +25,7 @@ var/global/list/limb_icon_cache = list()
deform = new_deform ? new_deform : deform
/obj/item/organ/external/proc/sync_colour_to_human(var/mob/living/carbon/human/H)
if(status & ORGAN_ROBOT && !(species && species.name == "Machine")) //machine people get skin color
if(is_robotic() && !(species && species.name == "Machine")) //machine people get skin color
return
if(species && H.species && species.name != H.species.name)
return
@@ -44,7 +44,7 @@ var/global/list/limb_icon_cache = list()
change_organ_icobase(C.icobase, C.deform)
/obj/item/organ/external/proc/sync_colour_to_dna()
if(status & ORGAN_ROBOT)
if(is_robotic())
return
if(!isnull(dna.GetUIValue(DNA_UI_SKIN_TONE)) && ((species.bodyflags & HAS_SKIN_TONE) || (species.bodyflags & HAS_ICON_SKIN_TONE)))
s_col = null
@@ -76,7 +76,7 @@ var/global/list/limb_icon_cache = list()
var/icon_file = new_icons[1]
var/new_icon_state = new_icons[2]
mob_icon = new /icon(icon_file, new_icon_state)
if(!skeletal && !(status & ORGAN_ROBOT))
if(!skeletal && !is_robotic())
if(status & ORGAN_DEAD)
mob_icon.ColorTone(rgb(10,50,0))
mob_icon.SetIntensity(0.7)
@@ -172,7 +172,7 @@ var/global/list/limb_icon_cache = list()
if(skeletal)
icon_file = 'icons/mob/human_races/r_skeleton.dmi'
else if(status & ORGAN_ROBOT)
else if(is_robotic())
icon_file = 'icons/mob/human_races/robotic.dmi'
else
if(status & ORGAN_MUTATED)
@@ -184,7 +184,7 @@ var/global/list/limb_icon_cache = list()
/obj/item/organ/external/chest/get_icon_state(skeletal)
var/result = ..()
if(fat && !skeletal && !(status & ORGAN_ROBOT) && (CAN_BE_FAT in species.species_traits))
if(fat && !skeletal && !is_robotic() && (CAN_BE_FAT in species.species_traits))
result[2] += "_fat"
return result
+5 -17
View File
@@ -90,7 +90,7 @@
return
/obj/item/organ/internal/proc/prepare_eat()
if(status == ORGAN_ROBOT)
if(is_robotic())
return //no eating cybernetic implants!
var/obj/item/reagent_containers/food/snacks/organ/S = new
S.name = name
@@ -315,7 +315,7 @@
return eyes_icon
/obj/item/organ/internal/eyes/proc/get_colourmatrix() //Returns a special colour matrix if the eyes are organic and the mob is colourblind, otherwise it uses the current one.
if(!robotic && owner.disabilities & COLOURBLIND)
if(!is_robotic() && owner.disabilities & COLOURBLIND)
return colourblind_matrix
else
return colourmatrix
@@ -355,8 +355,8 @@
owner.SetEyeBlurry(0)
owner.SetEyeBlind(0)
/obj/item/organ/internal/robotize(var/icon_bypass) //If icon bypass isn't null, skip the processing here and go straight to the parent call.
if(!icon_bypass && !(status & ORGAN_ROBOT)) //Don't override the icons for the already-mechanical IPC organs.
/obj/item/organ/internal/robotize() //If icon bypass isn't null, skip the processing here and go straight to the parent call.
if(!is_robotic()) //Don't override the icons for the already-mechanical IPC organs.
var/list/states = icon_states('icons/obj/surgery.dmi') //Insensitive to specially-defined icon files for species like the Drask or whomever else. Everyone gets the same robotic heart.
if(slot == "heart" && ("[slot]-prosthetic-on" in states) && ("[slot]-prosthetic-off" in states)) //Give the robotic heart its robotic heart icons if they exist.
var/obj/item/organ/internal/heart/H = src
@@ -375,19 +375,7 @@
dark_view = 2
..() //Make sure the organ's got the robotic status indicators before updating the client colour.
if(owner)
owner.update_client_colour(0) //Since both mechassisted and mechanical eyes give dark_view of 2 and full colour vision atm, just having this here is fine as mechassist() will call it anyway.
/obj/item/organ/internal/mechassist()
..() //Go back, call robotize(), adjust the robotic status indicators and the organ damage parameters.
var/list/states = icon_states(icon) //Sensitive to specially-defined icon files since the organs are not fully synthetic.
if(slot == "heart" && ("[organ_tag]-assisted-on" in states) && ("[organ_tag]-assisted-off" in states)) //Give the mechassisted heart its mechassisted heart icons if they exist.
var/obj/item/organ/internal/heart/H = src
H.icon_base = "[organ_tag]-assisted"
H.dead_icon = "[organ_tag]-assisted-off"
H.update_icon()
else if("[organ_tag]-assisted" in states) //Give the mechassisted organ its mechassisted organ icons if they exist.
icon_state = "[organ_tag]-assisted"
name = "mechanically assisted [initial(name)]" //Avoid setting the organ's name to something like "mechanically assisted mechanical eyes".
owner.update_client_colour(0) //Since mechanical eyes give dark_view of 2 and full colour vision atm, just having this here is fine.
/obj/item/organ/internal/liver
name = "liver"
+1 -1
View File
@@ -9,7 +9,7 @@
parent_organ = "head"
organ_tag = "stack"
slot = "vox_stack"
robotic = 2
status = ORGAN_ROBOT
vital = 1
/obj/item/organ/internal/stack/vox