mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-12 03:02:54 +00:00
Tidied up sd_DAL a bit to remove the last of the light-spilling and outside lighting since we have never used it.
Removed some unused variables from APCs (and cleaned up the map so they could be removed) git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4282 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
@@ -44,9 +44,6 @@
|
||||
var/lastused_environ = 0
|
||||
var/lastused_total = 0
|
||||
var/main_status = 0
|
||||
var/light_consumption = 0 //not used
|
||||
var/equip_consumption = 0 //not used
|
||||
var/environ_consumption = 0 //not used
|
||||
var/wiresexposed = 0
|
||||
var/apcwires = 15
|
||||
netnum = -1 // set so that APCs aren't found as powernet nodes
|
||||
|
||||
@@ -318,10 +318,9 @@ Turfs have these additional procs and vars:
|
||||
|
||||
\********************************************************************/
|
||||
|
||||
var/sd_dark_icon = 'icons/effects/ss13_dark_alpha7.dmi' // icon used for darkness
|
||||
var/sd_dark_shades = 7 // number of icon state in sd_dark_icon
|
||||
var/sd_light_layer = 10 // graphics layer for light effect
|
||||
var/sd_light_outside = 0 // how bright it is outside
|
||||
var/const/sd_dark_icon = 'icons/effects/ss13_dark_alpha7.dmi' // icon used for darkness
|
||||
var/const/sd_dark_shades = 7 // number of icon state in sd_dark_icon
|
||||
var/const/sd_light_layer = 10 // graphics layer for light effect
|
||||
var/sd_top_luminosity = 0
|
||||
|
||||
// since we're not using these, comment out all occurances to save CPU
|
||||
@@ -350,6 +349,7 @@ proc
|
||||
for(var/turf/T in sd_light_spill_turfs)
|
||||
T.sd_ApplySpill()
|
||||
*/
|
||||
/*
|
||||
proc/sd_SetDarkIcon(icon, shades)
|
||||
// reset the darkness icon and number of shades of darkness
|
||||
sd_dark_icon = icon
|
||||
@@ -357,7 +357,7 @@ proc/sd_SetDarkIcon(icon, shades)
|
||||
// change existing areas
|
||||
for(var/area/A)
|
||||
if(A.sd_darkimage) A.sd_LightLevel(A.sd_light_level,0)
|
||||
|
||||
*/
|
||||
|
||||
atom/New()
|
||||
..()
|
||||
@@ -380,13 +380,6 @@ atom/proc/sd_ApplyLum(list/V = view(luminosity,src), center = src)
|
||||
/* increase the turf's brightness depending on the
|
||||
brightness and distance of the lightsource */
|
||||
T.sd_lumcount += (luminosity-get_dist(center,T))
|
||||
// update the turf's area
|
||||
|
||||
//
|
||||
//if(T.tag == "sdd")
|
||||
// slog << "\red lc+([luminosity-get_dist(center,T)]) from [center] ([center:x],[center:y])"
|
||||
// slog << "now [T.sd_lumcount]"
|
||||
|
||||
T.sd_LumUpdate()
|
||||
|
||||
atom/proc/sd_StripLum(list/V = view(luminosity,src), center = src)
|
||||
@@ -396,12 +389,6 @@ atom/proc/sd_StripLum(list/V = view(luminosity,src), center = src)
|
||||
brightness and distance of the lightsource */
|
||||
T.sd_lumcount -= (luminosity-get_dist(center,T))
|
||||
T.sd_lumcount = max(0, T.sd_lumcount)
|
||||
|
||||
//if(T.tag == "sdd")
|
||||
// slog << "\red lc-([luminosity-get_dist(center,T)]) from [center] ([center:x],[center:y])"
|
||||
// slog << "now [T.sd_lumcount]"
|
||||
|
||||
|
||||
// update the turf's area
|
||||
T.sd_LumUpdate()
|
||||
|
||||
@@ -410,9 +397,6 @@ atom/proc/sd_ApplyLocalLum(list/affected = view(sd_top_luminosity,src))
|
||||
for(var/atom/A in affected)
|
||||
if(A.luminosity) A.sd_ApplyLum()
|
||||
|
||||
//if(sd_light_outside && (A in sd_light_spill_turfs))
|
||||
// A:sd_ApplySpill()
|
||||
|
||||
atom/proc/sd_StripLocalLum()
|
||||
/* strips all local luminosity
|
||||
|
||||
@@ -426,11 +410,6 @@ atom/proc/sd_StripLocalLum()
|
||||
if(A.luminosity && (get_dist(src,A) <= A.luminosity + turfflag))
|
||||
A.sd_StripLum()
|
||||
affected += A
|
||||
|
||||
//if(sd_light_outside && (A in sd_light_spill_turfs))
|
||||
// A:sd_StripSpill()
|
||||
// affected += A
|
||||
|
||||
return affected
|
||||
|
||||
atom/proc/sd_SetLuminosity(new_luminosity as num)
|
||||
@@ -446,20 +425,13 @@ atom/proc/sd_SetLuminosity(new_luminosity as num)
|
||||
|
||||
|
||||
atom/proc/sd_SetOpacity(new_opacity as num)
|
||||
/* if(opacity != new_opacity)
|
||||
var/list/affected = sd_StripLocalLum()
|
||||
opacity = new_opacity
|
||||
sd_ApplyLocalLum(affected) */
|
||||
if(opacity == (new_opacity ? 1 : 0)) return
|
||||
var
|
||||
list
|
||||
affected = new
|
||||
//spill
|
||||
atom/A
|
||||
turf
|
||||
T
|
||||
ATurf
|
||||
affected = new
|
||||
|
||||
var/list/affected = new
|
||||
var/atom/A
|
||||
var/turf/T
|
||||
var/turf/ATurf
|
||||
|
||||
for(A in range(sd_top_luminosity,src))
|
||||
T = A
|
||||
while(T && !istype(T)) T = T.loc
|
||||
@@ -470,9 +442,6 @@ atom/proc/sd_SetOpacity(new_opacity as num)
|
||||
if(A == T) turfflag = 1
|
||||
if(A.luminosity && get_dist(A,src)<=A.luminosity+turfflag)
|
||||
affected[A] = V
|
||||
//if(sd_light_outside && (A in sd_light_spill_turfs))
|
||||
// if(!spill) spill=new
|
||||
// spill[A] = view(sd_light_outside, T)
|
||||
opacity = new_opacity
|
||||
if(opacity)
|
||||
for(A in affected)
|
||||
@@ -482,33 +451,8 @@ atom/proc/sd_SetOpacity(new_opacity as num)
|
||||
for(T in affected[A]-view(A.luminosity, ATurf))
|
||||
T.sd_lumcount -= (A.luminosity-get_dist(A,T))
|
||||
T.sd_lumcount = max(0, T.sd_lumcount)
|
||||
|
||||
//if(T.tag == "sdd")
|
||||
// slog << "\red lc(1)-([A.luminosity-get_dist(A,T)]) from [A] ([A.x],[A.y])"
|
||||
// slog << "now [T.sd_lumcount]"
|
||||
|
||||
|
||||
T.sd_LumUpdate()
|
||||
/*
|
||||
for(A in spill)
|
||||
if(A.opacity && A!=src) continue
|
||||
ATurf = A
|
||||
while(ATurf && !istype(ATurf)) ATurf = ATurf.loc
|
||||
if(ATurf)
|
||||
//spill[A] -= view(sd_light_outside, A)
|
||||
for(T in (A==src)?spill[A]:(spill[A]-view(sd_light_outside,ATurf)))
|
||||
if(T.loc:sd_outside) continue
|
||||
T.sd_lumcount -= (sd_light_outside-get_dist(A,T))
|
||||
|
||||
//if(T.tag == "sdd")
|
||||
// slog << "\red lc(O)-([sd_light_outside-get_dist(A,T)]) from [A] ([A:x],[A:y])"
|
||||
// slog << "now [T.sd_lumcount]"
|
||||
|
||||
|
||||
T.sd_LumUpdate()
|
||||
*/
|
||||
|
||||
// end new_opacity = 1 block
|
||||
|
||||
else
|
||||
for(A in affected)
|
||||
@@ -517,29 +461,7 @@ atom/proc/sd_SetOpacity(new_opacity as num)
|
||||
if(ATurf)
|
||||
for(T in view(A.luminosity, ATurf) - affected[A])
|
||||
T.sd_lumcount += (A.luminosity-get_dist(A,T))
|
||||
//if(T.tag == "sdd")
|
||||
// slog << "\red lc(1)+([A.luminosity-get_dist(A,T)]) from [A] ([A.x],[A.y])"
|
||||
// slog << "now [T.sd_lumcount]"
|
||||
|
||||
T.sd_LumUpdate()
|
||||
/*
|
||||
for(A in spill)
|
||||
if(A.opacity) continue
|
||||
ATurf = A
|
||||
while(ATurf && !istype(ATurf)) ATurf = ATurf.loc
|
||||
if(ATurf)
|
||||
for(T in (A==src)?spill[A]:(view(sd_light_outside, ATurf)-spill[A]))
|
||||
if(T.loc:sd_outside) continue
|
||||
T.sd_lumcount += (sd_light_outside-get_dist(A,T))
|
||||
//if(T.tag == "sdd")
|
||||
// slog << "\red lc(O)+([sd_light_outside-get_dist(A,T)]) from [A] ([A:x],[A:y])"
|
||||
// slog << "now [T.sd_lumcount]"
|
||||
|
||||
T.sd_LumUpdate()
|
||||
|
||||
*/
|
||||
// end new_opacity = 0 block
|
||||
|
||||
|
||||
///
|
||||
|
||||
@@ -558,7 +480,6 @@ atom/proc/sd_NewOpacity(var/new_opacity)
|
||||
///
|
||||
|
||||
turf
|
||||
var/sd_light_spill = 0
|
||||
var/tmp/sd_lumcount = 0 // the brightness of the turf
|
||||
|
||||
|
||||
@@ -567,9 +488,6 @@ turf/proc/sd_LumReset()
|
||||
re-apply local lum*/
|
||||
var/list/affected = sd_StripLocalLum()
|
||||
sd_lumcount = 0
|
||||
//if(src.tag == "sdd")
|
||||
// slog << "\red lc(LR)=0"
|
||||
|
||||
sd_ApplyLocalLum(affected)
|
||||
|
||||
turf/proc/sd_LumUpdate()
|
||||
@@ -586,75 +504,17 @@ turf/proc/sd_LumUpdate()
|
||||
var/area/A = locate(ltag) // find an appropriate area
|
||||
if(!A)
|
||||
A = new Loc.type() // create area if it wasn't found
|
||||
A.tag = ltag
|
||||
|
||||
// replicate vars
|
||||
for(var/V in Loc.vars-"contents")
|
||||
if(issaved(Loc.vars[V])) A.vars[V] = Loc.vars[V]
|
||||
|
||||
|
||||
|
||||
A.tag = ltag
|
||||
/*
|
||||
if(A.sd_outside)
|
||||
if(!(A in sd_outside_areas))
|
||||
sd_outside_areas += A
|
||||
A.sd_light_level = light
|
||||
A.sd_LightLevel(light + sd_light_outside,0)
|
||||
else
|
||||
*/
|
||||
A.sd_LightLevel(light)
|
||||
// endelse
|
||||
|
||||
A.contents += src // move the turf into the area
|
||||
/*
|
||||
turf/proc/sd_ApplySpill()
|
||||
if(opacity) return
|
||||
var/oldlum = luminosity
|
||||
luminosity = sd_light_outside
|
||||
// loop through all the turfs in V
|
||||
for(var/turf/T in view(sd_light_outside,src))
|
||||
var/area/A = T.loc
|
||||
if(!istype(A) || A.sd_outside) continue
|
||||
/* increase the turf's brightness depending on the
|
||||
brightness and distance of the lightsource */
|
||||
T.sd_lumcount += (sd_light_outside-get_dist(src,T))
|
||||
//if(T.tag == "sdd")
|
||||
// slog << "\red lc(AS)+([sd_light_outside-get_dist(src,T)]) from [src] ([src:x],[src:y])"
|
||||
// slog << "now [T.sd_lumcount]"
|
||||
|
||||
// update the turf's area
|
||||
T.sd_LumUpdate()
|
||||
luminosity = oldlum
|
||||
|
||||
turf/proc/sd_StripSpill()
|
||||
if(opacity) return
|
||||
var/oldlum = luminosity
|
||||
luminosity = sd_light_outside
|
||||
// loop through all the turfs in V
|
||||
for(var/turf/T in view(sd_light_outside,src))
|
||||
var/area/A = T.loc
|
||||
if(!istype(A) || A.sd_outside) continue
|
||||
/* increase the turf's brightness depending on the
|
||||
brightness and distance of the lightsource */
|
||||
T.sd_lumcount -= (sd_light_outside-get_dist(src,T))
|
||||
//if(T.tag == "sdd")
|
||||
// slog << "\red lc(AS)-([sd_light_outside-get_dist(src,T)]) from [src] ([src:x],[src:y])"
|
||||
// slog << "now [T.sd_lumcount]"
|
||||
|
||||
// update the turf's area
|
||||
T.sd_LumUpdate()
|
||||
luminosity = oldlum
|
||||
|
||||
turf/New()
|
||||
..()
|
||||
if(sd_light_spill)
|
||||
sd_light_spill_turfs += src
|
||||
*/
|
||||
atom/movable/Move() // when something moves
|
||||
|
||||
//world << "[src]: sd_Move: ([loc.x],[loc.y])"
|
||||
|
||||
var/turf/oldloc = loc // remember for range calculations
|
||||
// list turfs in view and luminosity range of old loc
|
||||
var/list/oldview
|
||||
@@ -666,28 +526,16 @@ atom/movable/Move() // when something moves
|
||||
|
||||
. = ..()
|
||||
|
||||
//world << "[src]: sd_Move: .=[.]"
|
||||
|
||||
|
||||
if(.&&(luminosity>0)) // if the atom actually moved
|
||||
//world << "[src](luminosity) moved"
|
||||
if(istype(oldloc))
|
||||
sd_StripLum(oldview,oldloc)
|
||||
//oldloc.sd_lumcount++ // correct "off by 1" error in oldloc - no longer needed it seems (Erro)
|
||||
sd_ApplyLum()
|
||||
|
||||
area
|
||||
/* Turn this flag off to prevent sd_DynamicAreaLighting from affecting
|
||||
this area */
|
||||
var/sd_lighting = 1
|
||||
|
||||
/* This var determines if an area is outside (affected by sunlight) or
|
||||
not. */
|
||||
var/sd_outside = 0
|
||||
|
||||
var/sd_light_level = 0 // the current light level of the area
|
||||
|
||||
var/sd_darkimage // tracks the darkness image of the area for easy removal
|
||||
var/sd_lighting = 1 //Turn this flag off to prevent sd_DynamicAreaLighting from affecting this area
|
||||
var/sd_light_level = 0 //This is the current light level of the area
|
||||
var/sd_darkimage //This tracks the darkness image of the area for easy removal
|
||||
|
||||
|
||||
area/proc/sd_LightLevel(slevel = sd_light_level as num, keep = 1)
|
||||
@@ -706,20 +554,6 @@ area/proc/sd_LightLevel(slevel = sd_light_level as num, keep = 1)
|
||||
sd_darkimage = image(sd_dark_icon,,num2text(slevel),sd_light_layer)
|
||||
overlays += sd_darkimage
|
||||
|
||||
/*
|
||||
area/proc/New()
|
||||
..()
|
||||
if(!tag) tag = "[type]"
|
||||
spawn(1) // wait a tick
|
||||
if(sd_lighting)
|
||||
// see if this area was created by the library
|
||||
if(!findtext(tag, "sd_L"))
|
||||
/* show the dark overlay so areas outside of luminous regions
|
||||
won't be bright as day when they should be dark. */
|
||||
sd_LightLevel()
|
||||
if(sd_outside)
|
||||
sd_outside_areas += src
|
||||
*/
|
||||
area/proc/sd_New(sd_created)
|
||||
|
||||
if(!tag) tag = "[type]"
|
||||
@@ -730,8 +564,6 @@ area/proc/sd_New(sd_created)
|
||||
/* show the dark overlay so areas outside of luminous regions
|
||||
won't be bright as day when they should be dark. */
|
||||
sd_LightLevel()
|
||||
//if(sd_outside)
|
||||
// sd_outside_areas += src
|
||||
|
||||
area/Del()
|
||||
..()
|
||||
@@ -762,4 +594,3 @@ mob/sd_ApplyLocalLum(list/affected)
|
||||
else
|
||||
affected = view(sd_top_luminosity,src)
|
||||
. = ..(affected)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user