Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Surgery/Vitals - Add REBOA Impacts for CPR Success Rate and Dead/Cardiac Arrest Blood Volume Checks #698

Merged
merged 4 commits into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion addons/circulation/functions/fnc_cprLocal.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
params ["_medic", "_patient", "_reviveObject"];

private _chance = 0;
private _random = random 100;
private _random = (random 100) - (GET_REBOA_VOLUME(_patient) * 10);
private _randomAmi = random 4;
private _epiBoost = 1;
private _amiBoost = 0;
Expand Down
1 change: 1 addition & 0 deletions addons/main/script_macros.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,7 @@

//Surgery
#define STRING_BODY_PARTS ["head", "body", "left arm", "right arm", "left leg", "right leg"]
#define GET_REBOA_VOLUME(unit) ([unit] call EFUNC(surgery,reboaVolume))

//Feedback
#define VAR_PP QEGVAR(feedback,ppEffect)
Expand Down
1 change: 1 addition & 0 deletions addons/surgery/XEH_PREP.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,6 @@ PREP(reboaDeepApply);
PREP(reboaDeepApplyLocal);
PREP(reboaRemove);
PREP(reboaRemoveLocal);
PREP(reboaVolume);
PREP(ultraAssessment);
PREP(ultraAssessmentLocal);
27 changes: 27 additions & 0 deletions addons/surgery/functions/fnc_reboaVolume.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#include "..\script_component.hpp"
/*
* Author: Mazinski
* Checks blood volume protected by REBOA
*
* Arguments:
* 0: Patient <OBJECT>
*
* Return Value:
* Nothing
*
* Example:
* [player] call kat_surgery_fnc_reboaVolume
*
* Public: No
*/

params ["_patient"];

private _reboa = _patient getVariable [QGVAR(reboa), false];
private _tourniquets = GET_TOURNIQUETS(_patient);
private _volume = 0;

if (_reboa) then { _volume = _volume + 1.2; };
if ((_tourniquets select 1) != 0) then { _volume = _volume + 0.3; };

_volume
4 changes: 2 additions & 2 deletions addons/vitals/functions/fnc_handleUnitVitals.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -153,15 +153,15 @@ switch (true) do {
TRACE_3("O2 Fatal",_unit,EGVAR(breathing,SpO2_dieValue),_spo2);
[_unit, "Fatal_Blood_Oxygen"] call ACEFUNC(medical_status,setDead);
};
case (_bloodVolume < BLOOD_VOLUME_FATAL): {
case ((_bloodVolume + GET_REBOA_VOLUME(_unit)) < BLOOD_VOLUME_FATAL): {
TRACE_3("BloodVolume Fatal",_unit,BLOOD_VOLUME_FATAL,_bloodVolume);
[QACEGVAR(medical,Bleedout), _unit] call CBA_fnc_localEvent;
};
case (IN_CRDC_ARRST(_unit)): {}; // if in cardiac arrest just break now to avoid throwing unneeded events
case ((_spo2 < EGVAR(breathing,SpO2_cardiacValue)) && EGVAR(breathing,SpO2_cardiacActive)): {
[QACEGVAR(medical,FatalVitals), _unit] call CBA_fnc_localEvent;
};
case (_hemorrhage == 4): {
case ((_bloodVolume + GET_REBOA_VOLUME(_unit)) < BLOOD_VOLUME_CLASS_4_HEMORRHAGE): {
TRACE_3("Class IV Hemorrhage",_unit,_hemorrhage,_bloodVolume);
[QACEGVAR(medical,FatalVitals), _unit] call CBA_fnc_localEvent;
};
Expand Down
Loading