mirror of
https://github.com/yogstation13/Yogstation.git
synced 2025-02-26 09:04:50 +00:00
Partial sparks boilerplate reduction (#26081)
* Partial sparks boilerplate reduction - Lots of obects are making `/datum/effect_system/spark_spread`, setting them up, firing them, and then not qdeling them afterwards. - Makes a `do_sparks` global proc that takes the same arguments as `set_up` and then calls `start` and then `qdel` - Switches a bunch of things to use this proc - Makes emitters keep their own spark_spread datum around, since they spark so damn much. - Also makes some things use timers and ports some things to Initialize. * Compilation
This commit is contained in:
@@ -350,9 +350,7 @@
|
||||
else
|
||||
to_chat(user, "<span class='userdanger'>You stick \the [W] into the light socket!</span>")
|
||||
if(has_power() && (W.flags & CONDUCT))
|
||||
var/datum/effect_system/spark_spread/s = new /datum/effect_system/spark_spread
|
||||
s.set_up(3, 1, src)
|
||||
s.start()
|
||||
do_sparks(3, TRUE, src)
|
||||
if (prob(75))
|
||||
electrocute_mob(user, get_area(src), src, rand(0.7,1.0), TRUE)
|
||||
else
|
||||
@@ -523,9 +521,7 @@
|
||||
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()
|
||||
do_sparks(3, TRUE, src)
|
||||
status = LIGHT_BROKEN
|
||||
update()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user