From c460124da25dab86349e84a883e28467e98ea22e Mon Sep 17 00:00:00 2001 From: TullyBurnalot Date: Mon, 9 Jan 2017 03:25:34 +0000 Subject: [PATCH 1/5] Broken-but-On Light fix --- code/modules/power/apc.dm | 2 ++ code/modules/power/lighting.dm | 3 +++ 2 files changed, 5 insertions(+) diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm index ae931484524..d359744320c 100644 --- a/code/modules/power/apc.dm +++ b/code/modules/power/apc.dm @@ -1367,6 +1367,8 @@ cell.use(20) spawn(0) for(var/obj/machinery/light/L in area) + if(!L.isfunctional()) + continue if(prob(chance)) L.on = 1 L.broken() diff --git a/code/modules/power/lighting.dm b/code/modules/power/lighting.dm index 18a760f5f1d..1c2a0397b62 100644 --- a/code/modules/power/lighting.dm +++ b/code/modules/power/lighting.dm @@ -581,6 +581,9 @@ sleep(1) qdel(src) +/obj/machinery/light/proc/isfunctional() + return status == LIGHT_OK + // the light item // can be tube or bulb subtypes // will fit into empty /obj/machinery/light of the corresponding type From 2d82f940f6d7f1cbb0f6007d8d406d72cca8178c Mon Sep 17 00:00:00 2001 From: TullyBurnalot Date: Sun, 15 Jan 2017 14:20:15 +0000 Subject: [PATCH 2/5] Addresses suggestion by Krausus/Syntax fix --- .../shadowling/special_shadowling_abilities.dm | 2 +- code/modules/power/apc.dm | 1 - code/modules/power/lighting.dm | 17 +++++++---------- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/code/game/gamemodes/shadowling/special_shadowling_abilities.dm b/code/game/gamemodes/shadowling/special_shadowling_abilities.dm index 2c06168499e..2fac272afd5 100644 --- a/code/game/gamemodes/shadowling/special_shadowling_abilities.dm +++ b/code/game/gamemodes/shadowling/special_shadowling_abilities.dm @@ -143,7 +143,7 @@ var/list/possibleShadowlingNames = list("U'ruan", "Y`shej", "Nex", "Hel-uae", "N sleep(90) H.visible_message("[H]'s body begins to violently stretch and contort.", \ - "You begin to rend apart the final barries to godhood.") + "You begin to rend apart the final barriers to godhood.") sleep(40) to_chat(H, "Yes!") diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm index d359744320c..afd677d7d5c 100644 --- a/code/modules/power/apc.dm +++ b/code/modules/power/apc.dm @@ -1370,7 +1370,6 @@ if(!L.isfunctional()) continue if(prob(chance)) - L.on = 1 L.broken() stoplag() diff --git a/code/modules/power/lighting.dm b/code/modules/power/lighting.dm index 1c2a0397b62..5d51ea2eeb9 100644 --- a/code/modules/power/lighting.dm +++ b/code/modules/power/lighting.dm @@ -514,17 +514,14 @@ status = LIGHT_EMPTY update() -/obj/machinery/light/proc/broken(skip_sound_and_sparks = 0) - if(status == LIGHT_EMPTY || status == LIGHT_BROKEN) +/obj/machinery/light/proc/broken() + if(status == LIGHT_EMPTY || status == LIGHT_BROKEN || status == LIGHT_BURNED) return - - if(!skip_sound_and_sparks) - if(status == LIGHT_OK || status == LIGHT_BURNED) - playsound(src.loc, 'sound/effects/Glasshit.ogg', 75, 1) - if(on) - var/datum/effect/system/spark_spread/s = new /datum/effect/system/spark_spread - s.set_up(3, 1, src) - s.start() + if(status == LIGHT_OK) + playsound(src.loc, 'sound/effects/Glasshit.ogg', 75, 1) + var/datum/effect/system/spark_spread/s = new /datum/effect/system/spark_spread + s.set_up(3, 1, src) + s.start() status = LIGHT_BROKEN update() From d2210f24c5b2fb2923e13694ea4ee10b6f0a418b Mon Sep 17 00:00:00 2001 From: TullyBurnalot Date: Sun, 15 Jan 2017 14:25:05 +0000 Subject: [PATCH 3/5] Re-adds skip_sounds_and_sparks Woops, forgot how useful this could be --- code/modules/power/lighting.dm | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/code/modules/power/lighting.dm b/code/modules/power/lighting.dm index 5d51ea2eeb9..c31e8a179f3 100644 --- a/code/modules/power/lighting.dm +++ b/code/modules/power/lighting.dm @@ -514,14 +514,15 @@ status = LIGHT_EMPTY update() -/obj/machinery/light/proc/broken() +/obj/machinery/light/proc/broken(skip_sounds_and_sparks = 0) if(status == LIGHT_EMPTY || status == LIGHT_BROKEN || status == LIGHT_BURNED) return - if(status == LIGHT_OK) - playsound(src.loc, 'sound/effects/Glasshit.ogg', 75, 1) - var/datum/effect/system/spark_spread/s = new /datum/effect/system/spark_spread - s.set_up(3, 1, src) - s.start() + if(!skip_sounds_and_sparks) + if(status == LIGHT_OK) + playsound(src.loc, 'sound/effects/Glasshit.ogg', 75, 1) + var/datum/effect/system/spark_spread/s = new /datum/effect/system/spark_spread + s.set_up(3, 1, src) + s.start() status = LIGHT_BROKEN update() From 86536e3b433d3aca51a2659ac5b03f1fc2d8e757 Mon Sep 17 00:00:00 2001 From: TullyBurnalot Date: Sun, 15 Jan 2017 14:35:00 +0000 Subject: [PATCH 4/5] Removes needless proc --- code/modules/power/apc.dm | 2 -- code/modules/power/lighting.dm | 3 --- 2 files changed, 5 deletions(-) diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm index afd677d7d5c..2fab1812806 100644 --- a/code/modules/power/apc.dm +++ b/code/modules/power/apc.dm @@ -1367,8 +1367,6 @@ cell.use(20) spawn(0) for(var/obj/machinery/light/L in area) - if(!L.isfunctional()) - continue if(prob(chance)) L.broken() stoplag() diff --git a/code/modules/power/lighting.dm b/code/modules/power/lighting.dm index c31e8a179f3..b93b7ca0542 100644 --- a/code/modules/power/lighting.dm +++ b/code/modules/power/lighting.dm @@ -579,9 +579,6 @@ sleep(1) qdel(src) -/obj/machinery/light/proc/isfunctional() - return status == LIGHT_OK - // the light item // can be tube or bulb subtypes // will fit into empty /obj/machinery/light of the corresponding type From f7b729c138f7f116cde3aa141cc4ec4cd85e42f4 Mon Sep 17 00:00:00 2001 From: TullyBurnalot Date: Sun, 15 Jan 2017 17:37:30 +0000 Subject: [PATCH 5/5] ACTUALLY addresses suggestion by Krausus --- code/modules/power/apc.dm | 2 +- code/modules/power/lighting.dm | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm index 2fab1812806..749685971f3 100644 --- a/code/modules/power/apc.dm +++ b/code/modules/power/apc.dm @@ -1368,7 +1368,7 @@ spawn(0) for(var/obj/machinery/light/L in area) if(prob(chance)) - L.broken() + L.broken(0, 1) stoplag() /obj/machinery/power/apc/proc/setsubsystem(val) diff --git a/code/modules/power/lighting.dm b/code/modules/power/lighting.dm index b93b7ca0542..7c702313ae4 100644 --- a/code/modules/power/lighting.dm +++ b/code/modules/power/lighting.dm @@ -514,12 +514,14 @@ status = LIGHT_EMPTY update() -/obj/machinery/light/proc/broken(skip_sounds_and_sparks = 0) - if(status == LIGHT_EMPTY || status == LIGHT_BROKEN || status == LIGHT_BURNED) +/obj/machinery/light/proc/broken(skip_sound_and_sparks = 0, overloaded = 0) + if(status == LIGHT_EMPTY || status == LIGHT_BROKEN) return - if(!skip_sounds_and_sparks) - if(status == LIGHT_OK) + + if(!skip_sound_and_sparks) + if(status == LIGHT_OK || status == LIGHT_BURNED) playsound(src.loc, 'sound/effects/Glasshit.ogg', 75, 1) + if(on || overloaded) var/datum/effect/system/spark_spread/s = new /datum/effect/system/spark_spread s.set_up(3, 1, src) s.start()