Files
Paradise/code/modules/surgery/ribcage.dm
T
2013-01-28 01:51:42 +04:00

198 lines
8.4 KiB
Plaintext

//Procedures in this file: Generic ribcage opening steps, Removing alien embryo, Fixing ruptured lungs
//////////////////////////////////////////////////////////////////
// GENERIC RIBCAGE SURGERY //
//////////////////////////////////////////////////////////////////
/datum/surgery_step/ribcage
can_infect = 1
blood_level = 1
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
return target_zone == "chest"
/datum/surgery_step/ribcage/saw_ribcage
required_tool = /obj/item/weapon/circular_saw
min_duration = 50
max_duration = 70
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (!istype(target))
return
var/datum/organ/external/affected = target.get_organ(target_zone)
return ..() && target.op_stage.ribcage == 0 && affected.open >= 2
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message("[user] begins to cut through [target]'s ribcage with \the [tool].", \
"You begin to cut through [target]'s ribcage with \the [tool].")
target.custom_pain("Something hurts horribly in your chest!",1)
..()
end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message("\blue [user] has cut through [target]'s ribcage open with \the [tool].", \
"\blue You have cut through [target]'s ribcage open with \the [tool].")
target.op_stage.ribcage = 1
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message("\red [user]'s hand slips, cracking [target]'s ribcage with \the [tool]!" , \
"\red Your hand slips, cracking [target]'s ribcage with \the [tool]!" )
var/datum/organ/external/affected = target.get_organ(target_zone)
affected.createwound(CUT, 20)
affected.fracture()
/datum/surgery_step/ribcage/retract_ribcage
required_tool = /obj/item/weapon/retractor
allowed_tools = list(/obj/item/weapon/crowbar)
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 == 1
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/msg = "[user] starts to force open the ribcage in [target]'s torso with \the [tool]."
var/self_msg = "You start to force open the ribcage in [target]'s torso with \the [tool]."
user.visible_message(msg, self_msg)
target.custom_pain("Something hurts horribly in your chest!",1)
..()
end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/msg = "\blue [user] forces open [target]'s ribcage with \the [tool]."
var/self_msg = "\blue You force open [target]'s ribcage with \the [tool]."
user.visible_message(msg, self_msg)
target.op_stage.ribcage = 2
// Whoops!
if(prob(10))
var/datum/organ/external/affected = target.get_organ(target_zone)
affected.fracture()
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/msg = "\red [user]'s hand slips, breaking [target]'s ribcage!"
var/self_msg = "\red Your hand slips, breaking [target]'s ribcage!"
user.visible_message(msg, self_msg)
var/datum/organ/external/affected = target.get_organ(target_zone)
affected.createwound(BRUISE, 20)
affected.fracture()
/datum/surgery_step/ribcage/close_ribcage
required_tool = /obj/item/weapon/retractor
allowed_tools = list(/obj/item/weapon/crowbar)
min_duration = 20
max_duration = 40
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
return ..() && target.op_stage.ribcage == 2
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/msg = "[user] starts bending [target]'s ribcage back into place with \the [tool]."
var/self_msg = "You start bending [target]'s ribcage back into place with \the [tool]."
user.visible_message(msg, self_msg)
target.custom_pain("Something hurts horribly in your chest!",1)
..()
end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/msg = "\blue [user] bends [target]'s ribcage back into place with \the [tool]."
var/self_msg = "\blue You bend [target]'s ribcage back into place with \the [tool]."
user.visible_message(msg, self_msg)
target.op_stage.ribcage = 1
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/msg = "\red [user]'s hand slips, bending [target]'s ribcage in a wrong shape!"
var/self_msg = "\red Your hand slips, bending [target]'s ribcage in a wrong shape!"
user.visible_message(msg, self_msg)
var/datum/organ/external/chest/affected = target.get_organ("chest")
affected.createwound(BRUISE, 20)
affected.fracture()
if (prob(40))
user.visible_message("\red Rib pierces the lung!")
affected.ruptured_lungs = 1
/datum/surgery_step/ribcage/mend_ribcage
required_tool = /obj/item/weapon/bonegel
min_duration = 20
max_duration = 40
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
return ..() && target.op_stage.ribcage == 1
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/msg = "[user] starts applying \the [tool] to [target]'s ribcage."
var/self_msg = "You start applying \the [tool] to [target]'s ribcage."
user.visible_message(msg, self_msg)
target.custom_pain("Something hurts horribly in your chest!",1)
..()
end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/msg = "\blue [user] applied \the [tool] to [target]'s ribcage."
var/self_msg = "\blue You applied \the [tool] to [target]'s ribcage."
user.visible_message(msg, self_msg)
target.op_stage.ribcage = 0
//////////////////////////////////////////////////////////////////
// ALIEN EMBRYO SURGERY //
//////////////////////////////////////////////////////////////////
/datum/surgery_step/ribcage/remove_embryo
required_tool = /obj/item/weapon/hemostat
blood_level = 2
min_duration = 80
max_duration = 100
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/embryo = 0
for(var/obj/item/alien_embryo/A in target)
embryo = 1
break
return ..() && embryo && target.op_stage.ribcage == 2
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/msg = "[user] starts to pull something out from [target]'s ribcage with \the [tool]."
var/self_msg = "You start to pull something out from [target]'s ribcage with \the [tool]."
user.visible_message(msg, self_msg)
target.custom_pain("Something hurts horribly in your chest!",1)
..()
end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message("\red [user] rips the larva out of [target]'s ribcage!",
"You rip the larva out of [target]'s ribcage!")
for(var/obj/item/alien_embryo/A in target)
A.loc = A.loc.loc
//////////////////////////////////////////////////////////////////
// LUNG SURGERY //
//////////////////////////////////////////////////////////////////
/datum/surgery_step/ribcage/fix_lungs
required_tool = /obj/item/weapon/scalpel
allowed_tools = list(/obj/item/weapon/shard, /obj/item/weapon/kitchenknife)
min_duration = 70
max_duration = 90
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
return ..() && target.is_lung_ruptured() && target.op_stage.ribcage == 2
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/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/chest/affected = target.get_organ("chest")
user.visible_message("\blue [user] mends the rupture in [target]'s lungs with \the [tool].", \
"\blue You mend the rupture in [target]'s lungs with \the [tool]." )
affected.ruptured_lungs = 0
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
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)