actor DukeGibs1
{
  Radius 4
  Height 4
  Speed 0
  Projectile
  -NOGRAVITY
  Gravity 0.5
  health 1
  scale 0.6
  DeathSound "Gib/Land"
  States
  {
  Spawn:
    DGB1 ABCD 5
    loop
  Death:
    DGB6 CDEFGH 5
    stop
  }
}

actor DukeGibs2 : DukeGibs1
{
  States
  {
  Spawn:
    DGB2 ABCD 5
    loop
  Death:
    DGB6 CDEFGH 5
    stop
  }
}

actor DukeGibs3 : DukeGibs1
{
  health 4
  States
  {
  Spawn:
    DGB3 ABCD 5
    loop
  Death:
    DGB6 CDEFGH 5
    stop
  }
}
actor GutsGib : DukeGibs1
{
  States
  {
  Spawn:
    GGUT ABCD 3
    loop
  Death:
    GGUT EFGHIJKL 3
    stop
  }
}

actor DukeGibs5 : DukeGibs1
{
  States
  {
  Spawn:
    DGB5 ABCD 5
    loop
  Death:
    DGB6 CDEFGH 5
    stop
  }
}

actor BloodSplurt : DukeGibs1
{
  health 4
  States
  {
  Spawn:
    SPLT ABCD 3
    loop
  Death:
    SPLT EFGHIJKL 3
    stop
  }
}

actor SkullGib : DukeGibs1
{
  States
  {
  Spawn:
    GHED ABCD 3
    loop
  Death:
    GHED EFGHIJKL 3
    stop
  }
}

//Original spent casing code made by HellCattX and Lippeth
ACTOR CasingSpawner
{
	+MISSILE
	+NOBLOCKMAP
	+NOGRAVITY
	+DROPOFF
	+NOTELEPORT
	+FORCEXYBILLBOARD
	+NOTDMATCH
	+GHOST
	+NOINTERACTION
	Radius 1
	Height 1
	Mass 1
	Damage 0
	Speed 20
	States
	{
	Spawn:
		TNT1 A 0
		TNT1 A 1
		TNT1 A 0 A_CustomMissile("BulletCasing",0,0,random(-80,-100),2,random(45,80))
		TNT1 A 0
		Stop
	}
}

ACTOR BulletCasing
{
   Height 3
   Radius 3
   Speed 2
        Mass 5
   Scale 0.16
   PROJECTILE
   +DOOMBOUNCE
   -NOGRAVITY
        -NOBLOCKMAP
   SeeSound "casings/bullet/bounce"
   States
   {
   Spawn:
      BCAS A 0 A_CustomMissile("CasingSmoketrail",0,0,0)
      BCAS ABCDEFGH 1
      Loop
   Death:
         TNT1 A 0 A_jump(128,10)
         TNT1 A 0 A_jump(128,8)
         TNT1 A 0 A_jump(128,6)
         TNT1 A 0 A_jump(128,4)
      TNT1 A 0 A_jump(128,2)
           BCAS H 1050
           stop
           BCAS I 1050
           stop
           BCAS K 1050
           stop
           BCAS J 1050
           stop
           BCAS K 1050
           stop
           BCAS L 1050
           stop
   }
}

ACTOR ShotgunCasingSpawner : CasingSpawner
{
	States
	{
	Spawn:
		TNT1 A 0
		TNT1 A 1
		TNT1 A 0 A_CustomMissile("ShellCasing",0,0,random(-80,-100),2,random(45,80))
		TNT1 A 0
		Stop
	}
}

ACTOR ShellCasing : BulletCasing
{
   Scale 0.26
   SeeSound "casings/shell/bounce"
   States
   {

   Spawn:
      SCAS A 0 A_CustomMissile("CasingSmoketrail",0,0,0)
      SCAS ABCDEFGH 1
      Loop
   Death:
         TNT1 A 0 A_jump(128,10)
         TNT1 A 0 A_jump(128,8)
         TNT1 A 0 A_jump(128,6)
         TNT1 A 0 A_jump(128,4)
      TNT1 A 0 A_jump(128,2)
           SHDY A 1050
           stop
           SHDY B 1050
           stop
           SHDY C 1050
           stop
           SHDY D 1050
           stop
           SHDY E 1050
           stop
           SHDY F 1050
           stop
   }
}

ACTOR ShotgunCasingSpawner2 : CasingSpawner
{
	States
	{
	Spawn:
		TNT1 A 0
		TNT1 A 1
		TNT1 A 0 A_CustomMissile("ShellCasing2",0,0,random(-80,-100),2,random(45,80))
		TNT1 A 0
		Stop
	}
}

ACTOR ShellCasing2 : ShellCasing //Used for the Firestick
{
   States
   {

   Spawn:
      SCS2 A 0 A_CustomMissile("CasingSmoketrail",0,0,0)
      SCS2 ABCDEFGH 1
      Loop
   Death:
         TNT1 A 0 A_jump(128,10)
         TNT1 A 0 A_jump(128,8)
         TNT1 A 0 A_jump(128,6)
         TNT1 A 0 A_jump(128,4)
      TNT1 A 0 A_jump(128,2)
           SDY2 A 1050
           stop
           SDY2 B 1050
           stop
           SDY2 C 1050
           stop
           SDY2 D 1050
           stop
           SDY2 E 1050
           stop
           SDY2 F 1050
           stop
   }
}

ACTOR RifleCasingSpawner : CasingSpawner
{
	States
	{
	Spawn:
		TNT1 A 0
		TNT1 A 1
		TNT1 A 0 A_CustomMissile("RifleCasing",0,0,random(-80,-100),2,random(45,80))
		TNT1 A 0
		Stop
	}
}

ACTOR RifleCasing : BulletCasing
{
   Scale 0.26
   SeeSound "casings/rifle/bounce"
   States
   {

   Spawn:
      RCAS A 0 A_CustomMissile("CasingSmoketrail",0,0,0)
      RCAS ABCDEFGH 1
      Loop
   Death:
         TNT1 A 0 A_jump(128,8)
         TNT1 A 0 A_jump(128,6)
         TNT1 A 0 A_jump(128,4)
      TNT1 A 0 A_jump(128,2)
           RCAS I 1050
           stop
           RCAS J 1050
           stop
           RCAS K 1050
           stop
           RCAS L 1050
           stop
           RCAS M 1050
           stop
   }
}

ACTOR CasingSmoketrail 
{
   Speed 2
   Height 2
   Radius 4
   PROJECTILE
   +NOGRAVITY
   Scale 0.25
   RenderStyle Add
   Alpha 0.2
   States
   {
   Spawn:
      SMOK A 0
      goto death       
   Death: 
      SMOK ABCDEFGHIJKLMNOPQR 1
      STOP      
   }
}

ACTOR GrenadeSmoke
{   
   Radius 0
   Height 1
   Speed 0
   Projectile
   Scale 0.75
   Renderstyle Translucent
   Alpha 0.45
   States
   {
   Spawn:
      NULL A 3 bright
      SMK2 ABCDE 2 Bright
      Stop 
   }
}

ACTOR NewExplosion
{
	RenderStyle "Add"
	+NOINTERACTION
	+CLIENTSIDEONLY
	+FORCEXYBILLBOARD
	+NOBLOCKMAP
	+DONTSPLASH
	+THRUACTORS
	+NOTRIGGER
	+NOBLOCKMONST
	+NOTONAUTOMAP
	+CANNOTPUSH
	Radius 0.5
	Height 1
	Gravity 0.66
	+BRIGHT
	Alpha 0.99
	Scale 1.5
	DamageType GMIDExplosion
	States
	{
	Spawn:
		ZXPL A 0 A_Quake(4,12,0,400)
		ZXPL A 0 A_Quake(2,12,0,800)
		ZXPL A 0 A_Explode(175,148)
		ZXPL ABC 3
		ZXPL D 3 A_SpawnItem("ExplosionSmoke")
		ZXPL EFGHIJKLMN 3
		Stop
	}
}

ACTOR NewExplosion2 : NewExplosion
{
	Scale 1.6640625
	States
	{
	Spawn:
		YXPL A 0 A_Quake(4,12,0,400)
		YXPL A 0 A_Quake(2,12,0,800)
		YXPL A 0 A_Explode(175,148)
		YXPL ABC 3
		YXPL D 3 A_SpawnItem("ExplosionSmoke")
		YXPL EFGHIJKLMNOPQ 3
		Stop
	}
}

ACTOR ExplosionSmoke
{
	RenderStyle "Shaded"
	+NOINTERACTION
	+CLIENTSIDEONLY
	+FORCEXYBILLBOARD
	+NOBLOCKMAP
	+DONTSPLASH
	+THRUACTORS
	+NOTRIGGER
	+NOBLOCKMONST
	+NOTONAUTOMAP
	+CANNOTPUSH
	Radius 0.5
	Height 1
	Gravity 0.66
	Alpha 1.0
	Scale 1.5
	States
	{
	Spawn:
		SMK0 ABCDEFGHIJKLMNO 3
		Stop
	}
}

ACTOR XaserBarrelShell
{
	+NOCLIP
	States
	{
	Spawn:
		BEXP RSTRSTRSTRSTRSTRSTRSTRSTRSTRSTRSTRSTRSTRSTRSTRSTRSTRSTRSTRSTRSTRSTRSTRST 5 BRIGHT
      		BEXP U -1 A_SpawnItem("XaserBarrelShell2",1)
		Stop
	}
}

ACTOR XaserBarrelShell2
{
	+NOCLIP
	Renderstyle Translucent
	Alpha 1
	States
	{
	Spawn:
		BEXP A 0
		BEXP RRRRRSSSSSTTTTTRRRRRSSSSSTTTTTRRRRRSSSSSTTTTTRRRRR 1 BRIGHT A_FadeOut (0.02)
		Stop
	}
}

ACTOR BarrelParts
{
   Radius 2
   Height 2
   Speed 0
   Damage 0
   Scale 0.3
   ReactionTime 2
   SeeSound ""
   PROJECTILE
   -NOGRAVITY
   +HEXENBOUNCE
   Scale 0.75
   BounceSound "metal/hit"
   DeathSound "metal/hit"
   States
   {
   Spawn:
      TNT1 A 0 A_Countdown
      BARF AABBCCDDEE 2
      TNT1 A 0 A_Jump(128,2)
      TNT1 A 0 A_Countdown
      BARF FFGGHHIIJJ 2
      Loop
   Death:
      TNT1 A 1 A_SpawnItemEx("BarrelPartsDrop",0,0,0,0,0,0,128,0,0)
      Stop
   }
}

ACTOR BarrelPartsDrop
{
	+NOCLIP
	Scale 0.75
	States
	{
	Spawn:
		TNT1 A 0
		TNT1 A 0 A_SetTranslucent(1,0)
		TNT1 A 0 A_Jump(255,"BARFA","BARFB","BARFC","BARFD","BARFE","BARFF","BARFG","BARFH","BARFI","BARFJ")
	BARFA:
		BARF A 200
		BARF A 1 A_FadeOut(0.01)
		Wait
	BARFB:
		BARF B 200
		BARF B 1 A_FadeOut(0.01)
		Wait
	BARFC:
		BARF C 200
		BARF C 1 A_FadeOut(0.01)
		Wait
	BARFD:
		BARF D 200
		BARF D 1 A_FadeOut(0.01)
		Wait
	BARFE:
		BARF E 200
		BARF E 1 A_FadeOut(0.01)
		Wait
	BARFF:
		BARF F 200
		BARF F 1 A_FadeOut(0.01)
		Wait
	BARFG:
		BARF G 200
		BARF G 1 A_FadeOut(0.01)
		Wait
	BARFH:
		BARF H 200
		BARF H 1 A_FadeOut(0.01)
		Wait
	BARFI:
		BARF I 200
		BARF I 1 A_FadeOut(0.01)
		Wait
	BARFJ:
		BARF J 200
		BARF J 1 A_FadeOut(0.01)
		Wait
	}
}

ACTOR NewTeleportFog : TeleportFog replaces TeleportFog
{
  States
  {
  Spawn:
    TFOG ABABABABABABABABABABABCDEFGHIJ 1 Bright
    Stop
  }
}