manual mirror of upstream robotic surgery pr

This commit is contained in:
deathride58
2017-10-25 14:29:45 -04:00
parent d0a9c56f3b
commit 70a2c466f3
12 changed files with 207 additions and 45 deletions

View File

@@ -4,7 +4,7 @@
steps = list(/datum/surgery_step/incise, /datum/surgery_step/clamp_bleeders, /datum/surgery_step/retract_skin, /datum/surgery_step/saw, /datum/surgery_step/clamp_bleeders, /datum/surgery_step/sever_limb)
species = list(/mob/living/carbon/human, /mob/living/carbon/monkey)
possible_locs = list("r_arm", "l_arm", "l_leg", "r_leg", "head")
requires_organic_bodypart = 0
requires_bodypart_type = 0
/datum/surgery_step/sever_limb
@@ -22,4 +22,4 @@
var/obj/item/bodypart/target_limb = surgery.operated_bodypart
target_limb.drop_limb()
return 1
return 1

View File

@@ -3,7 +3,7 @@
steps = list(/datum/surgery_step/incise, /datum/surgery_step/retract_skin, /datum/surgery_step/clamp_bleeders, /datum/surgery_step/fix_eyes, /datum/surgery_step/close)
species = list(/mob/living/carbon/human, /mob/living/carbon/monkey)
possible_locs = list("eyes")
requires_organic_bodypart = 0
requires_bodypart_type = 0
//fix eyes
/datum/surgery_step/fix_eyes
@@ -35,4 +35,4 @@
target.adjustBrainLoss(100)
else
user.visible_message("<span class='warning'>[user] accidentally stabs [target] right in the brain! Or would have, if [target] had a brain.</span>", "<span class='warning'>You accidentally stab [target] right in the brain! Or would have, if [target] had a brain.</span>")
return FALSE
return FALSE

View File

@@ -29,7 +29,7 @@
if(affecting)
if(!S.requires_bodypart)
continue
if(S.requires_organic_bodypart && affecting.status == BODYPART_ROBOTIC)
if(S.requires_bodypart_type && affecting.status == BODYPART_ROBOTIC)
continue
if(S.requires_real_bodypart && affecting.is_pseudopart)
continue
@@ -56,7 +56,7 @@
if(affecting)
if(!S.requires_bodypart)
return
if(S.requires_organic_bodypart && affecting.status == BODYPART_ROBOTIC)
if(S.requires_bodypart_type && affecting.status == BODYPART_ROBOTIC)
return
else if(C && S.requires_bodypart)
return
@@ -78,13 +78,23 @@
user.visible_message("[user] removes the drapes from [M]'s [parse_zone(selected_zone)].", \
"<span class='notice'>You remove the drapes from [M]'s [parse_zone(selected_zone)].</span>")
qdel(current_surgery)
else if(istype(user.get_inactive_held_item(), /obj/item/cautery) && current_surgery.can_cancel)
M.surgeries -= current_surgery
user.visible_message("[user] mends the incision and removes the drapes from [M]'s [parse_zone(selected_zone)].", \
"<span class='notice'>You mend the incision and remove the drapes from [M]'s [parse_zone(selected_zone)].</span>")
qdel(current_surgery)
else if(current_surgery.can_cancel)
to_chat(user, "<span class='warning'>You need to hold a cautery in inactive hand to stop [M]'s surgery!</span>")
if(current_surgery.requires_bodypart_type == BODYPART_ORGANIC)
if(istype(user.get_inactive_held_item(), /obj/item/cautery))
M.surgeries -= current_surgery
user.visible_message("[user] mends the incision and removes the drapes from [M]'s [parse_zone(selected_zone)].", \
"<span class='notice'>You mend the incision and remove the drapes from [M]'s [parse_zone(selected_zone)].</span>")
qdel(current_surgery)
else
to_chat(user, "<span class='warning'>You need to hold a cautery in inactive hand to stop [M]'s surgery!</span>")
else if(current_surgery.requires_bodypart_type == BODYPART_ROBOTIC)
if(istype(user.get_inactive_held_item(), /obj/item/screwdriver))
M.surgeries -= current_surgery
user.visible_message("[user] screw the shell and removes the drapes from [M]'s [parse_zone(selected_zone)].", \
"<span class='notice'>You screw the shell and remove the drapes from [M]'s [parse_zone(selected_zone)].</span>")
qdel(current_surgery)
else
to_chat(user, "<span class='warning'>You need to hold a screwdriver in inactive hand to stop [M]'s surgery!</span>")
return 1
@@ -161,4 +171,3 @@
return 0
return 1

View File

@@ -3,7 +3,6 @@
steps = list(/datum/surgery_step/incise, /datum/surgery_step/clamp_bleeders, /datum/surgery_step/retract_skin, /datum/surgery_step/extract_implant, /datum/surgery_step/close)
species = list(/mob/living/carbon/human, /mob/living/carbon/monkey)
possible_locs = list("chest")
requires_organic_bodypart = 0
//extract implant
@@ -43,4 +42,15 @@
else
to_chat(user, "<span class='warning'>You can't find anything in [target]'s [target_zone]!</span>")
return 1
return 1
/datum/surgery/implant_removal/mechanic
name = "implant removal"
requires_bodypart_type = BODYPART_ROBOTIC
steps = list(
/datum/surgery_step/mechanic_open,
/datum/surgery_step/open_hatch,
/datum/surgery_step/mechanic_unwrench,
/datum/surgery_step/extract_implant,
/datum/surgery_step/mechanic_wrench,
/datum/surgery_step/mechanic_close)

View File

@@ -0,0 +1,85 @@
//open shell
/datum/surgery_step/mechanic_open
name = "unscrew shell"
implements = list(
/obj/item/screwdriver = 100,
/obj/item/scalpel = 75, // med borgs could try to unskrew shell with scalpel
/obj/item/kitchen/knife = 50,
/obj/item = 10) // 10% success with any sharp item.
time = 24
/datum/surgery_step/mechanic_open/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
user.visible_message("[user] begins to unscrew the shell of [target]'s [parse_zone(target_zone)].",
"<span class='notice'>You begin to unscrew the shell of [target]'s [parse_zone(target_zone)]...</span>")
/datum/surgery_step/mechanic_incise/tool_check(mob/user, obj/item/tool)
if(implement_type == /obj/item && !tool.is_sharp())
return FALSE
return TRUE
//close shell
/datum/surgery_step/mechanic_close
name = "screw shell"
implements = list(
/obj/item/screwdriver = 100,
/obj/item/scalpel = 75,
/obj/item/kitchen/knife = 50,
/obj/item = 10) // 10% success with any sharp item.
time = 24
/datum/surgery_step/mechanic_close/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
user.visible_message("[user] begins to screw the shell of [target]'s [parse_zone(target_zone)].",
"<span class='notice'>You begin to screw the shell of [target]'s [parse_zone(target_zone)]...</span>")
/datum/surgery_step/mechanic_close/tool_check(mob/user, obj/item/tool)
if(implement_type == /obj/item && !tool.is_sharp())
return FALSE
return TRUE
//prepare electronics
/datum/surgery_step/prepare_electronics
name = "prepare electronics"
implements = list(
/obj/item/device/multitool = 100,
/obj/item/hemostat = 10) // try to reboot internal controllers via short circuit with some conductor
time = 24
/datum/surgery_step/prepare_electronics/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
user.visible_message("[user] begins to prepare electronics in [target]'s [parse_zone(target_zone)].",
"<span class='notice'>You begin to prepare electronics in [target]'s [parse_zone(target_zone)]...</span>")
//unwrench
/datum/surgery_step/mechanic_unwrench
name = "unwrench bolts"
implements = list(
/obj/item/wrench = 100,
/obj/item/retractor = 10)
time = 24
/datum/surgery_step/mechanic_unwrench/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
user.visible_message("[user] begins to unwrench some bolts in [target]'s [parse_zone(target_zone)].",
"<span class='notice'>You begin to unwrench some bolts in [target]'s [parse_zone(target_zone)]...</span>")
//wrench
/datum/surgery_step/mechanic_wrench
name = "wrench bolts"
implements = list(
/obj/item/wrench = 100,
/obj/item/retractor = 10)
time = 24
/datum/surgery_step/mechanic_wrench/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
user.visible_message("[user] begins to wrench some bolts in [target]'s [parse_zone(target_zone)].",
"<span class='notice'>You begin to wrench some bolts in [target]'s [parse_zone(target_zone)]...</span>")
//open hatch
/datum/surgery_step/open_hatch
name = "open the hatch"
accept_hand = 1
time = 10
/datum/surgery_step/open_hatch/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
user.visible_message("[user] begins to open the hatch holders in [target]'s [parse_zone(target_zone)].",
"<span class='notice'>You begin to open the hatch holders in [target]'s [parse_zone(target_zone)]...</span>")

View File

@@ -1,38 +1,79 @@
/datum/surgery/organ_manipulation
name = "organ manipulation"
steps = list(/datum/surgery_step/incise, /datum/surgery_step/retract_skin, /datum/surgery_step/saw, /datum/surgery_step/clamp_bleeders,
/datum/surgery_step/incise, /datum/surgery_step/manipulate_organs)
species = list(/mob/living/carbon/human, /mob/living/carbon/monkey)
possible_locs = list("chest", "head")
requires_organic_bodypart = FALSE
requires_real_bodypart = TRUE
requires_real_bodypart = 1
steps = list(
/datum/surgery_step/incise,
/datum/surgery_step/retract_skin,
/datum/surgery_step/saw,
/datum/surgery_step/clamp_bleeders,
/datum/surgery_step/incise,
/datum/surgery_step/manipulate_organs,
//there should be bone fixing
/datum/surgery_step/close
)
/datum/surgery/organ_manipulation/soft
possible_locs = list("groin", "eyes", "mouth", "l_arm", "r_arm")
steps = list(/datum/surgery_step/incise, /datum/surgery_step/retract_skin, /datum/surgery_step/clamp_bleeders,
/datum/surgery_step/incise, /datum/surgery_step/manipulate_organs)
steps = list(
/datum/surgery_step/incise,
/datum/surgery_step/retract_skin,
/datum/surgery_step/clamp_bleeders,
/datum/surgery_step/incise,
/datum/surgery_step/manipulate_organs,
/datum/surgery_step/close
)
/datum/surgery/organ_manipulation/alien
name = "alien organ manipulation"
possible_locs = list("chest", "head", "groin", "eyes", "mouth", "l_arm", "r_arm")
species = list(/mob/living/carbon/alien/humanoid)
steps = list(/datum/surgery_step/saw, /datum/surgery_step/incise, /datum/surgery_step/retract_skin, /datum/surgery_step/saw, /datum/surgery_step/manipulate_organs)
steps = list(
/datum/surgery_step/saw,
/datum/surgery_step/incise,
/datum/surgery_step/retract_skin,
/datum/surgery_step/saw,
/datum/surgery_step/manipulate_organs,
/datum/surgery_step/close
)
/datum/surgery/organ_manipulation/mechanic
name = "prosthesis organ manipulation"
possible_locs = list("chest", "head")
requires_bodypart_type = BODYPART_ROBOTIC
steps = list(
/datum/surgery_step/mechanic_open,
/datum/surgery_step/open_hatch,
/datum/surgery_step/mechanic_unwrench,
/datum/surgery_step/prepare_electronics,
/datum/surgery_step/manipulate_organs,
/datum/surgery_step/mechanic_wrench,
/datum/surgery_step/mechanic_close
)
/datum/surgery/organ_manipulation/mechanic/soft
possible_locs = list("groin", "eyes", "mouth", "l_arm", "r_arm")
steps = list(
/datum/surgery_step/mechanic_open,
/datum/surgery_step/open_hatch,
/datum/surgery_step/prepare_electronics,
/datum/surgery_step/manipulate_organs,
/datum/surgery_step/mechanic_close
)
/datum/surgery_step/manipulate_organs
time = 64
name = "manipulate organs"
repeatable = 1
implements = list(/obj/item/organ = 100, /obj/item/reagent_containers/food/snacks/organ = 0, /obj/item/organ_storage = 100)
var/implements_extract = list(/obj/item/hemostat = 100, /obj/item/crowbar = 55)
var/implements_mend = list(/obj/item/cautery = 100, /obj/item/weldingtool = 70, /obj/item/lighter = 45, /obj/item/match = 20)
var/current_type
var/obj/item/organ/I = null
/datum/surgery_step/manipulate_organs/New()
..()
implements = implements + implements_extract + implements_mend
implements = implements + implements_extract
/datum/surgery_step/manipulate_organs/tool_check(mob/user, obj/item/tool)
if(istype(tool, /obj/item/weldingtool))
@@ -103,23 +144,12 @@
else
return -1
else if(implement_type in implements_mend)
current_type = "mend"
user.visible_message("[user] begins to mend the incision in [target]'s [parse_zone(target_zone)].",
"<span class='notice'>You begin to mend the incision in [target]'s [parse_zone(target_zone)]...</span>")
else if(istype(tool, /obj/item/reagent_containers/food/snacks/organ))
to_chat(user, "<span class='warning'>[tool] was bitten by someone! It's too damaged to use!</span>")
return -1
/datum/surgery_step/manipulate_organs/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
if(current_type == "mend")
user.visible_message("[user] mends the incision in [target]'s [parse_zone(target_zone)].",
"<span class='notice'>You mend the incision in [target]'s [parse_zone(target_zone)].</span>")
if(locate(/datum/surgery_step/saw) in surgery.steps)
target.heal_bodypart_damage(45,0)
return 1
else if(current_type == "insert")
if(current_type == "insert")
if(istype(tool, /obj/item/organ_storage))
I = tool.contents[1]
tool.icon_state = "evidenceobj"

View File

@@ -2,7 +2,7 @@
//make incision
/datum/surgery_step/incise
name = "make incision"
implements = list(/obj/item/scalpel = 100, /obj/item/melee/transforming/energy/sword = 75, /obj/item/kitchen/knife = 65,
implements = list(/obj/item/scalpel = 100, /obj/item/melee/transforming/energy/sword = 75, /obj/item/kitchen/knife = 65,
/obj/item/shard = 45, /obj/item = 30) // 30% success with any sharp item.
time = 16
@@ -87,7 +87,7 @@
//saw bone
/datum/surgery_step/saw
name = "saw bone"
implements = list(/obj/item/circular_saw = 100, /obj/item/melee/transforming/energy/sword/cyborg/saw = 100,
implements = list(/obj/item/circular_saw = 100, /obj/item/melee/transforming/energy/sword/cyborg/saw = 100,
/obj/item/melee/arm_blade = 75, /obj/item/mounted_chainsaw = 65, /obj/item/twohanded/required/chainsaw = 50,
/obj/item/twohanded/fireaxe = 50, /obj/item/hatchet = 35, /obj/item/kitchen/knife/butcher = 25)
time = 54

View File

@@ -4,6 +4,7 @@
species = list(/mob/living/carbon/human, /mob/living/carbon/monkey)
possible_locs = list("r_arm", "l_arm", "l_leg", "r_leg", "head")
requires_bodypart = FALSE //need a missing limb
requires_bodypart_type = 0
/datum/surgery/prosthetic_replacement/can_start(mob/user, mob/living/carbon/target)
if(!iscarbon(target))
@@ -84,4 +85,3 @@
var/obj/item/melee/arm_blade/new_arm = new(target,TRUE,TRUE)
target_zone == "r_arm" ? target.put_in_r_hand(new_arm) : target.put_in_l_hand(new_arm)
return 1

View File

@@ -6,7 +6,7 @@
var/can_cancel = 1 //Can cancel this surgery after step 1 with cautery
var/list/species = list(/mob/living/carbon/human) //Acceptable Species
var/location = "chest" //Surgery location
var/requires_organic_bodypart = 1 //Prevents you from performing an operation on robotic limbs
var/requires_bodypart_type = BODYPART_ORGANIC //Prevents you from performing an operation on robotic limbs
var/list/possible_locs = list() //Multiple locations
var/ignore_clothes = 0 //This surgery ignores clothes
var/mob/living/carbon/target //Operation target mob
@@ -53,6 +53,13 @@
var/step_type = steps[status]
return new step_type
/datum/surgery/proc/get_surgery_next_step()
if(status < steps.len)
var/step_type = steps[status + 1]
return new step_type
else
return null
/datum/surgery/proc/complete()
SSblackbox.add_details("surgeries_completed", "[type]")
qdel(src)

View File

@@ -5,6 +5,7 @@
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 //does the surgery step accept any item? If true, ignores implements. Compatible with require_hand.
var/time = 10 //how long does the step take?
var/repeatable = 0
/datum/surgery_step/proc/try_op(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
@@ -31,8 +32,19 @@
else
to_chat(user, "<span class='warning'>You need to expose [target]'s [parse_zone(target_zone)] to perform surgery on it!</span>")
return 1 //returns 1 so we don't stab the guy in the dick or wherever.
if(repeatable)
var/datum/surgery/next_step = surgery.get_surgery_next_step()
if(next_step)
surgery.status++
if(next_step.try_op(user, target, user.zone_selected, user.get_active_held_item(), surgery))
return 1
else
surgery.status--
if(iscyborg(user) && user.a_intent != INTENT_HARM) //to save asimov borgs a LOT of heartache
return 1
return 0
@@ -63,7 +75,7 @@
if(failure(user, target, target_zone, tool, surgery))
advance = 1
if(advance)
if(advance && !repeatable)
surgery.status++
if(surgery.status > surgery.steps.len)
surgery.complete()