mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
39 lines
1.0 KiB
Plaintext
39 lines
1.0 KiB
Plaintext
|
/*
|
||
|
* Author: BaerMitUmlaut
|
||
|
* Plays the corresponding treatment animation.
|
||
|
*
|
||
|
* Arguments:
|
||
|
* 0: Unit <OBJECT>
|
||
|
* 1: Is bandage <BOOL>
|
||
|
* 2: Is self treatment <BOOL>
|
||
|
*
|
||
|
* Return Value:
|
||
|
* Nothing
|
||
|
*
|
||
|
* Public: No
|
||
|
*/
|
||
|
#include "script_component.hpp"
|
||
|
params ["_unit", "_isBandage", "_isSelfTreatment"];
|
||
|
|
||
|
if (vehicle _unit != _unit) exitWith {};
|
||
|
|
||
|
private _animConfig = if (_isBandage) then {
|
||
|
configFile >> "ACE_Medical_Actions" >> "Basic" >> "Bandage";
|
||
|
} else {
|
||
|
configFile >> "ACE_Medical_Actions" >> "Basic" >> "Morphine";
|
||
|
};
|
||
|
|
||
|
private _configProperty = "animationCaller";
|
||
|
if (_isSelfTreatment) then {
|
||
|
_configProperty = _configProperty + "Self";
|
||
|
};
|
||
|
if (stance _unit == "PRONE") then {
|
||
|
_configProperty = _configProperty + "Prone";
|
||
|
};
|
||
|
|
||
|
private _anim = getText (_animConfig >> _configProperty);
|
||
|
private _wpn = ["non", "rfl", "pst"] select (1 + ([primaryWeapon _unit, handgunWeapon _unit] find (currentWeapon _unit)));
|
||
|
_anim = [_anim, "[wpn]", _wpn] call CBA_fnc_replace;
|
||
|
|
||
|
[_unit, _anim] call EFUNC(common,doAnimation);
|