Files
vgstation13/code/modules/power/ShieldGen/shield_gen_external.dm
ShiftyRail aa1d68ae8a Remove the WIP folder (#26572)
* Remove the WiP folder

* .dme and path references

* .tmpl
2020-05-24 13:31:49 -05:00

45 lines
1.4 KiB
Plaintext

//---------- external shield generator
//generates an energy field that loops around any built up area in space (is useless inside) halts movement and airflow, is blocked by walls, windows, airlocks etc
/obj/machinery/shield_gen/external
name = "\improper Starscreen-EX external shield generator"
desc = "Generates a hull-hugging wall of energy when active. Place near space."
board_path = /obj/item/weapon/circuitboard/shield_gen_ex
icon_state = "generator_external_off"
icon_prefix = "external"
/obj/machinery/shield_gen/external/get_shielded_turfs()
var/list/open = list(get_turf(src))
var/list/closed = list()
while(open.len)
for(var/turf/T in open)
for(var/turf/O in orange(1, T))
if(get_dist(O,src) > field_radius)
continue
var/add_this_turf = 0
if(istype(O,/turf/space))
for(var/turf/simulated/G in orange(1, O))
add_this_turf = 1
break
//uncomment this for structures (but not lattices) to be surrounded by shield as well
/*if(!add_this_turf)
for(var/obj/structure/S in orange(1, O))
if(!istype(S, /obj/structure/lattice))
add_this_turf = 1
break
if(add_this_turf)
for(var/obj/structure/S in O)
if(!istype(S, /obj/structure/lattice))
add_this_turf = 0
break*/
if(add_this_turf && !(O in open) && !(O in closed))
open += O
open -= T
closed += T
return closed