ACE3/addons/zeus/functions/fnc_moduleUnconscious.sqf

54 lines
1.6 KiB
Plaintext
Raw Normal View History

#include "..\script_component.hpp"
2015-05-14 22:04:58 +00:00
/*
* Author: kymckay
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);
Medical - Add AI Unconsciousness exception (when using zeus module) (#8903) * Add DF-15 GForceCoef Value This adds missing ACE_GForceCoef value for DF-15 uniforms. * DF-15 PR - cfgWeapons formating DF-15 PR - cfgWeapons formating * DF-15 PR - cfgWeapons formating II Forgot to save it with braces and spaces around = * Update CfgWeapons.hpp * sync * Add AI Unconsciousness exception option - Adds AI Unconsciousness exception option. If enabled, it allows you to put AI into unconsciousness via Zeus Module even though the AI unconsciousness is disabled. This "feature" was possible before the medical rewrite and allowed to put selected AI units into unconsciousness even though the overall AI unconsciousness was disabled. This was very handy and many groups missing this option including myself. - Special thanks to Pterolatypus for consultation. * tabs to spaces tabs to spaces * last tab to space :copium: last tab to space :copium: * stringtable tabs to spaces stringtable tabs to spaces * Addon option removed, adjusted variable name - Addon option removed - adjusted variable name * utilized QEGVAR - utilized QEGVAR in getVariable * removed fnc and put the code inside the condition - I've managed to properly implement the getVariable inside the condition thus allowing me to remove the function. Also kymckay had a good point on swapping the order for faster eval. * Update XEH_PREP.hpp * setVariable optimalization - setVariable optimalization Co-authored-by: pterolatypus <pterolatypus@users.noreply.github.com> * Update addons/medical_statemachine/Statemachine.hpp Co-authored-by: pterolatypus <pterolatypus@users.noreply.github.com> Co-authored-by: PabstMirror <pabstmirror@gmail.com> Co-authored-by: pterolatypus <pterolatypus@users.noreply.github.com>
2022-05-08 03:44:33 +00:00
if (_unconscious) then {
_unit setVariable [QEGVAR(medical_statemachine,AIUnconsciousness), nil, true];
} else {
_unit setVariable [QEGVAR(medical_statemachine,AIUnconsciousness), true, true];
};
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;