Actor Autofuck : Weapon
{
  +WEAPON.NOALERT
  +WEAPON.AMMO_OPTIONAL
  +WEAPON.CHEATNOTWEAPON
  Decal "BulletChip"
  Weapon.SlotNumber 0
  Weapon.SelectionOrder 700
  Weapon.PreferredSkin "AssaultRifle-Marine"
  Weapon.KickBack 75
  Weapon.AmmoType "AutofuckMagazine"
  Weapon.AmmoType2 "LegendaryLMGBulletMag"
  Weapon.AmmoGive 20
  Weapon.AmmoUse 1
  Inventory.PickupMessage "You got the autofuck! Sometimes you just need a 'better gun'."
  Obituary "%k riddled %o with bullets."
  Tag "Autogun"
  States
  {
  Spawn:
	AUTP A -1
	Loop
  Ready:
	AUTG A 1 A_WeaponReady
	TNT1 A 0 A_JumpIfInventory("HandGrenadeAction",1,"GrenadeCheck")
	TNT1 A 0 A_JumpIfInventory("MineAction",1,"MineCheck")
	Loop
  Deselect:
	TNT1 A 0
	TNT1 A 0 A_TakeInventory("HandGrenadeAction",1)
	TNT1 A 0 A_TakeInventory("MineAction",1)
	TNT1 A 0 A_TakeInventory("RailgunAction",1)
  DeselectLoop:
	AUTG A 1 A_Lower
	Loop
  Select:
	AUTG A 1 A_Raise
	Loop
  Fire:
	TNT1 A 0 A_JumpIfNoAmmo("Empty")
	TNT1 A 0 A_PlaySound("Autofuck/Fire",CHAN_WEAPON,1.0,0)
	TNT1 A 0 A_AlertMonsters
	TNT1 A 0 A_GunFlash
	TNT1 A 0 A_SpawnItemEx("LegRifleCasing",30,3,25,Random(2,4),Random(3,6),Random(3,6),0)
	TNT1 A 0 A_Light2
	AUTG B 1 Bright A_FireBullets(2.7,1.6,1,Random(98,100),"LegendaryASGBulletPuff")
	TNT1 A 0 A_Light0
	TNT1 A 0 A_Quake(1,2,0,1)
	TNT1 A 0 A_SetPitch(pitch-0.1)
	AUTG CD 1 A_SetPitch(pitch-0.075)
	AUTG C 1
	TNT1 A 0 A_ReFire("Fire")
	AUTG A 1 
	Goto Ready
  Empty:
	TNT1 A 0 A_PlayWeaponSound("weapons/click")
	AUTG AAAAAAAAAA 1 A_WeaponReady(WRF_NOFIRE)
	Goto AltFire
  AltFire:
	TNT1 A 0 A_JumpIfInventory("AutofuckMagazine",41,2)
	TNT1 A 0 A_JumpIfInventory("LegendaryLMGBulletMag",1,"AltFire2")
	AUTG A 1 A_WeaponReady(WRF_NOFIRE)
	Goto Ready
  AltFire2:
	TNT1 A 0 A_JumpIfInventory("AutofuckMagazine",1,"MaxReload")
	AUTG A 1 A_PlayWeaponSound("weapons/arreload")
	AUTG AEFGHI 1
	AUTG I 32 A_FireCustomMissile("AREmptyMagSpawner",0,0,0,1)
	AUTG I 11 A_PlayWeaponSound("weapons/arclick")
	TNT1 A 0 A_JumpIfInventory("LegendaryLMGBulletMag",1,"Reload")
	Goto Ready
  Reload:
	TNT1 A 0 A_TakeInventory("LegendaryLMGBulletMag",1,TIF_NOTAKEINFINITE)
	TNT1 A 0 A_GiveInventory("AutofuckMagazine",1)
	TNT1 A 0 A_JumpIfInventory("AutofuckMagazine",40,2)
	TNT1 A 0 A_JumpIfInventory("LegendaryLMGBulletMag",1,"Reload")
	TNT1 A 0
	AUTG IHGFEA 1
	Goto Ready
  MaxReload:
	AUTG A 1 A_PlayWeaponSound("weapons/arreload")
	AUTG AEFGHI 1
	AUTG I 14 A_FireCustomMissile("AREmptyMagSpawner",0,0,0,1)
	TNT1 A 0 A_JumpIfInventory("LegendaryLMGBulletMag",1,"Reload2")
  Reload2:
	TNT1 A 0 A_TakeInventory("LegendaryLMGBulletMag",1,TIF_NOTAKEINFINITE)
	TNT1 A 0 A_GiveInventory("AutofuckMagazine",1)
	TNT1 A 0 A_JumpIfInventory("AutofuckMagazine",41,"Full")
	TNT1 A 0 A_JumpIfInventory("LegendaryLMGBulletMag",1,"Reload2")
  Full:
	AUTG IHGFEA 1
	Goto Ready
  Flash:
	TNT1 A 3 Bright A_Light1
	Goto LightDone
  GrenadeCheck:
	TNT1 A 0 A_JumpIfInventory("HandGrenadeAmmo",1,"GrenadeToss")
	TNT1 A 0 A_TakeInventory("HandGrenadeAction",1)
	Goto Ready
  GrenadeToss:
	TNT1 A 0 A_PlayWeaponSound("weapons/weapondown")
	AUTG AEFGHI 1
	TNT1 A 4
	HGRN ABC 1
	HGRN D 2
	HGRN EFG 1
	HGRN HI 2
	TNT1 A 14 A_PlayWeaponSound("weapons/hgrenadepin")
	TNT1 A 0 A_PlayWeaponSound("weapons/hgrenadethrow")
	TNT1 A 0 A_TakeInventory("HandGrenadeAmmo",1,TIF_NOTAKEINFINITE)
	HGNE A 1 A_FireCustomMissile("ThrownGrenade",0,0,0,0,false)
	HGRN J 1
	HGRN KLM 2
	HGRN NO 1
	TNT1 A 6
	TNT1 A 0 A_JumpIfInventory("HandGrenadeAmmo",1,2)
	TNT1 A 0// A_TakeInventory("Hand Grenade",1)
	TNT1 A 0 A_TakeInventory("HandGrenadeAction",1)
	TNT1 A 0
	AUTG IHGFEA 1
	Goto Ready
  MineCheck:
	TNT1 A 0 A_JumpIfInventory("MineAmmo",1,"MineToss")
	TNT1 A 0 A_TakeInventory("MineAction",1)
	Goto Ready
  MineToss:
	TNT1 A 0 A_PlayWeaponSound("weapons/weapondown")
	AUTG AEFGHI 1
	TNT1 A 8
	TNT1 A 0 A_PlayWeaponSound("weapons/hgrenadethrow")
	MINE ABCDEF 1
	TNT1 A 0 A_TakeInventory("MineAmmo",1,TIF_NOTAKEINFINITE)
	MINE G 1 A_FireCustomMissile("ThrownMine",0,0,0,0,false)
	MINE HI 1
	MINE JK 2
	TNT1 A 0 A_JumpIfInventory("MineAmmo",1,2)
	TNT1 A 0// A_TakeInventory("Land Mine",1)
	TNT1 A 0 A_TakeInventory("MineAction",1)
	TNT1 A 0
	TNT1 A 5
	AUTG IHGFEA 1
	Goto Ready
	}
}

ACTOR AutofuckMagazine : Ammo 
{
	Inventory.Amount 0
	Inventory.MaxAmount 41
	Ammo.BackpackAmount 0
	Ammo.BackpackMaxAmount 41
	Inventory.Icon "AUTPA0"
	+IGNORESKILL
}