Modifications to sensors code

- More stuff now triggers powernet warnings: People getting shocked by machinery (primarily door, but can be anything else powered by APC), and grilles. Thanks to @mwerezak for suggestion.
- Monitoring computer now has slightly different icon_state when it detects powernet warning. This is checked and updated every 5 MC ticks (ie, slightly delayed)
- Fixes ocassional runtime in powernet_sensor.dm
- Powersinks buffed a bit more. Drain rate changed from 0.6MW to 1MW. 1MW is full output of main engine SMES.
- Powersinks also dissipate small amount of internal energy charge over time. (20kW)
This commit is contained in:
Atlantiscze
2014-11-12 14:54:56 +01:00
parent f29cd211e6
commit 835d04290c
7 changed files with 64 additions and 21 deletions

View File

@@ -69,21 +69,26 @@
else
total_load = "[round(total_load)] W"
out += "</table>"
out += "</table><br><b>TOTAL GRID LOAD: [total_load]</b>"
var/textavail = powernet.avail
if(textavail > 1000)
textavail = "[textavail / 1000]"
textavail += " kW"
else
textavail += " W"
var/textavail = powernet.avail
if(textavail > 1000)
textavail = "[textavail / 1000] kW"
else
textavail = "[textavail] W"
out += "<br><b>TOTAL AVAILABLE: [textavail]</b>"
if(powernet.problem)
out += "<br><b>WARNING: Abnormal grid activity detected!</b>"
out += "<br><b>TOTAL GRID LOAD: [total_load]</b>"
out += "<br><b>TOTAL AVAILABLE: [textavail]</b>"
if(powernet.problem)
out += "<br><b>WARNING: Abnormal grid activity detected!</b>"
return out
/obj/machinery/power/sensor/proc/check_grid_warning()
RefreshGrid()
if(powernet)
if(powernet.problem)
return 1
return 0
// Has to be here as we need it to be in Machines list.
/obj/machinery/power/sensor/process()
return 1