mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-20 19:44:09 +01:00
Object Embedding
This commit is contained in:
@@ -199,14 +199,14 @@
|
||||
affected.wounds += I
|
||||
affected.owner.custom_pain("You feel something rip in your [affected.name]!", 1)
|
||||
user.drop_item()
|
||||
target.internal_organs += tool
|
||||
affected.hidden = tool
|
||||
tool.forceMove(affected)
|
||||
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
|
||||
affected.hidden = null
|
||||
return 1
|
||||
else
|
||||
to_chat(user, "<span class='warning'>You don't find anything in [target]'s [target_zone].</span>")
|
||||
@@ -214,18 +214,18 @@
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////
|
||||
// IMPLANT/ITEM REMOVAL SURGERY //
|
||||
// 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")//head is for borers..i can put it elsewhere
|
||||
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")//head is for borers..i can put it elsewhere
|
||||
possible_locs = list("chest")
|
||||
|
||||
/datum/surgery/cavity_implant_rem/can_start(mob/user, mob/living/carbon/human/target)
|
||||
if(!istype(target))
|
||||
@@ -295,102 +295,4 @@
|
||||
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
|
||||
|
||||
/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, /datum/surgery_step/generic/cauterize)
|
||||
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/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)
|
||||
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/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"
|
||||
time = 32
|
||||
allowed_tools = list(
|
||||
/obj/item/weapon/scalpel/laser/manager = 100, \
|
||||
/obj/item/weapon/hemostat = 100, \
|
||||
/obj/item/stack/cable_coil = 75, \
|
||||
/obj/item/device/assembly/mousetrap = 20
|
||||
)
|
||||
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.detach()
|
||||
worm.leave_host()
|
||||
user.visible_message("a slug like creature wiggles out of [H]'s [target_zone]!")
|
||||
|
||||
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
|
||||
to_chat(user, "<span class='warning'>You find no objects embedded in [H]'s [L.limb_name]!</span>")
|
||||
else
|
||||
to_chat(user, "<span class='warning'>You can't find [target]'s [target_zone], let alone any objects embedded in it!</span>")
|
||||
|
||||
return 1
|
||||
return 1
|
||||
@@ -58,7 +58,7 @@
|
||||
var/encased // Needs to be opened with a saw to access the organs.
|
||||
|
||||
var/obj/item/hidden = null
|
||||
var/list/implants = list()
|
||||
var/list/embedded_objects = list()
|
||||
|
||||
// how often wounds should be updated, a higher number means less often
|
||||
var/wound_update_accuracy = 1
|
||||
@@ -104,7 +104,7 @@
|
||||
|
||||
QDEL_LIST(wounds)
|
||||
|
||||
QDEL_LIST(implants)
|
||||
QDEL_LIST(embedded_objects)
|
||||
|
||||
QDEL_NULL(hidden)
|
||||
|
||||
@@ -358,12 +358,6 @@ This function completely restores a damaged organ to perfect condition.
|
||||
for(var/obj/item/organ/external/EO in contents)
|
||||
EO.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()
|
||||
if(!owner)
|
||||
@@ -907,20 +901,6 @@ Note that amputating the affected organ does in fact remove the infection from t
|
||||
/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))
|
||||
|
||||
@@ -931,14 +911,17 @@ Note that amputating the affected organ does in fact remove the infection from t
|
||||
var/is_robotic = status & ORGAN_ROBOT
|
||||
var/mob/living/carbon/human/victim = owner
|
||||
|
||||
for(var/obj/item/I in embedded_objects)
|
||||
embedded_objects -= I
|
||||
I.forceMove(src)
|
||||
if(!owner.has_embedded_objects())
|
||||
owner.clear_alert("embeddedobject")
|
||||
|
||||
. = ..()
|
||||
|
||||
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)
|
||||
@@ -1018,3 +1001,22 @@ Note that amputating the affected organ does in fact remove the infection from t
|
||||
..() // Parent call loads in the DNA
|
||||
if(data["dna"])
|
||||
sync_colour_to_dna()
|
||||
|
||||
//Remove all embedded objects from all limbs on the carbon mob
|
||||
/mob/living/carbon/human/proc/remove_all_embedded_objects()
|
||||
var/turf/T = get_turf(src)
|
||||
|
||||
for(var/X in bodyparts)
|
||||
var/obj/item/organ/external/L = X
|
||||
for(var/obj/item/I in L.embedded_objects)
|
||||
L.embedded_objects -= I
|
||||
I.forceMove(T)
|
||||
|
||||
clear_alert("embeddedobject")
|
||||
|
||||
/mob/living/carbon/human/proc/has_embedded_objects()
|
||||
. = 0
|
||||
for(var/X in bodyparts)
|
||||
var/obj/item/organ/external/L = X
|
||||
for(var/obj/item/I in L.embedded_objects)
|
||||
return 1
|
||||
@@ -0,0 +1,42 @@
|
||||
/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("head", "chest", "l_arm", "l_hand", "r_arm", "r_hand","r_leg", "r_foot", "l_leg", "l_foot", "groin")
|
||||
|
||||
|
||||
/datum/surgery_step/remove_object
|
||||
name = "remove embedded objects"
|
||||
time = 32
|
||||
accept_hand = 1
|
||||
var/obj/item/organ/external/L = null
|
||||
|
||||
|
||||
/datum/surgery_step/remove_object/begin_step(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
|
||||
L = surgery.organ_ref
|
||||
if(L)
|
||||
user.visible_message("[user] looks for objects embedded in [target]'s [parse_zone(user.zone_sel.selecting)].", "<span class='notice'>You look for objects embedded in [target]'s [parse_zone(user.zone_sel.selecting)]...</span>")
|
||||
else
|
||||
user.visible_message("[user] looks for [target]'s [parse_zone(user.zone_sel.selecting)].", "<span class='notice'>You look for [target]'s [parse_zone(user.zone_sel.selecting)]...</span>")
|
||||
|
||||
|
||||
/datum/surgery_step/remove_object/end_step(mob/user, mob/living/carbon/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.embedded_objects)
|
||||
objects++
|
||||
I.forceMove(get_turf(H))
|
||||
L.embedded_objects -= I
|
||||
if(!H.has_embedded_objects())
|
||||
H.clear_alert("embeddedobject")
|
||||
|
||||
if(objects > 0)
|
||||
user.visible_message("[user] sucessfully removes [objects] objects from [H]'s [L]!", "<span class='notice'>You successfully remove [objects] objects from [H]'s [L.name].</span>")
|
||||
else
|
||||
to_chat(user, "<span class='warning'>You find no objects embedded in [H]'s [L]!</span>")
|
||||
|
||||
else
|
||||
to_chat(user, "<span class='warning'>You can't find [target]'s [parse_zone(user.zone_sel.selecting)], let alone any objects embedded in it!</span>")
|
||||
|
||||
return 1
|
||||
Reference in New Issue
Block a user