2015-02-23 19:35:36 +00:00
|
|
|
/*
|
|
|
|
* Author: Glowbal
|
|
|
|
* Local callback for checking the blood pressure of a patient
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: The medic <OBJECT>
|
|
|
|
* 1: The patient <OBJECT>
|
|
|
|
*
|
|
|
|
* Return Value:
|
2015-08-22 14:25:10 +00:00
|
|
|
* None
|
2015-02-23 19:35:36 +00:00
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2015-08-22 14:25:10 +00:00
|
|
|
private ["_bloodPressure", "_logOutPut", "_output"];
|
|
|
|
params ["_caller", "_target"];
|
2015-02-23 19:35:36 +00:00
|
|
|
|
2015-08-22 16:33:06 +00:00
|
|
|
_bloodPressure = if (!alive _target) then {
|
|
|
|
[0,0]
|
|
|
|
} else {
|
|
|
|
[_target] call FUNC(getBloodPressure)
|
2015-02-23 19:35:36 +00:00
|
|
|
};
|
2015-08-26 08:04:51 +00:00
|
|
|
_bloodPressure params ["_bloodPressureHigh", "_bloodPressureLow"];
|
2015-02-23 19:35:36 +00:00
|
|
|
_output = "";
|
|
|
|
_logOutPut = "";
|
|
|
|
if ([_caller] call FUNC(isMedic)) then {
|
2015-05-28 19:59:04 +00:00
|
|
|
_output = LSTRING(Check_Bloodpressure_Output_1);
|
2015-02-23 19:35:36 +00:00
|
|
|
_logOutPut = format["%1/%2",round(_bloodPressureHigh),round(_bloodPressureLow)];
|
|
|
|
} else {
|
|
|
|
if (_bloodPressureHigh > 20) then {
|
2015-05-28 19:59:04 +00:00
|
|
|
_output = LSTRING(Check_Bloodpressure_Output_2);
|
2015-06-09 22:30:02 +00:00
|
|
|
_logOutPut = LSTRING(Check_Bloodpressure_Low);
|
2015-02-23 19:35:36 +00:00
|
|
|
if (_bloodPressureHigh > 100) then {
|
2015-05-28 19:59:04 +00:00
|
|
|
_output = LSTRING(Check_Bloodpressure_Output_3);
|
2015-06-09 22:30:02 +00:00
|
|
|
_logOutPut = LSTRING(Check_Bloodpressure_Normal);
|
2015-02-23 19:35:36 +00:00
|
|
|
if (_bloodPressureHigh > 160) then {
|
2015-05-28 19:59:04 +00:00
|
|
|
_output = LSTRING(Check_Bloodpressure_Output_4);
|
2015-06-09 22:30:02 +00:00
|
|
|
_logOutPut = LSTRING(Check_Bloodpressure_High);
|
2015-02-23 19:35:36 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
} else {
|
|
|
|
if (random(10) > 3) then {
|
2015-05-28 19:59:04 +00:00
|
|
|
_output = LSTRING(Check_Bloodpressure_Output_5);
|
2015-06-09 22:30:02 +00:00
|
|
|
_logOutPut = LSTRING(Check_Bloodpressure_NoBloodpressure);
|
2015-02-23 19:35:36 +00:00
|
|
|
} else {
|
2015-05-28 19:59:04 +00:00
|
|
|
_output = LSTRING(Check_Bloodpressure_Output_6);
|
2015-06-09 22:30:02 +00:00
|
|
|
//Fail to find pressure, no logoutput
|
2015-02-23 19:35:36 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2015-03-09 21:08:43 +00:00
|
|
|
["displayTextStructured", [_caller], [[_output, [_target] call EFUNC(common,getName), round(_bloodPressureHigh),round(_bloodPressureLow)], 1.75, _caller]] call EFUNC(common,targetEvent);
|
2015-02-23 19:35:36 +00:00
|
|
|
|
|
|
|
if (_logOutPut != "") then {
|
2015-06-09 22:30:02 +00:00
|
|
|
[_target,"activity", LSTRING(Check_Bloodpressure_Log), [[_caller] call EFUNC(common,getName), _logOutPut]] call FUNC(addToLog);
|
2015-08-07 17:11:57 +00:00
|
|
|
[_target,"quick_view", LSTRING(Check_Bloodpressure_Log), [[_caller] call EFUNC(common,getName), _logOutPut]] call FUNC(addToLog);
|
2015-02-23 19:35:36 +00:00
|
|
|
};
|