From 450248864b95fa8848a7cb59ab8387d10f9240c1 Mon Sep 17 00:00:00 2001 From: cib Date: Wed, 14 Nov 2012 16:20:47 +0100 Subject: [PATCH] Added lung rupturing and lung surgery. --- code/WorkInProgress/surgery.dm | 26 +++++++++++++++++++ code/datums/organs/organ_external.dm | 1 + code/game/machinery/adv_med.dm | 5 +++- code/modules/mob/living/carbon/human/human.dm | 18 +++++++++++-- code/modules/mob/living/carbon/human/life.dm | 13 ++++++++-- 5 files changed, 58 insertions(+), 5 deletions(-) diff --git a/code/WorkInProgress/surgery.dm b/code/WorkInProgress/surgery.dm index 3fd825cb46b..2409195a00f 100644 --- a/code/WorkInProgress/surgery.dm +++ b/code/WorkInProgress/surgery.dm @@ -1147,3 +1147,29 @@ proc/spread_germs_to_organ(datum/organ/external/E, mob/living/carbon/human/user) for(var/datum/disease/alien_embryo in target.viruses) alien_embryo.cure() +/datum/surgery_step/ribcage/fix_lungs + required_tool = /obj/item/weapon/scalpel + + min_duration = 70 + max_duration = 90 + + can_use(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) + return ..() && target.is_lung_ruptured() + + begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) + 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]." ) + target.custom_pain("The pain in your chest is living hell!",1) + + end_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) + var/datum/organ/external/chest/affected = get_organ("chest") + user.visible_message("[user] mends the rupture in [target]'s lungs with \the [tool].", \ + "You mend the rupture in [target]'s lungs with \the [tool]." ) + affected.ruptured_lungs = 0 + + fail_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) + var/datum/organ/external/chest/affected = get_organ("chest") + 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) + diff --git a/code/datums/organs/organ_external.dm b/code/datums/organs/organ_external.dm index 0a6d312bd9b..1487e8a048a 100644 --- a/code/datums/organs/organ_external.dm +++ b/code/datums/organs/organ_external.dm @@ -527,6 +527,7 @@ max_damage = 150 min_broken_damage = 75 body_part = UPPER_TORSO + var/ruptured_lungs = 0 /datum/organ/external/groin name = "groin" diff --git a/code/game/machinery/adv_med.dm b/code/game/machinery/adv_med.dm index 15dbadb0061..5e6f6e9d1fc 100644 --- a/code/game/machinery/adv_med.dm +++ b/code/game/machinery/adv_med.dm @@ -279,9 +279,12 @@ var/bled = "" var/splint = "" var/internal_bleeding = "" + var/lung_ruptured = "" for(var/datum/wound/W in e.wounds) if(W.internal) internal_bleeding = "
Internal Bleeding" break + if(istype(e, /datum/organ/external/chest) && e:ruptured_lungs) + lung_ruptured = "Lung Ruptured:" if(e.status & ORGAN_SPLINTED) splint = "Splinted:" if(e.status & ORGAN_BLEEDING) @@ -295,7 +298,7 @@ if(!AN && !open && !infected & !imp) AN = "None:" if(!(e.status & ORGAN_DESTROYED)) - dat += "[e.display_name][e.burn_dam][e.brute_dam][bled][AN][splint][open][infected][imp][internal_bleeding]" + dat += "[e.display_name][e.burn_dam][e.brute_dam][bled][AN][splint][open][infected][imp][internal_bleeding][lung_ruptured]" else dat += "[e.display_name]--Not Found" dat += "" diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 45008dc63e2..f5cbd1d82d3 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -949,7 +949,7 @@ gloves.germ_level += n else germ_level += n - + /mob/living/carbon/human/revive() for (var/datum/organ/external/O in organs) O.status &= ~ORGAN_BROKEN @@ -970,4 +970,18 @@ del(H) - ..() + ..() + +/mob/living/carbon/human/proc/is_lung_ruptured() + var/datum/organ/external/chest/E = get_organs("chest") + return E.ruptured_lungs + + +/mob/living/carbon/human/proc/rupture_lung() + var/datum/organ/external/chest/E = get_organs("chest") + + if(E.ruptured_lungs == 0) + src.custom_pain("You feel a stabbing pain in your chest!", 1) + + E.ruptured_lungs = 1 + diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 7290b23d4e5..ea79c01a5b2 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -488,16 +488,22 @@ proc/breathe() - if(reagents.has_reagent("lexorin")) return if(istype(loc, /obj/machinery/atmospherics/unary/cryo_cell)) return + var/lung_ruptured = is_lung_ruptured() + if(lung_ruptured && prob(2)) + spawn emote("me", 1, "coughs up blood!") + src.drip(10) + var/datum/gas_mixture/environment = loc.return_air() var/datum/gas_mixture/breath // HACK NEED CHANGING LATER if(health < 0) losebreath++ - + if(lung_ruptured && prob(4)) + spawn emote("me", 1, "gasps for air!") + losebreath += 5 if(losebreath>0) //Suffocating so do not take a breath losebreath-- if (prob(10)) //Gasp per 10 ticks? Sounds about right. @@ -700,6 +706,9 @@ apply_damage(HEAT_GAS_DAMAGE_LEVEL_3, BURN, "head") fire_alert = max(fire_alert, 2) + if(oxyloss >= 50 && prob(oxyloss / 5)) + rupture_lung() + //Temporary fixes to the alerts. return 1