From 3f3683066e9c7bebf653257cfcc7e4a93a9d91d4 Mon Sep 17 00:00:00 2001 From: Joan Lung Date: Sun, 18 Sep 2016 17:49:20 -0400 Subject: [PATCH] Clockcult powerdraining is more likely to cause lights to burn out --- code/game/gamemodes/clock_cult/clock_powerdrain.dm | 2 ++ code/modules/power/lighting.dm | 14 +++++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/code/game/gamemodes/clock_cult/clock_powerdrain.dm b/code/game/gamemodes/clock_cult/clock_powerdrain.dm index 3f2ae58d4ae..7e733959ff4 100644 --- a/code/game/gamemodes/clock_cult/clock_powerdrain.dm +++ b/code/game/gamemodes/clock_cult/clock_powerdrain.dm @@ -38,6 +38,8 @@ playsound(src, 'sound/effects/light_flicker.ogg', 50, 1) flicker(2) . += 50 + else if(prob(50)) + burn_out() /mob/living/silicon/robot/power_drain(clockcult_user) if((!clockcult_user || !is_servant_of_ratvar(src)) && cell && cell.charge) diff --git a/code/modules/power/lighting.dm b/code/modules/power/lighting.dm index 6dd8f092ea1..56adb1ad851 100644 --- a/code/modules/power/lighting.dm +++ b/code/modules/power/lighting.dm @@ -232,11 +232,8 @@ if(status == LIGHT_OK && trigger) explode() else if( prob( min(60, switchcount*switchcount*0.01) ) ) - if(status == LIGHT_OK && trigger) - status = LIGHT_BURNED - icon_state = "[base_state]-burned" - on = 0 - SetLuminosity(0) + if(trigger) + burn_out() else use_power = 2 SetLuminosity(brightness) @@ -254,6 +251,13 @@ removeStaticPower(static_power_used, STATIC_LIGHT) +/obj/machinery/light/proc/burn_out() + if(status == LIGHT_OK) + status = LIGHT_BURNED + icon_state = "[base_state]-burned" + on = 0 + SetLuminosity(0) + // attempt to set the light's on/off status // will not switch on if broken/burned/empty /obj/machinery/light/proc/seton(s)