mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-30 00:21:11 +01:00
Spark Bulbs (#11241)
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user