Files
Aurora.3/code/game/objects/structures/window_spawner.dm
Lohikar 0cba68911d Lighting Overhaul & General process improvements (#1612)
This is it. The big one.
Risk: Very large. This modifies or rewrites several important systems.
Some things still need balancing, but that's probably better done if/when this hits dev.

changes:

New smooth lighting system.
Machinery split into three processes: machinery, powernet, pipenet Removed due to breakage. Refactored into multi-step process.
Mob process rewritten.
NanoUI process rewritten.
Objects process rewritten.
Tweaked color output of station lights.
Slime core lights now emit colored light.
Fixed light update frequency issue with fire alarms, hydroponics trays, and airlocks.
Increased light emission from bolted airlocks.
Miscellaneous performance improvements.
New datum pool implementation.
New lighting usage profiler.
Lighting system now tracks UV light, which is not visible to players.
Space now has a parallax effect.
Disabled Spin View verbs due to incompatibility with the new lighting system.
Disabled hallucination view spin due to incompatibility with the new lighting system.
Lighting system now initializes in the lobby before the round starts to reduce BoR deadtime.
Added UV light tracking to lighting engine; dionae now gain energy exclusively from UV light.
Added colored lighting to a few consoles that used default (white) light.
2017-01-29 01:13:54 +02:00

97 lines
2.9 KiB
Plaintext

// Ported from Haine and WrongEnd with much gratitude!
/* ._.-'~'-._.-'~'-._.-'~'-._.-'~'-._.-'~'-._.-'~'-._.-'~'-._. */
/*-=-=-=-=-=-=-=-=-=-=-=-=-=WHAT-EVER=-=-=-=-=-=-=-=-=-=-=-=-=-*/
/* '~'-._.-'~'-._.-'~'-._.-'~'-._.-'~'-._.-'~'-._.-'~'-._.-'~' */
/obj/effect/wingrille_spawn
name = "window grille spawner"
icon = 'icons/obj/structures.dmi'
icon_state = "wingrille"
density = 1
anchored = 1.0
var/win_path = /obj/structure/window/basic
var/activated
// stops ZAS expanding zones past us, the windows will block the zone anyway
/obj/effect/wingrille_spawn/CanPass()
return 0
/obj/effect/wingrille_spawn/attack_hand()
attack_generic()
/obj/effect/wingrille_spawn/attack_ghost()
attack_generic()
/obj/effect/wingrille_spawn/attack_generic()
activate()
/obj/effect/wingrille_spawn/initialize()
..()
if(!win_path)
return
if(ticker && ticker.current_state < GAME_STATE_PLAYING)
activate()
/obj/effect/wingrille_spawn/proc/activate()
if(activated) return
if (!locate(/obj/structure/grille) in get_turf(src))
var/obj/structure/grille/G = getFromPool(/obj/structure/grille, src.loc)
handle_grille_spawn(G)
var/list/neighbours = list()
for (var/dir in 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 = getFromPool(win_path, src.loc)
new_win.set_dir(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()
qdel(src)
/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"
win_path = /obj/structure/window/reinforced/crescent
/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