Files
Aurora.3/code/modules/effects/sparks/spawner.dm
T
Lohikar 73c29bd5a7 Miscellaneous Fixes (#1868)
changes:

Engineering now actually gets engineering-type alert consoles instead of the non-functional base type.
Lighting is no longer broken by shuttles.
The ERT shuttle autoannouncer should no longer cause lighting runtimes.
Fixed some bad newlines in some character setup help texts.
Custom loadout tweaks now properly write to SQL.
Custom loadout is now saved as JSON.
Players are now shown a notice when the server was unable to load their custom loadout.
Drowsyness is now clamped to zero.
Added some new tips to the example.
Tweaked some tips' grammar.
Removed some tips that do not apply to our code base.
Probably fixes embraced vampire thralls not getting vampire verbs.
Fixes #1844.
Fixes #1835.
Probably fixes #1687.
Probably fixes #1824.
Fixes #1839
2017-03-05 15:14:28 +02:00

52 lines
1.2 KiB
Plaintext

// -- Spark Datum --
/datum/effect_system/sparks
var/amount = 1 // How many sparks should we make
var/list/spread = list() // Which directions we should create sparks.
// Using the spark procs is preferred to directly instancing this.
/datum/effect_system/sparks/New(var/atom/movable/loc, var/start_immediately = TRUE, var/amt = 1, var/list/spread_dirs = list())
if(QDELETED(loc))
return
set_loc(loc)
if (amt)
amount = amt
if (spread_dirs)
spread = spread_dirs
else
spread = list()
..(start_immediately)
/datum/effect_system/sparks/queue()
if (holder)
location = get_turf(holder)
return ..()
/datum/effect_system/sparks/process()
. = ..()
var/total_sparks = 1
if (location)
var/obj/visual_effect/sparks/S = getFromPool(/obj/visual_effect/sparks, location, src, 0) //Trigger one on the tile it's on
S.start()
playsound(location, "sparks", 100, 1)
effects_visuals += S // Queue it.
while (total_sparks <= src.amount)
playsound(location, "sparks", 100, 1)
var/direction = 0
if (!src.spread.len)
direction = 0
else
direction = pick(src.spread)
S = getFromPool(/obj/visual_effect/sparks, location, src)
S.start(direction)
effects_visuals += S
total_sparks++