mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-27 14:08:44 +01:00
Basically ripped over /tg/'s powernet and cable code into our own codebase.
Keeps Z-level code as it was. Modifies/restores powernet procs as necessary to match our own implementation changes.
This commit is contained in:
@@ -70,12 +70,12 @@
|
||||
var/shieldload = between(500, max_stored_power - storedpower, power_draw) //what we try to draw
|
||||
shieldload = PN.draw_power(shieldload) //what we actually get
|
||||
storedpower += shieldload
|
||||
|
||||
|
||||
//If we're still in the red, then there must not be enough available power to cover our load.
|
||||
if(storedpower <= 0)
|
||||
power = 0
|
||||
return 0
|
||||
|
||||
|
||||
power = 1 // IVE GOT THE POWER!
|
||||
return 1
|
||||
|
||||
|
||||
@@ -107,14 +107,14 @@
|
||||
/obj/machinery/shield_capacitor/process()
|
||||
if (!anchored)
|
||||
active = 0
|
||||
|
||||
|
||||
//see if we can connect to a power net.
|
||||
var/datum/powernet/PN
|
||||
var/turf/T = src.loc
|
||||
var/obj/structure/cable/C = T.get_cable_node()
|
||||
if (C)
|
||||
PN = C.powernet
|
||||
|
||||
|
||||
if (PN)
|
||||
var/power_draw = between(0, max_charge - stored_charge, charge_rate) //what we are trying to draw
|
||||
power_draw = PN.draw_power(power_draw) //what we actually get
|
||||
@@ -138,7 +138,7 @@
|
||||
active = !active
|
||||
if( href_list["charge_rate"] )
|
||||
charge_rate = between(10000, charge_rate + text2num(href_list["charge_rate"]), max_charge_rate)
|
||||
|
||||
|
||||
updateDialog()
|
||||
|
||||
/obj/machinery/shield_capacitor/power_change()
|
||||
|
||||
Reference in New Issue
Block a user