Lighting code complete.

This commit is contained in:
Aryn
2014-02-24 03:35:07 -07:00
committed by ZomgPonies
parent 52e2a3d1c6
commit 4b78bd469b
3 changed files with 10 additions and 10 deletions
@@ -71,7 +71,7 @@ var/list/lit_z_levels = list(1,5)
if(x > 0 && y > 0)
turfs_updated++
if((turfs_updated % 5000) == 0)
if((turfs_updated % (total_turfs>>2)) == 0)
sleep(1)
world << "<font color=red>Progress: [round((turfs_updated/total_turfs)*100, 0.01)]% ([turfs_updated]/[total_turfs])"
+5 -5
View File
@@ -100,21 +100,21 @@ atom/movable/Move()
if(lighting_ready()) lighting_controller.FlushIconUpdates()
atom/proc/SetLight(intensity, radius)
if(lights_verbose) world << "SetLight([intensity],[radius])"
//if(lights_verbose) world << "SetLight([intensity],[radius])"
if(!intensity)
if(!light || !light.intensity)
if(lights_verbose) world << "Still off."
//if(lights_verbose) world << "Still off."
return
if(lights_verbose) world << "Shut off light with [light.lit_turfs.len] turfs lit."
//if(lights_verbose) world << "Shut off light with [light.lit_turfs.len] turfs lit."
light.Off()
light.intensity = 0
if(lighting_ready()) lighting_controller.FlushIconUpdates()
return
if(!light)
if(lights_verbose) world << "New light."
//if(lights_verbose) world << "New light."
light = new(src)
if(light.intensity == intensity)
if(lights_verbose) world << "Same intensity."
//if(lights_verbose) world << "Same intensity."
return
light.radius = min(radius,15)
light.intensity = intensity
+4 -4
View File
@@ -31,18 +31,18 @@ light/New(atom/atom)
src.atom = atom
light/proc/Reset()
if(atom.lights_verbose) world << "light.Reset()"
//if(atom.lights_verbose) world << "light.Reset()"
Off()
if(intensity > 0)
if(atom.lights_verbose) world << "Restoring light."
//if(atom.lights_verbose) world << "Restoring light."
for(var/turf/T in view(get_turf(atom),radius+1))
if(!T.is_outside)
T.AddLight(src)
lit_turfs.Add(T)
if(atom.lights_verbose) world << "[lit_turfs.len] turfs added."
//if(atom.lights_verbose) world << "[lit_turfs.len] turfs added."
light/proc/Off()
if(atom.lights_verbose) world << "light.Off()"
//if(atom.lights_verbose) world << "light.Off()"
for(var/turf/T in lit_turfs)
T.RemoveLight(src)
lit_turfs = list()