Advertisement
Guest User

Untitled

a guest
Jul 1st, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var KFGameInfo_Biohazard BIOGI;
  2.  
  3. function bool GiveWeaponAmmo( KFWeapon KFW )
  4. {
  5.     local bool bAddedAmmo;
  6.  
  7.     if( KFW.AddAmmo( Max( BIOGI.AmmoPickupsScaleFloat * KFW.MagazineCapacity[0], 1 )) > 0 )
  8.     {
  9.         bAddedAmmo = true;
  10.     }
  11.  
  12.     if( KFW.CanRefillSecondaryAmmo() )
  13.     {
  14.         if ( KFW.AddSecondaryAmmo( Max( BIOGI.AmmoPickupsScaleFloat * KFW.MagazineCapacity[1], 1 )) > 0 )
  15.         {
  16.             bAddedAmmo = true;
  17.         }
  18.     }
  19.  
  20.     return bAddedAmmo;
  21. }
  22.  
  23. function bool GiveWeaponsAmmo( bool bIncludeGrenades )
  24. {
  25.     local KFWeapon W;
  26.     local bool bAddedAmmo;
  27.  
  28.     foreach InventoryActors( class'KFWeapon', W )
  29.     {
  30.         if( !W.bInfiniteSpareAmmo && GiveWeaponAmmo(W) )
  31.         {
  32.             bAddedAmmo = true;
  33.         }
  34.     }
  35.  
  36.     if( bIncludeGrenades )
  37.     {
  38.         if( AddGrenadesCount( BIOGI.GrenadePickupsCountInt ) )
  39.         {
  40.             bAddedAmmo = true;
  41.         }
  42.     }
  43.  
  44.     if( bAddedAmmo )
  45.     {
  46.         PlayerController( Instigator.Owner ).ReceiveLocalizedMessage( class'KFLocalMessage_Game', GMT_Ammo );
  47.         PlayGiveInventorySound( AmmoPickupSound );
  48.     }
  49.     else
  50.     {
  51.         PlayerController( Instigator.Owner ).ReceiveLocalizedMessage( class'KFLocalMessage_Game', GMT_AmmoIsFull );
  52.     }
  53.  
  54.     return bAddedAmmo;
  55. }
  56.  
  57. function bool AddGrenadesCount( int GrenadePickups )
  58. {
  59.     GrenadePickups = BIOGI.GrenadePickupsCountInt;
  60.    
  61.     if( KFPawn( Instigator ) != None )
  62.     {
  63.         if( GrenadeCount < BIOGI.MaxGrenadeCountInt )
  64.         {
  65.             GrenadeCount = Min( BIOGI.MaxGrenadeCountInt, GrenadeCount + GrenadePickups );
  66.             return true;
  67.         }
  68.     }
  69.  
  70.     return false;
  71. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement