diff --git a/addons/breathing/CfgWeapons.hpp b/addons/breathing/CfgWeapons.hpp index 51075d00a..cda99aeea 100644 --- a/addons/breathing/CfgWeapons.hpp +++ b/addons/breathing/CfgWeapons.hpp @@ -79,7 +79,7 @@ class CfgWeapons { picture = QPATHTOF(ui\steth.paa); ACE_isMedicalItem = 1; class ItemInfo: CBA_MiscItem_ItemInfo { - mass = 5; + mass = 6; }; }; diff --git a/addons/circulation/ACE_Medical_Treatment_Actions.hpp b/addons/circulation/ACE_Medical_Treatment_Actions.hpp index 5c88d80e1..c38d1b432 100644 --- a/addons/circulation/ACE_Medical_Treatment_Actions.hpp +++ b/addons/circulation/ACE_Medical_Treatment_Actions.hpp @@ -1,7 +1,10 @@ class ACE_Medical_Treatment_Actions { class FieldDressing; class Morphine; - class CheckPulse; + class Diagnose; + class CheckPulse: Diagnose { + callbackSuccess = QFUNC(checkPulse); + }; class CPR { displayNameProgress = ""; treatmentTime = 0.01; @@ -27,6 +30,31 @@ class ACE_Medical_Treatment_Actions { }; class CheckBloodPressure: CheckPulse { allowedSelections[] = {"LeftArm", "RightArm", "LeftLeg", "RightLeg"}; + callbackSuccess = QFUNC(checkBloodPressure); + animationPatient = ""; + animationPatientUnconscious = "AinjPpneMstpSnonWrflDnon_rolltoback"; + animationPatientUnconsciousExcludeOn[] = {"ainjppnemstpsnonwrfldnon", "kat_recoveryposition"}; + }; + class CheckBloodPressureCuff: CheckBloodPressure { + displayName = CSTRING(Actions_CheckBloodPressureCuff); + displayNameProgress = CSTRING(Actions_CheckingBloodPressureCuff); + treatmentTime = QGVAR(treatmentTime_BPcuff); + allowedSelections[] = {"LeftArm", "RightArm", "LeftLeg", "RightLeg"}; + callbackSuccess = QFUNC(checkBloodPressureCuff); + medicRequired = QGVAR(medLvl_BPCuff); + items[] = {"kat_BPCuff"}; + animationPatient = ""; + animationPatientUnconscious = "AinjPpneMstpSnonWrflDnon_rolltoback"; + animationPatientUnconsciousExcludeOn[] = {"ainjppnemstpsnonwrfldnon", "kat_recoveryposition"}; + }; + class CheckPulseSteth: CheckPulse { + displayName = CSTRING(Actions_CheckHRSteth); + displayNameProgress = CSTRING(Actions_CheckingHRSteth); + treatmentTime = QGVAR(treatmentTime_StethHR); + allowedSelections[] = {"LeftArm", "RightArm", "LeftLeg", "RightLeg", "Body"}; + callbackSuccess = QFUNC(checkPulseSteth); + medicRequired = QGVAR(medLvl_StethHR); + items[] = {"kat_stethoscope"}; animationPatient = ""; animationPatientUnconscious = "AinjPpneMstpSnonWrflDnon_rolltoback"; animationPatientUnconsciousExcludeOn[] = {"ainjppnemstpsnonwrfldnon", "kat_recoveryposition"}; diff --git a/addons/circulation/CfgWeapons.hpp b/addons/circulation/CfgWeapons.hpp index 226b72b69..eff9bbc25 100644 --- a/addons/circulation/CfgWeapons.hpp +++ b/addons/circulation/CfgWeapons.hpp @@ -155,6 +155,17 @@ class CfgWeapons { mass = 0.1; }; }; + class kat_BPCuff: ACE_ItemCore { + scope = 2; + author = "Cplhardcore"; + displayName = CSTRING(BPCuff_display); + descriptionShort = CSTRING(BPCuff_display); + picture = QPATHTOF(ui\BPCuff.paa); + icon = ""; + class ItemInfo: CBA_MiscItem_ItemInfo { + mass = 8; + }; + }; class KAT_bloodSample: ACE_ItemCore { author = "Mazinski"; scope = 0; diff --git a/addons/circulation/XEH_PREP.hpp b/addons/circulation/XEH_PREP.hpp index a207e6fc7..68915e8aa 100644 --- a/addons/circulation/XEH_PREP.hpp +++ b/addons/circulation/XEH_PREP.hpp @@ -17,6 +17,14 @@ PREP(attachBloodGas); PREP(bloodType); PREP(bloodTypeLog); PREP(canDraw); +PREP(checkBloodPressure); +PREP(checkBloodPressureLocal); +PREP(checkBloodPressureCuff); +PREP(checkBloodPressureCuffLocal); +PREP(checkPulse); +PREP(checkPulseLocal); +PREP(checkPulseSteth); +PREP(checkPulseStethLocal); PREP(compatible); PREP(cprLocal); PREP(CPRStart); @@ -48,4 +56,4 @@ PREP(treatmentAdvanced_IV); PREP(updateBloodPressureChange); PREP(updateHeartRate); PREP(updateInternalBleeding); -PREP(wrongBloodTreatment); +PREP(wrongBloodTreatment); \ No newline at end of file diff --git a/addons/circulation/XEH_postInit.sqf b/addons/circulation/XEH_postInit.sqf index 6d2fac0dd..6340e5651 100644 --- a/addons/circulation/XEH_postInit.sqf +++ b/addons/circulation/XEH_postInit.sqf @@ -2,6 +2,10 @@ [QACEGVAR(medical_gui,updateBodyImage), LINKFUNC(gui_updateBodyImage)] call CBA_fnc_addEventHandler; [QACEGVAR(medical_treatment,fullHealLocalMod), LINKFUNC(fullHealLocal)] call CBA_fnc_addEventHandler; +[QGVAR(checkBloodPressureLocal), LINKFUNC(checkBloodPressureLocal)] call CBA_fnc_addEventHandler; +[QGVAR(checkBloodPressureCuffLocal), LINKFUNC(checkBloodPressureCuffLocal)] call CBA_fnc_addEventHandler; +[QGVAR(checkPulseLocal), LINKFUNC(checkPulseLocal)] call CBA_fnc_addEventHandler; +[QGVAR(checkPulseStethLocal), LINKFUNC(checkPulseStethLocal)] call CBA_fnc_addEventHandler; ["ace_cardiacArrest", LINKFUNC(handleCardiacArrest)] call CBA_fnc_addEventHandler; GVAR(AEDX_MonitorTarget) = objNull; diff --git a/addons/circulation/XEH_preInit.sqf b/addons/circulation/XEH_preInit.sqf index e4971657e..5236cc039 100644 --- a/addons/circulation/XEH_preInit.sqf +++ b/addons/circulation/XEH_preInit.sqf @@ -563,4 +563,40 @@ if (isServer) then { true ] call CBA_Settings_fnc_init; +[ + QGVAR(medLvl_BPCuff), + "LIST", + [LLSTRING(SETTING_BPCuff),LLSTRING(SETTING_BPCuff_DESC)], + [CBA_SETTINGS_CAT, ELSTRING(GUI,SubCategory_Basic)], + [[0, 1, 2], ["STR_ACE_Medical_Treatment_Anyone", "STR_ACE_Medical_Treatment_Medics", "STR_ACE_Medical_Treatment_Doctors"], 0], + true +] call CBA_settings_fnc_init; + +[ + QGVAR(treatmentTime_BPCuff), + "SLIDER", + [LLSTRING(treatmentTime_BPCuff)], + [CBA_SETTINGS_CAT, ELSTRING(GUI,SubCategory_Basic)], + [0.1, 30, 12, 1], + true +] call CBA_Settings_fnc_init; + +[ + QGVAR(medLvl_StethHR), + "LIST", + [LLSTRING(SETTING_StethHR),LLSTRING(SETTING_StethHR_DESC)], + [CBA_SETTINGS_CAT, ELSTRING(GUI,SubCategory_Basic)], + [[0, 1, 2], ["STR_ACE_Medical_Treatment_Anyone", "STR_ACE_Medical_Treatment_Medics", "STR_ACE_Medical_Treatment_Doctors"], 0], + true +] call CBA_settings_fnc_init; + +[ + QGVAR(treatmentTime_StethHR), + "SLIDER", + [LLSTRING(treatmentTime_StethHR)], + [CBA_SETTINGS_CAT, ELSTRING(GUI,SubCategory_Basic)], + [0.1, 30, 8, 1], + true +] call CBA_Settings_fnc_init; + ADDON = true; diff --git a/addons/circulation/functions/fnc_checkBloodPressure.sqf b/addons/circulation/functions/fnc_checkBloodPressure.sqf new file mode 100644 index 000000000..f3937fc2f --- /dev/null +++ b/addons/circulation/functions/fnc_checkBloodPressure.sqf @@ -0,0 +1,22 @@ +#include "..\script_component.hpp" +/* + * Author: Glowbal + * Checks the blood pressure of the patient. + * + * Arguments: + * 0: Medic + * 1: Patient + * 2: Body Part + * + * Return Value: + * None + * + * Example: + * [player, cursorObject, "LeftArm"] call kat_circulation_fnc_checkBloodPressure + * + * Public: No + */ + +params ["_medic", "_patient", "_bodyPart"]; + +[QGVAR(checkBloodPressureLocal), [_medic, _patient, _bodyPart], _patient] call CBA_fnc_targetEvent; \ No newline at end of file diff --git a/addons/circulation/functions/fnc_checkBloodPressureCuff.sqf b/addons/circulation/functions/fnc_checkBloodPressureCuff.sqf new file mode 100644 index 000000000..6ed58968b --- /dev/null +++ b/addons/circulation/functions/fnc_checkBloodPressureCuff.sqf @@ -0,0 +1,22 @@ +#include "..\script_component.hpp" +/* + * Author: Glowbal modified by Cplhardcore + * Checks the blood pressure of the patient. + * + * Arguments: + * 0: Medic + * 1: Patient + * 2: Body Part + * + * Return Value: + * None + * + * Example: + * [player, cursorObject, "LeftArm"] call kat_circulation_fnc_checkBloodPressure + * + * Public: No + */ + +params ["_medic", "_patient", "_bodyPart"]; + +[QGVAR(checkBloodPressureCuffLocal), [_medic, _patient, _bodyPart], _patient] call CBA_fnc_targetEvent; \ No newline at end of file diff --git a/addons/circulation/functions/fnc_checkBloodPressureCuffLocal.sqf b/addons/circulation/functions/fnc_checkBloodPressureCuffLocal.sqf new file mode 100644 index 000000000..8bdef1f28 --- /dev/null +++ b/addons/circulation/functions/fnc_checkBloodPressureCuffLocal.sqf @@ -0,0 +1,41 @@ +#include "..\script_component.hpp" +/* + * Author: Glowbal modified by Cplhardcore + * Local callback for checking the blood pressure of a patient. + * + * Arguments: + * 0: Medic + * 1: Patient + * 2: Body Part + * + * Return Value: + * None + * + * Example: + * [player, cursorObject, "LeftArm"] call kat_circulation_fnc_checkBloodPressureCuffLocal + * + * Public: No + */ + + +params ["_medic", "_patient", "_bodyPart"]; + +private _bloodPressure = [0, 0]; + +if (alive _patient && {!([_patient, _bodyPart] call ACEFUNC(medical_treatment,hasTourniquetAppliedTo))}) then { + _bloodPressure = [_patient] call FUNC(getBloodPressure); +}; + +private _bloodPressureOutput = ACELSTRING(medical_treatment,Check_Bloodpressure_Output_6); +private _logOutput = ACELSTRING(medical_treatment,Check_Bloodpressure_NoBloodpressure); + +_bloodPressure params ["_bloodPressureLow", "_bloodPressureHigh"]; + +if (_bloodPressureHigh > 20) then { + _bloodPressureOutput = ACELSTRING(medical_treatment,Check_Bloodpressure_Output_1); + _logOutput = format ["%1/%2", round _bloodPressureHigh, round _bloodPressureLow]; +}; + +[_patient, "quick_view", ACELSTRING(medical_treatment,Check_Bloodpressure_Log), [_medic call ACEFUNC(common,getName), _logOutput]] call ACEFUNC(medical_treatment,addToLog); + +[QACEGVAR(common,displayTextStructured), [[_bloodPressureOutput, _patient call ACEFUNC(common,getName), round _bloodPressureHigh, round _bloodPressureLow], 1.75, _medic], _medic] call CBA_fnc_targetEvent; \ No newline at end of file diff --git a/addons/circulation/functions/fnc_checkBloodPressureLocal.sqf b/addons/circulation/functions/fnc_checkBloodPressureLocal.sqf new file mode 100644 index 000000000..a9758e900 --- /dev/null +++ b/addons/circulation/functions/fnc_checkBloodPressureLocal.sqf @@ -0,0 +1,57 @@ +#include "..\script_component.hpp" +/* + * Author: Glowbal modified by Cplhardcore + * Local callback for checking the blood pressure of a patient. + * + * Arguments: + * 0: Medic + * 1: Patient + * 2: Body Part + * + * Return Value: + * None + * + * Example: + * [player, cursorObject, "LeftArm"] call kat_circulation_fnc_checkBloodPressureLocal + * + * Public: No + */ + +params ["_medic", "_patient", "_bodyPart"]; + +private _bloodPressure = [0, 0]; + +if (alive _patient && {!([_patient, _bodyPart] call ACEFUNC(medical_treatment,hasTourniquetAppliedTo))}) then { + _bloodPressure = [_patient] call FUNC(getBloodPressure); +}; + +private _bloodPressureOutput = ACELSTRING(medical_treatment,Check_Bloodpressure_Output_6); +private _logOutput = ACELSTRING(medical_treatment,Check_Bloodpressure_NoBloodpressure); + +_bloodPressure params ["_bloodPressureLow", "_bloodPressureHigh"]; + +if (_bloodPressureLow > 40) then { + if (_medic call ACEFUNC(medical_treatment,isMedic)) then { + _bloodPressureOutput = LSTRING(Check_Bloodpressure_Output_Palp); + _logOutput = format [LLSTRING(Bloodpressure_Output_Palp), (round (_bloodPressureLow / 10) * 10) + ([10, -10] select (random 1 > 0.5))]; + } else { + if (_bloodPressureHigh > 20) then { + _bloodPressureOutput = ACELSTRING(medical_treatment,Check_Bloodpressure_Output_2); + _logOutput = ACELSTRING(medical_treatment,Check_Bloodpressure_Low); + + if (_bloodPressureHigh > 100) then { + _bloodPressureOutput = ACELSTRING(medical_treatment,Check_Bloodpressure_Output_3); + _logOutput = ACELSTRING(medical_treatment,Check_Bloodpressure_Normal); + + if (_bloodPressureHigh > 160) then { + _bloodPressureOutput = ACELSTRING(medical_treatment,Check_Bloodpressure_Output_4); + _logOutput = ACELSTRING(medical_treatment,Check_Bloodpressure_High); + }; + }; + }; + }; +}; + +[_patient, "quick_view", ACELSTRING(medical_treatment,Check_Bloodpressure_Log), [_medic call ACEFUNC(common,getName), _logOutput]] call ACEFUNC(medical_treatment,addToLog); + +[QACEGVAR(common,displayTextStructured), [[_bloodPressureOutput, _patient call ACEFUNC(common,getName), round _bloodPressureHigh, round _bloodPressureLow], 1.75, _medic], _medic] call CBA_fnc_targetEvent; \ No newline at end of file diff --git a/addons/circulation/functions/fnc_checkPulse.sqf b/addons/circulation/functions/fnc_checkPulse.sqf new file mode 100644 index 000000000..a3121531d --- /dev/null +++ b/addons/circulation/functions/fnc_checkPulse.sqf @@ -0,0 +1,22 @@ +#include "..\script_component.hpp" +/* + * Author: Glowbal modified by Cplhardcore + * Checks the pulse or heart rate of the patient. + * + * Arguments: + * 0: Medic + * 1: Patient + * 2: Body Part + * + * Return Value: + * None + * + * Example: + * [player, cursorObject, "Head"] call kat_circulation_fnc_checkPulse + * + * Public: No + */ + +params ["_medic", "_patient", "_bodyPart"]; + +[QGVAR(checkPulseLocal), [_medic, _patient, _bodyPart], _patient] call CBA_fnc_targetEvent; \ No newline at end of file diff --git a/addons/circulation/functions/fnc_checkPulseLocal.sqf b/addons/circulation/functions/fnc_checkPulseLocal.sqf new file mode 100644 index 000000000..2f891dab8 --- /dev/null +++ b/addons/circulation/functions/fnc_checkPulseLocal.sqf @@ -0,0 +1,61 @@ +#include "..\script_component.hpp" +/* + * Author: Glowbal + * Local callback for checking the pulse or heart rate of a patient. + * + * Arguments: + * 0: Medic + * 1: Patient + * 2: Body Part + * + * Return Value: + * None + * + * Example: + * [player, cursorObject, "Head"] call ace_medical_treatment_fnc_checkPulseLocal + * + * Public: No + */ + +params ["_medic", "_patient", "_bodyPart"]; + +private _heartRate = 0; + +if !([_patient, _bodyPart] call ACEFUNC(medical_treatment,hasTourniquetAppliedTo)) then { + _heartRate = switch (true) do { + case (alive _patient): { + GET_HEART_RATE(_patient) + }; + case (alive (_patient getVariable [QACEGVAR(medical,CPR_provider), objNull])): { + random [100, 110, 120] // fake heart rate because patient is dead and off state machine + }; + default { 0 }; + }; +}; + +private _heartRateOutput = ACELSTRING(medical_treatment,Check_Pulse_Output_5); +private _logOutput = ACELSTRING(medical_treatment,Check_Pulse_None); + +if (_heartRate > 1) then { + if (_medic call ACEFUNC(medical_treatment,isMedic)) then { + _heartRateOutput = LSTRING(Check_Pulse_Output); + _logOutput = format [LLSTRING(Pulse_Output), (round(_heartRateOutput / 5) * 5)]; + } else { + _heartRateOutput = ACELSTRING(medical_treatment,Check_Pulse_Output_2); + _logOutput = ACELSTRING(medical_treatment,Check_Pulse_Weak); + + if (_heartRate > 60) then { + if (_heartRate > 100) then { + _heartRateOutput = ACELSTRING(medical_treatment,Check_Pulse_Output_3); + _logOutput = ACELSTRING(medical_treatment,Check_Pulse_Strong); + } else { + _heartRateOutput = ACELSTRING(medical_treatment,Check_Pulse_Output_4); + _logOutput = ACELSTRING(medical_treatment,Check_Pulse_Normal); + }; + }; + }; +}; + +[_patient, "quick_view", ACELSTRING(medical_treatment,Check_Pulse_Log), [_medic call ACEFUNC(common,getName), _logOutput]] call ACEFUNC(medical_treatment,addToLog); + +[QEGVAR(common,displayTextStructured), [[_heartRateOutput, _patient call ACEFUNC(common,getName), round _heartRate], 1.5, _medic], _medic] call CBA_fnc_targetEvent; \ No newline at end of file diff --git a/addons/circulation/functions/fnc_checkPulseSteth.sqf b/addons/circulation/functions/fnc_checkPulseSteth.sqf new file mode 100644 index 000000000..c13c9aece --- /dev/null +++ b/addons/circulation/functions/fnc_checkPulseSteth.sqf @@ -0,0 +1,22 @@ +#include "..\script_component.hpp" +/* + * Author: Glowbal modified by Cplhardcore + * Checks the pulse or heart rate of the patient. + * + * Arguments: + * 0: Medic + * 1: Patient + * 2: Body Part + * + * Return Value: + * None + * + * Example: + * [player, cursorObject, "Head"] call kat_circulation_fnc_checkPulseSteth + * + * Public: No + */ + +params ["_medic", "_patient", "_bodyPart"]; + +[QGVAR(checkPulseStethLocal), [_medic, _patient, _bodyPart], _patient] call CBA_fnc_targetEvent; \ No newline at end of file diff --git a/addons/circulation/functions/fnc_checkPulseStethLocal.sqf b/addons/circulation/functions/fnc_checkPulseStethLocal.sqf new file mode 100644 index 000000000..1910f5efd --- /dev/null +++ b/addons/circulation/functions/fnc_checkPulseStethLocal.sqf @@ -0,0 +1,46 @@ +#include "..\script_component.hpp" +/* + * Author: Glowbal + * Local callback for checking the pulse or heart rate of a patient. + * + * Arguments: + * 0: Medic + * 1: Patient + * 2: Body Part + * + * Return Value: + * None + * + * Example: + * [player, cursorObject, "Head"] call ace_medical_treatment_fnc_checkPulseStethLocal + * + * Public: No + */ + +params ["_medic", "_patient", "_bodyPart"]; + +private _heartRate = 0; + +if !([_patient, _bodyPart] call ACEFUNC(medical_treatment,hasTourniquetAppliedTo)) then { + _heartRate = switch (true) do { + case (alive _patient): { + GET_HEART_RATE(_patient) + }; + case (alive (_patient getVariable [QACEGVAR(medical,CPR_provider), objNull])): { + random [100, 105, 95] // fake heart rate because patient is dead and off state machine + }; + default { 0 }; + }; +}; + +private _heartRateOutput = ACELSTRING(medical_treatment,Check_Pulse_Output_5); +private _logOutput = ACELSTRING(medical_treatment,Check_Pulse_None); + +if (_heartRate > 1) then { + _heartRateOutput = ACELSTRING(medical_treatment,Check_Pulse_Output_1); + _logOutput = str round _heartRate; + }; + +[_patient, "quick_view", ACELSTRING(medical_treatment,Check_Pulse_Log), [_medic call ACEFUNC(common,getName), _logOutput]] call ACEFUNC(medical_treatment,addToLog); + +[QEGVAR(common,displayTextStructured), [[_heartRateOutput, _patient call ACEFUNC(common,getName), round _heartRate], 1.5, _medic], _medic] call CBA_fnc_targetEvent; \ No newline at end of file diff --git a/addons/circulation/stringtable.xml b/addons/circulation/stringtable.xml index 7a0566eb2..b870ed8bc 100644 --- a/addons/circulation/stringtable.xml +++ b/addons/circulation/stringtable.xml @@ -3177,5 +3177,53 @@ Probabilidade de progressão de tamponamento Tamponade progressie kans + + Blood Pressure Cuff + + + A medical device to accurately determine a patients blood pressure + + + Check BP with BP Cuff + + + Checking BP with BP Cuff + + + Allow BP Cuff + + + Training Level for use of the BP Cuff + + + Time to measure BP with BP Cuff + + + You find a blood pressure of %3 over Palp + + + %1 over Palp + + + You find a Pulse Rate of %2 + + + %1 PPM + + + Allow Stethoscope HR check + + + Training Level for use of the Stethoscope to measure HR + + + Time to measure HR with a Stethoscope + + + Check HR w/ Stethoscope + + + Checking HR with Stethoscope + diff --git a/addons/circulation/ui/BPCuff.paa b/addons/circulation/ui/BPCuff.paa new file mode 100644 index 000000000..032f5e103 Binary files /dev/null and b/addons/circulation/ui/BPCuff.paa differ