Fixes luminosity checks

They should now be more in-line with how they worked under the old
lighting system.
This commit is contained in:
Krausus
2015-05-15 01:07:08 -04:00
parent eac7bb075c
commit f5f15881c2
9 changed files with 24 additions and 15 deletions
+2 -2
View File
@@ -746,7 +746,7 @@ var/global/list/brutefireloss_overlays = list("1" = image("icon" = 'icons/mob/sc
var/turf/T = loc
var/atom/movable/lighting_overlay/L = locate(/atom/movable/lighting_overlay) in T
if(L)
light_amount = min(10,L.lum_r + L.lum_g + L.lum_b) - 5 //hardcapped so it's not abused by having a ton of flashlights
light_amount = (L.get_clamped_lum()*10) - 5 //hardcapped so it's not abused by having a ton of flashlights
else
light_amount = 5
nutrition += light_amount
@@ -768,7 +768,7 @@ var/global/list/brutefireloss_overlays = list("1" = image("icon" = 'icons/mob/sc
var/turf/T = loc
var/atom/movable/lighting_overlay/L = locate(/atom/movable/lighting_overlay) in T
if(L)
light_amount = L.lum_r + L.lum_g + L.lum_b //hardcapped so it's not abused by having a ton of flashlights
light_amount = L.get_clamped_lum()*10
else
light_amount = 10
if(light_amount > species.light_dam) //if there's enough light, start dying
@@ -442,7 +442,7 @@
var/turf/T = loc
var/atom/movable/lighting_overlay/L = locate(/atom/movable/lighting_overlay) in T
if(L)
light_amount = min(10,L.lum_r + L.lum_g + L.lum_b) - 5 //hardcapped so it's not abused by having a ton of flashlights
light_amount = (L.get_clamped_lum()*10) - 5 //hardcapped so it's not abused by having a ton of flashlights
else
light_amount = 5
@@ -672,4 +672,4 @@
proc/handle_wetness()
if(mob_master.current_cycle%20==2) //dry off a bit once every 20 ticks or so
wetlevel = max(wetlevel - 1,0)
return
return
@@ -116,19 +116,19 @@
var/DLlight_amount
var/atom/movable/lighting_overlay/L = locate(/atom/movable/lighting_overlay) in T
if(L)
light_amount = min(10,L.lum_r + L.lum_g + L.lum_b) - 5 //hardcapped so it's not abused by having a ton of flashlights
light_amount = L.lum_r + L.lum_g + L.lum_b
else
light_amount = 5
var/atom/movable/lighting_overlay/DL = locate(/atom/movable/lighting_overlay) in destination
if(DL)
DLlight_amount = min(10,L.lum_r + L.lum_g + L.lum_b) - 5 //hardcapped so it's not abused by having a ton of flashlights
DLlight_amount = L.lum_r + L.lum_g + L.lum_b
else
DLlight_amount = 5
if(T && destination)
// 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(light_amount <= 1 && DLlight_amount <= 1) // No one can see us in the darkness, right?
else if(light_amount < 0.1 && DLlight_amount < 0.1) // No one can see us in the darkness, right?
return null
// We aren't in darkness, loop for viewers.