ACE3/addons/medical/functions/fnc_actionCheckPulseLocal.sqf

55 lines
1.7 KiB
Plaintext
Raw Normal View History

2015-02-23 19:35:36 +00:00
/*
* Author: Glowbal
* Local callback for checking the pulse of a patient
*
* Arguments:
* 0: The medic <OBJECT>
* 1: The patient <OBJECT>
*
* Return Value:
* NONE
*
* Public: No
*/
#include "script_component.hpp"
2015-04-30 06:17:26 +00:00
private ["_caller", "_unit", "_heartRateOutput", "_heartRate", "_logOutPut"];
2015-02-23 19:35:36 +00:00
_caller = _this select 0;
_unit = _this select 1;
_heartRate = _unit getvariable [QGVAR(heartRate), 80];
2015-02-23 19:35:36 +00:00
if (!alive _unit) then {
_heartRate = 0;
};
2015-05-28 19:59:04 +00:00
_heartRateOutput = LSTRING(Check_Pulse_Output_5);
_logOutPut = LSTRING(Check_Pulse_None);
2015-02-23 19:35:36 +00:00
if (_heartRate > 1.0) then {
if ([_caller] call FUNC(isMedic)) then {
2015-05-28 19:59:04 +00:00
_heartRateOutput = LSTRING(Check_Pulse_Output_1);
2015-02-23 19:35:36 +00:00
_logOutPut = format["%1",round(_heartRate)];
} else {
// non medical personel will only find a pulse/HR
2015-05-28 19:59:04 +00:00
_heartRateOutput = LSTRING(Check_Pulse_Output_2);
_logOutPut = LSTRING(Check_Pulse_Weak);
2015-02-23 19:35:36 +00:00
if (_heartRate > 60) then {
if (_heartRate > 100) then {
2015-05-28 19:59:04 +00:00
_heartRateOutput = LSTRING(Check_Pulse_Output_3);
_logOutPut = LSTRING(Check_Pulse_Strong);
2015-02-23 19:35:36 +00:00
} else {
2015-05-28 19:59:04 +00:00
_heartRateOutput = LSTRING(Check_Pulse_Output_4);
_logOutPut = LSTRING(Check_Pulse_Normal);
2015-02-23 19:35:36 +00:00
};
};
};
};
2015-03-09 21:08:43 +00:00
["displayTextStructured", [_caller], [[_heartRateOutput, [_unit] call EFUNC(common,getName), round(_heartRate)], 1.5, _caller]] call EFUNC(common,targetEvent);
2015-02-23 19:35:36 +00:00
if (_logOutPut != "") then {
[_unit,"activity", LSTRING(Check_Pulse_Log),[[_caller] call EFUNC(common,getName),_logOutPut]] call FUNC(addToLog);
[_unit,"quick_view", LSTRING(Check_Pulse_Log),[[_caller] call EFUNC(common,getName),_logOutPut]] call FUNC(addToLog);
2015-02-23 19:35:36 +00:00
};