Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deconstructable Shutters #19969

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 56 additions & 1 deletion code/game/machinery/doors/blast_door.dm
Original file line number Diff line number Diff line change
Expand Up @@ -212,22 +212,77 @@
opacity = FALSE

// SUBTYPE: Shutters
// Nicer looking, and also weaker, shutters. Found in kitchen and similar areas.
// Nicer looking, and also weaker, shutters. Found in kitchen and similar areas. Unlike blast doors, can be destroyed with a welder.
/obj/machinery/door/blast/shutters
name = "shutter"
desc_extended = "This can be disassembled by cutting all six support beams off with a welding tool, and this process can be reversed by reinstalling support beams with use of steel rods."
icon_state_open = "shutter0"
icon_state_opening = "shutterc0"
icon_state_closed = "shutter1"
icon_state_closing = "shutterc1"
icon_state = "shutter1"
damage = SHUTTER_CRUSH_DAMAGE
closed_layer = CLOSED_DOOR_LAYER
/// How many cutting periods shutters require before they're deconstructed.
var/cuts_needed = 6
/// How long each cutting period takes.
var/cut_time = 15 SECONDS
/// Whether the shutter is currently being welded.
var/welding = FALSE

/obj/machinery/door/blast/shutters/open
icon_state = "shutter0"
density = FALSE
opacity = FALSE

/obj/machinery/door/blast/shutters/attackby(obj/item/attacking_item, mob/user)
// For replacing welded-off beams.
if(istype(attacking_item, /obj/item/stack/rods))
var/obj/item/stack/rods/R = attacking_item
if(cuts_needed >= initial(cuts_needed))
to_chat(usr, SPAN_NOTICE("\The [src] already has all the necessary support beams."))
else
to_chat(usr, SPAN_NOTICE("You begin to reinforce \the [src] with an additional support beam..."))
if (do_after(user, 30 SECONDS))
if(cuts_needed < initial(cuts_needed))
to_chat(usr, SPAN_NOTICE("You reinforce \the [src] with an additional support beam."))
R.use(1)
cuts_needed++

// For welding off beams.
else if (attacking_item.iswelder() && !welding)
var/obj/item/weldingtool/WT = attacking_item
while (cuts_needed)
welding = TRUE
to_chat(user, SPAN_NOTICE("You begin slicing through a support beam in \the [src]. You see [cuts_needed] remaining."))

if(attacking_item.use_tool(src, user, cut_time, volume = 50) && WT.isOn())
hazelrat marked this conversation as resolved.
Show resolved Hide resolved
cuts_needed--
else
break

new /obj/item/stack/rods(get_turf(src))

if (cuts_needed)
hazelrat marked this conversation as resolved.
Show resolved Hide resolved
to_chat(user, SPAN_NOTICE("You successfully cut a support beam! Now dislodged from its fitting, it clatters down to the floor."))
else
qdel(src)
playsound(src, 'sound/items/Welder.ogg', 10, TRUE)
user.visible_message(SPAN_WARNING("\The [src] were cut apart by \the [user]!"), SPAN_NOTICE("You slice straight through \the [src], opening the way!"))
break

welding = FALSE

return ..()

// I feel there must be a better way to do this ~ hazelmouse
/obj/machinery/door/blast/shutters/get_examine_text(mob/user, distance, is_adjacent, infix, suffix)
. = ..()
if (cuts_needed > 1)
. += SPAN_NOTICE("\The [src] seems to have [cuts_needed] intact support beams.")
else
. += SPAN_NOTICE("\The [src] seems to only have [cuts_needed] intact support beam! It's close to collapse!")

// SUBTYPE: Odin
// Found on the odin, or where people really shouldnt get into
/obj/machinery/door/blast/odin
Expand Down
58 changes: 58 additions & 0 deletions html/changelogs/hazelmouse-weldable_shutters.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
################################
# 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
# - (fixes bugs)
# wip
# - (work in progress)
# qol
# - (quality of life)
# soundadd
# - (adds a sound)
# sounddel
# - (removes a sound)
# rscadd
# - (adds a feature)
# rscdel
# - (removes a feature)
# imageadd
# - (adds an image or sprite)
# imagedel
# - (removes an image or sprite)
# spellcheck
# - (fixes spelling or grammar)
# experiment
# - (experimental change)
# balance
# - (balance changes)
# code_imp
# - (misc internal code change)
# refactor
# - (refactors code)
# config
# - (makes a change to the config files)
# admin
# - (makes changes to administrator tools)
# server
# - (miscellaneous changes to server)
#################################

# Your name.
author: hazelmouse

# 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, this gets changed to [] after reading. Just remove the brackets when you add new shit.
# Please surround your changes in double quotes ("). It works without them, but if you use certain characters it screws up compiling. The quotes will not show up in the changelog.
changes:
- rscadd: "Shutters can now be deconstructed with a welding torch."
Loading