Files
Bubberstation/code/modules/admin/verbs/manipulate_organs.dm
phil235 f6db08af2e Contents_explosion() tweaks (#20934)
* When any object is hit by an explosion, we no longer always call ex_act() on all its contents indiscriminately.
The default contents_explosion() does nothing and it's overriden for certain objects only like storage items, machines with occupants, mechs.

I've also overriden handle_atom_del() for many objects so that any sudden deletion of an object referenced in an object var of its container properly nullifies such references, avoiding potential runtime and updating the container's icon_state (e.g. admin-delete a mixer's beaker and the mixer's sprite updates immediately).

I've tweaked bomb effect on worn clothes, having some armor but not 100% now still protects your clothes somewhat.

Fixes some arguments of ex_act in living/ex_act() and other mobs.

* derp and map fixes.

* dem map fixes, man.

* More work on code that use implants, simplified now that we can use the "implants" carbon var.

* some fixes

* more typos and fixes.
2016-10-16 10:01:37 +13:00

58 lines
1.7 KiB
Plaintext

/client/proc/manipulate_organs(mob/living/carbon/C in world)
set name = "Manipulate Organs"
set category = "Debug"
var/operation = input("Select organ operation.", "Organ Manipulation", "cancel") in list("add organ", "add implant", "drop organ/implant", "remove organ/implant", "cancel")
var/list/organs = list()
switch(operation)
if("add organ")
for(var/path in subtypesof(/obj/item/organ))
var/dat = replacetext("[path]", "/obj/item/organ/", ":")
organs[dat] = path
var/obj/item/organ/organ = input("Select organ type:", "Organ Manipulation", null) in organs
organ = organs[organ]
organ = new organ
organ.Insert(C)
if("add implant")
for(var/path in subtypesof(/obj/item/weapon/implant))
var/dat = replacetext("[path]", "/obj/item/weapon/implant/", ":")
organs[dat] = path
var/obj/item/weapon/implant/organ = input("Select implant type:", "Organ Manipulation", null) in organs
organ = organs[organ]
organ = new organ
organ.implant(C)
if("drop organ/implant", "remove organ/implant")
for(var/X in C.internal_organs)
var/obj/item/organ/I = X
organs["[I.name] ([I.type])"] = I
for(var/X in C.implants)
var/obj/item/weapon/implant/I = X
organs["[I.name] ([I.type])"] = I
var/obj/item/organ = input("Select organ/implant:", "Organ Manipulation", null) in organs
organ = organs[organ]
if(!organ) return
var/obj/item/organ/O
var/obj/item/weapon/implant/I
if(isorgan(organ))
O = organ
O.Remove(C)
else
I = organ
I.removed(C)
organ.loc = get_turf(C)
if(operation == "remove organ/implant")
qdel(organ)
else if(I) // Put the implant in case.
var/obj/item/weapon/implantcase/case = new(get_turf(C))
case.imp = I
I.loc = case
case.update_icon()