Lighting system is too buggy to continue until I know wtf is going on

Conflicts:
	baystation12.dme
	code/game/turfs/turf.dm
This commit is contained in:
Aryn
2014-02-23 07:50:58 -07:00
committed by ZomgPonies
parent d443734d60
commit 5b2f811b71
20 changed files with 167 additions and 97 deletions
+3 -3
View File
@@ -950,7 +950,7 @@
var/turf/T = loc
var/area/A = T.loc
if(A)
if(A.lighting_use_dynamic) light_amount = min(10,T.lighting_lumcount) - 5 //hardcapped so it's not abused by having a ton of flashlights
if(A.lighting_use_dynamic) light_amount = min(10,T.lit_value) - 5 //hardcapped so it's not abused by having a ton of flashlights
else light_amount = 5
nutrition += light_amount
traumatic_shock -= light_amount
@@ -970,7 +970,7 @@
var/turf/T = loc
var/area/A = T.loc
if(A)
if(A.lighting_use_dynamic) light_amount = T.lighting_lumcount
if(A.lighting_use_dynamic) light_amount = T.lit_value
else light_amount = 10
if(light_amount > 2) //if there's enough light, start dying
take_overall_damage(1,1)
@@ -1498,7 +1498,7 @@
//0.1% chance of playing a scary sound to someone who's in complete darkness
if(isturf(loc) && rand(1,1000) == 1)
var/turf/currentTurf = loc
if(!currentTurf.lighting_lumcount)
if(!currentTurf.lit_value)
playsound_local(src,pick(scarySounds),50, 1, -1)
// Separate proc so we can jump out of it when we've succeeded in spreading disease.
@@ -448,7 +448,7 @@
var/turf/T = loc
var/area/A = T.loc
if(A)
if(A.lighting_use_dynamic) light_amount = min(10,T.lighting_lumcount) - 5 //hardcapped so it's not abused by having a ton of flashlights
if(A.lighting_use_dynamic) light_amount = min(10,T.lit_value) - 5 //hardcapped so it's not abused by having a ton of flashlights
else light_amount = 5
nutrition += light_amount
@@ -111,7 +111,7 @@
// Don't check it twice if our destination is the tile we are on or we can't even get to our destination
if(T == destination)
destination = null
else if(!T.lighting_lumcount && !destination.lighting_lumcount) // No one can see us in the darkness, right?
else if(!T.lit_value && !destination.lit_value) // No one can see us in the darkness, right?
return null
// We aren't in darkness, loop for viewers.
+2 -2
View File
@@ -603,8 +603,8 @@
#define LIGHTING_POWER_FACTOR 20 //20W per unit luminosity
/obj/machinery/light/process()//TODO: remove/add this from machines to save on processing as needed ~Carn PRIORITY
if(on)
use_power(luminosity * LIGHTING_POWER_FACTOR, LIGHT)
if(on && light)
use_power(light.radius * LIGHTING_POWER_FACTOR, LIGHT)
// called when area power state changes
/obj/machinery/light/power_change()