From 48aa2bb8f9be1e056333315fb51ebe0dabc943fb Mon Sep 17 00:00:00 2001 From: Zuhayr Date: Wed, 12 Jun 2013 14:17:05 -0700 Subject: [PATCH] Internal damage from yanking out things, damage from moving with shrapnel and things inside your body. --- code/modules/mob/living/carbon/human/human.dm | 53 ++++++++++++++++--- .../mob/living/carbon/human/human_damage.dm | 4 +- .../mob/living/carbon/human/human_movement.dm | 2 + 3 files changed, 50 insertions(+), 9 deletions(-) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 6f76bc7f269..17c3fc3dfea 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -1123,21 +1123,40 @@ usr.next_move = world.time + 20 var/list/valid_objects = get_visible_implants(1) + var/datum/organ/external/affected = null if(!valid_objects.len) src << "You have nothing stuck in your wounds that is large enough to remove without surgery." return - var/obj/item/weapon/selection = input("What do you want to yank out?", "Embedded objects") in valid_objects - visible_message("You rip [selection] out of your body in a welter of blood.") - bloody_hands(src) - selection.loc = get_turf(src) + if(src.stat == 1) + src << "You are unconcious and cannot do that!" + return - for(var/datum/organ/external/organ in src.organs) + if(src.restrained()) + src << "You are restrained and cannot do that!" + return + + var/obj/item/weapon/selection = input("What do you want to yank out?", "Embedded objects") in valid_objects + + for(var/datum/organ/external/organ in src.organs) //Grab the organ holding the implant. Messy as Hell, TBD: fix. for(var/obj/item/weapon/O in organ.implants) if(O == selection) - organ.implants -= selection + affected = organ + src << "You attempt to get a good grip on the [selection] in your [affected] with bloody fingers." + bloody_hands(src) + + spawn(80) + visible_message("[src] rips [selection] out of their [affected] in a welter of blood.","You rip [selection] out of your [affected] in a welter of blood.") + selection.loc = get_turf(src) + affected.implants -= selection + shock_stage+=10 + + if(prob(10)) //I'M SO ANEMIC I COULD JUST -DIE-. + var/datum/wound/internal_bleeding/I = new (15) + affected.wounds += I + src.custom_pain("Something tears wetly in your [affected] as [selection] is pulled free!", 1) return 1 /mob/living/carbon/human/proc/get_visible_implants(var/class = 0) @@ -1148,4 +1167,24 @@ if(!istype(O,/obj/item/weapon/implant) && O.w_class > class) visible_implants += O - return(visible_implants) \ No newline at end of file + return(visible_implants) + +/mob/living/carbon/human/proc/handle_embedded_objects() + + for(var/datum/organ/external/organ in src.organs) + for(var/obj/item/weapon/O in organ.implants) + if(!istype(O,/obj/item/weapon/implant) && prob(5)) //Moving with things stuck in you could be bad. + // All kinds of embedded objects cause bleeding. + var/msg = null + switch(rand(1,3)) + if(1) + msg ="A spike of pain jolts your [organ] as you bump [O] inside." + if(2) + msg ="Your movement jostles [O] in your [organ] painfully." + if(3) + msg ="[O] in your [organ] twists painfully as you move." + src << msg + + organ.status |= ORGAN_BLEEDING + organ.take_damage(rand(1,3), 0, 0) + organ.adjustToxLoss(rand(1,3)) \ No newline at end of file diff --git a/code/modules/mob/living/carbon/human/human_damage.dm b/code/modules/mob/living/carbon/human/human_damage.dm index fc0d098ad9c..12b363fc316 100644 --- a/code/modules/mob/living/carbon/human/human_damage.dm +++ b/code/modules/mob/living/carbon/human/human_damage.dm @@ -227,8 +227,8 @@ if(!organ) return if(istype(used_weapon,/obj/item/weapon)) var/obj/item/weapon/W = used_weapon - if(damage > 20 && (prob(damage/W.w_class) || sharp)) //The larger it is, the harder it needs to hit to stick. - W.loc = organ + if(damage > (5*W.w_class) && (prob(damage/W.w_class) || sharp)) //The larger it is, the harder it needs to hit to stick. + W.loc = organ //Sharp objects will always embed if they do enough damage. organ.implants += W visible_message("\The [W] sticks in the wound!") W.add_blood(src) diff --git a/code/modules/mob/living/carbon/human/human_movement.dm b/code/modules/mob/living/carbon/human/human_movement.dm index 74342ca7d1a..894ea1ff042 100644 --- a/code/modules/mob/living/carbon/human/human_movement.dm +++ b/code/modules/mob/living/carbon/human/human_movement.dm @@ -7,6 +7,8 @@ if (istype(loc, /turf/space)) return -1 // It's hard to be slowed down in space by... anything + handle_embedded_objects() //Moving with objects stuck in you can cause bad times. + var/health_deficiency = (100 - health - halloss) if(health_deficiency >= 40) tally += (health_deficiency / 25)