From 66c97ae2499d8b8a27e08bd55d2602a89507de41 Mon Sep 17 00:00:00 2001
From: mazinskihenry <33608576+mazinskihenry@users.noreply.github.com>
Date: Tue, 14 Jan 2025 08:28:38 -0800
Subject: [PATCH] Circulation - Cardiac Arrest Hold for H&T Conditions (#692)
**When merged this pull request will:**
- Adds setting for H&T conditions to make cardiac arrest never succeed
when H&T conditions are present
### IMPORTANT
- [Development Guidelines](https://ace3.acemod.org/wiki/development/)
are read, understood and applied.
- Title of this PR uses our standard template `Component -
Add|Fix|Improve|Change|Make|Remove {changes}`.
---
addons/circulation/XEH_preInit.sqf | 10 ++++++++++
addons/circulation/functions/fnc_cprLocal.sqf | 7 ++++++-
addons/circulation/stringtable.xml | 3 +++
3 files changed, 19 insertions(+), 1 deletion(-)
diff --git a/addons/circulation/XEH_preInit.sqf b/addons/circulation/XEH_preInit.sqf
index 577b7236b..5ace247aa 100644
--- a/addons/circulation/XEH_preInit.sqf
+++ b/addons/circulation/XEH_preInit.sqf
@@ -399,6 +399,16 @@ if (isServer) then {
true
] call CBA_Settings_fnc_init;
+// Sets whether or not H&T conditions keep patients in cardiac arrest until resolved
+[
+ QGVAR(AdvRhythm_HTHold),
+ "CHECKBOX",
+ LLSTRING(SETTING_AdvRhythm_HTHold),
+ [CBA_SETTINGS_CAT, LSTRING(SubCategory_AdvRhythms)],
+ [false],
+ true
+] call CBA_Settings_fnc_init;
+
// Sets chance for Pulseless Electrical Activity / Asystole
[
QGVAR(AdvRhythm_PEAChance),
diff --git a/addons/circulation/functions/fnc_cprLocal.sqf b/addons/circulation/functions/fnc_cprLocal.sqf
index 8d2871964..13c0a5ca8 100644
--- a/addons/circulation/functions/fnc_cprLocal.sqf
+++ b/addons/circulation/functions/fnc_cprLocal.sqf
@@ -32,6 +32,11 @@ private _fnc_advRhythm = {
params ["_patient", ["_CPR",false]];
private _patientState = _patient getVariable [QGVAR(cardiacArrestType), 0];
+ private _ht = if (GVAR(AdvRhythm_HTHold)) then {
+ ((count(_patient getVariable [QGVAR(ht), []])) == 0)
+ } else {
+ true
+ };
if (_CPR) then {
if (floor (random 100) < GVAR(AdvRhythm_CPR_ROSC_Chance)) then {
@@ -57,7 +62,7 @@ private _fnc_advRhythm = {
};
};
- if (_patient getVariable [QGVAR(cardiacArrestType), 0] isEqualTo 0) exitWith {
+ if ((_patient getVariable [QGVAR(cardiacArrestType), 0] isEqualTo 0) && _ht) exitWith {
[QACEGVAR(medical,CPRSucceeded), _patient] call CBA_fnc_localEvent;
};
diff --git a/addons/circulation/stringtable.xml b/addons/circulation/stringtable.xml
index 3ee2b3c3e..4a5d4b172 100644
--- a/addons/circulation/stringtable.xml
+++ b/addons/circulation/stringtable.xml
@@ -3051,6 +3051,9 @@
Peso del tempo di deterioramento casuale
随机劣化时间权重
+
+ Enable H-and-T Holding in Arrest
+
Deteriorate After Treatment
治療後に調律状態が悪化するようにする