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"
|
|
|
|
|
|
|
|
private ["_caller","_unit", "_heartRateOutput", "_heartRate","_logOutPut","_content"];
|
|
|
|
_caller = _this select 0;
|
|
|
|
_unit = _this select 1;
|
|
|
|
|
|
|
|
|
2015-02-28 12:17:17 +00:00
|
|
|
_heartRate = _unit getvariable [QGVAR(heartRate), 80];
|
2015-02-23 19:35:36 +00:00
|
|
|
if (!alive _unit) then {
|
|
|
|
_heartRate = 0;
|
|
|
|
};
|
2015-03-09 21:08:43 +00:00
|
|
|
_heartRateOutput = "STR_ACE_MEDICAL_CHECK_PULSE_OUTPUT_5";
|
2015-02-23 19:35:36 +00:00
|
|
|
_logOutPut = "No heart rate";
|
|
|
|
|
|
|
|
if (_heartRate > 1.0) then {
|
|
|
|
if ([_caller] call FUNC(isMedic)) then {
|
2015-03-09 21:08:43 +00:00
|
|
|
_heartRateOutput = "STR_ACE_MEDICAL_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-03-09 21:08:43 +00:00
|
|
|
_heartRateOutput = "STR_ACE_MEDICAL_CHECK_PULSE_OUTPUT_2";
|
2015-02-23 19:35:36 +00:00
|
|
|
_logOutPut = "Weak";
|
|
|
|
if (_heartRate > 60) then {
|
|
|
|
if (_heartRate > 100) then {
|
2015-03-09 21:08:43 +00:00
|
|
|
_heartRateOutput = "STR_ACE_MEDICAL_CHECK_PULSE_OUTPUT_3";
|
2015-02-23 19:35:36 +00:00
|
|
|
_logOutPut = "Strong";
|
|
|
|
} else {
|
2015-03-09 21:08:43 +00:00
|
|
|
_heartRateOutput = "STR_ACE_MEDICAL_CHECK_PULSE_OUTPUT_4";
|
2015-02-23 19:35:36 +00:00
|
|
|
_logOutPut = "Normal";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
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 {
|
2015-04-03 19:03:39 +00:00
|
|
|
[_unit,"activity","%1 checked Heart Rate: %2",[[_caller] call EFUNC(common,getName),_logOutPut]] call FUNC(addToLog);
|
2015-02-23 19:35:36 +00:00
|
|
|
};
|