mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-22 20:43:10 +01:00
Surgery tidy-up & bugfixes (#9501)
This commit is contained in:
@@ -1 +1,26 @@
|
||||
#define SURGERY_FAILURE -1
|
||||
|
||||
// organ open flags
|
||||
#define ORGAN_CLOSED 0
|
||||
#define ORGAN_OPEN_INCISION 1 // skin incision OR hatch unscrewed
|
||||
#define ORGAN_OPEN_RETRACTED 2 // skin retracted
|
||||
#define ORGAN_ENCASED_OPEN 2.5 // bones e.g. ribcage sawed open
|
||||
#define ORGAN_ENCASED_RETRACTED 3 // bones retracted OR hatch opened
|
||||
|
||||
// facial surgery
|
||||
#define FACE_NORMAL 0
|
||||
#define FACE_CUT_OPEN 1
|
||||
#define FACE_RETRACTED 2
|
||||
#define FACE_ALTERED 3
|
||||
|
||||
//bone repair
|
||||
#define BONE_PRE_OP 0
|
||||
#define BONE_GLUED 1
|
||||
#define BONE_SET 2
|
||||
|
||||
//cavity
|
||||
#define CAVITY_CLOSED 0
|
||||
#define CAVITY_OPEN 1
|
||||
|
||||
//macros
|
||||
#define IS_ORGAN_FULLY_OPEN affected.open == ((affected.encased || affected.robotic) ? ORGAN_ENCASED_RETRACTED : ORGAN_OPEN_RETRACTED)
|
||||
@@ -3,44 +3,46 @@
|
||||
// BONE SURGERY //
|
||||
//////////////////////////////////////////////////////////////////
|
||||
|
||||
/datum/surgery_step/glue_bone
|
||||
/decl/surgery_step/glue_bone
|
||||
name = "Begin bone repair"
|
||||
allowed_tools = list(
|
||||
/obj/item/surgery/bonegel = 100, \
|
||||
/obj/item/tape_roll = 60
|
||||
)
|
||||
can_infect = 1
|
||||
can_infect = TRUE
|
||||
blood_level = 1
|
||||
|
||||
min_duration = 50
|
||||
max_duration = 60
|
||||
|
||||
/datum/surgery_step/glue_bone/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(!ishuman(target))
|
||||
return 0
|
||||
/decl/surgery_step/glue_bone/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(!..())
|
||||
return FALSE
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
return affected && !(affected.status & ORGAN_ROBOT) && affected.open >= 2 && affected.open < 3 && affected.stage == 0
|
||||
return affected && !BP_IS_ROBOTIC(affected) && affected.open >= ORGAN_OPEN_RETRACTED && affected.open < ORGAN_ENCASED_RETRACTED && affected.stage == BONE_PRE_OP
|
||||
|
||||
/datum/surgery_step/glue_bone/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/glue_bone/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
if (affected.stage == 0)
|
||||
if (affected.stage == BONE_PRE_OP)
|
||||
user.visible_message("<b>[user]</b> starts applying some of [tool] to the damaged bones in [target]'s [affected.name]." , \
|
||||
SPAN_NOTICE("You start applying some of [tool] to the damaged bones in [target]'s [affected.name]."))
|
||||
target.custom_pain("Something in your [affected.name] is causing you a lot of pain!",1)
|
||||
..()
|
||||
|
||||
/datum/surgery_step/glue_bone/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/glue_bone/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
user.visible_message("<b>[user]</b> applies some of [tool] to [target]'s bone in [affected.name].", \
|
||||
"<span class='notice'>You apply some of [tool] to [target]'s bone in [affected.name].</span>")
|
||||
affected.stage = 1
|
||||
SPAN_NOTICE("You apply some of [tool] to [target]'s bone in [affected.name]."))
|
||||
affected.stage = BONE_GLUED
|
||||
|
||||
/datum/surgery_step/glue_bone/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/glue_bone/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
user.visible_message("<span class='warning'>[user]'s hand slips, smearing some of [tool] in the incision in [target]'s [affected.name]!</span>" , \
|
||||
"<span class='warning'>Your hand slips, smearing some of [tool] in the incision in [target]'s [affected.name]!</span>")
|
||||
user.visible_message(SPAN_WARNING("[user]'s hand slips, smearing some of [tool] in the incision in [target]'s [affected.name]!") , \
|
||||
SPAN_WARNING("Your hand slips, smearing some of [tool] in the incision in [target]'s [affected.name]!"))
|
||||
target.apply_damage(15, PAIN)
|
||||
|
||||
/datum/surgery_step/set_bone
|
||||
/decl/surgery_step/set_bone
|
||||
name = "Set bone"
|
||||
allowed_tools = list(
|
||||
/obj/item/surgery/bonesetter = 100, \
|
||||
/obj/item/wrench = 75 \
|
||||
@@ -49,37 +51,38 @@
|
||||
min_duration = 60
|
||||
max_duration = 70
|
||||
|
||||
/datum/surgery_step/set_bone/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(!ishuman(target))
|
||||
return 0
|
||||
/decl/surgery_step/set_bone/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(!..())
|
||||
return FALSE
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
return affected && affected.name != BP_HEAD && !(affected.status & ORGAN_ROBOT) && affected.open >= 2 && affected.stage == 1
|
||||
return affected && affected.name != BP_HEAD && !BP_IS_ROBOTIC(affected) && affected.open >= ORGAN_OPEN_RETRACTED && affected.stage == BONE_GLUED
|
||||
|
||||
/datum/surgery_step/set_bone/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/set_bone/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
user.visible_message("[user] is beginning to set the bone in [target]'s [affected.name] in place with \the [tool]." , \
|
||||
"You are beginning to set the bone in [target]'s [affected.name] in place with \the [tool].")
|
||||
target.custom_pain("The pain in your [affected.name] is going to make you pass out!",1)
|
||||
..()
|
||||
|
||||
/datum/surgery_step/set_bone/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/set_bone/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
if(affected.status & ORGAN_BROKEN)
|
||||
user.visible_message("<b>[user]</b> sets the bone in [target]'s [affected.name] in place with \the [tool].", \
|
||||
"<span class='notice'>You set the bone in [target]'s [affected.name] in place with \the [tool].</span>")
|
||||
affected.stage = 2
|
||||
SPAN_NOTICE("You set the bone in [target]'s [affected.name] in place with \the [tool]."))
|
||||
affected.stage = BONE_SET
|
||||
else
|
||||
user.visible_message("<span class='notice'>[user] sets the bone in [target]'s [affected.name]</span><span class='warning'>in the WRONG place with \the [tool].</span>", \
|
||||
"<span class='notice'>You set the bone in [target]'s [affected.name]</span><span class='warning'>in the WRONG place with \the [tool].</span>")
|
||||
user.visible_message(SPAN_NOTICE("[user] sets the bone in [target]'s [affected.name] [SPAN_WARNING("in the WRONG place with \the [tool].")]"), \
|
||||
SPAN_NOTICE("You set the bone in [target]'s [affected.name] [SPAN_WARNING("in the WRONG place with \the [tool].")]"))
|
||||
affected.fracture()
|
||||
|
||||
/datum/surgery_step/set_bone/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/set_bone/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
user.visible_message("<span class='warning'>[user]'s hand slips, damaging the bone in [target]'s [affected.name] with \the [tool]!</span>" , \
|
||||
"<span class='warning'>Your hand slips, damaging the bone in [target]'s [affected.name] with \the [tool]!</span>")
|
||||
user.visible_message(SPAN_WARNING("[user]'s hand slips, damaging the bone in [target]'s [affected.name] with \the [tool]!") , \
|
||||
SPAN_WARNING("Your hand slips, damaging the bone in [target]'s [affected.name] with \the [tool]!"))
|
||||
target.apply_damage(5, BRUTE, target_zone, 0, tool, damage_flags = tool.damage_flags())
|
||||
|
||||
/datum/surgery_step/mend_skull
|
||||
/decl/surgery_step/mend_skull
|
||||
name = "Repair skull"
|
||||
allowed_tools = list(
|
||||
/obj/item/surgery/bonesetter = 100, \
|
||||
/obj/item/wrench = 75 \
|
||||
@@ -88,65 +91,66 @@
|
||||
min_duration = 60
|
||||
max_duration = 70
|
||||
|
||||
/datum/surgery_step/mend_skull/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(!ishuman(target))
|
||||
return 0
|
||||
/decl/surgery_step/mend_skull/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(!..())
|
||||
return FALSE
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
return affected && affected.name == BP_HEAD && !(affected.status & ORGAN_ROBOT) && affected.open >= 2 && affected.stage == 1
|
||||
return affected && affected.name == BP_HEAD && !BP_IS_ROBOTIC(affected) && affected.open >= ORGAN_OPEN_RETRACTED && affected.stage == BONE_GLUED
|
||||
|
||||
/datum/surgery_step/mend_skull/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/mend_skull/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
user.visible_message("[user] is beginning to piece together [target]'s skull with \the [tool]." , \
|
||||
"You are beginning to piece together [target]'s skull with \the [tool].")
|
||||
..()
|
||||
|
||||
/datum/surgery_step/mend_skull/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/mend_skull/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
user.visible_message("<b>[user]</b> sets [target]'s skull with \the [tool]." , \
|
||||
"<span class='notice'>You set [target]'s skull with \the [tool].</span>")
|
||||
affected.stage = 2
|
||||
SPAN_NOTICE("You set [target]'s skull with \the [tool]."))
|
||||
affected.stage = ORGAN_OPEN_RETRACTED
|
||||
|
||||
/datum/surgery_step/mend_skull/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/mend_skull/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
user.visible_message("<span class='warning'>[user]'s hand slips, damaging [target]'s face with \the [tool]!</span>" , \
|
||||
"<span class='warning'>Your hand slips, damaging [target]'s face with \the [tool]!</span>")
|
||||
user.visible_message(SPAN_WARNING("[user]'s hand slips, damaging [target]'s face with \the [tool]!") , \
|
||||
SPAN_WARNING("Your hand slips, damaging [target]'s face with \the [tool]!"))
|
||||
var/obj/item/organ/external/head/h = affected
|
||||
target.apply_damage(10, BRUTE, target_zone, 0, tool, damage_flags = tool.damage_flags())
|
||||
h.disfigured = 1
|
||||
|
||||
/datum/surgery_step/finish_bone
|
||||
/decl/surgery_step/finish_bone
|
||||
name = "Finish bone repair"
|
||||
allowed_tools = list(
|
||||
/obj/item/surgery/bonegel = 100, \
|
||||
/obj/item/tape_roll = 60
|
||||
)
|
||||
can_infect = 1
|
||||
can_infect = TRUE
|
||||
blood_level = 1
|
||||
|
||||
min_duration = 50
|
||||
max_duration = 60
|
||||
|
||||
/datum/surgery_step/finish_bone/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(!ishuman(target))
|
||||
return 0
|
||||
/decl/surgery_step/finish_bone/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(!..())
|
||||
return FALSE
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
return affected && affected.open >= 2 && affected.open < 3 && !(affected.status & ORGAN_ROBOT) && affected.stage == 2
|
||||
return affected && affected.open >= ORGAN_OPEN_RETRACTED && affected.open < ORGAN_ENCASED_RETRACTED && !BP_IS_ROBOTIC(affected) && affected.stage == BONE_SET
|
||||
|
||||
/datum/surgery_step/finish_bone/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/finish_bone/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
user.visible_message("[user] starts to finish mending the damaged bones in [target]'s [affected.name] with \the [tool].", \
|
||||
"You start to finish mending the damaged bones in [target]'s [affected.name] with \the [tool].")
|
||||
..()
|
||||
|
||||
/datum/surgery_step/finish_bone/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/finish_bone/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
user.visible_message("<b>[user]</b> has mended the damaged bones in [target]'s [affected.name] with \the [tool]." , \
|
||||
"<span class='notice'>You have mended the damaged bones in [target]'s [affected.name] with \the [tool].</span>" )
|
||||
SPAN_NOTICE("You have mended the damaged bones in [target]'s [affected.name] with \the [tool].") )
|
||||
affected.status &= ~ORGAN_BROKEN
|
||||
affected.status &= ~ORGAN_SPLINTED
|
||||
affected.stage = 0
|
||||
affected.stage = BONE_PRE_OP
|
||||
affected.perma_injury = 0
|
||||
|
||||
/datum/surgery_step/finish_bone/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/finish_bone/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
user.visible_message("<span class='warning'>[user]'s hand slips, smearing [tool] in the incision in [target]'s [affected.name]!</span>" , \
|
||||
"<span class='warning'>Your hand slips, smearing [tool] in the incision in [target]'s [affected.name]!</span>")
|
||||
user.visible_message(SPAN_WARNING("[user]'s hand slips, smearing [tool] in the incision in [target]'s [affected.name]!") , \
|
||||
SPAN_WARNING("Your hand slips, smearing [tool] in the incision in [target]'s [affected.name]!"))
|
||||
target.apply_damage(15, PAIN)
|
||||
@@ -2,20 +2,21 @@
|
||||
//////////////////////////////////////////////////////////////////
|
||||
// GENERIC RIBCAGE SURGERY //
|
||||
//////////////////////////////////////////////////////////////////
|
||||
/datum/surgery_step/open_encased
|
||||
/decl/surgery_step/open_encased
|
||||
name = "Saw through bone"
|
||||
priority = 2
|
||||
can_infect = 1
|
||||
can_infect = TRUE
|
||||
blood_level = 1
|
||||
|
||||
/datum/surgery_step/open_encased/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(!ishuman(target))
|
||||
return 0
|
||||
/decl/surgery_step/open_encased/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(!..())
|
||||
return FALSE
|
||||
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
return affected && !(affected.status & ORGAN_ROBOT) && affected.encased && affected.open >= 2
|
||||
return affected && !BP_IS_ROBOTIC(affected) && affected.encased && affected.open >= ORGAN_OPEN_RETRACTED
|
||||
|
||||
|
||||
/datum/surgery_step/open_encased/saw
|
||||
/decl/surgery_step/open_encased/saw
|
||||
allowed_tools = list(
|
||||
/obj/item/surgery/circular_saw = 100,
|
||||
/obj/item/melee/energy = 100,
|
||||
@@ -26,13 +27,13 @@
|
||||
min_duration = 50
|
||||
max_duration = 70
|
||||
|
||||
/datum/surgery_step/open_encased/saw/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(!ishuman(target))
|
||||
return
|
||||
/decl/surgery_step/open_encased/saw/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(!..())
|
||||
return FALSE
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
return ..() && affected && affected.open == 2
|
||||
return affected && affected.open == ORGAN_OPEN_RETRACTED
|
||||
|
||||
/datum/surgery_step/open_encased/saw/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/open_encased/saw/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(!ishuman(target))
|
||||
return
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
@@ -42,28 +43,29 @@
|
||||
target.custom_pain("Something hurts horribly in your [affected.name]!", 75)
|
||||
..()
|
||||
|
||||
/datum/surgery_step/open_encased/saw/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/open_encased/saw/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(!ishuman(target))
|
||||
return
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
|
||||
user.visible_message("<b>[user]</b> has cut [target]'s [affected.encased] open with \the [tool].", \
|
||||
"<span class='notice'>You have cut [target]'s [affected.encased] open with \the [tool].</span>")
|
||||
affected.open = 2.5
|
||||
SPAN_NOTICE("You have cut [target]'s [affected.encased] open with \the [tool]."))
|
||||
affected.open = ORGAN_ENCASED_OPEN
|
||||
|
||||
/datum/surgery_step/open_encased/saw/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/open_encased/saw/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(!ishuman(target))
|
||||
return
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
|
||||
user.visible_message("<span class='warning'>[user]'s hand slips, cracking [target]'s [affected.encased] with \the [tool]!</span>" , \
|
||||
"<span class='warning'>Your hand slips, cracking [target]'s [affected.encased] with \the [tool]!</span>" )
|
||||
user.visible_message(SPAN_WARNING("[user]'s hand slips, cracking [target]'s [affected.encased] with \the [tool]!") , \
|
||||
SPAN_WARNING("Your hand slips, cracking [target]'s [affected.encased] with \the [tool]!") )
|
||||
|
||||
target.apply_damage(20, BRUTE, target_zone, 0, tool, damage_flags = tool.damage_flags())
|
||||
affected.fracture()
|
||||
|
||||
|
||||
/datum/surgery_step/open_encased/retract
|
||||
/decl/surgery_step/open_encased/retract
|
||||
name = "Retract bone"
|
||||
allowed_tools = list(
|
||||
/obj/item/surgery/retractor = 100, \
|
||||
/obj/item/crowbar = 75
|
||||
@@ -72,13 +74,13 @@
|
||||
min_duration = 30
|
||||
max_duration = 40
|
||||
|
||||
/datum/surgery_step/open_encased/retract/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(!ishuman(target))
|
||||
return
|
||||
/decl/surgery_step/open_encased/retract/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(!..())
|
||||
return FALSE
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
return ..() && affected && affected.open == 2.5
|
||||
return affected && affected.open == ORGAN_ENCASED_OPEN
|
||||
|
||||
/datum/surgery_step/open_encased/retract/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/open_encased/retract/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(!ishuman(target))
|
||||
return
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
@@ -89,7 +91,7 @@
|
||||
target.custom_pain("Something hurts horribly in your [affected.name]!", 75)
|
||||
..()
|
||||
|
||||
/datum/surgery_step/open_encased/retract/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/open_encased/retract/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(!ishuman(target))
|
||||
return
|
||||
|
||||
@@ -99,21 +101,21 @@
|
||||
user.visible_message(msg, SPAN_NOTICE(self_msg))
|
||||
..()
|
||||
|
||||
affected.open = 3
|
||||
affected.open = ORGAN_ENCASED_RETRACTED
|
||||
|
||||
/datum/surgery_step/open_encased/retract/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/open_encased/retract/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(!ishuman(target))
|
||||
return
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
|
||||
var/msg = "<span class='warning'>[user]'s hand slips, cracking [target]'s [affected.encased]!</span>"
|
||||
var/self_msg = "<span class='warning'>Your hand slips, cracking [target]'s [affected.encased]!</span>"
|
||||
var/msg = SPAN_WARNING("[user]'s hand slips, cracking [target]'s [affected.encased]!")
|
||||
var/self_msg = SPAN_WARNING("Your hand slips, cracking [target]'s [affected.encased]!")
|
||||
user.visible_message(msg, self_msg)
|
||||
|
||||
target.apply_damage(20, BRUTE, target_zone, 0, tool, damage_flags = tool.damage_flags())
|
||||
affected.fracture()
|
||||
|
||||
/datum/surgery_step/open_encased/close
|
||||
/decl/surgery_step/open_encased/close
|
||||
allowed_tools = list(
|
||||
/obj/item/surgery/retractor = 100, \
|
||||
/obj/item/crowbar = 75
|
||||
@@ -122,13 +124,13 @@
|
||||
min_duration = 20
|
||||
max_duration = 40
|
||||
|
||||
/datum/surgery_step/open_encased/close/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(!ishuman(target))
|
||||
return
|
||||
/decl/surgery_step/open_encased/close/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(!..())
|
||||
return FALSE
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
return ..() && affected && affected.open == 3
|
||||
return affected && affected.open == ORGAN_ENCASED_RETRACTED
|
||||
|
||||
/datum/surgery_step/open_encased/close/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/open_encased/close/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(!ishuman(target))
|
||||
return
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
@@ -139,7 +141,7 @@
|
||||
target.custom_pain("Something hurts horribly in your [affected.name]!", 75)
|
||||
..()
|
||||
|
||||
/datum/surgery_step/open_encased/close/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/open_encased/close/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(!ishuman(target))
|
||||
return
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
@@ -150,15 +152,15 @@
|
||||
target.custom_pain("Something hurts horribly in your [affected.name]!", 75)
|
||||
..()
|
||||
|
||||
affected.open = 2.5
|
||||
affected.open = ORGAN_ENCASED_OPEN
|
||||
|
||||
/datum/surgery_step/open_encased/close/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/open_encased/close/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(!ishuman(target))
|
||||
return
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
|
||||
var/msg = "<span class='warning'>[user]'s hand slips, bending [target]'s [affected.encased] the wrong way!</span>"
|
||||
var/self_msg = "<span class='warning'>Your hand slips, bending [target]'s [affected.encased] the wrong way!</span>"
|
||||
var/msg = SPAN_WARNING("[user]'s hand slips, bending [target]'s [affected.encased] the wrong way!")
|
||||
var/self_msg = SPAN_WARNING("Your hand slips, bending [target]'s [affected.encased] the wrong way!")
|
||||
user.visible_message(msg, self_msg)
|
||||
|
||||
target.apply_damage(20, BRUTE, target_zone, 0, tool, damage_flags = tool.damage_flags())
|
||||
@@ -167,10 +169,10 @@
|
||||
if(affected.internal_organs && affected.internal_organs.len)
|
||||
if(prob(40))
|
||||
var/obj/item/organ/O = pick(affected.internal_organs) //TODO weight by organ size
|
||||
user.visible_message("<span class='danger'>A wayward piece of [target]'s [affected.encased] pierces \his [O.name]!</span>")
|
||||
user.visible_message(SPAN_DANGER("A wayward piece of [target]'s [affected.encased] pierces \his [O.name]!"))
|
||||
O.bruise()
|
||||
|
||||
/datum/surgery_step/open_encased/mend
|
||||
/decl/surgery_step/open_encased/mend
|
||||
allowed_tools = list(
|
||||
/obj/item/surgery/bonegel = 100, \
|
||||
/obj/item/tape_roll = 60
|
||||
@@ -179,13 +181,13 @@
|
||||
min_duration = 20
|
||||
max_duration = 40
|
||||
|
||||
/datum/surgery_step/open_encased/mend/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(!ishuman(target))
|
||||
return
|
||||
/decl/surgery_step/open_encased/mend/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(!..())
|
||||
return FALSE
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
return ..() && affected && affected.open == 2.5
|
||||
return affected && affected.open == ORGAN_ENCASED_OPEN
|
||||
|
||||
/datum/surgery_step/open_encased/mend/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/open_encased/mend/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(!ishuman(target))
|
||||
return
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
@@ -196,7 +198,7 @@
|
||||
target.custom_pain("Something hurts horribly in your [affected.name]!", 75)
|
||||
..()
|
||||
|
||||
/datum/surgery_step/open_encased/mend/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/open_encased/mend/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(!ishuman(target))
|
||||
return
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
@@ -207,4 +209,4 @@
|
||||
target.custom_pain("Something hurts horribly in your [affected.name]!", 75)
|
||||
..()
|
||||
|
||||
affected.open = 2
|
||||
affected.open = ORGAN_OPEN_RETRACTED
|
||||
@@ -3,19 +3,20 @@
|
||||
// FACE SURGERY //
|
||||
//////////////////////////////////////////////////////////////////
|
||||
|
||||
/datum/surgery_step/face
|
||||
/decl/surgery_step/face
|
||||
name = "Make facial incisions"
|
||||
priority = 2
|
||||
can_infect = 0
|
||||
can_infect = FALSE
|
||||
|
||||
/datum/surgery_step/face/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(!ishuman(target))
|
||||
return 0
|
||||
/decl/surgery_step/face/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(!..())
|
||||
return FALSE
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
if(!affected || (affected.status & ORGAN_ROBOT))
|
||||
return 0
|
||||
if(!affected || BP_IS_ROBOTIC(affected))
|
||||
return FALSE
|
||||
return target_zone == BP_MOUTH
|
||||
|
||||
/datum/surgery_step/generic/cut_face
|
||||
/decl/surgery_step/generic/cut_face
|
||||
allowed_tools = list(
|
||||
/obj/item/surgery/scalpel = 100,
|
||||
/obj/item/material/knife = 75,
|
||||
@@ -25,35 +26,36 @@
|
||||
min_duration = 90
|
||||
max_duration = 110
|
||||
|
||||
/datum/surgery_step/generic/cut_face/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
return ..() && target_zone == BP_MOUTH && target.op_stage.face == 0
|
||||
/decl/surgery_step/generic/cut_face/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
return ..() && target_zone == BP_MOUTH && target.op_stage.face == FACE_NORMAL
|
||||
|
||||
/datum/surgery_step/generic/cut_face/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/generic/cut_face/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
user.visible_message("[user] starts to cut open [target]'s face and neck with \the [tool].", \
|
||||
"You start to cut open [target]'s face and neck with \the [tool].")
|
||||
..()
|
||||
|
||||
/datum/surgery_step/generic/cut_face/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/generic/cut_face/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
user.visible_message("<b>[user]</b> has cut open [target]'s face and neck with \the [tool]." , \
|
||||
"<span class='notice'>You have cut open [target]'s face and neck with \the [tool].</span>",)
|
||||
target.op_stage.face = 1
|
||||
SPAN_NOTICE("You have cut open [target]'s face and neck with \the [tool]."),)
|
||||
target.op_stage.face = FACE_CUT_OPEN
|
||||
|
||||
/datum/surgery_step/generic/cut_face/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
user.visible_message("<span class='warning'>[user]'s hand slips, slicing [target]'s throat wth \the [tool]!</span>" , \
|
||||
"<span class='warning'>Your hand slips, slicing [target]'s throat wth \the [tool]!</span>" )
|
||||
/decl/surgery_step/generic/cut_face/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
user.visible_message(SPAN_WARNING("[user]'s hand slips, slicing [target]'s throat wth \the [tool]!") , \
|
||||
SPAN_WARNING("Your hand slips, slicing [target]'s throat wth \the [tool]!") )
|
||||
target.apply_damage(40, BRUTE, target_zone, 0, tool, damage_flags = tool.damage_flags())
|
||||
target.apply_damage(20, OXY)
|
||||
target.losebreath += 10
|
||||
|
||||
|
||||
/datum/surgery_step/robotics/face
|
||||
/decl/surgery_step/robotics/face
|
||||
name = "Make facial incisions"
|
||||
priority = 2
|
||||
can_infect = 0
|
||||
can_infect = FALSE
|
||||
|
||||
/datum/surgery_step/robotics/face/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
return target_zone == BP_MOUTH
|
||||
/decl/surgery_step/robotics/face/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
return ..() && target_zone == BP_MOUTH
|
||||
|
||||
/datum/surgery_step/robotics/face/synthskin
|
||||
/decl/surgery_step/robotics/face/synthskin
|
||||
allowed_tools = list(
|
||||
/obj/item/surgery/scalpel = 100,
|
||||
/obj/item/material/knife = 75,
|
||||
@@ -63,20 +65,20 @@
|
||||
min_duration = 90
|
||||
max_duration = 110
|
||||
|
||||
/datum/surgery_step/robotics/face/synthskin/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
return ..() && target.op_stage.face == 0 && target.get_species() == "Shell Frame"
|
||||
/decl/surgery_step/robotics/face/synthskin/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
return ..() && target.op_stage.face == FACE_NORMAL && target.get_species() == "Shell Frame"
|
||||
|
||||
/datum/surgery_step/robotics/face/synthskin/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/robotics/face/synthskin/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
user.visible_message("[user] starts to cut open [target]'s synthskin face and neck with \the [tool].", \
|
||||
"You start to cut open [target]'s synthskin face and neck with \the [tool].")
|
||||
..()
|
||||
|
||||
/datum/surgery_step/robotics/face/synthskin/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/robotics/face/synthskin/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
user.visible_message("<b>[user]</b> has cut open [target]'s synthskin face and neck with \the [tool]." , \
|
||||
"<span class='notice'>You have cut open [target]'s synthskin face and neck with \the [tool].</span>",)
|
||||
target.op_stage.face = 1
|
||||
SPAN_NOTICE("You have cut open [target]'s synthskin face and neck with \the [tool]."),)
|
||||
target.op_stage.face = FACE_CUT_OPEN
|
||||
|
||||
/datum/surgery_step/robotics/face/synthskin/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
user.visible_message("<span class='warning'>[user]'s hand slips, slicing [target]'s throat wth \the [tool]!</span>" , \
|
||||
"<span class='warning'>Your hand slips, slicing [target]'s throat wth \the [tool]!</span>" )
|
||||
/decl/surgery_step/robotics/face/synthskin/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
user.visible_message(SPAN_WARNING("[user]'s hand slips, slicing [target]'s throat wth \the [tool]!") , \
|
||||
SPAN_WARNING("Your hand slips, slicing [target]'s throat wth \the [tool]!") )
|
||||
target.apply_damage(40, BRUTE, target_zone, 0, tool, damage_flags = tool.damage_flags())
|
||||
@@ -4,19 +4,20 @@
|
||||
// Plastic Surgery+Facial Repair //
|
||||
//////////////////////////////////////////////////////////////////
|
||||
|
||||
/datum/surgery_step/face
|
||||
/decl/surgery_step/face
|
||||
name = "Retract facial incisions"
|
||||
priority = 2
|
||||
can_infect = 0
|
||||
can_infect = FALSE
|
||||
|
||||
/datum/surgery_step/face/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(!ishuman(target))
|
||||
return 0
|
||||
/decl/surgery_step/face/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(!..())
|
||||
return FALSE
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
if(!affected || (affected.status & ORGAN_ROBOT))
|
||||
return 0
|
||||
if(!affected || BP_IS_ROBOTIC(affected))
|
||||
return FALSE
|
||||
return target_zone == BP_MOUTH
|
||||
|
||||
/datum/surgery_step/generic/prepare_face
|
||||
/decl/surgery_step/generic/prepare_face
|
||||
allowed_tools = list(
|
||||
/obj/item/surgery/retractor = 100,
|
||||
/obj/item/material/knife/tacknife = 75
|
||||
@@ -25,28 +26,29 @@
|
||||
min_duration = 90
|
||||
max_duration = 110
|
||||
|
||||
/datum/surgery_step/generic/prepare_face/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
return ..() && target_zone == BP_MOUTH && target.op_stage.face == 1
|
||||
/decl/surgery_step/generic/prepare_face/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
return ..() && target_zone == BP_MOUTH && target.op_stage.face == FACE_CUT_OPEN
|
||||
|
||||
/datum/surgery_step/generic/prepare_face/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/generic/prepare_face/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
user.visible_message("[user] starts to retract [target]'s face with \the [tool].", \
|
||||
"You start to retract [target]'s face with \the [tool].")
|
||||
..()
|
||||
|
||||
/datum/surgery_step/generic/prepare_face/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/generic/prepare_face/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
user.visible_message("<b>[user]</b> has retracted [target]'s face with \the [tool] for his facial alteration." , \
|
||||
"<span class='notice'>You have retracted [target]'s face and neck with \the [tool] for plastic surgery.</span>",)
|
||||
target.op_stage.face = 2
|
||||
SPAN_NOTICE("You have retracted [target]'s face and neck with \the [tool] for plastic surgery."),)
|
||||
target.op_stage.face = FACE_RETRACTED
|
||||
|
||||
/datum/surgery_step/generic/prepare_face/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
user.visible_message("<span class='warning'>[user]'s hand slips, slicing [target]'s throat wth \the [tool]!</span>" , \
|
||||
"<span class='warning'>Your hand slips, slicing [target]'s throat wth \the [tool]!</span>" )
|
||||
/decl/surgery_step/generic/prepare_face/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
user.visible_message(SPAN_WARNING("[user]'s hand slips, slicing [target]'s throat wth \the [tool]!") , \
|
||||
SPAN_WARNING("Your hand slips, slicing [target]'s throat wth \the [tool]!") )
|
||||
target.apply_damage(40, BRUTE, target_zone, 0, tool, damage_flags = tool.damage_flags())
|
||||
target.apply_damage(20, OXY)
|
||||
target.losebreath += 10
|
||||
|
||||
|
||||
/datum/surgery_step/generic/alter_face
|
||||
/decl/surgery_step/generic/alter_face
|
||||
name = "Alter face"
|
||||
allowed_tools = list(
|
||||
/obj/item/surgery/hemostat = 100, \
|
||||
/obj/item/stack/cable_coil = 75, \
|
||||
@@ -56,21 +58,21 @@
|
||||
min_duration = 40
|
||||
max_duration = 90
|
||||
|
||||
/datum/surgery_step/generic/alter_face/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
return ..() && target_zone == BP_MOUTH && target.op_stage.face == 2
|
||||
/decl/surgery_step/generic/alter_face/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
return ..() && target_zone == BP_MOUTH && target.op_stage.face == FACE_RETRACTED
|
||||
|
||||
/datum/surgery_step/generic/alter_face/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/generic/alter_face/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
user.visible_message("<b>[user]</b> starts to adjust [target]'s face with \the [tool].", \
|
||||
SPAN_NOTICE("You start to alter [target]'s face and neck with \the [tool]."))
|
||||
..()
|
||||
|
||||
/datum/surgery_step/generic/alter_face/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/generic/alter_face/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/head/head = target.get_organ(target_zone)
|
||||
if(head.disfigured || (HUSK in target.mutations))
|
||||
head.disfigured = FALSE
|
||||
target.mutations.Remove(HUSK)
|
||||
target.update_body()
|
||||
user.visible_message("<b>[user]</b> finishes adjusting the skin [target]'s face.", "<span class='notice'>You successfully restore [target]'s appearance.</span>")
|
||||
user.visible_message("<b>[user]</b> finishes adjusting the skin [target]'s face.", SPAN_NOTICE("You successfully restore [target]'s appearance."))
|
||||
|
||||
var/getName = sanitize(input(user, "What is your patient's new identity?", "Name change") as null|text, MAX_NAME_LEN)
|
||||
if(getName)
|
||||
@@ -80,18 +82,19 @@
|
||||
if(target.mind)
|
||||
target.mind.name = target.name
|
||||
target.change_appearance(APPEARANCE_PLASTICSURGERY, usr, usr, check_species_whitelist = 1, state = z_state)
|
||||
target.op_stage.face = 3
|
||||
target.op_stage.face = FACE_ALTERED
|
||||
|
||||
|
||||
/datum/surgery_step/generic/alter_face/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
user.visible_message("<span class='warning'>[user]'s hand slips, slicing [target]'s throat wth \the [tool]!</span>" , \
|
||||
"<span class='warning'>Your hand slips, slicing [target]'s throat wth \the [tool]!</span>" )
|
||||
/decl/surgery_step/generic/alter_face/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
user.visible_message(SPAN_WARNING("[user]'s hand slips, slicing [target]'s throat wth \the [tool]!") , \
|
||||
SPAN_WARNING("Your hand slips, slicing [target]'s throat wth \the [tool]!") )
|
||||
target.apply_damage(40, BRUTE, target_zone, 0, tool, damage_flags = tool.damage_flags())
|
||||
target.apply_damage(20, OXY)
|
||||
target.losebreath += 10
|
||||
|
||||
|
||||
/datum/surgery_step/face/cauterize
|
||||
/decl/surgery_step/face/cauterize
|
||||
name = "Cauterize face"
|
||||
allowed_tools = list(
|
||||
/obj/item/surgery/cautery = 100, \
|
||||
/obj/item/clothing/mask/smokable/cigarette = 75, \
|
||||
@@ -102,39 +105,40 @@
|
||||
min_duration = 70
|
||||
max_duration = 100
|
||||
|
||||
/datum/surgery_step/face/cauterize/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
return ..() && target.op_stage.face > 0
|
||||
/decl/surgery_step/face/cauterize/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
return ..() && target.op_stage.face > FACE_NORMAL
|
||||
|
||||
/datum/surgery_step/face/cauterize/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/face/cauterize/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
user.visible_message("[user] is beginning to cauterize the incision on [target]'s face and neck with \the [tool]." , \
|
||||
"You are beginning to cauterize the incision on [target]'s face and neck with \the [tool].")
|
||||
..()
|
||||
|
||||
/datum/surgery_step/face/cauterize/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/face/cauterize/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
user.visible_message("<b>[user]</b> cauterizes the incision on [target]'s face and neck with \the [tool].", \
|
||||
"<span class='notice'>You cauterize the incision on [target]'s face and neck with \the [tool].</span>")
|
||||
affected.open = 0
|
||||
SPAN_NOTICE("You cauterize the incision on [target]'s face and neck with \the [tool]."))
|
||||
affected.open = ORGAN_CLOSED
|
||||
affected.status &= ~ORGAN_BLEEDING
|
||||
if(target.op_stage.face == 3)
|
||||
var/obj/item/organ/external/head/h = affected
|
||||
h.disfigured = 0
|
||||
target.op_stage.face = 0
|
||||
target.op_stage.face = FACE_NORMAL
|
||||
|
||||
/datum/surgery_step/face/cauterize/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/face/cauterize/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
user.visible_message("<span class='warning'>[user]'s hand slips, leaving a small burn on [target]'s face with \the [tool]!</span>", \
|
||||
"<span class='warning'>Your hand slips, leaving a small burn on [target]'s face with \the [tool]!</span>")
|
||||
user.visible_message(SPAN_WARNING("[user]'s hand slips, leaving a small burn on [target]'s face with \the [tool]!"), \
|
||||
SPAN_WARNING("Your hand slips, leaving a small burn on [target]'s face with \the [tool]!"))
|
||||
target.apply_damage(5, BURN, affected)
|
||||
|
||||
/datum/surgery_step/robotics/face
|
||||
/decl/surgery_step/robotics/face
|
||||
priority = 2
|
||||
can_infect = 0
|
||||
can_infect = FALSE
|
||||
|
||||
/datum/surgery_step/robotics/face/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
return target_zone == BP_MOUTH
|
||||
/decl/surgery_step/robotics/face/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
return ..() && target_zone == BP_MOUTH
|
||||
|
||||
/datum/surgery_step/robotics/face/synthskinopen
|
||||
/decl/surgery_step/robotics/face/synthskinopen
|
||||
name = "Retract facial incisions"
|
||||
allowed_tools = list(
|
||||
/obj/item/surgery/scalpel = 100,
|
||||
/obj/item/material/knife = 75,
|
||||
@@ -144,25 +148,26 @@
|
||||
min_duration = 90
|
||||
max_duration = 110
|
||||
|
||||
/datum/surgery_step/robotics/face/synthskinopen/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
return ..() && target.op_stage.face == 0 && target.get_species() == "Shell Frame"
|
||||
/decl/surgery_step/robotics/face/synthskinopen/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
return ..() && target.op_stage.face == FACE_NORMAL && target.get_species() == "Shell Frame"
|
||||
|
||||
/datum/surgery_step/robotics/face/synthskinopen/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/robotics/face/synthskinopen/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
user.visible_message("[user] starts to cut open [target]'s synthskin face and neck with \the [tool].", \
|
||||
"You start to cut open [target]'s synthskin face and neck with \the [tool].")
|
||||
..()
|
||||
|
||||
/datum/surgery_step/robotics/face/synthskinopen/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/robotics/face/synthskinopen/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
user.visible_message("<b>[user]</b> has cut open [target]'s synthskin face and neck with \the [tool]." , \
|
||||
"<span class='notice'>You have cut open [target]'s synthskin face and neck with \the [tool].</span>",)
|
||||
target.op_stage.face = 1
|
||||
SPAN_NOTICE("You have cut open [target]'s synthskin face and neck with \the [tool]."),)
|
||||
target.op_stage.face = FACE_CUT_OPEN
|
||||
|
||||
/datum/surgery_step/robotics/face/synthskinopen/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
user.visible_message("<span class='warning'>[user]'s hand slips, slicing [target]'s throat wth \the [tool]!</span>" , \
|
||||
"<span class='warning'>Your hand slips, slicing [target]'s throat wth \the [tool]!</span>" )
|
||||
/decl/surgery_step/robotics/face/synthskinopen/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
user.visible_message(SPAN_WARNING("[user]'s hand slips, slicing [target]'s throat wth \the [tool]!") , \
|
||||
SPAN_WARNING("Your hand slips, slicing [target]'s throat wth \the [tool]!") )
|
||||
target.apply_damage(40, BRUTE, target_zone, 0, tool, damage_flags = tool.damage_flags())
|
||||
|
||||
/datum/surgery_step/robotics/face/prepare_face
|
||||
/decl/surgery_step/robotics/face/prepare_face
|
||||
name = "Prepare face"
|
||||
allowed_tools = list(
|
||||
/obj/item/surgery/retractor = 100,
|
||||
/obj/item/material/knife/tacknife = 75
|
||||
@@ -171,25 +176,26 @@
|
||||
min_duration = 90
|
||||
max_duration = 110
|
||||
|
||||
/datum/surgery_step/robotics/face/prepare_face/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
return ..() && target_zone == BP_MOUTH && target.op_stage.face == 1
|
||||
/decl/surgery_step/robotics/face/prepare_face/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
return ..() && target_zone == BP_MOUTH && target.op_stage.face == FACE_CUT_OPEN
|
||||
|
||||
/datum/surgery_step/robotics/face/prepare_face/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/robotics/face/prepare_face/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
user.visible_message("[user] starts to retract [target]'s synthskin face with \the [tool].", \
|
||||
"You start to retract [target]'s face with \the [tool].")
|
||||
..()
|
||||
|
||||
/datum/surgery_step/robotics/face/prepare_face/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/robotics/face/prepare_face/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
user.visible_message("<b>[user]</b> has retracted [target]'s synthskin face with \the [tool] for thier facial alteration." , \
|
||||
"<span class='notice'>You have retracted [target]'s synthskin face and neck with \the [tool] for plastic surgery.</span>",)
|
||||
target.op_stage.face = 2
|
||||
SPAN_NOTICE("You have retracted [target]'s synthskin face and neck with \the [tool] for plastic surgery."),)
|
||||
target.op_stage.face = FACE_RETRACTED
|
||||
|
||||
/datum/surgery_step/robotics/face/prepare_face/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
user.visible_message("<span class='warning'>[user]'s hand slips, slicing [target]'s throat wth \the [tool]!</span>" , \
|
||||
"<span class='warning'>Your hand slips, slicing [target]'s throat wth \the [tool]!</span>" )
|
||||
/decl/surgery_step/robotics/face/prepare_face/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
user.visible_message(SPAN_WARNING("[user]'s hand slips, slicing [target]'s throat wth \the [tool]!") , \
|
||||
SPAN_WARNING("Your hand slips, slicing [target]'s throat wth \the [tool]!") )
|
||||
target.apply_damage(40, BRUTE, target_zone, 0, tool, damage_flags = tool.damage_flags())
|
||||
|
||||
/datum/surgery_step/robotics/face/alter_synthface
|
||||
/decl/surgery_step/robotics/face/alter_synthface
|
||||
name = "Alter face"
|
||||
allowed_tools = list(
|
||||
/obj/item/device/multitool = 100, \
|
||||
/obj/item/stack/cable_coil = 75, \
|
||||
@@ -199,22 +205,22 @@
|
||||
min_duration = 40
|
||||
max_duration = 90
|
||||
|
||||
/datum/surgery_step/robotics/face/alter_synthface/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
return ..() && target_zone == BP_MOUTH && target.op_stage.face == 2
|
||||
/decl/surgery_step/robotics/face/alter_synthface/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
return ..() && target_zone == BP_MOUTH && target.op_stage.face == FACE_RETRACTED
|
||||
|
||||
/datum/surgery_step/robotics/face/alter_synthface/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/robotics/face/alter_synthface/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
user.visible_message("<b>[user]</b> starts to alter [target]'s synthskin face with \the [tool].", \
|
||||
SPAN_NOTICE("You start to alter [target]'s synthskin face and neck with \the [tool]."))
|
||||
..()
|
||||
|
||||
/datum/surgery_step/robotics/face/alter_synthface/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/robotics/face/alter_synthface/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/head/head = target.get_organ(target_zone)
|
||||
if(head.disfigured || (HUSK in target.mutations))
|
||||
head.disfigured = FALSE
|
||||
target.mutations.Remove(HUSK)
|
||||
target.update_body()
|
||||
user.visible_message("<b>[user]</b> finishes adjusting [target]'s synthetic face.", \
|
||||
"<span class='notice'>You successfully adjust [target]'s appearance.</span>")
|
||||
SPAN_NOTICE("You successfully adjust [target]'s appearance."))
|
||||
|
||||
var/getName = sanitize(input(user, "What is your patient's new identity?", "Name change") as null|text, MAX_NAME_LEN)
|
||||
if(getName)
|
||||
@@ -224,15 +230,16 @@
|
||||
if(target.mind)
|
||||
target.mind.name = target.name
|
||||
target.change_appearance(APPEARANCE_PLASTICSURGERY, usr, usr, check_species_whitelist = 1, state = z_state)
|
||||
target.op_stage.face = 3
|
||||
target.op_stage.face = FACE_ALTERED
|
||||
|
||||
|
||||
/datum/surgery_step/robotics/face/alter_synthface/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
user.visible_message("<span class='warning'>[user]'s hand slips, slicing [target]'s throat wth \the [tool]!</span>" , \
|
||||
"<span class='warning'>Your hand slips, slicing [target]'s throat wth \the [tool]!</span>" )
|
||||
/decl/surgery_step/robotics/face/alter_synthface/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
user.visible_message(SPAN_WARNING("[user]'s hand slips, slicing [target]'s throat wth \the [tool]!") , \
|
||||
SPAN_WARNING("Your hand slips, slicing [target]'s throat wth \the [tool]!") )
|
||||
target.apply_damage(40, BRUTE, target_zone, 0, tool, damage_flags = tool.damage_flags())
|
||||
|
||||
/datum/surgery_step/robotics/face/seal_face
|
||||
/decl/surgery_step/robotics/face/seal_face
|
||||
name = "Seal face"
|
||||
allowed_tools = list(
|
||||
/obj/item/surgery/cautery = 100, \
|
||||
/obj/item/clothing/mask/smokable/cigarette = 75, \
|
||||
@@ -243,26 +250,26 @@
|
||||
min_duration = 70
|
||||
max_duration = 100
|
||||
|
||||
/datum/surgery_step/robotics/face/seal_face/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
return ..() && target.op_stage.face > 0
|
||||
/decl/surgery_step/robotics/face/seal_face/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
return ..() && target.op_stage.face > FACE_NORMAL
|
||||
|
||||
/datum/surgery_step/robotics/face/seal_face/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/robotics/face/seal_face/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
user.visible_message("[user] is beginning to seal the incision on [target]'s synthskin face and neck with \the [tool]." , \
|
||||
"You are beginning to seal the incision on [target]'s synthskin face and neck with \the [tool].")
|
||||
..()
|
||||
|
||||
/datum/surgery_step/robotics/face/seal_face/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/robotics/face/seal_face/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
user.visible_message("<span class='notice'>[user] seals the incision on [target]'s synthskin face and neck with \the [tool].</span>", \
|
||||
"<span class='notice'>You seal the incision on [target]'s synthskin face and neck with \the [tool].</span>")
|
||||
affected.open = 0
|
||||
if(target.op_stage.face == 3)
|
||||
user.visible_message(SPAN_NOTICE("[user] seals the incision on [target]'s synthskin face and neck with \the [tool]."), \
|
||||
SPAN_NOTICE("You seal the incision on [target]'s synthskin face and neck with \the [tool]."))
|
||||
affected.open = ORGAN_CLOSED
|
||||
if(target.op_stage.face == FACE_ALTERED)
|
||||
var/obj/item/organ/external/head/h = affected
|
||||
h.disfigured = 0
|
||||
target.op_stage.face = 0
|
||||
h.disfigured = FALSE
|
||||
target.op_stage.face = FACE_NORMAL
|
||||
|
||||
/datum/surgery_step/robotics/face/seal_face/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/robotics/face/seal_face/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
user.visible_message("<span class='warning'>[user]'s hand slips, leaving a small burn on [target]'s synthskin face with \the [tool]!</span>", \
|
||||
"<span class='warning'>Your hand slips, leaving a small burn on [target]'s synthskin face with \the [tool]!</span>")
|
||||
user.visible_message(SPAN_WARNING("[user]'s hand slips, leaving a small burn on [target]'s synthskin face with \the [tool]!"), \
|
||||
SPAN_WARNING("Your hand slips, leaving a small burn on [target]'s synthskin face with \the [tool]!"))
|
||||
target.apply_damage(5, BURN, affected)
|
||||
+150
-133
@@ -3,26 +3,27 @@
|
||||
// COMMON STEPS //
|
||||
//////////////////////////////////////////////////////////////////
|
||||
|
||||
/datum/surgery_step/generic
|
||||
can_infect = 1
|
||||
/decl/surgery_step/generic
|
||||
can_infect = TRUE
|
||||
|
||||
/datum/surgery_step/generic/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/generic/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(isslime(target))
|
||||
return 0
|
||||
return FALSE
|
||||
if(target_zone == BP_EYES) //there are specific steps for eye surgery
|
||||
return 0
|
||||
if(!ishuman(target))
|
||||
return 0
|
||||
return FALSE
|
||||
if(!..())
|
||||
return FALSE
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
if(affected == null)
|
||||
return 0
|
||||
return FALSE
|
||||
if(affected.is_stump())
|
||||
return 0
|
||||
if(affected.status & ORGAN_ROBOT)
|
||||
return 0
|
||||
return 1
|
||||
return FALSE
|
||||
if(BP_IS_ROBOTIC(affected))
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/datum/surgery_step/generic/cut_with_laser
|
||||
/decl/surgery_step/generic/cut_with_laser
|
||||
name = "Make laser incision"
|
||||
allowed_tools = list(
|
||||
/obj/item/surgery/scalpel/laser3 = 95, \
|
||||
/obj/item/surgery/scalpel/laser2 = 85, \
|
||||
@@ -32,23 +33,24 @@
|
||||
min_duration = 90
|
||||
max_duration = 110
|
||||
|
||||
/datum/surgery_step/generic/cut_with_laser/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(..())
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
return affected && affected.open == 0 && target_zone != BP_MOUTH
|
||||
/decl/surgery_step/generic/cut_with_laser/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(!..())
|
||||
return FALSE
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
return affected && affected.open == ORGAN_CLOSED && target_zone != BP_MOUTH
|
||||
|
||||
/datum/surgery_step/generic/cut_with_laser/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/generic/cut_with_laser/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
user.visible_message("[user] starts the bloodless incision on [target]'s [affected.name] with \the [tool].", \
|
||||
"You start the bloodless incision on [target]'s [affected.name] with \the [tool].")
|
||||
target.custom_pain("You feel a horrible, searing pain in your [affected.name]!", 75)
|
||||
..()
|
||||
|
||||
/datum/surgery_step/generic/cut_with_laser/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/generic/cut_with_laser/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
user.visible_message("<b>[user]</b> has made a bloodless incision on [target]'s [affected.name] with \the [tool].", \
|
||||
"<span class='notice'>You have made a bloodless incision on [target]'s [affected.name] with \the [tool].</span>")
|
||||
affected.open = 1
|
||||
SPAN_NOTICE("You have made a bloodless incision on [target]'s [affected.name] with \the [tool]."))
|
||||
affected.open = ORGAN_OPEN_INCISION
|
||||
|
||||
if(istype(target) && !(target.species.flags & NO_BLOOD))
|
||||
affected.status |= ORGAN_BLEEDING
|
||||
@@ -58,14 +60,15 @@
|
||||
affected.clamp_organ()
|
||||
spread_germs_to_organ(affected, user)
|
||||
|
||||
/datum/surgery_step/generic/cut_with_laser/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/generic/cut_with_laser/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
user.visible_message("<span class='warning'>[user]'s hand slips as the blade sputters, searing a long gash in [target]'s [affected.name] with \the [tool]!</span>", \
|
||||
"<span class='warning'>Your hand slips as the blade sputters, searing a long gash in [target]'s [affected.name] with \the [tool]!</span>")
|
||||
user.visible_message(SPAN_WARNING("[user]'s hand slips as the blade sputters, searing a long gash in [target]'s [affected.name] with \the [tool]!"), \
|
||||
SPAN_WARNING("Your hand slips as the blade sputters, searing a long gash in [target]'s [affected.name] with \the [tool]!"))
|
||||
target.apply_damage(7.5, BRUTE, target_zone, 0, tool, damage_flags = tool.damage_flags())
|
||||
target.apply_damage(12.5, BURN, target_zone, 0, tool)
|
||||
|
||||
/datum/surgery_step/generic/incision_manager
|
||||
/decl/surgery_step/generic/incision_manager
|
||||
name = "Make managed incision"
|
||||
allowed_tools = list(
|
||||
/obj/item/surgery/scalpel/manager = 100
|
||||
)
|
||||
@@ -73,39 +76,41 @@
|
||||
min_duration = 80
|
||||
max_duration = 120
|
||||
|
||||
/datum/surgery_step/generic/incision_manager/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(..())
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
return affected && affected.open == 0 && target_zone != BP_MOUTH
|
||||
/decl/surgery_step/generic/incision_manager/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(!..())
|
||||
return FALSE
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
return affected && affected.open == ORGAN_CLOSED && target_zone != BP_MOUTH
|
||||
|
||||
/datum/surgery_step/generic/incision_manager/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/generic/incision_manager/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
user.visible_message("[user] starts to construct a prepared incision on and within [target]'s [affected.name] with \the [tool].", \
|
||||
"You start to construct a prepared incision on and within [target]'s [affected.name] with \the [tool].")
|
||||
target.custom_pain("You feel a horrible, searing pain in your [affected.name] as it is pushed apart!", 75)
|
||||
..()
|
||||
|
||||
/datum/surgery_step/generic/incision_manager/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/generic/incision_manager/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
user.visible_message("<b>[user]</b> constructs a prepared incision on and within [target]'s [affected.name] with \the [tool].", \
|
||||
"<span class='notice'>You have constructed a prepared incision on and within [target]'s [affected.name] with \the [tool].</span>",)
|
||||
affected.open = 1
|
||||
SPAN_NOTICE("You have constructed a prepared incision on and within [target]'s [affected.name] with \the [tool]."),)
|
||||
affected.open = ORGAN_OPEN_INCISION
|
||||
|
||||
if(istype(target) && !(target.species.flags & NO_BLOOD))
|
||||
affected.status |= ORGAN_BLEEDING
|
||||
|
||||
target.apply_damage(1, BRUTE, target_zone, 0)
|
||||
affected.clamp_organ()
|
||||
affected.open = 2
|
||||
affected.open = ORGAN_OPEN_RETRACTED
|
||||
|
||||
/datum/surgery_step/generic/incision_manager/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/generic/incision_manager/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
user.visible_message("<span class='warning'>[user]'s hand jolts as the system sparks, ripping a gruesome hole in [target]'s [affected.name] with \the [tool]!</span>", \
|
||||
"<span class='warning'>Your hand jolts as the system sparks, ripping a gruesome hole in [target]'s [affected.name] with \the [tool]!</span>")
|
||||
user.visible_message(SPAN_WARNING("[user]'s hand jolts as the system sparks, ripping a gruesome hole in [target]'s [affected.name] with \the [tool]!"), \
|
||||
SPAN_WARNING("Your hand jolts as the system sparks, ripping a gruesome hole in [target]'s [affected.name] with \the [tool]!"))
|
||||
target.apply_damage(20, BRUTE, target_zone, 0, tool, damage_flags = tool.damage_flags())
|
||||
target.apply_damage(15, BURN, target_zone, 0, tool)
|
||||
|
||||
/datum/surgery_step/generic/cut_open
|
||||
/decl/surgery_step/generic/cut_open
|
||||
name = "Make incision"
|
||||
allowed_tools = list(
|
||||
/obj/item/surgery/scalpel = 100,
|
||||
/obj/item/material/knife = 75,
|
||||
@@ -115,27 +120,27 @@
|
||||
min_duration = 90
|
||||
max_duration = 110
|
||||
|
||||
/datum/surgery_step/generic/cut_open/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/generic/cut_open/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(!..())
|
||||
return FALSE
|
||||
if(isvaurca(target))
|
||||
return 0
|
||||
return FALSE
|
||||
else
|
||||
if(..())
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
return affected && affected.open == 0 && target_zone != BP_MOUTH
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
return affected && affected.open == ORGAN_CLOSED && target_zone != BP_MOUTH
|
||||
|
||||
|
||||
/datum/surgery_step/generic/cut_open/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/generic/cut_open/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
user.visible_message("<b>[user]</b> starts the incision on [target]'s [affected.name] with \the [tool].", \
|
||||
SPAN_NOTICE("You start the incision on [target]'s [affected.name] with \the [tool]."))
|
||||
target.custom_pain("You feel a horrible pain as if from a sharp knife in your [affected.name]!", 75)
|
||||
..()
|
||||
|
||||
/datum/surgery_step/generic/cut_open/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/generic/cut_open/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
user.visible_message("<b>[user]</b> has made an incision on [target]'s [affected.name] with \the [tool].", \
|
||||
"<span class='notice'>You have made an incision on [target]'s [affected.name] with \the [tool].</span>",)
|
||||
affected.open = 1
|
||||
SPAN_NOTICE("You have made an incision on [target]'s [affected.name] with \the [tool]."),)
|
||||
affected.open = ORGAN_OPEN_INCISION
|
||||
|
||||
if(istype(target) && !(target.species.flags & NO_BLOOD))
|
||||
affected.status |= ORGAN_BLEEDING
|
||||
@@ -143,13 +148,14 @@
|
||||
target.apply_damage(1, BRUTE, target_zone, 0)
|
||||
playsound(target.loc, 'sound/weapons/bladeslice.ogg', 15, 1)
|
||||
|
||||
/datum/surgery_step/generic/cut_open/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/generic/cut_open/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
user.visible_message("<span class='warning'>[user]'s hand slips, slicing open [target]'s [affected.name] in the wrong place with \the [tool]!</span>", \
|
||||
"<span class='warning'>Your hand slips, slicing open [target]'s [affected.name] in the wrong place with \the [tool]!</span>")
|
||||
user.visible_message(SPAN_WARNING("[user]'s hand slips, slicing open [target]'s [affected.name] in the wrong place with \the [tool]!"), \
|
||||
SPAN_WARNING("Your hand slips, slicing open [target]'s [affected.name] in the wrong place with \the [tool]!"))
|
||||
target.apply_damage(10, BRUTE, target_zone, 0, tool, damage_flags = tool.damage_flags())
|
||||
|
||||
/datum/surgery_step/generic/cut_open_vaurca
|
||||
/decl/surgery_step/generic/cut_open_vaurca
|
||||
name = "Cut open vacura"
|
||||
allowed_tools = list(
|
||||
/obj/item/surgery/surgicaldrill = 85,
|
||||
/obj/item/pickaxe/ = 15
|
||||
@@ -158,39 +164,41 @@
|
||||
min_duration = 110
|
||||
max_duration = 130
|
||||
|
||||
/datum/surgery_step/generic/cut_open_vaurca/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/generic/cut_open_vaurca/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(!..())
|
||||
return FALSE
|
||||
if(!(isvaurca(target)))
|
||||
return 0
|
||||
return FALSE
|
||||
else
|
||||
if(..())
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
return affected && affected.open == 0 && target_zone != BP_MOUTH
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
return affected && affected.open == ORGAN_CLOSED && target_zone != BP_MOUTH
|
||||
|
||||
/datum/surgery_step/generic/cut_open_vaurca/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/generic/cut_open_vaurca/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
user.visible_message("[user] starts drilling into [target]'s [affected.name] carapace with \the [tool].", \
|
||||
"You start drilling into [target]'s [affected.name] carapace with \the [tool].")
|
||||
target.custom_pain("You feel a horrible pain as if from a jackhammer in your [affected.name]!", 75)
|
||||
..()
|
||||
|
||||
/datum/surgery_step/generic/cut_open_vaurca/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/generic/cut_open_vaurca/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
user.visible_message("<b>[user]</b> has drilled into [target]'s [affected.name] carapace with \the [tool].", \
|
||||
"<span class='notice'>You have drilled into [target]'s [affected.name] carapace with \the [tool].</span>",)
|
||||
affected.open = 1
|
||||
SPAN_NOTICE("You have drilled into [target]'s [affected.name] carapace with \the [tool]."),)
|
||||
affected.open = ORGAN_OPEN_INCISION
|
||||
|
||||
if(istype(target) && !(target.species.flags & NO_BLOOD))
|
||||
affected.status |= ORGAN_BLEEDING
|
||||
|
||||
target.apply_damage(1, BRUTE, target_zone, 0)
|
||||
|
||||
/datum/surgery_step/generic/cut_open_vaurca/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/generic/cut_open_vaurca/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
user.visible_message("<span class='warning'>[user]'s hand slips, cracking [target]'s [affected.name] carapace in the wrong place with \the [tool]!</span>", \
|
||||
"<span class='warning'>Your hand slips, cracking [target]'s [affected.name] carapace in the wrong place with \the [tool]!</span>")
|
||||
user.visible_message(SPAN_WARNING("[user]'s hand slips, cracking [target]'s [affected.name] carapace in the wrong place with \the [tool]!"), \
|
||||
SPAN_WARNING("Your hand slips, cracking [target]'s [affected.name] carapace in the wrong place with \the [tool]!"))
|
||||
target.apply_damage(15, BRUTE, target_zone, 0, tool, damage_flags = tool.damage_flags())
|
||||
|
||||
/datum/surgery_step/generic/clamp_bleeders
|
||||
/decl/surgery_step/generic/clamp_bleeders
|
||||
name = "Clamp bleeders"
|
||||
allowed_tools = list(
|
||||
/obj/item/surgery/hemostat = 100, \
|
||||
/obj/item/stack/cable_coil = 75, \
|
||||
@@ -200,33 +208,36 @@
|
||||
min_duration = 40
|
||||
max_duration = 60
|
||||
|
||||
/datum/surgery_step/generic/clamp_bleeders/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(..())
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
return affected && affected.open && (affected.status & ORGAN_BLEEDING)
|
||||
/decl/surgery_step/generic/clamp_bleeders/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(!..())
|
||||
return FALSE
|
||||
|
||||
/datum/surgery_step/generic/clamp_bleeders/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
return affected && affected.open > ORGAN_CLOSED && (affected.status & ORGAN_BLEEDING)
|
||||
|
||||
/decl/surgery_step/generic/clamp_bleeders/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
user.visible_message("<b>[user]</b> starts clamping bleeders in [target]'s [affected.name] with \the [tool].", \
|
||||
"You start clamping bleeders in [target]'s [affected.name] with \the [tool].")
|
||||
target.custom_pain("The pain in your [affected.name] is maddening!", 75)
|
||||
..()
|
||||
|
||||
/datum/surgery_step/generic/clamp_bleeders/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/generic/clamp_bleeders/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
user.visible_message("<b>[user]</b> clamps bleeders in [target]'s [affected.name] with \the [tool].", \
|
||||
"<span class='notice'>You clamp bleeders in [target]'s [affected.name] with \the [tool].</span>")
|
||||
SPAN_NOTICE("You clamp bleeders in [target]'s [affected.name] with \the [tool]."))
|
||||
affected.clamp_organ()
|
||||
spread_germs_to_organ(affected, user)
|
||||
playsound(target.loc, 'sound/items/Welder.ogg', 15, 1)
|
||||
|
||||
/datum/surgery_step/generic/clamp_bleeders/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/generic/clamp_bleeders/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
user.visible_message("<span class='warning'>[user]'s hand slips, tearing blood vessels and causing massive bleeding in [target]'s [affected.name] with \the [tool]!</span>", \
|
||||
"<span class='warning'>Your hand slips, tearing blood vessels and causing massive bleeding in [target]'s [affected.name] with \the [tool]!</span>",)
|
||||
user.visible_message(SPAN_WARNING("[user]'s hand slips, tearing blood vessels and causing massive bleeding in [target]'s [affected.name] with \the [tool]!"), \
|
||||
SPAN_WARNING("Your hand slips, tearing blood vessels and causing massive bleeding in [target]'s [affected.name] with \the [tool]!"),)
|
||||
affected.sever_artery()
|
||||
|
||||
/datum/surgery_step/generic/retract_skin
|
||||
/decl/surgery_step/generic/retract_skin
|
||||
name = "Widen incision"
|
||||
allowed_tools = list(
|
||||
/obj/item/surgery/retractor = 100, \
|
||||
/obj/item/crowbar = 75, \
|
||||
@@ -236,12 +247,14 @@
|
||||
min_duration = 30
|
||||
max_duration = 40
|
||||
|
||||
/datum/surgery_step/generic/retract_skin/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(..())
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
return affected && affected.open == 1
|
||||
/decl/surgery_step/generic/retract_skin/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(!..())
|
||||
return FALSE
|
||||
|
||||
/datum/surgery_step/generic/retract_skin/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
return affected && affected.open == ORGAN_OPEN_INCISION
|
||||
|
||||
/decl/surgery_step/generic/retract_skin/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
var/msg = "<b>[user]</b> starts to pry open the incision on [target]'s [affected.name] with \the [tool]."
|
||||
var/self_msg = "You start to pry open the incision on [target]'s [affected.name] with \the [tool]."
|
||||
@@ -255,33 +268,34 @@
|
||||
target.custom_pain("It feels like the skin on your [affected.name] is on fire!", 75)
|
||||
..()
|
||||
|
||||
/datum/surgery_step/generic/retract_skin/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/generic/retract_skin/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
var/msg = "<b>[user]</b> keeps the incision open on [target]'s [affected.name] with \the [tool]."
|
||||
var/self_msg = "<span class='notice'>You keep the incision open on [target]'s [affected.name] with \the [tool].</span>"
|
||||
var/self_msg = SPAN_NOTICE("You keep the incision open on [target]'s [affected.name] with \the [tool].")
|
||||
if(target_zone == BP_CHEST)
|
||||
msg = "<b>[user]</b> keeps the ribcage open on [target]'s torso with \the [tool]."
|
||||
self_msg = "<span class='notice'>You keep the ribcage open on [target]'s torso with \the [tool].</span>"
|
||||
self_msg = SPAN_NOTICE("You keep the ribcage open on [target]'s torso with \the [tool].")
|
||||
if(target_zone == BP_GROIN)
|
||||
msg = "<b>[user]</b> keeps the incision open on [target]'s lower abdomen with \the [tool]."
|
||||
self_msg = "<span class='notice'>You keep the incision open on [target]'s lower abdomen with \the [tool].</span>"
|
||||
self_msg = SPAN_NOTICE("You keep the incision open on [target]'s lower abdomen with \the [tool].")
|
||||
user.visible_message(msg, self_msg)
|
||||
affected.open = 2
|
||||
affected.open = ORGAN_OPEN_RETRACTED
|
||||
|
||||
/datum/surgery_step/generic/retract_skin/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/generic/retract_skin/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
var/msg = "<span class='warning'>[user]'s hand slips, tearing the edges of the incision on [target]'s [affected.name] with \the [tool]!</span>"
|
||||
var/self_msg = "<span class='warning'>Your hand slips, tearing the edges of the incision on [target]'s [affected.name] with \the [tool]!</span>"
|
||||
var/msg = SPAN_WARNING("[user]'s hand slips, tearing the edges of the incision on [target]'s [affected.name] with \the [tool]!")
|
||||
var/self_msg = SPAN_WARNING("Your hand slips, tearing the edges of the incision on [target]'s [affected.name] with \the [tool]!")
|
||||
if (target_zone == BP_CHEST)
|
||||
msg = "<span class='warning'>[user]'s hand slips, damaging several organs in [target]'s torso with \the [tool]!</span>"
|
||||
self_msg = "<span class='warning'>Your hand slips, damaging several organs in [target]'s torso with \the [tool]!</span>"
|
||||
msg = SPAN_WARNING("[user]'s hand slips, damaging several organs in [target]'s torso with \the [tool]!")
|
||||
self_msg = SPAN_WARNING("Your hand slips, damaging several organs in [target]'s torso with \the [tool]!")
|
||||
if (target_zone == BP_GROIN)
|
||||
msg = "<span class='warning'>[user]'s hand slips, damaging several organs in [target]'s lower abdomen with \the [tool]</span>"
|
||||
self_msg = "<span class='warning'>Your hand slips, damaging several organs in [target]'s lower abdomen with \the [tool]!</span>"
|
||||
msg = SPAN_WARNING("[user]'s hand slips, damaging several organs in [target]'s lower abdomen with \the [tool]")
|
||||
self_msg = SPAN_WARNING("Your hand slips, damaging several organs in [target]'s lower abdomen with \the [tool]!")
|
||||
user.visible_message(msg, self_msg)
|
||||
target.apply_damage(12, BRUTE, target_zone, 0, tool, damage_flags = tool.damage_flags())
|
||||
|
||||
/datum/surgery_step/generic/cauterize
|
||||
/decl/surgery_step/generic/cauterize
|
||||
name = "Cauterize incision"
|
||||
allowed_tools = list(
|
||||
/obj/item/surgery/cautery = 100,
|
||||
/obj/item/clothing/mask/smokable/cigarette = 25,
|
||||
@@ -292,33 +306,36 @@
|
||||
min_duration = 70
|
||||
max_duration = 100
|
||||
|
||||
/datum/surgery_step/generic/cauterize/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(..())
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
return affected && affected.open && target_zone != BP_MOUTH
|
||||
/decl/surgery_step/generic/cauterize/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(!..())
|
||||
return FALSE
|
||||
|
||||
/datum/surgery_step/generic/cauterize/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
return affected && affected.open > ORGAN_CLOSED && target_zone != BP_MOUTH
|
||||
|
||||
/decl/surgery_step/generic/cauterize/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
user.visible_message("<b>[user]</b> is beginning to cauterize the incision on [target]'s [affected.name] with \the [tool]." , \
|
||||
SPAN_NOTICE("You are beginning to cauterize the incision on [target]'s [affected.name] with \the [tool]."))
|
||||
target.custom_pain("Your [affected.name] is being burned!", 75)
|
||||
..()
|
||||
|
||||
/datum/surgery_step/generic/cauterize/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/generic/cauterize/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
user.visible_message("<b>[user]</b> cauterizes the incision on [target]'s [affected.name] with \the [tool].", \
|
||||
"<span class='notice'>You cauterize the incision on [target]'s [affected.name] with \the [tool].</span>")
|
||||
affected.open = 0
|
||||
SPAN_NOTICE("You cauterize the incision on [target]'s [affected.name] with \the [tool]."))
|
||||
affected.open = ORGAN_CLOSED
|
||||
affected.germ_level = 0
|
||||
affected.status &= ~ORGAN_BLEEDING
|
||||
|
||||
/datum/surgery_step/generic/cauterize/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/generic/cauterize/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
user.visible_message("<span class='warning'>[user]'s hand slips, leaving a small burn on [target]'s [affected.name] with \the [tool]!</span>", \
|
||||
"<span class='warning'>Your hand slips, leaving a small burn on [target]'s [affected.name] with \the [tool]!</span>")
|
||||
user.visible_message(SPAN_WARNING("[user]'s hand slips, leaving a small burn on [target]'s [affected.name] with \the [tool]!"), \
|
||||
SPAN_WARNING("Your hand slips, leaving a small burn on [target]'s [affected.name] with \the [tool]!"))
|
||||
target.apply_damage(5, BURN, affected, tool)
|
||||
|
||||
/datum/surgery_step/generic/amputate
|
||||
/decl/surgery_step/generic/amputate
|
||||
name = "Amputate limb"
|
||||
allowed_tools = list(
|
||||
/obj/item/surgery/circular_saw = 100,
|
||||
/obj/item/melee/energy = 100,
|
||||
@@ -329,60 +346,60 @@
|
||||
min_duration = 110
|
||||
max_duration = 160
|
||||
|
||||
/datum/surgery_step/generic/amputate/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/generic/amputate/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(!..())
|
||||
return FALSE
|
||||
|
||||
if(target_zone == BP_EYES) //there are specific steps for eye surgery
|
||||
return 0
|
||||
if(!ishuman(target))
|
||||
return 0
|
||||
return FALSE
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
if(affected == null)
|
||||
return 0
|
||||
return FALSE
|
||||
|
||||
if(istype(tool, /obj/item/melee/energy))
|
||||
var/obj/item/melee/energy/E = tool
|
||||
if(!E.active)
|
||||
to_chat(user, "<span class='warning'>The energy blade is not turned on!</span>")
|
||||
return 0
|
||||
to_chat(user, SPAN_WARNING("The energy blade is not turned on!"))
|
||||
return FALSE
|
||||
|
||||
if(istype(tool, /obj/item/melee/chainsword))
|
||||
var/obj/item/melee/chainsword/E = tool
|
||||
if(!E.active)
|
||||
to_chat(user, "<span class='warning'>The blades aren't spinning, you can't cut anything!</span>")
|
||||
return 0
|
||||
to_chat(user, SPAN_WARNING("The blades aren't spinning, you can't cut anything!"))
|
||||
return FALSE
|
||||
|
||||
return (affected.limb_flags & ORGAN_CAN_AMPUTATE)
|
||||
|
||||
/datum/surgery_step/generic/amputate/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/generic/amputate/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
user.visible_message("<span class='danger'>[user] is beginning to amputate [target]'s [affected.name] with \the [tool].</span>" , \
|
||||
"<span class='danger'>You begin to cut through [target]'s [affected.amputation_point] with \the [tool].</span>")
|
||||
user.visible_message(SPAN_DANGER("[user] is beginning to amputate [target]'s [affected.name] with \the [tool].") , \
|
||||
SPAN_DANGER("You begin to cut through [target]'s [affected.amputation_point] with \the [tool]."))
|
||||
target.custom_pain("Your [affected.amputation_point] is being ripped apart!", 75)
|
||||
..()
|
||||
|
||||
/datum/surgery_step/generic/amputate/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/generic/amputate/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
user.visible_message("<span class='danger'>[user] amputates [target]'s [affected.name] at the [affected.amputation_point] with \the [tool].</span>", \
|
||||
"<span class='danger'>You amputate [target]'s [affected.name] with \the [tool].</span>")
|
||||
user.visible_message(SPAN_DANGER("[user] amputates [target]'s [affected.name] at the [affected.amputation_point] with \the [tool]."), \
|
||||
SPAN_DANGER("You amputate [target]'s [affected.name] with \the [tool]."))
|
||||
|
||||
var/clean = 1
|
||||
var/clean = TRUE
|
||||
if(istype(tool, /obj/item/melee/chainsword))//Chainswords rip and tear, so the limb removal is not clean
|
||||
clean = 0
|
||||
clean = FALSE
|
||||
|
||||
var/obj/item/organ/external/parent = affected.parent//Cache the parent organ of the limb before we sever it
|
||||
affected.droplimb(clean,DROPLIMB_EDGE)
|
||||
|
||||
if(istype(tool, /obj/item/melee/energy))//Code for energy weapons cauterising the cut
|
||||
spawn(1)
|
||||
affected = parent
|
||||
affected.open = 0//Close open wounds
|
||||
for(var/datum/wound/lost_limb/W in affected.wounds)
|
||||
W.disinfected = 1//Cleanse the wound of any germs
|
||||
W.autoheal_cutoff = INFINITY//Allow the wound to auto-heal, regardless of damage
|
||||
W.max_bleeding_stage = 0//Stop bleeding
|
||||
affected = parent
|
||||
affected.open = ORGAN_CLOSED//Close open wounds
|
||||
for(var/datum/wound/lost_limb/W in affected.wounds)
|
||||
W.disinfected = TRUE//Cleanse the wound of any germs
|
||||
W.autoheal_cutoff = INFINITY//Allow the wound to auto-heal, regardless of damage
|
||||
W.max_bleeding_stage = 0//Stop bleeding
|
||||
|
||||
/datum/surgery_step/generic/amputate/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/generic/amputate/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
user.visible_message("<span class='warning'>[user]'s hand slips, sawing through the bone in [target]'s [affected.name] with \the [tool]!</span>", \
|
||||
"<span class='warning'>Your hand slips, sawwing through the bone in [target]'s [affected.name] with \the [tool]!</span>")
|
||||
user.visible_message(SPAN_WARNING("[user]'s hand slips, sawing through the bone in [target]'s [affected.name] with \the [tool]!"), \
|
||||
SPAN_WARNING("Your hand slips, sawwing through the bone in [target]'s [affected.name] with \the [tool]!"))
|
||||
target.apply_damage(30, BRUTE, target_zone, 0, tool, damage_flags = tool.damage_flags())
|
||||
affected.fracture()
|
||||
@@ -4,26 +4,26 @@
|
||||
// ITEM PLACEMENT SURGERY //
|
||||
//////////////////////////////////////////////////////////////////
|
||||
|
||||
/datum/surgery_step/cavity
|
||||
/decl/surgery_step/cavity
|
||||
priority = 1
|
||||
|
||||
/datum/surgery_step/cavity/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(!ishuman(target))
|
||||
return 0
|
||||
/decl/surgery_step/cavity/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(!..())
|
||||
return FALSE
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
return affected && affected.open == (affected.encased ? 3 : 2) && !(affected.status & ORGAN_BLEEDING)
|
||||
return affected && IS_ORGAN_FULLY_OPEN && !(affected.status & ORGAN_BLEEDING)
|
||||
|
||||
/datum/surgery_step/cavity/proc/get_max_wclass(var/obj/item/organ/external/affected)
|
||||
/decl/surgery_step/cavity/proc/get_max_wclass(var/obj/item/organ/external/affected)
|
||||
switch(affected.name)
|
||||
if(BP_HEAD)
|
||||
return 1
|
||||
return ITEMSIZE_TINY
|
||||
if("upper body")
|
||||
return 3
|
||||
return ITEMSIZE_NORMAL
|
||||
if("lower body")
|
||||
return 2
|
||||
return ITEMSIZE_SMALL
|
||||
return 0
|
||||
|
||||
/datum/surgery_step/cavity/proc/get_cavity(var/obj/item/organ/external/affected)
|
||||
/decl/surgery_step/cavity/proc/get_cavity(var/obj/item/organ/external/affected)
|
||||
switch(affected.name)
|
||||
if(BP_HEAD)
|
||||
return "cranial"
|
||||
@@ -33,13 +33,14 @@
|
||||
return "abdominal"
|
||||
return ""
|
||||
|
||||
/datum/surgery_step/cavity/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/cavity/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/chest/affected = target.get_organ(target_zone)
|
||||
user.visible_message("<span class='warning'>[user]'s hand slips, scraping around inside [target]'s [affected.name] with \the [tool]!</span>", \
|
||||
"<span class='warning'>Your hand slips, scraping around inside [target]'s [affected.name] with \the [tool]!</span>")
|
||||
user.visible_message(SPAN_WARNING("[user]'s hand slips, scraping around inside [target]'s [affected.name] with \the [tool]!"), \
|
||||
SPAN_WARNING("Your hand slips, scraping around inside [target]'s [affected.name] with \the [tool]!"))
|
||||
target.apply_damage(20, BRUTE, target_zone, 0, tool, damage_flags = tool.damage_flags())
|
||||
|
||||
/datum/surgery_step/cavity/make_space
|
||||
/decl/surgery_step/cavity/make_space
|
||||
name = "Hollow out cavity"
|
||||
allowed_tools = list(
|
||||
/obj/item/surgery/surgicaldrill = 100, \
|
||||
/obj/item/pen = 75, \
|
||||
@@ -49,26 +50,28 @@
|
||||
min_duration = 60
|
||||
max_duration = 80
|
||||
|
||||
/datum/surgery_step/cavity/make_space/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(..())
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
return affected && !affected.cavity
|
||||
/decl/surgery_step/cavity/make_space/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(!..())
|
||||
return FALSE
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
return affected && !affected.cavity
|
||||
|
||||
/datum/surgery_step/cavity/make_space/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/cavity/make_space/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
user.visible_message("[user] starts making some space inside [target]'s [get_cavity(affected)] cavity with \the [tool].", \
|
||||
"You start making some space inside [target]'s [get_cavity(affected)] cavity with \the [tool]." )
|
||||
target.custom_pain("The pain in your chest is living hell!",1)
|
||||
affected.cavity = 1
|
||||
affected.cavity = CAVITY_OPEN
|
||||
playsound(target.loc, 'sound/effects/squelch1.ogg', 25, 1)
|
||||
..()
|
||||
|
||||
/datum/surgery_step/cavity/make_space/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/cavity/make_space/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/chest/affected = target.get_organ(target_zone)
|
||||
user.visible_message("<b>[user]</b> pushes apart some organs inside [target]'s [get_cavity(affected)] cavity with \the [tool].", \
|
||||
"<span class='notice'>You make some space inside [target]'s [get_cavity(affected)] cavity with \the [tool].</span>" )
|
||||
SPAN_NOTICE("You make some space inside [target]'s [get_cavity(affected)] cavity with \the [tool].") )
|
||||
|
||||
/datum/surgery_step/cavity/close_space
|
||||
/decl/surgery_step/cavity/close_space
|
||||
name = "Close cavity"
|
||||
priority = 2
|
||||
allowed_tools = list(
|
||||
/obj/item/surgery/cautery = 100, \
|
||||
@@ -80,45 +83,48 @@
|
||||
min_duration = 60
|
||||
max_duration = 80
|
||||
|
||||
/datum/surgery_step/cavity/close_space/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(..())
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
return affected && affected.cavity
|
||||
/decl/surgery_step/cavity/close_space/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(!..())
|
||||
return FALSE
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
return affected && affected.cavity
|
||||
|
||||
/datum/surgery_step/cavity/close_space/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/cavity/close_space/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
user.visible_message("<b>[user]</b> starts mending [target]'s [get_cavity(affected)] cavity wall with \the [tool].", \
|
||||
"You start mending [target]'s [get_cavity(affected)] cavity wall with \the [tool]." )
|
||||
target.custom_pain("The pain in your chest is living hell!", 75)
|
||||
affected.cavity = 0
|
||||
affected.cavity = CAVITY_CLOSED
|
||||
..()
|
||||
|
||||
/datum/surgery_step/cavity/close_space/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/cavity/close_space/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/chest/affected = target.get_organ(target_zone)
|
||||
user.visible_message("<b>[user]</b> mends [target]'s [get_cavity(affected)] cavity walls with \the [tool].", \
|
||||
"<span class='notice'>You mend [target]'s [get_cavity(affected)] cavity walls with \the [tool].</span>" )
|
||||
SPAN_NOTICE("You mend [target]'s [get_cavity(affected)] cavity walls with \the [tool].") )
|
||||
|
||||
/datum/surgery_step/cavity/place_item
|
||||
/decl/surgery_step/cavity/place_item
|
||||
name = "Place item in cavity"
|
||||
priority = 0
|
||||
allowed_tools = list(/obj/item = 100)
|
||||
|
||||
min_duration = 80
|
||||
max_duration = 100
|
||||
|
||||
/datum/surgery_step/cavity/place_item/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(..())
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
if(istype(user,/mob/living/silicon/robot))
|
||||
return
|
||||
if(affected && affected.cavity)
|
||||
var/total_volume = tool.w_class
|
||||
for(var/obj/item/I in affected.implants)
|
||||
if(istype(I,/obj/item/implant))
|
||||
continue
|
||||
total_volume += I.w_class
|
||||
return total_volume <= get_max_wclass(affected)
|
||||
/decl/surgery_step/cavity/place_item/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(!..())
|
||||
return FALSE
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
if(istype(user,/mob/living/silicon/robot))
|
||||
return
|
||||
if(affected && affected.cavity)
|
||||
var/total_volume = tool.w_class
|
||||
for(var/obj/item/I in affected.implants)
|
||||
if(istype(I,/obj/item/implant))
|
||||
continue
|
||||
total_volume += I.w_class
|
||||
return total_volume <= get_max_wclass(affected)
|
||||
|
||||
/datum/surgery_step/cavity/place_item/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/cavity/place_item/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
user.visible_message("<b>[user]</b> starts putting \the [tool] inside [target]'s [get_cavity(affected)] cavity.", \
|
||||
SPAN_NOTICE("You start putting \the [tool] inside [target]'s [get_cavity(affected)] cavity." ))
|
||||
@@ -126,13 +132,13 @@
|
||||
playsound(target.loc, 'sound/effects/squelch1.ogg', 50, 1)
|
||||
..()
|
||||
|
||||
/datum/surgery_step/cavity/place_item/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/cavity/place_item/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/chest/affected = target.get_organ(target_zone)
|
||||
|
||||
user.visible_message("<b>[user]</b> puts \the [tool] inside [target]'s [get_cavity(affected)] cavity.", \
|
||||
"<span class='notice'>You put \the [tool] inside [target]'s [get_cavity(affected)] cavity.</span>" )
|
||||
if(tool.w_class > get_max_wclass(affected)/2 && prob(50) && !(affected.status & ORGAN_ROBOT))
|
||||
to_chat(user, "<span class='warning'>You tear \the [affected.artery_name] trying to fit an object so big!</span>")
|
||||
SPAN_NOTICE("You put \the [tool] inside [target]'s [get_cavity(affected)] cavity.") )
|
||||
if(tool.w_class > get_max_wclass(affected)/2 && prob(50) && !BP_IS_ROBOTIC(affected))
|
||||
to_chat(user, SPAN_WARNING("You tear \the [affected.artery_name] trying to fit an object so big!"))
|
||||
affected.sever_artery()
|
||||
affected.owner.custom_pain("You feel something rip in your [affected.name]!", 1)
|
||||
user.drop_item()
|
||||
@@ -142,13 +148,14 @@
|
||||
moved_event.register(target, gps, /obj/item/device/gps/proc/update_position)
|
||||
gps.implanted_into = target
|
||||
tool.forceMove(affected)
|
||||
affected.cavity = 0
|
||||
affected.cavity = CAVITY_CLOSED
|
||||
|
||||
//////////////////////////////////////////////////////////////////
|
||||
// IMPLANT/ITEM REMOVAL SURGERY //
|
||||
//////////////////////////////////////////////////////////////////
|
||||
|
||||
/datum/surgery_step/cavity/implant_removal
|
||||
/decl/surgery_step/cavity/implant_removal
|
||||
name = "Remove foreign body"
|
||||
allowed_tools = list(
|
||||
/obj/item/surgery/hemostat = 100, \
|
||||
/obj/item/wirecutters = 75, \
|
||||
@@ -158,18 +165,21 @@
|
||||
min_duration = 80
|
||||
max_duration = 100
|
||||
|
||||
/datum/surgery_step/cavity/implant_removal/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
return ..() && affected
|
||||
/decl/surgery_step/cavity/implant_removal/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(!..())
|
||||
return FALSE
|
||||
|
||||
/datum/surgery_step/cavity/implant_removal/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
return affected
|
||||
|
||||
/decl/surgery_step/cavity/implant_removal/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
user.visible_message("[user] starts poking around inside [target]'s [affected.name] with \the [tool].", \
|
||||
"You start poking around inside [target]'s [affected.name] with \the [tool]." )
|
||||
target.custom_pain("The pain in your [affected.name] is living hell!", 50)
|
||||
..()
|
||||
|
||||
/datum/surgery_step/cavity/implant_removal/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/cavity/implant_removal/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/chest/affected = target.get_organ(target_zone)
|
||||
|
||||
var/find_prob = 0
|
||||
@@ -191,7 +201,7 @@
|
||||
|
||||
if(prob(find_prob))
|
||||
user.visible_message("<b>[user]</b> takes something out of incision on [target]'s [affected.name] with \the [tool].", \
|
||||
"<span class='notice'>You take [obj] out of incision on [target]'s [affected.name]s with \the [tool].</span>" )
|
||||
SPAN_NOTICE("You take [obj] out of incision on [target]'s [affected.name]s with \the [tool].") )
|
||||
target.remove_implant(obj, TRUE, affected)
|
||||
|
||||
BITSET(target.hud_updateflag, IMPLOYAL_HUD)
|
||||
@@ -211,15 +221,15 @@
|
||||
playsound(target.loc, 'sound/effects/squelch1.ogg', 50, 1)
|
||||
else
|
||||
user.visible_message("<b>[user]</b> removes \the [tool] from [target]'s [affected.name].", \
|
||||
"<span class='notice'>There's something inside [target]'s [affected.name], but you just missed it this time.</span>" )
|
||||
SPAN_NOTICE("There's something inside [target]'s [affected.name], but you just missed it this time.") )
|
||||
else
|
||||
user.visible_message("<b>[user]</b> could not find anything inside [target]'s [affected.name], and pulls \the [tool] out.", \
|
||||
"<span class='notice'>You could not find anything inside [target]'s [affected.name].</span>" )
|
||||
SPAN_NOTICE("You could not find anything inside [target]'s [affected.name].") )
|
||||
|
||||
/datum/surgery_step/cavity/implant_removal/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/cavity/implant_removal/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
..()
|
||||
var/obj/item/organ/external/chest/affected = target.get_organ(target_zone)
|
||||
user.visible_message("<span class='warning'>[user] loses their grip and stabs [target] with \the [tool]!</span>", "<span class='warning'>You lose your grip on \the [tool] and stab [target]!</span>")
|
||||
user.visible_message(SPAN_WARNING("[user] loses their grip and stabs [target] with \the [tool]!"), SPAN_WARNING("You lose your grip on \the [tool] and stab [target]!"))
|
||||
affected.sever_artery()
|
||||
target.apply_damage(25, BRUTE, target_zone)
|
||||
|
||||
|
||||
@@ -3,16 +3,16 @@
|
||||
// LIMB SURGERY //
|
||||
//////////////////////////////////////////////////////////////////
|
||||
|
||||
/datum/surgery_step/limb
|
||||
priority = 3 // Must be higher than /datum/surgery_step/internal
|
||||
can_infect = 0
|
||||
/decl/surgery_step/limb
|
||||
priority = 3 // Must be higher than /decl/surgery_step/internal
|
||||
can_infect = FALSE
|
||||
|
||||
/datum/surgery_step/limb/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(!ishuman(target))
|
||||
return 0
|
||||
/decl/surgery_step/limb/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(!..())
|
||||
return FALSE
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
if(affected)
|
||||
return 0
|
||||
return FALSE
|
||||
var/list/organ_data = target.species.has_limbs["[target_zone]"]
|
||||
var/obj/item/organ/external/E = tool
|
||||
if(E?.parent_organ)
|
||||
@@ -21,57 +21,62 @@
|
||||
return FALSE // Parent organ non-existant or unsuitable
|
||||
return !isnull(organ_data)
|
||||
|
||||
/datum/surgery_step/limb/attach
|
||||
/decl/surgery_step/limb/attach
|
||||
name = "Replace limb"
|
||||
allowed_tools = list(/obj/item/organ/external = 100)
|
||||
|
||||
min_duration = 50
|
||||
max_duration = 70
|
||||
|
||||
/datum/surgery_step/limb/attach/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/limb/attach/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/E = tool
|
||||
user.visible_message("<b>[user]</b> starts attaching [E.name] to [target]'s [E.amputation_point].", \
|
||||
SPAN_NOTICE("You start attaching [E.name] to [target]'s [E.amputation_point]."))
|
||||
|
||||
/datum/surgery_step/limb/attach/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/limb/attach/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/E = tool
|
||||
user.visible_message("<b>[user]</b> attaches [target]'s [E.name] to the [E.amputation_point].", \
|
||||
"<span class='notice'>You have attached [target]'s [E.name] to the [E.amputation_point].</span>")
|
||||
SPAN_NOTICE("You have attached [target]'s [E.name] to the [E.amputation_point]."))
|
||||
user.drop_from_inventory(E)
|
||||
E.replaced(target)
|
||||
target.update_body()
|
||||
target.updatehealth()
|
||||
target.UpdateDamageIcon()
|
||||
|
||||
/datum/surgery_step/limb/attach/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/limb/attach/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/E = tool
|
||||
user.visible_message("<span class='warning'>[user]'s hand slips, damaging [target]'s [E.amputation_point]!</span>", \
|
||||
"<span class='warning'>Your hand slips, damaging [target]'s [E.amputation_point]!</span>")
|
||||
user.visible_message(SPAN_WARNING("[user]'s hand slips, damaging [target]'s [E.amputation_point]!"), \
|
||||
SPAN_WARNING("Your hand slips, damaging [target]'s [E.amputation_point]!"))
|
||||
target.apply_damage(10, BRUTE, null, damage_flags = DAM_EDGE)
|
||||
|
||||
/datum/surgery_step/limb/connect
|
||||
/decl/surgery_step/limb/connect
|
||||
name = "Connect limb"
|
||||
allowed_tools = list(
|
||||
/obj/item/surgery/hemostat = 100, \
|
||||
/obj/item/stack/cable_coil = 75, \
|
||||
/obj/item/device/assembly/mousetrap = 20
|
||||
)
|
||||
can_infect = 1
|
||||
can_infect = TRUE
|
||||
|
||||
min_duration = 100
|
||||
max_duration = 120
|
||||
|
||||
/datum/surgery_step/limb/connect/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/limb/connect/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(!..())
|
||||
return FALSE
|
||||
|
||||
var/obj/item/organ/external/E = target.get_organ(target_zone)
|
||||
return E && !E.is_stump() && (E.status & ORGAN_DESTROYED)
|
||||
|
||||
/datum/surgery_step/limb/connect/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/limb/connect/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/E = target.get_organ(target_zone)
|
||||
user.visible_message("[user] starts connecting tendons and muscles in [target]'s [E.amputation_point] with [tool].", \
|
||||
"You start connecting tendons and muscle in [target]'s [E.amputation_point].")
|
||||
|
||||
/datum/surgery_step/limb/connect/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/limb/connect/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/E = target.get_organ(target_zone)
|
||||
user.visible_message("<b>[user]</b> has connected tendons and muscles in [target]'s [E.amputation_point] with [tool].", \
|
||||
"<span class='notice'>You have connected tendons and muscles in [target]'s [E.amputation_point] with [tool].</span>")
|
||||
SPAN_NOTICE("You have connected tendons and muscles in [target]'s [E.amputation_point] with [tool]."))
|
||||
E.status &= ~ORGAN_DESTROYED
|
||||
if(E.children)
|
||||
for(var/obj/item/organ/external/C in E.children)
|
||||
@@ -80,34 +85,36 @@
|
||||
target.updatehealth()
|
||||
target.UpdateDamageIcon()
|
||||
|
||||
/datum/surgery_step/limb/connect/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/limb/connect/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/E = tool
|
||||
user.visible_message("<span class='warning'>[user]'s hand slips, damaging [target]'s [E.amputation_point]!</span>", \
|
||||
"<span class='warning'>Your hand slips, damaging [target]'s [E.amputation_point]!</span>")
|
||||
user.visible_message(SPAN_WARNING("[user]'s hand slips, damaging [target]'s [E.amputation_point]!"), \
|
||||
SPAN_WARNING("Your hand slips, damaging [target]'s [E.amputation_point]!"))
|
||||
target.apply_damage(10, BRUTE, null, damage_flags = DAM_SHARP)
|
||||
|
||||
/datum/surgery_step/limb/mechanize
|
||||
/decl/surgery_step/limb/mechanize
|
||||
name = "Attach prosthetic limb"
|
||||
allowed_tools = list(/obj/item/robot_parts = 100)
|
||||
|
||||
min_duration = 80
|
||||
max_duration = 100
|
||||
|
||||
/datum/surgery_step/limb/mechanize/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(..())
|
||||
var/obj/item/robot_parts/p = tool
|
||||
if(p.part)
|
||||
if(!(target_zone in p.part))
|
||||
return 0
|
||||
return isnull(target.get_organ(target_zone))
|
||||
/decl/surgery_step/limb/mechanize/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(!..())
|
||||
return FALSE
|
||||
var/obj/item/robot_parts/p = tool
|
||||
if(p.part)
|
||||
if(!(target_zone in p.part))
|
||||
return FALSE
|
||||
return isnull(target.get_organ(target_zone))
|
||||
|
||||
/datum/surgery_step/limb/mechanize/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/limb/mechanize/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
user.visible_message("<b>[user]</b> starts attaching \the [tool] to [target].", \
|
||||
SPAN_NOTICE("You start attaching \the [tool] to [target]."))
|
||||
|
||||
/datum/surgery_step/limb/mechanize/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/limb/mechanize/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/robot_parts/L = tool
|
||||
user.visible_message("<b>[user]</b> has attached \the [tool] to [target].", \
|
||||
"<span class='notice'>You have attached \the [tool] to [target].</span>")
|
||||
SPAN_NOTICE("You have attached \the [tool] to [target]."))
|
||||
|
||||
if(L.part)
|
||||
for(var/part_name in L.part)
|
||||
@@ -128,7 +135,7 @@
|
||||
|
||||
qdel(tool)
|
||||
|
||||
/datum/surgery_step/limb/mechanize/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
user.visible_message("<span class='warning'>[user]'s hand slips, damaging [target]'s flesh!</span>", \
|
||||
"<span class='warning'>Your hand slips, damaging [target]'s flesh!</span>")
|
||||
/decl/surgery_step/limb/mechanize/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
user.visible_message(SPAN_WARNING("[user]'s hand slips, damaging [target]'s flesh!"), \
|
||||
SPAN_WARNING("Your hand slips, damaging [target]'s flesh!"))
|
||||
target.apply_damage(10, BRUTE, null, damage_flags = DAM_SHARP)
|
||||
@@ -1,25 +1,26 @@
|
||||
// Internal surgeries.
|
||||
/datum/surgery_step/internal
|
||||
/decl/surgery_step/internal
|
||||
priority = 2
|
||||
can_infect = 1
|
||||
can_infect = TRUE
|
||||
blood_level = 1
|
||||
|
||||
/datum/surgery_step/internal/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(!ishuman(target))
|
||||
return 0
|
||||
/decl/surgery_step/internal/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(!..())
|
||||
return FALSE
|
||||
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
if(affected.encased)
|
||||
return affected && affected.open == (affected.encased ? 3 : 2)
|
||||
return affected && IS_ORGAN_FULLY_OPEN
|
||||
if(BP_IS_ROBOTIC(affected))
|
||||
return affected.augment_limit && affected.open == 3
|
||||
return affected.augment_limit && affected.open == ORGAN_ENCASED_RETRACTED
|
||||
else
|
||||
return affected.augment_limit && affected.open == 2
|
||||
return affected.augment_limit && affected.open == ORGAN_OPEN_RETRACTED
|
||||
|
||||
//////////////////////////////////////////////////////////////////
|
||||
// CHEST INTERNAL ORGAN SURGERY //
|
||||
//////////////////////////////////////////////////////////////////
|
||||
/datum/surgery_step/internal/fix_organ
|
||||
/decl/surgery_step/internal/fix_organ
|
||||
name = "Repair internal organs"
|
||||
allowed_tools = list(
|
||||
/obj/item/stack/medical/advanced/bruise_pack= 100, \
|
||||
/obj/item/stack/medical/bruise_pack = 20
|
||||
@@ -28,22 +29,20 @@
|
||||
min_duration = 70
|
||||
max_duration = 90
|
||||
|
||||
/datum/surgery_step/internal/fix_organ/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(!ishuman(target))
|
||||
return
|
||||
/decl/surgery_step/internal/fix_organ/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(!..())
|
||||
return FALSE
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
if(!affected)
|
||||
return
|
||||
var/is_organ_damaged = 0
|
||||
var/is_organ_damaged = FALSE
|
||||
for(var/obj/item/organ/I in affected.internal_organs)
|
||||
if(I.damage > 0)
|
||||
is_organ_damaged = 1
|
||||
is_organ_damaged = TRUE
|
||||
break
|
||||
return ..() && is_organ_damaged
|
||||
return is_organ_damaged
|
||||
|
||||
/datum/surgery_step/internal/fix_organ/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(!ishuman(target))
|
||||
return
|
||||
/decl/surgery_step/internal/fix_organ/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(!..())
|
||||
return FALSE
|
||||
|
||||
var/tool_name = "\the [tool]"
|
||||
if(istype(tool, /obj/item/stack/medical/advanced/bruise_pack))
|
||||
@@ -60,7 +59,7 @@
|
||||
target.custom_pain("The pain in your [affected.name] is living hell!", 75)
|
||||
..()
|
||||
|
||||
/datum/surgery_step/internal/fix_organ/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/internal/fix_organ/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/tool_name = "\the [tool]"
|
||||
if(istype(tool, /obj/item/stack/medical/advanced/bruise_pack))
|
||||
tool_name = "regenerative membrane"
|
||||
@@ -74,19 +73,19 @@
|
||||
for(var/obj/item/organ/internal/I in affected.internal_organs)
|
||||
if(I && I.damage > 0 && !BP_IS_ROBOTIC(I))
|
||||
user.visible_message("<b>[user]</b> finishes applying [tool_name] to [target]'s [I.name].", \
|
||||
"<span class='notice'>You treat damage to [target]'s [I.name] with [tool_name].</span>" )
|
||||
SPAN_NOTICE("You treat damage to [target]'s [I.name] with [tool_name].") )
|
||||
I.surgical_fix(user)
|
||||
var/obj/item/organ/internal/brain/sponge = target.internal_organs_by_name[BP_BRAIN]
|
||||
if(sponge && istype(I, sponge))
|
||||
target.cure_all_traumas(cure_type = CURE_SURGERY)
|
||||
|
||||
/datum/surgery_step/internal/fix_organ/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/internal/fix_organ/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(!ishuman(target))
|
||||
return
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
|
||||
user.visible_message("<span class='warning'>[user]'s hand slips, getting mess and tearing the inside of [target]'s [affected.name] with \the [tool]!</span>", \
|
||||
"<span class='warning'>Your hand slips, getting mess and tearing the inside of [target]'s [affected.name] with \the [tool]!</span>")
|
||||
user.visible_message(SPAN_WARNING("[user]'s hand slips, getting mess and tearing the inside of [target]'s [affected.name] with \the [tool]!"), \
|
||||
SPAN_WARNING("Your hand slips, getting mess and tearing the inside of [target]'s [affected.name] with \the [tool]!"))
|
||||
var/dam_amt = 2
|
||||
|
||||
if(istype(tool, /obj/item/stack/medical/advanced/bruise_pack))
|
||||
@@ -101,7 +100,8 @@
|
||||
if(I && I.damage > 0)
|
||||
I.take_damage(dam_amt,0)
|
||||
|
||||
/datum/surgery_step/internal/detach_organ
|
||||
/decl/surgery_step/internal/detach_organ
|
||||
name = "Separate organ"
|
||||
priority = 1
|
||||
allowed_tools = list(
|
||||
/obj/item/surgery/scalpel = 100,
|
||||
@@ -112,14 +112,14 @@
|
||||
min_duration = 90
|
||||
max_duration = 110
|
||||
|
||||
/datum/surgery_step/internal/detach_organ/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/internal/detach_organ/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(!..())
|
||||
return 0
|
||||
return FALSE
|
||||
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
|
||||
if(!(affected && !(affected.status & ORGAN_ROBOT)))
|
||||
return 0
|
||||
if(!(affected && !BP_IS_ROBOTIC(affected)))
|
||||
return FALSE
|
||||
|
||||
target.op_stage.current_organ = null
|
||||
|
||||
@@ -131,13 +131,13 @@
|
||||
|
||||
var/organ_to_remove = input(user, "Which organ do you want to prepare for removal?") as null|anything in attached_organs
|
||||
if(!organ_to_remove)
|
||||
return 0
|
||||
return FALSE
|
||||
|
||||
target.op_stage.current_organ = organ_to_remove
|
||||
|
||||
return ..() && organ_to_remove
|
||||
return organ_to_remove
|
||||
|
||||
/datum/surgery_step/internal/detach_organ/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/internal/detach_organ/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
|
||||
user.visible_message("<b>[user]</b> starts to separate [target]'s [target.op_stage.current_organ] with \the [tool].", \
|
||||
@@ -145,9 +145,9 @@
|
||||
target.custom_pain("The pain in your [affected.name] is living hell!", 75)
|
||||
..()
|
||||
|
||||
/datum/surgery_step/internal/detach_organ/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/internal/detach_organ/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
user.visible_message("<b>[user]</b> has separated [target]'s [target.op_stage.current_organ] with \the [tool]." , \
|
||||
"<span class='notice'>You have separated [target]'s [target.op_stage.current_organ] with \the [tool].</span>")
|
||||
SPAN_NOTICE("You have separated [target]'s [target.op_stage.current_organ] with \the [tool]."))
|
||||
|
||||
var/obj/item/organ/I = target.internal_organs_by_name[target.op_stage.current_organ]
|
||||
if(I && istype(I))
|
||||
@@ -157,14 +157,15 @@
|
||||
target.updatehealth()
|
||||
target.UpdateDamageIcon()
|
||||
|
||||
/datum/surgery_step/internal/detach_organ/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/internal/detach_organ/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
user.visible_message("<span class='warning'>[user]'s hand slips, slicing an artery inside [target]'s [affected.name] with \the [tool]!</span>", \
|
||||
"<span class='warning'>Your hand slips, slicing an artery inside [target]'s [affected.name] with \the [tool]!</span>")
|
||||
user.visible_message(SPAN_WARNING("[user]'s hand slips, slicing an artery inside [target]'s [affected.name] with \the [tool]!"), \
|
||||
SPAN_WARNING("Your hand slips, slicing an artery inside [target]'s [affected.name] with \the [tool]!"))
|
||||
affected.sever_artery()
|
||||
target.apply_damage(rand(30, 50), BRUTE, target_zone, 0, tool, damage_flags = tool.damage_flags())
|
||||
|
||||
/datum/surgery_step/internal/remove_organ
|
||||
/decl/surgery_step/internal/remove_organ
|
||||
name = "Remove organ"
|
||||
allowed_tools = list(
|
||||
/obj/item/surgery/hemostat = 100, \
|
||||
/obj/item/wirecutters = 75, \
|
||||
@@ -174,9 +175,9 @@
|
||||
min_duration = 60
|
||||
max_duration = 80
|
||||
|
||||
/datum/surgery_step/internal/remove_organ/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/internal/remove_organ/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(!..())
|
||||
return 0
|
||||
return FALSE
|
||||
|
||||
target.op_stage.current_organ = null
|
||||
|
||||
@@ -188,20 +189,20 @@
|
||||
|
||||
var/organ_to_remove = input(user, "Which organ do you want to remove?") as null|anything in removable_organs
|
||||
if(!organ_to_remove)
|
||||
return 0
|
||||
return FALSE
|
||||
|
||||
target.op_stage.current_organ = organ_to_remove
|
||||
return ..()
|
||||
|
||||
/datum/surgery_step/internal/remove_organ/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/internal/remove_organ/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
user.visible_message("[user] starts removing [target]'s [target.op_stage.current_organ] with \the [tool].", \
|
||||
"You start removing [target]'s [target.op_stage.current_organ] with \the [tool].")
|
||||
target.custom_pain("Someone's ripping out your [target.op_stage.current_organ]!", 75)
|
||||
..()
|
||||
|
||||
/datum/surgery_step/internal/remove_organ/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
user.visible_message("<span class='notice'>[user] has removed [target]'s [target.op_stage.current_organ] with \the [tool].</span>", \
|
||||
"<span class='notice'>You have removed [target]'s [target.op_stage.current_organ] with \the [tool].</span>")
|
||||
/decl/surgery_step/internal/remove_organ/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
user.visible_message(SPAN_NOTICE("[user] has removed [target]'s [target.op_stage.current_organ] with \the [tool]."), \
|
||||
SPAN_NOTICE("You have removed [target]'s [target.op_stage.current_organ] with \the [tool]."))
|
||||
|
||||
// Extract the organ!
|
||||
if(target.op_stage.current_organ)
|
||||
@@ -218,13 +219,14 @@
|
||||
target.updatehealth()
|
||||
target.UpdateDamageIcon()
|
||||
|
||||
/datum/surgery_step/internal/remove_organ/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/internal/remove_organ/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
user.visible_message("<span class='warning'>[user]'s hand slips, damaging [target]'s [affected.name] with \the [tool]!</span>", \
|
||||
"<span class='warning'>Your hand slips, damaging [target]'s [affected.name] with \the [tool]!</span>")
|
||||
user.visible_message(SPAN_WARNING("[user]'s hand slips, damaging [target]'s [affected.name] with \the [tool]!"), \
|
||||
SPAN_WARNING("Your hand slips, damaging [target]'s [affected.name] with \the [tool]!"))
|
||||
target.apply_damage(20, BRUTE, target_zone, 0, tool, damage_flags = tool.damage_flags())
|
||||
|
||||
/datum/surgery_step/internal/replace_organ
|
||||
/decl/surgery_step/internal/replace_organ
|
||||
name = "Replace organ"
|
||||
allowed_tools = list(
|
||||
/obj/item/organ = 100
|
||||
)
|
||||
@@ -232,25 +234,24 @@
|
||||
min_duration = 60
|
||||
max_duration = 80
|
||||
|
||||
/datum/surgery_step/internal/replace_organ/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/internal/replace_organ/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(!..())
|
||||
return FALSE
|
||||
|
||||
var/obj/item/organ/O = tool
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
|
||||
if(!affected)
|
||||
return
|
||||
|
||||
var/organ_compatible
|
||||
var/organ_missing
|
||||
|
||||
if(!istype(O))
|
||||
return 0
|
||||
return FALSE
|
||||
|
||||
if((affected.status & ORGAN_ROBOT) && !(O.status & ORGAN_ROBOT))
|
||||
to_chat(user, "<span class='danger'>You cannot install a naked organ into a robotic body.</span>")
|
||||
if(BP_IS_ROBOTIC(affected) && !(O.status & ORGAN_ROBOT))
|
||||
to_chat(user, SPAN_DANGER("You cannot install a naked organ into a robotic body."))
|
||||
return SURGERY_FAILURE
|
||||
|
||||
if(!target.species)
|
||||
to_chat(user, "<span class='danger'>You have no idea what species this person is. Report this on the bug tracker.</span>")
|
||||
to_chat(user, SPAN_DANGER("You have no idea what species this person is. Report this on the bug tracker."))
|
||||
return SURGERY_FAILURE
|
||||
|
||||
var/o_is = (O.gender == PLURAL) ? "are" : "is"
|
||||
@@ -258,11 +259,11 @@
|
||||
var/o_do = (O.gender == PLURAL) ? "don't" : "doesn't"
|
||||
|
||||
if(O.organ_tag == "limb")
|
||||
return 0
|
||||
return FALSE
|
||||
else if(target.species.has_organ[O.organ_tag] || O.is_augment)
|
||||
|
||||
if(O.damage > (O.max_damage * 0.75))
|
||||
to_chat(user, "<span class='warning'>\The [O.organ_tag] [o_is] in no state to be transplanted.</span>")
|
||||
to_chat(user, SPAN_WARNING("\The [O.organ_tag] [o_is] in no state to be transplanted."))
|
||||
return SURGERY_FAILURE
|
||||
|
||||
if(O.species_restricted)
|
||||
@@ -284,33 +285,33 @@
|
||||
return SURGERY_FAILURE
|
||||
|
||||
if(!target.internal_organs_by_name[O.organ_tag])
|
||||
organ_missing = 1
|
||||
organ_missing = TRUE
|
||||
else
|
||||
to_chat(user, "<span class='warning'>\The [target] already has [o_a][O.organ_tag].</span>")
|
||||
to_chat(user, SPAN_WARNING("\The [target] already has [o_a][O.organ_tag]."))
|
||||
return SURGERY_FAILURE
|
||||
|
||||
if(O && affected.limb_name == O.parent_organ)
|
||||
organ_compatible = 1
|
||||
organ_compatible = TRUE
|
||||
else
|
||||
to_chat(user, "<span class='warning'>\The [O.organ_tag] [o_do] normally go in \the [affected.name].</span>")
|
||||
to_chat(user, SPAN_WARNING("\The [O.organ_tag] [o_do] normally go in \the [affected.name]."))
|
||||
return SURGERY_FAILURE
|
||||
else
|
||||
to_chat(user, "<span class='warning'>You're pretty sure [target.species.name_plural] don't normally have [o_a][O.organ_tag].</span>")
|
||||
to_chat(user, SPAN_WARNING("You're pretty sure [target.species.name_plural] don't normally have [o_a][O.organ_tag]."))
|
||||
return SURGERY_FAILURE
|
||||
|
||||
return ..() && organ_missing && organ_compatible
|
||||
return organ_missing && organ_compatible
|
||||
|
||||
/datum/surgery_step/internal/replace_organ/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/internal/replace_organ/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
user.visible_message("[user] starts transplanting \the [tool] into [target]'s [affected.name].", \
|
||||
"You start transplanting \the [tool] into [target]'s [affected.name].")
|
||||
target.custom_pain("Someone's rooting around in your [affected.name]!", 75)
|
||||
..()
|
||||
|
||||
/datum/surgery_step/internal/replace_organ/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/internal/replace_organ/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
user.visible_message("<span class='notice'>[user] has transplanted \the [tool] into [target]'s [affected.name].</span>", \
|
||||
"<span class='notice'>You have transplanted \the [tool] into [target]'s [affected.name].</span>")
|
||||
user.visible_message(SPAN_NOTICE("[user] has transplanted \the [tool] into [target]'s [affected.name]."), \
|
||||
SPAN_NOTICE("You have transplanted \the [tool] into [target]'s [affected.name]."))
|
||||
var/obj/item/organ/O = tool
|
||||
if(istype(O) && user.unEquip(O))
|
||||
O.replaced(target,affected)
|
||||
@@ -320,14 +321,15 @@
|
||||
target.updatehealth()
|
||||
target.UpdateDamageIcon()
|
||||
|
||||
/datum/surgery_step/internal/replace_organ/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
user.visible_message("<span class='warning'>[user]'s hand slips, damaging \the [tool]!</span>", \
|
||||
"<span class='warning'>Your hand slips, damaging \the [tool]!</span>")
|
||||
/decl/surgery_step/internal/replace_organ/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
user.visible_message(SPAN_WARNING("[user]'s hand slips, damaging \the [tool]!"), \
|
||||
SPAN_WARNING("Your hand slips, damaging \the [tool]!"))
|
||||
var/obj/item/organ/I = tool
|
||||
if(istype(I))
|
||||
I.take_damage(rand(3,5),0)
|
||||
|
||||
/datum/surgery_step/internal/attach_organ
|
||||
/decl/surgery_step/internal/attach_organ
|
||||
name = "Attach organ"
|
||||
allowed_tools = list(
|
||||
/obj/item/surgery/FixOVein = 100, \
|
||||
/obj/item/stack/cable_coil = 75
|
||||
@@ -336,34 +338,34 @@
|
||||
min_duration = 100
|
||||
max_duration = 120
|
||||
|
||||
/datum/surgery_step/internal/attach_organ/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/internal/attach_organ/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(!..())
|
||||
return 0
|
||||
return FALSE
|
||||
|
||||
target.op_stage.current_organ = null
|
||||
|
||||
var/list/removable_organs = list()
|
||||
for(var/organ in target.internal_organs_by_name)
|
||||
var/obj/item/organ/I = target.internal_organs_by_name[organ]
|
||||
if(I && (I.status & ORGAN_CUT_AWAY) && !(I.status & ORGAN_ROBOT) && I.parent_organ == target_zone)
|
||||
if(I && (I.status & ORGAN_CUT_AWAY) && !BP_IS_ROBOTIC(I) && I.parent_organ == target_zone)
|
||||
removable_organs |= organ
|
||||
|
||||
var/organ_to_replace = input(user, "Which organ do you want to reattach?") as null|anything in removable_organs
|
||||
if(!organ_to_replace)
|
||||
return 0
|
||||
return FALSE
|
||||
|
||||
target.op_stage.current_organ = organ_to_replace
|
||||
return ..()
|
||||
return TRUE
|
||||
|
||||
/datum/surgery_step/internal/attach_organ/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/internal/attach_organ/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
user.visible_message("[user] begins reattaching [target]'s [target.op_stage.current_organ] with \the [tool].", \
|
||||
"You start reattaching [target]'s [target.op_stage.current_organ] with \the [tool].")
|
||||
target.custom_pain("Someone's digging needles into your [target.op_stage.current_organ]!", 75)
|
||||
..()
|
||||
|
||||
/datum/surgery_step/internal/attach_organ/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
user.visible_message("<span class='notice'>[user] has reattached [target]'s [target.op_stage.current_organ] with \the [tool].</span>" , \
|
||||
"<span class='notice'>You have reattached [target]'s [target.op_stage.current_organ] with \the [tool].</span>")
|
||||
/decl/surgery_step/internal/attach_organ/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
user.visible_message(SPAN_NOTICE("[user] has reattached [target]'s [target.op_stage.current_organ] with \the [tool].") , \
|
||||
SPAN_NOTICE("You have reattached [target]'s [target.op_stage.current_organ] with \the [tool]."))
|
||||
|
||||
var/obj/item/organ/I = target.internal_organs_by_name[target.op_stage.current_organ]
|
||||
if(I && istype(I))
|
||||
@@ -373,13 +375,14 @@
|
||||
target.updatehealth()
|
||||
target.UpdateDamageIcon()
|
||||
|
||||
/datum/surgery_step/internal/attach_organ/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/internal/attach_organ/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
user.visible_message("<span class='warning'>[user]'s hand slips, damaging the flesh in [target]'s [affected.name] with \the [tool]!</span>", \
|
||||
"<span class='warning'>Your hand slips, damaging the flesh in [target]'s [affected.name] with \the [tool]!</span>")
|
||||
user.visible_message(SPAN_WARNING("[user]'s hand slips, damaging the flesh in [target]'s [affected.name] with \the [tool]!"), \
|
||||
SPAN_WARNING("Your hand slips, damaging the flesh in [target]'s [affected.name] with \the [tool]!"))
|
||||
target.apply_damage(20, BRUTE, target_zone, 0, tool, damage_flags = tool.damage_flags())
|
||||
|
||||
/datum/surgery_step/internal/lobotomize
|
||||
/decl/surgery_step/internal/lobotomize
|
||||
name = "Lobotomy"
|
||||
allowed_tools = list(
|
||||
/obj/item/surgery/scalpel/manager = 95,
|
||||
/obj/item/surgery/surgicaldrill = 75,
|
||||
@@ -389,36 +392,36 @@
|
||||
min_duration = 100
|
||||
max_duration = 120
|
||||
|
||||
/datum/surgery_step/internal/lobotomize/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/internal/lobotomize/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(!..())
|
||||
return 0
|
||||
return FALSE
|
||||
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
var/obj/item/organ/internal/brain/sponge = target.internal_organs_by_name[BP_BRAIN]
|
||||
if(!affected || !istype(sponge) || !(sponge in affected.internal_organs))
|
||||
return 0
|
||||
if(!istype(sponge) || !(sponge in affected.internal_organs))
|
||||
return FALSE
|
||||
|
||||
if(!sponge.can_lobotomize || sponge.lobotomized)
|
||||
return 0
|
||||
return FALSE
|
||||
|
||||
target.op_stage.current_organ = sponge
|
||||
return ..()
|
||||
return TRUE
|
||||
|
||||
/datum/surgery_step/internal/lobotomize/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/internal/lobotomize/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/internal/brain/B = target.op_stage.current_organ
|
||||
user.visible_message("[user] begins to modify [target]'s [B] to remove their memory recall with \the [tool].", \
|
||||
"You start to modify [target]'s [B] to remove their memory recall with \the [tool].")
|
||||
target.custom_pain("Someone's scraping away at your [B]!", 75)
|
||||
..()
|
||||
|
||||
/datum/surgery_step/internal/lobotomize/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/internal/lobotomize/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/internal/brain/B = target.op_stage.current_organ
|
||||
user.visible_message("<span class='notice'>[user] has modified [target]'s [B] to remove their memory recall with \the [tool].</span>" , \
|
||||
"<span class='notice'>You have removed [target]'s memory recall with \the [tool].</span>")
|
||||
user.visible_message(SPAN_NOTICE("[user] has modified [target]'s [B] to remove their memory recall with \the [tool].") , \
|
||||
SPAN_NOTICE("You have removed [target]'s memory recall with \the [tool]."))
|
||||
B.lobotomize(user)
|
||||
|
||||
/datum/surgery_step/internal/lobotomize/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/internal/lobotomize/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
user.visible_message("<span class='warning'>[user]'s hand slips, damaging the flesh in [target]'s [affected.name] with \the [tool]!</span>", \
|
||||
"<span class='warning'>Your hand slips, damaging the flesh in [target]'s [affected.name] with \the [tool]!</span>")
|
||||
user.visible_message(SPAN_WARNING("[user]'s hand slips, damaging the flesh in [target]'s [affected.name] with \the [tool]!"), \
|
||||
SPAN_WARNING("Your hand slips, damaging the flesh in [target]'s [affected.name] with \the [tool]!"))
|
||||
target.apply_damage(20, BRUTE, target_zone, 0, tool, damage_flags = tool.damage_flags())
|
||||
|
||||
@@ -4,52 +4,54 @@
|
||||
//////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
/datum/surgery_step/fix_vein
|
||||
/decl/surgery_step/fix_vein
|
||||
name = "Repair arterial bleeding"
|
||||
priority = 3
|
||||
allowed_tools = list(
|
||||
/obj/item/surgery/FixOVein = 100, \
|
||||
/obj/item/stack/cable_coil = 75
|
||||
)
|
||||
can_infect = 1
|
||||
can_infect = TRUE
|
||||
blood_level = 1
|
||||
|
||||
min_duration = 70
|
||||
max_duration = 90
|
||||
|
||||
/datum/surgery_step/fix_vein/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(!ishuman(target))
|
||||
return 0
|
||||
/decl/surgery_step/fix_vein/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(!..())
|
||||
return FALSE
|
||||
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
if(!affected)
|
||||
return
|
||||
|
||||
return affected.open >= 2 && (affected.status & ORGAN_ARTERY_CUT)
|
||||
return affected.open >= ORGAN_OPEN_RETRACTED && (affected.status & ORGAN_ARTERY_CUT)
|
||||
|
||||
/datum/surgery_step/fix_vein/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/fix_vein/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
user.visible_message("[user] starts patching the damaged vein in [target]'s [affected.name] with \the [tool]." , \
|
||||
"You start patching the damaged [affected.artery_name] in [target]'s [affected.name] with \the [tool].")
|
||||
target.custom_pain("The pain in your [affected.name] is unbearable!", 100)
|
||||
..()
|
||||
|
||||
/datum/surgery_step/fix_vein/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/fix_vein/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
user.visible_message("<span class='notice'>[user] has patched the damaged [affected.artery_name] in [target]'s [affected.name] with \the [tool].</span>", \
|
||||
"<span class='notice'>You have patched the damaged [affected.artery_name] in [target]'s [affected.name] with \the [tool].</span>")
|
||||
user.visible_message(SPAN_NOTICE("[user] has patched the damaged [affected.artery_name] in [target]'s [affected.name] with \the [tool]."), \
|
||||
SPAN_NOTICE("You have patched the damaged [affected.artery_name] in [target]'s [affected.name] with \the [tool]."))
|
||||
|
||||
affected.status &= ~ORGAN_ARTERY_CUT
|
||||
affected.update_damages()
|
||||
if(ishuman(user) && prob(40))
|
||||
user:bloody_hands(target, 0)
|
||||
|
||||
/datum/surgery_step/fix_vein/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/fix_vein/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
user.visible_message("<span class='warning'>[user]'s hand slips, smearing [tool] in the incision in [target]'s [affected.name]!</span>" , \
|
||||
"<span class='warning'>Your hand slips, smearing [tool] in the incision in [target]'s [affected.name]!</span>")
|
||||
user.visible_message(SPAN_WARNING("[user]'s hand slips, smearing [tool] in the incision in [target]'s [affected.name]!") , \
|
||||
SPAN_WARNING("Your hand slips, smearing [tool] in the incision in [target]'s [affected.name]!"))
|
||||
affected.take_damage(5, 0)
|
||||
|
||||
/datum/surgery_step/fix_dead_tissue //Debridement
|
||||
/decl/surgery_step/internal/fix_dead_tissue //Debridement
|
||||
name = "Debride damaged tissue"
|
||||
priority = 3
|
||||
allowed_tools = list(
|
||||
/obj/item/surgery/scalpel = 100,
|
||||
@@ -57,15 +59,15 @@
|
||||
/obj/item/material/shard = 50
|
||||
)
|
||||
|
||||
can_infect = 1
|
||||
can_infect = TRUE
|
||||
blood_level = 1
|
||||
|
||||
min_duration = 110
|
||||
max_duration = 160
|
||||
|
||||
/datum/surgery_step/fix_dead_tissue/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(!ishuman(target))
|
||||
return 0
|
||||
/decl/surgery_step/internal/fix_dead_tissue/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(!..())
|
||||
return FALSE
|
||||
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
var/obj/item/organ/internal/organ
|
||||
@@ -79,9 +81,9 @@
|
||||
to_chat(user, SPAN_WARNING("\The [organ] is too damaged. Repair it first."))
|
||||
return 0
|
||||
|
||||
return organ && affected.open >= 2 && (organ.status & ORGAN_DEAD)
|
||||
return organ.status & ORGAN_DEAD
|
||||
|
||||
/datum/surgery_step/fix_dead_tissue/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/internal/fix_dead_tissue/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
var/obj/item/organ/internal/organ
|
||||
for(var/obj/item/organ/internal/I in affected.internal_organs)
|
||||
@@ -93,24 +95,25 @@
|
||||
target.custom_pain("The pain in your [affected.name] is unbearable!", 75)
|
||||
..()
|
||||
|
||||
/datum/surgery_step/fix_dead_tissue/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/internal/fix_dead_tissue/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/list/obj/item/organ/internal/dead_organs = list()
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
for(var/obj/item/organ/internal/I in affected.internal_organs)
|
||||
if(I && !(I.status & ORGAN_CUT_AWAY) && (I.status & ORGAN_DEAD) && !BP_IS_ROBOTIC(I))
|
||||
dead_organs |= I
|
||||
var/obj/item/organ/internal/organ_to_fix = dead_organs[1]
|
||||
user.visible_message("<span class='notice'>[user] has cut away necrotic tissue from [target]'s [organ_to_fix.name] with \the [tool].</span>", \
|
||||
"<span class='notice'>You have cut away necrotic tissue in [target]'s [organ_to_fix.name] with \the [tool].</span>")
|
||||
user.visible_message(SPAN_NOTICE("[user] has cut away necrotic tissue from [target]'s [organ_to_fix.name] with \the [tool]."), \
|
||||
SPAN_NOTICE("You have cut away necrotic tissue in [target]'s [organ_to_fix.name] with \the [tool]."))
|
||||
organ_to_fix.status &= ~ORGAN_DEAD
|
||||
|
||||
/datum/surgery_step/fix_dead_tissue/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/internal/fix_dead_tissue/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
user.visible_message("<span class='warning'>[user]'s hand slips, slicing an artery inside [target]'s [affected.name] with \the [tool]!</span>", \
|
||||
"<span class='warning'>Your hand slips, slicing an artery inside [target]'s [affected.name] with \the [tool]!</span>")
|
||||
user.visible_message(SPAN_WARNING("[user]'s hand slips, slicing an artery inside [target]'s [affected.name] with \the [tool]!"), \
|
||||
SPAN_WARNING("Your hand slips, slicing an artery inside [target]'s [affected.name] with \the [tool]!"))
|
||||
affected.sever_artery()
|
||||
|
||||
/datum/surgery_step/treat_necrosis
|
||||
/decl/surgery_step/treat_necrosis
|
||||
name = "Treat necrosis"
|
||||
priority = 2
|
||||
allowed_tools = list(
|
||||
/obj/item/reagent_containers/dropper = 100,
|
||||
@@ -120,37 +123,37 @@
|
||||
/obj/item/reagent_containers/glass/bucket = 50
|
||||
)
|
||||
|
||||
can_infect = 0
|
||||
can_infect = FALSE
|
||||
blood_level = 0
|
||||
|
||||
min_duration = 50
|
||||
max_duration = 60
|
||||
|
||||
/datum/surgery_step/treat_necrosis/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/treat_necrosis/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(!..())
|
||||
return FALSE
|
||||
|
||||
if(!istype(tool, /obj/item/reagent_containers))
|
||||
return 0
|
||||
return FALSE
|
||||
|
||||
var/obj/item/reagent_containers/container = tool
|
||||
if(!container.reagents.has_reagent(/datum/reagent/peridaxon))
|
||||
return 0
|
||||
|
||||
if(!ishuman(target))
|
||||
return 0
|
||||
return FALSE
|
||||
|
||||
if (target_zone == BP_MOUTH)
|
||||
return 0
|
||||
return FALSE
|
||||
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
return affected && affected.open == 3 && (affected.status & ORGAN_DEAD)
|
||||
return affected && IS_ORGAN_FULLY_OPEN && (affected.status & ORGAN_DEAD)
|
||||
|
||||
/datum/surgery_step/treat_necrosis/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/treat_necrosis/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
user.visible_message("[user] starts applying medication to the affected tissue in [target]'s [affected.name] with \the [tool]." , \
|
||||
"You start applying medication to the affected tissue in [target]'s [affected.name] with \the [tool].")
|
||||
target.custom_pain("Something in your [affected.name] is causing you a lot of pain!", 75)
|
||||
..()
|
||||
|
||||
/datum/surgery_step/treat_necrosis/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/treat_necrosis/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
if (!istype(tool, /obj/item/reagent_containers))
|
||||
return
|
||||
@@ -163,10 +166,10 @@
|
||||
affected.status &= ~ORGAN_DEAD
|
||||
affected.owner.update_body(1)
|
||||
|
||||
user.visible_message("<span class='notice'>[user] applies [trans] units of the solution to affected tissue in [target]'s [affected.name]</span>", \
|
||||
"<span class='notice'>You apply [trans] units of the solution to affected tissue in [target]'s [affected.name] with \the [tool].</span>")
|
||||
user.visible_message(SPAN_NOTICE("[user] applies [trans] units of the solution to affected tissue in [target]'s [affected.name]"), \
|
||||
SPAN_NOTICE("You apply [trans] units of the solution to affected tissue in [target]'s [affected.name] with \the [tool]."))
|
||||
|
||||
/datum/surgery_step/treat_necrosis/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/treat_necrosis/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
if (!istype(tool, /obj/item/reagent_containers))
|
||||
return
|
||||
@@ -174,78 +177,86 @@
|
||||
var/obj/item/reagent_containers/container = tool
|
||||
var/trans = container.reagents.trans_to_mob(target, container.amount_per_transfer_from_this, CHEM_BLOOD)
|
||||
|
||||
user.visible_message("<span class='warning'>[user]'s hand slips, applying [trans] units of the solution to the wrong place in [target]'s [affected.name] with the [tool]!</span>" , \
|
||||
"<span class='warning'>Your hand slips, applying [trans] units of the solution to the wrong place in [target]'s [affected.name] with the [tool]!</span>")
|
||||
user.visible_message(SPAN_WARNING("[user]'s hand slips, applying [trans] units of the solution to the wrong place in [target]'s [affected.name] with the [tool]!") , \
|
||||
SPAN_WARNING("Your hand slips, applying [trans] units of the solution to the wrong place in [target]'s [affected.name] with the [tool]!"))
|
||||
|
||||
//no damage or anything, just wastes medicine
|
||||
|
||||
/datum/surgery_step/fix_tendon
|
||||
/decl/surgery_step/fix_tendon
|
||||
name = "Repair tendons"
|
||||
priority = 2
|
||||
allowed_tools = list(
|
||||
/obj/item/surgery/FixOVein = 100, \
|
||||
/obj/item/stack/cable_coil = 75
|
||||
)
|
||||
can_infect = 1
|
||||
can_infect = TRUE
|
||||
blood_level = 1
|
||||
|
||||
min_duration = 70
|
||||
max_duration = 90
|
||||
|
||||
/datum/surgery_step/fix_tendon/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
return affected && (affected.status & ORGAN_TENDON_CUT) && affected.open >= 2
|
||||
/decl/surgery_step/fix_tendon/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(!..())
|
||||
return FALSE
|
||||
|
||||
/datum/surgery_step/fix_tendon/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
return affected && (affected.status & ORGAN_TENDON_CUT) && affected.open >= ORGAN_OPEN_RETRACTED
|
||||
|
||||
/decl/surgery_step/fix_tendon/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
user.visible_message("[user] starts reattaching the damaged [affected.tendon_name] in [target]'s [affected.name] with \the [tool]." , \
|
||||
"You start reattaching the damaged [affected.tendon_name] in [target]'s [affected.name] with \the [tool].")
|
||||
target.custom_pain("The pain in your [affected.name] is unbearable!", 100)
|
||||
..()
|
||||
|
||||
/datum/surgery_step/fix_tendon/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/fix_tendon/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
user.visible_message("<span class='notice'>[user] has reattached the [affected.tendon_name] in [target]'s [affected.name] with \the [tool].</span>", \
|
||||
"<span class='notice'>You have reattached the [affected.tendon_name] in [target]'s [affected.name] with \the [tool].</span>")
|
||||
user.visible_message(SPAN_NOTICE("[user] has reattached the [affected.tendon_name] in [target]'s [affected.name] with \the [tool]."), \
|
||||
SPAN_NOTICE("You have reattached the [affected.tendon_name] in [target]'s [affected.name] with \the [tool]."))
|
||||
affected.status &= ~ORGAN_TENDON_CUT
|
||||
affected.update_damages()
|
||||
|
||||
/datum/surgery_step/fix_tendon/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/fix_tendon/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
user.visible_message("<span class='warning'>[user]'s hand slips, smearing [tool] in the incision in [target]'s [affected.name]!</span>" , \
|
||||
"<span class='warning'>Your hand slips, smearing [tool] in the incision in [target]'s [affected.name]!</span>")
|
||||
user.visible_message(SPAN_WARNING("[user]'s hand slips, smearing [tool] in the incision in [target]'s [affected.name]!") , \
|
||||
SPAN_WARNING("Your hand slips, smearing [tool] in the incision in [target]'s [affected.name]!"))
|
||||
target.apply_damage(15, PAIN)
|
||||
|
||||
/datum/surgery_step/hardsuit
|
||||
/decl/surgery_step/hardsuit
|
||||
name = "Remove hardsuit"
|
||||
allowed_tools = list(
|
||||
/obj/item/weldingtool = 80,
|
||||
/obj/item/surgery/circular_saw = 60,
|
||||
/obj/item/gun/energy/plasmacutter = 100
|
||||
)
|
||||
|
||||
can_infect = 0
|
||||
can_infect = FALSE
|
||||
blood_level = 0
|
||||
|
||||
min_duration = 120
|
||||
max_duration = 180
|
||||
|
||||
/datum/surgery_step/hardsuit/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/hardsuit/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(!..())
|
||||
return FALSE
|
||||
|
||||
if(!istype(target))
|
||||
return 0
|
||||
return FALSE
|
||||
if(tool.iswelder())
|
||||
var/obj/item/weldingtool/welder = tool
|
||||
if(!welder.isOn() || !welder.remove_fuel(1,user))
|
||||
return 0
|
||||
return FALSE
|
||||
return (target_zone == BP_CHEST) && istype(target.back, /obj/item/rig) && !(target.back.canremove)
|
||||
|
||||
/datum/surgery_step/hardsuit/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/hardsuit/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
user.visible_message("[user] starts cutting through the support systems of [target]'s [target.back] with \the [tool]." , \
|
||||
"You start cutting through the support systems of [target]'s [target.back] with \the [tool].")
|
||||
..()
|
||||
|
||||
/datum/surgery_step/hardsuit/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/hardsuit/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/rig/rig = target.back
|
||||
if(!istype(rig))
|
||||
return
|
||||
rig.reset()
|
||||
user.visible_message("<span class='notice'>[user] has cut through the support systems of [target]'s [rig] with \the [tool].</span>", \
|
||||
"<span class='notice'>You have cut through the support systems of [target]'s [rig] with \the [tool].</span>")
|
||||
user.visible_message(SPAN_NOTICE("[user] has cut through the support systems of [target]'s [rig] with \the [tool]."), \
|
||||
SPAN_NOTICE("You have cut through the support systems of [target]'s [rig] with \the [tool]."))
|
||||
|
||||
+170
-147
@@ -3,26 +3,27 @@
|
||||
// COMMON STEPS //
|
||||
//////////////////////////////////////////////////////////////////
|
||||
|
||||
/datum/surgery_step/robotics
|
||||
can_infect = 0
|
||||
/decl/surgery_step/robotics
|
||||
can_infect = FALSE
|
||||
|
||||
/datum/surgery_step/robotics/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/robotics/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(!..())
|
||||
return FALSE
|
||||
if(isslime(target))
|
||||
return 0
|
||||
return FALSE
|
||||
if(target_zone == BP_EYES) //there are specific steps for eye surgery
|
||||
return 0
|
||||
if(!ishuman(target))
|
||||
return 0
|
||||
return FALSE
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
if(affected == null)
|
||||
return 0
|
||||
if(isnull(affected))
|
||||
return FALSE
|
||||
if(affected.status & ORGAN_DESTROYED)
|
||||
return 0
|
||||
if(!(affected.status & ORGAN_ROBOT))
|
||||
return 0
|
||||
return 1
|
||||
return FALSE
|
||||
if(!(BP_IS_ROBOTIC(affected)))
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/datum/surgery_step/robotics/unscrew_hatch
|
||||
/decl/surgery_step/robotics/unscrew_hatch
|
||||
name = "Unscrew hatch"
|
||||
allowed_tools = list(
|
||||
/obj/item/screwdriver = 100,
|
||||
/obj/item/coin = 50,
|
||||
@@ -32,29 +33,32 @@
|
||||
min_duration = 90
|
||||
max_duration = 110
|
||||
|
||||
/datum/surgery_step/robotics/unscrew_hatch/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(..())
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
return affected && affected.open == 0 && target_zone != BP_MOUTH
|
||||
/decl/surgery_step/robotics/unscrew_hatch/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(!..())
|
||||
return FALSE
|
||||
|
||||
/datum/surgery_step/robotics/unscrew_hatch/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
return affected && affected.open == ORGAN_CLOSED && target_zone != BP_MOUTH
|
||||
|
||||
/decl/surgery_step/robotics/unscrew_hatch/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
user.visible_message("<b>[user]</b> starts to unscrew the maintenance hatch on [target]'s [affected.name] with \the [tool].", \
|
||||
SPAN_NOTICE("You start to unscrew the maintenance hatch on [target]'s [affected.name] with \the [tool]."))
|
||||
..()
|
||||
|
||||
/datum/surgery_step/robotics/unscrew_hatch/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/robotics/unscrew_hatch/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
user.visible_message("<b>[user]</b> has opened the maintenance hatch on [target]'s [affected.name] with \the [tool].", \
|
||||
"<span class='notice'>You have opened the maintenance hatch on [target]'s [affected.name] with \the [tool].</span>",)
|
||||
affected.open = 1
|
||||
SPAN_NOTICE("You have opened the maintenance hatch on [target]'s [affected.name] with \the [tool]."),)
|
||||
affected.open = ORGAN_OPEN_INCISION
|
||||
|
||||
/datum/surgery_step/robotics/unscrew_hatch/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/robotics/unscrew_hatch/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
user.visible_message("<span class='warning'>[user]'s [tool.name] slips, failing to unscrew [target]'s [affected.name].</span>", \
|
||||
"<span class='warning'>Your [tool] slips, failing to unscrew [target]'s [affected.name].</span>")
|
||||
user.visible_message(SPAN_WARNING("[user]'s [tool.name] slips, failing to unscrew [target]'s [affected.name]."), \
|
||||
SPAN_WARNING("Your [tool] slips, failing to unscrew [target]'s [affected.name]."))
|
||||
|
||||
/datum/surgery_step/robotics/open_hatch
|
||||
/decl/surgery_step/robotics/open_hatch
|
||||
name = "Open hatch"
|
||||
allowed_tools = list(
|
||||
/obj/item/surgery/retractor = 100,
|
||||
/obj/item/crowbar = 100,
|
||||
@@ -64,29 +68,32 @@
|
||||
min_duration = 30
|
||||
max_duration = 40
|
||||
|
||||
/datum/surgery_step/robotics/open_hatch/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(..())
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
return affected && affected.open == 1
|
||||
/decl/surgery_step/robotics/open_hatch/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(!..())
|
||||
return FALSE
|
||||
|
||||
/datum/surgery_step/robotics/open_hatch/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
return affected && affected.open == ORGAN_OPEN_INCISION
|
||||
|
||||
/decl/surgery_step/robotics/open_hatch/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
user.visible_message("<b>[user]</b> starts to pry open the maintenance hatch on [target]'s [affected.name] with \the [tool].",
|
||||
SPAN_NOTICE("You start to pry open the maintenance hatch on [target]'s [affected.name] with \the [tool]."))
|
||||
..()
|
||||
|
||||
/datum/surgery_step/robotics/open_hatch/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/robotics/open_hatch/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
user.visible_message("<span class='notice'>[user] opens the maintenance hatch on [target]'s [affected.name] with \the [tool].</span>", \
|
||||
"<span class='notice'>You open the maintenance hatch on [target]'s [affected.name] with \the [tool].</span>")
|
||||
affected.open = 3
|
||||
user.visible_message(SPAN_NOTICE("[user] opens the maintenance hatch on [target]'s [affected.name] with \the [tool]."), \
|
||||
SPAN_NOTICE("You open the maintenance hatch on [target]'s [affected.name] with \the [tool]."))
|
||||
affected.open = ORGAN_ENCASED_RETRACTED
|
||||
|
||||
/datum/surgery_step/robotics/open_hatch/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/robotics/open_hatch/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
user.visible_message("<span class='warning'>[user]'s [tool.name] slips, failing to open the hatch on [target]'s [affected.name].</span>",
|
||||
"<span class='warning'>Your [tool] slips, failing to open the hatch on [target]'s [affected.name].</span>")
|
||||
user.visible_message(SPAN_WARNING("[user]'s [tool.name] slips, failing to open the hatch on [target]'s [affected.name]."),
|
||||
SPAN_WARNING("Your [tool] slips, failing to open the hatch on [target]'s [affected.name]."))
|
||||
|
||||
/datum/surgery_step/robotics/close_hatch
|
||||
/decl/surgery_step/robotics/close_hatch
|
||||
name = "Close hatch"
|
||||
allowed_tools = list(
|
||||
/obj/item/surgery/retractor = 100,
|
||||
/obj/item/crowbar = 100,
|
||||
@@ -96,30 +103,33 @@
|
||||
min_duration = 70
|
||||
max_duration = 100
|
||||
|
||||
/datum/surgery_step/robotics/close_hatch/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(..())
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
return affected && affected.open && target_zone != BP_MOUTH
|
||||
/decl/surgery_step/robotics/close_hatch/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(!..())
|
||||
return FALSE
|
||||
|
||||
/datum/surgery_step/robotics/close_hatch/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
return affected && affected.open > ORGAN_CLOSED && target_zone != BP_MOUTH
|
||||
|
||||
/decl/surgery_step/robotics/close_hatch/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
user.visible_message("<b>[user]</b> begins to close and secure the hatch on [target]'s [affected.name] with \the [tool]." , \
|
||||
SPAN_NOTICE("You begin to close and secure the hatch on [target]'s [affected.name] with \the [tool]."))
|
||||
..()
|
||||
|
||||
/datum/surgery_step/robotics/close_hatch/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/robotics/close_hatch/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
user.visible_message("<b>[user]</b> closes and secures the hatch on [target]'s [affected.name] with \the [tool].", \
|
||||
"<span class='notice'>You close and secure the hatch on [target]'s [affected.name] with \the [tool].</span>")
|
||||
affected.open = 0
|
||||
SPAN_NOTICE("You close and secure the hatch on [target]'s [affected.name] with \the [tool]."))
|
||||
affected.open = ORGAN_CLOSED
|
||||
affected.germ_level = 0
|
||||
|
||||
/datum/surgery_step/robotics/close_hatch/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/robotics/close_hatch/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
user.visible_message("<span class='warning'>[user]'s [tool.name] slips, failing to close the hatch on [target]'s [affected.name].</span>",
|
||||
"<span class='warning'>Your [tool.name] slips, failing to close the hatch on [target]'s [affected.name].</span>")
|
||||
user.visible_message(SPAN_WARNING("[user]'s [tool.name] slips, failing to close the hatch on [target]'s [affected.name]."),
|
||||
SPAN_WARNING("Your [tool.name] slips, failing to close the hatch on [target]'s [affected.name]."))
|
||||
|
||||
/datum/surgery_step/robotics/repair_brute
|
||||
/decl/surgery_step/robotics/repair_brute
|
||||
name = "Repair damage"
|
||||
allowed_tools = list(
|
||||
/obj/item/weldingtool = 100,
|
||||
/obj/item/gun/energy/plasmacutter = 50
|
||||
@@ -128,34 +138,37 @@
|
||||
min_duration = 50
|
||||
max_duration = 60
|
||||
|
||||
/datum/surgery_step/robotics/repair_brute/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(..())
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
if(tool.iswelder())
|
||||
var/obj/item/weldingtool/welder = tool
|
||||
if(!welder.isOn() || !welder.remove_fuel(2,user))
|
||||
return 0
|
||||
return affected && affected.open == 3 && affected.brute_dam > 0 && target_zone != BP_MOUTH
|
||||
/decl/surgery_step/robotics/repair_brute/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(!..())
|
||||
return FALSE
|
||||
|
||||
/datum/surgery_step/robotics/repair_brute/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
if(tool.iswelder())
|
||||
var/obj/item/weldingtool/welder = tool
|
||||
if(!welder.isOn() || !welder.remove_fuel(2,user))
|
||||
return FALSE
|
||||
return affected && affected.open == ORGAN_ENCASED_RETRACTED && affected.brute_dam > 0 && target_zone != BP_MOUTH
|
||||
|
||||
/decl/surgery_step/robotics/repair_brute/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
user.visible_message("<b>[user]</b> begins to patch damage to [target]'s [affected.name]'s support structure with \the [tool]." , \
|
||||
SPAN_NOTICE("You begin to patch damage to [target]'s [affected.name]'s support structure with \the [tool]."))
|
||||
..()
|
||||
|
||||
/datum/surgery_step/robotics/repair_brute/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/robotics/repair_brute/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
user.visible_message("<b>[user]</b> finishes patching damage to [target]'s [affected.name] with \the [tool].", \
|
||||
"<span class='notice'>You finish patching damage to [target]'s [affected.name] with \the [tool].</span>")
|
||||
SPAN_NOTICE("You finish patching damage to [target]'s [affected.name] with \the [tool]."))
|
||||
affected.heal_damage(rand(30,50),0,1,1)
|
||||
|
||||
/datum/surgery_step/robotics/repair_brute/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/robotics/repair_brute/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
user.visible_message("<span class='warning'>[user]'s [tool.name] slips, damaging the internal structure of [target]'s [affected.name].</span>",
|
||||
"<span class='warning'>Your [tool.name] slips, damaging the internal structure of [target]'s [affected.name].</span>")
|
||||
user.visible_message(SPAN_WARNING("[user]'s [tool.name] slips, damaging the internal structure of [target]'s [affected.name]."),
|
||||
SPAN_WARNING("Your [tool.name] slips, damaging the internal structure of [target]'s [affected.name]."))
|
||||
target.apply_damage(rand(5,10), BURN, affected)
|
||||
|
||||
/datum/surgery_step/robotics/repair_burn
|
||||
/decl/surgery_step/robotics/repair_burn
|
||||
name = "Repair burns"
|
||||
allowed_tools = list(
|
||||
/obj/item/stack/cable_coil = 100
|
||||
)
|
||||
@@ -163,39 +176,42 @@
|
||||
min_duration = 50
|
||||
max_duration = 60
|
||||
|
||||
/datum/surgery_step/robotics/repair_burn/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(..())
|
||||
var/obj/item/stack/cable_coil/C = tool
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
var/limb_can_operate = (affected && affected.open == 3 && affected.burn_dam > 0 && target_zone != BP_MOUTH)
|
||||
if(limb_can_operate)
|
||||
if(istype(C))
|
||||
if(!C.get_amount() >= 6)
|
||||
to_chat(user, "<span class='danger'>You need six or more cable pieces to repair this damage.</span>")
|
||||
return SURGERY_FAILURE
|
||||
C.use(3)
|
||||
return 1
|
||||
return 0
|
||||
/decl/surgery_step/robotics/repair_burn/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(!..())
|
||||
return FALSE
|
||||
|
||||
/datum/surgery_step/robotics/repair_burn/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/stack/cable_coil/C = tool
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
var/limb_can_operate = (affected && affected.open == ORGAN_ENCASED_RETRACTED && affected.burn_dam > 0 && target_zone != BP_MOUTH)
|
||||
if(limb_can_operate)
|
||||
if(istype(C))
|
||||
if(!C.get_amount() >= 6)
|
||||
to_chat(user, SPAN_DANGER("You need six or more cable pieces to repair this damage."))
|
||||
return SURGERY_FAILURE
|
||||
C.use(3)
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/decl/surgery_step/robotics/repair_burn/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
user.visible_message("<b>[user]</b> begins to splice new cabling into [target]'s [affected.name]." , \
|
||||
SPAN_NOTICE("You begin to splice new cabling into [target]'s [affected.name]."))
|
||||
..()
|
||||
|
||||
/datum/surgery_step/robotics/repair_burn/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/robotics/repair_burn/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
user.visible_message("<b>[user]</b> finishes splicing cable into [target]'s [affected.name]", \
|
||||
"<span class='notice'>You finishes splicing new cable into [target]'s [affected.name].</span>")
|
||||
SPAN_NOTICE("You finishes splicing new cable into [target]'s [affected.name]."))
|
||||
affected.heal_damage(0,rand(30,50),1,1)
|
||||
|
||||
/datum/surgery_step/robotics/repair_burn/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/robotics/repair_burn/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
user.visible_message("<span class='warning'>[user] causes a short circuit in [target]'s [affected.name]!</span>",
|
||||
"<span class='warning'>You cause a short circuit in [target]'s [affected.name]!</span>")
|
||||
user.visible_message(SPAN_WARNING("[user] causes a short circuit in [target]'s [affected.name]!"),
|
||||
SPAN_WARNING("You cause a short circuit in [target]'s [affected.name]!"))
|
||||
target.apply_damage(rand(5,10), BURN, affected)
|
||||
|
||||
/datum/surgery_step/robotics/fix_organ_robotic //For artificial organs
|
||||
/decl/surgery_step/robotics/fix_organ_robotic //For artificial organs
|
||||
name = "Repair robotic organ"
|
||||
allowed_tools = list(
|
||||
/obj/item/stack/nanopaste = 100,
|
||||
/obj/item/surgery/bonegel = 30,
|
||||
@@ -205,20 +221,19 @@
|
||||
min_duration = 70
|
||||
max_duration = 90
|
||||
|
||||
/datum/surgery_step/robotics/fix_organ_robotic/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(!ishuman(target))
|
||||
return
|
||||
/decl/surgery_step/robotics/fix_organ_robotic/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(!..())
|
||||
return FALSE
|
||||
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
if(!affected)
|
||||
return
|
||||
var/is_organ_damaged = 0
|
||||
for(var/obj/item/organ/I in affected.internal_organs)
|
||||
if(I.damage > 0 && I.robotic >= 2)
|
||||
is_organ_damaged = 1
|
||||
is_organ_damaged = TRUE
|
||||
break
|
||||
return is_organ_damaged && affected.open == (BP_IS_ROBOTIC(affected) ? 3 : 2)
|
||||
return is_organ_damaged && IS_ORGAN_FULLY_OPEN
|
||||
|
||||
/datum/surgery_step/robotics/fix_organ_robotic/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/robotics/fix_organ_robotic/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(!ishuman(target))
|
||||
return
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
@@ -232,7 +247,7 @@
|
||||
target.custom_pain("The pain in your [affected.name] is living hell!", 75)
|
||||
..()
|
||||
|
||||
/datum/surgery_step/robotics/fix_organ_robotic/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/robotics/fix_organ_robotic/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(!ishuman(target))
|
||||
return
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
@@ -241,7 +256,7 @@
|
||||
if(I && I.damage > 0)
|
||||
if(I.robotic >= 2)
|
||||
user.visible_message("<b>[user]</b> repairs [target]'s [I.name] with [tool].", \
|
||||
"<span class='notice'>You repair [target]'s [I.name] with [tool].</span>" )
|
||||
SPAN_NOTICE("You repair [target]'s [I.name] with [tool].") )
|
||||
I.damage = 0
|
||||
var/obj/item/organ/internal/brain/sponge = target.internal_organs_by_name[BP_BRAIN]
|
||||
if(sponge && istype(I, sponge))
|
||||
@@ -251,13 +266,13 @@
|
||||
nanopaste.use(1)
|
||||
return
|
||||
|
||||
/datum/surgery_step/robotics/fix_organ_robotic/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/robotics/fix_organ_robotic/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(!ishuman(target))
|
||||
return
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
|
||||
user.visible_message("<span class='warning'>[user]'s hand slips, gumming up the mechanisms inside of [target]'s [affected.name] with \the [tool]!</span>", \
|
||||
"<span class='warning'>Your hand slips, gumming up the mechanisms inside of [target]'s [affected.name] with \the [tool]!</span>")
|
||||
user.visible_message(SPAN_WARNING("[user]'s hand slips, gumming up the mechanisms inside of [target]'s [affected.name] with \the [tool]!"), \
|
||||
SPAN_WARNING("Your hand slips, gumming up the mechanisms inside of [target]'s [affected.name] with \the [tool]!"))
|
||||
|
||||
target.adjustToxLoss(5)
|
||||
target.apply_damage(5, BRUTE, target_zone, 0, tool, damage_flags = tool.damage_flags())
|
||||
@@ -266,7 +281,8 @@
|
||||
if(I)
|
||||
I.take_damage(rand(3,5),0)
|
||||
|
||||
/datum/surgery_step/robotics/detach_organ_robotic
|
||||
/decl/surgery_step/robotics/detach_organ_robotic
|
||||
name = "Detach robotic organ"
|
||||
allowed_tools = list(
|
||||
/obj/item/device/multitool = 100
|
||||
)
|
||||
@@ -274,12 +290,13 @@
|
||||
min_duration = 90
|
||||
max_duration = 110
|
||||
|
||||
/datum/surgery_step/robotics/detach_organ_robotic/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/robotics/detach_organ_robotic/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(!..())
|
||||
return FALSE
|
||||
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
if(!(affected && (affected.status & ORGAN_ROBOT)))
|
||||
return 0
|
||||
if(affected.open != 3)
|
||||
return 0
|
||||
if(affected.open != ORGAN_ENCASED_RETRACTED)
|
||||
return FALSE
|
||||
|
||||
target.op_stage.current_organ = null
|
||||
|
||||
@@ -291,30 +308,31 @@
|
||||
|
||||
var/organ_to_remove = input(user, "Which organ do you want to prepare for removal?") as null|anything in attached_organs
|
||||
if(!organ_to_remove)
|
||||
return 0
|
||||
return FALSE
|
||||
|
||||
target.op_stage.current_organ = organ_to_remove
|
||||
|
||||
return ..() && organ_to_remove
|
||||
return organ_to_remove
|
||||
|
||||
/datum/surgery_step/robotics/detach_organ_robotic/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/robotics/detach_organ_robotic/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
user.visible_message("<b>[user]</b> starts to decouple [target]'s [target.op_stage.current_organ] with \the [tool].", \
|
||||
SPAN_NOTICE("You start to decouple [target]'s [target.op_stage.current_organ] with \the [tool]." ))
|
||||
..()
|
||||
|
||||
/datum/surgery_step/robotics/detach_organ_robotic/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/robotics/detach_organ_robotic/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
user.visible_message("<b>[user]</b> has decoupled [target]'s [target.op_stage.current_organ] with \the [tool]." , \
|
||||
"<span class='notice'>You have decoupled [target]'s [target.op_stage.current_organ] with \the [tool].</span>")
|
||||
SPAN_NOTICE("You have decoupled [target]'s [target.op_stage.current_organ] with \the [tool]."))
|
||||
|
||||
var/obj/item/organ/I = target.internal_organs_by_name[target.op_stage.current_organ]
|
||||
if(I && istype(I))
|
||||
I.status |= ORGAN_CUT_AWAY
|
||||
|
||||
/datum/surgery_step/robotics/detach_organ_robotic/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
user.visible_message("<span class='warning'>[user]'s hand slips, disconnecting \the [tool].</span>", \
|
||||
"<span class='warning'>Your hand slips, disconnecting \the [tool].</span>")
|
||||
/decl/surgery_step/robotics/detach_organ_robotic/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
user.visible_message(SPAN_WARNING("[user]'s hand slips, disconnecting \the [tool]."), \
|
||||
SPAN_WARNING("Your hand slips, disconnecting \the [tool]."))
|
||||
|
||||
/datum/surgery_step/robotics/attach_organ_robotic
|
||||
/decl/surgery_step/robotics/attach_organ_robotic
|
||||
name = "Attach robotic organ"
|
||||
allowed_tools = list(
|
||||
/obj/item/screwdriver = 100
|
||||
)
|
||||
@@ -322,12 +340,13 @@
|
||||
min_duration = 100
|
||||
max_duration = 120
|
||||
|
||||
/datum/surgery_step/robotics/attach_organ_robotic/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/robotics/attach_organ_robotic/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(!..())
|
||||
return FALSE
|
||||
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
if(!(affected && (affected.status & ORGAN_ROBOT)))
|
||||
return 0
|
||||
if(affected.open != 3)
|
||||
return 0
|
||||
if(affected.open != ORGAN_ENCASED_RETRACTED)
|
||||
return FALSE
|
||||
|
||||
target.op_stage.current_organ = null
|
||||
|
||||
@@ -339,29 +358,30 @@
|
||||
|
||||
var/organ_to_replace = input(user, "Which organ do you want to reattach?") as null|anything in removable_organs
|
||||
if(!organ_to_replace)
|
||||
return 0
|
||||
return FALSE
|
||||
|
||||
target.op_stage.current_organ = organ_to_replace
|
||||
return ..()
|
||||
return TRUE
|
||||
|
||||
/datum/surgery_step/robotics/attach_organ_robotic/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/robotics/attach_organ_robotic/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
user.visible_message("<b>[user]</b> begins reattaching [target]'s [target.op_stage.current_organ] with \the [tool].", \
|
||||
SPAN_NOTICE("You start reattaching [target]'s [target.op_stage.current_organ] with \the [tool]."))
|
||||
..()
|
||||
|
||||
/datum/surgery_step/robotics/attach_organ_robotic/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/robotics/attach_organ_robotic/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
user.visible_message("<b>[user]</b> has reattached [target]'s [target.op_stage.current_organ] with \the [tool]." , \
|
||||
"<span class='notice'>You have reattached [target]'s [target.op_stage.current_organ] with \the [tool].</span>")
|
||||
SPAN_NOTICE("You have reattached [target]'s [target.op_stage.current_organ] with \the [tool]."))
|
||||
|
||||
var/obj/item/organ/I = target.internal_organs_by_name[target.op_stage.current_organ]
|
||||
if(I && istype(I))
|
||||
I.status &= ~ORGAN_CUT_AWAY
|
||||
|
||||
/datum/surgery_step/robotics/attach_organ_robotic/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
user.visible_message("<span class='warning'>[user]'s hand slips, disconnecting \the [tool].</span>", \
|
||||
"<span class='warning'>Your hand slips, disconnecting \the [tool].</span>")
|
||||
/decl/surgery_step/robotics/attach_organ_robotic/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
user.visible_message(SPAN_WARNING("[user]'s hand slips, disconnecting \the [tool]."), \
|
||||
SPAN_WARNING("Your hand slips, disconnecting \the [tool]."))
|
||||
|
||||
/datum/surgery_step/robotics/install_mmi
|
||||
/decl/surgery_step/robotics/install_mmi
|
||||
name = "Install MMI"
|
||||
allowed_tools = list(
|
||||
/obj/item/device/mmi = 100
|
||||
)
|
||||
@@ -369,54 +389,57 @@
|
||||
min_duration = 60
|
||||
max_duration = 80
|
||||
|
||||
/datum/surgery_step/robotics/install_mmi/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/robotics/install_mmi/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(!..())
|
||||
return FALSE
|
||||
|
||||
if(target_zone != BP_HEAD)
|
||||
return
|
||||
return FALSE
|
||||
|
||||
var/obj/item/device/mmi/M = tool
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
if(!(affected && affected.open == 3))
|
||||
return 0
|
||||
if(!(affected && affected.open == ORGAN_ENCASED_RETRACTED))
|
||||
return FALSE
|
||||
|
||||
if(!istype(M))
|
||||
return 0
|
||||
return FALSE
|
||||
|
||||
if(!M.brainmob || !M.brainmob.client || !M.brainmob.ckey || M.brainmob.stat >= DEAD)
|
||||
to_chat(user, "<span class='danger'>That brain is not usable.</span>")
|
||||
to_chat(user, SPAN_DANGER("That brain is not usable."))
|
||||
return SURGERY_FAILURE
|
||||
|
||||
if(!(affected.status & ORGAN_ROBOT))
|
||||
to_chat(user, "<span class='danger'>You cannot install a computer brain into a meat skull.</span>")
|
||||
if(!BP_IS_ROBOTIC(affected))
|
||||
to_chat(user, SPAN_DANGER("You cannot install a computer brain into a meat skull."))
|
||||
return SURGERY_FAILURE
|
||||
|
||||
if(!target.isSynthetic())
|
||||
to_chat(user, "<span class='danger'>You cannot install a computer brain into an organic body.</span>")
|
||||
to_chat(user, SPAN_DANGER("You cannot install a computer brain into an organic body."))
|
||||
return SURGERY_FAILURE
|
||||
|
||||
if(!target.species)
|
||||
to_chat(user, "<span class='danger'>You have no idea what species this person is. Report this on the bug tracker.</span>")
|
||||
to_chat(user, SPAN_DANGER("You have no idea what species this person is. Report this on the bug tracker."))
|
||||
return SURGERY_FAILURE
|
||||
|
||||
if(!target.species.has_organ[BP_BRAIN])
|
||||
to_chat(user, "<span class='danger'>You're pretty sure [target.species.name_plural] don't normally have a brain.</span>")
|
||||
to_chat(user, SPAN_DANGER("You're pretty sure [target.species.name_plural] don't normally have a brain."))
|
||||
return SURGERY_FAILURE
|
||||
|
||||
if(!isnull(target.internal_organs[BP_BRAIN]))
|
||||
to_chat(user, "<span class='danger'>Your subject already has a brain.</span>")
|
||||
to_chat(user, SPAN_DANGER("Your subject already has a brain."))
|
||||
return SURGERY_FAILURE
|
||||
|
||||
return 1
|
||||
return TRUE
|
||||
|
||||
/datum/surgery_step/robotics/install_mmi/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/robotics/install_mmi/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
user.visible_message("<b>[user]</b> starts installing \the [tool] into [target]'s [affected.name].", \
|
||||
SPAN_NOTICE("You start installing \the [tool] into [target]'s [affected.name]."))
|
||||
..()
|
||||
|
||||
/datum/surgery_step/robotics/install_mmi/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/robotics/install_mmi/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
user.visible_message("<b>[user]</b> has installed \the [tool] into [target]'s [affected.name].", \
|
||||
"<span class='notice'>You have installed \the [tool] into [target]'s [affected.name].</span>")
|
||||
SPAN_NOTICE("You have installed \the [tool] into [target]'s [affected.name]."))
|
||||
|
||||
var/obj/item/device/mmi/M = tool
|
||||
var/obj/item/organ/internal/mmi_holder/holder = new(target, 1)
|
||||
@@ -428,6 +451,6 @@
|
||||
if(M.brainmob && M.brainmob.mind)
|
||||
M.brainmob.mind.transfer_to(target)
|
||||
|
||||
/datum/surgery_step/robotics/install_mmi/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
user.visible_message("<span class='warning'>[user]'s hand slips.</span>", \
|
||||
"<span class='warning'>Your hand slips.</span>")
|
||||
/decl/surgery_step/robotics/install_mmi/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
user.visible_message(SPAN_WARNING("[user]'s hand slips."), \
|
||||
SPAN_WARNING("Your hand slips."))
|
||||
|
||||
@@ -2,13 +2,16 @@
|
||||
// SLIME CORE EXTRACTION //
|
||||
//////////////////////////////////////////////////////////////////
|
||||
|
||||
/datum/surgery_step/slime/is_valid_target(mob/living/carbon/slime/target)
|
||||
/decl/surgery_step/slime/is_valid_target(mob/living/carbon/slime/target)
|
||||
return istype(target, /mob/living/carbon/slime/)
|
||||
|
||||
/datum/surgery_step/slime/can_use(mob/living/user, mob/living/carbon/slime/target, target_zone, obj/item/tool)
|
||||
return target.stat == 2
|
||||
/decl/surgery_step/slime/can_use(mob/living/user, mob/living/carbon/slime/target, target_zone, obj/item/tool)
|
||||
if(!..())
|
||||
return FALSE
|
||||
return target.stat == DEAD
|
||||
|
||||
/datum/surgery_step/slime/cut_flesh
|
||||
/decl/surgery_step/slime/cut_flesh
|
||||
name = "Open Slime"
|
||||
allowed_tools = list(
|
||||
/obj/item/surgery/scalpel = 100,
|
||||
/obj/item/material/knife = 75,
|
||||
@@ -18,23 +21,24 @@
|
||||
min_duration = 10
|
||||
max_duration = 35
|
||||
|
||||
/datum/surgery_step/slime/cut_flesh/can_use(mob/living/user, mob/living/carbon/slime/target, target_zone, obj/item/tool)
|
||||
return ..() && istype(target) && target.core_removal_stage == 0
|
||||
/decl/surgery_step/slime/cut_flesh/can_use(mob/living/user, mob/living/carbon/slime/target, target_zone, obj/item/tool)
|
||||
return ..() && istype(target) && target.core_removal_stage == ORGAN_CLOSED
|
||||
|
||||
/datum/surgery_step/slime/cut_flesh/begin_step(mob/user, mob/living/carbon/slime/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/slime/cut_flesh/begin_step(mob/user, mob/living/carbon/slime/target, target_zone, obj/item/tool)
|
||||
user.visible_message("[user] starts cutting through [target]'s flesh with \the [tool].", \
|
||||
"You start cutting through [target]'s flesh with \the [tool].")
|
||||
|
||||
/datum/surgery_step/slime/cut_flesh/end_step(mob/living/user, mob/living/carbon/slime/target, target_zone, obj/item/tool)
|
||||
user.visible_message("<span class='notice'>[user] cuts through [target]'s flesh with \the [tool].</span>", \
|
||||
"<span class='notice'>You cut through [target]'s flesh with \the [tool], revealing its silky innards.</span>")
|
||||
target.core_removal_stage = 1
|
||||
/decl/surgery_step/slime/cut_flesh/end_step(mob/living/user, mob/living/carbon/slime/target, target_zone, obj/item/tool)
|
||||
user.visible_message(SPAN_NOTICE("[user] cuts through [target]'s flesh with \the [tool]."), \
|
||||
SPAN_NOTICE("You cut through [target]'s flesh with \the [tool], revealing its silky innards."))
|
||||
target.core_removal_stage = ORGAN_OPEN_INCISION
|
||||
|
||||
/datum/surgery_step/slime/cut_flesh/fail_step(mob/living/user, mob/living/carbon/slime/target, target_zone, obj/item/tool)
|
||||
user.visible_message("<span class='warning'>[user]'s hand slips, tearing [target]'s flesh with \the [tool]!</span>", \
|
||||
"<span class='warning'>Your hand slips, tearing [target]'s flesh with \the [tool]!</span>")
|
||||
/decl/surgery_step/slime/cut_flesh/fail_step(mob/living/user, mob/living/carbon/slime/target, target_zone, obj/item/tool)
|
||||
user.visible_message(SPAN_WARNING("[user]'s hand slips, tearing [target]'s flesh with \the [tool]!"), \
|
||||
SPAN_WARNING("Your hand slips, tearing [target]'s flesh with \the [tool]!"))
|
||||
|
||||
/datum/surgery_step/slime/cut_innards
|
||||
/decl/surgery_step/slime/cut_innards
|
||||
name = "Cut Innards"
|
||||
allowed_tools = list(
|
||||
/obj/item/surgery/scalpel = 100,
|
||||
/obj/item/material/knife = 75,
|
||||
@@ -44,23 +48,24 @@
|
||||
min_duration = 20
|
||||
max_duration = 45
|
||||
|
||||
/datum/surgery_step/slime/cut_innards/can_use(mob/living/user, mob/living/carbon/slime/target, target_zone, obj/item/tool)
|
||||
return ..() && istype(target) && target.core_removal_stage == 1
|
||||
/decl/surgery_step/slime/cut_innards/can_use(mob/living/user, mob/living/carbon/slime/target, target_zone, obj/item/tool)
|
||||
return ..() && istype(target) && target.core_removal_stage == ORGAN_OPEN_INCISION
|
||||
|
||||
/datum/surgery_step/slime/cut_innards/begin_step(mob/user, mob/living/carbon/slime/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/slime/cut_innards/begin_step(mob/user, mob/living/carbon/slime/target, target_zone, obj/item/tool)
|
||||
user.visible_message("[user] starts cutting [target]'s silky innards apart with \the [tool].", \
|
||||
"You start cutting [target]'s silky innards apart with \the [tool].")
|
||||
|
||||
/datum/surgery_step/slime/cut_innards/end_step(mob/living/user, mob/living/carbon/slime/target, target_zone, obj/item/tool)
|
||||
user.visible_message("<span class='notice'>[user] cuts [target]'s innards apart with \the [tool], exposing the cores.</span>", \
|
||||
"<span class='notice'>You cut [target]'s innards apart with \the [tool], exposing the cores.</span>")
|
||||
target.core_removal_stage = 2
|
||||
/decl/surgery_step/slime/cut_innards/end_step(mob/living/user, mob/living/carbon/slime/target, target_zone, obj/item/tool)
|
||||
user.visible_message(SPAN_NOTICE("[user] cuts [target]'s innards apart with \the [tool], exposing the cores."), \
|
||||
SPAN_NOTICE("You cut [target]'s innards apart with \the [tool], exposing the cores."))
|
||||
target.core_removal_stage = ORGAN_OPEN_RETRACTED
|
||||
|
||||
/datum/surgery_step/slime/cut_innards/fail_step(mob/living/user, mob/living/carbon/slime/target, target_zone, obj/item/tool)
|
||||
user.visible_message("<span class='warning'>[user]'s hand slips, tearing [target]'s innards with \the [tool]!</span>", \
|
||||
"<span class='warning'>Your hand slips, tearing [target]'s innards with \the [tool]!</span>")
|
||||
/decl/surgery_step/slime/cut_innards/fail_step(mob/living/user, mob/living/carbon/slime/target, target_zone, obj/item/tool)
|
||||
user.visible_message(SPAN_WARNING("[user]'s hand slips, tearing [target]'s innards with \the [tool]!"), \
|
||||
SPAN_WARNING("Your hand slips, tearing [target]'s innards with \the [tool]!"))
|
||||
|
||||
/datum/surgery_step/slime/saw_core
|
||||
/decl/surgery_step/slime/saw_core
|
||||
name = "Detach core"
|
||||
allowed_tools = list(
|
||||
/obj/item/surgery/circular_saw = 100, \
|
||||
/obj/item/material/hatchet = 75
|
||||
@@ -69,24 +74,24 @@
|
||||
min_duration = 35
|
||||
max_duration = 55
|
||||
|
||||
/datum/surgery_step/slime/saw_core/can_use(mob/living/user, mob/living/carbon/slime/target, target_zone, obj/item/tool)
|
||||
return ..() && (istype(target) && target.core_removal_stage == 2 && target.cores > 0) //This is being passed a human as target, unsure why.
|
||||
/decl/surgery_step/slime/saw_core/can_use(mob/living/user, mob/living/carbon/slime/target, target_zone, obj/item/tool)
|
||||
return ..() && (istype(target) && target.core_removal_stage == ORGAN_OPEN_RETRACTED && target.cores > 0) //This is being passed a human as target, unsure why.
|
||||
|
||||
/datum/surgery_step/slime/saw_core/begin_step(mob/user, mob/living/carbon/slime/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/slime/saw_core/begin_step(mob/user, mob/living/carbon/slime/target, target_zone, obj/item/tool)
|
||||
user.visible_message("[user] starts cutting out one of [target]'s cores with \the [tool].", \
|
||||
"You start cutting out one of [target]'s cores with \the [tool].")
|
||||
|
||||
/datum/surgery_step/slime/saw_core/end_step(mob/living/user, mob/living/carbon/slime/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/slime/saw_core/end_step(mob/living/user, mob/living/carbon/slime/target, target_zone, obj/item/tool)
|
||||
target.cores--
|
||||
user.visible_message("<span class='notice'>[user] cuts out one of [target]'s cores with \the [tool].</span>",, \
|
||||
"<span class='notice'>You cut out one of [target]'s cores with \the [tool]. [target.cores] cores left.</span>")
|
||||
user.visible_message(SPAN_NOTICE("[user] cuts out one of [target]'s cores with \the [tool]."),, \
|
||||
SPAN_NOTICE("You cut out one of [target]'s cores with \the [tool]. [target.cores] cores left."))
|
||||
|
||||
if(target.cores >= 0)
|
||||
new target.coretype(target.loc)
|
||||
if(target.cores <= 0)
|
||||
if(target.cores < 0)
|
||||
target.icon_state = "[target.colour] baby slime dead-nocore"
|
||||
|
||||
|
||||
/datum/surgery_step/slime/saw_core/fail_step(mob/living/user, mob/living/carbon/slime/target, target_zone, obj/item/tool)
|
||||
user.visible_message("<span class='warning'>[user]'s hand slips, causing \him to miss the core!</span>", \
|
||||
"<span class='warning'>Your hand slips, causing you to miss the core!</span>")
|
||||
/decl/surgery_step/slime/saw_core/fail_step(mob/living/user, mob/living/carbon/slime/target, target_zone, obj/item/tool)
|
||||
user.visible_message(SPAN_WARNING("[user]'s hand slips, causing \him to miss the core!"), \
|
||||
SPAN_WARNING("Your hand slips, causing you to miss the core!"))
|
||||
@@ -1,6 +1,7 @@
|
||||
/* SURGERY STEPS */
|
||||
|
||||
/datum/surgery_step
|
||||
/decl/surgery_step
|
||||
var/name
|
||||
var/priority = 0 //steps with higher priority would be attempted first
|
||||
|
||||
// type path referencing tools that can be used for this step, and how well are they suited for it
|
||||
@@ -14,41 +15,43 @@
|
||||
var/max_duration = 0
|
||||
|
||||
// evil infection stuff that will make everyone hate me
|
||||
var/can_infect = 0
|
||||
var/can_infect = FALSE
|
||||
//How much blood this step can get on surgeon. 1 - hands, 2 - full body.
|
||||
var/blood_level = 0
|
||||
|
||||
//returns how well tool is suited for this step
|
||||
/datum/surgery_step/proc/tool_quality(obj/item/tool)
|
||||
/decl/surgery_step/proc/tool_quality(obj/item/tool)
|
||||
for(var/T in allowed_tools)
|
||||
if(istype(tool,T))
|
||||
return allowed_tools[T]
|
||||
return 0
|
||||
return FALSE
|
||||
|
||||
// Checks if this step applies to the user mob at all
|
||||
/datum/surgery_step/proc/is_valid_target(mob/living/carbon/human/target)
|
||||
/decl/surgery_step/proc/is_valid_target(mob/living/carbon/human/target)
|
||||
if(!ishuman(target))
|
||||
return 0
|
||||
return FALSE
|
||||
|
||||
if(allowed_species)
|
||||
for(var/species in allowed_species)
|
||||
if(target.species.get_bodytype() == species)
|
||||
return 1
|
||||
return TRUE
|
||||
|
||||
if(disallowed_species)
|
||||
for(var/species in disallowed_species)
|
||||
if(target.species.get_bodytype() == species)
|
||||
return 0
|
||||
return FALSE
|
||||
|
||||
return 1
|
||||
return TRUE
|
||||
|
||||
|
||||
// checks whether this step can be applied with the given user and target
|
||||
/datum/surgery_step/proc/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
return 0
|
||||
/decl/surgery_step/proc/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(!ishuman(target))
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
// does stuff to begin the step, usually just printing messages. Moved germs transfering and bloodying here too
|
||||
/datum/surgery_step/proc/begin_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/proc/begin_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
if(can_infect && affected)
|
||||
spread_germs_to_organ(affected, user)
|
||||
@@ -61,16 +64,16 @@
|
||||
return
|
||||
|
||||
// does stuff to end the step, which is normally print a message + do whatever this step changes
|
||||
/datum/surgery_step/proc/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
return
|
||||
/decl/surgery_step/proc/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
return FALSE
|
||||
|
||||
// stuff that happens when the step fails
|
||||
/datum/surgery_step/proc/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
/decl/surgery_step/proc/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
return null
|
||||
|
||||
proc/spread_germs_to_organ(var/obj/item/organ/external/E, var/mob/living/carbon/human/user)
|
||||
if(!istype(user) || !istype(E))
|
||||
return
|
||||
return FALSE
|
||||
|
||||
var/germ_level = user.germ_level
|
||||
if(user.gloves)
|
||||
@@ -78,44 +81,59 @@ proc/spread_germs_to_organ(var/obj/item/organ/external/E, var/mob/living/carbon/
|
||||
|
||||
E.germ_level = max(germ_level,E.germ_level) //as funny as scrubbing microbes out with clean gloves is - no.
|
||||
|
||||
proc/do_surgery(mob/living/carbon/M, mob/living/user, obj/item/tool, var/autofail = FALSE)
|
||||
if(!istype(M))
|
||||
return 0
|
||||
if (user.a_intent == I_HURT) //check for Hippocratic Oath
|
||||
return 0
|
||||
/proc/do_surgery(mob/living/carbon/M, mob/living/user, obj/item/tool, var/autofail = FALSE)
|
||||
// Check for the Hippocratic oath.
|
||||
if(!istype(M) || user.a_intent != I_HELP)
|
||||
return FALSE
|
||||
// Check for multi-surgery drifting.
|
||||
var/zone = user.zone_sel.selecting
|
||||
if(zone in M.op_stage.in_progress) //Can't operate on someone repeatedly.
|
||||
to_chat(user, "<span class='warning'>You can't operate on this area while surgery is already in progress.</span>")
|
||||
return 1
|
||||
for(var/datum/surgery_step/S in surgery_steps)
|
||||
//check if tool is right or close enough and if this step is possible
|
||||
if(S.tool_quality(tool))
|
||||
var/step_is_valid = S.can_use(user, M, zone, tool)
|
||||
if(step_is_valid && S.is_valid_target(M))
|
||||
if(step_is_valid == SURGERY_FAILURE) // This is a failure that already has a message for failing.
|
||||
return 1
|
||||
M.op_stage.in_progress += zone
|
||||
S.begin_step(user, M, zone, tool) //start on it
|
||||
//The surface we're working on is shoddy, so we make a mistake
|
||||
if(autofail)
|
||||
S.fail_step(user, M, zone, tool)
|
||||
//We had proper tools! (or RNG smiled.) and user did not move or change hands.
|
||||
else if(prob(S.tool_quality(tool)) && do_mob(user, M, rand(S.min_duration, S.max_duration)))
|
||||
S.end_step(user, M, zone, tool) //finish successfully
|
||||
else if ((tool in user.contents) && user.Adjacent(M)) //or
|
||||
S.fail_step(user, M, zone, tool) //malpractice~
|
||||
else // This failing silently was a pain.
|
||||
to_chat(user, "<span class='warning'>You must remain close to your patient to conduct surgery.</span>")
|
||||
M.op_stage.in_progress -= zone // Clear the in-progress flag.
|
||||
if (ishuman(M))
|
||||
if(zone in M.op_stage.in_progress)
|
||||
to_chat(user, SPAN_WARNING("You can't operate on this area while surgery is already in progress."))
|
||||
return TRUE
|
||||
|
||||
// What surgeries does our tool/target enable?
|
||||
var/list/possible_surgeries
|
||||
var/list/all_surgeries = decls_repository.get_decls_of_subtype(/decl/surgery_step)
|
||||
for(var/decl in all_surgeries)
|
||||
var/decl/surgery_step/S = all_surgeries[decl]
|
||||
if(S.tool_quality(tool) && S.can_use(user, M, zone, tool))
|
||||
LAZYSET(possible_surgeries, S, TRUE)
|
||||
|
||||
// Which surgery, if any, do we actually want to do?
|
||||
var/decl/surgery_step/S
|
||||
if(LAZYLEN(possible_surgeries) == 1)
|
||||
S = possible_surgeries[1]
|
||||
else if(LAZYLEN(possible_surgeries) >= 1)
|
||||
if(user.client) // In case of future autodocs.
|
||||
S = input(user, "Which surgery would you like to perform?", "Surgery") as null|anything in possible_surgeries
|
||||
|
||||
// We didn't find a surgery, or decided not to perform one.
|
||||
if(!istype(S))
|
||||
to_chat(user, SPAN_WARNING("You aren't sure what you could do to \the [M] with \the [tool]."))
|
||||
return TRUE
|
||||
|
||||
// Otherwise we can make a start on surgery!
|
||||
else if(istype(M) && !QDELETED(M) && user.a_intent == I_HELP && user.get_active_hand() == tool)
|
||||
// Double-check this in case it changed between initial check and now.
|
||||
if(zone in M.op_stage.in_progress)
|
||||
to_chat(user, SPAN_WARNING("You can't operate on this area while surgery is already in progress."))
|
||||
else if(S.is_valid_target(M))
|
||||
M.op_stage.in_progress += zone
|
||||
S.begin_step(user, M, zone, tool)
|
||||
var/duration = rand(S.min_duration, S.max_duration)
|
||||
if(prob(S.tool_quality(tool)) && do_mob(user, M, duration))
|
||||
S.end_step(user, M, zone, tool)
|
||||
else if ((tool in user.contents) && user.Adjacent(M))
|
||||
S.fail_step(user, M, zone, tool)
|
||||
else
|
||||
to_chat(user, SPAN_WARNING("You must remain close to your patient to conduct surgery."))
|
||||
if(!QDELETED(M))
|
||||
M.op_stage.in_progress -= zone
|
||||
if(ishuman(M))
|
||||
var/mob/living/carbon/human/H = M
|
||||
H.update_surgery()
|
||||
return 1 //don't want to do weapony things after surgery
|
||||
|
||||
if (user.a_intent == I_HELP)
|
||||
to_chat(user, "<span class='warning'>You can't see any useful way to use \the [tool] on [M].</span>")
|
||||
//not returning 1 so people and borgs can still use things, like syringes and hyposprays, while their patients are on the table
|
||||
return 0
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/datum/surgery_status/
|
||||
var/eyes = 0
|
||||
|
||||
@@ -1 +1,16 @@
|
||||
#undef SURGERY_FAILURE
|
||||
#undef ORGAN_CLOSED
|
||||
#undef ORGAN_OPEN_INCISION
|
||||
#undef ORGAN_OPEN_RETRACTED
|
||||
#undef ORGAN_ENCASED_OPEN
|
||||
#undef ORGAN_ENCASED_RETRACTED
|
||||
#undef FACE_NORMAL
|
||||
#undef FACE_CUT_OPEN
|
||||
#undef FACE_RETRACTED
|
||||
#undef FACE_ALTERED
|
||||
#undef IS_ORGAN_FULLY_OPEN
|
||||
#undef BONE_PRE_OP
|
||||
#undef BONE_GLUED
|
||||
#undef BONE_SET
|
||||
#undef CAVITY_OPEN
|
||||
#undef CAVITY_CLOSED
|
||||
Reference in New Issue
Block a user