mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-21 12:04:48 +01:00
Lighting code complete.
This commit is contained in:
@@ -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])"
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user