Files
Aurora.3/code/modules/shieldgen/shield_gen_external.dm
Fluffy 404c90f688 Replaced the outside turfs with exoplanet ones for the digsite (#20066)
Replaced the outside turfs with exoplanet ones for the digsite.
Fixed some exoplanet areas not having an exoplanet base turf.
Wrote a unit test for exoplanet areas to ensure they have an exoplanet
base turf.
2024-10-20 18:49:39 +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/simulated/floor/exoplanet/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/list/turf/above = getzabove(get_turf(src))
var/list/turf/below = getzbelow(get_turf(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/simulated/floor/exoplanet/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