Curtain and Flap (De)construction (#7503)

This commit is contained in:
Doxxmedearly
2019-11-30 16:47:18 +01:00
committed by Werner
parent 98350ae658
commit a6715f0175
4 changed files with 105 additions and 0 deletions
+34
View File
@@ -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."
@@ -156,6 +156,19 @@
new/datum/stack_recipe("yellow folder", /obj/item/folder/yellow), \
))
/material/cloth/generate_recipes()
..()
recipes += new/datum/stack_recipe_list("curtains list",list( \
new /datum/stack_recipe("white curtain", /obj/structure/curtain, 2, time = 10), \
new /datum/stack_recipe("bed curtain", /obj/structure/curtain/open/bed, 2, time = 10), \
new /datum/stack_recipe("black curtain", /obj/structure/curtain/black, 2, time = 10), \
new /datum/stack_recipe("shower curtain", /obj/structure/curtain/open/shower, 2, time = 10), \
new /datum/stack_recipe("orange shower curtain", /obj/structure/curtain/open/shower/engineering, 2, time = 10), \
new /datum/stack_recipe("red shower curtain", /obj/structure/curtain/open/shower/security, 2, time = 10), \
new /datum/stack_recipe("privacy curtain", /obj/structure/curtain/open/privacy, 2, time = 10), \
))
/material/hide/xeno/generate_recipes()
..()
recipes += new/datum/stack_recipe("alien helmet", /obj/item/clothing/head/xenos)
@@ -0,0 +1,43 @@
################################
# Example Changelog File
#
# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb.
#
# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.)
# When it is, any changes listed below will disappear.
#
# Valid Prefixes:
# bugfix
# wip (For works in progress)
# tweak
# soundadd
# sounddel
# rscadd (general adding of nice things)
# rscdel (general deleting of nice things)
# imageadd
# imagedel
# maptweak
# spellcheck (typo fixes)
# experiment
# balance
# admin
# backend
# security
# refactor
#################################
# Your name.
author: Doxxmedearly
# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again.
delete-after: True
# Any changes you've made. See valid prefix list above.
# INDENT WITH TWO SPACES. NOT TABS. SPACES.
# SCREW THIS UP AND IT WON'T WORK.
# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries.
# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog.
changes:
- rscadd: "Allows players to cut down plastic flaps and curtains, using wirecutters or other cutting objects."
- rscadd: "Allows you to construct all curtains (except plastic curtains) from cloth, requiring two pieces each."
- tweak: "Most curtains begin anchored (Medical curtains do not). You can anchor and unanchor curtains with a screwdriver."