Merge branch 'master' of https://github.com/ParadiseSS13/Paradise into slime_fancy_stuff

This commit is contained in:
Crazylemon64
2016-03-05 02:55:00 -08:00
495 changed files with 16276 additions and 10446 deletions
+122 -81
View File
@@ -2,8 +2,36 @@
//////////////////////////////////////////////////////////////////
// BONE SURGERY //
//////////////////////////////////////////////////////////////////
///Surgery Datums
/datum/surgery/bone_repair
name = "bone repair"
steps = list(/datum/surgery_step/generic/cut_open, /datum/surgery_step/generic/clamp_bleeders, /datum/surgery_step/generic/retract_skin, /datum/surgery_step/glue_bone, /datum/surgery_step/set_bone, /datum/surgery_step/finish_bone, /datum/surgery_step/generic/cauterize)
possible_locs = list("chest", "l_arm", "l_hand", "r_arm", "r_hand","r_leg", "r_foot", "l_leg", "l_foot", "groin")
/datum/surgery/bone_repair/skull
name = "bone repair"
steps = list(/datum/surgery_step/generic/cut_open, /datum/surgery_step/generic/clamp_bleeders, /datum/surgery_step/generic/retract_skin, /datum/surgery_step/glue_bone, /datum/surgery_step/mend_skull, /datum/surgery_step/finish_bone, /datum/surgery_step/generic/cauterize)
possible_locs = list("head")
/datum/surgery/bone_repair/can_start(mob/user, mob/living/carbon/target)
if(istype(target,/mob/living/carbon/human))
var/mob/living/carbon/human/H = target
var/obj/item/organ/external/affected = H.get_organ(user.zone_sel.selecting)
if(affected && (affected.status & ORGAN_ROBOT))
return 0
if(affected && (affected.status & ORGAN_BROKEN))
return 1
if(target.get_species() == "Machine")
return 0
if(target.get_species() == "Diona")
return 0
return 1
//surgery steps
/datum/surgery_step/glue_bone
name = "mend bone"
allowed_tools = list(
/obj/item/weapon/bonegel = 100, \
/obj/item/weapon/screwdriver = 75
@@ -11,102 +39,113 @@
can_infect = 1
blood_level = 1
min_duration = 50
max_duration = 60
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
/datum/surgery_step/glue_bone/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_ROBOT) && !(affected.cannot_break) && affected.open == 2 && affected.stage == 0
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)
user.visible_message("[user] starts applying medication to the damaged bones in [target]'s [affected.name] with \the [tool]." , \
"You start applying medication to the damaged bones in [target]'s [affected.name] with \the [tool].")
target.custom_pain("Something in your [affected.name] is causing you a lot of pain!",1)
..()
/datum/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)
user.visible_message("[user] starts applying medication to the damaged bones in [target]'s [affected.name] with \the [tool]." , \
"You start applying medication to the damaged bones in [target]'s [affected.name] with \the [tool].")
target.custom_pain("Something in your [affected.name] is causing you a lot of pain!",1)
..()
end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
/datum/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("\blue [user] applies some [tool] to [target]'s bone in [affected.name]", \
"\blue You apply some [tool] to [target]'s bone in [affected.name] with \the [tool].")
user.visible_message("<span class='notice'> [user] applies some [tool] to [target]'s bone in [affected.name]</span>", \
"<span class='notice'> You apply some [tool] to [target]'s bone in [affected.name] with \the [tool].</span>")
affected.stage = 1
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
return 1
/datum/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("\red [user]'s hand slips, smearing [tool] in the incision in [target]'s [affected.name]!" , \
"\red Your hand slips, smearing [tool] in the incision in [target]'s [affected.name]!")
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>")
return 0
/datum/surgery_step/set_bone
name = "set bone"
allowed_tools = list(
/obj/item/weapon/bonesetter = 100, \
/obj/item/weapon/wrench = 75 \
)
min_duration = 60
max_duration = 70
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_ROBOT) && affected.limb_name != "head" && affected.open == 2 && affected.stage == 1
/datum/surgery_step/set_bone/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_ROBOT) && affected.limb_name != "head" && affected.open == 2 && affected.stage == 1
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/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)
..()
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("\blue [user] sets the bone in [target]'s [affected.name] in place with \the [tool].", \
"\blue You set the bone in [target]'s [affected.name] in place with \the [tool].")
affected.stage = 2
else
user.visible_message("\blue [user] sets the bone in [target]'s [affected.name]\red in the WRONG place with \the [tool].", \
"\blue You set the bone in [target]'s [affected.name]\red in the WRONG place with \the [tool].")
affected.fracture()
/datum/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("<span class='notice'> [user] sets the bone in [target]'s [affected.name] in place with \the [tool].</span>", \
"<span class='notice'> You set the bone in [target]'s [affected.name] in place with \the [tool].</span>")
affected.stage = 2
return 1
else
user.visible_message("<span class='notice'> [user] sets the bone in [target]'s [affected.name] in place with \the [tool].</span>", \
"<span class='notice'> You set the bone in [target]'s [affected.name] in place with \the [tool].</span>")
return 1
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("\red [user]'s hand slips, damaging the bone in [target]'s [affected.name] with \the [tool]!" , \
"\red Your hand slips, damaging the bone in [target]'s [affected.name] with \the [tool]!")
affected.createwound(BRUISE, 5)
/datum/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>")
affected.createwound(BRUISE, 5)
return 0
/datum/surgery_step/mend_skull
name = "mend skull"
allowed_tools = list(
/obj/item/weapon/bonesetter = 100, \
/obj/item/weapon/wrench = 75 \
)
min_duration = 60
max_duration = 70
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_ROBOT) && affected.limb_name == "head" && affected.open == 2 && affected.stage == 1
/datum/surgery_step/mend_skull/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_ROBOT) && affected.limb_name == "head" && affected.open == 2 && affected.stage == 1
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message("[user] is beginning piece together [target]'s skull with \the [tool]." , \
"You are beginning piece together [target]'s skull with \the [tool].")
..()
/datum/surgery_step/mend_skull/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message("[user] is beginning piece together [target]'s skull with \the [tool]." , \
"You are beginning piece together [target]'s skull with \the [tool].")
..()
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("\blue [user] sets [target]'s skull with \the [tool]." , \
"\blue You set [target]'s skull with \the [tool].")
affected.stage = 2
/datum/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("<span class='notice'> [user] sets [target]'s skull with \the [tool].</span>" , \
"<span class='notice'> You set [target]'s skull with \the [tool].</span>")
affected.stage = 2
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("\red [user]'s hand slips, damaging [target]'s face with \the [tool]!" , \
"\red Your hand slips, damaging [target]'s face with \the [tool]!")
var/obj/item/organ/external/head/h = affected
h.createwound(BRUISE, 10)
h.disfigured = 1
return 1
/datum/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>")
var/obj/item/organ/external/head/h = affected
h.createwound(BRUISE, 10)
h.disfigured = 1
return 0
/datum/surgery_step/finish_bone
name = "medicate bones"
allowed_tools = list(
/obj/item/weapon/bonegel = 100, \
/obj/item/weapon/screwdriver = 75
@@ -114,29 +153,31 @@
can_infect = 1
blood_level = 1
min_duration = 50
max_duration = 60
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_ROBOT) && affected.open == 2 && affected.stage == 2
/datum/surgery_step/finish_bone/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_ROBOT) && affected.open == 2 && affected.stage == 2
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/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].")
..()
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("\blue [user] has mended the damaged bones in [target]'s [affected.name] with \the [tool]." , \
"\blue 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.perma_injury = 0
/datum/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("<span class='notice'> [user] has mended the damaged bones in [target]'s [affected.name] with \the [tool].</span>" , \
"<span class='notice'> You have mended the damaged bones in [target]'s [affected.name] with \the [tool].</span>" )
affected.status &= ~ORGAN_BROKEN
affected.status &= ~ORGAN_SPLINTED
affected.stage = 0
affected.perma_injury = 0
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("\red [user]'s hand slips, smearing [tool] in the incision in [target]'s [affected.name]!" , \
"\red Your hand slips, smearing [tool] in the incision in [target]'s [affected.name]!")
return 1
/datum/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>")
return 0
+139 -127
View File
@@ -6,214 +6,226 @@
priority = 2
can_infect = 1
blood_level = 1
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (!hasorgans(target))
return 0
/datum/surgery_step/open_encased/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
return affected && !(affected.status & ORGAN_ROBOT) && affected.encased && affected.open >= 2
if (!hasorgans(target))
return 0
var/obj/item/organ/external/affected = target.get_organ(target_zone)
return affected && !(affected.status & ORGAN_ROBOT) && affected.encased && affected.open >= 2
/datum/surgery_step/open_encased/saw
name = "saw bone"
allowed_tools = list(
/obj/item/weapon/circular_saw = 100, \
/obj/item/weapon/melee/energy/sword/cyborg/saw = 100, \
/obj/item/weapon/hatchet = 75
)
min_duration = 50
max_duration = 70
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (!hasorgans(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
return ..() && affected && affected.open == 2
/datum/surgery_step/open_encased/saw/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
if (!hasorgans(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
return ..() && affected && affected.open == 2
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
/datum/surgery_step/open_encased/saw/begin_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
if (!hasorgans(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
if (!hasorgans(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("[user] begins to cut through [target]'s [affected.encased] with \the [tool].", \
"You begin to cut through [target]'s [affected.encased] with \the [tool].")
target.custom_pain("Something hurts horribly in your [affected.name]!",1)
..()
user.visible_message("[user] begins to cut through [target]'s [affected.encased] with \the [tool].", \
"You begin to cut through [target]'s [affected.encased] with \the [tool].")
target.custom_pain("Something hurts horribly in your [affected.name]!",1)
..()
end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
/datum/surgery_step/open_encased/saw/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
if (!hasorgans(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
if (!hasorgans(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("\blue [user] has cut [target]'s [affected.encased] open with \the [tool].", \
"\blue You have cut [target]'s [affected.encased] open with \the [tool].")
affected.open = 2.5
user.visible_message("<span class='notice'> [user] has cut [target]'s [affected.encased] open with \the [tool].</span>", \
"<span class='notice'> You have cut [target]'s [affected.encased] open with \the [tool].</span>")
affected.open = 2.5
return 1
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
/datum/surgery_step/open_encased/saw/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
if (!hasorgans(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
if (!hasorgans(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("\red [user]'s hand slips, cracking [target]'s [affected.encased] with \the [tool]!" , \
"\red Your hand slips, cracking [target]'s [affected.encased] with \the [tool]!" )
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>" )
affected.createwound(CUT, 20)
affected.fracture()
affected.createwound(CUT, 20)
affected.fracture()
return 0
/datum/surgery_step/open_encased/retract
name = "retract bone"
allowed_tools = list(
/obj/item/weapon/scalpel/manager = 120, \
/obj/item/weapon/retractor = 100, \
/obj/item/weapon/crowbar = 75
)
min_duration = 30
max_duration = 40
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (!hasorgans(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
return ..() && affected && affected.open == 2.5
/datum/surgery_step/open_encased/retract/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
if (!hasorgans(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
return ..() && affected && affected.open == 2.5
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
/datum/surgery_step/open_encased/retract/begin_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
if (!hasorgans(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
if (!hasorgans(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
var/msg = "[user] starts to force open the [affected.encased] in [target]'s [affected.name] with \the [tool]."
var/self_msg = "You start to force open the [affected.encased] in [target]'s [affected.name] with \the [tool]."
user.visible_message(msg, self_msg)
target.custom_pain("Something hurts horribly in your [affected.name]!",1)
..()
var/msg = "[user] starts to force open the [affected.encased] in [target]'s [affected.name] with \the [tool]."
var/self_msg = "You start to force open the [affected.encased] in [target]'s [affected.name] with \the [tool]."
user.visible_message(msg, self_msg)
target.custom_pain("Something hurts horribly in your [affected.name]!",1)
..()
end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
/datum/surgery_step/open_encased/retract/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
if (!hasorgans(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
if (!hasorgans(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
var/msg = "\blue [user] forces open [target]'s [affected.encased] with \the [tool]."
var/self_msg = "\blue You force open [target]'s [affected.encased] with \the [tool]."
user.visible_message(msg, self_msg)
var/msg = "<span class='notice'> [user] forces open [target]'s [affected.encased] with \the [tool].</span>"
var/self_msg = "<span class='notice'> You force open [target]'s [affected.encased] with \the [tool].</span>"
user.visible_message(msg, self_msg)
affected.open = 3
affected.open = 3
// Whoops!
if(prob(10))
affected.fracture()
// Whoops!
if(prob(10) && !isrobot(user))
affected.fracture()//WTF WHY?!
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
return 1
if (!hasorgans(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
/datum/surgery_step/open_encased/retract/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
var/msg = "\red [user]'s hand slips, cracking [target]'s [affected.encased]!"
var/self_msg = "\red Your hand slips, cracking [target]'s [affected.encased]!"
user.visible_message(msg, self_msg)
if (!hasorgans(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
affected.createwound(BRUISE, 20)
affected.fracture()
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>"
user.visible_message(msg, self_msg)
affected.createwound(BRUISE, 20)
affected.fracture()
return 0
/datum/surgery_step/open_encased/close
name = "unretract bone" //i suck at names okay? give me a new one
allowed_tools = list(
/obj/item/weapon/scalpel/manager = 120, \
/obj/item/weapon/retractor = 100, \
/obj/item/weapon/crowbar = 75
)
min_duration = 20
max_duration = 40
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
/datum/surgery_step/open_encased/close/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
if (!hasorgans(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
return ..() && affected && affected.open == 3
if (!hasorgans(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
return ..() && affected && affected.open == 3
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
/datum/surgery_step/open_encased/close/begin_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
if (!hasorgans(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
if (!hasorgans(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
var/msg = "[user] starts bending [target]'s [affected.encased] back into place with \the [tool]."
var/self_msg = "You start bending [target]'s [affected.encased] back into place with \the [tool]."
user.visible_message(msg, self_msg)
target.custom_pain("Something hurts horribly in your [affected.name]!",1)
..()
var/msg = "[user] starts bending [target]'s [affected.encased] back into place with \the [tool]."
var/self_msg = "You start bending [target]'s [affected.encased] back into place with \the [tool]."
user.visible_message(msg, self_msg)
target.custom_pain("Something hurts horribly in your [affected.name]!",1)
..()
end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
/datum/surgery_step/open_encased/close/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
if (!hasorgans(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
if (!hasorgans(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
var/msg = "\blue [user] bends [target]'s [affected.encased] back into place with \the [tool]."
var/self_msg = "\blue You bend [target]'s [affected.encased] back into place with \the [tool]."
user.visible_message(msg, self_msg)
var/msg = "<span class='notice'> [user] bends [target]'s [affected.encased] back into place with \the [tool].</span>"
var/self_msg = "<span class='notice'> You bend [target]'s [affected.encased] back into place with \the [tool].</span>"
user.visible_message(msg, self_msg)
affected.open = 2.5
affected.open = 2.5
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
return 1
if (!hasorgans(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
/datum/surgery_step/open_encased/close/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
var/msg = "\red [user]'s hand slips, bending [target]'s [affected.encased] the wrong way!"
var/self_msg = "\red Your hand slips, bending [target]'s [affected.encased] the wrong way!"
user.visible_message(msg, self_msg)
if (!hasorgans(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
affected.createwound(BRUISE, 20)
affected.fracture()
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>"
user.visible_message(msg, self_msg)
/*if (prob(40)) //TODO: ORGAN REMOVAL UPDATE.
user.visible_message("\red A rib pierces the lung!")
target.rupture_lung()*/
affected.createwound(BRUISE, 20)
affected.fracture()
return 0
/datum/surgery_step/open_encased/mend
name = "mend bone"
allowed_tools = list(
/obj/item/weapon/bonegel = 100, \
/obj/item/weapon/screwdriver = 75
)
min_duration = 20
max_duration = 40
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
/datum/surgery_step/open_encased/mend/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
if (!hasorgans(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
return ..() && affected && affected.open == 2.5
if (!hasorgans(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
return ..() && affected && affected.open == 2.5
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
/datum/surgery_step/open_encased/mend/begin_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
if (!hasorgans(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
if (!hasorgans(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
var/msg = "[user] starts applying \the [tool] to [target]'s [affected.encased]."
var/self_msg = "You start applying \the [tool] to [target]'s [affected.encased]."
user.visible_message(msg, self_msg)
target.custom_pain("Something hurts horribly in your [affected.name]!",1)
..()
var/msg = "[user] starts applying \the [tool] to [target]'s [affected.encased]."
var/self_msg = "You start applying \the [tool] to [target]'s [affected.encased]."
user.visible_message(msg, self_msg)
target.custom_pain("Something hurts horribly in your [affected.name]!",1)
..()
end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
/datum/surgery_step/open_encased/mend/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
if (!hasorgans(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
if (!hasorgans(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
var/msg = "\blue [user] applied \the [tool] to [target]'s [affected.encased]."
var/self_msg = "\blue You applied \the [tool] to [target]'s [affected.encased]."
user.visible_message(msg, self_msg)
var/msg = "<span class='notice'> [user] applied \the [tool] to [target]'s [affected.encased].</span>"
var/self_msg = "<span class='notice'> You applied \the [tool] to [target]'s [affected.encased].</span>"
user.visible_message(msg, self_msg)
affected.open = 2
affected.open = 2
return 1
+95 -57
View File
@@ -2,138 +2,176 @@
//////////////////////////////////////////////////////////////////
// FACE SURGERY //
//////////////////////////////////////////////////////////////////
/datum/surgery/plastic_surgery
name = "face repair"
steps = list(/datum/surgery_step/generic/cut_face, /datum/surgery_step/generic/retract_skin, /datum/surgery_step/face/mend_vocal, /datum/surgery_step/face/fix_face,/datum/surgery_step/face/cauterize)
possible_locs = list("head")
/datum/surgery/plastic_surgery/can_start(mob/user, mob/living/carbon/target)
if(istype(target,/mob/living/carbon/human))
var/mob/living/carbon/human/H = target
var/obj/item/organ/external/affected = H.get_organ(user.zone_sel.selecting)
if(affected && (affected.status & ORGAN_ROBOT))
return 0
if((target.get_species() == "Machine"))
return 0
return 1
/datum/surgery_step/face
priority = 2
can_infect = 0
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (!hasorgans(target))
return 0
var/obj/item/organ/external/affected = target.get_organ(target_zone)
if (!affected || (affected.status & ORGAN_ROBOT))
return 0
return target_zone == "mouth"
/datum/surgery_step/face/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
if (!hasorgans(target))
return 0
var/obj/item/organ/external/affected = target.get_organ(target_zone)
if (!affected || (affected.status & ORGAN_ROBOT))
return 0
return target_zone == "mouth"
/datum/surgery_step/generic/cut_face
name = "make incision"
allowed_tools = list(
/obj/item/weapon/scalpel/laser3 = 115, \
/obj/item/weapon/scalpel/laser2 = 110, \
/obj/item/weapon/scalpel/laser1 = 105, \
/obj/item/weapon/scalpel/manager = 120, \
/obj/item/weapon/scalpel = 100, \
/obj/item/weapon/kitchen/knife = 75, \
/obj/item/weapon/shard = 50, \
)
min_duration = 90
max_duration = 110
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
return ..() && target_zone == "mouth" && target.op_stage.face == 0
/datum/surgery_step/generic/cut_face/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
return ..() && target_zone == "mouth" //&& target.op_stage.face == 0//I NEED TO REPLACE THE OPSTAGE SHIT!
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
/datum/surgery_step/generic/cut_face/begin_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
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].")
..()
end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message("\blue [user] has cut open [target]'s face and neck with \the [tool]." , \
"\blue You have cut open [target]'s face and neck with \the [tool].",)
target.op_stage.face = 1
/datum/surgery_step/generic/cut_face/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
user.visible_message("<span class='notice'> [user] has cut open [target]'s face and neck with \the [tool].</span>" , \
"<span class='notice'> You have cut open [target]'s face and neck with \the [tool].</span>",)
//target.op_stage.face = 1//DID I MENTION I NEED TO REPLACE THE OPSTAGE SHIT!
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
return 1
/datum/surgery_step/generic/cut_face/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("\red [user]'s hand slips, slicing [target]'s throat wth \the [tool]!" , \
"\red Your hand slips, slicing [target]'s throat wth \the [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>" )
affected.createwound(CUT, 60)
target.losebreath += 4
return 0
/datum/surgery_step/face/mend_vocal
name = "mend vocal cords"
allowed_tools = list(
/obj/item/weapon/scalpel/manager = 120, \
/obj/item/weapon/hemostat = 100, \
/obj/item/stack/cable_coil = 75, \
/obj/item/device/assembly/mousetrap = 10 //I don't know. Don't ask me. But I'm leaving it because hilarity.
)
min_duration = 70
max_duration = 90
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
return ..() && target.op_stage.face == 1
/datum/surgery_step/face/mend_vocal/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
return ..()// && target.op_stage.face == 1 //NO REALLY NED TO REPLACE, MAYBE WITH FUCKING istype(S.get_surgery_step(), /datum/surgery_step/cut_face)) OR SOMETHING
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
/datum/surgery_step/face/mend_vocal/begin_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
user.visible_message("[user] starts mending [target]'s vocal cords with \the [tool].", \
"You start mending [target]'s vocal cords with \the [tool].")
..()
end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message("\blue [user] mends [target]'s vocal cords with \the [tool].", \
"\blue You mend [target]'s vocal cords with \the [tool].")
target.op_stage.face = 2
/datum/surgery_step/face/mend_vocal/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
user.visible_message("<span class='notice'> [user] mends [target]'s vocal cords with \the [tool].</span>", \
"<span class='notice'> You mend [target]'s vocal cords with \the [tool].</span>")
//target.op_stage.face = 2//I NEED TO REPLACE THE OPSTAGE SHIT!
return 1
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message("\red [user]'s hand slips, clamping [target]'s trachea shut for a moment with \the [tool]!", \
"\red Your hand slips, clamping [user]'s trachea shut for a moment with \the [tool]!")
/datum/surgery_step/face/mend_vocal/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
user.visible_message("<span class='warning'> [user]'s hand slips, clamping [target]'s trachea shut for a moment with \the [tool]!</span>", \
"<span class='warning'> Your hand slips, clamping [user]'s trachea shut for a moment with \the [tool]!</span>")
target.losebreath += 4
return 0
/datum/surgery_step/face/fix_face
name = "reshape face"
allowed_tools = list(
/obj/item/weapon/scalpel/manager = 120, \
/obj/item/weapon/retractor = 100, \
/obj/item/weapon/crowbar = 55, \
/obj/item/weapon/kitchen/utensil/fork = 75)
min_duration = 80
max_duration = 100
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
return ..() && target.op_stage.face == 2
/datum/surgery_step/face/fix_face/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
return ..() //&& target.op_stage.face == 2//I NEED TO REPLACE THE OPSTAGE SHIT!
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
/datum/surgery_step/face/fix_face/begin_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
user.visible_message("[user] starts pulling skin on [target]'s face back in place with \the [tool].", \
"You start pulling skin on [target]'s face back in place with \the [tool].")
..()
end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message("\blue [user] pulls skin on [target]'s face back in place with \the [tool].", \
"\blue You pull skin on [target]'s face back in place with \the [tool].")
target.op_stage.face = 3
/datum/surgery_step/face/fix_face/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
user.visible_message("<span class='notice'> [user] pulls skin on [target]'s face back in place with \the [tool].</span>", \
"<span class='notice'> You pull skin on [target]'s face back in place with \the [tool].</span>")
//target.op_stage.face = 3//I NEED TO REPLACE THE OPSTAGE SHIT!
return 1
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
/datum/surgery_step/face/fix_face/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("\red [user]'s hand slips, tearing skin on [target]'s face with \the [tool]!", \
"\red Your hand slips, tearing skin on [target]'s face with \the [tool]!")
user.visible_message("<span class='warning'> [user]'s hand slips, tearing skin on [target]'s face with \the [tool]!</span>", \
"<span class='warning'> Your hand slips, tearing skin on [target]'s face with \the [tool]!</span>")
target.apply_damage(10, BRUTE, affected, sharp=1, sharp=1)
return 0
/datum/surgery_step/face/cauterize
name = "close incision"
allowed_tools = list(
/obj/item/weapon/scalpel/laser3 = 115, \
/obj/item/weapon/scalpel/laser2 = 110, \
/obj/item/weapon/scalpel/laser1 = 105, \
/obj/item/weapon/cautery = 100, \
/obj/item/clothing/mask/cigarette = 75, \
/obj/item/weapon/lighter = 50, \
/obj/item/weapon/weldingtool = 25
)
min_duration = 70
max_duration = 100
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
return ..() && target.op_stage.face > 0
/datum/surgery_step/face/cauterize/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
return ..()// && target.op_stage.face > 0//I NEED TO REPLACE THE OPSTAGE SHIT!
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
/datum/surgery_step/face/cauterize/begin_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
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].")
..()
end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
/datum/surgery_step/face/cauterize/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("\blue [user] cauterizes the incision on [target]'s face and neck with \the [tool].", \
"\blue You cauterize the incision on [target]'s face and neck with \the [tool].")
user.visible_message("<span class='notice'> [user] cauterizes the incision on [target]'s face and neck with \the [tool].</span>", \
"<span class='notice'> You cauterize the incision on [target]'s face and neck with \the [tool].</span>")
affected.open = 0
affected.status &= ~ORGAN_BLEEDING
if (target.op_stage.face == 3)
var/obj/item/organ/external/head/h = affected
h.disfigured = 0
h.update_icon()
target.regenerate_icons()
target.op_stage.face = 0
//if (target.op_stage.face == 3)//I NEED TO REPLACE THE OPSTAGE SHIT!
var/obj/item/organ/external/head/h = affected
h.disfigured = 0
h.update_icon()
target.regenerate_icons()
//target.op_stage.face = 0//I NEED TO REPLACE THE OPSTAGE SHIT!
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
return 1
/datum/surgery_step/face/cauterize/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("\red [user]'s hand slips, leaving a small burn on [target]'s face with \the [tool]!", \
"\red Your hand slips, leaving a small burn on [target]'s face with \the [tool]!")
target.apply_damage(4, BURN, affected)
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>")
target.apply_damage(4, BURN, affected)
return 0
+177 -223
View File
@@ -5,269 +5,219 @@
/datum/surgery_step/generic/
can_infect = 1
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (target_zone == "eyes") //there are specific steps for eye surgery
return 0
if (!hasorgans(target))
return 0
var/obj/item/organ/external/affected = target.get_organ(target_zone)
if (affected == null)
return 0
if (affected.status & ORGAN_DESTROYED)
return 0
if (affected.status & ORGAN_ROBOT)
return 0
return 1
/datum/surgery_step/generic/cut_with_laser
allowed_tools = list(
/obj/item/weapon/scalpel/laser3 = 95, \
/obj/item/weapon/scalpel/laser2 = 85, \
/obj/item/weapon/scalpel/laser1 = 75, \
/obj/item/weapon/melee/energy/sword/saber = 5
)
/datum/surgery_step/generic/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
if (target_zone == "eyes") //there are specific steps for eye surgery
return 0
if (!hasorgans(target))
return 0
var/obj/item/organ/external/affected = target.get_organ(target_zone)
if (affected == null)
return 0
if (affected.status & ORGAN_DESTROYED)
return 0
if (affected.status & ORGAN_ROBOT)
return 0
return 1
min_duration = 90
max_duration = 110
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.open == 0 && target_zone != "mouth"
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]!",1)
..()
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("\blue [user] has made a bloodless incision on [target]'s [affected.name] with \the [tool].", \
"\blue You have made a bloodless incision on [target]'s [affected.name] with \the [tool].",)
//Could be cleaner ...
affected.open = 1
if(istype(target) && !(target.species.flags & NO_BLOOD))
affected.status |= ORGAN_BLEEDING
affected.createwound(CUT, 1)
affected.clamp()
spread_germs_to_organ(affected, user)
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("\red [user]'s hand slips as the blade sputters, searing a long gash in [target]'s [affected.name] with \the [tool]!", \
"\red Your hand slips as the blade sputters, searing a long gash in [target]'s [affected.name] with \the [tool]!")
affected.createwound(CUT, 7.5)
affected.createwound(BURN, 12.5)
/datum/surgery_step/generic/incision_manager
allowed_tools = list(
/obj/item/weapon/scalpel/manager = 100
)
min_duration = 80
max_duration = 120
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.open == 0 && target_zone != "mouth"
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!",1)
..()
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("\blue [user] has constructed a prepared incision on and within [target]'s [affected.name] with \the [tool].", \
"\blue You have constructed a prepared incision on and within [target]'s [affected.name] with \the [tool].",)
affected.open = 1
if(istype(target) && !(target.species.flags & NO_BLOOD))
affected.status |= ORGAN_BLEEDING
affected.createwound(CUT, 1)
affected.clamp()
affected.open = 2
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("\red [user]'s hand jolts as the system sparks, ripping a gruesome hole in [target]'s [affected.name] with \the [tool]!", \
"\red Your hand jolts as the system sparks, ripping a gruesome hole in [target]'s [affected.name] with \the [tool]!")
affected.createwound(CUT, 20)
affected.createwound(BURN, 15)
/datum/surgery_step/generic/cut_open
name = "make incision"
allowed_tools = list(
/obj/item/weapon/scalpel/laser3 = 115, \
/obj/item/weapon/scalpel/laser2 = 110, \
/obj/item/weapon/scalpel/laser1 = 105, \
/obj/item/weapon/scalpel/manager = 120, \
/obj/item/weapon/scalpel = 100, \
/obj/item/weapon/kitchen/knife = 75, \
/obj/item/weapon/shard = 50, \
/obj/item/weapon/scissors = 10, \
/obj/item/weapon/twohanded/chainsaw = 1, \
/obj/item/weapon/claymore = 5, \
/obj/item/weapon/melee/energy/ = 5, \
/obj/item/weapon/pen/edagger = 5, \
)
min_duration = 90
max_duration = 110
max_duration = 60
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (!ishuman(target))
return 0
var/obj/item/organ/external/affected = target.get_organ(target_zone)
return ..() && affected.open == 0 && target_zone != "mouth"
/datum/surgery_step/generic/cut_open/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
return ..() && affected.open == 0 && target_zone != "mouth"
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
/datum/surgery_step/generic/cut_open/begin_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("[user] starts the incision on [target]'s [affected.name] with \the [tool].", \
"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]!",1)
..()
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("\blue [user] has made an incision on [target]'s [affected.name] with \the [tool].", \
"\blue You have made an incision on [target]'s [affected.name] with \the [tool].",)
affected.open = 1
affected.status |= ORGAN_BLEEDING
affected.createwound(CUT, 1)
if (target_zone == "head")
target.brain_op_stage = 1
/datum/surgery_step/generic/cut_open/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("<span class='notice'> [user] has made an incision on [target]'s [affected.name] with \the [tool].</span>", \
"<span class='notice'> You have made an incision on [target]'s [affected.name] with \the [tool].</span>",)
affected.open = 1
affected.status |= ORGAN_BLEEDING
affected.createwound(CUT, 1)
//if (target_zone == "head")
// target.brain_op_stage = 1
return 1
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("\red [user]'s hand slips, slicing open [target]'s [affected.name] in a wrong spot with \the [tool]!", \
"\red Your hand slips, slicing open [target]'s [affected.name] in a wrong spot with \the [tool]!")
affected.createwound(CUT, 10)
/datum/surgery_step/generic/cut_open/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
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 a wrong spot with \the [tool]!</span>", \
"<span class='warning'> Your hand slips, slicing open [target]'s [affected.name] in a wrong spot with \the [tool]!</span>")
affected.createwound(CUT, 10)
return 0
/datum/surgery_step/generic/clamp_bleeders
name = "clamp bleeders"
allowed_tools = list(
/obj/item/weapon/scalpel/laser3 = 115, \
/obj/item/weapon/scalpel/laser2 = 110, \
/obj/item/weapon/scalpel/laser1 = 105, \
/obj/item/weapon/scalpel/manager = 120, \
/obj/item/weapon/hemostat = 100, \
/obj/item/stack/cable_coil = 75, \
/obj/item/device/assembly/mousetrap = 20
)
min_duration = 40
max_duration = 60
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
/datum/surgery_step/generic/clamp_bleeders/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
return ..() && affected.open && (affected.status & ORGAN_BLEEDING)
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
/datum/surgery_step/generic/clamp_bleeders/begin_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("[user] 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!",1)
..()
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("\blue [user] clamps bleeders in [target]'s [affected.name] with \the [tool].", \
"\blue You clamp bleeders in [target]'s [affected.name] with \the [tool].")
affected.clamp()
spread_germs_to_organ(affected, user)
/datum/surgery_step/generic/clamp_bleeders/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("<span class='notice'> [user] clamps bleeders in [target]'s [affected.name] with \the [tool]</span>.", \
"<span class='notice'> You clamp bleeders in [target]'s [affected.name] with \the [tool].</span>")
affected.clamp()
spread_germs_to_organ(affected, user)
return 1
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("\red [user]'s hand slips, tearing blood vessals and causing massive bleeding in [target]'s [affected.name] with \the [tool]!", \
"\red Your hand slips, tearing blood vessels and causing massive bleeding in [target]'s [affected.name] with \the [tool]!",)
affected.createwound(CUT, 10)
/datum/surgery_step/generic/clamp_bleeders/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("<span class='warning'> [user]'s hand slips, tearing blood vessals 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>",)
affected.createwound(CUT, 10)
return 0
/datum/surgery_step/generic/retract_skin
name = "retract skin"
allowed_tools = list(
/obj/item/weapon/scalpel/manager = 120, \
/obj/item/weapon/retractor = 100, \
/obj/item/weapon/crowbar = 75, \
/obj/item/weapon/kitchen/utensil/fork = 50
)
min_duration = 30
max_duration = 40
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
/datum/surgery_step/generic/retract_skin/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
return ..() && affected.open == 1 && !(affected.status & ORGAN_BLEEDING)
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 = "[user] 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]."
if (target_zone == "chest")
msg = "[user] starts to separate the ribcage and rearrange the organs in [target]'s torso with \the [tool]."
self_msg = "You start to separate the ribcage and rearrange the organs in [target]'s torso with \the [tool]."
if (target_zone == "groin")
msg = "[user] starts to pry open the incision and rearrange the organs in [target]'s lower abdomen with \the [tool]."
self_msg = "You start to pry open the incision and rearrange the organs in [target]'s lower abdomen with \the [tool]."
user.visible_message(msg, self_msg)
target.custom_pain("It feels like the skin on your [affected.name] is on fire!",1)
..()
/datum/surgery_step/generic/retract_skin/begin_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
var/msg = "[user] 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]."
if (target_zone == "chest")
msg = "[user] starts to separate the ribcage and rearrange the organs in [target]'s torso with \the [tool]."
self_msg = "You start to separate the ribcage and rearrange the organs in [target]'s torso with \the [tool]."
if (target_zone == "groin")
msg = "[user] starts to pry open the incision and rearrange the organs in [target]'s lower abdomen with \the [tool]."
self_msg = "You start to pry open the incision and rearrange the organs in [target]'s lower abdomen with \the [tool]."
user.visible_message(msg, self_msg)
target.custom_pain("It feels like the skin on your [affected.name] is on fire!",1)
..()
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 = "\blue [user] keeps the incision open on [target]'s [affected.name] with \the [tool]."
var/self_msg = "\blue You keep the incision open on [target]'s [affected.name] with \the [tool]."
if (target_zone == "chest")
msg = "\blue [user] keeps the ribcage open on [target]'s torso with \the [tool]."
self_msg = "\blue You keep the ribcage open on [target]'s torso with \the [tool]."
if (target_zone == "groin")
msg = "\blue [user] keeps the incision open on [target]'s lower abdomen with \the [tool]."
self_msg = "\blue You keep the incision open on [target]'s lower abdomen with \the [tool]."
user.visible_message(msg, self_msg)
affected.open = 2
/datum/surgery_step/generic/retract_skin/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
var/msg = "<span class='notice'> [user] keeps the incision open on [target]'s [affected.name] with \the [tool].</span>"
var/self_msg = "<span class='notice'> You keep the incision open on [target]'s [affected.name] with \the [tool].</span>"
if (target_zone == "chest")
msg = "<span class='notice'> [user] keeps the ribcage open on [target]'s torso with \the [tool].</span>"
self_msg = "<span class='notice'> You keep the ribcage open on [target]'s torso with \the [tool]."
if (target_zone == "groin")
msg = "<span class='notice'> [user] keeps the incision open on [target]'s lower abdomen with \the [tool].</span>"
self_msg = "<span class='notice'> You keep the incision open on [target]'s lower abdomen with \the [tool].</span>"
user.visible_message(msg, self_msg)
affected.open = 2
return 1
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 = "\red [user]'s hand slips, tearing the edges of incision on [target]'s [affected.name] with \the [tool]!"
var/self_msg = "\red Your hand slips, tearing the edges of incision on [target]'s [affected.name] with \the [tool]!"
if (target_zone == "chest")
msg = "\red [user]'s hand slips, damaging several organs [target]'s torso with \the [tool]!"
self_msg = "\red Your hand slips, damaging several organs [target]'s torso with \the [tool]!"
if (target_zone == "groin")
msg = "\red [user]'s hand slips, damaging several organs [target]'s lower abdomen with \the [tool]"
self_msg = "\red Your hand slips, damaging several organs [target]'s lower abdomen with \the [tool]!"
user.visible_message(msg, self_msg)
target.apply_damage(12, BRUTE, affected, sharp=1)
/datum/surgery_step/generic/retract_skin/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
var/msg = "<span class='warning'> [user]'s hand slips, tearing the edges of incision on [target]'s [affected.name] with \the [tool]!</span>"
var/self_msg = "<span class='warning'> Your hand slips, tearing the edges of incision on [target]'s [affected.name] with \the [tool]!</span>"
if (target_zone == "chest")
msg = "<span class='warning'> [user]'s hand slips, damaging several organs [target]'s torso with \the [tool]!</span>"
self_msg = "<span class='warning'> Your hand slips, damaging several organs [target]'s torso with \the [tool]!</span>"
if (target_zone == "groin")
msg = "<span class='warning'> [user]'s hand slips, damaging several organs [target]'s lower abdomen with \the [tool]</span>"
self_msg = "<span class='warning'> Your hand slips, damaging several organs [target]'s lower abdomen with \the [tool]!</span>"
user.visible_message(msg, self_msg)
target.apply_damage(12, BRUTE, affected, sharp=1)
return 0
/datum/surgery_step/generic/cauterize
name = "cauterize incision"
allowed_tools = list(
/obj/item/weapon/scalpel/laser3 = 115, \
/obj/item/weapon/scalpel/laser2 = 110, \
/obj/item/weapon/scalpel/laser1 = 105, \
/obj/item/weapon/cautery = 100, \
/obj/item/clothing/mask/cigarette = 75, \
/obj/item/weapon/lighter = 50, \
/obj/item/weapon/weldingtool = 25
)
min_duration = 70
max_duration = 100
max_duration = 90
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.open && target_zone != "mouth"
/datum/surgery_step/generic/cauterize/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
return ..() && affected.open && target_zone != "mouth"
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 cauterize the incision on [target]'s [affected.name] with \the [tool]." , \
"You are beginning to cauterize the incision on [target]'s [affected.name] with \the [tool].")
target.custom_pain("Your [affected.name] is being burned!",1)
..()
/datum/surgery_step/generic/cauterize/begin_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("[user] is beginning to cauterize the incision on [target]'s [affected.name] with \the [tool]." , \
"You are beginning to cauterize the incision on [target]'s [affected.name] with \the [tool].")
target.custom_pain("Your [affected.name] is being burned!",1)
..()
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("\blue [user] cauterizes the incision on [target]'s [affected.name] with \the [tool].", \
"\blue You cauterize the incision on [target]'s [affected.name] with \the [tool].")
affected.open = 0
affected.germ_level = 0
affected.status &= ~ORGAN_BLEEDING
/datum/surgery_step/generic/cauterize/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("<span class='notice'> [user] cauterizes the incision on [target]'s [affected.name] with \the [tool].</span>", \
"<span class='notice'> You cauterize the incision on [target]'s [affected.name] with \the [tool].</span>")
affected.open = 0
affected.germ_level = 0
affected.status &= ~ORGAN_BLEEDING
return 1
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("\red [user]'s hand slips, leaving a small burn on [target]'s [affected.name] with \the [tool]!", \
"\red Your hand slips, leaving a small burn on [target]'s [affected.name] with \the [tool]!")
target.apply_damage(3, BURN, affected)
/datum/surgery_step/generic/cauterize/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
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>")
target.apply_damage(3, BURN, affected)
return 0
/datum/surgery_step/generic/amputate
name = "amputate limb"
allowed_tools = list(
/obj/item/weapon/circular_saw = 100, \
/obj/item/weapon/melee/energy/sword/cyborg/saw = 100, \
@@ -275,37 +225,41 @@
/obj/item/weapon/melee/arm_blade = 60
)
min_duration = 110
max_duration = 160
max_duration = 110
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (target_zone == "eyes") //there are specific steps for eye surgery
return 0
if (!hasorgans(target))
return 0
var/obj/item/organ/external/affected = target.get_organ(target_zone)
if (affected == null)
return 0
if (affected.status & ORGAN_DESTROYED)
return 0
return !affected.cannot_amputate
/datum/surgery_step/generic/amputate/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
if (target_zone == "eyes") //there are specific steps for eye surgery
return 0
if (!hasorgans(target))
return 0
var/obj/item/organ/external/affected = target.get_organ(target_zone)
if (affected == null)
return 0
if (affected.status & ORGAN_DESTROYED)
return 0
return !affected.cannot_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("[user] is beginning to amputate [target]'s [affected.name] with \the [tool]." , \
"You are beginning to cut through [target]'s [affected.amputation_point] with \the [tool].")
target.custom_pain("Your [affected.amputation_point] is being ripped apart!",1)
..()
/datum/surgery_step/generic/amputate/begin_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("[user] is beginning to amputate [target]'s [affected.name] with \the [tool]." , \
"You are beginning to cut through [target]'s [affected.amputation_point] with \the [tool].")
target.custom_pain("Your [affected.amputation_point] is being ripped apart!",1)
..()
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("\blue [user] amputates [target]'s [affected.name] at the [affected.amputation_point] with \the [tool].", \
"\blue You amputate [target]'s [affected.name] with \the [tool].")
affected.droplimb(1,DROPLIMB_EDGE)
/datum/surgery_step/generic/amputate/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("<span class='notice'> [user] amputates [target]'s [affected.name] at the [affected.amputation_point] with \the [tool].</span>", \
"<span class='notice'> You amputate [target]'s [affected.name] with \the [tool].</span>")
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("\red [user]'s hand slips, sawing through the bone in [target]'s [affected.name] with \the [tool]!", \
"\red Your hand slips, sawwing through the bone in [target]'s [affected.name] with \the [tool]!")
affected.createwound(CUT, 30)
affected.fracture()
add_logs(target,user ,"surgically removed [affected.name] from", addition="INTENT: [uppertext(user.a_intent)]")//log it
affected.droplimb(1,DROPLIMB_EDGE)
return 1
/datum/surgery_step/generic/amputate/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
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>")
affected.createwound(CUT, 30)
affected.fracture()
return 0
+89
View File
@@ -0,0 +1,89 @@
/proc/attempt_initiate_surgery(obj/item/I, mob/living/M, mob/user, var/override )
if(istype(M))
var/mob/living/carbon/human/H
var/obj/item/organ/external/affecting
var/selected_zone = user.zone_sel.selecting
if(istype(M, /mob/living/carbon/human))
H = M
affecting = H.get_organ(check_zone(selected_zone))
if(can_operate(M) || isslime(M)) //if they're prone or a slime
var/datum/surgery/current_surgery
for(var/datum/surgery/S in M.surgeries)
if(S.location == selected_zone)
current_surgery = S
if(!current_surgery)
var/list/all_surgeries = surgeries_list.Copy()
var/list/available_surgeries = list()
for(var/datum/surgery/S in all_surgeries)
if(!S.possible_locs.Find(selected_zone))
continue
if(affecting && S.requires_organic_bodypart && affecting.status == ORGAN_ROBOT)
continue
if(!S.can_start(user, M))
continue
for(var/path in S.allowed_mob)
if(istype(M, path))
available_surgeries[S.name] = S
break
if(override)
if(istype(I,/obj/item/robot_parts))
var/datum/surgery/S = available_surgeries["robotic limb attachment"]
if(S)
var/datum/surgery/procedure = new S.type
if(procedure)
procedure.location = selected_zone
M.surgeries += procedure
procedure.organ_ref = affecting
procedure.next_step(user, M)
else
var/P = input("Begin which procedure?", "Surgery", null, null) as null|anything in available_surgeries
if(P && user && user.Adjacent(M) && (I in user))
var/datum/surgery/S = available_surgeries[P]
var/datum/surgery/procedure = new S.type
if(procedure)
procedure.location = selected_zone
M.surgeries += procedure
procedure.organ_ref = affecting
user.visible_message("[user] prepares to operate on [M]'s [parse_zone(selected_zone)].", \
"<span class='notice'>You prepare to operate on [M]'s [parse_zone(selected_zone)].</span>")
else if(!current_surgery.step_in_progress)
if(current_surgery.status == 1 )
M.surgeries -= current_surgery
user << "You stop the surgery."
qdel(current_surgery)
else if(istype(user.get_inactive_hand(), /obj/item/weapon/cautery) && current_surgery.can_cancel)
M.surgeries -= current_surgery
user.visible_message("[user] mends the incision on [M]'s [parse_zone(selected_zone)] with the [I] .", \
"<span class='notice'>You mend the incision on [M]'s [parse_zone(selected_zone)].</span>")
if(affecting)
affecting.open = 0
affecting.germ_level = 0
affecting.status &= ~ORGAN_BLEEDING
qdel(current_surgery)
else if(current_surgery.can_cancel)
user << "<span class='warning'>You need to hold a cautery in inactive hand to stop [M]'s surgery!</span>"
return 1
return 0
proc/get_location_modifier(mob/M)
var/turf/T = get_turf(M)
if(locate(/obj/machinery/optable, T))
return 1
else if(locate(/obj/structure/table, T))
return 0.8
else if(locate(/obj/structure/stool/bed, T))
return 0.7
else
return 0.5
+273 -148
View File
@@ -1,228 +1,353 @@
//Procedures in this file: Putting items in body cavity. Implant removal. Items removal.
//////////////////////////////////////////////////////////////////
// ITEM PLACEMENT SURGERY //
//////////////////////////////////////////////////////////////////
/datum/surgery/cavity_implant
name = "cavity implant/removal"
steps = list(/datum/surgery_step/generic/cut_open,/datum/surgery_step/generic/clamp_bleeders, /datum/surgery_step/generic/retract_skin, /datum/surgery_step/open_encased/saw,
/datum/surgery_step/open_encased/retract, /datum/surgery_step/cavity/make_space,/datum/surgery_step/cavity/place_item,/datum/surgery_step/cavity/close_space,/datum/surgery_step/open_encased/close,/datum/surgery_step/glue_bone, /datum/surgery_step/set_bone,/datum/surgery_step/finish_bone,/datum/surgery_step/generic/cauterize)
possible_locs = list("chest","head")
/datum/surgery/cavity_implant/soft
name = "cavity implant/removal"
steps = list(/datum/surgery_step/generic/cut_open, /datum/surgery_step/generic/clamp_bleeders, /datum/surgery_step/generic/retract_skin, /datum/surgery_step/generic/cut_open, /datum/surgery_step/cavity/make_space,/datum/surgery_step/cavity/place_item,/datum/surgery_step/cavity/close_space,/datum/surgery_step/generic/cauterize)
possible_locs = list("groin")
/datum/surgery/cavity_implant/synth
name = "robotic cavity implant"
steps = list(/datum/surgery_step/robotics/external/unscrew_hatch,/datum/surgery_step/robotics/external/open_hatch,/datum/surgery_step/cavity/place_item,/datum/surgery_step/robotics/external/close_hatch)
possible_locs = list("chest","head","groin")
allowed_mob = list(/mob/living/carbon/human/machine)
/datum/surgery/cavity_implant/can_start(mob/user, mob/living/carbon/target)
if(target.get_species() == "Machine")
return 0
return 1
/datum/surgery/cavity_implant/synth/can_start(mob/user, mob/living/carbon/target)
return target.get_species() == "Machine"
/datum/surgery_step/cavity
priority = 1
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if(!hasorgans(target))
return 0
var/obj/item/organ/external/affected = target.get_organ(target_zone)
return affected && affected.open == (affected.encased ? 3 : 2) && !(affected.status & ORGAN_BLEEDING)
proc/get_max_wclass(obj/item/organ/external/affected)
switch (affected.limb_name)
if ("head")
return 1
if ("chest")
return 3
if ("groin")
return 2
/datum/surgery_step/cavity/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
if(!hasorgans(target))
return 0
var/obj/item/organ/external/affected = target.get_organ(target_zone)
return affected && affected.open == (affected.encased ? 3 : 2) && !(affected.status & ORGAN_BLEEDING)
proc/get_cavity(obj/item/organ/external/affected)
switch (affected.limb_name)
if ("head")
return "cranial"
if ("chest")
return "thoracic"
if ("groin")
return "abdominal"
return ""
/datum/surgery_step/cavity/proc/get_max_wclass(obj/item/organ/external/affected)
switch (affected.limb_name)
if ("head")
return 1
if ("chest")
return 3
if ("groin")
return 2
return 0
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("\red [user]'s hand slips, scraping around inside [target]'s [affected.name] with \the [tool]!", \
"\red Your hand slips, scraping around inside [target]'s [affected.name] with \the [tool]!")
affected.createwound(CUT, 20)
/datum/surgery_step/cavity/proc/get_cavity(obj/item/organ/external/affected)
switch (affected.limb_name)
if ("head")
return "cranial"
if ("chest")
return "thoracic"
if ("groin")
return "abdominal"
return ""
/datum/surgery_step/cavity/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
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>")
affected.createwound(CUT, 20)
/datum/surgery_step/cavity/make_space
name = "make cavity space"
allowed_tools = list(
/obj/item/weapon/surgicaldrill = 100, \
/obj/item/weapon/pen = 75, \
/obj/item/stack/rods = 50
)
min_duration = 60
max_duration = 80
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.cavity && !affected.hidden
/datum/surgery_step/cavity/make_space/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
return ..() && !affected.cavity && !affected.hidden
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
..()
/datum/surgery_step/cavity/make_space/begin_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
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
..()
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("\blue [user] makes some space inside [target]'s [get_cavity(affected)] cavity with \the [tool].", \
"\blue You make some space inside [target]'s [get_cavity(affected)] cavity with \the [tool]." )
/datum/surgery_step/cavity/make_space/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
var/obj/item/organ/external/chest/affected = target.get_organ(target_zone)
user.visible_message("<span class='notice'> [user] makes some space inside [target]'s [get_cavity(affected)] cavity with \the [tool].</span>", \
"<span class='notice'> You make some space inside [target]'s [get_cavity(affected)] cavity with \the [tool].</span>" )
return 1
/datum/surgery_step/cavity/close_space
priority = 2
name = "close cavity space"
allowed_tools = list(
/obj/item/weapon/scalpel/laser3 = 115, \
/obj/item/weapon/scalpel/laser2 = 110, \
/obj/item/weapon/scalpel/laser1 = 105, \
/obj/item/weapon/scalpel/manager = 120, \
/obj/item/weapon/cautery = 100, \
/obj/item/clothing/mask/cigarette = 75, \
/obj/item/weapon/lighter = 50, \
/obj/item/weapon/weldingtool = 25
)
min_duration = 60
max_duration = 80
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.cavity
/datum/surgery_step/cavity/close_space/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
return ..() && affected.cavity
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 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!",1)
affected.cavity = 0
..()
/datum/surgery_step/cavity/close_space/begin_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("[user] 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!",1)
affected.cavity = 0
..()
/datum/surgery_step/cavity/close_space/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
var/obj/item/organ/external/chest/affected = target.get_organ(target_zone)
user.visible_message("<span class='notice'> [user] mends [target]'s [get_cavity(affected)] cavity walls with \the [tool].</span>", \
"<span class='notice'> You mend [target]'s [get_cavity(affected)] cavity walls with \the [tool].</span>" )
return 1
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("\blue [user] mends [target]'s [get_cavity(affected)] cavity walls with \the [tool].", \
"\blue You mend [target]'s [get_cavity(affected)] cavity walls with \the [tool]." )
/datum/surgery_step/cavity/place_item
priority = 0
name = "implant/extract object"
accept_hand = 1
accept_any_item = 1
var/obj/item/IC = null
allowed_tools = list(/obj/item = 100)
min_duration = 80
max_duration = 100
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (!ishuman(target))
return 0
var/obj/item/organ/external/affected = target.get_organ(target_zone)
var/can_fit = affected && !affected.hidden && affected.cavity && tool.w_class <= get_max_wclass(affected)
return ..() && can_fit
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)
/datum/surgery_step/cavity/place_item/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
if (!ishuman(target))
return 0
var/obj/item/organ/external/affected = target.get_organ(target_zone)
var/can_fit = affected && !affected.hidden && affected.cavity && tool.w_class <= get_max_wclass(affected)
return ..() && can_fit
/datum/surgery_step/cavity/place_item/begin_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
for(var/obj/item/I in target.internal_organs)
if(!istype(I, /obj/item/organ))
IC = I
break
if(tool)
user.visible_message("[user] starts putting \the [tool] inside [target]'s [get_cavity(affected)] cavity.", \
"You start putting \the [tool] inside [target]'s [get_cavity(affected)] cavity." )
target.custom_pain("The pain in your chest is living hell!",1)
..()
else if(IC)
user.visible_message("[user] checks for items in [target]'s [target_zone].", "<span class='notice'>You check for items in [target]'s [target_zone]...</span>")
else //no internal items..but we still need a message!
user.visible_message("[user] checks for items in [target]'s [target_zone].", "<span class='notice'>You check for items in [target]'s [target_zone]...</span>")
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)
target.custom_pain("The pain in your [target_zone] is living hell!",1)
..()
if(istype(tool, /obj/item/weapon/disk/nuclear))
user << "Central command would kill you if you implanted the disk into someone."
/datum/surgery_step/cavity/place_item/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
var/obj/item/organ/external/chest/affected = target.get_organ(target_zone)
if(istype(tool, /obj/item/weapon/disk/nuclear))
user << "Central command would kill you if you implanted the disk into someone."
return 0//fail
if(istype(tool,/obj/item/organ))
user << "This isn't the type of surgery for that!"
return 0//fail
if(tool)
if(IC)
user << "There seems to be something in there already!"
return 1
else
user.visible_message("\blue [user] puts \the [tool] inside [target]'s [get_cavity(affected)] cavity.", \
"\blue You put \the [tool] inside [target]'s [get_cavity(affected)] cavity." )
if (tool.w_class > get_max_wclass(affected)/2 && prob(50) && !(affected.status & ORGAN_ROBOT))
user << "\red You tear some vessels trying to fit such big object in this cavity."
user.visible_message("<span class='notice'> [user] puts \the [tool] inside [target]'s [get_cavity(affected)] cavity.</span>", \
"<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)))
user << "<span class='warning'> You tear some vessels trying to fit the object in the cavity.</span>"
var/datum/wound/internal_bleeding/I = new ()
affected.wounds += I
affected.owner.custom_pain("You feel something rip in your [affected.name]!", 1)
user.drop_item()
affected.hidden = tool
target.internal_organs += tool
tool.loc = target
affected.cavity = 0
return 1
else
if(IC)
user.visible_message("[user] pulls [IC] out of [target]'s [target_zone]!", "<span class='notice'>You pull [IC] out of [target]'s [target_zone].</span>")
user.put_in_hands(IC)
target.internal_organs -= IC
return 1
else
user << "<span class='warning'>You don't find anything in [target]'s [target_zone].</span>"
return 0
//////////////////////////////////////////////////////////////////
// IMPLANT/ITEM REMOVAL SURGERY //
//////////////////////////////////////////////////////////////////
/datum/surgery/cavity_implant_rem
name = "implant removal"
steps = list(/datum/surgery_step/generic/cut_open, /datum/surgery_step/generic/clamp_bleeders, /datum/surgery_step/generic/retract_skin,/datum/surgery_step/cavity/implant_removal,/datum/surgery_step/cavity/close_space,/datum/surgery_step/generic/cauterize/)
possible_locs = list("chest")//head is for borers..i can put it elsewhere
/datum/surgery/cavity_implant_rem/synth
name = "implant removal"
steps = list(/datum/surgery_step/robotics/external/unscrew_hatch,/datum/surgery_step/robotics/external/open_hatch,/datum/surgery_step/cavity/implant_removal,/datum/surgery_step/robotics/external/close_hatch)
possible_locs = list("chest")//head is for borers..i can put it elsewhere
allowed_mob = list(/mob/living/carbon/human/machine)
/datum/surgery/cavity_implant_rem/can_start(mob/user, mob/living/carbon/target)
if(target.get_species() == "Machine")
return 0
return 1
/datum/surgery/cavity_implant_rem/synth/can_start(mob/user, mob/living/carbon/target)
return target.get_species() == "Machine"
/datum/surgery_step/cavity/implant_removal
name = "extract implant"
allowed_tools = list(
/obj/item/weapon/hemostat = 100, \
/obj/item/weapon/wirecutters = 75, \
/obj/item/weapon/kitchen/utensil/fork = 20
)
var/obj/item/weapon/implant/I = null
max_duration = 70
min_duration = 80
max_duration = 100
/datum/surgery_step/cavity/implant_removal/begin_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
I = locate(/obj/item/weapon/implant) in target
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!",1)
..()
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!",1)
..()
/datum/surgery_step/cavity/implant_removal/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
I = locate(/obj/item/weapon/implant) in target
if(I && (target_zone == "chest")) //implant removal only works on the chest.
user.visible_message("<span class='notice'>[user] takes something out of [target]'s [affected.name] with \the [tool].</span>", \
"<span class='notice'>You take [I] out of [target]'s [affected.name]s with \the [tool].</span>" )
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/obj/item/weapon/implant/I = locate(/obj/item/weapon/implant) in target
I.removed(target)
if (affected.implants.len)
var/obj/item/weapon/implantcase/case
var/obj/item/obj = affected.implants[1]
if(istype(user.get_item_by_slot(slot_l_hand), /obj/item/weapon/implantcase))
case = user.get_item_by_slot(slot_l_hand)
else if(istype(user.get_item_by_slot(slot_r_hand), /obj/item/weapon/implantcase))
case = user.get_item_by_slot(slot_r_hand)
else
case = locate(/obj/item/weapon/implantcase) in get_turf(target)
user.visible_message("\blue [user] takes something out of [target]'s [affected.name] with \the [tool].", \
"\blue You take [obj] out of [target]'s [affected.name]s with \the [tool]." )
affected.implants -= obj
if(case && !case.imp)
case.imp = I
I.loc = case
case.update_icon()
user.visible_message("[user] places [I] into [case]!", "<span class='notice'>You place [I] into [case].</span>")
else
qdel(I)
//target.sec_hud_set_implants()
return 1
else
user.visible_message("<span class='notice'> [user] could not find anything inside [target]'s [affected.name], and pulls \the [tool] out.</span>", \
"<span class='notice'>You could not find anything inside [target]'s [affected.name].</span>")
return 1
//Handle possessive brain borers.
if(istype(obj,/mob/living/simple_animal/borer))
var/mob/living/simple_animal/borer/worm = obj
/datum/surgery_step/cavity/implant_removal/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
..()
var/obj/item/organ/external/chest/affected = target.get_organ(target_zone)
if (affected.implants.len)
var/fail_prob = 10
fail_prob += 100 - tool_quality(tool)
if (prob(fail_prob))
var/obj/item/weapon/implant/imp = affected.implants[1]
user.visible_message("<span class='warning'> Something beeps inside [target]'s [affected.name]!</span>")
playsound(imp.loc, 'sound/items/countdown.ogg', 75, 1, -3)
spawn(25)
imp.activate()
return 0
//////////////////////////////////////////////////////////////////
// EMBEDDED ITEM REOMOVAL //
//////////////////////////////////////////////////////////////////
/datum/surgery/embedded_removal
name = "removal of embedded objects"
steps = list(/datum/surgery_step/generic/cut_open,/datum/surgery_step/generic/clamp_bleeders, /datum/surgery_step/generic/retract_skin,/datum/surgery_step/remove_object)
possible_locs = list("r_arm","l_arm","r_leg","l_leg","r_hand","r_foot","l_hand","l_foot","groin","chest","head")
/datum/surgery/embedded_removal/can_start(mob/user, mob/living/carbon/target)
if(target.get_species() == "Machine")
return 0
return 1
/datum/surgery_step/remove_object
name = "remove embedded objects"
max_duration = 32
accept_hand = 1
var/obj/item/organ/external/L = null
/datum/surgery_step/remove_object/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool, datum/surgery/surgery)
L = target.get_organ(target_zone)
if(L)
user.visible_message("[user] looks for objects embedded in [target]'s [target_zone].", "<span class='notice'>You look for objects embedded in [target]'s [target_zone]...</span>")
else
user.visible_message("[user] looks for [target]'s [target_zone].", "<span class='notice'>You look for [target]'s [target_zone]...</span>")
/datum/surgery_step/remove_object/end_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool, datum/surgery/surgery)
if(L)
if(ishuman(target))
var/mob/living/carbon/human/H = target
var/objects = 0
for(var/obj/item/I in L.implants)
if(!istype(I,/obj/item/weapon/implant))
objects++
I.forceMove(get_turf(H))
L.implants -= I
//Handle possessive brain borers.
if(H.has_brain_worms() && target_zone == "head")//remove worms outside the loop
var/mob/living/simple_animal/borer/worm = H.has_brain_worms()
if(worm.controlling)
target.release_control()
worm.detatch()
worm.leave_host()
user.visible_message("a slug like creature wiggles out of [H]'s [target_zone]!")
obj.loc = get_turf(target)
else if(I && target_zone == "chest") //implant removal only works on the chest.
user.visible_message("<span class='notice'>[user] takes something out of [target]'s [affected.name] with \the [tool].</span>", \
"<span class='notice'>You take [I] out of [target]'s [affected.name]s with \the [tool].</span>" )
I.removed(target)
var/obj/item/weapon/implantcase/case
if(istype(user.get_item_by_slot(slot_l_hand), /obj/item/weapon/implantcase))
case = user.get_item_by_slot(slot_l_hand)
else if(istype(user.get_item_by_slot(slot_r_hand), /obj/item/weapon/implantcase))
case = user.get_item_by_slot(slot_r_hand)
if(objects > 0)
user.visible_message("[user] sucessfully removes [objects] objects from [H]'s [L.limb_name]!", "<span class='notice'>You sucessfully remove [objects] objects from [H]'s [L.limb_name].</span>")
else
case = locate(/obj/item/weapon/implantcase) in get_turf(target)
if(case && !case.imp)
case.imp = I
I.loc = case
case.update_icon()
user.visible_message("[user] places [I] into [case]!", "<span class='notice'>You place [I] into [case].</span>")
else
qdel(I)
else if (affected.hidden)
user.visible_message("\blue [user] takes something out of incision on [target]'s [affected.name] with \the [tool].", \
"\blue You take something out of incision on [target]'s [affected.name]s with \the [tool]." )
affected.hidden.loc = get_turf(target)
if(!affected.hidden.blood_DNA)
affected.hidden.blood_DNA = list()
affected.hidden.blood_DNA[target.dna.unique_enzymes] = target.dna.b_type
affected.hidden.update_icon()
affected.hidden = null
else
user.visible_message("\blue [user] could not find anything inside [target]'s [affected.name], and pulls \the [tool] out.", \
"\blue You could not find anything inside [target]'s [affected.name]." )
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)
if (affected.implants.len)
var/fail_prob = 10
fail_prob += 100 - tool_quality(tool)
if (prob(fail_prob))
var/obj/item/weapon/implant/imp = affected.implants[1]
user.visible_message("\red Something beeps inside [target]'s [affected.name]!")
playsound(imp.loc, 'sound/items/countdown.ogg', 75, 1, -3)
spawn(25)
imp.activate()
user << "<span class='warning'>You find no objects embedded in [H]'s [L.limb_name]!</span>"
else
user << "<span class='warning'>You can't find [target]'s [target_zone], let alone any objects embedded in it!</span>"
return 1
+164 -78
View File
@@ -3,8 +3,70 @@
// LIMB SURGERY //
//////////////////////////////////////////////////////////////////
/datum/surgery/amputation
name = "amputation"
steps = list(/datum/surgery_step/generic/amputate)
possible_locs = list("head","l_arm", "l_hand","r_arm","r_hand","r_leg","r_foot","l_leg","l_foot","groin")
/datum/surgery/amputation/can_start(mob/user, mob/living/carbon/target)
if(ishuman(target))
var/mob/living/carbon/human/H = target
var/obj/item/organ/external/affected = H.get_organ(user.zone_sel.selecting)
if((target.get_species() == "Machine"))
return 0
if(!affected)
return 0
return 1
/datum/surgery/reattach
name = "limb attachment"
steps = list(/datum/surgery_step/limb/attach,/datum/surgery_step/limb/connect)
possible_locs = list("head","l_arm", "l_hand","r_arm","r_hand","r_leg","r_foot","l_leg","l_foot","groin")
/datum/surgery/reattach/can_start(mob/user, mob/living/carbon/target)
if(ishuman(target))
var/mob/living/carbon/human/H = target
var/obj/item/organ/external/affected = H.get_organ(user.zone_sel.selecting)
if(!affected)
return 1
if((target.get_species() == "Machine"))
return 0
return 0
/datum/surgery/reattach_synth
name = "limb attachment"
steps = list(/datum/surgery_step/limb/attach)
possible_locs = list("head","l_arm", "l_hand","r_arm","r_hand","r_leg","r_foot","l_leg","l_foot","groin")
allowed_mob = list(/mob/living/carbon/human/machine)
/datum/surgery/reattach_synth/can_start(mob/user, mob/living/carbon/target)
if(ishuman(target))
var/mob/living/carbon/human/H = target
var/obj/item/organ/external/affected = H.get_organ(user.zone_sel.selecting)
if(!affected && (target.get_species() == "Machine"))
return 1
return 0
/datum/surgery/robo_attach
name = "robotic limb attachment"
steps = list(/datum/surgery_step/limb/mechanize)
possible_locs = list("head","l_arm", "l_hand","r_arm","r_hand","r_leg","r_foot","l_leg","l_foot","groin")
/datum/surgery/robo_attach/can_start(mob/user, mob/living/carbon/target)
if(ishuman(target))
var/mob/living/carbon/human/H = target
var/obj/item/organ/external/affected = H.get_organ(user.zone_sel.selecting)
if(!affected)
return 1
return 0
/datum/surgery_step/limb/
priority = 3 // Must be higher than /datum/surgery_step/internal
can_infect = 0
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (!hasorgans(target))
@@ -16,34 +78,44 @@
return !isnull(organ_data)
/datum/surgery_step/limb/attach
name = "attach limb"
allowed_tools = list(/obj/item/organ/external = 100)
min_duration = 50
max_duration = 70
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/obj/item/organ/external/E = tool
user.visible_message("[user] starts attaching [E.name] to [target]'s [E.amputation_point].", \
"You start attaching [E.name] to [target]'s [E.amputation_point].")
/datum/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("[user] starts attaching [E.name] to [target]'s [E.amputation_point].", \
"You start attaching [E.name] to [target]'s [E.amputation_point].")
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("<span class='notice'>[user] has attached [target]'s [E.name] to the [E.amputation_point].</span>", \
"<span class='notice'>You have attached [target]'s [E.name] to the [E.amputation_point].</span>")
user.unEquip(E)
E.replaced(target)
E.forceMove(target)
target.update_body()
target.updatehealth()
target.UpdateDamageIcon()
/datum/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("<span class='notice'>[user] has attached [target]'s [E.name] to the [E.amputation_point].</span>", \
"<span class='notice'>You have attached [target]'s [E.name] to the [E.amputation_point].</span>")
user.unEquip(E)
E.replaced(target)
E.forceMove(target)
if(target.get_species() == "Machine")//as this is the only step needed for ipc put togethers
if(target_zone == "head")
target.h_style = ""
E.status &= ~ORGAN_DESTROYED
if(E.children)
for(var/obj/item/organ/external/C in E.children)
C.status &= ~ORGAN_DESTROYED
target.update_body()
target.updatehealth()
target.UpdateDamageIcon()
return 1
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='alert'>[user]'s hand slips, damaging [target]'s [E.amputation_point]!</span>", \
"<span class='alert'>Your hand slips, damaging [target]'s [E.amputation_point]!</span>")
target.apply_damage(10, BRUTE, null, sharp=1)
/datum/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='alert'>[user]'s hand slips, damaging [target]'s [E.amputation_point]!</span>", \
"<span class='alert'>Your hand slips, damaging [target]'s [E.amputation_point]!</span>")
target.apply_damage(10, BRUTE, null, sharp=1)
return 0
/datum/surgery_step/limb/connect
name = "connect limb"
allowed_tools = list(
/obj/item/weapon/hemostat = 100, \
/obj/item/stack/cable_coil = 75, \
@@ -51,79 +123,93 @@
)
can_infect = 1
min_duration = 100
max_duration = 120
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
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/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/obj/item/organ/external/E = target.get_organ(target_zone)
return E && !E.is_stump() && (E.status & ORGAN_DESTROYED)
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/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].")
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("<span class='notice'>[user] has connected tendons and muscles in [target]'s [E.amputation_point] with [tool].</span>", \
"<span class='notice'>You have connected tendons and muscles in [target]'s [E.amputation_point] with [tool].</span>")
E.status &= ~ORGAN_DESTROYED
if(E.children)
for(var/obj/item/organ/external/C in E.children)
C.status &= ~ORGAN_DESTROYED
target.update_body()
target.updatehealth()
target.UpdateDamageIcon()
/datum/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("<span class='notice'>[user] has connected tendons and muscles in [target]'s [E.amputation_point] with [tool].</span>", \
"<span class='notice'>You have connected tendons and muscles in [target]'s [E.amputation_point] with [tool].</span>")
E.status &= ~ORGAN_DESTROYED
var/obj/item/organ/external/stump = target.organs_by_name["limb stump"]
if(stump)
stump.remove(target)
if(E.children)
for(var/obj/item/organ/external/C in E.children)
C.status &= ~ORGAN_DESTROYED
target.update_body()
target.updatehealth()
target.UpdateDamageIcon()
return 1
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='alert'>[user]'s hand slips, damaging [target]'s [E.amputation_point]!</span>", \
"<span class='alert'>Your hand slips, damaging [target]'s [E.amputation_point]!</span>")
target.apply_damage(10, BRUTE, null, sharp=1)
/datum/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='alert'>[user]'s hand slips, damaging [target]'s [E.amputation_point]!</span>", \
"<span class='alert'>Your hand slips, damaging [target]'s [E.amputation_point]!</span>")
target.apply_damage(10, BRUTE, null, sharp=1)
return 0
/datum/surgery_step/limb/mechanize
name = "attach robotic limb"
allowed_tools = list(/obj/item/robot_parts = 100)
min_duration = 80
max_duration = 100
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))
/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))
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
/datum/surgery_step/limb/mechanize/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message("[user] starts attaching \the [tool] to [target].", \
"You start attaching \the [tool] to [target].")
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("<span class='notice'>[user] has attached \the [tool] to [target].</span>", \
"<span class='notice'>You have attached \the [tool] to [target].</span>")
/datum/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("<span class='notice'>[user] has attached \the [tool] to [target].</span>", \
"<span class='notice'>You have attached \the [tool] to [target].</span>")
if(L.part)
for(var/part_name in L.part)
if(!isnull(target.get_organ(part_name)))
continue
var/list/organ_data = target.species.has_limbs["[part_name]"]
if(!organ_data)
continue
var/new_limb_type = organ_data["path"]
var/obj/item/organ/external/new_limb = new new_limb_type(target)
new_limb.robotize(L.model_info)
if(L.sabotaged)
new_limb.sabotaged = 1
if(L.part)
for(var/part_name in L.part)
if(!isnull(target.get_organ(part_name)))
continue
var/list/organ_data = target.species.has_limbs["[part_name]"]
if(!organ_data)
continue
var/obj/item/organ/external/stump = target.organs_by_name["limb stump"]
if(stump)
stump.remove(target)
var/new_limb_type = organ_data["path"]
var/obj/item/organ/external/new_limb = new new_limb_type(target)
new_limb.robotize(L.model_info)
new_limb.replaced(target)
new_limb.status &= ~ORGAN_DESTROYED
if(new_limb.children)
for(var/obj/item/organ/external/C in new_limb.children)
C.status &= ~ORGAN_DESTROYED
if(L.sabotaged)
new_limb.sabotaged = 1
target.update_body()
target.updatehealth()
target.UpdateDamageIcon()
target.update_body()
target.updatehealth()
target.UpdateDamageIcon()
qdel(tool)
qdel(tool)
return 1
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message("<span class='alert'>[user]'s hand slips, damaging [target]'s flesh!</span>", \
"<span class='alert'>Your hand slips, damaging [target]'s flesh!</span>")
target.apply_damage(10, BRUTE, null, sharp=1)
/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='alert'>[user]'s hand slips, damaging [target]'s flesh!</span>", \
"<span class='alert'>Your hand slips, damaging [target]'s flesh!</span>")
target.apply_damage(10, BRUTE, null, sharp=1)
return 0
@@ -0,0 +1,141 @@
/obj/item/organ/internal/cyberimp/eyes
name = "cybernetic eyes"
desc = "artificial photoreceptors with specialized functionality"
icon_state = "eye_implant"
implant_overlay = "eye_implant_overlay"
slot = "eye_sight"
parent_organ = "eyes"
w_class = 1
var/vision_flags = 0
var/list/eye_colour = list(0,0,0)
var/list/old_eye_colour = list(0,0,0)
var/flash_protect = 0
var/aug_message = "Your vision is augmented!"
/obj/item/organ/internal/cyberimp/eyes/proc/update_colour()
if(!owner)
return
eye_colour = list(
owner.r_eyes ? owner.r_eyes : 0,
owner.g_eyes ? owner.g_eyes : 0,
owner.b_eyes ? owner.b_eyes : 0
)
/obj/item/organ/internal/cyberimp/eyes/insert(var/mob/living/carbon/M, var/special = 0)
..()
if(istype(owner, /mob/living/carbon/human) && eye_colour)
var/mob/living/carbon/human/HMN = owner
old_eye_colour[1] = HMN.r_eyes
old_eye_colour[2] = HMN.g_eyes
old_eye_colour[2] = HMN.b_eyes
HMN.r_eyes = eye_colour[1]
HMN.g_eyes = eye_colour[2]
HMN.b_eyes = eye_colour[3]
HMN.update_eyes()
if(aug_message && !special)
owner << "<span class='notice'>[aug_message]</span>"
M.sight |= vision_flags
/obj/item/organ/internal/cyberimp/eyes/remove(var/mob/living/carbon/M, var/special = 0)
..()
M.sight ^= vision_flags
if(istype(owner,/mob/living/carbon/human) && eye_colour)
var/mob/living/carbon/human/HMN = owner
HMN.r_eyes = old_eye_colour[1]
HMN.g_eyes = old_eye_colour[2]
HMN.b_eyes = old_eye_colour[3]
HMN.update_eyes()
/obj/item/organ/internal/cyberimp/eyes/on_life()
..()
owner.sight |= vision_flags
/obj/item/organ/internal/cyberimp/eyes/emp_act(severity)
if(!owner)
return
if(severity > 1)
if(prob(10 * severity))
return
var/save_sight = owner.sight
owner.sight &= 0
owner.sdisabilities |= BLIND
owner << "<span class='warning'>Static obfuscates your vision!</span>"
spawn(60 / severity)
if(owner)
owner.sight |= save_sight
owner.sdisabilities ^= BLIND
/obj/item/organ/internal/cyberimp/eyes/xray
name = "X-ray implant"
desc = "These cybernetic eye implants will give you X-ray vision. Blinking is futile."
eye_colour = list(0, 0, 0)
implant_color = "#000000"
origin_tech = "materials=6;programming=4;biotech=6;magnets=5"
vision_flags = SEE_MOBS | SEE_OBJS | SEE_TURFS
/obj/item/organ/internal/cyberimp/eyes/thermals
name = "Thermals implant"
desc = "These cybernetic eye implants will give you Thermal vision. Vertical slit pupil included."
eye_colour = list(255, 204, 0)
implant_color = "#FFCC00"
vision_flags = SEE_MOBS
flash_protect = -1
origin_tech = "materials=6;programming=4;biotech=5;magnets=5;syndicate=4"
aug_message = "You see prey everywhere you look..."
// HUD implants
/obj/item/organ/internal/cyberimp/eyes/hud
name = "HUD implant"
desc = "These cybernetic eyes will display a HUD over everything you see. Maybe."
slot = "eye_hud"
var/HUD_type = 0
/obj/item/organ/internal/cyberimp/eyes/hud/insert(var/mob/living/carbon/M, var/special = 0)
..()
if(HUD_type)
var/datum/atom_hud/H = huds[HUD_type]
H.add_hud_to(M)
M.permanent_huds |= H
/obj/item/organ/internal/cyberimp/eyes/hud/remove(var/mob/living/carbon/M, var/special = 0)
..()
if(HUD_type)
var/datum/atom_hud/H = huds[HUD_type]
M.permanent_huds ^= H
H.remove_hud_from(M)
/obj/item/organ/internal/cyberimp/eyes/hud/medical
name = "Medical HUD implant"
desc = "These cybernetic eye implants will display a medical HUD over everything you see."
eye_colour = list(0,0,208)
implant_color = "#00FFFF"
origin_tech = "materials=4;programming=3;biotech=4"
aug_message = "You suddenly see health bars floating above people's heads..."
HUD_type = DATA_HUD_MEDICAL_ADVANCED
/obj/item/organ/internal/cyberimp/eyes/hud/security
name = "Security HUD implant"
desc = "These cybernetic eye implants will display a security HUD over everything you see."
eye_colour = list(208,0,0)
implant_color = "#CC0000"
origin_tech = "materials=4;programming=4;biotech=3;combat=1"
aug_message = "Job indicator icons pop up in your vision. That is not a certified surgeon..."
HUD_type = DATA_HUD_SECURITY_ADVANCED
// Welding shield implant
/obj/item/organ/internal/cyberimp/eyes/shield
name = "welding shield implant"
desc = "These reactive micro-shields will protect you from welders and flashes without obscuring your vision."
slot = "eye_shield"
origin_tech = "materials=4;biotech=3"
implant_color = "#101010"
flash_protect = 2
// Welding with thermals will still hurt your eyes a bit.
/obj/item/organ/internal/cyberimp/eyes/shield/emp_act(severity)
return
@@ -0,0 +1,345 @@
#define STUN_SET_AMOUNT 2
/obj/item/organ/internal/cyberimp
name = "cybernetic implant"
desc = "a state-of-the-art implant that improves a baseline's functionality"
status = ORGAN_ROBOT
var/implant_color = "#FFFFFF"
var/implant_overlay
tough = 1 //not easyly broken by combat damage
sterile = 1 //not very germy
/obj/item/organ/internal/cyberimp/New(var/mob/M = null)
if(iscarbon(M))
src.insert(M)
if(implant_overlay)
var/image/overlay = new /image(icon, implant_overlay)
overlay.color = implant_color
overlays |= overlay
return ..()
//[[[[BRAIN]]]]
/obj/item/organ/internal/cyberimp/brain
name = "cybernetic brain implant"
desc = "injectors of extra sub-routines for the brain"
icon_state = "brain_implant"
implant_overlay = "brain_implant_overlay"
parent_organ = "head"
/obj/item/organ/internal/cyberimp/brain/emp_act(severity)
if(!owner)
return
var/stun_amount = 5 + (severity-1 ? 0 : 5)
owner.Stun(stun_amount)
owner << "<span class='warning'>Your body seizes up!</span>"
return stun_amount
/obj/item/organ/internal/cyberimp/brain/anti_drop
name = "Anti-drop implant"
desc = "This cybernetic brain implant will allow you to force your hand muscles to contract, preventing item dropping. Twitch ear to toggle."
var/active = 0
var/l_hand_ignore = 0
var/r_hand_ignore = 0
var/obj/item/l_hand_obj = null
var/obj/item/r_hand_obj = null
implant_color = "#DE7E00"
slot = "brain_antidrop"
origin_tech = "materials=5;programming=4;biotech=4"
organ_action_name = "Toggle Anti-Drop"
/obj/item/organ/internal/cyberimp/brain/anti_drop/ui_action_click()
active = !active
if(active)
l_hand_obj = owner.l_hand
r_hand_obj = owner.r_hand
if(l_hand_obj)
if(owner.l_hand.flags & NODROP)
l_hand_ignore = 1
else
owner.l_hand.flags |= NODROP
l_hand_ignore = 0
if(r_hand_obj)
if(owner.r_hand.flags & NODROP)
r_hand_ignore = 1
else
owner.r_hand.flags |= NODROP
r_hand_ignore = 0
if(!l_hand_obj && !r_hand_obj)
owner << "<span class='notice'>You are not holding any items, your hands relax...</span>"
active = 0
else
var/msg = 0
msg += !l_hand_ignore && l_hand_obj ? 1 : 0
msg += !r_hand_ignore && r_hand_obj ? 2 : 0
switch(msg)
if(1)
owner << "<span class='notice'>Your left hand's grip tightens.</span>"
if(2)
owner << "<span class='notice'>Your right hand's grip tightens.</span>"
if(3)
owner << "<span class='notice'>Both of your hand's grips tighten.</span>"
else
release_items()
owner << "<span class='notice'>Your hands relax...</span>"
l_hand_obj = null
r_hand_obj = null
/obj/item/organ/internal/cyberimp/brain/anti_drop/emp_act(severity)
if(!owner)
return
var/range = severity ? 10 : 5
var/atom/A
var/obj/item/L_item = owner.l_hand
var/obj/item/R_item = owner.r_hand
release_items()
..()
if(L_item)
A = pick(oview(range))
L_item.throw_at(A, range, 2)
owner << "<span class='notice'>Your left arm spasms and throws the [L_item.name]!</span>"
if(R_item)
A = pick(oview(range))
R_item.throw_at(A, range, 2)
owner << "<span class='notice'>Your right arm spasms and throws the [R_item.name]!</span>"
/obj/item/organ/internal/cyberimp/brain/anti_drop/proc/release_items()
if(!l_hand_ignore && l_hand_obj in owner.contents)
l_hand_obj.flags ^= NODROP
if(!r_hand_ignore && r_hand_obj in owner.contents)
r_hand_obj.flags ^= NODROP
/obj/item/organ/internal/cyberimp/brain/anti_drop/remove(var/mob/living/carbon/M, special = 0)
..()
if(active)
ui_action_click()
/obj/item/organ/internal/cyberimp/brain/anti_stun
name = "CNS Rebooter implant"
desc = "This implant will automatically give you back control over your central nervous system, reducing downtime when stunned."
implant_color = "#FFFF00"
slot = "brain_antistun"
origin_tech = "materials=6;programming=4;biotech=5"
/obj/item/organ/internal/cyberimp/brain/anti_stun/on_life()
..()
if(crit_fail)
return
if(owner.stunned > STUN_SET_AMOUNT)
owner.stunned = STUN_SET_AMOUNT
if(owner.weakened > STUN_SET_AMOUNT)
owner.weakened = STUN_SET_AMOUNT
/obj/item/organ/internal/cyberimp/brain/anti_stun/emp_act(severity)
if(crit_fail)
return
crit_fail = 1
spawn(90 / severity)
crit_fail = 0
//[[[[CHEST]]]]
/obj/item/organ/internal/cyberimp/chest
name = "cybernetic torso implant"
desc = "implants for the organs in your torso"
icon_state = "chest_implant"
implant_overlay = "chest_implant_overlay"
parent_organ = "chest"
/obj/item/organ/internal/cyberimp/chest/nutriment
name = "Nutriment pump implant"
desc = "This implant with synthesize and pump into your bloodstream a small amount of nutriment when you are starving."
icon_state = "chest_implant"
implant_color = "#00AA00"
var/hunger_threshold = 150
var/synthesizing = 0
var/poison_amount = 5
slot = "stomach"
origin_tech = "materials=5;programming=3;biotech=4"
/obj/item/organ/internal/cyberimp/chest/nutriment/on_life()
if(!owner)
return
if(synthesizing)
return
if(owner.stat == DEAD)
return
if(owner.nutrition <= hunger_threshold)
synthesizing = 1
owner << "<span class='notice'>You feel less hungry...</span>"
owner.nutrition += 50
spawn(50)
synthesizing = 0
/obj/item/organ/internal/cyberimp/chest/nutriment/emp_act(severity)
if(!owner)
return
owner.reagents.add_reagent("????",poison_amount / severity) //food poisoning
owner << "<span class='warning'>You feel like your insides are burning.</span>"
/obj/item/organ/internal/cyberimp/chest/nutriment/plus
name = "Nutriment pump implant PLUS"
desc = "This implant will synthesize and pump into your bloodstream a small amount of nutriment when you are hungry."
icon_state = "chest_implant"
implant_color = "#006607"
hunger_threshold = 250
poison_amount = 10
origin_tech = "materials=5;programming=3;biotech=5"
/obj/item/organ/internal/cyberimp/chest/reviver
name = "Reviver implant"
desc = "This implant will attempt to revive you if you lose consciousness. For the faint of heart!"
icon_state = "chest_implant"
implant_color = "#AD0000"
origin_tech = "materials=6;programming=3;biotech=6;syndicate=4"
slot = "heartdrive"
var/revive_cost = 0
var/reviving = 0
var/cooldown = 0
/obj/item/organ/internal/cyberimp/chest/reviver/on_life()
if(reviving)
if(owner.stat == UNCONSCIOUS)
spawn(30)
if(prob(90) && owner.getOxyLoss())
owner.adjustOxyLoss(-3)
revive_cost += 5
if(prob(75) && owner.getBruteLoss())
owner.adjustBruteLoss(-1)
revive_cost += 20
if(prob(75) && owner.getFireLoss())
owner.adjustFireLoss(-1)
revive_cost += 20
if(prob(40) && owner.getToxLoss())
owner.adjustToxLoss(-1)
revive_cost += 50
else
cooldown = revive_cost + world.time
reviving = 0
return
if(cooldown > world.time)
return
if(owner.stat != UNCONSCIOUS)
return
if(owner.suiciding)
return
revive_cost = 0
reviving = 1
/obj/item/organ/internal/cyberimp/chest/reviver/emp_act(severity)
if(!owner)
return
if(reviving)
revive_cost += 200
else
cooldown += 200
if(istype(owner, /mob/living/carbon/human))
var/mob/living/carbon/human/H = owner
if(H.stat != DEAD && prob(50 / severity))
H.heart_attack = 1
spawn(600 / severity)
H.heart_attack = 0
if(H.stat == CONSCIOUS)
H << "<span class='notice'>You feel your heart beating again!</span>"
//ARM...THAT GO IN THE CHEST
/obj/item/organ/internal/cyberimp/chest/arm_mod//dummy parent item for making arm-mod implants. works best with nodrop items that are sent to nullspace upon being dropped.
name = "Arm-mounted item implant"
desc = "You shouldn't see this! Adminhelp and report this as an issue on github!"
icon_state = "chest_implant"
implant_color = "#007ACC"
slot = "shoulders"
origin_tech = "materials=5;biotech=4;powerstorage=4"
organ_action_name = "Toggle Arm Mod"
var/obj/holder//is defined as the retractable item itself. ensure this is defined somewhere!
var/out = 0//determines if the item is in the owner's hand or not
var/overloaded = 0//is set to 1 when owner gets EMPed. if set to 1, implant doesn't work.
var/lasthand = null
/obj/item/organ/internal/cyberimp/chest/arm_mod/ui_action_click()
if(overloaded)//ensure the implant isn't broken
owner << "<span class='warning'>The implant doesn't respond. It seems to be broken...</span>"
return
if(out)//check if the owner has the item out already
owner.unEquip(holder, 1)//if he does, take it away. then,
holder.loc = null//stash it in nullspace
out = 0//and set this to clarify the item isn't out.
owner.visible_message("<span class='notice'>[owner] retracts [holder].</span>","<span class='notice'>You retract [holder].</span>")
playsound(get_turf(owner), 'sound/mecha/mechmove03.ogg', 50, 1)
else//if he doesn't have the item out
if(owner.put_in_hands(holder))//put it in his hands.
lasthand = owner.get_active_hand()
out = 1
owner.visible_message("<span class='notice'>[owner] extends [holder]!</span>","<span class='notice'>You extend [holder]!</span>")
playsound(get_turf(owner), 'sound/mecha/mechmove03.ogg', 50, 1)
else//if this fails to put the item in his hands,
holder.loc = null//keep it in nullspace
owner << "<span class='warning'>You can't extend [holder] if you can't use your hands!</span>"
/obj/item/organ/internal/cyberimp/chest/arm_mod/emp_act(severity)//if the implant gets EMPed...
if(!owner || overloaded)//ensure that it's in an owner and that it's not already EMPed, then...
return
if(out)//check if he has the item out...
owner.unEquip(holder, 1)//if he does, take it away.
holder.loc = null
out = 0
owner.visible_message("<span class='notice'>[holder] forcibly retracts into [owner]'s arm.</span>")
owner.visible_message("<span class='danger'>A loud bang comes from [owner]...</span>")
playsound(get_turf(owner), 'sound/effects/bang.ogg', 100, 1)
owner << "<span class='warning'>You feel an explosion erupt inside you as your chest implant breaks. Is it hot in here?</span>"
owner.adjust_fire_stacks(20)
owner.IgniteMob()//ignite the owner, as well as
owner.say("AUUUUUUUUUUUUUUUUUUGH!!")
if(prob(50))
if(lasthand == "r_hand")
var/obj/item/organ/external/limb = owner.get_organ("r_arm")
limb.droplimb(0, DROPLIMB_EDGE)
else if(lasthand == "l_hand")
var/obj/item/organ/external/limb = owner.get_organ("l_arm")
limb.droplimb(0, DROPLIMB_EDGE)
owner.say("I HAVE BEEN DISARMED!!!")
owner.adjustFireLoss(25)//severely injure him!
overloaded = 1//then make sure this can't happen again by breaking the implant.
/obj/item/organ/internal/cyberimp/chest/arm_mod/tase//mounted, self-charging taser!
name = "Arm-cannon taser implant"
desc = "A variant of the arm cannon implant that fires electrodes and disabler shots. The cannon emerges from the subject's arms and remains in the shoulders when not in use."
icon_state = "armcannon_tase_implant"
origin_tech = "materials=5;combat=5;biotech=4;powerstorage=4"
organ_action_name = "Toggle Arm Cannon Taser"
/obj/item/organ/internal/cyberimp/chest/arm_mod/tase/New()//when the implant is created...
holder = new /obj/item/weapon/gun/energy/advtaser/mounted(src)//assign a brand new item to it. (in this case, a gun)
/obj/item/organ/internal/cyberimp/chest/arm_mod/lase//mounted, self-charging laser!
name = "Arm-cannon laser implant"
desc = "A variant of the arm cannon implant that fires lethal laser beams. The cannon emerges from the subject's arms and remains in the shoulders when not in use."
icon_state = "armcannon_lase_implant"
origin_tech = "materials=5;combat=5;biotech=4;powerstorage=4;syndicate=5"//this is kinda nutty and i might lower it
organ_action_name = "Toggle Arm Cannon Laser"
/obj/item/organ/internal/cyberimp/chest/arm_mod/lase/New()
holder = new /obj/item/weapon/gun/energy/laser/mounted(src)
//BOX O' IMPLANTS
/obj/item/weapon/storage/box/cyber_implants
name = "boxed cybernetic implants"
desc = "A sleek, sturdy box."
icon_state = "cyber_implants"
var/list/boxed = list(/obj/item/organ/internal/cyberimp/eyes/xray,/obj/item/organ/internal/cyberimp/eyes/thermals,
/obj/item/organ/internal/cyberimp/brain/anti_stun, /obj/item/organ/internal/cyberimp/chest/reviver)
var/amount = 5
/obj/item/weapon/storage/box/cyber_implants/New()
..()
var/i
var/implant
for(i = 0, i < amount, i++)
implant = pick(boxed)
new implant(src)
+360
View File
@@ -0,0 +1,360 @@
/****************************************************
BLOOD SYSTEM
****************************************************/
//Blood levels
var/const/BLOOD_VOLUME_SAFE = 501
var/const/BLOOD_VOLUME_OKAY = 336
var/const/BLOOD_VOLUME_BAD = 224
var/const/BLOOD_VOLUME_SURVIVE = 122
/mob/living/carbon/human/var/datum/reagents/vessel //Container for blood and BLOOD ONLY. Do not transfer other chems here.
/mob/living/carbon/human/var/var/pale = 0 //Should affect how mob sprite is drawn, but currently doesn't.
//Initializes blood vessels
/mob/living/carbon/human/proc/make_blood()
if(vessel)
return
vessel = new/datum/reagents(600)
vessel.my_atom = src
if(species && species.exotic_blood)
vessel.add_reagent(species.exotic_blood,560)
else
vessel.add_reagent("blood",560)
spawn(1)
fixblood()
//Resets blood data
/mob/living/carbon/human/proc/fixblood()
for(var/datum/reagent/blood/B in vessel.reagent_list)
if(B.id == "blood")
B.data = list( "donor"=src,"viruses"=null,"blood_DNA"=dna.unique_enzymes,"blood_colour"= species.blood_color,"blood_type"=dna.b_type, \
"resistances"=null,"trace_chem"=null, "virus2" = null, "antibodies" = null)
B.color = B.data["blood_colour"]
// Takes care blood loss and regeneration
/mob/living/carbon/human/proc/handle_blood()
var/blood_volume
if(species && species.flags & NO_BLOOD)
return
if(stat != DEAD && bodytemperature >= 170) //Dead or cryosleep people do not pump the blood.
if(species.exotic_blood)
blood_volume = round(vessel.get_reagent_amount(species.exotic_blood))
if(blood_volume < 560 && blood_volume)
var/datum/reagent/water/W = locate() in vessel.reagent_list //Grab some blood
if(W) // Make sure there's some blood at all
W.volume += 0.1 // regenerate blood VERY slowly
if (reagents.has_reagent("nutriment")) //Getting food speeds it up
W.volume += 0.4
reagents.remove_reagent("nutriment", 0.1)
else
blood_volume = round(vessel.get_reagent_amount("blood"))
//Blood regeneration if there is some space
if(blood_volume < 560 && blood_volume)
var/datum/reagent/blood/B = locate() in vessel.reagent_list //Grab some blood
if(B) // Make sure there's some blood at all
if(src.mind) //Handles vampires "eating" blood that isn't their own.
if(src.mind in ticker.mode.vampires)
for(var/datum/reagent/blood/BL in vessel.reagent_list)
if(src.nutrition >= 450)
break //We don't want blood tranfusions making vampires fat.
if(BL.data["donor"] != src)
src.nutrition += (15 * REAGENTS_METABOLISM)
BL.volume -= REAGENTS_METABOLISM
if(BL.volume <= 0)
qdel(BL)
break //Only process one blood per tick, to maintain the same metabolism as nutriment for non-vampires.
if(B.data["donor"] != src) //If it's not theirs, then we look for theirs
for(var/datum/reagent/blood/D in vessel.reagent_list)
if(D.data["donor"] == src)
B = D
break
B.volume += 0.1 // regenerate blood VERY slowly
if (reagents.has_reagent("nutriment")) //Getting food speeds it up
B.volume += 0.4
reagents.remove_reagent("nutriment", 0.1)
if (reagents.has_reagent("iron")) //Hematogen candy anyone?
B.volume += 0.8
reagents.remove_reagent("iron", 0.1)
if (reagents.has_reagent("salglu_solution")) //saline is good for blood regeneration
if(prob(33))
B.volume += 1.0
// Damaged heart virtually reduces the blood volume, as the blood isn't
// being pumped properly anymore.
var/obj/item/organ/internal/heart/heart = get_int_organ(/obj/item/organ/internal/heart)
if(heart)
if(heart.damage > 1 && heart.damage < heart.min_bruised_damage)
blood_volume *= 0.8
else if(heart.damage >= heart.min_bruised_damage && heart.damage < heart.min_broken_damage)
blood_volume *= 0.6
else if(heart.damage >= heart.min_broken_damage && heart.damage < INFINITY)
blood_volume *= 0.3
//Effects of bloodloss
switch(blood_volume)
if(BLOOD_VOLUME_SAFE to 10000)
if(pale)
pale = 0
update_body()
if(BLOOD_VOLUME_OKAY to BLOOD_VOLUME_SAFE)
if(!pale)
pale = 1
update_body()
var/word = pick("dizzy","woosey","faint")
src << "\red You feel [word]"
if(prob(1))
var/word = pick("dizzy","woosey","faint")
src << "\red You feel [word]"
if(oxyloss < 20)
oxyloss += 3
if(BLOOD_VOLUME_BAD to BLOOD_VOLUME_OKAY)
if(!pale)
pale = 1
update_body()
eye_blurry += 6
if(oxyloss < 50)
oxyloss += 10
oxyloss += 1
if(prob(15))
Paralyse(rand(1,3))
var/word = pick("dizzy","woosey","faint")
src << "\red You feel very [word]"
if(BLOOD_VOLUME_SURVIVE to BLOOD_VOLUME_BAD)
if(!pale)
pale = 1
update_body()
if(oxyloss > 20)
eye_blurry += 6
oxyloss += 12
if(prob(15))
Paralyse(rand(1,3))
var/word = pick("dizzy","woosey","faint")
src << "\red You feel extremely [word]"
if(0 to BLOOD_VOLUME_SURVIVE)
death()
// Without enough blood you slowly go hungry.
if(blood_volume < BLOOD_VOLUME_SAFE)
if(nutrition >= 300)
nutrition -= 10
else if(nutrition >= 200)
nutrition -= 3
//Bleeding out
var/blood_max = 0
for(var/obj/item/organ/external/temp in organs)
if(!(temp.status & ORGAN_BLEEDING) || temp.status & ORGAN_ROBOT)
continue
for(var/datum/wound/W in temp.wounds) if(W.bleeding())
blood_max += W.damage / 4
if (temp.open)
blood_max += 2 //Yer stomach is cut open
drip(blood_max)
//Makes a blood drop, leaking certain amount of blood from the mob
/mob/living/carbon/human/proc/drip(var/amt as num)
if(species && species.flags & NO_BLOOD) //TODO: Make drips come from the reagents instead.
return
if(!amt)
return
var/amm = 0.1 * amt
var/turf/T = get_turf(src)
if(src.species.exotic_blood)
vessel.remove_reagent(species.exotic_blood,amm)
vessel.reaction(T, TOUCH, amm)
return
else
vessel.remove_reagent("blood",amm)
blood_splatter(src,src)
/****************************************************
BLOOD TRANSFERS
****************************************************/
//Gets blood from mob to the container, preserving all data in it.
/mob/living/carbon/proc/take_blood(obj/item/weapon/reagent_containers/container, var/amount)
var/datum/reagent/B = get_blood(container.reagents)
if(!B) B = new /datum/reagent/blood
B.holder = container
B.volume += amount
//set reagent data
B.data["donor"] = src
if (!B.data["virus2"])
B.data["virus2"] = list()
B.data["virus2"] |= virus_copylist(src.virus2)
B.data["antibodies"] = src.antibodies
B.data["blood_DNA"] = copytext(src.dna.unique_enzymes,1,0)
B.data["blood_type"] = copytext(src.dna.b_type,1,0)
// Putting this here due to return shenanigans.
if(istype(src,/mob/living/carbon/human))
var/mob/living/carbon/human/H = src
B.data["blood_colour"] = H.species.blood_color
B.color = B.data["blood_colour"]
var/list/temp_chem = list()
for(var/datum/reagent/R in src.reagents.reagent_list)
temp_chem += R.id
temp_chem[R.id] = R.volume
B.data["trace_chem"] = list2params(temp_chem)
return B
//For humans, blood does not appear from blue, it comes from vessels.
/mob/living/carbon/human/take_blood(obj/item/weapon/reagent_containers/container, var/amount)
if(src.species.exotic_blood)
if(vessel.get_reagent_amount(src.species.exotic_blood) < amount)
return null
var/datum/reagent/W = new /datum/reagent
W.holder = container
W.volume += amount
var/list/temp_chem = list()
for(var/datum/reagent/R in src.reagents.reagent_list)
temp_chem += R.id
temp_chem[R.id] = R.volume
W.data["trace_chem"] = list2params(temp_chem)
vessel.remove_reagent(src.species.exotic_blood,amount) // Removes blood if human
return W
if(species && species.flags & NO_BLOOD)
return null
else
if(vessel.get_reagent_amount("blood") < amount)
return null
. = ..()
vessel.remove_reagent("blood",amount) // Removes blood if human
//Transfers blood from container ot vessels
/mob/living/carbon/proc/inject_blood(obj/item/weapon/reagent_containers/container, var/amount)
var/datum/reagent/blood/injected = get_blood(container.reagents)
if (!injected)
return
var/list/sniffles = virus_copylist(injected.data["virus2"])
for(var/ID in sniffles)
var/datum/disease2/disease/sniffle = sniffles[ID]
infect_virus2(src,sniffle,1)
if (injected.data["antibodies"] && prob(5))
antibodies |= injected.data["antibodies"]
var/list/chems = list()
chems = params2list(injected.data["trace_chem"])
for(var/C in chems)
src.reagents.add_reagent(C, (text2num(chems[C]) / 560) * amount)//adds trace chemicals to owner's blood
reagents.update_total()
container.reagents.remove_reagent("blood", amount)
//Transfers blood from container ot vessels, respecting blood types compatability.
/mob/living/carbon/human/inject_blood(obj/item/weapon/reagent_containers/container, var/amount)
var/datum/reagent/blood/injected = get_blood(container.reagents)
if(species && species.flags & NO_BLOOD)
reagents.add_reagent("blood", amount, injected.data)
reagents.update_total()
return
var/datum/reagent/blood/our = get_blood(vessel)
if (!injected || !our)
return
if(blood_incompatible(injected.data["blood_type"],our.data["blood_type"]) )
reagents.add_reagent("toxin",amount * 0.5)
reagents.update_total()
else
vessel.add_reagent("blood", amount, injected.data)
vessel.update_total()
..()
//Gets human's own blood.
/mob/living/carbon/proc/get_blood(datum/reagents/container)
var/datum/reagent/blood/res = locate() in container.reagent_list //Grab some blood
if(res) // Make sure there's some blood at all
if(res.data["donor"] != src) //If it's not theirs, then we look for theirs
for(var/datum/reagent/blood/D in container.reagent_list)
if(D.data["donor"] == src)
return D
return res
/proc/blood_incompatible(donor,receiver)
var/donor_antigen = copytext(donor,1,lentext(donor))
var/receiver_antigen = copytext(receiver,1,lentext(receiver))
var/donor_rh = findtext("+",donor)
var/receiver_rh = findtext("+",receiver)
if(donor_rh && !receiver_rh) return 1
switch(receiver_antigen)
if("A")
if(donor_antigen != "A" && donor_antigen != "O") return 1
if("B")
if(donor_antigen != "B" && donor_antigen != "O") return 1
if("O")
if(donor_antigen != "O") return 1
//AB is a universal receiver.
return 0
proc/blood_splatter(var/target,var/datum/reagent/blood/source,var/large)
var/obj/effect/decal/cleanable/blood/B
var/decal_type = /obj/effect/decal/cleanable/blood/splatter
var/turf/T = get_turf(target)
if(istype(source,/mob/living/carbon/human))
var/mob/living/carbon/human/M = source
source = M.get_blood(M.vessel)
// Are we dripping or splattering?
var/list/drips = list()
// Only a certain number of drips (or one large splatter) can be on a given turf.
for(var/obj/effect/decal/cleanable/blood/drip/drop in T)
drips |= drop.drips
qdel(drop)
if(!large && drips.len < 3)
decal_type = /obj/effect/decal/cleanable/blood/drip
// Find a blood decal or create a new one.
B = locate(decal_type) in T
if(!B)
B = new decal_type(T)
var/obj/effect/decal/cleanable/blood/drip/drop = B
if(istype(drop) && drips && drips.len && !large)
drop.overlays |= drips
drop.drips |= drips
// If there's no data to copy, call it quits here.
if(!source)
return B
// Update appearance.
if(source.data["blood_colour"])
B.basecolor = source.data["blood_colour"]
B.update_icon()
// Update blood information.
if(source.data["blood_DNA"])
B.blood_DNA = list()
if(source.data["blood_type"])
B.blood_DNA[source.data["blood_DNA"]] = source.data["blood_type"]
else
B.blood_DNA[source.data["blood_DNA"]] = "O+"
// Update virus information.
if(source.data["virus2"])
B.virus2 = virus_copylist(source.data["virus2"])
return B
+53
View File
@@ -0,0 +1,53 @@
/obj/item/organ/internal/body_egg
name = "body egg"
desc = "All slimy and yuck."
icon_state = "innards"
origin_tech = "biotech=5"
parent_organ = "chest"
slot = "parasite_egg"
/obj/item/organ/internal/body_egg/on_find(mob/living/finder)
..()
finder << "<span class='warning'>You found an unknown alien organism in [owner]'s [parent_organ]!</span>"
/obj/item/organ/internal/body_egg/New(loc)
if(iscarbon(loc))
insert(loc)
return ..()
/obj/item/organ/internal/body_egg/insert(var/mob/living/carbon/M, special = 0)
..()
owner.status_flags |= XENO_HOST
processing_objects.Add(src)
owner.med_hud_set_status()
spawn(0)
AddInfectionImages(owner)
/obj/item/organ/internal/body_egg/remove(var/mob/living/carbon/M, special = 0)
processing_objects.Remove(src)
if(owner)
owner.status_flags &= ~(XENO_HOST)
owner.med_hud_set_status()
spawn(0)
RemoveInfectionImages(owner)
..()
/obj/item/organ/internal/body_egg/process()
if(!owner) return
if(!(src in owner.internal_organs))
remove(owner)
return
egg_process()
/obj/item/organ/internal/body_egg/proc/egg_process()
return
/obj/item/organ/internal/body_egg/proc/RefreshInfectionImage()
RemoveInfectionImages()
AddInfectionImages()
/obj/item/organ/internal/body_egg/proc/AddInfectionImages()
return
/obj/item/organ/internal/body_egg/proc/RemoveInfectionImages()
return
+43
View File
@@ -0,0 +1,43 @@
/mob/proc/get_int_organ(typepath) //int stands for internal
return
/mob/proc/get_organs_zone(zone)
return
/mob/proc/get_organ_slot(slot) //is it a brain, is it a brain_tumor?
return
/mob/proc/get_int_organ_tag(tag) //is it a brain, is it a brain_tumor?
return
/mob/living/carbon/get_int_organ(typepath)
return (locate(typepath) in internal_organs)
/mob/living/carbon/get_organs_zone(zone, var/subzones = 0)
var/list/returnorg = list()
if(subzones)
// Include subzones - groin for chest, eyes and mouth for head
//Fethas note:We have check_zone, i may need to remove the below
if(zone == "head")
returnorg = get_organs_zone("eyes") + get_organs_zone("mouth")
if(zone == "chest")
returnorg = get_organs_zone("groin")
for(var/obj/item/organ/internal/O in internal_organs)
if(zone == O.parent_organ)
returnorg += O
return returnorg
/mob/living/carbon/get_organ_slot(slot)
for(var/obj/item/organ/internal/O in internal_organs)
if(slot == O.slot)
return O
/mob/living/carbon/get_int_organ_tag(tag)
for(var/obj/item/organ/internal/O in internal_organs)
if(tag == O.organ_tag)
return O
/proc/is_int_organ(atom/A)
return istype(A, /obj/item/organ/internal)
+310
View File
@@ -0,0 +1,310 @@
var/list/organ_cache = list()
/obj/item/organ
name = "organ"
icon = 'icons/obj/surgery.dmi'
var/dead_icon
var/mob/living/carbon/human/owner = null
var/status = 0
var/vital //Lose a vital limb, die immediately.
var/damage = 0 // amount of damage to the organ
var/min_bruised_damage = 10
var/min_broken_damage = 30
var/max_damage
var/organ_tag = "organ"
var/parent_organ = "chest"
var/robotic = 0 //For being a robot
var/list/datum/autopsy_data/autopsy_data = list()
var/list/trace_chemicals = list() // traces of chemicals in the organ,
// links chemical IDs to number of ticks for which they'll stay in the blood
germ_level = 0
var/datum/dna/dna
var/datum/species/species
// Stuff for tracking if this is on a tile with an open freezer or not
var/last_freezer_update_time = 0
var/freezer_update_period = 100
var/is_in_freezer = 0
var/sterile = 0 //can the organ be infected by germs?
var/tough = 0 //can organ be easily damaged?
/obj/item/organ/proc/update_health()
return
/obj/item/organ/New(var/mob/living/carbon/holder)
..(holder)
create_reagents(5)
if(!max_damage)
max_damage = min_broken_damage * 2
if(istype(holder))
species = all_species["Human"]
if(holder.dna)
dna = holder.dna.Clone()
species = all_species[dna.species]
else
log_to_dd("[src] at [loc] spawned without a proper DNA.")
var/mob/living/carbon/human/H = holder
if(istype(H))
if(dna)
if(!blood_DNA)
blood_DNA = list()
blood_DNA[dna.unique_enzymes] = dna.b_type
/obj/item/organ/proc/set_dna(var/datum/dna/new_dna)
if(new_dna)
dna = new_dna.Clone()
blood_DNA.Cut()
blood_DNA[dna.unique_enzymes] = dna.b_type
/obj/item/organ/proc/die()
if(status & ORGAN_ROBOT)
return
damage = max_damage
status |= ORGAN_DEAD
processing_objects -= src
if(dead_icon)
icon_state = dead_icon
if(owner && vital)
owner.death()
/obj/item/organ/process()
//dead already, no need for more processing
if(status & ORGAN_DEAD)
return
if(is_preserved())
return
//Process infections
if ((status & ORGAN_ROBOT) || (sterile) ||(owner && owner.species && (owner.species.flags & IS_PLANT)))
germ_level = 0
return
if(!owner)
if(reagents)
var/datum/reagent/blood/B = locate(/datum/reagent/blood) in reagents.reagent_list
if(B && prob(40))
reagents.remove_reagent("blood",0.1)
blood_splatter(src,B,1)
// Maybe scale it down a bit, have it REALLY kick in once past the basic infection threshold
// Another mercy for surgeons preparing transplant organs
germ_level++
if(germ_level >= INFECTION_LEVEL_ONE)
germ_level += rand(2,6)
if(germ_level >= INFECTION_LEVEL_TWO)
germ_level += rand(2,6)
if(germ_level >= INFECTION_LEVEL_THREE)
die()
if(damage >= max_damage)
die()
else if(owner.bodytemperature >= 170) //cryo stops germs from moving and doing their bad stuffs
//** Handle antibiotics and curing infections
handle_antibiotics()
handle_germ_effects()
//check if we've hit max_damage
if(damage >= max_damage)
die()
/obj/item/organ/proc/is_preserved()
if(istype(loc,/obj/item/device/mmi))
germ_level = max(0, germ_level - 1) // So a brain can slowly recover from being left out of an MMI
return 1
if(is_found_within(/obj/item/bodybag/cryobag))
return 1
if(is_found_within(/obj/structure/closet/crate/freezer))
return 1
if(istype(loc,/turf))
if(world.time - last_freezer_update_time > freezer_update_period)
// I don't want to loop through everything in the tile constantly, especially since it'll be a pile of organs
// if the virologist releases gibbingtons again or something
// There's probably a much less silly way of doing this, but BYOND native algorithms are stupidly naive
is_in_freezer = 0
for(var/obj/structure/closet/crate/freezer/F in loc.contents)
if(F.opened)
is_in_freezer = 1 // on the same tile, close enough, should keep organs much fresher on avg
break
last_freezer_update_time = world.time
return is_in_freezer // I'd like static varibles, please
// You can do your cool location temperature organ preserving effects here!
return 0
/obj/item/organ/examine(mob/user)
..(user)
if(status & ORGAN_DEAD)
user << "<span class='notice'>The decay has set in.</span>"
/obj/item/organ/proc/handle_germ_effects()
//** Handle the effects of infections
var/antibiotics = owner.reagents.get_reagent_amount("spaceacillin")
if (germ_level > 0 && germ_level < INFECTION_LEVEL_ONE/2 && prob(30))
germ_level--
if (germ_level >= INFECTION_LEVEL_ONE/2)
//aiming for germ level to go from ambient to INFECTION_LEVEL_TWO in an average of 15 minutes
if(antibiotics < 5 && prob(round(germ_level/6)))
germ_level++
if(germ_level >= INFECTION_LEVEL_ONE)
var/fever_temperature = (owner.species.heat_level_1 - owner.species.body_temperature - 5)* min(germ_level/INFECTION_LEVEL_TWO, 1) + owner.species.body_temperature
owner.bodytemperature += between(0, (fever_temperature - T20C)/BODYTEMP_COLD_DIVISOR + 1, fever_temperature - owner.bodytemperature)
if (germ_level >= INFECTION_LEVEL_TWO)
var/obj/item/organ/external/parent = owner.get_organ(parent_organ)
//spread germs
if (antibiotics < 5 && parent.germ_level < germ_level && ( parent.germ_level < INFECTION_LEVEL_ONE*2 || prob(30) ))
parent.germ_level++
if (prob(3)) //about once every 30 seconds
take_damage(1,silent=prob(30))
/obj/item/organ/proc/receive_chem(chemical as obj)
return 0
/obj/item/organ/proc/rejuvenate()
damage = 0
germ_level = 0
/obj/item/organ/proc/is_damaged()
return damage > 0
/obj/item/organ/proc/is_bruised()
return damage >= min_bruised_damage
/obj/item/organ/proc/is_broken()
return (damage >= min_broken_damage || (status & ORGAN_CUT_AWAY) || ((status & ORGAN_BROKEN) && !(status & ORGAN_SPLINTED)))
//Germs
/obj/item/organ/proc/handle_antibiotics()
var/antibiotics = owner.reagents.get_reagent_amount("spaceacillin")
if (!germ_level || antibiotics <= 0.4)
return
if (germ_level < INFECTION_LEVEL_ONE)
germ_level = 0 //cure instantly
else if (germ_level < INFECTION_LEVEL_TWO)
germ_level -= 24 //at germ_level == 500, this should cure the infection in 15 seconds
else
germ_level -= 8 // at germ_level == 1000, this will cure the infection in 1 minute, 15 seconds
// Let's not drag this on, medbay has only so much antibiotics
//Adds autopsy data for used_weapon.
/obj/item/organ/proc/add_autopsy_data(var/used_weapon, var/damage)
var/datum/autopsy_data/W = autopsy_data[used_weapon]
if(!W)
W = new()
W.weapon = used_weapon
autopsy_data[used_weapon] = W
W.hits += 1
W.damage += damage
W.time_inflicted = world.time
//Note: external organs have their own version of this proc
/obj/item/organ/proc/take_damage(amount, var/silent=0)
if(tough)
return
if(src.status & ORGAN_ROBOT)
src.damage = between(0, src.damage + (amount * 0.8), max_damage)
else
src.damage = between(0, src.damage + amount, max_damage)
//only show this if the organ is not robotic
if(owner && parent_organ && amount > 0)
var/obj/item/organ/external/parent = owner.get_organ(parent_organ)
if(parent && !silent)
owner.custom_pain("Something inside your [parent.name] hurts a lot.", 1)
/obj/item/organ/proc/robotize() //Being used to make robutt hearts, etc
robotic = 2
src.status &= ~ORGAN_BROKEN
src.status &= ~ORGAN_BLEEDING
src.status &= ~ORGAN_SPLINTED
src.status &= ~ORGAN_CUT_AWAY
src.status &= ~ORGAN_ATTACHABLE
src.status &= ~ORGAN_DESTROYED
src.status |= ORGAN_ROBOT
src.status |= ORGAN_ASSISTED
/obj/item/organ/proc/mechassist() //Used to add things like pacemakers, etc
robotize()
src.status &= ~ORGAN_ROBOT
robotic = 1
min_bruised_damage = 15
min_broken_damage = 35
/obj/item/organ/emp_act(severity)
if(!(status & ORGAN_ROBOT))
return
switch (severity)
if (1.0)
take_damage(0,20)
return
if (2.0)
take_damage(0,7)
return
if(3.0)
take_damage(0,3)
/obj/item/organ/proc/remove(var/mob/living/user,special = 0)
if(!istype(owner))
return
owner.internal_organs -= src
var/obj/item/organ/external/affected = owner.get_organ(parent_organ)
if(affected) affected.internal_organs -= src
loc = get_turf(owner)
processing_objects |= src
var/datum/reagent/blood/organ_blood
if(reagents) organ_blood = locate(/datum/reagent/blood) in reagents.reagent_list
if(!organ_blood || !organ_blood.data["blood_DNA"])
owner.vessel.trans_to(src, 5, 1, 1)
if(owner && vital && is_primary_organ()) // I'd do another check for species or whatever so that you couldn't "kill" an IPC by removing a human head from them, but it doesn't matter since they'll come right back from the dead
if(user)
user.attack_log += "\[[time_stamp()]\]<font color='red'> removed a vital organ ([src]) from [key_name(owner)] (INTENT: [uppertext(user.a_intent)])</font>"
owner.attack_log += "\[[time_stamp()]\]<font color='orange'> had a vital organ ([src]) removed by [key_name(user)] (INTENT: [uppertext(user.a_intent)])</font>"
msg_admin_attack("[key_name_admin(user)] removed a vital organ ([src]) from [key_name_admin(owner)]")
owner.death()
owner = null
/obj/item/organ/proc/replaced(var/mob/living/carbon/human/target,var/obj/item/organ/external/affected)
if(!istype(target)) return
owner = target
processing_objects -= src
affected.internal_organs |= src
if (!target.get_int_organ(src))
target.internal_organs += src
src.loc = target
if(robotic)
status |= ORGAN_ROBOT
/obj/item/organ/proc/surgeryize()
return
/*
Returns 1 if this is the organ that is handling all the functionalities of that particular organ slot
Returns 0 if it isn't
I use this so that this can be made better once the organ overhaul rolls out -- Crazylemon
*/
/obj/item/organ/proc/is_primary_organ(var/mob/living/carbon/human/O = null)
if (isnull(O))
O = owner
if (!istype(owner)) // You're not the primary organ of ANYTHING, bucko
return 0
return src == O.get_int_organ(organ_tag)
@@ -0,0 +1,940 @@
/****************************************************
EXTERNAL ORGANS
****************************************************/
/obj/item/organ/external
name = "external"
min_broken_damage = 30
max_damage = 0
dir = SOUTH
organ_tag = "limb"
var/brute_mod = 1
var/burn_mod = 1
var/icon_name = null
var/body_part = null
var/icon_position = 0
var/model
var/force_icon
var/damage_state = "00"
var/brute_dam = 0
var/burn_dam = 0
var/max_size = 0
var/last_dam = -1
var/icon/mob_icon
var/gendered_icon = 0
var/limb_name
var/disfigured = 0
var/cannot_amputate
var/cannot_break
var/s_tone
var/list/s_col = list()
var/list/wounds = list()
var/number_wounds = 0 // cache the number of wounds, which is NOT wounds.len!
var/perma_injury = 0
// 0: Don't fail when at full damage
// 1: Neatly pop off at full damage, stop damage propogation
// 2: Disintegrate at full damage, continue damage propogation
var/fail_at_full_damage = 0
var/obj/item/organ/external/parent
var/list/obj/item/organ/external/children
// Internal organs of this body part
var/list/internal_organs = list()
var/damage_msg = "\red You feel an intense pain"
var/broken_description
var/open = 0
var/stage = 0
var/cavity = 0
var/sabotaged = 0 //If a prosthetic limb is emagged, it will detonate when it fails.
var/encased // Needs to be opened with a saw to access the organs.
var/obj/item/hidden = null
var/list/implants = list()
// how often wounds should be updated, a higher number means less often
var/wound_update_accuracy = 1
var/amputation_point // Descriptive string used in amputation.
var/can_grasp
var/can_stand
/obj/item/organ/external/Destroy()
if(parent && parent.children)
parent.children -= src
if(internal_organs)
for(var/obj/item/organ/internal/O in internal_organs)
internal_organs -= O
O.remove(owner,special = 1)
if(children)
for(var/obj/item/organ/external/C in children)
qdel(C)
return ..()
/obj/item/organ/external/attackby(obj/item/weapon/W as obj, mob/user as mob)
switch(stage)
if(0)
if(istype(W,/obj/item/weapon/scalpel))
spread_germs_to_organ(src,user)
user.visible_message("<span class='danger'><b>[user]</b> cuts [src] open with [W]!")
stage++
return
if(1)
if(istype(W,/obj/item/weapon/retractor))
spread_germs_to_organ(src,user)
user.visible_message("<span class='danger'><b>[user]</b> cracks [src] open like an egg with [W]!")
stage++
return
if(2)
if(istype(W,/obj/item/weapon/hemostat))
spread_germs_to_organ(src,user)
if(contents.len)
var/obj/item/removing = pick(contents)
removing.loc = get_turf(user.loc)
var/obj/item/organ/internal/O = removing
if(istype(O))
O.status |= ORGAN_CUT_AWAY
if(!O.sterile)
spread_germs_to_organ(O,user) // This wouldn't be any cleaner than the actual surgery
O.forceMove(src)
if(!(user.l_hand && user.r_hand))
user.put_in_hands(removing)
user.visible_message("<span class='danger'><b>[user]</b> extracts [removing] from [src] with [W]!")
else
user.visible_message("<span class='danger'><b>[user]</b> fishes around fruitlessly in [src] with [W].")
return
..()
/obj/item/organ/external/update_health()
damage = min(max_damage, (brute_dam + burn_dam))
return
/obj/item/organ/external/New(var/mob/living/carbon/holder)
..()
if(istype(holder, /mob/living/carbon/human))
replaced(holder)
sync_colour_to_human(holder)
spawn(1)
get_icon()
/obj/item/organ/external/replaced(var/mob/living/carbon/human/target)
owner = target
status = status & ~ORGAN_DESTROYED
forceMove(owner)
if(istype(owner))
owner.organs_by_name[limb_name] = src
owner.organs |= src
for(var/obj/item/organ/organ in src)
if(istype(src, /obj/item/organ/internal))
var/obj/item/organ/internal/I = organ
if(target.get_organ_slot(I.slot))
continue // Just leave it inside its limb, so brains with brainmobs in them don't get voided.
organ.replaced(owner,src)
if(parent_organ)
parent = owner.organs_by_name[src.parent_organ]
if(parent)
if(!parent.children)
parent.children = list()
parent.children.Add(src)
//Remove all stump wounds since limb is not missing anymore
for(var/datum/wound/lost_limb/W in parent.wounds)
parent.wounds -= W
qdel(W)
break
parent.update_damages()
/****************************************************
DAMAGE PROCS
****************************************************/
/obj/item/organ/external/take_damage(brute, burn, sharp, edge, used_weapon = null, list/forbidden_limbs = list())
if((brute <= 0) && (burn <= 0))
return 0
if(status & ORGAN_DESTROYED)
return 0
brute *= brute_mod
burn *= burn_mod
// Threshold needed to have a chance of hurting internal bits with something sharp
var/const/sharp_thresh_int_dmg = 5
// Threshold needed to have a chance of hurting internal bits
var/const/thresh_int_dmg = 10
// Probability of taking internal damage from sufficient force, while otherwise healthy
var/const/dmg_prob = 5
// Probability of taking internal damage when hit while lacking encasing bones
var/const/no_bone_dmg_prob = 30
// High brute damage or sharp objects may damage internal organs
if(internal_organs && (brute_dam >= max_damage || (((sharp && brute >= sharp_thresh_int_dmg) || brute >= thresh_int_dmg) && prob(dmg_prob)) || (!encased && prob(no_bone_dmg_prob))))
// Damage an internal organ
if(internal_organs && internal_organs.len)
var/obj/item/organ/internal/I = pick(internal_organs)
if(!I.tough)//mostly for cybernetic organs
I.take_damage(brute / 2)
brute -= brute / 2
if(status & ORGAN_BROKEN && prob(40) && brute)
owner.emote("scream") //getting hit on broken hand hurts
if(used_weapon)
add_autopsy_data("[used_weapon]", brute + burn)
var/can_cut = (prob(brute*2) || sharp) && !(status & ORGAN_ROBOT)
// If the limbs can break, make sure we don't exceed the maximum damage a limb can take before breaking
if((brute_dam + burn_dam + brute + burn) < max_damage || !config.limbs_can_break)
if(brute)
if(can_cut)
createwound( CUT, brute )
else
createwound( BRUISE, brute )
if(burn)
createwound( BURN, burn )
else
//If we can't inflict the full amount of damage, spread the damage in other ways
//How much damage can we actually cause?
var/can_inflict = max_damage * config.organ_health_multiplier - (brute_dam + burn_dam)
if(can_inflict)
if (brute > 0)
//Inflict all burte damage we can
if(can_cut)
createwound( CUT, min(brute,can_inflict) )
else
createwound( BRUISE, min(brute,can_inflict) )
var/temp = can_inflict
//How much mroe damage can we inflict
can_inflict = max(0, can_inflict - brute)
//How much brute damage is left to inflict
brute = max(0, brute - temp)
if (burn > 0 && can_inflict)
//Inflict all burn damage we can
createwound(BURN, min(burn,can_inflict))
//How much burn damage is left to inflict
burn = max(0, burn - can_inflict)
//If there are still hurties to dispense
if (burn || brute)
if (fail_at_full_damage == 1 && body_part != UPPER_TORSO && body_part != LOWER_TORSO)
droplimb(1) //Clean loss, just drop the limb and be done
else
//List organs we can pass it to
var/list/obj/item/organ/external/possible_points = list()
if(parent)
possible_points += parent
if(children) for(var/organ in children)
if(organ) possible_points += organ
if(forbidden_limbs.len)
possible_points -= forbidden_limbs
if(possible_points.len)
//And pass the pain around
var/obj/item/organ/external/target = pick(possible_points)
target.take_damage(brute, burn, sharp, edge, used_weapon, forbidden_limbs + src)
if(fail_at_full_damage == 2 && body_part != UPPER_TORSO && body_part != LOWER_TORSO)
var/losstype
if(burn > brute)
losstype = DROPLIMB_BURN
else
losstype = DROPLIMB_BLUNT
droplimb(0, losstype) // less clean than a robot arm, doesn't buffer damage either
// sync the organ's damage with its wounds
src.update_damages()
var/mob/living/carbon/owner_old = owner //Need to update health, but need a reference in case the below check cuts off a limb.
//If limb took enough damage, try to cut or tear it off
if(owner && loc == owner)
if(!cannot_amputate && config.limbs_can_break && (brute_dam) >= (max_damage * config.organ_health_multiplier))
if(prob(brute / 2))
if(edge)
droplimb(0,DROPLIMB_EDGE)
if(owner_old) owner_old.updatehealth()
return update_icon()
/obj/item/organ/external/proc/heal_damage(brute, burn, internal = 0, robo_repair = 0)
if(status & ORGAN_ROBOT && !robo_repair)
return
//Heal damage on the individual wounds
for(var/datum/wound/W in wounds)
if(brute == 0 && burn == 0)
break
// heal brute damage
if(W.damage_type == CUT || W.damage_type == BRUISE)
brute = W.heal_damage(brute)
else if(W.damage_type == BURN)
burn = W.heal_damage(burn)
if(internal)
status &= ~ORGAN_BROKEN
perma_injury = 0
/*
if((brute || burn) && children && children.len && (owner.species.flags & REGENERATES_LIMBS))
var/obj/item/organ/external/stump/S = locate() in children
if(S)
//world << "Extra healing to go around ([brute+burn]) and [owner] needs a replacement limb."
*/
//Sync the organ's damage with its wounds
src.update_damages()
owner.updatehealth()
var/result = update_icon()
return result
/*
This function completely restores a damaged organ to perfect condition.
*/
/obj/item/organ/external/rejuvenate()
damage_state = "00"
if(status & 128) //Robotic organs stay robotic. Fix because right click rejuvinate makes IPC's organs organic.
status = 128
else
status = 0
perma_injury = 0
brute_dam = 0
burn_dam = 0
// handle internal organs
for(var/obj/item/organ/internal/current_organ in internal_organs)
current_organ.rejuvenate()
// remove embedded objects and drop them on the floor
for(var/obj/implanted_object in implants)
if(!istype(implanted_object,/obj/item/weapon/implant)) // We don't want to remove REAL implants. Just shrapnel etc.
implanted_object.loc = owner.loc
implants -= implanted_object
owner.updatehealth()
update_icon()
/obj/item/organ/external/proc/createwound(var/type = CUT, var/damage)
if(damage == 0) return
//moved this before the open_wound check so that having many small wounds for example doesn't somehow protect you from taking internal damage
//Possibly trigger an internal wound, too.
var/local_damage = brute_dam + burn_dam + damage
if(damage > 15 && type != BURN && local_damage > 30 && prob(damage) && !(status & ORGAN_ROBOT))
var/datum/wound/internal_bleeding/I = new ()
wounds += I
owner.custom_pain("You feel something rip in your [name]!", 1)
// first check whether we can widen an existing wound
if(wounds.len > 0 && prob(max(50+(number_wounds-1)*10,90)))
if((type == CUT || type == BRUISE) && damage >= 5)
//we need to make sure that the wound we are going to worsen is compatible with the type of damage...
var/list/compatible_wounds = list()
for (var/datum/wound/W in wounds)
if (W.can_worsen(type, damage))
compatible_wounds += W
if(compatible_wounds.len)
var/datum/wound/W = pick(compatible_wounds)
W.open_wound(damage)
if(prob(25))
if(status & ORGAN_ROBOT)
owner.visible_message("<span class='alert'>The damage to [owner.name]'s [name] worsens.</span>",\
"<span class='alert'>The damage to your [name] worsens.</span>",\
"You hear the screech of abused metal.")
else
owner.visible_message("<span class='alert'>The wound on [owner.name]'s [name] widens with a nasty ripping noise.</span>",\
"<span class='alert'>The wound on your [name] widens with a nasty ripping noise.</span>",\
"You hear a nasty ripping noise, as if flesh is being torn apart.")
return
//Creating wound
var/wound_type = get_wound_type(type, damage)
if(wound_type)
var/datum/wound/W = new wound_type(damage)
//Check whether we can add the wound to an existing wound
for(var/datum/wound/other in wounds)
if(other.can_merge(W))
other.merge_wound(W)
W = null // to signify that the wound was added
break
if(W)
wounds += W
/****************************************************
PROCESSING & UPDATING
****************************************************/
//Determines if we even need to process this organ.
/obj/item/organ/external/proc/need_process()
if(status & (ORGAN_CUT_AWAY|ORGAN_GAUZED|ORGAN_BLEEDING|ORGAN_BROKEN|ORGAN_DESTROYED|ORGAN_SPLINTED|ORGAN_DEAD|ORGAN_MUTATED))
return 1
if(brute_dam || burn_dam)
return 1
if(last_dam != brute_dam + burn_dam) // Process when we are fully healed up.
last_dam = brute_dam + burn_dam
return 1
else
last_dam = brute_dam + burn_dam
if(germ_level)
return 1
return 0
/obj/item/organ/external/process()
if(owner)
if(parent)
if(parent.status & ORGAN_DESTROYED)
status |= ORGAN_DESTROYED
owner.update_body(1)
return
// Process wounds, doing healing etc. Only do this every few ticks to save processing power
if(owner.life_tick % wound_update_accuracy == 0)
update_wounds()
//Chem traces slowly vanish
if(owner.life_tick % 10 == 0)
for(var/chemID in trace_chemicals)
trace_chemicals[chemID] = trace_chemicals[chemID] - 1
if(trace_chemicals[chemID] <= 0)
trace_chemicals.Remove(chemID)
if(!(status & ORGAN_BROKEN))
perma_injury = 0
//Infections
update_germs()
else
..()
//Updating germ levels. Handles organ germ levels and necrosis.
/*
The INFECTION_LEVEL values defined in setup.dm control the time it takes to reach the different
infection levels. Since infection growth is exponential, you can adjust the time it takes to get
from one germ_level to another using the rough formula:
desired_germ_level = initial_germ_level*e^(desired_time_in_seconds/1000)
So if I wanted it to take an average of 15 minutes to get from level one (100) to level two
I would set INFECTION_LEVEL_TWO to 100*e^(15*60/1000) = 245. Note that this is the average time,
the actual time is dependent on RNG.
INFECTION_LEVEL_ONE below this germ level nothing happens, and the infection doesn't grow
INFECTION_LEVEL_TWO above this germ level the infection will start to spread to internal and adjacent organs
INFECTION_LEVEL_THREE above this germ level the player will take additional toxin damage per second, and will die in minutes without
antitox. also, above this germ level you will need to overdose on spaceacillin to reduce the germ_level.
Note that amputating the affected organ does in fact remove the infection from the player's body.
*/
/obj/item/organ/external/proc/update_germs()
if(status & (ORGAN_ROBOT|ORGAN_DESTROYED) || (owner.species && owner.species.flags & IS_PLANT)) //Robotic limbs shouldn't be infected, nor should nonexistant limbs.
germ_level = 0
return
if(owner.bodytemperature >= 170) //cryo stops germs from moving and doing their bad stuffs
//** Syncing germ levels with external wounds
handle_germ_sync()
//** Handle antibiotics and curing infections
handle_antibiotics()
//** Handle the effects of infections
handle_germ_effects()
/obj/item/organ/external/proc/handle_germ_sync()
var/antibiotics = owner.reagents.get_reagent_amount("spaceacillin")
for(var/datum/wound/W in wounds)
//Open wounds can become infected
if (owner.germ_level > W.germ_level && W.infection_check())
W.germ_level++
if (antibiotics < 5)
for(var/datum/wound/W in wounds)
//Infected wounds raise the organ's germ level
if (W.germ_level > germ_level)
germ_level++
break //limit increase to a maximum of one per second
/obj/item/organ/external/handle_germ_effects()
if(germ_level < INFECTION_LEVEL_TWO)
return ..()
var/antibiotics = owner.reagents.get_reagent_amount("spaceacillin")
if(germ_level >= INFECTION_LEVEL_TWO)
//spread the infection to internal organs
var/obj/item/organ/internal/target_organ = null //make internal organs become infected one at a time instead of all at once
for (var/obj/item/organ/internal/I in internal_organs)
if (I.germ_level > 0 && I.germ_level < min(germ_level, INFECTION_LEVEL_TWO)) //once the organ reaches whatever we can give it, or level two, switch to a different one
if (!target_organ || I.germ_level > target_organ.germ_level) //choose the organ with the highest germ_level
target_organ = I
if (!target_organ)
//figure out which organs we can spread germs to and pick one at random
var/list/candidate_organs = list()
for (var/obj/item/organ/internal/I in internal_organs)
if (I.germ_level < germ_level)
candidate_organs |= I
if (candidate_organs.len)
target_organ = pick(candidate_organs)
if (target_organ)
target_organ.germ_level++
//spread the infection to child and parent organs
if (children)
for (var/obj/item/organ/external/child in children)
if (child.germ_level < germ_level && !(child.status & ORGAN_ROBOT))
if (child.germ_level < INFECTION_LEVEL_ONE*2 || prob(30))
child.germ_level++
if (parent)
if (parent.germ_level < germ_level && !(parent.status & ORGAN_ROBOT))
if (parent.germ_level < INFECTION_LEVEL_ONE*2 || prob(30))
parent.germ_level++
if(germ_level >= INFECTION_LEVEL_THREE && antibiotics < 30) //overdosing is necessary to stop severe infections
if (!(status & ORGAN_DEAD))
status |= ORGAN_DEAD
owner << "<span class='notice'>You can't feel your [name] anymore...</span>"
owner.update_body(1)
germ_level++
owner.adjustToxLoss(1)
//Updating wounds. Handles wound natural I had some free spachealing, internal bleedings and infections
/obj/item/organ/external/proc/update_wounds()
if((status & ORGAN_ROBOT)) //Robotic limbs don't heal or get worse.
return
for(var/datum/wound/W in wounds)
// wounds can disappear after 10 minutes at the earliest
if(W.damage <= 0 && W.created + 10 * 10 * 60 <= world.time)
wounds -= W
continue
// let the GC handle the deletion of the wound
// Internal wounds get worse over time. Low temperatures (cryo) stop them.
if(W.internal && !W.can_autoheal() && owner.bodytemperature >= 170)
var/bicardose = owner.reagents.get_reagent_amount("styptic_powder")
if(!bicardose) //styptic powder stops internal wounds from growing bigger with time, and also stop bleeding
W.open_wound(0.1 * wound_update_accuracy)
owner.vessel.remove_reagent("blood",0.05 * W.damage * wound_update_accuracy)
owner.vessel.remove_reagent("blood",0.02 * W.damage * wound_update_accuracy)
if(prob(1 * wound_update_accuracy))
owner.custom_pain("You feel a stabbing pain in your [name]!",1)
//overdose of styptic powder begins healing IB
if(owner.reagents.get_reagent_amount("styptic_powder") >= 30)
W.damage = max(0, W.damage - 0.2)
// slow healing
var/heal_amt = 0
// if damage >= 50 AFTER treatment then it's probably too severe to heal within the timeframe of a round.
if (W.can_autoheal() && W.wound_damage() < 50)
heal_amt += 0.5
//we only update wounds once in [wound_update_accuracy] ticks so have to emulate realtime
heal_amt = heal_amt * wound_update_accuracy
//configurable regen speed woo, no-regen hardcore or instaheal hugbox, choose your destiny
heal_amt = heal_amt * config.organ_regeneration_multiplier
// amount of healing is spread over all the wounds
heal_amt = heal_amt / (wounds.len + 1)
// making it look prettier on scanners
heal_amt = round(heal_amt,0.1)
W.heal_damage(heal_amt)
// Salving also helps against infection
if(W.germ_level > 0 && W.salved && prob(2))
W.disinfected = 1
W.germ_level = 0
// sync the organ's damage with its wounds
src.update_damages()
if (update_icon())
owner.UpdateDamageIcon(1)
//Updates brute_damn and burn_damn from wound damages. Updates BLEEDING status.
/obj/item/organ/external/proc/update_damages()
number_wounds = 0
brute_dam = 0
burn_dam = 0
status &= ~ORGAN_BLEEDING
var/clamped = 0
var/mob/living/carbon/human/H
if(istype(owner,/mob/living/carbon/human))
H = owner
for(var/datum/wound/W in wounds)
if(W.damage_type == CUT || W.damage_type == BRUISE)
brute_dam += W.damage
else if(W.damage_type == BURN)
burn_dam += W.damage
if(!(status & ORGAN_ROBOT) && W.bleeding())
W.bleed_timer--
if(H && (H.species.flags & NO_BLOOD)) // Bloodless organic races are finicky
W.clamped = 1
W.bleed_timer = 0
else
status |= ORGAN_BLEEDING
clamped |= W.clamped
number_wounds += W.amount
if (open && !clamped && (H && !(H.species.flags & NO_BLOOD)))
status |= ORGAN_BLEEDING
//Bone fractures
if(config.bones_can_break && brute_dam > min_broken_damage * config.organ_health_multiplier && !(status & ORGAN_ROBOT))
src.fracture()
// new damage icon system
// returns just the brute/burn damage code
/obj/item/organ/external/proc/damage_state_text()
if(status & ORGAN_DESTROYED)
return "--"
var/tburn = 0
var/tbrute = 0
if(burn_dam ==0)
tburn =0
else if (burn_dam < (max_damage * 0.25 / 2))
tburn = 1
else if (burn_dam < (max_damage * 0.75 / 2))
tburn = 2
else
tburn = 3
if (brute_dam == 0)
tbrute = 0
else if (brute_dam < (max_damage * 0.25 / 2))
tbrute = 1
else if (brute_dam < (max_damage * 0.75 / 2))
tbrute = 2
else
tbrute = 3
return "[tbrute][tburn]"
/****************************************************
DISMEMBERMENT
****************************************************/
//Handles dismemberment
/obj/item/organ/external/proc/droplimb(var/clean, var/disintegrate, var/ignore_children, var/nodamage)
if(cannot_amputate || !owner)
return
if(!disintegrate)
disintegrate = DROPLIMB_EDGE
switch(disintegrate)
if(DROPLIMB_EDGE)
if(!clean)
var/gore_sound = "[(status & ORGAN_ROBOT) ? "tortured metal" : "ripping tendons and flesh"]"
owner.visible_message(
"<span class='danger'>\The [owner]'s [src.name] flies off in an arc!</span>",\
"<span class='moderate'><b>Your [src.name] goes flying off!</b></span>",\
"<span class='danger'>You hear a terrible sound of [gore_sound].</span>")
if(DROPLIMB_BURN)
var/gore = "[(status & ORGAN_ROBOT) ? "": " of burning flesh"]"
owner.visible_message(
"<span class='danger'>\The [owner]'s [src.name] flashes away into ashes!</span>",\
"<span class='moderate'><b>Your [src.name] flashes away into ashes!</b></span>",\
"<span class='danger'>You hear a crackling sound[gore].</span>")
if(DROPLIMB_BLUNT)
var/gore = "[(status & ORGAN_ROBOT) ? "": " in shower of gore"]"
var/gore_sound = "[(status & ORGAN_ROBOT) ? "rending sound of tortured metal" : "sickening splatter of gore"]"
owner.visible_message(
"<span class='danger'>\The [owner]'s [src.name] explodes[gore]!</span>",\
"<span class='moderate'><b>Your [src.name] explodes[gore]!</b></span>",\
"<span class='danger'>You hear the [gore_sound].</span>")
var/mob/living/carbon/human/victim = owner //Keep a reference for post-removed().
remove(null, ignore_children)
victim.traumatic_shock += 30
wounds.Cut()
if(parent && !nodamage)
var/datum/wound/lost_limb/W = new (src, disintegrate, clean)
parent.children -= src
if(clean)
parent.wounds |= W
parent.update_damages()
else
var/obj/item/organ/external/stump/stump = new (victim, 0, src)
if(status & ORGAN_ROBOT)
stump.robotize()
stump.wounds |= W
victim.organs |= stump
stump.update_damages()
parent = null
spawn(1)
if(victim)
victim.updatehealth()
victim.UpdateDamageIcon()
victim.regenerate_icons()
dir = 2
switch(disintegrate)
if(DROPLIMB_EDGE)
compile_icon()
add_blood(victim)
var/matrix/M = matrix()
M.Turn(rand(180))
src.transform = M
if(!clean)
// Throw limb around.
if(src && istype(loc,/turf))
throw_at(get_edge_target_turf(src,pick(alldirs)),rand(1,3),30)
dir = 2
return
else
qdel(src) // If you flashed away to ashes, YOU FLASHED AWAY TO ASHES
return
/****************************************************
HELPERS
****************************************************/
/obj/item/organ/external/proc/is_stump()
return 0
/obj/item/organ/external/proc/release_restraints(var/mob/living/carbon/human/holder)
if(!holder)
holder = owner
if(!holder)
return
if (holder.handcuffed && body_part in list(ARM_LEFT, ARM_RIGHT, HAND_LEFT, HAND_RIGHT))
holder.visible_message(\
"\The [holder.handcuffed.name] falls off of [holder.name].",\
"\The [holder.handcuffed.name] falls off you.")
holder.unEquip(holder.handcuffed)
if (holder.legcuffed && body_part in list(FOOT_LEFT, FOOT_RIGHT, LEG_LEFT, LEG_RIGHT))
holder.visible_message(\
"\The [holder.legcuffed.name] falls off of [holder.name].",\
"\The [holder.legcuffed.name] falls off you.")
holder.unEquip(holder.legcuffed)
/obj/item/organ/external/proc/bandage()
var/rval = 0
src.status &= ~ORGAN_BLEEDING
for(var/datum/wound/W in wounds)
if(W.internal) continue
rval |= !W.bandaged
W.bandaged = 1
return rval
/obj/item/organ/external/proc/disinfect()
var/rval = 0
for(var/datum/wound/W in wounds)
if(W.internal) continue
rval |= !W.disinfected
W.disinfected = 1
W.germ_level = 0
return rval
/obj/item/organ/external/proc/clamp()
var/rval = 0
src.status &= ~ORGAN_BLEEDING
for(var/datum/wound/W in wounds)
if(W.internal) continue
rval |= !W.clamped
W.clamped = 1
return rval
/obj/item/organ/external/proc/salve()
var/rval = 0
for(var/datum/wound/W in wounds)
rval |= !W.salved
W.salved = 1
return rval
/obj/item/organ/external/proc/fracture()
if(status & ORGAN_ROBOT)
return //ORGAN_BROKEN doesn't have the same meaning for robot limbs
if((status & ORGAN_BROKEN) || cannot_break)
return
if(owner)
owner.visible_message(\
"\red You hear a loud cracking sound coming from \the [owner].",\
"\red <b>Something feels like it shattered in your [name]!</b>",\
"You hear a sickening crack.")
if(owner.species && !(owner.species.flags & NO_PAIN))
owner.emote("scream")
status |= ORGAN_BROKEN
broken_description = pick("broken","fracture","hairline fracture")
perma_injury = brute_dam
// Fractures have a chance of getting you out of restraints
if (prob(25))
release_restraints()
/obj/item/organ/external/proc/mend_fracture()
if(status & ORGAN_ROBOT)
return 0 //ORGAN_BROKEN doesn't have the same meaning for robot limbs
if(brute_dam > min_broken_damage * config.organ_health_multiplier)
return 0 //will just immediately fracture again
status &= ~ORGAN_BROKEN
return 1
// I put these two next to each other to highlight that both exist. This should likely be resolved.
/obj/item/organ/external/robotize()
..()
//robot limbs take reduced damage
brute_mod = 0.66
burn_mod = 0.66
// Robot parts also lack bones
// This is so surgery isn't kaput, let's see how this does
encased = null
fail_at_full_damage = 1
/obj/item/organ/external/robotize(var/company)
..()
if(company && istext(company))
model = company
var/datum/robolimb/R = all_robolimbs[company]
if(R)
force_icon = R.icon
name = "[R.company] [initial(name)]"
desc = "[R.desc]"
cannot_break = 1
get_icon()
for (var/obj/item/organ/external/T in children)
if(T)
T.robotize()
/obj/item/organ/external/proc/mutate()
src.status |= ORGAN_MUTATED
if(owner) owner.update_body()
/obj/item/organ/external/proc/unmutate()
src.status &= ~ORGAN_MUTATED
if(owner) owner.update_body()
/obj/item/organ/external/proc/get_damage() //returns total damage
return max(brute_dam + burn_dam - perma_injury, perma_injury) //could use health?
/obj/item/organ/external/proc/has_infected_wound()
for(var/datum/wound/W in wounds)
if(W.germ_level > INFECTION_LEVEL_ONE)
return 1
return 0
/obj/item/organ/external/proc/is_usable()
if((status & ORGAN_ROBOT) && get_damage() >= max_damage) //robot limbs just become inoperable at max damage
return
return !(status & (ORGAN_DESTROYED|ORGAN_MUTATED|ORGAN_DEAD))
/obj/item/organ/external/proc/is_malfunctioning()
return ((status & ORGAN_ROBOT) && (brute_dam + burn_dam) >= 10 && prob(brute_dam + burn_dam))
/obj/item/organ/external/proc/embed(var/obj/item/weapon/W, var/silent = 0)
if(!owner || loc != owner)
return
if(!silent)
owner.visible_message("<span class='danger'>\The [W] sticks in the wound!</span>")
implants += W
owner.embedded_flag = 1
owner.verbs += /mob/proc/yank_out_object
W.add_blood(owner)
if(ismob(W.loc))
var/mob/living/H = W.loc
H.drop_item()
W.loc = owner
/obj/item/organ/external/proc/open_enough_for_surgery()
return (encased ? (open == 3) : (open == 2))
/obj/item/organ/external/remove(var/mob/living/user, var/ignore_children)
if(!owner)
return
var/is_robotic = status & ORGAN_ROBOT
var/mob/living/carbon/human/victim = owner
..()
status |= ORGAN_DESTROYED
victim.bad_external_organs -= src
for(var/implant in implants) //todo: check if this can be left alone
qdel(implant)
// Attached organs also fly off.
if(!ignore_children)
for(var/obj/item/organ/external/O in children)
O.remove()
if(O)
O.forceMove(src)
// Grab all the internal giblets too.
for(var/obj/item/organ/organ in internal_organs)
organ.remove()
organ.forceMove(src)
release_restraints(victim)
victim.organs -= src
if(is_primary_organ(victim))
victim.organs_by_name[limb_name] = null // Remove from owner's vars.
//Robotic limbs explode if sabotaged.
if(is_robotic && sabotaged)
victim.visible_message(
"<span class='danger'>\The [victim]'s [src.name] explodes violently!</span>",\
"<span class='danger'>Your [src.name] explodes!</span>",\
"<span class='danger'>You hear an explosion!</span>")
explosion(get_turf(owner),-1,-1,2,3)
var/datum/effect/system/spark_spread/spark_system = new /datum/effect/system/spark_spread()
spark_system.set_up(5, 0, victim)
spark_system.attach(owner)
spark_system.start()
spawn(10)
qdel(spark_system)
qdel(src)
/obj/item/organ/external/proc/disfigure(var/type = "brute")
if (disfigured)
return
if(owner)
if(type == "brute")
owner.visible_message("\red You hear a sickening cracking sound coming from \the [owner]'s [name].", \
"\red <b>Your [name] becomes a mangled mess!</b>", \
"\red You hear a sickening crack.")
else
owner.visible_message("\red \The [owner]'s [name] melts away, turning into mangled mess!", \
"\red <b>Your [name] melts away!</b>", \
"\red You hear a sickening sizzle.")
disfigured = 1
/obj/item/organ/external/is_primary_organ(var/mob/living/carbon/human/O = null)
if (isnull(O))
O = owner
if (!istype(O)) // You're not the primary organ of ANYTHING, bucko
return 0
return src == O.organs_by_name[limb_name]
+141
View File
@@ -0,0 +1,141 @@
var/global/list/limb_icon_cache = list()
/obj/item/organ/external/proc/compile_icon()
overlays.Cut()
// This is a kludge, only one icon has more than one generation of children though.
for(var/obj/item/organ/external/organ in contents)
if(organ.children && organ.children.len)
for(var/obj/item/organ/external/child in organ.children)
overlays += child.mob_icon
overlays += organ.mob_icon
/obj/item/organ/external/proc/sync_colour_to_human(var/mob/living/carbon/human/human)
s_tone = null
s_col = null
if(status & ORGAN_ROBOT && !(species && species.name == "Machine")) //machine people get skin color
return
if(species && human.species && species.name != human.species.name)
return
if(!isnull(human.s_tone) && (human.species.bodyflags & HAS_SKIN_TONE))
s_tone = human.s_tone
if(human.species.bodyflags & HAS_SKIN_COLOR)
s_col = list(human.r_skin, human.g_skin, human.b_skin)
/obj/item/organ/external/proc/sync_colour_to_dna()
s_tone = null
s_col = null
if(status & ORGAN_ROBOT)
return
if(!isnull(dna.GetUIValue(DNA_UI_SKIN_TONE)) && (species.flags & HAS_SKIN_TONE))
s_tone = dna.GetUIValue(DNA_UI_SKIN_TONE)
if(species.flags & HAS_SKIN_COLOR)
s_col = list(dna.GetUIValue(DNA_UI_SKIN_R), dna.GetUIValue(DNA_UI_SKIN_G), dna.GetUIValue(DNA_UI_SKIN_B))
/obj/item/organ/external/head/sync_colour_to_human(var/mob/living/carbon/human/human)
..()
var/obj/item/organ/internal/eyes/eyes = owner.get_int_organ(/obj/item/organ/internal/eyes)//owner.internal_organs_by_name["eyes"]
if(eyes) eyes.update_colour()
/obj/item/organ/external/head/remove()
get_icon()
..()
/obj/item/organ/external/head/get_icon()
..()
overlays.Cut()
if(!owner)
return
if(species.has_organ["eyes"])
var/obj/item/organ/internal/eyes/eyes = owner.get_int_organ(/obj/item/organ/internal/eyes)//owner.internal_organs_by_name["eyes"]
if(species.eyes)
var/icon/eyes_icon = new/icon('icons/mob/human_face.dmi', species.eyes)
if(eyes)
eyes_icon.Blend(rgb(eyes.eye_colour[1], eyes.eye_colour[2], eyes.eye_colour[3]), ICON_ADD)
else
eyes_icon.Blend(rgb(128,0,0), ICON_ADD)
mob_icon.Blend(eyes_icon, ICON_OVERLAY)
overlays |= eyes_icon
if(owner.lip_style && (species && (species.flags & HAS_LIPS)))
var/icon/lip_icon = new/icon('icons/mob/human_face.dmi', "lips_[owner.lip_style]_s")
overlays |= lip_icon
mob_icon.Blend(lip_icon, ICON_OVERLAY)
if(owner.f_style)
var/datum/sprite_accessory/facial_hair_style = facial_hair_styles_list[owner.f_style]
if(facial_hair_style && facial_hair_style.species_allowed && (species.name in facial_hair_style.species_allowed))
var/icon/facial_s = new/icon("icon" = facial_hair_style.icon, "icon_state" = "[facial_hair_style.icon_state]_s")
if(species.name == "Slime People") // I am el worstos
facial_s.Blend(rgb(owner.r_skin, owner.g_skin, owner.b_skin, 160), ICON_AND)
else if(facial_hair_style.do_colouration)
facial_s.Blend(rgb(owner.r_facial, owner.g_facial, owner.b_facial), ICON_ADD)
overlays |= facial_s
if(owner.h_style && !(owner.head && (owner.head.flags & BLOCKHEADHAIR)))
var/datum/sprite_accessory/hair_style = hair_styles_list[owner.h_style]
if(hair_style && (species.name in hair_style.species_allowed))
var/icon/hair_s = new/icon("icon" = hair_style.icon, "icon_state" = "[hair_style.icon_state]_s")
if(species.name == "Slime People") // I am el worstos
hair_s.Blend(rgb(owner.r_skin, owner.g_skin, owner.b_skin, 160), ICON_AND)
else if(hair_style.do_colouration)
hair_s.Blend(rgb(owner.r_hair, owner.g_hair, owner.b_hair), ICON_ADD)
overlays |= hair_s
return mob_icon
/obj/item/organ/external/proc/get_icon(var/skeletal)
var/gender
if(force_icon)
mob_icon = new /icon(force_icon, "[icon_name]")
if(species && species.name == "Machine") //snowflake for IPC's, sorry.
if(s_col && s_col.len >= 3)
mob_icon.Blend(rgb(s_col[1], s_col[2], s_col[3]), ICON_ADD)
else
if(!dna)
mob_icon = new /icon('icons/mob/human_races/r_human.dmi', "[icon_name][gendered_icon ? "_f" : ""]")
else
if(gendered_icon)
if(dna.GetUIState(DNA_UI_GENDER))
gender = "f"
else
gender = "m"
if(skeletal)
mob_icon = new /icon('icons/mob/human_races/r_skeleton.dmi', "[icon_name][gender ? "_[gender]" : ""]")
else if(status & ORGAN_ROBOT)
mob_icon = new /icon('icons/mob/human_races/robotic.dmi', "[icon_name][gender ? "_[gender]" : ""]")
else
if (status & ORGAN_MUTATED)
mob_icon = new /icon(species.deform, "[icon_name][gender ? "_[gender]" : ""]")
else
mob_icon = new /icon(species.icobase, "[icon_name][gender ? "_[gender]" : ""]")
if(status & ORGAN_DEAD)
mob_icon.ColorTone(rgb(10,50,0))
mob_icon.SetIntensity(0.7)
if(!isnull(s_tone))
if(s_tone >= 0)
mob_icon.Blend(rgb(s_tone, s_tone, s_tone), ICON_ADD)
else
mob_icon.Blend(rgb(-s_tone, -s_tone, -s_tone), ICON_SUBTRACT)
else if(s_col && s_col.len >= 3)
mob_icon.Blend(rgb(s_col[1], s_col[2], s_col[3]), ICON_ADD)
dir = EAST
icon = mob_icon
return mob_icon
// new damage icon system
// adjusted to set damage_state to brute/burn code only (without r_name0 as before)
/obj/item/organ/external/update_icon()
var/n_is = damage_state_text()
if (n_is != damage_state)
damage_state = n_is
return 1
return 0
@@ -0,0 +1,473 @@
#define PROCESS_ACCURACY 10
/obj/item/organ/internal
origin_tech = "biotech=2"
force = 1
w_class = 2
throwforce = 0
var/zone = "chest"
var/slot
vital = 0
var/organ_action_name = null
/obj/item/organ/internal/New(var/mob/living/carbon/holder)
if(istype(holder))
insert(holder)
..()
/obj/item/organ/internal/proc/insert(mob/living/carbon/M, special = 0)
if(!iscarbon(M) || owner == M)
return
var/obj/item/organ/internal/replaced = M.get_organ_slot(slot)
if(replaced)
replaced.remove(M, special = 1)
owner = M
M.internal_organs |= src
var/obj/item/organ/external/parent
if(istype(M, /mob/living/carbon/human))
var/mob/living/carbon/human/H = M
parent = H.get_organ(check_zone(parent_organ))
if(!istype(parent))
log_to_dd("[src] attempted to insert into a [parent], but [parent] wasn't an organ! Area: [get_area(M)]")
else
parent.internal_organs |= src
//M.internal_organs_by_name[src] |= src(H,1)
loc = null
if(organ_action_name)
action_button_name = organ_action_name
/obj/item/organ/internal/remove(mob/living/carbon/M, special = 0)
owner = null
if(M)
M.internal_organs -= src
if(vital && !special)
if(M.stat != DEAD)//safety check!
M.death()
if(istype(M, /mob/living/carbon/human))
var/mob/living/carbon/human/H = M
var/obj/item/organ/external/parent = H.get_organ(check_zone(parent_organ))
if(!istype(parent))
log_to_dd("[src] attempted to remove from a [parent], but [parent] didn't exist! Area: [get_area(M)], Mob: [M]")
else
parent.internal_organs -= src
if(organ_action_name)
action_button_name = null
/obj/item/organ/internal/replaced(var/mob/living/carbon/human/target,var/obj/item/organ/external/affected)
insert(target)
..()
/obj/item/organ/internal/proc/on_find(mob/living/finder)
return
/obj/item/organ/internal/proc/on_life()
return
/obj/item/organ/internal/Destroy()
if(owner)
remove(owner, 1)
return ..()
/obj/item/organ/internal/proc/prepare_eat()
var/obj/item/weapon/reagent_containers/food/snacks/organ/S = new
S.name = name
S.desc = desc
S.icon = icon
S.icon_state = icon_state
S.origin_tech = origin_tech
S.w_class = w_class
return S
/obj/item/weapon/reagent_containers/food/snacks/organ
name = "appendix"
icon_state = "appendix"
icon = 'icons/obj/surgery.dmi'
/obj/item/weapon/reagent_containers/food/snacks/organ/New()
..()
reagents.add_reagent("nutriment", 5)
/obj/item/organ/internal/Destroy()
if(owner)
remove(owner, 1)
return ..()
/obj/item/organ/internal/attack(mob/living/carbon/M, mob/user)
if(M == user && ishuman(user))
var/mob/living/carbon/human/H = user
var/obj/item/weapon/reagent_containers/food/snacks/S = prepare_eat()
if(S)
H.drop_item()
H.put_in_active_hand(S)
S.attack(H, H)
qdel(src)
else
..()
/****************************************************
INTERNAL ORGANS DEFINES
****************************************************/
// Brain is defined in brain_item.dm.
/obj/item/organ/internal/heart
name = "heart"
icon_state = "heart-on"
organ_tag = "heart"
parent_organ = "chest"
dead_icon = "heart-off"
vital = 1
var/beating = 0
/obj/item/organ/internal/heart/update_icon()
if(beating)
icon_state = "heart-on"
else
icon_state = "heart-off"
/obj/item/organ/internal/heart/insert(mob/living/carbon/M, special = 0)
..()
beating = 1
update_icon()
/obj/item/organ/internal/heart/remove(mob/living/carbon/M, special = 0)
..()
spawn(120)
beating = 0
update_icon()
/obj/item/organ/internal/heart/prepare_eat()
var/obj/S = ..()
S.icon_state = "heart-off"
return S
/obj/item/organ/internal/lungs
name = "lungs"
icon_state = "lungs"
gender = PLURAL
organ_tag = "lungs"
parent_organ = "chest"
slot = "lungs"
vital = 1
//Insert something neat here.
///obj/item/organ/internal/lungs/remove(mob/living/carbon/M, special = 0)
// owner.losebreath += 10
//insert oxy damage extream here.
// ..()
/obj/item/organ/internal/lungs/process()
..()
if(!owner)
return
if (germ_level > INFECTION_LEVEL_ONE)
if(prob(5))
owner.emote("cough") //respitory tract infection
if(is_bruised())
if(prob(2))
spawn owner.custom_emote(1, "coughs up blood!")
owner.drip(10)
if(prob(4))
spawn owner.custom_emote(1, "gasps for air!")
owner.losebreath += 5
/obj/item/organ/internal/kidneys
name = "kidneys"
icon_state = "kidneys"
gender = PLURAL
organ_tag = "kidneys"
parent_organ = "groin"
slot = "kidneys"
/obj/item/organ/internal/kidneys/process()
..()
if(!owner)
return
// Coffee is really bad for you with busted kidneys.
// This should probably be expanded in some way, but fucked if I know
// what else kidneys can process in our reagent list.
var/datum/reagent/coffee = locate(/datum/reagent/drink/coffee) in owner.reagents.reagent_list
if(coffee)
if(is_bruised())
owner.adjustToxLoss(0.1 * PROCESS_ACCURACY)
else if(is_broken())
owner.adjustToxLoss(0.3 * PROCESS_ACCURACY)
/obj/item/organ/internal/eyes
name = "eyeballs"
icon_state = "eyes"
gender = PLURAL
organ_tag = "eyes"
parent_organ = "head"
slot = "eyes"
var/list/eye_colour = list(0,0,0)
/obj/item/organ/internal/eyes/proc/update_colour()
if(!owner)
return
eye_colour = list(
owner.r_eyes ? owner.r_eyes : 0,
owner.g_eyes ? owner.g_eyes : 0,
owner.b_eyes ? owner.b_eyes : 0
)
/obj/item/organ/internal/eyes/insert(mob/living/carbon/M, special = 0)
// Apply our eye colour to the target.
if(istype(M) && eye_colour)
var/mob/living/carbon/human/eyes = M
eyes.r_eyes = eye_colour[1]
eyes.g_eyes = eye_colour[2]
eyes.b_eyes = eye_colour[3]
eyes.update_eyes()
..()
/obj/item/organ/internal/eyes/surgeryize()
if(!owner)
return
owner.disabilities &= ~NEARSIGHTED
owner.sdisabilities &= ~BLIND
owner.eye_blurry = 0
owner.eye_blind = 0
/obj/item/organ/internal/liver
name = "liver"
icon_state = "liver"
organ_tag = "liver"
parent_organ = "groin"
slot = "liver"
/obj/item/organ/internal/liver/process()
..()
if(!owner)
return
if (germ_level > INFECTION_LEVEL_ONE)
if(prob(1))
owner << "<span class='warning'> Your skin itches.</span>"
if (germ_level > INFECTION_LEVEL_TWO)
if(prob(1))
spawn owner.vomit()
if(owner.life_tick % PROCESS_ACCURACY == 0)
//High toxins levels are dangerous
if(owner.getToxLoss() >= 60 && !owner.reagents.has_reagent("charcoal"))
//Healthy liver suffers on its own
if (src.damage < min_broken_damage)
src.damage += 0.2 * PROCESS_ACCURACY
//Damaged one shares the fun
else
var/obj/item/organ/internal/O = pick(owner.internal_organs)
if(O)
O.damage += 0.2 * PROCESS_ACCURACY
//Detox can heal small amounts of damage
if (src.damage && src.damage < src.min_bruised_damage && owner.reagents.has_reagent("charcoal"))
src.damage -= 0.2 * PROCESS_ACCURACY
if(src.damage < 0)
src.damage = 0
// Get the effectiveness of the liver.
var/filter_effect = 3
if(is_bruised())
filter_effect -= 1
if(is_broken())
filter_effect -= 2
// Damaged liver means some chemicals are very dangerous
if(src.damage >= src.min_bruised_damage)
for(var/datum/reagent/R in owner.reagents.reagent_list)
// Ethanol and all drinks are bad
if(istype(R, /datum/reagent/ethanol))
owner.adjustToxLoss(0.1 * PROCESS_ACCURACY)
// Can't cope with toxins at all
for(var/toxin in list("toxin", "plasma", "sacid", "facid", "cyanide", "amanitin", "carpotoxin"))
if(owner.reagents.has_reagent(toxin))
owner.adjustToxLoss(0.3 * PROCESS_ACCURACY)
/obj/item/organ/internal/appendix
name = "appendix"
icon_state = "appendix"
organ_tag = "appendix"
parent_organ = "groin"
slot = "appendix"
/*
/obj/item/organ/internal/appendix/removed()
if(owner)
var/inflamed = 0
for(var/datum/disease/appendicitis/appendicitis in owner.viruses)
inflamed = 1
appendicitis.cure()
owner.resistances += appendicitis
if(inflamed)
icon_state = "appendixinflamed"
name = "inflamed appendix"
..()
*/
//shadowling tumor
/obj/item/organ/internal/shadowtumor
name = "black tumor"
desc = "A tiny black mass with red tendrils trailing from it. It seems to shrivel in the light."
icon_state = "blacktumor"
origin_tech = "biotech=4"
w_class = 1
parent_organ = "head"
slot = "brain_tumor"
health = 3
/obj/item/organ/internal/shadowtumor/New()
..()
processing_objects.Add(src)
/obj/item/organ/internal/shadowtumor/Destroy()
processing_objects.Remove(src)
return ..()
/obj/item/organ/internal/shadowtumor/process()
if(isturf(loc))
var/turf/T = loc
var/light_count = T.get_lumcount()*10
if(light_count > 4 && health > 0) //Die in the light
health--
else if(light_count < 2 && health < 3) //Heal in the dark
health++
if(health <= 0)
visible_message("<span class='warning'>[src] collapses in on itself!</span>")
qdel(src)
//debug and adminbus....
/obj/item/organ/internal/honktumor
name = "banana tumor"
desc = "A tiny yellow mass shaped like..a banana?"
icon_state = "honktumor"
origin_tech = "biotech=1"
w_class = 1
parent_organ = "head"
slot = "brain_tumor"
health = 3
var/organhonked = 0
/obj/item/organ/internal/honktumor/New()
..()
processing_objects.Add(src)
/obj/item/organ/internal/honktumor/insert(mob/living/carbon/M, special = 0)
..()
M.mutations.Add(CLUMSY)
M.mutations.Add(COMICBLOCK)
M.dna.SetSEState(CLUMSYBLOCK,1,1)
M.dna.SetSEState(COMICBLOCK,1,1)
genemutcheck(M,CLUMSYBLOCK,null,MUTCHK_FORCED)
genemutcheck(M,COMICBLOCK,null,MUTCHK_FORCED)
organhonked = world.time
/obj/item/organ/internal/honktumor/remove(mob/living/carbon/M, special = 0)
..()
M.mutations.Remove(CLUMSY)
M.mutations.Remove(COMICBLOCK)
M.dna.SetSEState(CLUMSYBLOCK,0)
M.dna.SetSEState(COMICBLOCK,0)
genemutcheck(M,CLUMSYBLOCK,null,MUTCHK_FORCED)
genemutcheck(M,COMICBLOCK,null,MUTCHK_FORCED)
/obj/item/organ/internal/honktumor/Destroy()
processing_objects.Remove(src)
return ..()
/obj/item/organ/internal/honktumor/process()
if(isturf(loc))
visible_message("<span class='warning'>[src] honks in on itself!</span>")
new /obj/item/weapon/bananapeel(get_turf(loc))
qdel(src)
/obj/item/organ/internal/honktumor/on_life()
if(!owner)
return
if(organhonked < world.time)
organhonked = world.time+900
owner << "<font color='red' size='7'>HONK</font>"
owner.sleeping = 0
owner.stuttering = 20
owner.ear_deaf = 30
owner.Weaken(3)
owner << 'sound/items/AirHorn.ogg'
if(prob(30))
owner.Stun(10)
owner.Paralyse(4)
else
owner.Jitter(500)
if(istype(owner, /mob/living/carbon/human))
var/mob/living/carbon/human/H = owner
if(isobj(H.shoes))
var/thingy = H.shoes
H.unEquip(H.shoes)
walk_away(thingy,H,15,2)
spawn(20)
if(thingy)
walk(thingy,0)
..()
/obj/item/organ/internal/beard
name = "beard organ"
desc = "Let they who is worthy wear the beard of Thorbjorndottir."
icon_state = "liver"
origin_tech = "biotech=1"
w_class = 1
parent_organ = "head"
slot = "hair_organ"
/obj/item/organ/internal/beard/on_life()
if(!owner)
return
if(istype(owner, /mob/living/carbon/human))
var/mob/living/carbon/human/H = owner
if(!(H.h_style == "Very Long Hair" || H.h_style == "Mowhawk"))
if(prob(10))
H.h_style = "Mohawk"
else
H.h_style = "Very Long Hair"
H.r_hair = 216
H.g_hair = 192
H.b_hair = 120
H.update_hair()
if(!(H.f_style == "Very Long Beard"))
H.f_style = "Very Long Beard"
H.r_facial = 216
H.g_facial = 192
H.b_facial = 120
H.update_fhair()
@@ -0,0 +1,28 @@
/obj/item/organ/external/stump
name = "limb stump"
icon_name = ""
var/can_intake_reagents = 0
/obj/item/organ/external/stump/New(var/mob/living/carbon/holder, var/internal, var/obj/item/organ/external/limb)
if(istype(limb))
limb_name = limb.limb_name
body_part = limb.body_part
amputation_point = limb.amputation_point
parent_organ = limb.parent_organ
wounds = limb.wounds
..(holder, internal)
if(istype(limb))
max_damage = limb.max_damage
if((limb.status & ORGAN_ROBOT) && (!parent || (parent.status & ORGAN_ROBOT)))
robotize() //if both limb and the parent are robotic, the stump is robotic too
/obj/item/organ/external/stump/is_stump()
return 1
/obj/item/organ/external/stump/remove()
..()
qdel(src)
/obj/item/organ/external/stump/is_usable()
return 0
+148
View File
@@ -0,0 +1,148 @@
mob/proc/flash_pain()
flick("pain",pain)
mob/var/list/pain_stored = list()
mob/var/last_pain_message = ""
mob/var/next_pain_time = 0
// partname is the name of a body part
// amount is a num from 1 to 100
mob/living/carbon/proc/pain(var/partname, var/amount, var/force, var/burning = 0)
if(stat >= 2) return
if(reagents.has_reagent("sal_acid"))
return
if(reagents.has_reagent("morphine"))
return
if(reagents.has_reagent("hydrocodone"))
return
if(analgesic)
return
if(world.time < next_pain_time && !force)
return
if(amount > 10 && istype(src,/mob/living/carbon/human))
if(src:paralysis)
src:paralysis = max(0, src:paralysis-round(amount/10))
if(amount > 50 && prob(amount / 5))
src:drop_item()
var/msg
if(burning)
switch(amount)
if(1 to 10)
msg = "\red <b>Your [partname] burns.</b>"
if(11 to 90)
flash_weak_pain()
msg = "\red <b><font size=2>Your [partname] burns badly!</font></b>"
if(91 to 10000)
flash_pain()
msg = "\red <b><font size=3>OH GOD! Your [partname] is on fire!</font></b>"
else
switch(amount)
if(1 to 10)
msg = "<b>Your [partname] hurts.</b>"
if(11 to 90)
flash_weak_pain()
msg = "<b><font size=2>Your [partname] hurts badly.</font></b>"
if(91 to 10000)
flash_pain()
msg = "<b><font size=3>OH GOD! Your [partname] is hurting terribly!</font></b>"
if(msg && (msg != last_pain_message || prob(10)))
last_pain_message = msg
src << msg
next_pain_time = world.time + (100 - amount)
// message is the custom message to be displayed
// flash_strength is 0 for weak pain flash, 1 for strong pain flash
mob/living/carbon/human/proc/custom_pain(var/message, var/flash_strength)
if(stat >= 1) return
if(species && species.flags & NO_PAIN) return
if(reagents.has_reagent("morphine"))
return
if(reagents.has_reagent("hydrocodone"))
return
if(analgesic)
return
var/msg = "\red <b>[message]</b>"
if(flash_strength >= 1)
msg = "\red <font size=3><b>[message]</b></font>"
// Anti message spam checks
if(msg && ((msg != last_pain_message) || (world.time >= next_pain_time)))
last_pain_message = msg
src << msg
next_pain_time = world.time + 100
mob/living/carbon/human/proc/handle_pain()
// not when sleeping
if(species && species.flags & NO_PAIN)
//While synthetics don't feel pain, they will notice their gears gunking up with residue (toxins)
if(isSynthetic())
var/toxDamageMessage = null
var/toxMessageProb = 1
switch(getToxLoss())
if(25 to 50)
toxMessageProb = 1
toxDamageMessage = "Your servos seem to be working harder."
if(50 to 75)
toxMessageProb = 2
toxDamageMessage = "Your joints seem to stick randomly."
if(75 to INFINITY)
toxMessageProb = 5
toxDamageMessage = "Your motors seem to slip; it really grinds your gears!"
if(toxDamageMessage && prob(toxMessageProb))
src.custom_pain(toxDamageMessage, getToxLoss() >= 15)
return
if(stat >= 2) return
if(reagents.has_reagent("morphine"))
return
if(reagents.has_reagent("hydrocodone"))
return
if(analgesic)
return
var/maxdam = 0
var/obj/item/organ/external/damaged_organ = null
for(var/obj/item/organ/external/E in organs)
if(E.status & ORGAN_DEAD|ORGAN_ROBOT) continue
var/dam = E.get_damage()
// make the choice of the organ depend on damage,
// but also sometimes use one of the less damaged ones
if(dam > maxdam && (maxdam == 0 || prob(70)) )
damaged_organ = E
maxdam = dam
if(damaged_organ)
pain(damaged_organ.name, maxdam, 0)
// Damage to internal organs hurts a lot.
for(var/obj/item/organ/internal/I in internal_organs)
if(istype(I, /obj/item/organ/internal/brain)) //the brain has no pain receptors, and brain damage is meant to be a stealthy damage type.
continue
if(I.damage > 2) if(prob(2))
var/obj/item/organ/external/parent = get_organ(I.parent_organ)
src.custom_pain("You feel a sharp pain in your [parent.limb_name]", 1)
var/toxDamageMessage = null
var/toxMessageProb = 1
switch(getToxLoss())
if(1 to 5)
toxMessageProb = 1
toxDamageMessage = "Your body stings slightly."
if(6 to 10)
toxMessageProb = 2
toxDamageMessage = "Your whole body hurts a little."
if(11 to 15)
toxMessageProb = 2
toxDamageMessage = "Your whole body hurts."
if(15 to 25)
toxMessageProb = 3
toxDamageMessage = "Your whole body hurts badly."
if(26 to INFINITY)
toxMessageProb = 5
toxDamageMessage = "Your body aches all over, it's driving you mad."
if(toxDamageMessage && prob(toxMessageProb))
src.custom_pain(toxDamageMessage, getToxLoss() >= 15)
+48
View File
@@ -0,0 +1,48 @@
var/global/list/all_robolimbs = list()
var/global/list/chargen_robolimbs = list()
var/global/datum/robolimb/basic_robolimb
/proc/populate_robolimb_list()
basic_robolimb = new()
for(var/limb_type in typesof(/datum/robolimb))
var/datum/robolimb/R = new limb_type()
all_robolimbs[R.company] = R
if(!R.unavailable_at_chargen)
chargen_robolimbs[R.company] = R
/datum/robolimb
var/company = "Unbranded" // Shown when selecting the limb.
var/desc = "A generic unbranded robotic prosthesis." // Seen when examining a limb.
var/icon = 'icons/mob/human_races/robotic.dmi' // Icon base to draw from.
var/unavailable_at_chargen // If set, not available at chargen.
/datum/robolimb/bishop
company = "Bishop Cybernetics"
desc = "This limb has a white polymer casing with blue holo-displays."
icon = 'icons/mob/human_races/cyberlimbs/bishop.dmi'
/datum/robolimb/hesphaistos
company = "Hesphiastos Industries"
desc = "This limb has a militaristic black and green casing with gold stripes."
icon = 'icons/mob/human_races/cyberlimbs/hesphaistos.dmi'
/datum/robolimb/zenghu
company = "Zeng-Hu Pharmaceuticals"
desc = "This limb has a rubbery fleshtone covering with visible seams."
icon = 'icons/mob/human_races/cyberlimbs/zenghu.dmi'
/datum/robolimb/xion
company = "Xion Manufacturing Group"
desc = "This limb has a minimalist black and red casing."
icon = 'icons/mob/human_races/cyberlimbs/xion.dmi'
/datum/robolimb/ipc
company = "Morpheus Cyberkinetics"
desc = "This limb is simple and functional; no effort has been made to make it look human."
icon = 'icons/mob/human_races/cyberlimbs/ipc.dmi'
unavailable_at_chargen = 1
/datum/robolimb/wardtakahashi
company = "Ward-Takahashi"
desc = "This limb features sleek black and white polymers."
icon = 'icons/mob/human_races/cyberlimbs/wardtakahashi.dmi'
+50
View File
@@ -0,0 +1,50 @@
/obj/item/weapon/skeleton
name ="skeleton"
desc = "skeleton parent object."
icon = 'icons/mob/human_races/r_skeleton.dmi'
/obj/item/weapon/skeleton/head
name = "skull"
desc = "a skeleton skull, would make a nice paperweight."
icon_state = "head"
/obj/item/weapon/skeleton/r_hand
name = "skeleton right hand"
desc = "a skeleton right hand."
icon_state = "r_hand"
/obj/item/weapon/skeleton/r_arm
name = "skeleton right arm"
desc = "a skeleton right arm."
icon_state = "r_arm"
/obj/item/weapon/skeleton/l_hand
name = "skeleton left hand"
desc = "a skeleton left hand."
icon_state = "l_hand"
/obj/item/weapon/skeleton/l_arm
name = "skeleton left arm"
desc = "a skeleton left arm."
icon_state = "l_arm"
/obj/item/weapon/skeleton/r_foot
name = "skeleton right foot"
desc = "a skeleton right foot."
icon_state = "r_foot"
/obj/item/weapon/skeleton/r_leg
name = "skeleton right leg"
desc = "a skeleton right leg"
icon_state = "r_leg"
/obj/item/weapon/skeleton/l_foot
name = "skeleton left foot"
desc = "a skeleton left foot"
icon_state = "l_foot"
/obj/item/weapon/skeleton/l_leg
name = "skeleton left leg"
desc = "a skeleton left leg"
icon_state = "l_leg"
@@ -0,0 +1,215 @@
/*/proc/spawn_diona_nymph_from_organ(var/obj/item/organ/organ)
if(!istype(organ))
return 0
//This is a terrible hack and I should be ashamed.
var/datum/seed/diona = plant_controller.seeds["diona"]
if(!diona)
return 0
spawn(1) // So it has time to be thrown about by the gib() proc.
var/mob/living/simple_animal/diona/D = new(get_turf(organ))
var/datum/ghosttrap/plant/P = get_ghost_trap("living plant")
P.request_player(D, "A diona nymph has split off from its gestalt. ")
spawn(60)
if(D)
if(!D.ckey || !D.client)
D.death()
return 1 */
/obj/item/organ/external/diona
name = "tendril"
cannot_break = 1
amputation_point = "branch"
/obj/item/organ/external/diona/chest
name = "core trunk"
limb_name = "chest"
icon_name = "torso"
max_damage = 200
min_broken_damage = 50
w_class = 5
body_part = UPPER_TORSO
vital = 1
cannot_amputate = 1
parent_organ = null
/obj/item/organ/external/diona/groin
name = "fork"
limb_name = "groin"
icon_name = "groin"
max_damage = 100
min_broken_damage = 50
w_class = 4
body_part = LOWER_TORSO
parent_organ = "chest"
/obj/item/organ/external/diona/arm
name = "left upper tendril"
limb_name = "l_arm"
icon_name = "l_arm"
max_damage = 35
min_broken_damage = 20
w_class = 3
body_part = ARM_LEFT
parent_organ = "chest"
can_grasp = 1
/obj/item/organ/external/diona/arm/right
name = "right upper tendril"
limb_name = "r_arm"
icon_name = "r_arm"
body_part = ARM_RIGHT
/obj/item/organ/external/diona/leg
name = "left lower tendril"
limb_name = "l_leg"
icon_name = "l_leg"
max_damage = 35
min_broken_damage = 20
w_class = 3
body_part = LEG_LEFT
icon_position = LEFT
parent_organ = "groin"
can_stand = 1
/obj/item/organ/external/diona/leg/right
name = "right lower tendril"
limb_name = "r_leg"
icon_name = "r_leg"
body_part = LEG_RIGHT
icon_position = RIGHT
/obj/item/organ/external/diona/foot
name = "left foot"
limb_name = "l_foot"
icon_name = "l_foot"
max_damage = 20
min_broken_damage = 10
w_class = 2
body_part = FOOT_LEFT
icon_position = LEFT
parent_organ = "l_leg"
can_stand = 1
/obj/item/organ/external/diona/foot/right
name = "right foot"
limb_name = "r_foot"
icon_name = "r_foot"
body_part = FOOT_RIGHT
icon_position = RIGHT
parent_organ = "r_leg"
amputation_point = "right ankle"
/obj/item/organ/external/diona/hand
name = "left grasper"
limb_name = "l_hand"
icon_name = "l_hand"
max_damage = 30
min_broken_damage = 15
w_class = 2
body_part = HAND_LEFT
parent_organ = "l_arm"
can_grasp = 1
/obj/item/organ/external/diona/hand/right
name = "right grasper"
limb_name = "r_hand"
icon_name = "r_hand"
body_part = HAND_RIGHT
parent_organ = "r_arm"
/obj/item/organ/external/diona/head
limb_name = "head"
icon_name = "head"
name = "head"
max_damage = 50
min_broken_damage = 25
vital = 1
w_class = 3
body_part = HEAD
parent_organ = "chest"
var/can_intake_reagents = 1
/obj/item/organ/external/diona/head/remove()
if(owner)
owner.unEquip(owner.head)
owner.unEquip(owner.l_ear)
..()
//DIONA ORGANS.
/* /obj/item/organ/external/diona/removed()
var/mob/living/carbon/human/H = owner
..()
if(!istype(H) || !H.organs || !H.organs.len)
H.death()
if(prob(50) && spawn_diona_nymph_from_organ(src))
qdel(src) */
/obj/item/organ/diona/process()
return
/obj/item/organ/internal/heart/diona
name = "neural strata"
icon = 'icons/obj/objects.dmi'
icon_state = "nymph"
organ_tag = "heart" // Turns into a nymph instantly, no transplanting possible.
origin_tech = "biotech=3"
parent_organ = "chest"
slot = "heart"
/obj/item/organ/internal/brain/diona
name = "gas bladder"
parent_organ = "head"
icon = 'icons/obj/objects.dmi'
icon_state = "nymph"
organ_tag = "brain" // Turns into a nymph instantly, no transplanting possible.
origin_tech = "biotech=3"
slot = "brain"
/obj/item/organ/internal/kidneys/diona
name = "polyp segment"
icon = 'icons/obj/objects.dmi'
icon_state = "nymph"
organ_tag = "kidneys" // Turns into a nymph instantly, no transplanting possible.
origin_tech = "biotech=3"
parent_organ = "groin"
slot = "kidneys"
/obj/item/organ/internal/appendix/diona
name = "anchoring ligament"
icon = 'icons/obj/objects.dmi'
icon_state = "nymph"
organ_tag = "appendix" // Turns into a nymph instantly, no transplanting possible.
origin_tech = "biotech=3"
parent_organ = "groin"
slot = "appendix"
/obj/item/organ/internal/eyes/diona
name = "receptor node"
organ_tag = "eyes"
icon = 'icons/mob/alien.dmi'
icon_state = "claw"
origin_tech = "biotech=3"
parent_organ = "head"
slot = "eyes"
//TODO:Make absorb rads on insert
/obj/item/organ/internal/liver/diona
name = "nutrient vessel"
parent_organ = "chest"
organ_tag = "liver"
icon = 'icons/mob/alien.dmi'
icon_state = "claw"
slot = "liver"
//TODO:Make absorb light on insert.
/*/obj/item/organ/diona/removed(var/mob/living/user)
var/mob/living/carbon/human/H = owner
..()
if(!istype(H) || !H.organs || !H.organs.len)
H.death()
if(prob(50) && spawn_diona_nymph_from_organ(src))
qdel(src) */
@@ -0,0 +1,185 @@
// IPC limbs.
/obj/item/organ/external/head/ipc
can_intake_reagents = 0
vital = 0
max_damage = 50 //made same as arm, since it is not vital
min_broken_damage = 30
encased = null
status = ORGAN_ROBOT
/obj/item/organ/external/head/ipc/New()
robotize("Morpheus Cyberkinetics")
..()
/obj/item/organ/external/chest/ipc
encased = null
status = ORGAN_ROBOT
/obj/item/organ/external/chest/ipc/New()
robotize("Morpheus Cyberkinetics")
..()
/obj/item/organ/external/groin/ipc
encased = null
status = ORGAN_ROBOT
/obj/item/organ/external/groin/ipc/New()
robotize("Morpheus Cyberkinetics")
..()
/obj/item/organ/external/arm/ipc
encased = null
status = ORGAN_ROBOT
/obj/item/organ/external/arm/ipc/New()
robotize("Morpheus Cyberkinetics")
..()
/obj/item/organ/external/arm/right/ipc
encased = null
status = ORGAN_ROBOT
/obj/item/organ/external/arm/right/ipc/New()
robotize("Morpheus Cyberkinetics")
..()
/obj/item/organ/external/leg/ipc
encased = null
status = ORGAN_ROBOT
/obj/item/organ/external/leg/ipc/New()
robotize("Morpheus Cyberkinetics")
..()
/obj/item/organ/external/leg/right/ipc
encased = null
status = ORGAN_ROBOT
/obj/item/organ/external/leg/right/ipc/New()
robotize("Morpheus Cyberkinetics")
..()
/obj/item/organ/external/foot/ipc
encased = null
status = ORGAN_ROBOT
/obj/item/organ/external/foot/ipc/New()
robotize("Morpheus Cyberkinetics")
..()
/obj/item/organ/external/foot/right/ipc
encased = null
status = ORGAN_ROBOT
/obj/item/organ/external/foot/right/ipc/New()
robotize("Morpheus Cyberkinetics")
..()
/obj/item/organ/external/hand/ipc
encased = null
status = ORGAN_ROBOT
/obj/item/organ/external/hand/ipc/New()
robotize("Morpheus Cyberkinetics")
..()
/obj/item/organ/external/hand/right/ipc
encased = null
status = ORGAN_ROBOT
/obj/item/organ/external/hand/right/ipc/New()
robotize("Morpheus Cyberkinetics")
..()
/obj/item/organ/internal/cell
name = "microbattery"
desc = "A small, powerful cell for use in fully prosthetic bodies."
icon = 'icons/obj/power.dmi'
icon_state = "scell"
organ_tag = "heart"
parent_organ = "chest"
slot = "heart"
vital = 1
status = ORGAN_ROBOT
/obj/item/organ/internal/cell/New()
robotize()
..()
/obj/item/organ/internal/cell/insert()
..()
// This is very ghetto way of rebooting an IPC. TODO better way.
if(owner && owner.stat == DEAD)
owner.stat = CONSCIOUS
owner.visible_message("<span class='danger'>\The [owner] twitches visibly!</span>")
/obj/item/organ/internal/optical_sensor
name = "optical sensor"
organ_tag = "eyes"
parent_organ = "head"
icon = 'icons/obj/robot_component.dmi'
icon_state = "camera"
slot = "eyes"
status = ORGAN_ROBOT
// dead_icon = "camera_broken"
/obj/item/organ/internal/optical_sensor/New()
robotize()
..()
// Used for an MMI or posibrain being installed into a human.
/obj/item/organ/internal/brain/mmi_holder
name = "brain"
organ_tag = "brain"
parent_organ = "chest"
vital = 1
max_damage = 200
slot = "brain"
status = ORGAN_ROBOT
var/obj/item/device/mmi/stored_mmi
/obj/item/organ/internal/brain/mmi_holder/proc/update_from_mmi()
if(!stored_mmi)
return
name = stored_mmi.name
desc = stored_mmi.desc
icon = stored_mmi.icon
icon_state = stored_mmi.icon_state
/obj/item/organ/internal/brain/mmi_holder/remove(var/mob/living/user,special = 0)
if(!special)
if(stored_mmi)
stored_mmi.forceMove(get_turf(owner))
if(owner.mind)
owner.mind.transfer_to(stored_mmi.brainmob)
..()
var/mob/living/holder_mob = loc
if(istype(holder_mob))
holder_mob.unEquip(src)
qdel(src)
/obj/item/organ/internal/brain/mmi_holder/New()
..()
// This is very ghetto way of rebooting an IPC. TODO better way.
spawn(1)
if(owner && owner.stat == DEAD)
owner.stat = CONSCIOUS
owner.visible_message("<span class='danger'>\The [owner] twitches visibly!</span>")
/obj/item/organ/internal/brain/mmi_holder/posibrain/New()
robotize()
stored_mmi = new /obj/item/device/mmi/posibrain/ipc(src)
..()
spawn(1)
if(owner)
stored_mmi.name = "positronic brain ([owner.real_name])"
stored_mmi.brainmob.real_name = owner.real_name
stored_mmi.brainmob.name = stored_mmi.brainmob.real_name
stored_mmi.icon_state = "posibrain-occupied"
update_from_mmi()
else
stored_mmi.loc = get_turf(src)
qdel(src)
@@ -0,0 +1,65 @@
//CORTICAL BORER ORGANS.
/obj/item/organ/internal/borer
name = "cortical borer"
icon = 'icons/obj/objects.dmi'
icon_state = "borer"
parent_organ = "head"
organ_tag = "brain"
slot = "borer"
vital = 1
/obj/item/organ/internal/borer/process()
// Borer husks regenerate health, feel no pain, and are resistant to stuns and brainloss.
for(var/chem in list("saline", "sailcylic", "meth", "mannitol"))
if(owner.reagents.get_reagent_amount(chem) < 3)
owner.reagents.add_reagent(chem, 5)
// They're also super gross and ooze ichor.
if(prob(5))
var/mob/living/carbon/human/H = owner
if(!istype(H))
return
var/datum/reagent/blood/B = locate(/datum/reagent/blood) in H.vessel.reagent_list
blood_splatter(H,B,1)
var/obj/effect/decal/cleanable/blood/splatter/goo = locate() in get_turf(owner)
if(goo)
goo.name = "husk ichor"
goo.desc = "It's thick and stinks of decay."
goo.basecolor = "#412464"
goo.update_icon()
/obj/item/organ/internal/borer/remove(var/mob/living/user)
..()
var/mob/living/simple_animal/borer/B = owner.has_brain_worms()
if(B)
B.leave_host()
B.ckey = owner.ckey
spawn(0)
qdel(src)
//VOX ORGANS.
/obj/item/organ/internal/stack
name = "cortical stack"
icon_state = "brain-prosthetic"
parent_organ = "head"
organ_tag = "stack"
slot = "vox_stack"
robotic = 2
vital = 1
var/backup_time = 0
var/datum/mind/backup
/obj/item/organ/internal/stack/process()
if(owner && owner.stat != 2 && !is_broken())
backup_time = world.time
if(owner.mind) backup = owner.mind
/obj/item/organ/internal/stack/vox
name = "vox cortical stack"
/obj/item/organ/internal/stack/vox/stack
@@ -0,0 +1,37 @@
//NUCLEATION ORGAN
/obj/item/organ/internal/nucleation
name = "nucleation organ"
icon = 'icons/obj/surgery.dmi'
desc = "A crystalized human organ. /red It has a strangely iridescent glow."
/obj/item/organ/internal/nucleation/resonant_crystal
name = "resonant crystal"
icon_state = "resonant-crystal"
organ_tag = "resonant crystal"
parent_organ = "head"
slot = "res_crystal"
/obj/item/organ/internal/nucleation/strange_crystal
name = "strange crystal"
icon_state = "strange-crystal"
organ_tag = "strange crystal"
parent_organ = "chest"
slot = "heart"
/obj/item/organ/internal/eyes/luminescent_crystal
name = "luminescent eyes"
icon_state = "crystal-eyes"
organ_tag = "luminescent eyes"
light_color = "#1C1C00"
parent_organ = "head"
slot = "eyes"
/obj/item/organ/internal/eyes/luminescent_crystal/New()
set_light(2)
/obj/item/organ/internal/brain/crystal
name = "crystalized brain"
icon_state = "crystal-brain"
organ_tag = "crystalized brain"
slot = "brain"
@@ -0,0 +1,172 @@
/****************************************************
ORGAN DEFINES
****************************************************/
/obj/item/organ/external/chest
name = "upper body"
limb_name = "chest"
icon_name = "torso"
max_damage = 100
min_broken_damage = 35
w_class = 5
body_part = UPPER_TORSO
vital = 1
amputation_point = "spine"
gendered_icon = 1
cannot_amputate = 1
parent_organ = null
encased = "ribcage"
/obj/item/organ/external/groin
name = "lower body"
limb_name = "groin"
icon_name = "groin"
max_damage = 100
min_broken_damage = 35
w_class = 4
body_part = LOWER_TORSO
vital = 1
parent_organ = "chest"
amputation_point = "lumbar"
gendered_icon = 1
/obj/item/organ/external/arm
limb_name = "l_arm"
name = "left arm"
icon_name = "l_arm"
max_damage = 50
min_broken_damage = 30
w_class = 3
body_part = ARM_LEFT
parent_organ = "chest"
amputation_point = "left shoulder"
can_grasp = 1
/obj/item/organ/external/arm/right
limb_name = "r_arm"
name = "right arm"
icon_name = "r_arm"
body_part = ARM_RIGHT
amputation_point = "right shoulder"
/obj/item/organ/external/leg
limb_name = "l_leg"
name = "left leg"
icon_name = "l_leg"
max_damage = 50
min_broken_damage = 30
w_class = 3
body_part = LEG_LEFT
icon_position = LEFT
parent_organ = "groin"
amputation_point = "left hip"
can_stand = 1
/obj/item/organ/external/leg/right
limb_name = "r_leg"
name = "right leg"
icon_name = "r_leg"
body_part = LEG_RIGHT
icon_position = RIGHT
amputation_point = "right hip"
/obj/item/organ/external/foot
limb_name = "l_foot"
name = "left foot"
icon_name = "l_foot"
max_damage = 30
min_broken_damage = 15
w_class = 2
body_part = FOOT_LEFT
icon_position = LEFT
parent_organ = "l_leg"
amputation_point = "left ankle"
can_stand = 1
/obj/item/organ/external/foot/remove()
if(owner.shoes) owner.unEquip(owner.shoes)
..()
/obj/item/organ/external/foot/right
limb_name = "r_foot"
name = "right foot"
icon_name = "r_foot"
body_part = FOOT_RIGHT
icon_position = RIGHT
parent_organ = "r_leg"
amputation_point = "right ankle"
/obj/item/organ/external/hand
limb_name = "l_hand"
name = "left hand"
icon_name = "l_hand"
max_damage = 30
min_broken_damage = 15
w_class = 2
body_part = HAND_LEFT
parent_organ = "l_arm"
amputation_point = "left wrist"
can_grasp = 1
/obj/item/organ/external/hand/remove()
if(owner.gloves)
owner.unEquip(owner.gloves)
..()
/obj/item/organ/external/hand/right
limb_name = "r_hand"
name = "right hand"
icon_name = "r_hand"
body_part = HAND_RIGHT
parent_organ = "r_arm"
amputation_point = "right wrist"
/obj/item/organ/external/head
limb_name = "head"
icon_name = "head"
name = "head"
max_damage = 75
min_broken_damage = 35
w_class = 3
body_part = HEAD
vital = 1
parent_organ = "chest"
amputation_point = "neck"
gendered_icon = 1
encased = "skull"
var/can_intake_reagents = 1
/obj/item/organ/external/head/remove()
if(owner)
if(!istype(dna))
dna = owner.dna.Clone()
name = "[dna.real_name]'s head"
if(owner.glasses)
owner.unEquip(owner.glasses)
if(owner.head)
owner.unEquip(owner.head)
if(owner.l_ear)
owner.unEquip(owner.l_ear)
if(owner.r_ear)
owner.unEquip(owner.r_ear)
if(owner.wear_mask)
owner.unEquip(owner.wear_mask)
spawn(1)
if(owner)//runtimer no runtiming
owner.update_hair()
owner.update_fhair()
..()
/obj/item/organ/external/head/replaced()
name = limb_name
..()
/obj/item/organ/external/head/take_damage(brute, burn, sharp, edge, used_weapon = null, list/forbidden_limbs = list())
..(brute, burn, sharp, edge, used_weapon, forbidden_limbs)
if (!disfigured)
if (brute_dam > 40)
if (prob(50))
disfigure("brute")
if (burn_dam > 40)
disfigure("burn")
@@ -0,0 +1,34 @@
// Slime limbs.
/obj/item/organ/external/chest/unbreakable
cannot_break = 1
/obj/item/organ/external/groin/unbreakable
cannot_break = 1
/obj/item/organ/external/arm/unbreakable
cannot_break = 1
/obj/item/organ/external/arm/right/unbreakable
cannot_break = 1
/obj/item/organ/external/leg/unbreakable
cannot_break = 1
/obj/item/organ/external/leg/right/unbreakable
cannot_break = 1
/obj/item/organ/external/foot/unbreakable
cannot_break = 1
/obj/item/organ/external/foot/right/unbreakable
cannot_break = 1
/obj/item/organ/external/hand/unbreakable
cannot_break = 1
/obj/item/organ/external/hand/right/unbreakable
cannot_break = 1
/obj/item/organ/external/head/unbreakable
cannot_break = 1
@@ -0,0 +1,8 @@
//WRYN ORGAN
/obj/item/organ/internal/wryn/hivenode
name = "antennae"
organ_tag = "antennae"
icon = 'icons/mob/human_races/r_wryn.dmi'
icon_state = "antennae"
parent_organ = "head"
slot = "hivenode"
@@ -0,0 +1,162 @@
/obj/item/organ/internal/xenos
origin_tech = "biotech=5"
icon_state = "xgibmid2"
var/list/alien_powers = list()
tough = 1
sterile = 1
///obj/item/organ/internal/xenos/New()
// for(var/A in alien_powers)
// if(ispath(A))
// alien_powers -= A
// alien_powers += new A(src)
// ..()
///can be changed if xenos get an update..
/obj/item/organ/internal/xenos/insert(mob/living/carbon/M, special = 0)
..()
for(var/P in alien_powers)
M.verbs |= P
//M.verbs |= alien_powers.Copy()
/obj/item/organ/internal/xenos/remove(mob/living/carbon/M, special = 0)
for(var/P in alien_powers)
M.verbs -= P
//M.verbs -= alien_powers.Copy()
..()
/obj/item/organ/internal/xenos/prepare_eat()
var/obj/S = ..()
S.reagents.add_reagent("sacid", 10)
return S
//XENOMORPH ORGANS
/obj/item/organ/internal/xenos/plasmavessel
name = "xeno plasma vessel"
icon_state = "plasma"
origin_tech = "biotech=5;plasmatech=2"
w_class = 3
parent_organ = "chest"
slot = "plasmavessel"
alien_powers = list(/mob/living/carbon/alien/humanoid/verb/plant, /mob/living/carbon/alien/humanoid/verb/transfer_plasma)
var/stored_plasma = 0
var/max_plasma = 500
var/heal_rate = 5
var/plasma_rate = 10
/obj/item/organ/internal/xenos/plasmavessel/prepare_eat()
var/obj/S = ..()
S.reagents.add_reagent("plasma", stored_plasma/10)
return S
/obj/item/organ/internal/xenos/plasmavessel/queen
name = "bloated xeno plasma vessel"
icon_state = "plasma_large"
origin_tech = "biotech=6;plasma=3"
stored_plasma = 200
max_plasma = 500
plasma_rate = 25
/obj/item/organ/internal/xenos/plasmavessel/drone
name = "large xeno plasma vessel"
icon_state = "plasma_large"
stored_plasma = 200
max_plasma = 500
/obj/item/organ/internal/xenos/plasmavessel/sentinel
stored_plasma = 100
max_plasma = 250
/obj/item/organ/internal/xenos/plasmavessel/hunter
name = "small xeno plasma vessel"
icon_state = "plasma_tiny"
stored_plasma = 100
max_plasma = 150
alien_powers = list(/mob/living/carbon/alien/humanoid/verb/plant)
/obj/item/organ/internal/xenos/plasmavessel/larva
name = "tiny xeno plasma vessel"
icon_state = "plasma_tiny"
max_plasma = 100
/obj/item/organ/internal/xenos/plasmavessel/on_life()
//If there are alien weeds on the ground then heal if needed or give some plasma
if(locate(/obj/structure/alien/weeds) in owner.loc)
if(owner.health >= owner.maxHealth)
owner.adjustPlasma(plasma_rate)
else
var/heal_amt = heal_rate
if(!isalien(owner))
heal_amt *= 0.2
owner.adjustPlasma(plasma_rate*0.5)
owner.adjustBruteLoss(-heal_amt)
owner.adjustFireLoss(-heal_amt)
owner.adjustOxyLoss(-heal_amt)
owner.adjustCloneLoss(-heal_amt)
/obj/item/organ/internal/xenos/plasmavessel/insert(mob/living/carbon/M, special = 0)
..()
if(isalien(M))
var/mob/living/carbon/alien/A = M
A.updatePlasmaDisplay()
/obj/item/organ/internal/alien/plasmavessel/remove(mob/living/carbon/M, special = 0)
..()
if(isalien(M))
var/mob/living/carbon/alien/A = M
A.updatePlasmaDisplay()
/obj/item/organ/internal/xenos/acidgland
name = "xeno acid gland"
parent_organ = "head"
slot = "acid"
origin_tech = "biotech=5;materials=2;combat=2"
alien_powers = list(/mob/living/carbon/alien/humanoid/proc/corrosive_acid)
/obj/item/organ/internal/xenos/hivenode
name = "xeno hive node"
parent_organ = "head"
slot = "hivenode"
origin_tech = "biotech=5;magnets=4;bluespace=3"
w_class = 1
alien_powers = list(/mob/living/carbon/alien/humanoid/verb/whisp)
/obj/item/organ/internal/xenos/hivenode/insert(mob/living/carbon/M, special = 0)
..()
M.faction |= "alien"
/obj/item/organ/internal/xenos/hivenode/remove(mob/living/carbon/M, special = 0)
M.faction -= "alien"
..()
/obj/item/organ/internal/xenos/neurotoxin
name = "xeno neurotoxin gland"
icon_state = "neurotox"
parent_organ = "head"
slot = "neurotox"
origin_tech = "biotech=5;combat=5"
alien_powers = list(/mob/living/carbon/alien/humanoid/proc/neurotoxin)
/obj/item/organ/internal/xenos/resinspinner
name = "xeno resin organ"//...there tiger....
parent_organ = "mouth"
icon_state = "liver-x"
slot = "hivenode"
origin_tech = "biotech=5;materials=4"
alien_powers = list(/mob/living/carbon/alien/humanoid/proc/resin)
/obj/item/organ/internal/xenos/eggsac
name = "xeno egg sac"
icon_state = "eggsac"
parent_organ = "groin"
slot = "eggsac"
w_class = 4
origin_tech = "biotech=8"
alien_powers = list(/mob/living/carbon/alien/humanoid/queen/verb/lay_egg)
+344
View File
@@ -0,0 +1,344 @@
/****************************************************
WOUNDS
****************************************************/
/datum/wound
// number representing the current stage
var/current_stage = 0
// description of the wound
var/desc = "wound" //default in case something borks
// amount of damage this wound causes
var/damage = 0
// ticks of bleeding left.
var/bleed_timer = 0
// amount of damage the current wound type requires(less means we need to apply the next healing stage)
var/min_damage = 0
// is the wound bandaged?
var/bandaged = 0
// Similar to bandaged, but works differently
var/clamped = 0
// is the wound salved?
var/salved = 0
// is the wound disinfected?
var/disinfected = 0
var/created = 0
// number of wounds of this type
var/amount = 1
// amount of germs in the wound
var/germ_level = 0
/* These are defined by the wound type and should not be changed */
// stages such as "cut", "deep cut", etc.
var/list/stages
// internal wounds can only be fixed through surgery
var/internal = 0
// maximum stage at which bleeding should still happen. Beyond this stage bleeding is prevented.
var/max_bleeding_stage = 0
// one of CUT, BRUISE, BURN
var/damage_type = CUT
// whether this wound needs a bandage/salve to heal at all
// the maximum amount of damage that this wound can have and still autoheal
var/autoheal_cutoff = 15
// helper lists
var/tmp/list/desc_list = list()
var/tmp/list/damage_list = list()
New(var/damage)
created = world.time
// reading from a list("stage" = damage) is pretty difficult, so build two separate
// lists from them instead
for(var/V in stages)
desc_list += V
damage_list += stages[V]
src.damage = damage
// initialize with the appropriate stage
src.init_stage(damage)
bleed_timer += damage
// returns 1 if there's a next stage, 0 otherwise
proc/init_stage(var/initial_damage)
current_stage = stages.len
while(src.current_stage > 1 && src.damage_list[current_stage-1] <= initial_damage / src.amount)
src.current_stage--
src.min_damage = damage_list[current_stage]
src.desc = desc_list[current_stage]
// the amount of damage per wound
proc/wound_damage()
return src.damage / src.amount
proc/can_autoheal()
if(src.wound_damage() <= autoheal_cutoff)
return 1
return is_treated()
// checks whether the wound has been appropriately treated
proc/is_treated()
if(damage_type == BRUISE || damage_type == CUT)
return bandaged
else if(damage_type == BURN)
return salved
// Checks whether other other can be merged into src.
proc/can_merge(var/datum/wound/other)
if (other.type != src.type) return 0
if (other.current_stage != src.current_stage) return 0
if (other.damage_type != src.damage_type) return 0
if (!(other.can_autoheal()) != !(src.can_autoheal())) return 0
if (!(other.bandaged) != !(src.bandaged)) return 0
if (!(other.clamped) != !(src.clamped)) return 0
if (!(other.salved) != !(src.salved)) return 0
if (!(other.disinfected) != !(src.disinfected)) return 0
//if (other.germ_level != src.germ_level) return 0
return 1
proc/merge_wound(var/datum/wound/other)
src.damage += other.damage
src.amount += other.amount
src.bleed_timer += other.bleed_timer
src.germ_level = max(src.germ_level, other.germ_level)
src.created = max(src.created, other.created) //take the newer created time
// checks if wound is considered open for external infections
// untreated cuts (and bleeding bruises) and burns are possibly infectable, chance higher if wound is bigger
proc/infection_check()
if (damage < 10) //small cuts, tiny bruises, and moderate burns shouldn't be infectable.
return 0
if (is_treated() && damage < 25) //anything less than a flesh wound (or equivalent) isn't infectable if treated properly
return 0
if (disinfected)
germ_level = 0 //reset this, just in case
return 0
if (damage_type == BRUISE && !bleeding()) //bruises only infectable if bleeding
return 0
var/dam_coef = round(damage/10)
switch (damage_type)
if (BRUISE)
return prob(dam_coef*5)
if (BURN)
return prob(dam_coef*10)
if (CUT)
return prob(dam_coef*20)
return 0
// heal the given amount of damage, and if the given amount of damage was more
// than what needed to be healed, return how much heal was left
// set @heals_internal to also heal internal organ damage
proc/heal_damage(amount, heals_internal = 0)
if(src.internal && !heals_internal)
// heal nothing
return amount
var/healed_damage = min(src.damage, amount)
amount -= healed_damage
src.damage -= healed_damage
while(src.wound_damage() < damage_list[current_stage] && current_stage < src.desc_list.len)
current_stage++
desc = desc_list[current_stage]
src.min_damage = damage_list[current_stage]
// return amount of healing still leftover, can be used for other wounds
return amount
// opens the wound again
proc/open_wound(damage)
src.damage += damage
bleed_timer += damage
while(src.current_stage > 1 && src.damage_list[current_stage-1] <= src.damage / src.amount)
src.current_stage--
src.desc = desc_list[current_stage]
src.min_damage = damage_list[current_stage]
// returns whether this wound can absorb the given amount of damage.
// this will prevent large amounts of damage being trapped in less severe wound types
proc/can_worsen(damage_type, damage)
if (src.damage_type != damage_type)
return 0 //incompatible damage types
if (src.amount > 1)
return 0
//with 1.5*, a shallow cut will be able to carry at most 30 damage,
//37.5 for a deep cut
//52.5 for a flesh wound, etc.
var/max_wound_damage = 1.5*src.damage_list[1]
if (src.damage + damage > max_wound_damage)
return 0
return 1
proc/bleeding()
if (src.internal)
return 0 // internal wounds don't bleed in the sense of this function
if (current_stage > max_bleeding_stage)
return 0
if (bandaged||clamped)
return 0
if (wound_damage() <= 30 && bleed_timer <= 0)
return 0 //Bleed timer has run out. Wounds with more than 30 damage don't stop bleeding on their own.
return (damage_type == BRUISE && wound_damage() >= 20 || damage_type == CUT && wound_damage() >= 5)
/** WOUND DEFINITIONS **/
//Note that the MINIMUM damage before a wound can be applied should correspond to
//the damage amount for the stage with the same name as the wound.
//e.g. /datum/wound/cut/deep should only be applied for 15 damage and up,
//because in it's stages list, "deep cut" = 15.
/proc/get_wound_type(var/type = CUT, var/damage)
switch(type)
if(CUT)
switch(damage)
if(70 to INFINITY)
return /datum/wound/cut/massive
if(60 to 70)
return /datum/wound/cut/gaping_big
if(50 to 60)
return /datum/wound/cut/gaping
if(25 to 50)
return /datum/wound/cut/flesh
if(15 to 25)
return /datum/wound/cut/deep
if(0 to 15)
return /datum/wound/cut/small
if(BRUISE)
return /datum/wound/bruise
if(BURN)
switch(damage)
if(50 to INFINITY)
return /datum/wound/burn/carbonised
if(40 to 50)
return /datum/wound/burn/deep
if(30 to 40)
return /datum/wound/burn/severe
if(15 to 30)
return /datum/wound/burn/large
if(0 to 15)
return /datum/wound/burn/moderate
return null //no wound
/** CUTS **/
/datum/wound/cut/small
// Minor cuts have max_bleeding_stage set to the stage that bears the wound type's name.
// The major cut types have the max_bleeding_stage set to the clot stage (which is accordingly given the "blood soaked" descriptor).
max_bleeding_stage = 3
stages = list("ugly ripped cut" = 20, "ripped cut" = 10, "cut" = 5, "healing cut" = 2, "small scab" = 0)
damage_type = CUT
/datum/wound/cut/deep
max_bleeding_stage = 3
stages = list("ugly deep ripped cut" = 25, "deep ripped cut" = 20, "deep cut" = 15, "clotted cut" = 8, "scab" = 2, "fresh skin" = 0)
damage_type = CUT
/datum/wound/cut/flesh
max_bleeding_stage = 4
stages = list("ugly ripped flesh wound" = 35, "ugly flesh wound" = 30, "flesh wound" = 25, "blood soaked clot" = 15, "large scab" = 5, "fresh skin" = 0)
damage_type = CUT
/datum/wound/cut/gaping
max_bleeding_stage = 3
stages = list("gaping wound" = 50, "large blood soaked clot" = 25, "blood soaked clot" = 15, "small angry scar" = 5, "small straight scar" = 0)
damage_type = CUT
/datum/wound/cut/gaping_big
max_bleeding_stage = 3
stages = list("big gaping wound" = 60, "healing gaping wound" = 40, "large blood soaked clot" = 25, "large angry scar" = 10, "large straight scar" = 0)
damage_type = CUT
datum/wound/cut/massive
max_bleeding_stage = 3
stages = list("massive wound" = 70, "massive healing wound" = 50, "massive blood soaked clot" = 25, "massive angry scar" = 10, "massive jagged scar" = 0)
damage_type = CUT
/** BRUISES **/
/datum/wound/bruise
stages = list("monumental bruise" = 80, "huge bruise" = 50, "large bruise" = 30,
"moderate bruise" = 20, "small bruise" = 10, "tiny bruise" = 5)
max_bleeding_stage = 3 //only large bruise and above can bleed.
autoheal_cutoff = 30
damage_type = BRUISE
/** BURNS **/
/datum/wound/burn/moderate
stages = list("ripped burn" = 10, "moderate burn" = 5, "healing moderate burn" = 2, "fresh skin" = 0)
damage_type = BURN
/datum/wound/burn/large
stages = list("ripped large burn" = 20, "large burn" = 15, "healing large burn" = 5, "fresh skin" = 0)
damage_type = BURN
/datum/wound/burn/severe
stages = list("ripped severe burn" = 35, "severe burn" = 30, "healing severe burn" = 10, "burn scar" = 0)
damage_type = BURN
/datum/wound/burn/deep
stages = list("ripped deep burn" = 45, "deep burn" = 40, "healing deep burn" = 15, "large burn scar" = 0)
damage_type = BURN
/datum/wound/burn/carbonised
stages = list("carbonised area" = 50, "healing carbonised area" = 20, "massive burn scar" = 0)
damage_type = BURN
/** INTERNAL BLEEDING **/
/datum/wound/internal_bleeding
internal = 1
stages = list("severed artery" = 30, "cut artery" = 20, "damaged artery" = 10, "bruised artery" = 5)
autoheal_cutoff = 5
max_bleeding_stage = 4 //all stages bleed. It's called internal bleeding after all.
/** EXTERNAL ORGAN LOSS **/
/datum/wound/lost_limb
/datum/wound/lost_limb/New(var/obj/item/organ/external/lost_limb, var/losstype, var/clean)
var/damage_amt = lost_limb.max_damage
if(clean) damage_amt /= 2
switch(losstype)
if(DROPLIMB_EDGE, DROPLIMB_BLUNT)
damage_type = CUT
max_bleeding_stage = 3 //clotted stump and above can bleed.
stages = list(
"ripped stump" = damage_amt*1.3,
"bloody stump" = damage_amt,
"clotted stump" = damage_amt*0.5,
"scarred stump" = 0
)
if(DROPLIMB_BURN)
damage_type = BURN
stages = list(
"ripped charred stump" = damage_amt*1.3,
"charred stump" = damage_amt,
"scarred stump" = damage_amt*0.5,
"scarred stump" = 0
)
..(damage_amt)
/datum/wound/lost_limb/can_merge(var/datum/wound/other)
return 0 //cannot be merged
+340 -383
View File
@@ -1,10 +1,53 @@
/datum/surgery/organ_manipulation
name = "organ manipulation"
steps = list(/datum/surgery_step/generic/cut_open,/datum/surgery_step/generic/clamp_bleeders, /datum/surgery_step/generic/retract_skin, /datum/surgery_step/open_encased/saw,
/datum/surgery_step/open_encased/retract, /datum/surgery_step/internal/manipulate_organs, /datum/surgery_step/glue_bone, /datum/surgery_step/set_bone,/datum/surgery_step/finish_bone,/datum/surgery_step/generic/cauterize)
possible_locs = list("chest","head")
requires_organic_bodypart = 1
/datum/surgery/organ_manipulation/soft
possible_locs = list("groin", "eyes", "mouth")
steps = list(/datum/surgery_step/generic/cut_open,/datum/surgery_step/generic/clamp_bleeders, /datum/surgery_step/generic/retract_skin, /datum/surgery_step/internal/manipulate_organs,/datum/surgery_step/generic/cauterize)
requires_organic_bodypart = 1
/datum/surgery/organ_manipulation_boneless
name = "organ manipulation"
possible_locs = list("chest","head","groin", "eyes", "mouth")
steps = list(/datum/surgery_step/generic/cut_open,/datum/surgery_step/generic/clamp_bleeders, /datum/surgery_step/generic/retract_skin, /datum/surgery_step/internal/manipulate_organs,/datum/surgery_step/generic/cauterize)
requires_organic_bodypart = 1
allowed_mob = list(/mob/living/carbon/human/diona)
/datum/surgery/organ_manipulation/alien
name = "alien organ manipulation"
possible_locs = list("chest", "head", "groin", "eyes", "mouth")
allowed_mob = list(/mob/living/carbon/alien/humanoid)
steps = list(/datum/surgery_step/saw_carapace,/datum/surgery_step/cut_carapace, /datum/surgery_step/retract_carapace,/datum/surgery_step/internal/manipulate_organs)
/datum/surgery/organ_manipulation/can_start(mob/user, mob/living/carbon/target)
if(istype(target,/mob/living/carbon/human))
var/mob/living/carbon/human/H = target
var/obj/item/organ/external/affected = H.get_organ(user.zone_sel.selecting)
if(affected && (affected.status & ORGAN_ROBOT))
return 0
if((target.get_species() == "Machine"))
return 0
if((target.get_species() == "Diona"))
return 0
return 1
/datum/surgery/organ_manipulation/alien/can_start(mob/user, mob/living/carbon/target)
if(istype(target,/mob/living/carbon/alien/humanoid))
return 1
else return 0
// Internal surgeries.
/datum/surgery_step/internal
priority = 2
can_infect = 1
blood_level = 1
/datum/surgery_step/internal/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
/datum/surgery_step/internal/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
if (!hasorgans(target))
return 0
@@ -12,452 +55,366 @@
var/obj/item/organ/external/affected = target.get_organ(target_zone)
return affected && affected.open_enough_for_surgery()
//////////////////////////////////////////////////////////////////
// Dethrall Shadowling //
//////////////////////////////////////////////////////////////////
/datum/surgery_step/internal/dethrall
allowed_tools = list(
/obj/item/weapon/hemostat = 100, \
/obj/item/weapon/wirecutters = 75, \
/obj/item/weapon/kitchen/utensil/fork = 20
)
min_duration = 120
max_duration = 120
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (!hasorgans(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
return ..() && affected && is_thrall(target) && affected.open_enough_for_surgery() && target_zone == target.named_organ_parent("brain")
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/braincase = target.named_organ_parent("brain")
user.visible_message("[user] begins looking around in [target]'s [braincase].", "<span class='notice'>You begin looking for foreign influences on [target]'s brain...")
user << "<span class='warning'>You locate a small, pulsing black tumor on the side of [target]'s brain and begin to remove it.</span>"
target << "<span class='boldannounce'>A small part of your [braincase] pulses with agony as the light impacts it.</span>"
user.visible_message("[user] begins removing something from [target]'s [braincase].</span>", \
"<span class='notice'>You begin carefully extracting the tumor...</span>")
..()
end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/braincase = target.named_organ_parent("brain")
user.visible_message("<span class='notice'>[user] carefully extracts the tumor from [target]'s brain!</span>", \
"<span class='notice'>You extract the black tumor from [target]'s [braincase]. It quickly shrivels and burns away.</span>")
ticker.mode.remove_thrall(target.mind,0)
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/braincase = target.named_organ_parent("brain")
if(prob(50))
user.visible_message("<span class='warning'>[user] slips and rips the tumor out from [target]'s [braincase]!</span>", \
"<span class='warning'><b>You fumble and tear out [target]'s tumor!</span>")
target.adjustBrainLoss(110) // This is so you can't just defib'n go
ticker.mode.remove_thrall(target.mind,1)
else
user.visible_message("<span class='warning'>[user]'s hand slips and fumbles! Luckily, they didn't damage anything!</span>")
//////////////////////////////////////////////////////////////////
// ALIEN EMBRYO SURGERY //
//////////////////////////////////////////////////////////////////
/datum/surgery_step/internal/remove_embryo
allowed_tools = list(
/obj/item/weapon/hemostat = 100, \
/obj/item/weapon/wirecutters = 75, \
/obj/item/weapon/kitchen/utensil/fork = 20
)
blood_level = 2
min_duration = 80
max_duration = 100
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/embryo = 0
for(var/obj/item/alien_embryo/A in target)
embryo = 1
break
if (!hasorgans(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
return ..() && affected && embryo && affected.open_enough_for_surgery() && target_zone == "chest"
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/msg = "[user] starts to pull something out from [target]'s ribcage with \the [tool]."
var/self_msg = "You start to pull something out from [target]'s ribcage with \the [tool]."
user.visible_message(msg, self_msg)
target.custom_pain("Something hurts horribly in your chest!",1)
..()
end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message("\red [user] rips the larva out of [target]'s ribcage!",
"You rip the larva out of [target]'s ribcage!")
for(var/obj/item/alien_embryo/A in target)
A.loc = A.loc.loc
//////////////////////////////////////////////////////////////////
// CHEST INTERNAL ORGAN SURGERY //
//////////////////////////////////////////////////////////////////
/datum/surgery_step/internal/fix_organ
allowed_tools = list(
/obj/item/stack/medical/advanced/bruise_pack= 100, \
/obj/item/stack/medical/bruise_pack = 20
)
min_duration = 70
/datum/surgery_step/internal/manipulate_organs
name = "manipulate organs"
allowed_tools = list(/obj/item/organ/internal = 100, /obj/item/weapon/reagent_containers/food/snacks/organ = 0)
var/implements_extract = list(/obj/item/weapon/hemostat = 100, /obj/item/weapon/kitchen/utensil/fork = 55)
var/implements_mend = list(/obj/item/stack/medical/advanced/bruise_pack = 100,/obj/item/stack/nanopaste = 100,/obj/item/stack/medical/bruise_pack = 20)
//Finish is just so you can close up after you do other things.
var/implements_finsh = list(/obj/item/weapon/scalpel/manager = 120,/obj/item/weapon/retractor = 100 ,/obj/item/weapon/crowbar = 75)
var/current_type
var/obj/item/organ/internal/I = null
var/obj/item/organ/external/affected = null
max_duration = 90
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
/datum/surgery_step/internal/manipulate_organs/New()
..()
allowed_tools = allowed_tools + implements_extract + implements_mend + implements_finsh
if (!hasorgans(target))
return
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
break
return ..() && is_organ_damaged
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
/datum/surgery_step/internal/manipulate_organs/begin_step(mob/living/user, mob/living/carbon/target, target_zone, obj/item/tool,datum/surgery/surgery)
I = null
var/mob/living/carbon/human/H
if(istype(target,/mob/living/carbon/human))
H = target
affected = H.get_organ(target_zone)
if(is_int_organ(tool))
current_type = "insert"
I = tool
if(target_zone != I.parent_organ || target.get_organ_slot(I.slot))
user << "<span class='notice'>There is no room for [I] in [target]'s [parse_zone(target_zone)]!</span>"
return -1
if(I.damage > (I.max_damage * 0.75))
user << "<span class='notice'> \The [I] is in no state to be transplanted.</span>"
return -1
if(target.get_int_organ(I))
user << "<span class='warning'> \The [target] already has [I].</span>"
return -1
if(affected)
user.visible_message("[user] starts transplanting \the [tool] into [target]'s [affected.name].", \
"You start transplanting \the [tool] into [target]'s [affected.name].")
H.custom_pain("Someone's rooting around in your [affected.name]!",1)
else
user.visible_message("[user] starts transplanting \the [tool] into [target]'s [parse_zone(target_zone)].", \
"You start transplanting \the [tool] into [target]'s [parse_zone(target_zone)].")
else if(implement_type in implements_finsh)
//same as surgery step /datum/surgery_step/open_encased/close/
current_type = "finish"
if(affected && affected.encased)
var/msg = "[user] starts bending [target]'s [affected.encased] back into place with \the [tool]."
var/self_msg = "You start bending [target]'s [affected.encased] back into place with \the [tool]."
user.visible_message(msg, self_msg)
else
var/msg = "[user] starts pulling [target]'s skin back into place with \the [tool]."
var/self_msg = "You start pulling [target]'s skin back into place with \the [tool]."
user.visible_message(msg, self_msg)
if(affected)
H.custom_pain("Something hurts horribly in your [affected.name]!",1)
else if(implement_type in implements_extract)
current_type = "extract"
var/list/organs = target.get_organs_zone(target_zone)
if(!organs.len)
user << "<span class='notice'>There are no removeable organs in [target]'s [parse_zone(target_zone)]!</span>"
return -1
else
for(var/obj/item/organ/internal/O in organs)
O.on_find(user)
organs -= O
organs[O.name] = O
I = input("Remove which organ?", "Surgery", null, null) as null|anything in organs
if(I && user && target && user.Adjacent(target) && user.get_active_hand() == tool)
I = organs[I]
if(!I) return -1
user.visible_message("[user] starts to separate [target]'s [I] with \the [tool].", \
"You start to separate [target]'s [I] with \the [tool] for removal." )
if(affected)
H.custom_pain("The pain in your [affected.name] is living hell!",1)
else
return -1
else if(implement_type in implements_mend)
//todo Change message, make it heal the organs...
current_type = "mend"
var/tool_name = "\the [tool]"
if (istype(tool, /obj/item/stack/medical/advanced/bruise_pack))
tool_name = "regenerative membrane"
else if (istype(tool, /obj/item/stack/medical/bruise_pack))
tool_name = "the bandaid"
else if (istype(tool, /obj/item/stack/nanopaste))
tool_name = "\the [tool]" //what else do you call nanopaste medically?
if (!hasorgans(target))
if(!hasorgans(target))
user << "They do not have organs to mend!"
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
for(var/obj/item/organ/I in affected.internal_organs)
for(var/obj/item/organ/internal/I in affected.internal_organs)
if(I && I.damage > 0)
if(I.robotic < 2)
spread_germs_to_organ(I, user)
if(I.robotic < 2 && !istype (tool, /obj/item/stack/nanopaste))
if(!(I.sterile))
spread_germs_to_organ(I, user)
user.visible_message("[user] starts treating damage to [target]'s [I.name] with [tool_name].", \
"You start treating damage to [target]'s [I.name] with [tool_name]." )
else if(I.robotic > 2 && istype(tool, /obj/item/stack/nanopaste))
user.visible_message("[user] starts treating damage to [target]'s [I.name] with [tool_name].", \
"You start treating damage to [target]'s [I.name] with [tool_name]." )
target.custom_pain("The pain in your [affected.name] is living hell!",1)
..()
user << "No organs appear to be damaged."
H.custom_pain("The pain in your [affected.name] is living hell!",1)
end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
else if(istype(tool, /obj/item/weapon/reagent_containers/food/snacks/organ))
user << "<span class='warning'>[tool] was biten by someone! It's too damaged to use!</span>"
return -1
..()
/datum/surgery_step/internal/manipulate_organs/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
if(current_type == "mend")
var/tool_name = "\the [tool]"
if (istype(tool, /obj/item/stack/medical/advanced/bruise_pack))
tool_name = "regenerative membrane"
if (istype(tool, /obj/item/stack/medical/bruise_pack))
tool_name = "the bandaid"
if (istype(tool, /obj/item/stack/nanopaste))
tool_name = "\the [tool]" //what else do you call nanopaste medically?
if (!hasorgans(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
for(var/obj/item/organ/I in affected.internal_organs)
for(var/obj/item/organ/internal/I in affected.internal_organs)
if(I)
I.surgeryize()
if(I && I.damage > 0)
if(I.robotic < 2)
user.visible_message("\blue [user] treats damage to [target]'s [I.name] with [tool_name].", \
"\blue You treat damage to [target]'s [I.name] with [tool_name]." )
if(I.robotic < 2 && !istype (tool, /obj/item/stack/nanopaste))
user.visible_message("<span class='notice'> [user] treats damage to [target]'s [I.name] with [tool_name].</span>", \
"<span class='notice'> You treat damage to [target]'s [I.name] with [tool_name].</span>" )
I.damage = 0
else if(I.robotic > 2 && istype (tool, /obj/item/stack/nanopaste))
user.visible_message("<span class='notice'> [user] treats damage to [target]'s [I.name] with [tool_name].</span>", \
"<span class='notice'> You treat damage to [target]'s [I.name] with [tool_name].</span>" )
I.damage = 0
//return 1
else if(current_type == "insert")
I = tool
user.drop_item()
I.insert(target)
spread_germs_to_organ(I, user)
if(affected)
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>")
else
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 [parse_zone(target_zone)].</span>")
I.status &= ~ORGAN_CUT_AWAY
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
else if(current_type == "extract")
if(I && I.owner == target)
user.visible_message("<span class='notice'> [user] has separated and extracts [target]'s [I] with \the [tool].</span>" , \
"<span class='notice'> You have separated and extracted [target]'s [I] with \the [tool].</span>")
add_logs(target,user, "surgically removed [I.name] from", addition="INTENT: [uppertext(user.a_intent)]")
spread_germs_to_organ(I, user)
I.status |= ORGAN_CUT_AWAY
I.remove(target)
I.loc = get_turf(target)
else
user.visible_message("<span class='notice'>[user] can't seem to extract anything from [target]'s [parse_zone(target_zone)]!</span>",
"<span class='notice'>You can't extract anything from [target]'s [parse_zone(target_zone)]!</span>")
else if(current_type == "finish")
if(affected.encased)
var/msg = "<span class='notice'> [user] bends [target]'s [affected.encased] back into place with \the [tool].</span>"
var/self_msg = "<span class='notice'> You bend [target]'s [affected.encased] back into place with \the [tool].</span>"
user.visible_message(msg, self_msg)
affected.open = 2.5
else
var/msg = "<span class='notice'>[user] pulls [target]'s flesh back into place with \the [tool].</span>"
var/self_msg = "<span class='notice'>You pull [target]'s flesh back into place with \the [tool].</span>"
user.visible_message(msg, self_msg)
return 1
return 0
/datum/surgery_step/internal/manipulate_organs/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
if(current_type == "mend")
if (!hasorgans(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("\red [user]'s hand slips, getting mess and tearing the inside of [target]'s [affected.name] with \the [tool]!", \
"\red Your hand slips, getting mess and tearing the inside of [target]'s [affected.name] with \the [tool]!")
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>")
var/dam_amt = 2
if (istype(tool, /obj/item/stack/medical/advanced/bruise_pack))
target.adjustToxLoss(5)
else if (istype(tool, /obj/item/stack/medical/bruise_pack))
else if (istype(tool, /obj/item/stack/medical/bruise_pack) || istype(tool, /obj/item/stack/nanopaste))
dam_amt = 5
target.adjustToxLoss(10)
affected.createwound(CUT, 5)
for(var/obj/item/organ/I in affected.internal_organs)
if(I && I.damage > 0)
for(var/obj/item/organ/internal/I in affected.internal_organs)
if(I && I.damage > 0 && !(I.tough))
I.take_damage(dam_amt,0)
/datum/surgery_step/internal/detatch_organ
return 0
else if(current_type == "insert")
user.visible_message("<span class='warning'> [user]'s hand slips, damaging \the [tool]!</span>", \
"<span class='warning'> Your hand slips, damaging \the [tool]!</span>")
var/obj/item/organ/internal/I = tool
if(istype(I) &&!(I.tough))
I.take_damage(rand(3,5),0)
return 0
else if(current_type == "extract")
if(I && I.owner == target)
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>")
affected.createwound(BRUISE, 20)
else
user.visible_message("[user] can't seem to extract anything from [target]'s [parse_zone(target_zone)]!",
"<span class='notice'>You can't extract anything from [target]'s [parse_zone(target_zone)]!</span>")
return 0
else if(current_type == "finish")
if(affected.encased)
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>"
user.visible_message(msg, self_msg)
affected.fracture()
else
var/msg = "<span class='warning'> [user]'s hand slips, tearing the skin!</span>"
var/self_msg = "<span class='warning'> Your hand slips, tearing skin!</span>"
user.visible_message(msg, self_msg)
affected.createwound(BRUISE, 20)
return 0
return 0
//////////////////////////////////////////////////////////////////
// SPESHUL AYLIUM STUPS //
//////////////////////////////////////////////////////////////////
/datum/surgery_step/saw_carapace
name = "saw carapace"
allowed_tools = list(
/obj/item/weapon/circular_saw = 100, \
/obj/item/weapon/melee/energy/sword/cyborg/saw = 100, \
/obj/item/weapon/hatchet = 75
)
max_duration = 70
/datum/surgery_step/saw_carapace/begin_step(mob/living/user, mob/living/carbon/target, target_zone, obj/item/tool,datum/surgery/surgery)
user.visible_message("[user] begins to cut through [target]'s [target_zone] with \the [tool].", \
"You begin to cut through [target]'s [target_zone] with \the [tool].")
..()
/datum/surgery_step/saw_carapace/end_step(mob/living/user, mob/living/carbon/target, target_zone, obj/item/tool,datum/surgery/surgery)
user.visible_message("<span class='notice'> [user] has cut [target]'s [target_zone] open with \the [tool].</span>", \
"<span class='notice'> You have cut [target]'s [target_zone] open with \the [tool].</span>")
return 1
/datum/surgery_step/saw_carapace/fail_step(mob/living/user, mob/living/carbon/target, target_zone, obj/item/tool,datum/surgery/surgery)
user.visible_message("<span class='warning'> [user]'s hand slips, cracking [target]'s [target_zone] with \the [tool]!</span>" , \
"<span class='warning'> Your hand slips, cracking [target]'s [target_zone] with \the [tool]!</span>" )
return 0
/datum/surgery_step/cut_carapace
name = "cut carapace"
allowed_tools = list(
/obj/item/weapon/scalpel/laser3 = 115, \
/obj/item/weapon/scalpel/laser2 = 110, \
/obj/item/weapon/scalpel/laser1 = 105, \
/obj/item/weapon/scalpel/manager = 120, \
/obj/item/weapon/scalpel = 100, \
/obj/item/weapon/kitchen/knife = 75, \
/obj/item/weapon/shard = 50, \
/obj/item/weapon/scissors = 10, \
/obj/item/weapon/twohanded/chainsaw = 1, \
/obj/item/weapon/claymore = 5, \
/obj/item/weapon/melee/energy/ = 5, \
/obj/item/weapon/pen/edagger = 5, \
)
min_duration = 90
max_duration = 110
max_duration = 60
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
/datum/surgery_step/cut_carapace/begin_step(mob/living/user, mob/living/carbon/target, target_zone, obj/item/tool,datum/surgery/surgery)
if (!..())
return 0
user.visible_message("[user] starts the incision on [target]'s [target_zone] with \the [tool].", \
"You start the incision on [target]'s [target_zone] with \the [tool].")
..()
var/obj/item/organ/external/affected = target.get_organ(target_zone)
/datum/surgery_step/cut_carapace/end_step(mob/living/user, mob/living/carbon/target, target_zone, obj/item/tool,datum/surgery/surgery)
if(!(affected && !(affected.status & ORGAN_ROBOT)))
return 0
user.visible_message("<span class='notice'> [user] has made an incision on [target]'s [target_zone] with \the [tool].</span>", \
"<span class='notice'> You have made an incision on [target]'s [target_zone] with \the [tool].</span>",)
return 1
target.op_stage.current_organ = null
target.op_stage.organ_ref = null
/datum/surgery_step/cut_carapace/fail_step(mob/living/user, mob/living/carbon/target, target_zone, obj/item/tool,datum/surgery/surgery)
var/list/attached_organs = list()
for(var/organ in affected.internal_organs)
var/obj/item/organ/I = organ
if(I && !(I.status & ORGAN_CUT_AWAY) && I.parent_organ == target_zone)
attached_organs[I.organ_tag] = I
user.visible_message("<span class='warning'> [user]'s hand slips, slicing open [target]'s [target_zone] in a wrong spot with \the [tool]!</span>", \
"<span class='warning'> Your hand slips, slicing open [target]'s [target_zone] in a wrong spot with \the [tool]!</span>")
return 0
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
target.op_stage.current_organ = organ_to_remove
target.op_stage.organ_ref = attached_organs[organ_to_remove]
return ..() && organ_to_remove
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 separate [target]'s [target.op_stage.current_organ] with \the [tool].", \
"You start to separate [target]'s [target.op_stage.current_organ] with \the [tool]." )
target.custom_pain("The pain in your [affected.name] is living hell!",1)
..()
end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message("\blue [user] has separated [target]'s [target.op_stage.current_organ] with \the [tool]." , \
"\blue You have separated [target]'s [target.op_stage.current_organ] with \the [tool].")
var/obj/item/organ/I = target.op_stage.organ_ref
if(I && istype(I))
spread_germs_to_organ(I, user)
I.status |= ORGAN_CUT_AWAY
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("\red [user]'s hand slips, slicing an artery inside [target]'s [affected.name] with \the [tool]!", \
"\red Your hand slips, slicing an artery inside [target]'s [affected.name] with \the [tool]!")
affected.createwound(CUT, rand(30,50), 1)
/datum/surgery_step/internal/remove_organ
/datum/surgery_step/retract_carapace
name = "retract carapace"
allowed_tools = list(
/obj/item/weapon/hemostat = 100, \
/obj/item/weapon/wirecutters = 75, \
/obj/item/weapon/kitchen/utensil/fork = 20
/obj/item/weapon/scalpel/manager = 120, \
/obj/item/weapon/retractor = 100, \
/obj/item/weapon/crowbar = 75, \
/obj/item/weapon/kitchen/utensil/fork = 50
)
min_duration = 60
max_duration = 80
max_duration = 40
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
/datum/surgery_step/retract_carapace/begin_step(mob/living/user, mob/living/carbon/target, target_zone, obj/item/tool,datum/surgery/surgery)
var/msg = "[user] starts to pry open the incision on [target]'s [target_zone] with \the [tool]."
var/self_msg = "You start to pry open the incision on [target]'s [target_zone] with \the [tool]."
if (target_zone == "chest")
msg = "[user] starts to separate the ribcage and rearrange the organs in [target]'s torso with \the [tool]."
self_msg = "You start to separate the ribcage and rearrange the organs in [target]'s torso with \the [tool]."
if (target_zone == "groin")
msg = "[user] starts to pry open the incision and rearrange the organs in [target]'s lower abdomen with \the [tool]."
self_msg = "You start to pry open the incision and rearrange the organs in [target]'s lower abdomen with \the [tool]."
user.visible_message(msg, self_msg)
..()
if (!..())
return 0
var/obj/item/organ/external/affected = target.get_organ(target_zone)
/datum/surgery_step/retract_carapace/end_step(mob/living/user, mob/living/carbon/target, target_zone, obj/item/tool,datum/surgery/surgery)
var/msg = "<span class='notice'> [user] keeps the incision open on [target]'s [target_zone] with \the [tool]</span>."
var/self_msg = "<span class='notice'> You keep the incision open on [target]'s [target_zone] with \the [tool].</span>"
if (target_zone == "chest")
msg = "<span class='notice'> [user] keeps the ribcage open on [target]'s torso with \the [tool].</span>"
self_msg = "<span class='notice'> You keep the ribcage open on [target]'s torso with \the [tool].</span>"
if (target_zone == "groin")
msg = "<span class='notice'> [user] keeps the incision open on [target]'s lower abdomen with \the [tool].</span>"
self_msg = "<span class='notice'> You keep the incision open on [target]'s lower abdomen with \the [tool].</span>"
user.visible_message(msg, self_msg)
return 1
if(!istype(affected))
return 0
target.op_stage.current_organ = null
target.op_stage.organ_ref = null
var/list/removable_organs = list()
for(var/organ in affected.internal_organs)
var/obj/item/organ/I = organ
if(istype(I) && (I.status & ORGAN_CUT_AWAY) && I.parent_organ == target_zone)
removable_organs[I.organ_tag] = I
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
target.op_stage.current_organ = organ_to_remove
target.op_stage.organ_ref = removable_organs[organ_to_remove]
return ..()
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]!",1)
..()
end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message("\blue [user] has removed [target]'s [target.op_stage.current_organ] with \the [tool].", \
"\blue You have removed [target]'s [target.op_stage.current_organ] with \the [tool].")
// Extract the organ!
if(target.op_stage.current_organ)
var/obj/item/organ/O = target.op_stage.organ_ref
if(O && istype(O))
spread_germs_to_organ(O, user)
O.removed(user)
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("\red [user]'s hand slips, damaging [target]'s [affected.name] with \the [tool]!", \
"\red Your hand slips, damaging [target]'s [affected.name] with \the [tool]!")
affected.createwound(BRUISE, 20)
/datum/surgery_step/internal/replace_organ
allowed_tools = list(
/obj/item/organ = 100
)
min_duration = 60
max_duration = 80
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
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
if((affected.status & ORGAN_ROBOT) && !(O.status & ORGAN_ROBOT))
user << "<span class='danger'>You cannot install a naked organ into a robotic body.</span>"
return 2
if(!target.species)
user << "\red You have no idea what species this person is. Report this on the bug tracker."
return 2
var/o_is = (O.gender == PLURAL) ? "are" : "is"
var/o_a = (O.gender == PLURAL) ? "" : "a "
var/o_do = (O.gender == PLURAL) ? "don't" : "doesn't"
if(O.organ_tag == "limb")
return 0
else if(target.species.has_organ[O.organ_tag])
if(O.damage > (O.max_damage * 0.75))
user << "\red \The [O.organ_tag] [o_is] in no state to be transplanted."
return 2
if(!target.internal_organs_by_name[O.organ_tag])
organ_missing = 1
else
user << "\red \The [target] already has [o_a][O.organ_tag]."
return 2
if(O && affected.limb_name == O.parent_organ)
organ_compatible = 1
else
user << "\red \The [O.organ_tag] [o_do] normally go in \the [affected.name]."
return 2
else
user << "\red You're pretty sure [target.species.name] don't normally have [o_a][O.organ_tag]."
return 2
return ..() && organ_missing && organ_compatible
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]!",1)
..()
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("\blue [user] has transplanted \the [tool] into [target]'s [affected.name].", \
"\blue You have transplanted \the [tool] into [target]'s [affected.name].")
user.drop_item(tool)
var/obj/item/organ/O = tool
if(istype(O))
O.replaced(target,affected)
spread_germs_to_organ(O, user)
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message("\red [user]'s hand slips, damaging \the [tool]!", \
"\red 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
allowed_tools = list(
/obj/item/weapon/FixOVein = 100, \
/obj/item/stack/cable_coil = 75
)
min_duration = 100
max_duration = 120
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (!..())
return 0
var/obj/item/organ/external/affected = target.get_organ(target_zone)
if(!istype(affected))
return 0
target.op_stage.current_organ = null
target.op_stage.organ_ref = null
var/list/removable_organs = list()
for(var/organ in affected.internal_organs)
var/obj/item/organ/I = organ
if(I && istype(I) && (I.status & ORGAN_CUT_AWAY) && !(I.status & ORGAN_ROBOT) && I.parent_organ == target_zone)
removable_organs[I.organ_tag] = I
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
target.op_stage.current_organ = organ_to_replace
target.op_stage.organ_ref = removable_organs[organ_to_replace]
return ..()
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]!",1)
..()
end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message("\blue [user] has reattached [target]'s [target.op_stage.current_organ] with \the [tool]." , \
"\blue You have reattached [target]'s [target.op_stage.current_organ] with \the [tool].")
var/obj/item/organ/I = target.op_stage.organ_ref
if(I && istype(I))
I.status &= ~ORGAN_CUT_AWAY
spread_germs_to_organ(I, user)
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("\red [user]'s hand slips, damaging the flesh in [target]'s [affected.name] with \the [tool]!", \
"\red Your hand slips, damaging the flesh in [target]'s [affected.name] with \the [tool]!")
affected.createwound(BRUISE, 20)
//////////////////////////////////////////////////////////////////
// HEART SURGERY //
//////////////////////////////////////////////////////////////////
// To be finished after some tests.
// /datum/surgery_step/ribcage/heart/cut
// allowed_tools = list(
// /obj/item/weapon/scalpel = 100, \
// /obj/item/weapon/kitchen/knife = 75, \
// /obj/item/weapon/shard = 50, \
// )
// min_duration = 30
// max_duration = 40
// can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
// return ..() && target.op_stage.ribcage == 2
/datum/surgery_step/generic/retract_carapace/fail_step(mob/living/user, mob/living/carbon/target, target_zone, obj/item/tool,datum/surgery/surgery)
var/msg = "<span class='warning'> [user]'s hand slips, tearing the edges of incision on [target]'s [target_zone] with \the [tool]!</span>"
var/self_msg = "<span class='warning'> Your hand slips, tearing the edges of incision on [target]'s [target_zone] with \the [tool]!</span>"
if (target_zone == "chest")
msg = "<span class='warning'> [user]'s hand slips, damaging several organs [target]'s torso with \the [tool]!</span>"
self_msg = "<span class='warning'> Your hand slips, damaging several organs [target]'s torso with \the [tool]!</span>"
if (target_zone == "groin")
msg = "<span class='warning'> [user]'s hand slips, damaging several organs [target]'s lower abdomen with \the [tool]</span>"
self_msg = "<span class='warning'> Your hand slips, damaging several organs [target]'s lower abdomen with \the [tool]!</span>"
user.visible_message(msg, self_msg)
return 0
+189 -101
View File
@@ -2,10 +2,27 @@
//////////////////////////////////////////////////////////////////
// INTERNAL WOUND PATCHING //
//////////////////////////////////////////////////////////////////
/datum/surgery/bleeding
name = "internal bleeding"
steps = list(/datum/surgery_step/generic/cut_open,/datum/surgery_step/generic/clamp_bleeders,/datum/surgery_step/generic/retract_skin,/datum/surgery_step/fix_vein,/datum/surgery_step/generic/cauterize)
possible_locs = list("chest","head","groin")
/datum/surgery/bleeding/can_start(mob/user, mob/living/carbon/target)
if(ishuman(target))
var/mob/living/carbon/human/H = target
var/obj/item/organ/external/affected = H.get_organ(user.zone_sel.selecting)
if(!affected) return 0
var/internal_bleeding = 0
for(var/datum/wound/W in affected.wounds) if(W.internal)
internal_bleeding = 1
break
if(internal_bleeding)
return 1
return 0
/datum/surgery_step/fix_vein
priority = 2
name = "mend internal bleeding"
allowed_tools = list(
/obj/item/weapon/FixOVein = 100, \
/obj/item/stack/cable_coil = 75
@@ -13,45 +30,50 @@
can_infect = 1
blood_level = 1
min_duration = 70
max_duration = 90
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)
if(!affected) return 0
/datum/surgery_step/fix_vein/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
if(!affected) return 0
var/internal_bleeding = 0
for(var/datum/wound/W in affected.wounds) if(W.internal)
internal_bleeding = 1
break
var/internal_bleeding = 0
for(var/datum/wound/W in affected.wounds) if(W.internal)
internal_bleeding = 1
break
return affected.open == 2 && internal_bleeding
return affected.open == 2 && internal_bleeding
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 vein in [target]'s [affected.name] with \the [tool].")
target.custom_pain("The pain in [affected.name] is unbearable!",1)
..()
/datum/surgery_step/fix_vein/begin_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
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 vein in [target]'s [affected.name] with \the [tool].")
target.custom_pain("The pain in [affected.name] is unbearable!",1)
..()
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("\blue [user] has patched the damaged vein in [target]'s [affected.name] with \the [tool].", \
"\blue You have patched the damaged vein in [target]'s [affected.name] with \the [tool].")
/datum/surgery_step/fix_vein/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("<span class='notice'> [user] has patched the damaged vein in [target]'s [affected.name] with \the [tool].</span>", \
"<span class='notice'> You have patched the damaged vein in [target]'s [affected.name] with \the [tool].</span>")
for(var/datum/wound/W in affected.wounds) if(W.internal)
affected.wounds -= W
affected.update_damages()
if (ishuman(user) && prob(40)) user:bloody_hands(target, 0)
for(var/datum/wound/W in affected.wounds) if(W.internal)
affected.wounds -= W
affected.update_damages()
if (ishuman(user) && prob(40))
var/mob/living/carbon/human/U = user
U.bloody_hands(target, 0)
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("\red [user]'s hand slips, smearing [tool] in the incision in [target]'s [affected.name]!" , \
"\red Your hand slips, smearing [tool] in the incision in [target]'s [affected.name]!")
affected.take_damage(5, 0)
return 1
/datum/surgery_step/fix_vein/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
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>")
affected.take_damage(5, 0)
return 0
/datum/surgery_step/fix_dead_tissue //Debridement
priority = 2
name = "remove dead tissue"
allowed_tools = list(
/obj/item/weapon/scalpel = 100, \
/obj/item/weapon/kitchen/knife = 75, \
@@ -61,41 +83,44 @@
can_infect = 1
blood_level = 1
min_duration = 110
max_duration = 160
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if(!hasorgans(target))
return 0
/datum/surgery_step/fix_dead_tissue/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
if(!hasorgans(target))
return 0
if (target_zone == "mouth" || target_zone == "eyes")
return 0
if (target_zone == "mouth" || target_zone == "eyes")
return 0
var/obj/item/organ/external/affected = target.get_organ(target_zone)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
return affected && affected.open == 2 && (affected.status & ORGAN_DEAD)
return affected && affected.open == 2 && (affected.status & ORGAN_DEAD)
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 cutting away necrotic tissue in [target]'s [affected.name] with \the [tool]." , \
"You start cutting away necrotic tissue in [target]'s [affected.name] with \the [tool].")
target.custom_pain("The pain in [affected.name] is unbearable!",1)
..()
/datum/surgery_step/fix_dead_tissue/begin_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("[user] starts cutting away necrotic tissue in [target]'s [affected.name] with \the [tool]." , \
"You start cutting away necrotic tissue in [target]'s [affected.name] with \the [tool].")
target.custom_pain("The pain in [affected.name] is unbearable!",1)
..()
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("\blue [user] has cut away necrotic tissue in [target]'s [affected.name] with \the [tool].", \
"\blue You have cut away necrotic tissue in [target]'s [affected.name] with \the [tool].")
affected.open = 3
/datum/surgery_step/fix_dead_tissue/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("<span class='notice'> [user] has cut away necrotic tissue in [target]'s [affected.name] with \the [tool].</span>", \
"<span class='notice'> You have cut away necrotic tissue in [target]'s [affected.name] with \the [tool].</span>")
affected.open = 3
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("\red [user]'s hand slips, slicing an artery inside [target]'s [affected.name] with \the [tool]!", \
"\red Your hand slips, slicing an artery inside [target]'s [affected.name] with \the [tool]!")
affected.createwound(CUT, 20, 1)
return 1
/datum/surgery_step/fix_dead_tissue/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
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>")
affected.createwound(CUT, 20, 1)
return 0
/datum/surgery_step/treat_necrosis
priority = 2
name = "treat necrosis"
allowed_tools = list(
/obj/item/weapon/reagent_containers/dropper = 100,
/obj/item/weapon/reagent_containers/glass/bottle = 75,
@@ -107,63 +132,126 @@
can_infect = 0
blood_level = 0
min_duration = 50
max_duration = 60
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (!istype(tool, /obj/item/weapon/reagent_containers))
return 0
/datum/surgery_step/fix_dead_tissue/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
if (!istype(tool, /obj/item/weapon/reagent_containers))
return 0
var/obj/item/weapon/reagent_containers/container = tool
if(!container.reagents.has_reagent("mitocholide"))
return 0
var/obj/item/weapon/reagent_containers/container = tool
if(!container.reagents.has_reagent("mitocholide"))
return 0
if(!hasorgans(target))
return 0
if(!hasorgans(target))
return 0
if (target_zone == "mouth" || target_zone == "eyes")
return 0
if (target_zone == "mouth" || target_zone == "eyes")
return 0
var/obj/item/organ/external/affected = target.get_organ(target_zone)
return affected.open == 3 && (affected.status & ORGAN_DEAD)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
return affected.open == 3 && (affected.status & ORGAN_DEAD)
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!",1)
..()
/datum/surgery_step/fix_dead_tissue/begin_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
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!",1)
..()
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)
/datum/surgery_step/fix_dead_tissue/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
if (!istype(tool, /obj/item/weapon/reagent_containers))
return
if (!istype(tool, /obj/item/weapon/reagent_containers))
return
var/obj/item/weapon/reagent_containers/container = tool
var/obj/item/weapon/reagent_containers/container = tool
var/trans = container.reagents.trans_to(target, container.amount_per_transfer_from_this)
if (trans > 0)
container.reagents.reaction(target, INGEST) //technically it's contact, but the reagents are being applied to internal tissue
if(container.reagents.has_reagent("mitocholide"))
affected.status &= ~ORGAN_DEAD
user.visible_message("\blue [user] applies [trans] units of the solution to affected tissue in [target]'s [affected.name]", \
"\blue You apply [trans] units of the solution to affected tissue in [target]'s [affected.name] with \the [tool].")
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/weapon/reagent_containers))
return
var/obj/item/weapon/reagent_containers/container = tool
var/trans = container.reagents.trans_to(target, container.amount_per_transfer_from_this)
var/trans = container.reagents.trans_to(target, container.amount_per_transfer_from_this)
if (trans > 0)
container.reagents.reaction(target, INGEST) //technically it's contact, but the reagents are being applied to internal tissue
user.visible_message("\red [user]'s hand slips, applying [trans] units of the solution to the wrong place in [target]'s [affected.name] with the [tool]!" , \
"\red Your hand slips, applying [trans] units of the solution to the wrong place in [target]'s [affected.name] with the [tool]!")
if(container.reagents.has_reagent("mitocholide"))
affected.status &= ~ORGAN_DEAD
//no damage or anything, just wastes medicine
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>")
return 1
/datum/surgery_step/fix_dead_tissue/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
if (!istype(tool, /obj/item/weapon/reagent_containers))
return
var/obj/item/weapon/reagent_containers/container = tool
var/trans = container.reagents.trans_to(target, container.amount_per_transfer_from_this)
container.reagents.reaction(target, INGEST) //technically it's contact, but the reagents are being applied to internal tissue
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>")
//no damage or anything, just wastes medicine
//////////////////////////////////////////////////////////////////
// Dethrall Shadowling //
//////////////////////////////////////////////////////////////////
/datum/surgery/remove_thrall
name = "clense contaminations"//RENAME MEH
steps = list(/datum/surgery_step/generic/cut_open, /datum/surgery_step/generic/clamp_bleeders, /datum/surgery_step/generic/retract_skin, /datum/surgery_step/open_encased/saw,/datum/surgery_step/open_encased/retract, /datum/surgery_step/internal/dethrall,/datum/surgery_step/glue_bone, /datum/surgery_step/set_bone,/datum/surgery_step/finish_bone,/datum/surgery_step/generic/cauterize)
possible_locs = list("head")
/datum/surgery/remove_thrall/synth
name = "clense contaminations"//RENAME MEH
steps = list(/datum/surgery_step/robotics/external/unscrew_hatch,/datum/surgery_step/robotics/external/open_hatch,/datum/surgery_step/internal/dethrall,/datum/surgery_step/robotics/external/close_hatch)
possible_locs = list("chest")
/datum/surgery/remove_thrall/can_start(mob/user, mob/living/carbon/target)
return is_thrall(target)//would this be too meta?
/datum/surgery/remove_thrall/synth/can_start(mob/user, mob/living/carbon/target)
return is_thrall(target) && target.get_species() == "Machine"
/datum/surgery_step/dethrall
name = "cleanse contamination"
allowed_tools = list(/obj/item/device/flash = 100, /obj/item/device/flashlight/pen = 80, /obj/item/device/flashlight = 40)
max_duration = 120
/datum/surgery_step/internal/dethrall/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
if (!hasorgans(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
return ..() && affected && is_thrall(target) && affected.open_enough_for_surgery() && target_zone == target.named_organ_parent("brain")
/datum/surgery_step/internal/dethrall/begin_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
var/braincase = target.named_organ_parent("brain")
user.visible_message("[user] reaches into [target]'s head with [tool].", "<span class='notice'>You begin aligning [tool]'s light to the tumor on [target]'s brain...</span>")
target << "<span class='boldannounce'>A small part of your [braincase] pulses with agony as the light impacts it.</span>"
..()
/datum/surgery_step/internal/dethrall/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
user.visible_message("[user] shines light onto the tumor in [target]'s head!", "<span class='notice'>You cleanse the contamination from [target]'s brain!</span>")
ticker.mode.remove_thrall(target.mind,0)
target.visible_message("<span class='warning'>A strange black mass falls from [target]'s head!</span>")
new /obj/item/organ/internal/shadowtumor(get_turf(target))
return 1
/datum/surgery_step/internal/dethrall/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
var/braincase = target.named_organ_parent("brain")
if(prob(50))
user.visible_message("<span class='warning'>[user] slips and rips the tumor out from [target]'s [braincase]!</span>", \
"<span class='warning'><b>You fumble and tear out [target]'s tumor!</span>")
target.adjustBrainLoss(110) // This is so you can't just defib'n go
ticker.mode.remove_thrall(target.mind,1)
return 0
else
user.visible_message("<span class='warning'>[user]'s hand slips and fumbles! Luckily, they didn't damage anything!</span>")
return 0
+407 -257
View File
@@ -3,10 +3,51 @@
// COMMON STEPS //
//////////////////////////////////////////////////////////////////
/datum/surgery/cybernetic_repair
name = "Cybernetic Repair"
steps = list(/datum/surgery_step/robotics/external/unscrew_hatch,/datum/surgery_step/robotics/external/open_hatch,/datum/surgery_step/robotics/external/repair_brute,/datum/surgery_step/robotics/external/repair_burn,/datum/surgery_step/robotics/external/close_hatch)
possible_locs = list("chest","head","l_arm", "l_hand","r_arm","r_hand","r_leg","r_foot","l_leg","l_foot","groin")
requires_organic_bodypart = 0
/datum/surgery/cybernetic_repair/internal
name = "Internal Cybernetic Mainpulation"
steps = list(/datum/surgery_step/robotics/external/unscrew_hatch,/datum/surgery_step/robotics/external/open_hatch,/datum/surgery_step/robotics/manipulate_robotic_organs)
possible_locs = list("chest","head","groin")
requires_organic_bodypart = 0
/datum/surgery/cybernetic_amputation
name = "robotic limb amputation"
steps = list(/datum/surgery_step/robotics/external/amputate)
possible_locs = list("chest","head","l_arm", "l_hand","r_arm","r_hand","r_leg","r_foot","l_leg","l_foot","groin")
requires_organic_bodypart = 0
/datum/surgery/cybernetic_repair/can_start(mob/user, mob/living/carbon/target)
if(istype(target,/mob/living/carbon/human))
var/mob/living/carbon/human/H = target
var/obj/item/organ/external/affected = H.get_organ(user.zone_sel.selecting)
if(!affected)
return 0
if(!(affected.status & ORGAN_ROBOT))
return 0
return 1
/datum/surgery/cybernetic_amputation/can_start(mob/user, mob/living/carbon/target)
if(istype(target,/mob/living/carbon/human))
var/mob/living/carbon/human/H = target
var/obj/item/organ/external/affected = H.get_organ(user.zone_sel.selecting)
if(!affected)
return 0
if(!(affected.status & ORGAN_ROBOT))
return 0
return 1
//to do, moar surgerys or condense down ala mainpulate organs.
/datum/surgery_step/robotics
can_infect = 0
/datum/surgery_step/robotics/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
/datum/surgery_step/robotics/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
if (isslime(target))
return 0
if (target_zone == "eyes") //there are specific steps for eye surgery
@@ -22,7 +63,7 @@
/datum/surgery_step/robotics/external
/datum/surgery_step/robotics/external/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
/datum/surgery_step/robotics/external/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
if (!..())
return 0
var/obj/item/organ/external/affected = target.get_organ(target_zone)
@@ -31,361 +72,437 @@
return 1
/datum/surgery_step/robotics/external/unscrew_hatch
name = "unscrew hatch"
allowed_tools = list(
/obj/item/weapon/screwdriver = 100,
/obj/item/weapon/coin = 50,
/obj/item/weapon/kitchen/knife = 50
)
min_duration = 90
max_duration = 110
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 != "mouth"
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
/datum/surgery_step/robotics/external/unscrew_hatch/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
if(..())
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("[user] starts to unscrew the maintenance hatch on [target]'s [affected.name] with \the [tool].", \
"You start to unscrew the maintenance hatch on [target]'s [affected.name] with \the [tool].")
..()
return affected && affected.open == 0 && target_zone != "mouth"
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("\blue [user] has opened the maintenance hatch on [target]'s [affected.name] with \the [tool].", \
"\blue You have opened the maintenance hatch on [target]'s [affected.name] with \the [tool].",)
affected.open = 1
/datum/surgery_step/robotics/external/unscrew_hatch/begin_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("[user] starts to unscrew the maintenance hatch on [target]'s [affected.name] with \the [tool].", \
"You start to unscrew the maintenance hatch on [target]'s [affected.name] with \the [tool].")
..()
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("\red [user]'s [tool.name] slips, failing to unscrew [target]'s [affected.name].", \
"\red Your [tool] slips, failing to unscrew [target]'s [affected.name].")
/datum/surgery_step/robotics/external/unscrew_hatch/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("<span class='notice'> [user] has opened the maintenance hatch on [target]'s [affected.name] with \the [tool].</span>", \
"<span class='notice'> You have opened the maintenance hatch on [target]'s [affected.name] with \the [tool].</span>",)
affected.open = 1
return 1
/datum/surgery_step/robotics/external/unscrew_hatch/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
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>")
return 0
/datum/surgery_step/robotics/external/open_hatch
name = "open hatch"
allowed_tools = list(
/obj/item/weapon/retractor = 100,
/obj/item/weapon/crowbar = 100,
/obj/item/weapon/kitchen/utensil/ = 50
)
min_duration = 30
max_duration = 40
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
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
/datum/surgery_step/robotics/external/open_hatch/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
if(..())
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("[user] starts to pry open the maintenance hatch on [target]'s [affected.name] with \the [tool].",
"You start to pry open the maintenance hatch on [target]'s [affected.name] with \the [tool].")
..()
return affected && affected.open == 1
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("\blue [user] opens the maintenance hatch on [target]'s [affected.name] with \the [tool].", \
"\blue You open the maintenance hatch on [target]'s [affected.name] with \the [tool]." )
affected.open = 2
/datum/surgery_step/robotics/external/open_hatch/begin_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("[user] starts to pry open the maintenance hatch on [target]'s [affected.name] with \the [tool].",
"You start to pry open the maintenance hatch on [target]'s [affected.name] with \the [tool].")
..()
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("\red [user]'s [tool.name] slips, failing to open the hatch on [target]'s [affected.name].",
"\red Your [tool] slips, failing to open the hatch on [target]'s [affected.name].")
/datum/surgery_step/robotics/external/open_hatch/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
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 = 2
return 1
/datum/surgery_step/robotics/external/open_hatch/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
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>")
return 0
/datum/surgery_step/robotics/external/close_hatch
name = "close hatch"
allowed_tools = list(
/obj/item/weapon/retractor = 100,
/obj/item/weapon/crowbar = 100,
/obj/item/weapon/kitchen/utensil = 50
)
min_duration = 70
max_duration = 100
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 != "mouth"
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
/datum/surgery_step/robotics/external/close_hatch/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
if(..())
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("[user] begins to close and secure the hatch on [target]'s [affected.name] with \the [tool]." , \
"You begin to close and secure the hatch on [target]'s [affected.name] with \the [tool].")
..()
return affected && affected.open && target_zone != "mouth"
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("\blue [user] closes and secures the hatch on [target]'s [affected.name] with \the [tool].", \
"\blue You close and secure the hatch on [target]'s [affected.name] with \the [tool].")
affected.open = 0
affected.germ_level = 0
/datum/surgery_step/robotics/external/close_hatch/begin_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("[user] begins to close and secure the hatch on [target]'s [affected.name] with \the [tool]." , \
"You begin to close and secure the hatch on [target]'s [affected.name] with \the [tool].")
..()
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("\red [user]'s [tool.name] slips, failing to close the hatch on [target]'s [affected.name].",
"\red Your [tool.name] slips, failing to close the hatch on [target]'s [affected.name].")
/datum/surgery_step/robotics/external/close_hatch/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("<span class='notice'> [user] closes and secures the hatch on [target]'s [affected.name] with \the [tool].</span>", \
"<span class='notice'> You close and secure the hatch on [target]'s [affected.name] with \the [tool].</span>")
affected.open = 0
affected.germ_level = 0
return 1
/datum/surgery_step/robotics/external/close_hatch/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
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>")
return 0
/datum/surgery_step/robotics/external/repair_brute
name = "Repair brute damage"
allowed_tools = list(
/obj/item/weapon/weldingtool = 100,
/obj/item/weapon/gun/energy/plasmacutter = 50
)
min_duration = 50
max_duration = 60
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(tool,/obj/item/weapon/weldingtool))
var/obj/item/weapon/weldingtool/welder = tool
if(!welder.isOn() || !welder.remove_fuel(1,user))
return 0
return affected && affected.open == 2 && (affected.brute_dam > 0 || affected.disfigured)&& target_zone != "mouth"
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
/datum/surgery_step/robotics/external/repair_brute/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
if(..())
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("[user] begins to patch damage to [target]'s [affected.name]'s support structure with \the [tool]." , \
"You begin to patch damage to [target]'s [affected.name]'s support structure with \the [tool].")
..()
if(istype(tool,/obj/item/weapon/weldingtool))
var/obj/item/weapon/weldingtool/welder = tool
if(!welder.isOn() || !welder.remove_fuel(1,user))
return 0
return affected && affected.open == 2 && (affected.brute_dam > 0 || affected.disfigured)&& target_zone != "mouth"
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("\blue [user] finishes patching damage to [target]'s [affected.name] with \the [tool].", \
"\blue You finish patching damage to [target]'s [affected.name] with \the [tool].")
affected.heal_damage(rand(30,50),0,1,1)
if(affected.disfigured)
affected.disfigured = 0
affected.update_icon()
target.regenerate_icons()
/datum/surgery_step/robotics/external/repair_brute/begin_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("[user] begins to patch damage to [target]'s [affected.name]'s support structure with \the [tool]." , \
"You begin to patch damage to [target]'s [affected.name]'s support structure with \the [tool].")
..()
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("\red [user]'s [tool.name] slips, damaging the internal structure of [target]'s [affected.name].",
"\red 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/external/repair_brute/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("<span class='notice'> [user] finishes patching damage to [target]'s [affected.name] with \the [tool].</span>", \
"<span class='notice'> You finish patching damage to [target]'s [affected.name] with \the [tool].</span>")
affected.heal_damage(rand(30,50),0,1,1)
if(affected.disfigured)
affected.disfigured = 0
affected.update_icon()
target.regenerate_icons()
return 1
/datum/surgery_step/robotics/external/repair_brute/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
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>")
target.apply_damage(rand(5,10), BURN, affected)
return 0
/datum/surgery_step/robotics/external/repair_burn
name = "repair heat damage"
allowed_tools = list(
/obj/item/stack/cable_coil = 100
)
min_duration = 50
max_duration = 60
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 == 2 && affected.burn_dam > 0 && target_zone != "mouth")
if(limb_can_operate)
if(istype(C))
if(!C.get_amount() >= 3)
user << "<span class='warning'>You need three or more cable pieces to repair this damage.</span>"
return 2
C.use(3)
return 1
return 0
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
/datum/surgery_step/robotics/external/repair_burn/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
if(..())
var/obj/item/stack/cable_coil/C = tool
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("[user] begins to splice new cabling into [target]'s [affected.name]." , \
"You begin to splice new cabling into [target]'s [affected.name].")
..()
var/limb_can_operate = (affected && affected.open == 2 && affected.burn_dam > 0 && target_zone != "mouth")
if(limb_can_operate)
if(istype(C))
if(!C.get_amount() >= 3)
user << "<span class='warning'>You need three or more cable pieces to repair this damage.</span>"
return 2
C.use(3)
return 1
return 0
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("\blue [user] finishes splicing cable into [target]'s [affected.name].", \
"\blue You finishes splicing new cable into [target]'s [affected.name].")
affected.heal_damage(0,rand(30,50),1,1)
/datum/surgery_step/robotics/external/repair_burn/begin_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("[user] begins to splice new cabling into [target]'s [affected.name]." , \
"You begin to splice new cabling into [target]'s [affected.name].")
..()
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("\red [user] causes a short circuit in [target]'s [affected.name]!",
"\red You cause a short circuit in [target]'s [affected.name]!")
target.apply_damage(rand(5,10), BURN, affected)
/datum/surgery_step/robotics/external/repair_burn/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("<span class='notice'> [user] finishes splicing cable into [target]'s [affected.name].</span>", \
"<span class='notice'> You finishes splicing new cable into [target]'s [affected.name].</span>")
affected.heal_damage(0,rand(30,50),1,1)
return 1
/datum/surgery_step/robotics/fix_organ_robotic //For artificial organs
allowed_tools = list(
/obj/item/stack/nanopaste = 100, \
/obj/item/weapon/bonegel = 30, \
/obj/item/weapon/screwdriver = 70, \
)
/datum/surgery_step/robotics/external/repair_burn/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
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>")
target.apply_damage(rand(5,10), BURN, affected)
return 0
min_duration = 70
///////condenseing remove/extract/repair here. /////////////
/datum/surgery_step/robotics/manipulate_robotic_organs
name = "internal part mainpulation"
allowed_tools = list(/obj/item/device/mmi = 100)
var/implements_extract = list(/obj/item/device/multitool = 100)
var/implements_mend = list( /obj/item/stack/nanopaste = 100,/obj/item/weapon/bonegel = 30, /obj/item/weapon/screwdriver = 70)
var/implements_insert = list(/obj/item/weapon/screwdriver = 100)
var/implements_finish =list(/obj/item/weapon/retractor = 100,/obj/item/weapon/crowbar = 100,/obj/item/weapon/kitchen/utensil = 50)
var/current_type
var/obj/item/organ/internal/I = null
var/obj/item/organ/external/affected = null
max_duration = 90
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
/datum/surgery_step/robotics/manipulate_robotic_organs/New()
..()
allowed_tools = allowed_tools + implements_extract + implements_mend + implements_insert + implements_finish
if (!hasorgans(target))
return
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
break
return affected.open_enough_for_surgery() && is_organ_damaged
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
/datum/surgery_step/robotics/manipulate_robotic_organs/begin_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
I = null
affected = target.get_organ(target_zone)
if(implement_type in implements_insert)
current_type = "insert"
//I = tool
var/off_tool = user.get_inactive_hand()
if(!off_tool || !istype(off_tool,/obj/item/organ/internal))
user << "<span class='notice'>You need a replacement internal part in your off hand.</span>"
return -1
I = off_tool //and please god let it be an organ...
if(target_zone != I.parent_organ || target.get_organ_slot(I.slot))
user << "<span class='notice'>There is no room for [I] in [target]'s [parse_zone(target_zone)]!</span>"
return -1
if(I.damage > (I.max_damage * 0.75))
user << "<span class='notice'> \The [I] is in no state to be transplanted.</span>"
return -1
if(target.get_int_organ(I))
user << "<span class='warning'> \The [target] already has [I].</span>"
return -1
user.visible_message("[user] begins reattaching [target]'s [off_tool] with \the [tool].", \
"You start reattaching [target]'s [off_tool] with \the [tool].")
target.custom_pain("Someone's rooting around in your [affected.name]!",1)
else if(istype(tool,/obj/item/device/mmi))
current_type = "install"
if(target_zone != "chest")
user << "<span class='notice'> You must target the chest cavity.</span>"
return -1
var/obj/item/device/mmi/M = tool
if(!(affected && affected.open_enough_for_surgery()))
return -1
if(!istype(M))
return -1
if(!M.brainmob || !M.brainmob.client || !M.brainmob.ckey || M.brainmob.stat >= DEAD)
user << "<span class='danger'>That brain is not usable.</span>"
return -1
if(!(affected.status & ORGAN_ROBOT))
user << "<span class='danger'>You cannot install a computer brain into a meat enclosure.</span>"
return -1
if(!target.species)
user << "<span class='danger'>You have no idea what species this person is. Report this on the bug tracker.</span>"
return -1
if(!target.species.has_organ["brain"])
user << "<span class='danger'>You're pretty sure [target.species.name_plural] don't normally have a brain.</span>"
return -1
if(target.get_int_organ(/obj/item/organ/internal/brain/))
user << "<span class='danger'>Your subject already has a brain.</span>"
return -1
user.visible_message("[user] starts installing \the [tool] into [target]'s [affected.name].", \
"You start installing \the [tool] into [target]'s [affected.name].")
else if(implement_type in implements_extract)
current_type = "extract"
var/list/organs = target.get_organs_zone(target_zone)
if(!(affected && (affected.status & ORGAN_ROBOT)))
return -1
if(!affected.open_enough_for_surgery())
return -1
if(!organs.len)
user << "<span class='notice'>There is no removeable organs in [target]'s [parse_zone(target_zone)]!</span>"
return -1
else
for(var/obj/item/organ/internal/O in organs)
O.on_find(user)
organs -= O
organs[O.name] = O
I = input("Remove which organ?", "Surgery", null, null) as null|anything in organs
if(I && user && target && user.Adjacent(target) && user.get_active_hand() == tool)
I = organs[I]
if(!I) return -1
user.visible_message("[user] starts to decouple [target]'s [I] with \the [tool].", \
"You start to decouple [target]'s [I] with \the [tool]." )
target.custom_pain("The pain in your [affected.name] is living hell!",1)
else
return -1
else if(implement_type in implements_mend)
current_type = "mend"
if (!hasorgans(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
for(var/obj/item/organ/I in affected.internal_organs)
for(var/obj/item/organ/internal/I in affected.internal_organs)
if(I && I.damage > 0)
if(I.robotic >= 2)
user.visible_message("[user] starts mending the damage to [target]'s [I.name]'s mechanisms.", \
"You start mending the damage to [target]'s [I.name]'s mechanisms." )
target.custom_pain("The pain in your [affected.name] is living hell!",1)
..()
end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
else if(implement_type in implements_finish)
current_type = "finish"
user.visible_message("[user] begins to close and secure the hatch on [target]'s [affected.name] with \the [tool]." , \
"You begin to close and secure the hatch on [target]'s [affected.name] with \the [tool].")
..()
/datum/surgery_step/robotics/manipulate_robotic_organs/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
if(current_type == "mend")
if (!hasorgans(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
for(var/obj/item/organ/I in affected.internal_organs)
for(var/obj/item/organ/internal/I in affected.internal_organs)
if(I && I.damage > 0)
if(I.robotic >= 2)
user.visible_message("\blue [user] repairs [target]'s [I.name] with [tool].", \
"\blue You repair [target]'s [I.name] with [tool]." )
user.visible_message("<span class='notice'> [user] repairs [target]'s [I.name] with [tool].</span>", \
"<span class='notice'> You repair [target]'s [I.name] with [tool].</span>" )
I.damage = 0
else if(current_type == "insert")
var/obj/item/organ/internal/I = target.get_int_organ(surgery.current_organ)
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/off_tool = user.get_inactive_hand()
I = off_tool
//user.drop_item()
I.insert(target)
user.visible_message("<span class='notice'> [user] has reattached [target]'s [I] with \the [tool].</span>" , \
"<span class='notice'> You have reattached [target]'s [I] with \the [tool].</span>")
if(I && istype(I))
I.status &= ~ORGAN_CUT_AWAY
qdel(off_tool)
else if (current_type == "install")
user.visible_message("<span class='notice'> [user] has installed \the [tool] into [target]'s [affected.name].</span>", \
"<span class='notice'> You have installed \the [tool] into [target]'s [affected.name].</span>")
var/obj/item/device/mmi/M = tool
var/obj/item/organ/internal/brain/mmi_holder/holder = new()
if (istype(M, /obj/item/device/mmi/posibrain))
holder.robotize()
holder.insert(target)
user.unEquip(tool)
tool.forceMove(holder)
holder.stored_mmi = tool
holder.update_from_mmi()
if(M.brainmob && M.brainmob.mind)
M.brainmob.mind.transfer_to(target)
else if(current_type == "extract")
if(I && I.owner == target)
user.visible_message("<span class='notice'> [user] has decoupled [target]'s [surgery.current_organ] with \the [tool].</span>" , \
"<span class='notice'> You have decoupled [target]'s [surgery.current_organ] with \the [tool].</span>")
add_logs(target,user, "surgically removed [I.name] from", addition="INTENT: [uppertext(user.a_intent)]")
spread_germs_to_organ(I, user)
I.status |= ORGAN_CUT_AWAY
I.remove(target)
I.loc = get_turf(target)
else
user.visible_message("[user] can't seem to extract anything from [target]'s [parse_zone(target_zone)]!",
"<span class='notice'>You can't extract anything from [target]'s [parse_zone(target_zone)]!</span>")
else if(current_type == "finish")
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("<span class='notice'> [user] closes and secures the hatch on [target]'s [affected.name] with \the [tool].</span>", \
"<span class='notice'> You close and secure the hatch on [target]'s [affected.name] with \the [tool].</span>")
affected.open = 0
affected.germ_level = 0
return 1
return 0
/datum/surgery_step/robotics/manipulate_robotic_organs/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
if(current_type == "mend")
if (!hasorgans(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("\red [user]'s hand slips, gumming up the mechanisms inside of [target]'s [affected.name] with \the [tool]!", \
"\red Your hand slips, gumming up the mechanisms inside of [target]'s [affected.name] with \the [tool]!")
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>")
target.adjustToxLoss(5)
affected.createwound(CUT, 5)
for(var/obj/item/organ/I in affected.internal_organs)
for(var/obj/item/organ/internal/I in affected.internal_organs)
if(I)
I.take_damage(rand(3,5),0)
/datum/surgery_step/robotics/detatch_organ_robotic
else if(current_type == "insert")
user.visible_message("<span class='warning'> [user]'s hand slips, disconnecting \the [tool].</span>", \
"<span class='warning'> Your hand slips, disconnecting \the [tool].</span>")
allowed_tools = list(
/obj/item/device/multitool = 100
)
min_duration = 90
max_duration = 110
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
else if(current_type == "extract")
user.visible_message("<span class='warning'> [user]'s hand slips, disconnecting \the [tool].</span>", \
"<span class='warning'> Your hand slips, disconnecting \the [tool].</span>")
else if (current_type == "install")
user.visible_message("<span class='warning'> [user]'s hand slips!</span>.", \
"<span class='warning'> Your hand slips!</span>")
else if(current_type == "finish")
var/obj/item/organ/external/affected = target.get_organ(target_zone)
if(!(affected && (affected.status & ORGAN_ROBOT)))
return 0
if(!affected.open_enough_for_surgery())
return 0
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>")
return -1
target.op_stage.current_organ = null
target.op_stage.organ_ref = null
var/list/attached_organs = list()
for(var/organ in affected.internal_organs)
var/obj/item/organ/I = organ
if(I && istype(I) && !(I.status & ORGAN_CUT_AWAY) && I.parent_organ == target_zone)
attached_organs[I.organ_tag] = I
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
target.op_stage.current_organ = organ_to_remove
target.op_stage.organ_ref = attached_organs[organ_to_remove]
return ..() && organ_to_remove
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message("[user] starts to decouple [target]'s [target.op_stage.current_organ] with \the [tool].", \
"You start to decouple [target]'s [target.op_stage.current_organ] with \the [tool]." )
..()
end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message("\blue [user] has decoupled [target]'s [target.op_stage.current_organ] with \the [tool]." , \
"\blue 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
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message("\red [user]'s hand slips, disconnecting \the [tool].", \
"\red Your hand slips, disconnecting \the [tool].")
/datum/surgery_step/robotics/attach_organ_robotic
allowed_tools = list(
/obj/item/weapon/screwdriver = 100,
)
min_duration = 100
max_duration = 120
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)
if(!(affected && (affected.status & ORGAN_ROBOT)))
return 0
if(!affected.open_enough_for_surgery())
return 0
target.op_stage.current_organ = null
target.op_stage.organ_ref = null
var/list/removable_organs = list()
for(var/organ in affected.internal_organs)
var/obj/item/organ/I = organ
if(I && istype(I) && (I.status & ORGAN_CUT_AWAY) && (I.status & ORGAN_ROBOT) && I.parent_organ == target_zone)
removable_organs[I.organ_tag] = I
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
target.op_stage.current_organ = organ_to_replace
target.op_stage.organ_ref = removable_organs[organ_to_replace]
return ..()
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].")
..()
end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message("\blue [user] has reattached [target]'s [target.op_stage.current_organ] with \the [tool]." , \
"\blue 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
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message("\red [user]'s hand slips, disconnecting \the [tool].", \
"\red Your hand slips, disconnecting \the [tool].")
/datum/surgery_step/robotics/install_mmi
allowed_tools = list(
/obj/item/device/mmi = 100
)
min_duration = 60
max_duration = 80
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
if(target_zone != "chest")
return 0
@@ -414,29 +531,29 @@
user << "<span class='danger'>You're pretty sure [target.species.name_plural] don't normally have a brain.</span>"
return 2
if(!isnull(target.internal_organs["brain"]))
if(target.get_int_organ(/obj/item/organ/internal/brain/))
user << "<span class='danger'>Your subject already has a brain.</span>"
return 2
return 1
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
begin_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("[user] starts installing \the [tool] into [target]'s [affected.name].", \
"You start installing \the [tool] into [target]'s [affected.name].")
..()
end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("\blue [user] has installed \the [tool] into [target]'s [affected.name].", \
"\blue You have installed \the [tool] into [target]'s [affected.name].")
user.visible_message("<span class='notice'> [user] has installed \the [tool] into [target]'s [affected.name].</span>", \
"<span class='notice'> You have installed \the [tool] into [target]'s [affected.name].</span>")
var/obj/item/device/mmi/M = tool
var/obj/item/organ/mmi_holder/holder = new(target, 1)
var/obj/item/organ/internal/brain/mmi_holder/holder = new()
if (istype(M, /obj/item/device/mmi/posibrain))
holder.robotize()
target.internal_organs_by_name["brain"] = holder
holder.insert(target)
user.unEquip(tool)
tool.forceMove(holder)
holder.stored_mmi = tool
@@ -445,6 +562,39 @@
if(M.brainmob && M.brainmob.mind)
M.brainmob.mind.transfer_to(target)
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message("\red [user]'s hand slips.", \
"\red Your hand slips.")
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
user.visible_message("<span class='warning'> [user]'s hand slips.</span>", \
"<span class='warning'> Your hand slips.</span>")
/datum/surgery_step/robotics/external/amputate
name = "remove robotic limb"
allowed_tools = list(
/obj/item/device/multitool = 100)
max_duration = 110
/datum/surgery_step/robotics/external/amputate/begin_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("[user] starts to decouple [target]'s [affected.name] with \the [tool].", \
"You start to decouple [target]'s [affected.name] with \the [tool]." )
target.custom_pain("Your [affected.amputation_point] is being ripped apart!",1)
..()
/datum/surgery_step/robotics/external/amputate/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("<span class='notice'> [user] has decoupled [target]'s [affected.name] with \the [tool].</span>" , \
"<span class='notice'> You have decoupled [target]'s [affected.name] with \the [tool].</span>")
add_logs(target,user ,"surgically removed [affected.name] from", addition="INTENT: [uppertext(user.a_intent)]")//log it
affected.droplimb(1,DROPLIMB_EDGE)
return 1
/datum/surgery_step/robotics/external/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
user.visible_message("<span class='warning'> [user]'s hand slips!</span>", \
"<span class='warning'> Your hand slips!</span>")
return 0
+44 -33
View File
@@ -1,13 +1,19 @@
//////////////////////////////////////////////////////////////////
// SLIME CORE EXTRACTION //
//////////////////////////////////////////////////////////////////
/datum/surgery/core_removal
name = "core removal"
steps = list(/datum/surgery_step/slime/cut_flesh, /datum/surgery_step/slime/cut_innards, /datum/surgery_step/slime/saw_core)
allowed_mob = list(/mob/living/carbon/slime)
possible_locs = list("chest")//urgghhhhhhhhhhhh
/datum/surgery_step/slime
is_valid_target(mob/living/carbon/slime/target)
return istype(target, /mob/living/carbon/slime/)
can_use(mob/living/user, mob/living/carbon/slime/target, target_zone, obj/item/tool)
return target.stat == 2
return target.stat == DEAD
/datum/surgery_step/slime/cut_flesh
allowed_tools = list(
@@ -16,24 +22,26 @@
/obj/item/weapon/shard = 50, \
)
min_duration = 30
max_duration = 50
can_use(mob/living/user, mob/living/carbon/slime/target, target_zone, obj/item/tool)
/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
begin_step(mob/user, mob/living/carbon/slime/target, target_zone, obj/item/tool)
/datum/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].")
end_step(mob/living/user, mob/living/carbon/slime/target, target_zone, obj/item/tool)
user.visible_message("\blue [user] cuts through [target]'s flesh with \the [tool].", \
"\blue You cut through [target]'s flesh with \the [tool], revealing its silky innards.")
/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
fail_step(mob/living/user, mob/living/carbon/slime/target, target_zone, obj/item/tool)
user.visible_message("\red [user]'s hand slips, tearing [target]'s flesh with \the [tool]!", \
"\red Your hand slips, tearing [target]'s flesh with \the [tool]!")
return 1
/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>")
return 0
/datum/surgery_step/slime/cut_innards
allowed_tools = list(
@@ -42,24 +50,25 @@
/obj/item/weapon/shard = 50, \
)
min_duration = 30
max_duration = 50
can_use(mob/living/user, mob/living/carbon/slime/target, target_zone, obj/item/tool)
/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
begin_step(mob/user, mob/living/carbon/slime/target, target_zone, obj/item/tool)
/datum/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].")
end_step(mob/living/user, mob/living/carbon/slime/target, target_zone, obj/item/tool)
user.visible_message("\blue [user] cuts [target]'s innards apart with \the [tool], exposing the cores.", \
"\blue You cut [target]'s innards apart with \the [tool], exposing the cores.")
/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
return 1
fail_step(mob/living/user, mob/living/carbon/slime/target, target_zone, obj/item/tool)
user.visible_message("\red [user]'s hand slips, tearing [target]'s innards with \the [tool]!", \
"\red Your hand slips, tearing [target]'s innards with \the [tool]!")
/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>")
return 0
/datum/surgery_step/slime/saw_core
allowed_tools = list(
@@ -67,26 +76,28 @@
/obj/item/weapon/hatchet = 75
)
min_duration = 50
max_duration = 70
can_use(mob/living/user, mob/living/carbon/slime/target, target_zone, obj/item/tool)
/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.
begin_step(mob/user, mob/living/carbon/slime/target, target_zone, obj/item/tool)
/datum/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].")
end_step(mob/living/user, mob/living/carbon/slime/target, target_zone, obj/item/tool)
target.cores--
user.visible_message("\blue [user] cuts out one of [target]'s cores with \the [tool].",, \
"\blue You cut out one of [target]'s cores with \the [tool]. [target.cores] cores left.")
/datum/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>")
if(target.cores >= 0)
new target.coretype(target.loc)
if(target.cores <= 0)
target.icon_state = "[target.colour] baby slime dead-nocore"
if(target.cores >= 0)
new target.coretype(target.loc)
if(target.cores <= 0)
target.icon_state = "[target.colour] baby slime dead-nocore"
fail_step(mob/living/user, mob/living/carbon/slime/target, target_zone, obj/item/tool)
user.visible_message("\red [user]'s hand slips, causing \him to miss the core!", \
"\red Your hand slips, causing you to miss the core!")
return 1
/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>")
return 0
+132 -61
View File
@@ -1,22 +1,133 @@
///Datum Surgery Helpers//
/datum/surgery
var/name
var/status = 1
var/list/steps = list()
/*
var/eyes = 0
var/face = 0
var/appendix = 0
var/ribcage = 0
var/head_reattach = 0 //Steps in a surgery
*/
var/can_cancel = 1
var/step_in_progress = 0
var/list/in_progress = list() //Actively performing a Surgery
var/location = "chest" //Surgery location
var/requires_organic_bodypart = 1 //Prevents you from performing an operation on robotic limbs
var/list/possible_locs = list() //Multiple locations -- c0
var/obj/item/organ/organ_ref //Operable body part
var/current_organ = "organ"
var/list/allowed_mob = list(/mob/living/carbon/human)
/datum/surgery/proc/can_start(mob/user, mob/living/carbon/target)
// if 0 surgery wont show up in list
// put special restrictions here
return 1
/datum/surgery/proc/next_step(mob/user, mob/living/carbon/target)
if(step_in_progress) return
var/datum/surgery_step/S = get_surgery_step()
if(S)
if(S.try_op(user, target, user.zone_sel.selecting, user.get_active_hand(), src))
return 1
return 0
/datum/surgery/proc/get_surgery_step()
var/step_type = steps[status]
return new step_type
/datum/surgery/proc/complete(mob/living/carbon/human/target)
target.surgeries -= src
src = null
/* SURGERY STEPS */
/datum/surgery_step
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
var/list/allowed_tools = null
// type paths referencing mutantraces that this step applies to.
var/list/allowed_species = null
var/list/disallowed_species = null
var/implement_type = null
// duration of the step
var/min_duration = 0
var/max_duration = 0
var/name
var/accept_hand = 0 //does the surgery step require an open hand? If true, ignores implements. Compatible with accept_any_item.
var/accept_any_item = 0
// evil infection stuff that will make everyone hate me
var/can_infect = 0
//How much blood this step can get on surgeon. 1 - hands, 2 - full body.
var/blood_level = 0
var/list/allowed_mob = list()
var/list/disallowed_mob = list()
/datum/surgery_step/proc/try_op(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
var/success = 0
if(accept_hand)
if(!tool)
success = 1
if(accept_any_item)
if(tool && tool_quality(tool))
success = 1
else
for(var/path in allowed_tools)
if(istype(tool, path))
implement_type = path
if(tool_quality(tool))
success = 1
if(success)
if(target_zone == surgery.location)
initiate(user, target, target_zone, tool, surgery)
return 1//returns 1 so we don't stab the guy in the dick or wherever.
if(isrobot(user) && user.a_intent != I_HARM) //to save asimov borgs a LOT of heartache
return 1
return 0
/datum/surgery_step/proc/initiate(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
surgery.step_in_progress = 1
if(begin_step(user, target, target_zone, tool, surgery) == -1)
surgery.step_in_progress = 0
return
var/advance = 0
var/prob_chance = 100
if(implement_type) //this means it isn't a require nd or any item step.
prob_chance = min(allowed_tools[implement_type], 100)
prob_chance *= get_location_modifier(target)
if(prob_chance > 100)//if we are using a super tool
max_duration = max_duration/prob_chance //PLACEHOLDER VALUES
if(do_after(user, max_duration, target = target))
if(prob(prob_chance) || isrobot(user))
if(end_step(user, target, target_zone, tool, surgery))
advance = 1
else
if(fail_step(user, target, target_zone, tool, surgery))
advance = 1
if(advance)
surgery.status++
if(surgery.status > surgery.steps.len)
surgery.complete(target)
surgery.step_in_progress = 0
//returns how well tool is suited for this step
/datum/surgery_step/proc/tool_quality(obj/item/tool)
for (var/T in allowed_tools)
@@ -29,28 +140,29 @@
if(!hasorgans(target))
return 0
if(allowed_species)
for(var/species in allowed_species)
if(target.species.name == species)
if(allowed_mob)//can i just remove this and/or change it?
for(var/species in allowed_mob)
if(target.get_species() == species)
return 1
if(disallowed_species)
for(var/species in disallowed_species)
if(target.species.name == species)
if(disallowed_mob)
for(var/species in disallowed_mob)
if(target.get_species() == species)
return 0
return 1
// 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)
/datum/surgery_step/proc/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
return 0
// 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)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
if (can_infect && affected)
spread_germs_to_organ(affected, user)
if (ishuman(user) && prob(60))
/datum/surgery_step/proc/begin_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
if(ishuman(target))
var/obj/item/organ/external/affected = target.get_organ(target_zone)
if (can_infect && affected)
spread_germs_to_organ(affected, user)
if (ishuman(user) && !(istype(target,/mob/living/carbon/alien)) && prob(60))
var/mob/living/carbon/human/H = user
if (blood_level)
H.bloody_hands(target,0)
@@ -59,54 +171,23 @@
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)
/datum/surgery_step/proc/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
return
// 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)
/datum/surgery_step/proc/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery)
return null
/proc/spread_germs_to_organ(obj/item/organ/E, mob/living/carbon/human/user)
if(!istype(user) || !istype(E)) return
//world << "Germ spread: [E] : [E.owner]"
var/germ_level = user.germ_level
if(user.gloves)
germ_level = user.gloves.germ_level
if(!(E.status & ORGAN_ROBOT)) //Germs on robotic limbs bad
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)
if(!istype(M))
return 0
if (user.a_intent == I_HARM) //check for Hippocratic Oath
return 0
var/zone = user.zone_sel.selecting
if(zone in M.op_stage.in_progress) //Can't operate on someone repeatedly.
user << "\red You can't operate on this area while surgery is already in progress."
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 == 2) // 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
//We had proper tools! (or RNG smiled.) and user did not move or change hands.
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.
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.
return 1 //don't want to do weapony things after surgery
if (user.a_intent == I_HELP)
user << "<span class='warning'>You can't see any useful way to use [tool] on [M].</span>"
return 1
return 0
/proc/sort_surgeries()
var/gap = surgery_steps.len
@@ -123,13 +204,3 @@
if(l.priority < r.priority)
surgery_steps.Swap(i, gap + i)
swapped = 1
/datum/surgery_status/
var/eyes = 0
var/face = 0
var/appendix = 0
var/ribcage = 0
var/head_reattach = 0
var/current_organ = "organ"
var/obj/item/organ/organ_ref = null
var/list/in_progress = list()
+5 -12
View File
@@ -82,9 +82,9 @@
/*
* Researchable Scalpels
*/
/obj/item/weapon/scalpel/laser1
/obj/item/weapon/scalpel/laser1 //lasers also count as catuarys
name = "laser scalpel"
desc = "A scalpel augmented with a directed laser, for more precise cutting without blood entering the field. This one looks basic and could be improved."
desc = "A scalpel augmented with a directed laser. This one looks basic and could be improved."
icon_state = "scalpel_laser1_on"
item_state = "scalpel"
damtype = "fire"
@@ -92,7 +92,7 @@
/obj/item/weapon/scalpel/laser2
name = "laser scalpel"
desc = "A scalpel augmented with a directed laser, for more precise cutting without blood entering the field. This one looks somewhat advanced."
desc = "A scalpel augmented with a directed laser. This one looks somewhat advanced."
icon_state = "scalpel_laser2_on"
item_state = "scalpel"
damtype = "fire"
@@ -100,13 +100,13 @@
/obj/item/weapon/scalpel/laser3
name = "laser scalpel"
desc = "A scalpel augmented with a directed laser, for more precise cutting without blood entering the field. This one looks to be the pinnacle of precision energy cutlery!"
desc = "A scalpel augmented with a directed laser. This one looks to be the pinnacle of precision energy cutlery!"
icon_state = "scalpel_laser3_on"
item_state = "scalpel"
damtype = "fire"
hitsound = 'sound/weapons/sear.ogg'
/obj/item/weapon/scalpel/manager
/obj/item/weapon/scalpel/manager //super tool! Retractor/hemostat
name = "incision management system"
desc = "A true extension of the surgeon's body, this marvel instantly and completely prepares an incision allowing for the immediate commencement of therapeutic steps."
icon_state = "scalpel_manager_on"
@@ -132,7 +132,6 @@
origin_tech = "materials=1;biotech=1"
attack_verb = list("attacked", "slashed", "sawed", "cut")
//misc, formerly from code/defines/weapons.dm
/obj/item/weapon/bonegel
name = "bone gel"
@@ -171,9 +170,3 @@
w_class = 1.0
origin_tech = "biotech=1"
attack_verb = list("slapped")
/*
/obj/item/weapon/surgical_drapes/attack(mob/living/M, mob/user)
if(!attempt_initiate_surgery(src, M, user))
..()
*/