ACTOR GE007GoldenGun: Weapon
{
  Weapon.Kickback 100
  Scale 0.1
  Inventory.PickupMessage "Picked up the Golden Gun."
   Weapon.Ammotype1 "GoldenGunClip"
    Weapon.AmmoUse1 1
  Weapon.AmmoGive1 0
	Weapon.AmmoGive2 3
	Weapon.AmmoType2 "GE007GoldenAmmo"
	+WEAPON.AMMO_OPTIONAL
	tag "Golden Gun"
  Obituary  "%k stopped %o's heart with an accurate Golden Gun round."
  	Inventory.PickupSound "GE007/Weapons/WeaponSFX1"
  States
  {
  Spawn:
    TKA1 G -1
    Loop
  Ready:
  TNT1 A 0 A_PlaySound ("GE007/Weapons/WeaponSFX1","Weapon")
    TK40 A 1 
    TK40 B 1
    TK40 C 1
    TK40 D 1
    TK40 EFGHIJKLMNO 1
    TK40 P -1 A_WeaponReady
	goto ReloadCheck
	TK40 P 1 A_WeaponReady
    Goto Ready+6
	
		ReloadCheck:
	 KLBG A 0 A_JumpIfInventory("GoldenGunClip",1,2)
	 KLBG A 0 A_JumpIfInventory("GE007GoldenAmmo",1,"ReloadStart")
	 KLBG A 0
	 goto Ready+16

  ReloadStart:
	 KLBR A 0 A_PlayWeaponSound("GE007/Weapons/Reload")
     TK40 ONMLKJIHGFEDCBA 1
	 TNT1 A 5
	 goto ReloadAmmo

  ReloadAmmo:
	 TNT1 A 0 A_TakeInventory("GE007GoldenAmmo",1)
	 TNT1 A 0 A_GiveInventory("GoldenGunClip",1)
	 TNT1 A 0 A_JumpIfInventory("GoldenGunClip",1,"ReloadDone")
	 TNT1 A 0 A_JumpIfInventory("GE007GoldenAmmo",1,"ReloadAmmo")
	 goto ReloadDone
	 
	 ReloadDone:
	 TNT1 A 5
	 TK40 ABCDEFGHIJKLMNOP 1
	 goto Ready+16
  Deselect:
    TK40 ONMLKJIHGFEDCB 1
    TK40 A 1
    TK08 A 0 A_Lower
    wait
  Select: 
    TK08 A 0 A_Raise 
    Loop  
  Fire: 
  KLBG A 0 A_JumpIfNoAmmo("ReloadCheck")
 	TNT1 A 0 A_PlaySound ("GE007/Weapons/D5K","Weapon")
    TK40 Q 1 BRIGHT A_FireBullets(1, 1, -1, 99999, "BulletPuff")
	TK40 RSTUVXYZ 1
	TK41 ABCDE 1
    Goto Ready+16
		AltFire:
		TK04 A 0
		goto ReloadCheck
  }
}

ACTOR GoldenGunClip : Ammo
{
Inventory.MaxAmount 1 // size of the clip
Ammo.BackpackAmount 0
Ammo.BackpackMaxAmount 1 //MUST be the same as Inventory.MaxAmmount
+INVENTORY.IGNORESKILL
}

ACTOR GE007GoldenGunPickup : Custominventory
{
   Scale 0.2
  Inventory.PickupMessage "Picked up the Golden Gun."
  	Inventory.PickupSound "GE007/Weapons/WeaponSFX1"
   States
   {
   Spawn:
	  TKA4 O -1
	  loop
   Pickup:
	  TNT1 A 0 A_GiveInventory("GE007GoldenGun")
	  stop
   }
}
