## XIII
Class XIIIWeaponPickup

source: C:\XIII\XIII\Classes\XIIIWeaponPickup.uc

    Core.Object
       |
       +--Engine.Actor
          |
          +--Engine.Pickup
             |
             +--Engine.WeaponPickup
                |
                +--XIII.XIIIWeaponPickup

Direct Known Subclasses:ArbaletePick, ArbaleteX3Pick, BazookPick, BerettaPick, FGrenadPick, FusilChassePick, FusilPompePick, FusilSnipePick, GrenadPick, KalashPick, LHarponPick, M16Pick, M60Pick, MagnumPick, MiniUziPick, TKnifePick, FlashBangPick

class XIIIWeaponPickup
extends Engine.WeaponPickup

    //-----------------------------------------------------------
    //
    //-----------------------------------------------------------

Function Summary
`float` | `BotDesireability(Pawn Bot)`
    //_____________________________________________________________________________

Source Code

    00001	//-----------------------------------------------------------
    00002	//
    00003	//-----------------------------------------------------------
    00004	class XIIIWeaponPickup extends WeaponPickup
    00005	     abstract;
    00006
    00007	//_____________________________________________________________________________
    00008	function float BotDesireability(Pawn Bot)
    00009	{
    00010	    local Weapon AlreadyHas;
    00011	    local float desire;
    00012
    00013	    // bots adjust their desire for their favorite weapons
    00014	    desire = MaxDesireability; //+ Bot.Controller.AdjustDesireFor(self);
    00015
    00016	    // see if bot already has a weapon of this type
    00017	    AlreadyHas = Weapon(Bot.FindInventoryType(InventoryType));
    00018	    if ( AlreadyHas != None )
    00019	    {
    00020	      // can't pick it up if weapon stay is on
    00021	      if ( bWeaponStay && ((Inventory == None) || Inventory.bTossedOut) )
    00022	        return 0;
    00023	      if ( AlreadyHas.AmmoType == None )
    00024	        return 0.25 * desire;
    00025
    00026	      // bot wants this weapon for the ammo it holds
    00027	      if ( AlreadyHas.AmmoType.AmmoAmount > 0 )
    00028	        return FMax( 0.25 * desire,
    00029	          AlreadyHas.AmmoType.PickupClass.Default.MaxDesireability
    00030	          * FMin(1, 0.15 * AlreadyHas.AmmoType.MaxAmmo/AlreadyHas.AmmoType.AmmoAmount) );
    00031	      else
    00032	        return 0.05;
    00033	    }
    00034
    00035	    // incentivize bot to get this weapon if it doesn't have a good weapon already
    00036	    if ( (Bot.Weapon == None) || (Bot.Weapon.AIRating <= 0.4) )
    00037	      return 2*desire;
    00038
    00039	    return desire;
    00040	}
    00041
    00042
    00043
    00044	defaultproperties
    00045	{
    00046	     RespawnTime=12.000000
    00047	     hRespawnSound=Sound'XIIIsound.Multi__SFXMulti.SFXMulti__hRespawnGun'
    00048	     DrawType=DT_StaticMesh
    00049	     CollisionRadius=34.000000
    00050	     CollisionHeight=10.000000
    00051	     MessageClass=Class'XIII.XIIIPickupMessage'
    00052	}

End Source Code