- Randomized light brightness for lights at round start is now no longer tied to individual lights, but to the area they start in, meaning some areas might start out darker on some rounds. Most have far too many lights tho, so they don't affect anything.

- 10 percent of lights with tubes will now start out broken and 25 percent of lights with bulbs will now start out broken.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@2261 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
baloh.matevz
2011-09-24 14:14:40 +00:00
parent 92dbb05fd5
commit bd73bf33d3
3 changed files with 27 additions and 14 deletions

View File

@@ -74,13 +74,22 @@
/obj/machinery/light/New()
..()
switch(fitting)
if("tube")
brightness = rand(6,9)
if("bulb")
brightness = 3
spawn(1)
update()
spawn(2)
switch(fitting)
if("tube")
if(src.loc && src.loc.loc && isarea(src.loc.loc))
var/area/A = src.loc.loc
brightness = A.area_lights_luminosity
else
brightness = rand(6,9)
if(prob(10))
broken(1)
if("bulb")
brightness = 3
if(prob(25))
broken(1)
spawn(1)
update()
/obj/machinery/light/Del()
var/area/A = get_area(src)
@@ -307,16 +316,17 @@
// break the light and make sparks if was on
/obj/machinery/light/proc/broken()
/obj/machinery/light/proc/broken(var/skip_sound_and_sparks = 0)
if(status == LIGHT_EMPTY)
return
if(status == LIGHT_OK || status == LIGHT_BURNED)
playsound(src.loc, 'Glasshit.ogg', 75, 1)
if(on)
var/datum/effects/system/spark_spread/s = new /datum/effects/system/spark_spread
s.set_up(3, 1, src)
s.start()
if(!skip_sound_and_sparks)
if(status == LIGHT_OK || status == LIGHT_BURNED)
playsound(src.loc, 'Glasshit.ogg', 75, 1)
if(on)
var/datum/effects/system/spark_spread/s = new /datum/effects/system/spark_spread
s.set_up(3, 1, src)
s.start()
status = LIGHT_BROKEN
update()