/
githubmirror
/
vgstation13
Обзор
Документация
Войти
/
githubmirror
/
vgstation13
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
Bleeding-Edge
code/game/objects/structures/coatrack.dm
137 строк
4 KB
SECBATON GRIFFON
Mass "your the" (and relevant areas) fix (#39188)
27 апр 2026, 16:40
Не верифицирован
27 апр 2026, 16:40
8cf6ef4
Код
Авторство
О чём код?
/obj/structure/coatrack name = "Coat Rack" desc = "For a detective to hang his coat and hat." icon = 'icons/obj/coatrack.dmi' icon_state = "coatrack" density = 1 anchored = 0 pressure_resistance = ONE_ATMOSPHERE*5 flags = FPRINT w_class = W_CLASS_LARGE w_type = RECYK_WOOD flammable = TRUE var/obj/item/clothing/suit/suit = null var/obj/item/clothing/head/hat = null var/list/allowed_suits = list( /obj/item/clothing/suit/storage/det_suit, /obj/item/clothing/suit/storage/forensics, /obj/item/clothing/suit/storage/labcoat, /obj/item/clothing/suit/storage/wintercoat, /obj/item/clothing/suit/armor/hos, /obj/item/clothing/suit/storage/draculacoat, /obj/item/clothing/suit/raincoat, /obj/item/clothing/suit/storage/capjacket, /obj/item/clothing/suit/pirate, /obj/item/clothing/suit/hgpirate, /obj/item/clothing/suit/storage/trader, /obj/item/clothing/suit/storage/lawyer, /obj/item/clothing/suit/secdressjacket, /obj/item/clothing/suit/storage/internalaffairs, /obj/item/clothing/suit/storage/lawyer/bridgeofficer, /obj/item/clothing/suit/storage/fr_jacket, /obj/item/clothing/suit/storage/Hop_Coat, /obj/item/clothing/suit/storage/syndicateexec, /obj/item/clothing/suit/storage/armorjacketcapt, /obj/item/clothing/suit/storage/capjacket, /obj/item/clothing/suit/greatcoat, /obj/item/clothing/suit/johnny_coat, /obj/item/clothing/suit/leathercoat, /obj/item/clothing/suit/browncoat, /obj/item/clothing/suit/neocoat, /obj/item/clothing/suit/inquisitor ) var/list/allowed_hats = list( /obj/item/clothing/head/det_hat, /obj/item/clothing/head/caphat, /obj/item/clothing/head/centhat, /obj/item/clothing/head/beret, /obj/item/clothing/head/that, /obj/item/clothing/head/flatcap, /obj/item/clothing/head/hgpiratecap, /obj/item/clothing/head/warden, /obj/item/clothing/head/HoS, ) /obj/structure/coatrack/attack_hand(mob/user) if(suit) to_chat(user, "<span class='notice'>You pick up \the [suit] from \the [src]</span>") playsound(src, "rustle", 50, 1, -5) suit.forceMove(get_turf(src)) if(!user.get_active_hand()) user.put_in_hands(suit) suit = null update_icon() return if(hat) to_chat(user, "<span class='notice'>You pick up \the [hat] from \the [src]</span>") playsound(src, "rustle", 50, 1, -5) hat.forceMove(get_turf(src)) if(!user.get_active_hand()) user.put_in_hands(hat) hat = null update_icon() return /obj/structure/coatrack/attackby(obj/item/C, mob/user) if (istype(C, /obj/item/clothing/suit) && !suit && is_type_in_list(C, allowed_suits)) if(user.drop_item(C, src)) to_chat(user, "<span class='notice'>You place your [C.name] on \the [src]</span>") playsound(src, "rustle", 50, 1, -5) suit = C update_icon() else if (istype(C, /obj/item/clothing/head) && !hat && is_type_in_list(C, allowed_hats)) if(user.drop_item(C, src)) to_chat(user, "<span class='notice'>You place your [C.name] on \the [src]</span>") playsound(src, "rustle", 50, 1, -5) hat = C update_icon() else if(C.is_wrench(user)) C.playtoolsound(src, 50) new /obj/item/stack/sheet/wood(get_turf(src), 2) qdel(src)//the hat and suit on the coat rack are automatically dropped by Destroy() else return ..() /obj/structure/coatrack/ex_act(severity) switch(severity) if(1.0) qdel(src) return if(2.0) if (prob(50)) qdel(src) return if(3.0) if (prob(5)) qdel(src) return /obj/structure/coatrack/Destroy() if(loc) if(suit) suit.forceMove(loc) if(hat) hat.forceMove(loc) ..() /obj/structure/coatrack/update_icon() overlays.len = 0 if(suit) overlays += image(icon,"coat-[suit.icon_state]") if(hat) var/image/I = image('icons/mob/head.dmi', hat.icon_state, dir = SOUTH) var/matrix/M = matrix() M.Turn(90) M.Translate(-9,6) I.transform = M overlays += I /obj/structure/coatrack/full /obj/structure/coatrack/full/New() ..() suit = new/obj/item/clothing/suit/storage/det_suit(src) hat = new/obj/item/clothing/head/det_hat(src) update_icon()