mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-27 22:17:32 +01:00
Object Embedding
This commit is contained in:
@@ -1048,104 +1048,6 @@ var/list/slot_equipment_priority = list( \
|
||||
/mob/proc/get_species()
|
||||
return ""
|
||||
|
||||
/mob/proc/get_visible_implants(var/class = 0)
|
||||
var/list/visible_implants = list()
|
||||
for(var/obj/item/O in embedded)
|
||||
if(O.w_class > class)
|
||||
visible_implants += O
|
||||
return visible_implants
|
||||
|
||||
/mob/proc/yank_out_object()
|
||||
set category = "Object"
|
||||
set name = "Yank out object"
|
||||
set desc = "Remove an embedded item at the cost of bleeding and pain."
|
||||
set src in view(1)
|
||||
|
||||
if(!isliving(usr) || usr.next_move > world.time)
|
||||
return
|
||||
usr.changeNext_move(CLICK_CD_RESIST)
|
||||
|
||||
if(usr.stat == 1)
|
||||
to_chat(usr, "You are unconcious and cannot do that!")
|
||||
return
|
||||
|
||||
if(usr.restrained())
|
||||
to_chat(usr, "You are restrained and cannot do that!")
|
||||
return
|
||||
|
||||
var/mob/S = src
|
||||
var/mob/U = usr
|
||||
var/list/valid_objects = list()
|
||||
var/self = null
|
||||
|
||||
if(S == U)
|
||||
self = 1 // Removing object from yourself.
|
||||
|
||||
valid_objects = get_visible_implants(0)
|
||||
if(!valid_objects.len)
|
||||
if(self)
|
||||
to_chat(src, "You have nothing stuck in your body that is large enough to remove.")
|
||||
else
|
||||
to_chat(U, "[src] has nothing stuck in their wounds that is large enough to remove.")
|
||||
return
|
||||
|
||||
var/obj/item/weapon/selection = input("What do you want to yank out?", "Embedded objects") in valid_objects
|
||||
|
||||
if(self)
|
||||
visible_message("<span class='warning'>[usr] appears to be trying to extract an object from their body.</span>")
|
||||
to_chat(src, "<span class='warning'>You attempt to get a good grip on [selection] in your body.</span>")
|
||||
else
|
||||
visible_message("<span class='warning'>[usr] attempts to get a good grip on [selection] in [S]'s body.</span>")
|
||||
to_chat(U, "<span class='warning'>You attempt to get a good grip on [selection] in [S]'s body.</span>")
|
||||
|
||||
if(!do_after(U, 80, target = S))
|
||||
return
|
||||
if(!selection || !S || !U)
|
||||
return
|
||||
|
||||
if(self)
|
||||
visible_message("<span class='warning'><b>[src] rips [selection] out of their body.</b></span>","<span class='warning'><b>You rip [selection] out of your body.</b></span>")
|
||||
else
|
||||
visible_message("<span class='warning'><b>[usr] rips [selection] out of [src]'s body.</b></span>","<span class='warning'><b>[usr] rips [selection] out of your body.</b></span>")
|
||||
valid_objects = get_visible_implants(0)
|
||||
if(valid_objects.len == 1) //Yanking out last object - removing verb.
|
||||
src.verbs -= /mob/proc/yank_out_object
|
||||
|
||||
if(ishuman(src))
|
||||
|
||||
var/mob/living/carbon/human/H = src
|
||||
var/obj/item/organ/external/affected
|
||||
|
||||
for(var/obj/item/organ/external/organ in H.bodyparts) //Grab the organ holding the implant.
|
||||
for(var/obj/item/weapon/O in organ.implants)
|
||||
if(O == selection)
|
||||
affected = organ
|
||||
|
||||
affected.implants -= selection
|
||||
H.shock_stage+=10
|
||||
|
||||
if(prob(10)) //I'M SO ANEMIC I COULD JUST -DIE-.
|
||||
var/datum/wound/internal_bleeding/I = new ()
|
||||
affected.wounds += I
|
||||
H.custom_pain("Something tears wetly in your [affected] as [selection] is pulled free!", 1)
|
||||
|
||||
if(ishuman(U))
|
||||
var/mob/living/carbon/human/human_user = U
|
||||
human_user.bloody_hands(H)
|
||||
|
||||
selection.forceMove(get_turf(src))
|
||||
if(!(U.l_hand && U.r_hand))
|
||||
U.put_in_hands(selection)
|
||||
|
||||
for(var/obj/item/weapon/O in pinned)
|
||||
if(O == selection)
|
||||
pinned -= O
|
||||
if(!pinned.len)
|
||||
anchored = 0
|
||||
return 1
|
||||
|
||||
|
||||
|
||||
/mob/dead/observer/verb/respawn()
|
||||
set name = "Respawn as NPC"
|
||||
set category = "Ghost"
|
||||
|
||||
Reference in New Issue
Block a user