Skip to content

Commit

Permalink
Ketamine fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Cplhardcore committed Sep 14, 2024
1 parent 7dcf17a commit cac1bf6
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 19 deletions.
34 changes: 23 additions & 11 deletions addons/pharma/functions/fnc_medicationLocal.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -111,23 +111,35 @@ TRACE_3("adjustments",_heartRateChange,_painReduce,_viscosityChange);

//Change Alpha Factor
[_patient, _alphaFactor] call FUNC(alphaAction);
if ([QGVAR(AMS_Enabled)] call CBA_settings_fnc_get) then {

_medicationParts = (_className select [13, count _className - 13]) splitString "_";
private _medicationParts = (_className splitString "_");

if (count _medicationParts > 4) then {
_medicationName = _medicationParts select 4;
if (count _medicationParts > 4) then {
_medicationName = _medicationParts select 2;

if (_medicationName in ["lorazepam","EACA","TXA","amiodarone","flumazenil"]) then {
if (_medicationName in ["lorazepam","EACA","TXA","amiodarone","flumazenil"]) then {
[format ["kat_pharma_%1Local", toLower _medicationName], [_patient, _bodyPart], _patient] call CBA_fnc_targetEvent;
};
};

if (_medicationName in ["ketamine","atropine"]) then {
if (_medicationName in ["ketamine","atropine"]) then {
[format ["kat_pharma_%1Local", toLower _medicationName], [_patient, _bodyPart, _classname], _patient] call CBA_fnc_targetEvent;
};
};

if (_medicationName in ["fentanyl","morphine","nalbuphine"]) then {
if (_medicationName in ["fentanyl","morphine","nalbuphine"]) then {
[format ["kat_pharma_%1Local", toLower _medicationName], [_patient, _bodyPart, _opioidRelief], _patient] call CBA_fnc_targetEvent;
};

} else {
diag_log format ["Unexpected _className format: %1", _className];
};
} else {

if (_className in ["Lorazepam","Ketamine","EACA","TXA","Atropine","Amiodarone","Flumazenil"]) then {
[format ["kat_pharma_%1Local", toLower _className], [_patient, _bodyPart], _patient] call CBA_fnc_targetEvent;
};
} else {
diag_log format ["Unexpected _className format: %1", _className];
};

if (_className in ["Fentanyl","Morphine","Nalbuphine"]) then {
[format ["kat_pharma_%1Local", toLower _className], [_patient, _bodyPart, _opioidRelief], _patient] call CBA_fnc_targetEvent;
};
};
17 changes: 9 additions & 8 deletions addons/pharma/functions/fnc_treatmentAdvanced_KetamineLocal.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* None
*
* Example:
* [player, leftLeg, syringe_kat_ketamine_5ml_2] call kat_pharma_fnc_ketamineLocal;
* [player, leftLeg, syringe_kat_ketamine_5ml_2] call kat_pharma_fnc_treatmentAdvanced_ketamineLocal;
*
* Public: No
*/
Expand All @@ -20,6 +20,14 @@
params ["_patient", "_bodyPart", "_classname"];

if !(alive _target) exitWith {};
if (_classname isEqualTo "syringe_kat_ketamine_5ml_2") then {
_patient setVariable [QEGVAR(surgery,sedated), true, true];
[_patient, true] call ACEFUNC(medical,setUnconscious);

[{
_patient setVariable ["kat_surgery_sedated", false, true];
}, 90] call CBA_fnc_waitAndExecute;
};
if (ACE_Player != _target) exitWith {};
if (GVAR(chromatic_aberration_checkbox_ketamine)) then {
[{
Expand Down Expand Up @@ -63,10 +71,3 @@ if (GVAR(chromatic_aberration_checkbox_ketamine)) then {
},
[_target], 60] call CBA_fnc_waitAndExecute; // chroma start after 60s
};

if (_classname isEqualTo "syringe_kat_ketamine_5ml_2") then {
_patient setVariable [QEGVAR(surgery,sedated), true, true];
[_patient, true] call ACEFUNC(medical,setUnconscious);

[[_patient setVariable [QEGVAR(surgery,sedated), false, true]], 90] call CBA_fnc_waitAndExecute;
};

0 comments on commit cac1bf6

Please sign in to comment.