diff --git a/baystation12.dme b/baystation12.dme index 2ce22f1f948..b2635fd942b 100644 --- a/baystation12.dme +++ b/baystation12.dme @@ -561,6 +561,7 @@ #include "code\game\objects\storage\coat.dm" #include "code\game\objects\structures\barsign.dm" #include "code\game\objects\structures\bedsheet_bin.dm" +#include "code\game\objects\structures\coathanger.dm" #include "code\game\objects\structures\displaycase.dm" #include "code\game\objects\structures\door_assembly.dm" #include "code\game\objects\structures\electricchair.dm" diff --git a/code/game/objects/structures/coathanger.dm b/code/game/objects/structures/coathanger.dm new file mode 100644 index 00000000000..0894ea67c1a --- /dev/null +++ b/code/game/objects/structures/coathanger.dm @@ -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 << "You cannot hang [W] on [src]" + 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") \ No newline at end of file diff --git a/icons/obj/coatrack.dmi b/icons/obj/coatrack.dmi index 96c1171d82e..ad51d5e5d5a 100644 Binary files a/icons/obj/coatrack.dmi and b/icons/obj/coatrack.dmi differ