ACE3/addons/zeus/functions/fnc_bi_moduleArsenal.sqf
mharis001 bca8b01860 Various additions to ace_zeus (#6036)
* Add search to teleport players UI

* Change group side icons to look better

* Improve teleport UI and add stringtable entries

* Add Assign Repair Vehicle module

* Add Assign Repair Facility module

* Add Assign Engineer module

* Add Full Heal module

* Add Suicide Bomber module

* Make heal module work without ace_medical

* Add suicide bomber module translations

* Improve attribute cargo to use displayName

* Improve set engineer ui

* ACE_Curator for repair modules + author array

* Add angle param to getModuleDestination

* Prevent multiple suicide bomber modules on same target

* Heal module: support BI scripted revive system

* Requested changes
2018-02-24 11:44:57 -06:00

66 lines
2.2 KiB
Plaintext

/*
* Author: Bohemia Interactive
* Module function to open a full arsenal on a unit
* Edited to use ACE arsenal when present, moved isPlayer check
*
* Arguments:
* 0: The module logic <LOGIC>
* 1: Not used
* 2: activated <BOOL>
*
* Return Value:
* None
*
* Example:
* [LOGIC, nil, true] call ace_zeus_fnc_bi_moduleArsenal
*
* Public: No
*/
#include "script_component.hpp"
params ["_logic", "", "_activated"];
if (_activated && local _logic) then {
_unit = _logic getvariable ["bis_fnc_curatorAttachObject_object",objnull];
//--- Check if the unit is suitable
_error = "";
switch true do {
case (isnull _unit): {_error = localize "str_a3_BIS_fnc_showCuratorFeedbackMessage_506";};
case !(alive _unit): {_error = localize "str_a3_BIS_fnc_moduleArsenal_errorDead";};
case (isnull group _unit || !(side group _unit in [east,west,resistance,civilian])): {_error = localize "str_a3_BIS_fnc_moduleArsenal_errorBrain";};
case (vehicle _unit != _unit || effectivecommander _unit != _unit): {_error = localize "str_a3_BIS_fnc_moduleArsenal_errorVehicle";};
};
if (_error == "") then {
if (["ACE_Arsenal"] call EFUNC(common,isModLoaded)) then {
if (!isPlayer _unit || {player == _unit}) then {
[{
params ["_unit"];
[_unit, _unit, true] call EFUNC(arsenal,openBox);
}, [_unit]] call CBA_fnc_directCall;
} else {
[objNull, localize "str_a3_BIS_fnc_moduleArsenal_errorDead"] call bis_fnc_showCuratorFeedbackMessage;
};
} else {
if !(isPlayer _unit) then {
([] call bis_fnc_rscLayer) cuttext ["","black out",0.5];
["#(argb,8,8,3)color(0,0,0,1)",false,nil,0,[0.5,0]] call bis_fnc_textTiles;
["Open",[true,nil,_unit]] call bis_fnc_arsenal;
([] call bis_fnc_rscLayer) cuttext ["","plain"];
} else {
[objNull, localize "str_a3_BIS_fnc_moduleArsenal_errorDead"] call bis_fnc_showCuratorFeedbackMessage;
};
};
} else {
[objNull,_error] call bis_fnc_showCuratorFeedbackMessage;
};
deleteVehicle _logic;
};