Files
Aurora.3/code/game/objects/structures/tranqcabinet.dm
LordFowl 660a5d0063 Miscellaneous Content Patch (#1002)
rscadd: "Added three new energy-based weapons, one designed purely for pest-control."
rscadd: "Added a new rare handpistol, based off of a proposed competitor to the NT Mk58."
rscadd: "Added a new pet for the Head of Security - the PTR-7 Tranquilizer Rifle."
rscadd: "Syndicate manhack delivery grenades are now available via the traitor uplink."
rscadd: "Manhacks will no longer attack anyone belonging to the 'syndicate' faction, including Heist pirates."
tweak: "Tweaked loadout customisation whitelists, generally making them more restrictive by role."
bugfix: "It is no longer possible to be older or younger than your species ought to be."
2016-10-22 23:26:42 +03:00

62 lines
1.5 KiB
Plaintext

/obj/structure/tranqcabinet
name = "tranquilizer rifle cabinet"
desc = "A wall mounted cabinet designed to hold a tranquilizer rifle."
icon = 'icons/obj/closet.dmi'
icon_state = "tranq_closed"
anchored = 1
density = 0
var/obj/item/weapon/gun/projectile/heavysniper/tranq/has_tranq
var/opened = 0
/obj/structure/tranqcabinet/New()
..()
has_tranq = new/obj/item/weapon/gun/projectile/heavysniper/tranq(src)
/obj/structure/tranqcabinet/attackby(obj/item/O, mob/user)
if(isrobot(user))
return
if(istype(O, /obj/item/weapon/gun/projectile/heavysniper/tranq))
if(!has_tranq && opened)
user.remove_from_mob(O)
contents += O
has_tranq = O
user << "<span class='notice'>You place [O] in [src].</span>"
else
opened = !opened
else
opened = !opened
update_icon()
/obj/structure/tranqcabinet/attack_hand(mob/user)
if(isrobot(user))
return
if (!user.can_use_hand())
return
if(has_tranq)
user.put_in_hands(has_tranq)
user << "<span class='notice'>You take [has_tranq] from [src].</span>"
has_tranq = null
opened = 1
else
opened = !opened
update_icon()
/obj/structure/tranqcabinet/attack_tk(mob/user)
if(has_tranq)
has_tranq.forceMove(loc)
user << "<span class='notice'>You telekinetically remove [has_tranq] from [src].</span>"
has_tranq = null
opened = 1
else
opened = !opened
update_icon()
/obj/structure/tranqcabinet/update_icon()
if(!opened)
icon_state = "tranq_closed"
return
if(has_tranq)
icon_state = "tranq_full"
else
icon_state = "tranq_empty"