Continual updates until merged
This commit is contained in:
@@ -199,6 +199,10 @@ By design, d1 is the smallest direction and d2 is the highest
|
||||
// Power related
|
||||
///////////////////////////////////////////
|
||||
|
||||
// All power generation handled in add_avail()
|
||||
// Machines should use add_load(), surplus(), avail()
|
||||
// Non-machines should use add_delayedload(), delayed_surplus(), newavail()
|
||||
|
||||
/obj/structure/cable/proc/add_avail(amount)
|
||||
if(powernet)
|
||||
powernet.newavail += amount
|
||||
@@ -209,7 +213,7 @@ By design, d1 is the smallest direction and d2 is the highest
|
||||
|
||||
/obj/structure/cable/proc/surplus()
|
||||
if(powernet)
|
||||
return powernet.avail-powernet.load
|
||||
return CLAMP(powernet.avail-powernet.load, 0, powernet.avail)
|
||||
else
|
||||
return 0
|
||||
|
||||
@@ -219,6 +223,22 @@ By design, d1 is the smallest direction and d2 is the highest
|
||||
else
|
||||
return 0
|
||||
|
||||
/obj/structure/cable/proc/add_delayedload(amount)
|
||||
if(powernet)
|
||||
powernet.delayedload += amount
|
||||
|
||||
/obj/structure/cable/proc/delayed_surplus()
|
||||
if(powernet)
|
||||
return CLAMP(powernet.newavail - powernet.delayedload, 0, powernet.newavail)
|
||||
else
|
||||
return 0
|
||||
|
||||
/obj/structure/cable/proc/newavail()
|
||||
if(powernet)
|
||||
return powernet.newavail
|
||||
else
|
||||
return 0
|
||||
|
||||
/////////////////////////////////////////////////
|
||||
// Cable laying helpers
|
||||
////////////////////////////////////////////////
|
||||
@@ -828,4 +848,4 @@ GLOBAL_LIST_INIT(cable_coil_recipes, list (new/datum/stack_recipe("cable restrai
|
||||
|
||||
/obj/item/stack/cable_coil/cut/random
|
||||
item_color = null
|
||||
color = "#ffffff"
|
||||
color = "#ffffff"
|
||||
Reference in New Issue
Block a user