2015-08-28 21:52:56 +00:00
|
|
|
/*
|
2015-09-05 03:40:00 +00:00
|
|
|
DMS_fnc_MissionSuccessState
|
2015-08-28 21:52:56 +00:00
|
|
|
Created by eraser1
|
|
|
|
|
|
|
|
Usage:
|
|
|
|
[
|
|
|
|
[_completionType1,_completionArgs1],
|
|
|
|
[_completionType2,_completionArgs2],
|
|
|
|
...
|
|
|
|
[_completionTypeN,_completionArgsN]
|
2015-09-05 03:40:00 +00:00
|
|
|
] call DMS_fnc_MissionSuccessState;
|
2015-08-28 21:52:56 +00:00
|
|
|
*/
|
2015-08-30 00:33:32 +00:00
|
|
|
|
|
|
|
if !((typeName _this) == "ARRAY") exitWith
|
2015-08-28 21:52:56 +00:00
|
|
|
{
|
|
|
|
diag_log format ["DMS ERROR :: DMS_MissionSuccessState called with invalid parameter: %1",_this];
|
|
|
|
};
|
|
|
|
|
|
|
|
private "_success";
|
|
|
|
|
|
|
|
_success = true;
|
|
|
|
|
|
|
|
{
|
|
|
|
if (!_success) exitWith
|
|
|
|
{
|
|
|
|
if (DMS_DEBUG) then
|
|
|
|
{
|
2015-09-01 22:37:29 +00:00
|
|
|
diag_log format ["DMS_DEBUG MissionSuccessState :: Mission not yet completed with parameters: %1 | at time %2",_this,diag_tickTime];
|
2015-08-28 21:52:56 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
private ["_OK","_completionType","_completionArgs"];
|
|
|
|
|
|
|
|
_OK = _x params
|
|
|
|
[
|
|
|
|
["_completionType", "", [""] ],
|
2015-08-31 07:52:46 +00:00
|
|
|
["_completionArgs", [], [[],grpNull] ]
|
2015-08-28 21:52:56 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
if (!_OK) exitWith
|
|
|
|
{
|
|
|
|
diag_log format ["DMS ERROR :: DMS_MissionSuccessState has invalid parameters in: %1",_x];
|
|
|
|
};
|
|
|
|
|
|
|
|
switch (_completionType) do
|
|
|
|
{
|
|
|
|
// Using switch-do so that future cases can be added easily
|
|
|
|
case "kill":
|
|
|
|
{
|
2015-09-05 03:40:00 +00:00
|
|
|
_success = _completionArgs call DMS_fnc_TargetsKilled;
|
2015-08-28 21:52:56 +00:00
|
|
|
};
|
2015-08-30 00:33:32 +00:00
|
|
|
case "killPercent":
|
|
|
|
{
|
2015-09-05 03:40:00 +00:00
|
|
|
_success = _completionArgs call DMS_fnc_TargetsKilledPercent;//<---TODO
|
2015-08-30 00:33:32 +00:00
|
|
|
};
|
2015-08-28 21:52:56 +00:00
|
|
|
case "playerNear":
|
|
|
|
{
|
|
|
|
_success = _completionArgs call ExileServer_util_position_isPlayerNearby;
|
|
|
|
};
|
|
|
|
};
|
2015-09-04 16:35:19 +00:00
|
|
|
} forEach _this;
|
2015-08-28 21:52:56 +00:00
|
|
|
|
|
|
|
_success;
|