Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |
00001 00002 00003 00004 00005 00006 00007 00008 00009 00010 00011 00012 00013 00014 00015 00016 00017 00018 00019 00020 00021 00022 00023 00024 00025 00026 00027 00028 00029 00030 00031 00032 00033 00034 00035 00036 00037 00038 00039 00040 00041 00042 00043 00044 00045 00046 00047 00048 00049 00050 00051 00052 00053 00054 00055 00056 00057 00058 00059 00060 00061 00062 00063 00064 00065 00066 00067 00068 00069 00070 00071 00072 00073 00074 00075 00076 00077 00078 00079 00080 00081 00082 00083 00084 00085 00086 |
//============================================================================= // Ammo. //============================================================================= class Ammo extends Pickup abstract native; #exec Texture Import File=Textures\Ammo.pcx Name=S_Ammo Mips=Off MASKED=1 var() int AmmoAmount; simulated static function UpdateHUD(HUD H) { H.LastPickupTime = H.Level.TimeSeconds; H.LastAmmoPickupTime = H.LastPickupTime; } /* DetourWeight() value of this path to take a quick detour (usually 0, used when on route to distant objective, but want to grab inventory for example) */ function float DetourWeight(Pawn Other,float PathWeight) { local Inventory inv; local Weapon W; local float Desire; if ( Other.Weapon.AIRating >= 0.5 ) return 0; for ( Inv=Other.Inventory; Inv!=None; Inv=Inv.Inventory ) { W = Weapon(Inv); if ( W != None ) { Desire = W.DesireAmmo(InventoryType, true); if ( Desire != 0 ) return Desire * MaxDesireability/PathWeight; } } return 0; } function float BotDesireability(Pawn Bot) { local Inventory inv; local Weapon W; local float Desire; local Ammunition M; if ( Bot.Controller.bHuntPlayer ) return 0; for ( Inv=Bot.Inventory; Inv!=None; Inv=Inv.Inventory ) { W = Weapon(Inv); if ( W != None ) { Desire = W.DesireAmmo(InventoryType, false); if ( Desire != 0 ) return Desire * MaxDesireability; } } M = Ammunition(Bot.FindInventoryType(InventoryType)); if ( (M != None) && (M.AmmoAmount >= M.MaxAmmo) ) return -1; return 0.25 * MaxDesireability; } function inventory SpawnCopy( Pawn Other ) { local Inventory Copy; Copy = Super.SpawnCopy(Other); Ammunition(Copy).AmmoAmount = AmmoAmount; return Copy; } defaultproperties { MaxDesireability=0.200000 RespawnTime=30.000000 PickupMessage="You picked up some ammo." CullDistance=4000.000000 Texture=Texture'Engine.S_Ammo' AmbientGlow=128 } |
Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |