From 4235bd8b912291258b847c33a0f407f291f10905 Mon Sep 17 00:00:00 2001 From: commy2 Date: Wed, 18 Mar 2015 17:57:55 +0100 Subject: [PATCH] restore lost files? --- .../fnc_actionCheckBloodPressure.sqf | 18 ++++++ .../fnc_actionCheckBloodPressureLocal.sqf | 60 +++++++++++++++++++ .../functions/fnc_actionCheckPulse.sqf | 18 ++++++ 3 files changed, 96 insertions(+) create mode 100644 addons/medical/functions/fnc_actionCheckBloodPressure.sqf create mode 100644 addons/medical/functions/fnc_actionCheckBloodPressureLocal.sqf create mode 100644 addons/medical/functions/fnc_actionCheckPulse.sqf diff --git a/addons/medical/functions/fnc_actionCheckBloodPressure.sqf b/addons/medical/functions/fnc_actionCheckBloodPressure.sqf new file mode 100644 index 0000000000..7db155483e --- /dev/null +++ b/addons/medical/functions/fnc_actionCheckBloodPressure.sqf @@ -0,0 +1,18 @@ +/* +* Author: Glowbal +* Action for checking the blood pressure of the patient +* +* Arguments: +* 0: The medic +* 1: The patient +* +* Return Value: +* NONE +* +* Public: No +*/ +#include "script_component.hpp" +private ["_caller","_target"]; +_caller = _this select 0; +_target = _this select 1; +[[_caller, _target], QUOTE(DFUNC(actionCheckBloodPressureLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ diff --git a/addons/medical/functions/fnc_actionCheckBloodPressureLocal.sqf b/addons/medical/functions/fnc_actionCheckBloodPressureLocal.sqf new file mode 100644 index 0000000000..f2d01573f0 --- /dev/null +++ b/addons/medical/functions/fnc_actionCheckBloodPressureLocal.sqf @@ -0,0 +1,60 @@ +/* + * Author: Glowbal + * Local callback for checking the blood pressure of a patient + * + * Arguments: + * 0: The medic + * 1: The patient + * + * Return Value: + * NONE + * + * Public: No + */ + +#include "script_component.hpp" + +private ["_caller","_target","_bloodPressure","_bloodPressureHigh","_bloodPressureLow","_title","_content"]; +_caller = _this select 0; +_target = _this select 1; + +_bloodPressure = [_target] call FUNC(getBloodPressure); +if (!alive _target) then { + _bloodPressure = [0,0]; +}; + +_bloodPressureHigh = _bloodPressure select 1; +_bloodPressureLow = _bloodPressure select 0; +_output = ""; +_logOutPut = ""; +if ([_caller] call FUNC(isMedic)) then { + _output = "STR_ACE_MEDICAL_CHECK_BLOODPRESSURE_OUTPUT_1"; + _logOutPut = format["%1/%2",round(_bloodPressureHigh),round(_bloodPressureLow)]; +} else { + if (_bloodPressureHigh > 20) then { + _output = "STR_ACE_MEDICAL_CHECK_BLOODPRESSURE_OUTPUT_2"; + _logOutPut = "Low"; + if (_bloodPressureHigh > 100) then { + _output = "STR_ACE_MEDICAL_CHECK_BLOODPRESSURE_OUTPUT_3"; + _logOutPut = "Normal"; + if (_bloodPressureHigh > 160) then { + _output = "STR_ACE_MEDICAL_CHECK_BLOODPRESSURE_OUTPUT_4"; + _logOutPut = "High"; + }; + + }; + } else { + if (random(10) > 3) then { + _output = "STR_ACE_MEDICAL_CHECK_BLOODPRESSURE_OUTPUT_5"; + _logOutPut = "No Blood Pressure"; + } else { + _output = "STR_ACE_MEDICAL_CHECK_BLOODPRESSURE_OUTPUT_6"; + }; + }; +}; + +["displayTextStructured", [_caller], [[_output, [_target] call EFUNC(common,getName), round(_bloodPressureHigh),round(_bloodPressureLow)], 1.75, _caller]] call EFUNC(common,targetEvent); + +if (_logOutPut != "") then { + [_target,"examine", format["%1 checked Blood Pressure: %2", [_caller] call EFUNC(common,getName), _logOutPut]] call FUNC(addToLog); +}; diff --git a/addons/medical/functions/fnc_actionCheckPulse.sqf b/addons/medical/functions/fnc_actionCheckPulse.sqf new file mode 100644 index 0000000000..9fa79b2183 --- /dev/null +++ b/addons/medical/functions/fnc_actionCheckPulse.sqf @@ -0,0 +1,18 @@ +/* +* Author: Glowbal +* Action for checking the pulse or heart rate of the patient +* +* Arguments: +* 0: The medic +* 1: The patient +* +* Return Value: +* NONE +* +* Public: No +*/ +#include "script_component.hpp" +private ["_caller","_target","_title","_content"]; +_caller = _this select 0; +_target = _this select 1; +[[_caller, _target], QUOTE(DFUNC(actionCheckPulseLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */