Window Rework (#13805)

This commit is contained in:
SleepyGemmy
2022-07-05 14:27:29 +02:00
committed by GitHub
parent 6121af6954
commit 005f30b76f
55 changed files with 2636 additions and 2732 deletions
@@ -152,7 +152,7 @@
name = "phoron glass"
singular_name = "phoron glass sheet"
icon_state = "sheet-phoronglass"
created_window = /obj/structure/window/phoronbasic
created_window = /obj/structure/window/borosilicate
default_type = "phoron glass"
icon_has_variants = FALSE
@@ -164,6 +164,6 @@
singular_name = "reinforced phoron glass sheet"
icon_state = "sheet-phoronrglass"
default_type = "reinforced phoron glass"
created_window = /obj/structure/window/phoronreinforced
created_window = /obj/structure/window/borosilicate/reinforced
is_reinforced = 1
icon_has_variants = FALSE
@@ -191,9 +191,9 @@
*/
/obj/item/stack/tile/floor
name = "floor tile"
singular_name = "floor tile"
desc = "Used to cover up your horrible art."
name = "steel tiles"
singular_name = "steel tile"
desc = "A set of steel floor tiles."
icon_state = "tile"
force = 6
matter = list(DEFAULT_WALL_MATERIAL = TILE_MATERIAL_AMOUNT)
@@ -207,6 +207,12 @@
amount = max_amount
update_icon()
/obj/item/stack/tile/floor/full
name = "full steel tiles"
desc = "A set of full steel floor tiles."
singular_name = "full steel tile"
icon_state = "tile_full"
/obj/item/stack/tile/floor_red
name = "red floor tile"
singular_name = "red floor tile"
@@ -232,11 +238,19 @@
icon_state = "tile_white"
/obj/item/stack/tile/floor_dark
name = "dark floor tile"
singular_name = "dark floor tile"
name = "plasteel tiles"
desc = "A set of plasteel floor tiles."
singular_name = "plasteel tile"
icon_state = "fr_tile"
matter = list(MATERIAL_PLASTEEL = TILE_MATERIAL_AMOUNT)
/obj/item/stack/tile/floor_dark/full
name = "full plasteel tiles"
desc = "A set of full plasteel floor tiles."
singular_name = "full plasteel tile"
icon_state = "fr_tile_full"
matter = list(MATERIAL_PLASTEEL = TILE_MATERIAL_AMOUNT)
/obj/item/stack/tile/floor_freezer
name = "freezer floor tile"
singular_name = "freezer floor tile"
+2 -2
View File
@@ -219,8 +219,8 @@ RFD Construction-Class
if(istype(T, /turf/simulated/floor))
build_cost = 3
build_delay = 20
build_type = "window and grille section"
build_atom = /obj/effect/map_effect/wingrille_spawn/reinforced
build_type = "window"
build_atom = /obj/effect/map_effect/window_spawner/full/reinforced
else if(mode == RFD_AIRLOCK)
if(istype(T, /turf/simulated/floor))
build_cost = 3
+146 -32
View File
@@ -1,52 +1,166 @@
/obj/structure/window_frame
name = "window frame"
desc = "An empty window frame."
icon = 'icons/obj/smooth/full_window.dmi'
name = "steel window frame"
desc = "A steel window frame."
icon = 'icons/obj/smooth/full_window_frame.dmi'
icon_state = "window_frame"
build_amt = 4
anchored = FALSE
/obj/structure/window_frame/anchored
anchored = TRUE
density = TRUE
climbable = TRUE
smooth = SMOOTH_TRUE
can_be_unanchored = TRUE
canSmoothWith = list(
/turf/simulated/wall,
/turf/simulated/wall/r_wall,
/obj/structure/window_frame,
/obj/structure/window_frame/unanchored,
/obj/structure/window_frame/empty
)
var/should_check_mapload = TRUE
var/has_glass_installed = FALSE
var/glass_needed = 4
/obj/structure/window_frame/cardinal_smooth(adjacencies, var/list/dir_mods)
LAZYINITLIST(dir_mods)
var/north_wall = FALSE
var/east_wall = FALSE
var/south_wall = FALSE
var/west_wall = FALSE
if(adjacencies & N_NORTH)
var/turf/T = get_step(src, NORTH)
if(iswall(T))
dir_mods["[N_NORTH]"] = "-wall"
north_wall = TRUE
if(adjacencies & N_EAST)
var/turf/T = get_step(src, EAST)
if(iswall(T))
dir_mods["[N_EAST]"] = "-wall"
east_wall = TRUE
if(adjacencies & N_SOUTH)
var/turf/T = get_step(src, SOUTH)
if(iswall(T))
dir_mods["[N_SOUTH]"] = "-wall"
south_wall = TRUE
if(adjacencies & N_WEST)
var/turf/T = get_step(src, WEST)
if(iswall(T))
dir_mods["[N_WEST]"] = "-wall"
west_wall = TRUE
if(((adjacencies & N_NORTH) && (adjacencies & N_WEST)) && (north_wall || west_wall))
dir_mods["[N_NORTH][N_WEST]"] = "-n[north_wall ? "wall" : "win"]-w[west_wall ? "wall" : "win"]"
if(((adjacencies & N_NORTH) && (adjacencies & N_EAST)) && (north_wall || east_wall))
dir_mods["[N_NORTH][N_EAST]"] = "-n[north_wall ? "wall" : "win"]-e[east_wall ? "wall" : "win"]"
if(((adjacencies & N_SOUTH) && (adjacencies & N_WEST)) && (south_wall || west_wall))
dir_mods["[N_SOUTH][N_WEST]"] = "-s[south_wall ? "wall" : "win"]-w[west_wall ? "wall" : "win"]"
if((adjacencies & N_SOUTH) && (adjacencies & N_EAST) && (south_wall || east_wall))
dir_mods["[N_SOUTH][N_EAST]"] = "-s[south_wall ? "wall" : "win"]-e[east_wall ? "wall" : "win"]"
return ..(adjacencies, dir_mods)
/obj/structure/window_frame/proc/update_nearby_icons()
queue_smooth_neighbors(src)
/obj/structure/window_frame/update_icon()
queue_smooth(src)
/obj/structure/window_frame/Initialize(mapload) // If the window frame is mapped in, it should be considered to have glass spawned in it by a window spawner.
. = ..()
if(mapload && should_check_mapload)
has_glass_installed = TRUE
/obj/structure/window_frame/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
if(air_group || (height == 0))
return TRUE
if(istype(mover, /obj/structure/closet/crate))
return TRUE
if(istype(mover) && mover.checkpass(PASSTABLE))
return TRUE
if(locate(/obj/structure/window_frame) in get_turf(mover))
return TRUE
return FALSE
/obj/structure/window_frame/attackby(obj/item/W, mob/user)
if((W.isscrewdriver()) && (istype(loc, /turf/simulated) || anchored))
playsound(src, W.usesound, 80, 1)
anchored = !anchored
user.visible_message("<span class='notice'>[user] [anchored ? "fastens" : "unfastens"] \the [src].</span>", \
"<span class='notice'>You have [anchored ? "fastened the grille to" : "unfastened the grill from"] the floor.</span>")
return
if(has_glass_installed)
to_chat(user, SPAN_NOTICE("You can't unfasten \the [src] if it has glass installed."))
return
if(anchored)
if(W.use_tool(src, user, 2 SECONDS, volume = 50))
anchored = FALSE
to_chat(user, SPAN_NOTICE("You unfasten \the [src]."))
update_icon()
update_nearby_icons()
return
else
if(W.use_tool(src, user, 2 SECONDS, volume = 50))
anchored = TRUE
to_chat(user, SPAN_NOTICE("You fasten \the [src]."))
dir = 2
update_icon()
update_nearby_icons()
return
else if(W.iswelder())
if(has_glass_installed)
to_chat(user, SPAN_NOTICE("You can't disassemble \the [src] if it has glass installed."))
return
if(anchored)
to_chat(user, SPAN_NOTICE("\The [src] needs to be unanchored to be able to be welded apart."))
return
var/obj/item/weldingtool/WT = W
if(!WT.isOn())
to_chat(user, SPAN_WARNING("\The [WT] isn't turned on."))
return
if(WT.use(0, user))
to_chat(user, SPAN_NOTICE("You use \the [WT] to remove \the [src]."))
playsound(src, WT.usesound, 80, 1)
new /obj/item/stack/material/steel(get_turf(src),rand(1,3))
qdel(src)
to_chat(user, SPAN_NOTICE("\The [WT] isn't turned on."))
return
playsound(src, 'sound/items/welder.ogg', 50, TRUE)
user.visible_message(
SPAN_WARNING("\The [user] starts welding \the [src] apart!"),
SPAN_NOTICE("You start welding \the [src] apart..."),
"You hear deconstruction."
)
if(W.use_tool(src, user, 2 SECONDS, volume = 50))
if(!src || !WT.isOn())
return
if(WT.use(0, user))
to_chat(user, SPAN_NOTICE("You use \the [WT] to weld apart \the [src]."))
playsound(src, WT.usesound, 50, 1)
new /obj/item/stack/material/steel(get_turf(src), 4)
qdel(src)
return
else if(istype(W, /obj/item/stack/material) && W.get_material_name() == MATERIAL_GLASS_REINFORCED && anchored)
var/obj/item/stack/material/G = W
if(G.use(4))
playsound(src, 'sound/items/Deconstruct.ogg', 50, 1)
to_chat(user, SPAN_WARNING ("You place the glass on the window frame."))
new /obj/structure/window/full(get_turf(src))
qdel(src)
if(has_glass_installed)
to_chat(user, SPAN_NOTICE("\The [src] already has glass installed."))
return
var/obj/item/stack/material/G = W
if(do_after(user, 2 SECONDS))
if(G.use(glass_needed))
playsound(src, 'sound/items/Deconstruct.ogg', 50, 1)
to_chat(user, SPAN_NOTICE("You place the [MATERIAL_GLASS_REINFORCED] in the window frame."))
new /obj/structure/window/full/reinforced(get_turf(src), constructed = TRUE)
desc = "A steel window frame."
has_glass_installed = TRUE
return
else
to_chat(user, SPAN_WARNING ("You need at least four sheets of reinforced glass to finished the window."))
to_chat(user, SPAN_NOTICE("You need at least [glass_needed] sheets of [MATERIAL_GLASS_REINFORCED] to install a window in \the [src]."))
else if(istype(W, /obj/item/stack/material) && W.get_material_name() == MATERIAL_GLASS_REINFORCED_PHORON && anchored)
var/obj/item/stack/material/G = W
if(G.use(4))
playsound(src, 'sound/items/Deconstruct.ogg', 50, 1)
to_chat(user, SPAN_WARNING ("You place the glass on the window frame."))
new /obj/structure/window/full/phoron(get_turf(src))
qdel(src)
if(has_glass_installed)
to_chat(user, SPAN_NOTICE("\The [src] already has glass installed."))
return
var/obj/item/stack/material/G = W
if(do_after(user, 2 SECONDS))
if(G.use(glass_needed))
playsound(src, 'sound/items/Deconstruct.ogg', 50, 1)
to_chat(user, SPAN_WARNING("You place the [MATERIAL_GLASS_REINFORCED_PHORON] in the window frame."))
new /obj/structure/window/full/phoron/reinforced(get_turf(src), constructed = TRUE)
desc = "A steel window frame."
has_glass_installed = TRUE
return
else
to_chat(user, SPAN_WARNING ("You need at least four sheets of reinforced borosilicate glass to finished the window."))
to_chat(user, SPAN_WARNING("You need at least [glass_needed] sheets of [MATERIAL_GLASS_REINFORCED_PHORON] to finished the window."))
/obj/structure/window_frame/unanchored // Used during in-game construction.
should_check_mapload = FALSE // No glass.
anchored = FALSE
/obj/structure/window_frame/empty
should_check_mapload = FALSE // No glass.
+370 -190
View File
@@ -1,20 +1,23 @@
//
// Glass
//
/obj/structure/window
name = "window"
desc = "A window."
name = "glass pane"
desc = "A glass pane."
icon = 'icons/obj/structures.dmi'
density = 1
density = TRUE
w_class = ITEMSIZE_NORMAL
layer = 3.2//Just above doors
anchored = 1.0
layer = 3.2 // Just above doors.
anchored = TRUE
flags = ON_BORDER
obj_flags = OBJ_FLAG_ROTATABLE
var/maxhealth = 14.0
var/maximal_heat = T0C + 100 // Maximal heat before this window begins taking damage from fire
var/damage_per_fire_tick = 2.0 // Amount of damage per fire tick. Regular windows are not fireproof so they might as well break quickly.
var/maxhealth = 14
var/maximal_heat = T0C + 100 // Maximal heat before this window begins taking damage from fire
var/damage_per_fire_tick = 2 // Amount of damage per fire tick. Regular windows are not fireproof so they might as well break quickly.
var/health
var/ini_dir = null
var/state = 2
var/reinf = 0
var/reinf = FALSE
var/basestate
var/shardtype = /obj/item/material/shard
var/glasstype = null // Set this in subtypes. Null is assumed strange or otherwise impossible to dismantle, such as for shuttle glass.
@@ -80,11 +83,11 @@
return
/obj/structure/window/proc/apply_silicate(var/amount)
if(health < maxhealth) // Mend the damage
if(health < maxhealth) // Mend the damage.
health = min(health + amount * 3, maxhealth)
if(health == maxhealth)
visible_message("[src] looks fully repaired." )
else // Reinforce
else // Reinforce.
silicate = min(silicate + amount, 100)
updateSilicate()
@@ -104,12 +107,12 @@
var/index = null
index = 0
while(index < 2)
new shardtype(loc) //todo pooling?
new shardtype(loc)
if(reinf)
new /obj/item/stack/rods(loc)
index++
else
new shardtype(loc) //todo pooling?
new shardtype(loc)
if(reinf)
new /obj/item/stack/rods(loc)
@@ -124,7 +127,6 @@
return
/obj/structure/window/bullet_act(var/obj/item/projectile/Proj)
var/proj_damage = Proj.get_structure_damage()
if(!proj_damage) return
@@ -132,25 +134,22 @@
take_damage(proj_damage)
return
/obj/structure/window/ex_act(severity)
switch(severity)
if(1.0)
if(1)
qdel(src)
return
if(2.0)
if(2)
shatter(0)
return
if(3.0)
if(3)
if(prob(50))
shatter(0)
return
else
take_damage(rand(10,30), TRUE, FALSE)
//TODO: Make full windows a separate type of window.
//Once a full window, it will always be a full window, so there's no point
//having the same type for both.
// This and relevant verbs/procs can probably be removed since full windows are a thing now. -Gem
/obj/structure/window/proc/is_full_window()
return (dir == SOUTHWEST || dir == SOUTHEAST || dir == NORTHWEST || dir == NORTHEAST)
@@ -164,7 +163,6 @@
else
return 1
/obj/structure/window/CheckExit(atom/movable/O, turf/target)
if(istype(O) && O.checkpass(PASSGLASS))
return 1
@@ -172,7 +170,6 @@
return 0
return 1
/obj/structure/window/hitby(AM as mob|obj)
..()
visible_message(SPAN_DANGER("[src] was hit by [AM]."))
@@ -324,13 +321,15 @@
new glasstype(loc)
qdel(src)
/obj/structure/window/Initialize(mapload, start_dir = null, constructed=0)
/obj/structure/window/Initialize(mapload, start_dir = null, constructed = 0)
. = ..()
//player-constructed windows
if (constructed)
anchored = 0
if (!mapload && constructed)
state = 0
if (start_dir)
set_dir(start_dir)
@@ -341,7 +340,6 @@
update_nearby_tiles(need_rebuild=1)
update_nearby_icons()
/obj/structure/window/Destroy()
density = 0
update_nearby_tiles()
@@ -360,8 +358,7 @@
set_dir(ini_dir)
update_nearby_tiles(need_rebuild=1)
//checks if this window is full-tile one
/obj/structure/window/proc/is_fulltile()
/obj/structure/window/proc/is_fulltile() // Checks if this window is a full-tile one.
if(dir & (dir - 1))
return 1
return 0
@@ -371,147 +368,52 @@
hit(damage_per_fire_tick, 0)
..()
/********** Glass and Glass Panes **********/
/obj/structure/window/basic
desc = "It looks thin and flimsy. A few knocks with... anything, really should shatter it."
name = "glass pane"
desc = "It looks thin and flimsy. A few hits with anything will shatter it."
icon_state = "window"
basestate = "window"
glasstype = /obj/item/stack/material/glass
maximal_heat = T0C + 100
damage_per_fire_tick = 2.0
maxhealth = 12.0
damage_per_fire_tick = 2
maxhealth = 12
/obj/structure/window/phoronbasic
name = "phoron window"
desc = "A borosilicate alloy window. It seems to be quite strong."
basestate = "phoronwindow"
icon_state = "phoronwindow"
shardtype = /obj/item/material/shard/phoron
glasstype = /obj/item/stack/material/glass/phoronglass
maximal_heat = T0C + 2000
damage_per_fire_tick = 1.0
maxhealth = 40.0
/obj/structure/window/phoronreinforced
name = "reinforced borosilicate window"
desc = "A borosilicate alloy window, with rods supporting it. It seems to be very strong."
basestate = "phoronrwindow"
icon_state = "phoronrwindow"
shardtype = /obj/item/material/shard/phoron
glasstype = /obj/item/stack/material/glass/phoronrglass
reinf = 1
maximal_heat = T0C + 4000
damage_per_fire_tick = 1.0 // This should last for 80 fire ticks if the window is not damaged at all. The idea is that borosilicate windows have something like ablative layer that protects them for a while.
maxhealth = 80.0
/obj/structure/window/phoronreinforced/skrell
name = "advanced borosilicate-alloy window"
desc = "A window made out of a higly advanced borosilicate alloy. It seems to be extremely strong."
basestate = "phoronwindow"
icon_state = "phoronwindow"
maxhealth = 250
/obj/structure/window/basic/full
name = "glass"
icon_state = "window"
dir = 5
/obj/structure/window/reinforced
name = "reinforced window"
name = "reinforced glass pane"
desc = "It looks rather strong. Might take a few good hits to shatter it."
icon_state = "rwindow"
basestate = "rwindow"
maxhealth = 40.0
reinf = 1
maxhealth = 40
reinf = TRUE
maximal_heat = T0C + 750
damage_per_fire_tick = 2.0
damage_per_fire_tick = 2
glasstype = /obj/item/stack/material/glass/reinforced
/obj/structure/window/Initialize(mapload, constructed = 0)
. = ..()
//player-constructed windows
if (!mapload && constructed)
state = 0
/obj/structure/window/reinforced/full
dir = 5
icon_state = "fwindow"
name = "reinforced glass"
icon_state = "rwindow"
dir = 5
/obj/structure/window/reinforced/tinted
name = "tinted window"
name = "reinforced tinted glass pane"
desc = "It looks rather strong and opaque. Might take a few good hits to shatter it."
icon_state = "twindow"
basestate = "twindow"
opacity = 1
/obj/structure/window/reinforced/tinted/frosted
name = "frosted window"
name = "reinforced frosted glass pane"
desc = "It looks rather strong and frosted over. Looks like it might take a few less hits then a normal reinforced window."
icon_state = "fwindow"
basestate = "fwindow"
maxhealth = 30
/obj/structure/window/shuttle
name = "shuttle window"
desc = "It looks rather strong. Might take a few good hits to shatter it."
icon = 'icons/obj/smooth/shuttle_window.dmi'
icon_state = "shuttle_window"
basestate = "window"
maxhealth = 40
reinf = 1
basestate = "w"
dir = 5
smooth = SMOOTH_TRUE
can_be_unanchored = TRUE
layer = 2.99
/obj/structure/window/shuttle/legion
name = "cockpit window"
icon = 'icons/obj/smooth/shuttle_window_legion.dmi'
health = 160
maxhealth = 160
/obj/structure/window/shuttle/palepurple
icon = 'icons/obj/smooth/shuttle_window_palepurple.dmi'
/obj/structure/window/shuttle/skrell
name = "advanced borosilicate alloy window"
desc = "It looks extremely strong. Might take many good hits to crack it."
icon = 'icons/obj/smooth/skrell_window_purple.dmi'
health = 500
maxhealth = 500
smooth = SMOOTH_MORE|SMOOTH_DIAGONAL
canSmoothWith = list(
/turf/simulated/wall/shuttle/skrell,
/obj/structure/window/shuttle/skrell
)
/obj/structure/window/shuttle/scc_space_ship
name = "window"
desc = "It looks extremely strong. Might take many good hits to crack it."
icon = 'icons/obj/smooth/scc_space_ship.dmi'
icon_state = "scc_space_ship"
health = 500
maxhealth = 500
smooth = SMOOTH_MORE|SMOOTH_DIAGONAL
canSmoothWith = list(
/obj/structure/window/shuttle/scc_space_ship
)
/obj/structure/window/shuttle/scc_space_ship/cardinal
smooth = SMOOTH_MORE
/obj/structure/window/shuttle/scc
icon = 'icons/obj/smooth/scc_shuttle_window.dmi'
health = 160
maxhealth = 160
/obj/structure/window/shuttle/crescent
desc = "It looks rather strong."
/obj/structure/window/shuttle/crescent/take_damage()
return
/obj/structure/window/reinforced/polarized
name = "electrochromic window"
name = "reinforced electrochromic glass pane"
desc = "Adjusts its tint with voltage. Might take a few good hits to shatter it."
var/id
@@ -529,7 +431,7 @@
/obj/structure/window/reinforced/crescent/attackby()
return
/obj/structure/window/reinforced/crescent/ex_act(var/severity = 2.0)
/obj/structure/window/reinforced/crescent/ex_act(var/severity = 2)
return
/obj/structure/window/reinforced/crescent/hitby()
@@ -546,9 +448,12 @@
desc = "A remote control switch for polarized windows."
var/range = 16
/obj/machinery/button/switch/windowtint/update_icon()
icon_state = "light[active]"
/obj/machinery/button/switch/windowtint/attack_hand(mob/user as mob)
if(..())
return 1
return TRUE
toggle_tint()
@@ -558,42 +463,129 @@
active = !active
update_icon()
for(var/obj/structure/window/reinforced/polarized/W in range(src,range))
if (W.id == src.id || !W.id)
spawn(0)
W.toggle()
return
for(var/obj/structure/window/reinforced/polarized/W in range(src, range))
if(W.id == src.id || !W.id)
W.toggle()
for(var/obj/structure/window/full/reinforced/polarized/W in range(src, range))
if(W.id == src.id || !W.id)
W.toggle()
/obj/machinery/button/switch/windowtint/power_change()
..()
if(active && !powered(power_channel))
toggle_tint()
/obj/machinery/button/switch/windowtint/update_icon()
icon_state = "light[active]"
/obj/structure/window/borosilicate
name = "borosilicate glass pane"
desc = "A borosilicate alloy window. It seems to be quite strong."
basestate = "phoronwindow"
icon_state = "phoronwindow"
shardtype = /obj/item/material/shard/phoron
glasstype = /obj/item/stack/material/glass/phoronglass
maximal_heat = T0C + 2000
damage_per_fire_tick = 1 // This should last for 80 fire ticks if the window is not damaged at all. The idea is that borosilicate windows have something like ablative layer that protects them for a while.
maxhealth = 40
/obj/structure/window/full
name = "reinforced window"
/obj/structure/window/borosilicate/reinforced
name = "reinforced borosilicate glass pane"
desc = "A borosilicate alloy window, with rods supporting it. It seems to be very strong."
basestate = "phoronrwindow"
icon_state = "phoronrwindow"
glasstype = /obj/item/stack/material/glass/phoronrglass
reinf = TRUE
maximal_heat = T0C + 4000
maxhealth = 80
/obj/structure/window/borosilicate/reinforced/skrell
name = "advanced borosilicate alloy window"
desc = "A window made out of a higly advanced borosilicate alloy. It seems to be extremely strong."
basestate = "phoronwindow"
icon_state = "phoronwindow"
maxhealth = 250
/********** Shuttle Windows **********/
/obj/structure/window/shuttle
name = "reinforced shuttle window"
desc = "It looks rather strong. Might take a few good hits to shatter it."
icon = 'icons/obj/smooth/full_window.dmi'
icon_state = "window_glass"
basestate = "window_glass"
icon = 'icons/obj/smooth/shuttle_window.dmi'
icon_state = "shuttle_window"
basestate = "window"
maxhealth = 40
reinf = TRUE
maximal_heat = T0C + 750
basestate = "w"
dir = 5
damage_per_fire_tick = 2.0
smooth = SMOOTH_TRUE
can_be_unanchored = TRUE
glasstype = /obj/item/stack/material/glass/reinforced
layer = 2.99
/obj/structure/window/shuttle/legion
name = "reinforced cockpit window"
icon = 'icons/obj/smooth/shuttle_window_legion.dmi'
health = 160
maxhealth = 160
/obj/structure/window/shuttle/palepurple
icon = 'icons/obj/smooth/shuttle_window_palepurple.dmi'
/obj/structure/window/shuttle/skrell
name = "advanced borosilicate alloy window"
desc = "It looks extremely strong. Might take many good hits to crack it."
icon = 'icons/obj/smooth/skrell_window_purple.dmi'
health = 500
maxhealth = 500
smooth = SMOOTH_MORE | SMOOTH_DIAGONAL
canSmoothWith = list(
/turf/simulated/wall/shuttle/skrell,
/obj/structure/window/shuttle/skrell
)
/obj/structure/window/shuttle/scc_space_ship
name = "advanced borosilicate alloy window"
desc = "It looks extremely strong. Might take many good hits to crack it."
icon = 'icons/obj/smooth/scc_space_ship.dmi'
icon_state = "scc_space_ship"
health = 500
maxhealth = 500
smooth = SMOOTH_MORE | SMOOTH_DIAGONAL
canSmoothWith = list(
/obj/structure/window/shuttle/scc_space_ship,
/turf/simulated/wall/shuttle/scc_space_ship
)
/obj/structure/window/shuttle/scc_space_ship/cardinal
smooth = SMOOTH_MORE
/obj/structure/window/shuttle/scc
icon = 'icons/obj/smooth/scc_shuttle_window.dmi'
health = 160
maxhealth = 160
/obj/structure/window/shuttle/crescent
desc = "It looks rather strong."
/obj/structure/window/shuttle/crescent/take_damage()
return
//
// Full Windows
//
/obj/structure/window/full
name = "window"
desc = "You aren't supposed to see this."
obj_flags = null
dir = 5
maxhealth = 28 // Two glass panes worth of health, since that's the minimum you need to break through to get to the other side.
glasstype = /obj/item/stack/material/glass
shardtype = /obj/item/material/shard
layer = 2.99
base_frame = /obj/structure/window_frame
/obj/structure/window/full/dismantle_window()
var/obj/item/stack/material/mats = new glasstype(loc)
mats.amount = 4
var/obj/structure/window_frame/F = new/obj/structure/window_frame (get_turf(src))
F.anchored = anchored
qdel(src)
smooth = SMOOTH_TRUE
canSmoothWith = list(
/obj/structure/window/full/reinforced,
/obj/structure/window/full/reinforced/polarized,
/obj/structure/window/full/phoron/reinforced
)
/obj/structure/window/full/cardinal_smooth(adjacencies, var/list/dir_mods)
LAZYINITLIST(dir_mods)
@@ -631,34 +623,222 @@
dir_mods["[N_SOUTH][N_EAST]"] = "-s[south_wall ? "wall" : "win"]-e[east_wall ? "wall" : "win"]"
return ..(adjacencies, dir_mods)
/obj/structure/window/full/phoron
name = "reinforced borosilicate window"
desc = "A borosilicate alloy window, with rods supporting it. It seems to be very strong."
icon = 'icons/obj/smooth/phoron_full_window.dmi'
icon_state = "window_glass"
basestate = "window_glass"
shardtype = /obj/item/material/shard/phoron
glasstype = /obj/item/stack/material/glass/phoronrglass
maximal_heat = T0C + 4000
damage_per_fire_tick = 1.0
maxhealth = 80.0
layer = 2.99
base_frame = /obj/structure/window_frame
/obj/structure/window/full/Initialize(mapload, start_dir = null, constructed = 0)
if (!mapload && constructed)
state = 0
/obj/structure/window/reinforced/polarized/full
name = "reinforced electrochromic window"
desc = "Adjusts its tint with voltage. Might take a few good hits to shatter it."
if (start_dir)
set_dir(start_dir)
health = maxhealth
ini_dir = dir
update_nearby_tiles(need_rebuild=1)
update_icon()
update_nearby_icons()
/obj/structure/window/full/Destroy()
var/obj/structure/window_frame/WF = locate(/obj/structure/window_frame) in get_turf(src)
WF.has_glass_installed = FALSE
return ..()
/obj/structure/window/full/attackby(obj/item/W, mob/user)
if(!istype(W) || istype(W, /obj/item/flag))
return
if(istype(W, /obj/item/grab) && get_dist(src,user)<2)
var/obj/item/grab/G = W
if(istype(G.affecting,/mob/living))
grab_smash_attack(G, BRUTE)
return
if(W.flags & NOBLUDGEON)
return
if(W.isscrewdriver())
if(state == 2)
if(W.use_tool(src, user, 2 SECONDS, volume = 50))
to_chat(user, SPAN_NOTICE("You have unfastened the glass from the window frame."))
state--
update_nearby_icons()
else if(state == 1)
if(W.use_tool(src, user, 2 SECONDS, volume = 50))
to_chat(user, SPAN_NOTICE("You have fastened the glass to the window frame."))
state++
update_nearby_icons()
else if(W.iscrowbar())
if(state == 1)
if(W.use_tool(src, user, 2 SECONDS, volume = 50))
to_chat(user, SPAN_NOTICE("You pry the glass out of the window frame."))
state--
update_nearby_icons()
else if(state == 0)
if(W.use_tool(src, user, 2 SECONDS, volume = 50))
to_chat(user, SPAN_NOTICE("You pry the glass into the window frame."))
state++
update_nearby_icons()
else if(W.iswrench())
if(state == 0)
visible_message(SPAN_WARNING("\The [user] is dismantling \the [src]!"))
if(W.use_tool(src, user, 2 SECONDS, volume = 50))
to_chat(user, SPAN_NOTICE("You undo the safety bolts and remove the glass from \the [src]."))
dismantle_window()
else
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
if(W.damtype == BRUTE || W.damtype == BURN)
user.do_attack_animation(src)
hit(W.force)
else
playsound(loc, 'sound/effects/glass_hit.ogg', 75, 1)
return
/obj/structure/window/full/shatter(var/display_message = 1)
playsound(src, /decl/sound_category/glass_break_sound, 70, 1)
if(display_message)
visible_message(SPAN_WARNING("\The [src] shatters!"))
if(dir == SOUTHWEST)
var/index = null
index = 0
while(index < 2)
new shardtype(loc)
if(reinf)
new /obj/item/stack/rods(loc)
index++
else
new shardtype(loc)
if(reinf)
new /obj/item/stack/rods(loc)
qdel(src)
return
/obj/structure/window/full/take_damage(var/damage = 0, var/sound_effect = 1)
var/initialhealth = health
if(silicate)
damage = damage * (1 - silicate / 200)
health = max(0, health - damage)
if(health <= 0)
shatter()
else
if(sound_effect)
playsound(loc, 'sound/effects/glass_hit.ogg', 100, 1)
if(health < maxhealth / 4 && initialhealth >= maxhealth / 4)
visible_message(SPAN_DANGER("[src] looks like it's about to shatter!"))
playsound(loc, /decl/sound_category/glasscrack_sound, 100, 1)
else if(health < maxhealth / 2 && initialhealth >= maxhealth / 2)
visible_message(SPAN_WARNING("[src] looks seriously damaged!"))
playsound(loc, /decl/sound_category/glasscrack_sound, 100, 1)
else if(health < maxhealth * 3/4 && initialhealth >= maxhealth * 3/4)
visible_message(SPAN_WARNING("Cracks begin to appear in [src]!"))
playsound(loc, /decl/sound_category/glasscrack_sound, 100, 1)
return
/obj/structure/window/full/dismantle_window()
var/obj/item/stack/material/mats = new glasstype(loc)
mats.amount = 4
var/obj/structure/window_frame/WF = locate(/obj/structure/window_frame) in get_turf(src)
if(istype(WF))
WF.has_glass_installed = FALSE
WF.desc = "An empty steel window frame."
qdel(src)
update_nearby_icons()
/********** Full Windows **********/
// Reinforced Window
/obj/structure/window/full/reinforced
name = "reinforced window"
desc = "It looks rather strong. Might take a few good hits to shatter it."
icon = 'icons/obj/smooth/full_window.dmi'
icon_state = "window_glass"
basestate = "window_glass"
dir = 5
smooth = SMOOTH_TRUE
maxhealth = 80 // Two reinforced panes worth of health, since that's the minimum you need to break through to get to the other side.
reinf = TRUE
maximal_heat = T0C + 750
glasstype = /obj/item/stack/material/glass/reinforced
layer = 2.99
base_frame = /obj/structure/window_frame
smooth = SMOOTH_TRUE
canSmoothWith = list(
/turf/simulated/wall,
/turf/simulated/wall/r_wall,
/obj/structure/window/full/reinforced,
/obj/structure/window/full/reinforced/polarized,
/obj/structure/window/full/phoron/reinforced
)
/obj/structure/window/reinforced/polarized/full/dismantle_window()
var/obj/item/stack/material/mats = new glasstype(loc)
mats.amount = 4
var/obj/structure/window_frame/F = new/obj/structure/window_frame (get_turf(src))
F.anchored = anchored
qdel(src)
// Indestructible Reinforced Window
/obj/structure/window/full/reinforced/indestructible/attack_hand()
return
/obj/structure/window/full/reinforced/indestructible/attackby()
return
/obj/structure/window/full/reinforced/indestructible/ex_act(var/severity = 2)
return
/obj/structure/window/full/reinforced/indestructible/hitby()
return
/obj/structure/window/full/reinforced/indestructible/take_damage()
return
/obj/structure/window/full/reinforced/indestructible/shatter()
return
// Reinforced Polarized Window
/obj/structure/window/full/reinforced/polarized
name = "reinforced electrochromic window"
desc = "Adjusts its tint with voltage. Might take a few good hits to shatter it."
var/id
/obj/structure/window/full/reinforced/polarized/proc/toggle()
if(opacity)
animate(src, color="#FFFFFF", time = 1 SECOND)
set_opacity(FALSE)
else
animate(src, color="#606060", time = 1 SECOND)
set_opacity(TRUE)
// Indestructible Reinforced Polarized Window
/obj/structure/window/full/reinforced/polarized/indestructible/attack_hand()
return
/obj/structure/window/full/reinforced/polarized/indestructible/attackby()
return
/obj/structure/window/full/reinforced/polarized/indestructible/ex_act(var/severity = 2)
return
/obj/structure/window/full/reinforced/polarized/indestructible/hitby()
return
/obj/structure/window/full/reinforced/polarized/indestructible/take_damage()
return
/obj/structure/window/full/reinforced/polarized/indestructible/shatter()
return
// Borosilicate Window (I.e. Phoron Window)
/obj/structure/window/full/phoron
name = "borosilicate window"
desc = "You aren't supposed to see this."
icon = 'icons/obj/smooth/full_window_phoron.dmi'
icon_state = "window_glass"
basestate = "window_glass"
glasstype = /obj/item/stack/material/glass/phoronglass
shardtype = /obj/item/material/shard/phoron
maxhealth = 80 // Two borosilicate glass panes worth of health, since that's the minimum you need to break through to get to the other side.
maximal_heat = T0C + 2000
damage_per_fire_tick = 1
// Reinforced Borosilicate Window (I.e. Reinforced Phoron Window)
/obj/structure/window/full/phoron/reinforced
name = "reinforced borosilicate window"
desc = "A borosilicate alloy window, with rods supporting it. It seems to be very strong."
glasstype = /obj/item/stack/material/glass/phoronrglass
maxhealth = 160 // Two reinforced borosilicate glass panes worth of health, since that's the minimum you need to break through to get to the other side.
reinf = TRUE
maximal_heat = T0C + 4000