// Minigun (Skulltag)

ACTOR IDMMinigun : IDMWeapon
{
  Weapon.SelectionOrder 50
  Weapon.Ammotype "IDMclip"
  Weapon.Ammouse 1
  Weapon.AmmoGive 200
  Weapon.Kickback 200
  //Weapon.PreferredSkin "GatlingMarine"
  Inventory.PickupMessage "Minigun! (Slot 4)"
  Obituary "%o got a load of hail mary from %k's Minigun!"
  Tag "Minigun"
  +WEAPON.BFG
  +WEAPON.NOLMS
  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,4), 20,"IDMSuperPuff",0)
		TNT1 A 0 A_JumpIfNoAmmo("OutofAmmo")
		TNT1 A 0 A_GunFlash("Flash2")
		MNGG B 1 Bright A_FireBullets(8.4, 3.55, random(1,4), 20,"IDMSuperPuff")
		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,4), 20,"IDMSuperPuff",0)
		TNT1 A 0 A_JumpIfNoAmmo("OutofAmmo")
		TNT1 A 0 A_GunFlash("Flash2")
		MNGG B 1 Bright A_FireBullets(8.4, 3.55, random(1,4), 20,"IDMSuperPuff")
		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,4), 20,"ExtremePuff",0)
		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,4), 20,"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,4), 20,"ExtremePuff",0)
		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,4), 20,"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), 20,"IDMSuperPuff",0)
		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), 20,"IDMSuperPuff")
		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), 20,"IDMSuperPuff",0)
		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), 20,"IDMSuperPuff")
		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,12), 20,"ExtremePuff",0)
		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,12), 20,"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,12), 20,"ExtremePuff",0)
		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,12), 20,"ExtremePuff")
		TNT1 A 0 A_JumpIfNoAmmo("OutofAmmo")
	FireEnd:
		TNT1 A 0 A_Refire("Hold")
	UnSpool:
		TNT1 A 0 A_Stopsound(CHAN_7)
		TNT1 A 0 A_TakeInventory("GunSpinnerDummy")
		TNT1 A 0 A_Playsound("weapons/ministop",CHAN_6)
		TNT1 A 0 A_JumpIfInventory("PowerIDMWeaponLevel2",1,"Level2Unspool")
		MNGG AB 1 A_Stopsound(CHAN_7)
		MNGG AB 2 A_Stopsound(CHAN_7)
		MNGG ABAB 3 A_Stopsound(CHAN_7)
		MNGG AB 4 A_ReFire("Fire")
		MNGG A 5 A_ReFire("Fire")
		MNGG B 6 A_ReFire("Fire")
		Goto Ready
	Level2UnSpool:
		TNT1 A 0 A_Stopsound(CHAN_7)
		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_Stopsound(CHAN_7)
		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_CheckReload
	    TNT1 A 0 A_Refire("Fire")
		Goto Ready
	Flash:
		MNGF A 2 Bright A_Light1
		Goto LightDone
	Flash2:
		MNGF B 2 Bright A_Light1
		Goto LightDone
	}
}