forked from Ballistic-Weapons-Community/BallisticWeapons
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAmmo_545mmSTANAG.uc
58 lines (55 loc) · 1.49 KB
/
Ammo_545mmSTANAG.uc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
//=============================================================================
// Ammo_545mmSTANAG.
//
// 5.45mm bullet ammo. Shorter length round used in STANAG mags.
// Used by the MARS-3
//
// by Nolan "Dark Carnivour" Richert.
// Copyright(c) 2005 RuneStorm. All Rights Reserved.
//=============================================================================
class Ammo_545mmSTANAG extends BallisticAmmo;
var Ammo_BRINKGrenades Grenades;
function bool HandlePickupQuery( pickup Item )
{
if ( Item.IsA('AP_STANAGShockwave') )
{
if (Grenades==None)
{
Grenades = Ammo_BRINKGrenades(Pawn(Owner).FindInventoryType(class'Ammo_BRINKGrenades'));
if (Grenades == None)
{
Grenades = spawn(class'Ammo_BRINKGrenades',Owner,,,rot(0,0,0));
Grenades.GiveTo( Pawn(Owner), Item );
}
}
if (Grenades!=None)
{
if (Grenades.AmmoAmount < Grenades.MaxAmmo)
{
Grenades.AddAmmo(2);
if (AmmoAmount<MaxAmmo)
{
item.AnnouncePickup(Pawn(Owner));
item.SetRespawn();
}
}
}
if (AmmoAmount>=MaxAmmo)
return true;
item.AnnouncePickup(Pawn(Owner));
AddAmmo(Ammo(item).AmmoAmount);
item.SetRespawn();
return true;
}
else
return super.HandlePickupQuery(Item);
}
defaultproperties
{
InitialAmount=90
IconFlashMaterial=Shader'BWBP_SKC_Tex.M4A1.AmmoIcon_556Flash'
PickupClass=Class'BWBP_SWC_Pro.AP_STANAGShockwave'
IconMaterial=Texture'BWBP_SKC_Tex.M4A1.AmmoIcon_556'
IconCoords=(X2=64,Y2=64)
ItemName="5.45mm STN Ammo"
}