ACE3/addons/zeus/functions/fnc_moduleUnconscious.sqf

49 lines
1.3 KiB
Plaintext
Raw Normal View History

#include "script_component.hpp"
2015-05-14 22:04:58 +00:00
/*
* Author: SilentSpike
2015-07-20 20:07:53 +00:00
* Flips the unconscious state of the unit the module is placed on.
2015-05-14 22:04:58 +00:00
*
* Arguments:
2015-08-15 20:11:49 +00:00
* 0: The module logic <OBJECT>
* 1: Synchronized units <ARRAY>
* 2: Activated <BOOL>
2015-05-14 22:04:58 +00:00
*
2015-08-15 20:11:49 +00:00
* Return Value:
* None
2015-05-14 22:04:58 +00:00
*
* Example:
* [LOGIC, [bob, kevin], true] call ace_zeus_fnc_moduleUnconscious
*
2015-08-15 20:11:49 +00:00
* Public: No
2015-05-14 22:04:58 +00:00
*/
params ["_logic"];
if !(local _logic) exitWith {};
if (isNil QEFUNC(medical,setUnconscious)) then {
[LSTRING(RequiresAddon)] call FUNC(showMessage);
} else {
private _mouseOver = GETMVAR(bis_fnc_curatorObjectPlaced_mouseOver,[""]);
2015-07-20 20:07:53 +00:00
if ((_mouseOver select 0) != "OBJECT") then {
[LSTRING(NothingSelected)] call FUNC(showMessage);
2015-05-18 21:49:47 +00:00
} else {
private _unit = effectivecommander (_mouseOver select 1);
2015-07-20 20:07:53 +00:00
2015-05-18 21:49:47 +00:00
if !(_unit isKindOf "CAManBase") then {
[LSTRING(OnlyInfantry)] call FUNC(showMessage);
2015-05-18 21:49:47 +00:00
} else {
if !(alive _unit) then {
[LSTRING(OnlyAlive)] call FUNC(showMessage);
2015-05-18 21:49:47 +00:00
} else {
private _unconscious = GETVAR(_unit,ACE_isUnconscious,false);
2015-05-18 21:49:47 +00:00
// Function handles locality for me
[_unit, !_unconscious, 10e10] call EFUNC(medical,setUnconscious);
2015-05-18 21:49:47 +00:00
};
};
};
2015-05-14 22:04:58 +00:00
};
deleteVehicle _logic;