Spark Bulbs (#11241)

This commit is contained in:
Geeves
2021-03-01 16:41:41 +01:00
committed by GitHub
parent adec66804b
commit d67f81c9ff
2 changed files with 15 additions and 0 deletions
+9
View File
@@ -42,6 +42,8 @@
var/emergency_mode = FALSE // if true, the light is in emergency mode.
var/no_emergency = FALSE // if true, this light cannot enter emergency mode.
var/next_spark = 0
var/bulb_is_noisy = TRUE
var/previous_stat
@@ -222,12 +224,19 @@
active_power_usage = ((light_range * light_power) * 10)
/obj/machinery/light/proc/broken_sparks()
if(world.time > next_spark && has_power())
spark(src, 3, alldirs)
next_spark = world.time + 1 MINUTE + (rand(-15, 15) SECONDS)
// ehh
/obj/machinery/light/machinery_process()
if (cell && cell.charge != cell.maxcharge && has_power())
cell.charge = min(cell.maxcharge, cell.charge + 0.2)
if (emergency_mode && !use_emergency_power(LIGHT_EMERGENCY_POWER_USE))
update(FALSE)
if(status == LIGHT_BROKEN)
broken_sparks()
/obj/machinery/light/proc/has_emergency_power(pwr = LIGHT_EMERGENCY_POWER_USE)
if (no_emergency | !cell)