mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-23 13:05:44 +01:00
Updates the coat hanger (#2950)
Updates the coat hanger to have far more sprites and hold more types of coats Also fixes #2919
This commit is contained in:
@@ -4,20 +4,27 @@
|
||||
icon = 'icons/obj/coatrack.dmi'
|
||||
icon_state = "coatrack0"
|
||||
var/obj/item/clothing/suit/coat
|
||||
var/list/allowed = list(/obj/item/clothing/suit/storage/toggle/labcoat, /obj/item/clothing/suit/storage/det_trench)
|
||||
var/list/allowed = list(/obj/item/clothing/suit/storage/toggle/labcoat, /obj/item/clothing/suit/storage/det_trench,
|
||||
/obj/item/clothing/suit/storage/forensics, /obj/item/clothing/suit/storage/trench)
|
||||
|
||||
/obj/structure/coatrack/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()
|
||||
if (!ishuman(user))
|
||||
return
|
||||
if(user.incapacitated())
|
||||
return
|
||||
if (!user.can_use_hand())
|
||||
return
|
||||
if(coat)
|
||||
user.visible_message("[user] takes [coat] off \the [src].", "You take [coat] off the \the [src]")
|
||||
coat.forceMove(get_turf(user))
|
||||
user.put_in_hands(coat)
|
||||
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))
|
||||
can_hang = 1
|
||||
if(is_type_in_list(W, allowed))
|
||||
can_hang = 1
|
||||
if (can_hang && !coat)
|
||||
user.visible_message("[user] hangs [W] on \the [src].", "You hang [W] on the \the [src]")
|
||||
coat = W
|
||||
@@ -29,9 +36,8 @@
|
||||
|
||||
/obj/structure/coatrack/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
|
||||
var/can_hang = 0
|
||||
for (var/T in allowed)
|
||||
if(istype(mover,T))
|
||||
can_hang = 1
|
||||
if(is_type_in_list(mover, allowed))
|
||||
can_hang = 1
|
||||
|
||||
if (can_hang && !coat)
|
||||
src.visible_message("[mover] lands on \the [src].")
|
||||
@@ -44,9 +50,5 @@
|
||||
|
||||
/obj/structure/coatrack/update_icon()
|
||||
cut_overlays()
|
||||
if (istype(coat, /obj/item/clothing/suit/storage/toggle/labcoat))
|
||||
add_overlay("coat_lab")
|
||||
if (istype(coat, /obj/item/clothing/suit/storage/toggle/labcoat/cmo))
|
||||
add_overlay("coat_cmo")
|
||||
if (istype(coat, /obj/item/clothing/suit/storage/det_trench))
|
||||
add_overlay("coat_det")
|
||||
if (coat)
|
||||
add_overlay("coat_[coat.icon_state]")
|
||||
|
||||
Reference in New Issue
Block a user