2023-09-12 18:58:10 +00:00
|
|
|
#include "..\script_component.hpp"
|
2017-05-10 16:29:04 +00:00
|
|
|
/*
|
|
|
|
* Author: bux, PabstMirror
|
|
|
|
* Commands the selected unit or group to start suppressive fire on the unit, group or location the module is placed on
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: Unit <OBJECT>
|
|
|
|
* 1: Fire Pos ASL <ARRAY>
|
|
|
|
* 2: Artiller Magazine <STRING>
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
2017-06-08 13:31:51 +00:00
|
|
|
* Example:
|
|
|
|
* [bob, [5, 6, 7], "bigmagazine"] call ace_zeus_fnc_moduleSuppressiveFireLocal
|
|
|
|
*
|
2017-05-10 16:29:04 +00:00
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
|
|
|
|
params ["_unit", "_targetASL", "_artilleryMag"];
|
|
|
|
TRACE_4("moduleSuppressiveFireLocal",_unit,local _unit,_targetASL,_artilleryMag);
|
|
|
|
|
|
|
|
if (_artilleryMag != "") exitWith {
|
|
|
|
(vehicle _unit) doArtilleryFire [ASLtoAGL _targetASL, _artilleryMag, 4];
|
|
|
|
TRACE_3("doArtilleryFire",_unit,_targetASL,_artilleryMag);
|
|
|
|
};
|
|
|
|
|
|
|
|
[{
|
|
|
|
params ["_unit", "_burstsLeft", "_nextRun", "_targetASL", "_artilleryMag"];
|
|
|
|
if (!alive _unit) exitWith {true};
|
|
|
|
if (CBA_missionTime >= _nextRun) then {
|
|
|
|
_burstsLeft = _burstsLeft - 1;
|
|
|
|
_this set [1, _burstsLeft];
|
|
|
|
_this set [2, _nextRun + 4];
|
|
|
|
_unit doSuppressiveFire _targetASL;
|
|
|
|
TRACE_2("doSuppressiveFire",_unit,_targetASL);
|
|
|
|
};
|
|
|
|
(_burstsLeft <= 0)
|
|
|
|
}, {
|
|
|
|
TRACE_1("Done",_this);
|
|
|
|
}, [_unit, 11, CBA_missionTime, _targetASL, _artilleryMag]] call CBA_fnc_waitUntilAndExecute;
|
|
|
|
|