Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames

Engine.ArmorPickup


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
class ArmorPickup extends Pickup
    abstract;

function float BotDesireability( pawn Bot )
{
    local Inventory AlreadyHas;
    local Armor AlreadyHasArmor;
    local float desire;
    local bool bChecked;

    desire = MaxDesireability;

    if ( RespawnTime < 10 )
    {
        bChecked = true;
        AlreadyHas = Bot.FindInventoryType(InventoryType); 
        if ( AlreadyHas != None ) 
        {
            if ( Inventory != None )
            {
                if( Inventory.Charge <= AlreadyHas.Charge )
                    return -1;
            }
            else if ( InventoryType.Default.Charge <= AlreadyHas.Charge )
                return -1;
        }
    }

    if ( !bChecked )
        AlreadyHasArmor = Armor(Bot.FindInventoryType(InventoryType)); 
    if ( AlreadyHasArmor != None )
        desire *= (1 - AlreadyHasArmor.Charge * AlreadyHasArmor.ArmorAbsorption * 0.00003);
    
    if ( Armor(Inventory) != None )
    {
        // pointing to specific, existing item
        desire *= (Inventory.Charge * 0.005);
        desire *= (Armor(Inventory).ArmorAbsorption * 0.01);
    }
    else
    {
        desire *= (InventoryType.default.Charge * 0.005);
        desire *= (class<Armor>(InventoryType).default.ArmorAbsorption * 0.01);
    }
    return desire;
}

defaultproperties
{
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: Fri 3/10/2008 19:00:56.000 - Creation time: Tue 27/4/2010 03:12:43.619 - Created with UnCodeX