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:
PsiOmega
2014-10-13 17:13:04 +02:00
parent ef9cc80603
commit a1ee4e766b
24 changed files with 1393 additions and 1183 deletions
+2 -2
View File
@@ -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
+3 -3
View File
@@ -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()