-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Zeus module to convert drone into suicide drone (#116)
* Sort * Ignore debug helper * Add module to convert drone into suicide drone * Add dependencies * Update A3 and CBA required versions
- Loading branch information
Showing
9 changed files
with
206 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[sqf.var_all_caps] | ||
options.ignore = [ | ||
"MTS_RECOMPILES", "MTS_PREP_RECOMPILE" | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,23 @@ | ||
PREP(add3DENCommentsDrawEH); | ||
PREP(addACEUnconsciousIconDrawEH); | ||
PREP(moduleArtillery); | ||
PREP(artyAirburst); | ||
PREP(artyFireMissionHE); | ||
PREP(artyFireMissionSMOKE); | ||
PREP(artyFireMissionILLUM); | ||
PREP(execArtyStrike); | ||
PREP(artyAirburst); | ||
PREP(contextMeasureDistance); | ||
PREP(drawACEUnconsciousIcon); | ||
PREP(execArtyStrike); | ||
PREP(getModuleDestination); | ||
PREP(getTargetKnowledge); | ||
PREP(makeIntoSuicideDrone); | ||
PREP(moduleArtillery); | ||
PREP(moduleSuicideDrone); | ||
PREP(moduleTargetKnowledge); | ||
PREP(moduleUnflipVehicle); | ||
PREP(on3DENMissionSave); | ||
PREP(onZeusDisplayOpen); | ||
PREP(moduleTargetKnowledge); | ||
PREP(setAIStance); | ||
PREP(switchAIPathBehaviour); | ||
PREP(setAIBehaviour); | ||
PREP(setAICombatMode); | ||
PREP(getModuleDestination); | ||
PREP(contextMeasureDistance); | ||
PREP(setAIStance); | ||
PREP(setTargetKnowledge); | ||
PREP(getTargetKnowledge); | ||
PREP(switchAIPathBehaviour); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#include "script_component.hpp" | ||
/** | ||
* Author: Timi007 | ||
* | ||
* Description: | ||
* Turns the drone unit into a suicide drone. Must be executed where unit is local. | ||
* | ||
* Parameter(s): | ||
* 0: OBJECT - Unit that should get turned into a suicide drone. | ||
* 1: STRING - Vehicle classname of the charge which explodes when the drone is destroyed. | ||
* 2: NUMBER - Maximum ATL height where the charge does not detonate, even when the drone is destroyed. | ||
* Negative number do not set max height. (Default: No max height.) | ||
* | ||
* Returns: | ||
* Nothing. | ||
* | ||
* Example: | ||
* [_unit, "DemoCharge_Remote_Ammo_Scripted"] call mts_zeus_fnc_makeIntoSuicideDrone | ||
* | ||
*/ | ||
|
||
params [["_unit", objNull, [objNull]], ["_chargeType", "", [""]], ["_maxTriggerHeight", -1, [0]]]; | ||
TRACE_2("makeIntoSuicideDrone",_unit,_chargeType); | ||
|
||
if (isNull _unit || _chargeType isEqualTo "") exitWith {}; | ||
if (!local _unit) exitWith {}; | ||
if (_unit getVariable [QGVAR(isSuicideDrone), false]) exitWith {}; | ||
|
||
[_unit, "Killed", { | ||
_thisArgs params ["_unit", "_chargeType", "_maxTriggerHeight"]; | ||
|
||
private _posATL = getPosATLVisual _unit; | ||
if ((_posATL select 2) <= _maxTriggerHeight || _maxTriggerHeight < 0) then { | ||
private _charge = createVehicle [_chargeType, _posATL, [], 0, "CAN_COLLIDE"]; | ||
_charge setDamage 1; | ||
}; | ||
|
||
_unit removeEventHandler [_thisType, _thisId]; | ||
}, [_unit, _chargeType, _maxTriggerHeight]] call CBA_fnc_addBISEventHandler; | ||
|
||
_unit setVariable [QGVAR(isSuicideDrone), true, true]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
#include "script_component.hpp" | ||
/** | ||
* Author: Timi007 | ||
* | ||
* Description: | ||
* Adds "Make into suicide drone" as modules and to the context menu. | ||
* | ||
* Parameter(s): | ||
* None. | ||
* | ||
* Returns: | ||
* Nothing. | ||
* | ||
* Example: | ||
* call mts_zeus_fnc_moduleSuicideDrone | ||
* | ||
*/ | ||
|
||
[ | ||
LELSTRING(main,category), LLSTRING(suicideDrone), | ||
{ | ||
params ["", ["_unit", objNull, [objNull]]]; | ||
|
||
if (isNull _unit) exitWith { | ||
[LLSTRING(suicideDrone_noObject)] call zen_common_fnc_showMessage; | ||
}; | ||
|
||
if (!unitIsUAV _unit || {!alive _unit} || {!isNull objectParent _unit}) exitWith { | ||
[LLSTRING(suicideDrone_notADrone)] call zen_common_fnc_showMessage; | ||
}; | ||
|
||
if (_unit getVariable [QGVAR(isSuicideDrone), false]) exitWith { | ||
[LLSTRING(suicideDrone_isAlreadySuicideDrone)] call zen_common_fnc_showMessage; | ||
}; | ||
|
||
GVAR(chargeCache) params ["_configNames", "_displayNames"]; | ||
|
||
[ | ||
LLSTRING(suicideDrone), | ||
[ | ||
["COMBO", LLSTRING(suicideDrone_charge), [_configNames, _displayNames, 0]] | ||
], | ||
{ | ||
params ["_dialogData", "_unit"]; | ||
_dialogData params ["_chargeType"]; | ||
|
||
[_unit, _chargeType] remoteExecCall [QFUNC(makeIntoSuicideDrone), _unit]; | ||
|
||
[LLSTRING(suicideDrone_success)] call zen_common_fnc_showMessage; | ||
}, | ||
{}, | ||
_unit | ||
] call zen_dialog_fnc_create; | ||
}, | ||
"a3\drones_f\air_f_gamma\uav_01\data\ui\uav_01_ca.paa" | ||
] call zen_custom_modules_fnc_register; | ||
|
||
private _suicideDroneAction = [ | ||
QGVAR(suicideDrone), | ||
LLSTRING(suicideDrone), | ||
"a3\drones_f\air_f_gamma\uav_01\data\ui\uav_01_ca.paa", | ||
{ | ||
params ["", "_objects"]; | ||
|
||
GVAR(chargeCache) params ["_configNames", "_displayNames"]; | ||
|
||
[ | ||
LLSTRING(suicideDrone), | ||
[ | ||
["COMBO", LLSTRING(suicideDrone_charge), [_configNames, _displayNames, 0]] | ||
], | ||
{ | ||
params ["_dialogData", "_objects"]; | ||
_dialogData params ["_chargeType"]; | ||
|
||
{ | ||
if (!unitIsUAV _unit || {!isNull objectParent _unit}) then { | ||
continue; | ||
}; | ||
|
||
[_x, _chargeType] remoteExecCall [QFUNC(makeIntoSuicideDrone), _x]; | ||
} forEach _objects; | ||
|
||
[LLSTRING(suicideDrone_success)] call zen_common_fnc_showMessage; | ||
}, | ||
{}, | ||
_objects | ||
] call zen_dialog_fnc_create; | ||
}, | ||
{ | ||
params ["", "_objects"]; | ||
({unitIsUAV _x && {!(_x getVariable [QGVAR(isSuicideDrone), false])} && {alive _x} && {isNull objectParent _x}} count _objects) > 0 | ||
} | ||
] call zen_context_menu_fnc_createAction; | ||
[_suicideDroneAction, [], 0] call zen_context_menu_fnc_addAction; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters