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:
|
|
|
|
* 0: The module logic <LOGIC>
|
|
|
|
* 1: units <ARRAY>
|
|
|
|
* 2: activated <BOOL>
|
|
|
|
*
|
|
|
|
* ReturnValue:
|
|
|
|
* nil
|
|
|
|
*
|
|
|
|
* Public: no
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2015-05-18 11:36:39 +00:00
|
|
|
PARAMS_3(_logic,_units,_activated);
|
2015-07-20 20:07:53 +00:00
|
|
|
private ["_mouseOver","_unit","_conscious"];
|
2015-05-18 11:36:39 +00:00
|
|
|
|
2015-07-29 11:25:04 +00:00
|
|
|
if !(_activated && local _logic) exitWith {};
|
2015-05-18 11:36:39 +00:00
|
|
|
|
|
|
|
if (isNil QEFUNC(medical,setUnconscious)) then {
|
2015-06-04 18:33:19 +00:00
|
|
|
[LSTRING(RequiresAddon)] call EFUNC(common,displayTextStructured);
|
2015-05-18 11:36:39 +00:00
|
|
|
} else {
|
2015-07-20 20:07:53 +00:00
|
|
|
_mouseOver = GETMVAR(bis_fnc_curatorObjectPlaced_mouseOver,[""]);
|
2015-05-18 11:36:39 +00:00
|
|
|
|
2015-07-20 20:07:53 +00:00
|
|
|
if ((_mouseOver select 0) != "OBJECT") then {
|
2015-06-04 18:33:19 +00:00
|
|
|
[LSTRING(NothingSelected)] call EFUNC(common,displayTextStructured);
|
2015-05-18 21:49:47 +00:00
|
|
|
} else {
|
2015-07-20 20:07:53 +00:00
|
|
|
_unit = effectivecommander (_mouseOver select 1);
|
|
|
|
|
2015-05-18 21:49:47 +00:00
|
|
|
if !(_unit isKindOf "CAManBase") then {
|
2015-06-04 18:33:19 +00:00
|
|
|
[LSTRING(OnlyInfantry)] call EFUNC(common,displayTextStructured);
|
2015-05-18 21:49:47 +00:00
|
|
|
} else {
|
|
|
|
if !(alive _unit) then {
|
2015-06-04 18:33:19 +00:00
|
|
|
[LSTRING(OnlyAlive)] call EFUNC(common,displayTextStructured);
|
2015-05-18 21:49:47 +00:00
|
|
|
} else {
|
|
|
|
_conscious = GETVAR(_unit,ACE_isUnconscious,false);
|
|
|
|
// Function handles locality for me
|
|
|
|
[_unit, !_conscious, round(random(10)+5), true] call EFUNC(medical,setUnconscious);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2015-05-14 22:04:58 +00:00
|
|
|
};
|
|
|
|
|
2015-05-18 11:36:39 +00:00
|
|
|
deleteVehicle _logic;
|