Files
Bubberstation/code/game/objects/items/weapons/implants/implantcase.dm
Mloc-Argent 79495f710a Refactors the code to work with BYOND 500. Big commit.
Var changes:
* /obj/item/var/color is now item_color
* /obj/machinery/portable_atmospherics/canister/var/color is now canister_color
* /obj/machinery/atmospherics/var/color is now pipe_color
* /mob/living/simple_animal/mouse/var/color is now body_color
* /mob/living/simple_animal/chicken/var/color is now body_color

Proc changes:
* /obj/machinery/door/proc/animate() is now do_animate()
* /obj/machinery/transformer/proc/transform() is now do_transform()

Map changes are due to pipe instances being changed from color to pipe_color

Signed-off-by: Mloc-Argent <colmohici@gmail.com>
2013-10-06 19:47:30 +01:00

103 lines
2.7 KiB
Plaintext

/obj/item/weapon/implantcase
name = "glass case"
desc = "A case containing an implant."
icon_state = "implantcase-0"
item_state = "implantcase"
throw_speed = 1
throw_range = 5
w_class = 1.0
var/obj/item/weapon/implant/imp = null
/obj/item/weapon/implantcase/update_icon()
if(imp)
icon_state = "implantcase-[imp.item_color]"
else
icon_state = "implantcase-0"
/obj/item/weapon/implantcase/attackby(obj/item/weapon/W, mob/user)
..()
if(istype(W, /obj/item/weapon/pen))
var/t = input(user, "What would you like the label to be?", name, null) as text
if(user.get_active_hand() != W)
return
if(!in_range(src, user) && loc != user)
return
t = copytext(sanitize(t), 1, MAX_MESSAGE_LEN)
if(t)
name = "glass case- '[t]'"
else
name = "glass case"
else if(istype(W, /obj/item/weapon/reagent_containers/syringe))
if(!imp) return
if(!imp.allow_reagents) return
if(imp.reagents.total_volume >= imp.reagents.maximum_volume)
user << "<span class='notice'>[src] is full.</span>"
else
W.reagents.trans_to(imp, 5)
user << "<span class='notice'>You inject 5 units of the solution. The syringe now contains [W.reagents.total_volume] units.</span>"
else if(istype(W, /obj/item/weapon/implanter))
var/obj/item/weapon/implanter/I = W
if(I.imp)
if((imp || I.imp.implanted))
return
I.imp.loc = src
imp = I.imp
I.imp = null
update_icon()
I.update_icon()
else
if(imp)
if(I.imp)
return
imp.loc = I
I.imp = imp
imp = null
update_icon()
I.update_icon()
/obj/item/weapon/implantcase/tracking
name = "glass case- 'Tracking'"
desc = "A case containing a tracking implant."
icon = 'icons/obj/items.dmi'
icon_state = "implantcase-b"
/obj/item/weapon/implantcase/tracking/New()
imp = new /obj/item/weapon/implant/tracking(src)
..()
/obj/item/weapon/implantcase/explosive
name = "glass case- 'Explosive'"
desc = "A case containing an explosive implant."
icon = 'icons/obj/items.dmi'
icon_state = "implantcase-r"
/obj/item/weapon/implantcase/explosive/New()
imp = new /obj/item/weapon/implant/explosive(src)
..()
/obj/item/weapon/implantcase/chem
name = "glass case- 'Chem'"
desc = "A case containing a chemical implant."
icon = 'icons/obj/items.dmi'
icon_state = "implantcase-b"
/obj/item/weapon/implantcase/chem/New()
imp = new /obj/item/weapon/implant/chem(src)
..()
/obj/item/weapon/implantcase/loyalty
name = "glass case- 'Loyalty'"
desc = "A case containing a loyalty implant."
icon = 'icons/obj/items.dmi'
icon_state = "implantcase-r"
/obj/item/weapon/implantcase/loyalty/New()
imp = new /obj/item/weapon/implant/loyalty(src)
..()