From cf69a5797db39478265c05b76b8f005a5b914157 Mon Sep 17 00:00:00 2001 From: Chinsky Date: Thu, 10 Oct 2013 13:49:42 +0400 Subject: [PATCH] WIP coat rack --- baystation12.dme | 1 + code/game/objects/structures/coathanger.dm | 48 +++++++++++++++++++++ icons/obj/coatrack.dmi | Bin 529 -> 538 bytes 3 files changed, 49 insertions(+) create mode 100644 code/game/objects/structures/coathanger.dm 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 96c1171d82e869ced42157f712dead7e1be6ae3e..ad51d5e5d5a140d9e3185fc6a34f4fac8c92dedb 100644 GIT binary patch delta 397 zcmV;80doG41eyep7!3#m0001;w}I>c001zNB_bz)fPk`&YySWL-{0SsU@Ez}xsfs- z000000d!JMQvg8b*k%9#0DzHVWPhWmj891|Axa_0NJHX`%t=hbrBGSH)z1a&EdXW( zKTb*dT^#@b0Srk*K~z|U?bhKEf*=e4U|>)}lJEbv4beXdZL$=vYiED-_PJqjQ|elw zb$7s29{~pa_5_rx0BbD;nEW#(0IVZ{l#N$Cp9C;nn_|9#n*#=b?N{=x1Ai7!`wF>$ zbAWsI3a$&>z&R%Xh5@|y?LgX!q81cuHy#ZPxDFzKK9N2H%;*j1bf5?hcAbHCK`+q^ zn4B+I1~W%{{%^!r<^wANOce+i^xJ3PQOqC5kph0d!JMQvg8b z*k%9#0C|yaWPf9*G$LB1A<-(0aj8^RaP@Nmdkg^JP(RCS)K+r<009&Bf&wLeN{AQ>bW6BE1QmDicHln>xT zLrrCVL(r76jI;HXCTqr3z5*XH4ZLNk>Z z5DiLfClDnDgE*5IMro=g{>peG9}koKFpb5^C6ZD`M_JaUDPYWub1!&-9j~~ONM-yv|8Mmz|Vo7