mostly working now

This commit is contained in:
Fox-McCloud
2017-06-05 19:35:06 -04:00
parent 3de897d884
commit 4a6d8cd1e1
9 changed files with 127 additions and 102 deletions
+1 -4
View File
@@ -80,7 +80,4 @@
#define WEAPON_LIGHT 0
#define WEAPON_MEDIUM 1
#define WEAPON_HEAVY 2
// Embedded objects
#define EMBED_THROWSPEED_THRESHOLD 15
#define WEAPON_HEAVY 2
+6
View File
@@ -235,6 +235,12 @@ or something covering your eyes."
desc = "All that alcohol you've been drinking is impairing your speech, motor skills, and mental cognition. Make sure to act like it."
icon_state = "drunk"
/obj/screen/alert/embeddedobject
name = "Embedded Object"
desc = "Something got lodged into your flesh and is causing major bleeding. It might fall out with time, but surgery is the safest way. \
If you're feeling frisky, click yourself in help intent to pull the object out."
icon_state = "embeddedobject"
/obj/screen/alert/embeddedobject/Click()
if(isliving(usr))
var/mob/living/carbon/human/M = usr
+1 -1
View File
@@ -246,7 +246,7 @@
src.show_message(text("\t []My [] is [].",status=="OK"?"<span class='notice'></span>":"<span class='warning'></span>",org.name,status),1)
for(var/obj/item/I in org.embedded_objects)
to_chat(src, "\t <a href='byond://?src=\ref[src];embedded_object=\ref[I];embedded_limb=\ref[org]' class='warning'>There is \a [I] embedded in your [org.name]!</a>")
to_chat(src, "\t <a href='byond://?src=[UID()];embedded_object=[I.UID()];embedded_limb=[org.UID()]' class='warning'>There is \a [I] embedded in your [org.name]!</a>")
if(staminaloss)
if(staminaloss > 30)
@@ -1,10 +1,3 @@
//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,
@@ -210,89 +203,4 @@
return 1
else
to_chat(user, "<span class='warning'>You don't find anything in [target]'s [target_zone].</span>")
return 0
//////////////////////////////////////////////////////////////////
// IMPLANT 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")
/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")
/datum/surgery/cavity_implant_rem/can_start(mob/user, mob/living/carbon/human/target)
if(!istype(target))
return 0
var/obj/item/organ/external/affected = target.get_organ(user.zone_sel.selecting)
if(!affected)
return 0
if(affected.status & ORGAN_ROBOT)
return 0
return 1
/datum/surgery/cavity_implant_rem/synth/can_start(mob/user, mob/living/carbon/human/target)
if(!istype(target))
return 0
var/obj/item/organ/external/affected = target.get_organ(user.zone_sel.selecting)
if(!affected)
return 0
if(!(affected.status & ORGAN_ROBOT))
return 0
return 1
/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
time = 64
/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)
..()
/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>" )
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)
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)
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
return 0
+78
View File
@@ -0,0 +1,78 @@
//////////////////////////////////////////////////////////////////
// IMPLANT REMOVAL SURGERY //
//////////////////////////////////////////////////////////////////
/datum/surgery/implant_removal
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/extract_implant,/datum/surgery_step/generic/cauterize)
possible_locs = list("chest")
/datum/surgery/implant_removal/synth
name = "Implant Removal"
steps = list(/datum/surgery_step/robotics/external/unscrew_hatch,/datum/surgery_step/robotics/external/open_hatch,/datum/surgery_step/extract_implant,/datum/surgery_step/robotics/external/close_hatch)
possible_locs = list("chest")
/datum/surgery/implant_removal/can_start(mob/user, mob/living/carbon/human/target)
if(!istype(target))
return 0
var/obj/item/organ/external/affected = target.get_organ(user.zone_sel.selecting)
if(!affected)
return 0
if(affected.status & ORGAN_ROBOT)
return 0
return 1
/datum/surgery/implant_removal/synth/can_start(mob/user, mob/living/carbon/human/target)
if(!istype(target))
return 0
var/obj/item/organ/external/affected = target.get_organ(user.zone_sel.selecting)
if(!affected)
return 0
if(!(affected.status & ORGAN_ROBOT))
return 0
return 1
/datum/surgery_step/extract_implant
name = "extract implant"
allowed_tools = list(/obj/item/weapon/hemostat = 100, /obj/item/weapon/crowbar = 65)
time = 64
var/obj/item/weapon/implant/I = null
/datum/surgery_step/extract_implant/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)
..()
/datum/surgery_step/extract_implant/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>" )
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)
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
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
+12
View File
@@ -159,6 +159,11 @@
else if(implement_type in implements_extract)
current_type = "extract"
var/list/organs = target.get_organs_zone(target_zone)
var/mob/living/simple_animal/borer/B = target.has_brain_worms()
if(B)
user.visible_message("[user] begins to extract [B] from [target]'s [parse_zone(target_zone)].",
"<span class='notice'>You begin to extract [B] from [target]'s [parse_zone(target_zone)]...</span>")
return TRUE
if(!organs.len)
to_chat(user, "<span class='notice'>There are no removeable organs in [target]'s [parse_zone(target_zone)]!</span>")
return -1
@@ -262,6 +267,13 @@
I.status &= ~ORGAN_CUT_AWAY
else if(current_type == "extract")
/* var/mob/living/simple_animal/borer/B = target.has_brain_worms()
if(B && B.victim == target)
user.visible_message("[user] successfully extracts [B] from [target]'s [parse_zone(target_zone)]!",
"<span class='notice'>You successfully extract [B] from [target]'s [parse_zone(target_zone)].</span>")
add_logs(user, target, "surgically removed [B] from", addition="INTENT: [uppertext(user.a_intent)]")
B.leave_victim()
return FALSE */
if(I && I.owner == target)
user.visible_message("<span class='notice'> [user] has separated and extracts [target]'s [I] with [tool].</span>",
"<span class='notice'> You have separated and extracted [target]'s [I] with [tool].</span>")
+26 -3
View File
@@ -1,11 +1,34 @@
/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)
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,/datum/surgery_step/generic/cauterize)
possible_locs = list("head", "chest", "l_arm", "l_hand", "r_arm", "r_hand","r_leg", "r_foot", "l_leg", "l_foot", "groin")
/datum/surgery/embedded_removal/synth
steps = list(/datum/surgery_step/robotics/external/unscrew_hatch,/datum/surgery_step/robotics/external/open_hatch,/datum/surgery_step/remove_object,/datum/surgery_step/robotics/external/close_hatch)
/datum/surgery/embedded_removal/can_start(mob/user, mob/living/carbon/human/target)
if(!istype(target))
return 0
var/obj/item/organ/external/affected = target.get_organ(user.zone_sel.selecting)
if(!affected)
return 0
if(affected.status & ORGAN_ROBOT)
return 0
return 1
/datum/surgery/embedded_removal/synth/can_start(mob/user, mob/living/carbon/human/target)
if(!istype(target))
return 0
var/obj/item/organ/external/affected = target.get_organ(user.zone_sel.selecting)
if(!affected)
return 0
if(!(affected.status & ORGAN_ROBOT))
return 0
return 1
/datum/surgery_step/remove_object
name = "remove embedded objects"
name = "Remove Embedded Objects"
time = 32
accept_hand = 1
var/obj/item/organ/external/L = null
Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 37 KiB

+2 -1
View File
@@ -2126,12 +2126,13 @@
#include "code\modules\store\items.dm"
#include "code\modules\store\store.dm"
#include "code\modules\surgery\bones.dm"
#include "code\modules\surgery\cavity_implant.dm"
#include "code\modules\surgery\dental_implant.dm"
#include "code\modules\surgery\encased.dm"
#include "code\modules\surgery\face.dm"
#include "code\modules\surgery\generic.dm"
#include "code\modules\surgery\helpers.dm"
#include "code\modules\surgery\implant.dm"
#include "code\modules\surgery\implant_removal.dm"
#include "code\modules\surgery\limb_reattach.dm"
#include "code\modules\surgery\organs_internal.dm"
#include "code\modules\surgery\other.dm"