APC Area update initial commit.

Conflicts:
	code/modules/mob/mob.dm
	code/modules/power/power.dm
This commit is contained in:
Ccomp5950
2014-03-07 23:42:28 -06:00
committed by ZomgPonies
parent 0b47e16828
commit b97434054f
9 changed files with 57 additions and 15 deletions
+3
View File
@@ -14,6 +14,7 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
*/
/area
var/fire = null
var/atmos = 1
@@ -32,6 +33,8 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
var/eject = null
var/debug = 0
var/powerupdate = 0
var/requires_power = 1
var/always_unpowered = 0 //this gets overriden to 1 for space in area/New()
+1
View File
@@ -13,6 +13,7 @@
master = src //moved outside the spawn(1) to avoid runtimes in lighting.dm when it references loc.loc.master ~Carn
uid = ++global_uid
related = list(src)
active_areas += src
if(type == /area) // override defaults for space. TODO: make space areas of type /area/space rather than /area
requires_power = 1
+13 -3
View File
@@ -67,8 +67,10 @@ Class Procs:
Checks to see if area that contains the object has power available for power
channel given in 'chan'.
use_power(amount, chan=EQUIP) 'modules/power/power.dm'
use_power(amount, chan=EQUIP, autocalled) 'modules/power/power.dm'
Deducts 'amount' from the power channel 'chan' of the area that contains the object.
If it's autocalled then everything is normal, if something else calls use_power we are going to
need to recalculate the power two ticks in a row.
power_change() 'modules/power/power.dm'
Called by the area that contains the object when ever that area under goes a
@@ -161,9 +163,9 @@ Class Procs:
if(!powered(power_channel))
return 0
if(src.use_power == 1)
use_power(idle_power_usage,power_channel)
use_power(idle_power_usage,power_channel, 1)
else if(src.use_power >= 2)
use_power(active_power_usage,power_channel)
use_power(active_power_usage,power_channel, 1)
return 1
/obj/machinery/Topic(href, href_list)
@@ -191,6 +193,10 @@ Class Procs:
return 1
src.add_fingerprint(usr)
var/area/A = get_area(src)
A.powerupdate = 1
return 0
/obj/machinery/attack_ai(var/mob/user as mob)
@@ -233,6 +239,10 @@ Class Procs:
return 1
src.add_fingerprint(user)
var/area/A = get_area(src)
A.powerupdate = 1
return 0
/obj/machinery/CheckParts()