ACTOR GE007KF7Soviet : Weapon
{
  Weapon.Kickback 100
  Scale 0.1
    Weapon.Ammotype1 "KF7SovietClip"
    Weapon.AmmoUse1 1
  Weapon.AmmoGive1 0
	Weapon.AmmoGive2 30
	Weapon.AmmoType2 "GE007RifleAmmo"
	TAG "KF7 Soviet"
	  +WEAPON.AMMO_OPTIONAL
  Inventory.PickupMessage "Picked up a KF7 Soviet."
  Obituary  "%o was destroyed by the Russian might of %k with his KF7 Soviet."
  	Inventory.PickupSound "GE007/Weapons/WeaponSFX1"
  States
  {
  Spawn:
    TKA1 I -1
    Loop
  Ready:
  TNT1 A 0 A_PlaySound ("GE007/Weapons/WeaponSFX1","Weapon")
    TK20 A 1 
    TK20 B 1
    TK20 C 1
    TK20 D 1
    TK20 EFGHIJKLM 1
    TK20 N -1 A_WeaponReady
	goto ReloadCheck
	TK20 N 1 A_WeaponReady
    Goto Ready+6	
	
	ReloadCheck:
	 KLBG A 0 A_JumpIfInventory("KF7SovietClip",30,2)
	 KLBG A 0 A_JumpIfInventory("GE007RifleAmmo",1,"ReloadStart")
	 KLBG A 0
	 goto Ready+14

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

  ReloadAmmo:
	 TNT1 A 0 A_TakeInventory("GE007RifleAmmo",1)
	 TNT1 A 0 A_GiveInventory("KF7SovietClip",1)
	 TNT1 A 0 A_JumpIfInventory("KF7SovietClip",30,"ReloadDone")
	 TNT1 A 0 A_JumpIfInventory("GE007RifleAmmo",1,"ReloadAmmo")
	 goto ReloadDone
	 
	 ReloadDone:
	 TNT1 A 5
	 TK20 ABCDEFGHIJKLMN 1
	 goto Ready+14
  Deselect:
    TK20 MLKJIHGFEDCB 1
    TK20 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_PlayWeaponSound ("GE007/Weapons/KF7")
    TK20 O 1 BRIGHT A_FireBullets(4, 2, 1, 20, "BulletPuff",FBF_USEAMMO|FBF_NORANDOM)
	SNIP A 0 BRIGHT A_SpawnItemEx ("PointedBulletCasing", 30,cos(pitch)*12,sin(-pitch)*10+30, frandom(0.5,1.2),frandom(0.5,1.2),frandom(1.5,2.5))
	TK20 PQ 1
	TNT1 A 0 A_PlayWeaponSound ("GE007/Weapons/KF7")
    TK20 R 1 BRIGHT A_FireBullets(4, 2, 1, 20, "BulletPuff",FBF_USEAMMO|FBF_NORANDOM)
	SNIP A 0 BRIGHT A_SpawnItemEx ("PointedBulletCasing", 30,cos(pitch)*12,sin(-pitch)*10+30, frandom(0.5,1.2),frandom(0.5,1.2),frandom(1.5,2.5))
	TK20 ST 1
	TNT1 A 0 A_PlayWeaponSound ("GE007/Weapons/KF7")
	TK20 U 1 BRIGHT A_FireBullets(4, 2, 1, 20, "BulletPuff",FBF_USEAMMO|FBF_NORANDOM)
	SNIP A 0 BRIGHT A_SpawnItemEx ("PointedBulletCasing", 30,cos(pitch)*12,sin(-pitch)*10+30, frandom(0.5,1.2),frandom(0.5,1.2),frandom(1.5,2.5))
	TK20 V 1 A_refire
	TK20 XYZ 1
	TK21 ABCDEFGHI 1
    Goto Ready+14
		AltFire:
		TK04 A 0
		goto ReloadCheck
  }
}

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

ACTOR GE007KF7SovietPickup : Custominventory
{
   Scale 0.075
  Inventory.PickupMessage "Picked up a KF7 Soviet."
  	Inventory.PickupSound "GE007/Weapons/WeaponSFX1"
   States
   {
   Spawn:
	  TKA5 B -1
	  loop
   Pickup:
	  TNT1 A 0 A_GiveInventory("GE007KF7Soviet")
	  stop
   }
}
