Advertisement
Guest User

Untitled

a guest
Aug 22nd, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.71 KB | None | 0 0
  1. //Adds events for evaluation every 15 seconds.
  2.  
  3. _AlphaCasualty = "CDF" call FNC_CasualtyPercentage; //CDF
  4. _BravoCasualty = "CNM" call FNC_CasualtyPercentage; //MILITA
  5. // _CharlieCasualty = "C SIDE" call FNC_CasualtyPercentage;
  6. // _DeltaCasualty = "D SIDE" call FNC_CasualtyPercentage;
  7.  
  8. //Casualty Flags
  9. Alpha_casFlag = false;
  10. Bravo_casFlag = false;
  11. // Charlie_casFlag = false;
  12. // Delta_casFlag = false;
  13.  
  14. //Objective Flags
  15. Alpha_obj1Flag = false;
  16. Alpha_obj2Flag = false;
  17. Bravo_obj1Flag = false;
  18. // Bravo_obj2Flag = false;
  19. /**************************/
  20. // Charlie_obj1Flag = false;
  21. // Charlie_obj2Flag = false;
  22. // Delta_obj1Flag = false;
  23. // Delta_obj2Flag = false;
  24.  
  25. //Time Flags
  26. Alpha_timeFlag = false;
  27. // Bravo_timeFlag = false;
  28. // Charlie_timeFlag = false;
  29. // Delta_timeFlag = false;
  30.  
  31. //Loss Conditions
  32. Alpha_loss1Flag = false;
  33. Alpha_loss2Flag = false;
  34. Bravo_loss1Flag = false;
  35. //Bravo_loss2Flag = false;
  36.  
  37. // if (_CharlieCasualty >= 80) then {Alpha_casFlag = true};
  38. // if (_DeltaCasualty >= 80) then {Bravo_casFlag = true};
  39.  
  40. _handler = [{
  41. _AlphaCasualty = "CDF" call FNC_CasualtyPercentage;
  42. _BravoCasualty = "CNM" call FNC_CasualtyPercentage;
  43. // _CharlieCasualty = "C SIDE" call FNC_CasualtyPercentage;
  44. // _DeltaCasualty = "D SIDE" call FNC_CasualtyPercentage;
  45. if (_AlphaCasualty >= 80) then {
  46. Alpha_casFlag = true;
  47. sideName = "ALPHA";
  48. ["casualtyCheck", ["Alpha_casFlag","sideName"]] call CBA_fnc_serverEvent;
  49. };
  50. if (_BravoCasualty >= 90) then {
  51. Bravo_casFlag = true;
  52. sideName = "BRAVO";
  53. ["casualtyCheck", ["Bravo_casFlag","sideName"]] call CBA_fnc_serverEvent;
  54. };
  55. if (time > 3600) then {Alpha_timeFlag = true; Alpha_loss2Flag = true;};
  56. // if (_CharlieCasualty >= 80) then {Charlie_casFlag = true;
  57. //["casualtyCheck", ["Delta_casFlag"]] call CBA_fnc_serverEvent;};
  58. // if (_DeltaCasualty >= 80) then {Delta_casFlag = true;
  59. //["casualtyCheck", ["Delta_casFlag"]] call CBA_fnc_serverEvent;};
  60. if(!alive cache) then {Alpha_obj2Flag = true;};
  61. }, 15, []] call CBA_fnc_addPerFrameHandler;
  62.  
  63. _customHandler = ["casualtyCheck", {
  64. if(_this select 1 isEqualTo "ALPHA") then {
  65. Alpha_loss1Flag = true;
  66. Alpha_obj1Flag = true;
  67. };
  68. if(_this select 1 isEqualTo "BRAVO") then {
  69. Bravo_loss1Flag = true;
  70. Alpha_obj1Flag = true;
  71. };
  72. }] call CBA_fnc_addEventHandler;
  73.  
  74. if (Alpha_obj1Flag || Alpha_obj2Flag || Bravo_obj1Flag || Alpha_timeFlag) then {
  75.  
  76. // if(Alpha_loss1Flag) exitWith {
  77. // "CDF Failure<br/>CDF Casualties exceeded acceptable limits." call FNC_EndMission;
  78. // };
  79. if(Alpha_obj2Flag && !Alpha_loss1Flag) exitWith {
  80. "CDF Victory<br/>CDF destroyed the cache and cleared the town." call FNC_EndMission;
  81. };
  82. if(Alpha_obj2Flag && Alpha_loss1Flag) exitWith {
  83. "CDF Pyrhicc Victory<br/>CDF Casualties exceeded acceptable limits,<br/>but CDF destroyed the cache." call FNC_EndMission;
  84. };
  85. if(Alpha_loss1Flag && !Bravo_casFlag) exitWith {
  86. "CDF Failure<br/>CDF Casualties exceeded acceptable limits." call FNC_EndMission;
  87. };
  88. if(Alpha_loss1Flag && Bravo_casFlag) exitWith {
  89. "CDF Failure<br/>CDF Casualties exceeded acceptable limits but major CNM casualties inflicted." call FNC_EndMission;
  90. };
  91. if(Alpha_loss2Flag && !Bravo_casFlag) exitWith {
  92. "CDF Failure<br/>Time has run out." call FNC_EndMission;
  93. };
  94. if(Alpha_loss2Flag && Bravo_casFlag) exitWith {
  95. "CDF Failure<br/>Time has run out, but major CNM casualties inflicted." call FNC_EndMission;
  96. };
  97. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement