Merge pull request #3913 from Screemonster/outdoorshields

Hull shields and emergency shields check for outdoor turfs and drops
This commit is contained in:
Anewbe
2017-09-23 17:04:23 -05:00
committed by GitHub
2 changed files with 12 additions and 3 deletions

View File

@@ -139,6 +139,11 @@
var/check_delay = 60 //periodically recheck if we need to rebuild a shield
use_power = 0
idle_power_usage = 0
var/global/list/blockedturfs = list(
/turf/space,
/turf/simulated/open,
/turf/simulated/floor/outdoors,
)
/obj/machinery/shieldgen/Destroy()
collapse_shields()
@@ -169,7 +174,7 @@
/obj/machinery/shieldgen/proc/create_shields()
for(var/turf/target_tile in range(2, src))
if (istype(target_tile,/turf/space) && !(locate(/obj/machinery/shield) in target_tile))
if (is_type_in_list(target_tile,blockedturfs) && !(locate(/obj/machinery/shield) in target_tile))
if (malfunction && prob(33) || !malfunction)
var/obj/machinery/shield/S = new/obj/machinery/shield(target_tile)
deployed_shields += S

View File

@@ -3,7 +3,11 @@
/obj/machinery/shield_gen/external
name = "hull shield generator"
var/global/list/blockedturfs = list(
/turf/space,
/turf/simulated/open,
/turf/simulated/floor/outdoors,
)
/obj/machinery/shield_gen/external/New()
..()
@@ -18,7 +22,7 @@
for (var/x_offset = -field_radius; x_offset <= field_radius; x_offset++)
for (var/y_offset = -field_radius; y_offset <= field_radius; y_offset++)
T = locate(gen_turf.x + x_offset, gen_turf.y + y_offset, gen_turf.z)
if (istype(T, /turf/space))
if (is_type_in_list(T,blockedturfs))
//check neighbors of T
if (locate(/turf/simulated/) in orange(1, T))
out += T