/*

decorate (modified) and sprites: tormentor667, solarsnowfall (from realm667)

*/

actor yellowsparkspawner : effect
{
	states
	{
	spawn:
		TNT1 A 0
		TNT1 A 0 A_PlaySound("World/Spark")
		TNT1 A 0 A_Jump(256, 1, 2, 3, 4, 5, 6)
		TNT1 A 1 A_SpawnItemEx("SparkFlare_Y1", 0, 0, 0, 0, 0, 0, 0, 128)
		Goto SpawnSparks
		TNT1 A 1 A_SpawnItemEx("SparkFlare_Y2", 0, 0, 0, 0, 0, 0, 0, 128)
		Goto SpawnSparks
		TNT1 A 1 A_SpawnItemEx("SparkFlare_Y3", 0, 0, 0, 0, 0, 0, 0, 128)
		Goto SpawnSparks
		TNT1 A 1 A_SpawnItemEx("SparkFlare_Y4", 0, 0, 0, 0, 0, 0, 0, 128)
		Goto SpawnSparks
		TNT1 A 1 A_SpawnItemEx("SparkFlare_Y5", 0, 0, 0, 0, 0, 0, 0, 128)
		Goto SpawnSparks
		TNT1 A 1 A_SpawnItemEx("SparkFlare_Y6", 0, 0, 0, 0, 0, 0, 0, 128)
		Goto SpawnSparks
	spawnsparks:
		TNT1 AA 0 A_CustomMissile("Spark_Y1", 0, 0, Random(0, 360), 2, Random(67, 113))
		TNT1 AA 0 A_CustomMissile("Spark_Y2", 0, 0, Random(0, 360), 2, Random(67, 113))
		TNT1 AA 0 A_CustomMissile("Spark_Y3", 0, 0, Random(0, 360), 2, Random(67, 113))
		TNT1 AA 0 A_CustomMissile("Spark_Y4", 0, 0, Random(0, 360), 2, Random(67, 113))
		TNT1 AA 0 A_CustomMissile("Spark_Y5", 0, 0, Random(0, 360), 2, Random(67, 113))
		TNT1 AA 0 A_CustomMissile("Spark_Y6", 0, 0, Random(0, 360), 2, Random(67, 113))
		TNT1 AA 0 A_CustomMissile("Spark_Y7", 0, 0, Random(0, 360), 2, Random(67, 113))
		TNT1 AA 0 A_CustomMissile("Spark_Y8", 0, 0, Random(0, 360), 2, Random(67, 113))
		TNT1 AA 0 A_CustomMissile("Spark_Y9", 0, 0, Random(0, 360), 2, Random(67, 113))
		TNT1 AA 0 A_CustomMissile("Spark_Y10", 0, 0, Random(0, 360), 2, Random(67, 113))
		TNT1 AA 0 A_CustomMissile("Spark_Y11", 0, 0, Random(0, 360), 2, Random(67, 113))
		TNT1 AA 0 A_CustomMissile("Spark_Y12", 0, 0, Random(0, 360), 2, Random(67, 113))
		TNT1 AA 0 A_CustomMissile("Spark_Y13", 0, 0, Random(0, 360), 2, Random(67, 113))
		TNT1 AA 0 A_CustomMissile("Spark_Y14", 0, 0, Random(0, 360), 2, Random(67, 113))
		TNT1 AA 0 A_CustomMissile("Spark_Y15", 0, 0, Random(0, 360), 2, Random(67, 113))
		TNT1 AA 0 A_CustomMissile("Spark_Y16", 0, 0, Random(0, 360), 2, Random(67, 113))
		TNT1 A 1
		stop
	}
}

Actor SparkFlare_Y1
{
	Height 0
	Radius 0
	Mass 0
	+Missile
	+NoBlockMap
	+NoClip
	+NoGravity
	+NoInteraction
	+clientsideonly
	RenderStyle Add
	Scale 0.25
	States
	{
	Spawn:
		SPKY A 1 Bright A_FadeOut(0.1)
		Loop
	}
}

Actor SparkFlare_Y2 : SparkFlare_Y1 { States { Spawn: SPKY B 1 Bright A_FadeOut (0.1) Loop } }
Actor SparkFlare_Y3 : SparkFlare_Y1 { States { Spawn: SPKY C 1 Bright A_FadeOut (0.1) Loop } }
Actor SparkFlare_Y4 : SparkFlare_Y1 { States { Spawn: SPKY D 1 Bright A_FadeOut (0.1) Loop } }
Actor SparkFlare_Y5 : SparkFlare_Y1 { States { Spawn: SPKY E 1 Bright A_FadeOut (0.1) Loop } }
Actor SparkFlare_Y6 : SparkFlare_Y1 { States { Spawn: SPKY F 1 Bright A_FadeOut (0.1) Loop } }

Actor Spark_Y1
{
	Height 1
	Radius 2
	Mass 0
	Speed 0.25
	+Missile
	+NoBlockMap
	+LowGravity
	+clientsideonly
	RenderStyle Add
	Scale 0.025
    States
	{
	Spawn:
		SPKY E 1 bright
		Loop
	Death:
		SPKY E 1 bright A_FadeOut (0.1)
		Loop
	}
}

Actor Spark_Y2 : Spark_Y1  { Speed 0.5  }
Actor Spark_Y3 : Spark_Y1  { Speed 0.75 }
Actor Spark_Y4 : Spark_Y1  { Speed 1.0  }
Actor Spark_Y5 : Spark_Y1  { Speed 1.25 }
Actor Spark_Y6 : Spark_Y1  { Speed 1.5  }
Actor Spark_Y7 : Spark_Y1  { Speed 1.75 }
Actor Spark_Y8 : Spark_Y1  { Speed 2.0  }
Actor Spark_Y9 : Spark_Y1  { Speed 2.25 }
Actor Spark_Y10 : Spark_Y1 { Speed 2.5  }
Actor Spark_Y11 : Spark_Y1 { Speed 2.75 }
Actor Spark_Y12 : Spark_Y1 { Speed 3.0  }
Actor Spark_Y13 : Spark_Y1 { Speed 3.25 }
Actor Spark_Y14 : Spark_Y1 { Speed 3.5  }
Actor Spark_Y15 : Spark_Y1 { Speed 3.75 }
Actor Spark_Y16 : Spark_Y1 { Speed 4.0  }