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
00080
00081
00082
00083
00084
00085
00086
class Health extends 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 LODSTYLE=8
#exec MESH LODPARAMS MESH=HealthM STRENGTH=0.3
#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 TLOD=5

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

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

    HealMax = Bot.Default.Health;
    if (bSuperHeal) HealMax = HealMax * 2.0;
    desire = Min(HealingAmount, HealMax - Bot.Health);

    if ( (Bot.Weapon != None) && (Bot.Weapon.AIRating > 0.5) )
        desire *= 1.7;
    if ( Bot.Health < 40 )
        return ( FMin(0.03 * desire, 2.2) );
    else
        return ( FMin(0.015 * desire, 2.0) ); 
}

function PlayPickupMessage(Pawn Other)
{
    Other.ClientMessage(PickupMessage$HealingAmount, 'Pickup');
}

auto state Pickup
{   
    function Touch( actor Other )
    {
        local int HealMax;
        local Pawn P;
            
        if ( ValidTouch(Other) ) 
        {   
            P = Pawn(Other);    
            HealMax = P.default.health;
            if (bSuperHeal) HealMax = HealMax * 2.0;
            if (P.Health < HealMax) 
            {
                if (Level.Game.LocalLog != None)
                    Level.Game.LocalLog.LogPickup(Self, P);
                if (Level.Game.WorldLog != None)
                    Level.Game.WorldLog.LogPickup(Self, P);
                P.Health += HealingAmount;
                if (P.Health > HealMax) P.Health = HealMax;
                PlayPickupMessage(P);
                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=LodMesh'UnrealShare.HealthM'
     MaxDesireability=0.500000
     PickupSound=Sound'UnrealShare.Pickups.Health2'
     Icon=Texture'UnrealShare.Icons.I_Health'
     RemoteRole=ROLE_DumbProxy
     Mesh=LodMesh'UnrealShare.HealthM'
     AmbientGlow=64
     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: za 22-4-2006 13:27:48.000 - Creation time: za 22-4-2006 13:29:28.406 - Created with UnCodeX