Files
silicons 0f33f1de5f standardizes wallmount orientations (#6255)
Co-authored-by: silicons <no@you.cat>
2024-01-10 21:55:29 +01:00

94 lines
2.9 KiB
Plaintext

// Ported from Haine and WrongEnd with much gratitude!
/* ._.-'~'-._.-'~'-._.-'~'-._.-'~'-._.-'~'-._.-'~'-._.-'~'-._. */
/*-=-=-=-=-=-=-=-=-=-=-=-=-=WHAT-EVER=-=-=-=-=-=-=-=-=-=-=-=-=-*/
/* '~'-._.-'~'-._.-'~'-._.-'~'-._.-'~'-._.-'~'-._.-'~'-._.-'~' */
//! PLEASE STOP USING THIS, GO USE /obj/spawner/window
/obj/effect/wingrille_spawn
name = "window grille spawner"
icon = 'icons/obj/structures/window_spawners.dmi'
icon_state = "wingrille"
density = TRUE
layer = WINDOW_LAYER
anchored = 1.0
pressure_resistance = 4*ONE_ATMOSPHERE
CanAtmosPass = ATMOS_PASS_AIR_BLOCKED
var/win_path = /obj/structure/window/basic
var/activated
/obj/effect/wingrille_spawn/Initialize(mapload)
. = ..()
if(!win_path)
return
activate()
return INITIALIZE_HINT_QDEL
/obj/effect/wingrille_spawn/proc/activate()
if(activated)
return
if (!locate(/obj/structure/grille) in get_turf(src))
var/obj/structure/grille/G = new /obj/structure/grille(src.loc)
handle_grille_spawn(G)
var/list/neighbours = list()
for (var/dir in GLOB.cardinal)
var/turf/T = get_step(src, dir)
var/obj/effect/wingrille_spawn/other = locate(/obj/effect/wingrille_spawn) in T
if(!other)
var/found_connection
if(locate(/obj/structure/grille) in T)
for(var/obj/structure/window/W in T)
if(W.type == win_path && W.dir == get_dir(T,src))
found_connection = 1
qdel(W)
if(!found_connection)
var/obj/structure/window/new_win = new win_path(src.loc)
new_win.setDir(dir)
handle_window_spawn(new_win)
else
neighbours |= other
activated = 1
for(var/obj/effect/wingrille_spawn/other in neighbours)
if(!other.activated) other.activate()
/obj/effect/wingrille_spawn/proc/handle_window_spawn(var/obj/structure/window/W)
return
// Currently unused, could be useful for pre-wired electrified windows.
/obj/effect/wingrille_spawn/proc/handle_grille_spawn(var/obj/structure/grille/G)
return
/obj/effect/wingrille_spawn/reinforced
name = "reinforced window grille spawner"
icon_state = "r-wingrille"
win_path = /obj/structure/window/reinforced
/obj/effect/wingrille_spawn/reinforced/crescent
name = "Crescent window grille spawner"
icon_state = "r-wingrille"
win_path = /obj/structure/window/reinforced
/obj/effect/wingrille_spawn/reinforced/crescent/handle_window_spawn(var/obj/structure/window/W)
W.set_multiplied_integrity(100, TRUE)
/obj/effect/wingrille_spawn/phoron
name = "phoron window grille spawner"
icon_state = "p-wingrille"
win_path = /obj/structure/window/phoronbasic
/obj/effect/wingrille_spawn/reinforced_phoron
name = "reinforced phoron window grille spawner"
icon_state = "pr-wingrille"
win_path = /obj/structure/window/phoronreinforced
/obj/effect/wingrille_spawn/reinforced/polarized
name = "polarized window grille spawner"
color = "#444444"
win_path = /obj/structure/window/reinforced/polarized
var/id
/obj/effect/wingrille_spawn/reinforced/polarized/handle_window_spawn(var/obj/structure/window/reinforced/polarized/P)
if(id)
P.id = id