ACE3/addons/zeus/functions/fnc_moduleHeal.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

59 lines
1.3 KiB
Plaintext

/*
* Author: mharis001
* Full heal unit.
*
* Arguments:
* 0: The module logic <OBJECT>
*
* Return Value:
* None
*
* Example:
* [LOGIC] call ace_zeus_fnc_moduleHeal
*
* Public: No
*/
#include "script_component.hpp"
params ["_logic"];
if !(local _logic) exitWith {};
private _unit = attachedTo _logic;
// Validate module target
scopeName "Main";
private _fnc_errorAndClose = {
params ["_msg"];
deleteVehicle _logic;
[_msg] call FUNC(showMessage);
breakOut "Main";
};
switch (false) do {
case !(isNull _unit): {
[LSTRING(NothingSelected)] call _fnc_errorAndClose;
};
case (_unit isKindOf "CAManBase"): {
[LSTRING(OnlyInfantry)] call _fnc_errorAndClose;
};
case (alive _unit): {
[LSTRING(OnlyAlive)] call _fnc_errorAndClose;
};
};
// Heal validated target
if (["ace_medical"] call EFUNC(common,isModLoaded) && {EGVAR(medical,level) > 0}) then {
[QEGVAR(medical,treatmentAdvanced_fullHealLocal), [_unit, _unit], _unit] call CBA_fnc_targetEvent;
} else {
// BI's scripted revive system
if ((missionNamespace getVariable ["bis_revive_mode", 0]) != 0) then {
["#rev", 1, _unit] call BIS_fnc_reviveOnState;
_unit setVariable ["#rev", 1, true];
} else {
_unit setDamage 0;
};
};
deleteVehicle _logic;