2023-09-12 18:58:10 +00:00
|
|
|
#include "..\script_component.hpp"
|
2021-10-14 15:49:10 +00:00
|
|
|
/*
|
2023-08-16 23:18:01 +00:00
|
|
|
* Author: tcvm
|
2021-10-14 15:49:10 +00:00
|
|
|
* Decreases burning intensity on successful medical action.
|
2024-06-22 18:07:36 +00:00
|
|
|
* The medical action is looped until the user stops the interaction or the unit is no longer burning.
|
2021-10-14 15:49:10 +00:00
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: Medic <OBJECT>
|
|
|
|
* 1: Patient <OBJECT>
|
2024-06-22 18:07:36 +00:00
|
|
|
* 2: Body Part <STRING>
|
|
|
|
* 3: Treatment <STRING>
|
2021-10-14 15:49:10 +00:00
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* [player, cursorObject] call ace_fire_fnc_medical_success
|
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
|
2023-06-24 02:08:23 +00:00
|
|
|
params ["_medic", "_patient", "_bodyPart", "_classname"];
|
2021-10-14 15:49:10 +00:00
|
|
|
|
|
|
|
private _intensity = _patient getVariable [QGVAR(intensity), 0];
|
2022-08-29 00:27:10 +00:00
|
|
|
_intensity = _intensity * INTENSITY_DECREASE_MULT_PAT_DOWN;
|
2024-06-22 18:07:36 +00:00
|
|
|
|
2021-10-14 15:49:10 +00:00
|
|
|
_patient setVariable [QGVAR(intensity), _intensity, true];
|
2023-06-24 02:08:23 +00:00
|
|
|
|
2024-06-22 18:07:36 +00:00
|
|
|
// If the unit is still burning, loop the medical action
|
|
|
|
if !(_patient call FUNC(isBurning)) exitWith {
|
|
|
|
TRACE_1("patient no longer burning, quitting",_this);
|
|
|
|
};
|
2023-06-24 02:08:23 +00:00
|
|
|
|
2024-06-22 18:07:36 +00:00
|
|
|
TRACE_1("patient still burning, looping",_this);
|
2023-06-24 02:08:23 +00:00
|
|
|
|
2024-06-22 18:07:36 +00:00
|
|
|
if (EGVAR(medical_gui,pendingReopen)) then {
|
|
|
|
TRACE_1("temporarily blocking medical menu reopen",_this);
|
2023-06-24 02:08:23 +00:00
|
|
|
|
2024-06-22 18:07:36 +00:00
|
|
|
EGVAR(medical_gui,pendingReopen) = false;
|
|
|
|
[{EGVAR(medical_gui,pendingReopen) = true}] call CBA_fnc_execNextFrame;
|
2023-06-24 02:08:23 +00:00
|
|
|
};
|
2024-06-22 18:07:36 +00:00
|
|
|
|
|
|
|
[_medic, _patient, _bodyPart, _classname] call EFUNC(medical_treatment,treatment);
|