From 0efcb4d60d5c39503ae0899ac3eb21f960246736 Mon Sep 17 00:00:00 2001 From: ShizCalev Date: Wed, 3 Oct 2018 06:20:14 -0400 Subject: [PATCH] Updates Implant Pads (#40628) --- .../objects/items/implants/implant_track.dm | 6 -- .../game/objects/items/implants/implantpad.dm | 86 ++++++++++--------- .../research/designs/medical_designs.dm | 4 +- 3 files changed, 46 insertions(+), 50 deletions(-) diff --git a/code/game/objects/items/implants/implant_track.dm b/code/game/objects/items/implants/implant_track.dm index 913c577f2c2..44e912c96e4 100644 --- a/code/game/objects/items/implants/implant_track.dm +++ b/code/game/objects/items/implants/implant_track.dm @@ -32,9 +32,3 @@ Integrity: Gradient creates slight risk of being overcharged and frying the circuitry. As a result neurotoxins can cause massive damage."} return dat - - -/obj/item/implantcase/track - name = "implant case - 'Tracking'" - desc = "A glass case containing a tracking implant." - imp_type = /obj/item/implant/tracking \ No newline at end of file diff --git a/code/game/objects/items/implants/implantpad.dm b/code/game/objects/items/implants/implantpad.dm index 846f1119aad..17a1b910e2b 100644 --- a/code/game/objects/items/implants/implantpad.dm +++ b/code/game/objects/items/implants/implantpad.dm @@ -1,5 +1,5 @@ /obj/item/implantpad - name = "implantpad" + name = "implant pad" desc = "Used to modify implants." icon = 'icons/obj/items_and_weapons.dmi' icon_state = "implantpad-0" @@ -10,41 +10,61 @@ throw_range = 5 w_class = WEIGHT_CLASS_SMALL var/obj/item/implantcase/case = null - var/broadcasting = null - var/listening = 1 - /obj/item/implantpad/update_icon() - if(case) - icon_state = "implantpad-1" + icon_state = "implantpad-[!QDELETED(case)]" + +/obj/item/implantpad/examine(mob/user) + ..() + var/is_adjacent = Adjacent(user) + if(is_adjacent) + to_chat(user, "It [case ? "contains \a [case]" : "is currently empty"].") + if(case) + to_chat(user, "Alt-click to remove [case].") else - icon_state = "implantpad-0" + if(case) + to_chat(user, "There seems to be something inside it, but you can't quite tell what from here...") - -/obj/item/implantpad/attack_hand(mob/user) - . = ..() - if(.) - return - if(case && user.is_holding(src)) - user.put_in_active_hand(case) - - case.add_fingerprint(user) +/obj/item/implantpad/handle_atom_del(atom/A) + if(A == case) case = null + update_icon() + updateSelfDialog() + . = ..() - add_fingerprint(user) - update_icon() +/obj/item/implantpad/AltClick(mob/user) + ..() + if(!user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK)) + return + if(!case) + to_chat(user, "There's no implant to remove from [src].") + return + + user.put_in_hands(case) + + add_fingerprint(user) + case.add_fingerprint(user) + case = null + + updateSelfDialog() + update_icon() /obj/item/implantpad/attackby(obj/item/implantcase/C, mob/user, params) - if(istype(C, /obj/item/implantcase)) - if(!case) - if(!user.transferItemToLoc(C, src)) - return - case = C + if(istype(C, /obj/item/implantcase) && !case) + if(!user.transferItemToLoc(C, src)) + return + case = C + updateSelfDialog() update_icon() else return ..() -/obj/item/implantpad/attack_self(mob/user) +/obj/item/implantpad/ui_interact(mob/user) + if(!user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK)) + user.unset_machine(src) + user << browse(null, "window=implantpad") + return + user.set_machine(src) var/dat = "Implant Mini-Computer:
" if(case) @@ -57,21 +77,3 @@ dat += "Please insert an implant casing!" user << browse(dat, "window=implantpad") onclose(user, "implantpad") - - -/obj/item/implantpad/Topic(href, href_list) - ..() - if(usr.stat) - return - if(usr.contents.Find(src) || (in_range(src, usr) && isturf(loc))) - usr.set_machine(src) - - if(ismob(loc)) - attack_self(loc) - else - for(var/mob/M in viewers(1, src)) - if(M.client) - attack_self(M) - add_fingerprint(usr) - else - usr << browse(null, "window=implantpad") diff --git a/code/modules/research/designs/medical_designs.dm b/code/modules/research/designs/medical_designs.dm index b15629d64f6..7eb665c50a3 100644 --- a/code/modules/research/designs/medical_designs.dm +++ b/code/modules/research/designs/medical_designs.dm @@ -401,7 +401,7 @@ id = "implant_tracking" build_type = PROTOLATHE materials = list(MAT_METAL = 500, MAT_GLASS = 500) - build_path = /obj/item/implantcase/track + build_path = /obj/item/implantcase/tracking category = list("Medical Designs") departmental_flags = DEPARTMENTAL_FLAG_SECURITY | DEPARTMENTAL_FLAG_MEDICAL @@ -467,7 +467,7 @@ research_icon = 'icons/obj/surgery.dmi' research_icon_state = "surgery_any" var/surgery - + /datum/design/surgery/experimental_dissection name = "Experimental Dissection" desc = "A surgical procedure which deeply analyzes the biology of a corpse, and automatically adds new findings to the research database."