ACTOR GE007RCP90 : Weapon
{
  Weapon.Kickback 100
  Scale 0.1
    Weapon.Ammotype1 "RCP90Clip"
    Weapon.AmmoUse1 1
  Weapon.AmmoGive1 0
	Weapon.AmmoGive2 80
	Weapon.AmmoType2 "GE007PistolAmmo"
     +WEAPON.AMMO_OPTIONAL
   tag "RCP-90"
  Inventory.PickupMessage "Picked up a RCP-90."
  Obituary  "%k pulled out his RCP-90 and %o's head fell off in terror."
  	Inventory.PickupSound "GE007/Weapons/WeaponSFX1"
  States
  {
  Spawn:
    TKA1 O -1
    Loop
  Ready:
  TNT1 A 0 A_PlaySound ("GE007/Weapons/WeaponSFX1","Weapon")
    TK32 A 1 
    TK32 B 1
    TK32 C 1
    TK32 D 1
    TK32 EFGHIJKLMNOPQ 1
    TK32 R -1 A_WeaponReady
	goto ReloadCheck
	TK32 R 1 A_WeaponReady
    Goto Ready+6
	
		ReloadCheck:
	 KLBG A 0 A_JumpIfInventory("RCP90Clip",80,2)
	 KLBG A 0 A_JumpIfInventory("GE007PistolAmmo",1,"ReloadStart")
	 KLBG A 0
	 goto Ready+17

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

  ReloadAmmo:
	 TNT1 A 0 A_TakeInventory("GE007PistolAmmo",1)
	 TNT1 A 0 A_GiveInventory("RCP90Clip",1)
	 TNT1 A 0 A_JumpIfInventory("RCP90Clip",80,"ReloadDone")
	 TNT1 A 0 A_JumpIfInventory("GE007PistolAmmo",1,"ReloadAmmo")
	 goto ReloadDone
	 
	 ReloadDone:
	 TNT1 A 5
	 TK32 ABCDEFGHIJKLMNOPQ 1
	 goto Ready+17	
  Deselect:
    TK32 QPONMLKJIHGFEDCB 1
    TK32 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/RCP90")
    TK32 S 1 BRIGHT A_FireBullets(6, 6, 1, 30, "BulletPuff",FBF_USEAMMO|FBF_NORANDOM)
	PP7G B 0 BRIGHT A_SpawnItemEx ("GE007BulletCasing", 30,cos(pitch)*12,sin(-pitch)*10+30, frandom(0.5,1.2),frandom(0.5,1.2),frandom(1.5,2.5))
	TK32 T 1
	TK32 U 1 A_REFIRE
	TK32 VXYZ 1
	TK33 ABCDEF 1
    Goto Ready+18
		AltFire:
		TK04 A 0
		goto ReloadCheck
  }
}

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

ACTOR GE007RCP90Pickup : Custominventory
{
   Scale 0.1
  Inventory.PickupMessage "Picked up a RCP-90."
  	Inventory.PickupSound "GE007/Weapons/WeaponSFX1"
   States
   {
   Spawn:
	  TKA5 I -1
	  loop
   Pickup:
	  TNT1 A 0 A_GiveInventory("GE007RCP90")
	  stop
   }
}
