#library "BoomerScripts.acs"
#include "zcommon.acs"
#import "CustomFunctions.acs"
#import "PickupScripts.acs"

Script "Boomerclass_AmmoPickupSystem" (void)
{  
   int plr = PlayerNumber();

  SetInventory("PickedUp", 0);
 
  int multiplyammo;
  multiplyammo = 1;
  if((GameSkill() == 4) || (GetCVAR("sv_doubleammo") == 1))
  multiplyammo = 2;

  
     switch(ammonumbersave[plr])
  {
  
   case 1: //Clip
   if((CheckInventory("BoomerPShRounds")) == (GetAmmoCapacity("BoomerPShRounds")) && (CheckInventory("BoomerMaximRounds")) == (GetAmmoCapacity("BoomerMaximRounds"))) { terminate; }
	   GiveInventory("BoomerPShRounds", 5*ammomultiplysave[plr]/ammodividesave[plr]);
	   	   GiveInventory("BoomerMaximRounds", 10*ammomultiplysave[plr]/ammodividesave[plr]);
 message[plr] = strparam(s:"PSh Rounds +", i:((5*ammomultiplysave[plr]/ammodividesave[plr])*multiplyammo), s:" & Maxim Rounds +", i:((10*ammomultiplysave[plr]/ammodividesave[plr])*multiplyammo));
   break;
   case 2: //Shell
   if((CheckInventory("BoomerShells")) == (GetAmmoCapacity("BoomerShells")) && (CheckInventory("BoomerFlak")) == (GetAmmoCapacity("BoomerFlak"))) { terminate; }
   GiveInventory("BoomerShells", 2*ammomultiplysave[plr]/ammodividesave[plr]);
   GiveInventory("BoomerFlak", 2*ammomultiplysave[plr]/ammodividesave[plr]);
   message[plr] = strparam(s:"Explosive Buckshot +", i:((2*ammomultiplysave[plr]/ammodividesave[plr])*multiplyammo), s:" & Flak Shells +", i:((2*ammomultiplysave[plr]/ammodividesave[plr])*multiplyammo));
   break;
   case 3: //Rocket
   if((CheckInventory("BoomerRockets")) == (GetAmmoCapacity("BoomerRockets"))) { terminate; }
	   GiveInventory("BoomerRockets", 1*ammomultiplysave[plr]/ammodividesave[plr]);
   message[plr] = strparam(s:"Katyusha Tank Shells +", i:((1*ammomultiplysave[plr]/ammodividesave[plr])*multiplyammo));
   break;
   case 4: //Cell 
   if((CheckInventory("BoomerAutocannonRounds")) == (GetAmmoCapacity("BoomerAutocannonRounds")) && (CheckInventory("BoomerMininukes")) == (GetAmmoCapacity("BoomerMininukes"))) { terminate; }
   GiveInventory("BoomerAutocannonRounds", 10*ammomultiplysave[plr]/ammodividesave[plr]);
   GiveInventory("BoomerMininukes", 1*ammomultiplysave[plr]/ammodividesave[plr]);
   message[plr] = strparam(s:"Autocannon Shells +", i:((10*ammomultiplysave[plr]/ammodividesave[plr])*multiplyammo), s:" & Mininukes +", i:((1*ammomultiplysave[plr]/ammodividesave[plr])*multiplyammo));
   break;
   }
   GiveInventory("PickupBlend", 1);
   PlaySound(0, "AMMO", 4);
   ACS_NamedExecuteWithResult("PostLog", 0, 0, 0, 0);
}

Script "BoomerClass_PistolStart" (void)
{ 
	TakeInventory("BoomerTerrorizer", 1);
	TakeInventory("BoomerFlakGun", 1);
	TakeInventory("BoomerKS23",1);
	TakeInventory("BoomerShells", 0);
	TakeInventory("BoomerFlak", 0);
	TakeInventory("BoomerMaximov", 1);
	TakeInventory("BoomerMaximRounds",0);
	TakeInventory("BoomerTankCannon", 1);
	TakeInventory("BoomerSaigak12", 1);
	TakeInventory("BoomerRockets", 0);
	TakeInventory("BoomerSHVAK", 1);
	TakeInventory("BoomerAutocannonRounds", 0);
	TakeInventory("BoomerTZARPUSHKA", 1);
	TakeInventory("BoomerMininukes", 0);
}

Script "BoomerClass_PickupSystem" (void)
{ 
   
   int plr = PlayerNumber();
   
   GiveInventory("PickupBlend", 1);
   PlaySound(0, "DSWPNUP", 4);
   
     switch(weaponnumbersave[plr])
  {
   case 1: GiveInventory("BoomerTerrorizer", 1);  print(s:"\cfYou got The Russian Terrorizator! Twist and peel!"); ; SetInventory("HasChainsaw", 1); break;
   case 2: GiveInventory("BoomerKS23",1); print(s:"\cfYou got The KS-23! Quite handy!!");  SetInventory("HasShotgun", 1); break;
   case 3: GiveInventory("BoomerFlakGun", 1);  print(s:"\cfYou got your friend Stanislav! Big and BAD!"); SetInventory("HasSuperShotgun", 1); break;
   case 4: GiveInventory("BoomerMaximov",1);  print(s:"\cfYou got The Maximov HMG! Run Cowards!"); SetInventory("HasChaingun", 1); break;
   case 5: GiveInventory("BoomerTankCannon", 1); GiveInventory("BoomerSaigak12", 1);  print(s:"\cfYou got the SaigaK-12 and Katyusha Tank Cannon!"); SetInventory("HasRocketLauncher", 1); break;
   case 6: GiveInventory("BoomerSHVAK", 1); print(s:"\cfYou got The ShVAK AutoCannon! Armed And Dangerous!"); SetInventory("HasPlasmaRifle", 1); break;
   case 7: GiveInventory("BoomerTZARPUSHKA", 1); print(s:"\cfYou got Tzar Pushka! Like Pyotr The 1st Intended!"); SetInventory("HasBFG9000", 1); break;
   }
   
}

