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

DeusEx.AugmentationDisplayWindow


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
00759
00760
00761
00762
00763
00764
00765
00766
00767
00768
00769
00770
00771
00772
00773
00774
00775
00776
00777
00778
00779
00780
00781
00782
00783
00784
00785
00786
00787
00788
00789
00790
00791
00792
00793
00794
00795
00796
00797
00798
00799
00800
00801
00802
00803
00804
00805
00806
00807
00808
00809
00810
00811
00812
00813
00814
00815
00816
00817
00818
00819
00820
00821
00822
00823
00824
00825
00826
00827
00828
00829
00830
00831
00832
00833
00834
00835
00836
00837
00838
00839
00840
00841
00842
00843
00844
00845
00846
00847
00848
00849
00850
00851
00852
00853
00854
00855
00856
00857
00858
00859
00860
00861
00862
00863
00864
00865
00866
00867
00868
00869
00870
00871
00872
00873
00874
00875
00876
00877
00878
00879
00880
00881
00882
00883
00884
00885
00886
00887
00888
00889
00890
00891
00892
00893
00894
00895
00896
00897
00898
00899
00900
00901
00902
00903
00904
00905
00906
00907
00908
00909
00910
00911
00912
00913
00914
00915
00916
00917
00918
00919
00920
00921
00922
00923
00924
00925
00926
00927
00928
00929
00930
00931
00932
00933
00934
00935
00936
00937
00938
00939
00940
00941
00942
00943
00944
00945
00946
00947
00948
00949
00950
00951
00952
00953
00954
00955
00956
00957
00958
00959
00960
00961
00962
00963
00964
00965
00966
00967
00968
00969
00970
00971
00972
00973
00974
00975
00976
00977
00978
00979
00980
00981
00982
00983
00984
00985
00986
00987
00988
00989
00990
00991
00992
00993
00994
00995
00996
00997
00998
00999
01000
01001
01002
01003
01004
01005
01006
01007
01008
01009
01010
01011
01012
01013
01014
01015
01016
01017
01018
01019
01020
01021
01022
01023
01024
01025
01026
01027
01028
01029
01030
01031
01032
01033
01034
01035
01036
01037
01038
01039
01040
01041
01042
01043
01044
01045
01046
01047
01048
01049
01050
01051
01052
01053
01054
01055
01056
01057
01058
01059
01060
01061
01062
01063
01064
01065
01066
01067
01068
01069
01070
01071
01072
01073
01074
01075
01076
01077
01078
01079
01080
01081
01082
01083
01084
01085
01086
01087
01088
01089
01090
01091
01092
01093
01094
01095
01096
01097
01098
01099
01100
01101
01102
01103
01104
01105
01106
01107
01108
01109
01110
01111
01112
01113
01114
01115
01116
01117
01118
01119
01120
01121
01122
01123
01124
01125
01126
01127
01128
01129
01130
01131
01132
01133
01134
01135
01136
01137
01138
01139
01140
01141
01142
01143
01144
01145
01146
01147
01148
01149
01150
01151
01152
01153
01154
01155
01156
01157
01158
01159
01160
01161
01162
01163
01164
01165
01166
01167
01168
01169
01170
01171
01172
01173
01174
01175
01176
01177
01178
01179
01180
01181
01182
01183
01184
01185
01186
01187
01188
01189
01190
01191
01192
01193
01194
01195
01196
01197
01198
01199
01200
01201
01202
01203
01204
01205
01206
01207
01208
01209
01210
01211
01212
01213
01214
01215
01216
01217
01218
01219
01220
01221
01222
01223
01224
01225
01226
01227
01228
01229
01230
01231
01232
01233
01234
01235
01236
01237
01238
01239
01240
01241
01242
01243
01244
01245
01246
01247
01248
01249
01250
01251
01252
01253
01254
01255
01256
01257
01258
01259
01260
01261
01262
01263
01264
01265
01266
01267
01268
01269
01270
01271
01272
01273
01274
01275
01276
01277
01278
01279
01280
01281
01282
01283
01284
01285
01286
01287
01288
01289
01290
01291
01292
01293
01294
01295
01296
01297
01298
01299
01300
01301
01302
01303
01304
01305
01306
01307
01308
01309
01310
01311
01312
01313
01314
01315
01316
01317
01318
01319
01320
01321
01322
01323
01324
01325
01326
01327
01328
01329
01330
01331
01332
01333
01334
01335
01336
01337
01338
01339
01340
01341
01342
01343
01344
01345
01346
01347
01348
01349
01350
01351
01352
01353
01354
01355
01356
01357
01358
01359
01360
01361
01362
01363
01364
01365
01366
01367
01368
01369
01370
01371
01372
01373
01374
01375
01376
01377
01378
01379
01380
01381
01382
01383
01384
01385
01386
01387
01388
01389
01390
01391
01392
01393
01394
01395
01396
01397
01398
01399
01400
01401
01402
01403
01404
01405
01406
01407
01408
01409
01410
01411
01412
01413
01414
01415
01416
01417
01418
01419
01420
01421
01422
01423
01424
01425
01426
01427
01428
01429
01430
01431
01432
01433
01434
01435
01436
01437
01438
01439
01440
01441
01442
01443
01444
01445
01446
01447
01448
01449
01450
01451
01452
01453
01454
01455
01456
01457
01458
01459
01460
01461
01462
01463
01464
01465
01466
01467
01468
01469
01470
01471
01472
01473
01474
01475
01476
01477
01478
01479
01480
01481
01482
01483
01484
01485
01486
01487
01488
01489
01490
01491
01492
01493
01494
01495
01496
01497
01498
01499
01500
01501
01502
01503
01504
01505
01506
01507
01508
01509
01510
01511
01512
01513
01514
01515
01516
01517
01518
01519
01520
01521
01522
01523
01524
01525
01526
01527
01528
01529
01530
01531
01532
01533
01534
01535
01536
01537
01538
01539
01540
01541
01542
01543
01544
01545
01546
01547
01548
01549
01550
01551
01552
01553
01554
01555
01556
01557
01558
01559
01560
01561
01562
01563
01564
01565
01566
01567
01568
01569
01570
01571
01572
01573
01574
01575
01576
01577
01578
01579
01580
01581
01582
01583
01584
01585
01586
01587
01588
01589
01590
01591
01592
01593
01594
01595
01596
01597
01598
01599
01600
01601
01602
01603
01604
01605
01606
01607
01608
01609
01610
01611
01612
01613
//=============================================================================
// AugmentationDisplayWindow.
//=============================================================================
class AugmentationDisplayWindow extends HUDBaseWindow;

var ViewportWindow winZoom;
var float margin;
var float corner;

var bool bDefenseActive;
var int defenseLevel;
var DeusExProjectile defenseTarget;

var ViewportWindow winDrone;
var bool bDroneCreated;
var bool bDroneReferenced;
//var SpyDrone aDrone;		// MBCODE: Took this out and moved it to DeusExPlayer since the server
                                    // has no idea about these windows or the drone (needed for multiplayer).

var bool bTargetActive;
var int targetLevel;
var Actor lastTarget;
var float lastTargetTime;

var bool bVisionActive;
var int visionLevel;
var float visionLevelValue;
var int activeCount;

var localized String msgRange;
var localized String msgRangeUnits;
var localized String msgHigh;
var localized String msgMedium;
var localized String msgLow;
var localized String msgHealth;
var localized String msgOverall;
var localized String msgPercent;
var localized String msgHead;
var localized String msgTorso;
var localized String msgLeftArm;
var localized String msgRightArm;
var localized String msgLeftLeg;
var localized String msgRightLeg;
var localized String msgLegs;
var localized String msgWeapon;
var localized String msgNone;
var localized String msgScanning1;
var localized String msgScanning2;
var localized String msgADSTracking;
var localized String msgADSDetonating;
var localized String msgBehind;
var localized String msgDroneActive;
var localized String msgEnergyLow;
var localized String msgCantLaunch;
var localized String msgLightAmpActive;
var localized String msgIRAmpActive;
var localized String msgNoImage;
var localized String msgDisabled;
var localized String SpottedTeamString;
var localized String YouArePoisonedString;
var localized String YouAreBurnedString;
var localized String TurretInvincibleString;
var localized String CameraInvincibleString;
var localized String NeutBurnPoisonString;
var localized String    OnlyString;
var localized String KillsToGoString;
var localized String KillToGoString;
var localized String    LessThanMinuteString;
var localized String    LessThanXString1;
var localized String    LessThanXString2;
var localized String    LeadsMatchString;
var localized String    TiedMatchString;
var localized String WillWinMatchString;
var localized String OutOfRangeString;
var localized String LostLegsString;
var localized String DropItem1String;
var localized String DropItem2String;
var localized String msgTeammateHit, msgTeamNsf, msgTeamUnatco;
var localized String    UseString;
var localized String    TeamTalkString;
var localized String    TalkString;
var localized String YouKilledTeammateString;
var localized String TeamLAMString;
var localized String TeamComputerString;
var localized String NoCloakWeaponString;
var localized String TeamHackTurretString;
var localized String KeyNotBoundString;

var localized String OutOfAmmoString;
var float OutOfAmmoTime;

var Actor VisionBlinder; //So the same thing doesn't blind me twice.

var int VisionTargetStatus; //For picking see through wall texture
const VISIONENEMY = 1;
const VISIONALLY = 2;
const VISIONNEUTRAL = 0;

// Show name of player in multiplayer on a timer
var String  targetPlayerName;                   // Player's name in targeting reticle
var String  targetPlayerHealthString;     // Target player's health (for targeting aug)'
var String  targetPlayerLocationString;   // Point on target player at which you are aiming (For multiplayer)
var float   targetPlayerTime;                   // Timer
var float   targetRangeTime;
var color   targetPlayerColor;              // Color red or green
var bool        targetOutOfRange;                   // Is target out of range with current weapon
const           targetPlayerDelay       = 3;            // Delay in seconds until name is not displayed
const           targetPlayerXMul        = 0.08;
const           targetPlayerYMul        = 0.79;

var String  keyDropItem, keyTalk, keyTeamTalk;

var Color   colRed, colGreen, colWhite;


// ----------------------------------------------------------------------
// InitWindow()
// ----------------------------------------------------------------------

event InitWindow()
{
    Super.InitWindow();
    bTickEnabled = True;
    Lower();
    RefreshMultiplayerKeys();
}

// ----------------------------------------------------------------------
// TraceLOS()
// ----------------------------------------------------------------------

function Actor TraceLOS(float checkDist, out vector HitLocation)
{
    local Actor target;
    local Vector HitLoc, HitNormal, StartTrace, EndTrace;

    target = None;

    // figure out how far ahead we should trace
    StartTrace = Player.Location;
    EndTrace = Player.Location + (Vector(Player.ViewRotation) * checkDist);

    // adjust for the eye height
    StartTrace.Z += Player.BaseEyeHeight;
    EndTrace.Z += Player.BaseEyeHeight;

    // find the object that we are looking at
    // make sure we don't select the object that we're carrying
    foreach Player.TraceActors(class'Actor', target, HitLoc, HitNormal, EndTrace, StartTrace)
    {
        if (target.IsA('Pawn') || target.IsA('DeusExDecoration') || target.IsA('ThrownProjectile') ||
            (target.IsA('DeusExMover') && DeusExMover(target).bBreakable))
        {
            if (target != Player.CarriedDecoration)
            {
                if ( (Player.Level.NetMode != NM_Standalone) && target.IsA('DeusExPlayer') )
                {
                    if ( DeusExPlayer(target).AdjustHitLocation( HitLoc, EndTrace - StartTrace ) )
                        break;
                    else
                        target = None;
                }
                else
                    break;
            }
        }
    }

    HitLocation = HitLoc;

    return target;
}

// ----------------------------------------------------------------------
// Interpolate()
// ----------------------------------------------------------------------

function Interpolate(GC gc, float fromX, float fromY, float toX, float toY, int power)
{
    local float xPos, yPos;
    local float deltaX, deltaY;
    local float maxDist;
    local int   points;
    local int   i;

    maxDist = 16;

    points = 1;
    deltaX = (toX-fromX);
    deltaY = (toY-fromY);
    while (power >= 0)
    {
        if ((deltaX >= maxDist) || (deltaX <= -maxDist) || (deltaY >= maxDist) || (deltaY <= -maxDist))
        {
            deltaX *= 0.5;
            deltaY *= 0.5;
            points *= 2;
            power--;
        }
        else
            break;
    }

    xPos = fromX + ((Player.Level.TimeSeconds % 0.5) * deltaX * 2);
    yPos = fromY + ((Player.Level.TimeSeconds % 0.5) * deltaY * 2);
    for (i=0; i<points-1; i++)
    {
        xPos += deltaX;
        yPos += deltaY;
        gc.DrawPattern(xPos, yPos, 2, 2, 0, 0, Texture'Solid');
    }
}

// ----------------------------------------------------------------------
// ConfigurationChanged()
// ----------------------------------------------------------------------

function ConfigurationChanged()
{
    local float x, y, w, h, cx, cy;

    if ((winDrone != None) || (winZoom != None))
    {
        w = width/4;
        h = height/4;
        cx = width/8 + margin;
        cy = height/2;
        x = cx - w/2;
        y = cy - h/2;

        if (winDrone != None)
            winDrone.ConfigureChild(x, y, w, h);

        if (winZoom != None)
            winZoom.ConfigureChild(x, y, w, h);
    }
}

// ----------------------------------------------------------------------
// ChildRequestedReconfiguration()
// ----------------------------------------------------------------------

function bool ChildRequestedReconfiguration(Window childWin)
{
    ConfigurationChanged();

    return True;
}

// ----------------------------------------------------------------------
// RefreshMultiplayerKeys()
// ----------------------------------------------------------------------
function RefreshMultiplayerKeys()
{
    local String Alias, keyName;
    local int i;

    for ( i = 0; i < 255; i++ )
    {
        keyName = player.ConsoleCommand ( "KEYNAME "$i );
        if ( keyName != "" )
        {
            Alias = player.ConsoleCommand( "KEYBINDING "$keyName );
            if ( Alias ~= "DropItem" )
                keyDropItem = keyName;
            else if ( Alias ~= "Talk" )
                keyTalk = keyName;
            else if ( Alias ~= "TeamTalk" )
                keyTeamTalk = keyName;
        }
    }
    if ( keyDropItem ~= "" )
        keyDropItem = KeyNotBoundString;
    if ( keyTalk ~= "" )
        keyTalk = KeyNotBoundString;
    if ( keyTeamTalk ~= "" )
        keyTeamTalk = KeyNotBoundString;
}


// ----------------------------------------------------------------------
// Tick()
// ----------------------------------------------------------------------

function Tick(float deltaTime)
{
    // check for the drone ViewportWindow being constructed
    if (Player.bSpyDroneActive && (Player.aDrone != None) && (winDrone == None) && 
        (Player.PlayerIsClient() || (Player.Level.NetMode==NM_Standalone)) )
    {
        winDrone = ViewportWindow(NewChild(class'ViewportWindow'));
        if (winDrone != None)
        {
            winDrone.AskParentForReconfigure();
            winDrone.Lower();
            winDrone.SetViewportActor(Player.aDrone);
        }
    }

    // check for the target ViewportWindow being constructed
    if (bTargetActive && (targetLevel > 2) && (winZoom == None) && (lastTarget != None) && (Player.Level.NetMode == NM_Standalone))
    {
        winZoom = ViewportWindow(NewChild(class'ViewportWindow'));
        if (winZoom != None)
        {
            winZoom.AskParentForReconfigure();
            winZoom.Lower();
        }
    }

    // handle Destroy() in Tick() since they can't be in DrawWindow()
    if (!Player.bSpyDroneActive)
    {
        if (winDrone != None)
        {
            winDrone.Destroy();
            winDrone = None;
        }
        if ((Player.aDrone != None) && IsActorValid(Player.aDrone))
        {
            RemoveActorRef(Player.aDrone);
            bDroneReferenced = false;
        }
        bDroneCreated = false;
    }

    if (winZoom != None)
    {
        if ((bTargetActive && (lastTarget == None)) || !bTargetActive)
        {
            winZoom.Destroy();
            winZoom = None;
        }
    }
}

// ----------------------------------------------------------------------
// PostDrawWindow()
// ----------------------------------------------------------------------

function PostDrawWindow(GC gc)
{
    local PlayerPawn pp;

    pp = Player.GetPlayerPawn();

   //DEUS_EX AMSD Draw vision first so that everything else doesn't get washed green
    if (bVisionActive)
        DrawVisionAugmentation(gc);

    if ( Player.Level.NetMode != NM_Standalone )
        DrawMiscStatusMessages( gc );

    if (bDefenseActive)
        DrawDefenseAugmentation(gc);

    if (Player.bSpyDroneActive)
        DrawSpyDroneAugmentation(gc);

   // draw IFF and accuracy information all the time, return False if target aug is not active
    DrawTargetAugmentation(gc);

   gc.SetFont(Font'FontMenuSmall_DS');
    gc.SetTextColor(colHeaderText);
    gc.SetStyle(DSTY_Normal);
    gc.SetTileColor(colBorder);

   if ( (pp != None) && (pp.bShowScores) )
    {
        if ( DeathMatchGame(Player.DXGame) != None )
            DeathMatchGame(Player.DXGame).ShowDMScoreboard( Player, gc, width, height );
        else if ( TeamDMGame(Player.DXGame) != None )
            TeamDMGame(Player.DXGame).ShowTeamDMScoreboard( Player, gc, width, height );
    }
}

// ----------------------------------------------------------------------
// DrawDefenseAugmentation()
// ----------------------------------------------------------------------

function DrawDefenseAugmentation(GC gc)
{
    local String str;
    local float boxCX, boxCY;
    local float x, y, w, h, mult;
    local bool bDrawLine;

    if (defenseTarget != None)
    {
        bDrawLine = False;

        if (defenseTarget.IsInState('Exploding'))
        {
            str = msgADSDetonating;
            bDrawLine = True;
        }
        else
            str = msgADSTracking;

        mult = VSize(defenseTarget.Location - Player.Location);
        str = str $ CR() $ msgRange @ Int(mult/16) @ msgRangeUnits;

        if (!ConvertVectorToCoordinates(defenseTarget.Location, boxCX, boxCY))
            str = str @ msgBehind;

        gc.GetTextExtent(0, w, h, str);
        x = boxCX - w/2;
        y = boxCY - h;
        gc.SetTextColorRGB(255,0,0);
        gc.DrawText(x, y, w, h, str);
        gc.SetTextColor(colHeaderText);

        if (bDrawLine)
        {
            gc.SetTileColorRGB(255,0,0);
            Interpolate(gc, width/2, height/2, boxCX, boxCY, 64);
            gc.SetTileColor(colHeaderText);
        }
    }
}

// ----------------------------------------------------------------------
// DrawSpyDroneAugmentation()
// ----------------------------------------------------------------------

function DrawSpyDroneAugmentation(GC gc)
{
    local String str;
    local float boxCX, boxCY, boxTLX, boxTLY, boxBRX, boxBRY, boxW, boxH;
    local float x, y, w, h, mult;
    local Vector loc;

    // set the coords of the drone window
    boxW = width/4;
    boxH = height/4;
    boxCX = width/8 + margin;
    boxCY = height/2;
    boxTLX = boxCX - boxW/2;
    boxTLY = boxCY - boxH/2;
    boxBRX = boxCX + boxW/2;
    boxBRY = boxCY + boxH/2;

    if (winDrone != None)
    {
        DrawDropShadowBox(gc, boxTLX, boxTLY, boxW, boxH);

        str = msgDroneActive;
        gc.GetTextExtent(0, w, h, str);
        x = boxCX - w/2;
        y = boxTLY - h - margin;
        gc.DrawText(x, y, w, h, str);

        // print a low energy warning message
        if ((Player.Energy / Player.Default.Energy) < 0.2)
        {
            str = msgEnergyLow;
            gc.GetTextExtent(0, w, h, str);
            x = boxCX - w/2;
            y = boxTLY + margin;
            gc.SetTextColorRGB(255,0,0);
            gc.DrawText(x, y, w, h, str);
            gc.SetTextColor(colHeaderText);
        }
    }
    // Since drone is created on server, they is a delay in when it will actually show up on the client
    // the flags dronecreated and drone referenced negotiate this timing
    if ( !bDroneCreated )   
    {
        if (Player.aDrone == None)
        {
            bDroneCreated = true;
            Player.CreateDrone();
        }
    }
    else if ( !bDroneReferenced )
    {
        if ( Player.aDrone != None )
        {
            bDroneReferenced = true;
            AddActorRef( Player.aDrone );
        }
    }
}

//-------------------------------------------------------------------------------------------------
// TopCentralMessage()
//-------------------------------------------------------------------------------------------------

function float TopCentralMessage( GC gc, String str, color textColor )
{
    local float x, y, w, h;

    gc.SetFont(Font'FontMenuTitle');
    gc.GetTextExtent( 0, w, h, str );
    gc.SetTextColor( textColor );
    x = (width * 0.5) - (w * 0.5);
    y = height * 0.33;
    DrawFadedText( gc, x, y, textColor, str );
    return( y + h );
}

// ----------------------------------------------------------------------
// DrawFadedText()
// ----------------------------------------------------------------------
function DrawFadedText( GC gc, float x, float y, Color msgColor, String msg )
{
    local Color adj;
    local float mul, w, h;

    EnableTranslucentText(True);
    gc.SetStyle(DSTY_Translucent);
    mul = FClamp( (Player.mpMsgTime - Player.Level.Timeseconds)/Player.mpMsgDelay, 0.0, 1.0 );
    adj.r = mul * msgColor.r;
    adj.g = mul * msgColor.g;
    adj.b = mul * msgColor.b;
    gc.SetTextColor(adj);
    gc.GetTextExtent( 0, w, h, msg );
    gc.DrawText( x, y, w, h, msg );
    gc.SetStyle(DSTY_Normal);
    EnableTranslucentText(False);
}

// ----------------------------------------------------------------------
// DrawMiscStatusMessages()
// ----------------------------------------------------------------------
function DrawMiscStatusMessages( GC gc )
{
    local DeusExWeapon weap;
    local float x, y, w, h, cury;
    local Color msgColor;
    local String str;
    local bool bNeutralMsg;
    local String dropKeyName, keyName;
    local int i;

    bNeutralMsg = False;

    if (( Player.Level.Timeseconds < Player.mpMsgTime ) && !Player.bShowScores )
    {
        msgColor = colGreen;

        switch( Player.mpMsgCode )
        {
            case Player.MPMSG_TeamUnatco:
                str = msgTeamUnatco;
                cury = TopCentralMessage( gc, str, msgColor );
                if ( keyTalk ~= KeyNotBoundString )
                    RefreshMultiplayerKeys();
                str = UseString $ keyTalk $ TalkString;
                gc.GetTextExtent( 0, w, h, str );
                cury += h;
                DrawFadedText( gc, (width * 0.5) - (w * 0.5), cury, msgColor, str );
                if ( TeamDMGame(Player.DXGame) != None )
                {
                    cury += h;
                    if ( keyTeamTalk ~= KeyNotBoundString )
                        RefreshMultiplayerKeys();
                    str = UseString $ keyTeamTalk $ TeamTalkString;
                    gc.GetTextExtent( 0, w, h, str );
                    DrawFadedText( gc, (width * 0.5) - (w * 0.5), cury, msgColor, str );
                }
                break;
            case Player.MPMSG_TeamNsf:
                str = msgTeamNsf;
                cury = TopCentralMessage( gc, str, msgColor );
                if ( keyTalk ~= KeyNotBoundString )
                    RefreshMultiplayerKeys();
                str = UseString $ keyTalk $ TalkString;
                gc.GetTextExtent( 0, w, h, str );
                cury += h;
                DrawFadedText( gc, (width * 0.5) - (w * 0.5), cury, msgColor, str );
                if ( TeamDMGame(Player.DXGame) != None )
                {
                    cury += h;
                    if ( keyTeamTalk ~= KeyNotBoundString )
                        RefreshMultiplayerKeys();
                    str = UseString $ keyTeamTalk $ TeamTalkString;
                    gc.GetTextExtent( 0, w, h, str );
                    DrawFadedText( gc, (width * 0.5) - (w * 0.5), cury, msgColor, str );
                }
                break;
            case Player.MPMSG_TeamHit:
                msgColor = colRed;
                str = msgTeammateHit;
                TopCentralMessage( gc, str, msgColor );
                break;
            case Player.MPMSG_TeamSpot:
                str = SpottedTeamString;
                TopCentralMessage( gc, str, msgColor );
                break;
            case Player.MPMSG_FirstPoison:
                str = YouArePoisonedString;
                cury = TopCentralMessage( gc, str, msgColor );
                gc.GetTextExtent( 0, w, h, NeutBurnPoisonString );
                x = (width * 0.5) - (w * 0.5);
                DrawFadedText( gc, x, cury, msgColor, NeutBurnPoisonString );
                break;
            case Player.MPMSG_FirstBurn:
                str = YouAreBurnedString;
                cury = TopCentralMessage( gc, str, msgColor );
                gc.GetTextExtent( 0, w, h, NeutBurnPoisonString );
                x = (width * 0.5) - (w * 0.5);
                DrawFadedText( gc, x, cury, msgColor, NeutBurnPoisonString );
                break;
            case Player.MPMSG_TurretInv:
                str = TurretInvincibleString;
                TopCentralMessage( gc, str, msgColor );
                break;
            case Player.MPMSG_CameraInv:
                str = CameraInvincibleString;
                TopCentralMessage( gc, str, msgColor );
                break;
            case Player.MPMSG_CloseKills:
                if ( Player.mpMsgOptionalParam > 1 )
                    str = OnlyString $ Player.mpMsgOptionalParam $ KillsToGoString;
                else
                    str = OnlyString $ Player.mpMsgOptionalParam $ KillToGoString;
                if ( Player.mpMsgOptionalString ~= "Tied" ) // Should only happen in a team game
                    str = str $ TiedMatchString;
                else
                    str = str $ Player.mpMsgOptionalString $ WillWinMatchString;
                TopCentralMessage( gc, str, msgColor );
                break;
            case Player.MPMSG_TimeNearEnd:
                if ( Player.mpMsgOptionalParam > 1 )
                    str = LessThanXString1 $ Player.mpMsgOptionalParam $ LessThanXString2;
                else
                    str = LessThanMinuteString;

                if ( Player.mpMsgOptionalString ~= "Tied" ) // Should only happen in a team game
                    str = str $ TiedMatchString;
                else
                    str = str $ Player.mpMsgOptionalString $ LeadsMatchString;
                TopCentralMessage( gc, str, msgColor );
                break;
            case Player.MPMSG_LostLegs:
                str = LostLegsString;
                TopCentralMessage( gc, str, msgColor );
                break;
            case Player.MPMSG_DropItem:
                if ( keyDropItem ~= KeyNotBoundString )
                    RefreshMultiplayerKeys();
                str = DropItem1String $ keyDropItem $ DropItem2String;
                TopCentralMessage( gc, str, msgColor );
                break;
            case Player.MPMSG_KilledTeammate:
                msgColor = colRed;
                TopCentralMessage( gc, YouKilledTeammateString, msgColor );
                break;
            case Player.MPMSG_TeamLAM:
                str = TeamLAMString;
                TopCentralMessage( gc, str, msgColor );
                break;
            case Player.MPMSG_TeamComputer:
                str = TeamComputerString;
                TopCentralMessage( gc, str, msgColor );
                break;
            case Player.MPMSG_NoCloakWeapon:
                str = NoCloakWeaponString;
                TopCentralMessage( gc, str, msgColor );
                break;
            case Player.MPMSG_TeamHackTurret:
                str = TeamHackTurretString;
                TopCentralMessage( gc, str, msgColor );
                break;
        }
        gc.SetTextColor(colWhite);
    }
    if ( Player.Level.Timeseconds < targetPlayerTime )
    {
        gc.SetFont(Font'FontMenuSmall');
        gc.GetTextExtent(0, w, h, targetPlayerName $ targetPlayerHealthString $ targetPlayerLocationString);
        gc.SetTextColor(targetPlayerColor);
        x = width * targetPlayerXMul - (w*0.5);
        if ( x < 1) x = 1;
        y = height * targetPlayerYMul;
        gc.DrawText( x, y, w, h, targetPlayerName $ targetPlayerHealthString $ targetPlayerLocationString);
        if (( targetOutOfRange ) && ( targetRangeTime > Player.Level.Timeseconds ))
        {
            gc.GetTextExtent(0, w, h, OutOfRangeString);
            x = (width * 0.5) - (w*0.5);
            y = (height * 0.5) - (h * 3.0);
            gc.DrawText( x, y, w, h, OutOfRangeString );
        }
        gc.SetTextColor(colWhite);
    }
    weap = DeusExWeapon(Player.inHand);
    if (( weap != None ) && ( weap.AmmoLeftInClip() == 0 ) && (weap.NumClips() == 0) )
    {
        if ( weap.IsA('WeaponLAM') ||
              weap.IsA('WeaponGasGrenade') || 
              weap.IsA('WeaponEMPGrenade') ||
              weap.IsA('WeaponShuriken') ||
              weap.IsA('WeaponLAW') )
        {
        }
        else
        {
            if ( Player.Level.Timeseconds < OutOfAmmoTime )
            {
                gc.SetFont(Font'FontMenuTitle');
                gc.GetTextExtent( 0, w, h, OutOfAmmoString );
                gc.SetTextColor(colRed);
                x = (width*0.5) - (w*0.5);
                y = (height*0.5) - (h*5.0);
                gc.DrawText( x, y, w, h, OutOfAmmoString );
            }
            if ( Player.Level.Timeseconds-OutOfAmmoTime > 0.33 )
                OutOfAmmoTime = Player.Level.Timeseconds + 1.0;
        }
    }
}

// ----------------------------------------------------------------------
// GetTargetReticle()
// ----------------------------------------------------------------------

function GetTargetReticleColor( Actor target, out Color xcolor )
{
    local DeusExPlayer safePlayer;
    local AutoTurret turret;
    local bool bDM, bTeamDM;
    local Vector dist;
   local float SightDist;
    local DeusExWeapon w;
    local int team;
    local String titleString;

    bDM = (DeathMatchGame(player.DXGame) != None);
    bTeamDM = (TeamDMGame(player.DXGame) != None);

    if ( target.IsA('ScriptedPawn') )
    {
        if (ScriptedPawn(target).GetPawnAllianceType(Player) == ALLIANCE_Hostile)
            xcolor = colRed;
        else
            xcolor = colGreen;
    }
    else if ( Player.Level.NetMode != NM_Standalone )   // Only do the rest in multiplayer
    {
        if ( target.IsA('DeusExPlayer') && (target != player) ) // Other players IFF
        {
            if ( bTeamDM && (TeamDMGame(player.DXGame).ArePlayersAllied(DeusExPlayer(target),player)) )
            { 
                xcolor = colGreen;
                if ( (Player.mpMsgFlags & Player.MPFLAG_FirstSpot) != Player.MPFLAG_FirstSpot )
                    Player.MultiplayerNotifyMsg( Player.MPMSG_TeamSpot );
            }
            else
                xcolor = colRed;

         SightDist = VSize(target.Location - Player.Location);

            if ( ( bTeamDM && (TeamDMGame(player.DXGame).ArePlayersAllied(DeusExPlayer(target),player))) ||
                  (target.Style != STY_Translucent) || (bVisionActive && (Sightdist <= visionLevelvalue)) )              
            {
                targetPlayerName = DeusExPlayer(target).PlayerReplicationInfo.PlayerName;
            // DEUS_EX AMSD Show health of enemies with the target active.
            if (bTargetActive)
               TargetPlayerHealthString = "(" $ int(100 * (DeusExPlayer(target).Health / Float(DeusExPlayer(target).Default.Health))) $ "%)";
                targetOutOfRange = False;
                w = DeusExWeapon(player.Weapon);
                if (( w != None ) && ( xcolor != colGreen ))
                {
                    dist = player.Location - target.Location;
                    if ( VSize(dist) > w.maxRange ) 
                    {
                        if (!(( WeaponAssaultGun(w) != None ) && ( Ammo20mm(WeaponAssaultGun(w).AmmoType) != None )))
                        {
                            targetRangeTime = Player.Level.Timeseconds + 0.1;
                            targetOutOfRange = True;
                        }
                    }
                }
                targetPlayerTime = Player.Level.Timeseconds + targetPlayerDelay;
                targetPlayerColor = xcolor;
            }
            else
                xcolor = colWhite;  // cloaked enemy
        }
        else if (target.IsA('ThrownProjectile'))    // Grenades IFF
        {
            if ( ThrownProjectile(target).bDisabled )
                xcolor = colWhite;
            else if ( (bTeamDM && (ThrownProjectile(target).team == player.PlayerReplicationInfo.team)) || 
                (player == DeusExPlayer(target.Owner)) )
                xcolor = colGreen;
            else
                xcolor = colRed;
        }
        else if ( target.IsA('AutoTurret') || target.IsA('AutoTurretGun') ) // Autoturrets IFF
        {
            if ( target.IsA('AutoTurretGun') )
            {
                team = AutoTurretGun(target).team;
                titleString = AutoTurretGun(target).titleString;
            }
            else
            {
                team = AutoTurret(target).team;
                titleString = AutoTurret(target).titleString;
            }
            if ( (bTeamDM && (player.PlayerReplicationInfo.team == team)) ||
                  (!bTeamDM && (player.PlayerReplicationInfo.PlayerID == team)) )
                xcolor = colGreen;
            else if (team == -1)
                xcolor = colWhite;
            else
                xcolor = colRed;

            targetPlayerName = titleString;
            targetOutOfRange = False;
            targetPlayerTime = Player.Level.Timeseconds + targetPlayerDelay;
            targetPlayerColor = xcolor;
        }
        else if ( target.IsA('ComputerSecurity'))
        {
            if ( ComputerSecurity(target).team == -1 )
                xcolor = colWhite;
            else if ((bTeamDM && (ComputerSecurity(target).team==player.PlayerReplicationInfo.team)) ||
                         (bDM && (ComputerSecurity(target).team==player.PlayerReplicationInfo.PlayerID)))
                xcolor = colGreen;
            else
                xcolor = colRed;
        }
        else if ( target.IsA('SecurityCamera'))
        {
         if ( !SecurityCamera(target).bActive )
            xcolor = colWhite;
            else if ( SecurityCamera(target).team == -1 )
                xcolor = colWhite;
            else if ((bTeamDM && (SecurityCamera(target).team==player.PlayerReplicationInfo.team)) ||
                         (bDM && (SecurityCamera(target).team==player.PlayerReplicationInfo.PlayerID)))
                xcolor = colGreen;
            else
                xcolor = colRed;
        }
    }
}


// ----------------------------------------------------------------------
// DrawTargetAugmentation()
// ----------------------------------------------------------------------

function DrawTargetAugmentation(GC gc)
{
    local String str;
    local Actor target;
    local float boxCX, boxCY, boxTLX, boxTLY, boxBRX, boxBRY, boxW, boxH;
    local float x, y, w, h, mult;
    local Vector v1, v2;
    local int i, j, k;
    local DeusExWeapon weapon;
    local bool bUseOldTarget;
    local Color crossColor;
    local DeusExPlayer own;
    local vector AimLocation;
    local int AimBodyPart;


    crossColor.R = 255; crossColor.G = 255; crossColor.B = 255;

    // check 500 feet in front of the player
    target = TraceLOS(8000,AimLocation);

   targetplayerhealthstring = "";
   targetplayerlocationstring = "";

    if ( target != None )
    {
        GetTargetReticleColor( target, crossColor );

        if ((DeusExPlayer(target) != None) && (bTargetActive))
        {
            AimBodyPart = DeusExPlayer(target).GetMPHitLocation(AimLocation);
            if (AimBodyPart == 1)
                TargetPlayerLocationString = "("$msgHead$")";
            else if ((AimBodyPart == 2) || (AimBodyPart == 5) || (AimBodyPart == 6))
                TargetPlayerLocationString = "("$msgTorso$")";
            else if ((AimBodyPart == 3) || (AimBodyPart == 4))
                TargetPlayerLocationString = "("$msgLegs$")";
        }

        weapon = DeusExWeapon(Player.Weapon);
        if ((weapon != None) && !weapon.bHandToHand && !bUseOldTarget)
        {
            // if the target is out of range, don't draw the reticle
            if (weapon.MaxRange >= VSize(target.Location - Player.Location))
            {
                w = width;
                h = height;
                x = int(w * 0.5)-1;
                y = int(h * 0.5)-1;

                // scale based on screen resolution - default is 640x480
                mult = FClamp(weapon.currentAccuracy * 80.0 * (width/640.0), corner, 80.0);

                // make sure it's not too close to the center unless you have a perfect accuracy
                mult = FMax(mult, corner+4.0);
                if (weapon.currentAccuracy == 0.0)
                    mult = corner;

                // draw the drop shadowed reticle
                gc.SetTileColorRGB(0,0,0);
                for (i=1; i>=0; i--)
                {
                    gc.DrawBox(x+i, y-mult+i, 1, corner, 0, 0, 1, Texture'Solid');
                    gc.DrawBox(x+i, y+mult-corner+i, 1, corner, 0, 0, 1, Texture'Solid');
                    gc.DrawBox(x-(corner-1)/2+i, y-mult+i, corner, 1, 0, 0, 1, Texture'Solid');
                    gc.DrawBox(x-(corner-1)/2+i, y+mult+i, corner, 1, 0, 0, 1, Texture'Solid');

                    gc.DrawBox(x-mult+i, y+i, corner, 1, 0, 0, 1, Texture'Solid');
                    gc.DrawBox(x+mult-corner+i, y+i, corner, 1, 0, 0, 1, Texture'Solid');
                    gc.DrawBox(x-mult+i, y-(corner-1)/2+i, 1, corner, 0, 0, 1, Texture'Solid');
                    gc.DrawBox(x+mult+i, y-(corner-1)/2+i, 1, corner, 0, 0, 1, Texture'Solid');

                    gc.SetTileColor(crossColor);
                }
            }
        }
        // movers are invalid targets for the aug
        if (target.IsA('DeusExMover'))
            target = None;
    }

    // let there be a 0.5 second delay before losing a target
    if (target == None)
    {
        if ((Player.Level.TimeSeconds - lastTargetTime < 0.5) && IsActorValid(lastTarget))
        {
            target = lastTarget;
            bUseOldTarget = True;
        }
        else
        {
            RemoveActorRef(lastTarget);
            lastTarget = None;
        }
    }
    else
    {
        lastTargetTime = Player.Level.TimeSeconds;
        bUseOldTarget = False;
        if (lastTarget != target)
        {
            RemoveActorRef(lastTarget);
            lastTarget = target;
            AddActorRef(lastTarget);
        }
    }

    if (target != None)
    {
        // draw a cornered targetting box
        v1.X = target.CollisionRadius;
        v1.Y = target.CollisionRadius;
        v1.Z = target.CollisionHeight;

        if (ConvertVectorToCoordinates(target.Location, boxCX, boxCY))
        {
            boxTLX = boxCX;
            boxTLY = boxCY;
            boxBRX = boxCX;
            boxBRY = boxCY;

            // get the smallest box to enclose actor
            // modified from Scott's ActorDisplayWindow
            for (i=-1; i<=1; i+=2)
            {
                for (j=-1; j<=1; j+=2)
                {
                    for (k=-1; k<=1; k+=2)
                    {
                        v2 = v1;
                        v2.X *= i;
                        v2.Y *= j;
                        v2.Z *= k;
                        v2.X += target.Location.X;
                        v2.Y += target.Location.Y;
                        v2.Z += target.Location.Z;

                        if (ConvertVectorToCoordinates(v2, x, y))
                        {
                            boxTLX = FMin(boxTLX, x);
                            boxTLY = FMin(boxTLY, y);
                            boxBRX = FMax(boxBRX, x);
                            boxBRY = FMax(boxBRY, y);
                        }
                    }
                }
            }

            boxTLX = FClamp(boxTLX, margin, width-margin);
            boxTLY = FClamp(boxTLY, margin, height-margin);
            boxBRX = FClamp(boxBRX, margin, width-margin);
            boxBRY = FClamp(boxBRY, margin, height-margin);

            boxW = boxBRX - boxTLX;
            boxH = boxBRY - boxTLY;

            if ((bTargetActive) && (Player.Level.Netmode == NM_Standalone))
            {
                // set the coords of the zoom window, and draw the box
                // even if we don't have a zoom window
                x = width/8 + margin;
                y = height/2;
                w = width/4;
                h = height/4;

                DrawDropShadowBox(gc, x-w/2, y-h/2, w, h);

                boxCX = width/8 + margin;
                boxCY = height/2;
                boxTLX = boxCX - width/8;
                boxTLY = boxCY - height/8;
                boxBRX = boxCX + width/8;
                boxBRY = boxCY + height/8;

                if (targetLevel > 2)
                {
                    if (winZoom != None)
                    {
                        mult = (target.CollisionRadius + target.CollisionHeight);
                        v1 = Player.Location;
                        v1.Z += Player.BaseEyeHeight;
                        v2 = 1.5 * Player.Normal(target.Location - v1);
                        winZoom.SetViewportLocation(target.Location - mult * v2);
                        winZoom.SetWatchActor(target);
                    }
                    // window construction now happens in Tick()
                }
                else
                {
                    // black out the zoom window and draw a "no image" message
                    gc.SetStyle(DSTY_Normal);
                    gc.SetTileColorRGB(0,0,0);
                    gc.DrawPattern(boxTLX, boxTLY, w, h, 0, 0, Texture'Solid');

                    gc.SetTextColorRGB(255,255,255);
                    gc.GetTextExtent(0, w, h, msgNoImage);
                    x = boxCX - w/2;
                    y = boxCY - h/2;
                    gc.DrawText(x, y, w, h, msgNoImage);
                }

                // print the name of the target above the box
                if (target.IsA('Pawn'))
                    str = target.BindName;
                else if (target.IsA('DeusExDecoration'))
                    str = DeusExDecoration(target).itemName;
                else if (target.IsA('DeusExProjectile'))
                    str = DeusExProjectile(target).itemName;
                else
                    str = target.GetItemName(String(target.Class));

                // print disabled robot info
                if (target.IsA('Robot') && (Robot(target).EMPHitPoints == 0))
                    str = str $ " (" $ msgDisabled $ ")";
                gc.SetTextColor(crossColor);

                // print the range to target
                mult = VSize(target.Location - Player.Location);
                str = str $ CR() $ msgRange @ Int(mult/16) @ msgRangeUnits;

                gc.GetTextExtent(0, w, h, str);
                x = boxTLX + margin;
                y = boxTLY - h - margin;
                gc.DrawText(x, y, w, h, str);

                // level zero gives very basic health info
                if (target.IsA('Pawn'))
                    mult = Float(Pawn(target).Health) / Float(Pawn(target).Default.Health);
                else if (target.IsA('DeusExDecoration'))
                    mult = Float(DeusExDecoration(target).HitPoints) / Float(DeusExDecoration(target).Default.HitPoints);
                else
                    mult = 1.0;

                if (targetLevel == 0)
                {
                    // level zero only gives us general health readings
                    if (mult >= 0.66)
                    {
                        str = msgHigh;
                        mult = 1.0;
                    }
                    else if (mult >= 0.33)
                    {
                        str = msgMedium;
                        mult = 0.5;
                    }
                    else
                    {
                        str = msgLow;
                        mult = 0.05;
                    }

                    str = str @ msgHealth;
                }
                else
                {
                    // level one gives exact health readings
                    str = Int(mult * 100.0) $ msgPercent;
                    if (target.IsA('Pawn') && !target.IsA('Robot') && !target.IsA('Animal'))
                    {
                        x = mult;       // save this for color calc
                        str = str @ msgOverall;
                        mult = Float(Pawn(target).HealthHead) / Float(Pawn(target).Default.HealthHead);
                        str = str $ CR() $ Int(mult * 100.0) $ msgPercent @ msgHead;
                        mult = Float(Pawn(target).HealthTorso) / Float(Pawn(target).Default.HealthTorso);
                        str = str $ CR() $ Int(mult * 100.0) $ msgPercent @ msgTorso;
                        mult = Float(Pawn(target).HealthArmLeft) / Float(Pawn(target).Default.HealthArmLeft);
                        str = str $ CR() $ Int(mult * 100.0) $ msgPercent @ msgLeftArm;
                        mult = Float(Pawn(target).HealthArmRight) / Float(Pawn(target).Default.HealthArmRight);
                        str = str $ CR() $ Int(mult * 100.0) $ msgPercent @ msgRightArm;
                        mult = Float(Pawn(target).HealthLegLeft) / Float(Pawn(target).Default.HealthLegLeft);
                        str = str $ CR() $ Int(mult * 100.0) $ msgPercent @ msgLeftLeg;
                        mult = Float(Pawn(target).HealthLegRight) / Float(Pawn(target).Default.HealthLegRight);
                        str = str $ CR() $ Int(mult * 100.0) $ msgPercent @ msgRightLeg;
                        mult = x;
                    }
                    else
                    {
                        str = str @ msgHealth;
                    }
                }

                gc.GetTextExtent(0, w, h, str);
                x = boxTLX + margin;
                y = boxTLY + margin;
                gc.SetTextColor(GetColorScaled(mult));
                gc.DrawText(x, y, w, h, str);
                gc.SetTextColor(colHeaderText);

                if (targetLevel > 1)
                {
                    // level two gives us weapon info as well
                    if (target.IsA('Pawn'))
                    {
                        str = msgWeapon;
    
                        if (Pawn(target).Weapon != None)
                            str = str @ target.GetItemName(String(Pawn(target).Weapon.Class));
                        else
                            str = str @ msgNone;

                        gc.GetTextExtent(0, w, h, str);
                        x = boxTLX + margin;
                        y = boxBRY - h - margin;
                        gc.DrawText(x, y, w, h, str);
                    }
                }
            }
            else
            {
                // display disabled robots
                if (target.IsA('Robot') && (Robot(target).EMPHitPoints == 0))
                {
                    str = msgDisabled;
                    gc.SetTextColor(crossColor);
                    gc.GetTextExtent(0, w, h, str);
                    x = boxCX - w/2;
                    y = boxTLY - h - margin;
                    gc.DrawText(x, y, w, h, str);
                }
            }
        }
    }
    else if ((bTargetActive) && (Player.Level.NetMode == NM_Standalone))
    {
        if (Player.Level.TimeSeconds % 1.5 > 0.75)
            str = msgScanning1;
        else
            str = msgScanning2;
        gc.GetTextExtent(0, w, h, str);
        x = width/2 - w/2;
        y = (height/2 - h) - 20;
        gc.DrawText(x, y, w, h, str);
    }

    // set the crosshair colors
    DeusExRootWindow(player.rootWindow).hud.cross.SetCrosshairColor(crossColor);
}

// ----------------------------------------------------------------------
// DrawVisionAugmentation()
// ----------------------------------------------------------------------

function DrawVisionAugmentation(GC gc)
{
    local Vector loc;
    local float boxCX, boxCY, boxTLX, boxTLY, boxBRX, boxBRY, boxW, boxH;
    local float dist, x, y, w, h;
   local float BrightDot;
    local Actor A;
   local float DrawGlow;
   local float RadianView;
   local float OldFlash, NewFlash;
   local vector OldFog, NewFog;
    local Texture oldSkins[9];

    boxW = width/2;
    boxH = height/2;
    boxCX = width/2;
    boxCY = height/2;
    boxTLX = boxCX - boxW/2;
    boxTLY = boxCY - boxH/2;
    boxBRX = boxCX + boxW/2;
    boxBRY = boxCY + boxH/2;

    // at level one and higher, enhance heat sources (FLIR)
    // use DrawActor to enhance NPC visibility
    if (visionLevel >= 1)
    {
        // shift the entire screen to dark red (except for the middle box)
      if (player.Level.Netmode == NM_Standalone)
      {
         gc.SetStyle(DSTY_Modulated);
         gc.DrawPattern(0, 0, width, boxTLY, 0, 0, Texture'ConWindowBackground');
         gc.DrawPattern(0, boxBRY, width, height-boxBRY, 0, 0, Texture'ConWindowBackground');
         gc.DrawPattern(0, boxTLY, boxTLX, boxH, 0, 0, Texture'ConWindowBackground');
         gc.DrawPattern(boxBRX, boxTLY, width-boxBRX, boxH, 0, 0, Texture'ConWindowBackground');
         gc.DrawPattern(0, 0, width, boxTLY, 0, 0, Texture'SolidRed');
         gc.DrawPattern(0, boxBRY, width, height-boxBRY, 0, 0, Texture'SolidRed');
         gc.DrawPattern(0, boxTLY, boxTLX, boxH, 0, 0, Texture'SolidRed');
         gc.DrawPattern(boxBRX, boxTLY, width-boxBRX, boxH, 0, 0, Texture'SolidRed');
         gc.SetStyle(DSTY_Translucent);
      }

      // DEUS_EX AMSD In multiplayer, draw green here so that we can draw red actors over it
      if (player.Level.Netmode != NM_Standalone)
      {
         gc.SetStyle(DSTY_Modulated);
         gc.DrawPattern(0, 0, width, height, 0, 0, Texture'VisionBlue');
         gc.DrawPattern(0, 0, width, height, 0, 0, Texture'VisionBlue');
         gc.SetStyle(DSTY_Translucent);
      }
      

        // adjust for the player's eye height
        loc = Player.Location;
        loc.Z += Player.BaseEyeHeight;

      // DEUS_EX AMSD In multiplayer, in order to not let you snipe people hiding in the dark across the map, but not get
      // bad feedback from coloring everything green, we have to make the red non translucent so that scale glow darkens it,
      // instead of fading it out.
      //if (Player.Level.Netmode != NM_Standalone)
         //gc.SetStyle(DSTY_Normal);

      foreach Player.AllActors(class'Actor', A)
      {
         if (A.bVisionImportant)
         {
            if (IsHeatSource(A) || ( (Player.Level.Netmode != NM_Standalone) && ((A.IsA('AutoTurret')) || (A.IsA('AutoTurretGun')) || (A.IsA('SecurityCamera')) ) ))
            {
               dist = VSize(A.Location - loc);
               //If within range of vision aug bit
               if ( ( ((Player.Level.Netmode != NM_Standalone) && (dist <= (visionLevelvalue / 2))) ||
                      ((Player.Level.Netmode == NM_Standalone) && (dist <= (visionLevelValue)))        ) && (IsHeatSource(A)))
               {           
                  VisionTargetStatus = GetVisionTargetStatus(A);               
                  SetSkins(A, oldSkins);
                  gc.DrawActor(A, False, False, True, 1.0, 2.0, None);
                  ResetSkins(A, oldSkins);
               }
               else if ((Player.Level.Netmode != NM_Standalone) && (GetVisionTargetStatus(A) == VISIONENEMY) && (A.Style == STY_Translucent))
               {
                  //DEUS_EX AMSD In multiplayer, if looking at a cloaked enemy player within range (greater than see through walls)
                  //(If within walls radius he'd already have been seen.               
                  if ( (dist <= (visionLevelvalue)) && (Player.LineOfSightTo(A,true)) )
                  {
                     VisionTargetStatus = GetVisionTargetStatus(A);               
                     SetSkins(A, oldSkins);
                     gc.DrawActor(A, False, False, True, 1.0, 2.0, None);
                     ResetSkins(A, oldSkins);
                  }
               }
               else if (Player.LineOfSightTo(A,true))
               {
                  VisionTargetStatus = GetVisionTargetStatus(A);               
                  SetSkins(A, oldSkins);
                  
                  if ((Player.Level.NetMode == NM_Standalone) || (dist < VisionLevelValue * 1.5) || (VisionTargetStatus != VISIONENEMY))
                  {
                     DrawGlow = 2.0;
                  }
                  else
                  {
                     // Fadeoff with distance square
                     DrawGlow = 2.0 / ((dist / (VisionLevelValue * 1.5)) * (dist / (VisionLevelValue * 1.5)));
                     // Don't make the actor harder to see than without the aug.
                     //DrawGlow = FMax(DrawGlow,A.ScaleGlow);
                     // Set a minimum.
                     DrawGlow = FMax(DrawGlow,0.15);
                  }                  
                  gc.DrawActor(A, False, False, True, 1.0, DrawGlow, None);
                  ResetSkins(A, oldSkins);
               }
            }
            else if ( (A != VisionBlinder) && (Player.Level.NetMode != NM_Standalone) && (A.IsA('ExplosionLight')) && (Player.LineOfSightTo(A,True)) )
            {
               BrightDot = Normal(Vector(Player.ViewRotation)) dot Normal(A.Location - Player.Location);
               dist = VSize(A.Location - Player.Location);
               
               if (dist > 3000)
                  DrawGlow = 0;
               else if (dist < 300)
                  DrawGlow = 1;
               else
                  DrawGlow = ( 3000 - dist ) / ( 3000 - 300 );
               
               // Calculate view angle in radians.
               RadianView = (Player.FovAngle / 180) * 3.141593;
               
               if ((BrightDot >= Cos(RadianView)) && (DrawGlow > 0.2) && (BrightDot * DrawGlow * 0.9 > 0.2))  //DEUS_EX AMSD .75 is approximately at our view angle edge.
               {
                  VisionBlinder = A;
                  NewFlash = 10.0 * BrightDot * DrawGlow;
                  NewFog = vect(1000,1000,900) * BrightDot * DrawGlow * 0.9;
                  OldFlash = player.DesiredFlashScale;
                  OldFog = player.DesiredFlashFog * 1000;
                  
                  // Don't add increase the player's flash above the current newflash.
                  NewFlash = FMax(0,NewFlash - OldFlash);
                  NewFog.X = FMax(0,NewFog.X - OldFog.X);
                  NewFog.Y = FMax(0,NewFog.Y - OldFog.Y);
                  NewFog.Z = FMax(0,NewFog.Z - OldFog.Z);
                  player.ClientFlash(NewFlash,NewFog);
                  player.IncreaseClientFlashLength(4.0*BrightDot*DrawGlow*BrightDot);
               }
            }
         }
      }

      // draw text label
      if (player.Level.Netmode == NM_Standalone)
      {
         gc.GetTextExtent(0, w, h, msgIRAmpActive);
         x = boxTLX + margin;
         y = boxTLY - margin - h;
         gc.SetTextColor(colHeaderText);
         gc.DrawText(x, y, w, h, msgIRAmpActive);
      }
    }

    // shift the middle of the screen green (NV) and increase the contrast
   // DEUS_EX AMSD In singleplayer, draw this here
   // In multiplayer, drawn earlier so you can still see through walls with it.
   if (player.Level.Netmode == NM_Standalone)
   {
      gc.SetStyle(DSTY_Modulated);
      gc.DrawPattern(boxTLX, boxTLY, boxW, boxH, 0, 0, Texture'SolidGreen');
      gc.DrawPattern(boxTLX, boxTLY, boxW, boxH, 0, 0, Texture'SolidGreen');
   }
   gc.SetStyle(DSTY_Normal);

    if (player.Level.NetMode == NM_Standalone)
      DrawDropShadowBox(gc, boxTLX, boxTLY, boxW, boxH);

    // draw text label
   if (player.Level.Netmode == NM_Standalone)
   {
      gc.GetTextExtent(0, w, h, msgLightAmpActive);
      x = boxTLX + margin;
      y = boxTLY + margin;
      gc.SetTextColor(colHeaderText);
      gc.DrawText(x, y, w, h, msgLightAmpActive);
   }
}

// ----------------------------------------------------------------------
// IsHeatSource()
// ----------------------------------------------------------------------

function bool IsHeatSource(Actor A)
{
   if ((A.bHidden) && (Player.Level.NetMode != NM_Standalone))
      return False;
   if (A.IsA('Pawn'))
   {
      if (A.IsA('ScriptedPawn'))
         return True;
      else if ( (A.IsA('DeusExPlayer')) && (A != Player) )//DEUS_EX AMSD For multiplayer.
         return True;
      return False;
   }
    else if (A.IsA('DeusExCarcass'))
        return True;   
    else if (A.IsA('FleshFragment'))
        return True;
   else
        return False;
}

// ----------------------------------------------------------------------
// GetGridTexture()
//
// modified from ActorDisplayWindow
// ----------------------------------------------------------------------

function Texture GetGridTexture(Texture tex)
{
    if (tex == None)
        return Texture'BlackMaskTex';
    else if (tex == Texture'BlackMaskTex')
        return Texture'BlackMaskTex';
    else if (tex == Texture'GrayMaskTex')
        return Texture'BlackMaskTex';
    else if (tex == Texture'PinkMaskTex')
        return Texture'BlackMaskTex';
    else if (VisionTargetStatus == VISIONENEMY)         
      return Texture'Virus_SFX';
   else if (VisionTargetStatus == VISIONALLY)
        return Texture'Wepn_Prifle_SFX';
   else if (VisionTargetStatus == VISIONNEUTRAL)
      return Texture'WhiteStatic';
   else
      return Texture'WhiteStatic';
}

// ----------------------------------------------------------------------
// SetSkins()
// 
// copied from ActorDisplayWindow
// ----------------------------------------------------------------------

function SetSkins(Actor actor, out Texture oldSkins[9])
{
    local int     i;
    local texture curSkin;

    for (i=0; i<8; i++)
        oldSkins[i] = actor.MultiSkins[i];
    oldSkins[i] = actor.Skin;

    for (i=0; i<8; i++)
    {
        curSkin = actor.GetMeshTexture(i);
        actor.MultiSkins[i] = GetGridTexture(curSkin);
    }
    actor.Skin = GetGridTexture(oldSkins[i]);
}

// ----------------------------------------------------------------------
// ResetSkins()
// 
// copied from ActorDisplayWindow
// ----------------------------------------------------------------------

function ResetSkins(Actor actor, Texture oldSkins[9])
{
    local int i;

    for (i=0; i<8; i++)
        actor.MultiSkins[i] = oldSkins[i];
    actor.Skin = oldSkins[i];
}

// ----------------------------------------------------------------------
// DrawDropShadowBox()
// ----------------------------------------------------------------------

function DrawDropShadowBox(GC gc, float x, float y, float w, float h)
{
    local Color oldColor;

    gc.GetTileColor(oldColor);
    gc.SetTileColorRGB(0,0,0);
    gc.DrawBox(x, y+h+1, w+2, 1, 0, 0, 1, Texture'Solid');
    gc.DrawBox(x+w+1, y, 1, h+2, 0, 0, 1, Texture'Solid');
    gc.SetTileColor(colBorder);
    gc.DrawBox(x-1, y-1, w+2, h+2, 0, 0, 1, Texture'Solid');
    gc.SetTileColor(oldColor);
}

// ----------------------------------------------------------------------
// VisionTargetStatus()
// ----------------------------------------------------------------------

function int GetVisionTargetStatus(Actor Target)
{
   local DeusExPlayer PlayerTarget;
   local TeamDMGame TeamGame;

   if (Target == None)
      return VISIONNEUTRAL;
   
   if (player.Level.NetMode == NM_Standalone)
      return VISIONNEUTRAL;

   if (target.IsA('DeusExPlayer'))
   {     
      if (target == player)
         return VISIONNEUTRAL;
      
      TeamGame = TeamDMGame(player.DXGame);
      // In deathmatch, all players are hostile.
      if (TeamGame == None)
         return VISIONENEMY;
      
      PlayerTarget = DeusExPlayer(Target);
      
      if (TeamGame.ArePlayersAllied(PlayerTarget,Player))
         return VISIONALLY;
      else
         return VISIONENEMY;
   }
   else if ( (target.IsA('AutoTurretGun')) || (target.IsA('AutoTurret')) )
   {
      if (target.IsA('AutoTurretGun'))
         return GetVisionTargetStatus(target.Owner);
      else if ((AutoTurret(Target).bDisabled))
         return VISIONNEUTRAL;
      else if (AutoTurret(Target).safetarget == Player) 
         return VISIONALLY;
      else if ((Player.DXGame.IsA('TeamDMGame')) && (AutoTurret(Target).team == -1))
         return VISIONNEUTRAL;
      else if ( (!Player.DXGame.IsA('TeamDMGame')) || (Player.PlayerReplicationInfo.Team != AutoTurret(Target).team) )
          return VISIONENEMY;
      else if (Player.PlayerReplicationInfo.Team == AutoTurret(Target).team)
         return VISIONALLY;
      else
         return VISIONNEUTRAL;
   }
   else if (target.IsA('SecurityCamera'))
   {
      if ( !SecurityCamera(target).bActive )
         return VISIONNEUTRAL;
      else if ( SecurityCamera(target).team == -1 )
         return VISIONNEUTRAL;
      else if (((Player.DXGame.IsA('TeamDMGame')) && (SecurityCamera(target).team==player.PlayerReplicationInfo.team)) ||
         ( (Player.DXGame.IsA('DeathMatchGame')) && (SecurityCamera(target).team==player.PlayerReplicationInfo.PlayerID)))
         return VISIONALLY;
      else
         return VISIONENEMY;
   }
   else
      return VISIONNEUTRAL;
}

// ----------------------------------------------------------------------
// ----------------------------------------------------------------------

defaultproperties
{
     margin=4.000000
     corner=9.000000
     msgRange="Range"
     msgRangeUnits="ft"
     msgHigh="High"
     msgMedium="Medium"
     msgLow="Low"
     msgHealth="health"
     msgOverall="Overall"
     msgPercent="%"
     msgHead="Head"
     msgTorso="Torso"
     msgLeftArm="L Arm"
     msgRightArm="R Arm"
     msgLeftLeg="L Leg"
     msgRightLeg="R Leg"
     msgLegs="Legs"
     msgWeapon="Weapon:"
     msgNone="None"
     msgScanning1="* No Target *"
     msgScanning2="* Scanning *"
     msgADSTracking="* ADS Tracking *"
     msgADSDetonating="* ADS Detonating *"
     msgBehind="BEHIND"
     msgDroneActive="Remote SpyDrone Active"
     msgEnergyLow="BioElectric energy low!"
     msgCantLaunch="ERROR - No room for SpyDrone construction!"
     msgLightAmpActive="LightAmp Active"
     msgIRAmpActive="IRAmp Active"
     msgNoImage="Image Not Available"
     msgDisabled="Disabled"
     SpottedTeamString="You have spotted a teammate!"
     YouArePoisonedString="You have been poisoned!"
     YouAreBurnedString="You are burning!"
     TurretInvincibleString="Turrets are only affected by EMP damage!"
     CameraInvincibleString="Cameras are only affected by EMP damage!"
     NeutBurnPoisonString="(Use medkits to instantly neutralize)"
     OnlyString="Only "
     KillsToGoString=" more kills, and "
     KillToGoString=" more kill, and "
     LessThanMinuteString="Less than a minute to go, and "
     LessThanXString1="Less than "
     LessThanXString2=" minutes to go, and "
     LeadsMatchString=" leads the match!"
     TiedMatchString="it's a tied match!"
     WillWinMatchString=" will win the match!"
     OutOfRangeString="(Out of range)"
     LostLegsString="You've lost your legs!"
     DropItem1String="You can use <"
     DropItem2String="> to drop an equipped item."
     msgTeammateHit="You hit your teammate!"
     msgTeamNsf="You're on Team NSF!"
     msgTeamUnatco="You're on Team Unatco!"
     UseString="Use <"
     TeamTalkString="> to send team messages."
     TalkString="> to send regular chat messages."
     YouKilledTeammateString="You killed a teammate!"
     TeamLAMString="You cannot pickup your teammate's grenade!"
     TeamComputerString="That computer already belongs to your team!"
     NoCloakWeaponString="You cannot cloak while a weapon is drawn!"
     TeamHackTurretString="That turret already belongs to your team!"
     KeyNotBoundString="Key Not Bound"
     OutOfAmmoString="Out of Ammo!"
     colRed=(R=255)
     colGreen=(G=255)
     colWhite=(R=255,G=255,B=255)
}

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:22.665 - Created with UnCodeX