Organ/Surgery Overhaul Part 1

This commit is contained in:
ZomgPonies
2013-12-19 07:25:55 -05:00
parent aa25918e50
commit 5ce256b73c
21 changed files with 241 additions and 84 deletions
@@ -173,6 +173,9 @@ emp_act
for(var/datum/organ/external/O in organs)
if(O.status & ORGAN_DESTROYED) continue
O.emp_act(severity)
for(var/datum/organ/internal/O in internal_organs)
if(O.robotic == 0) continue
O.emp_act(severity)
..()
@@ -21,7 +21,7 @@
var/lip_style = null //no lipstick by default- arguably misleading, as it could be used for general makeup
var/age = 30 //Player's age (pure fluff)
var/b_type = "A+" //Player's bloodtype (Not currently used, just character fluff)
var/b_type = "A+" //Player's bloodtype
var/underwear = 1 //Which underwear the player wants
var/backbag = 2 //Which backpack type the player has chosen. Nothing, Satchel or Backpack.
@@ -1401,10 +1401,6 @@
if(!O.up && tinted_weldhelh)
client.screen += global_hud.darkMask
if(eye_stat > 20)
if(eye_stat > 30) client.screen += global_hud.darkMask
else client.screen += global_hud.vimpaired
if(machine)
if(!machine.check_eye(src)) reset_view(null)
else
-1
View File
@@ -81,7 +81,6 @@
var/lying = 0
var/lying_prev = 0
var/canmove = 1
var/eye_stat = null//Living, potentially Carbon
var/lastpuke = 0
var/unacidable = 0
var/small = 0
+6 -7
View File
@@ -68,13 +68,12 @@ var/const/BLOOD_VOLUME_SURVIVE = 122
var/datum/organ/internal/heart/heart = internal_organs["heart"]
if(heart)
switch(heart.damage)
if(5 to 10)
if(1 to heart.min_bruised_damage)
blood_volume *= 0.8
if(11 to 20)
blood_volume *= 0.5
if(21 to INFINITY)
blood_volume *= 0.3
if(heart.min_bruised_damage to heart.min_broken_damage)
blood_volume *= 0.6
if(heart.min_broken_damage to INFINITY)
blood_volume *= 0.4
//Effects of bloodloss
switch(blood_volume)
if(BLOOD_VOLUME_SAFE to 10000)
@@ -106,7 +105,7 @@ var/const/BLOOD_VOLUME_SURVIVE = 122
src << "\red You feel extremely [word]"
if(BLOOD_VOLUME_SURVIVE to BLOOD_VOLUME_BAD)
oxyloss += 5
toxloss += 5
toxloss += 1
if(prob(15))
var/word = pick("dizzy","woosey","faint")
src << "\red You feel extremely [word]"
+1 -1
View File
@@ -58,7 +58,7 @@
internal_organs_by_name["liver"] = new/datum/organ/internal/liver(src)
internal_organs_by_name["kidney"] = new/datum/organ/internal/kidney(src)
internal_organs_by_name["brain"] = new/datum/organ/internal/brain(src)
// internal_organs_by_name["eyes"] = new/datum/organ/internal/eyes(src)
internal_organs_by_name["eyes"] = new/datum/organ/internal/eyes(src)
for(var/name in organs_by_name)
organs += organs_by_name[name]
+36 -2
View File
@@ -10,6 +10,7 @@
var/min_bruised_damage = 10
var/min_broken_damage = 30
var/parent_organ = "chest"
var/robotic = 0 //For being a robot
/datum/organ/internal/proc/rejuvenate()
damage=0
@@ -31,12 +32,33 @@
src.owner = H
/datum/organ/internal/proc/take_damage(amount, var/silent=0)
src.damage += amount
if(src.robotic == 2)
src.damage += amount * 0.8
else
src.damage += amount
var/datum/organ/external/parent = owner.get_organ(parent_organ)
if (!silent)
owner.custom_pain("Something inside your [parent.display_name] hurts a lot.", 1)
/datum/organ/internal/proc/emp_act(severity)
if(src.robotic == 1)
take_damage(15, 0)
if(severity == 2)
take_damage(5, 0)
if(src.robotic == 2)
take_damage(30, 0)
if(severity == 2)
take_damage(15, 0)
/datum/organ/internal/proc/mechanize() //Being used to make robutt hearts, etc
robotic = 2
/datum/organ/internal/proc/mechassist() //Used to add things like pacemakers, etc
robotic = 1
min_bruised_damage = 15
min_broken_damage = 35
/****************************************************
INTERNAL ORGANS DEFINES
****************************************************/
@@ -102,4 +124,16 @@
/datum/organ/internal/brain
name = "brain"
parent_organ = "head"
parent_organ = "head"
/datum/organ/internal/eyes
name = "eyes"
parent_organ = "head"
process() //Eye damage replaces the old eye_stat var.
if(damage > min_bruised_damage)
if(damage > min_broken_damage)
owner.client.screen += global_hud.darkMask
owner.eye_blind = 20
else
owner.client.screen += global_hud.vimpaired
+30 -3
View File
@@ -516,7 +516,7 @@ datum
if(15 to 25)
M.drowsyness = max(M.drowsyness, 20)
if(25 to INFINITY)
M.Paralyse(20)
M.Weaken(20)
M.drowsyness = max(M.drowsyness, 30)
data++
..()
@@ -1596,6 +1596,11 @@ datum
M.eye_blind = 0
// M.disabilities &= ~NEARSIGHTED //doesn't even do anythig cos of the disabilities = 0 bit
// M.sdisabilities &= ~BLIND //doesn't even do anythig cos of the sdisabilities = 0 bit
if(ishuman(M))
var/mob/living/carbon/human/H = M
var/datum/organ/internal/eyes/E = H.internal_organs["eyes"]
if(istype(E))
E.damage = max(E.damage-5 , 0)
M.SetWeakened(0)
M.SetStunned(0)
M.SetParalysis(0)
@@ -1614,6 +1619,25 @@ datum
..()
return
peridaxon
name = "Peridaxon"
id = "peridaxon"
description = "Used to encourage recovery of internal organs and nervous systems. Medicate cautiously."
reagent_state = LIQUID
color = "#C8A5DC" // rgb: 200, 165, 220
// overdose = 10
on_mob_life(var/mob/living/M as mob)
if(!M) M = holder.my_atom
if(ishuman(M))
var/mob/living/carbon/human/H = M
var/datum/organ/internal/I = H.internal_organs
if(I.parent_organ == "chest")
I.damage = max(I.damage -1 , 0)
..()
return
synaptizine
name = "Synaptizine"
id = "synaptizine"
@@ -1710,8 +1734,11 @@ datum
if(!M) M = holder.my_atom
M.eye_blurry = max(M.eye_blurry-5 , 0)
M.eye_blind = max(M.eye_blind-5 , 0)
M.disabilities &= ~NEARSIGHTED
M.eye_stat = max(M.eye_stat-5, 0)
if(ishuman(M))
var/mob/living/carbon/human/H = M
var/datum/organ/internal/eyes/E = H.internal_organs["eyes"]
if(istype(E))
E.damage = max(E.damage-5 , 0)
// M.sdisabilities &= ~1 Replaced by eye surgery
..()
return
@@ -189,6 +189,14 @@ datum
required_reagents = list("silicon" = 1, "carbon" = 1)
result_amount = 2
peridaxon
name = "Peridaxon"
id = "peridaxon"
result = "peridaxon"
required_reagents = list("bicaridine" = 2, "clonexadone" = 2)
required_catalysts = list("plasma" = 5)
result_amount = 2
virus_food
name = "Virus Food"
id = "virusfood"
+12 -2
View File
@@ -36,12 +36,15 @@
user.visible_message("\blue [user] has separated the corneas on [target]'s eyes with \the [tool]." , \
"\blue You have separated the corneas on [target]'s eyes with \the [tool].",)
target.op_stage.eyes = 1
target.blinded += 1.5
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/internal/eyes/eyes = target.internal_organs["eyes"]
var/datum/organ/external/affected = target.get_organ(target_zone)
user.visible_message("\red [user]'s hand slips, slicing [target]'s eyes wth \the [tool]!" , \
"\red Your hand slips, slicing [target]'s eyes wth \the [tool]!" )
affected.createwound(CUT, 10)
eyes.take_damage(5, 1)
/datum/surgery_step/eye/lift_eyes
allowed_tools = list(
@@ -66,10 +69,12 @@
target.op_stage.eyes = 2
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/internal/eyes/eyes = target.internal_organs["eyes"]
var/datum/organ/external/affected = target.get_organ(target_zone)
user.visible_message("\red [user]'s hand slips, damaging [target]'s eyes with \the [tool]!", \
"\red Your hand slips, damaging [target]'s eyes with \the [tool]!")
target.apply_damage(10, BRUTE, affected)
eyes.take_damage(5, 1)
/datum/surgery_step/eye/mend_eyes
allowed_tools = list(
@@ -95,10 +100,12 @@
target.op_stage.eyes = 3
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/internal/eyes/eyes = target.internal_organs["eyes"]
var/datum/organ/external/affected = target.get_organ(target_zone)
user.visible_message("\red [user]'s hand slips, stabbing \the [tool] into [target]'s eye!", \
"\red Your hand slips, stabbing \the [tool] into [target]'s eye!")
target.apply_damage(10, BRUTE, affected)
eyes.take_damage(5, 1)
/datum/surgery_step/eye/cauterize
allowed_tools = list(
@@ -119,16 +126,19 @@
"You are beginning to cauterize the incision around [target]'s eyes with \the [tool].")
end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/internal/eyes/eyes = target.internal_organs["eyes"]
user.visible_message("\blue [user] cauterizes the incision around [target]'s eyes with \the [tool].", \
"\blue You cauterize the incision around [target]'s eyes with \the [tool].")
if (target.op_stage.eyes == 3)
target.disabilities &= ~NEARSIGHTED
target.sdisabilities &= ~BLIND
target.eye_stat = 0
eyes.damage -= 15
target.op_stage.eyes = 0
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/internal/eyes/eyes = target.internal_organs["eyes"]
var/datum/organ/external/affected = target.get_organ(target_zone)
user.visible_message("\red [user]'s hand slips, searing [target]'s eyes with \the [tool]!", \
"\red Your hand slips, searing [target]'s eyes with \the [tool]!")
target.apply_damage(5, BURN, affected)
target.eye_stat += 5
eyes.take_damage(5, 1)
+60 -5
View File
@@ -216,8 +216,12 @@
user.visible_message("[user] starts mending the rupture in [target]'s lungs with \the [tool].", \
"You start mending the rupture in [target]'s lungs with \the [tool]." )
if(heart.damage > 0)
user.visible_message("[user] starts mending the bruises on [target]'s heart with \the [tool].", \
"You start mending the bruises on [target]'s heart with \the [tool]." )
if(heart.robotic < 2)
user.visible_message("[user] starts mending the bruises on [target]'s heart with \the [tool].", \
"You start mending the bruises on [target]'s heart with \the [tool]." )
if(heart.robotic == 2)
user.visible_message("\blue [user] attempts to repair [target]'s mechanical heart with \the [tool]...", \
"\blue You attempt to repair [target]'s heart with \the [tool]...")
if(liver.damage > 0)
user.visible_message("[user] starts mending the bruises on [target]'s liver with \the [tool].", \
"You start mending the bruises on [target]'s liver with \the [tool]." )
@@ -239,9 +243,13 @@
lungs.damage = 0
if(heart.damage > 0)
user.visible_message("\blue [user] treats the bruises on [target]'s heart with \the [tool].", \
"\blue You treats the bruises on [target]'s heart with \the [tool]." )
heart.damage = 0
if(heart.robotic == 2)
user.visible_message("\blue [user] pokes [target]'s mechanical heart with \the [tool].", \
"\red [target]'s heart is not organic, you cannot operate on it with \the [tool]!")
else
user.visible_message("\blue [user] treats the bruises on [target]'s heart with \the [tool].", \
"\blue You treat the bruises on [target]'s heart with \the [tool]." )
heart.damage = 0
if(liver.damage > 0)
user.visible_message("\blue [user] treats the bruises on [target]'s liver with \the [tool].", \
@@ -258,3 +266,50 @@
user.visible_message("\red [user]'s hand slips, slicing an artery inside [target]'s chest with \the [tool]!", \
"\red Your hand slips, slicing an artery inside [target]'s chest with \the [tool]!")
affected.createwound(CUT, 20)
/datum/surgery_step/ribcage/fix_chest_internal_robot //For artificial organs
allowed_tools = list(
/obj/item/stack/nanopaste = 100, \
/obj/item/weapon/bonegel = 60, \
/obj/item/weapon/screwdriver = 30, \
)
min_duration = 70
max_duration = 90
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/is_chest_organ_damaged = 0
var/datum/organ/external/chest/chest = target.get_organ("chest")
for(var/datum/organ/internal/I in chest.internal_organs) if(I.damage > 0)
is_chest_organ_damaged = 1
break
return ..() && is_chest_organ_damaged && target.op_stage.ribcage == 2
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/internal/heart/heart = target.internal_organs["heart"]
if(heart.damage > 0)
if(heart.robotic == 2)
user.visible_message("[user] starts mending the mechanisms on [target]'s heart with \the [tool].", \
"You start mending the mechanisms on [target]'s heart with \the [tool]." )
target.custom_pain("The pain in your chest is living hell!",1)
..()
end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/internal/heart/heart = target.internal_organs["heart"]
if(heart.damage > 0)
user.visible_message("\blue [user] repairs [target]'s heart with \the [tool].", \
"\blue You repair [target]'s heart with \the [tool]." )
heart.damage = 0
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/internal/heart/heart = target.internal_organs["heart"]
user.visible_message("\red [user]'s hand slips, smearing [tool] in the incision in [target]'s heart, gumming it up!!" , \
"\red Your hand slips, smearing [tool] in the incision in [target]'s heart, gumming it up!")
heart.take_damage(5, 0)
target.adjustToxLoss(5)
//////////////////////////////////////////////////////////////////
// HEART SURGERY //
//////////////////////////////////////////////////////////////////