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

DeusEx.DeusExMover


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
00261
00262
00263
00264
00265
00266
00267
00268
00269
00270
00271
00272
00273
00274
00275
00276
00277
00278
00279
00280
00281
00282
00283
00284
00285
00286
00287
00288
00289
00290
00291
00292
00293
00294
00295
00296
00297
00298
00299
00300
00301
00302
00303
00304
00305
00306
00307
00308
00309
00310
00311
00312
00313
00314
00315
00316
00317
00318
00319
00320
00321
00322
00323
00324
00325
00326
00327
00328
00329
00330
00331
00332
00333
00334
00335
00336
00337
00338
00339
00340
00341
00342
00343
00344
00345
00346
00347
00348
00349
00350
00351
00352
00353
00354
00355
00356
00357
00358
00359
00360
00361
00362
00363
00364
00365
00366
00367
00368
00369
00370
00371
00372
00373
00374
00375
00376
00377
00378
00379
00380
00381
00382
00383
00384
00385
00386
00387
00388
00389
00390
00391
00392
00393
00394
00395
00396
00397
00398
00399
00400
00401
00402
00403
00404
00405
00406
00407
00408
00409
00410
00411
00412
00413
00414
00415
00416
00417
00418
00419
00420
00421
00422
00423
00424
00425
00426
00427
00428
00429
00430
00431
00432
00433
00434
00435
00436
00437
00438
00439
00440
00441
00442
00443
00444
00445
00446
00447
00448
00449
00450
00451
00452
00453
00454
00455
00456
00457
00458
00459
00460
00461
00462
00463
00464
00465
00466
00467
00468
00469
00470
00471
00472
00473
00474
00475
00476
00477
00478
00479
00480
00481
00482
00483
00484
00485
00486
00487
00488
00489
00490
00491
00492
00493
00494
00495
00496
00497
00498
00499
00500
00501
00502
00503
00504
00505
00506
00507
00508
00509
00510
00511
00512
00513
00514
00515
00516
00517
00518
00519
00520
00521
00522
00523
00524
00525
00526
00527
00528
00529
00530
00531
00532
00533
00534
00535
00536
00537
00538
00539
00540
00541
00542
00543
00544
00545
00546
00547
00548
00549
00550
00551
00552
00553
00554
00555
00556
00557
00558
00559
00560
00561
00562
00563
00564
00565
00566
00567
00568
00569
00570
00571
00572
00573
00574
00575
00576
00577
00578
00579
00580
00581
00582
00583
00584
00585
00586
00587
00588
00589
00590
00591
00592
00593
00594
00595
00596
00597
00598
00599
00600
00601
00602
00603
00604
00605
00606
00607
00608
00609
00610
00611
00612
00613
00614
00615
00616
00617
00618
00619
00620
00621
00622
00623
00624
00625
00626
00627
00628
00629
00630
00631
00632
00633
00634
00635
00636
00637
00638
00639
00640
00641
00642
00643
00644
00645
00646
00647
00648
00649
00650
00651
00652
00653
00654
00655
00656
00657
00658
00659
00660
00661
00662
00663
00664
00665
00666
00667
00668
00669
00670
00671
00672
00673
00674
00675
00676
00677
00678
00679
00680
00681
00682
00683
00684
00685
00686
00687
00688
00689
00690
00691
00692
00693
00694
00695
00696
00697
00698
00699
00700
00701
00702
00703
00704
00705
00706
00707
00708
00709
00710
00711
00712
00713
00714
00715
00716
00717
00718
00719
00720
00721
00722
00723
00724
00725
00726
00727
00728
00729
00730
00731
00732
00733
00734
00735
00736
00737
00738
00739
00740
00741
00742
00743
00744
00745
00746
00747
00748
00749
00750
00751
00752
00753
00754
00755
00756
00757
00758
//=============================================================================
// DeusExMover.
//=============================================================================
class DeusExMover extends Mover;

var() bool              bOneWay;                // this door can only be opened from one side
var() bool              bLocked;                // this door is locked
var() bool              bPickable;              // this lock can be picked
var() float             lockStrength;           // "toughness" of the lock on this door - 0.0 is easy, 1.0 is hard
var() float          initiallockStrength; // for resetting lock, initial lock strength of door.
var() bool           bInitialLocked;      // for resetting lock
var() bool              bBreakable;             // this door can be destroyed
var() float             doorStrength;           // "toughness" of this door - 0.0 is weak, 1.0 is strong
var() name              KeyIDNeeded;            // key ID code to open the door
var() bool              bHighlight;             // should this door highlight when focused?
var() bool              bFrobbable;             // this door can be frobbed

var bool                bPicking;               // a lockpick is currently being used
var float               pickValue;              // how much this lockpick is currently picking
var float               pickTime;               // how much time it takes to use a single lockpick
var int                 numPicks;               // how many times to reduce hack strength
var float            TicksSinceLastPick; //num ticks done since last pickstrength update(includes partials)
var float            TicksPerPick;       // num ticks needed for a hackstrength update (includes partials)
var float            LastTickTime;       // Time at which last tick occurred.

var DeusExPlayer        pickPlayer;             // the player that is picking
var Lockpick            curPick;                // the lockpick that is being used

var() int               minDamageThreshold;     // damage below this amount doesn't count
var bool                bDestroyed;             // has this mover already been destroyed?

var() int               NumFragments;           // number of fragments to spew on destroy
var() float             FragmentScale;          // scale of fragments
var() int               FragmentSpread;         // distance fragments will be thrown
var() class<Fragment>   FragmentClass;          // which fragment
var() texture           FragmentTexture;        // what texture to use on fragments
var() bool              bFragmentTranslucent;   // are these fragments translucent?
var() bool              bFragmentUnlit;         // are these fragments unlit?
var() sound             ExplodeSound1;          // small explosion sound
var() sound             ExplodeSound2;          // large explosion sound
var() bool              bDrawExplosion;         // should we draw an explosion?
var() bool              bIsDoor;                // is this mover an actual door?

var() float          TimeSinceReset;   // how long since we relocked it
var() float          TimeToReset;      // how long between relocks

var localized string    msgKeyLocked;           // message when key locked door
var localized string    msgKeyUnlocked;         // message when key unlocked door
var localized string    msgLockpickSuccess;     // message when lock is picked
var localized string    msgOneWayFail;          // message when one-way door can't be opened
var localized string    msgLocked;              // message when the door is locked
var localized string    msgPicking;             // message when the door is being picked
var localized string    msgAlreadyUnlocked;     // message when the door is already unlocked
var localized string    msgNoNanoKey;           // message when the player doesn't have the right nanokey

function PostBeginPlay()
{
    Super.PostBeginPlay();

    // keep these within limits
    lockStrength = FClamp(lockStrength, 0.0, 1.0);
    doorStrength = FClamp(doorStrength, 0.0, 1.0);

    if (!bPickable)
        lockStrength = 1.0;
    if (!bBreakable)
        doorStrength = 1.0;

   initiallockStrength = lockStrength;
   TimeSinceReset = 0.0;
   bInitialLocked = bLocked;
}


// -------------------------------------------------------------------------------
// Network Replication
// -------------------------------------------------------------------------------

replication
{
   //Variables server to client
   reliable if (Role == ROLE_Authority)
      bLocked, pickValue, lockStrength, doorStrength;
}

//
// ComputeMovementArea() - Computes a bounding box for the area
//                         in which this mover will move
//
function ComputeMovementArea(out vector center, out vector area)
{
    local int     i, j;
    local float   mult;
    local int     count;
    local vector  box1, box2;
    local vector  minVect;
    local vector  maxVect;
    local vector  newLocation;
    local rotator newRotation;

    if (NumKeys > 0)  // better safe than silly
    {
        // Initialize our bounding box
        GetBoundingBox(box1, box2, false, KeyPos[0]+BasePos, KeyRot[0]+BaseRot);

        // Compute the total area of our bounding box
        for (i=1; i<NumKeys; i++)
        {
            if (KeyRot[i] == KeyRot[i-1])
                count = 1;
            else
                count = 3;
            for (j=0; j<count; j++)
            {
                mult = float(j+1)/count;
                newLocation = BasePos + (KeyPos[i]-KeyPos[i-1])*mult + KeyPos[i-1];
                newRotation = BaseRot + (KeyRot[i]-KeyRot[i-1])*mult + KeyRot[i-1];
                if (GetBoundingBox(minVect, maxVect, false, newLocation, newRotation))
                {
                    // Expand the bounding box
                    box1.X = FMin(FMin(box1.X, maxVect.X), minVect.X);
                    box1.Y = FMin(FMin(box1.Y, maxVect.Y), minVect.Y);
                    box1.Z = FMin(FMin(box1.Z, maxVect.Z), minVect.Z);
                    box2.X = FMax(FMax(box2.X, maxVect.X), minVect.X);
                    box2.Y = FMax(FMax(box2.Y, maxVect.Y), minVect.Y);
                    box2.Z = FMax(FMax(box2.Z, maxVect.Z), minVect.Z);
                }
            }
        }
    }

    // Fallback
    else
    {
        box1 = vect(0,0,0);
        box2 = vect(0,0,0);
    }

    // Compute center/area of the bounding box and return
    center = (box1+box2)/2;
    area = box2 - center;

}

//
// FinishNotify() - overridden from Mover; called when mover has finished moving
//
function FinishNotify()
{
    local Pawn   curPawn;
    local vector box1, box2;
    local vector center, area;
    local float  distX, distY, distZ;
    local float  maxX, maxY, maxZ;
    local float  dist;
    local float  maxDist;
    local vector tempVect;
    local bool   bNotify;

    Super.FinishNotify();

    if ((NumKeys > 0) && (MoverEncroachType == ME_IgnoreWhenEncroach))
    {
        GetBoundingBox(box1, box2, false, KeyPos[KeyNum]+BasePos, KeyRot[KeyNum]+BaseRot);
        center  = (box1+box2)/2;
        area    = box2 - center;
        maxDist = VSize(area)+200;
      // XXXDEUS_EX AMSD Slow Pawn Iterator
        //foreach RadiusActors(Class'Pawn', curPawn, maxDist)
      for (CurPawn = Level.PawnList; CurPawn != None; CurPawn = CurPawn.NextPawn)
        {
         if ((CurPawn != None) && (VSize(CurPawn.Location - Location) < (MaxDist + CurPawn.CollisionRadius)))
         {
            bNotify = false;
            distZ = Abs(center.Z - curPawn.Location.Z);
            maxZ  = area.Z + curPawn.CollisionHeight;
            if (distZ < maxZ)
            {
               distX = Abs(center.X - curPawn.Location.X);
               distY = Abs(center.Y - curPawn.Location.Y);
               maxX  = area.X + curPawn.CollisionRadius;
               maxY  = area.Y + curPawn.CollisionRadius;
               if ((distX < maxX) && (distY < maxY))
               {
                  if ((distX >= area.X) && (distY >= area.Y))
                  {
                     tempVect.X = distX-area.X;
                     tempVect.Y = distY-area.Y;
                     tempVect.Z = 0;
                     if (VSize(tempVect) < CollisionRadius)
                        bNotify = true;
                  }
                  else
                     bNotify = true;
               }
            }
            if (bNotify)
               curPawn.EncroachedByMover(self);
         }
        }
    }
}

//
// DropThings() - drops everything that is based on this mover
//
function DropThings()
{
    local actor A;

    // drop everything that is on us
    foreach BasedActors(class'Actor', A)
        A.SetPhysics(PHYS_Falling);
}

//
// "Destroy" the mover
//
function BlowItUp(Pawn instigatedBy)
{
    local int i;
    local Fragment frag;
    local Actor A;
    local DeusExDecal D;
    local Vector spawnLoc;
    local ExplosionLight light;

    // force the mover to stop
    if (Leader != None)
        Leader.MakeGroupStop();

    Instigator = instigatedBy;

    // trigger our event
    if (Event != '')
        foreach AllActors(class'Actor', A, Event)
            if (A != None)
                A.Trigger(Self, instigatedBy);

    // destroy all effects that are on us
    foreach BasedActors(class'DeusExDecal', D)
        D.Destroy();

    DropThings();

    // get the origin of the mover
    spawnLoc = Location - (PrePivot >> Rotation);

    // spawn some fragments and make a sound
    for (i=0; i<NumFragments; i++)
    {
        frag = Spawn(FragmentClass,,, spawnLoc + FragmentSpread * VRand());
        if (frag != None)
        {
            frag.Instigator = instigatedBy;

            // make the last fragment just drop down so we have something to attach the sound to
            if (i == NumFragments - 1)
                frag.Velocity = vect(0,0,0);
            else
                frag.CalcVelocity(VRand(), FragmentSpread);

            frag.DrawScale = FragmentScale;
            if (FragmentTexture != None)
                frag.Skin = FragmentTexture;
            if (bFragmentTranslucent)
                frag.Style = STY_Translucent;
            if (bFragmentUnlit)
                frag.bUnlit = True;
        }
    }

    // should we draw explosion effects?
    if (bDrawExplosion)
    {
        light = Spawn(class'ExplosionLight',,, spawnLoc);
        if (FragmentSpread < 64)
        {
            Spawn(class'ExplosionSmall',,, spawnLoc);
            if (light != None)
                light.size = 2;
        }
        else if (FragmentSpread < 128)
        {
            Spawn(class'ExplosionMedium',,, spawnLoc);
            if (light != None)
                light.size = 4;
        }
        else
        {
            Spawn(class'ExplosionLarge',,, spawnLoc);
            if (light != None)
                light.size = 8;
        }
    }

    // alert NPCs that I'm breaking
    AISendEvent('LoudNoise', EAITYPE_Audio, 2.0, FragmentSpread * 16);

    MakeNoise(2.0);
    if (frag != None)
    {
        if (NumFragments <= 5)
            frag.PlaySound(ExplodeSound1, SLOT_None, 2.0,, FragmentSpread*256);
        else
            frag.PlaySound(ExplodeSound2, SLOT_None, 2.0,, FragmentSpread*256);
    }

   //DEUS_EX AMSD Mover is dead, make it a dumb proxy so location updates
   RemoteRole = ROLE_DumbProxy;
    SetLocation(Location+vect(0,0,20000));      // move it out of the way
    SetCollision(False, False, False);          // and make it non-colliding
    bDestroyed = True;
}

//
// SupportActor()
//
// Called when somebody lands on us (copied from DeusExDecoration)
//

singular function SupportActor(Actor standingActor)
{
    local float  zVelocity;
    local float  baseMass;
    local float  standingMass;

    zVelocity = standingActor.Velocity.Z;
    // We've been stomped!
    if (zVelocity < -500)
    {
        standingMass = FMax(1, standingActor.Mass);
        baseMass     = FMax(1, Mass);
        TakeDamage((1 - standingMass/baseMass * zVelocity/30),
                   standingActor.Instigator, standingActor.Location, 0.2*standingActor.Velocity, 'stomped');
    }

    if (!bDestroyed)
        standingActor.SetBase(self);
    else
        standingActor.SetPhysics(PHYS_Falling);
}


//
// Copied from Engine.Mover
//
function TakeDamage(int Damage, Pawn instigatedBy, Vector hitlocation, Vector momentum, name damageType)
{
    if (bDestroyed)
        return;

    if ((damageType == 'TearGas') || (damageType == 'PoisonGas') || (damageType == 'HalonGas'))
        return;

    if ((damageType == 'Stunned') || (damageType == 'Radiation'))
        return;

    if ((DamageType == 'EMP') || (DamageType == 'NanoVirus') || (DamageType == 'Shocked'))
        return;

    if (bBreakable)
    {
        // add up the damage
        if (Damage >= minDamageThreshold)
            doorStrength -= Damage * 0.01;
//		else
//			doorStrength -= Damage * 0.001;		// damage below the threshold does 1/10th the damage

        doorStrength = FClamp(doorStrength, 0.0, 1.0);
        if (doorStrength ~= 0.0)
            BlowItUp(instigatedBy);
    }
}

//
// Called every 0.1 seconds while the pick is actually picking
//
function Timer()
{
    local DeusExMover M;

    if (bPicking)
    {
        curPick.PlayUseAnim();

      TicksSinceLastPick += (Level.TimeSeconds - LastTickTime) * 10;
      LastTickTime = Level.TimeSeconds;
      //TicksSinceLastPick = TicksSinceLastPick + 1;
      while (TicksSinceLastPick > TicksPerPick)
      {
         numPicks--;
         lockStrength -= 0.01;
         TicksSinceLastPick = TicksSinceLastPick - TicksPerPick;      
         lockStrength = FClamp(lockStrength, 0.0, 1.0);
      }

        // pick all like-tagged movers at once (for double doors and such)
        if ((Tag != '') && (Tag != 'DeusExMover'))
            foreach AllActors(class'DeusExMover', M, Tag)
                if (M != Self)
                    M.lockStrength = lockStrength;

        // did we unlock it?
        if (lockStrength ~= 0.0)
        {
            lockStrength = 0.0;
            bLocked = False;
         TimeSinceReset = 0.0;

            // unlock all like-tagged movers at once (for double doors and such)
            if ((Tag != '') && (Tag != 'DeusExMover'))
                foreach AllActors(class'DeusExMover', M, Tag)
                    if (M != Self)
                    {
                        M.bLocked = False;
                        M.TimeSinceReset = 0;
                        M.lockStrength = 0.0;
                    }

            pickPlayer.ClientMessage(msgLockpickSuccess);
            StopPicking();
        }

        // are we done with this pick?
        else if (numPicks <= 0)
            StopPicking();

        // check to see if we've moved too far away from the door to continue
        else if (pickPlayer.frobTarget != Self)
            StopPicking();

        // check to see if we've put the lockpick away
        else if (pickPlayer.inHand != curPick)
            StopPicking();
    }
}

//
// Called to deal with resetting the device
//
function Tick(float deltaTime)
{
   TimeSinceReset = TimeSinceReset + deltaTime;
   //only reset in multiplayer, if we aren't picking it, and if it has been completely unlocked
   if ((!bPicking) && (Level.NetMode != NM_Standalone) && (lockStrength == 0.0) && !(bLocked))
   {
      if (TimeSinceReset > TimeToReset)
      {
         lockStrength = initiallockStrength;
         TimeSinceReset = 0.0;
         if (lockStrength > 0)
         {
             //Force door closed and locked appropriately.
             DoClose();
             bLocked = bInitialLocked;
         }
      }
   }
   // In multi, force it closed if locked.  Keep trying until it closes.
   if ((Level.NetMode != NM_Standalone) && (bLocked) && (KeyNum != 0))
       DoClose();
   Super.Tick(deltaTime);
}

//
// Stops the current pick-in-progress
//
function StopPicking()
{
    // alert NPCs that I'm not messing with stuff anymore
    AIEndEvent('MegaFutz', EAITYPE_Visual);
    bPicking = False;
    if (curPick != None)
    {
        curPick.StopUseAnim();
        curPick.bBeingUsed = False;
        curPick.UseOnce();
    }
    curPick = None;
    SetTimer(0.1, False);
}

//
// The main logic function for doors
//
function Frob(Actor Frobber, Inventory frobWith)
{
    local Pawn P;
    local DeusExPlayer Player;
    local bool bOpenIt, bDone;
    local string msg;
    local Vector X, Y, Z;
    local float dotp;
    local DeusExMover M;

    // if we shouldn't be frobbed, get out
    if (!bFrobbable)
        return;

    // if we are destroyed, don't do anything
    if (bDestroyed)
        return;

    // make sure we frob our leader if we are a slave
    if (bSlave)
        if (Leader != None)
            Leader.Frob(Frobber, frobWith);

    P = Pawn(Frobber);
    Player = DeusExPlayer(P);
    bOpenIt = False;
    bDone = False;
    msg = msgLocked;

    // make sure someone is trying to open the door
    if (P == None)
        return;

    // ugly hack, so animals can't open doors
    if (P.IsA('Animal'))
        return;

    // Let any non-player pawn open any door for now
    if (Player == None)
    {
        bOpenIt = True;
        msg = "";
        bDone = True;
    }

    // If we are already trying to pick it, print a message
    if (bPicking)
    {
        msg = msgPicking;
        bDone = True;
    }

    // If the door is not closed, it can always be closed no matter what
    if ((KeyNum != 0) || (PrevKeyNum != 0))
    {
        bOpenIt = True;
        msg = "";
        bDone = True;
    }

    // check to see if this is a one-way door
    if (!bDone && bOneWay)
    {
        GetAxes(Rotation, X, Y, Z);
        dotp = (Location - Frobber.Location) dot X;

        // if we're on the wrong side of the door, then don't open
        if (dotp > 0.0)
        {
            bOpenIt = False;
            msg = msgOneWayFail;
            bDone = True;
        }
    }

    //
    // If the door is locked, the player must do one of the following to open it
    // without triggers or explosions:
    // 1. Use the KeyIDNeeded 
    // 2. Use the Lockpick and SkillLockpicking
    //
    if (!bDone)
    {
        // Get what's in the player's hand
        if (frobWith != None)
        {
            // check for the use of lockpicks
            if (bPickable && frobWith.IsA('Lockpick') && (Player.SkillSystem != None))
            {
                if (bLocked)
                {
                    // alert NPCs that I'm messing with stuff
                    AIStartEvent('MegaFutz', EAITYPE_Visual);

                    pickValue = Player.SkillSystem.GetSkillLevelValue(class'SkillLockpicking');
                    pickPlayer = Player;
                    curPick = LockPick(frobWith);
                    curPick.bBeingUsed = True;
                    curPick.PlayUseAnim();
                    bPicking = True;
               //DEUS_EX AMSD In multiplayer, slow it down further at low skill levels
               numPicks = PickValue * 100;
               if (Level.Netmode != NM_Standalone)
                  pickTime = default.pickTime / (pickValue * pickValue);
               TicksPerPick = (PickTime * 10.0) / numPicks;
               LastTickTime = Level.TimeSeconds;
               TicksSinceLastPick = 0;
                    SetTimer(0.1, True);
                    msg = msgPicking;
                }
                else
                {
                    msg = msgAlreadyUnlocked;
                }
            }
            else if ((KeyIDNeeded != '') && frobWith.IsA('NanoKeyRing') && (lockStrength > 0.0))
            {
                // check for the correct key use
                NanoKeyRing(frobWith).PlayUseAnim();
                if (NanoKeyRing(frobWith).HasKey(KeyIDNeeded))
                {
                    bLocked = !bLocked;     // toggle the lock state
                    TimeSinceReset = 0;

                    // toggle the lock state for all like-tagged movers at once (for double doors and such)
                    if ((Tag != '') && (Tag != 'DeusExMover'))
                        foreach AllActors(class'DeusExMover', M, Tag)
                            if (M != Self)
                            {
                                M.bLocked = !M.bLocked;
                                M.TimeSinceReset = 0;
                            }

                    bOpenIt = False;
                    if (bLocked)
                        msg = msgKeyLocked;
                    else
                        msg = msgKeyUnlocked;
                }
                else if (bLocked)
                {
                    bOpenIt = False;
                    msg = msgNoNanoKey;
                }
                else
                {
                    msg = msgAlreadyUnlocked;
                }
            }
            else if (!bLocked)
            {
                bOpenIt = True;
                msg = "";
            }
        }
        else if (!bLocked)
        {
            bOpenIt = True;
            msg = "";
        }
    }

    // give the player a message
    if ((Player != None) && (msg != ""))
        Player.ClientMessage(msg);

    // open it!
    if (bOpenIt)
    {
        Super.Frob(Frobber, frobWith);
        Trigger(Frobber, P);

        // trigger all like-tagged movers at once (for double doors and such)
        if ((Tag != '') && (Tag != 'DeusExMover'))
            foreach AllActors(class'DeusExMover', M, Tag)
                if (M != Self)
                    M.Trigger(Frobber, P);
    }
}

function DoOpen()
{
    local DeusExMover M;
    if (Level.NetMode != NM_Standalone)
    {
        // In multiplayer, unlock doors that get opened.
        // toggle the lock state for all like-tagged movers at once (for double doors and such)
        bLocked = false;
        TimeSinceReset = 0;
        lockStrength = 0.0;
        if ((Tag != '') && (Tag != 'DeusExMover'))
            foreach AllActors(class'DeusExMover', M, Tag)
            if (M != Self)
            {
                M.bLocked = false;
                M.TimeSinceReset = 0;
                M.lockStrength = 0;
            }
    }
    Super.DoOpen();
}

//
// make sure we can't be triggered after we've been destroyed
//
state() TriggerOpenTimed
{
    function Trigger( actor Other, pawn EventInstigator )
    {
        if (!bDestroyed)
            Super.Trigger(Other, EventInstigator);
    }
}

state() TriggerToggle
{
    function Trigger( actor Other, pawn EventInstigator )
    {
        if (!bDestroyed)
            Super.Trigger(Other, EventInstigator);
    }
}

state() TriggerControl
{
    function Trigger( actor Other, pawn EventInstigator )
    {
        if (!bDestroyed)
            Super.Trigger(Other, EventInstigator);
    }
}

state() TriggerPound
{
    function Trigger( actor Other, pawn EventInstigator )
    {
        if (!bDestroyed)
            Super.Trigger(Other, EventInstigator);
    }
}

defaultproperties
{
     bPickable=True
     lockStrength=0.200000
     doorStrength=0.250000
     bHighlight=True
     bFrobbable=True
     pickTime=4.000000
     minDamageThreshold=10
     NumFragments=16
     FragmentScale=2.000000
     FragmentSpread=32
     FragmentClass=Class'DeusEx.WoodFragment'
     ExplodeSound1=Sound'DeusExSounds.Generic.WoodBreakSmall'
     ExplodeSound2=Sound'DeusExSounds.Generic.WoodBreakLarge'
     TimeToReset=28.000000
     msgKeyLocked="Your NanoKey Ring locked it"
     msgKeyUnlocked="Your NanoKey Ring unlocked it"
     msgLockpickSuccess="You picked the lock"
     msgOneWayFail="It won't open from this side"
     msgLocked="It's locked"
     msgPicking="Picking the lock..."
     msgAlreadyUnlocked="It's already unlocked"
     msgNoNanoKey="Your NanoKey Ring doesn't have the right code"
     MoverEncroachType=ME_StopWhenEncroach
     BumpType=BT_PawnBump
     bBlockSight=True
     InitialState=TriggerToggle
     bDirectional=True
}

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