Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var KFGameInfo_Biohazard BIOGI;
- function bool GiveWeaponAmmo( KFWeapon KFW )
- {
- local bool bAddedAmmo;
- if( KFW.AddAmmo( Max( BIOGI.AmmoPickupsScaleFloat * KFW.MagazineCapacity[0], 1 )) > 0 )
- {
- bAddedAmmo = true;
- }
- if( KFW.CanRefillSecondaryAmmo() )
- {
- if ( KFW.AddSecondaryAmmo( Max( BIOGI.AmmoPickupsScaleFloat * KFW.MagazineCapacity[1], 1 )) > 0 )
- {
- bAddedAmmo = true;
- }
- }
- return bAddedAmmo;
- }
- function bool GiveWeaponsAmmo( bool bIncludeGrenades )
- {
- local KFWeapon W;
- local bool bAddedAmmo;
- foreach InventoryActors( class'KFWeapon', W )
- {
- if( !W.bInfiniteSpareAmmo && GiveWeaponAmmo(W) )
- {
- bAddedAmmo = true;
- }
- }
- if( bIncludeGrenades )
- {
- if( AddGrenadesCount( BIOGI.GrenadePickupsCountInt ) )
- {
- bAddedAmmo = true;
- }
- }
- if( bAddedAmmo )
- {
- PlayerController( Instigator.Owner ).ReceiveLocalizedMessage( class'KFLocalMessage_Game', GMT_Ammo );
- PlayGiveInventorySound( AmmoPickupSound );
- }
- else
- {
- PlayerController( Instigator.Owner ).ReceiveLocalizedMessage( class'KFLocalMessage_Game', GMT_AmmoIsFull );
- }
- return bAddedAmmo;
- }
- function bool AddGrenadesCount( int GrenadePickups )
- {
- GrenadePickups = BIOGI.GrenadePickupsCountInt;
- if( KFPawn( Instigator ) != None )
- {
- if( GrenadeCount < BIOGI.MaxGrenadeCountInt )
- {
- GrenadeCount = Min( BIOGI.MaxGrenadeCountInt, GrenadeCount + GrenadePickups );
- return true;
- }
- }
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement