More Overload Lighting Performance

This commit is contained in:
Fox-McCloud
2016-08-01 15:29:47 -04:00
parent e93a7868e9
commit 62a780220d
6 changed files with 13 additions and 13 deletions
+2 -2
View File
@@ -34,7 +34,7 @@
S.update_icon()
S.power_change()
for(var/obj/machinery/power/apc/C in world)
for(var/obj/machinery/power/apc/C in apcs)
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))
@@ -48,7 +48,7 @@
if(announce)
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)
for(var/obj/machinery/power/apc/C in apcs)
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))
+7 -7
View File
@@ -977,8 +977,8 @@
return 0
else if(href_list["overload"])
if(istype(usr, /mob/living/silicon) && !aidisabled)
src.overload_lighting()
if(issilicon(usr) && !aidisabled)
overload_lighting()
else if(href_list["malfhack"])
var/mob/living/silicon/ai/malfai = usr
@@ -1383,17 +1383,17 @@
// overload all the lights in this APC area
/obj/machinery/power/apc/proc/overload_lighting(var/chance = 100)
if(/* !get_connection() || */ !operating || shorted)
/obj/machinery/power/apc/proc/overload_lighting(chance = 100)
if(!operating || shorted)
return
if( cell && cell.charge>=20)
cell.use(20);
if(cell && cell.charge >= 20)
cell.use(20)
spawn(0)
for(var/obj/machinery/light/L in area)
if(prob(chance))
L.on = 1
L.broken()
sleep(1)
stoplag()
/obj/machinery/power/apc/proc/setsubsystem(val)
if(cell && cell.charge > 0)
+1 -1
View File
@@ -514,7 +514,7 @@
status = LIGHT_EMPTY
update()
/obj/machinery/light/proc/broken(var/skip_sound_and_sparks = 0)
/obj/machinery/light/proc/broken(skip_sound_and_sparks = 0)
if(status == LIGHT_EMPTY || status == LIGHT_BROKEN)
return