/* Modify built-in Doom projectiles.  The main point here is just to assign
 * damage types to them, so the radiation suit and ceramic suit can offer
 * partial protection against slime and fire attacks, respectively.
 *
 * Somewhat unintuitively, we do NOT use the stock "slime" and "fire" types.
 * Those are the terrain damage types, and the suits protect against ALL
 * damage of those types.  We don't want the suits to make the player
 * immortal, just a little tougher, so instead we use custom "slimeball" and
 * "fireball" for attacks.  There's also a "rocket" type, which the ceramic
 * suit protects against slightly.

 * "Plasma" and "electric" damage are currently not modified in any way, but
 * are included for completion.
 *
 * The stock monster extensions also contain some damage types, for hitscan
 * attackers (type "hitscan") and the Arch-Vile, who doesn't use a projectile
 * (type "fireball").
 */


actor Anachrony_DoomImpBall : DoomImpBall replaces DoomImpBall
{
	damagetype fireball
	alpha 0.9
}

actor Anachrony_FatShot : FatShot replaces FatShot
{
	damagetype fireball
	alpha 0.9
}

actor Anachrony_BaronBall : BaronBall replaces BaronBall
{
	damagetype slimeball
	alpha 0.9
}

actor Anachrony_CacodemonBall : CacodemonBall replaces CacodemonBall
{
	damagetype electric
	alpha 0.9
}

actor Anachrony_RevenantTracer : RevenantTracer replaces RevenantTracer
{
	damagetype rocket
	alpha 0.9
}

actor Anachrony_Rocket : Rocket replaces Rocket
{
	damagetype rocket
}

actor Anachrony_ArachnotronPlasma : ArachnotronPlasma replaces ArachnotronPlasma
{
	damagetype plasma
}

actor Anachrony_PlasmaBall : PlasmaBall replaces PlasmaBall
{
	damagetype plasma
}


actor Anachrony_BFGBall : BFGBall replaces BFGBall
{
	WeaveIndexXY 0
	WeaveIndexZ 16
	states {
	Spawn:
		// note that the sprite is twice as big as the radius suggests!
		// also, the offsets put the anchor at about 3/4 down
		BFS1 A 1 bright
		TNT1 AAAA 0 A_SpawnParticle(
			"40 ff 00", SPF_RELATIVE|SPF_FULLBRIGHT, 20, 3, 0,
			frandom(-1.0, 0.0) * speed, frandom(-1.5, 1.5) * radius, frandom(-0.5, 2.5) * radius,
			-0.125 * speed)
		BFS1 A 1 bright
		TNT1 AAAA 0 A_SpawnParticle(
			"40 ff 00", SPF_RELATIVE|SPF_FULLBRIGHT, 20, 3, 0,
			frandom(-1.0, 0.0) * speed, frandom(-1.5, 1.5) * radius, frandom(-0.5, 2.5) * radius,
			-0.125 * speed)
		BFS1 B 1 bright
		TNT1 AAAA 0 A_SpawnParticle(
			"40 ff 00", SPF_RELATIVE|SPF_FULLBRIGHT, 20, 3, 0,
			frandom(-1.0, 0.0) * speed, frandom(-1.5, 1.5) * radius, frandom(-0.5, 2.5) * radius,
			-0.125 * speed)
		BFS1 B 1 bright
		TNT1 AAAA 0 A_SpawnParticle(
			"40 ff 00", SPF_RELATIVE|SPF_FULLBRIGHT, 20, 3, 0,
			frandom(-1.0, 0.0) * speed, frandom(-1.5, 1.5) * radius, frandom(-0.5, 2.5) * radius,
			-0.125 * speed)
		loop
	}
}
actor Anachrony_BFGBall2 : Anachrony_BFGBall
{
	WeaveIndexXY 16
	WeaveIndexZ 0

	states {
	Spawn:
		BFS1 AAAABBBB 1 Bright A_Weave(5, 5, 1.0, 1.0)
		loop
	}
}
