Actor SuperChaingun : Weapon 30437
{
//$Category Weapons/RM
//$Sprite SUCGA0
//$Title "Super Chaingun"
Weapon.SelectionOrder 700
Weapon.AmmoType "BulletMag"
Weapon.AmmoUse 1
Weapon.AmmoGive 60
Weapon.KickBack 200
Weapon.PreferredSkin "Super-Chaingun-Marine"
AttackSound "roaster/mgunfire"
Inventory.PickupMessage "Super Chaingun"
Inventory.PickupSound "misc/w_pkup"
Obituary "%o was totally perforated by %k's chaingun."
Tag "Super Chaingun"
States
	{
	Spawn:
		SUCG A -1
		Loop
	Ready:
		SCG2 A 1 A_WeaponReady
		TNT1 A 0 A_JumpIfInventory("HandGrenadeAction",1,"GrenadeCheck")
		TNT1 A 0 A_JumpIfInventory("MineAction",1,"MineCheck")
		Loop
	Select:
		SCG2 A 1 A_Raise
		Loop
	Deselect:
		TNT1 A 0 A_TakeInventory("DumbyOne",2)
		TNT1 A 0 A_TakeInventory("WTFIsThis",14)
		SCG2 A 1 A_Lower
		TNT1 A 0 A_StopSound(6)
		Loop
	Fire:
		TNT1 A 0 A_GiveInventory("DumbyOne",1)
		TNT1 A 0 A_JumpIfInventory("DumbyOne",2,6)
		TNT1 A 0 A_PlaySound("roaster/chaingunon",6)
		SCG2 A 7
		SCG2 BCD 6
		TNT1 A 0 A_GiveInventory("WTFIsThis",1)
		TNT1 A 0 A_JumpIfInventory("WTFIsThis",14,"Fire2")
		TNT1 A 0 A_GunFlash
		SCG2 A 1 Bright A_FireBullets(1,1,1,random(4,8)*3,"ModdedBulletPuff",FBF_USEAMMO|CBAF_NORANDOM)
		TNT1 A 0 A_PlaySound("roaster/chaingunidle",6)
		SCG2 B 1 Bright
		SCG2 C 1
		SCG2 D 1
		TNT1 A 0 A_Refire("Fire")
		TNT1 A 0 A_TakeInventory("DumbyOne",2)
		TNT1 A 0 A_PlaySound("roaster/chaingunoff",6)
		SCG2 A 2 A_Refire("Fire")
		SCG2 B 4 A_Refire("Fire")
		SCG2 C 6 A_Refire("Fire")
		SCG2 D 7 A_Refire("Fire")
		Goto Ready
	Fire2:
		TNT1 A 0 A_Recoil(0.15)
		TNT1 A 0 A_GunFlash
		TNT1 A 0 Radius_Quake(2,2,0,1,0)
		SCG2 A 1 Bright A_FireBullets(4,3,1,10*random(1,3),"ModdedBulletPuff",FBF_USEAMMO|CBAF_NORANDOM)
		SCG2 B 1 Bright A_FireBullets(3,4,1,10*random(1,3),"ModdedBulletPuff",FBF_USEAMMO|CBAF_NORANDOM)
		SCG2 C 1
		TNT1 A 0 A_PlaySound("roaster/chaingunidle",6)
		TNT1 A 0 A_Refire("Fire")
		TNT1 A 0 A_TakeInventory("DumbyOne",2)
		TNT1 A 0 A_PlaySound("roaster/chaingunoff",6)
		TNT1 A 0 A_TakeInventory("WTFIsThis",14)
		SCG2 A 2 A_Refire("Fire")
		SCG2 B 4 A_Refire("Fire")
		SCG2 C 6 A_Refire("Fire")
		SCG2 D 7 A_Refire("Fire")
		Goto Ready
	Flash:
		SCGF A 1 Bright A_Light1
		SCGF B 1 Bright A_Light2
		TNT1 A 0 A_Light0
		Stop
	GrenadeCheck:
		TNT1 A 0 A_JumpIfInventory("HandGrenadeAmmo",1,"GrenadeToss")
		TNT1 A 0 A_TakeInventory("HandGrenadeAction",1)
		Goto Ready
	GrenadeToss:
		TNT1 A 0 A_GiveInventory("Hand Grenade")
		TNT1 A 0 A_SelectWeapon("Hand Grenade")
		Goto Deselect
	MineCheck:
		TNT1 A 0 A_JumpIfInventory("MineAmmo",1,"MineToss")
		TNT1 A 0 A_TakeInventory("MineAction",1)
		Goto Ready
	MineToss:
		TNT1 A 0 A_GiveInventory("Land Mine")
		TNT1 A 0 A_SelectWeapon("Land Mine")
		Goto Deselect
	}
}

Actor WTFIsThis : Inventory { Inventory.MaxAmount 14 }
Actor DumbyOne : Inventory { Inventory.MaxAmount 2 }