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 - Add Nitroglycerin Impacts to Cardiac Arrest Chance and Adjust H&T Factor Impact #711

Open
wants to merge 4 commits into
base: dev-Tomcat
Choose a base branch
from
Open
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
15 changes: 13 additions & 2 deletions addons/circulation/functions/fnc_cprLocal.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ private _randomAmi = random 4;
private _epiBoost = 1;
private _amiBoost = 0;
private _lidoBoost = 0;
private _nitroEffect = 1;
private _CPRcount = _patient getVariable [QGVAR(cprCount), 0];

private _fnc_advRhythm = {
Expand Down Expand Up @@ -62,7 +63,11 @@ private _fnc_advRhythm = {
};
};

if ((_patient getVariable [QGVAR(cardiacArrestType), 0] isEqualTo 0) && _ht) exitWith {
if !(_ht) then {
_patient setVariable [QGVAR(cardiacArrestType), 1, true];
};

if ((_patient getVariable [QGVAR(cardiacArrestType), 0] isEqualTo 0)) exitWith {
[QACEGVAR(medical,CPRSucceeded), _patient] call CBA_fnc_localEvent;
};

Expand Down Expand Up @@ -92,6 +97,10 @@ private _fnc_advRhythm = {
{
_lidoBoost = _lidoBoost + 8;
};
case "Nitroglycerin":
{
_nitroEffect = _nitroEffect + 1;
};
};
} forEach (_patient getVariable [QACEGVAR(medical,medications), []]);

Expand Down Expand Up @@ -122,7 +131,7 @@ switch (_reviveObject) do {
};

if (_reviveObject in ["AED", "AEDX"]) exitWith {
_chance = _chance + (_amiBoost + (1 max _lidoBoost) * _epiBoost);
_chance = _chance + (_amiBoost + (1 max _lidoBoost) * _epiBoost) / _nitroEffect;

private _patientState = _patient getVariable [QGVAR(cardiacArrestType), 0];

Expand Down Expand Up @@ -169,6 +178,8 @@ if !(GVAR(enable_CPR_Chances)) then {
_chance = _chance + _amiBoost;
};

_chance = _chance / _nitroEffect;

if (_random <= _chance) then {
if (GVAR(AdvRhythm)) then {
if (_patient getVariable [QGVAR(cardiacArrestType), 0] != 0) then {
Expand Down
6 changes: 6 additions & 0 deletions addons/circulation/functions/fnc_handleCardiacArrest.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ if (_initial) then {
_cardiacArrestType = 2;
};

private _nitroCount = ([_patient, "Nitroglycerin", false] call ACEFUNC(medical_status,getMedicationCount)) select 1;

if ((_nitroCount < 0.5) && ((random 3) < 1)) then {
_cardiacArrestType = 2;
};

_unit setVariable [QGVAR(cardiacArrestType), _cardiacArrestType, true];
} else {
_cardiacArrestType = _unit getVariable [QGVAR(cardiacArrestType), 0];
Expand Down
Loading