2016-07-15 10:23:47 +00:00
|
|
|
/*
|
|
|
|
* Author: Glowbal
|
|
|
|
* Local callback for checking the pulse of a patient
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: The medic <OBJECT>
|
|
|
|
* 1: The patient <OBJECT>
|
2016-10-13 19:08:41 +00:00
|
|
|
* 2: Body part <STRING>
|
2016-07-15 10:23:47 +00:00
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2016-10-13 19:08:41 +00:00
|
|
|
params ["_caller", "_target", "_bodyPart"];
|
|
|
|
|
2016-12-07 10:32:01 +00:00
|
|
|
private _heartRate = 0;
|
2016-07-15 10:23:47 +00:00
|
|
|
|
2018-07-18 10:09:48 +00:00
|
|
|
if (alive _target && !([_target, _bodyPart] call FUNC(hasTourniquetAppliedTo))) then {
|
2018-05-11 15:11:01 +00:00
|
|
|
_heartRate = GET_HEART_RATE(_target);
|
2016-07-15 10:23:47 +00:00
|
|
|
};
|
2016-10-13 19:08:41 +00:00
|
|
|
|
2016-07-15 10:23:47 +00:00
|
|
|
private _heartRateOutput = ELSTRING(medical,Check_Pulse_Output_5);
|
|
|
|
private _logOutPut = ELSTRING(medical,Check_Pulse_None);
|
|
|
|
|
|
|
|
if (_heartRate > 1.0) then {
|
2018-07-18 10:09:48 +00:00
|
|
|
if (_caller call FUNC(isMedic)) then {
|
2016-07-15 10:23:47 +00:00
|
|
|
_heartRateOutput = ELSTRING(medical,Check_Pulse_Output_1);
|
2016-10-13 19:08:41 +00:00
|
|
|
_logOutPut = format ["%1", round(_heartRate)];
|
2016-07-15 10:23:47 +00:00
|
|
|
} else {
|
|
|
|
// non medical personel will only find a pulse/HR
|
|
|
|
_heartRateOutput = ELSTRING(medical,Check_Pulse_Output_2);
|
|
|
|
_logOutPut = ELSTRING(medical,Check_Pulse_Weak);
|
2016-10-13 19:08:41 +00:00
|
|
|
|
2016-07-15 10:23:47 +00:00
|
|
|
if (_heartRate > 60) then {
|
|
|
|
if (_heartRate > 100) then {
|
|
|
|
_heartRateOutput = ELSTRING(medical,Check_Pulse_Output_3);
|
|
|
|
_logOutPut = ELSTRING(medical,Check_Pulse_Strong);
|
|
|
|
} else {
|
|
|
|
_heartRateOutput = ELSTRING(medical,Check_Pulse_Output_4);
|
|
|
|
_logOutPut = ELSTRING(medical,Check_Pulse_Normal);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2016-10-13 19:08:41 +00:00
|
|
|
[QEGVAR(common,displayTextStructured), [[_heartRateOutput, _target call EFUNC(common,getName), round _heartRate], 1.5, _caller], _caller] call CBA_fnc_targetEvent;
|
2016-07-15 10:23:47 +00:00
|
|
|
|
|
|
|
if (_logOutPut != "") then {
|
2016-10-13 19:08:41 +00:00
|
|
|
[_target, "activity", ELSTRING(medical,Check_Pulse_Log), [_caller call EFUNC(common,getName), _logOutPut]] call FUNC(addToLog);
|
|
|
|
[_target, "quick_view", ELSTRING(medical,Check_Pulse_Log), [_caller call EFUNC(common,getName), _logOutPut]] call FUNC(addToLog);
|
2016-07-15 10:23:47 +00:00
|
|
|
};
|