Removes most hard-coded z level checks

This commit is contained in:
Crazylemon64
2016-07-31 21:29:03 -07:00
parent f54de64a73
commit bf2bcbce67
122 changed files with 325 additions and 410 deletions
+1 -2
View File
@@ -17,8 +17,7 @@
/datum/event/alien_infestation/start()
var/list/vents = list()
for(var/obj/machinery/atmospherics/unary/vent_pump/temp_vent in world)
// TODO: Tie into space manager
if((temp_vent.loc.z in config.station_levels) && !temp_vent.welded)
if(is_station_level(temp_vent.loc.z) && !temp_vent.welded)
if(temp_vent.parent.other_atmosmch.len > 50) //Stops Aliens getting stuck in small networks. See: Security, Virology
vents += temp_vent
+1 -2
View File
@@ -19,8 +19,7 @@
var/obj/item/device/radio/beacon/chosen
var/list/possible = list()
for(var/obj/item/device/radio/beacon/W in world)
// TODO: Tie into space manager
if(!(W.z in config.station_levels))
if(!is_station_level(W.z))
continue
possible += W
+1 -2
View File
@@ -18,8 +18,7 @@
/datum/event/brand_intelligence/start()
for(var/obj/machinery/vending/V in machines)
// TODO: Tie into space manager
if(V.z != ZLEVEL_STATION) continue
if(!is_station_level(V.z)) continue
vendingMachines.Add(V)
if(!vendingMachines.len)
+1 -2
View File
@@ -21,8 +21,7 @@
var/turf/T = get_turf(H)
if(!T)
continue
// TODO: Tie into space manager
if(T.z != ZLEVEL_STATION)
if(!is_station_level(T.z))
continue
var/foundAlready = 0 // don't infect someone that already has the virus
for(var/datum/disease/D in H.viruses)
+1 -1
View File
@@ -62,7 +62,7 @@
goal = locate(endx, endy, 1)
src.x = startx
src.y = starty
src.z = ZLEVEL_STATION
src.z = level_name_to_num(MAIN_STATION)
spawn(0)
walk_towards(src, goal, 1)
return
+5 -10
View File
@@ -22,8 +22,7 @@
for(var/obj/machinery/power/smes/S in machines)
var/area/current_area = get_area(S)
// TODO: Tie into space manager
if(current_area.type in skipped_areas || !(S.z in config.station_levels))
if(current_area.type in skipped_areas || !is_station_level(S.z))
continue
S.last_charge = S.charge
S.last_output_attempt = S.output_attempt
@@ -36,8 +35,7 @@
for(var/obj/machinery/power/apc/C in world)
var/area/current_area = get_area(C)
// TODO: Tie into space manager
if(current_area.type in skipped_areas_apc || !(C.z in config.station_levels))
if(current_area.type in skipped_areas_apc || !is_station_level(C.z))
continue
if(C.cell)
C.cell.charge = 0
@@ -50,15 +48,13 @@
command_announcement.Announce("Power has been restored to [station_name()]. We apologize for the inconvenience.", "Power Systems Nominal", new_sound = 'sound/AI/poweron.ogg')
for(var/obj/machinery/power/apc/C in machines)
var/area/current_area = get_area(C)
// TODO: Tie into space manager
if(current_area.type in skipped_areas_apc || !(C.z in config.station_levels))
if(current_area.type in skipped_areas_apc || !is_station_level(C.z))
continue
if(C.cell)
C.cell.charge = C.cell.maxcharge
for(var/obj/machinery/power/smes/S in machines)
var/area/current_area = get_area(S)
// TODO: Tie into space manager
if(current_area.type in skipped_areas || !(S.z in config.station_levels))
if(current_area.type in skipped_areas || !is_station_level(S.z))
continue
S.charge = S.last_charge
S.output_attempt = S.last_output_attempt
@@ -70,8 +66,7 @@
if(announce)
command_announcement.Announce("All SMESs on [station_name()] have been recharged. We apologize for the inconvenience.", "Power Systems Nominal", new_sound = 'sound/AI/poweron.ogg')
for(var/obj/machinery/power/smes/S in machines)
// TODO: Tie into space manager
if(S.z != ZLEVEL_STATION)
if(!is_station_level(S.z))
continue
S.charge = S.capacity
S.output_level = S.output_level_max
+1 -2
View File
@@ -1,7 +1,6 @@
/proc/Christmas_Game_Start()
for(var/obj/structure/flora/tree/pine/xmas in world)
// TODO: Tie into space manager
if(!(xmas.z in config.station_levels)) continue
if(!is_station_level(xmas.z)) continue
for(var/turf/simulated/floor/T in orange(1,xmas))
for(var/i=1,i<=rand(1,5),i++)
new /obj/item/weapon/a_gift(T)
+1 -1
View File
@@ -171,7 +171,7 @@ var/global/Holiday = null
*/
/* var/list/obj/containers = list()
for(var/obj/item/weapon/storage/S in world)
if(!(S.z in config.station_levels)) continue
if(!is_station_level(S.z)) continue
containers += S
message_admins("\blue DEBUG: Event: Egg spawned at [Egg.loc] ([Egg.x],[Egg.y],[Egg.z])")*/
+3 -6
View File
@@ -24,8 +24,7 @@
command_announcement.Announce("High levels of radiation detected near the station. Please evacuate into one of the shielded maintenance tunnels.", "Anomaly Alert", new_sound = 'sound/AI/radiation.ogg')
for(var/area/A in world)
// TODO: Tie into space manager
if(!(A.z in config.station_levels) || is_safe_zone(A))
if(!is_station_level(A.z) || is_safe_zone(A))
continue
A.radiation_alert()
@@ -43,8 +42,7 @@
var/turf/T = get_turf(H)
if(!T)
continue
// TODO: Tie into space manager
if(!(T.z in config.station_levels) || is_safe_zone(T.loc))
if(!is_station_level(T.z) || is_safe_zone(T.loc))
continue
if(istype(H,/mob/living/carbon/human))
@@ -63,8 +61,7 @@
command_announcement.Announce("The station has passed the radiation belt. Please report to medbay if you experience any unusual symptoms. Maintenance will lose all access again shortly.", "Anomaly Alert")
for(var/area/A in world)
// TODO: Tie into space manager
if(!(A.z in config.station_levels) || is_safe_zone(A))
if(!is_station_level(A.z) || is_safe_zone(A))
continue
A.reset_radiation_alert()
+1 -1
View File
@@ -41,7 +41,7 @@
var/datum/effect/system/spark_spread/sparks = new /datum/effect/system/spark_spread()
sparks.set_up(3, 0, D.loc)
sparks.start()
D.z = ZLEVEL_CENTCOMM
D.z = level_name_to_num(CENTCOMM)
D.has_loot = 0
qdel(D)
+1 -2
View File
@@ -16,8 +16,7 @@
var/list/vents = list()
for(var/obj/machinery/atmospherics/unary/vent_pump/temp_vent in world)
// TODO: Tie into space manager
if((temp_vent.loc.z in config.station_levels) && !temp_vent.welded)
if(is_station_level(temp_vent.loc.z) && !temp_vent.welded)
if(temp_vent.parent.other_atmosmch.len > 50)
vents += temp_vent
+1 -2
View File
@@ -9,8 +9,7 @@
RS.start()
RS.kill()
for(var/area/A)
// TODO: Tie into space manager
if(!(A.z in config.station_levels)) continue //Spook on main station only.
if(!is_station_level(A.z)) continue //Spook on main station only.
if(A.luminosity) continue
// if(A.lighting_space) continue
if(A.type == /area) continue
+1 -2
View File
@@ -11,8 +11,7 @@
/datum/event/vent_clog/setup()
endWhen = rand(25, 100)
for(var/obj/machinery/atmospherics/unary/vent_scrubber/temp_vent in machines)
// TODO: Tie into space manager
if((temp_vent.loc.z in config.station_levels))
if(is_station_level(temp_vent.loc.z))
if(temp_vent.parent.other_atmosmch.len > 50)
vents += temp_vent
+1 -2
View File
@@ -13,8 +13,7 @@
/datum/event/wormholes/start()
for(var/turf/simulated/floor/T in world)
// TODO: Tie into space manager
if((T.z in config.station_levels))
if(is_station_level(T.z))
pick_turfs += T
for(var/i = 1, i <= number_of_wormholes, i++)