mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-21 12:02:31 +01:00
Curtain and Flap (De)construction (#7503)
This commit is contained in:
@@ -8,6 +8,8 @@
|
||||
layer = SHOWER_OPEN_LAYER
|
||||
opacity = 1
|
||||
density = 0
|
||||
anchored = TRUE //curtains start secured in place
|
||||
var/manipulating = FALSE //prevents queuing up multiple deconstructs and returning a bunch of cloth
|
||||
|
||||
/obj/structure/curtain/open
|
||||
icon_state = "open"
|
||||
@@ -30,6 +32,35 @@
|
||||
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/W, mob/user)
|
||||
|
||||
if(W.iswirecutter() || W.sharp && !W.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(!do_after(user, 30/W.toolspeed))
|
||||
manipulating = FALSE
|
||||
return
|
||||
playsound(src.loc, 'sound/items/Wirecutter.ogg', 50, 1)
|
||||
visible_message(span("notice", "[user] cuts down \the [src]."),
|
||||
span("notice", "You cut down \the [src]."))
|
||||
if(istype(src, /obj/structure/curtain/open/medical))
|
||||
new /obj/item/stack/material/plastic(src.loc)
|
||||
else
|
||||
new /obj/item/stack/material/cloth(src.loc, (W.iswirecutter() ? 2 : 1)) //wirecutters return full. Sharp items return half.
|
||||
qdel(src)
|
||||
|
||||
if(W.isscrewdriver()) //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
|
||||
playsound(src.loc, W.usesound, 50, 1)
|
||||
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)
|
||||
@@ -46,11 +77,13 @@
|
||||
/obj/structure/curtain/medical
|
||||
name = "plastic curtain"
|
||||
color = "#B8F5E3"
|
||||
anchored = FALSE
|
||||
alpha = 200
|
||||
|
||||
/obj/structure/curtain/open/medical
|
||||
name = "plastic curtain"
|
||||
color = "#B8F5E3"
|
||||
anchored = FALSE
|
||||
alpha = 200
|
||||
|
||||
/obj/structure/curtain/open/bed
|
||||
@@ -60,6 +93,7 @@
|
||||
/obj/structure/curtain/open/privacy
|
||||
name = "privacy curtain"
|
||||
color = "#B8F5E3"
|
||||
anchored = FALSE
|
||||
|
||||
/obj/structure/curtain/open/shower
|
||||
name = "shower curtain"
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
anchored = 1
|
||||
layer = 4
|
||||
explosion_resistance = 5
|
||||
var/manipulating = FALSE //Prevents queueing up a ton of deconstructs
|
||||
var/list/mobs_can_pass = list(
|
||||
/mob/living/carbon/slime,
|
||||
/mob/living/simple_animal/rat,
|
||||
@@ -46,6 +47,20 @@
|
||||
if (prob(5))
|
||||
qdel(src)
|
||||
|
||||
/obj/structure/plasticflaps/attackby(obj/item/W, mob/user)
|
||||
if(manipulating) return
|
||||
manipulating = TRUE
|
||||
if(W.iswirecutter() || W.sharp && !W.noslice)
|
||||
visible_message(span("notice", "[user] begins cutting down \the [src]."),
|
||||
span("notice", "You begin cutting down \the [src]."))
|
||||
if(!do_after(user, 30/W.toolspeed))
|
||||
manipulating = FALSE
|
||||
return
|
||||
playsound(src.loc, 'sound/items/Wirecutter.ogg', 50, 1)
|
||||
visible_message(span("notice", "[user] cuts down \the [src]."),
|
||||
span("notice", "You cut down \the [src]."))
|
||||
qdel(src)
|
||||
|
||||
/obj/structure/plasticflaps/mining //A specific type for mining that doesn't allow airflow because of them damn crates
|
||||
name = "airtight plastic flaps"
|
||||
desc = "Heavy duty, airtight, plastic flaps."
|
||||
|
||||
Reference in New Issue
Block a user