Files
Aurora.3/code/modules/shieldgen/shield_gen_external.dm
T
Fluffy 29f616a5b1 Removed various set backgrounds (#18634)
* Atomization

* sadf

---------

Co-authored-by: FluffyGhost <FluffyGhost>
2024-03-13 21:27:27 +00:00

60 lines
1.8 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 = "hull shield generator"
multi_unlocked = TRUE
//Search for space turfs within range that are adjacent to a simulated turf.
/obj/machinery/shield_gen/external/get_shielded_turfs()
var/list/out = list()
var/turf/gen_turf = get_turf(src)
if (!gen_turf)
return
var/turf/U
var/turf/T
for (var/tt in RANGE_TURFS(field_radius, gen_turf))
T = tt
// Ignore station areas.
if (GLOB.the_station_areas[T.loc] || is_shuttle_area(T.loc))
continue
else if (istype(T, /turf/space) || istype(T, /turf/unsimulated/floor/asteroid) || isopenturf(T) || istype(T, /turf/simulated/floor/reinforced))
for (var/uu in RANGE_TURFS(1, T))
U = uu
if (T == U)
continue
if (GLOB.the_station_areas[U.loc] || istype(U, /turf/simulated/mineral/surface))
out += T
break
if(multiz)
var/connected_levels = list()
var/turf/above = getzabove(src)
var/turf/below = getzbelow(src)
if(above)
for(var/turf/z as anything in above)
connected_levels += z
if(below)
for(var/turf/z as anything in below)
connected_levels += z
for(var/turf/z in connected_levels)
for (var/tt in RANGE_TURFS(field_radius, z))
T = tt
// Ignore station areas.
if (GLOB.the_station_areas[T.loc] || istype(T.loc, /area/shuttle))
continue
else if (istype(T, /turf/space) || istype(T, /turf/unsimulated/floor/asteroid) || isopenturf(T) || istype(T, /turf/simulated/floor/reinforced))
for (var/uu in RANGE_TURFS(1, T))
U = uu
if (T == U)
continue
if (GLOB.the_station_areas[U.loc])
out += T
break
return out