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

XPickups.ShieldPickup


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
//=============================================================================
// ShieldPickup - cut and paste from TournamentHealth
//=============================================================================
class ShieldPickup extends TournamentPickUp
    abstract notplaceable;

var() int ShieldAmount;

/* 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 float Need;
    
    Need = Other.CanUseShield(ShieldAmount);
    if ( Need <= 0 )
        return 0;
    if ( AIController(Other.Controller).PriorityObjective() && (Need < 0.4 * Other.GetShieldStrengthMax()) )
        return (0.005 * MaxDesireability * Need)/PathWeight; 
    return (0.013 * MaxDesireability * Need)/PathWeight;
}

simulated static function UpdateHUD(HUD H)
{
    H.LastPickupTime = H.Level.TimeSeconds;
    H.LastArmorPickupTime = H.LastPickupTime;
}

event float BotDesireability(Pawn Bot)
{
    return (0.013 * MaxDesireability * Bot.CanUseShield(ShieldAmount));
}

static function string GetLocalString(
    optional int Switch,
    optional PlayerReplicationInfo RelatedPRI_1, 
    optional PlayerReplicationInfo RelatedPRI_2
    )
{
    return Default.PickupMessage$Default.ShieldAmount;
}

auto state Pickup
{   
    function Touch( actor Other )
    {
        local Pawn P;
            
        if ( ValidTouch(Other) ) 
        {           
            P = Pawn(Other);
            if ( P.AddShieldStrength(ShieldAmount) || !Level.Game.bTeamGame )
            {
                AnnouncePickup(P);
                SetRespawn();
            }
        }
    }
}

defaultproperties
{
     ShieldAmount=20
     MaxDesireability=1.500000
     RespawnTime=30.000000
     PickupMessage="You picked up a Shield Pack +"
     AmbientGlow=64
     CollisionHeight=23.000000
     Mass=10.000000
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: Fr 30.3.2007 08:43:42.000 - Creation time: Mo 16.4.2007 11:20:53.171 - Created with UnCodeX