#include ZOMBIES
#include DEMONS
#include GORE
#include ITEMS

ACTOR DRDoom : PlayerPawn
{
	Speed 1
	Health 125
	Radius 16
	Height 56
	Mass 100
	PainChance 255
	+NOSKIN
	Player.DisplayName "Doom"
	Player.SoundClass "Player"
	Player.StartItem "DRPistol"
	Player.StartItem "DRChainsaw"
	Player.CrouchSprite "PLYC"
	Player.ForwardMove 0.8
	Player.SideMove 0.8
	Player.ViewHeight 50
	Player.AttackZOffset 17
	DamageFactor "Friendly", 0
	Species Players
	States
	{
	Spawn:
	  PLAY Z 1
      Loop
    See:
	  PLAY A 2
	  PLAY B 2
	  PLAY C 2 A_SpawnItemEx ("FootStep",0,0,0,0,0,-8)
	  PLAY D 2
	  PLAY E 2
	  PLAY F 2
	  PLAY G 2
	  PLAY H 2 A_SpawnItemEx ("FootStep",0,0,0,0,0,-8)
	  PLAY I 2
      Loop
	RunBack:
      PLAY J 2
	  PLAY K 2
	  PLAY L 2 A_SpawnItemEx ("FootStep",0,0,0,0,0,-8)
	  PLAY M 2
	  PLAY N 2
	  PLAY O 2
	  PLAY P 2
	  PLAY Q 2 A_SpawnItemEx ("FootStep",0,0,0,0,0,-8)
	  PLAY R 2
      Loop
	JumpLoop:
      PLYJ ABCDEFG 2 A_CheckFloor("Land")
	  PLYJ H 0 A_JumpIf(waterlevel>=2,"Swim")
	  PLYJ H 1 A_CheckFloor("Land")
      Goto JumpLoop+7
    JumpLoop.Back:
      PYJ2 ABCDEFGH 2 A_CheckFloor("Land")
	  PYJ2 I 0 A_JumpIf(waterlevel>=2,"Swim")
	  PYJ2 I 1 A_CheckFloor("Land")
      Goto JumpLoop.Back+8
    Land:
      PLYJ J 2 A_PlaySound("Player/Land")
	  PLYJ KLMNOP 2 A_JumpIf(momz<-6,"JumpLoop")
	  TNT1 A 0 A_TakeInventory("RunningBack",1)
	  TNT1 A 0 A_TakeInventory("DoingMelee",1)
      Goto Spawn
	Swim:
      PLYS ABCDEFGHIJ 3 A_JumpIf(waterlevel<=1,"JumpLoop")
      Loop
	AnimTaunt:
	  PLAY Z 1 A_PlaySoundEx("DOMTAUNT",voice,0)
	  PLAY Z 1 A_TakeInventory("DoingTaunt",1)
      Goto Spawn
	Pain:
	  PLAY Z 0 A_Pain
	  PLAY Z 0 ACS_Execute(404,0,0,0)
	  PLAY A 0 A_TakeInventory("DoingMelee",1)
	  TNT1 A 0 A_TakeInventory("RunningBack",1)
	  Goto Spawn
	Death:
	  NADD A 0 A_PlaySoundEx("world/quake",SoundSlot5,0)
	  NADD A 0 A_PlaySoundEx("world/quake",SoundSlot6,0)
	  NADD A 0 A_PlaySoundEx("world/quake",SoundSlot7,0)
	  NADD A 2 A_PlayerScream
	  NADD B 2 A_NoBlocking
	  NADD CDEFGHIJKLMNOPQRSTUVWXYZ 2
	  NADE ABCD 2
	  NADE E -1
	  Stop
	XDeath:
	  NADA A 0 A_CustomMissile ("XDeathDecalerSpawn", 32, 0, random (0, 360), 2, random (0, 160))
	  NADA A 0 A_CustomMissile ("XDeathHead", 32, 0, random (0, 360), 2, random (67, 160))
	  NADA A 0 A_CustomMissile ("XDeath11", 32, 0, random (0, 360), 2, random (0, 160))
	  NADA A 0 A_CustomMissile ("XDeath21", 32, 0, random (0, 360), 2, random (0, 160))
	  NADA A 0 A_CustomMissile ("XDeath31", 32, 0, random (0, 360), 2, random (0, 160))
	  NADA A 0 A_CustomMissile ("XDeath41", 32, 0, random (0, 360), 2, random (0, 160))
	  NADA A 0 A_CustomMissile ("XDeath51", 32, 0, random (0, 360), 2, random (0, 160))
	  NADA A 0 A_CustomMissile ("XDeath61", 32, 0, random (0, 360), 2, random (0, 160))
	  NADA A 0 A_CustomMissile ("XDeath71", 32, 0, random (0, 360), 2, random (0, 160))
	  NADA A 0 A_CustomMissile ("XDeath81", 32, 0, random (0, 360), 2, random (0, 160))
	  NADA A 0 A_PlaySoundEx("world/quake",SoundSlot5,0)
	  NADA A 0 A_PlaySoundEx("world/quake",SoundSlot6,0)
	  NADA A 0 A_PlaySoundEx("world/quake",SoundSlot7,0)
	  NADA A 0 A_XScream
      NADA O 1 A_NoBlocking
	  NADA W -1
      Stop
	}
}

ACTOR DRCrash : PlayerPawn
{
	Speed 1
	Health 125
	Radius 16
	Height 56
	Mass 100
	PainChance 255
	+NOSKIN
	Player.CrouchSprite "PLYC"
	Player.DisplayName "Crash"
	Player.SoundClass "Crash"
	Player.StartItem "DRPistol"
	Player.StartItem "DRChainsaw"
	Player.ForwardMove 0.8
	Player.SideMove 0.8
	Player.ViewHeight 48
	Player.AttackZOffset 16
	DamageFactor "Friendly", 0
	Species Players
	States
	{
	Spawn:
	  PLAY Z 1
      Loop
    See:
      PLAY A 2
	  PLAY B 2
	  PLAY C 2 A_SpawnItemEx ("FootStep",0,0,0,0,0,-8)
	  PLAY D 2
	  PLAY E 2
	  PLAY F 2
	  PLAY G 2
	  PLAY H 2 A_SpawnItemEx ("FootStep",0,0,0,0,0,-8)
	  PLAY I 2
	  PLAY J 2
      Loop
	RunBack:
      PLAY K 2
	  PLAY L 2
	  PLAY M 2 A_SpawnItemEx ("FootStep",0,0,0,0,0,-8)
	  PLAY N 2
	  PLAY O 2
	  PLAY P 2
	  PLAY Q 2
	  PLAY R 2 A_SpawnItemEx ("FootStep",0,0,0,0,0,-8)
	  PLAY S 2
	  PLAY T 2
      Loop
	JumpLoop:
      PLYJ ABCDEFGHI 2 A_CheckFloor("Land")
	  PLYJ J 0 A_JumpIf(waterlevel>=2,"Swim")
	  PLYJ J 1 A_CheckFloor("Land")
      Goto JumpLoop+9
    JumpLoop.Back:
      PYJ2 ABCDEFGHIJK 2 A_CheckFloor("Land")
	  PYJ2 L 0 A_JumpIf(waterlevel>=2,"Swim")
	  PYJ2 L 1 A_CheckFloor("Land")
      Goto JumpLoop.Back+11
    Land: 
      PLYJ M 2 A_PlaySound("Player/Land")
	  PLYJ NOPQ 2 A_JumpIf(momz<-6,"JumpLoop")
	  TNT1 A 0 A_TakeInventory("RunningBack",1)
	  TNT1 A 0 A_TakeInventory("DoingMelee",1)
      Goto Spawn
	Swim:
      PLYS ABCDEFGHIJ 3 A_JumpIf(waterlevel<=1,"JumpLoop")
      Loop
	AnimTaunt:
	  PLAY Z 1 A_PlaySoundEx("CRTTAUNT",voice,0)
	  PLAY Z 1 A_TakeInventory("DoingTaunt",1)
      Goto Spawn
	Pain:
	  PLAY Z 0 A_Pain
	  PLAY Z 0 ACS_Execute(404,0,0,0)
	  TNT1 A 0 A_TakeInventory("DoingMelee",1)
	  TNT1 A 0 A_TakeInventory("RunningBack",1)
	  Goto Spawn
	Death:
	  NADD A 0 A_PlaySoundEx("world/quake",SoundSlot5,0)
	  NADD A 0 A_PlaySoundEx("world/quake",SoundSlot6,0)
	  NADD A 0 A_PlaySoundEx("world/quake",SoundSlot7,0)
	  NADD A 2 A_PlayerScream
	  NADD B 2 A_NoBlocking
	  NADD CDEFGHIJKLMNOPQRSTUVWXYZ 2
	  NADE ABCD 2
	  NADE E -1
	  Stop
	XDeath:
	  NADA A 0 A_CustomMissile ("XDeathDecalerSpawn", 32, 0, random (0, 360), 2, random (0, 160))
	  NADA A 0 A_CustomMissile ("XDeathHead", 32, 0, random (0, 360), 2, random (67, 160))
	  NADA A 0 A_CustomMissile ("XDeath11", 32, 0, random (0, 360), 2, random (0, 160))
	  NADA A 0 A_CustomMissile ("XDeath21", 32, 0, random (0, 360), 2, random (0, 160))
	  NADA A 0 A_CustomMissile ("XDeath31", 32, 0, random (0, 360), 2, random (0, 160))
	  NADA A 0 A_CustomMissile ("XDeath41", 32, 0, random (0, 360), 2, random (0, 160))
	  NADA A 0 A_CustomMissile ("XDeath51", 32, 0, random (0, 360), 2, random (0, 160))
	  NADA A 0 A_CustomMissile ("XDeath61", 32, 0, random (0, 360), 2, random (0, 160))
	  NADA A 0 A_CustomMissile ("XDeath71", 32, 0, random (0, 360), 2, random (0, 160))
	  NADA A 0 A_CustomMissile ("XDeath81", 32, 0, random (0, 360), 2, random (0, 160))
	  NADA A 0 A_PlaySoundEx("world/quake",SoundSlot5,0)
	  NADA A 0 A_PlaySoundEx("world/quake",SoundSlot6,0)
	  NADA A 0 A_PlaySoundEx("world/quake",SoundSlot7,0)
	  NADA A 0 A_XScream
      NADA O 1 A_NoBlocking
	  NADA W -1
      Stop
	}
}

ACTOR DoingMelee : Ammo
{
   Inventory.MaxAmount 1
   Ammo.BackpackAmount 0
   Ammo.BackpackMaxAmount 1
   +INVENTORY.UNDROPPABLE
}

ACTOR DoingTaunt : Ammo
{
   Inventory.MaxAmount 1
   Ammo.BackpackAmount 0
   Ammo.BackpackMaxAmount 1
   +INVENTORY.UNDROPPABLE
}

ACTOR RunningBack : Ammo
{
   Inventory.MaxAmount 1
   Ammo.BackpackAmount 0
   Ammo.BackpackMaxAmount 1
   +INVENTORY.UNDROPPABLE
}

ACTOR IsADeadPlayer : Ammo
{
   Inventory.MaxAmount 1
   Ammo.BackpackAmount 0
   Ammo.BackpackMaxAmount 1
   +INVENTORY.UNDROPPABLE
}

Actor FootStep
{
	PROJECTILE
	+NOBLOOD
	damage 0
	radius 10
	Speed 20
	States
	{
	Spawn:
	    TNT1 A 3
		Stop
	}
}

Actor MachinegunCasingSpawner
{
  Height 1
  Radius 1
  Speed 10
  +NoBlockMap
  +Missile
  +NoGravity
  States
  {
  Spawn:
    TNT1 A 0
    TNT1 A 1 A_SpawnItemEx("BulletCasing", 1, 10, 0, 4, 0, (0.1)*Random(0, 30), Random(70, 100), 128)
    Stop
  }
}

Actor ShotgunCasingSpawner
{
  Height 1
  Radius 1
  Speed 14
  +NoBlockMap
  +Missile
  +NoGravity
  States
  {
  Spawn:
    TNT1 A 0
	TNT1 A 1 A_SpawnItemEx("ShellCasing", 1, 0, 0, 4, 0, (0.1)*Random(0, 20), Random(80, 90), 128)
    Stop
  }
}

Actor SuperShotgunCasingSpawner
{
  Height 1
  Radius 1
  Speed 14
  +NoBlockMap
  +Missile
  +NoGravity
  States
  {
  Spawn:
    TNT1 A 0
	TNT1 A 0 A_SpawnItemEx("ShellCasing", 2, 0, 0, 4, 0, (0.1)*Random(0, 20), Random(190, 205), 128)
    TNT1 A 1 A_SpawnItemEx("ShellCasing", 2, 0, 0, 4, 0, (0.1)*Random(0, 20), Random(-190, -205), 128)
    Stop
  }
}

Actor BulletCasing
{
  Height 4
  Radius 2
  Scale 0.4
  Mass 1
  BounceCount 10
  PROJECTILE
  +DOOMBOUNCE
  -NOGRAVITY
  -NOBLOCKMAP
  +CLIENTSIDEONLY
  SeeSound "Weapons/BulletCasing"
  States
  {
  Spawn:
    CAS2 A 1 A_JumpIf(waterlevel > 1, "Death")
    Loop
  Death:
    CAS2 A 8 A_FadeOut(0.03)
    Loop
  }
}

Actor ShellCasing
{
  Height 4
  Radius 2
  Scale 0.4
  BounceCount 10
  Mass 1
  PROJECTILE
  +DOOMBOUNCE
  -NOGRAVITY
  -NOBLOCKMAP
  +CLIENTSIDEONLY
  SeeSound "Weapons/ShellCasing"
  States
  {
  Spawn:
    CAS1 A 1 A_JumpIf(waterlevel > 1, "Death")
    Loop
  Death:
    CAS1 A 8 A_FadeOut(0.03)
    Loop
  }
}

Actor LightFireWeapons
{
   Height 1
   Radius 1
   +DROPOFF
   +NOGRAVITY
   +DONTFALL
   +CLIENTSIDEONLY
   States
   {
   Spawn:
      TNT1 A 3
      Stop
   }
}

Actor Tracer
{
	Radius 4
	Height 8
	Speed 256
	RenderStyle Add
	Alpha 1.0
	PROJECTILE
	States
	{
	Spawn:
		TRAC A 1 BRIGHT
		Loop
	Death:
		TNT1 A 1
		Stop
	}
}

ACTOR HitPuff4
{
  +NOBLOCKMAP
  +NOGRAVITY
  +PUFFONACTORS
  activesound ""
  attacksound "weapons/chainsawall"
  seesound "weapons/chainsawmeat"
  states
  {
  Spawn:
    TNT1 A 0
    TNT1 A 1
    stop
  Crash:
  	TNT1 A 0
  	TNT1 A 1
  	stop
  Melee:
  	TNT1 A 0
  	TNT1 A 1
  	stop
  }
}

ACTOR DRChainsaw : Weapon 7002
{
	//$Category Weapons
   +INVENTORY.UNDROPPABLE
   +WEAPON.MELEEWEAPON
   +FLOATBOB
   Tag "Chainsaw"
   Inventory.PickupMessage "Chainsaw"
   Inventory.PickupSound "misc/d3pickup"
   Weapon.SelectionOrder 9
   Weapon.Kickback 1
   States
   {
   Spawn:
      D3SH A -1
      Loop
   Ready:
      NADA A 0 A_PlaySoundEx("weapons/d3chnswidle",SoundSlot5,1)
	  NADA A 3 A_WeaponReady(14)
	  NADA BCDEFGHIJKLMN 3 A_WeaponReady
	  NADA O 0 A_PlaySoundEx("weapons/d3chnswidle",SoundSlot5,1)
	  NADA O 3 A_WeaponReady(14)
	  NADA PQRSTUVWXY 3 A_WeaponReady
	  NADA Z 0 A_PlaySoundEx("weapons/d3chnswidle",SoundSlot5,1)
	  NADA Z 3 A_WeaponReady(14)
	  NADZ ABCDEFGHIJKLM 3 A_WeaponReady
	  NADZ N 0 A_PlaySoundEx("weapons/d3chnswidle",SoundSlot5,1)
	  NADZ N 3 A_WeaponReady(14)
      Loop
   Select:
	  NADS A 0 A_PlaySound("weapons/d3chnsws1")
	  FADE DCBA 1 BRIGHT A_Raise
   SelectLoop:
	  FADE AAA 0 BRIGHT A_Raise
	  FADE A 1 BRIGHT A_Raise
      Loop
   Deselect:
	  NADS A 0 A_PlaySoundEx("weapons/switch",SoundSlot7,0)
	  NADS A 0 A_PlaySound("weapons/d3chnsws4")
	  NADS A 0 A_PlaySoundEx("blank",SoundSlot5,0)
	  NADS A 0 A_StopSoundEx(SoundSlot5)
      FADE ABCD 1 BRIGHT A_Lower
	  FADE DDD 0 BRIGHT A_Lower
	  FADE D 1 BRIGHT A_Lower
      Goto Deselect+8
   Fire:
      NADB A 0 A_PlaySound("weapons/d3chnswbegin")
      NADB ABCDE 1 A_CustomPunch(5, 0, 0, "HitPuff4")
   Hold:
      NADC A 2 A_CustomPunch(5, 0, 0, "HitPuff4")
      NADC B 2 A_PlaySoundEx("weapons/d3chnswrun",SoundSlot5,1)
	  NADC C 2 A_CustomPunch(5, 0, 0, "HitPuff4")
      NADC C 2 A_ReFire
	  NADD A 0 A_PlaySound("weapons/d3chnsws3")
	  NADD A 0 A_PlaySoundEx("blank",SoundSlot5,0)
	  NADD A 2 A_StopSoundEx(SoundSlot5)
	  NADD BCDEFGHIJK 2
      Goto Ready
   }
}

actor ChainsawRandomSpawner : RandomSpawner replaces Chainsaw
{
	DropItem "DRGrenadeBox" 255 1
	DropItem "DRSlugs" 255 1
	DropItem "DRLightningTube" 255 1
}

ACTOR DRPistol : Weapon replaces Pistol
{
	//$Category Weapons
   Inventory.PickupMessage "N-7 Pistol"
   Weapon.SelectionOrder 8
   Weapon.Kickback 8
   AttackSound "weapons/pistol"
   Inventory.PickupSound "misc/DRWpickup"
   Tag "N-7 Pistol"
   +INVENTORY.UNDROPPABLE
   +AMMO_OPTIONAL
   +FLOATBOB
   States
   {
   Spawn:
      D3SH A -1
      Loop
   Ready:
      NADA A 1 A_WeaponReady
      Loop
   Select:
	  FADE DCBA 1 BRIGHT A_Raise
   SelectLoop:
	  FADE AAA 0 BRIGHT A_Raise
	  FADE A 1 BRIGHT A_Raise
      Loop
   Deselect:
	  NADS A 0 A_PlaySoundEx("weapons/switch",SoundSlot7,0)
      FADE ABCD 1 BRIGHT A_Lower
	  FADE DDD 0 BRIGHT A_Lower
	  FADE D 1 BRIGHT A_Lower
      Goto Deselect+5
   Fire:
      NADB A 0 A_FireCustomMissile("FlashMG",0,0,4,0)
	  NADB A 0 A_FireCustomMissile("Tracer", 0, 0, 0, 0, 0, 0)
      NADB A 2 A_FireBullets(1, 1, 1, 10, "BulletPuff")
      NADB B 2 A_FireCustomMissile("MachinegunCasingSpawner", 0, 0, 0, 1)
	  NADB CDE 2
      Goto Ready
   } 
}

ACTOR DRShotgun : Weapon replaces Shotgun
{
   Inventory.PickupMessage "Shevran Shotgun"
   Inventory.PickupSound "misc/DRWpickup"
   Weapon.SelectionOrder 2
   Weapon.AmmoType "DRShevranShells"
   Weapon.AmmoGive 10
   Weapon.AmmoUse 1
   Weapon.Kickback 256
   Tag "Shevran Shotgun"
   AttackSound "weapons/shotgunfire"
   +FLOATBOB
   States
   {
   Spawn:
      D3SH A -1
      Loop
   Ready:
      NADA A 1 A_WeaponReady
      Loop
   Select:
	  FADE DCBA 1 BRIGHT A_Raise
   SelectLoop:
	  FADE AAA 0 BRIGHT A_Raise
	  FADE A 1 BRIGHT A_Raise
      Loop
   Deselect:
	  NADS A 0 A_PlaySoundEx("weapons/switch",SoundSlot7,0)
      FADE ABCD 1 BRIGHT A_Lower
	  FADE DDD 0 BRIGHT A_Lower
	  FADE D 1 BRIGHT A_Lower
      Goto Deselect+5
   Fire: 
	  NADB A 0 A_FireCustomMissile("SmokeSpawner", 0, 0, 0, 1)
	  NADB A 0 A_FireCustomMissile("FlashSG",0,0,4,0)
      NADB AAAAAAAAAAA 0 A_FireCustomMissile("Tracer", random(-8,8), 0, 0, 0, 0, random(-8,8))
      NADB A 2 A_FireBullets(8, 8, 11, 7, "BulletPuff")
      NADB BC 2 A_WeaponReady(14)
      NADB D 2 A_FireCustomMissile("ShotgunCasingSpawner", 0, 0, 0, 1)
      NADB E 2 A_PlaySoundEx("weapons/shotgunpump",SoundSlot6,0)
      NADB FGHIJKLMNOP 2 A_WeaponReady(14)
      Goto Ready
   } 
}

Actor FlashSG
{
	Height 1
	Radius 1
	+NOINTERACTION
	+CLIENTSIDEONLY
	RenderStyle Add
	Alpha 1.0
	Speed 16
	States
	{
	Spawn:
		NADA A 2 BRIGHT
		Goto Death
	Death:
		TNT1 A 0
		Stop
	}
}

Actor SmokeSpawner
{
  Height 1
  Radius 1
  +NoBlockMap
  +Missile
  +NoGravity
  +CLIENTSIDEONLY
  States
  {
  Spawn:
    TNT1 A 0
    TNT1 A 1 A_SpawnItem("S31Smoke",16,0,0)
    Stop
  }
}

Actor S31Smoke
{
   Height 8
   Radius 8
   VSpeed 0.1
   Scale 0.15
   +DROPOFF
   +NOGRAVITY
   +DONTFALL
   +ForceXYBillboard
   +NOCLIP
   +CLIENTSIDEONLY
   States
   {
   Spawn:
      TRAI AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 1 A_FadeOut(0.02)
      Stop
   }
}

ACTOR DRShevranShells : Ammo replaces shell
{
   //$Category Ammo
   Inventory.Amount 20
   Inventory.MaxAmount 100
   Ammo.BackpackAmount 25
   Ammo.BackpackMaxAmount 200
   Inventory.PickupMessage "Shevran Shells"
   Inventory.PickupSound "misc/a_pkup"
   Inventory.Icon ICONA_SH
   States
   {
   Spawn:
	  NADA A 1
	  Loop
   }
}

ACTOR ShellRandomSpawner : RandomSpawner 2008
{
	DropItem "DRShevranShells" 255 2
    DropItem "DRNitraShells" 255 1
}

ACTOR DRNitraShotgun : Weapon replaces SuperShotgun
{
	//$Category Weapons
   +WEAPON.NOAUTOAIM
   +FLOATBOB
   Tag "Nitra Shotgun"
   Inventory.PickupMessage "Nitra Shotgun"
   Inventory.PickupSound "misc/DRWpickup"
   Weapon.SelectionOrder 2
   Weapon.AmmoType "DRNitraShells"
   Weapon.AmmoGive 12
   Weapon.AmmoUse 2
   Weapon.Kickback 512
   AttackSound "SSGFIRE"
   States
   {
   Spawn:
	  D3SH A 1
	  Loop
   Ready:
      NADA A 1 A_WeaponReady
      Loop
   Select:
	  FADE DCBA 1 BRIGHT A_Raise
   SelectLoop:
	  FADE AAA 0 BRIGHT A_Raise
	  FADE A 1 BRIGHT A_Raise
      Loop
   Deselect:
	  NADS A 0 A_PlaySoundEx("weapons/switch",SoundSlot7,0)
      FADE ABCD 1 BRIGHT A_Lower
	  FADE DDD 0 BRIGHT A_Lower
	  FADE D 1 BRIGHT A_Lower
      Goto Deselect+5
   Fire: 
	  NADB A 0 A_FireCustomMissile("SmokeSpawner", 0, 0, 0, 1)
	  NADB A 0 A_FireCustomMissile("FlashSG",0,0,4,0)
      NADB AAAAAAAAAAAAAAAAAAAAAA 0 A_FireCustomMissile("Tracer", random(-8,8), 0, 0, 0, 0, random(-8,8))
      NADB A 3 A_FireBullets(8, 8, 22, 14, "BulletPuff")
      NADB B 3 A_FireCustomMissile("SuperShotgunCasingSpawner", 0, 0, 0, 1)
      NADB CDEFG 3 A_WeaponReady(14)
	  NADA A 50 A_WeaponReady(14)
      Goto Ready
   } 
}

ACTOR DRNitraShells : Ammo Replaces Shellbox
{
	//$Category Ammo
	Inventory.Amount 6
	Inventory.MaxAmount 40
	Ammo.BackpackAmount 20
	Ammo.BackpackMaxAmount 80
	Inventory.PickupMessage "Nitra Shells"
	Inventory.PickupSound "misc/a_pkup"
	Inventory.Icon ICONA_S2
	States
	{
	Spawn:
		NADA A 1
		Loop
	}
}

ACTOR ShellBoxRandomSpawner : RandomSpawner 2049
{
	DropItem "DRShevranShells" 255 1
    DropItem "DRNitraShells" 255 2
}

ACTOR DRMachinegun : Weapon 7003
{
	//$Category Weapons
   Tag "Machinegun"
   Inventory.PickupMessage "Machine Gun"
   Inventory.PickupSound "misc/DRWpickup"
   Weapon.AmmoType "DRMGClip"
   Weapon.AmmoGive 50
   Weapon.AmmoUse 1
   Weapon.Kickback 8
   AttackSound "weapons/MGFire"
   +FLOATBOB
   States
   {
   Spawn:
      D3SH A -1
      Loop
   Ready:
      NADA A 1 A_WeaponReady
      Loop
   Select:
	  FADE DCBA 1 BRIGHT A_Raise
   SelectLoop:
	  FADE AAA 0 BRIGHT A_Raise
	  FADE A 1 BRIGHT A_Raise
      Loop
   Deselect:
	  NADS A 0 A_PlaySoundEx("weapons/switch",SoundSlot7,0)
      FADE ABCD 1 BRIGHT A_Lower
	  FADE DDD 0 BRIGHT A_Lower
	  FADE D 1 BRIGHT A_Lower
      Goto Deselect+5
   Fire:
      NADB A 0 A_FireCustomMissile("FlashMG",0,0,4,0)
	  NADB A 0 A_FireCustomMissile("Tracer", random(-1,1), 0, 0, 0, 0, random(-1,1))
      NADB A 1 A_FireBullets(2, 2, 1, 7, "BulletPuff")
      NADB B 1 A_FireCustomMissile("MachinegunCasingSpawner", 0, 0, 0, 1)
	  NADB CD 1
	  NADB D 15 A_Refire
      Goto Ready
   }
}

Actor FlashMG
{
	Height 1
	Radius 1
	+NOINTERACTION
	+CLIENTSIDEONLY
	RenderStyle Add
	Alpha 0.7
	Speed 16
	States
	{
	Spawn:
		NADA A 2 BRIGHT
		Goto Death
	Death:
		TNT1 A 0
		Stop
	}
}

ACTOR DRMGClip : Ammo replaces Clip
{
   //$Category Ammo
   Inventory.Amount 50
   Inventory.MaxAmount 400
   Ammo.BackpackAmount 100
   Ammo.BackpackMaxAmount 800
   Inventory.PickupMessage "Machine Gun Clip"
   Inventory.PickupSound "misc/a_pkup"
   Inventory.Icon ICONA_MG
   States
   {
   Spawn:
	  NADA A 1
      Loop
   }
}

ACTOR ClipRandomSpawner : RandomSpawner 2007
{
	DropItem "DRMGClip" 255 2
    DropItem "DRCGClipBox" 255 1
}

ACTOR DRChaingun : Weapon 7004
{ 
	//$Category Weapons
   Inventory.PickupMessage "Chaingun" 
   Inventory.PickupSound "misc/DRWpickup"
   Weapon.AmmoType "DRCGClipBox"
   Weapon.AmmoGive 100
   Weapon.AmmoUse 1
   Weapon.Kickback 64
   Tag "Chaingun"
   +FLOATBOB
   States 
   { 
   Spawn: 
      D3SH A -1
      LOOP 
   Ready:
      NADA A 1 A_WeaponReady 
      LOOP
   Select:
	  FADE DCBA 1 BRIGHT A_Raise
   SelectLoop:
	  FADE AAA 0 BRIGHT A_Raise
	  FADE A 1 BRIGHT A_Raise
      Loop
   Deselect:
	  NADS A 0 A_PlaySoundEx("blank",SoundSlot6,0)
	  NADS A 0 A_StopSoundEx(SoundSlot6)
	  NADS A 0 A_PlaySoundEx("weapons/switch",SoundSlot7,0)
      FADE ABCD 1 BRIGHT A_Lower
	  FADE DDD 0 BRIGHT A_Lower
	  FADE D 1 BRIGHT A_Lower
      Goto Deselect+5
   Fire: 
      NADB A 3 A_PlaySound("weapons/d3chngunwndup")
      NADB BC 3
	  NADB DEF 2
	  NADB GHIJKLMN 1
      NADB O 1 A_Refire
      Goto Hold+11
   Hold: 
	  NADB A 0 A_FireCustomMissile("MachinegunCasingSpawner", 0, 0, 0, 1)
	  NADB A 0 A_FireCustomMissile("Tracer", random(-6,6), 0, 0, 0, 0, random(-6,6))
	  NADB A 0 A_FireCustomMissile("FlashCG",0,0,3,0)
      NADB A 0 A_FireBullets(6, 6, -1, 5, "BulletPuff")
      NADB A 1 A_PlaySoundEx("weapons/d3chngunwnd",SoundSlot6,1)
	  NADB M 0 A_FireCustomMissile("MachinegunCasingSpawner", 0, 0, 0, 1)
	  NADB M 0 A_FireCustomMissile("Tracer", random(-6,6), 0, 0, 0, 0, random(-6,6))
	  NADB M 0 A_FireCustomMissile("FlashCG",0,0,3,0)
      NADB M 0 A_FireBullets(6, 6, -1, 5, "BulletPuff")
      NADB M 1
	  NADB M 0 A_ReFire
	  NADB A 0 A_PlaySoundEx("blank",SoundSlot6,0)
	  NADC A 0 A_StopSoundEx(SoundSlot6)
      NADC A 1 A_PlaySoundEx("weapons/d3chngunwnddwn",SoundSlot6,0)
      NADC BC 1 A_WeaponReady(14)
	  NADC DEF 2 A_WeaponReady(14)
	  NADC GHI 3 A_WeaponReady(14)
	  NADC JKLMNO 4 A_WeaponReady(14)
	  NADC O 1 A_WeaponReady(14)
      Goto Ready
   } 
} 

Actor FlashCG
{
	Height 1
	Radius 1
	+NOINTERACTION
	+CLIENTSIDEONLY
	RenderStyle Add
	Alpha 1.0
	Speed 16
	States
	{
	Spawn:
		NADA A 0
	    NADA A 0 A_PlaySound("weapons/d3chngunf")
		NADA A 2 BRIGHT
		Goto Death
	Death:
		TNT1 A 0
		Stop
	}
}

ACTOR DRCGClipBox : Ammo replaces Clipbox
{
   //$Category Ammo
   Inventory.Amount 100
   Inventory.MaxAmount 600
   Ammo.BackpackAmount 200
   Ammo.BackpackMaxAmount 1200
   Inventory.PickupMessage "Extratone Bullets"
   Inventory.PickupSound "misc/a_pkup"
   Inventory.Icon ICONA_CG
   States
   {
   Spawn:
	  NADA A 1
      Loop
   }
}

actor ClipBoxRandomSpawner : RandomSpawner 2048
{
	DropItem "DRMGClip" 255 1
    DropItem "DRCGClipBox" 255 2
}

actor ChaingunRandomSpawner : RandomSpawner replaces Chaingun
{
    DropItem "DRChaingun" 255 1
    DropItem "DRMachinegun" 255 1
}

ACTOR DRRocketLauncher : Weapon 7005
{ 
   +WEAPON.EXPLOSIVE
   +WEAPON.NOAUTOAIM
   +FLOATBOB
   Inventory.PickupMessage "Rocket Launcher" 
   Inventory.PickupSound "misc/DRWpickup"
   Weapon.AmmoType "DRRocketBox"
   Weapon.AmmoGive 10
   Weapon.AmmoUse 1
   Weapon.Kickback 2048
   Tag "Rocket Launcher"
   States 
   {
   Spawn: 
      D3SH A -1
      Loop
   Ready:
      NADA A 1 A_WeaponReady
      Loop
   Select:
	  FADE DCBA 1 BRIGHT A_Raise
   SelectLoop:
	  FADE AAA 0 BRIGHT A_Raise
	  FADE A 1 BRIGHT A_Raise
      Loop
   Deselect:
	  NADS A 0 A_PlaySoundEx("weapons/switch",SoundSlot7,0)
      FADE ABCD 1 BRIGHT A_Lower
	  FADE DDD 0 BRIGHT A_Lower
	  FADE D 1 BRIGHT A_Lower
      Goto Deselect+5
   Fire:
      NADB A 0 A_PlayWeaponSound("DRRLFir")
	  NADB A 0 A_FireCustomMissile("FlashRL",0,0,4,0)
      NADB A 4 A_FireCustomMissile("DRRocket", 0, 1, 1, 0)
      NADB BCDEF 4 A_WeaponReady(14)
	  NADB G 4 A_PlaySoundEx("RLRepose",SoundSlot6,0)
	  NADB HIJ 4 A_WeaponReady(14)
      Goto Ready
   } 
}

Actor FlashRL
{
	Height 1
	Radius 1
	+NoBlockMap
	+Missile
	+NoGravity
	+CLIENTSIDEONLY
	RenderStyle Add
	Alpha 1.0
	Speed 16
	States
	{
	Spawn:
		NADA A 2 BRIGHT
		Goto Death
	Death:
		TNT1 A 0
		Stop
	}
}

ACTOR DRRocket
{
   Radius 2
   Height 4
   Speed 48
   Damage 40
   DeathSound "RocketExpl"
   Decal EXPLScorch
   PROJECTILE
   +SPECTRAL
   +MTHRUSPECIES
   States
   {
   Spawn:
      MISL A 0 BRIGHT A_PlaySoundEx("weapons/rocktfly",SoundSlot7,1)
	  MISL A 0 BRIGHT A_SpawnItem("RocketFTrail",-8,0,0)
	  MISL A 0 BRIGHT A_SpawnItemEx("RocketFire1",-16,0,0, (0.1)*Random(5, 15), (0.1)*Random(-5, 5), (0.1)*Random(-5, 5), Random(-8, 8), 128)
	  MISL A 0 BRIGHT A_SpawnItemEx("RocketFire2",-16,0,0, (0.1)*Random(5, 15), (0.1)*Random(-5, 5), (0.1)*Random(-5, 5), Random(-8, 8), 128)
	  MISL A 1 BRIGHT A_SpawnItemEx("RocketFire3",-16,0,0, (0.1)*Random(5, 15), (0.1)*Random(-5, 5), (0.1)*Random(-5, 5), Random(-8, 8), 128)
	  Loop
   Death:
      TNT1 A 0 BRIGHT A_StopSoundEx(SoundSlot7)	
      TNT1 A 0 BRIGHT A_SpawnItem("DRRocketExplosion",0,0,0)
	  TNT1 A 0 BRIGHT A_SpawnItem("DRRocketExplosion2",0,0,0)
	  TNT1 A 1 BRIGHT
	  Stop
   }
}

Actor DRRocketExplosion
{
   Height 1
   Radius 1
   Scale 4.0
   RenderStyle Add
   Alpha 1.0
   +NOGRAVITY
   +NOCLIP
   +NOBLOCKMAP
   +ForceXYBillboard
   +NODAMAGETHRUST
   States
   {
   Spawn:
      NPEX A 0
	  NPEX AAAAAAAAAA 0 BRIGHT A_SpawnItemEx("XFire1", 0,0,0, (0.1)*Random(-40, 40), 0, (0.1)*Random(-40, 40), Random(0, 360), 128)
	  NPEX AAAAAAAAAA 0 BRIGHT A_SpawnItemEx("XFire2", 0,0,0, (0.1)*Random(-40, 40), 0, (0.1)*Random(-40, 40), Random(0, 360), 128)
	  NPEX AAAAAAAAAA 0 BRIGHT A_SpawnItemEx("XFire3", 0,0,0, (0.1)*Random(-40, 40), 0, (0.1)*Random(-40, 40), Random(0, 360), 128)
      NPEX A 1 A_Explode(200,192)
	  NPEX BCDEFGHIJ 1
      Stop
   }
}

Actor DRRocketExplosion2
{
   Height 1
   Radius 1
   Scale 4.0
   RenderStyle Add
   Alpha 1.0
   +NOINTERACTION
   +ForceXYBillboard
   +CLIENTSIDEONLY
   States
   {
   Spawn:
	  NPEX ABCDEFGHIJ 1
      Stop
   }
}

ACTOR XFire1
{
   Speed 0
   Height 1
   Radius 1
   Damage 0
   RenderStyle Add
   Alpha 0.9
   Scale 0.5
   +NOINTERACTION
   +ForceXYBillboard
   +CLIENTSIDEONLY
   States
   {
   Spawn:
	  NADA A 0
      Goto Death
   Death:
	  FLAC AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 1 BRIGHT A_FadeOut(0.03)
      Stop
   }
}

ACTOR XFire2
{
   Speed 0
   Height 1
   Radius 1
   Damage 0
   RenderStyle Add
   Alpha 0.9
   Scale 0.5
   +NOINTERACTION
   +ForceXYBillboard
   +CLIENTSIDEONLY
   States
   {
   Spawn:
	  NADA A 0
      Goto Death
   Death:
	  FLAC BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB 1 BRIGHT A_FadeOut(0.03)
      Stop
   }
}

ACTOR XFire3
{
   Speed 0
   Height 1
   Radius 1
   Damage 0
   RenderStyle Add
   Alpha 0.9
   Scale 0.5
   +NOINTERACTION
   +ForceXYBillboard
   +CLIENTSIDEONLY
   States
   {
   Spawn:
	  NADA A 0
      Goto Death
   Death:
	  FLAC CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC 1 BRIGHT A_FadeOut(0.03)
      Stop
   }
}

ACTOR RocketFTrail
{
   Height 1
   Radius 1
   RenderStyle Add
   Alpha 0.75
   Scale 0.4
   +NOINTERACTION
   +ForceXYBillboard
   +CLIENTSIDEONLY
   States
   {
   Spawn:
	  NADA A 0
      Goto Death
   Death:
	  FRTB ABCDEFGHI 1 BRIGHT
      Stop
   }
}

ACTOR RocketFire1
{
   Speed 0
   Height 1
   Radius 1
   RenderStyle Add
   Alpha 1.0
   Scale 0.08
   +NOINTERACTION
   +ForceXYBillboard
   +CLIENTSIDEONLY
   States
   {
   Spawn:
	  NADA A 0
      Goto Death
   Death:
	  FLAC AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 1 BRIGHT A_FadeOut(0.06)
      Stop
   }
}

ACTOR RocketFire2
{
   Speed 0
   Height 1
   Radius 1
   RenderStyle Add
   Alpha 1.0
   Scale 0.08
   +NOINTERACTION
   +ForceXYBillboard
   +CLIENTSIDEONLY
   States
   {
   Spawn:
	  NADA A 0
      Goto Death
   Death:
	  FLAC BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB 1 BRIGHT A_FadeOut(0.06)
      Stop
   }
}

ACTOR RocketFire3
{
   Speed 0
   Height 1
   Radius 1
   RenderStyle Add
   Alpha 1.0
   Scale 0.08
   +NOINTERACTION
   +ForceXYBillboard
   +CLIENTSIDEONLY
   States
   {
   Spawn:
	  NADA A 0
      Goto Death
   Death:
	  FLAC CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC 1 BRIGHT A_FadeOut(0.06)
      Stop
   }
}

ACTOR DRRocketBox : Ammo replaces RocketAmmo
{
   //$Category Ammo
   Inventory.Amount 10
   Inventory.MaxAmount 50
   Ammo.BackpackAmount 20
   Ammo.BackpackMaxAmount 100
   Inventory.PickupMessage "Rocket Box"
   Inventory.PickupSound "misc/r_pkup"
   Inventory.Icon ICONA_RL
   States
   {
   Spawn:
	  NADA A 1
      Loop
   }
}

ACTOR DRGrenadeLauncher : Weapon 7006
{
   +WEAPON.EXPLOSIVE
   +FLOATBOB
   //$Category Weapons
   Inventory.PickupMessage "Grenade Launcher"
   Inventory.PickupSound "misc/DRWpickup"
   Weapon.AmmoType "DRGrenadeBox"
   Weapon.AmmoUse 1
   Weapon.AmmoGive 10
   Weapon.Kickback 2048
   Tag "Grenade Launcher"
   States
   {
   Spawn:
      D3SH A -1
      Loop
   Ready:
      NADA A 1 A_WeaponReady
      Loop
   Select:
	  FADE DCBA 1 BRIGHT A_Raise
   SelectLoop:
	  FADE AAA 0 BRIGHT A_Raise
	  FADE A 1 BRIGHT A_Raise
      loop
   Deselect:
	  NADS A 0 A_PlaySoundEx("weapons/switch",SoundSlot7,0)
      FADE ABCD 1 BRIGHT A_Lower
	  FADE DDD 0 BRIGHT A_Lower
	  FADE D 1 BRIGHT A_Lower
      Goto Deselect+5
   Fire:
      NADB A 0 A_PlayWeaponSound("weapons/GLFire")
	  NADB A 0 A_FireCustomMissile("FlashRL",0,0,4,0)
	  NADB A 3 A_FireCustomMissile("DRGrenade",0,1,0,0,0,8)
	  NADB BCDEFGHIJ 3 A_WeaponReady(14)
	  NADA A 4 A_WeaponReady(14)
      Goto Ready
   }
}

ACTOR DRGrenade
{
	Radius 4
	Height 8
	Speed 32
	Damage 40
	Projectile
	-NOGRAVITY
	+DOOMBOUNCE
	+SPECTRAL
	+CANBOUNCEWATER
	+MTHRUSPECIES
	SeeSound "weapons/grenadebounce"
	States
	{
	Spawn:
		GRAN A 1 A_JumpIf(waterlevel>1,"Death")
		Loop
	Death:
		NADA A 0 A_PlaySound("RocketExpl")
        NADA A 0 A_SpawnItem("DRRocketExplosion",0,0,0)
		NADA A 1
		Stop
	}
}

ACTOR DRGrenadeBox : Ammo replaces Rocketbox
{
   //$Category Ammo
   Inventory.Amount 10
   Inventory.MaxAmount 50
   Ammo.BackpackAmount 20
   Ammo.BackpackMaxAmount 100
   Inventory.PickupMessage "Grenade Box"
   Inventory.PickupSound "misc/r_pkup"
   Inventory.Icon ICONA_GL
   States
   {
   Spawn:
	  NADA A 1
      Loop
   }
}

actor RocketBoxRandomSpawner : RandomSpawner 2046
{
	DropItem "DRRocketBox" 255 1
    DropItem "DRGrenadeBox" 255 2
}

actor RocketLauncherRandomSpawner : RandomSpawner replaces RocketLauncher
{
    DropItem "DRRocketLauncher" 255 2
    DropItem "DRGrenadeLauncher" 255 1
}

ACTOR DRRailgun : Weapon 7007
{
   //$Category Weapons
   Inventory.PickupMessage "Railgun"
   Inventory.PickupSound "misc/DRWpickup"
   Weapon.SelectionOrder 13
   Weapon.AmmoType "DRSlugs"
   Weapon.AmmoUse 1
   Weapon.AmmoGive 15
   Weapon.Kickback 2048
   Tag "Railgun"
   AttackSound "RGFire"
   +FLOATBOB
   States
   {
   Spawn:
      D3SH A -1
      Loop
   Ready:
	  NADA A 0 A_PlaySoundEx("weapons/railhum",SoundSlot5,1)
      NADA A 1 A_WeaponReady
      Loop
   Select:
	  FADE DCBA 1 BRIGHT A_Raise
   SelectLoop:
	  FADE AAA 0 BRIGHT A_Raise
	  FADE A 1 BRIGHT A_Raise
      Loop
   Deselect:
	  NADS A 0 A_PlaySoundEx("blank",SoundSlot5,0)
	  NADS A 0 A_StopSoundEx(SoundSlot5)
	  NADS A 0 A_PlaySoundEx("weapons/switch",SoundSlot7,0)
      FADE ABCD 1 BRIGHT A_Lower
	  FADE DDD 0 BRIGHT A_Lower
	  FADE D 1 BRIGHT A_Lower
      Goto Deselect+6
   Fire:
	  NADB A 0 A_FireCustomMissile("FlashRG",0,0,4,0)
	  NADB A 2 A_RailAttack(300,4,1,none,"ff ff ff",0,0,"RailPuff")
	  NADB CDEFGHI 2
	  NADB J 2 A_PlaySoundEx("weapons/railreload",SoundSlot6,0)
	  NADB KLMNOPQRST 2 A_WeaponReady(14)
	  NADA A 20 A_WeaponReady(14)
      Goto Ready
   }
}

Actor FlashRG
{
	Height 1
	Radius 1
	+NoBlockMap
	+Missile
	+NoGravity
	+CLIENTSIDEONLY
	RenderStyle Add
	Alpha 1.0
	Speed 16
	States
	{
	Spawn:
		NADA A 2 BRIGHT
		Goto Death
	Death:
		TNT1 A 0
		Stop
	}
}

Actor RGRail
{
  Height 1
  Radius 1
  Alpha 0.35
  Scale 0.2
  +NOINTERACTION
  +FORCEXYBILLBOARD
  +CLIENTSIDEONLY
  States
  {
  Spawn:
    RGRA A 0 BRIGHT
    RGRA A 4 BRIGHT
	RGRA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 1 BRIGHT A_FadeOut(0.03)
    Stop
  }
}

Actor RailPuff
{
   Height 1
   Radius 1
   +PUFFONACTORS
   +ALWAYSPUFF
   +NOBLOCKMAP
   +NOGRAVITY
   +EXTREMEDEATH
   States
   {
   Spawn:
      NADA A 4 BRIGHT
      Stop
   }
}

ACTOR DRSlugs : Ammo 6000
{
   //$Category Ammo
   Inventory.Amount 10
   Inventory.MaxAmount 40
   Ammo.BackpackAmount 20
   Ammo.BackpackMaxAmount 80
   Inventory.PickupMessage "Slugs"
   Inventory.PickupSound "misc/q4pkup"
   Inventory.Icon ICONA_RG
   States
   {
   Spawn:
	  NADA A 1
      Loop
   }
}

actor DRLightningGun : Weapon 7008
{
  //$Category Weapons
  Inventory.PickupMessage "Lightning Gun"
  Inventory.PickupSound "misc/DRWpickup"
  Weapon.AmmoGive 200
  Weapon.AmmoUse 1
  Weapon.AmmoType "DRLightningTube"
  Weapon.Kickback 64
  +FLOATBOB
  Tag "Lightning Gun"
  States
  {
  Spawn:
      D3SH A -1
      Loop
  Ready:
	  NADA A 0 A_PlaySoundEx("LightningHum",SoundSlot5,1)
      NADA A 1 A_WeaponReady
      Loop
  Select:
	  FADE DCBA 1 BRIGHT A_Raise
  SelectLoop:
	  FADE AAA 0 BRIGHT A_Raise
	  FADE A 1 BRIGHT A_Raise
      Loop
   Deselect:
	  NADS A 0 A_PlaySoundEx("blank",SoundSlot5,0)
	  NADS A 0 A_StopSoundEx(SoundSlot5)
	  NADS A 0 A_PlaySoundEx("blank",SoundSlot6,0)
      NADS A 0 A_StopSoundEx(SoundSlot6)
	  NADS A 0 A_PlaySoundEx("weapons/switch",SoundSlot7,0)
      FADE ABCD 1 BRIGHT A_Lower
	  FADE DDD 0 BRIGHT A_Lower
	  FADE D 1 BRIGHT A_Lower
      Goto Deselect+8
  Fire:
      NADB A 0 A_PlaySound("LightningStrom")
	  Goto Hold
  Hold:
	  NADB A 0 A_PlaySoundEx("LightningElec",SoundSlot6,1)
	  NADB A 0 A_FireCustomMissile("FlashLG",0,0,4,0)
      NADB A 1 A_FireCustomMissile("DRLightningBall",0,1,4,0) 
	  NADB A 0 A_ReFire
	  NADB A 0 A_PlaySoundEx("blank",SoundSlot6,0)
	  NADB A 1 A_StopSoundEx(SoundSlot6)
	  NADB BCD 4 A_WeaponReady(11)
	  Goto Ready
  }
}

Actor FlashLG
{
	Height 1
	Radius 1
	+NoBlockMap
	+Missile
	+NoGravity
	+CLIENTSIDEONLY
	RenderStyle Add
	Alpha 1.0
	Speed 16
	States
	{
	Spawn:
		NADA A 2 BRIGHT
		Goto Death
	Death:
		TNT1 A 0
		Stop
	}
}

ACTOR DRLightningBall : FastProjectile
{
   Speed 260
   Height 4
   Radius 2
   Damage 4
   RenderStyle Add
   Alpha 0.25
   DeathSound "LightningHit"
   PROJECTILE
   +NOBLOCKMAP
   +DROPOFF
   +NOGRAVITY
   +NOEXTREMEDEATH
   +SPECTRAL
   +MTHRUSPECIES
   States
   {
   Spawn:
      NADA A 1 BRIGHT
      Loop
   Death:
	  NADA B 1 BRIGHT A_SpawnItem("LightningPuff",0,0,0)
      Stop
   }
}

Actor LightningPuff
{
   Height 1
   Radius 1
   RenderStyle Add
   Alpha 0.5
   Scale 2.0
   SeeSound "LightningHit"
   +NOINTERACTION
   +CLIENTSIDEONLY
   States
   {
   Spawn:
      ZXSE ABCDE 1 BRIGHT
      Stop
   }
}

ACTOR DRLightningTube : Ammo 6001
{
   //$Category Ammo
   Inventory.Amount 80
   Inventory.MaxAmount 800
   Ammo.BackpackAmount 160
   Ammo.BackpackMaxAmount 1600
   Inventory.PickupMessage "Lightning Tube"
   Inventory.PickupSound "misc/litpkup"
   Inventory.Icon ICONA_LG
   States
   {
   Spawn:
	  NADA A 1
      Loop
   }
}

ACTOR DRPlasmarifle : Weapon 7009
{
	+WEAPON.NOAUTOAIM
	+FLOATBOB
   Inventory.PickupMessage "Plasma Rifle"
   Inventory.PickupSound "misc/DRWpickup"
   Weapon.SelectionOrder 5
   Weapon.AmmoType "DRCell"
   Weapon.AmmoGive 60
   Weapon.AmmoUse 1
   Weapon.Kickback 128
   Tag "Plasma Rifle"
   States
   {
   Spawn:
      D3SH A -1
      Loop
   Ready:
      NADA A 0 A_PlaySoundEx("weapons/plasmaidle",SoundSlot5,1)
      NADA A 1 A_WeaponReady
      Loop
   Select:
	  FADE DCBA 1 BRIGHT A_Raise
   SelectLoop:
	  FADE AAA 0 BRIGHT A_Raise
	  FADE A 1 BRIGHT A_Raise
      Loop
   Deselect:
	  NADS A 0 A_PlaySoundEx("blank",SoundSlot5,0)
	  NADS A 0 A_StopSoundEx(SoundSlot5)
	  NADS A 0 A_PlaySoundEx("weapons/switch",SoundSlot7,0)
      FADE ABCD 1 BRIGHT A_Lower
	  FADE DDD 0 BRIGHT A_Lower
	  FADE D 1 BRIGHT A_Lower
      Goto Deselect+6
   Fire:
      NADB A 0 A_PlayWeaponSound("weapons/d3plasmaf")
	  NADB A 0 A_FireCustomMissile("FlashPG",0,0,4,0)
      NADB A 1 A_FireCustomMissile("DRPlasmaBall", 0, 1, 1, 0)
	  NADB B 2
	  NADB C 2 A_ReFire
	  NADB DEF 2 A_WeaponReady(14)
      Goto Ready
   }
}

Actor FlashPG
{
	Height 1
	Radius 1
	+NOINTERACTION
	+CLIENTSIDEONLY
	RenderStyle Add
	Alpha 1.0
	Speed 16
	States
	{
	Spawn:
		NADA A 2 BRIGHT
		Goto Death
	Death:
		TNT1 A 0
		Stop
	}
}

ACTOR DRPlasmaBall
{
   Speed 32
   Height 4
   Radius 2
   Damage 10
   RenderStyle Add
   Alpha 1.0
   Scale 0.4
   DeathSound "weapons/d3plasmax"
   Decal PlasmaDecal
   PROJECTILE
   +NOBLOCKMAP
   +DROPOFF
   +NOGRAVITY
   +ForceXYBillboard
   +NOEXTREMEDEATH
   +MTHRUSPECIES
   States
   {
   Spawn:
      PLBL A 0 A_PlaySoundEx("weapons/plasmafly",SoundSlot5,1)
      PLBL A 1 BRIGHT A_SpawnItemEx("bluefogtrail",-16,0,0,0, (0.1)*Random(-3, 3), (0.1)*Random(-3, 3), Random(-8, 8), 128)
      Loop
   Death:
      NADA A 0 A_StopSoundEx(SoundSlot5)
      TNT1 AAAAAAAAA 0 A_SpawnItemEx("bluefoghit", 0,0,0, (0.1)*Random(-20, 20), 0, (0.1)*Random(-20, 20), Random(0, 360), 128)
	  TNT1 A 1
      Stop
   }
}

ACTOR bluefogtrail
{
   Height 8
   Radius 8
   Damage 0
   Speed 0
   RenderStyle add
   Alpha 0.1
   Scale 0.4
   +NOINTERACTION
   +ForceXYBillboard
   +CLIENTSIDEONLY
   States
   {
   Spawn:
	  PLSZ A 1 BRIGHT
	  PLSZ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 1 BRIGHT A_FadeOut(0.003)
      Stop
   }
}

ACTOR bluefoghit
{
   Height 8
   Radius 8
   Damage 0
   Speed 0
   RenderStyle Add
   Alpha 0.2
   +NOINTERACTION
   +ForceXYBillboard
   +CLIENTSIDEONLY
   States
   {
   Spawn:
	  PLSZ A 1 BRIGHT
	  PLSZ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 1 BRIGHT A_FadeOut(0.008)
      Stop
   }
}

ACTOR DRCell : Ammo replaces Cell
{
   //$Category Ammo
   Inventory.Amount 60
   Inventory.MaxAmount 300
   Ammo.BackpackAmount 120
   Ammo.BackpackMaxAmount 600
   Inventory.PickupMessage "Plasma Cell"
   Inventory.PickupSound "misc/plas_pkup"
   Inventory.Icon ICONA_PG
   States
   {
   Spawn:
	  NADA A 1
      Loop
   }
}

actor CellRandomSpawner : RandomSpawner 2047
{
    DropItem "DRCell" 255 2
    DropItem "DRLightningTube" 255 1
	DropItem "DRSlugs" 255 1
}

actor PlasmarifleRandomSpawner : RandomSpawner replaces PlasmaRifle
{
    DropItem "DRPlasmarifle" 255 2
    DropItem "DRLightninggun" 255 1
	DropItem "DRRailgun" 255 1
}

ACTOR DRBFG9000 : Weapon replaces BFG9000
{
	//$Category Weapons
   +WEAPON.NOAUTOAIM
   +WEAPON.BFG
   +FLOATBOB
   Inventory.PickupMessage "BFG9k"
   Inventory.PickupSound "misc/DRWpickup"
   Weapon.SelectionOrder 7
   Weapon.AmmoType "DRBFGAmmo"
   Weapon.AmmoGive 10
   Weapon.AmmoUse 1
   Weapon.Kickback 4192
   Tag "BFG 9000"
   States
   {
   Spawn:
      D3SH A -1
      Loop
   Ready:
      NADA A 0 A_PlaySoundEx("weapons/d3bfgidle",SoundSlot5,1)
      NADA A 1 A_WeaponReady
      Goto Ready
   Select:
	  FADE DCBA 1 BRIGHT A_Raise
   SelectLoop:
	  FADE AAA 0 BRIGHT A_Raise
	  FADE A 1 BRIGHT A_Raise
      Loop
   Deselect:
	  NADS A 0 A_PlaySoundEx("blank",SoundSlot5,0)
	  NADS A 0 A_StopSoundEx(SoundSlot5)
	  NADS A 0 A_PlaySoundEx("weapons/switch",SoundSlot7,0)
      FADE ABCD 1 BRIGHT A_Lower
	  FADE DDD 0 BRIGHT A_Lower
	  FADE D 1 BRIGHT A_Lower
      Goto Deselect+6
   Fire:
	  NADB A 1 A_PlaySound("weapons/d3bfgf")
	  NADB BCDEFGHIJ 1 A_WeaponReady(14)
      NADC A 2 A_FireCustomMissile("DRBFGBall",0,1,16,0)
	  NADC BCDEFGHIJKLMN 2 A_WeaponReady(14)
	  Goto Ready
   }
}

ACTOR DRBFGBall 
{
   Speed 20
   Height 4
   Radius 2
   Damage 80
   RenderStyle Add
   Alpha 1.0
   DeathSound "weapons/d3bfgx"
   Decal BFGLightning
   PROJECTILE
   +FORCERADIUSDMG
   +NOBLOCKMAP
   +NOGRAVITY
   +DROPOFF
   +ForceXYBillboard
   +MTHRUSPECIES
   States
   {
   Spawn:
      BFGM A 0 BRIGHT A_PlaySoundEx("weapons/d3bfgfly",SoundSlot5,1)
	  BFGM A 0 BRIGHT A_SpawnItemEx("greenfogtrail",-16,0,0,0, (0.1)*Random(-8, 8), (0.1)*Random(-8, 8), Random(-8, 8), 128)
	  BFGM A 1 BRIGHT A_SpawnItem("BFGRail",0,0,0)
	  BFGM B 0 BRIGHT A_PlaySoundEx("weapons/d3bfgfly",SoundSlot5,1)
	  BFGM B 0 BRIGHT A_SpawnItemEx("greenfogtrail",-16,0,0,0, (0.1)*Random(-8, 8), (0.1)*Random(-8, 8), Random(-8, 8), 128)
	  BFGM B 1 BRIGHT A_SpawnItem("BFGRail",0,0,0)
	  BFGM C 0 BRIGHT A_PlaySoundEx("weapons/d3bfgfly",SoundSlot5,1)
	  BFGM C 0 BRIGHT A_SpawnItemEx("greenfogtrail",-16,0,0,0, (0.1)*Random(-8, 8), (0.1)*Random(-8, 8), Random(-8, 8), 128)
	  BFGM C 1 BRIGHT A_SpawnItem("BFGRail",0,0,0)
	  BFGM D 0 BRIGHT A_PlaySoundEx("weapons/d3bfgfly",SoundSlot5,1)
	  BFGM D 0 BRIGHT A_SpawnItemEx("greenfogtrail",-16,0,0,0, (0.1)*Random(-8, 8), (0.1)*Random(-8, 8), Random(-8, 8), 128)
	  BFGM D 1 BRIGHT A_SpawnItem("BFGRail",0,0,0)
	  BFGM E 0 BRIGHT A_PlaySoundEx("weapons/d3bfgfly",SoundSlot5,1)
	  BFGM E 0 BRIGHT A_SpawnItemEx("greenfogtrail",-16,0,0,0, (0.1)*Random(-8, 8), (0.1)*Random(-8, 8), Random(-8, 8), 128)
	  BFGM E 1 BRIGHT A_SpawnItem("BFGRail",0,0,0)
	  BFGM F 0 BRIGHT A_PlaySoundEx("weapons/d3bfgfly",SoundSlot5,1)
	  BFGM F 0 BRIGHT A_SpawnItemEx("greenfogtrail",-16,0,0,0, (0.1)*Random(-8, 8), (0.1)*Random(-8, 8), Random(-8, 8), 128)
	  BFGM F 1 BRIGHT A_SpawnItem("BFGRail",0,0,0)
      Loop
   Death:
      BPLO A 0 BRIGHT A_StopSoundEx(SoundSlot5)
      BPLO A 0 BRIGHT Radius_Quake(9,30,0,16,0)
	  BPLO A 0 BRIGHT Radius_Quake(8,34,0,24,0)
	  BPLO A 0 BRIGHT Radius_Quake(7,38,0,32,0)
	  BPLO A 0 BRIGHT Radius_Quake(6,42,0,40,0)
	  BPLO A 0 BRIGHT Radius_Quake(5,46,0,48,0)
	  BPLO A 0 BRIGHT Radius_Quake(4,50,0,56,0)
	  BPLO A 0 BRIGHT Radius_Quake(3,54,0,64,0)
	  BPLO A 0 BRIGHT Radius_Quake(2,58,0,72,0)
	  BPLO A 0 BRIGHT Radius_Quake(1,62,0,80,0)
      BPLO A 0 BRIGHT A_SpawnItemEx("Shockwave",0,0,0)
      BPLO A 2 BRIGHT A_Explode(250,256,0)
	  BPLO B 1 BRIGHT A_BFGSpray("BFGExtra",15,100)
      BPLO CDEFGHIJKLM 2 BRIGHT
      Stop
   }
}

ACTOR greenfogtrail
{
   Height 8
   Radius 8
   Damage 0
   Speed 0
   RenderStyle add
   Alpha 0.1
   +NOINTERACTION
   +ForceXYBillboard
   +CLIENTSIDEONLY
   States
   {
   Spawn:
	  BFGT A 1 BRIGHT
	  BFGT AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 1 BRIGHT A_FadeOut(0.003)
      Stop
   }
}

ACTOR BFGRail
{  
   Radius 1
   Height 1
   +ISMONSTER
   +FRIENDLY
   -COUNTKILL
   +LOOKALLAROUND
   +NOBLOCKMONST
   +NOGRAVITY
   +NOCLIP
   MaxTargetRange 1024
   RenderStyle None
   States
   {
   Spawn:
      NADA A 0 A_Look
   See:
      NADA A 1 A_Chase
   Missile:
	  NADA A 0 BRIGHT A_CustomRailgun(0,0,none,"00 FF 00",1,1,8,"BFGPuff")
	  NADA A 1 BRIGHT A_CustomRailgun(random(3,10),0,none,"00 FF 00",1,1,16,"BFGPuff")
      Stop
   }
}

Actor BFGPuff
{
   Height 1
   Radius 1
   +PUFFONACTORS
   +ALWAYSPUFF
   +NOINTERACTION
   +RANDOMIZE
   DamageType "Friendly"
   States
   {
   Spawn:
      NADA A 4 BRIGHT
      Stop
   }
}

actor Shockwave
{
  Radius 1
  Height 1
  RenderStyle add
  Alpha 1.0
  +CLIENTSIDEONLY
  +NOINTERACTION
  states
  {
  Spawn:
    NADA ABCDEFGHIJKLMNOPQR 1 bright
	NADA SSSTTTUUUVVVWWWXXXXYYYYZZZZ 1 bright A_FadeOut(0.06)
	NADB AAAAABBBBBCCCCCDDDDDDEEEEEEE 1 bright A_FadeOut(0.06)
    loop
  Death:
    TNT1 A 1
    stop
  }
}

ACTOR DRBFGAmmo : Ammo replaces CellPack
{
   //$Category Ammo
   Inventory.Amount 2
   Inventory.MaxAmount 10
   Ammo.BackpackAmount 4
   Ammo.BackpackMaxAmount 20
   Inventory.PickupMessage "BFG Ammo"
   Inventory.PickupSound "misc/plas_pkup"
   Inventory.Icon ICONA_BF
   States
   {
   Spawn:
	  NADA A 1
      Loop
   }
}

actor CellPackRandomSpawner : RandomSpawner 17
{
    DropItem "DRCell" 255 2
    DropItem "DRLightningTube" 255 1
	DropItem "DRSlugs" 255 1
	DropItem "DRBFGAmmo" 255 3
}

ACTOR WaterSplashSmall
{
	Radius 2
	Height 4
	RenderStyle Add
	Alpha 1.0
	+NOBLOCKMAP
	+DROPOFF
	+NOTELEPORT
	+LOWGRAVITY
	+CANNOTPUSH
	+DONTSPLASH
	+DONTBLAST
	States
	{
	Spawn:
		NADA A 0
		NADA A 0 A_SpawnItemEx("WaterParticle", 8, 0, 0, random(1,4), 0, random(4,8), random(0,359), 129)
		NADA A 0 A_SpawnItemEx("WaterParticle", 8, 0, 0, random(1,4), 0, random(4,8), random(0,359), 129)
		NADA A 0 A_SpawnItemEx("WaterParticle", 8, 0, 0, random(1,4), 0, random(4,8), random(0,359), 129)
		NADA A 0 A_SpawnItemEx("WaterParticle", 8, 0, 0, random(1,4), 0, random(4,8), random(0,359), 129)
		NADA A 0 A_SpawnItemEx("WaterParticle", 8, 0, 0, random(1,4), 0, random(4,8), random(0,359), 129)
		NADA ABCDEF 4
		Stop
	}
}

ACTOR WaterSplashBig : WaterSplashSmall
{
	Scale 2.0
}

Actor WaterParticle
{
  Height 0
  Radius 0
  Mass 0
  +ThruActors
  +Missile
  +NoBlockMap
  -NoGravity
  +DontSplash
  +FORCEXYBILLBOARD
  +CLIENTSIDEONLY
  Gravity 0.9
  RenderStyle Add
  States
  {
  Spawn:
    WPR1 BCD 6
	Goto SpawnLoop
  SpawnLoop:
	WPR1 D 1 A_JumpIf(waterlevel>0,"Death")
    Loop
  Death:
    NADA A 0 A_SpawnItemEx("WaterParticleSplash", 8, 0, 0, random(1,2), 0, random(2,4), random(0,359), 129)
	NADA A 0 A_SpawnItemEx("WaterParticleSplash", 8, 0, 0, random(1,2), 0, random(2,4), random(0,359), 129)
	NADA A 0 A_SpawnItemEx("WaterParticleSplash", 8, 0, 0, random(1,2), 0, random(2,4), random(0,359), 129)
    Stop
  }
}

Actor WaterParticleSplash
{
  Height 0
  Radius 0
  Mass 0
  +ThruActors
  +Missile
  +NoBlockMap
  -NoGravity
  +DontSplash
  +FORCEXYBILLBOARD
  +CLIENTSIDEONLY
  RenderStyle Add
  States
  {
  Spawn:
    WPR1 A 1
    Goto Stand
  Stand:
    WPR1 A 2 A_FadeOut(0.03)
    Loop
  Death:
    TNT1 A 1
    TNT1 A 0
    Stop
  }
}
