mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-07-17 10:57:19 +01:00
Merge pull request #7583 from atlantiscze/cellrate-hardsuit-stuff
Hardsuit Powersink Adjustments
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user