Removes SMES power failure.

changes exception system to use critical_machine variable on machines.
Tcomms machines and the AI have their areas exempted.
If the PA is assembled, engineering is exempted.
This commit is contained in:
Shadowlight213
2016-08-22 19:24:59 -07:00
parent e0d2a9f434
commit 7e09f1bc77
10 changed files with 62 additions and 97 deletions
+8
View File
@@ -1150,6 +1150,14 @@
/obj/machinery/power/apc/proc/energy_fail(duration)
for(var/obj/machinery/M in area.contents)
if(M.critical_machine)
return
for(var/A in ai_list)
var/mob/living/silicon/ai/I = A
if(get_area(I) == area)
return
failure_timer = max(failure_timer, round(duration))
@@ -159,6 +159,7 @@
var/turf/T = loc
assembled = 0
critical_machine = FALSE
var/obj/structure/particle_accelerator/fuel_chamber/F = locate() in orange(1,src)
if(!F)
@@ -189,6 +190,7 @@
return 0
assembled = 1
critical_machine = TRUE //Only counts if the PA is actually assembled.
return 1
/obj/machinery/particle_accelerator/control_box/proc/check_part(turf/T, type)
-17
View File
@@ -29,7 +29,6 @@
var/input_level = 50000 // amount of power the SMES attempts to charge by
var/input_level_max = 200000 // cap on input_level
var/input_available = 0 // amount of charge available from input last tick
var/failure_timer = 0
var/output_attempt = 1 // 1 = attempting to output, 0 = not attempting to output
var/outputting = 1 // 1 = actually outputting, 0 = not outputting
@@ -44,7 +43,6 @@
/obj/machinery/power/smes/New()
..()
smes_list |= src
var/obj/item/weapon/circuitboard/machine/B = new /obj/item/weapon/circuitboard/machine/smes(null)
B.apply_default_parts(src)
@@ -184,7 +182,6 @@
cell.charge = (charge / capacity) * cell.maxcharge
/obj/machinery/power/smes/Destroy()
smes_list -= src
if(ticker && ticker.current_state == GAME_STATE_PLAYING)
var/area/area = get_area(src)
message_admins("SMES deleted at (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[x];Y=[y];Z=[z]'>[area.name]</a>)")
@@ -254,9 +251,6 @@
if(stat & BROKEN)
return
if(failure_timer) // Disabled by gridcheck.
failure_timer--
return
//store machine state to see if we need to update the icon overlays
var/last_disp = chargedisplay()
@@ -347,18 +341,14 @@
/obj/machinery/power/smes/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, \
datum/tgui/master_ui = null, datum/ui_state/state = default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
ui = new(user, src, ui_key, "smes", name, 340, 440, master_ui, state)
ui.open()
if(ui)
ui.set_autoupdate(state = (failure_timer ? 1 : 0))
/obj/machinery/power/smes/ui_data()
var/list/data = list(
"capacityPercent" = round(100*charge/capacity, 0.1),
"capacity" = capacity,
"failTime" = failure_timer,
"charge" = charge,
"inputAttempt" = input_attempt,
@@ -379,9 +369,6 @@
if(..())
return
switch(action)
if("reboot")
failure_timer = 0
update_icon()
if("tryinput")
input_attempt = !input_attempt
log_smes(usr.ckey)
@@ -436,7 +423,6 @@
if(.)
output_level = Clamp(target, 0, output_level_max)
log_smes(usr.ckey)
return 1
/obj/machinery/power/smes/proc/log_smes(user = "")
investigate_log("input/output; [input_level>output_level?"<font color='green'>":"<font color='red'>"][input_level]/[output_level]</font> | Charge: [charge] | Output-mode: [output_attempt?"<font color='green'>on</font>":"<font color='red'>off</font>"] | Input-mode: [input_attempt?"<font color='green'>auto</font>":"<font color='red'>off</font>"] by [user]", "singulo")
@@ -456,9 +442,6 @@
log_smes("an emp")
..()
/obj/machinery/power/smes/proc/energy_fail(duration)
failure_timer = duration
/obj/machinery/power/smes/engineering
charge = 1.5e6 // Engineering starts with some charge for singulo