Powersink Fix

- Fixes powersinks lasting for infinite duration before exploding.
- Minor adjustment to powersink drain rates. Powersink now drains up to 1.5MW instead of  1MW. It also attempts to drain up to 5kW instead of 2kW from each APC, unless powernet supplies enough power. They can still be overpowered by pumping more than 1.5MW into the grid, which is possible if you either install more coils into main SMES, or use the solars. Even 1MW of default SMES is enough to slow the drain effect considerably, espicially if you can isolate it with breakers.
- Fixes "APC Flickering" issues caused by powersinks. Powersinks are now processed immediately after powernets, which ensures they are first to take power from that powernet. This is unfortunately necessary as APCs would take power first, which is not desired.
- Minor refactor while i was at it - absolute paths, span classes, visible_message() instead of for cycle. No gameplay effect.
This commit is contained in:
Atlantiscze
2015-05-05 18:49:11 +02:00
parent 864d40d1c4
commit 91e3ced65e
2 changed files with 95 additions and 89 deletions

View File

@@ -328,6 +328,11 @@ datum/controller/game_controller/proc/process_pipenets()
for(var/datum/powernet/Powernet in powernets)
Powernet.reset()
// This is necessary to ensure powersinks are always the first devices that drain power from powernet.
// Otherwise APCs or other stuff go first, resulting in bad things happening.
for(var/obj/item/device/powersink/S in processing_objects)
S.drain()
datum/controller/game_controller/proc/process_nano()
last_thing_processed = /datum/nanoui
var/i = 1