
// ------------------------------------------------------------
//   Misc. special effects
// ------------------------------------------------------------

ACTOR BulletPuffBig
{
	damagetype "SmallArms3"
	alpha 0.7
	+nointeraction
	+forcexybillboard
	height 0
	radius 0
	States
	{
	Spawn:
		PUFF B 0
		PUFF B 0 A_PlaySound ("misc/bullethit")
		PUFF B 0 A_FaceTarget
		PUFF CCCCCCCC 0 A_SpawnItemEx ("WallChunk", random(-1,1), random(-1,1), random(-1,1), random(-1.4,1.4),random(-1.4,1.4), random(4,12),random(-60,60),160)
		Goto Death
	Death:
		PUFF C 4 ThrustThingZ (0, random(1,2), 0, 1)
		PUFF CCCDDDD 3 A_FadeOut (0.1)
		Stop
	}
}
ACTOR BulletPuffMedium : BulletPuffBig
{
	damagetype "SmallArms2"
	States
	{
	Spawn:
		PUFF B 0
		PUFF B 0 A_PlaySound ("misc/bullethit")
		PUFF CCCCC 0 A_SpawnItemEx ("WallChunk", random(-1,1), random(-1,1), random(-1,1), random(-1.4,1.4),random(-1.4,1.4), random(4,8),random(0,360),160)
		Goto Death
	}
}
ACTOR BulletPuffSmall : BulletPuffBig
{
	damagetype "SmallArms1"
	scale 0.6
	States
	{
	Spawn:
		PUFF B 0
		PUFF B 0 A_Jump (180, 3)
		PUFF B 0 A_PlaySound ("misc/bullethit")
		PUFF CC 0 A_SpawnItemEx ("TinyWallChunk", random(-1,1), random(-1,1), random(-1,1), random(-1,1),random(-1,1), random(3,8),random(0,360),160)
		Goto Death
	}
}
ACTOR FragPuff : BulletPuffBig
{
	damagetype "SmallArms0"
	scale 0.8
	states
	{
	Spawn:
		PUFF C 0
		Goto Death
	}
}
ACTOR HDSmoke
{
	renderstyle add
	alpha 0.4
	seesound ""
	+nointeraction
	+forcexybillboard
	radius 1
	height 1
	states
	{
	Spawn:
		TNT1 A 0
		TNT1 A 1 ThrustThing (random(0,7)*32, random(0, 32), 0, 0)
		TNT1 A 0 A_Stop
		SMOK A 4 ThrustThingZ (0, random(3,6), 0, 1)
		TNT1 A 0 A_SetTranslucent (0.4, 0)
		SMOK B 4 ThrustThingZ (0, random(1,3), 0, 1)
		SMOK CC 6 A_FadeOut (0.05)
		goto Death
	Death:
		SMOK D 6 A_FadeOut (0.05)
		loop
	}
}
ACTOR WallChunk
{
	Scale 0.16
	+noteleport
	+missile
	+bounceonactors
	+doombounce
	+forcexybillboard
	bouncefactor 0.2
	height 1
	radius 1
	States
	{
	Spawn:
		TNT1 A 0
		TNT1 A 0 A_GiveInventory ("Timer", random(1,4))
	See:
		TNT1 A 0 A_JumpIfInventory("Timer",4,"See4")
		TNT1 A 0 A_JumpIfInventory("Timer",3,"See3")
		TNT1 A 0 A_JumpIfInventory("Timer",2,"See2")
		TNT1 A 0 A_PlaySound ("misc/wallchunks")
	See1:
		DUST A 1
		loop
	See2:
		DUST B 1
		loop
	See3:
		DUST C 1
		loop
	See4:
		DUST D 1
		loop
	Death:
		TNT1 A 0 A_ChangeFlag ("missile",0)
		TNT1 A 0 A_ChangeFlag ("doombounce",0)
		TNT1 A 0 A_JumpIfInventory("Timer",4,"Death4")
		TNT1 A 0 A_JumpIfInventory("Timer",3,"Death3")
		TNT1 A 0 A_JumpIfInventory("Timer",2,"Death2")
	Death1:
		DUST A 100
		Stop
	Death2:
		DUST B 100
		Stop
	Death3:
		DUST C 100
		Stop
	Death4:
		DUST D 100
		Stop
	}
}
ACTOR TinyWallChunk : WallChunk
{
	Scale 0.12
}
ACTOR BigWallChunk : WallChunk
{
	Scale 0.3
}
ACTOR HugeWallChunk : WallChunk
{
	Scale 0.4
}

ACTOR BloodSplat : Blood replaces Blood
{
	+nogravity
	+noclip
	+forcexybillboard
	Alpha 0.3
	Scale 0.4
	height 1
	radius 1
	States
	{
	spawn:
		TNT1 A 0
		TNT1 A 0 A_PlaySound ("misc/bulletflesh")
	death1:
		TNT1 AA 0 A_SpawnItemEx ("BloodChunk", 0,0,10,random(-3,3),random(-3,3),random(-3,4), 0,161)
		stop
	death2:
		TNT1 A 0 A_SpawnItemEx ("BloodChunk2", 0,0,10,random(-4,4),random(-4,4),random(-4,6), 0,161)
		stop
	noblood:
		TNT1 A 0
		stop
	}
}
ACTOR BloodChunk
{
	+noteleport
	+noclip
	+forcexybillboard
	Scale 0.2
	Height 1
	Radius 1
	States
	{
	Spawn:
		TNT1 A 0
		TNT1 A 0 A_Jump (256, "Death1", "Death1", "Death2", "Death3", "Death4")
	Death1:
		BLOD AAAA 1 A_SpawnItemEx ("BloodTrail2", 0,0,0, 0,0,0, 0,161)
		stop
		TNT1 A 0 A_Jump (64, "Death")
		loop
	Death2:
		BLOD BBBB 1 A_SpawnItemEx ("BloodTrail", 0,0,0, 0,0,0, 0,161)
		stop
		TNT1 A 0 A_Jump (64, "Death")
		loop
	Death3:
		BLOD CCCC 1 A_SpawnItemEx ("BloodTrail", 0,0,0, 0,0,0, 0,161)
		stop
		TNT1 A 0 A_Jump (64, "Death")
		loop
	Death4:
		BLOD DDDD 1 A_SpawnItemEx ("BloodTrail2", 0,0,0, 0,0,0, 0,161)
		stop
		TNT1 A 0 A_Jump (64, "Death")
		loop
	Death:
		TNT1 A 0
		stop
	}
}
ACTOR BloodChunk2 : BloodChunk
{
	scale 0.3
}
ACTOR BloodTrail
{
	alpha 0.3
	scale 0.2
	+noteleport
	+noclip
	states
	{
	spawn:
		BLOD A 0
		BLOD A 0 A_SetGravity (0.02)
	fade:
		BLOD A 4 A_FadeOut (0.06) 
		loop
	}
}
ACTOR BloodTrail2 : BloodTrail
{
	alpha 0.6
	scale 0.3
}
ACTOR MegaBloodSplatter
{
	height 1
	radius 1
	+nogravity
	+noclip
	+noteleport
	states
	{
	spawn:
		TNT1 A 0
		TNT1 AAAAAAAAAAAAAAAAAAAA 0 A_SpawnItemEx ("BloodChunk", random(-2,2),random(-2,2),random(-2,2), random(-4,4),random(-4,4),random(2,12),random(0,360),161,32)
		stop
	noblood:
		BAL1 A 0
		stop
	}
}

ACTOR HDExplosion
{
	+missile
	+nointeraction
	+noclip
	+forcexybillboard
	Height 0
	Radius 0
	Speed 1
	Alpha 0.9
	RenderStyle Add
	DamageType "Thermal"
	States
	{
	Spawn:
		MISX A 0
		MISX A 0 A_PlaySound ("world/explode")
		Goto Death
	Death:
		MISX AAAAA 0 A_SpawnItemEx("HDSmoke", random(-24,24),random(-24,24),random(0,12),velx,vely,velz,0,160)
		MISX AA 0 BRIGHT A_Explode (random(24,32), random(128,192))
		MISL BCDD 2 BRIGHT A_FadeOut (0.2)
		Stop
	}
}


// ------------------------------------------------------------
//   Distance sound actors
// ------------------------------------------------------------

actor DistantGun : IdleDummy
{
	states
	{
	spawn:
		TNT1 A 1
		TNT1 A 0 A_PlaySoundEx("*death","Body",0,1)
		stop
	}
}
actor DistantRifle : DistantGun
{
	states
	{
	spawn:
		TNT1 A 1
		TNT1 A 0 A_PlaySoundEx("world/riflefar","Body",0,1)
		stop
	}
}
actor DistantShotgun : DistantGun
{
	states
	{
	spawn:
		TNT1 A 1
		TNT1 A 0 A_PlaySoundEx("world/shotgunfar","Body",0,1)
		stop
	}
}
actor DistantChaingun : DistantGun
{
	states
	{
	spawn:
		TNT1 A 1
		TNT1 A 0 A_PlaySoundEx("world/chaingunfar","Body",0,1)
		stop
	}
}
actor DistantRocket : DistantGun
{
	states
	{
	spawn:
		TNT1 A 1
		TNT1 A 0 A_PlaySoundEx("world/rocketfar","Body",0,1)
		stop
	}
}
actor DistantPlasma : DistantGun
{
	states
	{
	spawn:
		TNT1 A 1
		TNT1 A 0 A_PlaySoundEx("world/plasmafar","Body",0,1)
		stop
	}
}
actor DistantBFG : DistantGun
{
	states
	{
	spawn:
		TNT1 A 1
		TNT1 A 0 A_PlaySoundEx("world/bfgfar","Body",0,1)
		stop
	}
}
//		TNT1 A 0 A_SpawnItem ("Distant", 1, 1, 0, 0)

