2023-09-12 18:58:10 +00:00
|
|
|
#include "..\script_component.hpp"
|
2016-09-04 09:25:03 +00:00
|
|
|
/*
|
|
|
|
* Author: BaerMitUmlaut
|
|
|
|
* Plays the corresponding treatment animation.
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: Unit <OBJECT>
|
2019-07-03 14:59:28 +00:00
|
|
|
* 1: Treatment name <STRING>
|
2016-09-04 09:25:03 +00:00
|
|
|
* 2: Is self treatment <BOOL>
|
|
|
|
*
|
|
|
|
* Return Value:
|
2017-06-08 13:31:51 +00:00
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Example:
|
2024-07-29 13:04:59 +00:00
|
|
|
* [cursorObject, "Splint", true] call ace_medical_ai_fnc_playTreatmentAnim
|
2016-09-04 09:25:03 +00:00
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
2024-07-23 13:28:40 +00:00
|
|
|
|
2019-07-03 14:59:28 +00:00
|
|
|
params ["_unit", "_actionName", "_isSelfTreatment"];
|
|
|
|
TRACE_3("playTreatmentAnim",_unit,_actionName,_isSelfTreatment);
|
2016-09-04 09:25:03 +00:00
|
|
|
|
2024-03-26 12:54:06 +00:00
|
|
|
if (!isNull objectParent _unit) exitWith {};
|
2016-09-04 09:25:03 +00:00
|
|
|
|
2019-06-03 15:31:46 +00:00
|
|
|
private _configProperty = "animationMedic";
|
2016-09-04 09:25:03 +00:00
|
|
|
if (_isSelfTreatment) then {
|
|
|
|
_configProperty = _configProperty + "Self";
|
|
|
|
};
|
|
|
|
if (stance _unit == "PRONE") then {
|
|
|
|
_configProperty = _configProperty + "Prone";
|
|
|
|
};
|
|
|
|
|
2019-07-03 14:59:28 +00:00
|
|
|
private _anim = getText (configFile >> QEGVAR(medical_treatment,Actions) >> _actionName >> _configProperty);
|
|
|
|
if (_anim == "") exitWith { WARNING_2("no anim [%1, %2]",_actionName,_configProperty); };
|
|
|
|
|
2016-11-03 23:01:58 +00:00
|
|
|
private _wpn = switch (true) do {
|
|
|
|
case ((currentWeapon _unit) == ""): {"non"};
|
|
|
|
case ((currentWeapon _unit) == (primaryWeapon _unit)): {"rfl"};
|
|
|
|
case ((currentWeapon _unit) == (handgunWeapon _unit)): {"pst"};
|
|
|
|
default {"non"};
|
|
|
|
};
|
2016-09-04 09:25:03 +00:00
|
|
|
_anim = [_anim, "[wpn]", _wpn] call CBA_fnc_replace;
|
|
|
|
|
|
|
|
[_unit, _anim] call EFUNC(common,doAnimation);
|