diff --git a/addons/circulation/functions/fnc_cprLocal.sqf b/addons/circulation/functions/fnc_cprLocal.sqf index da04d1571..adfabc32f 100644 --- a/addons/circulation/functions/fnc_cprLocal.sqf +++ b/addons/circulation/functions/fnc_cprLocal.sqf @@ -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 = { @@ -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; }; @@ -92,6 +97,10 @@ private _fnc_advRhythm = { { _lidoBoost = _lidoBoost + 8; }; + case "Nitroglycerin": + { + _nitroEffect = _nitroEffect + 1; + }; }; } forEach (_patient getVariable [QACEGVAR(medical,medications), []]); @@ -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]; @@ -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 { diff --git a/addons/circulation/functions/fnc_handleCardiacArrest.sqf b/addons/circulation/functions/fnc_handleCardiacArrest.sqf index 307b12e01..5a8fd0b6e 100644 --- a/addons/circulation/functions/fnc_handleCardiacArrest.sqf +++ b/addons/circulation/functions/fnc_handleCardiacArrest.sqf @@ -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];