mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-23 05:00:55 +01: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:
@@ -23,7 +23,7 @@ would spawn and follow the beaker, even if it is carried or thrown.
|
||||
|
||||
/datum/effect_system
|
||||
var/number = 3
|
||||
var/cardinals = 0
|
||||
var/cardinals = FALSE
|
||||
var/turf/location
|
||||
var/atom/holder
|
||||
var/effect_type
|
||||
@@ -34,7 +34,7 @@ would spawn and follow the beaker, even if it is carried or thrown.
|
||||
location = null
|
||||
return ..()
|
||||
|
||||
/datum/effect_system/proc/set_up(n = 3, c = 0, loca)
|
||||
/datum/effect_system/proc/set_up(n = 3, c = FALSE, loca)
|
||||
if(n > 10)
|
||||
n = 10
|
||||
number = n
|
||||
|
||||
@@ -5,6 +5,17 @@
|
||||
// will always spawn at the items location.
|
||||
/////////////////////////////////////////////
|
||||
|
||||
/proc/do_sparks(n, c, source)
|
||||
// n - number of sparks
|
||||
// c - cardinals, bool, do the sparks only move in cardinal directions?
|
||||
// source - source of the sparks.
|
||||
|
||||
var/datum/effect_system/spark_spread/sparks = new
|
||||
sparks.set_up(n, c, source)
|
||||
sparks.start()
|
||||
qdel(sparks)
|
||||
|
||||
|
||||
/obj/effect/particle_effect/sparks
|
||||
name = "sparks"
|
||||
icon_state = "sparks"
|
||||
|
||||
Reference in New Issue
Block a user