Files
Bubberstation/code/game/objects/items/implants/implantpad.dm
Ghom 1be27a4ffe Dunking handle_atom_del() in the trash bin. (#77339)
Whatever you do, if it warrants the use of something like
`handle_atom_del`, chances are `Exited` can do it better, as most of
these cases involve movables that shouldn't be moved out of their loc
(`Destroy` forcefully moves movables to nullspace) without calling
specific procs, and for the remaining few, `handle_atom_del` doesn't
even cover the eventuality of a movable being deleted outside the source
atom, so it's quite garbage.

Beside, I feel confident in saying `handle_atom_del()` is older than the
DCS, an echo on the workarounds done at the time.
2023-08-18 11:02:22 +00:00

79 lines
2.0 KiB
Plaintext

/obj/item/implantpad
name = "implant pad"
desc = "Used to modify implants."
icon = 'icons/obj/device.dmi'
icon_state = "implantpad-0"
inhand_icon_state = "electronic"
lefthand_file = 'icons/mob/inhands/items/devices_lefthand.dmi'
righthand_file = 'icons/mob/inhands/items/devices_righthand.dmi'
throw_speed = 3
throw_range = 5
w_class = WEIGHT_CLASS_SMALL
var/obj/item/implantcase/case = null
/obj/item/implantpad/update_icon_state()
icon_state = "implantpad-[!QDELETED(case)]"
return ..()
/obj/item/implantpad/examine(mob/user)
. = ..()
if(Adjacent(user))
. += "It [case ? "contains \a [case]" : "is currently empty"]."
if(case)
. += span_info("Alt-click to remove [case].")
else
if(case)
. += span_warning("There seems to be something inside it, but you can't quite tell what from here...")
/obj/item/implantpad/Exited(atom/movable/gone, direction)
. = ..()
if(gone == case)
case = null
update_appearance()
updateSelfDialog()
/obj/item/implantpad/AltClick(mob/user)
..()
if(!user.can_perform_action(src, FORBID_TELEKINESIS_REACH))
return
if(!case)
to_chat(user, span_warning("There's no implant to remove from [src]."))
return
user.put_in_hands(case)
add_fingerprint(user)
case.add_fingerprint(user)
updateSelfDialog()
update_appearance()
/obj/item/implantpad/attackby(obj/item/implantcase/C, mob/user, params)
if(istype(C, /obj/item/implantcase) && !case)
if(!user.transferItemToLoc(C, src))
return
case = C
updateSelfDialog()
update_appearance()
else
return ..()
/obj/item/implantpad/ui_interact(mob/user)
if(!user.can_perform_action(src, FORBID_TELEKINESIS_REACH))
user.unset_machine(src)
user << browse(null, "window=implantpad")
return
user.set_machine(src)
var/dat = "<B>Implant Mini-Computer:</B><HR>"
if(case)
if(case.imp)
if(istype(case.imp, /obj/item/implant))
dat += case.imp.get_data()
else
dat += "The implant casing is empty."
else
dat += "Please insert an implant casing!"
user << browse(dat, "window=implantpad")
onclose(user, "implantpad")