diff --git a/code/__DEFINES/construction.dm b/code/__DEFINES/construction.dm
index 683681a9a6..d3caedac22 100644
--- a/code/__DEFINES/construction.dm
+++ b/code/__DEFINES/construction.dm
@@ -23,6 +23,14 @@
#define WINDOW_IN_FRAME 1
#define WINDOW_SCREWED_TO_FRAME 2
+//reinforced plasma window construction states
+#define PRWINDOW_FRAME_BOLTED 3
+#define PRWINDOW_BARS_CUT 4
+#define PRWINDOW_POPPED 5
+#define PRWINDOW_BOLTS_OUT 6
+#define PRWINDOW_BOLTS_HEATED 7
+#define PRWINDOW_SECURE 8
+
//airlock assembly construction states
#define AIRLOCK_ASSEMBLY_NEEDS_WIRES 0
#define AIRLOCK_ASSEMBLY_NEEDS_ELECTRONICS 1
diff --git a/code/game/objects/structures/window.dm b/code/game/objects/structures/window.dm
index e40e158895..2d97009fa1 100644
--- a/code/game/objects/structures/window.dm
+++ b/code/game/objects/structures/window.dm
@@ -21,6 +21,7 @@ GLOBAL_LIST_EMPTY(electrochromatic_window_lookup)
var/ini_dir = null
var/state = WINDOW_OUT_OF_FRAME
var/reinf = FALSE
+ var/extra_reinforced = FALSE
var/heat_resistance = 800
var/decon_speed = 30
var/wtype = "glass"
@@ -65,6 +66,20 @@ GLOBAL_LIST_EMPTY(electrochromatic_window_lookup)
. += "The window is out of the frame, but could be pried in. It is screwed to the floor."
else if(!anchored)
. += "The window is unscrewed from the floor, and could be deconstructed by wrenching."
+ switch(state)
+ if(PRWINDOW_SECURE)
+ if(extra_reinforced)
+ . += "It's been screwed in with one way screws, you'd need to heat them to have any chance of backing them out."
+ else
+ . += "It's been screwed in with solid screws, you'd need to screw them out to unsecure the window."
+ if(PRWINDOW_BOLTS_HEATED)
+ . += "The screws are glowing white hot, and you'll likely be able to unscrew them now."
+ if(PRWINDOW_BOLTS_OUT)
+ . += "The screws have been removed, revealing a small gap you could fit a prying tool in."
+ if(PRWINDOW_POPPED)
+ . += "The main plate of the window has popped out of the frame, exposing some bars that look like they can be cut."
+ if(PRWINDOW_BARS_CUT)
+ . += "The main pane can be easily moved out of the way to reveal some bolts holding the frame in."
else
if(anchored)
. += "The window is screwed to the floor."
@@ -75,8 +90,13 @@ GLOBAL_LIST_EMPTY(electrochromatic_window_lookup)
. = ..()
if(direct)
setDir(direct)
+
+ if(extra_reinforced && anchored)
+ state = PRWINDOW_SECURE
+
if(reinf && anchored)
state = WINDOW_SCREWED_TO_FRAME
+
if(mapload && electrochromatic_id && electrochromatic_id[1] == "!")
electrochromatic_id = SSmapping.get_obfuscated_id(electrochromatic_id)
@@ -230,29 +250,26 @@ GLOBAL_LIST_EMPTY(electrochromatic_window_lookup)
make_electrochromatic(K.id)
qdel(K)
- if(!(flags_1&NODECONSTRUCT_1))
+ if(!(flags_1 & NODECONSTRUCT_1) && !(state >= PRWINDOW_FRAME_BOLTED))
if(I.tool_behaviour == TOOL_SCREWDRIVER)
I.play_tool_sound(src, 75)
- if(reinf)
- if(state == WINDOW_SCREWED_TO_FRAME || state == WINDOW_IN_FRAME)
- to_chat(user, "You begin to [state == WINDOW_SCREWED_TO_FRAME ? "unscrew the window from":"screw the window to"] the frame...")
- if(I.use_tool(src, user, decon_speed, extra_checks = CALLBACK(src, .proc/check_state_and_anchored, state, anchored)))
+ if(state == WINDOW_SCREWED_TO_FRAME || state == WINDOW_IN_FRAME && anchored)
+ to_chat(user, "You begin to [state == WINDOW_SCREWED_TO_FRAME ? "unscrew the window from":"screw the window to"] the frame...")
+ if(I.use_tool(src, user, decon_speed, extra_checks = CALLBACK(src, .proc/check_state_and_anchored, state, anchored)))
+ if(extra_reinforced && state == WINDOW_IN_FRAME)
+ state = PRWINDOW_SECURE
+ else
state = (state == WINDOW_IN_FRAME ? WINDOW_SCREWED_TO_FRAME : WINDOW_IN_FRAME)
- to_chat(user, "You [state == WINDOW_IN_FRAME ? "unfasten the window from":"fasten the window to"] the frame.")
- else if(state == WINDOW_OUT_OF_FRAME)
- to_chat(user, "You begin to [anchored ? "unscrew the frame from":"screw the frame to"] the floor...")
- if(I.use_tool(src, user, decon_speed, extra_checks = CALLBACK(src, .proc/check_state_and_anchored, state, anchored)))
- setAnchored(!anchored)
- to_chat(user, "You [anchored ? "fasten the frame to":"unfasten the frame from"] the floor.")
- else //if we're not reinforced, we don't need to check or update state
- to_chat(user, "You begin to [anchored ? "unscrew the window from":"screw the window to"] the floor...")
- if(I.use_tool(src, user, decon_speed, extra_checks = CALLBACK(src, .proc/check_anchored, anchored)))
+ to_chat(user, "You [state == WINDOW_IN_FRAME ? "unfasten the window from":"fasten the window to"] the frame.")
+ else if(state == WINDOW_OUT_OF_FRAME)
+ to_chat(user, "You begin to [anchored ? "unscrew the frame from":"screw the frame to"] the floor...")
+ if(I.use_tool(src, user, decon_speed, extra_checks = CALLBACK(src, .proc/check_state_and_anchored, state, anchored)))
setAnchored(!anchored)
- to_chat(user, "You [anchored ? "fasten the window to":"unfasten the window from"] the floor.")
+ to_chat(user, "You [anchored ? "fasten the frame to":"unfasten the frame from"] the floor.")
return
- else if(I.tool_behaviour == TOOL_CROWBAR && reinf && (state == WINDOW_OUT_OF_FRAME || state == WINDOW_IN_FRAME))
+ else if(I.tool_behaviour == TOOL_CROWBAR && reinf && (state == WINDOW_OUT_OF_FRAME || state == WINDOW_IN_FRAME) && anchored)
to_chat(user, "You begin to lever the window [state == WINDOW_OUT_OF_FRAME ? "into":"out of"] the frame...")
I.play_tool_sound(src, 75)
if(I.use_tool(src, user, decon_speed, extra_checks = CALLBACK(src, .proc/check_state_and_anchored, state, anchored)))
@@ -270,8 +287,67 @@ GLOBAL_LIST_EMPTY(electrochromatic_window_lookup)
to_chat(user, "You successfully disassemble [src].")
qdel(src)
return
+ if(!reinf || !anchored)
+ return ..()
+ switch(state)
+ if(PRWINDOW_SECURE)
+ if(extra_reinforced)
+ if(I.tool_behaviour == TOOL_WELDER && user.a_intent == INTENT_HARM)
+ user.visible_message("[user] holds \the [I] to the security screws on \the [src]...",
+ "You begin heating the security screws on \the [src]...")
+ if(I.use_tool(src, user, 180, volume = 100))
+ to_chat(user, "The security bolts are glowing white hot and look ready to be removed.")
+ state = PRWINDOW_BOLTS_HEATED
+ addtimer(CALLBACK(src, .proc/cool_bolts), 300)
+ return
+ else
+ if(I.tool_behaviour == TOOL_SCREWDRIVER)
+ user.visible_message("[user] digs into the screws and starts removing them...",
+ "You dig into the screws hard and they start turning...")
+ if(I.use_tool(src, user, 80, volume = 50))
+ state = PRWINDOW_BOLTS_OUT
+ to_chat(user, "The screws come out, and a gap forms around the edge of the pane.")
+ return
+ if(PRWINDOW_BOLTS_HEATED)
+ if(I.tool_behaviour == TOOL_SCREWDRIVER)
+ user.visible_message("[user] digs into the heated security screws and starts removing them...",
+ "You dig into the heated screws hard and they start turning...")
+ if(I.use_tool(src, user, 80, volume = 50))
+ state = PRWINDOW_BOLTS_OUT
+ to_chat(user, "The screws come out, and a gap forms around the edge of the pane.")
+ return
+ if(PRWINDOW_BOLTS_OUT)
+ if(I.tool_behaviour == TOOL_CROWBAR)
+ user.visible_message("[user] wedges \the [I] into the gap in the frame and starts prying...",
+ "You wedge \the [I] into the gap in the frame and start prying...")
+ if(I.use_tool(src, user, 50, volume = 50))
+ state = PRWINDOW_POPPED
+ to_chat(user, "The panel pops out of the frame, exposing some thin metal bars that looks like they can be cut.")
+ return
+ if(PRWINDOW_POPPED)
+ if(I.tool_behaviour == TOOL_WIRECUTTER)
+ user.visible_message("[user] starts cutting the exposed bars on \the [src]...",
+ "You start cutting the exposed bars on \the [src]")
+ if(I.use_tool(src, user, 30, volume = 50))
+ state = PRWINDOW_BARS_CUT
+ to_chat(user, "The panels falls out of the way exposing the frame bolts.")
+ return
+ if(PRWINDOW_BARS_CUT)
+ if(I.tool_behaviour == TOOL_WRENCH)
+ user.visible_message("[user] starts unfastening \the [src] from the frame...",
+ "You start unfastening the bolts from the frame...")
+ if(I.use_tool(src, user, 50, volume = 50))
+ to_chat(user, "You unscrew the bolts from the frame and the window pops loose.")
+ state = WINDOW_OUT_OF_FRAME
+ setAnchored(FALSE)
+ return
return ..()
+/obj/structure/window/proc/cool_bolts()
+ if(state == PRWINDOW_BOLTS_HEATED)
+ state = PRWINDOW_SECURE
+ visible_message("The bolts on \the [src] look like they've cooled off...")
+
/obj/structure/window/setAnchored(anchorvalue)
..()
air_update_turf(TRUE)
@@ -577,6 +653,7 @@ GLOBAL_LIST_EMPTY(electrochromatic_window_lookup)
desc = "A window made out of a plasma-silicate alloy and a rod matrix. It looks hopelessly tough to break and is most likely nigh fireproof."
icon_state = "plasmarwindow"
reinf = TRUE
+ extra_reinforced = TRUE
heat_resistance = 50000
armor = list("melee" = 85, "bullet" = 20, "laser" = 0, "energy" = 0, "bomb" = 60, "bio" = 100, "rad" = 100, "fire" = 99, "acid" = 100)
max_integrity = 500
@@ -642,6 +719,7 @@ GLOBAL_LIST_EMPTY(electrochromatic_window_lookup)
icon = 'icons/obj/smooth_structures/rplasma_window.dmi'
icon_state = "rplasmawindow"
dir = FULLTILE_WINDOW_DIR
+ state = PRWINDOW_SECURE
max_integrity = 1000
fulltile = TRUE
flags_1 = PREVENT_CLICK_UNDER_1
@@ -726,6 +804,7 @@ GLOBAL_LIST_EMPTY(electrochromatic_window_lookup)
fulltile = TRUE
flags_1 = PREVENT_CLICK_UNDER_1
reinf = TRUE
+ extra_reinforced = TRUE
heat_resistance = 1600
armor = list("melee" = 50, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 50, "bio" = 100, "rad" = 100, "fire" = 80, "acid" = 100)
smooth = SMOOTH_TRUE
@@ -758,6 +837,7 @@ GLOBAL_LIST_EMPTY(electrochromatic_window_lookup)
wave_explosion_block = EXPLOSION_BLOCK_BOROSILICATE_WINDOW
wave_explosion_multiply = EXPLOSION_DAMPEN_BOROSILICATE_WINDOW
decon_speed = 40
+ extra_reinforced = TRUE
glass_type = /obj/item/stack/tile/brass
glass_amount = 1
reinf = FALSE