Skip to content

Commit

Permalink
Circulation - Cardiac Arrest Hold for H&T Conditions (#692)
Browse files Browse the repository at this point in the history
**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}`.
  • Loading branch information
mazinskihenry authored Jan 14, 2025
1 parent e06c27d commit 66c97ae
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
10 changes: 10 additions & 0 deletions addons/circulation/XEH_preInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
7 changes: 6 additions & 1 deletion addons/circulation/functions/fnc_cprLocal.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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;
};

Expand Down
3 changes: 3 additions & 0 deletions addons/circulation/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3051,6 +3051,9 @@
<Italian>Peso del tempo di deterioramento casuale</Italian>
<Chinesesimp>随机劣化时间权重</Chinesesimp>
</Key>
<Key ID="STR_KAT_Circulation_SETTING_AdvRhythm_HTHold">
<English>Enable H-and-T Holding in Arrest</English>
</Key>
<Key ID="STR_KAT_Circulation_SETTING_AdvRhythm_deteriorateAfterTreatment">
<English>Deteriorate After Treatment</English>
<Japanese>治療後に調律状態が悪化するようにする</Japanese>
Expand Down

0 comments on commit 66c97ae

Please sign in to comment.