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

DeusEx.Gray


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
00186
00187
00188
00189
00190
00191
00192
00193
00194
00195
00196
00197
00198
00199
00200
00201
00202
00203
00204
00205
00206
00207
00208
00209
00210
00211
00212
00213
00214
00215
00216
00217
00218
00219
00220
00221
00222
00223
00224
00225
00226
00227
00228
00229
00230
00231
00232
00233
00234
00235
00236
00237
00238
00239
00240
00241
00242
00243
00244
00245
00246
00247
00248
00249
00250
00251
00252
00253
00254
00255
00256
00257
00258
00259
00260
//=============================================================================
// Gray.
//=============================================================================
class Gray extends Animal;

#exec OBJ LOAD FILE=Ambient

var float damageRadius;
var float damageInterval;
var float damageAmount;
var float damageTime;

// check every damageInterval seconds and damage any player near the gray
function Tick(float deltaTime)
{
    local DeusExPlayer player;

    damageTime += deltaTime;

    if (damageTime >= damageInterval)
    {
        damageTime = 0;
        foreach VisibleActors(class'DeusExPlayer', player, damageRadius)
            if (player != None)
                player.TakeDamage(damageAmount, Self, player.Location, vect(0,0,0), 'Radiation');
    }

    Super.Tick(deltaTime);
}

function ComputeFallDirection(float totalTime, int numFrames,
                              out vector moveDir, out float stopTime)
{
    // Determine direction, and how long to slide
    if (AnimSequence == 'DeathFront')
    {
        moveDir = Vector(DesiredRotation) * Default.CollisionRadius*2.0;
        stopTime = totalTime*0.7;
    }
    else if (AnimSequence == 'DeathBack')
    {
        moveDir = -Vector(DesiredRotation) * Default.CollisionRadius*1.8;
        stopTime = totalTime*0.65;
    }
}

function bool FilterDamageType(Pawn instigatedBy, Vector hitLocation,
                               Vector offset, Name damageType)
{
    // Grays aren't affected by radiation or fire or gas
    if ((damageType == 'Radiation') || (damageType == 'Flamed') || (damageType == 'Burned'))
        return false;
    else if ((damageType == 'TearGas') || (damageType == 'HalonGas') || (damageType == 'PoisonGas'))
        return false;
    else
        return Super.FilterDamageType(instigatedBy, hitLocation, offset, damageType);
}

function GotoDisabledState(name damageType, EHitLocation hitPos)
{
    if (!bCollideActors && !bBlockActors && !bBlockPlayers)
        return;
    else if (damageType == 'Stunned')
        GotoNextState();
    else if (CanShowPain())
        TakeHit(hitPos);
    else
        GotoNextState();
}

function TweenToAttack(float tweentime)
{
    if (Region.Zone.bWaterZone)
        TweenAnimPivot('Tread', tweentime, GetSwimPivot());
    else
        TweenAnimPivot('Attack', tweentime);
}

function PlayAttack()
{
    if ((Weapon != None) && Weapon.IsA('WeaponGraySpit'))
        PlayAnimPivot('Shoot');
    else
        PlayAnimPivot('Attack');
}

function PlayPanicRunning()
{
    PlayRunning();
}

function PlayTurning()
{
    if (Region.Zone.bWaterZone)
        LoopAnimPivot('Tread',,,, GetSwimPivot());
    else
        LoopAnimPivot('Walk', 0.1);
}

function TweenToWalking(float tweentime)
{
    if (Region.Zone.bWaterZone)
        TweenAnimPivot('Tread', tweentime, GetSwimPivot());
    else
        TweenAnimPivot('Walk', tweentime);
}

function PlayWalking()
{
    if (Region.Zone.bWaterZone)
        LoopAnimPivot('Tread',,,, GetSwimPivot());
    else
        LoopAnimPivot('Walk', , 0.15);
}

function TweenToRunning(float tweentime)
{
    if (Region.Zone.bWaterZone)
        TweenAnimPivot('Tread', tweentime, GetSwimPivot());
    else
        LoopAnimPivot('Run',, tweentime);
}

function PlayRunning()
{
    if (Region.Zone.bWaterZone)
        LoopAnimPivot('Tread',,,, GetSwimPivot());
    else
        LoopAnimPivot('Run');
}
function TweenToWaiting(float tweentime)
{
    if (Region.Zone.bWaterZone)
        TweenAnimPivot('Tread', tweentime, GetSwimPivot());
    else
        TweenAnimPivot('BreatheLight', tweentime);
}
function PlayWaiting()
{
    if (Region.Zone.bWaterZone)
        LoopAnimPivot('Tread',,,, GetSwimPivot());
    else
        LoopAnimPivot('BreatheLight', , 0.3);
}

function PlayTakingHit(EHitLocation hitPos)
{
    local vector pivot;
    local name   animName;

    animName = '';
    if (!Region.Zone.bWaterZone)
    {
        switch (hitPos)
        {
            case HITLOC_HeadFront:
            case HITLOC_TorsoFront:
            case HITLOC_LeftArmFront:
            case HITLOC_RightArmFront:
            case HITLOC_LeftLegFront:
            case HITLOC_RightLegFront:
                animName = 'HitFront';
                break;

            case HITLOC_HeadBack:
            case HITLOC_TorsoBack:
            case HITLOC_LeftArmBack:
            case HITLOC_RightArmBack:
            case HITLOC_LeftLegBack:
            case HITLOC_RightLegBack:
                animName = 'HitBack';
                break;
        }
        pivot = vect(0,0,0);
    }

    if (animName != '')
        PlayAnimPivot(animName, , 0.1, pivot);
}

// sound functions
function PlayIdleSound()
{
    if (FRand() < 0.5)
        PlaySound(sound'GrayIdle', SLOT_None);
    else
        PlaySound(sound'GrayIdle2', SLOT_None);
}

function PlayScanningSound()
{
    if (FRand() < 0.3)
    {
        if (FRand() < 0.5)
            PlaySound(sound'GrayIdle', SLOT_None);
        else
            PlaySound(sound'GrayIdle2', SLOT_None);
    }
}

function PlayTargetAcquiredSound()
{
    PlaySound(sound'GrayAlert', SLOT_None);
}

function PlayCriticalDamageSound()
{
    PlaySound(sound'GrayFlee', SLOT_None);
}

defaultproperties
{
     DamageRadius=256.000000
     damageInterval=1.000000
     DamageAmount=10.000000
     bPlayDying=True
     MinHealth=10.000000
     CarcassType=Class'DeusEx.GrayCarcass'
     WalkingSpeed=0.280000
     bCanBleed=True
     CloseCombatMult=0.500000
     ShadowScale=0.750000
     InitialInventory(0)=(Inventory=Class'DeusEx.WeaponGraySwipe')
     InitialInventory(1)=(Inventory=Class'DeusEx.WeaponGraySpit')
     InitialInventory(2)=(Inventory=Class'DeusEx.AmmoGraySpit',Count=9999)
     WalkSound=Sound'DeusExSounds.Animal.GrayFootstep'
     GroundSpeed=350.000000
     WaterSpeed=50.000000
     AirSpeed=144.000000
     AccelRate=500.000000
     BaseEyeHeight=25.000000
     Health=50
     ReducedDamageType=Radiation
     ReducedDamagePct=1.000000
     UnderWaterTime=20.000000
     AttitudeToPlayer=ATTITUDE_Ignore
     HitSound1=Sound'DeusExSounds.Animal.GrayPainSmall'
     HitSound2=Sound'DeusExSounds.Animal.GrayPainLarge'
     Die=Sound'DeusExSounds.Animal.GrayDeath'
     Alliance=Gray
     DrawType=DT_Mesh
     Mesh=LodMesh'DeusExCharacters.Gray'
     AmbientGlow=12
     SoundRadius=14
     SoundVolume=255
     AmbientSound=Sound'Ambient.Ambient.GeigerLoop'
     CollisionRadius=28.540001
     CollisionHeight=36.000000
     LightType=LT_Steady
     LightBrightness=32
     LightHue=96
     LightSaturation=128
     LightRadius=5
     Mass=120.000000
     Buoyancy=97.000000
     BindName="Gray"
     FamiliarName="Gray"
     UnfamiliarName="Gray"
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: Mon 8/11/2021 16:22:52.000 - Creation time: Mon 8/11/2021 16:31:26.675 - Created with UnCodeX