Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Adds events for evaluation every 15 seconds.
- _AlphaCasualty = "CDF" call FNC_CasualtyPercentage; //CDF
- _BravoCasualty = "CNM" call FNC_CasualtyPercentage; //MILITA
- // _CharlieCasualty = "C SIDE" call FNC_CasualtyPercentage;
- // _DeltaCasualty = "D SIDE" call FNC_CasualtyPercentage;
- //Casualty Flags
- Alpha_casFlag = false;
- Bravo_casFlag = false;
- // Charlie_casFlag = false;
- // Delta_casFlag = false;
- //Objective Flags
- Alpha_obj1Flag = false;
- Alpha_obj2Flag = false;
- Bravo_obj1Flag = false;
- // Bravo_obj2Flag = false;
- /**************************/
- // Charlie_obj1Flag = false;
- // Charlie_obj2Flag = false;
- // Delta_obj1Flag = false;
- // Delta_obj2Flag = false;
- //Time Flags
- Alpha_timeFlag = false;
- // Bravo_timeFlag = false;
- // Charlie_timeFlag = false;
- // Delta_timeFlag = false;
- //Loss Conditions
- Alpha_loss1Flag = false;
- Alpha_loss2Flag = false;
- Bravo_loss1Flag = false;
- //Bravo_loss2Flag = false;
- // if (_CharlieCasualty >= 80) then {Alpha_casFlag = true};
- // if (_DeltaCasualty >= 80) then {Bravo_casFlag = true};
- _handler = [{
- _AlphaCasualty = "CDF" call FNC_CasualtyPercentage;
- _BravoCasualty = "CNM" call FNC_CasualtyPercentage;
- // _CharlieCasualty = "C SIDE" call FNC_CasualtyPercentage;
- // _DeltaCasualty = "D SIDE" call FNC_CasualtyPercentage;
- if (_AlphaCasualty >= 80) then {
- Alpha_casFlag = true;
- sideName = "ALPHA";
- ["casualtyCheck", ["Alpha_casFlag","sideName"]] call CBA_fnc_serverEvent;
- };
- if (_BravoCasualty >= 90) then {
- Bravo_casFlag = true;
- sideName = "BRAVO";
- ["casualtyCheck", ["Bravo_casFlag","sideName"]] call CBA_fnc_serverEvent;
- };
- if (time > 3600) then {Alpha_timeFlag = true; Alpha_loss2Flag = true;};
- // if (_CharlieCasualty >= 80) then {Charlie_casFlag = true;
- //["casualtyCheck", ["Delta_casFlag"]] call CBA_fnc_serverEvent;};
- // if (_DeltaCasualty >= 80) then {Delta_casFlag = true;
- //["casualtyCheck", ["Delta_casFlag"]] call CBA_fnc_serverEvent;};
- if(!alive cache) then {Alpha_obj2Flag = true;};
- }, 15, []] call CBA_fnc_addPerFrameHandler;
- _customHandler = ["casualtyCheck", {
- if(_this select 1 isEqualTo "ALPHA") then {
- Alpha_loss1Flag = true;
- Alpha_obj1Flag = true;
- };
- if(_this select 1 isEqualTo "BRAVO") then {
- Bravo_loss1Flag = true;
- Alpha_obj1Flag = true;
- };
- }] call CBA_fnc_addEventHandler;
- if (Alpha_obj1Flag || Alpha_obj2Flag || Bravo_obj1Flag || Alpha_timeFlag) then {
- // if(Alpha_loss1Flag) exitWith {
- // "CDF Failure<br/>CDF Casualties exceeded acceptable limits." call FNC_EndMission;
- // };
- if(Alpha_obj2Flag && !Alpha_loss1Flag) exitWith {
- "CDF Victory<br/>CDF destroyed the cache and cleared the town." call FNC_EndMission;
- };
- if(Alpha_obj2Flag && Alpha_loss1Flag) exitWith {
- "CDF Pyrhicc Victory<br/>CDF Casualties exceeded acceptable limits,<br/>but CDF destroyed the cache." call FNC_EndMission;
- };
- if(Alpha_loss1Flag && !Bravo_casFlag) exitWith {
- "CDF Failure<br/>CDF Casualties exceeded acceptable limits." call FNC_EndMission;
- };
- if(Alpha_loss1Flag && Bravo_casFlag) exitWith {
- "CDF Failure<br/>CDF Casualties exceeded acceptable limits but major CNM casualties inflicted." call FNC_EndMission;
- };
- if(Alpha_loss2Flag && !Bravo_casFlag) exitWith {
- "CDF Failure<br/>Time has run out." call FNC_EndMission;
- };
- if(Alpha_loss2Flag && Bravo_casFlag) exitWith {
- "CDF Failure<br/>Time has run out, but major CNM casualties inflicted." call FNC_EndMission;
- };
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement