/// decorate/weapons.txt by Kaapeli47

/// Weapons ///

/// Common Weapon Class

ACTOR IDMWeapon : Weapon
{
	-WEAPON.ALLOW_WITH_RESPAWN_INVUL
	+WEAPON.NOLMS
}


/// Slot 1 - Melee weapons

// Fist

ACTOR Fist : IDMWeapon // Registered as 'Fist' to ensure Fisting!-medal compatibility.
{
	Weapon.SlotNumber 1
	Weapon.SelectionOrder 2000
	Weapon.Kickback 200
	Obituary "%o was disemboweled by %k's fist."
	Tag "Fist"
	Decal BulletChip
	Damagetype "Punch"
	+WEAPON.MELEEWEAPON
	+WEAPON.ALLOW_WITH_RESPAWN_INVUL
	-WEAPON.NOLMS
	States
	{
	Ready:
	  PUNG A 1 A_WeaponReady
	  Loop
	Deselect:
	  PUNG A 0 A_Lower
	  PUNG A 0 A_Lower
      PUNG A 1 A_Lower
	  Loop
	Select:
	  TNT1 A 0 A_PlaySound("weapons/wswitch",CHAN_WEAPON)
	Sloop:
	  PUNG A 0 A_Raise
	  PUNG A 0 A_Raise
	  PUNG A 1 A_Raise
      Loop
	Fire:
      PUNG B 1
      TNT1 A 0 A_JumpIfInventory("PowerStrength", 1, "Berserked")
      TNT1 A 0 A_JumpIfInventory("PowerIDMWeaponLevel2", 1, "Berserked")
	  TNT1 A 0 A_JumpIfInventory("PowerQuadDamage",1,"Quad")
	Normal:
      PUNG C 1 A_CustomPunch(random(200,250), TRUE,0,"FistHitPuff",64)
      PUNG D 6
	  Goto FireEnd
	Quad:
	  TNT1 A 0 A_Playsound("misc/qdmg",CHAN_AUTO,1)
      PUNG C 1 A_CustomPunch(random(200,250), TRUE,0,"FistHitPuff",64)
      PUNG D 6
	  Goto FireEnd
	Berserked:
	  TNT1 A 0 A_JumpIfInventory("PowerQuadDamage",1,"QuadBerserked")
      PUNG E 1 Bright A_CustomPunch(random(200,250) * 10, TRUE,0,"FistHitPuff",64,1)
	  PUNG F 6 Bright
	  Goto FireEnd
    QuadBerserked:
	  TNT1 A 0 A_Playsound("misc/qdmg",CHAN_AUTO,1)
      PUNG E 1 Bright A_CustomPunch(random(200,250) * 10, TRUE,0,"FistHitPuff",64,1)
	  PUNG F 6 Bright
	FireEnd:
      PUNG C 2
	  PUNG B 1
	  PUNG B 2 Offset(0,40) A_WeaponReady(WRF_NOFIRE)
	  PUNG B 2 Offset(0,36) A_WeaponReady(WRF_NOFIRE)
	  PUNG B 2 Offset(0,33) A_WeaponReady(WRF_NOFIRE)
      TNT1 A 0 A_ReFire
      Goto Ready
	}
}

// Chainsaw

ACTOR StartingChainsaw : IDMWeapon
{
	Weapon.SlotNumber 1
	Weapon.SisterWeapon "DualChainsaw"
	Weapon.Kickback 0
	Weapon.SelectionOrder 1500
	Weapon.ReadySound "weapons/sawidle"
	Inventory.PickupMessage "Chainsaw!"
	Obituary "%o was minced by %k's Chainsaw."
	Damagetype "Saw"
	Tag "Chainsaw"
	Decal BulletChip
	+WEAPON.MELEEWEAPON
	+WEAPON.ALLOW_WITH_RESPAWN_INVUL
	-WEAPON.NOLMS
	States
	{
	Ready:
      SAWG C 3 A_WeaponReady
	  SAWG D 3 A_WeaponReady
      Loop
	Deselect:
      SAWG C 0 A_Lower
      SAWG C 0 A_Lower
      SAWG C 1 A_Lower
      Loop
	Select:
	  TNT1 A 0 A_PlaySound("weapons/wswitch",CHAN_WEAPON)
	Sloop:
      SAWG C 0 A_Raise
      SAWG C 0 A_Raise
      SAWG C 1 A_Raise
	  Loop
	Fire:
	  TNT1 A 0 A_JumpIfInventory("PowerQuadDamage",1,"Quad")
	  SAWG AB 2 A_Saw("weapons/sawfull","weapons/sawhit",random(1,5) * random(1,5),"ChainsawPuff",0,76)
	  TNT1 A 0 A_Refire
      Goto Ready
	Quad:
	  TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
	  SAWG AB 2 A_Saw("weapons/sawfull","weapons/sawhit",random(1,5) * random(1,5),"ExtremePuff",0,76)
	  TNT1 A 0 A_Refire
      Goto Ready
	Spawn:
      CSAW A -1 Bright
      Stop
	}
}

ACTOR DualChainsaw : StartingChainsaw
{
	+POWERED_UP
	+WEAPON.CHEATNOTWEAPON
	Weapon.SisterWeapon "StartingChainsaw"
	Decal BulletChip
	States
	{
	Ready:
      SAW2 C 3 A_WeaponReady
	  SAW2 D 3 A_WeaponReady
      Loop
	Deselect:
      SAW2 C 0 A_Lower
      SAW2 C 0 A_Lower
      SAW2 C 1 A_Lower
      Loop
	Select:
	  TNT1 A 0 A_PlaySound("weapons/wswitch",CHAN_WEAPON)
	Sloop:
      SAW2 C 0 A_Raise
      SAW2 C 0 A_Raise
      SAW2 C 1 A_Raise
      Loop
	Fire:
	  TNT1 A 0 A_JumpIfInventory("PowerQuadDamage",1,"Quad")
	Normal:
	  TNT1 A 0 A_Saw("weapons/sawfull","weapons/sawhit",random(2,10) * random(1,5),"ChainsawPuff",0,76)
	  SAW2 A 2 A_Saw("weapons/sawfull","weapons/sawhit",random(2,10) * random(1,5),"ChainsawPuff",0,76)
	  TNT1 B 0 A_Saw("weapons/sawfull","weapons/sawhit",random(2,10) * random(1,5),"ChainsawPuff",0,76)
	  SAW2 B 2 A_Saw("weapons/sawfull","weapons/sawhit",random(2,10) * random(1,5),"ChainsawPuff",0,76)
      SAWG B 0 A_ReFire
	  Goto Ready
	Quad:
	  TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
	  SAW2 A 0 A_Saw("weapons/sawfull","weapons/sawhit",random(2,10) * random(1,5),"ExtremePuff",0,76)
	  SAW2 A 2 A_Saw("weapons/sawfull","weapons/sawhit",random(2,10) * random(1,5),"ExtremePuff",0,76)
	  SAW2 B 0 A_Saw("weapons/sawfull","weapons/sawhit",random(2,10) * random(1,5),"ExtremePuff",0,76)
	  SAW2 B 2 A_Saw("weapons/sawfull","weapons/sawhit",random(2,10) * random(1,5),"ExtremePuff",0,76)
      SAWG B 0 A_ReFire
      Goto Ready
	Spawn:
      CSAW A -1 Bright
      Stop
	}
}


/// Slot 2 - Small arms

// Pistol

ACTOR IDMPistol : IDMWeapon
{
	Weapon.SelectionOrder 1000
	Weapon.SlotNumber 2
	Weapon.Sisterweapon "DualPistol"
	Weapon.AmmoUse 1
	Weapon.AmmoGive 20
	Weapon.AmmoType "IDMClip"
	Obituary "%o was gunslinged by %k's Pistol."
	Inventory.Pickupmessage "Pistol!"
	Tag "Pistol"
	Decal BulletChip
	Damagetype "Bullet"
	AttackSound "weapons/pistol"
	+WEAPON.ALLOW_WITH_RESPAWN_INVUL
	-WEAPON.NOLMS
    +INVENTORY.IGNORESKILL
	States
	{
	Ready:
      PISG A 1 A_WeaponReady
      Loop
	Deselect:
      PISG A 0 A_Lower
      PISG A 0 A_Lower
      PISG A 1 A_Lower
	  Loop
	Select:
	  TNT1 A 0 A_PlaySound("weapons/wswitch",CHAN_WEAPON)
	Sloop:
      PISG A 0 A_Raise
      PISG A 0 A_Raise
      PISG A 1 A_Raise
	  Loop
    Fire:
      PISG B 0 A_JumpIfInventory("PowerQuadDamage", 1, "Quad")
	  PISG B 0 A_FireBullets(2.8, 1.775, 1, 25, "IDMBulletPuff")
	  Goto FireEnd
	Quad:
	  TNT1 A 0 A_Playsound("misc/qdmg",CHAN_AUTO,1)
	  PISG B 0 A_FireBullets(2.8, 1.775, 1, 25, "ExtremePuff")
	FireEnd:
	  PISG B 5 A_GunFlash
	  PISG C 4
	  PISG A 3
	  PISG A 3 A_Refire
	  Goto Ready
	Flash:
      PISF A 4 Bright A_Light1
      Goto LightDone
    Spawn:
      PIST A -1 Bright
      Stop
	}
}

ACTOR DualPistol : IDMPistol
{
	+POWERED_UP
	+WEAPON.CHEATNOTWEAPON
	Weapon.Sisterweapon "IDMPistol"
	Damagetype "Bullet"
	States
	{
	Ready:
      DPIS A 1 A_WeaponReady
      Loop
	Deselect:
      DPIS A 0 A_Lower
      DPIS A 0 A_Lower
      DPIS A 1 A_Lower
      Loop
	Select:
	  TNT1 A 0 A_PlaySound("weapons/wswitch",CHAN_WEAPON)
	Sloop:
      DPIS A 0 A_Raise
      DPIS A 0 A_Raise
      DPIS A 1 A_Raise
      Loop
	Fire:
	  DPIS A 1
      DPIS B 0 A_JumpIfInventory("PowerQuadDamage", 1, "Quad")
	  DPIS B 0 A_FireBullets(4.2, 1.775, 1, 25, "IDMBulletPuff")
	  TNT1 A 0 A_GunFlash
      DPIS B 3 
      DPIS C 2
	  Goto Normal2
	Quad:
	  TNT1 A 0 A_Playsound("misc/qdmg",CHAN_AUTO,1)
	  DPIS B 0 A_FireBullets(4.2, 1.775, 1, 25, "ExtremePuff")
	  TNT1 A 0 A_GunFlash
      DPIS B 3 
      DPIS C 2
	Normal2:
      DPIS B 0 A_JumpIfInventory("PowerQuadDamage", 1, "Quad2")
	  DPIS A 1 A_CheckReload
	  TNT1 A 0 A_FireBullets(4.2, 1.775, 1, 25, "IDMBulletPuff")
	  TNT1 A 0 A_GunFlash("Flash2")
	  DPIS D 3
      DPIS E 2
      DPIS A 5 A_ReFire
	  Goto Ready
	Quad2:
	  TNT1 A 0 A_Playsound("misc/qdmg",CHAN_AUTO,1)
	  DPIS A 1 A_CheckReload
	  TNT1 A 0 A_FireBullets(4.2, 1.775, 1, 25, "ExtremePuff")
	  TNT1 A 0 A_GunFlash("Flash2")
      DPIS D 3
      DPIS E 2
	  TNT1 A 0 A_ReFire
      Goto Ready
	Flash:
      DPIS F 4 Bright A_Light1
      Goto LightDone
	Flash2:
      DPIS G 4 Bright A_Light1
      Goto LightDone
	Spawn:
      PIST A -1 Bright
      Stop
	}
}


// Machinegun

ACTOR Machinegun : IDMWeapon
{
	Weapon.SelectionOrder 900
	Weapon.SlotNumber 2
	Weapon.AmmoType "IDMClip"
	Weapon.AmmoGive 20
	Weapon.AmmoUse 1
	Inventory.PickupSound "misc/w_pkup" 
	Inventory.PickupMessage "Machinegun!"
	Obituary "%o was lit up by %k's Machinegun."
	AttackSound "weapons/machinegun"
	Tag "Machinegun"
 	Decal BulletChip
	Damagetype "Bullet"
	States 
	{  
	Ready: 
		RGUN A 0 A_WeaponReady  
		RGUN A 0 A_WeaponReady  
		RGUN A 1 A_WeaponReady 
		Loop 
	Deselect: 
		RGUN A 0 A_Lower  
		RGUN A 0 A_Lower  
		RGUN A 1 A_Lower 
		Loop 
	Select: 
		TNT1 A 0 A_PlaySound("weapons/wswitch",CHAN_WEAPON)
	Sloop:
		RGUN A 0 A_Raise  
		RGUN A 0 A_Raise  
		RGUN A 1 A_Raise 
		Loop
	Fire: 
		RGUN C 0 A_GunFlash
		RGUN A 0 A_JumpIfInventory("PowerIDMWeaponLevel2",1,"Level2")
		RGUN C 0 A_JumpIfInventory("PowerQuadDamage", 1, "Quad")
	Normal:
		RGUN C 1 Bright A_FireBullets(4.2, 2.6625, -1, 16, "IDMBulletPuff")
		RGUN B 2 Bright A_GunFlash
		RGUN C 1 Bright A_FireBullets(4.2, 2.6625, -1, 16, "IDMBulletPuff")
		RGUN B 2 Bright A_GunFlash("Flash2")
		RGUN C 1 Bright A_FireBullets(4.2, 2.6625, -1, 16, "IDMBulletPuff")
		RGUN B 2 Bright A_GunFlash
		RGUN A 4
		RGUN A 3 A_Refire
		Goto Ready
	Level2:
		TNT1 A 0 A_JumpIfInventory("PowerQuadDamage", 1, "QuadLevel2")
		RGUN C 1 A_FireBullets(4.2, 2.6625, 2, 16, "IDMBulletPuff")
		RGUN B 1 A_GunFlash
		RGUN C 1 A_FireBullets(4.2, 2.6625, 2, 16, "IDMBulletPuff")
		RGUN B 1 A_GunFlash("Flash2")
		RGUN C 1 A_FireBullets(4.2, 2.6625, 2, 16, "IDMBulletPuff")
		RGUN B 1 A_GunFlash
		RGUN C 1 A_FireBullets(4.2, 2.6625, 2, 16, "IDMBulletPuff")
		RGUN B 1 A_GunFlash("Flash2")
		RGUN A 4
		RGUN A 3 A_Refire
		Goto Ready 
	Quad:
		TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5,1)
		RGUN C 1 A_FireBullets(2.8, 1.775, -1, 15, "ExtremePuff")
		RGUN B 2 A_GunFlash
		TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5,1)
		RGUN C 1 A_FireBullets(2.8, 1.775, -1, 15, "ExtremePuff")
		RGUN B 2 A_GunFlash("Flash2")
		TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5,1)
		RGUN C 1 A_FireBullets(2.8, 1.775, -1, 15, "ExtremePuff")
		RGUN B 2 A_GunFlash
		RGUN A 4
		RGUN A 3 A_Refire
		Goto Ready
	QuadLevel2:
		TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5,1)
		RGUN C 1 A_FireBullets(2.8, 1.775, 2, 15, "ExtremePuff")
		RGUN B 1 A_GunFlash
		TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5,1)
		RGUN C 1 A_FireBullets(2.8, 1.775, 2, 15, "ExtremePuff")
		RGUN B 1 A_GunFlash("Flash2")
		TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5,1)
		RGUN C 1 A_FireBullets(2.8, 1.775, 2, 15, "ExtremePuff")
		RGUN B 1 A_GunFlash
		TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5,1)
		RGUN C 1 A_FireBullets(2.8, 1.775, 2, 15, "ExtremePuff")
		RGUN B 1 A_GunFlash("Flash2")
		RGUN A 4
		RGUN A 3 A_Refire
		Goto Ready
	Flash:
		TNT1 A 2 Bright A_Light1
		Goto LightDone
	Flash2:
		TNT1 AA 2 Bright A_Light1
        Goto LightDone
	Spawn:
		RGUP A -1 Bright
		Stop
	}
}


// Yellowboy

ACTOR Yellowboy : IDMWeapon
{
	Weapon.SelectionOrder 800
	Weapon.SlotNumber 2
	Weapon.AmmoUse 10
	Weapon.AmmoGive 50
	Weapon.AmmoType "IDMClip"
	Weapon.Kickback 200
	Inventory.PickupMessage "Yellowboy!"
	Obituary "%o was sniped by %k's Yellowboy."
	AttackSound "weapons/wchfire"
	Tag "Yellowboy"
	Decal Bulletchip
	Damagetype "Bullet"
	+WEAPON.NOAUTOAIM
	+WEAPON.ALLOW_WITH_RESPAWN_INVUL
	-WEAPON.NOLMS
	States
	{
	Ready:
      WINC A 1 A_WeaponReady
      Loop
	Deselect:
      WINC A 0 A_Lower
      WINC A 0 A_Lower
      WINC A 1 A_Lower
      Loop
	Select:
	  TNT1 A 0 A_PlaySound("weapons/wswitch",CHAN_WEAPON)
	Sloop:
      WINC A 0 A_Raise
      WINC A 0 A_Raise
      WINC A 1 A_Raise
      Loop
	Fire:
      WINC A 2
	Normal:
	  TNT1 A 0 A_JumpIfInventory("PowerIDMWeaponLevel2",1,"Level2")
	  TNT1 A 0 A_JumpIfInventory("PowerQuadDamage",1,"Quad")
      TNT1 A 0 A_FireBullets(0, 0, 1, random(100,150), "IDMBulletPuff", FBF_NORANDOM | FBF_USEAMMO)
	  Goto FireEnd
	Level2:
	  WINC A 0 A_JumpIfInventory("PowerQuadDamage",1,"QuadLevel2")
      WINC B 0 A_RailAttack(random(100,150),0,1,none,"Orange",0,0,"PiercePuff")
	  Goto FireEnd
	QuadLevel2:
	  TNT1 A 0 A_Playsound("misc/qdmg",CHAN_AUTO,1)
	  Goto Level2+1
	Quad:
	  TNT1 A 0 A_Playsound("misc/qdmg",CHAN_AUTO,1)
	  WINC B 0 A_FireBullets(0, 0, 1, random(100,150), "ExtremePuff", FBF_NORANDOM | FBF_USEAMMO)
	FireEnd:
	  WINC B 6 A_GunFlash
      WINC C 5
      WINC D 5 A_Playsound ("weapons/wchlevr")
      WINC ED 5
      WINC C 5
      WINC A 2
      Goto Ready
	Flash:
      LAMZ B 3 Bright A_Light1
      LAMZ A 2 Bright A_Light2
	  Goto LightDone
	Spawn:
      WHCE A -1 Bright
      Stop
	}
}


// Blaster

ACTOR IDMBlaster : IDMWeapon
{
	Weapon.SelectionOrder 800
	Weapon.SlotNumber 2
	Weapon.Ammotype "IDMCell"
	Weapon.Ammouse 2
	Weapon.Ammogive 20
	Inventory.PickupMessage "Blaster!"
	Tag "Blaster"
	+WEAPON.ALLOW_WITH_RESPAWN_INVUL
	-WEAPON.NOLMS
	States
	{
	Ready:
	  BLAS A 1 A_WeaponReady
	  Loop
	Deselect:
	  BLAS A 0 A_Lower
	  BLAS A 0 A_Lower
	  BLAS A 1 A_Lower
	  Loop
	Select:
	  TNT1 A 0 A_PlaySound("weapons/wswitch",CHAN_WEAPON)
	Sloop:
	  BLAS A 0 A_Raise
	  BLAS A 0 A_Raise
	  BLAS A 1 A_Raise
	  Loop
	Fire:
	  TNT1 A 0 A_GunFlash
	  TNT1 A 0 A_JumpIfInventory("PowerIDMWeaponLevel2",1,"Level2")
	  TNT1 A 0 A_JumpIfInventory("PowerQuadDamage",1,"Quad")
	  BLAS B 5 Bright A_FireCustomMissile("BlasterShot")
	  Goto FireEnd
	Quad:
	  TNT1 A 0 A_Playsound("misc/qdmg",CHAN_AUTO,1)
	  BLAS B 5 Bright A_FireCustomMissile("ExtremeBlasterShot")
	  Goto FireEnd
	Level2:
	  TNT1 A 0 A_JumpIfInventory("PowerQuadDamage",1,"QuadLevel2")
	  TNT1 A 0 A_FireCustomMissile("BlasterShot",-5)
	  TNT1 A 0 A_FireCustomMissile("BlasterShot",5)
	  BLAS B 5 Bright A_FireCustomMissile("BlasterShot")
	  Goto FireEnd
	QuadLevel2:
	  TNT1 A 0 A_Playsound("misc/qdmg",CHAN_AUTO,1)
	  TNT1 A 0 A_FireCustomMissile("ExtremeBlasterShot",-5)
	  TNT1 A 0 A_FireCustomMissile("ExtremeBlasterShot",5)
	  BLAS B 5 Bright A_FireCustomMissile("ExtremeBlasterShot")
	FireEnd:
	  BLAS C 5 Bright
	  BLAS A 4 Bright
	  BLAS A 4
	  TNT1 A 0 A_Refire
	  Goto Ready
	Flash:
	  BLAF A 2 A_Light1
	  BLAF A 2 A_Light2
	  Goto LightDone
	Spawn:
	  BLST A -1 Bright
	  Stop
	}
}


/// Slot 3 - Shotguns

// Boomstick (Quake shotgun)

ACTOR Boomstick : IDMWeapon
{
	Weapon.SelectionOrder 900
	Weapon.SlotNumber 3
	Weapon.AmmoType "IDMShell"
	Weapon.AmmoGive 4
	Weapon.AmmoUse 1
	Weapon.Kickback 200
	Inventory.PickupMessage "Boomstick!"
	Obituary "%o chewed on %k's boomstick."
	Attacksound "weapons/bstick"
	Tag "Boomstick"
	Decal Bulletchip
	Damagetype "Bullet"
	+WEAPON.ALLOW_WITH_RESPAWN_INVUL
	-WEAPON.NOLMS
	States
	{
	Spawn:
	  BOMS A -1 Bright
	  Stop
	Ready:
	  BSTK A 1 A_WeaponReady
  	  Loop
	Deselect:
	  BSTK A 0 A_Lower
	  BSTK A 0 A_Lower
	  BSTK A 1 A_Lower
	  Loop
	Select:
	  TNT1 A 0 A_PlaySound("weapons/wswitch",CHAN_WEAPON)
	Sloop:
	  BSTK A 0 A_Raise
	  BSTK A 0 A_Raise
	  BSTK A 1 A_Raise
	  Loop
	Fire:
	  BSTK B 0 A_GunFlash
	  BSTK B 0 A_JumpIfInventory("PowerIDMWeaponLevel2",1,"Level2")
	  BSTK B 0 A_JumpIfInventory("PowerQuadDamage",1,"Quad")
	Normal:
	  BSTK B 6 A_Firebullets(2.8,1.775,8,5,"IDMBulletPuff")
	  Goto FireEnd
	Level2:
	  TNT1 A 0 A_JumpIfInventory("PowerQuadDamage", 1, "QuadLevel2")
	  BSTK B 2 A_Firebullets(2.8,1.775,8,5,"IDMBulletPuff",FBF_NOFLASH)
	  BSTK B 2 A_Firebullets(2.8,1.775,8,5,"IDMBulletPuff",FBF_NOFLASH)
	  BSTK B 2 A_Firebullets(2.8,1.775,8,5,"IDMBulletPuff")
	  Goto FireEnd
	Quad:
	  TNT1 A 0 A_Playsound("misc/qdmg",CHAN_AUTO,1)
	  BSTK B 6 A_Firebullets(2.8,1.775,8,5,"ExtremePuff")
	  Goto FireEnd
	QuadLevel2:
	  TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5,1)
	  BSTK B 2 A_Firebullets(2.8,1.775,8,5,"IDMBulletPuff",FBF_NOFLASH)
	  TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5,1)
	  BSTK B 2 A_Firebullets(2.8,1.775,8,5,"IDMBulletPuff",FBF_NOFLASH)
	  TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5,1)
	  BSTK B 2 A_Firebullets(2.8,1.775,8,5,"IDMBulletPuff")
	FireEnd:
	  BSTK C 6
	  BSTK A 6
	  BSTK A 0 A_Refire
	  Goto Ready
	Flash:
	  BSTK D 4 Bright A_Light1
	  Goto LightDone
	}
}

// Buckshot (Quake Super Shotgun)

ACTOR BuckShot : IDMWeapon
{
	Weapon.SelectionOrder 900
	Weapon.SlotNumber 3
	Weapon.AmmoType "IDMShell"
	Weapon.AmmoGive 4
	Weapon.AmmoUse 2
	Weapon.Kickback 200
	Inventory.PickupMessage "Buckshot!"
	Obituary "%o ate 2 loads of %k's Buckshot."
	Attacksound "weapons/dbstck"
	Tag "Buckshot"
	Decal Bulletchip
	Damagetype "Bullet"
	+WEAPON.ALLOW_WITH_RESPAWN_INVUL
	-WEAPON.NOLMS
	States
	{
	Spawn:
	  DBMS A -1 Bright
	  Stop
	Ready:
	  DBST A 1 A_WeaponReady
	  Loop
	Deselect:
	  DBST A 0 A_Lower
	  DBST A 0 A_Lower
	  DBST A 1 A_Lower
	  Loop
	Select:
	  TNT1 A 0 A_PlaySound("weapons/wswitch",CHAN_WEAPON)
	Sloop:
	  DBST A 0 A_Raise
	  DBST A 0 A_Raise
	  DBST A 1 A_Raise
	  Loop
	Fire:
	  DBST B 0 A_GunFlash
	  BSTK B 0 A_JumpIfInventory("PowerIDMWeaponLevel2",1,"Level2")
	  BSTK B 0 A_JumpIfInventory("PowerQuadDamage",1,"Quad")
	Normal:
	  DBST A 4 A_Firebullets(5.6,3.55,16,5,"IDMBulletPuff")
	  Goto FireEnd
	Level2:
	  TNT1 A 0 A_JumpIfInventory("PowerQuadDamage", 1, "QuadLevel2")
	  DBST A 2 A_Firebullets(5.6,3.55,16,5,"IDMBulletPuff",FBF_NOFLASH)
	  DBST A 2 A_Firebullets(5.6,3.55,16,5,"IDMBulletPuff")
	  Goto FireEnd
	Quad:
	  TNT1 A 0 A_Playsound("misc/qdmg",CHAN_AUTO,1)
	  DBST A 4 A_Firebullets(5.6,3.55,16,5,"ExtremePuff")
	  Goto FireEnd
	QuadLevel2:
	  TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5,1)
	  DBST A 2 A_Firebullets(5.6,3.55,16,5,"ExtremePuff",FBF_NOFLASH)
	  TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5,1)
	  DBST A 2 A_Firebullets(5.6,3.55,16,5,"ExtremePuff")
	FireEnd:
	  DBST B 8
	  DBST C 7
	  DBST A 6
	  DBST A 0 A_Refire
	  Goto Ready
	Flash:
	  DBST D 5 Bright A_Light1
	  Goto LightDone
	}
}

// Shotgun (Doom)

ACTOR IDMShotgun : IDMWeapon replaces Shotgun
{
  Weapon.SelectionOrder 700
  Weapon.SlotNumber 3
  Weapon.Sisterweapon "ShotgunLevel2"
  Weapon.AmmoUse 1
  Weapon.AmmoGive 10
  Weapon.Kickback 200
  Weapon.AmmoType "IDMShell"
  Inventory.PickupMessage "Shotgun!"
  Obituary "%o was peppered by %k's Shotgun."
  Tag "Shotgun"
  Decal BulletChip
  Damagetype "Bullet"
  AttackSound "weapons/shotgf"
  States
  {
  Ready:
    SHTG A 1 A_WeaponReady
    Loop
  Deselect:
    SHTG A 0 A_Lower
    SHTG A 0 A_Lower
    SHTG A 1 A_Lower
    Loop
  Select:
	TNT1 A 0 A_PlaySound("weapons/wswitch",CHAN_WEAPON)
  Sloop:
    SHTG A 0 A_Raise
    SHTG A 0 A_Raise
    SHTG A 1 A_Raise
    Loop
  Fire:
    SHTG A 1
	SHTG A 0 A_JumpIfInventory("PowerQuadDamage", 1, "Quad")
  Normal:
    SHTG A 0 A_FireBullets (5.6, 3.55, 18, 5, "IDMBulletPuff")
	Goto FireEnd
  Quad:
	TNT1 A 0 A_Playsound("misc/qdmg",CHAN_AUTO,1)
	SHTG A 0 A_FireBullets (5.6, 3.55, 18, 5, "ExtremePuff")
  FireEnd:
    SHTG A 7 A_GunFlash
    SHTG BC 5
    SHTG D 4
    SHTG CB 5
    SHTG A 3
    SHTG A 7 A_ReFire
    Goto Ready
  Flash:
    SHTF B 4 Bright A_Light1
    SHTF A 2 Bright A_Light2
    Goto LightDone
  Spawn:
    SHOT A -1 Bright
    Stop
  }
}

ACTOR ShotgunLevel2 : IDMShotgun
{
  +POWERED_UP
  +WEAPON.CHEATNOTWEAPON
  Weapon.Sisterweapon "IDMShotgun"
  Damagetype "Bullet"
  Tag "Shotgun"
  States
  {
  Ready:
    SHL2 A 1 A_WeaponReady
    Loop
  Deselect:
    SHL2 A 0 A_Lower
    SHL2 A 0 A_Lower
    SHL2 A 1 A_Lower
    Loop
  Select:
	TNT1 A 0 A_PlaySound("weapons/wswitch",CHAN_WEAPON)
  Sloop:
    SHL2 A 0 A_Raise
    SHL2 A 0 A_Raise
    SHL2 A 1 A_Raise
    Loop
  Fire:
    SHL2 A 1
	SHL2 A 0 A_JumpIfInventory("PowerQuadDamage", 1, "Quad")
  Normal:
    SHL2 A 0 A_FireBullets (5.6, 3.55, 36, 5, "IDMBulletPuff")
	Goto FireEnd
  Quad:
	TNT1 A 0 A_Playsound("misc/qdmg",CHAN_AUTO,1)
	SHL2 A 0 A_FireBullets (5.6, 3.55, 36, 5, "ExtremePuff")
  FireEnd:
    SHL2 A 7 A_GunFlash
    SHL2 BC 5
    SHL2 D 4
    SHL2 CB 5
    SHL2 A 3
    SHL2 A 7 A_ReFire
    Goto Ready
  Flash:
    SHL2 F 4 Bright A_Light1
    SHL2 E 2 Bright A_Light2
    Goto LightDone
	}
}
	
// Super Shotgun (Doom II)

ACTOR IDMSuperShotgun : IDMWeapon replaces SuperShotgun
{
  Weapon.SelectionOrder 400
  Weapon.SlotNumber 3
  Weapon.Sisterweapon "SuperShotgunLevel2"
  Weapon.AmmoUse 2
  Weapon.AmmoGive 10
  Weapon.AmmoType "IDMShell"
  Weapon.Kickback 200
  Inventory.PickupMessage "Super Shotgun!"
  Obituary "%o was splattered by %k's Super Shotgun."
  Tag "Super Shotgun"
  Decal BulletChip
  Damagetype "Bullet"
  AttackSound "weapons/sshotf"
  States
  {
  Ready:
    SHT2 A 1 A_WeaponReady
    Loop
  Deselect:
    SHT2 A 0 A_Lower
    SHT2 A 0 A_Lower
	SHT2 A 1 A_Lower
    Loop
  Select:
	TNT1 A 0 A_PlaySound("weapons/wswitch",CHAN_WEAPON)
  Sloop:
    SHT2 A 0 A_Raise
    SHT2 A 0 A_Raise
    SHT2 A 1 A_Raise
    Loop
  Fire:
	SHT2 A 3
	SHT2 A 0 A_JumpIfInventory("PowerQuadDamage", 1, "Quad")
  Normal:
	SHT2 A 0 A_GunFlash
    SHT2 A 7 Bright A_FireBullets(11.2, 7.1, 50, 5, "IDMBulletPuff")
	Goto FireEnd
  Quad:
	TNT1 A 0 A_Playsound("misc/qdmg",CHAN_AUTO,1)
	SHT2 A 0 A_GunFlash
	SHT2 A 7 Bright A_FireBullets(11.2, 7.1, 50, 5, "ExtremePuff")
	Goto FireEnd
  FireEnd:
    SHT2 B 7
    SHT2 C 7 A_CheckReload
    SHT2 D 7 A_OpenShotgun2
    SHT2 E 7
    SHT2 F 7 A_LoadShotgun2
    SHT2 G 6
    SHT2 H 6 A_CloseShotgun2
    SHT2 A 5 A_ReFire
    Goto Ready
  Flash:
    SHT2 J 4 Bright A_Light1
    SHT2 I 2 Bright A_Light2
    Goto LightDone
  Spawn:
    SGN2 A -1 Bright
    Stop
  }
}

ACTOR SuperShotgunLevel2 : IDMSuperShotgun
{
  Weapon.Sisterweapon "IDMSuperShotgun"
  +POWERED_UP
  States
  {
  Ready:
    SHT3 A 1 A_WeaponReady
    Loop
  Deselect:
    SHT3 A 0 A_Lower
    SHT3 A 0 A_Lower
	SHT3 A 1 A_Lower
    Loop
  Select:
	TNT1 A 0 A_PlaySound("weapons/wswitch",CHAN_WEAPON)
  Sloop:
    SHT3 A 0 A_Raise
    SHT3 A 0 A_Raise
    SHT3 A 1 A_Raise
    Loop
  Fire:
	SHT3 A 3
	SHT3 A 0 A_JumpIfInventory("PowerQuadDamage", 1, "Quad")
  Normal:
	SHT3 A 0 A_GunFlash
    SHT3 A 7 Bright A_FireBullets(11.2, 7.1, 150, 5, "IDMBulletPuff")
	Goto FireEnd
  Quad:
	TNT1 A 0 A_Playsound("misc/qdmg",CHAN_AUTO,1)
	SHT3 A 0 A_GunFlash
	SHT3 A 7 Bright A_FireBullets(11.2, 7.1, 150, 5, "ExtremePuff")
	Goto FireEnd
  FireEnd:
    SHT3 B 7
    SHT3 C 7 A_CheckReload
    SHT3 D 7 A_OpenShotgun2
    SHT3 E 7
    SHT3 F 7 A_LoadShotgun2
    SHT3 G 6
    SHT3 H 6 A_CloseShotgun2
    SHT3 A 5 A_ReFire
    Goto Ready
  Flash:
    SHT3 J 4 Bright A_Light1
    SHT3 I 2 Bright A_Light2
    Goto LightDone
  }
}


// Riot Shotgun (Shadow Warrior)

ACTOR RiotShotgun  : IDMWeapon
{
  Weapon.SelectionOrder 400
  Weapon.KickBack 150
  Weapon.SlotNumber 3
  Weapon.AmmoUse 1
  Weapon.AmmoGive 10
  Weapon.AmmoType "IDMShell"
  Inventory.PickupMessage "Riot Shotgun!"
  Obituary "%o caught a dozen pellets from %k's Riot Shotgun."
  Tag "Riot Shotgun"
  Decal BulletChip
  Damagetype "Bullet"
  AttackSound "weapons/riotshf"
  States
  {
  Ready:
    ASHG A 1 A_WeaponReady
    Loop
  Deselect:
    ASHG A 0 A_Lower
    ASHG A 0 A_Lower
	ASHG A 1 A_Lower
    Loop
  Select:
	TNT1 A 0 A_PlaySound("weapons/wswitch",CHAN_WEAPON)
  Sloop:
    ASHG A 0 A_Raise
    ASHG A 0 A_Raise
    ASHG A 1 A_Raise
    Loop
  Fire:
	TNT1 A 0 A_JumpIfInventory("PowerIDMWeaponLevel2",1,"Level2")
	TNT1 A 0 A_JumpIfInventory("PowerQuadDamage",1,"Quad")
	TNT1 A 0 A_GunFlash
	ASHG B 1 Bright Offset(0,41) A_FireBullets(5.6,3.55,15,5,"IDMBulletPuff")
	ASHG C 1 Bright Offset(0,41)
	ASHG F 1 Offset(0,38)
	ASHG E 1 Offset(0,38)
	ASHG A 1 Offset(0,36)
	TNT1 A 0 A_CheckReload
	TNT1 A 0 A_GunFlash
	ASHG B 1 Bright Offset(0,41) A_FireBullets(5.6,3.55,15,5,"IDMBulletPuff")
	ASHG C 1 Bright Offset(0,41)
	ASHG F 1 Offset(0,38)
	ASHG E 1 Offset(0,38)
	ASHG A 1 Offset(0,36)
	TNT1 A 0 A_CheckReload
	TNT1 A 0 A_GunFlash
	ASHG B 1 Bright Offset(0,41) A_FireBullets(5.6,3.55,15,5,"IDMBulletPuff")
	ASHG C 1 Bright Offset(0,41)
	ASHG F 1 Offset(0,38)
	ASHG E 1 Offset(0,38)
	ASHG A 1 Offset(0,36)
	TNT1 A 0 A_CheckReload
	TNT1 A 0 A_GunFlash
	ASHG B 1 Bright Offset(0,41) A_FireBullets(5.6,3.55,15,5,"IDMBulletPuff")
	Goto FireEnd
  Quad:
	TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
	TNT1 A 0 A_GunFlash
	ASHG B 1 Bright Offset(0,41) A_FireBullets(5.6,3.55,15,5,"ExtremePuff")
	ASHG C 1 Bright Offset(0,41)
	ASHG F 1 Offset(0,38)
	ASHG E 1 Offset(0,38)
	ASHG A 1 Offset(0,36)
	TNT1 A 0 A_CheckReload
	TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
	TNT1 A 0 A_GunFlash
	ASHG B 1 Bright Offset(0,41) A_FireBullets(5.6,3.55,15,5,"ExtremePuff")
	ASHG C 1 Bright Offset(0,41)
	ASHG F 1 Offset(0,38)
	ASHG E 1 Offset(0,38)
	ASHG A 1 Offset(0,36)
	TNT1 A 0 A_CheckReload
	TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
	TNT1 A 0 A_GunFlash
	ASHG B 1 Bright Offset(0,41) A_FireBullets(5.6,3.55,15,5,"ExtremePuff")
	ASHG C 1 Bright Offset(0,41)
	ASHG F 1 Offset(0,38)
	ASHG E 1 Offset(0,38)
	ASHG A 1 Offset(0,36)
	TNT1 A 0 A_CheckReload
	TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
	TNT1 A 0 A_GunFlash
	ASHG B 1 Bright Offset(0,41) A_FireBullets(5.6,3.55,15,5,"ExtremePuff")
	Goto FireEnd
  Level2:
	TNT1 A 0 A_JumpIfInventory("PowerQuadDamage",1,"QuadLevel2")
	TNT1 A 0 A_GunFlash
	TNT1 A 0 A_FireBullets(11.2,7.1,90,5,"IDMBulletPuff")
	ASHG C 2 Bright Offset(0,44) A_Playsound("weapons/sshotf",CHAN_WEAPON)
	ASHG B 2 Bright Offset(0,44) A_Playsound("weapons/qshotf",CHAN_WEAPON)
	Goto FireEnd
  QuadLevel2:
	TNT1 A 0 A_GunFlash
	TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
	TNT1 A 0 A_FireBullets(11.2,7.1,90,5,"ExtremePuff")
	ASHG C 2 Bright Offset(0,44) A_Playsound("weapons/sshotf",CHAN_WEAPON)
	ASHG B 2 Bright Offset(0,44) A_Playsound("weapons/qshotf",CHAN_WEAPON)
  FireEnd:
	ASHG C 1 Bright Offset(0,44)
	ASHG F 1 Offset(0,44)
	ASHG D 2 Offset(0,44)
	ASHG A 1 Offset(0,44)
	TNT1 A 0 A_CheckReload
	ASHG A 1 Offset(0,44) A_Playsound("weapons/riotrel",CHAN_7)
	ASHG D 2 Offset(0,44)
	ASHG E 1 Offset(0,44)
	ASHG F 2 Offset(0,44)
	ASHG A 1 Offset(0,44)
	ASHG D 2 Offset(0,44)
	ASHG E 1 Offset(0,44)
	ASHG F 2 Offset(0,44)
	ASHG D 1 Offset(0,44)
	ASHG E 2 Offset(0,44)
	ASHG F 1 Offset(0,44)
	ASHG A 2 Offset(0,44)
	ASHG D 1 Offset(0,44)
	ASHG E 2 Offset(0,44)
	ASHG F 1 Offset(0,44)
	ASHG A 7 Offset(0,44)
	ASHG A 2 Offset(0,39) A_Playsound("weapons/riotrdy",CHAN_7)
	ASHG A 2 Offset(0,36)
	ASHG A 3 Offset(0,33)
	TNT1 A 0 A_Refire
	Goto Ready
  Flash:
	TNT1 A 3 A_Light1
	TNT1 A 3 A_Light0
	Goto LightDone
  Spawn:
	ASHT A -1 Bright
	Stop
  }
}


/// Slot 4 - Heavy Bullet weapons

// Chaingun (Doom)

ACTOR IDMChaingun : IDMWeapon replaces Chaingun
{
  Weapon.SlotNumber 4
  Weapon.Sisterweapon "IDMChaingunLevel2"
  Weapon.SelectionOrder 800
  Weapon.AmmoUse 1
  Weapon.AmmoGive 25
  Weapon.AmmoType "IDMClip"
  Inventory.PickupMessage "Chaingun!"
  Obituary "%o was perforated by %k's Chaingun."
  Attacksound "weapons/Pistol"
  Tag "Chaingun"
  Damagetype "Bullet"
  Decal Bulletchip
  +WEAPON.ALLOW_WITH_RESPAWN_INVUL
  -WEAPON.NOLMS
  States
  {
  Ready:
    CHGG A 1 A_WeaponReady
	Loop
  Deselect:
    CHGG A 0 A_Lower
    CHGG A 0 A_Lower
    CHGG A 1 A_Lower
    Loop
  Select:
	TNT1 A 0 A_PlaySound("weapons/wswitch",CHAN_WEAPON)
  Sloop:
    CHGG A 0 A_Raise
    CHGG A 0 A_Raise
    CHGG A 1 A_Raise
    Loop
  Fire:
  Normal:
    CHGG A 0 A_JumpIfInventory("PowerQuadDamage", 1, "Quad")
    CHGG A 0 A_GunFlash
    CHGG A 4 A_FireBullets(5.6, 3.55, random(1,2), 10,"IDMBulletPuff")
	CHGG A 0 A_JumpIfNoAmmo("Unspool")
  Normal2:
    CHGG A 0 A_JumpIfInventory("PowerQuadDamage", 1, "Quad2")
    CHGG B 0 A_GunFlash("Flash2")
    CHGG B 4 A_FireBullets(5.6, 3.55, random(1,2), 10,"IDMBulletPuff")
	CHGG B 0 A_JumpIfNoAmmo("Unspool")
	CHGG B 0 A_Refire("Normal")
  Unspool:
	CHGG AB 5
	Goto Ready
  Quad:
	TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
    CHGG A 0 A_GunFlash
    CHGG A 4 A_FireBullets(5.6, 3.55, random(1,2), 10,"ExtremePuff")
	CHGG A 0 A_JumpIfNoAmmo("Unspool")
	Goto Normal2
  Quad2:
	TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
    CHGG B 0 A_GunFlash("Flash2")
    CHGG B 4 A_FireBullets(5.6, 3.55, random(1,2), 10,"ExtremePuff")
	CHGG B 0 A_JumpIfNoAmmo("Unspool")
	CHGG B 0 A_Refire("Normal")
	Goto Unspool
  Flash:
    CHGF A 5 Bright A_Light1
	Goto LightDone
  Flash2:
    CHGF B 5 Bright A_Light2
	Goto LightDone
  Spawn:
    MGUN A -1 Bright
    Stop
  }
}

ACTOR IDMChaingunLevel2 : IDMChaingun
{
  +POWERED_UP
  +WEAPON.CHEATNOTWEAPON
  Weapon.AmmoGive 0
  Weapon.AmmoUse 1
  Weapon.Sisterweapon "IDMChaingun"
  Damagetype "Bullet"
  Tag "Chaingun"
  States
  {
  Ready:
    CHG2 A 1 A_WeaponReady
	Loop
  Deselect:
    CHG2 A 0 A_Lower
    CHG2 A 0 A_Lower
    CHG2 A 1 A_Lower
    Loop
  Select:
	TNT1 A 0 A_PlaySound("weapons/wswitch",CHAN_WEAPON)
  Sloop:
    CHG2 A 0 A_Raise
    CHG2 A 0 A_Raise
    CHG2 A 1 A_Raise
    Loop
  Fire:
  Normal:
    CHG2 A 0 A_JumpIfInventory("PowerQuadDamage", 1, "Quad")
    CHG2 A 0 A_GunFlash
    CHG2 A 4 A_FireBullets(5.6, 3.55, random(2,6), 10,"IDMBulletPuff")
	CHG2 A 0 A_JumpIfNoAmmo("Unspool")
  Normal2:
    CHG2 A 0 A_JumpIfInventory("PowerQuadDamage", 1, "Quad2")
    CHG2 B 0 A_GunFlash("Flash2")
    CHG2 B 4 A_FireBullets(5.6, 3.55, random(2,6), 10,"IDMBulletPuff")
	CHG2 B 0 A_JumpIfNoAmmo("Unspool")
	CHG2 B 0 A_Refire("Fire")
  Unspool:
	CHG2 ABA 4
	CHG2 BA 5
	Goto Ready
  Quad:
	TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
    CHG2 A 0 A_GunFlash
    CHG2 A 4 A_FireBullets(5.6, 3.55, random(2,6), 10,"ExtremePuff")
	CHG2 A 0 A_JumpIfNoAmmo("Unspool")
	Goto Normal2
  Quad2:
	TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
    CHG2 B 0 A_GunFlash("Flash2")
    CHG2 B 4 A_FireBullets(5.6, 3.55, random(2,6), 10,"ExtremePuff")
	CHG2 B 0 A_JumpIfNoAmmo("Unspool")
	CHG2 B 0 A_Refire("Fire")
	Goto Unspool
  Flash:
    CH2F A 5 Bright A_Light1
	Goto LightDone
  Flash2:
    CH2F B 5 Bright A_Light2
	Goto LightDone
  }
}

// Super Chaingun


ACTOR GunSpinnerDummy : Inventory
{
	Inventory.Amount 1
	Inventory.MaxAmount 1
}

ACTOR SuperChainGun : IDMWeapon
{
  Weapon.SlotNumber 4
  Weapon.SelectionOrder 500
  Weapon.Sisterweapon "SuperChaingunLevel2"
  Weapon.AmmoUse 1
  Weapon.AmmoGive 100
  Weapon.AmmoType "IDMClip"
  Inventory.PickupMessage "Super Chaingun!"
  Obituary "%o was made Swiss cheese by %k's Super Chaingun."
  Tag "Super Chaingun"
  Decal BulletChip
  Damagetype "Bullet"
  Attacksound "weapons/chngun"
  States
  {
  Ready:
    SCHG A 1 A_WeaponReady
	Loop
  Deselect:
	TNT1 A 0 A_JumpIfInventory("GunSpinnerDummy",1,"FireDeselect")
	Goto Desloop
  FireDeselect:
    SCHG B 0 A_Playsound("weapons/chngnstop")
  Desloop:
	TNT1 A 0 A_TakeInventory("GunSpinnerDummy")
    SCHG A 0 A_Lower
    SCHG A 0 A_Lower
    SCHG A 1 A_Lower
    Loop
  Select:
	TNT1 A 0 A_PlaySound("weapons/wswitch",CHAN_WEAPON)
  Sloop:
    SCHG A 0 A_Raise
    SCHG A 0 A_Raise
    SCHG A 1 A_Raise
    Loop
  Fire:
  NormalA:
    SCHG A 0 A_GunFlash
    SCHG A 0 A_JumpIfInventory("PowerQuadDamage", 1, "QuadA")
    SCHG A 4 A_FireBullets(5.6, 3.55, random(1,2), 10,"IDMBulletPuff")
  NormalB:
    SCHG B 0 A_GunFlash("Flash2")
    SCHG A 0 A_JumpIfInventory("PowerQuadDamage", 1, "QuadB")
    SCHG B 4 A_FireBullets(5.6, 3.55, random(1,2), 10,"IDMBulletPuff")
	SCHG B 0 A_Refire("Spool")
	Goto Ready
  Spool:
	SCHG A 0 A_JumpIfNoAmmo("Unspool")
	TNT1 A 0 A_GiveInventory("GunSpinnerDummy")
  Normal1:
    SCHG A 0 A_PlaySound("weapons/chngnstrt")
    SCHG A 0 A_GunFlash
    SCHG A 0 A_JumpIfInventory("PowerQuadDamage", 1, "Quad1")
    SCHG A 4 A_FireBullets(5.6, 3.55, random(1,2), 10, "IDMBulletPuff")
	SCHG A 0 A_JumpIfNoAmmo("Unspool")
  Normal2:
    SCHG B 0 A_GunFlash("Flash2")
    SCHG A 0 A_JumpIfInventory("PowerQuadDamage", 1, "Quad2")
    SCHG B 4 A_FireBullets(5.6, 3.55, random(1,2), 10,"IDMBulletPuff")
	SCHG A 0 A_JumpIfNoAmmo("Unspool")
  Normal3:
    SCHG A 0 A_GunFlash
    SCHG A 0 A_JumpIfInventory("PowerQuadDamage", 1, "Quad3")
	SCHG A 4 A_FireBullets(5.6, 3.55, random(1,2), 10,"IDMBulletPuff")
	SCHG A 0 A_JumpIfNoAmmo("Unspool")
  Normal4:
    SCHG B 0 A_GunFlash("Flash2")
    SCHG B 0 A_JumpIfInventory("PowerQuadDamage", 1, "Quad4")
    SCHG B 4 A_FireBullets(5.6, 3.55, random(1,2), 10,"IDMBulletPuff")
	SCHG B 0 A_JumpIfNoAmmo("Unspool")
  Normal5:
	SCHG A 0 A_GunFlash
    SCHG A 0 A_JumpIfInventory("PowerQuadDamage", 1, "Quad5")
	SCHG A 4 A_FireBullets(5.6, 3.55, random(1,2), 10,"IDMBulletPuff")
	SCHG A 0 A_JumpIfNoAmmo("Unspool")
  Normal6:
    SCHG B 0 A_GunFlash("Flash2")
    SCHG B 0 A_JumpIfInventory("PowerQuadDamage", 1, "Quad6")
    SCHG B 4 A_FireBullets(5.6, 3.55, random(1,2), 10,"IDMBulletPuff")
	SCHG B 0 A_JumpIfNoAmmo("Unspool")
  Normal7:
	SCHG A 0 A_GunFlash
    SCHG A 0 A_JumpIfInventory("PowerQuadDamage", 1, "Quad7")
	SCHG A 4 A_FireBullets(5.6, 3.55, random(1,2), 10,"IDMBulletPuff")
	SCHG A 0 A_JumpIfNoAmmo("Unspool")
  Normal8:
    SCHG B 0 A_GunFlash("Flash2")
    SCHG B 0 A_JumpIfInventory("PowerQuadDamage", 1, "Quad8")
	SCHG B 4 A_FireBullets(5.6, 3.55, random(1,2), 10,"IDMBulletPuff")
	SCHG B 0 A_JumpIfNoAmmo("Unspool")
	SCHG B 0 A_Refire("Hold")
	Goto Unspool
  Hold:
	SCHG A 0 A_Playsound("weapons/chngnloop")
  Normal9:
    SCHG A 0 A_GunFlash("SpoolFlash")
    SCHG A 0 A_JumpIfInventory("PowerQuadDamage", 1, "Quad9")
	SCHG A 2 A_FireBullets(5.6, 3.55, random(1,2), 10,"IDMBulletPuff")
	SCHG A 0 A_JumpIfNoAmmo("Unspool")
	Goto Normal10
  Normal10:
    SCHG B 0 A_GunFlash("SpoolFlash2")
    SCHG B 0 A_JumpIfInventory("PowerQuadDamage", 1, "Quad10")
	SCHG B 2 A_FireBullets(5.6, 3.55, random(1,2), 10,"IDMBulletPuff")
	SCHG B 0 A_JumpIfNoAmmo("Unspool")
	SCHG B 0 A_Refire("Hold")
  Unspool:
	TNT1 A 0 A_TakeInventory("GunSpinnerDummy")
    SCHG B 0 A_Playsound("weapons/chngnstop")
    SCHG ABA 2
	SCHG BA 3
	SCHG B 4
	TNT1 A 0 A_Refire("Fire")
	Goto Ready
  QuadA:
	TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
    SCHG A 4 A_FireBullets(5.6, 3.55, random(1,2), 10,"ExtremePuff")
	SCHG A 0 A_JumpIfNoAmmo("Unspool")
  QuadB:
    SCHG B 0 A_GunFlash("Flash2")
	TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
    SCHG B 4 A_FireBullets(5.6, 3.55, random(1,2), 10,"ExtremePuff")
	SCHG A 0 A_JumpIfNoAmmo("Unspool")
	SCHG B 0 A_Refire("Spool")
	Goto Ready
  Quad1:
	TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
    SCHG A 4 A_FireBullets(5.6, 3.55, random(1,2), 10,"ExtremePuff")
	SCHG A 0 A_JumpIfNoAmmo("Unspool")
	Goto Normal2
  Quad2:
    SCHG B 0 A_GunFlash("Flash2")
	TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
    SCHG B 4 A_FireBullets(5.6, 3.55, random(1,2), 10,"ExtremePuff")
	SCHG A 0 A_JumpIfNoAmmo("Unspool")
	Goto Normal3
  Quad3:
	TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
	SCHG A 4 A_FireBullets(5.6, 3.55, random(1,2), 10,"ExtremePuff")
	SCHG A 0 A_JumpIfNoAmmo("Unspool")
	Goto Normal4
  Quad4:
	TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
    SCHG B 4 A_FireBullets(5.6, 3.55, random(1,2), 10,"ExtremePuff")
	SCHG A 0 A_JumpIfNoAmmo("Unspool")
	Goto Normal5
  Quad5:
	TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
    SCHG A 4 A_FireBullets(5.6, 3.55, random(1,2), 10,"ExtremePuff")
	SCHG A 0 A_JumpIfNoAmmo("Unspool")
	Goto Normal6
  Quad6:
	TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
    SCHG B 4 A_FireBullets(5.6, 3.55, random(1,2), 10,"ExtremePuff")
	SCHG A 0 A_JumpIfNoAmmo("Unspool")
	Goto Normal7
  Quad7:
	TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
    SCHG A 4 A_FireBullets(5.6, 3.55, random(1,2), 10,"ExtremePuff")
	SCHG A 0 A_JumpIfNoAmmo("Unspool")
	Goto Normal8
  Quad8:
	TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
    SCHG B 4 A_FireBullets(5.6, 3.55, random(1,2), 10,"ExtremePuff")
	SCHG A 0 A_JumpIfNoAmmo("Unspool")
	Goto Hold
  Quad9:
	TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
    SCHG A 2 A_FireBullets(5.6, 3.55, random(1,2), 10,"ExtremePuff")
	SCHG A 0 A_JumpIfNoAmmo("Unspool")
	Goto Normal10
  Quad10:
	TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
    SCHG B 2 A_FireBullets(5.6, 3.55, random(1,2), 10,"ExtremePuff")
	SCHG B 0 A_JumpIfNoAmmo("Unspool")
	SCHG B 0 A_Refire("Hold")
	Goto Unspool
  Flash:
    SCHF A 5 Bright A_Light1
    Goto LightDone
  Flash2:
    SCHF B 5 Bright A_Light2
    Goto LightDone
  SpoolFlash:
    SCHF A 3 Bright A_Light1
	Goto LightDone
  SpoolFlash2:
    SCHF B 3 Bright A_Light2
	Goto LightDone
  Spawn:
     SCHA A -1 Bright
     Stop
  }
}

ACTOR SuperChaingunLevel2 : SuperChaingun
{
  +POWERED_UP
  +WEAPON.CHEATNOTWEAPON
  Weapon.Ammogive 0
  Weapon.Sisterweapon "SuperChaingun"
  Damagetype "Bullet"
  Tag "Super Chaingun"
  States
  {
  Ready:
    SC2G A 1 A_WeaponReady
	Loop
  Deselect:
	TNT1 A 0 A_JumpIfInventory("GunSpinnerDummy",1,"FireDeselect")
	Goto Desloop
  FireDeselect:
    SC2G B 0 A_Playsound("weapons/chngnstop")
  Desloop:
	TNT1 A 0 A_TakeInventory("GunSpinnerDummy")
    SC2G A 0 A_Lower
    SC2G A 0 A_Lower
    SC2G A 1 A_Lower
    Loop
  Select:
	TNT1 A 0 A_PlaySound("weapons/wswitch",CHAN_WEAPON)
  Sloop:
    SC2G A 0 A_Raise
    SC2G A 0 A_Raise
    SC2G A 1 A_Raise
    Loop
  Fire:
  NormalA:
    SC2G A 0 A_GunFlash
    SC2G A 0 A_JumpIfInventory("PowerQuadDamage", 1, "QuadA")
    SC2G A 4 A_FireBullets(5.6, 3.55, random(2,6), 10,"IDMBulletPuff")
  NormalB:
    SC2G B 0 A_GunFlash("Flash2")
    SC2G A 0 A_JumpIfInventory("PowerQuadDamage", 1, "QuadB")
    SC2G B 4 A_FireBullets(5.6, 3.55, random(2,6), 10,"IDMBulletPuff")
	SC2G B 0 A_Refire("Spool")
	Goto Ready
  Spool:
	SC2G A 0 A_JumpIfNoAmmo("Unspool")
	TNT1 A 0 A_GiveInventory("GunSpinnerDummy")
  Normal1:
    SC2G A 0 A_PlaySound("weapons/chngnstrt")
    SC2G A 0 A_GunFlash
    SC2G A 0 A_JumpIfInventory("PowerQuadDamage", 1, "Quad1")
    SC2G A 4 A_FireBullets(5.6, 3.55, random(2,6), 10, "IDMBulletPuff")
	SC2G A 0 A_JumpIfNoAmmo("Unspool")
  Normal2:
    SC2G B 0 A_GunFlash("Flash2")
    SC2G A 0 A_JumpIfInventory("PowerQuadDamage", 1, "Quad2")
    SC2G B 4 A_FireBullets(5.6, 3.55, random(2,6), 10,"IDMBulletPuff")
	SC2G A 0 A_JumpIfNoAmmo("Unspool")
  Normal3:
    SC2G A 0 A_GunFlash
    SC2G A 0 A_JumpIfInventory("PowerQuadDamage", 1, "Quad3")
	SC2G A 4 A_FireBullets(5.6, 3.55, random(2,6), 10,"IDMBulletPuff")
	SC2G A 0 A_JumpIfNoAmmo("Unspool")
  Normal4:
    SC2G B 0 A_GunFlash("Flash2")
    SC2G B 0 A_JumpIfInventory("PowerQuadDamage", 1, "Quad4")
    SC2G B 4 A_FireBullets(5.6, 3.55, random(2,6), 10,"IDMBulletPuff")
	SC2G B 0 A_JumpIfNoAmmo("Unspool")
  Normal5:
	SC2G A 0 A_GunFlash
    SC2G A 0 A_JumpIfInventory("PowerQuadDamage", 1, "Quad5")
	SC2G A 4 A_FireBullets(5.6, 3.55, random(2,6), 10,"IDMBulletPuff")
	SC2G A 0 A_JumpIfNoAmmo("Unspool")
  Normal6:
    SC2G B 0 A_GunFlash("Flash2")
    SC2G B 0 A_JumpIfInventory("PowerQuadDamage", 1, "Quad6")
    SC2G B 4 A_FireBullets(5.6, 3.55, random(2,6), 10,"IDMBulletPuff")
	SC2G B 0 A_JumpIfNoAmmo("Unspool")
  Normal7:
	SC2G A 0 A_GunFlash
    SC2G A 0 A_JumpIfInventory("PowerQuadDamage", 1, "Quad7")
	SC2G A 4 A_FireBullets(5.6, 3.55, random(2,6), 10,"IDMBulletPuff")
	SC2G A 0 A_JumpIfNoAmmo("Unspool")
  Normal8:
    SC2G B 0 A_GunFlash("Flash2")
    SC2G B 0 A_JumpIfInventory("PowerQuadDamage", 1, "Quad8")
	SC2G B 4 A_FireBullets(5.6, 3.55, random(2,6), 10,"IDMBulletPuff")
	SC2G B 0 A_JumpIfNoAmmo("Unspool")
	SC2G B 0 A_Refire("Hold")
	Goto Unspool
  Hold:
	SC2G A 0 A_Playsound ("weapons/chngnloop")
  Normal9:
    SC2G A 0 A_GunFlash("SpoolFlash")
    SC2G A 0 A_JumpIfInventory("PowerQuadDamage", 1, "Quad9")
	SC2G A 2 A_FireBullets(5.6, 3.55, random(2,6), 10,"IDMBulletPuff")
	SC2G A 0 A_JumpIfNoAmmo("Unspool")
	Goto Normal10
  Normal10:
    SC2G B 0 A_GunFlash("SpoolFlash2")
    SC2G B 0 A_JumpIfInventory("PowerQuadDamage", 1, "Quad10")
	SC2G B 2 A_FireBullets(5.6, 3.55, random(2,6), 10,"IDMBulletPuff")
	SC2G B 0 A_JumpIfNoAmmo("Unspool")
	SC2G B 0 A_Refire("Hold")
  Unspool:
	TNT1 A 0 A_TakeInventory("GunSpinnerDummy")
    SCHG B 0 A_Playsound("weapons/chngnstop")
    SC2G AB 2
	SC2G AB 3
	SC2G AB 4
	SC2G A 5 A_Refire("Fire")
	Goto Ready
  QuadA:
	TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
    SC2G A 4 A_FireBullets(5.6, 3.55, random(2,6), 10,"ExtremePuff")
	SC2G A 0 A_JumpIfNoAmmo("Unspool")
  QuadB:
    SC2G B 0 A_GunFlash("Flash2")
	TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
    SC2G B 4 A_FireBullets(5.6, 3.55, random(2,6), 10,"ExtremePuff")
	SC2G A 0 A_JumpIfNoAmmo("Unspool")
	SC2G B 0 A_Refire("Spool")
	Goto Ready
  Quad1:
	TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
    SC2G A 4 A_FireBullets(5.6, 3.55, random(2,6), 10,"ExtremePuff")
	SC2G A 0 A_JumpIfNoAmmo("Unspool")
	Goto Normal2
  Quad2:
    SC2G B 0 A_GunFlash("Flash2")
	TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
    SC2G B 4 A_FireBullets(5.6, 3.55, random(2,6), 10,"ExtremePuff")
	SC2G A 0 A_JumpIfNoAmmo("Unspool")
	Goto Normal3
  Quad3:
	TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
	SC2G A 4 A_FireBullets(5.6, 3.55, random(2,6), 10,"ExtremePuff")
	SC2G A 0 A_JumpIfNoAmmo("Unspool")
	Goto Normal4
  Quad4:
	TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
    SC2G B 4 A_FireBullets(5.6, 3.55, random(2,6), 10,"ExtremePuff")
	SC2G A 0 A_JumpIfNoAmmo("Unspool")
	Goto Normal5
  Quad5:
	TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
    SC2G A 4 A_FireBullets(5.6, 3.55, random(2,6), 10,"ExtremePuff")
	SC2G A 0 A_JumpIfNoAmmo("Unspool")
	Goto Normal6
  Quad6:
	TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
    SC2G B 4 A_FireBullets(5.6, 3.55, random(2,6), 10,"ExtremePuff")
	SC2G A 0 A_JumpIfNoAmmo("Unspool")
	Goto Normal7
  Quad7:
	TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
    SC2G A 4 A_FireBullets(5.6, 3.55, random(2,6), 10,"ExtremePuff")
	SC2G A 0 A_JumpIfNoAmmo("Unspool")
	Goto Normal8
  Quad8:
	TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
    SC2G B 4 A_FireBullets(5.6, 3.55, random(2,6), 10,"ExtremePuff")
	SC2G A 0 A_JumpIfNoAmmo("Unspool")
	Goto Hold
  Quad9:
	TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
    SC2G A 2 A_FireBullets(5.6, 3.55, random(2,6), 10,"ExtremePuff")
	SC2G A 0 A_JumpIfNoAmmo("Unspool")
	Goto Normal10
  Quad10:
	TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
    SC2G B 2 A_FireBullets(5.6, 3.55, random(2,6), 10,"ExtremePuff")
	SC2G B 0 A_JumpIfNoAmmo("Unspool")
	SC2G B 0 A_Refire("Hold")
	Goto Unspool
  Flash:
    SC2F A 5 Bright A_Light1
    Goto LightDone
  Flash2:
    SC2F B 5 Bright A_Light2
    Goto LightDone
  SpoolFlash:
    SC2F A 3 Bright A_Light1
	Goto LightDone
  SpoolFlash2:
    SC2F B 3 Bright A_Light2
	Goto LightDone
	}
}
	

// Heavy Machinegun

ACTOR HeavyMachinegun : IDMWeapon
{ 
	Weapon.Kickback 25
	Weapon.SelectionOrder 500
	Weapon.AmmoType "IDMClip"
	Weapon.AmmoGive 100
	Weapon.AmmoUse 2
	Weapon.SlotNumber 4
	Inventory.PickupSound "misc/w_pkup" 
	Inventory.PickupMessage "Heavy Machinegun!"
	Obituary "%o was bursted by %k's Heavy Machinegun."
	Tag "Heavy Machinegun"
	AttackSound "weapons/hmgfire"
 	Decal BulletChip
	Damagetype "Bullet"
	States 
	{  
	Ready: 
		HVMG A 1 A_WeaponReady 
		Loop 
	Deselect: 
		HVMG A 0 A_Lower 
		HVMG A 0 A_Lower 
		HVMG A 1 A_Lower 
		Loop 
	Select: 
		TNT1 A 0 A_PlaySound("weapons/wswitch",CHAN_WEAPON)
	Sloop:
		HVMG A 0 A_Raise
		HVMG A 0 A_Raise
		HVMG A 1 A_Raise
		Loop 
	Fire: 
		HVMG B 0 A_GunFlash
		TNT1 A 0 A_JumpIfInventory("PowerIDMWeaponLevel2",1,"Level2")
		TNT1 A 0 A_JumpIfInventory("PowerQuadDamage",1,"Quad")
		HVMG B 1 Bright A_FireBullets(2.8, 1.775, -1, 25, "IDMBulletPuff")
		HVMG C 2 Bright
		TNT1 A 0 A_CheckReload
		HVMG B 0 A_GunFlash("Flash2")
		HVMG B 1 Bright A_FireBullets(2.8, 1.775, -1, 25, "IDMBulletPuff")
		HVMG C 2 Bright
		HVMG B 0 A_GunFlash
		HVMG B 1 Bright A_FireBullets(2.8, 1.775, -1, 25, "IDMBulletPuff")
		HVMG C 2 Bright
		TNT1 A 0 A_CheckReload
		HVMG B 0 A_GunFlash("Flash2")
		HVMG B 1 Bright A_FireBullets(2.8, 1.775, -1, 25, "IDMBulletPuff")
		HVMG C 2 Bright
		TNT1 A 0 A_CheckReload
		HVMG B 0 A_GunFlash
		HVMG B 1 Bright A_FireBullets(2.8, 1.775, -1, 25, "IDMBulletPuff")
		HVMG C 2 Bright
		TNT1 A 0 A_CheckReload
		Goto FireEnd
	Quad:
		TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
		HVMG B 1 Bright A_FireBullets(2.8, 1.775, -1, 25, "ExtremePuff")
		HVMG C 2 Bright
		TNT1 A 0 A_CheckReload
		HVMG B 0 A_GunFlash("Flash2")
		TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
		HVMG B 1 Bright A_FireBullets(2.8, 1.775, -1, 25, "ExtremePuff")
		HVMG C 2 Bright
		TNT1 A 0 A_CheckReload
		HVMG B 0 A_GunFlash
		TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
		HVMG B 1 Bright A_FireBullets(2.8, 1.775, -1, 25, "ExtremePuff")
		HVMG C 2 Bright
		TNT1 A 0 A_CheckReload
		HVMG B 0 A_GunFlash("Flash2")
		TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
		HVMG B 1 Bright A_FireBullets(2.8, 1.775, -1, 25, "ExtremePuff")
		HVMG C 2 Bright
		TNT1 A 0 A_CheckReload
		HVMG B 0 A_GunFlash
		TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
		HVMG B 1 Bright A_FireBullets(2.8, 1.775, -1, 25, "ExtremePuff")
		HVMG C 2 Bright
		TNT1 A 0 A_CheckReload
	FireEnd:
		HVMG A 2 Offset(0,40)
		HVMG A 2 Offset(0,39)
		HVMG A 2 Offset(0,38)
		HVMG A 2 Offset(0,35)
		HVMG A 3 Offset(0,32)
		HVMG A 0 A_Refire
		Goto Ready
	Level2:
		HVMG B 0 A_GunFlash
		TNT1 A 0 A_JumpIfInventory("PowerQuadDamage",1,"QuadLevel2")
		HVMG B 1 Bright A_FireBullets(2.8, 1.775, 2, 25, "IDMBulletPuff")
		HVMG C 2 Bright
		TNT1 A 0 A_CheckReload
		HVMG B 0 A_GunFlash("Flash2")
		HVMG B 1 Bright A_FireBullets(2.8, 1.775, 2, 25, "IDMBulletPuff")
		HVMG C 2 Bright
		TNT1 A 0 A_CheckReload
		HVMG A 2 A_Refire
		Goto Ready
	QuadLevel2:
		HVMG B 0 A_GunFlash
		TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
		HVMG B 1 Bright A_FireBullets(2.8, 1.775, 2, 25, "ExtremePuff")
		HVMG C 2 Bright
		TNT1 A 0 A_CheckReload
		HVMG B 0 A_GunFlash("Flash2")
		TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
		HVMG B 1 Bright A_FireBullets(2.8, 1.775, 2, 25, "ExtremePuff")
		HVMG C 2 Bright
		TNT1 A 0 A_CheckReload
		HVMG A 2 A_Refire
		Goto Ready
       Flash:
		TNT1 A 4 Bright A_Light1
		Goto LightDone
	   Flash2:
		TNT1 A 4 Bright A_Light2
		Goto LightDone
	Spawn:
		HVMG W -1 Bright
		Stop
	}
}


// Nailgun (Quake)

Actor NailGun : IDMWeapon
{
  Weapon.SelectionOrder 700
  Weapon.AmmoUse 1
  Weapon.AmmoGive 25
  Weapon.SlotNumber 4
  Weapon.AmmoType "IDMClip"
  Inventory.PickupMessage "Nailgun!"
  Obituary "%o was nailed by %k's Nailgun."
  Tag "Nailgun"
  +WEAPON.ALLOW_WITH_RESPAWN_INVUL
  -WEAPON.NOLMS
  States
  {
  Spawn:
    NLMG E -1 Bright
    Loop
  Select:
	TNT1 A 0 A_PlaySound("weapons/wswitch",CHAN_WEAPON)
  Sloop:
    NLMG A 0 A_Raise
    NLMG A 0 A_Raise
    NLMG A 1 A_Raise
    Loop
  Deselect:
    NLMG A 0 A_Lower
    NLMG A 0 A_Lower
    NLMG A 1 A_Lower
    Loop
  Ready:
    NLMG A 1 A_WeaponReady
    Loop
  Fire:
    NLMG D 0 A_PlaySound("Weapons/NailStart",CHAN_WEAPON,1)
	NLMG D 0 A_GunFlash("FlashStart")
	NLMG D 0 A_JumpIfInventory("PowerIDMWeaponLevel2", 1, "Level2Loop")
	Goto Normal
  Normal:
	NLMG D 0 A_JumpIfInventory("PowerQuadDamage", 1, "Quad")
    NLMG D 0 A_FireCustomMissile("SmallNail", 0, 1, -3)
	NLMG D 2 A_FireCustomMissile("SmallNail", 0, 1, 3)
	NLMG A 6
	NLMG D 0 A_JumpIfInventory("PowerIDMWeaponLevel2", 1, "Level2Loop")
	NLMG A 0 A_Refire("FireLoop")
	Goto Ready
  FireLoop:
	NLMG D 0 A_JumpIfInventory("PowerIDMWeaponLevel2", 1, "Level2Loop")
	NLMG B 0 A_JumpIfInventory("PowerQuadDamage",1,"QuadLoop")
	NLMG B 0 A_GunFlash
    NLMG B 0 A_PlaySound("Weapons/NailFire",CHAN_WEAPON)
    NLMG B 2 A_FireCustomMissile("SmallNail", 0, 1, -3)
	NLMG A 2
  FireLoop2:
	NLMG A 0 A_JumpIfNoAmmo("FireEnd")
	NLMG B 0 A_JumpIfInventory("PowerQuadDamage",1,"QuadLoop2")
	NLMG C 0 A_GunFlash("Flash2")
    NLMG C 0 A_PlaySound("Weapons/NailFire",CHAN_WEAPON)
	NLMG C 2 A_FireCustomMissile("SmallNail", 0, 1, 3)
    NLMG A 2
	NLMG A 0 A_JumpIfNoAmmo("FireEnd")
    NLMG A 0 A_Refire("FireLoop")
    Goto FireEnd
  Level2Loop:
	NLMG D 0 A_JumpIfInventory("PowerQuadDamage",1,"Level2QuadLoop")
	NLMG D 0 A_GunFlash("Level2Flash")
    NLMG D 0 A_PlaySound("Weapons/NailFire",CHAN_WEAPON)
    NLMG D 0 A_FireCustomMissile("SmallNail", 0, 1, -3)
	NLMG D 2 A_FireCustomMissile("SmallNail", 0, 0, 3)
	NLMG A 2
	NLMG D 0 A_JumpIfInventory("PowerQuadDamage",1,"Level2QuadLoop")
	NLMG D 0 A_GunFlash("Level2Flash2")
    NLMG D 0 A_PlaySound("Weapons/NailFire",CHAN_WEAPON)
    NLMG D 0 A_FireCustomMissile("SmallNail", 0, 1, -3)
	NLMG D 2 A_FireCustomMissile("SmallNail", 0, 0, 3)
	NLMG A 2
    NLMG A 0 A_Refire("Fire")
	Goto FireEnd
  Quad:
	TNT1 A 0 A_Playsound("misc/qdmg",CHAN_5)
	NLMG D 0 A_FireCustomMissile("ExtremeSmallNail", 0, 1, -3)
	NLMG D 2 A_FireCustomMissile("ExtremeSmallNail", 0, 1, 3)
	NLMG A 6
	NLMG D 0 A_JumpIfInventory("PowerIDMWeaponLevel2", 1, "Level2Loop")
	NLMG A 0 A_Refire("QuadLoop")
	Goto Ready
  QuadLoop:
	TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
	NLMG B 0 A_GunFlash
	NLMG B 0 A_PlaySound("Weapons/NailFire",CHAN_WEAPON,1)
    NLMG B 2 A_FireCustomMissile("ExtremeSmallNail", 0, 1, -3)
	NLMG A 2
	Goto FireLoop2
  QuadLoop2:
	NLMG A 0 A_JumpIfNoAmmo("FireEnd")
	TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
	NLMG C 0 A_GunFlash("Flash2")
	NLMG C 0 A_PlaySound("Weapons/NailFire",CHAN_WEAPON,1)
	NLMG C 2 A_FireCustomMissile("ExtremeSmallNail", 0, 1, 3)
    NLMG A 2
	NLMG A 0 A_JumpIfNoAmmo("FireEnd")
    NLMG A 0 A_Refire("QuadLoop")
    Goto FireEnd
  Level2QuadLoop:
	TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
	NLMG D 0 A_GunFlash("Level2Flash")
    NLMG D 0 A_PlaySound("Weapons/NailFire",CHAN_WEAPON)
    NLMG D 0 A_FireCustomMissile("ExtremeSmallNail", 0, 1, -3)
    NLMG D 2 A_FireCustomMissile("ExtremeSmallNail", 0, 0, 3)
	NLMG A 2
    NLMG A 0 A_Refire
  FireEnd:
	NLMG A 0 A_Playsound("Weapons/NailStop",CHAN_WEAPON,1)
	Goto Ready
  FlashStart:
    NLMG D 2 Bright A_Light1
	Goto LightDone
  Flash:
	NLMG B 3 Bright A_Light1
	NLMG A 2 Bright A_Light1
  Flash2:
	NLMG C 3 Bright A_Light2
	NLMG A 2 Bright A_Light2
	Goto LightDone
  Level2Flash:
    NLMG D 3 Bright A_Light1
	NLMG A 2 Bright A_Light1
	Goto LightDone
  Level2Flash2:
    NLMG D 3 Bright A_Light2
	NLMG A 2 Bright A_Light2
	Goto LightDone
  }
}

// Super Nailgun (Quake)

ACTOR SuperNailgun : IDMWeapon
{
  Weapon.AmmoUse 2
  Weapon.AmmoGive 100
  Weapon.AmmoType "IDMClip"
  Inventory.PickupSound "Misc/W_PkUp"
  Inventory.PickupMessage "Super Nailgun!"
  Weapon.Selectionorder 500
  Weapon.SlotNumber 4
  Obituary "%o was punctured by %k's Super Nailgun."
  Tag "Super Nailgun"
  States
  {
  Spawn:
    NLMG F -1 Bright
    Loop
  Select:
	TNT1 A 0 A_PlaySound("weapons/wswitch",CHAN_WEAPON)
  Sloop:
    SNAI E 0 A_Raise
    SNAI E 0 A_Raise
    SNAI E 1 A_Raise
    Loop
  Deselect:
    SNAI E 0 A_Lower
    SNAI E 0 A_Lower
    SNAI E 1 A_Lower
    Loop
  Ready:
    SNAI EEEEEDDDDDAAAAABBBBB 1 A_WeaponReady
    Loop
  /*
  The Fire state of the Super Nailgun is a bit complicated. What it essentially
  does is it fluctuates its rate of fire every shot from slightly slower to
  slightly faster rate. Each shot's fire state has a 50% (128 out of 256 tics)
  chance to jump to a firing state with a different rate of fire.
  */
  Fire:
    SNAI C 0 A_JumpIfNoAmmo("FireEnd")
	SNAI C 0 A_JumpIfInventory("PowerIDMWeaponLevel2", 1, "Level2")
	SNAI C 0 A_JumpIfInventory("PowerQuadDamage", 1, "Quad")
	SNAI C 0 A_Jump(128,"NormalB")
  NormalA:
	SNAI C 0 A_JumpIfInventory("PowerQuadDamage", 1, "QuadA")
    SNAI C 0 A_PlayWeaponSound("Weapons/SNailFire")
    SNAI C 0 A_GunFlash
    SNAI C 2 Bright A_FireCustomMissile("Nail",0, 1)
    SNAI D 1
  NormalA2:
	SNAI C 0 A_Jump(128,"NormalB2")
    SNAI H 0 A_JumpIfNoAmmo("FireEnd")
	SNAI C 0 A_JumpIfInventory("PowerQuadDamage", 1, "QuadA2")
    SNAI H 0 A_PlayWeaponSound("Weapons/SNailFire")
    SNAI H 0 A_GunFlash
    SNAI H 2 Bright A_FireCustomMissile("Nail", 0, 1)
	SNAI B 2
	SNAI E 2 A_Refire
	Goto FireEnd
  NormalB:
    SNAI C 0 A_PlayWeaponSound("Weapons/SNailFire")
    SNAI C 0 A_GunFlash
	SNAI C 0 A_JumpIfInventory("PowerQuadDamage", 1, "QuadB2")
    SNAI C 2 Bright A_FireCustomMissile("Nail",0, 1)
    SNAI D 2
  NormalB2:
	SNAI C 0 A_Jump(128,"NormalA2")
    SNAI H 0 A_JumpIfNoAmmo("FireEnd")
	SNAI C 0 A_JumpIfInventory("PowerQuadDamage", 1, "QuadB2")
    SNAI H 0 A_PlayWeaponSound("Weapons/SNailFire")
    SNAI H 0 A_GunFlash
    SNAI H 2 Bright A_FireCustomMissile("Nail", 0, 1)
	SNAI B 1
	SNAI E 2 A_Refire
	Goto FireEnd
  Level2:
	SNAI C 0 A_JumpIfInventory("PowerQuadDamage", 1, "QuadLevel2")
  Level2A:
	SNAI C 0 A_Jump(128,"Level2B")
    SNAI C 0 A_PlayWeaponSound("Weapons/SNailFire")
    SNAI C 0 A_GunFlash
	SNAI C 0 A_JumpIfInventory("PowerQuadDamage", 1, "QuadLevel2A")
    SNAI C 0 Bright A_FireCustomMissile("Nail",0, 1,-3,-5)
    SNAI C 0 Bright A_FireCustomMissile("Nail",0, 0,3,-5)
    SNAI C 2 Bright A_FireCustomMissile("Nail",0, 0)
    SNAI D 1
  Level2A2:
	SNAI C 0 A_Jump(128,"Level2B2")
	SNAI C 0 A_JumpIfInventory("PowerQuadDamage", 1, "QuadLevel2A2")
    SNAI H 0 A_JumpIfNoAmmo("FireEnd")
    SNAI F 0 A_PlayWeaponSound("Weapons/SNailFire")
    SNAI F 0 A_GunFlash
    SNAI C 0 Bright A_FireCustomMissile("Nail",0, 1,-3)
    SNAI C 0 Bright A_FireCustomMissile("Nail",0, 0,3)
    SNAI F 2 Bright A_FireCustomMissile("Nail",0, 0, 0, -5)
	SNAI B 1
	SNAI E 2 A_Refire
	Goto FireEnd
  Level2B:
    SNAI C 0 A_PlayWeaponSound("Weapons/SNailFire")
    SNAI C 0 A_GunFlash
	SNAI C 0 A_JumpIfInventory("PowerQuadDamage", 1, "QuadLevel2B")
    SNAI C 0 Bright A_FireCustomMissile("Nail",0, 1,-3,-5)
    SNAI C 0 Bright A_FireCustomMissile("Nail",0, 0,3,-5)
    SNAI C 2 Bright A_FireCustomMissile("Nail",0, 0)
    SNAI D 2
  Level2B2:
	SNAI C 0 A_Jump(128,"Level2A2")
	SNAI C 0 A_JumpIfInventory("PowerQuadDamage", 1, "QuadLevel2B2")
    SNAI H 0 A_JumpIfNoAmmo("FireEnd")
    SNAI F 0 A_PlayWeaponSound("Weapons/SNailFire")
    SNAI F 0 A_GunFlash
    SNAI C 0 Bright A_FireCustomMissile("Nail",0, 1,-3)
    SNAI C 0 Bright A_FireCustomMissile("Nail",0, 0,3)
    SNAI F 2 Bright A_FireCustomMissile("Nail",0, 0, 0, -5)
	SNAI B 2
	SNAI E 2 A_Refire
	Goto FireEnd
  QuadLevel2:
    SNAI C 0 A_PlayWeaponSound("Weapons/SNailFire")
    SNAI C 0 A_GunFlash
	Goto Level2A
  QuadLevel2A:
	TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
    SNAI C 0 Bright A_FireCustomMissile("ExtremeNail",0, 1,-3,-5)
    SNAI C 0 Bright A_FireCustomMissile("ExtremeNail",0, 0,3,-5)
    SNAI C 2 Bright A_FireCustomMissile("ExtremeNail",0, 0)
    SNAI D 1
	Goto Level2A2
  QuadLevel2A2:
    SNAI H 0 A_JumpIfNoAmmo("FireEnd")
	TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
    SNAI F 0 A_PlayWeaponSound("Weapons/SNailFire")
    SNAI F 0 A_GunFlash
    SNAI C 0 Bright A_FireCustomMissile("ExtremeNail",0, 1,-3)
    SNAI C 0 Bright A_FireCustomMissile("ExtremeNail",0, 0,3)
    SNAI F 2 Bright A_FireCustomMissile("ExtremeNail",0, 0,0,-5)
	SNAI B 1
	SNAI E 2 A_Refire
	Goto FireEnd
  QuadLevel2B:
	TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
    SNAI C 0 Bright A_FireCustomMissile("ExtremeNail",0, 1,-3,-5)
    SNAI C 0 Bright A_FireCustomMissile("ExtremeNail",0, 0,3,-5)
    SNAI C 2 Bright A_FireCustomMissile("ExtremeNail",0, 0)
    SNAI D 2
	Goto Level2B2
  QuadLevel2B2:
    SNAI H 0 A_JumpIfNoAmmo("FireEnd")
	TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
    SNAI F 0 A_PlayWeaponSound("Weapons/SNailFire")
    SNAI F 0 A_GunFlash
    SNAI C 0 Bright A_FireCustomMissile("ExtremeNail",0, 1,-3)
    SNAI C 0 Bright A_FireCustomMissile("ExtremeNail",0, 0,3)
    SNAI F 2 Bright A_FireCustomMissile("ExtremeNail",0, 0,0,-5)
	SNAI B 2
	SNAI E 2 A_Refire
	Goto FireEnd
  Quad:
    SNAI C 0 A_PlayWeaponSound("Weapons/SNailFire")
  QuadA:
	TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
    SNAI C 0 A_GunFlash
    SNAI C 2 Bright A_FireCustomMissile("ExtremeNail",0, 1)
    SNAI D 1
	Goto NormalA2
  QuadA2:
	TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
    SNAI H 0 A_PlayWeaponSound("Weapons/SNailFire")
    SNAI H 0 A_GunFlash
    SNAI H 2 Bright A_FireCustomMissile("ExtremeNail", 0, 1)
	SNAI B 1
    SNAI E 2 A_ReFire("Fire")
	Goto FireEnd
  QuadB:
	TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
    SNAI C 0 A_GunFlash
    SNAI C 2 Bright A_FireCustomMissile("ExtremeNail",0, 1)
    SNAI D 2
	Goto NormalB2
  QuadB2:
	TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
    SNAI H 0 A_PlayWeaponSound("Weapons/SNailFire")
    SNAI H 0 A_GunFlash
    SNAI H 2 Bright A_FireCustomMissile("ExtremeNail", 0, 1)
	SNAI B 2
    SNAI E 2 A_ReFire("Fire")
  FireEnd:
    SNAI D 2 A_ReFire("Fire")
    SNAI A 2 A_ReFire("Fire")
    SNAI B 2 A_ReFire("Fire")
	SNAI E 3 A_ReFire("Fire")
    SNAI D 3 A_ReFire("Fire")
    SNAI A 3 A_ReFire("Fire")
    SNAI B 4 A_ReFire("Fire")
    Goto Ready
  Flash:
    TNT1 A 5 Bright A_Light1
    Goto LightDone
  }
}

/// Slot 5 - Explosive weapons

// Grenade Rifle

ACTOR GrenadeRifle : IDMWeapon
{
  Weapon.AmmoType "IDMRocketAmmo"
  Weapon.AmmoGive 15
  Weapon.AmmoUse 1
  Weapon.SlotNumber 5
  Inventory.PickupMessage "Grenade Rifle!"
  Tag "Grenade Rifle"
  Weapon.SelectionOrder 700
  +WEAPON.NOAUTOAIM
  +WEAPON.ALLOW_WITH_RESPAWN_INVUL
  -WEAPON.NOLMS
  States
  {
  Spawn:
    GLA2 A -1 Bright
    Loop
  Select:
	TNT1 A 0 A_PlaySound("weapons/wswitch",CHAN_WEAPON)
   Sloop:
    GLAG A 0 A_Raise
    GLAG A 0 A_Raise
    GLAG A 1 A_Raise
    Loop
  Deselect:
    GLAG A 0 A_Lower
    GLAG A 0 A_Lower
    GLAG A 1 A_Lower
    Loop
  Ready:
    GLAG A 1 A_WeaponReady
    Loop
  Fire:
    GLAG B 0 Bright A_GunFlash
    GLAG B 0 Bright A_PlaySound("Weapons/ShannonFire")
	TNT1 A 0 A_JumpIfInventory("PowerIDMWeaponLevel2",1,"Level2")
	TNT1 A 0 A_JumpIfInventory("PowerQuadDamage",1,"Quad")
  Normal:
    GLAG B 4 Bright A_FireCustomMissile("GRifleGrenade", 0, 1, 0, 0, 1, 3.0)
    GLAG I 4
    GLAG A 0 A_CheckReload
    GLAG C 6
    GLAG D 5
    GLAG E 5 A_PlaySound("Weapons/ShannonOpen")
    GLAG FG 5
    GLAG H 5 A_PlaySound("Weapons/ShannonLoad")
    GLAG FE 4
    GLAG D 4 A_PlaySound("Weapons/ShannonClose")
    GLAG A 3
	GLAG A 0 A_Refire
    Goto Ready
  Level2:
	TNT1 A 0 A_JumpIfInventory("PowerQuadDamage",1,"QuadLevel2")
    GLAG B 4 Bright A_FireCustomMissile("ClusterGrenade", 0, 1, 0, 0, 1, 3.5)
    Goto Normal+1
  Quad:
	TNT1 A 0 A_Playsound("misc/qdmg",CHAN_AUTO)
    GLAG B 4 Bright A_FireCustomMissile("ExtremeGRifleGrenade", 0, 1, 0, 0, 1, 3.5)
	Goto Normal+1
  QuadLevel2:
	TNT1 A 0 A_Playsound("misc/qdmg",CHAN_AUTO)
    GLAG B 4 Bright A_FireCustomMissile("ExtremeClusterGrenade", 0, 1, 0, 0, 1, 3.5)
    Goto Normal+1
  Flash:
    TNT1 A 2 A_Light1
    TNT1 A 2 A_Light2
    TNT1 A 2 A_Light0
    Stop
  }
}


// Barrage Launcher

ACTOR BarrageLauncher : IDMWeapon
{
  Weapon.SelectionOrder 350
  Weapon.AmmoType "IDMRocketAmmo"
  Weapon.AmmoGive 15
  Weapon.AmmoUse 1
  Weapon.SlotNumber 5
  Inventory.PickupSound "misc/w_pkup"
  Inventory.PickupMessage "Barrage Launcher!"
  Obituary "%o caught %k's artillery."
  Tag "Barrage Launcher"
  Scale 0.9
  +WEAPON.EXPLOSIVE
  States
  {
  Spawn:
	3LAU A -1 Bright
	Stop
   Ready:
	3MIS A 1 A_WeaponReady
	Loop
   Deselect:
	3MIS A 0 A_Lower
	3MIS A 0 A_Lower
	3MIS A 1 A_Lower
	Loop
   Select:
	TNT1 A 0 A_PlaySound("weapons/wswitch",CHAN_WEAPON)
   Sloop:
	3MIS A 0 A_Raise
	3MIS A 0 A_Raise
	3MIS A 1 A_Raise
	Loop
   Fire:
	TNT1 A 0 A_GunFlash
	TNT1 A 0 A_JumpIfInventory("PowerIDMWeaponLevel2", 1, "Level2")
	3MIS A 4
	TNT1 A 0 A_PlaySound("weapons/brgfire")
	TNT1 A 0 A_GunFlash("Flash2")
	TNT1 A 0 A_JumpIfInventory("PowerQuadDamage", 1, "Quad")
   Normal:
	3MIS A 5 A_FireCustomMissile("IDMRocket",0,1,0)
	TNT1 A 0 A_CheckReload
	TNT1 A 0 A_PlaySound("weapons/brgfire")
	TNT1 A 0 A_GunFlash("Flash3")
	3MIS A 5 A_FireCustomMissile("IDMRocket",0,1,-5)
	TNT1 A 0 A_CheckReload
	TNT1 A 0 A_PlaySound("weapons/brgfire")
	TNT1 A 0 A_GunFlash("Flash4")
	3MIS A 4 A_FireCustomMissile("IDMRocket",0,1,5)
	Goto FireEnd
   Level2:
	TNT1 A 0 A_PlaySound("weapons/brgfire")
	TNT1 A 0 A_JumpIfInventory("PowerQuadDamage", 1, "QuadLevel2")
	3MIS A 5 A_FireCustomMissile("BigRocket",0,1,0)
	TNT1 A 0 A_PlaySound("weapons/brgfire")
	TNT1 A 0 A_GunFlash("Flash3")
	3MIS A 5 A_FireCustomMissile("BigRocket",0,0,-5)
	TNT1 A 0 A_PlaySound("weapons/brgfire")
	TNT1 A 0 A_GunFlash("Flash4")
	3MIS A 4 A_FireCustomMissile("BigRocket",0,0,5)
	Goto FireEnd
   Quad:
	TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
   	3MIS A 5 A_FireCustomMissile("ExtremeRocket",0,1,0)
	TNT1 A 0 A_CheckReload
	TNT1 A 0 A_PlaySound("weapons/brgfire")
	TNT1 A 0 A_GunFlash("Flash3")
	TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
	3MIS A 5 A_FireCustomMissile("ExtremeRocket",0,1,-5)
	TNT1 A 0 A_CheckReload
	TNT1 A 0 A_PlaySound("weapons/brgfire")
	TNT1 A 0 A_GunFlash("Flash4")
	TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
	3MIS A 4 A_FireCustomMissile("ExtremeRocket",0,1,5)
	Goto FireEnd
   QuadLevel2:
	TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
	3MIS A 5 A_FireCustomMissile("ExtremeBigRocket",0,1,0)
	TNT1 A 0 A_PlaySound("weapons/brgfire")
	TNT1 A 0 A_GunFlash("Flash3")
	TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
	3MIS A 5 A_FireCustomMissile("ExtremeBigRocket",0,0,-5)
	TNT1 A 0 A_PlaySound("weapons/brgfire")
	TNT1 A 0 A_GunFlash("Flash4")
	TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
	3MIS A 4 A_FireCustomMissile("ExtremeBigRocket",0,0,5)
	Goto FireEnd
   FireEnd:
	3MSF E 0 A_GunFlash("Flash5")
	3MIS A 6 A_CheckReload
	3MIS A 14 A_Playsound("weapons/rcketstrt",CHAN_AUTO)
	3MIS A 6 A_ReFire
	Goto Ready
   Flash:
	3MSF A 6 Bright A_Light1
	Goto LightDone
   Flash2:
	3MSF B 6 Bright A_Light2
	Goto LightDone
   Flash3:
	3MSF C 6 Bright A_Light1
	Goto LightDone
   Flash4:
	3MSF D 6 Bright A_Light2
	Goto LightDone
   Flash5:
	3MSF EF 6 Bright A_Light1
	Goto LightDone
  }
}

// Grenade Launcher (Skulltag / Quake)

ACTOR IDMGrenadeLauncher : IDMWeapon
{
	Radius 20
	Height 16
	Weapon.SlotNumber 5
	Weapon.Selectionorder 400
	+WEAPON.EXPLOSIVE
	+WEAPON.NOAUTOAIM
	Weapon.AmmoUse 1
	Weapon.AmmoGive 15
	Weapon.AmmoType "IDMRocketAmmo"
    Inventory.PickupSound "misc/w_pkup"
	Inventory.PickupMessage "Grenade Launcher!"
	Tag "Grenade Launcher"
	States
	{
	Spawn:
		GLAU A -1 Bright
		Stop
	Ready:
		GRLG A 1 A_WeaponReady
		Loop
	Deselect:
		GRLG A 0 A_Lower
		GRLG A 0 A_Lower
		GRLG A 1 A_Lower
		Loop
	Select:
		TNT1 A 0 A_PlaySound("weapons/wswitch",CHAN_WEAPON)
	Sloop:
		GRLG A 0 A_Raise
		GRLG A 0 A_Raise
		GRLG A 1 A_Raise
		Loop
	Fire:
		GRLG B 4 A_GunFlash
		GRLG B 0 A_JumpIfInventory("PowerIDMWeaponLevel2",1,"Level2")
		GRLG B 0 A_JumpIfInventory("PowerQuadDamage",1,"Quad")
	Normal:
		GRLG B 18 A_FireCustomMissile("IDMGrenade", 0, 1, 0, 0, 0, 4.5)
		Goto FireEnd
	Level2:
		GRLG B 0 A_JumpIfInventory("PowerQuadDamage",1,"QuadLevel2")
		GRLG B 18 A_FireCustomMissile("MushroomGrenade", 0, 1, 0, 0, 0, 4.5)
		Goto FireEnd
	Quad:
		TNT1 A 0 A_Playsound("misc/qdmg",CHAN_AUTO,1)
		GRLG B 18 A_FireCustomMissile("ExtremeGrenade", 0, 1, 0, 0, 0, 4.5)
		Goto FireEnd
	QuadLevel2:
		TNT1 A 0 A_Playsound("misc/qdmg",CHAN_AUTO,1)
		GRLG B 18 A_FireCustomMissile("ExtremeMushroomGrenade", 0, 1, 0, 0, 0, 4.5)
	FireEnd:
		GRLG B 0 A_ReFire
		Goto Ready 
	Flash: 
		GRLF A 3 bright A_Light1
		GRLF B 3 bright
		GRLF C 4 bright A_Light2
		GRLF D 3 bright A_Light2
		Goto LightDone
	}
}

ACTOR Heatseeker : IDMWeapon
{
  Weapon.SelectionOrder 400
  Weapon.SisterWeapon "SuperSeeker"
  Weapon.AmmoType "IDMRocketAmmo"
  Weapon.AmmoGive 15
  Weapon.AmmoUse 2
  Weapon.SlotNumber 5
  Inventory.PickupSound "misc/w_pkup"
  Inventory.PickupMessage "Heat Seeker!"
  Tag "Heat Seeker"
  +WEAPON.EXPLOSIVE
  +WEAPON.NOAUTOAIM
  States
  {
  Spawn:
	HEAT A -1 Bright
	Stop
  Ready:
	HSKR A 1 A_WeaponReady
	Loop
  Select:
	TNT1 A 0 A_PlaySound("weapons/wswitch",CHAN_WEAPON)
  Sloop:
    HSKR A 0 A_Raise
    HSKR A 0 A_Raise
    HSKR A 1 A_Raise
	Loop
  Deselect:
	HSKR A 0 A_Lower
	HSKR A 0 A_Lower
	HSKR A 1 A_Lower
	Loop
  Fire:
	HSKR A 3 Bright A_GunFlash
  Normal:
	MISG B 0 A_PlaySound("weapons/heatseekerf")
	TNT1 A 0 A_JumpIfInventory("PowerQuadDamage",1,"Quad")
	HSKR B 6 A_FireCustomMissile("HeatSeekerMissile",0,1)
	Goto FireEnd
  Quad:
	TNT1 A 0 A_Playsound("misc/qdmg",CHAN_AUTO,1)
	HSKR B 6 Bright A_FireCustomMissile("ExtremeHeatSeekerMissile",0,1)
  FireEnd:
	HSKR B 24 Bright A_Playsound("weapons/heatreload",CHAN_AUTO)
	HSKR A 5
	TNT1 A 0 A_Refire
	Goto Ready
  Flash:
	HSKF A 3 bright A_Light1
	HSKF B 3 bright
	HSKF C 4 bright A_Light2
	HSKF D 4 bright A_Light2
	Goto LightDone
  }
}

ACTOR SuperSeeker : HeatSeeker
{
	+POWERED_UP
	+WEAPON.CHEATNOTWEAPON
	Weapon.Sisterweapon "HeatSeeker"
	Weapon.Ammogive 0
	Weapon.AmmoUse 1
	States
	{
	Ready:
		MMIS A 1 A_WeaponReady
		Loop
	Select:
		TNT1 A 0 A_PlaySound("weapons/wswitch",CHAN_WEAPON)
	Sloop:
		MMIS A 0 A_Raise
		MMIS A 0 A_Raise
		MMIS A 1 A_Raise
		Loop
	Deselect:
		MMIS A 0 A_Lower
		MMIS A 0 A_Lower
		MMIS A 1 A_Lower
		Loop
	Fire:
		MMIS A 3 Bright
    Normal:
		MMIS B 0 A_GunFlash
		MMIS B 0 A_PlaySound("weapons/multimf")
		TNT1 A 0 A_Playsound("weapons/heatreload",CHAN_AUTO)
		TNT1 A 0 A_JumpIfInventory("PowerQuadDamage",1,"Quad")
		TNT1 A 0 A_FireCustomMissile("HeatSeekerMissile",-15,1)
		TNT1 A 0 A_FireCustomMissile("HeatSeekerMissile",0,1)
		MMIS B 4 Bright A_FireCustomMissile("HeatSeekerMissile",15,1)
		Goto FireEnd
	Quad:
		TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
		TNT1 A 0 A_FireCustomMissile("ExtremeHeatSeekerMissile",-15,1)
		TNT1 A 0 A_FireCustomMissile("ExtremeHeatSeekerMissile",0,1)
		MMIS B 4 Bright A_FireCustomMissile("ExtremeHeatSeekerMissile",15,1)
    FireEnd:
		MMIS CDE 4 Bright
		MMIS F 3 Bright
		MMIS A 13
		TNT1 A 0 A_Refire
		Goto Ready
    Flash:
		TNT1 A 2 bright A_Light1
		TNT1 A 1 bright
		TNT1 AA 1 bright A_Light2
		Goto LightDone
	}
}
	

// Rocket Launcher (Doom)

ACTOR IDMRocketLauncher : IDMWeapon
{
  Weapon.SelectionOrder 400
  Weapon.SlotNumber 5
  Weapon.AmmoUse 1
  Weapon.AmmoGive 15
  Weapon.AmmoType "IDMRocketAmmo"
  Inventory.PickupMessage "Rocket Launcher!"
  +WEAPON.EXPLOSIVE
  Tag "Rocket Launcher"
  States
  {
  Ready:
    MISG A 1 A_WeaponReady
    Loop
  Deselect:
    MISG A 0 A_Lower
    MISG A 0 A_Lower
    MISG A 1 A_Lower
    Loop
  Select:
	TNT1 A 0 A_PlaySound("weapons/wswitch",CHAN_WEAPON)
  Sloop:
    MISG A 0 A_Raise
    MISG A 0 A_Raise
    MISG A 1 A_Raise
    Loop
  Fire:
    MISG B 6 Bright A_GunFlash
	TNT1 A 0 A_PlaySound("weapons/rlfire")
  Normal:
	MISG B 0 A_JumpIfInventory("PowerIDMWeaponLevel2",1,"Level2")
	MISG B 0 A_JumpIfInventory("PowerQuadDamage",1,"Quad")
    MISG B 14 Bright A_FireCustomMissile("IDMSmallRocket",0,1)
    MISG B 0 A_Refire
	Goto Ready
  Level2:
	MISG B 0 A_JumpIfInventory("PowerQuadDamage",1,"QuadLevel2")
    MISG B 14 Bright A_FireCustomMissile("SmallBigRocket",0,1)
    MISG B 0 A_Refire
	Goto Ready
  Quad:
	TNT1 A 0 A_Playsound("misc/qdmg",CHAN_AUTO,1)
    MISG B 14 Bright A_FireCustomMissile("ExtremeSmallRocket",0,1)
	MISG B 0 A_Refire
	Goto Ready
  QuadLevel2:
	TNT1 A 0 A_Playsound("misc/qdmg",CHAN_AUTO,1)
    MISG B 14 Bright A_FireCustomMissile("ExtremeSmallBigRocket",0,1)
    MISG B 0 A_Refire
	Goto Ready
  Flash:
    MISF A 4 Bright A_Light1
    MISF B 4 Bright
    MISF CD 4 Bright A_Light2
    Goto LightDone
  Spawn:
    LAUN A -1 Bright
    Stop
  }
}

/// Slot 6 - Plasma weapons

// Plasmachine Gun

ACTOR PlasMachineGun : IDMWeapon
{
  Weapon.SlotNumber 6
  Weapon.SelectionOrder 100
  Weapon.AmmoUse 1
  Weapon.AmmoGive 50
  Weapon.AmmoType "IDMCell"
  Inventory.PickupMessage "Plasmachine Gun!"
  Tag "Plasmachine Gun"
  States
  {
  Ready:
    PLMG A 1 A_WeaponReady
    Loop
  Deselect:
    PLMG A 0 A_Lower
    PLMG A 0 A_Lower
	PLMG A 1 A_Lower
    Loop
  Select:
	TNT1 A 0 A_PlaySound("weapons/wswitch",CHAN_WEAPON)
  Sloop:
	PLMG A 0 A_Raise
	PLMG A 0 A_Raise
	PLMG A 1 A_Raise
    Loop
  Fire:
	TNT1 A 0 A_PlaySound("weapons/plmgchr",CHAN_WEAPON)
	PLMG A 3
	PLMG BC 3 Bright
  Hold:
	PLMG A 0 A_GunFlash
	PLMG A 0 A_JumpIfInventory("PowerIDMWeaponLevel2", 1, "Level2")
	PLMG A 0 A_JumpIfInventory("PowerQuadDamage", 1, "Quad")
  Normal:
    PLMG A 0 A_FireCustomMissile("IDMPlasmaBall",random(-6,6),1,6,1)
    PLMG A 3 A_FireCustomMissile("IDMPlasmaBall",random(-6,6),1,-6,1)
	TNT1 A 0 A_Refire
	PLMG B 0 A_GunFlash("Flash2")
    PLMG D 30
    Goto Ready
  Level2:
	PLMG A 0 A_JumpIfInventory("PowerQuadDamage", 1, "QuadLevel2")
    PLMG A 0 A_FireCustomMissile("IDMPlasmaBall2",random(-6,6),1,6,1)
    PLMG A 3 A_FireCustomMissile("IDMPlasmaBall2",random(-6,6),1,-6,1)
	TNT1 A 0 A_Refire
	PLMG B 0 A_GunFlash("Flash2")
    PLMG D 30
    Goto Ready
  Quad:
	TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
    PLMG A 0 A_FireCustomMissile("ExtremePlasmaBall",random(-6,6),1,6,1)
    PLMG A 3 A_FireCustomMissile("ExtremePlasmaBall",random(-6,6),1,-6,1)
	TNT1 A 0 A_Refire
	PLMG B 0 A_GunFlash("Flash2")
    PLMG D 30
    Goto Ready
  QuadLevel2:
	TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
    PLMG A 0 A_FireCustomMissile("ExtremePlasmaBall2",random(-6,6),1,6,1)
    PLMG A 3 A_FireCustomMissile("ExtremePlasmaBall2",random(-6,6),1,-6,1)
	TNT1 A 0 A_Refire
	PLMG B 0 A_GunFlash("Flash2")
    PLMG D 30
    Goto Ready
  Flash:
    PLMF A 3 Bright A_Light1
    PLMF B 3 Bright A_Light1
    Goto LightDone
  Flash2:
	PLMG D 2 Bright A_Light0
	Goto LightDone
  Spawn:
    PLMS A -1 Bright
    Stop
  }
}

// Plasma Gun (Doom)

ACTOR IDMPlasmaGun : IDMWeapon replaces PlasmaRifle
{
  Weapon.SlotNumber 6
  Weapon.SelectionOrder 200
  Weapon.Sisterweapon "PlasmaGunLevel2"
  Weapon.AmmoUse 1
  Weapon.AmmoGive 50
  Weapon.AmmoType "IDMCell"
  Weapon.Kickback 200
  Inventory.PickupMessage "Plasma Gun!"
  Tag "Plasma Gun"
  States
  {
  Ready:
    PLSG A 1 A_WeaponReady
    Loop
  Deselect:
    PLSG A 0 A_Lower
    PLSG A 0 A_Lower
    PLSG A 1 A_Lower
    Loop
  Select:
	TNT1 A 0 A_PlaySound("weapons/wswitch",CHAN_WEAPON)
  Sloop:
    PLSG A 0 A_Raise
    PLSG A 0 A_Raise
    PLSG A 1 A_Raise
    Loop
  Fire:
	PLSG A 0 A_GunFlash
	PLSG A 0 A_JumpIfInventory("PowerQuadDamage",1,"Quad")
  Normal:
    PLSG A 2 A_FireCustomMissile("IDMSmallPlasmaBall",0,1)
	PLSG A 1 A_GunFlash("Flash2")
    TNT1 A 0 A_ReFire
    PLSG B 20
    Goto Ready
  Quad:
	TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
	PLSG A 2 A_FireCustomMissile("ExtremeSmallPlasmaBall",0,1)
	PLSG A 1 A_GunFlash("Flash2")
    TNT1 A 0 A_ReFire
    PLSG B 20
    Goto Ready
  Flash:
    PLSF A 2 Bright A_Light1
    PLSF B 2 Bright A_Light1
    Goto LightDone
  Flash2:
	PLSG A 2 Bright A_Light1
	Goto LightDone
  Spawn:
    PLAS A -1 Bright
    Stop
  }
}

ACTOR PlasmaGunLevel2 : IDMPlasmaGun
{
  Weapon.Sisterweapon "IDMPlasmaGun"
  Weapon.AmmoUse 1
  +POWERED_UP
  +NOAUTOAIM
  States
  {
  Fire:
	PLSG A 0 A_GunFlash
	PLSG A 0 A_JumpIfInventory("PowerQuadDamage",1,"Quad")
  Normal:
    PLSG A 2 A_FireCustomMissile("IDMSmallPlasmaBall2",0,2)
	PLSG A 1 A_GunFlash("Flash2")
    TNT1 A 0 A_ReFire
    PLSG B 20
    Goto Ready
  Quad:
	TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
	PLSG A 2 A_FireCustomMissile("ExtremeSmallPlasmaBall2",0,2)
	PLSG A 1 A_GunFlash("Flash2")
    TNT1 A 0 A_ReFire
    PLSG B 20
    Goto Ready
  }
}



// Pulse Rifle

Actor PulseRifle : IDMWeapon
{
  Inventory.PickupMessage "Pulse Rifle!"
  Weapon.AmmoType "IDMCell"
  Weapon.AmmoUse 3
  Weapon.AmmoGive 50
  Weapon.Selectionorder 100
  Decal "ArachnotronScorch"
  Weapon.SlotNumber 6
  Tag "Pulse Rifle"
  States
  {
  Spawn:
    PULS A -1 Bright
    stop
  Ready:
      PULS B 1 A_WeaponReady
      Loop
  Deselect:
      PULS B 0 A_Lower
      PULS B 0 A_Lower
      PULS B 1 A_Lower
      Loop
  Select:
	TNT1 A 0 A_PlaySound("weapons/wswitch",CHAN_WEAPON)
  Sloop:
      PULS B 0 A_Raise
      PULS B 0 A_Raise
      PULS B 1 A_Raise
      loop
  Fire:
      PULS C 1 Bright
	  PULS D 0 A_GunFlash
	  PULS D 0 A_JumpIfInventory("PowerIDMWeaponLevel2",1,"Level2")
	  PULS D 0 A_JumpIfInventory("PowerQuadDamage",1,"Quad")
  Normal:
      PULS D 2 Bright A_FireCustomMissile("PulseBall",0,1)
	  Goto FireEnd
  Level2:
	  PULS D 0 A_JumpIfInventory("PowerQuadDamage",1,"QuadLevel2")
      PULS D 0 Bright A_FireCustomMissile("PulseBall2",random(-4,4),1)
      PULS D 0 Bright A_FireCustomMissile("PulseBall2",random(-4,4),0)
      PULS D 2 Bright A_FireCustomMissile("PulseBall2",random(-4,4),0)
	  Goto FireEnd
  Quad:
	  TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5,1)
      PULS D 2 Bright A_FireCustomMissile("ExtremePulseBall",0,1)
	  Goto FireEnd
  QuadLevel2:
	  TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5,1)
      PULS D 0 Bright A_FireCustomMissile("ExtremePulseBall2",random(-4,4),1)
      PULS D 0 Bright A_FireCustomMissile("ExtremePulseBall2",random(-4,4),0)
      PULS D 2 Bright A_FireCustomMissile("ExtremePulseBall2",random(-4,4),0)
  FireEnd:
	  PULS C 2 Bright
      PULS B 1
	  PULS B 2 A_ReFire
      Goto Ready
  Flash:
	  NULL A 7 A_Light1
	  Goto LightDone
  }
}


ACTOR PlasmaBeam : IDMWeapon
{
  Weapon.AmmoUse 1
  Weapon.AmmoGive 50
  Weapon.SelectionOrder 100
  Weapon.SlotNumber 6
  Weapon.AmmoType "IDMCell"
  Inventory.PickupMessage "Plasma Beam!"
  Tag "Plasma Beam"
  +WEAPON.NOAUTOAIM
  States
  {
  Ready:
    LECH A 1 A_WeaponReady
    Loop
  Deselect:
    LECH A 0 A_Lower
    LECH A 0 A_Lower
    LECH A 1 A_Lower
    LECH A 0 A_StopSoundEx(Weapon)
    LECH A 0 A_StopSoundEx(soundslot7)
    LECH A 0 A_StopSoundEx(Weapon)
    LECH A 0 A_StopSoundEx(soundslot7)
    Loop
  Select:
	TNT1 A 0 A_PlaySound("weapons/wswitch",CHAN_WEAPON)
  Sloop:
    LECH A 0 A_Raise
    LECH A 0 A_Raise
    LECH A 1 A_Raise
    LECH A 0 A_StopSoundEx(soundslot7)
    LECH A 0 A_StopSoundEx(soundslot7)
    Loop
  Fire:
	LECH A 13 Bright A_PlaysoundEx("Weapons/plsbmwind",Weapon)
	LECH BC 4 Bright
	LECH A 0 A_PlaysoundEx("weapons/plsbmfire",Soundslot6)
  Hold:
	TNT1 A 0 A_JumpIfInventory("PowerIDMWeaponLevel2",1,"Level2")
	TNT1 A 0 A_JumpIfInventory("PowerQuadDamage",1,"Quad")
    LECH A 0 A_GunFlash
    LECH A 1 A_FireCustomMissile("LeechBeam", 0, 1, 0, 0, 0)
    LECH A 0 A_PlaySoundEx("weapons/plsbmloop", soundslot7, 1)
    LECH A 0 A_PlaySoundEx("weapons/plsbmloop2", Weapon, 1)
    LECH A 1 A_FireCustomMissile("LeechBeam", 0, 0, 0, 0, 0)
	TNT1 A 0 A_JumpIfNoAmmo("NoAmmo")
    LECH A 1 A_ReFire
  NoAmmo:
	LECH A 0 A_StopSoundEx(Weapon)
	LECH A 0 A_StopSoundEx(soundslot7)
    LECH A 1 A_PlaysoundEx("weapons/plsbmstop",Weapon)
    LECH AAAAAAAAAAAAAAAAAAAAAAAA 1 A_StopSoundEx(soundslot7)
    Goto Ready
  Level2:
	TNT1 A 0 A_JumpIfInventory("PowerQuadDamage",1,"QuadLevel2")
    LECH A 0 A_GunFlash
	LECH A 0 A_FireCustomMissile("LeechBeam2", random(-5,1), 0, 3, 0, 0)
	LECH A 1 A_FireCustomMissile("LeechBeam2", random(-1,5), 1, -3, 0, 0)
    LECH A 0 A_PlaySoundEx("weapons/plsbmloop", soundslot7, 1)
    LECH A 0 A_PlaySoundEx("weapons/plsbmloop2", Weapon, 1)
	LECH A 0 A_FireCustomMissile("LeechBeam2", 0, 0, 3, 0, 0)
	LECH A 1 A_FireCustomMissile("LeechBeam2", 0, 0, -3, 0, 0)
	TNT1 A 0 A_JumpIfNoAmmo("NoAmmo")
    LECH A 1 A_ReFire
	LECH A 0 A_StopSoundEx(Weapon)
	LECH A 0 A_StopSoundEx(soundslot7)
    LECH A 1 A_PlaysoundEx("weapons/plsbmstop",Weapon)
    LECH AAAAAAAAAAAAAAAAAAAAAAAA 1 A_StopSoundEx(soundslot7)
    Goto Ready
  Quad:
	TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5,1)
    LECH A 0 A_GunFlash
    LECH A 1 A_FireCustomMissile("ExtremeLeechBeam", 0, 1, 0, 0, 0)
    LECH A 0 A_PlaySoundEx("weapons/plsbmloop", soundslot7, 1)
    LECH A 0 A_PlaySoundEx("weapons/plsbmloop2", Weapon, 1)
    LECH A 1 A_FireCustomMissile("ExtremeLeechBeam", 0, 0, 0, 0, 0)
    LECH A 1 A_ReFire
	LECH A 0 A_StopSoundEx(Weapon)
	LECH A 0 A_StopSoundEx(soundslot7)
    LECH A 1 A_PlaysoundEx("weapons/plsbmstop",Weapon)
    LECH AAAAAAAAAAAAAAAAAAAAAAAA 1 A_StopSoundEx(soundslot7)
	Goto Ready
  QuadLevel2:
	TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5,1)
    LECH A 0 A_GunFlash
	LECH A 0 A_FireCustomMissile (ExtremeLeechBeam2, random(-5,1), 0, 3, 0, 0)
	LECH A 1 A_FireCustomMissile (ExtremeLeechBeam2, random(-1,5), 1, -3, 0, 0)
    LECH A 0 A_PlaySoundEx("weapons/plsbmloop", soundslot7, 1)
    LECH A 0 A_PlaySoundEx("weapons/plsbmloop2", Weapon, 1)
	LECH A 0 A_FireCustomMissile (ExtremeLeechBeam2, 0, 0, 3, 0, 0)
	LECH A 1 A_FireCustomMissile (ExtremeLeechBeam2, 0, 0, -3, 0, 0)
    LECH A 1 A_ReFire
	LECH A 0 A_StopSoundEx(Weapon)
	LECH A 0 A_StopSoundEx(soundslot7)
    LECH A 1 A_PlaysoundEx("weapons/plsbmstop",Weapon)
    LECH AAAAAAAAAAAAAAAAAAAAAAAA 1 A_StopSoundEx(soundslot7)
    Goto Ready
  Flash:
    LECH B 1 bright A_Light1
    LECH C 1 bright A_Light2
    LECH B 1 bright A_Light0
    Stop
  Spawn:
    BEMP A -1
    Stop
  }
}



// Railgun (Skulltag / Quake 2/3)

ACTOR IDMRailgun : IDMWeapon
{
  Radius 20
  Height 16
  Weapon.SlotNumber 6
  Weapon.KickBack 200
  Weapon.Selectionorder 300
  Weapon.AmmoUse 10
  Weapon.AmmoGive 50
  Weapon.AmmoType "IDMCell"
  Weapon.SisterWeapon "RailgunLevel2"
  Inventory.Pickupmessage "Railgun!"
  Obituary "%o was railed by %k."
  Decal RailScorch
  DamageType "Railgun"
  Tag "Railgun"
  +WEAPON.NOAUTOAIM
  States
  {
  Ready:
	RLGG A 1 A_Weaponready
    Loop
  Deselect:
    RLGG A 0 A_Lower
    RLGG A 0 A_Lower
    RLGG A 1 A_Lower
    Loop
  Select:
	TNT1 A 0 A_PlaySound("weapons/wswitch",CHAN_WEAPON)
  Sloop:
    RLGG A 0 A_Raise
    RLGG A 0 A_Raise
    RLGG A 1 A_Raise
    Loop
  Fire:
	TNT1 A 0 A_JumpIfInventory("PowerQuadDamage",1,"Quad")
	Goto Normal
  Quad:
	TNT1 A 0 A_Playsound("misc/qdmg",CHAN_AUTO,1)
  Normal:
	RLGG D 0 A_GunFlash
	RLGG D 0 A_RailAttack(random(200,250))
	RLGG D 2 Bright Offset(0,45) A_Playsound("weapons/railgun", CHAN_WEAPON)
    RLGG C 2 Bright Offset(0,40)
	RLGG B 2 Bright Offset(0,35)
	RLGG A 2 Bright
	RLGG E 3
    RLGG F 4 A_Playsound("weapons/railclip",CHAN_AUTO,0.75)
	RLGG G 4
	RLGG H 9 A_CheckReload
	RLGG I 4
	RLGG J 3
	RLGG K 4 A_Playsound("weapons/railreload",CHAN_AUTO)
	RLGG L 4
	RLGG A 4
    TNT1 A 0 A_ReFire
    Goto Ready
  Flash:
	TNT1 A 6 A_Light1
    Goto LightDone
  Spawn:
    RAIL A -1 Bright
    Stop
  }
}

ACTOR RailgunLevel2 : IDMRailgun
{
  Weapon.AmmoUse 5
  Weapon.Sisterweapon "IDMRailgun"
  +POWERED_UP
  States
  {
  Fire:
	TNT1 A 0 A_JumpIfInventory("PowerQuadDamage",1,"Quad")
	Goto Normal
  Quad:
	TNT1 A 0 A_Playsound("misc/qdmg",CHAN_AUTO,1)
  Normal:
	RLGG D 0 A_GunFlash
	RLGG A 0 A_StopSound(CHAN_6)
	RLGG D 0 A_RailAttack(random(200,250))
	RLGG D 2 Bright Offset(0,45) A_Playsound("weapons/railgun", CHAN_WEAPON)
    RLGG C 2 Bright Offset(0,40)
	RLGG B 2 Bright Offset(0,35)
	RLGG A 2 Bright
	TNT1 A 0 A_CheckForReload(4,"Recoil")
	Goto FireEnd
  Recoil:
	RLGG A 6 Offset(0,34)
	RLGG A 4 Offset(0,33)
	Goto Ready
  FireEnd:
	RLGG E 3
    RLGG F 3 A_Playsound("weapons/railclip",CHAN_AUTO,0.75)
	RLGG G 4
	RLGG H 12 A_CheckReload
	RLGG IJ 3
	RLGG K 4 A_Playsound("weapons/railreload",CHAN_AUTO)
	RLGG L 4
	RLGG A 4 A_ResetReloadCounter
    RLGG M 0 A_ReFire
    Goto Ready
	}
}
  
  
/// Slot 7 - BIG WEAPONS!! ///

// BFG Prototype

ACTOR BFG9000 : IDMWeapon // Registered as 'BFG9000' to ensure Spam!-medal compatibility.
{
  Weapon.SlotNumber 7
  Height 20
  Weapon.SelectionOrder 50
  Weapon.AmmoUse 40
  Weapon.AmmoGive 100
  Weapon.AmmoType "IDMCell"
  +WEAPON.BFG
  +WEAPON.EXPLOSIVE
  +WEAPON.NOAUTOAIM
  Inventory.PickupMessage "BFG Prototype!"
  Tag "BFG Prototype"
  States
  {
  Ready:
    BFGG A 17 A_WeaponReady
	BFGG B 17 A_WeaponReady
    Loop
  Deselect:
    BFGG A 0 A_StopSound(CHAN_WEAPON)
    BFGG A 1 A_Lower
    Loop
  Select:
	TNT1 A 0 A_PlaySound("weapons/wswitch",CHAN_WEAPON)
  Sloop:
	BFGG A 1 A_Raise
    Loop
  Fire:
    BFGG A 20 A_BFGSound
    BFGG B 10 A_GunFlash
	TNT1 A 0 A_Recoil(3)
	TNT1 A 0 A_JumpIfInventory("PowerIDMWeaponLevel2",1,"Level2")
	BFGG B 0 A_JumpIfInventory("PowerQuadDamage", 1, "Quad")
  Normal:
    BFGG B 10 A_FireCustomMissile("IDMBFGBall",0,1)
	Goto FireEnd
  Quad:
	TNT1 A 0 A_Playsound("misc/qdmg",CHAN_AUTO,1)
	BFGG B 10 A_FireCustomMissile("ExtremeBFGBall",0,1)
	Goto FireEnd
  Level2:
	TNT1 A 0 A_GunFlash("Flash2")
	BFGG B 0 A_JumpIfInventory("PowerQuadDamage", 1, "QuadLevel2")
    BFGG B 6 A_FireCustomMissile("IDMBFGBall",random(-10,10),1)
	TNT1 A 0 A_GunFlash("Flash2")
    BFGG B 6 A_FireCustomMissile("IDMBFGBall",random(-10,10),0)
	TNT1 A 0 A_GunFlash("Flash2")
    BFGG B 6 A_FireCustomMissile("IDMBFGBall",random(-10,10),0)
	TNT1 A 0 A_Refire
	Goto Ready
  QuadLevel2:
    BFGG B 6 A_FireCustomMissile("ExtremeBFGBall",0,1)
	TNT1 A 0 A_GunFlash("Flash2")
    BFGG B 6 A_FireCustomMissile("ExtremeBFGBall",0,0)
	TNT1 A 0 A_GunFlash("Flash2")
    BFGG B 6 A_FireCustomMissile("ExtremeBFGBall",0,0)
	TNT1 A 0 A_Refire
  FireEnd:
    BFGG A 0 A_PlaySound("weapons/bfgcool")
	BFGG ABABABA 6
	BFGG B 6 A_Refire
	BFGG AB 6
	Goto Ready
  Flash:
    BFGF A 6 Bright A_Light1
    BFGF B 6 Bright A_Light2
	BFGF C 5 Bright A_Light0
	Goto LightDone
  Flash2:
    BFGF B 4 Bright A_Light2
	BFGF C 5 Bright A_Light0
	Goto LightDone
  Spawn:
    BFUG A -1 Bright
    Stop
  }
}

// Quad Shotgun

ACTOR QuadShotgun : IDMWeapon
{
  Tag "Quad-Shotgun"
  Obituary "%o was obliterated by %k's Quad-Shotgun!"
  Radius 20
  Height 16
  Inventory.Pickupmessage "Quad Shotgun!"
  weapon.selectionorder 50
  Weapon.SlotNumber 7
  Weapon.kickback 400
  Weapon.AmmoType "IDMShell"
  Weapon.AmmoGive 20
  Weapon.AmmoUse 4
  Decal "BulletChip"
  Damagetype "Bullet"
  +WEAPON.BFG
  states
  {
  Ready:
   SHT4 A 1 A_WeaponReady
    loop
  Deselect: 
   SHT4 A 1 A_Lower
   loop
  Select:
	TNT1 A 0 A_PlaySound("weapons/wswitch",CHAN_WEAPON)
  Sloop:
    SHT4 A 1 A_Raise
    loop
  Fire:
	SHT4 A 4
  	SHT4 A 0 A_PlaySound("weapons/qshotf",CHAN_WEAPON)
    TNT1 A 0 A_GunFlash
	TNT1 A 0 A_JumpIfInventory("PowerIDMWeaponLevel2",1,"Level2")
	TNT1 A 0 A_JumpIfInventory("PowerQuadDamage",1,"Quad")
  Normal:
	TNT1 A 0 A_Recoil(4)
	SHT4 A 7 Bright A_FireBullets (22.4, 10.65, 250, 10, "QuadShotPuff")
	Goto FireEnd
  Level2:
	TNT1 A 0 A_Quake(7,10,0,100,none)
	TNT1 A 0 A_Recoil(20)
	TNT1 A 0 A_PlaySound("weapons/qshot2",CHAN_WEAPON)
	TNT1 A 0 A_JumpIfInventory("PowerQuadDamage",1,"QuadLevel2")
	SHT4 A 7 Bright A_FireBullets (44.8, 21.1, 2000, 10, "QuadShotPuff")
	Goto FireEnd
  Quad:
	TNT1 A 0 A_Recoil(4)
	TNT1 A 0 A_Playsound("misc/qdmg",CHAN_AUTO,1)
	SHT4 A 7 Bright A_FireBullets (22.4, 10.65, 250, 10, "ExtremePuff")
	Goto FireEnd
  QuadLevel2:
	TNT1 A 0 A_Playsound("misc/qdmg",CHAN_AUTO,1)
	SHT4 A 7 Bright A_FireBullets (44.8, 21.1, 2000, 10, "ExtremePuff")
  FireEnd:
	SHT4 B 7
	SHT4 C 8 A_CheckReload
	SHT4 D 7 A_Playsound("weapons/qsopen",CHAN_WEAPON)
	SHT4 E 8
	SHT4 F 4
	SHT4 F 4 A_Playsound("weapons/qsload",CHAN_WEAPON)
	SHT4 G 7
	SHT4 H 7
	SHT4 H 1 A_Playsound("weapons/qsclose",CHAN_WEAPON)
	TNT1 A 0 A_Refire
	SHT4 I 7
	SHT4 A 5
	Goto Ready
  Flash:
    SH4X A 4 Bright A_Light1
    SH4X B 2 Bright A_Light2
    Goto LightDone
  Spawn:
    QSGW A -1 Bright
    stop
  }
}

// Hellstorm Cannon

Actor HellstormCannon : IDMWeapon
{
  Weapon.SlotNumber 7
  Weapon.SelectionOrder 50
  Weapon.AmmoUse 6
  Weapon.AmmoGive 12
  Weapon.AmmoType "IDMRocketAmmo"
  DamageType "Hellstorm"
  +WEAPON.NOAUTOAIM
  +WEAPON.BFG
  Inventory.PickupMessage "HellStorm Cannon!"
  Tag "Hellstorm Cannon"
  States
  {
  Ready:
    HSTM B 1 A_WeaponReady
    Loop
  Deselect:
    HSTM B 1 A_Lower
    Loop
  Select:
	TNT1 A 0 A_PlaySound("weapons/wswitch",CHAN_WEAPON)
  Sloop:
    HSTM B 1 A_Raise
    Loop
  Fire:
	HSTM B 24 A_PlayWeaponSound("Hellstorm/Prime")
    HSTM B 3 Bright A_GunFlash
    TNT1 A 0 A_PlayWeaponSound("HellStorm/Fire")
	TNT1 A 0 A_Recoil(4)
	TNT1 A 0 A_JumpIfInventory("PowerQuadDamage",1,"Quad")
	Goto NormalA
	Quad:
	TNT1 A 0 A_Playsound("misc/qdmg",CHAN_AUTO,1)
	// Oh boy here we go...
	NormalA:
    TNT1 A 0 Bright A_FireCustomMissile("HellstormRocket1", random(-15, 15), 0, 0, 0, 0, random(-1,1))
    TNT1 A 0 Bright A_FireCustomMissile("HellstormRocket2", random(-15, 15), 0, 0, 0, 0, random(-1,1))
 	TNT1 A 0 Bright A_FireCustomMissile("HellstormTracer", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	TNT1 A 0 Bright A_FireCustomMissile("HellstormFatShot", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	TNT1 A 0 Bright A_FireCustomMissile("HellstormImpBall", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	TNT1 A 0 Bright A_FireCustomMissile("HellstormCacoBall", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	TNT1 A 0 Bright A_FireCustomMissile("HellstormSkull", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	TNT1 A 0 Bright A_FireCustomMissile("HellstormBaronBall", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	HSTM C 1 Bright
    TNT1 A 0 Bright A_FireCustomMissile("HellstormRocket1", random(-15, 15), 0, 0, 0, 0, random(-1,1))
    TNT1 A 0 Bright A_FireCustomMissile("HellstormRocket2", random(-15, 15), 0, 0, 0, 0, random(-1,1))
 	TNT1 A 0 Bright A_FireCustomMissile("HellstormTracer", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	TNT1 A 0 Bright A_FireCustomMissile("HellstormFatShot", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	TNT1 A 0 Bright A_FireCustomMissile("HellstormImpBall", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	TNT1 A 0 Bright A_FireCustomMissile("HellstormCacoBall", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	TNT1 A 0 Bright A_FireCustomMissile("HellstormSkull", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	TNT1 A 0 Bright A_FireCustomMissile("HellstormBaronBall", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	HSTM C 1 Bright
    TNT1 A 0 Bright A_FireCustomMissile("HellstormRocket1", random(-15, 15), 0, 0, 0, 0, random(-1,1))
    TNT1 A 0 Bright A_FireCustomMissile("HellstormRocket2", random(-15, 15), 0, 0, 0, 0, random(-1,1))
 	TNT1 A 0 Bright A_FireCustomMissile("HellstormTracer", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	TNT1 A 0 Bright A_FireCustomMissile("HellstormFatShot", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	TNT1 A 0 Bright A_FireCustomMissile("HellstormImpBall", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	TNT1 A 0 Bright A_FireCustomMissile("HellstormCacoBall", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	TNT1 A 0 Bright A_FireCustomMissile("HellstormSkull", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	TNT1 A 0 Bright A_FireCustomMissile("HellstormBaronBall", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	HSTM C 1 Bright
	TNT1 A 0 A_JumpIfInventory("PowerIDMWeaponLevel2",1,"Level2A")
	Goto NormalB
	Level2A:
    TNT1 A 0 Bright A_FireCustomMissile("HellstormRocket1", random(-15, 15), 0, 0, 0, 0, random(-1,1))
    TNT1 A 0 Bright A_FireCustomMissile("HellstormRocket2", random(-15, 15), 0, 0, 0, 0, random(-1,1))
 	TNT1 A 0 Bright A_FireCustomMissile("HellstormTracer", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	TNT1 A 0 Bright A_FireCustomMissile("HellstormFatShot", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	TNT1 A 0 Bright A_FireCustomMissile("HellstormImpBall", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	TNT1 A 0 Bright A_FireCustomMissile("HellstormCacoBall", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	TNT1 A 0 Bright A_FireCustomMissile("HellstormSkull", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	TNT1 A 0 Bright A_FireCustomMissile("HellstormBaronBall", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	HSTM C 1 Bright
    TNT1 A 0 Bright A_FireCustomMissile("HellstormRocket1", random(-15, 15), 0, 0, 0, 0, random(-1,1))
    TNT1 A 0 Bright A_FireCustomMissile("HellstormRocket2", random(-15, 15), 0, 0, 0, 0, random(-1,1))
 	TNT1 A 0 Bright A_FireCustomMissile("HellstormTracer", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	TNT1 A 0 Bright A_FireCustomMissile("HellstormFatShot", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	TNT1 A 0 Bright A_FireCustomMissile("HellstormImpBall", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	TNT1 A 0 Bright A_FireCustomMissile("HellstormCacoBall", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	TNT1 A 0 Bright A_FireCustomMissile("HellstormSkull", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	TNT1 A 0 Bright A_FireCustomMissile("HellstormBaronBall", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	HSTM C 1 Bright
    TNT1 A 0 Bright A_FireCustomMissile("HellstormRocket1", random(-15, 15), 0, 0, 0, 0, random(-1,1))
    TNT1 A 0 Bright A_FireCustomMissile("HellstormRocket2", random(-15, 15), 0, 0, 0, 0, random(-1,1))
 	TNT1 A 0 Bright A_FireCustomMissile("HellstormTracer", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	TNT1 A 0 Bright A_FireCustomMissile("HellstormFatShot", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	TNT1 A 0 Bright A_FireCustomMissile("HellstormImpBall", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	TNT1 A 0 Bright A_FireCustomMissile("HellstormCacoBall", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	TNT1 A 0 Bright A_FireCustomMissile("HellstormSkull", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	TNT1 A 0 Bright A_FireCustomMissile("HellstormBaronBall", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	HSTM C 1 Bright
	NormalB:
    TNT1 A 0 Bright A_FireCustomMissile("HellstormRocket1", random(-15, 15), 0, 0, 0, 0, random(-1,1))
    TNT1 A 0 Bright A_FireCustomMissile("HellstormRocket2", random(-15, 15), 0, 0, 0, 0, random(-1,1))
 	TNT1 A 0 Bright A_FireCustomMissile("HellstormTracer", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	TNT1 A 0 Bright A_FireCustomMissile("HellstormFatShot", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	TNT1 A 0 Bright A_FireCustomMissile("HellstormImpBall", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	TNT1 A 0 Bright A_FireCustomMissile("HellstormCacoBall", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	TNT1 A 0 Bright A_FireCustomMissile("HellstormSkull", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	TNT1 A 0 Bright A_FireCustomMissile("HellstormBaronBall", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	HSTM C 1 Bright
    TNT1 A 0 Bright A_FireCustomMissile("HellstormRocket1", random(-15, 15), 0, 0, 0, 0, random(-1,1))
    TNT1 A 0 Bright A_FireCustomMissile("HellstormRocket2", random(-15, 15), 0, 0, 0, 0, random(-1,1))
 	TNT1 A 0 Bright A_FireCustomMissile("HellstormTracer", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	TNT1 A 0 Bright A_FireCustomMissile("HellstormFatShot", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	TNT1 A 0 Bright A_FireCustomMissile("HellstormImpBall", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	TNT1 A 0 Bright A_FireCustomMissile("HellstormCacoBall", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	TNT1 A 0 Bright A_FireCustomMissile("HellstormSkull", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	TNT1 A 0 Bright A_FireCustomMissile("HellstormBaronBall", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	HSTM C 1 Bright
    TNT1 A 0 Bright A_FireCustomMissile("HellstormRocket1", random(-15, 15), 0, 0, 0, 0, random(-1,1))
    TNT1 A 0 Bright A_FireCustomMissile("HellstormRocket2", random(-15, 15), 0, 0, 0, 0, random(-1,1))
 	TNT1 A 0 Bright A_FireCustomMissile("HellstormTracer", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	TNT1 A 0 Bright A_FireCustomMissile("HellstormFatShot", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	TNT1 A 0 Bright A_FireCustomMissile("HellstormImpBall", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	TNT1 A 0 Bright A_FireCustomMissile("HellstormCacoBall", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	TNT1 A 0 Bright A_FireCustomMissile("HellstormSkull", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	TNT1 A 0 Bright A_FireCustomMissile("HellstormBaronBall", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	HSTM C 1 Bright
	TNT1 A 0 A_JumpIfInventory("PowerIDMWeaponLevel2",1,"Level2B")
	Goto NormalC
	Level2B:
    TNT1 A 0 Bright A_FireCustomMissile("HellstormRocket1", random(-15, 15), 0, 0, 0, 0, random(-1,1))
    TNT1 A 0 Bright A_FireCustomMissile("HellstormRocket2", random(-15, 15), 0, 0, 0, 0, random(-1,1))
 	TNT1 A 0 Bright A_FireCustomMissile("HellstormTracer", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	TNT1 A 0 Bright A_FireCustomMissile("HellstormFatShot", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	TNT1 A 0 Bright A_FireCustomMissile("HellstormImpBall", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	TNT1 A 0 Bright A_FireCustomMissile("HellstormCacoBall", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	TNT1 A 0 Bright A_FireCustomMissile("HellstormSkull", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	TNT1 A 0 Bright A_FireCustomMissile("HellstormBaronBall", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	HSTM C 1 Bright
    TNT1 A 0 Bright A_FireCustomMissile("HellstormRocket1", random(-15, 15), 0, 0, 0, 0, random(-1,1))
    TNT1 A 0 Bright A_FireCustomMissile("HellstormRocket2", random(-15, 15), 0, 0, 0, 0, random(-1,1))
 	TNT1 A 0 Bright A_FireCustomMissile("HellstormTracer", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	TNT1 A 0 Bright A_FireCustomMissile("HellstormFatShot", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	TNT1 A 0 Bright A_FireCustomMissile("HellstormImpBall", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	TNT1 A 0 Bright A_FireCustomMissile("HellstormCacoBall", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	TNT1 A 0 Bright A_FireCustomMissile("HellstormSkull", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	TNT1 A 0 Bright A_FireCustomMissile("HellstormBaronBall", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	HSTM C 1 Bright
    TNT1 A 0 Bright A_FireCustomMissile("HellstormRocket1", random(-15, 15), 0, 0, 0, 0, random(-1,1))
    TNT1 A 0 Bright A_FireCustomMissile("HellstormRocket2", random(-15, 15), 0, 0, 0, 0, random(-1,1))
 	TNT1 A 0 Bright A_FireCustomMissile("HellstormTracer", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	TNT1 A 0 Bright A_FireCustomMissile("HellstormFatShot", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	TNT1 A 0 Bright A_FireCustomMissile("HellstormImpBall", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	TNT1 A 0 Bright A_FireCustomMissile("HellstormCacoBall", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	TNT1 A 0 Bright A_FireCustomMissile("HellstormSkull", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	TNT1 A 0 Bright A_FireCustomMissile("HellstormBaronBall", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	HSTM C 1 Bright
	NormalC:
    TNT1 A 0 Bright A_FireCustomMissile("HellstormRocket1", random(-15, 15), 0, 0, 0, 0, random(-1,1))
    TNT1 A 0 Bright A_FireCustomMissile("HellstormRocket2", random(-15, 15), 0, 0, 0, 0, random(-1,1))
 	TNT1 A 0 Bright A_FireCustomMissile("HellstormTracer", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	TNT1 A 0 Bright A_FireCustomMissile("HellstormFatShot", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	TNT1 A 0 Bright A_FireCustomMissile("HellstormImpBall", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	TNT1 A 0 Bright A_FireCustomMissile("HellstormCacoBall", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	TNT1 A 0 Bright A_FireCustomMissile("HellstormSkull", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	TNT1 A 0 Bright A_FireCustomMissile("HellstormBaronBall", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	HSTM D 1 Bright
    TNT1 A 0 Bright A_FireCustomMissile("HellstormRocket1", random(-15, 15), 0, 0, 0, 0, random(-1,1))
    TNT1 A 0 Bright A_FireCustomMissile("HellstormRocket2", random(-15, 15), 0, 0, 0, 0, random(-1,1))
 	TNT1 A 0 Bright A_FireCustomMissile("HellstormTracer", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	TNT1 A 0 Bright A_FireCustomMissile("HellstormFatShot", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	TNT1 A 0 Bright A_FireCustomMissile("HellstormImpBall", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	TNT1 A 0 Bright A_FireCustomMissile("HellstormCacoBall", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	TNT1 A 0 Bright A_FireCustomMissile("HellstormSkull", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	TNT1 A 0 Bright A_FireCustomMissile("HellstormBaronBall", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	HSTM D 1 Bright
    TNT1 A 0 Bright A_FireCustomMissile("HellstormRocket1", random(-15, 15), 0, 0, 0, 0, random(-1,1))
    TNT1 A 0 Bright A_FireCustomMissile("HellstormRocket2", random(-15, 15), 0, 0, 0, 0, random(-1,1))
 	TNT1 A 0 Bright A_FireCustomMissile("HellstormTracer", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	TNT1 A 0 Bright A_FireCustomMissile("HellstormFatShot", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	TNT1 A 0 Bright A_FireCustomMissile("HellstormImpBall", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	TNT1 A 0 Bright A_FireCustomMissile("HellstormCacoBall", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	TNT1 A 0 Bright A_FireCustomMissile("HellstormSkull", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	TNT1 A 0 Bright A_FireCustomMissile("HellstormBaronBall", random(-15, 15), 1, 0, 0, 0, random(-1,1))
	TNT1 A 0 A_JumpIfInventory("PowerIDMWeaponLevel2",1,"Level2C")
	Goto FireEnd
  Level2C:
    TNT1 A 0 Bright A_FireCustomMissile("HellstormRocket1", random(-15, 15), 0, 0, 0, 0, random(-1,1))
    TNT1 A 0 Bright A_FireCustomMissile("HellstormRocket2", random(-15, 15), 0, 0, 0, 0, random(-1,1))
 	TNT1 A 0 Bright A_FireCustomMissile("HellstormTracer", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	TNT1 A 0 Bright A_FireCustomMissile("HellstormFatShot", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	TNT1 A 0 Bright A_FireCustomMissile("HellstormImpBall", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	TNT1 A 0 Bright A_FireCustomMissile("HellstormCacoBall", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	TNT1 A 0 Bright A_FireCustomMissile("HellstormSkull", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	TNT1 A 0 Bright A_FireCustomMissile("HellstormBaronBall", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	HSTM D 1 Bright
    TNT1 A 0 Bright A_FireCustomMissile("HellstormRocket1", random(-15, 15), 0, 0, 0, 0, random(-1,1))
    TNT1 A 0 Bright A_FireCustomMissile("HellstormRocket2", random(-15, 15), 0, 0, 0, 0, random(-1,1))
 	TNT1 A 0 Bright A_FireCustomMissile("HellstormTracer", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	TNT1 A 0 Bright A_FireCustomMissile("HellstormFatShot", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	TNT1 A 0 Bright A_FireCustomMissile("HellstormImpBall", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	TNT1 A 0 Bright A_FireCustomMissile("HellstormCacoBall", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	TNT1 A 0 Bright A_FireCustomMissile("HellstormSkull", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	TNT1 A 0 Bright A_FireCustomMissile("HellstormBaronBall", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	HSTM D 1 Bright
    TNT1 A 0 Bright A_FireCustomMissile("HellstormRocket1", random(-15, 15), 0, 0, 0, 0, random(-1,1))
    TNT1 A 0 Bright A_FireCustomMissile("HellstormRocket2", random(-15, 15), 0, 0, 0, 0, random(-1,1))
 	TNT1 A 0 Bright A_FireCustomMissile("HellstormTracer", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	TNT1 A 0 Bright A_FireCustomMissile("HellstormFatShot", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	TNT1 A 0 Bright A_FireCustomMissile("HellstormImpBall", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	TNT1 A 0 Bright A_FireCustomMissile("HellstormCacoBall", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	TNT1 A 0 Bright A_FireCustomMissile("HellstormSkull", random(-15, 15), 0, 0, 0, 0, random(-1,1))
	TNT1 A 0 Bright A_FireCustomMissile("HellstormBaronBall", random(-15, 15), 0, 0, 0, 0, random(-1,1))
  FireEnd:
    HSTM D 10 A_PlaySoundEx("HellStorm/Reload", "SoundSlot6", 0)
    HSTM B 38
	TNT1 A 0 A_Refire
    Goto Ready
  Flash:
    TNT1 A 12 Bright
    Goto Lightdone
  Spawn:
    HSTM A -1 Bright
    Stop
  }
}

// Minigun (Skulltag)

ACTOR IDMMinigun : IDMWeapon
{
	Weapon.Slotnumber 7
	Weapon.SelectionOrder 50
	Weapon.Ammotype "IDMclip"
	Weapon.Ammouse 1
	Weapon.AmmoGive 200
	Weapon.Kickback 200
	Inventory.PickupMessage "Minigun!"
	Obituary "%o got a load of hail mary from %k's Minigun!"
	Tag "Minigun"
	+WEAPON.BFG
	Decal "BulletChip"
	Damagetype "Bullet"
	States
	{
	Spawn:
		MNGN A -1 Bright
		Stop
	Ready:
		MNGG A 1 A_WeaponReady
		Loop
	Select:
		TNT1 A 0 A_PlaySound("weapons/wswitch",CHAN_WEAPON)
	Sloop:
		MNGG A 1 A_Raise
		Loop
	Deselect:
		TNT1 A 0 A_StopSound(CHAN_7)
		TNT1 A 0 A_StopSound(CHAN_WEAPON)
		TNT1 A 0 A_JumpIfInventory("GunSpinnerDummy",1,"FireDeselect")
		Goto DeSloop
	FireDeselect:
		TNT1 A 0 A_Playsound("weapons/ministop",CHAN_6)
	Desloop:
		TNT1 A 0 A_TakeInventory("GunSpinnerDummy")
		MNGG A 1 A_Lower
		Loop
	Fire:
		TNT1 A 0 A_GiveInventory("GunSpinnerDummy")
		TNT1 A 0 A_JumpIfNoAmmo("Ready")
		TNT1 A 0 A_Playsound("weapons/ministart",CHAN_6)
		TNT1 A 0 A_JumpIfInventory("PowerIDMWeaponLevel2",1,"Level2Spool")
		Goto Spool
	Spool:
		MNGG ABA 4
		MNGG BAB 3
		MNGG AB 2
		MNGG AB 1
		TNT1 A 0 A_Playsound("weapons/minispecial", CHAN_7, 1)
		Goto Hold
	Level2Spool:
		MNGG ABAB 3
		MNGG AB 2
		MNGG AB 1
		TNT1 A 0 A_Playsound("weapons/minispecial", CHAN_7, 1)
	Hold:
		TNT1 A 0 A_GiveInventory("GunSpinnerDummy")
		TNT1 A 0 A_Playsound("weapons/miniloop",CHAN_6)
		TNT1 A 0 A_JumpIfInventory("PowerIDMWeaponLevel2",1,"L2Hold")
		TNT1 A 0 A_JumpIfInventory("PowerQuadDamage",1,"Quad")
		TNT1 A 0 A_JumpIfNoAmmo("OutofAmmo")
	Normal:
		TNT1 A 0 A_PlaySound("weapons/minigun",CHAN_WEAPON,1)
		TNT1 A 0 A_GunFlash
		MNGG A 1 Bright A_FireBullets(8.4, 3.55, random(1,3), 10,"QuadShotPuff")
		TNT1 A 0 A_JumpIfNoAmmo("OutofAmmo")
		TNT1 A 0 A_GunFlash("Flash2")
		MNGG B 1 Bright A_FireBullets(8.4, 3.55, random(1,3), 10,"QuadShotPuff")
		TNT1 A 0 A_JumpIfNoAmmo("OutofAmmo")
		TNT1 A 0 A_PlaySound("weapons/minigun",CHAN_WEAPON,1)
		TNT1 A 0 A_GunFlash
		MNGG A 1 Bright A_FireBullets(8.4, 3.55, random(1,3), 10,"QuadShotPuff")
		TNT1 A 0 A_JumpIfNoAmmo("OutofAmmo")
		TNT1 A 0 A_GunFlash("Flash2")
		MNGG B 1 Bright A_FireBullets(8.4, 3.55, random(1,3), 10,"QuadShotPuff")
		TNT1 A 0 A_JumpIfNoAmmo("OutofAmmo")
		Goto FireEnd
	Quad:
		TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
		TNT1 A 0 A_PlaySound("weapons/minigun",CHAN_WEAPON,1)
		TNT1 A 0 A_GunFlash
		MNGG A 1 Bright A_FireBullets(8.4, 3.55, random(1,3), 10,"ExtremePuff")
		TNT1 A 0 A_JumpIfNoAmmo("OutofAmmo")
		TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
		TNT1 A 0 A_GunFlash("Flash2")
		MNGG B 1 Bright A_FireBullets(8.4, 3.55, random(1,3), 10,"ExtremePuff")
		TNT1 A 0 A_JumpIfNoAmmo("OutofAmmo")
		TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
		TNT1 A 0 A_PlaySound("weapons/minigun",CHAN_WEAPON,1)
		TNT1 A 0 A_GunFlash
		MNGG A 1 Bright A_FireBullets(8.4, 3.55, random(1,3), 10,"ExtremePuff")
		TNT1 A 0 A_JumpIfNoAmmo("OutofAmmo")
		TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
		TNT1 A 0 A_GunFlash("Flash2")
		MNGG B 1 Bright A_FireBullets(8.4, 3.55, random(1,3), 10,"ExtremePuff")
		TNT1 A 0 A_JumpIfNoAmmo("OutofAmmo")
		Goto FireEnd
	Level2:
		TNT1 A 0 A_Playsound("weapons/minispecial", CHAN_7, 1)
	L2Hold:
		TNT1 A 0 A_JumpIfInventory("PowerQuadDamage",1,"QuadLevel2")
		TNT1 A 0 A_PlaySound("weapons/minigun2",CHAN_WEAPON,1)
		TNT1 A 0 A_GunFlash
		MNGG A 1 Bright A_FireBullets(11.2, 7.1, random(1,12), 10,"QuadShotPuff")
		TNT1 A 0 A_JumpIfNoAmmo("OutofAmmo")
		TNT1 A 0 A_GunFlash("Flash2")
		MNGG B 1 Bright A_FireBullets(11.2, 7.1, random(1,12), 10,"QuadShotPuff")
		TNT1 A 0 A_JumpIfNoAmmo("OutofAmmo")
		TNT1 A 0 A_PlaySound("weapons/minigun2",CHAN_WEAPON,1)
		TNT1 A 0 A_GunFlash
		MNGG A 1 Bright A_FireBullets(11.2, 7.1, random(1,12), 10,"QuadShotPuff")
		TNT1 A 0 A_JumpIfNoAmmo("OutofAmmo")
		TNT1 A 0 A_GunFlash("Flash2")
		MNGG B 1 Bright A_FireBullets(11.2, 7.1, random(1,12), 10,"QuadShotPuff")
		TNT1 A 0 A_JumpIfNoAmmo("OutofAmmo")
		Goto FireEnd
	QuadLevel2:
		TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
		TNT1 A 0 A_PlaySound("weapons/minigun2",CHAN_WEAPON,1)
		TNT1 A 0 A_GunFlash
		MNGG A 1 Bright A_FireBullets(11.2, 7.1, random(1,8), 10,"ExtremePuff")
		TNT1 A 0 A_JumpIfNoAmmo("OutofAmmo")
		TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
		TNT1 A 0 A_GunFlash("Flash2")
		MNGG B 1 Bright A_FireBullets(11.2, 7.1, random(1,8), 10,"ExtremePuff")
		TNT1 A 0 A_JumpIfNoAmmo("OutofAmmo")
		TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
		TNT1 A 0 A_PlaySound("weapons/minigun2",CHAN_WEAPON,1)
		TNT1 A 0 A_GunFlash
		MNGG A 1 Bright A_FireBullets(11.2, 7.1, random(1,8), 10,"ExtremePuff")
		TNT1 A 0 A_JumpIfNoAmmo("OutofAmmo")
		TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
		TNT1 A 0 A_GunFlash("Flash2")
		MNGG B 1 Bright A_FireBullets(11.2, 7.1, random(1,8), 10,"ExtremePuff")
		TNT1 A 0 A_JumpIfNoAmmo("OutofAmmo")
	FireEnd:
		TNT1 A 0 A_Refire("Hold")
	UnSpool:
		TNT1 A 0 A_TakeInventory("GunSpinnerDummy")
		TNT1 A 0 A_Playsound("weapons/ministop",CHAN_6)
		TNT1 A 0 A_JumpIfInventory("PowerIDMWeaponLevel2",1,"Level2Unspool")
		MNGG ABABAB 1
		MNGG ABABAB 2
		MNGG ABAB 4
		MNGG ABAB 4
		MNGG A 5
		MNGG B 6 A_ReFire("Fire")
		Goto Ready
	Level2UnSpool:
		MNGG ABABAB 1 A_ReFire("Fire")
		MNGG ABABAB 2 A_ReFire("Fire")
		MNGG ABABAB 3 A_ReFire("Fire")
		MNGG AB 4 A_ReFire("Fire")
		TNT1 A 0 A_ReFire("Fire")
		Goto Ready
	OutofAmmo:
		TNT1 A 0 A_TakeInventory("GunSpinnerDummy")
		TNT1 A 0 A_Playsound("weapons/ministop",CHAN_6)
		MNGG ABABAB 1
		MNGG ABABAB 2
		MNGG ABAB 3
		MNGG ABAB 4
		MNGG A 5
		MNGG B 6
	    TNT1 A 0 A_Refire("Fire")
		Goto Ready
	Flash:
		MNGF A 4 Bright A_Light1
		Goto LightDone
	Flash2:
		MNGF B 4 Bright A_Light1
		Goto LightDone
	}
}

// Wraithverge (Hexen)

ACTOR IDMWraithverge : CWeapWraithVerge
{
  Game Doom
  Health 100
  Weapon.SelectionOrder 50
  Weapon.Sisterweapon "WraithvergeLevel2"
  Weapon.SlotNumber 7
  Weapon.KickBack 150
  Weapon.AmmoGive 100
  Weapon.AmmoUse 50
  Weapon.AmmoType "IDMMana"
  Weapon.Kickback 100
  Obituary "%o was cleansed by %k's Wraithverge."
  Inventory.PickupMessage "Wraithverge!"
  Inventory.PickupSound "misc/w_pkup"
  Tag "Wraithverge"
  DamageType "Holy"
  +WEAPON.BFG
  +WEAPON.NOAUTOAIM
  -WEAPON.ALLOW_WITH_RESPAWN_INVUL
  +WEAPON.NOLMS
  -INVENTORY.NOATTENPICKUPSOUND
  States
  {
  Spawn:
    WCHS A -1 Bright
    Stop
  Ready:
    CHLY A 1 A_WeaponReady
    Loop
  Select:
	TNT1 A 0 A_PlaySound("weapons/wswitch",CHAN_WEAPON)
  Sloop:
    CHLY A 1 A_Raise
    Loop
  Deselect:
    CHLY A 1 A_Lower
    Loop
  Fire:
	CHLY AB 2 Bright Offset (0, 40)
	CHLY CD 2 Bright Offset (0, 43)
	CHLY E 2 Bright Offset (0, 45)
	TNT1 A 0 A_JumpIfInventory("PowerQuadDamage",1,"Quad")
	Goto Normal
  Quad:
    TNT1 A 0 A_Playsound("misc/qdmg",CHAN_AUTO,1)
  Normal:
	CHLY F 3 Bright Offset (0, 48) A_CHolyAttack
	CHLY GG 1 Bright Offset (0, 40) A_CHolyPalette
	CHLY G 2 Offset (0, 36) A_CHolyPalette
	TNT1 A 0 A_Refire
    Goto Ready
  }
}

ACTOR WraithvergeLevel2 : IDMWraithverge
{
  Weapon.AmmoUse 25
  Weapon.Sisterweapon "IDMWraithverge"
  +POWERED_UP
  States
  {
  Fire:
	TNT1 A 0 A_JumpIfInventory("PowerQuadDamage",1,"Quad")
	Goto Normal
  Quad:
    TNT1 A 0 A_Playsound("misc/qdmg",CHAN_AUTO,1)
  Normal:
	CHLY AB 2 Bright Offset (0, 40)
	CHLY CD 2 Bright Offset (0, 43)
	CHLY E 2 Bright Offset (0, 45)
	TNT1 A 0 A_FireCustomMissile("IDMHolyMissile",-30,0)
	TNT1 A 0 A_FireCustomMissile("IDMHolyMissile",30,0)
	CHLY F 3 Bright Offset (0, 48) A_CHolyAttack
	CHLY GG 2 Bright Offset (0, 48) A_CHolyPalette
	CHLY G 3 Offset (0, 52) A_CHolyPalette
	CHLY A 25 Offset (0, 52)
	CHLY A 2 Offset (0, 51)
	CHLY A 2 Offset (0, 49)
	CHLY A 2 Offset (0, 48)
	CHLY A 2 Offset (0, 46)
	CHLY A 2 Offset (0, 45)
	CHLY A 2 Offset (0, 43)
	CHLY A 2 Offset (0, 42)
	CHLY A 2 Offset (0, 40)
	CHLY A 2 Offset (0, 39)
	CHLY A 2 Offset (0, 37)
	CHLY A 2 Offset (0, 36)
	CHLY A 2 Offset (0, 35)
	CHLY A 2 Offset (0, 35)
	TNT1 A 0 A_Refire
    Goto Ready
  }
}

// Freeze Cannon

ACTOR FreezeCannon : IDMWeapon
{
  Weapon.SelectionOrder 50
  Weapon.SlotNumber 7
  Weapon.AmmoUse 2
  Weapon.AmmoGive 100
  Weapon.AmmoType "IDMCell"
  Inventory.PickupMessage "Freeze Cannon!"
  Tag "Freeze Cannon"
  +WEAPON.BFG
  States
  {
  Ready:
    FRSG A 1 A_WeaponReady
    Loop
  Deselect:
    FRSG A 1 A_Lower
    Loop
  Select:
	TNT1 A 0 A_PlaySound("weapons/wswitch",CHAN_WEAPON)
  Sloop:
    FRSG A 1 A_Raise
    Loop
  Fire:
	FRSG A 0 A_Playsound("weapons/freezecnnf",CHAN_WEAPON)
	FRSG A 24 A_GunFlash
	Goto Hold
  Quad:
    TNT1 A 0 A_Playsound("misc/qdmg",CHAN_AUTO,1)
	Goto Hold+2
  Hold:
	TNT1 A 0 A_JumpIfInventory("PowerIDMWeaponLevel2",1,"Level2")
	TNT1 A 0 A_JumpIfInventory("PowerQuadDamage",1,"Quad")
    FRSG A 0 A_GunFlash("Flash2")
	FRSG A 4 A_FireCustomMissile("FreezeBall",random(-10,10),1,0,0,0)
  FireEnd:
	TNT1 A 0 A_Refire
    FRSG B 30
    Goto Ready
  QuadLevel2:
    TNT1 A 0 A_Playsound("misc/qdmg",CHAN_AUTO,1)
	Goto Level2+1
  Level2:
	TNT1 A 0 A_JumpIfInventory("PowerQuadDamage",1,"QuadLevel2")
    FRSG A 0 A_GunFlash("Flash2")
	FRSG A 0 A_FireCustomMissile("FreezeBall",random(-10,10),0)
	FRSG A 0 A_FireCustomMissile("FreezeBall",random(-10,10),0)
	FRSG A 5 A_FireCustomMissile("FreezeBall",random(-10,10))
	Goto FireEnd
  Flash:
	FRSG A 10 Bright
	FRSF AB 7 Bright
	Goto LightDone
  Flash2:
    FRSF ABA 2 Bright A_Light1
    Goto LightDone
  Spawn:
    FRAS A -1 Bright
    Stop
  }
}

// Unmaker

ACTOR Unmaker : IDMWeapon
{
  Weapon.SelectionOrder 50
  Weapon.SlotNumber 7
  Weapon.AmmoUse 1
  Weapon.AmmoGive 12
  Weapon.AmmoType "IDMHellenergy"
  Inventory.PickupMessage "Unmaker!"
  Tag "Unmaker"
  +WEAPON.NOAUTOAIM
  +WEAPON.BFG
  States
  {
  Ready:
	TNT1 A 0
	TNT1 A 0 A_Jump(1,"Idle")
	UNMK AAAAAA 1 A_WeaponReady
    Loop
  Idle:
	TNT1 A 0 A_Playsound("weapons/unmakeridle",CHAN_WEAPON)
	Goto Ready+2
  Deselect:
    UNMK A 1 A_Lower
    Loop
  Select:
	TNT1 A 0 A_PlaySound("weapons/wswitch",CHAN_WEAPON)
  Sloop:
    UNMK A 1 A_Raise
    Loop
  Fire:
	UNMK B 24 Bright A_Playsound("weapons/unmakerchrg",CHAN_AUTO)
	TNT1 A 0 A_Gunflash
	UNMK CD 3 Bright
	TNT1 A 0 A_JumpIfInventory("PowerIDMWeaponLevel2",1,"Level2")
	TNT1 A 0 A_JumpIfInventory("PowerQuadDamage",1,"Quad")
  Normal:
	TNT1 A 0 A_Playsound("weapons/unmakerfire",CHAN_WEAPON)
	TNT1 A 0 A_FireCustomMissile("UnmakerRay",-4.5,0,0,-2)
	TNT1 A 0 A_FireCustomMissile("UnmakerRay",4.5,0,0,-2)
	TNT1 A 0 A_FireCustomMissile("UnmakerRay",-9,0,0,-3)
	TNT1 A 0 A_FireCustomMissile("UnmakerRay",9,1,0,-3)
	UNMK E 4 Bright A_FireCustomMissile("UnmakerRay",0,1,0,-2)
	UNMK F 3 Bright
	UNMK G 3 Bright A_Playsound("weapons/unmakerscrm",CHAN_AUTO)
  FireEnd:
	UNMK B 10 Bright
	UNMK A 16
	TNT1 A 0 A_Refire
	Goto Ready
  Quad:
    TNT1 A 0 A_Playsound("misc/qdmg",CHAN_AUTO,1)
	Goto Normal
  Level2:
	TNT1 A 0 A_Playsound("weapons/unmakerfire",CHAN_WEAPON)
	TNT1 A 0 A_JumpIfInventory("PowerQuadDamage",1,"QuadLevel2")
	TNT1 A 0 A_FireCustomMissile("UnmakerRay",-4,0,0,-2)
	TNT1 A 0 A_FireCustomMissile("UnmakerRay",4,0,0,-2)
	TNT1 A 0 A_FireCustomMissile("UnmakerRay",-8,0,0,-3)
	TNT1 A 0 A_FireCustomMissile("UnmakerRay",8,0,0,-3)
	TNT1 A 0 A_FireCustomMissile("UnmakerRay",-12,0,0,-3)
	TNT1 A 0 A_FireCustomMissile("UnmakerRay",12,0,0,-3)
	UNMK E 4 Bright A_FireCustomMissile("UnmakerRay",0,1,0,-2)
	UNMK F 3 Bright
	UNMK G 3 Bright A_Playsound("weapons/unmakerscrm",CHAN_AUTO)
	UNMK B 5 Bright
	TNT1 A 0 A_JumpIfInventory("PowerIDMWeaponLevel2",1,"Level2Refire")
	Goto FireEnd
  Level2Refire:
	TNT1 A 0 A_Refire("Level2")
	Goto FireEnd
  QuadLevel2:
    TNT1 A 0 A_Playsound("misc/qdmg",CHAN_AUTO,1)
    Goto Level2+2
  Flash:
	TNT1 A 6 A_Light1
	TNT1 A 5 A_Light2
	TNT1 A 5 A_Light(3)
	TNT1 A 5 A_Light1
	Goto LightDone
  Spawn:
	UNMA A -1 Bright
	Stop
  }
}

// Bloodscourge (Hexen)

ACTOR IDMBloodScourge : MWeapBloodscourge
{
  Weapon.Slotnumber 7
  Weapon.SelectionOrder 50
  Weapon.Sisterweapon "BloodscourgeLevel2"
  Weapon.AmmoType1 "IDMMana"
  Weapon.AmmoType2 "IDMMana"
  Weapon.AmmoUse1 10
  Weapon.AmmoUse2 0
  Weapon.AmmoGive1 50
  Weapon.AmmoGive2 50
  Weapon.KickBack 150
  Weapon.YAdjust 0
  Inventory.PickupMessage "Bloodscourge!"
  Inventory.PickupSound "misc/w_pkup"
  Tag "Bloodscourge"
  -WEAPON.ALLOW_WITH_RESPAWN_INVUL
  +WEAPON.NOLMS
  +WEAPON.BFG
  -INVENTORY.NOATTENPICKUPSOUND
  States
  {
  Spawn:
    WMBS A -1 Bright
    Stop
  Select:
	TNT1 A 0 A_PlaySound("weapons/wswitch",CHAN_WEAPON)
  Sloop:
    MSTF A 1 A_Raise
    Loop
  Deselect:
    MSTF A 1 A_Lower
    Loop
  Ready:
    MSTF AAAAAABBBBBBCCCCCCDDDDDDEEEEEEFFFFF 1 A_WeaponReady
    Loop
  Fire:
    MSTF G 4 Bright Offset(0,40)
	TNT1 A 0 A_JumpIfInventory("PowerQuadDamage",1,"Quad")
	Goto Normal
  Quad:
    TNT1 A 0 A_Playsound("misc/qdmg",CHAN_AUTO,1)
  Normal:
    MSTF H 4 Bright Offset(0,48) A_MStaffAttack
    MSTF H 2 Bright Offset(0,48) A_MStaffPalette
    MSTF II 2 Bright Offset(0,48) A_MStaffPalette
    MSTF I 1 Bright Offset(0,40)
    MSTF J 5 Bright Offset(0,36)
    Goto Ready
  }
}

ACTOR BloodscourgeLevel2 : IDMBloodscourge
{
  Weapon.Sisterweapon "IDMBloodscourge"
  Weapon.AmmoUse1 1
  Weapon.AmmoUse2 0
  +POWERED_UP
  States
  {
  Fire:
	TNT1 A 0 A_JumpIfInventory("PowerQuadDamage",1,"Quad")
	Goto Normal
  Quad:
    TNT1 A 0 A_Playsound("misc/qdmg",CHAN_AUTO,1)
  Normal:
    MSTF G 4 Bright Offset(0,40)
	TNT1 A 0 A_Playsound("MageStaffFire",CHAN_WEAPON)
    TNT1 A 0 A_FireCustomMissile("IDMMageStaffFX2",random(-10,10))
    MSTF H 2 Bright Offset(0,48) A_FireCustomMissile("IDMMageStaffFX2",random(-10,10),1)
    TNT1 A 0 A_FireCustomMissile("IDMMageStaffFX2",random(-10,10))
    MSTF H 2 Bright Offset(0,48) A_FireCustomMissile("IDMMageStaffFX2",random(-10,10),1)
    TNT1 A 0 A_FireCustomMissile("IDMMageStaffFX2",random(-10,10))
    MSTF H 2 Bright Offset(0,48) A_FireCustomMissile("IDMMageStaffFX2",random(-10,10),1)
    TNT1 A 0 A_FireCustomMissile("IDMMageStaffFX2",random(-10,10))
    MSTF H 2 Bright Offset(0,48) A_FireCustomMissile("IDMMageStaffFX2",random(-10,10),1)
    TNT1 A 0 A_FireCustomMissile("IDMMageStaffFX2",random(-10,10))
    MSTF H 2 Bright Offset(0,48) A_FireCustomMissile("IDMMageStaffFX2",random(-10,10),1)
    MSTF II 2 Bright Offset(0,48)
    MSTF I 1 Bright Offset(0,40) A_Refire
    MSTF J 5 Bright Offset(0,36)
	Goto Ready
  }
}

// BFG10K (Skulltag)

ACTOR IDMBFG10K : IDMWeapon
{
  Radius 20
  Height 20
  Weapon.Selectionorder 50
  Weapon.AmmoUse 5
  Weapon.AmmoGive 100
  Weapon.AmmoType "IDMCell"
  Weapon.Kickback 200
  Weapon.SlotNumber 7
  Weapon.Sisterweapon "BFG10KLevel2"
  Inventory.Pickupmessage "BFG10000!"
  Tag "BFG10000"
  +WEAPON.BFG
  +WEAPON.EXPLOSIVE
  States
  {
  Spawn:
    BFG2 A -1 Bright
    Stop
  Ready:
    BG2G A 0 A_PlaySound ("weapons/bfg10kidle")
    BG2G AAABBBCCCDDD 1 Bright A_WeaponReady
    Loop
  Deselect:
    BG2G O 1 A_Lower
    Loop
  Select:
	TNT1 A 0 A_PlaySound("weapons/wswitch",CHAN_WEAPON)
  Sloop:
    BG2G O 1 A_Raise
    Loop
  Fire:
    BG2G E 16 Bright A_PlaySound ("weapons/bfg10kf",CHAN_WEAPON)
    BG2G F 4 Bright
    BG2G G 2 Bright
    BG2G H 2 Bright
    BG2G I 2 Bright
    BG2G J 2 Bright
    Goto Hold
  Quad:
    TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5,1)
	Goto Hold+1
  Hold:
	TNT1 A 0 A_JumpIfInventory("PowerQuadDamage",1,"Quad")
    BG2G K 2 Bright A_GunFlash
	TNT1 A 0 Bright A_PlaySound ("weapons/bfg10kf2",CHAN_7)
    BG2G L 2 Bright A_FireBullets(0,0,1,80,"IDMBFG10kShot")
    BG2G M 2 Bright
	TNT1 A 0 A_JumpIfNoAmmo("NoAmmo")
    BG2G N 2 Bright A_ReFire
    BG2G O 33 Bright A_PlaySound ("weapons/bfg10kcool",CHAN_WEAPON)
    Goto Ready
  NoAmmo:
    BG2G N 2 Bright
    BG2G O 33 Bright A_PlaySound ("weapons/bfg10kcool",CHAN_WEAPON)
	TNT1 A 0 A_CheckReload
	Goto Ready
  Flash:
    TNT1 A 2 Bright A_Light1
    TNT1 A 3 Bright
    Goto LightDone
    Stop
  }
}

ACTOR BFG10KLevel2 : IDMBFG10K
{
  Weapon.Sisterweapon "IDMBFG10K"
  Weapon.AmmoUse 100
  +POWERED_UP
  States
  {
  Quad:
    TNT1 A 0 A_Playsound("misc/qdmg",CHAN_AUTO,1)
	Goto Fire+1
  Fire:
	TNT1 A 0 A_JumpIfInventory("PowerQuadDamage",1,"Quad")
    BG2G E 16 Bright A_PlaySound("weapons/bfg10kf",CHAN_WEAPON)
    BG2G F 4 Bright
    BG2G G 2 Bright
    BG2G H 2 Bright
    BG2G I 2 Bright
    BG2G J 2 Bright
    BG2G K 2 Bright A_GunFlash
	TNT1 A 0 Bright A_PlaySound ("weapons/bfg10kf2",CHAN_7)
    BG2G L 2 Bright A_FireCustomMissile("BFG10KBall",0,1)
    BG2G M 2 Bright
    BG2G N 2 Bright
    BG2G O 33 Bright A_PlaySound("weapons/bfg10kcool",CHAN_WEAPON)
	TNT1 A 0 A_Refire("Fire")
    Goto Ready
  }
}


// Devastators

ACTOR Devastator : IDMWeapon
{
	Inventory.PickupSound "misc/w_pkup"
	Inventory.PickupMessage "Devastators!"
	Tag "Devastators"
	Weapon.AmmoType "IDMRocketAmmo"
	Weapon.AmmoGive 15
	Weapon.AmmoUse 1
	Weapon.Selectionorder 50
	Weapon.SlotNumber 7
	+WEAPON.BFG
	+WEAPON.EXPLOSIVE
	States
	{
    Spawn:
        DVGG A -1 Bright
        Loop
    Ready:
        DVST A 1 A_WeaponReady
        Loop
    Deselect:
        DVST A 1 A_Lower
        Loop
    Select:
		TNT1 A 0 A_PlaySound("weapons/devpick",CHAN_WEAPON)
		TNT1 A 0 A_Jump(128,"Duke")
	Sloop:
        DVST A 1 A_Raise
        Loop
	Duke:
		TNT1 A 0 A_Playsound("weapons/duke",CHAN_AUTO)
		Goto Sloop
    Fire:
		DVST B 0 A_Light2
		DVST B 0 A_PlayWeaponSound("weapons/devshot")
	    NULL A 0 A_JumpIfInventory("Devcheck",1,"fire2")
		TNT1 A 0 A_JumpIfInventory("PowerIDMWeaponLevel2",1,"Level2")
		TNT1 A 0 A_JumpIfInventory("PowerQuadDamage",1,"Quad")
		DVST AAAA 0 A_FireCustomMissile("DevastatorRocket",random(-3,3),0,5,5)
		DVST C 1 Bright A_FireCustomMissile("DevastatorRocket",random(-3,3),1,5,6)
		DVST C 0 A_Light2
		DVST EGHI 1 Bright A_Light0
		NULL A 0 A_GiveInventory("Devcheck",1)
		DVST A 1 
		Goto Ready
	Quad:
		TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5,1)
		Goto Fire+5
	Level2:
		DVST A 0 A_FireCustomMissile("DevastatorMissile",20,0,5,5)
		DVST A 0 A_FireCustomMissile("DevastatorMissile",10,0,5,5)
		DVST A 0 A_FireCustomMissile("DevastatorMissile",0,0,5,5)
		DVST A 0 A_FireCustomMissile("DevastatorMissile",-10,0,5,5)
		DVST C 1 Bright A_FireCustomMissile("DevastatorMissile",-20,1,5,6)
		DVST C 0 A_Light2
		DVST EGHI 1 Bright A_Light0 
		NULL A 0 A_GiveInventory("Devcheck",1)
		DVST A 1 
		Goto Ready
	Fire2:
		TNT1 A 0 A_JumpIfInventory("PowerIDMWeaponLevel2",1,"Level22")
		TNT1 A 0 A_JumpIfInventory("PowerQuadDamage",1,"Quad2")
		DVST AAAA 0 A_FireCustomMissile("DevastatorRocket",random(2,-2),0,-5,5)
		DVST J 1 Bright A_FireCustomMissile("DevastatorRocket",random(2,-2),1,-5,6)
		DVST C 0 A_Light2
		DVST LNPQR 1 Bright A_Light0 
		DVST A 1 
		NULL A 0 A_TakeInventory("Devcheck",1)
		Goto Ready
	Quad2:
		TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5,1)
		Goto Fire2+2
	Level22:
		DVST B 0 A_Light2
		DVST B 0 A_PlayWeaponSound("weapons/devshot")
		DVST A 0 A_FireCustomMissile("DevastatorMissile",20,0,5,5)
		DVST A 0 A_FireCustomMissile("DevastatorMissile",10,0,5,5)
		DVST A 0 A_FireCustomMissile("DevastatorMissile",0,0,5,5)
		DVST A 0 A_FireCustomMissile("DevastatorMissile",-10,0,5,5)
		DVST J 1 Bright A_FireCustomMissile("DevastatorMissile",-20,1,-5,6)
		DVST C 0 A_Light2
		DVST LNPQR 1 Bright A_Light0 
		DVST A 1 
		NULL A 0 A_TakeInventory("Devcheck",1)
		Goto Ready
	}
}


ACTOR Devcheck : Inventory
{
   Inventory.MaxAmount 1
}


// Fire Mace (Heretic)

ACTOR IDMMace : Mace
{
  Weapon.SelectionOrder 50
  Weapon.AmmoUse 1
  Weapon.AmmoGive1 150
  Weapon.YAdjust 15
  Weapon.SlotNumber 7
  Weapon.AmmoType "IDMMaceAmmo"
  Weapon.SisterWeapon "IDMMacePowered"
  Inventory.PickupMessage "Fire Mace!"
  Tag "Fire Mace"
  States
  {
  Spawn:
    WMCE A -1 Bright
    Stop
  Deselect:
    MACE A 1 A_Lower
    Loop
  Select:
	TNT1 A 0 A_PlaySound("weapons/macepkup",CHAN_WEAPON)
  Sloop:
    MACE A 1 A_Raise
    Loop
  Fire:
    MACE B 4
  Hold:
	TNT1 A 0 A_FireMacePL1
    MACE C 3 Bright A_FireMacePL1
	TNT1 A 0 A_FireMacePL1
    MACE D 3 Bright A_FireMacePL1
	TNT1 A 0 A_FireMacePL1
    MACE E 3 Bright A_FireMacePL1
	TNT1 A 0 A_FireMacePL1
    MACE F 3 Bright A_FireMacePL1
    MACE C 4 Bright A_ReFire
    MACE DEFB 4 Bright
    Goto Ready
  }
}

ACTOR IDMMacePowered : MacePowered
{
  +WEAPON.POWERED_UP
  Weapon.AmmoUse 3
  Weapon.AmmoGive 0
  Weapon.AmmoType "IDMMaceAmmo"
  Weapon.SisterWeapon "IDMMace"
  Tag "Fire Mace"
  States
  {
  Select:
	TNT1 A 0 A_PlaySound("weapons/macepkup",CHAN_WEAPON)
  Sloop:
    MACE A 1 A_Raise
    Loop
  Fire:
  Hold:
    MACE BC 2 Bright
    MACE D 2 Bright A_FireMacePL2
    MACE EFB 2 Bright
    MACE A 8 A_ReFire
    Goto Ready
  }
}