Continual updates until merged

This commit is contained in:
Poojawa
2018-09-17 04:55:03 -05:00
parent 99e57fb221
commit bc0d14c193
53 changed files with 358 additions and 200 deletions
+22 -2
View File
@@ -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"