Committing for QualityVan!

Fixes issue 458.

Changes singularity beacons to consume zero power but require a certain amount to function, check the attached wire rather than the area for that power, and most importantly, not work in space(normally).

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4399 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
petethegoat@gmail.com
2012-08-14 13:59:21 +00:00
parent 517a0d8add
commit 755c98d8b6
2 changed files with 24 additions and 14 deletions

View File

@@ -120,6 +120,9 @@
proc/Activate(mob/user = null)
if(!checkWirePower())
if(user) user << "\blue The connected wire doesn't have enough current."
return
for(var/obj/machinery/singularity/singulo in world)
if(singulo.z == z)
singulo.target = src
@@ -180,23 +183,30 @@
if(active) Deactivate()
..()
/*
* Added for a simple way to check power. Verifies that the beacon
* is connected to a wire, the wire is part of a powernet (that part's
* sort of redundant, since all wires either join or create one when placed)
* and that the powernet has at least 1500 power units available for use.
* Doesn't use them, though, just makes sure they're there.
* - QualityVan, Aug 11 2012
*/
proc/checkWirePower()
if(!attached)
return 0
var/datum/powernet/PN = attached.get_powernet()
if(!PN)
return 0
if(PN.avail < 1500)
return 0
return 1
process()
if(stat & NOPOWER)
if(active)
Deactivate()
return
if(!active)
return
if(attached)
if(!attached.get_powernet())
Deactivate()
return
use_power(1500)
else
Deactivate()
if(!checkWirePower())
Deactivate()
return

View File

@@ -576,7 +576,7 @@ mob/sd_ApplyLum(list/V, center = src)
if(isturf(loc))
V = view(luminosity,loc)
else
V = view(luminosity,src)
V = view(luminosity,get_turf(src))
. = ..(V, center)
mob/sd_StripLum(list/V, center = src)
@@ -584,7 +584,7 @@ mob/sd_StripLum(list/V, center = src)
if(isturf(loc))
V = view(luminosity,loc)
else
V = view(luminosity,src)
V = view(luminosity,get_turf(src))
. = ..(V, center)
mob/sd_ApplyLocalLum(list/affected)