mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 18:32:03 +00:00
- 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:
@@ -28,6 +28,8 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
|
||||
mouse_opacity = 0
|
||||
var/lightswitch = 1
|
||||
|
||||
var/area_lights_luminosity = 9 //This gets assigned at area creation. It is used to determine how bright the lights in an area should be. At the time of writing the value that it gets assigned is rand(6,9) - only used for light tubes
|
||||
|
||||
var/eject = null
|
||||
|
||||
var/requires_power = 1
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
sd_lighting = 0 // *DAL*
|
||||
else
|
||||
luminosity = 0
|
||||
area_lights_luminosity = rand(6,9)
|
||||
//sd_SetLuminosity(0) // *DAL*
|
||||
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user