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

Botpack.TFemaleBody


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
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
//=============================================================================
// TFemaleBody.
//=============================================================================
class TFemaleBody extends UTHumanCarcass
    abstract;

var float LastHit;
var bool bJerking;
var name Jerks[4];

replication
{
    // Things the server should send to the client.
    unreliable if( Role==ROLE_Authority )
        LastHit, bJerking;
}

function SpawnHead()
{
    local carcass carc;

    carc = Spawn(class'UT_HeadFemale');
    if ( carc != None )
    {
        carc.RemoteRole = ROLE_SimulatedProxy;
        carc.Initfor(self);
    }
}
function TakeDamage( int Damage, Pawn InstigatedBy, Vector Hitlocation, 
                        Vector Momentum, name DamageType)
{   
    local bool bRiddled;

    if ( bJerking || (AnimSequence == 'Dead9') )
    {
        bJerking = true;
        if ( Damage < 23 )
            LastHit = Level.TimeSeconds;
        else 
            bJerking = false;
    }
    Super.TakeDamage(Damage, InstigatedBy, HitLocation, Momentum, DamageType);

    if ( bJerking )
    {
        CumulativeDamage = 50;
        Velocity.Z = FMax(Velocity.Z, 40);
        if ( InstigatedBy == None )
        {
            bJerking = false;
            PlayAnim('Dead9B', 1.1, 0.1);
        }
    }
    if ( bJerking && (VSize(InstigatedBy.Location - Location) < 150)
        && (InstigatedBy.Acceleration != vect(0,0,0))
        && ((Normal(InstigatedBy.Velocity) Dot Normal(Location - InstigatedBy.Location)) > 0.7) )
    {
        bJerking = false;
        PlayAnim('Dead9B', 1.1, 0.1);
    }
}

function AnimEnd()
{
    local name NewAnim;

    if ( AnimSequence == 'Dead9' )
        bJerking = true;

    if ( !bJerking )
        Super.AnimEnd();
    else if ( (Level.TimeSeconds - LastHit < 0.2) && (FRand() > 0.02) )
    {
        NewAnim = Jerks[Rand(4)];
        if ( NewAnim == AnimSequence )
        {
            if ( NewAnim == Jerks[0] )
                NewAnim = Jerks[1];
            else
                NewAnim = Jerks[0];
        }
        TweenAnim(NewAnim, 0.15);
    }
    else
    {
        bJerking = false;
        PlayAnim('Dead9B', 1.0, 0.1);
    }
}

defaultproperties
{
     Jerks(0)=GutHit
     Jerks(1)=HeadHit
     Jerks(2)=LeftHit
     Jerks(3)=RightHit
     MasterReplacement=Class'Botpack.TFemaleMasterChunk'
     LifeSpan=0.000000
     AnimSequence=Dead1
     AnimFrame=0.000000
     bBlockActors=True
     bBlockPlayers=True
     Mass=100.000000
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: Do 19.5.2005 19:42:14.000 - Creation time: Fr 7.6.2013 13:16:05.117 - Created with UnCodeX