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

Circulation - Cardiac Arrest Hold for H&T Conditions #692

Merged
merged 1 commit into from
Jan 14, 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
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
Loading