Refactors Spark Spread Activation

This commit is contained in:
Fox McCloud
2018-10-17 14:31:07 -04:00
parent 5a53a2344c
commit 3825b4e1d5
77 changed files with 135 additions and 347 deletions
@@ -8,8 +8,9 @@ would spawn and follow the beaker, even if it is carried or thrown.
/obj/effect/particle_effect
name = "particle effect"
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
unacidable = 1//So effects are not targeted by alien acid.
unacidable = TRUE //So effects are not targeted by alien acid.
pass_flags = PASSTABLE | PASSGRILLE
anchored = TRUE
/obj/effect/particle_effect/New()
..()
@@ -28,6 +29,7 @@ would spawn and follow the beaker, even if it is carried or thrown.
var/atom/holder
var/effect_type
var/total_effects = 0
var/autocleanup = FALSE //will delete itself after use
/datum/effect_system/Destroy()
holder = null
@@ -71,3 +73,5 @@ would spawn and follow the beaker, even if it is carried or thrown.
/datum/effect_system/proc/decrement_total_effect()
total_effects--
if(autocleanup && total_effects <= 0)
qdel(src)
@@ -155,9 +155,7 @@
/datum/effect_system/reagents_explosion/start()
if(amount <= 2)
var/datum/effect_system/spark_spread/s = new /datum/effect_system/spark_spread
s.set_up(2, 1, location)
s.start()
do_sparks(2, 1, location)
for(var/mob/M in viewers(5, location))
to_chat(M, "<span class='warning'>The solution violently explodes.</span>")
@@ -5,15 +5,26 @@
// 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.autocleanup = TRUE
sparks.start()
/obj/effect/particle_effect/sparks
name = "sparks"
desc = "it's a spark what do you need to know?"
icon_state = "sparks"
anchored = 1
anchored = TRUE
var/hotspottemp = 1000
/obj/effect/particle_effect/sparks/New()
..()
flick("sparks", src) // replay the animation
playsound(loc, "sparks", 100, 1)
var/turf/T = loc
if(isturf(T))