From ae31f9cdcfea10a1868280247bedefd533081799 Mon Sep 17 00:00:00 2001 From: Nanai Date: Wed, 13 Nov 2013 19:30:21 -0500 Subject: [PATCH] Surgery Update Proper repair surgery for internal organs- Scalpel replaced by membranes from advanced kits, robotic hearts have a separate surgery. --- code/game/objects/items/stacks/medical.dm | 128 +++++++++++------- code/game/objects/items/stacks/nanopaste.dm | 24 ++-- code/modules/surgery/ribcage.dm | 141 ++++++++++++++++---- 3 files changed, 208 insertions(+), 85 deletions(-) diff --git a/code/game/objects/items/stacks/medical.dm b/code/game/objects/items/stacks/medical.dm index ccc00290db..347fc6f41d 100644 --- a/code/game/objects/items/stacks/medical.dm +++ b/code/game/objects/items/stacks/medical.dm @@ -65,24 +65,31 @@ var/mob/living/carbon/human/H = M var/datum/organ/external/affecting = H.get_organ(user.zone_sel.selecting) - if(!affecting.bandage()) - user << "\red The wounds on [M]'s [affecting.display_name] have already been bandaged." - return 1 + if(affecting.open == 0) + if(!affecting.bandage()) + user << "\red The wounds on [M]'s [affecting.display_name] have already been bandaged." + return 1 + else + for (var/datum/wound/W in affecting.wounds) + if (W.internal) + continue + if (W.current_stage <= W.max_bleeding_stage) + user.visible_message( "\blue [user] bandages [W.desc] on [M]'s [affecting.display_name].", \ + "\blue You bandage [W.desc] on [M]'s [affecting.display_name]." ) + //H.add_side_effect("Itch") + else if (istype(W,/datum/wound/bruise)) + user.visible_message( "\blue [user] places bruise patch over [W.desc] on [M]'s [affecting.display_name].", \ + "\blue You place bruise patch over [W.desc] on [M]'s [affecting.display_name]." ) + else + user.visible_message( "\blue [user] places bandaid over [W.desc] on [M]'s [affecting.display_name].", \ + "\blue You place bandaid over [W.desc] on [M]'s [affecting.display_name]." ) + use(1) else - for (var/datum/wound/W in affecting.wounds) - if (W.internal) - continue - if (W.current_stage <= W.max_bleeding_stage) - user.visible_message( "\blue [user] bandages [W.desc] on [M]'s [affecting.display_name].", \ - "\blue You bandage [W.desc] on [M]'s [affecting.display_name]." ) - //H.add_side_effect("Itch") - else if (istype(W,/datum/wound/bruise)) - user.visible_message( "\blue [user] places bruise patch over [W.desc] on [M]'s [affecting.display_name].", \ - "\blue You place bruise patch over [W.desc] on [M]'s [affecting.display_name]." ) - else - user.visible_message( "\blue [user] places bandaid over [W.desc] on [M]'s [affecting.display_name].", \ - "\blue You place bandaid over [W.desc] on [M]'s [affecting.display_name]." ) - use(1) + if (can_operate(H)) //Checks if mob is lying down on table for surgery + if (do_surgery(H,user,src)) + return + else + user << "The [affecting.display_name] is cut open, you'll need more than a bandage!" /obj/item/stack/medical/ointment name = "ointment" @@ -101,20 +108,27 @@ var/mob/living/carbon/human/H = M var/datum/organ/external/affecting = H.get_organ(user.zone_sel.selecting) - if(!affecting.salve()) - user << "\red The wounds on [M]'s [affecting.display_name] have already been salved." - return 1 + if(affecting.open == 0) + if(!affecting.salve()) + user << "\red The wounds on [M]'s [affecting.display_name] have already been salved." + return 1 + else + user.visible_message( "\blue [user] salves wounds on [M]'s [affecting.display_name].", \ + "\blue You salve wounds on [M]'s [affecting.display_name]." ) + use(1) else - user.visible_message( "\blue [user] salves wounds on [M]'s [affecting.display_name].", \ - "\blue You salve wounds on [M]'s [affecting.display_name]." ) - use(1) + if (can_operate(H)) //Checks if mob is lying down on table for surgery + if (do_surgery(H,user,src)) + return + else + user << "The [affecting.display_name] is cut open, you'll need more than a bandage!" /obj/item/stack/medical/bruise_pack/tajaran name = "\improper S'rendarr's Hand leaf" singular_name = "S'rendarr's Hand leaf" desc = "A soft leaf that is rubbed on bruises." icon = 'icons/obj/harvest.dmi' - icon_state = "cabbage" + icon_state = "shand" heal_brute = 7 /obj/item/stack/medical/ointment/tajaran @@ -122,7 +136,7 @@ singular_name = "Messa's Tear leaf" desc = "A cold leaf that is rubbed on burns." icon = 'icons/obj/harvest.dmi' - icon_state = "ambrosiavulgaris" + icon_state = "mtear" heal_burn = 7 /obj/item/stack/medical/advanced/bruise_pack @@ -141,25 +155,32 @@ var/mob/living/carbon/human/H = M var/datum/organ/external/affecting = H.get_organ(user.zone_sel.selecting) - if(!affecting.bandage()) - user << "\red The wounds on [M]'s [affecting.display_name] have already been treated." - return 1 + if(affecting.open == 0) + if(!affecting.bandage()) + user << "\red The wounds on [M]'s [affecting.display_name] have already been treated." + return 1 + else + for (var/datum/wound/W in affecting.wounds) + if (W.internal) + continue + if (W.current_stage <= W.max_bleeding_stage) + user.visible_message( "\blue [user] cleans [W.desc] on [M]'s [affecting.display_name] and seals edges with bioglue.", \ + "\blue You clean and seal [W.desc] on [M]'s [affecting.display_name]." ) + //H.add_side_effect("Itch") + else if (istype(W,/datum/wound/bruise)) + user.visible_message( "\blue [user] places medicine patch over [W.desc] on [M]'s [affecting.display_name].", \ + "\blue You place medicine patch over [W.desc] on [M]'s [affecting.display_name]." ) + else + user.visible_message( "\blue [user] smears some bioglue over [W.desc] on [M]'s [affecting.display_name].", \ + "\blue You smear some bioglue over [W.desc] on [M]'s [affecting.display_name]." ) + affecting.heal_damage(heal_brute,0) + use(1) else - for (var/datum/wound/W in affecting.wounds) - if (W.internal) - continue - if (W.current_stage <= W.max_bleeding_stage) - user.visible_message( "\blue [user] cleans [W.desc] on [M]'s [affecting.display_name] and seals edges with bioglue.", \ - "\blue You clean and seal [W.desc] on [M]'s [affecting.display_name]." ) - //H.add_side_effect("Itch") - else if (istype(W,/datum/wound/bruise)) - user.visible_message( "\blue [user] places medicine patch over [W.desc] on [M]'s [affecting.display_name].", \ - "\blue You place medicine patch over [W.desc] on [M]'s [affecting.display_name]." ) - else - user.visible_message( "\blue [user] smears some bioglue over [W.desc] on [M]'s [affecting.display_name].", \ - "\blue You smear some bioglue over [W.desc] on [M]'s [affecting.display_name]." ) - affecting.heal_damage(heal_brute,0) - use(1) + if (can_operate(H)) //Checks if mob is lying down on table for surgery + if (do_surgery(H,user,src)) + return + else + user << "The [affecting.display_name] is cut open, you'll need more than a bandage!" /obj/item/stack/medical/advanced/ointment name = "advanced burn kit" @@ -178,14 +199,21 @@ var/mob/living/carbon/human/H = M var/datum/organ/external/affecting = H.get_organ(user.zone_sel.selecting) - if(!affecting.salve()) - user << "\red The wounds on [M]'s [affecting.display_name] have already been salved." - return 1 + if(affecting.open == 0) + if(!affecting.salve()) + user << "\red The wounds on [M]'s [affecting.display_name] have already been salved." + return 1 + else + user.visible_message( "\blue [user] covers wounds on [M]'s [affecting.display_name] with regenerative membrane.", \ + "\blue You cover wounds on [M]'s [affecting.display_name] with regenerative membrane." ) + affecting.heal_damage(0,heal_burn) + use(1) else - user.visible_message( "\blue [user] covers wounds on [M]'s [affecting.display_name] with regenerative membrane.", \ - "\blue You cover wounds on [M]'s [affecting.display_name] with regenerative membrane." ) - affecting.heal_damage(0,heal_burn) - use(1) + if (can_operate(H)) //Checks if mob is lying down on table for surgery + if (do_surgery(H,user,src)) + return + else + user << "The [affecting.display_name] is cut open, you'll need more than a bandage!" /obj/item/stack/medical/splint name = "medical splints" diff --git a/code/game/objects/items/stacks/nanopaste.dm b/code/game/objects/items/stacks/nanopaste.dm index 026ddb77f5..db0ab6b088 100644 --- a/code/game/objects/items/stacks/nanopaste.dm +++ b/code/game/objects/items/stacks/nanopaste.dm @@ -26,12 +26,20 @@ if (istype(M,/mob/living/carbon/human)) //Repairing robolimbs var/mob/living/carbon/human/H = M var/datum/organ/external/S = H.get_organ(user.zone_sel.selecting) - if (S && (S.status & ORGAN_ROBOT)) - if(S.get_damage()) - S.heal_damage(15, 15, robo_repair = 1) - H.updatehealth() - use(1) - user.visible_message("\The [user] applies some nanite paste at[user != M ? " \the [M]'s" : " \the"][S.display_name] with \the [src].",\ - "You apply some nanite paste at [user == M ? "your" : "[M]'s"] [S.display_name].") + + if(S.open == 1) + if (S && (S.status & ORGAN_ROBOT)) + if(S.get_damage()) + S.heal_damage(15, 15, robo_repair = 1) + H.updatehealth() + use(1) + user.visible_message("\The [user] applies some nanite paste at[user != M ? " \the [M]'s" : " \the"][S.display_name] with \the [src].",\ + "You apply some nanite paste at [user == M ? "your" : "[M]'s"] [S.display_name].") + else + user << "Nothing to fix here." + else + if (can_operate(H)) + if (do_surgery(H,user,src)) + return else - user << "Nothing to fix here." + user << "Nothing to fix in here." \ No newline at end of file diff --git a/code/modules/surgery/ribcage.dm b/code/modules/surgery/ribcage.dm index b4f6762a3d..4c8c029772 100644 --- a/code/modules/surgery/ribcage.dm +++ b/code/modules/surgery/ribcage.dm @@ -188,9 +188,9 @@ ////////////////////////////////////////////////////////////////// /datum/surgery_step/ribcage/fix_chest_internal allowed_tools = list( - /obj/item/weapon/scalpel = 100, \ - /obj/item/weapon/kitchenknife = 75, \ - /obj/item/weapon/shard = 50, \ + /obj/item/stack/medical/advanced/bruise_pack= 100, \ + /obj/item/stack/medical/bruise_pack = 20, \ + /obj/item/stack/medical/bruise_pack/tajaran = 70, \ ) min_duration = 70 @@ -210,22 +210,58 @@ var/datum/organ/internal/liver/liver = target.internal_organs["liver"] var/datum/organ/internal/liver/kidney = target.internal_organs["kidney"] - if(lungs.damage > 0) - 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) - 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]." ) - if(kidney.damage > 0) - user.visible_message("[user] starts mending the bruises on [target]'s kidney with \the [tool].", \ - "You start mending the bruises on [target]'s kidney with \the [tool]." ) + if (istype(tool, /obj/item/stack/medical/advanced/bruise_pack)) + if(lungs.damage > 0) + user.visible_message("[user] starts sealing the rupture in [target]'s lungs with regenerative membrane.", \ + "You start mending the rupture in [target]'s lungs with regenerative membrane." ) + if(heart.damage > 0) + if(heart.robotic < 2) + user.visible_message("[user] starts mending the bruises on [target]'s heart with regenerative membrane.", \ + "You start mending the bruises on [target]'s heart with regenerative membrane." ) + if(heart.robotic == 2) + user.visible_message("\blue [user] attempts to repair [target]'s mechanical heart with regenerative membrane...", \ + "\blue You attempt to repair [target]'s heart with regenerative membrane...") + if(liver.damage > 0) + user.visible_message("[user] starts mending the bruises on [target]'s liver with regenerative membrane.", \ + "You start mending the bruises on [target]'s liver with regenerative membrane." ) + if(kidney.damage > 0) + user.visible_message("[user] starts mending the bruises on [target]'s kidney with regenerative membrane.", \ + "You start mending the bruises on [target]'s kidney with regenerative membrane." ) + if (istype(tool, /obj/item/stack/medical/bruise_pack)) + if (istype(tool, /obj/item/stack/medical/bruise_pack/tajaran/)) + if(lungs.damage > 0) + user.visible_message("[user] starts covering the rupture in [target]'s lungs with the poultice.", \ + "You start covering the rupture in [target]'s lungs with the poultice." ) + if(heart.damage > 0) + if(heart.robotic < 2) + user.visible_message("[user] starts mending the bruises on [target]'s heart with the poultice.", \ + "You start mending the bruises on [target]'s heart with the poultice." ) + 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 putting the poultice to the bruises on [target]'s liver.", \ + "You start putting the poultice to the bruises on [target]'s liver." ) + if(kidney.damage > 0) + user.visible_message("[user] starts putting the poultice to the bruises on [target]'s kidney.", \ + "You start putting the poultice to the bruises on [target]'s kidney." ) + if(lungs.damage > 0) + user.visible_message("[user] starts mending the rupture in [target]'s lungs with \the [tool].", \ + "You start mending the rupture in [target]'s lungs \the [tool]." ) + else + if(heart.damage > 0) + 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]." ) + if(kidney.damage > 0) + user.visible_message("[user] starts mending the bruises on [target]'s kidney with \the [tool].", \ + "You start mending the bruises on [target]'s kidney with \the [tool]." ) target.custom_pain("The pain in your chest is living hell!",1) ..() @@ -260,16 +296,51 @@ kidney.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"] + var/datum/organ/internal/lungs/lungs = target.internal_organs["lungs"] + var/datum/organ/internal/liver/liver = target.internal_organs["liver"] + var/datum/organ/internal/liver/kidney = target.internal_organs["kidney"] var/datum/organ/external/chest/affected = target.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) + user.visible_message("\red [user]'s hand slips, getting mess and tearing the inside of [target]'s chest with \the [tool]!", \ + "\red Your hand slips, getting mess and tearing the inside of [target]'s chest with \the [tool]!") + switch(tool) + if(/obj/item/stack/medical/advanced/bruise_pack) + if(heart.damage > 0) + heart.take_damage(2, 0) + if(liver.damage > 0) + liver.take_damage(2, 0) + if(kidney.damage > 0) + kidney.take_damage(2, 0) + if(lungs.damage > 0) + lungs.take_damage(2, 0) + target.adjustToxLoss(5) + if(/obj/item/stack/medical/bruise_pack/tajaran) + if(heart.damage > 0) + heart.take_damage(2, 0) + if(liver.damage > 0) + liver.take_damage(2, 0) + if(kidney.damage > 0) + kidney.take_damage(2, 0) + if(lungs.damage > 0) + lungs.take_damage(2, 0) + target.adjustToxLoss(7) + if(/obj/item/stack/medical/bruise_pack) + if(heart.damage > 0) + heart.take_damage(5, 0) + if(liver.damage > 0) + liver.take_damage(5, 0) + if(kidney.damage > 0) + kidney.take_damage(5, 0) + if(lungs.damage > 0) + lungs.take_damage(5, 0) + target.adjustToxLoss(10) + affected.createwound(CUT, 5) /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, \ + /obj/item/weapon/bonegel = 30, \ + /obj/item/weapon/screwdriver = 70, \ ) min_duration = 70 @@ -290,15 +361,19 @@ 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]." ) + else + user.visible_message("[user] cannot mend an organic heart with this!") + return 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 + if(heart.robotic == 2) + 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"] @@ -311,3 +386,15 @@ // HEART SURGERY // ////////////////////////////////////////////////////////////////// +/datum/surgery_step/ribcage/heart/cut + allowed_tools = list( + /obj/item/weapon/scalpel = 100, \ + /obj/item/weapon/kitchenknife = 75, \ + /obj/item/weapon/shard = 50, \ + ) + + min_duration = 30 + max_duration = 40 + + can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) + return ..() && target.op_stage.ribcage == 2