mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-22 19:47:47 +01:00
WIP coat rack
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
/obj/structure/coatrack
|
||||
name = "coat rack"
|
||||
desc = "Rack that holds coats."
|
||||
icon = 'icons/obj/coatrack.dmi'
|
||||
icon_state = "coatrack0"
|
||||
var/obj/item/clothing/suit/coat
|
||||
var/list/allowed = list(/obj/item/clothing/suit/storage/labcoat, /obj/item/clothing/suit/storage/det_suit)
|
||||
|
||||
/obj/structure/mirror/attack_hand(mob/user as mob)
|
||||
user.visible_message("[user] takes [coat] off \the [src].", "You take [coat] off the \the [src]")
|
||||
if(!user.put_in_active_hand(coat))
|
||||
coat.loc = get_turf(user)
|
||||
coat = null
|
||||
update_icon()
|
||||
|
||||
/obj/structure/coatrack/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
var/can_hang = 0
|
||||
for (var/T in allowed)
|
||||
if(istype(W,T))
|
||||
cam_hang = 1
|
||||
if (can_hang)
|
||||
user.visible_message("[user] hangs [coat] on \the [src].", "You hang [coat] on the \the [src]")
|
||||
coat = W
|
||||
user.drop_item(src)
|
||||
update_icon()
|
||||
else
|
||||
user << "<span class='notice'>You cannot hang [W] on [src]</span>"
|
||||
return ..()
|
||||
|
||||
/obj/structure/coatrack/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
|
||||
for (var/T in allowed)
|
||||
if(istype(mover,T))
|
||||
cam_hang = 1
|
||||
|
||||
if (can_hang)
|
||||
src.visible_message("[mover] lands on \the [src].")
|
||||
coat = mover
|
||||
update_icon()
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
|
||||
/obj/structure/coatrack/update_icon()
|
||||
overlays.Cut()
|
||||
if (istype(W, /obj/item/clothing/suit/storage/labcoat))
|
||||
overlays += image(iconn, icon_state = "coat_lab")
|
||||
if (istype(W, /obj/item/clothing/suit/storage/det_suit))
|
||||
overlays += image(iconn, icon_state = "coat_det")
|
||||
Reference in New Issue
Block a user