diff --git a/addons/breathing/functions/fnc_fullHealLocal.sqf b/addons/breathing/functions/fnc_fullHealLocal.sqf index e0af97d7b..3c7dd4ae9 100644 --- a/addons/breathing/functions/fnc_fullHealLocal.sqf +++ b/addons/breathing/functions/fnc_fullHealLocal.sqf @@ -28,7 +28,7 @@ _patient setVariable [QGVAR(etco2Monitor), [], true]; _patient setVariable [QGVAR(breathRate), 15, true]; _patient setVariable [QGVAR(nasalCannula), false, true]; _patient setVariable [QGVAR(lungSurfaceArea), 400]; - +_patient setvariable [QGVAR(respiratoryRateMultiplier), 1]; if (ACEGVAR(advanced_fatigue,enabled)) then { ["kat_LSDF"] call ACEFUNC(advanced_fatigue,removeDutyFactor); }; diff --git a/addons/main/script_macros.hpp b/addons/main/script_macros.hpp index 0cdd5eb99..b981e8b7c 100644 --- a/addons/main/script_macros.hpp +++ b/addons/main/script_macros.hpp @@ -189,6 +189,7 @@ #undef GET_BLOOD_VOLUME #define GET_OPIOID_FACTOR(unit) (unit getVariable [QEGVAR(pharma,opioidFactor), 0]) +#define GET_OPIOID_DEPRESSION(unit) (unit getVariable [QEGVAR(pharma,opioidDepression), 0]) #define GET_PAIN_PERCEIVED(unit) (0 max ((GET_PAIN(unit) - GET_PAIN_SUPPRESS(unit)) min 1)) #undef GET_DAMAGE_THRESHOLD diff --git a/addons/pharma/ACE_Medical_Treatment.hpp b/addons/pharma/ACE_Medical_Treatment.hpp index 58d683171..4bcab3826 100644 --- a/addons/pharma/ACE_Medical_Treatment.hpp +++ b/addons/pharma/ACE_Medical_Treatment.hpp @@ -92,18 +92,6 @@ class ACE_ADDON(Medical_Treatment) { incompatibleMedication[] = {}; viscosityChange = 0; }; - class Alteplase { - painReduce = 0; - hrIncreaseLow[] = {-4, -10}; - hrIncreaseNormal[] = {-5, -15}; - hrIncreaseHigh[] = {-5, -20}; - timeInSystem = 180; - timeTillMaxEffect = 30; - maxDose = 1; - maxDoseDeviation = 0; - incompatibleMedication[] = {}; - viscosityChange = 0; - }; class AdenosineIV { painReduce = 0; hrIncreaseLow[] = {-7, -10}; @@ -727,6 +715,18 @@ class ACE_ADDON(Medical_Treatment) { timeTillMaxEffect = 15; viscosityChange = 0; }; + class syringe_alteplase_5ml_3 { + painReduce = 0; + hrIncreaseLow[] = {-4, -10}; + hrIncreaseNormal[] = {-5, -15}; + hrIncreaseHigh[] = {-5, -20}; + timeInSystem = 180; + timeTillMaxEffect = 30; + maxDose = 1; + maxDoseDeviation = 0; + incompatibleMedication[] = {}; + viscosityChange = 0; + }; class syringe_fentanyl_10ml_1 { painReduce = 0.6; hrIncreaseLow[] = {-5, -10}; diff --git a/addons/pharma/functions/fnc_fullHealLocal.sqf b/addons/pharma/functions/fnc_fullHealLocal.sqf index 7800a79b1..aa566ab51 100644 --- a/addons/pharma/functions/fnc_fullHealLocal.sqf +++ b/addons/pharma/functions/fnc_fullHealLocal.sqf @@ -48,6 +48,7 @@ _patient setVariable [QGVAR(externalPh), 0, true]; _patient setVariable [QGVAR(pH), 0, true]; _patient setVariable [QGVAR(opioidFactor), 0, true]; +_patient setVariable [QGVAR(opioidDepressionFactor), 0, true]; _patient setVariable [QGVAR(kidneyFail), false, true]; _patient setVariable [QGVAR(kidneyArrest), false, true]; diff --git a/addons/pharma/functions/fnc_medicationLocal.sqf b/addons/pharma/functions/fnc_medicationLocal.sqf index 689c3f3dc..46dbf7ca2 100644 --- a/addons/pharma/functions/fnc_medicationLocal.sqf +++ b/addons/pharma/functions/fnc_medicationLocal.sqf @@ -92,6 +92,7 @@ private _alphaFactor = GET_NUMBER(_medicationConfig >> "alphaFactor", private _maxRelief = GET_NUMBER(_medicationConfig >> "maxRelief",getNumber (_defaultConfig >> "maxRelief")); private _opioidRelief = GET_NUMBER(_medicationConfig >> "opioidRelief",getNumber (_defaultConfig >> "opioidRelief")); private _opioidEffect = GET_NUMBER(_medicationConfig >> "opioidEffect",getNumber (_defaultConfig >> "opioidEffect")); +private _opioidDepression = GET_NUMBER(_medicationConfig >> "opioidRelief",getNumber (_defaultConfig >> "opioidRelief")); private _heartRate = GET_HEART_RATE(_patient); private _hrIncrease = [_hrIncreaseLow, _hrIncreaseNormal, _hrIncreaseHigh] select (floor ((0 max _heartRate min 110) / 55)); @@ -113,14 +114,14 @@ if ([QGVAR(AMS_Enabled)] call CBA_settings_fnc_get) then { }; // Adjust the medication effects and add the medication to the list TRACE_3("adjustments",_heartRateChange,_painReduce,_viscosityChange); - [_patient, _medicationName, _timeTillMaxEffect, _timeInSystem, _heartRateChange, _painReduce, _viscosityChange, _alphaFactor, _opioidRelief, _opioidEffect] call EFUNC(vitals,addMedicationAdjustment); + [_patient, _medicationName, _timeTillMaxEffect, _timeInSystem, _heartRateChange, _painReduce, _viscosityChange, _alphaFactor, _opioidRelief, _opioidEffect, _opioidDepression] call EFUNC(vitals,addMedicationAdjustment); // Check for medication compatiblity [_patient, _medicationName, _maxDose, _maxDoseDeviation, _incompatibleMedication] call ACEFUNC(medical_treatment,onMedicationUsage); } else { // Adjust the medication effects and add the medication to the list TRACE_3("adjustments",_heartRateChange,_painReduce,_viscosityChange); - [_patient, _className, _timeTillMaxEffect, _timeInSystem, _heartRateChange, _painReduce, _viscosityChange, _alphaFactor, _opioidRelief, _opioidEffect] call EFUNC(vitals,addMedicationAdjustment); + [_patient, _className, _timeTillMaxEffect, _timeInSystem, _heartRateChange, _painReduce, _viscosityChange, _alphaFactor, _opioidRelief, _opioidEffect, _opioidDepression] call EFUNC(vitals,addMedicationAdjustment); // Check for medication compatiblity [_patient, _className, _maxDose, _maxDoseDeviation, _incompatibleMedication] call ACEFUNC(medical_treatment,onMedicationUsage); diff --git a/addons/pharma/functions/fnc_treatmentAdvanced_AdenosineOverdoseLocal.sqf b/addons/pharma/functions/fnc_treatmentAdvanced_AdenosineOverdoseLocal.sqf index 594b920e0..efbe7ec38 100644 --- a/addons/pharma/functions/fnc_treatmentAdvanced_AdenosineOverdoseLocal.sqf +++ b/addons/pharma/functions/fnc_treatmentAdvanced_AdenosineOverdoseLocal.sqf @@ -14,4 +14,52 @@ * * Public: No */ -params ["_patient"]; \ No newline at end of file +params ["_patient"]; +[{ + params ["_patient"]; + private _adenosineOverdoseTarget = 0; + [{ + params ["_patient", "_idPFH"]; + if (!(alive _patient)) exitWith { + [_idPFH] call CBA_fnc_removePerFrameHandler; + }; + _adenosineOverdoseTarget = _adenosineOverdoseTarget + 1; + if (_adenosineOverdoseTarget > 12) exitWith { + if (random(100) < 15) then { + [{ + params ["_args", "_idPFH"]; + _args params ["_patient"]; + private _ht = _patient getVariable [QEGVAR(circulation,ht), []]; + if ((_ht findIf {_x isEqualTo "adenosineOD"}) == -1) then { + _ht pushBack "adenosineOD"; + + if (_patient getVariable [QEGVAR(circulation,cardiacArrestType), 0] == 0) then { + [QACEGVAR(medical,FatalVitals), _patient] call CBA_fnc_localEvent; + }; + + _patient setVariable [QEGVAR(circulation,ht), _ht, true]; + }; + }, [_patient], 15] call CBA_fnc_waitAndExecute; + }; + [_idPFH] call CBA_fnc_removePerFrameHandler; + }; + private _surfaceArea = (_patient getVariable [QEGVAR(breathing,lungSurfaceArea), 400]) - 10; + _patient setVariable [QEGVAR(breathing,lungSurfaceArea), _surfaceArea]; + }, 15, [_patient]] call CBA_fnc_addPerFrameHandler; +}, _patient, 15] call CBA_fnc_waitAndExecute; +[{ + params ["_patient"]; + private _AdenosineTarget = 0; + [{ + params ["_patient", "_idPFH"]; + if (!(alive _patient)) exitWith { + [_idPFH] call CBA_fnc_removePerFrameHandler; + }; + _AdenosineTarget = _AdenosineTarget + 1; + if (_AdenosineTarget > 18) exitWith { + [_idPFH] call CBA_fnc_removePerFrameHandler; + }; + private _surfaceArea = (_patient getVariable [QEGVAR(breathing,lungSurfaceArea), 400]) + 10; + _patient setVariable [QEGVAR(breathing,lungSurfaceArea), _surfaceArea]; + }, 10, [_patient]] call CBA_fnc_addPerFrameHandler; +}, _patient, 300] call CBA_fnc_waitAndExecute; \ No newline at end of file diff --git a/addons/pharma/functions/fnc_treatmentAdvanced_AmiodaroneOverdoseLocal.sqf b/addons/pharma/functions/fnc_treatmentAdvanced_AmiodaroneOverdoseLocal.sqf index 0c42d6cf4..145e73b2e 100644 --- a/addons/pharma/functions/fnc_treatmentAdvanced_AmiodaroneOverdoseLocal.sqf +++ b/addons/pharma/functions/fnc_treatmentAdvanced_AmiodaroneOverdoseLocal.sqf @@ -17,4 +17,4 @@ params ["_patient"]; private _hrAdjust = -50 + floor random ((-30 - -50) + 1); [_patient, "BRADYCARDIA", 120, 1200, _hrAdjust, "", "", "", "", ""] call EFUNC(vitals,addMedicationAdjustment); -[_patient, AmiodaroneOverdose, 30, 600, "", "", "", 0.2, "", ""] call EFUNC(vitals,addMedicationAdjustment); +[_patient, "AmiodaroneOverdose", 30, 600, "", "", "", 0.2, "", ""] call EFUNC(vitals,addMedicationAdjustment); diff --git a/addons/pharma/functions/fnc_treatmentAdvanced_AtropineOverdoseLocal.sqf b/addons/pharma/functions/fnc_treatmentAdvanced_AtropineOverdoseLocal.sqf index 184e8aeb8..d6d7cd9d9 100644 --- a/addons/pharma/functions/fnc_treatmentAdvanced_AtropineOverdoseLocal.sqf +++ b/addons/pharma/functions/fnc_treatmentAdvanced_AtropineOverdoseLocal.sqf @@ -14,4 +14,56 @@ * * Public: No */ -params ["_patient"]; \ No newline at end of file +params ["_patient"]; +[{ + params ["_patient"]; + private _adenosineOverdoseTarget = 0; + [{ + params ["_patient", "_idPFH"]; + if (!(alive _patient)) exitWith { + [_idPFH] call CBA_fnc_removePerFrameHandler; + }; + _adenosineOverdoseTarget = _adenosineOverdoseTarget + 1; + if (_adenosineOverdoseTarget > 12) exitWith { + if (random(100) < 15) then { + [{ + params ["_args", "_idPFH"]; + _args params ["_patient"]; + private _ht = _patient getVariable [QEGVAR(circulation,ht), []]; + if ((_ht findIf {_x isEqualTo "adenosineOD"}) == -1) then { + _ht pushBack "adenosineOD"; + + if (_patient getVariable [QEGVAR(circulation,cardiacArrestType), 0] == 0) then { + [QACEGVAR(medical,FatalVitals), _patient] call CBA_fnc_localEvent; + }; + + _patient setVariable [QEGVAR(circulation,ht), _ht, true]; + }; + }, [_patient], 15] call CBA_fnc_waitAndExecute; + }; + [_idPFH] call CBA_fnc_removePerFrameHandler; + }; + private _depression = _unit getVariable [QEGVAR(pharma,opioidDepressionFactor)] + 0.05; + _patient setVariable [QEGVAR(pharma,opioidDepressionFactor), _depression]; + private _rr = _patient getvariable [QEGVAR(breathing,respiratoryRateMultiplier), 1] - 0.07; + _patient setvariable [QEGVAR(breathing,respiratoryRateMultiplier), _rr]; + }, 15, [_patient]] call CBA_fnc_addPerFrameHandler; +}, _patient, 15] call CBA_fnc_waitAndExecute; +[{ + params ["_patient"]; + private _AdenosineTarget = 0; + [{ + params ["_patient", "_idPFH"]; + if (!(alive _patient)) exitWith { + [_idPFH] call CBA_fnc_removePerFrameHandler; + }; + _AdenosineTarget = _AdenosineTarget + 1; + if (_AdenosineTarget > 18) exitWith { + [_idPFH] call CBA_fnc_removePerFrameHandler; + }; + private _depression = _unit getVariable [QEGVAR(pharma,opioidDepressionFactor)] - 0.05; + _patient setVariable [QEGVAR(pharma,opioidDepressionFactor), _depression]; + private _rr = _patient getvariable [QEGVAR(breathing,respiratoryRateMultiplier), 1] + 0.07; + _patient setvariable [QEGVAR(breathing,respiratoryRateMultiplier), _rr]; + }, 10, [_patient]] call CBA_fnc_addPerFrameHandler; +}, _patient, 300] call CBA_fnc_waitAndExecute; diff --git a/addons/pharma/functions/fnc_treatmentAdvanced_CWMPOverdoseLocal.sqf b/addons/pharma/functions/fnc_treatmentAdvanced_CWMPOverdoseLocal.sqf index 01c0baac3..66a3683f1 100644 --- a/addons/pharma/functions/fnc_treatmentAdvanced_CWMPOverdoseLocal.sqf +++ b/addons/pharma/functions/fnc_treatmentAdvanced_CWMPOverdoseLocal.sqf @@ -31,12 +31,9 @@ if GVAR(kidneyAction) then [_idPFH] call CBA_fnc_removePerFrameHandler;}; private _ph = _patient getVariable [QGVAR(externalPh), _ph, true] + 100; _patient setVariable [QGVAR(externalPh), _ph, true]; - private _coagulationFactor = (_patient getVariable [QGVAR(coagulationFactor), 30]); - private _factorstoremove = 1; - _patient setVariable [QGVAR(coagulationFactor), (_coagulationFactor - _factorstoremove), true]; }, 10, [_patient]] call CBA_fnc_addPerFrameHandler; }, _patient, 15] call CBA_fnc_waitAndExecute; -} +}; [{ params ["_patient"]; private _bpTarget = 0; @@ -49,5 +46,8 @@ if GVAR(kidneyAction) then if (_bpTarget > 12) exitWith { [_idPFH] call CBA_fnc_removePerFrameHandler;}; [_patient, -2, -2, "CWMPOverdose"] call kat_circulation_fnc_updateBloodPressureChange; + private _coagulationFactor = (_patient getVariable [QGVAR(coagulationFactor), 30]); + private _factorstoremove = 1; + _patient setVariable [QGVAR(coagulationFactor), (_coagulationFactor - _factorstoremove), true]; }, 15, [_patient]] call CBA_fnc_addPerFrameHandler; }, _patient, 15] call CBA_fnc_waitAndExecute; \ No newline at end of file diff --git a/addons/pharma/functions/fnc_treatmentAdvanced_EtomidateOverdoseLocal.sqf b/addons/pharma/functions/fnc_treatmentAdvanced_EtomidateOverdoseLocal.sqf index b2ff1731c..f6a4928ed 100644 --- a/addons/pharma/functions/fnc_treatmentAdvanced_EtomidateOverdoseLocal.sqf +++ b/addons/pharma/functions/fnc_treatmentAdvanced_EtomidateOverdoseLocal.sqf @@ -15,32 +15,172 @@ * Public: No */ params ["_patient"]; -private _random = random 3; -if (_random <= 1) then { - private _hrAdjust = -40 + floor random ((-20 - -40) + 1); - [_patient, "BRADYCARDIA", 120, 1200, _hrAdjust, "", "", "", "", ""] call EFUNC(vitals,addMedicationAdjustment); -}; -private _randomNumber = floor (random 1) + 1; +private _randomNumber = floor (random 3) + 1; switch (_randomNumber) do { case 1: { - private _bpAdjust = -20 + floor random ((-5 - -20) + 1); - [_patient, _bpAdjust, _bpAdjust, "EtomidateOverdose"] call kat_circulation_fnc_updateBloodPressureChange; + private _bpAdjust = -20 + floor random ((-5 - -20) + 1); + [_patient, _bpAdjust, _bpAdjust, "EtomidateOverdose"] call kat_circulation_fnc_updateBloodPressureChange; private _hrAdjust = -40 + floor random ((-20 - -40) + 1); - [_patient, "BRADYCARDIA", 120, 1200, _hrAdjust, "", "", "", "", ""] call EFUNC(vitals,addMedicationAdjustment); + [_patient, "BRADYCARDIA", 120, 1200, _hrAdjust, "", "", "", "", ""] call EFUNC(vitals,addMedicationAdjustment); + [{ + params ["_patient"]; + private _etomidateOverdoseTarget = 0; + [{ + params ["_patient", "_idPFH"]; + if (!(alive _patient)) exitWith { + [_idPFH] call CBA_fnc_removePerFrameHandler; + }; + _etomidateOverdoseTarget = _etomidateOverdoseTarget + 1; + if (_etomidateOverdoseTarget > 12) exitWith { + if (random(100) < 25) then { + [{ + params ["_args", "_idPFH"]; + _args params ["_patient"]; + private _ht = _patient getVariable [QEGVAR(circulation,ht), []]; + if ((_ht findIf {_x isEqualTo "lidocaineOD"}) == -1) then { + _ht pushBack "lidocaineOD"; + + if (_patient getVariable [QEGVAR(circulation,cardiacArrestType), 0] == 0) then { + [QACEGVAR(medical,FatalVitals), _patient] call CBA_fnc_localEvent; + }; + + _patient setVariable [QEGVAR(circulation,ht), _ht, true]; + }; + }, [_patient], 15] call CBA_fnc_waitAndExecute; + }; + [_idPFH] call CBA_fnc_removePerFrameHandler; + }; + private _depression = _unit getVariable [QEGVAR(pharma,opioidDepressionFactor)] + 0.08; + _patient setVariable [QEGVAR(pharma,opioidDepressionFactor), _depression]; + }, 30, [_patient]] call CBA_fnc_addPerFrameHandler; + }, _patient, 30] call CBA_fnc_waitAndExecute; }; case 2: { - private _bpAdjust = -20 + floor random ((-5 - -20) + 1); - [_patient, _bpAdjust, _bpAdjust, "EtomidateOverdose"] call kat_circulation_fnc_updateBloodPressureChange; + private _bpAdjust = -20 + floor random ((-5 - -20) + 1); + [_patient, _bpAdjust, _bpAdjust, "EtomidateOverdose"] call kat_circulation_fnc_updateBloodPressureChange; + private _hrAdjust = 20 + floor random ((40 - 20) + 1); + [_patient, "TACHYCARDIA", 120, 1200, _hrAdjust, "", "", "", "", ""] call EFUNC(vitals,addMedicationAdjustment); + [{ + params ["_patient"]; + private _etomidateOverdoseTarget = 0; + [{ + params ["_patient", "_idPFH"]; + if (!(alive _patient)) exitWith { + [_idPFH] call CBA_fnc_removePerFrameHandler; + }; + _etomidateOverdoseTarget = _etomidateOverdoseTarget + 1; + if (_etomidateOverdoseTarget > 12) exitWith { + if (random(100) < 25) then { + [{ + params ["_args", "_idPFH"]; + _args params ["_patient"]; + private _ht = _patient getVariable [QEGVAR(circulation,ht), []]; + if ((_ht findIf {_x isEqualTo "lidocaineOD"}) == -1) then { + _ht pushBack "lidocaineOD"; + + if (_patient getVariable [QEGVAR(circulation,cardiacArrestType), 0] == 0) then { + [QACEGVAR(medical,FatalVitals), _patient] call CBA_fnc_localEvent; + }; + + _patient setVariable [QEGVAR(circulation,ht), _ht, true]; + }; + }, [_patient], 15] call CBA_fnc_waitAndExecute; + }; + [_idPFH] call CBA_fnc_removePerFrameHandler; + }; + private _depression = _unit getVariable [QEGVAR(pharma,opioidDepressionFactor)] + 0.08; + _patient setVariable [QEGVAR(pharma,opioidDepressionFactor), _depression]; + }, 30, [_patient]] call CBA_fnc_addPerFrameHandler; + }, _patient, 30] call CBA_fnc_waitAndExecute; + }; + case 3: { + private _bpAdjust = -20 + floor random ((-5 - -20) + 1); + [_patient, _bpAdjust, _bpAdjust, "EtomidateOverdose"] call kat_circulation_fnc_updateBloodPressureChange; private _hrAdjust = 20 + floor random ((40 - 20) + 1); - [_patient, "TACHYCARDIA", 120, 1200, _hrAdjust, "", "", "", "", ""] call EFUNC(vitals,addMedicationAdjustment); + [_patient, "TACHYCARDIA", 120, 1200, _hrAdjust, "", "", "", "", ""] call EFUNC(vitals,addMedicationAdjustment); + [{ + params ["_patient"]; + private _etomidateOverdoseTarget = 0; + [{ + params ["_patient", "_idPFH"]; + if (!(alive _patient)) exitWith { + [_idPFH] call CBA_fnc_removePerFrameHandler; + }; + _etomidateOverdoseTarget = _etomidateOverdoseTarget + 1; + if (_etomidateOverdoseTarget > 12) exitWith { + if (random(100) < 15) then { + [{ + params ["_args", "_idPFH"]; + _args params ["_patient"]; + private _ht = _patient getVariable [QEGVAR(circulation,ht), []]; + if ((_ht findIf {_x isEqualTo "lidocaineOD"}) == -1) then { + _ht pushBack "lidocaineOD"; + + if (_patient getVariable [QEGVAR(circulation,cardiacArrestType), 0] == 0) then { + [QACEGVAR(medical,FatalVitals), _patient] call CBA_fnc_localEvent; + }; + + _patient setVariable [QEGVAR(circulation,ht), _ht, true]; + }; + }, [_patient], 15] call CBA_fnc_waitAndExecute; + }; + [_idPFH] call CBA_fnc_removePerFrameHandler; + }; + private _depression = _unit getVariable [QEGVAR(pharma,opioidDepressionFactor)] + 0.08; + _patient setVariable [QEGVAR(pharma,opioidDepressionFactor), _depression]; + private _rr = _patient getvariable [QEGVAR(breathing,respiratoryRateMultiplier), 1] - 0.06; + _patient setvariable [QEGVAR(breathing,respiratoryRateMultiplier), _rr]; + }, 30, [_patient]] call CBA_fnc_addPerFrameHandler; + }, _patient, 30] call CBA_fnc_waitAndExecute; + }; + case 3: { + private _bpAdjust = -20 + floor random ((-5 - -20) + 1); + [_patient, _bpAdjust, _bpAdjust, "EtomidateOverdose"] call kat_circulation_fnc_updateBloodPressureChange; + private _hrAdjust = -40 + floor random ((-20 - -40) + 1); + [_patient, "BRADYCARDIA", 120, 1200, _hrAdjust, "", "", "", "", ""] call EFUNC(vitals,addMedicationAdjustment); + [{ + params ["_patient"]; + private _etomidateOverdoseTarget = 0; + [{ + params ["_patient", "_idPFH"]; + if (!(alive _patient)) exitWith { + [_idPFH] call CBA_fnc_removePerFrameHandler; + }; + _etomidateOverdoseTarget = _etomidateOverdoseTarget + 1; + if (_etomidateOverdoseTarget > 12) exitWith { + if (random(100) < 15) then { + [{ + params ["_args", "_idPFH"]; + _args params ["_patient"]; + private _ht = _patient getVariable [QEGVAR(circulation,ht), []]; + if ((_ht findIf {_x isEqualTo "lidocaineOD"}) == -1) then { + _ht pushBack "lidocaineOD"; + + if (_patient getVariable [QEGVAR(circulation,cardiacArrestType), 0] == 0) then { + [QACEGVAR(medical,FatalVitals), _patient] call CBA_fnc_localEvent; + }; + + _patient setVariable [QEGVAR(circulation,ht), _ht, true]; + }; + }, [_patient], 15] call CBA_fnc_waitAndExecute; + }; + [_idPFH] call CBA_fnc_removePerFrameHandler; + }; + private _depression = _unit getVariable [QEGVAR(pharma,opioidDepressionFactor)] + 0.08; + _patient setVariable [QEGVAR(pharma,opioidDepressionFactor), _depression]; + private _rr = _patient getvariable [QEGVAR(breathing,respiratoryRateMultiplier), 1] - 0.06; + _patient setvariable [QEGVAR(breathing,respiratoryRateMultiplier), _rr]; + }, 30, [_patient]] call CBA_fnc_addPerFrameHandler; + }, _patient, 30] call CBA_fnc_waitAndExecute; }; }; if QEGVAR(feedback,effectOverdose) then - {PP_wetD = ppEffectCreate ["WetDistortion",300]; - PP_wetD ppEffectEnable true; - PP_wetD ppEffectAdjust [9.7,0.2,-0.1,1.84,1.46,0.33,0.86,0.05,0.05,0.05,0.05,0.1,0.1,0.2,0.2]; - PP_wetD ppEffectCommit 0; - // Date YYYY-MM-DD-HH-MM: [2035,6,24,8,0]. Overcast: 0.3. Fog: 0.0823474. Fog params: [0.0800016,0.013,0] - // GF PostProcess Editor parameters: Copy the following line to clipboard and click Import in the editor. - //[[false,100,[0.2,0.2,0.26,0.3]],[false,200,[0.05,0.05,true]],[true,300,[9.7,0.2,-0.1,1.84,1.46,0.33,0.86,0.05,0.05,0.05,0.05,0.1,0.1,0.2,0.2]],[false,1500,[1,1,0,[2,2,2,-0.1],[5,5,5,1],[4,0.33,0.33,0],[0.66,0,0.96,0,0,0,4]]],[false,500,[2.06]],[false,2000,[0.44,1,1,0.5,0.5,true]],[false,2500,[1,1,1]]] - [{PP_wetD ppEffectEnable false; PP_wetD ppEffectCommit 0;}, [], 600] call CBA_fnc_waitAndExecute;}: \ No newline at end of file + { + PP_wetD = ppEffectCreate ["WetDistortion",300]; + PP_wetD ppEffectEnable true; + PP_wetD ppEffectAdjust [9.7,0.2,-0.1,1.84,1.46,0.33,0.86,0.05,0.05,0.05,0.05,0.1,0.1,0.2,0.2]; + PP_wetD ppEffectCommit 0; + // Date YYYY-MM-DD-HH-MM: [2035,6,24,8,0]. Overcast: 0.3. Fog: 0.0823474. Fog params: [0.0800016,0.013,0] + // GF PostProcess Editor parameters: Copy the following line to clipboard and click Import in the editor. + //[[false,100,[0.2,0.2,0.26,0.3]],[false,200,[0.05,0.05,true]],[true,300,[9.7,0.2,-0.1,1.84,1.46,0.33,0.86,0.05,0.05,0.05,0.05,0.1,0.1,0.2,0.2]],[false,1500,[1,1,0,[2,2,2,-0.1],[5,5,5,1],[4,0.33,0.33,0],[0.66,0,0.96,0,0,0,4]]],[false,500,[2.06]],[false,2000,[0.44,1,1,0.5,0.5,true]],[false,2500,[1,1,1]]] + [{PP_wetD ppEffectEnable false; PP_wetD ppEffectCommit 0;}, [], 600] call CBA_fnc_waitAndExecute;}; \ No newline at end of file diff --git a/addons/pharma/functions/fnc_treatmentAdvanced_FentanylOverdoseLocal.sqf b/addons/pharma/functions/fnc_treatmentAdvanced_FentanylOverdoseLocal.sqf index 9bf52f81e..882dcf043 100644 --- a/addons/pharma/functions/fnc_treatmentAdvanced_FentanylOverdoseLocal.sqf +++ b/addons/pharma/functions/fnc_treatmentAdvanced_FentanylOverdoseLocal.sqf @@ -44,9 +44,9 @@ private _hrAdjust = -50 + floor random ((-30 - -50) + 1); }, [_patient], 10] call CBA_fnc_waitAndExecute; [_idPFH] call CBA_fnc_removePerFrameHandler; }; - private _medications = _patient getVariable [QACEGVAR(medical,medications), []]; - if (_medications findIf {_x isEqualTo "naloxone"} != -1) exitWith {}; - private _depression = _unit getVariable [QEGVAR(pharma,opioidFactor)] + 0.1; - _patient setVariable [QEGVAR(pharma,opioidFactor), _depression]; + private _medications = _patient getVariable [QACEGVAR(medical,medications), []]; + if (_medications findIf {_x isEqualTo "naloxone"} != -1) exitWith {}; + private _depression = _unit getVariable [QEGVAR(pharma,opioidDepressionFactor)] + 0.08; + _patient setVariable [QEGVAR(pharma,opioidDepressionFactor), _depression]; }, 10, [_patient]] call CBA_fnc_addPerFrameHandler; }, _patient, 10] call CBA_fnc_waitAndExecute; diff --git a/addons/pharma/functions/fnc_treatmentAdvanced_FlumazenilLocal.sqf b/addons/pharma/functions/fnc_treatmentAdvanced_FlumazenilLocal.sqf index c40be45a6..21c041efd 100644 --- a/addons/pharma/functions/fnc_treatmentAdvanced_FlumazenilLocal.sqf +++ b/addons/pharma/functions/fnc_treatmentAdvanced_FlumazenilLocal.sqf @@ -18,3 +18,25 @@ params ["_patient"]; _patient setVariable [QEGVAR(surgery,sedated), false, true]; +private _medications = _patient getVariable [QACEGVAR(medical,medications), []]; +if (_medications findIf {_x isEqualTo "Lorazepam"} != ) exitWith {[{ + params ["_patient"]; + private _FlumanzenilTarget = 0; + [{ + params ["_patient", "_idPFH"]; + if (!(alive _patient)) exitWith { + [_idPFH] call CBA_fnc_removePerFrameHandler; + }; + _FlumanzenilTarget = _FlumanzenilTarget + 1; + if (_FlumanzenilTarget > 12) exitWith { + [{ + params ["_args", "_idPFH"]; + _args params ["_patient"]; + }, [_patient], 15] call CBA_fnc_waitAndExecute; + [_idPFH] call CBA_fnc_removePerFrameHandler; + }; + private _depression = _unit getVariable [QEGVAR(pharma,opioidDepressionFactor)] - 0.08; + _patient setVariable [QEGVAR(pharma,opioidDepressionFactor), _depression]; + }, 60, [_patient]] call CBA_fnc_addPerFrameHandler; +}, _patient, 60] call CBA_fnc_waitAndExecute;}; + diff --git a/addons/pharma/functions/fnc_treatmentAdvanced_FlumazenilOverdoseLocal.sqf b/addons/pharma/functions/fnc_treatmentAdvanced_FlumazenilOverdoseLocal.sqf index 1784c47eb..269819a9b 100644 --- a/addons/pharma/functions/fnc_treatmentAdvanced_FlumazenilOverdoseLocal.sqf +++ b/addons/pharma/functions/fnc_treatmentAdvanced_FlumazenilOverdoseLocal.sqf @@ -14,4 +14,17 @@ * * Public: No */ -params ["_patient"]; \ No newline at end of file +params ["_patient"]; +private _hrAdjust = 20 + floor random ((40 - 20) + 1); +[_patient, "TACHYCARDIA", 120, 1200, _hrAdjust, "", "", "", "", ""] call EFUNC(vitals,addMedicationAdjustment); +if QEGVAR(feedback,effectOverdose) then + { + PP_wetD = ppEffectCreate ["WetDistortion",300]; + PP_wetD ppEffectEnable true; + PP_wetD ppEffectAdjust [10,0.2,0.2,1.84,1.46,0.33,0.86,0.05,0.05,0.05,0.05,0.1,0.1,0.2,0.2]; + PP_wetD ppEffectCommit 0; + [{PP_wetD ppEffectEnable false; PP_wetD ppEffectCommit 0;}, [], 600] call CBA_fnc_waitAndExecute;}; + // Date YYYY-MM-DD-HH-MM: [2035,6,24,8,0]. Overcast: 0.3. Fog: 0.0806154. Fog params: [0.0800015,0.013,0] + // GF PostProcess Editor parameters: Copy the following line to clipboard and click Import in the editor. + //[[false,100,[0.2,0.2,0.26,0.3]],[false,200,[0.05,0.05,true]],[true,300,[10,0.2,0.2,1.84,1.46,0.33,0.86,0.05,0.05,0.05,0.05,0.1,0.1,0.2,0.2]],[false,1500,[1,1,0,[2,2,2,-0.1],[5,5,5,1],[4,0.33,0.33,0],[0.66,0,0.96,0,0,0,4]]],[false,500,[2.06]],[false,2000,[0.44,1,1,0.5,0.5,true]],[false,2500,[1,1,1]]] + \ No newline at end of file diff --git a/addons/pharma/functions/fnc_treatmentAdvanced_KetamineOverdoseLocal.sqf b/addons/pharma/functions/fnc_treatmentAdvanced_KetamineOverdoseLocal.sqf index 220aff5c8..be8d2fc20 100644 --- a/addons/pharma/functions/fnc_treatmentAdvanced_KetamineOverdoseLocal.sqf +++ b/addons/pharma/functions/fnc_treatmentAdvanced_KetamineOverdoseLocal.sqf @@ -16,4 +16,37 @@ * * Public: No */ -params ["_patient"]; \ No newline at end of file +params ["_patient"]; +[{ + params ["_patient"]; + private _KetamineOverdoseTarget = 0; + [{ + params ["_patient", "_idPFH"]; + if (!(alive _patient)) exitWith { + [_idPFH] call CBA_fnc_removePerFrameHandler; + }; + _KetamineOverdoseTarget = _KetamineOverdoseTarget + 1; + if (_KetamineOverdoseTarget > 12) exitWith { + if (random(100) < 25) then { + [{ + params ["_args", "_idPFH"]; + _args params ["_patient"]; + private _ht = _patient getVariable [QEGVAR(circulation,ht), []]; + if ((_ht findIf {_x isEqualTo "KetamineOD"}) == -1) then { + _ht pushBack "KetamineOD"; + + if (_patient getVariable [QEGVAR(circulation,cardiacArrestType), 0] == 0) then { + [QACEGVAR(medical,FatalVitals), _patient] call CBA_fnc_localEvent; + }; + _patient setVariable [QEGVAR(circulation,ht), _ht, true]; + }; + }, [_patient], 15] call CBA_fnc_waitAndExecute; + }; + [_idPFH] call CBA_fnc_removePerFrameHandler; + }; + private _rr = _patient getvariable [QEGVAR(breathing,respiratoryRateMultiplier), 1] - 0.04; + _patient setvariable [QEGVAR(breathing,respiratoryRateMultiplier), _rr]; + private _depression = _unit getVariable [QEGVAR(pharma,opioidDepressionFactor)] + 0.04; + _patient setVariable [QEGVAR(pharma,opioidDepressionFactor), _depression]; + }, 15, [_patient]] call CBA_fnc_addPerFrameHandler; +}, _patient, 15] call CBA_fnc_waitAndExecute; \ No newline at end of file diff --git a/addons/pharma/functions/fnc_treatmentAdvanced_LidocaineOverdoseLocal.sqf b/addons/pharma/functions/fnc_treatmentAdvanced_LidocaineOverdoseLocal.sqf index a10b8e371..6ed5cd4ea 100644 --- a/addons/pharma/functions/fnc_treatmentAdvanced_LidocaineOverdoseLocal.sqf +++ b/addons/pharma/functions/fnc_treatmentAdvanced_LidocaineOverdoseLocal.sqf @@ -15,3 +15,41 @@ * Public: No */ params ["_patient"]; +private _bpAdjust = -40 + floor random ((-25 - -40) + 1); +[_patient, _bpAdjust, _bpAdjust, "lidocaineOverdose"] call kat_circulation_fnc_updateBloodPressureChange; +private _hrAdjust = -50 + floor random ((-30 - -50) + 1); +[_patient, "BRADYCARDIA", 120, 1200, _hrAdjust, "", "", "", "", ""] call EFUNC(vitals,addMedicationAdjustment); +[{ + params ["_patient"]; + private _lidocaineOverdoseTarget = 0; + [{ + params ["_patient", "_idPFH"]; + if (!(alive _patient)) exitWith { + [_idPFH] call CBA_fnc_removePerFrameHandler; + }; + _lidocaineOverdoseTarget = _lidocaineOverdoseTarget + 1; + if (_lidocaineOverdoseTarget > 12) exitWith { + if (random(100) < 25) then { + [{ + params ["_args", "_idPFH"]; + _args params ["_patient"]; + private _ht = _patient getVariable [QEGVAR(circulation,ht), []]; + if ((_ht findIf {_x isEqualTo "lidocaineOD"}) == -1) then { + _ht pushBack "lidocaineOD"; + + if (_patient getVariable [QEGVAR(circulation,cardiacArrestType), 0] == 0) then { + [QACEGVAR(medical,FatalVitals), _patient] call CBA_fnc_localEvent; + }; + + _patient setVariable [QEGVAR(circulation,ht), _ht, true]; + }; + }, [_patient], 15] call CBA_fnc_waitAndExecute; + }; + [_idPFH] call CBA_fnc_removePerFrameHandler; + }; + private _medications = _patient getVariable [QACEGVAR(medical,medications), []]; + if (_medications findIf {_x isEqualTo "naloxone"} != -1) exitWith {}; + private _depression = _unit getVariable [QEGVAR(pharma,opioidDepressionFactor)] + 0.08; + _patient setVariable [QEGVAR(pharma,opioidDepressionFactor), _depression]; + }, 30, [_patient]] call CBA_fnc_addPerFrameHandler; +}, _patient, 30] call CBA_fnc_waitAndExecute; diff --git a/addons/pharma/functions/fnc_treatmentAdvanced_LorazepamOverdoseLocal.sqf b/addons/pharma/functions/fnc_treatmentAdvanced_LorazepamOverdoseLocal.sqf index a10b8e371..72fd314da 100644 --- a/addons/pharma/functions/fnc_treatmentAdvanced_LorazepamOverdoseLocal.sqf +++ b/addons/pharma/functions/fnc_treatmentAdvanced_LorazepamOverdoseLocal.sqf @@ -15,3 +15,48 @@ * Public: No */ params ["_patient"]; +private _bpAdjust = -30 + floor random ((-15 - -30) + 1); +[_patient, _bpAdjust, _bpAdjust, "LorazepamOverdose"] call kat_circulation_fnc_updateBloodPressureChange; +private _hrAdjust = -50 + floor random ((-30 - -50) + 1); +[_patient, "LorazepamOverdose", 120, 1200, _hrAdjust, "", "", "", "", ""] call EFUNC(vitals,addMedicationAdjustment); +[{ + params ["_patient"]; + private _LorazepamOverdoseTarget = 0; + [{ + params ["_patient", "_idPFH"]; + if (!(alive _patient)) exitWith { + [_idPFH] call CBA_fnc_removePerFrameHandler; + }; + _LorazepamOverdoseTarget = _LorazepamOverdoseTarget + 1; + if (_LorazepamOverdoseTarget > 12) exitWith { + if (random(100) < 25) then { + [{ + params ["_args", "_idPFH"]; + _args params ["_patient"]; + private _ht = _patient getVariable [QEGVAR(circulation,ht), []]; + if ((_ht findIf {_x isEqualTo "LorazepamOD"}) == -1) then { + _ht pushBack "LorazepamOD"; + + if (_patient getVariable [QEGVAR(circulation,cardiacArrestType), 0] == 0) then { + [QACEGVAR(medical,FatalVitals), _patient] call CBA_fnc_localEvent; + }; + + _patient setVariable [QEGVAR(circulation,ht), _ht, true]; + }; + }, [_patient], 15] call CBA_fnc_waitAndExecute; + }; + [_idPFH] call CBA_fnc_removePerFrameHandler; + }; + private _depression = _unit getVariable [QEGVAR(pharma,opioidDepressionFactor)] + 0.08; + _patient setVariable [QEGVAR(pharma,opioidDepressionFactor), _depression]; + }, 15, [_patient]] call CBA_fnc_addPerFrameHandler; +}, _patient, 15] call CBA_fnc_waitAndExecute; + + +if QEGVAR(feedback,effectOverdose) then + { + PP_wetD = ppEffectCreate ["WetDistortion",300]; + PP_wetD ppEffectEnable true; + PP_wetD ppEffectAdjust [10,0.2,0.2,1.84,1.46,0.33,0.86,0.05,0.05,0.05,0.05,0.1,0.1,0.2,0.2]; + PP_wetD ppEffectCommit 0; + [{PP_wetD ppEffectEnable false; PP_wetD ppEffectCommit 0;}, [], 600] call CBA_fnc_waitAndExecute;}; diff --git a/addons/pharma/functions/fnc_treatmentAdvanced_MorphineOverdoseLocal.sqf b/addons/pharma/functions/fnc_treatmentAdvanced_MorphineOverdoseLocal.sqf index 1fa0a846b..7cd7be3c3 100644 --- a/addons/pharma/functions/fnc_treatmentAdvanced_MorphineOverdoseLocal.sqf +++ b/addons/pharma/functions/fnc_treatmentAdvanced_MorphineOverdoseLocal.sqf @@ -15,7 +15,6 @@ * Public: No */ params ["_patient"]; -params ["_patient"]; private _bpAdjust = -30 + floor random ((-15 - -30) + 1); [_patient, _bpAdjust, _bpAdjust, "morphineOverdose"] call kat_circulation_fnc_updateBloodPressureChange; private _hrAdjust = -50 + floor random ((-30 - -50) + 1); @@ -44,9 +43,9 @@ private _hrAdjust = -50 + floor random ((-30 - -50) + 1); }, [_patient], 10] call CBA_fnc_waitAndExecute; [_idPFH] call CBA_fnc_removePerFrameHandler; }; - private _medications = _patient getVariable [QACEGVAR(medical,medications), []]; - if (_medications findIf {_x isEqualTo "naloxone"} != -1) exitWith {}; - private _depression = _unit getVariable [QEGVAR(pharma,opioidFactor)] + 0.08; - _patient setVariable [QEGVAR(pharma,opioidFactor), _depression]; + private _medications = _patient getVariable [QACEGVAR(medical,medications), []]; + if (_medications findIf {_x isEqualTo "naloxone"} != -1) exitWith {}; + private _depression = _unit getVariable [QEGVAR(pharma,opioidDepressionFactor)] + 0.08; + _patient setVariable [QEGVAR(pharma,opioidDepressionFactor), _depression]; }, 10, [_patient]] call CBA_fnc_addPerFrameHandler; }, _patient, 10] call CBA_fnc_waitAndExecute; diff --git a/addons/pharma/functions/fnc_treatmentAdvanced_NalbuphineOverdoseLocal.sqf b/addons/pharma/functions/fnc_treatmentAdvanced_NalbuphineOverdoseLocal.sqf index bdd6c14b6..917360f21 100644 --- a/addons/pharma/functions/fnc_treatmentAdvanced_NalbuphineOverdoseLocal.sqf +++ b/addons/pharma/functions/fnc_treatmentAdvanced_NalbuphineOverdoseLocal.sqf @@ -44,9 +44,9 @@ private _hrAdjust = -50 + floor random ((-30 - -50) + 1); }, [_patient], 10] call CBA_fnc_waitAndExecute; [_idPFH] call CBA_fnc_removePerFrameHandler; }; - private _medications = _patient getVariable [QACEGVAR(medical,medications), []]; - if (_medications findIf {_x isEqualTo "naloxone"} != -1) exitWith {}; - private _depression = _unit getVariable [QEGVAR(pharma,opioidFactor)] + 0.05; - _patient setVariable [QEGVAR(pharma,opioidFactor), _depression]; + private _medications = _patient getVariable [QACEGVAR(medical,medications), []]; + if (_medications findIf {_x isEqualTo "naloxone"} != -1) exitWith {}; + private _depression = _unit getVariable [QEGVAR(pharma,opioidDepressionFactor)] + 0.05; + _patient setVariable [QEGVAR(pharma,opioidDepressionFactor), _depression]; }, 10, [_patient]] call CBA_fnc_addPerFrameHandler; }, _patient, 10] call CBA_fnc_waitAndExecute; diff --git a/addons/pharma/functions/fnc_treatmentAdvanced_NaloxoneOverdoseLocal.sqf b/addons/pharma/functions/fnc_treatmentAdvanced_NaloxoneOverdoseLocal.sqf index 8e5983b55..8a8dc27af 100644 --- a/addons/pharma/functions/fnc_treatmentAdvanced_NaloxoneOverdoseLocal.sqf +++ b/addons/pharma/functions/fnc_treatmentAdvanced_NaloxoneOverdoseLocal.sqf @@ -14,4 +14,4 @@ * * Public: No */ - +params ["_patient"]; diff --git a/addons/pharma/functions/fnc_treatmentAdvanced_NitroglycerinOverdoseLocal.sqf b/addons/pharma/functions/fnc_treatmentAdvanced_NitroglycerinOverdoseLocal.sqf index 58476f973..b33602b25 100644 --- a/addons/pharma/functions/fnc_treatmentAdvanced_NitroglycerinOverdoseLocal.sqf +++ b/addons/pharma/functions/fnc_treatmentAdvanced_NitroglycerinOverdoseLocal.sqf @@ -18,3 +18,7 @@ params ["_patient"]; private _hrValue = [-20, -25, -30, -35, -40, -45, 20, 25, 30, 35, 40, 45]; private _hrAdjust = selectRandom _hrValue; [_patient, NitroglycerinOverdose, 30, 1200, _hrAdjust, "", 75, "", "", ""] call EFUNC(vitals,addMedicationAdjustment); +if (random 3 < 1) then { + private _randomValue = [3, 4]; + private _randomRhythm = selectRandom _randomValue; + _patient setVariable [QEGVAR(circulation,cardiacArrestType), _randomRhythm];}; diff --git a/addons/pharma/functions/fnc_treatmentAdvanced_NorepinephrineLocal.sqf b/addons/pharma/functions/fnc_treatmentAdvanced_NorepinephrineLocal.sqf index 8631f2d4f..57a63abce 100644 --- a/addons/pharma/functions/fnc_treatmentAdvanced_NorepinephrineLocal.sqf +++ b/addons/pharma/functions/fnc_treatmentAdvanced_NorepinephrineLocal.sqf @@ -1,7 +1,7 @@ #include "..\script_component.hpp" /* - * Author: Mazinski.H - * Locates and Removes Bradycardia Effect. + * Author: Cplhardcore + * * * Arguments: * 0: Patient diff --git a/addons/pharma/functions/fnc_treatmentAdvanced_NorepinephrineOverdoseLocal.sqf b/addons/pharma/functions/fnc_treatmentAdvanced_NorepinephrineOverdoseLocal.sqf index 9686acd92..c1a8d9136 100644 --- a/addons/pharma/functions/fnc_treatmentAdvanced_NorepinephrineOverdoseLocal.sqf +++ b/addons/pharma/functions/fnc_treatmentAdvanced_NorepinephrineOverdoseLocal.sqf @@ -1,7 +1,7 @@ #include "..\script_component.hpp" /* - * Author: Mazinski.H - * Locates and Removes Bradycardia Effect. + * Author: Cplhardcore + * Applies Norepinephrine Overdose Effects * * Arguments: * 0: Patient diff --git a/addons/pharma/functions/fnc_treatmentAdvanced_PervitinOverdoseLocal.sqf b/addons/pharma/functions/fnc_treatmentAdvanced_PervitinOverdoseLocal.sqf index c941a693e..e69bc9f0c 100644 --- a/addons/pharma/functions/fnc_treatmentAdvanced_PervitinOverdoseLocal.sqf +++ b/addons/pharma/functions/fnc_treatmentAdvanced_PervitinOverdoseLocal.sqf @@ -15,4 +15,38 @@ * * Public: No */ -params ["_patient"]; \ No newline at end of file +params ["_patient"]; +private _randomNumber = floor (random 3) + 1; +switch (_randomNumber) do { + case 1: { + private _bpAdjust = 20 + floor random ((35 - 20) + 1); + [_patient, _bpAdjust, _bpAdjust, "PervitinOverdose"] call kat_circulation_fnc_updateBloodPressureChange; + private _hrAdjust = 30 + floor random ((50 - 30) + 1); + [_patient, "TACHYCARDIA", 120, 1200, _hrAdjust, "", "", "", "", ""] call EFUNC(vitals,addMedicationAdjustment); + }; + case 2: { + private _bpAdjust = 20 + floor random ((35 - 20) + 1); + [_patient, _bpAdjust, _bpAdjust, "PervitinOverdose"] call kat_circulation_fnc_updateBloodPressureChange; + private _hrAdjust = 30 + floor random ((50 - 30) + 1); + [_patient, "TACHYCARDIA", 120, 1200, _hrAdjust, "", "", "", "", ""] call EFUNC(vitals,addMedicationAdjustment); + private _randomValue = [3, 4]; + private _randomRhythm = selectRandom _randomValue; + _patient setVariable [QEGVAR(circulation,cardiacArrestType), _randomRhythm]; + }; + case 3: { + private _bpAdjust = 20 + floor random ((35 - 20) + 1); + [_patient, _bpAdjust, _bpAdjust, "PervitinOverdose"] call kat_circulation_fnc_updateBloodPressureChange; + private _hrAdjust = 30 + floor random ((50 - 30) + 1); + [_patient, "TACHYCARDIA", 120, 1200, _hrAdjust, "", "", "", "", ""] call EFUNC(vitals,addMedicationAdjustment); + private _randomValue = [3, 4]; + private _randomRhythm = selectRandom _randomValue; + _patient setVariable [QEGVAR(circulation,cardiacArrestType), _randomRhythm]; + }; + case 4: { + private _bpAdjust = 20 + floor random ((35 - 20) + 1); + [_patient, _bpAdjust, _bpAdjust, "PervitinOverdose"] call kat_circulation_fnc_updateBloodPressureChange; + private _hrAdjust = 30 + floor random ((50 - 30) + 1); + [_patient, "TACHYCARDIA", 120, 1200, _hrAdjust, "", "", "", "", ""] call EFUNC(vitals,addMedicationAdjustment); + _patient setVariable [QEGVAR(circulation,cardiacArrestType), 0]; + }; +}; \ No newline at end of file diff --git a/addons/vitals/XEH_PREP.hpp b/addons/vitals/XEH_PREP.hpp index 9295e7f53..2618e1039 100644 --- a/addons/vitals/XEH_PREP.hpp +++ b/addons/vitals/XEH_PREP.hpp @@ -8,5 +8,6 @@ PREP(handleRespawn); PREP(handleOxygenFunction); PREP(hasStableVitals); PREP(init); +PREP(updateOpioidDepression); PREP(updateOpioidEffect); PREP(updateOpioidRelief); \ No newline at end of file diff --git a/addons/vitals/functions/fnc_addMedicationAdjustment.sqf b/addons/vitals/functions/fnc_addMedicationAdjustment.sqf index c293d1345..f49f7b0f7 100644 --- a/addons/vitals/functions/fnc_addMedicationAdjustment.sqf +++ b/addons/vitals/functions/fnc_addMedicationAdjustment.sqf @@ -20,7 +20,7 @@ * * Public: No */ -params ["_unit", "_medication", "_timeToMaxEffect", "_maxTimeInSystem", "_hrAdjust", "_painAdjust", "_flowAdjust", "_alphaFactor", "_opioidRelief", "_opioidEffect"]; +params ["_unit", "_medication", "_timeToMaxEffect", "_maxTimeInSystem", "_hrAdjust", "_painAdjust", "_flowAdjust", "_alphaFactor", "_opioidRelief", "_opioidEffect", "_opioidDepression"]; TRACE_7("addMedicationAdjustment",_unit,_medication,_timeToMaxEffect,_maxTimeInSystem,_hrAdjust,_painAdjust,_flowAdjust); if (_maxTimeInSystem <= 0) exitWith { WARNING_1("bad value for _maxTimeInSystem - %1",_this); }; @@ -29,6 +29,6 @@ _timeToMaxEffect = _timeToMaxEffect max 1; private _adjustments = _unit getVariable [VAR_MEDICATIONS, []]; -_adjustments pushBack [_medication, CBA_missionTime, _timeToMaxEffect, _maxTimeInSystem, _hrAdjust, _painAdjust, _flowAdjust, _alphaFactor, _opioidRelief, _opioidEffect]; +_adjustments pushBack [_medication, CBA_missionTime, _timeToMaxEffect, _maxTimeInSystem, _hrAdjust, _painAdjust, _flowAdjust, _alphaFactor, _opioidRelief, _opioidEffect, _opioidDepression]; _unit setVariable [VAR_MEDICATIONS, _adjustments, true]; diff --git a/addons/vitals/functions/fnc_handleOxygenFunction.sqf b/addons/vitals/functions/fnc_handleOxygenFunction.sqf index dab0fab68..5ebb34cdf 100644 --- a/addons/vitals/functions/fnc_handleOxygenFunction.sqf +++ b/addons/vitals/functions/fnc_handleOxygenFunction.sqf @@ -33,6 +33,7 @@ params ["_unit", "_actualHeartRate", "_anerobicPressure", "_bloodGas", "_tempera #define DEFAULT_FIO2 0.21 private _respiratoryRate = 0; +private _respiratoryRateMult = _unit getvariable [QEGVAR(breathing,respiratoryRateMultiplier), 1]; private _demandVentilation = 0; private _actualVentilation = 0; private _previousCyclePaco2 = (_bloodGas select 0); @@ -49,7 +50,7 @@ if (IN_CRDC_ARRST(_unit)) then { private _tidalVolume = GET_KAT_SURFACE_AREA(_unit); // Respiratory Rate is supressed by Opioids - _respiratoryRate = [((_demandVentilation / _tidalVolume) - (_opioidDepression * 5)) min MAXIMUM_RR, 20] select (_unit getVariable [QEGVAR(breathing,BVMInUse), false]); + _respiratoryRate = [(((_demandVentilation / _tidalVolume) - (_opioidDepression * 5)) * _respiratoryRateMult) min MAXIMUM_RR, 20] select (_unit getVariable [QEGVAR(breathing,BVMInUse), false]); // If respiratory rate is low due to PaCO2, it starts increasing faster to compensate if (_previousCyclePaco2 > 50) then { _respiratoryRate = (_respiratoryRate + ((_previousCyclePaco2 - 50) * 0.2)) min MAXIMUM_RR}; diff --git a/addons/vitals/functions/fnc_handleUnitVitals.sqf b/addons/vitals/functions/fnc_handleUnitVitals.sqf index fe3295591..2f8f2f0ec 100644 --- a/addons/vitals/functions/fnc_handleUnitVitals.sqf +++ b/addons/vitals/functions/fnc_handleUnitVitals.sqf @@ -91,6 +91,7 @@ private _peripheralResistanceAdjustment = 0; private _alphaFactorAdjustment = 0; private _opioidAdjustment = 0; private _opioidEffectAdjustment = 0; +private _opioidDepressionAdjustment = 0; private _adjustments = _unit getVariable [VAR_MEDICATIONS,[]]; if !(_adjustments isEqualTo []) then { @@ -109,6 +110,7 @@ if !(_adjustments isEqualTo []) then { if (_alphaFactor != 0) then { _alphaFactorAdjustment = _alphaFactorAdjustment + _alphaFactor * _effectRatio; }; if (_opioidRelief != 0) then {_opioidAdjustment = _opioidAdjustment + _opioidRelief * _effectRatio; }; if (_opioidEffect != 0) then {_opioidEffectAdjustment = _opioidEffectAdjustment + _opioidEffect * _effectRatio; }; + if (_opioidDepression != 0) then {_opioidDepressionAdjustment = _opioidAdjustment + _opioidDepression * _effectRatio; }; }; } forEach _adjustments; @@ -122,6 +124,7 @@ if !(_adjustments isEqualTo []) then { [_unit, _peripheralResistanceAdjustment, _deltaT, _syncValues] call ACEFUNC(medical_vitals,updatePeripheralResistance); [_unit, _opioidAdjustment, _deltaT, _syncValues] call FUNC(updateOpioidRelief); [_unit, _opioidEffectAdjustment, _deltaT, _syncValues] call FUNC(updateOpioidEffect); +[_unit, _opioid_opioidDepressionAdjustment, _deltaT, _syncValues] call FUNC(updateOpioidDepression); private _heartRate = [_unit, _hrTargetAdjustment, 0, _bloodVolume, _deltaT, _syncValues] call FUNC(handleCardiacFunction); @@ -129,7 +132,7 @@ private _spo2 = 97; if (EGVAR(breathing,enable)) then { // Additional variables for Respiration functions private _bloodGas = GET_BLOOD_GAS(_unit); - private _opioidDepression = GET_OPIOID_FACTOR(_unit); + private _opioidDepression = GET_OPIOID_DEPRESSION(_unit); private _anerobicPressure = (DEFAULT_ANEROBIC_EXCHANGE * (6 / (_bloodVolume max 6))) min 1.2; _spo2 = [_unit, _heartRate, _anerobicPressure, _bloodGas, _temperature, _baroPressure, _opioidDepression, _deltaT, _syncValues] call FUNC(handleOxygenFunction); diff --git a/addons/vitals/functions/fnc_updateOpioidDepression.sqf b/addons/vitals/functions/fnc_updateOpioidDepression.sqf new file mode 100644 index 000000000..b6b1a5230 --- /dev/null +++ b/addons/vitals/functions/fnc_updateOpioidDepression.sqf @@ -0,0 +1,23 @@ +#include "..\script_component.hpp" +/* + * Author: Cplhardcore + * Update the opioid Depression effect + * + * Arguments: + * 0: The Unit + * 1: Opioid Depression Adjustments + * 2: Time since last update + * 3: Sync value? + * + * Return Value: + * None + * + * Example: + * [player, 0, 1, false] call kat_vitals_fnc_updateOpioidDepression + * + * Public: No + */ + +params ["_unit", "_opioidDepressionAdjustment", "_deltaT", "_syncValue"]; + +_unit setVariable [QEGVAR(pharma,opioidDepression), _opioidDepressionAdjustment, _syncValue];