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

UnrealShare.Male


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
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174
00175
00176
00177
00178
00179
00180
00181
00182
00183
00184
00185
//=============================================================================
// Male.
//=============================================================================
class Male extends Human
    abstract;

#exec AUDIO IMPORT FILE="Sounds\Male\deathc1.WAV" NAME="MDeath1" GROUP="Male"
#exec AUDIO IMPORT FILE="Sounds\Male\deathc3.WAV" NAME="MDeath3" GROUP="Male"
#exec AUDIO IMPORT FILE="Sounds\Male\deathc4.WAV" NAME="MDeath4" GROUP="Male"
#exec AUDIO IMPORT FILE="Sounds\Male\injurL2.WAV" NAME="MInjur1" GROUP="Male"
#exec AUDIO IMPORT FILE="Sounds\Male\injurL04.WAV" NAME="MInjur2" GROUP="Male"
#exec AUDIO IMPORT FILE="Sounds\Male\injurM04.WAV" NAME="MInjur3" GROUP="Male"
#exec AUDIO IMPORT FILE="Sounds\Male\injurH5.WAV" NAME="MInjur4" GROUP="Male"
#exec AUDIO IMPORT FILE="Sounds\Male\drownM02.WAV" NAME="MDrown1" GROUP="Male"
#exec AUDIO IMPORT FILE="Sounds\Male\gasp02.WAV" NAME="MGasp1" GROUP="Male"
#exec AUDIO IMPORT FILE="Sounds\Male\hgasp1.WAV" NAME="MGasp2" GROUP="Male"
#exec AUDIO IMPORT FILE="Sounds\Male\jump1.WAV" NAME="MJump1" GROUP="Male"
#exec AUDIO IMPORT FILE="Sounds\Male\UWinjur41.WAV" NAME="MUWHit1" GROUP="Male"
#exec AUDIO IMPORT FILE="Sounds\Male\UWinjur42.WAV" NAME="MUWHit2" GROUP="Male"
#exec AUDIO IMPORT FILE="Sounds\Male\lland01.WAV" NAME="lland01" GROUP="Male"

function PlayDying(name DamageType, vector HitLoc)
{
    local vector X,Y,Z, HitVec, HitVec2D;
    local float dotp;
    local carcass carc;

    BaseEyeHeight = Default.BaseEyeHeight;
    PlayDyingSound();
            
    if ( DamageType == 'Suicided' )
    {
        PlayAnim('Dead7', 0.7, 0.1);
        return;
    }

    if ( FRand() < 0.15 )
    {
        PlayAnim('Dead2',0.7,0.1);
        return;
    }

    // check for big hit
    if ( (Velocity.Z > 250) && (FRand() < 0.7) && ((Level.Game == None) || !Level.Game.bVeryLowGore) )
    {
        if ( (hitLoc.Z > Location.Z) && (FRand() < 0.65) )
        {
            PlayAnim('Dead5',0.7,0.1);
            if ( Level.NetMode != NM_Client )
            {
                carc = Spawn(class 'MaleHead',,, Location + CollisionHeight * vect(0,0,0.8), Rotation + rot(3000,0,16384) );
                if (carc != None)
                {
                    carc.Initfor(self);
                    carc.Velocity = Velocity + VSize(Velocity) * VRand();
                    carc.Velocity.Z = FMax(carc.Velocity.Z, Velocity.Z);
                    ViewTarget = carc;
                }
                carc = Spawn(class 'CreatureChunks');
                if (carc != None)
                {
                    carc.Mesh = mesh 'CowBody1';
                    carc.Initfor(self);
                    carc.Velocity = Velocity + VSize(Velocity) * VRand();
                    carc.Velocity.Z = FMax(carc.Velocity.Z, Velocity.Z);
                }
                carc = Spawn(class 'Arm1',,, Location + CollisionHeight * vect(0,0,0.8), Rotation + rot(3000,0,16384) );
                if (carc != None)
                {
                    carc.Initfor(self);
                    carc.Velocity = Velocity + VSize(Velocity) * VRand();
                    carc.Velocity.Z = FMax(carc.Velocity.Z, Velocity.Z);
                }
            }
        }
        else
            PlayAnim('Dead1', 0.7, 0.1);
        return;
    }

    // check for head hit
    if ( ((DamageType == 'Decapitated') || (HitLoc.Z - Location.Z > 0.6 * CollisionHeight))
         && !Level.Game.bVeryLowGore )
    {
        DamageType = 'Decapitated';
        PlayAnim('Dead4', 0.7, 0.1);
        if ( Level.NetMode != NM_Client )
        {
            carc = Spawn(class 'MaleHead',,, Location + CollisionHeight * vect(0,0,0.8), Rotation + rot(3000,0,16384) );
            if (carc != None)
            {
                carc.Initfor(self);
                carc.Velocity = Velocity + VSize(Velocity) * VRand();
                carc.Velocity.Z = FMax(carc.Velocity.Z, Velocity.Z);
                ViewTarget = carc;
            }
        }
        return;
    }

    GetAxes(Rotation,X,Y,Z);
    X.Z = 0;
    HitVec = Normal(HitLoc - Location);
    HitVec2D= HitVec;
    HitVec2D.Z = 0;
    dotp = HitVec2D dot X;
    
    if (Abs(dotp) > 0.71) //then hit in front or back
        PlayAnim('Dead3', 0.7, 0.1);
    else
    {
        dotp = HitVec dot Y;
        if (dotp > 0.0)
            PlayAnim('Dead6', 0.7, 0.1);
        else
            PlayAnim('Dead7', 0.7, 0.1);
    }
}

function PlayGutHit(float tweentime)
{
    if ( (AnimSequence == 'GutHit') || (AnimSequence == 'Dead2') )
    {
        if (FRand() < 0.5)
            TweenAnim('LeftHit', tweentime);
        else
            TweenAnim('RightHit', tweentime);
    }
    else if ( FRand() < 0.6 )
        TweenAnim('GutHit', tweentime);
    else
        TweenAnim('Dead2', tweentime);

}

function PlayHeadHit(float tweentime)
{
    if ( (AnimSequence == 'HeadHit') || (AnimSequence == 'Dead3') )
        TweenAnim('GutHit', tweentime);
    else if ( FRand() < 0.6 )
        TweenAnim('HeadHit', tweentime);
    else
        TweenAnim('Dead3', tweentime);
}

function PlayLeftHit(float tweentime)
{
    if ( (AnimSequence == 'LeftHit') || (AnimSequence == 'Dead6') )
        TweenAnim('GutHit', tweentime);
    else if ( FRand() < 0.6 )
        TweenAnim('LeftHit', tweentime);
    else 
        TweenAnim('Dead6', tweentime);
}

function PlayRightHit(float tweentime)
{
    if ( (AnimSequence == 'RightHit') || (AnimSequence == 'Dead1') )
        TweenAnim('GutHit', tweentime);
    else if ( FRand() < 0.6 )
        TweenAnim('RightHit', tweentime);
    else
        TweenAnim('Dead1', tweentime);
}

defaultproperties
{
     drown=Sound'UnrealShare.Male.MDrown1'
     breathagain=Sound'UnrealShare.Male.MGasp1'
     HitSound3=Sound'UnrealShare.Male.MInjur3'
     HitSound4=Sound'UnrealShare.Male.MInjur4'
     Die2=Sound'UnrealShare.Male.MDeath3'
     Die3=Sound'UnrealShare.Male.MDeath3'
     Die4=Sound'UnrealShare.Male.MDeath4'
     GaspSound=Sound'UnrealShare.Male.MGasp2'
     UWHit1=Sound'UnrealShare.Male.MUWHit1'
     UWHit2=Sound'UnrealShare.Male.MUWHit2'
     LandGrunt=Sound'UnrealShare.Male.lland01'
     CarcassType=Class'UnrealShare.MaleBody'
     JumpSound=Sound'UnrealShare.Male.MJump1'
     HitSound1=Sound'UnrealShare.Male.MInjur1'
     HitSound2=Sound'UnrealShare.Male.MInjur2'
     Die=Sound'UnrealShare.Male.MDeath1'
}

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