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

UnrealShare.Health


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
class Health expands PickUp;

#exec AUDIO IMPORT FILE="Sounds\Pickups\HEALTH2.WAV"  NAME="Health2"     GROUP="Pickups"

#exec TEXTURE IMPORT NAME=I_Health FILE=TEXTURES\HUD\i_Health.PCX GROUP="Icons" MIPS=OFF

#exec MESH IMPORT MESH=HealthM ANIVFILE=MODELS\aniv38.3D DATAFILE=MODELS\data38.3D X=0 Y=0 Z=0
#exec  MESH ORIGIN MESH=HealthM X=0 Y=0 Z=0 YAW=0
#exec  MESH SEQUENCE MESH=HealthM SEQ=All    STARTFRAME=0  NUMFRAMES=1
#exec  TEXTURE IMPORT NAME=Jhealth1 FILE=MODELS\health.PCX GROUP="Skins" FLAGS=2
#exec  MESHMAP SCALE MESHMAP=HealthM X=0.02 Y=0.02 Z=0.04
#exec  MESHMAP SETTEXTURE MESHMAP=HealthM NUM=0 TEXTURE=Jhealth1

var() int HealingAmount;
var() bool bSuperHeal;

event float BotDesireability(Pawn Bot)
{
    local float desire;

    desire = HealingAmount;
    if ( !bSuperHeal )
        desire = Min(desire, 100 - Bot.Health);

    if ( (Bot.Weapon != None) && (Bot.Weapon.AIRating > 0.4) )
        desire *= 2;
    if ( Bot.Health < 40 )
        return ( FMin(0.03 * desire, 2.2) );
    else if ( Bot.Health < 100 )
        return ( 0.015 * desire ); 
    else
        return 0;
}

auto state Pickup
{   
    function Touch( actor Other )
    {
        local int HealMax;
    
        if ( ValidTouch(Other) ) 
        {       
            HealMax = Pawn(Other).default.health;
            if (bSuperHeal) HealMax = HealMax * 2.0;
            if (Pawn(Other).Health < HealMax) 
            {
                Pawn(Other).Health += HealingAmount;
                if (Pawn(Other).Health > HealMax) Pawn(Other).Health = HealMax;
                if ( bSuperHeal )
                    Pawn(Other).ClientMessage(PickupMessage, 'Pickup');
                else                
                    Pawn(Other).ClientMessage(PickupMessage $ HealingAmount, 'Pickup');
                PlaySound (PickupSound,,2.5);
                if ( Level.Game.Difficulty > 1 )
                    Other.MakeNoise(0.1 * Level.Game.Difficulty);       
                SetRespawn();
            }
        }
    }
}

defaultproperties
{
     HealingAmount=20
     PickupMessage="You picked up a Health Pack +"
     RespawnTime=20.000000
     PickupViewMesh=Mesh'UnrealShare.HealthM'
     MaxDesireability=0.500000
     PickupSound=Sound'UnrealShare.Pickups.Health2'
     Icon=Texture'UnrealShare.Icons.I_Health'
     RemoteRole=ROLE_DumbProxy
     Mesh=Mesh'UnrealShare.HealthM'
     AmbientGlow=64
     bMeshCurvy=False
     CollisionRadius=22.000000
     CollisionHeight=8.000000
     Mass=10.000000
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: Sun 21/2/2010 23:48:40.000 - Creation time: Sun 21/2/2010 23:49:52.008 - Created with UnCodeX