/obj/structure/curtain name = "curtain" icon = 'icons/obj/curtain.dmi' icon_state = "closed" layer = ABOVE_WINDOW_LAYER opacity = 1 density = 0 anchored = TRUE //curtains start secured in place build_amt = 2 var/manipulating = FALSE //prevents queuing up multiple deconstructs and returning a bunch of cloth var/curtain_material = MATERIAL_CLOTH /obj/structure/curtain/Initialize() . = ..() material = SSmaterials.get_material_by_name(curtain_material) AddComponent(TURF_HAND_COMPONENT) /obj/structure/curtain/open icon_state = "open" layer = ABOVE_HUMAN_LAYER opacity = 0 /obj/structure/curtain/bullet_act(obj/projectile/hitting_projectile, def_zone, piercing_hit) . = ..() if(. != BULLET_ACT_HIT) return . if(hitting_projectile.damage > 0) visible_message(SPAN_WARNING("[hitting_projectile] tears [src] down!")) qdel(src) /obj/structure/curtain/attack_hand(mob/user) playsound(get_turf(loc), 'sound/effects/curtain.ogg', 15, 1, -5) toggle() ..() /obj/structure/curtain/attack_ai(mob/user) if(istype(user, /mob/living/silicon/robot) && Adjacent(user)) // Robots can open/close it, but not the AI. attack_hand(user) /obj/structure/curtain/attackby(obj/item/attacking_item, mob/user) if(attacking_item.tool_behaviour == TOOL_WIRECUTTER || attacking_item.sharp && !attacking_item.noslice) if(manipulating) return manipulating = TRUE visible_message(SPAN_NOTICE("[user] begins cutting down \the [src]."), SPAN_NOTICE("You begin cutting down \the [src].")) if(!attacking_item.use_tool(src, user, 30, volume = 50)) manipulating = FALSE return visible_message(SPAN_NOTICE("[user] cuts down \the [src]."), SPAN_NOTICE("You cut down \the [src].")) dismantle() if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER) //You can anchor/unanchor curtains anchored = !anchored var/obj/structure/curtain/C for(C in src.loc) if(C != src && C.anchored) //Can't secure more than one curtain in a tile to_chat(user, "There is already a curtain secured here!") return attacking_item.play_tool_sound(get_turf(src), 50) visible_message(SPAN_NOTICE("\The [src] has been [anchored ? "secured in place" : "unsecured"] by \the [user].")) /obj/structure/curtain/proc/toggle() src.set_opacity(!src.opacity) if(opacity) icon_state = "closed" layer = ABOVE_HUMAN_LAYER else icon_state = "open" layer = ABOVE_WINDOW_LAYER /obj/structure/curtain/black name = "black curtain" color = "#222222" /obj/structure/curtain/medical name = "plastic curtain" color = "#B8F5E3" anchored = FALSE alpha = 200 curtain_material = MATERIAL_PLASTIC /obj/structure/curtain/open/medical name = "plastic curtain" color = "#B8F5E3" anchored = FALSE alpha = 200 curtain_material = MATERIAL_PLASTIC /obj/structure/curtain/open/bed name = "bed curtain" color = "#854636" /obj/structure/curtain/open/privacy name = "privacy curtain" color = "#B8F5E3" anchored = FALSE /obj/structure/curtain/open/shower name = "shower curtain" color = "#ACD1E9" alpha = 200 /obj/structure/curtain/open/shower/engineering color = "#FFA500" /obj/structure/curtain/open/shower/security color = "#AA0000" /obj/structure/curtain/open/bar name = "curtain" color = "#792f27" icon_state = "open" /obj/structure/curtain/open/bar/toggle() src.set_opacity(!src.opacity) if(opacity) icon_state = "closed" layer = ABOVE_ABOVE_HUMAN_LAYER else icon_state = "open" layer = ABOVE_ABOVE_HUMAN_LAYER