Advertisement
Guest User

Untitled

a guest
Feb 5th, 2017
224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //=============================================================================
  2. // KFObjective
  3. //=============================================================================
  4. // Base class for the KF2 objectives
  5. //=============================================================================
  6. // Killing Floor 2
  7. // Copyright (C) 2015 Tripwire Interactive LLC
  8. // - Christian "schneidzekk" Schneider
  9. //=============================================================================
  10. class KFObjective extends ReplicationInfo
  11.         abstract
  12.         config(Game)
  13.         native
  14.         nativereplication;
  15.  
  16. enum EObjectiveState
  17. {
  18.     OS_None,
  19.     OS_Alert,
  20.     OS_PreStart,
  21.     OS_Active,
  22.     OS_Won,
  23.     OS_Failed
  24. };
  25.  
  26. enum EObjFailIndex
  27. {
  28.     OF_TimeLimit,
  29.     OF_WipedOut,
  30.     OF_TargetDied,
  31.     OF_WaveEnded,
  32.     OF_Ended,
  33.     OF_NoDoshReceivers,
  34.     OF_NeededPlayers
  35. };
  36.  
  37. var             KFObjectiveVolume       StartVolume;                //Defines the starting location of the objective
  38. var repnotify   byte                    ObjectiveState;             //What is going on right now, voting, active
  39. var repnotify   byte                    ObjectiveFailReason;        //Why did we fail
  40. var repnotify   int                     TimeLimit;                  //The amount of time players have to complete the objective
  41. var             float                   SpawnCurveIntensity;        //An override to the games spawning curve to allow spawning intensity control during the objective gameplay
  42. var             int                     DoshReward;                 //The total amount of dosh the team receives for the objective.
  43. var             int                     PerkReward;                 //The amount of experience each player receives for completing the objective.
  44. var localized   string                  ObjectiveDifficulties[3];   //Difficulty strings for the  wvae objectives
  45. var localized   string                  ObjectiveFailReasons[7];    //Fail reason strings
  46. var localized   string                  ObjectiveStartTitle;        //Start string
  47. var localized   string                  ObjectiveWaitingString;     //Waiting string
  48. var localized   string                  ObjectiveWonString;         //Won string
  49. var localized   string                  ObjectiveFailedString;      //Failed string
  50. var localized   string                  ObjectiveEndedString;       //Ended sttring (Not every every objective can be completed or failed)
  51. var localized   string                  ObjectiveTimeString;        //Time string
  52. var localized   string                  ObjectiveTypeString;        //Text that defines the action of the objective to the player. Will be displayed in the Objective HUD notifications.
  53. var localized   string                  ObjectiveTargetTitle;       //Text that defines the target of the objective to the player. Will be displayed in the Objective HUD notifications.
  54. var localized   string                  ObjectiveStatusTitle;       //Displayed in the players objective progress tracker.
  55. var localized   string                  ObjectiveXPString;          //"XP"
  56. var localized   string                  ObjectiveTimeLimitString;   //Text for time limits
  57. var localized   string                  ObjectiveTimeUnit;          //"s" time unit
  58. var localized   string                  ObjectiveStatusString;      //Header text when ojective active
  59.  
  60. var repnotify   byte                    ObjectiveDifficulty;        //Randomly chosen difficulty
  61. var             byte                    ObjectiveProgress;          // 0-100%
  62. var             float                   RealObjectiveProgress;      // We want to use float precision internally
  63.  
  64. var()           float                   ObjectiveAlertDelay;        //Duration the alert is shown
  65. var()           float                   ObjectiveStartDelay;        //Time between the objective alert and the time it actually starts
  66. var protected   float                   ObjectiveStartTime;         //Time the objective starts
  67. var protected   float                   ObjectiveEndTime;           //Time the objective ends
  68.  
  69. var             KFGameReplicationInfo   MyKFGRI;                    //Cache
  70. var             array<PlayerReplicationInfo> ActiveObjectivePlayers;//Players who were in the objective
  71. var             float                   CurPlayerCount;             //NumPlayers
  72. var             bool                    bIsCoopObjective;           //Am I a Co-op objective?
  73. var             float                   NumPlayersDenied;           //Number of players that do not want to play the objective
  74.  
  75. /*********************************************************************************************
  76.  Player Variables
  77. **********************************************************************************************/
  78. var             bool                    bHasAccepted;                  //Player has voted
  79. var             bool                    bObjectiveDenied;           //Player does not want to play the objective
  80. var             bool                    bNoLocalObjective;          //This objective should be ingnored on the local client
  81.  
  82. /*********************************************************************************************
  83.  SFX
  84. **********************************************************************************************/
  85. var             AkEvent             ObjectiveTriggeredSFX;      //A sound that is played when the objective is triggered.
  86. var             AkEvent             ObjectiveCompletedSFX;      //A sound that is played when the objective is successfully completed.
  87. var             AkEvent             ObjectiveFailedSFX;         //A sound that is played when the objective is failed.
  88. var             AkEvent             ObjectiveCrossOffSFX;       //A sound that is place when an objective is accepted
  89.  
  90. var config      bool                bShowObjectivePath;
  91.  
  92. /*********************************************************************************************
  93.  HUD
  94. **********************************************************************************************/
  95. var             Texture2D           ObjSquareTex;
  96. var             Texture2D           ObjRectangleTex;
  97. var             Texture2D           ObjWorldTex;
  98. var             Texture2D           ObjAlertTex;
  99. var             Texture2D           ObjAlertAlphaTex;
  100. var             Texture2D           ObjWhiteTex;
  101. var             Texture2D           DoshTex;
  102. var             int                 CurAlpha;
  103. var             int                 AlphaDelta;
  104. var             Font                ObjectiveFont;
  105.  
  106. /*********************************************************************************************
  107.  Debug
  108. **********************************************************************************************/
  109. var config      bool                bLogObjective;
  110.  
  111. replication
  112. {
  113.     if( bNetInitial )
  114.         StartVolume, ObjectiveDifficulty, TimeLimit, DoshReward, PerkReward;
  115.  
  116.  
  117.     if( bNetDirty )
  118.         ObjectiveState, ObjectiveFailReason, ObjectiveProgress;
  119. }
  120.  
  121. cpptext
  122. {
  123.     // Override replication for set owner / RPC calls
  124.     INT* GetOptimizedRepList( BYTE* Recent, FPropertyRetirement* Retire, INT* Ptr, UPackageMap* Map, UActorChannel* Channel );
  125.     virtual void PostNetReceive();
  126. }
  127.  
  128. simulated event ReplicatedEvent(name VarName)
  129. {
  130.     `log("[OBJECTIVE]" @ GetFuncName() @ "Replicated variable:" @ VarName, bLogObjective);
  131.  
  132.     if( VarName == nameOf(TimeLimit) )
  133.     {
  134.         Initialize();
  135.     }
  136.     else
  137.     {
  138.         super.ReplicatedEvent(VarName);
  139.     }
  140. }
  141.  
  142. // Let's get this Objective going (client & server)
  143. simulated event Initialize()
  144. {
  145.     `log("[OBJECTIVE]" @ GetFuncName(), bLogObjective);
  146.     InitializeTimer();
  147.  
  148.     if( WorldInfo.NetMode != NM_DedicatedServer )
  149.     {
  150.         `TraderDialogManager.PlayObjectiveDialog( GetALocalPlayerController(), GetTraderDialogStartIndex() );
  151.     }
  152. }
  153.  
  154. // Update the spawn curve intensity
  155. function NotifySpawnManager(bool bUpdateSpawnCurveIntensity)
  156. {
  157.     local KFGameInfo KFGI;
  158.  
  159.     KFGI = KFGameInfo(WorldInfo.Game);
  160.     if( KFGI != none && KFGI.SpawnManager != none )
  161.     {
  162.         if( bUpdateSpawnCurveIntensity )
  163.         {
  164.             `log("[OBJECTIVE]" @ GetFuncName() @ "Setting SpawnCurve intensity!", bLogObjective);
  165.             KFGI.SpawnManager.UpdateSpawnCurveIntensity(SpawnCurveIntensity);
  166.            
  167.         }
  168.         else
  169.         {
  170.             `log("[OBJECTIVE]" @ GetFuncName() @ "Resetting SpawnCurve intensity!", bLogObjective);
  171.             KFGI.SpawnManager.ResetSpawnCurveIntensity();
  172.         }
  173.     }
  174. }
  175.  
  176. // Tell the GRI that we are the objective
  177. simulated function NotifyGRI()
  178. {
  179.     `log("[OBJECTIVE]" @ GetFuncName(), bLogObjective);
  180.     if( WorldInfo.GRI != none )
  181.     {
  182.         MyKFGRI = KFGameReplicationInfo(WorldInfo.GRI);
  183.         MYKFGRI.CurrentObjective = self;
  184.  
  185.         //While we are here let's see how many players are alive
  186.         CurPlayerCount = MyKFGRI.GetNumPlayersAlive();
  187.     }
  188. }
  189.  
  190. // Start the objective loop
  191. simulated function InitializeTimer()
  192. {
  193.     SetTimer(1.0, true, nameOf(UpdateObjective));
  194. }
  195.  
  196. // Objective loop
  197. function UpdateObjective()
  198. {
  199.     switch( ObjectiveState )
  200.     {
  201.         case OS_None:
  202.             break;
  203.         case OS_Alert:
  204.             UpdateObj_Alert();
  205.             break;
  206.         case OS_PreStart:
  207.             UpdateObj_Prestart();
  208.             break;
  209.         case OS_Active:
  210.             UpdateObj_Active();
  211.             break;
  212.         case OS_Won:
  213.             break;
  214.         case OS_Failed:
  215.             break;
  216.     }
  217. }
  218.  
  219. function UpdateObj_Alert();
  220.  
  221. function UpdateObj_Prestart()
  222. {
  223.     if( WorldInfo.TimeSeconds >= ObjectiveStartTime )
  224.     {
  225.         if( StartVolume != none && GetNumPlayersAccepted() > 0 )
  226.         {
  227.             `log("[OBJECTIVE]" @ GetFuncName() @ "GetNumPlayersAccepted() > 0", bLogObjective);
  228.             StartObjective();
  229.         }
  230.         else
  231.         {
  232.             `log("[OBJECTIVE]" @ GetFuncName() @ "Not enough players", bLogObjective);
  233.             FailObjective(OF_NeededPlayers);
  234.         }
  235.     }
  236.     else if( StartVolume != none && GetNumPlayersAccepted() >= CurPlayerCount )
  237.     {
  238.         `log("[OBJECTIVE]" @ GetFuncName() @ "GetNumPlayersAccepted() >= CurPlayerCount", bLogObjective);
  239.         StartObjective();
  240.     }
  241. }
  242.  
  243. function UpdateObj_Active()
  244. {
  245.     if( ObjectiveEndTime <= WorldInfo.TimeSeconds )
  246.     {
  247.         if( ObjectiveComplete() )
  248.         {
  249.             WinObjective();
  250.         }
  251.         else
  252.         {
  253.             FailObjective(OF_TimeLimit);
  254.         }
  255.     }
  256.     else
  257.     {
  258.         if( ObjectiveComplete() )
  259.         {
  260.             WinObjective();
  261.         }
  262.     }
  263. }
  264.  
  265. // Sub class
  266. function bool ObjectiveComplete()
  267. {
  268.     return false;
  269. }
  270.  
  271. simulated function AlertObjective()
  272. {
  273.  
  274. }
  275.  
  276. // Let's get to the start volume
  277. simulated function PreStartObjective()
  278. {
  279.     `log("[OBJECTIVE]" @ GetFuncName(), bLogObjective);
  280.  
  281.     if( WorldInfo.NetMode != NM_DedicatedServer )
  282.     {
  283.         DoObjPreStartNotify();
  284.     }
  285. }
  286.  
  287. // Actual objective starts
  288. simulated function StartObjective()
  289. {
  290.     `log("[OBJECTIVE]" @ GetFuncName(), bLogObjective);
  291.  
  292.     if( Role == ROLE_Authority )
  293.     {
  294.         ObjectiveState = OS_Active;
  295.     }
  296.  
  297.     ObjectiveEndTime = WorldInfo.TimeSeconds + TimeLimit;
  298.  
  299.     if( WorldInfo.NetMode != NM_DedicatedServer )
  300.     {
  301.         DoObjStartNotify();
  302.     }
  303. }
  304.  
  305. // Objective failed miserably
  306. simulated function FailObjective(EObjFailIndex FailReason)
  307. {
  308.     `log("[OBJECTIVE]" @ GetFuncName(), bLogObjective);
  309.  
  310.     ObjectiveFailReason = FailReason;
  311.     ObjectiveState = OS_Failed;
  312.     DoObjFailNotify();
  313.  
  314.     HideObj();
  315.     SetTimer(4.f, false, nameOf(EndObjective));
  316. }
  317.  
  318. //
  319. function WinObjective()
  320. {
  321.     ObjectiveState = OS_Won;
  322.     DoObjWinNotify();
  323.     HideObj();
  324.     SetTimer(4.f, false, nameOf(EndObjective));
  325. }
  326.  
  327. simulated function AcceptObj()
  328. {
  329.     `log("[OBJECTIVE]" @ GetFuncName(), bLogObjective);
  330.  
  331.     bHasAccepted = true;
  332. }
  333.  
  334. simulated function HideObj()
  335. {
  336.     StartVolume.Hide();
  337. }
  338.  
  339. simulated function EndObjective()
  340. {
  341.     ObjectiveState = OS_None;
  342.     ClearTimer(nameOf(UpdateObjective));
  343.  
  344.     `log("[OBJECTIVE]" @ GetFuncName(), bLogObjective);
  345.     if( WorldInfo.NetMode != NM_DedicatedServer )
  346.     {
  347.         HideObjHUD();
  348.     }
  349.  
  350.     ResetObjectivePlayers();
  351.     MYKFGRI.CurrentObjective = none;
  352.     Destroy();
  353. }
  354.  
  355. simulated function bool ShouldShowObjPath()
  356. {
  357.     return ObjectiveState < OS_Active && bShowObjectivePath && !bIsCoopObjective;
  358. }
  359.  
  360. function AddObjectivePlayer(PlayerReplicationInfo PRI)
  361. {
  362.     ActiveObjectivePlayers.AddItem(PRI);
  363.  
  364.     if( ActiveObjectivePlayers.Length >= MyKFGRI.GetNumPlayersAlive() )
  365.     {
  366.         StartObjective();
  367.     }
  368. }
  369.  
  370. function ResetObjectivePlayers()
  371. {
  372.     local KFPawn_Human KFPH;
  373.  
  374.     `log("[OBJECTIVE]" @ GetFuncName(), bLogObjective);
  375.  
  376.     foreach WorldInfo.Allpawns(class'KFPawn_Human', KFPH)
  377.     {
  378.         KFPH.bObjectivePlayer = false;
  379.     }
  380.  
  381.     ActiveObjectivePlayers.Remove(0, ActiveObjectivePlayers.Length);
  382. }
  383.  
  384. function bool IsObjectivePlayer(KFPlayerReplicationInfo KFPRI)
  385. {
  386.     return ActiveObjectivePlayers.Find( KFPRI ) > INDEX_NONE;
  387. }
  388.  
  389. function int GetNumPlayersAccepted()
  390. {
  391.     return ActiveObjectivePlayers.Length;
  392. }
  393. /************************************************************
  394.  * Notify functions called by the objective events
  395.  ************************************************************/
  396.  
  397. /* Objective is triggerd */
  398. simulated function DoObjAlertNotify()
  399. {
  400.     if( bNoLocalObjective )
  401.     {
  402.         return;
  403.     }
  404.  
  405.     `log("[OBJECTIVE]" @ GetFuncName(), bLogObjective);
  406.     ShowObjAlert();
  407.     PlayObjAlertSFX();
  408. }
  409.  
  410. /* Objective is accepted */
  411. simulated function DoObjPreStartNotify()
  412. {
  413.     local KFPlayerController KFPC;
  414.  
  415.     if( bNoLocalObjective )
  416.     {
  417.         return;
  418.     }
  419.  
  420.     `log("[OBJECTIVE]" @ GetFuncName(), bLogObjective);
  421.  
  422.     foreach LocalPlayerControllers(class'KFPlayerController', KFPC)
  423.     {
  424.         if( KFPC.PlayerReplicationInfo != none )
  425.         {
  426.             KFPC.PlaySoundBase(ObjectiveCrossOffSFX);
  427.         }
  428.     }
  429.  
  430.     if( bShowObjectivePath )
  431.     {
  432.         ShowObjPath();
  433.     }
  434.  
  435.     ShowObjTracker();
  436. }
  437.  
  438. /* Objective starts */
  439. simulated function DoObjStartNotify()
  440. {
  441.     if( bNoLocalObjective )
  442.     {
  443.         return;
  444.     }
  445.  
  446.     `log("[OBJECTIVE]" @ GetFuncName(), bLogObjective);
  447.     ShowObjStartMessage();
  448.     ShowObjTracker();
  449. }
  450.  
  451. /* Objective is failed */
  452. simulated function DoObjFailNotify()
  453. {
  454.     if( bNoLocalObjective )
  455.     {
  456.         return;
  457.     }
  458.  
  459.     `log("[OBJECTIVE]" @ GetFuncName(), bLogObjective);
  460.     ShowObjFailMessage();
  461.     PlayObjFailSFX();
  462.  
  463.     if( WorldInfo.NetMode != NM_DedicatedServer )
  464.     {
  465.         `TraderDialogManager.PlayObjectiveDialog( GetALocalPlayerController(), GetTraderDialogStartIndex() + 3 );
  466.     }
  467. }
  468.  
  469. /* Objective is won */
  470. simulated function DoObjWinNotify()
  471. {
  472.     if( bNoLocalObjective )
  473.     {
  474.         return;
  475.     }
  476.  
  477.     `log("[OBJECTIVE]" @ GetFuncName(), bLogObjective);
  478.     ShowObjWinMessage();
  479.     PlayObjWinSFX();
  480.  
  481.     if( WorldInfo.NetMode != NM_DedicatedServer )
  482.     {
  483.         `TraderDialogManager.PlayObjectiveDialog( GetALocalPlayerController(), GetTraderDialogStartIndex() + 1 );
  484.     }
  485. }
  486.  
  487. /************************************************************
  488.  * HUD message functions
  489.  ************************************************************/
  490.  
  491. simulated function ShowObjAlert()
  492. {
  493.  
  494. }
  495.  
  496. /* Show the objective info when objective is triggered */
  497. simulated function ShowObjVoteMenu()
  498. {
  499.     `log("[OBJECTIVE]" @ GetFuncName(), bLogObjective);
  500. }
  501.  
  502. /* Show the path to the objective */
  503. simulated function ShowObjPath()
  504. {
  505.     `log("[OBJECTIVE]" @ GetFuncName(), bLogObjective);
  506.     StartVolume.ShowObjectivePath();
  507. }
  508.  
  509. /* Show the objective start message */
  510. simulated function ShowObjStartMessage()
  511. {
  512.  
  513. }
  514.  
  515. /* Show the general objective tracker (TOP-RIGHT) */
  516. simulated function ShowObjTracker()
  517. {
  518.  
  519. }
  520.  
  521. /* Show the win message (BOTTOM-CENTER) */
  522. simulated function ShowObjWinMessage()
  523. {
  524.  
  525. }
  526.  
  527. /* Show the fail message (BOTTOM-CENTER) */
  528. simulated function ShowObjFailMessage()
  529. {
  530.  
  531. }
  532.  
  533. /* Hide all objective HUD parts (Used later) */
  534. simulated function HideObjHUD()
  535. {
  536.  
  537. }
  538.  
  539. /************************************************************
  540.  * SFX/VO functions
  541.  ************************************************************/
  542.  
  543. /* Play SFX/VO when vote menu comes up */
  544. simulated function PlayObjAlertSFX()
  545. {
  546.     local KFPlayerController KFPC;
  547.  
  548.     `log("[OBJECTIVE]" @ GetFuncName(), bLogObjective);
  549.  
  550.     foreach LocalPlayerControllers(class'KFPlayerController', KFPC)
  551.     {
  552.         if( KFPC.PlayerReplicationInfo != none )
  553.         {
  554.             KFPC.PlaySoundBase(ObjectiveTriggeredSFX);
  555.         }
  556.     }
  557. }
  558.  
  559. /* Play win SFX/VO */
  560. simulated function PlayObjWinSFX()
  561. {
  562.     local KFPlayerController KFPC;
  563.  
  564.     `log("[OBJECTIVE]" @ GetFuncName(), bLogObjective);
  565.  
  566.     foreach LocalPlayerControllers(class'KFPlayerController', KFPC)
  567.     {
  568.         if( KFPC.PlayerReplicationInfo != none )
  569.         {
  570.             KFPC.PlaySoundBase(ObjectiveCompletedSFX);
  571.         }
  572.     }
  573. }
  574.  
  575. /* Play lose SFX/VO */
  576. simulated function PlayObjFailSFX()
  577. {
  578.     local KFPlayerController KFPC;
  579.  
  580.     `log("[OBJECTIVE]" @ GetFuncName(), bLogObjective);
  581.  
  582.     foreach LocalPlayerControllers(class'KFPlayerController', KFPC)
  583.     {
  584.         if( KFPC.PlayerReplicationInfo != none )
  585.         {
  586.             KFPC.PlaySoundBase(ObjectiveFailedSFX);
  587.         }
  588.     }
  589. }
  590.  
  591. /************************************************************
  592.  * Functions used in sub classes
  593.  ************************************************************/
  594. function SetLowHealthPawn(KFPawn_Human LowHealthPawn);
  595. function NewHealer(PlayerReplicationInfo Healer);
  596. function PawnDied(Pawn KilledPawn);
  597. function SetLowDoshPawns(array<KFPawn_Human> LowHealthPawns);
  598. function int GetPayDayBonusDosh(int DoshSpend){return 0;}
  599. function CheckForPayDayPawn(Pawn P);
  600. function bool InfiniteZedsEnabled(){ return false; }
  601.  
  602. /************************************************************
  603.  * HUD
  604.  ************************************************************/
  605. simulated function DrawObjectiveHUD(Canvas C);
  606. simulated function DrawTrackerHUD(Canvas C);
  607. simulated function DrawObjAlertHUD(Canvas C);
  608. simulated function DrawObjPrestartHUD(Canvas C);
  609. simulated function DrawObjEndHUD(Canvas C);
  610.  
  611. simulated function DrawObjectiveWorldPosition(Canvas C)
  612. {
  613.     local vector ScreenPos;
  614.     local string Distance;
  615.     local KFPawn_Human MyKFPH;
  616.     local KFPlayerController KFPC;
  617.     local float Dim, StringSizeX, StringSizeY;
  618.  
  619.     CurAlpha += AlphaDelta;
  620.     if( CurAlpha >= 255 || CurAlpha <= 0 )
  621.     {
  622.         CurAlpha = CurAlpha >= 255 ? 255 : 0;
  623.         AlphaDelta = -AlphaDelta;
  624.     }
  625.  
  626.     Dim = 48;
  627.     C.SetDrawColor(0, 230, 255, CurAlpha);
  628.     C.bCenter = false;
  629.  
  630.     foreach LocalPlayerControllers(class'KFPlayerController', KFPC)
  631.     {
  632.         MyKFPH = KFPawn_Human(KFPC.Pawn);
  633.         if( MyKFPH != none )
  634.         {
  635.             break;
  636.         }
  637.     }
  638.  
  639.     ScreenPos = C.Project(StartVolume.Location);
  640.     if( ScreenPos.Z > 0 )
  641.     {
  642.         if( ScreenPos.X >= C.ClipX )
  643.         {
  644.             ScreenPos.X = C.ClipX - Dim / 2;
  645.         }
  646.         else if( ScreenPos.X <= 0 )
  647.         {
  648.             ScreenPos.X = Dim / 2;
  649.         }
  650.  
  651.         if( ScreenPos.Y >= C.ClipY )
  652.         {
  653.             ScreenPos.Y = C.ClipY - Dim / 2;
  654.         }
  655.         else if( ScreenPos.Y <= 0 )
  656.         {
  657.             ScreenPos.Y = Dim / 2;
  658.         }
  659.     }
  660.     else
  661.     {
  662.         if( ScreenPos.X >= C.SizeX / 2)
  663.         {
  664.             ScreenPos.X = Dim / 2;
  665.         }
  666.         else
  667.         {
  668.             ScreenPos.X = C.ClipX - Dim / 2;
  669.         }
  670.  
  671.         ScreenPos.Y = C.ClipY - (ScreenPos.Y % C.ClipY);
  672.     }
  673.  
  674.     Distance = Round(VSize(StartVolume.Location - MyKFPH.Location) / 100) $ "m";
  675.     C.StrLen(Distance, StringSizeX, StringSizeY);
  676.  
  677.     C.SetPos(ScreenPos.X - Dim / 2, ScreenPos.Y - Dim / 2);
  678.     C.DrawTile(ObjWorldTex, Dim, Dim, 0, 0, 256, 256);
  679.  
  680.     C.SetPos(ScreenPos.X -  StringSizeX / 2, ScreenPos.Y + Dim / 2);
  681.     C.DrawText(Distance, false);
  682.  
  683.     C.Reset();
  684. }
  685.  
  686. /** Returns (hardcoded) trader objective dialog ID, override in children */
  687. simulated function int GetTraderDialogStartIndex()
  688. {
  689.     return 49; // defaults to Defend Target
  690. }
  691.  
  692. DefaultProperties
  693. {
  694.     AlphaDelta=10
  695.     ObjectiveStartDelay=60.f
  696.     bIsCoopObjective=false
  697.     ObjectiveAlertDelay=3.f
  698.  
  699.     ObjectiveFont=Font'UI_Canvas_Fonts.Font_General'
  700.  
  701.     RemoteRole=ROLE_SimulatedProxy
  702.     bAlwaysRelevant=True
  703.     TickGroup=TG_DuringAsyncWork
  704.  
  705.     //ObjSquareTex=Texture2D'UI_Objective_Tex.UI_Obj_Background_Square'
  706.     //ObjRectangleTex=Texture2D'UI_Objective_Tex.UI_Obj_Background_Short'
  707.     //ObjWorldTex=Texture2D'UI_Objective_Tex.UI_Obj_World_Loc'
  708.     //ObjAlertTex=Texture2D'InGameHUD_UI.alert_BG'
  709.     //ObjAlertAlphaTex=Texture2D'InGameHUD_UI.alert_noBG'
  710.     //ObjWhiteTex=Texture2D'EngineResources.WhiteSquareTexture'
  711.     //DoshTex=Texture2D'InGameHUD_UI.InGameHUD_SWF_I18'
  712.  
  713.     ObjectiveTriggeredSFX=AkEvent'WW_UI_Objectives.Play_UI_NewObjective'
  714.     ObjectiveCompletedSFX=AkEvent'WW_UI_Objectives.Play_UI_ObjectiveComplete'
  715.     ObjectiveFailedSFX=AkEvent'WW_UI_Objectives.Play_UI_Objective_Fail'
  716.     ObjectiveCrossOffSFX=AkEvent'WW_UI_Objectives.Play_UI_Objective_CrossOff'
  717. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement