Merge pull request #7583 from atlantiscze/cellrate-hardsuit-stuff

Hardsuit Powersink Adjustments
This commit is contained in:
Chinsky
2014-12-31 08:17:20 +03:00
10 changed files with 61 additions and 76 deletions
+8 -2
View File
@@ -100,11 +100,17 @@
// now look for APCs and drain their cells
if(drained < drain_rate)
for(var/obj/machinery/power/terminal/T in PN.nodes)
// Enough power drained this tick, no need to torture more APCs
if(drained >= drain_rate)
break
if(istype(T.master, /obj/machinery/power/apc))
var/obj/machinery/power/apc/A = T.master
if(A.operating && A.cell)
A.cell.charge = max(0, A.cell.charge - (2000 * CELLRATE))
power_drained += 2000
var/cur_charge = A.cell.charge / CELLRATE
var/drain_val = min(2000, cur_charge)
A.cell.use(drain_val * CELLRATE)
drained += drain_val
if(power_drained > max_power * 0.95)