// Super Chaingun (Quake 2)

ACTOR SuperChainGun : IDMWeapon
{
	//Weapon.PreferredSkin "ChaingunMarine"
	Weapon.SelectionOrder 400
	Weapon.Sisterweapon "SuperChaingunLevel2"
	Weapon.AmmoUse 1
	Weapon.AmmoGive 80
	Weapon.AmmoType "IDMClip"
	Inventory.PickupMessage "Super Chaingun! (Slot 4)"
	Obituary "%o was made into Swiss cheese by %k's Super Chaingun."
	Tag "Super Chaingun"
	Decal BulletChip
	Damagetype "Bullet"
	Attacksound "weapons/chngun"
	+WEAPON.NOLMS
	States
	{
	Ready:
	  SCHG A 1 A_WeaponReady
	  Loop
	Deselect:
	  TNT1 A 0 A_JumpIfInventory("GunSpinnerDummy",1,"FireDeselect")
	  Goto Desloop
	FireDeselect:
      TNT1 A 0 A_Playsound("weapons/chngnstop")
    Desloop:
	  TNT1 A 0 A_TakeInventory("GunSpinnerDummy")
      TNT1 A 0 A_Lower
      TNT1 A 0 A_Lower
      SCHG A 1 A_Lower
      Loop
	Select:
	  TNT1 A 0 A_PlaySound("weapons/wswitch",CHAN_WEAPON)
	Sloop:
      TNT1 A 0 A_Raise
      TNT1 A 0 A_Raise
      SCHG A 1 A_Raise
      Loop
	Fire:
	NormalA:
      TNT1 A 0 A_GunFlash
      TNT1 A 0 A_JumpIfInventory("PowerQuadDamage", 1, "QuadA")
      SCHG A 4 A_FireBullets(5.6, 3.55, random(1,2), 10,"IDMBulletPuff")
	NormalB:
      TNT1 A 0 A_GunFlash("Flash2")
      TNT1 A 0 A_JumpIfInventory("PowerQuadDamage", 1, "QuadB")
      SCHG B 4 A_FireBullets(5.6, 3.55, random(1,2), 10,"IDMBulletPuff")
	  TNT1 A 0 A_Refire("Spool")
	  Goto Ready
	Spool:
	  TNT1 A 0 A_JumpIfNoAmmo("Unspool")
	  TNT1 A 0 A_GiveInventory("GunSpinnerDummy")
	Normal1:
      TNT1 A 0 A_PlaySound("weapons/chngnstrt")
      TNT1 A 0 A_GunFlash
      TNT1 A 0 A_JumpIfInventory("PowerQuadDamage", 1, "Quad1")
      SCHG A 4 A_FireBullets(5.6, 3.55, random(1,2), 10, "IDMBulletPuff")
	  TNT1 A 0 A_JumpIfNoAmmo("Unspool")
	Normal2:
      TNT1 A 0 A_GunFlash("Flash2")
      TNT1 A 0 A_JumpIfInventory("PowerQuadDamage", 1, "Quad2")
      SCHG B 4 A_FireBullets(5.6, 3.55, random(1,2), 10,"IDMBulletPuff")
	  TNT1 A 0 A_JumpIfNoAmmo("Unspool")
	Normal3:
      TNT1 A 0 A_GunFlash
      TNT1 A 0 A_JumpIfInventory("PowerQuadDamage", 1, "Quad3")
	  SCHG A 4 A_FireBullets(5.6, 3.55, random(1,2), 10,"IDMBulletPuff")
	  TNT1 A 0 A_JumpIfNoAmmo("Unspool")
	Normal4:
      TNT1 A 0 A_GunFlash("Flash2")
      TNT1 A 0 A_JumpIfInventory("PowerQuadDamage", 1, "Quad4")
      SCHG B 4 A_FireBullets(5.6, 3.55, random(1,2), 10,"IDMBulletPuff")
	  TNT1 A 0 A_JumpIfNoAmmo("Unspool")
	Normal5:
	  TNT1 A 0 A_GunFlash
      TNT1 A 0 A_JumpIfInventory("PowerQuadDamage", 1, "Quad5")
	  SCHG A 4 A_FireBullets(5.6, 3.55, random(1,2), 10,"IDMBulletPuff")
	  TNT1 A 0 A_JumpIfNoAmmo("Unspool")
	Normal6:
      TNT1 A 0 A_GunFlash("Flash2")
      TNT1 A 0 A_JumpIfInventory("PowerQuadDamage", 1, "Quad6")
      SCHG B 4 A_FireBullets(5.6, 3.55, random(1,2), 10,"IDMBulletPuff")
	  TNT1 A 0 A_JumpIfNoAmmo("Unspool")
	Normal7:
	  TNT1 A 0 A_GunFlash
      TNT1 A 0 A_JumpIfInventory("PowerQuadDamage", 1, "Quad7")
	  SCHG A 4 A_FireBullets(5.6, 3.55, random(1,2), 10,"IDMBulletPuff")
	  TNT1 A 0 A_JumpIfNoAmmo("Unspool")
	Normal8:
      TNT1 A 0 A_GunFlash("Flash2")
      TNT1 A 0 A_JumpIfInventory("PowerQuadDamage", 1, "Quad8")
	  SCHG B 4 A_FireBullets(5.6, 3.55, random(1,2), 10,"IDMBulletPuff")
	  TNT1 A 0 A_JumpIfNoAmmo("Unspool")
	  TNT1 A 0 A_Refire("Hold")
	  Goto Unspool
	Hold:
	  TNT1 A 0 A_Playsound("weapons/chngnloop")
	Normal9:
      TNT1 A 0 A_GunFlash("SpoolFlash")
      TNT1 A 0 A_JumpIfInventory("PowerQuadDamage", 1, "Quad9")
	  SCHG A 2 A_FireBullets(5.6, 3.55, random(1,2), 10,"IDMBulletPuff")
	  TNT1 A 0 A_JumpIfNoAmmo("Unspool")
	  Goto Normal10
	Normal10:
      TNT1 A 0 A_GunFlash("SpoolFlash2")
      TNT1 A 0 A_JumpIfInventory("PowerQuadDamage", 1, "Quad10")
	  SCHG B 2 A_FireBullets(5.6, 3.55, random(1,2), 10,"IDMBulletPuff")
	  TNT1 A 0 A_JumpIfNoAmmo("Unspool")
	  TNT1 A 0 A_Refire("Hold")
	Unspool:
	  TNT1 A 0 A_TakeInventory("GunSpinnerDummy")
      TNT1 A 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")
	  TNT1 A 0 A_JumpIfNoAmmo("Unspool")
    QuadB:
      TNT1 A 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")
	  TNT1 A 0 A_JumpIfNoAmmo("Unspool")
	  TNT1 A 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")
	  TNT1 A 0 A_JumpIfNoAmmo("Unspool")
	  Goto Normal2
	Quad2:
	  TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
      SCHG B 4 A_FireBullets(5.6, 3.55, random(1,2), 10,"ExtremePuff")
	  TNT1 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")
	  TNT1 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")
	  TNT1 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")
	  TNT1 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")
	  TNT1 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")
	  TNT1 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")
	  TNT1 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")
	  TNT1 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")
	  TNT1 A 0 A_JumpIfNoAmmo("Unspool")
	  TNT1 A 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.PreferredSkin "DualChaingunMarine"
	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:
      TNT1 A 0 A_Playsound("weapons/chngnstop")
	Desloop:
	  TNT1 A 0 A_TakeInventory("GunSpinnerDummy")
      TNT1 A 0 A_Lower
      TNT1 A 0 A_Lower
      SC2G A 1 A_Lower
      Loop
	Select:
	  TNT1 A 0 A_PlaySound("weapons/wswitch",CHAN_WEAPON)
	Sloop:
      TNT1 A 0 A_Raise
      TNT1 A 0 A_Raise
      SC2G A 1 A_Raise
      Loop
	Fire:
	NormalA:
      TNT1 A 0 A_GunFlash
      TNT1 A 0 A_JumpIfInventory("PowerQuadDamage", 1, "QuadA")
      SC2G A 4 A_FireBullets(5.6, 3.55, random(2,6), 10,"IDMBulletPuff")
	NormalB:
      TNT1 A 0 A_GunFlash("Flash2")
      TNT1 A 0 A_JumpIfInventory("PowerQuadDamage", 1, "QuadB")
      SC2G B 4 A_FireBullets(5.6, 3.55, random(2,6), 10,"IDMBulletPuff")
	  TNT1 A 0 A_Refire("Spool")
	  Goto Ready
	Spool:
	  TNT1 A 0 A_JumpIfNoAmmo("Unspool")
	  TNT1 A 0 A_GiveInventory("GunSpinnerDummy")
	Normal1:
      TNT1 A 0 A_PlaySound("weapons/chngnstrt")
      TNT1 A 0 A_GunFlash
      TNT1 A 0 A_JumpIfInventory("PowerQuadDamage", 1, "Quad1")
      SC2G A 4 A_FireBullets(5.6, 3.55, random(2,6), 10, "IDMBulletPuff")
	  TNT1 A 0 A_JumpIfNoAmmo("Unspool")
	Normal2:
      TNT1 A 0 A_GunFlash("Flash2")
      TNT1 A 0 A_JumpIfInventory("PowerQuadDamage", 1, "Quad2")
      SC2G B 4 A_FireBullets(5.6, 3.55, random(2,6), 10,"IDMBulletPuff")
	  TNT1 A 0 A_JumpIfNoAmmo("Unspool")
	Normal3:
      TNT1 A 0 A_GunFlash
      TNT1 A 0 A_JumpIfInventory("PowerQuadDamage", 1, "Quad3")
	  SC2G A 4 A_FireBullets(5.6, 3.55, random(2,6), 10,"IDMBulletPuff")
	  TNT1 A 0 A_JumpIfNoAmmo("Unspool")
	Normal4:
      TNT1 A 0 A_GunFlash("Flash2")
      TNT1 A 0 A_JumpIfInventory("PowerQuadDamage", 1, "Quad4")
      SC2G B 4 A_FireBullets(5.6, 3.55, random(2,6), 10,"IDMBulletPuff")
	  TNT1 A 0 A_JumpIfNoAmmo("Unspool")
	Normal5:
	  TNT1 A 0 A_GunFlash
      TNT1 A 0 A_JumpIfInventory("PowerQuadDamage", 1, "Quad5")
	  SC2G A 4 A_FireBullets(5.6, 3.55, random(2,6), 10,"IDMBulletPuff")
	  TNT1 A 0 A_JumpIfNoAmmo("Unspool")
	Normal6:
      TNT1 A 0 A_GunFlash("Flash2")
      TNT1 A 0 A_JumpIfInventory("PowerQuadDamage", 1, "Quad6")
      SC2G B 4 A_FireBullets(5.6, 3.55, random(2,6), 10,"IDMBulletPuff")
	  TNT1 A 0 A_JumpIfNoAmmo("Unspool")
	Normal7:
	  TNT1 A 0 A_GunFlash
      TNT1 A 0 A_JumpIfInventory("PowerQuadDamage", 1, "Quad7")
	  SC2G A 4 A_FireBullets(5.6, 3.55, random(2,6), 10,"IDMBulletPuff")
	  TNT1 A 0 A_JumpIfNoAmmo("Unspool")
	Normal8:
      TNT1 A 0 A_GunFlash("Flash2")
      TNT1 A 0 A_JumpIfInventory("PowerQuadDamage", 1, "Quad8")
	  SC2G B 4 A_FireBullets(5.6, 3.55, random(2,6), 10,"IDMBulletPuff")
	  TNT1 A 0 A_JumpIfNoAmmo("Unspool")
	  TNT1 A 0 A_Refire("Hold")
	  Goto Unspool
	Hold:
	  TNT1 A 0 A_Playsound ("weapons/chngnloop")
	Normal9:
      TNT1 A 0 A_GunFlash("SpoolFlash")
      TNT1 A 0 A_JumpIfInventory("PowerQuadDamage", 1, "Quad9")
	  SC2G A 2 A_FireBullets(5.6, 3.55, random(2,6), 10,"IDMBulletPuff")
	  TNT1 A 0 A_JumpIfNoAmmo("Unspool")
	  Goto Normal10
	Normal10:
      TNT1 A 0 A_GunFlash("SpoolFlash2")
      TNT1 A 0 A_JumpIfInventory("PowerQuadDamage", 1, "Quad10")
	  SC2G B 2 A_FireBullets(5.6, 3.55, random(2,6), 10,"IDMBulletPuff")
	  TNT1 A 0 A_JumpIfNoAmmo("Unspool")
	  TNT1 A 0 A_Refire("Hold")
	Unspool:
	  TNT1 A 0 A_TakeInventory("GunSpinnerDummy")
      TNT1 A 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")
	  TNT1 A 0 A_JumpIfNoAmmo("Unspool")
	  Goto NormalB
	QuadB:
	  TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
      SC2G B 4 A_FireBullets(5.6, 3.55, random(2,6), 10,"ExtremePuff")
	  TNT1 A 0 A_JumpIfNoAmmo("Unspool")
	  TNT1 A 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")
	  TNT1 A 0 A_JumpIfNoAmmo("Unspool")
	  Goto Normal2
	Quad2:
	  TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
      SC2G B 4 A_FireBullets(5.6, 3.55, random(2,6), 10,"ExtremePuff")
	  TNT1 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")
	  TNT1 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")
	  TNT1 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")
	  TNT1 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")
	  TNT1 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")
	  TNT1 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")
	  TNT1 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")
	  TNT1 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")
	  TNT1 A 0 A_JumpIfNoAmmo("Unspool")
	  TNT1 A 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
	}
}

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