2023-09-12 18:58:10 +00:00
|
|
|
#include "..\script_component.hpp"
|
2019-06-03 15:31:46 +00:00
|
|
|
/*
|
|
|
|
* Author: KoffeinFlummi, Glowbal, mharis001
|
|
|
|
* Handles treatment process success.
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: Arguments <ARRAY>
|
|
|
|
* 0: Medic <OBJECT>
|
|
|
|
* 1: Patient <OBJECT>
|
|
|
|
* 2: Body Part <STRING>
|
|
|
|
* 3: Treatment <STRING>
|
|
|
|
* 4: Item User <OBJECT>
|
|
|
|
* 5: Used Item <STRING>
|
2024-04-07 01:11:51 +00:00
|
|
|
* 6: Create Litter <BOOL>
|
2019-06-03 15:31:46 +00:00
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
|
|
|
|
params ["_args"];
|
2024-04-07 01:11:51 +00:00
|
|
|
_args params ["_medic", "_patient", "_bodyPart", "_classname", "_itemUser", "_usedItem", "_createLitter"];
|
|
|
|
TRACE_7("",_medic,_patient,_bodyPart,_classname,_itemUser,_usedItem,_createLitter);
|
2019-06-03 15:31:46 +00:00
|
|
|
|
|
|
|
// Switch medic to end animation immediately
|
|
|
|
private _endInAnim = _medic getVariable QGVAR(endInAnim);
|
|
|
|
|
|
|
|
if (!isNil "_endInAnim") then {
|
|
|
|
if (animationState _medic != _endInAnim) then {
|
|
|
|
[_medic, _endInAnim, 2] call EFUNC(common,doAnimation);
|
|
|
|
};
|
|
|
|
|
|
|
|
_medic setVariable [QGVAR(endInAnim), nil];
|
|
|
|
};
|
|
|
|
|
|
|
|
// Reset medic animation speed coefficient
|
|
|
|
[QEGVAR(common,setAnimSpeedCoef), [_medic, 1]] call CBA_fnc_globalEvent;
|
|
|
|
|
|
|
|
if (!isNil QEGVAR(advanced_fatigue,setAnimExclusions)) then {
|
|
|
|
EGVAR(advanced_fatigue,setAnimExclusions) deleteAt (EGVAR(advanced_fatigue,setAnimExclusions) find QUOTE(ADDON));
|
|
|
|
};
|
|
|
|
|
|
|
|
// Call treatment specific success callback
|
|
|
|
GET_FUNCTION(_callbackSuccess,configFile >> QGVAR(actions) >> _classname >> "callbackSuccess");
|
|
|
|
|
|
|
|
_args call _callbackSuccess;
|
|
|
|
|
|
|
|
// Call litter creation handler
|
2024-04-07 01:11:51 +00:00
|
|
|
if (_createLitter) then { _args call FUNC(createLitter); };
|
2019-06-03 15:31:46 +00:00
|
|
|
|
|
|
|
// Emit local event for medical API
|
2024-04-26 22:35:57 +00:00
|
|
|
["ace_treatmentSucceded", [_medic, _patient, _bodyPart, _classname, _itemUser, _usedItem, _createLitter]] call CBA_fnc_localEvent;
|