actor ShellCasing {
	+DOOMBOUNCE
	+MISSILE
	+NOBLOCKMAP
	+BOUNCEONACTORS
	+FLOORCLIP
	+CLIENTSIDEONLY
	Scale 0.25
	Radius 4
	Height 4
	Speed 6
	bouncefactor 0.5
	mass 1000
	SeeSound "weapons/casing"
	States {
	Spawn:
		TNT1 A 0
		TNT1 A 0 A_JumpIf(ACS_ExecuteWithResult(909) >= 0, 1)
		Stop
		CAS1 ABCDEFGH 1 
		TNT1 A 0 A_JumpIf(waterlevel > 1, "Death")
		loop
	Death:
		TNT1 A 0
		TNT1 A 0 ThrustThingZ(0,2,1,0)
		TNT1 A 0 A_Jump (128, "death1")
		TNT1 A 0 A_Jump (128, "death2")
		TNT1 A 0 A_Jump (128, "death3")
		TNT1 A 0 A_Jump (128, "death4")
		TNT1 A 0 A_Jump (128, "death5")
		goto Death6
	Death1:
		CAS1 I 512
		CAS1 I 1 A_Fadeout(0.01)
		Wait
	Death2:
		CAS1 J 512
		CAS1 J 1 A_Fadeout(0.01)
		Wait
	Death3:
		CAS1 K 512
		CAS1 K 1 A_Fadeout(0.01)
		Wait
	Death4:
		CAS1 L 512
		CAS1 L 1 A_Fadeout(0.01)
		Wait
	Death5:
		CAS1 M 512
		CAS1 M 1 A_Fadeout(0.01)
		Wait
	Death6:
		CAS1 N 512
		CAS1 N 1 A_Fadeout(0.01)
		Wait
	}
}

actor ShotgunShellCasing : ShellCasing {
	SeeSound "weapons/shotgunshells"
	States {
	Spawn:
		TNT1 A 0
		TNT1 A 0 A_JumpIf(ACS_ExecuteWithResult(909) >= 0, 1)
		Stop
		CAS2 ABCDEFGH 1 
		TNT1 A 0 A_JumpIf(waterlevel > 1, "Death")
		loop
	Death1:
		CAS2 I 512
		CAS2 I 1 A_Fadeout(0.01)
		Wait
	Death2:
		CAS2 J 512
		CAS2 J 1 A_Fadeout(0.01)
		Wait
	Death3:
		CAS2 K 512
		CAS2 K 1 A_Fadeout(0.01)
		Wait
	Death4:
		CAS2 L 512
		CAS2 L 1 A_Fadeout(0.01)
		Wait
	Death5:
		CAS2 M 512
		CAS2 M 1 A_Fadeout(0.01)
		Wait
	Death6:
		CAS2 N 512
		CAS2 N 1 A_Fadeout(0.01)
		Wait
	}
}

actor RifleShellCasing : ShellCasing {
	SeeSound "weapons/ChainCasing"
	states {
	Spawn:
		TNT1 A 0
		TNT1 A 0 A_JumpIf(ACS_ExecuteWithResult(909) >= 0, 1)
		Stop
		CAS3 ABCDEFGH 1 
		TNT1 A 0 A_JumpIf(waterlevel > 1, "Death")
		loop
	Death1:
		CAS3 I 512
		CAS3 I 1 A_Fadeout(0.01)
		Wait
	Death2:
		CAS3 J 512
		CAS3 J 1 A_Fadeout(0.01)
		Wait
	Death3:
		CAS3 K 512
		CAS3 K 1 A_Fadeout(0.01)
		Wait
	Death4:
		CAS3 L 512
		CAS3 L 1 A_Fadeout(0.01)
		Wait
	Death5:
		CAS3 M 512
		CAS3 M 1 A_Fadeout(0.01)
		Wait
	Death6:
		CAS3 N 512
		CAS3 N 1 A_Fadeout(0.01)
		Wait
	}
}

actor ArtilleryCasing : ShellCasing {
	SeeSound "weapons/ChainCasing"
	Scale 0.50
}

actor ArtilleryCasing80mm : ShellCasing {
	SeeSound "weapons/ChainCasing"
	Scale 0.66
}

actor CellCasing : ShellCasing {
	seesound "weapons/shotgunshells"
	scale 0.4
	states {
	Spawn:
		TNT1 A 0
		TNT1 A 0 A_JumpIf(ACS_ExecuteWithResult(909) >= 0, 1)
		Stop
		CELL A 3 A_JumpIf(waterlevel > 1, "Death")
		wait
	Death:
		TNT1 A 0
		TNT1 A 0 ThrustThingZ (0, 2, 1, 0)
		CELL A 512
		CELL A 1 A_FadeOut (0.01)
		wait
	}
}