* This is PHASE 1 of a multi-phase conversion. In this first phase we implement the subsystem, but leave it processing the existing global list variables. In the next phase we will switch to use datum variables in the subsystem. The main reason for splitting into two phases is ease of code review; change the meaningful code without the hundreds of machines -> SSmachines.machinery substitutions.
* We did declare macros for adding/removing things to the processing lists, and convert everywhere to use the macros.
* Added var/is_processing to /datum to keep track of whether an instance is already in a processing list (prevents it being in the list twice!) and also debugging, making sure its not in two lists etc.
* NOTE: The global machines list is **no longer sorted** for performance reasons. As far as I know, the only module that actually ever cared was cameras. Our camera system already handles its own sorting in the cameranets anyway, so it should no longer be needed.
- Fixes#9536
- Area now has APC variable, instead of list. APC construction, etc. should have checks to allow one APC per area only, so situations with multi-APC areas are unlikely, unless adminbus occurs. Either way, with or without this commit, one of the APCs would be unoperational (no load)
- get_apc() no longer uses very laggy locate() in contents of area. In situations where get_apc() is called repeately this brings massive increase in performance (from 0.120 to 0.000, depending on area size and amount of things in contents of that area) as it now only returns the apc variable.
- First issue is power monitoring consoles showing slightly inaccurate values. The code calculated some sort of level average which resulted in stupid values being reported (like load 500kW available 300kW). This also fixes APC load partially showing as Other load on the console.
- Second fixed issue (Fixes#7869) resolved gamebreaking bug that caused total irreversible failure of all powernets if makepowernets() was called. This, for example, includes large enough explosions, via admin command, or few other cases.
- 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)
- Adds remote powernet sensors, power monitoring computers use these by default to monitor power around the station. Default range is 1 Z level + long range versions of sensors
- Powernet sensors mapped in, each subgrid has it's own one (ie: substations compatible)
- Telecomms, mining, research and engineering outposts have long range versions installed, visible even cross-Zlevels
- Powersinks and ninja gloves now trigger problem warning in powernets they affect. This warning is visible to anyone using power monitoring console. TODO: Add more stuff that triggers warnings.
- Powersinks now properly drain APC cells using CELLRATE (@2000W per APC max.)
- Powersinks buffed a bit, to compensate for CELLRATE change (previous line)