// AGHHHHHHHHHHH WHY ISN'T BounceSound IN SKULLTAG YET???? WTFFFFFF


ACTOR BulletCasingSpawner
{
    Radius 1
    Height 1
    Speed 20
    PROJECTILE
    +noblockmap
	+NOTIMEFREEZE
	+CLIENTSIDEONLY
    States
    {
    Spawn:
        TNT1 A 1
        Goto Death
    Death:
        TNT1 A 0 A_CustomMissile("BulletCasing",0,0,random(-80,-60),2,random(40,60))
        Stop
    }
}

ACTOR BulletCasing
{
	Radius 3
	Height 3
	Speed 6
	Scale 0.13
	BounceFactor 0.4
	Mass 4
	PROJECTILE                    
	+DOOMBOUNCE
	-NOGRAVITY  
	-NOBLOCKMAP
	+DONTSPLASH
	+PAINLESS
	+NOTIMEFREEZE
	+FORCEXYBILLBOARD
	//-CANBOUNCEWATER           
	SeeSound "weapons/bulletcasing"
	States
	{
	Spawn:
		CAS1 A 0
	   CAS1 A 0 A_JumpIf(waterlevel == 3, "Death")
	   CAS1 A 0 A_Playsound("NULL")
	   CAS1 AABBCCDDEEFF 1 A_SpawnItemEx("BulletCasingSmoke", 0, 0, 0, 0, 0, 0, 0, 160) 
	   Goto Spawn+1
	Death:
   	   CAS1 A 0 A_jump(128,"Death2","Death3","Death4","Death5","Death6")
	Death1:
           CAS1 A 1 A_Fadeout(0.03)
           Loop
	Death2:
           CAS1 B 1 A_Fadeout(0.04)
           Loop
	Death3:
           CAS1 C 1 A_Fadeout(0.05)
           Loop
	Death4:
           CAS1 D 1 A_Fadeout(0.06)
           Loop
	Death5:
           CAS1 E 1 A_Fadeout(0.07)
           Loop
	Death6:
           CAS1 F 1 A_Fadeout(0.08)
           Loop
	}
}


ACTOR ShellCasingSpawner
{
    Radius 1
    Height 1
    Speed 12
    PROJECTILE
    +noblockmap
   +NOTIMEFREEZE
	+CLIENTSIDEONLY
    scale 0.18
    States
    {
    Spawn:
        NULL A 1
        NULL A 0 A_Die
        Goto Death
    Death:
        NULL A 0 A_CustomMissile("ShellCasing",-2,0,random(-80,-100),2,random(40,60))
        Stop
    }
}

ACTOR ShellCasingSpawner2
{
    Radius 1
    Height 1
    Speed 12
    PROJECTILE
    +noblockmap
   +NOTIMEFREEZE
	+CLIENTSIDEONLY
    scale 0.18
    States
    {
    Spawn:
        NULL A 1
        NULL A 0 A_Die
        Goto Death
    Death:
        NULL A 0 A_CustomMissile("ShellCasing",-2,0,random(80,100),2,random(40,60))
        Stop
    }
}

ACTOR ShellCasing
{
	Height 3.5
	Radius 1.5
	Speed 5//6
        Scale 0.14
		BounceFactor 0.6//.4
		Mass 4
	PROJECTILE                    
	+DOOMBOUNCE
	-NOGRAVITY  
	-NOBLOCKMAP
	+DONTSPLASH
	+PAINLESS
	//-CANBOUNCEWATER
	+NOTIMEFREEZE
	+FORCEXYBILLBOARD
	SeeSound "weapons/shellcasing"
	States
	{
	Spawn:
		CAS2 A 0
	   CAS2 A 0 A_JumpIf(waterlevel == 3, "Death")
	   CAS2 A 0 A_Playsound("NULL")
	   CAS2 AABBCCDDEEFF 1 A_SpawnItemEx("ShellCasingSmoke", 0, 0, 0, 0, 0, 0, 0, 160) 
	   Goto Spawn+1
	Death:
   	   CAS2 A 0 A_jump(128,"Death2","Death3","Death4","Death5","Death6")
	Death1:
           CAS2 A 1 A_Fadeout(0.03)
           Loop
	Death2:
           CAS2 B 1 A_Fadeout(0.04)
           Loop
	Death3:
           CAS2 C 1 A_Fadeout(0.05)
           Loop
	Death4:
           CAS2 D 1 A_Fadeout(0.06)
           Loop
	Death5:
           CAS2 E 1 A_Fadeout(0.07)
           Loop
	Death6:
           CAS2 F 1 A_Fadeout(0.08)
           Loop
	}
}
ACTOR BulletCasingSmoke
{
   Radius 1
   Height 1
   PROJECTILE
   +NOCLIP
   Scale 0.02
   Speed 0
   RENDERSTYLE ADD
   ALPHA 0.09
	+NOTIMEFREEZE
	+FORCEXYBILLBOARD
   States
   {
   Spawn:
	  SMOK A 0
	  SMOK A 0 Thing_ChangeTID (0, 1330) 
	  TNT1 A 1
      SMOK ABCDEFG 2 BRIGHT A_Fadeout(0.01)
      SMOK HIJKLMNOPQ 2 
      Stop
   }
}

ACTOR ShellCasingSmoke : BulletCasingSmoke
{
Scale 0.03
ALPHA 0.11
}