diff --git a/.hemtt/launch.toml b/.hemtt/launch.toml index 662ac1232..c708d334b 100644 --- a/.hemtt/launch.toml +++ b/.hemtt/launch.toml @@ -3,4 +3,12 @@ workshop = [ "450814997", # CBA_A3's Workshop ID "463939057", # ACE3's Workshop ID "2369477168", # Advanced Developer Tools's Workshop ID + "1779063631", # ZEN +] +parameters = [ + "-skipIntro", + "-noSplash", + "-showScriptErrors", + "-debug", + "-filePatching", ] \ No newline at end of file diff --git a/addons/breathing/functions/fnc_fullHealLocal.sqf b/addons/breathing/functions/fnc_fullHealLocal.sqf index 9791dd752..8e5086513 100644 --- a/addons/breathing/functions/fnc_fullHealLocal.sqf +++ b/addons/breathing/functions/fnc_fullHealLocal.sqf @@ -27,7 +27,7 @@ _patient setVariable [QGVAR(deepPenetratingInjury), false, true]; _patient setVariable [QGVAR(etco2Monitor), [], true]; _patient setVariable [QGVAR(breathRate), 15, true]; _patient setVariable [QGVAR(nasalCannula), false, true]; - +_patient setVariable [QGVAR(lungSurfaceArea), 400]; if (ACEGVAR(advanced_fatigue,enabled)) then { ["kat_LSDF"] call ACEFUNC(advanced_fatigue,removeDutyFactor); }; diff --git a/addons/chemical/functions/fnc_treatmentAdvanced_AtropineLocal.sqf b/addons/chemical/functions/fnc_treatmentAdvanced_AtropineLocal.sqf index ede9e02ae..d07c7e376 100644 --- a/addons/chemical/functions/fnc_treatmentAdvanced_AtropineLocal.sqf +++ b/addons/chemical/functions/fnc_treatmentAdvanced_AtropineLocal.sqf @@ -15,7 +15,8 @@ * Public: No */ -params ["_patient"]; +params ["_patient", "_classname"]; +if (_classname isEqualTo "syringe_atropine_5ml_1") exitWith {}; _patient setVariable [QGVAR(airPoisoning), false, true]; _patient setVariable [QGVAR(isTreated), true, true]; diff --git a/addons/circulation/CfgFunctions.hpp b/addons/circulation/CfgFunctions.hpp index ea50d658c..4db609314 100644 --- a/addons/circulation/CfgFunctions.hpp +++ b/addons/circulation/CfgFunctions.hpp @@ -26,4 +26,12 @@ class CfgFunctions { }; }; }; + class overwrite_medical { + tag = "ace_medical"; + class ace_medical { + class updateWoundBloodLoss { + file = QPATHTOF(functions\fnc_updateWoundBloodLoss.sqf); + }; + }; + }; }; \ No newline at end of file diff --git a/addons/circulation/XEH_PREP.hpp b/addons/circulation/XEH_PREP.hpp index a207e6fc7..c9c62c8e7 100644 --- a/addons/circulation/XEH_PREP.hpp +++ b/addons/circulation/XEH_PREP.hpp @@ -45,6 +45,7 @@ PREP(placeAED); PREP(removeLog); PREP(showBloodGas); PREP(treatmentAdvanced_IV); +PREP(updateWoundBloodLoss); PREP(updateBloodPressureChange); PREP(updateHeartRate); PREP(updateInternalBleeding); diff --git a/addons/circulation/functions/fnc_cprLocal.sqf b/addons/circulation/functions/fnc_cprLocal.sqf index 8d2871964..4700ffef5 100644 --- a/addons/circulation/functions/fnc_cprLocal.sqf +++ b/addons/circulation/functions/fnc_cprLocal.sqf @@ -73,7 +73,7 @@ private _fnc_advRhythm = { { case "Epinephrine": { - _epiBoost = 1.5; + _epiBoost = 1.2; }; case "EpinephrineIV": { @@ -87,6 +87,26 @@ private _fnc_advRhythm = { { _lidoBoost = _lidoBoost + 8; }; + case "syringe_epinephrineIV_5ml_1": + { + _epiBoost = 1.3; + }; + case "syringe_epinephrineIV_5ml_3": + { + _epiBoost = 1.5; + }; + case "syringe_lidocaine_5ml_3": + { + _lidoBoost = _lidoBoost + 8; + }; + case "syringe_amiodarone_5ml_1": + { + _amiBoost = _amiBoost + (random [6,10,16]); + }; + case "syringe_amiodarone_5ml_3": + { + _amiBoost = _amiBoost + (random [8,14,20]); + }; }; } forEach (_patient getVariable [QACEGVAR(medical,medications), []]); diff --git a/addons/circulation/functions/fnc_treatmentAdvanced_IV.sqf b/addons/circulation/functions/fnc_treatmentAdvanced_IV.sqf index 2097f9f7c..763824f1e 100644 --- a/addons/circulation/functions/fnc_treatmentAdvanced_IV.sqf +++ b/addons/circulation/functions/fnc_treatmentAdvanced_IV.sqf @@ -23,7 +23,7 @@ private _volume = getNumber (configFile >> "ACE_Medical_Treatment" >> "IV" >> _c private _hradjust = -_volume; -[_unit, "BloodPoisoning", 150, 300, _hradjust, 0, -10] call ACEFUNC(medical_status,addMedicationAdjustment); +[_unit, "BloodPoisoning", 150, 600, _hradjust, 0, -10, "", "", ""] call EFUNC(vitals,addMedicationAdjustment); [{ params ["_unit"]; diff --git a/addons/circulation/functions/fnc_updateWoundBloodLoss.sqf b/addons/circulation/functions/fnc_updateWoundBloodLoss.sqf new file mode 100644 index 000000000..e8bea637e --- /dev/null +++ b/addons/circulation/functions/fnc_updateWoundBloodLoss.sqf @@ -0,0 +1,47 @@ +#include "..\script_component.hpp" +/* + * Author: Glowbal, modified by Cplhardcore + * Update total wound bleeding based on open wounds and tourniquets + * Wound bleeding = percentage of cardiac output lost + * + * Arguments: + * 0: The Unit + * + * Return Value: + * Nothing + * + * Example: + * [player] call kat_circulation_fnc_updateWoundBloodLoss + * + * Public: No + */ + +params ["_unit"]; + +private _tourniquets = GET_TOURNIQUETS(_unit); +private _bodyPartBleeding = [0,0,0,0,0,0]; +{ + private _partIndex = ALL_BODY_PARTS find _x; + if (_tourniquets select _partIndex == 1) then { + { + _x params ["", "_amountOf", "_bleeeding"]; + _bodyPartBleeding set [_partIndex, (_bodyPartBleeding select _partIndex) + (0.05 * _amountOf * _bleeeding)]; + } forEach _y; + } else { + { + _x params ["", "_amountOf", "_bleeeding"]; + _bodyPartBleeding set [_partIndex, (_bodyPartBleeding select _partIndex) + (_amountOf * _bleeeding)]; + } forEach _y; + }; + } forEach GET_OPEN_WOUNDS(_unit); + +if (_bodyPartBleeding isEqualTo [0,0,0,0,0,0]) then { + TRACE_1("updateWoundBloodLoss-none",_unit); + _unit setVariable [VAR_WOUND_BLEEDING, 0, true]; +} else { + _bodyPartBleeding params ["_headBleeding", "_bodyBleeding", "_leftArmBleeding", "_rightArmBleeding", "_leftLegBleeding", "_rightLegBleeding"]; + private _bodyBleedingRate = ((_headBleeding min 0.9) + (_bodyBleeding min 1.0)) min 1.0; + private _limbBleedingRate = ((_leftArmBleeding min 0.3) + (_rightArmBleeding min 0.3) + (_leftLegBleeding min 0.5) + (_rightLegBleeding min 0.5)) min 1.0; + TRACE_3("updateWoundBloodLoss-bleeding",_unit,_bodyBleedingRate,_limbBleedingRate); + _unit setVariable [VAR_WOUND_BLEEDING, _bodyBleedingRate + _limbBleedingRate, true]; +}; \ No newline at end of file diff --git a/addons/feedback/XEH_preInit.sqf b/addons/feedback/XEH_preInit.sqf index 9e766b44e..97406ec84 100644 --- a/addons/feedback/XEH_preInit.sqf +++ b/addons/feedback/XEH_preInit.sqf @@ -27,4 +27,13 @@ PREP_RECOMPILE_END; true ] call CBA_Settings_fnc_init; +[ + QGVAR(effectOverdose), + "CHECKBOX", + [LLSTRING(SETTING_overdoseEffect_display), LLSTRING(SETTING_overdoseEffect_DESC)], + CBA_SETTINGS_CAT, + [false], + true +] call CBA_Settings_fnc_init; + ADDON = true; diff --git a/addons/feedback/stringtable.xml b/addons/feedback/stringtable.xml index 87b1e7830..03e2a81c5 100644 --- a/addons/feedback/stringtable.xml +++ b/addons/feedback/stringtable.xml @@ -37,5 +37,12 @@ Enables opioid effect on ketamine, fentanyl and pervitin ケタミン、フェンタニル、ペルビチンなどでオピオイドの効果を有効にします + + Enable Overdose effects + オピオイド効果を有効化 + + + Enables Overdose effects on certain medications + diff --git a/addons/gui/XEH_PREP.hpp b/addons/gui/XEH_PREP.hpp index 330c8f51c..586af5ecf 100644 --- a/addons/gui/XEH_PREP.hpp +++ b/addons/gui/XEH_PREP.hpp @@ -10,4 +10,9 @@ PREP(updateCategories); PREP(updateInjuryList); PREP(updateBodyImage); PREP(updateIVStatus); -PREP(updateABGStatus); \ No newline at end of file +PREP(updateABGStatus); +PREP(updateSyringes); +PREP(updateMedications); +PREP(prepSyringe); +PREP(openSyringeMenu); +PREP(closeSyringeMenu); \ No newline at end of file diff --git a/addons/gui/functions/fnc_closeSyringeMenu.sqf b/addons/gui/functions/fnc_closeSyringeMenu.sqf new file mode 100644 index 000000000..d63469b47 --- /dev/null +++ b/addons/gui/functions/fnc_closeSyringeMenu.sqf @@ -0,0 +1,21 @@ +#include "..\script_component.hpp" +/* + * Author: Cplhardcore + * closes the syringe menu + * + * Arguments: + * none + * + * Return Value: + * None + * + * Example: + * [] call kat_medical_gui_fnc_closeSyringeMenu; + * + * Public: No + */ +[{player setVariable ["SyringeMenu", false]; +ctrlShow [71300, false]; +ctrlShow [71301, false]; +ctrlShow [71311, false]; +ctrlShow [71310, true];}, []] call CBA_fnc_execNextFrame; \ No newline at end of file diff --git a/addons/gui/functions/fnc_onMenuOpen.sqf b/addons/gui/functions/fnc_onMenuOpen.sqf index 59742a629..4b838845e 100644 --- a/addons/gui/functions/fnc_onMenuOpen.sqf +++ b/addons/gui/functions/fnc_onMenuOpen.sqf @@ -98,6 +98,9 @@ if (EGVAR(pharma,RequireInsIV) && EGVAR(pharma,IVflowControl)) then { (_display displayCtrl IDC_IV_FLOW_SHOWBUTTON) ctrlShow true; }; +if (EGVAR(pharma,AMS_Enabled)) then { + (_display displayCtrl IDC_SYRINGE_OPEN) ctrlShow true; +}; // Set toggle button icon and tooltip private _ctrl = _display displayCtrl IDC_TOGGLE; if (ACEGVAR(medical_gui,target) == ACE_player) then { @@ -107,3 +110,9 @@ if (ACEGVAR(medical_gui,target) == ACE_player) then { _ctrl ctrlSetText QACEPATHTOF(medical_gui,data\categories\toggle_to_self.paa); _ctrl ctrlSetTooltip ACELLSTRING(medical_gui,ToggleToSelf); }; +private _syringeMenuStatus = player getVariable ["SyringeMenu", false]; +if (_syringeMenuStatus == true) then { + [] call FUNC(openSyringeMenu); +} else { + [] call FUNC(closeSyringeMenu); +}; \ No newline at end of file diff --git a/addons/gui/functions/fnc_openSyringeMenu.sqf b/addons/gui/functions/fnc_openSyringeMenu.sqf new file mode 100644 index 000000000..4f162914c --- /dev/null +++ b/addons/gui/functions/fnc_openSyringeMenu.sqf @@ -0,0 +1,23 @@ +#include "..\script_component.hpp" +/* + * Author: Cplhardcore + * opens the syringe menu and populates it + * + * Arguments: + * none + * + * Return Value: + * None + * + * Example: + * [] call kat_medical_gui_fnc_openSyringeMenu; + * + * Public: No + */ +[] call FUNC(updateMedications); +[] call FUNC(updateSyringes); +[{player setVariable ["SyringeMenu", true]; +ctrlShow [71300, true]; +ctrlShow [71301, true]; +ctrlShow [71311, true]; +ctrlShow [71310, false];}, []] call CBA_fnc_execNextFrame; diff --git a/addons/gui/functions/fnc_prepSyringe.sqf b/addons/gui/functions/fnc_prepSyringe.sqf new file mode 100644 index 000000000..5bb8ddf5f --- /dev/null +++ b/addons/gui/functions/fnc_prepSyringe.sqf @@ -0,0 +1,30 @@ +#include "..\script_component.hpp" +/* + * Author: Cplhardcore + * Checks the medications in the players inventory and then populates the listbox with the medications, + * + * Arguments: + * none + * + * Return Value: + * None + * + * Example: + * [] call kat_medical_gui_fnc_prepSyringe; + * + * Public: No + */ +private _playerMedicalLevel = [_player] call ace_medical_fnc_getMedicLevel; +private _requiredMedicalLevel = GVAR(medLvl_PrepSyringe); +if (_playerMedicalLevel < _requiredMedicalLevel) exitWith {}; +[EGVAR(pharma,prepTime_PrepSyringe), [], { +private _syringeBox = findDisplay 38580 displayCtrl 71303; +private _medicationBox = findDisplay 38580 displayCtrl 71305; +private _doseCombo = findDisplay 38580 displayCtrl 71307; +private _syringeSelected = lbCurSel _syringeBox; +private _medicationSelected = lbCurSel _medicationBox; +private _doseSelected = lbCurSel _doseCombo; +private _syringeType = _syringeBox lbData _syringeSelected; +private _medicationType = _medicationBox lbData _medicationSelected; +private _doseType = _doseCombo lbValue _doseSelected; +[player, _medicationType, _syringeType, _doseType] call kat_pharma_fnc_prepareSyringe;}, {}, "Preparing Syringe..."] call ace_common_fnc_progressBar; \ No newline at end of file diff --git a/addons/gui/functions/fnc_updateMedications.sqf b/addons/gui/functions/fnc_updateMedications.sqf new file mode 100644 index 000000000..c352432f2 --- /dev/null +++ b/addons/gui/functions/fnc_updateMedications.sqf @@ -0,0 +1,91 @@ +#include "..\script_component.hpp" +/* + * Author: Cplhardcore + * Checks the medications in the players inventory and then populates the listbox with the medications, + * + * Arguments: + * none + * + * Return Value: + * None + * + * Example: + * [] call kat_medical_gui_fnc_updateMedication; + * + * Public: No + */ + +if !(EGVAR(pharma,AMS_Enabled)) exitWith {}; +disableSerialization; + +[{private _medications = [ + "kat_amiodarone", + "kat_atropine", + "kat_EACA", + "kat_epinephrineIV", + "kat_etomidate", + "kat_fentanyl", + "kat_flumazenil", + "kat_ketamine", + "kat_lidocaine", + "kat_lorazepam", + "kat_nalbuphine", + "kat_nitroglycerin", + "kat_norepinephrine", + "kat_phenylephrine", + "kat_TXA", + "kat_morphineIV", + "kat_adenosineIV", + "kat_atropineIV", + "kat_alteplase" +]; + +private _medicationsFound = { + params ["_medications"]; + + private _inventory = (items player) + (magazines player); + private _found = []; + + { + private _item = _x; + if (_item in _medications) then { + private _existingIndex = -1; + { + if ((_x select 0) == _item) exitWith {_existingIndex = _forEachIndex}; + } forEach _found; + + if (_existingIndex == -1) then { + _found pushBack [_item, 1]; + } else { + _found set [_existingIndex, [_item, (_found select _existingIndex select 1) + 1]]; + }; + }; + } forEach _inventory; + + _found +}; + +private _listBox = findDisplay 38580 displayCtrl 71305; +private _foundMedications = [_medications] call _medicationsFound; + +private _populateListBox = { + params ["_foundMedications", "_listBox"]; + + lbClear _listBox; + { + private _medItem = _x select 0; + private _medCount = _x select 1; + if (_medItem != "") then { + private _config = configFile >> "CfgWeapons" >> _medItem; + private _displayName = getText (_config >> "displayName"); + private _picture = getText (_config >> "picture"); + private _data = toLower ((_medItem splitString "_") select 1); + private _entryText = format ["%1 (x%2)", _displayName, _medCount]; + private _index = _listBox lbAdd _entryText; + _listBox lbSetPicture [_index, _picture]; + _listBox lbSetData [_index, _data]; + }; + } forEach _foundMedications; +}; + +[_foundMedications, _listBox] call _populateListBox; }, [], 0.01] call CBA_fnc_waitAndExecute; \ No newline at end of file diff --git a/addons/gui/functions/fnc_updateSyringes.sqf b/addons/gui/functions/fnc_updateSyringes.sqf new file mode 100644 index 000000000..59804e379 --- /dev/null +++ b/addons/gui/functions/fnc_updateSyringes.sqf @@ -0,0 +1,73 @@ +#include "..\script_component.hpp" +/* + * Author: Cplhardcore + * Checks the syringes in the players inventory and then populates the listbox with the syringes, + * + * Arguments: + * none + * + * Return Value: + * None + * + * Example: + * [] call kat_medical_gui_fnc_updateSyringes; + * + * Public: No + */ +if !(EGVAR(pharma,AMS_Enabled)) exitWith {}; +disableSerialization; + +[{private _syringes = [ + "kat_10ml_syringe", + "kat_5ml_syringe" +]; + +private _syringesFound = { + params ["_syringes"]; + + private _inventory = (items player) + (magazines player); + private _found = []; + + { + private _item = _x; + if (_item in _syringes) then { + private _existingIndex = -1; + { + if ((_x select 0) == _item) exitWith {_existingIndex = _forEachIndex}; + } forEach _found; + + if (_existingIndex == -1) then { + _found pushBack [_item, 1]; + } else { + _found set [_existingIndex, [_item, (_found select _existingIndex select 1) + 1]]; + }; + }; + } forEach _inventory; + + _found +}; + +private _listBox = findDisplay 38580 displayCtrl 71303; +private _foundSyringes = [_syringes] call _syringesFound; + +private _populateListBox = { + params ["_foundSyringes", "_listBox"]; + + lbClear _listBox; + { + private _syringeItem = _x select 0; + private _syringeCount = _x select 1; + if (_syringeItem != "") then { + private _config = configFile >> "CfgWeapons" >> _syringeItem; + private _displayName = getText (_config >> "displayName"); + private _picture = getText (_config >> "picture"); + private _data = toLower ((_syringeItem splitString "_") select 1); + private _entryText = format ["%1 (x%2)", _displayName, _syringeCount]; + private _index = _listBox lbAdd _entryText; + _listBox lbSetPicture [_index, _picture]; + _listBox lbSetData [_index, _data]; + }; + } forEach _foundSyringes; +}; + +[_foundSyringes, _listBox] call _populateListBox; }, [], 0.01] call CBA_fnc_waitAndExecute; \ No newline at end of file diff --git a/addons/gui/gui.hpp b/addons/gui/gui.hpp index 5c94d09f8..eb4980dca 100644 --- a/addons/gui/gui.hpp +++ b/addons/gui/gui.hpp @@ -7,6 +7,7 @@ class RscActivePicture; class RscButtonMenu; class RscControlsGroup; class RscControlsGroupNoScrollbars; +class RscCombo; class ace_medical_gui_TriageToggle: RscButton { x = QUOTE(POS_X(14.33)); @@ -166,7 +167,28 @@ class ACE_Medical_Menu { shadow = "true"; }; }; - }; + class SYRINGEBackground: IVFlowBackground { + idc = IDC_SYRINGE_BACKGROUND; // LOOK HERE + x = QUOTE(POS_X(39.6)); + y = QUOTE(POS_Y(4.9)); + w = QUOTE(POS_W(9)); + h = QUOTE(POS_H(16.5)); + }; + class SYRINGETitle: IVFlowTitle { + idc = IDC_SYRINGE_TITLE; // LOOK HERE + text = CSTRING(SYRINGETitle); + x = QUOTE(POS_X(39.6)); + y = QUOTE(POS_Y(4.9)); + w = QUOTE(POS_W(9)); + h = QUOTE(POS_H(1)); + show = 1; + class Attributes { + color = "#E5E5E5"; + font = "RobotoCondensed"; + shadow = "true"; + }; + }; + }; class controls { class IVbutton: RscButton { idc = IDC_IV_FLOW_SHOWBUTTON; // LOOK HERE @@ -639,5 +661,165 @@ class ACE_Medical_Menu { class BodyLabelRight: BodyLabelLeft { idc = IDC_SIDE_LABEL_RIGHT; }; + class SyringeOpenButton: RscButton { + idc = IDC_SYRINGE_OPEN; + text = CSTRING(OpenSyringeMenu); + x = QUOTE(POS_X(23.6)); + y = QUOTE(POS_Y(0)); + w = QUOTE(POS_W(4.4)); + h = QUOTE(POS_H(1)); + show = 0; + colorBackground[] = {0, 0, 0, 0}; + colorBackgroundActive[] = {1, 1, 1, 0.4}; + colorBackgroundDisabled[] = {0, 0, 0, 0}; + colorBorder[] = {0,0,0,0}; + onButtonClick = QUOTE([] call FUNC(openSyringeMenu)); + class Attributes { + align = "Right"; + valign = "bottom"; + color = "#E5E5E5"; + font = "RobotoCondensed"; + shadow = "false"; + }; + }; + class SyringeControlGroup: RscControlsGroup { + idc = IDC_SYRINGE_GROUP; + x = QUOTE(POS_X(39.6)); + y = QUOTE(POS_Y(4.9)); + w = QUOTE(POS_W(9.2)); + h = QUOTE(POS_H(16.5)); + class controls { + class SyringeCloseButton: RscButton { + idc = IDC_SYRINGE_CLOSE; + text = CSTRING(CloseMenu); + x = QUOTE(POS_X(10.3)); + y = QUOTE(POS_Y(0)); + w = QUOTE(POS_W(2)); + h = QUOTE(POS_H(1)); + onButtonClick = QUOTE([] call FUNC(closeSyringeMenu)); + class Attributes { + align = "Right"; + valign = "bottom"; + color = "#E5E5E5"; + font = "RobotoCondensed"; + shadow = "false"; + }; + }; + class SyringeTypeTitle: RscStructuredText { + idc = IDC_SYRINGE_TYPE_TITLE; // LOOK HERE + text = CSTRING(SyringeTitleList); + x = QUOTE(POS_X(3.8)); + y = QUOTE(POS_Y(1.3)); + w = QUOTE(POS_W(8)); + h = QUOTE(POS_H(1)); + colorBackground[] = {0, 0, 0, 0.5}; + show = 1; + class Attributes { + align = "center"; + valign = "bottom"; + color = "#E5E5E5"; + font = "RobotoCondensed"; + shadow = "false"; + }; + }; + class SyringeList: RscListBox { + idc = IDC_SYRINGE_TYPE_LIST; // LOOK HERE + x = QUOTE(POS_X(3.8)); + y = QUOTE(POS_Y(2.3)); + w = QUOTE(POS_W(8)); + h = QUOTE(POS_H(2)); + show = 1; + }; + class MedicationTypeTitle: RscStructuredText { + idc = IDC_MEDICATION_TYPE_TITLE; // LOOK HERE + text = CSTRING(MedicationTitleList); + x = QUOTE(POS_X(3.8)); + y = QUOTE(POS_Y(4.6)); + w = QUOTE(POS_W(8)); + h = QUOTE(POS_H(1)); + colorBackground[] = {0, 0, 0, 0.5}; + show = 1; + class Attributes { + align = "center"; + valign = "bottom"; + color = "#E5E5E5"; + font = "RobotoCondensed"; + shadow = "false"; + }; + }; + class MedicationList: RscListBox { + idc = IDC_MEDICATION_TYPE_LIST; // LOOK HERE + x = QUOTE(POS_X(3.8)); + y = QUOTE(POS_Y(5.6)); + w = QUOTE(POS_W(8)); + h = QUOTE(POS_H(6)); + show = 1; + }; + class DoseTitle: RscStructuredText { + idc = IDC_MEDICATION_DOSE_TITLE; // LOOK HERE + text = CSTRING(DoseTitle); + x = QUOTE(POS_X(3.8)); + y = QUOTE(POS_Y(12)); + w = QUOTE(POS_W(8)); + h = QUOTE(POS_H(1)); + colorBackground[] = {0, 0, 0, 0.5}; + show = 1; + class Attributes { + align = "center"; + valign = "bottom"; + color = "#E5E5E5"; + font = "RobotoCondensed"; + shadow = "false"; + }; + }; + class DoseList: RscCombo { + idc = IDC_MEDICATION_DOSE_COMBO; // LOOK HERE + x = QUOTE(POS_X(3.8)); + y = QUOTE(POS_Y(13)); + w = QUOTE(POS_W(8)); + h = QUOTE(POS_H(1)); + show = 1; + class Items + { + class LowDose + { + text = CSTRING(DoseLow); + default = 1; + value = 1; + }; + //class MediumDose + //{ + // text = CSTRING(DoseMedium); + // value = 2; + //}; + class HighDose + { + text = CSTRING(DoseHigh); + value = 3; + }; + }; + }; + class PrepSyringe: RscButton { + idc = IDC_MEDICATION_PREP_SYRINGE; // LOOK HERE + text = CSTRING(PrepSyringe); + x = QUOTE(POS_X(3.8)); + y = QUOTE(POS_Y(14.5)); + w = QUOTE(POS_W(8)); + h = QUOTE(POS_H(1.5)); + onButtonClick = QUOTE([] call FUNC(prepSyringe)); + colorText[] = {1, 1, 1, 0.9}; + colorActive[] = {0, 0, 0, 0.7}; + colorBackground[] = {0, 0, 0, 0.7}; + colorBackgroundActive[] = {1, 1, 1, 1}; + colorBorder[] = {0,0,0,0}; + show = 1; + class Attributes { + align = "center"; + font = "RobotoCondensed"; + shadow = "false"; + }; + }; + }; + }; }; -}; +}; \ No newline at end of file diff --git a/addons/gui/gui_defines.hpp b/addons/gui/gui_defines.hpp index 6192eb7b2..344d1d188 100644 --- a/addons/gui/gui_defines.hpp +++ b/addons/gui/gui_defines.hpp @@ -140,7 +140,18 @@ #define IDC_TEST_HCO3 71205 #define IDC_TEST_PH 71206 #define IDC_TEST_RESET 71207 - -#define IDC_TEST_SHOWBUTTON 71208 - -#define IDC_ABG_BACKGROUND 71299 +#define IDC_TEST_SHOWBUTTON 71208 + +#define IDC_ABG_BACKGROUND 71299 +#define IDC_SYRINGE_TITLE 71300 +#define IDC_SYRINGE_BACKGROUND 71301 +#define IDC_SYRINGE_TYPE_TITLE 71302 +#define IDC_SYRINGE_TYPE_LIST 71303 +#define IDC_MEDICATION_TYPE_TITLE 71304 +#define IDC_MEDICATION_TYPE_LIST 71305 +#define IDC_MEDICATION_DOSE_TITLE 71306 +#define IDC_MEDICATION_DOSE_COMBO 71307 +#define IDC_MEDICATION_PREP_SYRINGE 71308 +#define IDC_SYRINGE_CLOSE 71309 +#define IDC_SYRINGE_OPEN 71310 +#define IDC_SYRINGE_GROUP 71311 diff --git a/addons/gui/stringtable.xml b/addons/gui/stringtable.xml index 056595910..d7514fe95 100644 --- a/addons/gui/stringtable.xml +++ b/addons/gui/stringtable.xml @@ -231,5 +231,35 @@ Restaurar リセット + + Syringe Preparation + + + Syringe Type + + + Medication Type + + + Dose Size + + + Low + + + Medium + + + High + + + Prepare Syringe + + + Close + + + Syringe Prep + diff --git a/addons/main/script_macros.hpp b/addons/main/script_macros.hpp index 7007174ec..91e9b54bb 100644 --- a/addons/main/script_macros.hpp +++ b/addons/main/script_macros.hpp @@ -163,7 +163,7 @@ // Defined here for easy consistency with GETVAR/SETVAR (also a list for reference) #define VAR_BLOOD_PRESS QACEGVAR(medical,bloodPressure) #define VAR_BLOOD_VOL QACEGVAR(medical,bloodVolume) -#define VAR_WOUND_BLEEDING QACEGVAR(medical,woundBleeding) +#define VAR_WOUND_BLEEDING QEGVAR(circulation,woundBleeding) #define VAR_CRDC_ARRST QACEGVAR(medical,inCardiacArrest) #define VAR_HEART_RATE QACEGVAR(medical,heartRate) #define VAR_PAIN QACEGVAR(medical,pain) @@ -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 @@ -299,8 +300,9 @@ #define OXYGEN_PERCENTAGE_FATAL 75 // Breathing -#define VAR_SURFACE_AREA 400 -#define GET_KAT_SURFACE_AREA(unit) (VAR_SURFACE_AREA - (((unit getVariable [QEGVAR(breathing,pneumothorax), 0]) * 75))) +#define LUNG_SURFACE_AREA QEGVAR(breathing,lungSurfaceArea) +#define VAR_SURFACE_AREA(unit) (unit getVariable [LUNG_SURFACE_AREA, 400]) +#define GET_KAT_SURFACE_AREA(unit) (VAR_SURFACE_AREA(unit) - (((unit getVariable [QEGVAR(breathing,pneumothorax), 0]) * 75))) #define VAR_BLOOD_GAS QEGVAR(circulation,bloodGas) #define VAR_BREATHING_RATE QEGVAR(breathing,breathRate) diff --git a/addons/pharma/ACE_Medical_Treatment.hpp b/addons/pharma/ACE_Medical_Treatment.hpp index 71ec22cca..80bbfca4d 100644 --- a/addons/pharma/ACE_Medical_Treatment.hpp +++ b/addons/pharma/ACE_Medical_Treatment.hpp @@ -11,6 +11,8 @@ class ACE_ADDON(Medical_Treatment) { timeInSystem = 120; // How long until the maximum effect is reached timeTillMaxEffect = 30; + + dose = 1; // How many of this type of medication can be in the system before the patient overdoses? maxDose = 4; // The number of doses over maxDose where there is a chance to overdose. @@ -28,14 +30,17 @@ class ACE_ADDON(Medical_Treatment) { opioidRelief = 0; // How strong should opioid visuals be opioidEffect = 0; + //multiplier to respiratory rate + respiratoryRate = 0; class Epinephrine { painReduce = 0; - hrIncreaseLow[] = {10, 20}; - hrIncreaseNormal[] = {10, 50}; - hrIncreaseHigh[] = {10, 40}; + hrIncreaseLow[] = {5, 20}; + hrIncreaseNormal[] = {5, 25}; + hrIncreaseHigh[] = {5, 20}; timeInSystem = 120; timeTillMaxEffect = 10; + dose = 1; maxDose = 6; maxDoseDeviation = 4; incompatibleMedication[] = {}; @@ -44,11 +49,12 @@ class ACE_ADDON(Medical_Treatment) { }; class EpinephrineIV { painReduce = 0; - hrIncreaseLow[] = {15, 30}; - hrIncreaseNormal[] = {10, 50}; - hrIncreaseHigh[] = {15, 40}; - timeInSystem = 120; + hrIncreaseLow[] = {5, 30}; + hrIncreaseNormal[] = {10, 30}; + hrIncreaseHigh[] = {5, 30}; + timeInSystem = 300; timeTillMaxEffect = 10; + dose = 1; maxDose = 4; maxDoseDeviation = 2; incompatibleMedication[] = {}; @@ -56,17 +62,57 @@ class ACE_ADDON(Medical_Treatment) { onOverDose = ""; }; class Morphine { + painReduce = 0.6; + hrIncreaseLow[] = {-2, -10}; + hrIncreaseNormal[] = {-5, -10}; + hrIncreaseHigh[] = {-10, -15}; + timeInSystem = 300; + timeTillMaxEffect = 60; + dose = 1; + maxDose = 2; + maxDoseDeviation = 1; + incompatibleMedication[] = {}; + viscosityChange = -0; + }; + class MorphineIV { painReduce = 0.8; - hrIncreaseLow[] = {-10, -20}; - hrIncreaseNormal[] = {-10, -30}; - hrIncreaseHigh[] = {-10, -35}; + hrIncreaseLow[] = {-5, -15}; + hrIncreaseNormal[] = {-5, -20}; + hrIncreaseHigh[] = {-5, -20}; timeInSystem = 900; timeTillMaxEffect = 30; + dose = 1; + maxDose = 2; + maxDoseDeviation = 1; + incompatibleMedication[] = {}; + viscosityChange = -15; + opioidRelief = 1.3; + }; + class Adenosine { + painReduce = 0; + hrIncreaseLow[] = {-4, -10}; + hrIncreaseNormal[] = {-5, -10}; + hrIncreaseHigh[] = {-5, -15}; + timeInSystem = 180; + timeTillMaxEffect = 30; + dose = 1; maxDose = 4; - maxDoseDeviation = 4; + maxDoseDeviation = 2; incompatibleMedication[] = {}; - viscosityChange = -10; - opioidRelief = 0.1; + viscosityChange = 0; + }; + class AdenosineIV { + painReduce = 0; + hrIncreaseLow[] = {-7, -10}; + hrIncreaseNormal[] = {-15, -20}; + hrIncreaseHigh[] = {-15, -25}; + timeInSystem = 360; + timeTillMaxEffect = 15; + dose = 1; + maxDose = 2; + maxDoseDeviation = 2; + incompatibleMedication[] = {}; + viscosityChange = 0; }; class Carbonate { painReduce = 0; @@ -75,6 +121,7 @@ class ACE_ADDON(Medical_Treatment) { hrIncreaseHigh[] = {15, 20}; timeInSystem = 30; timeTillMaxEffect = 2; + dose = 1; maxDose = 10; incompatibleMedication[] = {}; viscosityChange = 0; @@ -85,8 +132,9 @@ class ACE_ADDON(Medical_Treatment) { hrIncreaseLow[] = {0, 0}; hrIncreaseNormal[] = {0, 0}; hrIncreaseHigh[] = {0, 0}; - timeInSystem = 120; - timeTillMaxEffect = 5; + timeInSystem = 240; + timeTillMaxEffect = 30; + dose = 1; maxDose = 3; incompatibleMedication[] = {}; viscosityChange = 0; @@ -99,6 +147,7 @@ class ACE_ADDON(Medical_Treatment) { hrIncreaseHigh[] = {5, 10}; timeInSystem = 360; timeTillMaxEffect = 15; + dose = 1; maxDose = 12; incompatibleMedication[] = {}; viscosityChange = 25; @@ -112,6 +161,7 @@ class ACE_ADDON(Medical_Treatment) { hrIncreaseHigh[] = {-10, -15}; timeInSystem = 360; timeTillMaxEffect = 15; + dose = 1; maxDose = 6; maxDoseDeviation = 4; incompatibleMedication[] = {}; @@ -126,6 +176,7 @@ class ACE_ADDON(Medical_Treatment) { hrIncreaseHigh[] = {-10, -15}; timeInSystem = 360; timeTillMaxEffect = 15; + dose = 1; maxDose = 6; maxDoseDeviation = 4; incompatibleMedication[] = {}; @@ -139,6 +190,7 @@ class ACE_ADDON(Medical_Treatment) { hrIncreaseHigh[] = {10, 15}; timeInSystem = 360; timeTillMaxEffect = 15; + dose = 1; maxDose = 6; maxDoseDeviation = 4; incompatibleMedication[] = {}; @@ -153,6 +205,7 @@ class ACE_ADDON(Medical_Treatment) { hrIncreaseHigh[] = {-20, -10}; timeInSystem = 900; timeTillMaxEffect = 20; + dose = 1; maxDose = 1; maxDoseDeviation = 1; incompatibleMedication[] = {}; @@ -168,6 +221,7 @@ class ACE_ADDON(Medical_Treatment) { hrIncreaseHigh[] = {10, 15}; timeInSystem = 900; timeTillMaxEffect = 15; + dose = 1; maxDose = 2; maxDoseDeviation = 2; incompatibleMedication[] = {}; @@ -182,6 +236,7 @@ class ACE_ADDON(Medical_Treatment) { hrIncreaseHigh[] = {-15, -5}; timeInSystem = 900; timeTillMaxEffect = 30; + dose = 1; maxDose = 2; maxDoseDeviation = 2; incompatibleMedication[] = {}; @@ -196,12 +251,13 @@ class ACE_ADDON(Medical_Treatment) { hrIncreaseHigh[] = {5, 10}; timeInSystem = 360; timeTillMaxEffect = 45; + dose = 1; maxDose = 6; maxDoseDeviation = 4; incompatibleMedication[] = {}; viscosityChange = -5; onOverDose = ""; - maxRelief = 0.5; + maxRelief = 0.4; }; class Atropine { painReduce = 0; @@ -210,6 +266,7 @@ class ACE_ADDON(Medical_Treatment) { hrIncreaseHigh[] = {5, 15}; timeInSystem = 120; timeTillMaxEffect = 30; + dose = 1; maxDose = 4; incompatibleMedication[]= {}; viscosityChange = 0; @@ -222,6 +279,7 @@ class ACE_ADDON(Medical_Treatment) { hrIncreaseHigh[] = {0, 0, 0}; timeInSystem = 120; timeTillMaxEffect = 30; + dose = 1; maxDose = 4; incompatibleMedication[]= {}; viscosityChange = 0; @@ -234,6 +292,7 @@ class ACE_ADDON(Medical_Treatment) { hrIncreaseHigh[] = {0, 0, 0}; timeInSystem = 120; timeTillMaxEffect = 30; + dose = 1; maxDose = 2; maxDoseDeviation = 4; incompatibleMedication[]= {}; @@ -246,7 +305,8 @@ class ACE_ADDON(Medical_Treatment) { hrIncreaseNormal[] = {0, 0}; hrIncreaseHigh[] = {0, 0}; timeInSystem = 600; - timeTillMaxEffect = 15; + timeTillMaxEffect = 60; + dose = 1; maxDose = 10; incompatibleMedication[] = {}; viscosityChange = 0; @@ -259,6 +319,7 @@ class ACE_ADDON(Medical_Treatment) { hrIncreaseHigh[] = {-20, -30}; timeInSystem = 45; timeTillMaxEffect = 5; + dose = 1; maxDose = 10; incompatibleMedication[] = {}; viscosityChange = 0; @@ -271,6 +332,7 @@ class ACE_ADDON(Medical_Treatment) { hrIncreaseHigh[] = {0, 0}; timeInSystem = 60; timeTillMaxEffect = 5; + dose = 1; maxDose = 3; incompatibleMedication[] = {}; viscosityChange = 0; @@ -283,6 +345,7 @@ class ACE_ADDON(Medical_Treatment) { hrIncreaseHigh[] = {0, 0}; timeInSystem = 60; timeTillMaxEffect = 5; + dose = 1; maxDose = 3; incompatibleMedication[] = {}; viscosityChange = -15; @@ -295,6 +358,7 @@ class ACE_ADDON(Medical_Treatment) { hrIncreaseHigh[] = {15, 25}; timeInSystem = 600; timeTillMaxEffect = 5; + dose = 1; maxDose = 2; maxDoseDeviation = 1; incompatibleMedication[] = {}; @@ -309,6 +373,7 @@ class ACE_ADDON(Medical_Treatment) { hrIncreaseHigh[] = {5, 15}; timeInSystem = 1800; timeTillMaxEffect = 5; + dose = 1; maxDose = 4; maxDoseDeviation = 4; incompatibleMedication[] = {}; @@ -322,6 +387,7 @@ class ACE_ADDON(Medical_Treatment) { hrIncreaseHigh[] = {0, 0}; timeInSystem = 300; timeTillMaxEffect = 5; + dose = 1; maxDose = 0; incompatibleMedication[] = {}; viscosityChange = 0; @@ -334,11 +400,626 @@ class ACE_ADDON(Medical_Treatment) { hrIncreaseHigh[] = {-5, -15}; timeInSystem = 300; timeTillMaxEffect = 20; + dose = 1; maxDose = 4; incompatibleMedication[] = {}; viscosityChange = 5; onOverDose = ""; maxRelief = 0.6; }; + class syringe_txa_5ml_1 { + painReduce = 0; + hrIncreaseLow[] = {-2, -5}; + hrIncreaseNormal[] = {-2, -5}; + hrIncreaseHigh[] = {-2, -5}; + timeInSystem = 120; + timeTillMaxEffect = 5; + dose = 1; + viscosityChange = 0; + }; + class syringe_txa_5ml_3 { + painReduce = 0; + hrIncreaseLow[] = {-4, -12}; + hrIncreaseNormal[] = {-4, -12}; + hrIncreaseHigh[] = {-4, -12}; + timeInSystem = 240; + timeTillMaxEffect = 5; + dose = 3; + viscosityChange = 0; + }; + class syringe_txa_10ml_1 { + painReduce = 0; + hrIncreaseLow[] = {-2, -5}; + hrIncreaseNormal[] = {-2, -5}; + hrIncreaseHigh[] = {-2, -5}; + timeInSystem = 120; + timeTillMaxEffect = 20; + dose = 1; + viscosityChange = 0; + }; + class syringe_txa_10ml_3 { + painReduce = 0; + hrIncreaseLow[] = {-4, -12}; + hrIncreaseNormal[] = {-4, -12}; + hrIncreaseHigh[] = {-4, -12}; + timeInSystem = 180; + timeTillMaxEffect = 20; + dose = 3; + viscosityChange = 0; + }; + class syringe_eaca_5ml_1 { + painReduce = 0; + hrIncreaseLow[] = {-2, -5}; + hrIncreaseNormal[] = {-2, -5}; + hrIncreaseHigh[] = {-2, -5}; + timeInSystem = 100; + timeTillMaxEffect = 35; + dose = 1; + viscosityChange = 0; + }; + class syringe_eaca_5ml_3 { + painReduce = 0; + hrIncreaseLow[] = {-4, -12}; + hrIncreaseNormal[] = {-4, -12}; + hrIncreaseHigh[] = {-4, -12}; + timeInSystem = 300; + timeTillMaxEffect = 35; + dose = 3; + viscosityChange = 0; + }; + class syringe_epinephrineIV_5ml_1 { + painReduce = 0; + hrIncreaseLow[] = {10, 20}; + hrIncreaseNormal[] = {10, 30}; + hrIncreaseHigh[] = {15, 30}; + timeInSystem = 120; + timeTillMaxEffect = 10; + dose = 1; + alphaFactor = -0.2; + }; + class syringe_epinephrineIV_5ml_3 { + painReduce = 0; + hrIncreaseLow[] = {10, 20}; + hrIncreaseNormal[] = {10, 35}; + hrIncreaseHigh[] = {15, 30}; + timeInSystem = 180; + timeTillMaxEffect = 10; + dose = 3; + alphaFactor = -0.4; + }; + class syringe_norepinephrine_5ml_1 { + painReduce = 0; + hrIncreaseLow[] = {-5, 5}; + hrIncreaseNormal[] = {-10, 5}; + hrIncreaseHigh[] = {-10, 5}; + timeInSystem = 360; + timeTillMaxEffect = 15; + viscosityChange = 15; + dose = 1; + alphaFactor = -0.2; + }; + class syringe_norepinephrine_5ml_3 { + painReduce = 0; + hrIncreaseLow[] = {-10, 0}; + hrIncreaseNormal[] = {-15, 5}; + hrIncreaseHigh[] = {-15, 5}; + timeInSystem = 360; + timeTillMaxEffect = 15; + dose = 3; + viscosityChange = 25; + alphaFactor = -0.4; + }; + class syringe_phenylephrine_5ml_1 { + painReduce = 0; + hrIncreaseLow[] = {2, 10}; + hrIncreaseNormal[] = {2, 15}; + hrIncreaseHigh[] = {2, 10}; + timeInSystem = 180; + timeTillMaxEffect = 15; + viscosityChange = 35; + dose = 1; + alphaFactor = -0.4; + }; + class syringe_phenylephrine_5ml_3 { + painReduce = 0; + hrIncreaseLow[] = {2, 15}; + hrIncreaseNormal[] = {2, 20}; + hrIncreaseHigh[] = {2, 15}; + timeInSystem = 300; + timeTillMaxEffect = 15; + viscosityChange = 50; + dose = 3; + alphaFactor = -0.7; + }; + class syringe_nitroglycerin_5ml_1 { + painReduce = 0; + hrIncreaseLow[] = {5, 10}; + hrIncreaseNormal[] = {10, 15}; + hrIncreaseHigh[] = {10, 15}; + timeInSystem = 360; + timeTillMaxEffect = 15; + viscosityChange = -25; + dose = 1; + alphaFactor = 0.3; + }; + class syringe_nitroglycerin_5ml_3 { + painReduce = 0; + hrIncreaseLow[] = {5, 15}; + hrIncreaseNormal[] = {5, 20}; + hrIncreaseHigh[] = {5, 20}; + timeInSystem = 360; + timeTillMaxEffect = 15; + dose = 3; + viscosityChange = -35; + alphaFactor = 0.5; + }; + class syringe_fentanyl_5ml_1 { + painReduce = 0.6; + hrIncreaseLow[] = {-5, -10}; + hrIncreaseNormal[] = {-10, -15}; + hrIncreaseHigh[] = {-10, -15}; + timeInSystem = 900; + timeTillMaxEffect = 20; + dose = 1; + viscosityChange = -10; + opioidRelief = 1.2; + opioidEffect = 0.17; + respiratoryRate = -0.2; + }; + class syringe_fentanyl_5ml_3 { + painReduce = 1; + hrIncreaseLow[] = {-5, -15}; + hrIncreaseNormal[] = {-10, -20}; + hrIncreaseHigh[] = {-10, -20}; + timeInSystem = 900; + timeTillMaxEffect = 20; + dose = 3; + viscosityChange = -10; + opioidRelief = 1.5; + opioidEffect = 0.25; + respiratoryRate = -0.3; + }; + class syringe_ketamine_5ml_1 { + painReduce = 0.5; + hrIncreaseLow[] = {5, 20}; + hrIncreaseNormal[] = {10, 25}; + hrIncreaseHigh[] = {5, 25}; + timeInSystem = 600; + timeTillMaxEffect = 15; + dose = 1; + viscosityChange = 10; + opioidEffect = 0.18; + respiratoryRate = -0.3; + }; + class syringe_ketamine_5ml_3 { + painReduce = 0.8; + hrIncreaseLow[] = {15, 30}; + hrIncreaseNormal[] = {15, 35}; + hrIncreaseHigh[] = {15, 35}; + timeInSystem = 900; + timeTillMaxEffect = 15; + dose = 3; + viscosityChange = 10; + onOverDose = ""; + opioidEffect = 0.21; + respiratoryRate = -0.4; + }; + class syringe_nalbuphine_5ml_1 { + painReduce = 0.5; + hrIncreaseLow[] = {-5, 0}; + hrIncreaseNormal[] = {-10, -5}; + hrIncreaseHigh[] = {-15, -5}; + timeInSystem = 600; + timeTillMaxEffect = 30; + dose = 1; + viscosityChange = -5; + opioidRelief = 1.1; + respiratoryRate = -0.1; + }; + class syringe_nalbuphine_5ml_3 { + painReduce = 0.7; + hrIncreaseLow[] = {0, -10}; + hrIncreaseNormal[] = {-5, -15}; + hrIncreaseHigh[] = {-5, -15}; + timeInSystem = 900; + timeTillMaxEffect = 30; + dose = 3; + viscosityChange = -5; + opioidRelief = 1.2; + respiratoryRate = -0.1; + }; + class syringe_atropineIV_5ml_1 { + painReduce = 0; + hrIncreaseLow[] = {5, 20}; + hrIncreaseNormal[] = {5, 15}; + hrIncreaseHigh[] = {5, 10}; + timeInSystem = 120; + timeTillMaxEffect = 30; + dose = 1; + viscosityChange = 0; + }; + class syringe_atropineIV_5ml_3 { + painReduce = 0; + hrIncreaseLow[] = {10, 30}; + hrIncreaseNormal[] = {10, 25}; + hrIncreaseHigh[] = {5, 15}; + timeInSystem = 120; + timeTillMaxEffect = 30; + dose = 3; + viscosityChange = 0; + }; + class syringe_amiodarone_5ml_1 { + painReduce = 0; + hrIncreaseLow[] = {0, 0}; + hrIncreaseNormal[] = {0, 0}; + hrIncreaseHigh[] = {0, 0}; + timeInSystem = 120; + timeTillMaxEffect = 30; + dose = 1; + viscosityChange = 0; + }; + class syringe_amiodarone_5ml_3 { + painReduce = 0; + hrIncreaseLow[] = {0, 0}; + hrIncreaseNormal[] = {0, 0}; + hrIncreaseHigh[] = {0, 0}; + timeInSystem = 120; + timeTillMaxEffect = 30; + dose = 3; + viscosityChange = 0; + }; + class syringe_lidocaine_5ml_1 { + painReduce = 0; + hrIncreaseLow[] = {0, 0}; + hrIncreaseNormal[] = {0, 0}; + hrIncreaseHigh[] = {0, 0}; + timeInSystem = 120; + timeTillMaxEffect = 30; + dose = 1; + }; + class syringe_lidocaine_5ml_3 { + painReduce = 0; + hrIncreaseLow[] = {0, 0}; + hrIncreaseNormal[] = {0, 0}; + hrIncreaseHigh[] = {0, 0}; + timeInSystem = 120; + timeTillMaxEffect = 30; + dose = 3; + }; + class syringe_etomidate_5ml_1 { + painReduce = 0.2; + hrIncreaseLow[] = {0, -5}; + hrIncreaseNormal[] = {-5, -10}; + hrIncreaseHigh[] = {-10, -15}; + timeInSystem = 60; + timeTillMaxEffect = 5; + dose = 1; + viscosityChange = 0; + }; + class syringe_etomidate_5ml_3 { + painReduce = 0.4; + hrIncreaseLow[] = {-5, -10}; + hrIncreaseNormal[] = {-5, -15}; + hrIncreaseHigh[] = {-10, -15}; + timeInSystem = 30; + timeTillMaxEffect = 5; + dose = 3; + viscosityChange = 0; + }; + class syringe_flumazenil_5ml_1 { + painReduce = 0; + hrIncreaseLow[] = {0, 0}; + hrIncreaseNormal[] = {0, 0}; + hrIncreaseHigh[] = {0, 0}; + timeInSystem = 60; + timeTillMaxEffect = 5; + dose = 1; + viscosityChange = 0; + }; + class syringe_flumazenil_5ml_3 { + painReduce = 0; + hrIncreaseLow[] = {0, 0}; + hrIncreaseNormal[] = {0, 0}; + hrIncreaseHigh[] = {0, 0}; + timeInSystem = 60; + timeTillMaxEffect = 5; + dose = 3; + viscosityChange = 0; + }; + class syringe_lorazepam_5ml_1 { + painReduce = 0; + hrIncreaseLow[] = {5, 10}; + hrIncreaseNormal[] = {5, 15}; + hrIncreaseHigh[] = {7, 15}; + timeInSystem = 60; + timeTillMaxEffect = 5; + dose = 1; + viscosityChange = -10; + respiratoryRate = -0.1; + }; + class syringe_lorazepam_5ml_3 { + painReduce = 0; + hrIncreaseLow[] = {5, 15}; + hrIncreaseNormal[] = {5, 20}; + hrIncreaseHigh[] = {5, 20}; + timeInSystem = 60; + timeTillMaxEffect = 5; + dose = 3; + viscosityChange = -15; + respiratoryRate = -0.1; + }; + class syringe_morphineIV_5ml_1 { + painReduce = 0.6; + hrIncreaseLow[] = {-5, -15}; + hrIncreaseNormal[] = {-5, -20}; + hrIncreaseHigh[] = {-5, -20}; + timeInSystem = 600; + timeTillMaxEffect = 30; + dose = 1; + viscosityChange = -15; + opioidRelief = 1.2; + respiratoryRate = -0.2; + }; + class syringe_morphineIV_5ml_3 { + painReduce = 0.8; + hrIncreaseLow[] = {-5, -15}; + hrIncreaseNormal[] = {-5, -25}; + hrIncreaseHigh[] = {-5, -25}; + timeInSystem = 600; + timeTillMaxEffect = 30; + dose = 3; + viscosityChange = -20; + opioidRelief = 1.3; + respiratoryRate = -0.3; + }; + class syringe_adenosineIV_5ml_1 { + painReduce = 0; + hrIncreaseLow[] = {-3, -10}; + hrIncreaseNormal[] = {-5, -10}; + hrIncreaseHigh[] = {-5, -15}; + timeInSystem = 180; + timeTillMaxEffect = 15; + dose = 1; + viscosityChange = 0; + }; + class syringe_adenosineIV_5ml_3 { + painReduce = 0; + hrIncreaseLow[] = {-3, -10}; + hrIncreaseNormal[] = {-5, -15}; + hrIncreaseHigh[] = {-5, -20}; + timeInSystem = 180; + timeTillMaxEffect = 15; + dose = 3; + viscosityChange = 0; + }; + class syringe_alteplase_5ml_3 { + painReduce = 0; + hrIncreaseLow[] = {-4, -10}; + hrIncreaseNormal[] = {-5, -15}; + hrIncreaseHigh[] = {-5, -20}; + timeInSystem = 180; + timeTillMaxEffect = 30; + dose = 3; + maxDose = 3; + maxDoseDeviation = 0; + incompatibleMedication[] = {}; + viscosityChange = 0; + }; + class syringe_fentanyl_10ml_1 { + painReduce = 0.6; + hrIncreaseLow[] = {-5, -10}; + hrIncreaseNormal[] = {-10, -15}; + hrIncreaseHigh[] = {-10, -15}; + timeInSystem = 300; + timeTillMaxEffect = 60; + dose = 1; + viscosityChange = -10; + onOverDose = ""; + opioidRelief = 1.1; + opioidEffect = 0.15; + respiratoryRate = -0.2; + }; + class syringe_fentanyl_10ml_3 { + painReduce = 0.8; + hrIncreaseLow[] = {-5, -15}; + hrIncreaseNormal[] = {-10, -20}; + hrIncreaseHigh[] = {-10, -20}; + timeInSystem = 600; + timeTillMaxEffect = 60; + dose = 3; + viscosityChange = -10; + opioidRelief = 1.3; + opioidEffect = 0.17; + respiratoryRate = -0.3; + }; + class syringe_ketamine_10ml_1 { + painReduce = 0.6; + hrIncreaseLow[] = {5, 20}; + hrIncreaseNormal[] = {10, 25}; + hrIncreaseHigh[] = {5, 25}; + timeInSystem = 300; + timeTillMaxEffect = 30; + dose = 1; + viscosityChange = 10; + opioidEffect = 0.12; + respiratoryRate = -0.3; + }; + class syringe_ketamine_10ml_3 { + painReduce = 0.8; + hrIncreaseLow[] = {15, 30}; + hrIncreaseNormal[] = {15, 35}; + hrIncreaseHigh[] = {15, 35}; + timeInSystem = 450; + timeTillMaxEffect = 30; + dose = 3; + viscosityChange = 10; + opioidEffect = 0.15; + respiratoryRate = -0.4; + }; + class syringe_nalbuphine_10ml_1 { + painReduce = 0.5; + hrIncreaseLow[] = {-5, 0}; + hrIncreaseNormal[] = {-10, -5}; + hrIncreaseHigh[] = {-15, -5}; + timeInSystem = 300; + timeTillMaxEffect = 45; + dose = 1; + viscosityChange = -5; + opioidRelief = 1.1; + respiratoryRate = -0.1; + }; + class syringe_nalbuphine_10ml_3 { + painReduce = 0.7; + hrIncreaseLow[] = {0, -10}; + hrIncreaseNormal[] = {-5, -15}; + hrIncreaseHigh[] = {-5, -15}; + timeInSystem = 300; + timeTillMaxEffect = 45; + dose = 3; + viscosityChange = -5; + opioidRelief = 1.2; + respiratoryRate = -0.1; + }; + class syringe_lidocaine_10ml_1 { + painReduce = 0; + hrIncreaseLow[] = {0, 0}; + hrIncreaseNormal[] = {0, 0}; + hrIncreaseHigh[] = {0, 0}; + timeInSystem = 120; + timeTillMaxEffect = 30; + dose = 1; + }; + class syringe_morphineIV_10ml_1 { + painReduce = 0.6; + hrIncreaseLow[] = {-5, -15}; + hrIncreaseNormal[] = {-5, -20}; + hrIncreaseHigh[] = {-5, -20}; + timeInSystem = 600; + timeTillMaxEffect = 30; + dose = 1; + viscosityChange = -15; + opioidRelief = 1.1; + respiratoryRate = -0.2; + }; + class syringe_morphineIV_10ml_3 { + painReduce = 0.8; + hrIncreaseLow[] = {-5, -15}; + hrIncreaseNormal[] = {-5, -25}; + hrIncreaseHigh[] = {-5, -25}; + timeInSystem = 600; + timeTillMaxEffect = 30; + dose = 3; + viscosityChange = -15; + opioidRelief = 1.3; + respiratoryRate = -0.3; + }; + class syringe_txa { + maxDose = 6; + maxDoseDeviation = 2; + incompatibleMedication[] = {}; + onOverDose = ""; + }; + class syringe_eaca { + maxDose = 6; + maxDoseDeviation = 2; + incompatibleMedication[] = {}; + onOverDose = ""; + }; + class syringe_epinephrineIV { + maxDose = 9; + maxDoseDeviation = 3; + incompatibleMedication[] = {}; + onOverDose = ""; + }; + class syringe_norepinephrine { + maxDose = 6; + maxDoseDeviation = 3; + incompatibleMedication[] = {}; + onOverDose = ""; + }; + class syringe_phenylephrine { + maxDose = 6; + maxDoseDeviation = 3; + incompatibleMedication[] = {}; + onOverDose = ""; + }; + class syringe_nitroglycerin { + maxDose = 6; + maxDoseDeviation = 3; + incompatibleMedication[] = {}; + onOverDose = ""; + }; + class syringe_atropineIV { + maxDose = 9; + maxDoseDeviation = 3; + incompatibleMedication[] = {}; + onOverDose = ""; + }; + class syringe_amiodarone { + maxDose = 6; + maxDoseDeviation = 3; + incompatibleMedication[] = {}; + onOverDose = ""; + }; + class syringe_etomidate { + maxDose = 9; + maxDoseDeviation = 3; + incompatibleMedication[] = {}; + onOverDose = ""; + }; + class syringe_flumazenil { + maxDose = 4; + maxDoseDeviation = 2; + incompatibleMedication[] = {}; + onOverDose = ""; + }; + class syringe_lorazepam { + maxDose = 4; + maxDoseDeviation = 2; + incompatibleMedication[] = {}; + onOverDose = ""; + }; + class syringe_lidocaine { + maxDose = 6; + maxDoseDeviation = 3; + incompatibleMedication[] = {}; + onOverDose = ""; + }; + class syringe_fentanyl { + maxDose = 3; + maxDoseDeviation = 1; + incompatibleMedication[] = {}; + onOverDose = ""; + }; + class syringe_ketamine { + maxDose = 4; + maxDoseDeviation = 2; + incompatibleMedication[] = {}; + onOverDose = ""; + }; + class syringe_nalbuphine { + maxDose = 4; + maxDoseDeviation = 2; + incompatibleMedication[] = {}; + onOverDose = ""; + }; + class syringe_morphineIV { + maxDose = 3; + maxDoseDeviation = 3; + incompatibleMedication[] = {}; + onOverDose = ""; + }; + class syringe_adenosineIV { + maxDose = 6; + maxDoseDeviation = 3; + incompatibleMedication[] = {}; + onOverDose = ""; + }; + class syringe_alteplase { + maxDose = 3; + maxDoseDeviation = 0; + incompatibleMedication[] = {}; + onOverDose = ""; + }; }; }; diff --git a/addons/pharma/ACE_Medical_Treatment_Actions.hpp b/addons/pharma/ACE_Medical_Treatment_Actions.hpp index 66c4ee124..7222038f3 100644 --- a/addons/pharma/ACE_Medical_Treatment_Actions.hpp +++ b/addons/pharma/ACE_Medical_Treatment_Actions.hpp @@ -138,7 +138,7 @@ class ACE_Medical_Treatment_Actions { medicRequired = QGVAR(medLvl_EACA); treatmentTime = QGVAR(treatmentTime_EACA); items[] = {"kat_EACA"}; - condition = QUOTE(!(GVAR(MedicationsRequireInsIV)) || FUNC(removeIV)); + condition = QUOTE(FUNC(AMSCheck)); callbackSuccess = QFUNC(medication); sounds[] = {}; }; @@ -251,6 +251,16 @@ class ACE_Medical_Treatment_Actions { callbackSuccess = QFUNC(medication); sounds[] = {}; }; + class AtropineIV: EACA { + displayName = CSTRING(Take_AtropineIV); + allowedSelections[] = {"Body", "LeftArm", "RightArm", "LeftLeg", "RightLeg"}; + allowSelfTreatment = 1; + medicRequired = QGVAR(medLvl_AtropineIV); + treatmentTime = QGVAR(treatmentTime_AtropineIV); + items[] = {"kat_atropineIV"}; + callbackSuccess = QFUNC(medication); + sounds[] = {}; + }; class Ketamine: EACA { displayName = CSTRING(Take_Ketamine); allowedSelections[] = {"Body", "LeftArm", "RightArm", "LeftLeg", "RightLeg"}; @@ -281,6 +291,26 @@ class ACE_Medical_Treatment_Actions { callbackSuccess = QFUNC(medication); sounds[] = {}; }; + class MorphineIV: EACA { + displayName = CSTRING(Take_MorphineIV); + allowedSelections[] = {"Body", "LeftArm", "RightArm", "LeftLeg", "RightLeg"}; + allowSelfTreatment = 1; + medicRequired = QGVAR(medLvl_MorphineIV); + treatmentTime = QGVAR(treatmentTime_MorphineIV); + items[] = {"kat_morphineIV"}; + callbackSuccess = QFUNC(medication); + sounds[] = {}; + }; + class AdenosineIV: EACA { + displayName = CSTRING(Take_AdenosineIV); + allowedSelections[] = {"Body", "LeftArm", "RightArm", "LeftLeg", "RightLeg"}; + allowSelfTreatment = 1; + medicRequired = QGVAR(medLvl_AdenosineIV); + treatmentTime = QGVAR(treatmentTime_AdenosineIV); + items[] = {"kat_adenosineIV"}; + callbackSuccess = QFUNC(medication); + sounds[] = {}; + }; class Reorientation: Carbonate { displayName = CSTRING(Take_Reorient); displayNameProgress = CSTRING(Reorienting); @@ -309,6 +339,32 @@ class ACE_Medical_Treatment_Actions { litter[] = {}; sounds[] = {}; }; + class Apply14IV: ApplyIV { + displayName = CSTRING(Apply_IV_14); + displayNameProgress = CSTRING(Applying_IV); + medicRequired = QGVAR(medLvl_Apply14IV); + category = "advanced"; + allowedSelections[] = {"LeftArm", "RightArm", "LeftLeg", "RightLeg"}; + items[] = {"kat_IV_14"}; + condition = QUOTE(!([ARR_3(_player,_patient,_bodyPart)] call FUNC(removeIV))); + treatmentTime = QGVAR(treatmentTime_ApplyIV); + callbackSuccess = QUOTE([ARR_4(_player,_patient,_bodyPart,'kat_IV_14')] call FUNC(applyIV)); + litter[] = {}; + sounds[] = {}; + }; + class Apply20IV: ApplyIV { + displayName = CSTRING(Apply_IV_20); + displayNameProgress = CSTRING(Applying_IV); + medicRequired = QGVAR(medLvl_Apply20IV); + category = "advanced"; + allowedSelections[] = {"LeftArm", "RightArm", "LeftLeg", "RightLeg"}; + items[] = {"kat_IV_20"}; + condition = QUOTE(!([ARR_3(_player,_patient,_bodyPart)] call FUNC(removeIV))); + treatmentTime = QGVAR(treatmentTime_ApplyIV); + callbackSuccess = QUOTE([ARR_4(_player,_patient,_bodyPart,'kat_IV_20')] call FUNC(applyIV)); + litter[] = {}; + sounds[] = {}; + }; class ApplyIO: ApplyIV { displayName = CSTRING(Apply_IO_45); displayNameProgress = CSTRING(Applying_IV); @@ -413,4 +469,449 @@ class ACE_Medical_Treatment_Actions { callbackSuccess = QFUNC(treatmentAdvanced_CheckCoag); litter[] = {}; }; + class syringe_EACA_5ml_1: Carbonate { + displayName = CSTRING(push_EACA_IV_1); + displayNameProgress = CSTRING(pushing_EACA_IV_1); + allowedSelections[] = {"Body", "LeftArm", "RightArm", "LeftLeg", "RightLeg"}; + allowSelfTreatment = 1; + medicRequired = QGVAR(medLvl_EACA); + treatmentTime = QGVAR(treatmentTime_EACA); + items[] = {"kat_syringe_eaca_5ml_1"}; + condition = QUOTE(FUNC(ivCondition)); + callbackSuccess = QFUNC(medication); + sounds[] = {}; + }; + class syringe_EACA_5ml_3: syringe_EACA_5ml_1 { + displayName = CSTRING(push_EACA_IV_3); + displayNameProgress = CSTRING(pushing_EACA_IV_3); + items[] = {"kat_syringe_eaca_5ml_3"}; + callbackSuccess = QFUNC(medication); + sounds[] = {}; + }; + class syringe_TXA_10ml_1: Carbonate { + displayName = CSTRING(inject_TXA_IM_1); + displayNameProgress = CSTRING(injecting_TXA_IM_1); + allowedSelections[] = {"LeftArm", "RightArm", "LeftLeg", "RightLeg"}; + allowSelfTreatment = 1; + medicRequired = QGVAR(medLvl_TXAIM); + treatmentTime = QGVAR(treatmentTime_TXAIM); + items[] = {"kat_syringe_txa_10ml_1"}; + callbackSuccess = QFUNC(medication); + sounds[] = {}; + }; + class syringe_TXA_10ml_3: syringe_TXA_10ml_1 { + displayName = CSTRING(inject_TXA_IM_3); + displayNameProgress = CSTRING(injecting_TXA_IM_3); + items[] = {"kat_syringe_txa_10ml_3"}; + callbackSuccess = QFUNC(medication); + sounds[] = {}; + }; + class syringe_TXA_5ml_1: syringe_EACA_5ml_1 { + displayName = CSTRING(push_TXA_IV_1); + displayNameProgress = CSTRING(pushing_TXA_IV_1); + allowedSelections[] = {"Body", "LeftArm", "RightArm", "LeftLeg", "RightLeg"}; + allowSelfTreatment = 1; + medicRequired = QGVAR(medLvl_TXA); + treatmentTime = QGVAR(treatmentTime_TXA); + items[] = {"kat_syringe_txa_5ml_1"}; + callbackSuccess = QFUNC(medication); + sounds[] = {}; + }; + class syringe_TXA_5ml_3: syringe_TXA_5ml_1 { + displayName = CSTRING(push_TXA_IV_3); + displayNameProgress = CSTRING(pushing_TXA_IV_3); + items[] = {"kat_syringe_txa_5ml_3"}; + callbackSuccess = QFUNC(medication); + sounds[] = {}; + }; + class syringe_norepinephrine_5ml_1: syringe_EACA_5ml_1 { + displayName = CSTRING(push_norepinephrine_IV_1); + displayNameProgress = CSTRING(pushing_norepinephrine_IV_1); + allowedSelections[] = {"Body", "LeftArm", "RightArm", "LeftLeg", "RightLeg"}; + allowSelfTreatment = 1; + medicRequired = QGVAR(medLvl_norepinephrine); + treatmentTime = QGVAR(treatmentTime_norepinephrine); + items[] = {"kat_syringe_norepinephrine_5ml_1"}; + callbackSuccess = QFUNC(medication); + sounds[] = {}; + }; + class syringe_norepinephrine_5ml_3: syringe_norepinephrine_5ml_1 { + displayName = CSTRING(push_norepinephrine_IV_3); + displayNameProgress = CSTRING(pushing_norepinephrine_IV_3); + items[] = {"kat_syringe_norepinephrine_5ml_3"}; + callbackSuccess = QFUNC(medication); + sounds[] = {}; + }; + class syringe_phenylephrine_5ml_1: syringe_EACA_5ml_1 { + displayName = CSTRING(push_phenylephrine_IV_1); + displayNameProgress = CSTRING(pushing_phenylephrine_IV_1); + allowedSelections[] = {"Body", "LeftArm", "RightArm", "LeftLeg", "RightLeg"}; + allowSelfTreatment = 1; + medicRequired = QGVAR(medLvl_phenylephrine); + treatmentTime = QGVAR(treatmentTime_phenylephrine); + items[] = {"kat_syringe_phenylephrine_5ml_1"}; + callbackSuccess = QFUNC(medication); + sounds[] = {}; + }; + class syringe_penylephrine_5ml_3: syringe_phenylephrine_5ml_1 { + displayName = CSTRING(push_phenylephrine_IV_3); + displayNameProgress = CSTRING(pushing_phenylephrine_IV_3); + items[] = {"kat_syringe_phenylephrine_5ml_3"}; + callbackSuccess = QFUNC(medication); + sounds[] = {}; + }; + class syringe_nitroglycerin_5ml_1: syringe_EACA_5ml_1 { + displayName = CSTRING(push_nitroglycerin_IV_1); + displayNameProgress = CSTRING(pushing_nitroglycerin_IV_1); + allowedSelections[] = {"Body", "LeftArm", "RightArm", "LeftLeg", "RightLeg"}; + allowSelfTreatment = 1; + medicRequired = QGVAR(medLvl_nitroglycerin); + treatmentTime = QGVAR(treatmentTime_nitroglycerin); + items[] = {"kat_syringe_nitroglycerin_5ml_1"}; + callbackSuccess = QFUNC(medication); + sounds[] = {}; + }; + class syringe_nitroglycerin_5ml_3: syringe_nitroglycerin_5ml_1 { + displayName = CSTRING(push_nitroglycerin_IV_3); + displayNameProgress = CSTRING(pushing_nitroglycerin_IV_3); + items[] = {"kat_syringe_nitroglycerin_5ml_3"}; + callbackSuccess = QFUNC(medication); + sounds[] = {}; + }; + class syringe_amiodarone_5ml_1: syringe_EACA_5ml_1 { + displayName = CSTRING(push_amiodarone_IV_1); + displayNameProgress = CSTRING(pushing_amiodarone_IV_1); + allowedSelections[] = {"Body", "LeftArm", "RightArm", "LeftLeg", "RightLeg"}; + allowSelfTreatment = 1; + medicRequired = QGVAR(medLvl_amiodarone); + treatmentTime = QGVAR(treatmentTime_amiodarone); + items[] = {"kat_syringe_amiodarone_5ml_1"}; + callbackSuccess = QFUNC(medication); + sounds[] = {}; + }; + class syringe_amiodarone_5ml_3: syringe_amiodarone_5ml_1 { + displayName = CSTRING(push_amiodarone_IV_3); + displayNameProgress = CSTRING(pushing_amiodarone_IV_3); + items[] = {"kat_syringe_amiodarone_5ml_3"}; + callbackSuccess = QFUNC(medication); + sounds[] = {}; + }; + class syringe_alteplase_5ml_3: syringe_EACA_5ml_1 { + displayName = CSTRING(push_alteplase_IV_3); + displayNameProgress = CSTRING(pushing_alteplase_IV_3); + allowedSelections[] = {"Body", "LeftArm", "RightArm", "LeftLeg", "RightLeg"}; + allowSelfTreatment = 1; + medicRequired = QGVAR(medLvl_alteplase); + treatmentTime = QGVAR(treatmentTime_alteplase); + items[] = {"kat_syringe_alteplase_5ml_3"}; + callbackSuccess = QFUNC(medication); + sounds[] = {}; + }; + class syringe_lidocaine_5ml_1: syringe_EACA_5ml_1 { + displayName = CSTRING(push_lidocaine_IV_1); + displayNameProgress = CSTRING(pushing_lidocaine_IV_1); + allowedSelections[] = {"Body", "LeftArm", "RightArm", "LeftLeg", "RightLeg"}; + allowSelfTreatment = 1; + medicRequired = QGVAR(medLvl_lidocaine); + treatmentTime = QGVAR(treatmentTime_lidocaine); + condition = QUOTE(!(GVAR(MedicationsRequireInsIV)) || FUNC(ivCondition)); + items[] = {"kat_syringe_lidocaine_5ml_1"}; + callbackSuccess = QFUNC(medication); + sounds[] = {}; + }; + class syringe_lidocaine_5ml_3: syringe_lidocaine_5ml_1 { + displayName = CSTRING(push_lidocaine_IV_3); + displayNameProgress = CSTRING(pushing_lidocaine_IV_3); + items[] = {"kat_syringe_lidocaine_5ml_3"}; + callbackSuccess = QFUNC(medication); + sounds[] = {}; + }; + class syringe_atropine_5ml_1: syringe_EACA_5ml_1 { + displayName = CSTRING(push_atropine_IV_1); + displayNameProgress = CSTRING(pushing_atropine_IV_1); + allowedSelections[] = {"Body", "LeftArm", "RightArm", "LeftLeg", "RightLeg"}; + allowSelfTreatment = 1; + medicRequired = QGVAR(medLvl_atropine); + treatmentTime = QGVAR(treatmentTime_atropine); + items[] = {"kat_syringe_atropine_5ml_1"}; + callbackSuccess = QFUNC(medication); + sounds[] = {}; + }; + class syringe_atropine_5ml_3: syringe_atropine_5ml_1 { + displayName = CSTRING(push_atropine_IV_3); + displayNameProgress = CSTRING(pushing_atropine_IV_3); + items[] = {"kat_syringe_atropine_5ml_3"}; + callbackSuccess = QFUNC(medication); + sounds[] = {}; + }; + class syringe_ketamine_5ml_1: syringe_EACA_5ml_1 { + displayName = CSTRING(push_ketamine_IV_1); + displayNameProgress = CSTRING(pushing_ketamine_IV_1); + allowedSelections[] = {"Body", "LeftArm", "RightArm", "LeftLeg", "RightLeg"}; + allowSelfTreatment = 1; + medicRequired = QGVAR(medLvl_ketamine); + treatmentTime = QGVAR(treatmentTime_ketamine); + items[] = {"kat_syringe_ketamine_5ml_1"}; + callbackSuccess = QFUNC(medication); + sounds[] = {}; + }; + class syringe_ketamine_5ml_3: syringe_ketamine_5ml_1 { + displayName = CSTRING(push_ketamine_IV_3); + displayNameProgress = CSTRING(pushing_ketamine_IV_3); + category = "surgery"; + items[] = {"kat_syringe_ketamine_5ml_3"}; + callbackSuccess = QFUNC(medication); + sounds[] = {}; + }; + class syringe_fentanyl_5ml_1: syringe_EACA_5ml_1 { + displayName = CSTRING(push_fentanyl_IV_1); + displayNameProgress = CSTRING(pushing_fentanyl_IV_1); + allowedSelections[] = {"Body", "LeftArm", "RightArm", "LeftLeg", "RightLeg"}; + allowSelfTreatment = 1; + medicRequired = QGVAR(medLvl_fentanyl); + treatmentTime = QGVAR(treatmentTime_fentanyl); + items[] = {"kat_syringe_fentanyl_5ml_1"}; + callbackSuccess = QFUNC(medication); + sounds[] = {}; + }; + class syringe_fentanyl_5ml_3: syringe_fentanyl_5ml_1 { + displayName = CSTRING(push_fentanyl_IV_3); + displayNameProgress = CSTRING(pushing_fentanyl_IV_3); + items[] = {"kat_syringe_fentanyl_5ml_3"}; + callbackSuccess = QFUNC(medication); + sounds[] = {}; + }; + class syringe_nalbuphine_5ml_1: syringe_EACA_5ml_1 { + displayName = CSTRING(push_nalbuphine_IV_1); + displayNameProgress = CSTRING(pushing_nalbuphine_IV_1); + allowedSelections[] = {"Body", "LeftArm", "RightArm", "LeftLeg", "RightLeg"}; + allowSelfTreatment = 1; + medicRequired = QGVAR(medLvl_nalbuphine); + treatmentTime = QGVAR(treatmentTime_nalbuphine); + items[] = {"kat_syringe_nalbuphine_5ml_1"}; + callbackSuccess = QFUNC(medication); + sounds[] = {}; + }; + class syringe_nalbuphine_5ml_3: syringe_nalbuphine_5ml_1 { + displayName = CSTRING(push_nalbuphine_IV_3); + displayNameProgress = CSTRING(pushing_nalbuphine_IV_3); + items[] = {"kat_syringe_nalbuphine_5ml_3"}; + callbackSuccess = QFUNC(medication); + sounds[] = {}; + }; + class syringe_morphineIV_5ml_1: syringe_EACA_5ml_1 { + displayName = CSTRING(push_morphineIV_IV_1); + displayNameProgress = CSTRING(pushing_morphineIV_IV_1); + allowedSelections[] = {"Body", "LeftArm", "RightArm", "LeftLeg", "RightLeg"}; + allowSelfTreatment = 1; + medicRequired = QGVAR(medLvl_morphineIV); + treatmentTime = QGVAR(treatmentTime_morphineIV); + items[] = {"kat_syringe_morphineIV_5ml_1"}; + callbackSuccess = QFUNC(medication); + sounds[] = {}; + }; + class syringe_morphineIV_5ml_3: syringe_morphineIV_5ml_1 { + displayName = CSTRING(push_morphineIV_IV_3); + displayNameProgress = CSTRING(pushing_morphineIV_IV_3); + items[] = {"kat_syringe_morphineIV_5ml_3"}; + callbackSuccess = QFUNC(medication); + sounds[] = {}; + }; + class syringe_lorazepam_5ml_1: syringe_EACA_5ml_1 { + displayName = CSTRING(push_lorazepam_IV_1); + displayNameProgress = CSTRING(pushing_lorazepam_IV_1); + category = "surgery"; + allowedSelections[] = {"Body", "LeftArm", "RightArm", "LeftLeg", "RightLeg"}; + allowSelfTreatment = 1; + medicRequired = QGVAR(medLvl_lorazepam); + treatmentTime = QGVAR(treatmentTime_lorazepam); + items[] = {"kat_syringe_lorazepam_5ml_1"}; + callbackSuccess = QFUNC(medication); + sounds[] = {}; + }; + class syringe_lorazapam_5ml_1: syringe_lorazepam_5ml_1 { + displayName = CSTRING(push_lorazepam_IV_3); + displayNameProgress = CSTRING(pushing_lorazepam_IV_3); + category = "surgery"; + items[] = {"kat_syringe_lorazepam_5ml_3"}; + callbackSuccess = QFUNC(medication); + sounds[] = {}; + }; + class syringe_flumazenil_5ml_1: syringe_EACA_5ml_1 { + displayName = CSTRING(push_flumazenil_IV_1); + displayNameProgress = CSTRING(pushing_flumazenil_IV_1); + category = "surgery"; + allowedSelections[] = {"Body", "LeftArm", "RightArm", "LeftLeg", "RightLeg"}; + allowSelfTreatment = 1; + medicRequired = QGVAR(medLvl_flumazenil); + treatmentTime = QGVAR(treatmentTime_flumazenil); + items[] = {"kat_syringe_flumazenil_5ml_1"}; + callbackSuccess = QFUNC(medication); + sounds[] = {}; + }; + class syringe_flumazenil_5ml_3: syringe_flumazenil_5ml_1 { + displayName = CSTRING(push_flumazenil_IV_3); + displayNameProgress = CSTRING(pushing_flumazenil_IV_3); + category = "surgery"; + items[] = {"kat_syringe_flumazenil_5ml_3"}; + callbackSuccess = QFUNC(medication); + sounds[] = {}; + }; + class syringe_etomidate_5ml_1: syringe_EACA_5ml_1 { + displayName = CSTRING(push_etomidate_IV_1); + displayNameProgress = CSTRING(pushing_etomidate_IV_1); + category = "surgery"; + allowedSelections[] = {"Body", "LeftArm", "RightArm", "LeftLeg", "RightLeg"}; + allowSelfTreatment = 1; + medicRequired = QGVAR(medLvl_etomidate); + treatmentTime = QGVAR(treatmentTime_etomidate); + items[] = {"kat_syringe_etomidate_5ml_1"}; + callbackSuccess = QFUNC(medication); + sounds[] = {}; + }; + class syringe_etomidate_5ml_3: syringe_etomidate_5ml_1 { + displayName = CSTRING(push_etomidate_IV_3); + displayNameProgress = CSTRING(pushing_flumazenil_IV_3); + category = "surgery"; + items[] = {"kat_syringe_etomidate_5ml_3"}; + callbackSuccess = QFUNC(medication); + sounds[] = {}; + }; + class syringe_epinephrineIV_5ml_1: syringe_EACA_5ml_1 { + displayName = CSTRING(push_epinephrineIV_IV_1); + displayNameProgress = CSTRING(pushing_epinephrineIV_IV_1); + allowedSelections[] = {"Body", "LeftArm", "RightArm", "LeftLeg", "RightLeg"}; + allowSelfTreatment = 1; + medicRequired = QGVAR(medLvl_EpinephrineIV); + treatmentTime = QGVAR(treatmentTime_EpinephrineIV); + items[] = {"kat_syringe_epinephrineIV_5ml_1"}; + callbackSuccess = QFUNC(medication); + sounds[] = {}; + }; + class syringe_epinephrineIV_5ml_3: syringe_epinephrineIV_5ml_1 { + displayName = CSTRING(push_epinephrineIV_IV_3); + displayNameProgress = CSTRING(pushing_epinephrineIV_IV_3); + items[] = {"kat_syringe_epinephrineIV_5ml_3"}; + callbackSuccess = QFUNC(medication); + sounds[] = {}; + }; + class syringe_adenosineIV_5ml_1: syringe_EACA_5ml_1 { + displayName = CSTRING(push_adenosineIV_IV_1); + displayNameProgress = CSTRING(pushing_adenosineIV_IV_1); + allowedSelections[] = {"Body", "LeftArm", "RightArm", "LeftLeg", "RightLeg"}; + allowSelfTreatment = 1; + medicRequired = QGVAR(medLvl_adenosineIV); + treatmentTime = QGVAR(treatmentTime_adenosineIV); + items[] = {"kat_syringe_adenosineIV_5ml_1"}; + callbackSuccess = QFUNC(medication); + sounds[] = {}; + }; + class syringe_adenosineIV_5ml_3: syringe_adenosineIV_5ml_1 { + displayName = CSTRING(push_adenosineIV_IV_3); + displayNameProgress = CSTRING(pushing_adenosineIV_IV_3); + items[] = {"kat_syringe_adenosineIV_5ml_3"}; + callbackSuccess = QFUNC(medication); + sounds[] = {}; + }; + class syringe_atropineIV_5ml_1: syringe_EACA_5ml_1 { + displayName = CSTRING(push_atropineIV_IV_1); + displayNameProgress = CSTRING(pushing_atropineIV_IV_1); + allowedSelections[] = {"Body", "LeftArm", "RightArm", "LeftLeg", "RightLeg"}; + allowSelfTreatment = 1; + medicRequired = QGVAR(medLvl_AtropineIV); + treatmentTime = QGVAR(treatmentTime_AtropineIV); + items[] = {"kat_syringe_atropineIV_5ml_1"}; + callbackSuccess = QFUNC(medication); + sounds[] = {}; + }; + class syringe_atropineIV_5ml_3: syringe_atropineIV_5ml_1 { + displayName = CSTRING(push_atropineIV_IV_3); + displayNameProgress = CSTRING(pushing_atropineIV_IV_3); + items[] = {"kat_syringe_atropineIV_5ml_3"}; + callbackSuccess = QFUNC(medication); + sounds[] = {}; + }; + class syringe_lidocaine_10ml_1: syringe_TXA_10ml_1 { + displayName = CSTRING(inject_lidocaine_IM_1); + displayNameProgress = CSTRING(injecting_lidocaine_IM_1); + allowedSelections[] = {"LeftArm", "RightArm", "LeftLeg", "RightLeg"}; + allowSelfTreatment = 1; + medicRequired = QGVAR(medLvl_lidocaineIM); + treatmentTime = QGVAR(treatmentTime_lidocaineIM); + items[] = {"kat_syringe_lidocaine_10ml_1"}; + callbackSuccess = QFUNC(medication); + sounds[] = {}; + }; + class syringe_ketamine_10ml_1: syringe_TXA_10ml_1 { + displayName = CSTRING(inject_ketamine_IM_1); + displayNameProgress = CSTRING(injecting_ketamine_IM_1); + allowedSelections[] = {"LeftArm", "RightArm", "LeftLeg", "RightLeg"}; + allowSelfTreatment = 1; + medicRequired = QGVAR(medLvl_ketamineIM); + treatmentTime = QGVAR(treatmentTime_ketamineIM); + items[] = {"kat_syringe_ketamine_10ml_1"}; + callbackSuccess = QFUNC(medication); + sounds[] = {}; + }; + class syringe_ketamine_10ml_3: syringe_ketamine_10ml_1 { + displayName = CSTRING(inject_ketamine_IM_3); + displayNameProgress = CSTRING(injecting_ketamine_IM_3); + items[] = {"kat_syringe_ketamine_10ml_3"}; + callbackSuccess = QFUNC(medication); + sounds[] = {}; + }; + class syringe_fentanyl_10ml_1: syringe_TXA_10ml_1 { + displayName = CSTRING(inject_fentanyl_IM_1); + displayNameProgress = CSTRING(injecting_fentanyl_IM_1); + allowedSelections[] = {"LeftArm", "RightArm", "LeftLeg", "RightLeg"}; + allowSelfTreatment = 1; + medicRequired = QGVAR(medLvl_fentanylIM); + treatmentTime = QGVAR(treatmentTime_fentanylIM); + items[] = {"kat_syringe_fentanyl_10ml_1"}; + callbackSuccess = QFUNC(medication); + sounds[] = {}; + }; + class syringe_fentanyl_10ml_3: syringe_fentanyl_10ml_1 { + displayName = CSTRING(inject_fentanyl_IM_3); + displayNameProgress = CSTRING(injecting_fentanyl_IM_3); + items[] = {"kat_syringe_fentanyl_10ml_3"}; + callbackSuccess = QFUNC(medication); + sounds[] = {}; + }; + class syringe_nalbuphine_10ml_1: syringe_TXA_10ml_1 { + displayName = CSTRING(inject_nalbuphine_IM_1); + displayNameProgress = CSTRING(injecting_nalbuphine_IM_1); + allowedSelections[] = {"LeftArm", "RightArm", "LeftLeg", "RightLeg"}; + allowSelfTreatment = 1; + medicRequired = QGVAR(medLvl_nalbuphineIM); + treatmentTime = QGVAR(treatmentTime_nalbuphineIM); + items[] = {"kat_syringe_nalbuphine_10ml_1"}; + callbackSuccess = QFUNC(medication); + sounds[] = {}; + }; + class syringe_nalbuphine_10ml_3: syringe_nalbuphine_10ml_1 { + displayName = CSTRING(inject_nalbuphine_IM_3); + displayNameProgress = CSTRING(injecting_nalbuphine_IM_3); + items[] = {"kat_syringe_nalbuphine_10ml_3"}; + callbackSuccess = QFUNC(medication); + sounds[] = {}; + }; + class syringe_morphineIV_10ml_1: syringe_TXA_10ml_1 { + displayName = CSTRING(inject_morphineIV_IM_1); + displayNameProgress = CSTRING(injecting_morphineIV_IM_1); + allowedSelections[] = {"LeftArm", "RightArm", "LeftLeg", "RightLeg"}; + allowSelfTreatment = 1; + medicRequired = QGVAR(medLvl_morphineIM); + treatmentTime = QGVAR(treatmentTime_morphineIM); + items[] = {"kat_syringe_morphineIV_10ml_1"}; + callbackSuccess = QFUNC(medication); + sounds[] = {}; + }; + class syringe_morphineIV_10ml_3: syringe_morphineIV_10ml_1 { + displayName = CSTRING(inject_morphineIV_IM_3); + displayNameProgress = CSTRING(injecting_morphineIV_IM_3); + items[] = {"kat_syringe_morphineIV_10ml_3"}; + callbackSuccess = QFUNC(medication); + sounds[] = {}; + }; }; diff --git a/addons/pharma/CfgFunctions.hpp b/addons/pharma/CfgFunctions.hpp index ab92d6775..0e95d25ee 100644 --- a/addons/pharma/CfgFunctions.hpp +++ b/addons/pharma/CfgFunctions.hpp @@ -17,6 +17,12 @@ class CfgFunctions { class tourniquetRemove { file = QPATHTOF(functions\fnc_tourniquetRemove.sqf); }; + class overDose { + file = QPATHTOF(functions\fnc_overDose.sqf); + }; + class onMedicationUsage { + file = QPATHTOF(functions\fnc_onMedicationUsage.sqf); + }; }; }; }; diff --git a/addons/pharma/CfgWeapons.hpp b/addons/pharma/CfgWeapons.hpp index 82b7bd0bf..27f6c6074 100644 --- a/addons/pharma/CfgWeapons.hpp +++ b/addons/pharma/CfgWeapons.hpp @@ -13,6 +13,28 @@ class CfgWeapons { mass = 0.5; }; }; + class kat_IV_14: ACE_ItemCore { + scope = 2; + displayName = CSTRING(IV_14_Display); + picture = QPATHTOF(ui\icon_IV_16.paa); + model = QPATHTOF(models\iv\kat_iv.p3d); + descriptionShort = CSTRING(IV_DescShort); + ACE_isMedicalItem = 1; + class ItemInfo: CBA_MiscItem_ItemInfo { + mass = 0.5; + }; + }; + class kat_IV_20: ACE_ItemCore { + scope = 2; + displayName = CSTRING(IV_20_Display); + picture = QPATHTOF(ui\icon_IV_16.paa); + model = QPATHTOF(models\iv\kat_iv.p3d); + descriptionShort = CSTRING(IV_DescShort); + ACE_isMedicalItem = 1; + class ItemInfo: CBA_MiscItem_ItemInfo { + mass = 0.5; + }; + }; class kat_IO_FAST: ACE_ItemCore { scope = 2; displayName = CSTRING(IO_45_Display); @@ -24,6 +46,28 @@ class CfgWeapons { mass = 0.5; }; }; + class kat_10ml_syringe: ACE_ItemCore { + scope = 2; + displayName = CSTRING(Syringe_10_Display); + picture = QPATHTOF(ui\syringe_item.paa); + model = "\A3\Structures_F_EPA\Items\Medical\Painkillers_F.p3d"; + descriptionShort = CSTRING(Syringe_10_DescShort); + ACE_isMedicalItem = 1; + class ItemInfo: CBA_MiscItem_ItemInfo { + mass = 1; + }; + }; + class kat_5ml_syringe: ACE_ItemCore { + scope = 2; + displayName = CSTRING(Syringe_5_Display); + picture = QPATHTOF(ui\syringe_item.paa); + model = "\A3\Structures_F_EPA\Items\Medical\Painkillers_F.p3d"; + descriptionShort = CSTRING(Syringe_5_DescShort); + ACE_isMedicalItem = 1; + class ItemInfo: CBA_MiscItem_ItemInfo { + mass = 1; + }; + }; class kat_naloxone: ACE_ItemCore { scope = 2; displayName = CSTRING(Naloxone_Box_Display); @@ -135,6 +179,17 @@ class CfgWeapons { mass = 0.5; }; }; + class kat_atropineIV: ACE_ItemCore { + scope = 2; + displayName = CSTRING(AtropineIV_Display); + picture = QPATHTOF(ui\icon_AtropineIV.paa); + model = "\A3\Structures_F_EPA\Items\Medical\Painkillers_F.p3d"; + descriptionShort = CSTRING(AtropineIV_DescShort); + ACE_isMedicalItem = 1; + class ItemInfo: CBA_MiscItem_ItemInfo { + mass = 0.5; + }; + }; class kat_ketamine: ACE_ItemCore { scope = 2; displayName = CSTRING(Ketamine_Box_Display); @@ -176,7 +231,7 @@ class CfgWeapons { descriptionShort = CSTRING(Lorazepam_DescShort); ACE_isMedicalItem = 1; class ItemInfo: CBA_MiscItem_ItemInfo { - mass = 0.2; + mass = 0.5; }; }; class kat_flumazenil: ACE_ItemCore { @@ -187,7 +242,7 @@ class CfgWeapons { descriptionShort = CSTRING(Flumazenil_DescShort); ACE_isMedicalItem = 1; class ItemInfo: CBA_MiscItem_ItemInfo { - mass = 0.2; + mass = 0.5; }; }; class kat_etomidate: ACE_ItemCore { @@ -198,7 +253,7 @@ class CfgWeapons { descriptionShort = CSTRING(Etomidate_DescShort); ACE_isMedicalItem = 1; class ItemInfo: CBA_MiscItem_ItemInfo { - mass = 0.2; + mass = 0.5; }; }; class kat_epinephrineIV: ACE_ItemCore { @@ -209,7 +264,40 @@ class CfgWeapons { descriptionShort = CSTRING(EpinephrineIV_DescShort); ACE_isMedicalItem = 1; class ItemInfo: CBA_MiscItem_ItemInfo { - mass = 0.2; + mass = 0.5; + }; + }; + class kat_morphineIV: ACE_ItemCore { + scope = 2; + displayName = CSTRING(MorphineIV_displayName); + picture = QPATHTOF(ui\icon_MorphineIV.paa); + model = "\A3\Structures_F_EPA\Items\Medical\Painkillers_F.p3d"; + descriptionShort = CSTRING(MorphineIV_DescShort); + ACE_isMedicalItem = 1; + class ItemInfo: CBA_MiscItem_ItemInfo { + mass = 0.5; + }; + }; + class kat_adenosineIV: ACE_ItemCore { + scope = 2; + displayName = CSTRING(AdenosineIV_displayName); + picture = QPATHTOF(ui\icon_AdenosineIV.paa); + model = "\A3\Structures_F_EPA\Items\Medical\Painkillers_F.p3d"; + descriptionShort = CSTRING(AdenosineIV_DescShort); + ACE_isMedicalItem = 1; + class ItemInfo: CBA_MiscItem_ItemInfo { + mass = 0.5; + }; + }; + class kat_alteplase: ACE_ItemCore { + scope = 2; + displayName = CSTRING(Alteplase_Display); + picture = QPATHTOF(ui\icon_Alteplase.paa); + model = "\A3\Structures_F_EPA\Items\Medical\Painkillers_F.p3d"; + descriptionShort = CSTRING(Alteplase_DescShort); + ACE_isMedicalItem = 1; + class ItemInfo: CBA_MiscItem_ItemInfo { + mass = 0.5; }; }; class kat_coag_sense: ACE_ItemCore { @@ -223,4 +311,510 @@ class CfgWeapons { mass = 1; }; }; + class kat_syringe_txa_10ml_1: ACE_ItemCore { + scope = 1; + displayName = CSTRING(Syringe_txa_10_1_Display); + picture = QPATHTOF(ui\syringe_item.paa); + model = "\A3\Structures_F_EPA\Items\Medical\Painkillers_F.p3d"; + descriptionShort = CSTRING(Syringe_txa_10_1_DescShort); + ACE_isMedicalItem = 1; + class ItemInfo: CBA_MiscItem_ItemInfo { + mass = 1; + }; + }; + class kat_syringe_txa_10ml_3: ACE_ItemCore { + scope = 1; + displayName = CSTRING(Syringe_txa_10_3_Display); + picture = QPATHTOF(ui\syringe_item.paa); + model = "\A3\Structures_F_EPA\Items\Medical\Painkillers_F.p3d"; + descriptionShort = CSTRING(Syringe_txa_10_3_DescShort); + ACE_isMedicalItem = 1; + class ItemInfo: CBA_MiscItem_ItemInfo { + mass = 1; + }; + }; + class kat_syringe_morphineIV_10ml_1: ACE_ItemCore { + scope = 1; + displayName = CSTRING(Syringe_morphineIV_10_1_Display); + picture = QPATHTOF(ui\syringe_item.paa); + model = "\A3\Structures_F_EPA\Items\Medical\Painkillers_F.p3d"; + descriptionShort = CSTRING(Syringe_morphineIV_10_1_DescShort); + ACE_isMedicalItem = 1; + class ItemInfo: CBA_MiscItem_ItemInfo { + mass = 1; + }; + }; + class kat_syringe_morphineIV_10ml_3: ACE_ItemCore { + scope = 1; + displayName = CSTRING(Syringe_morphineIV_10_3_Display); + picture = QPATHTOF(ui\syringe_item.paa); + model = "\A3\Structures_F_EPA\Items\Medical\Painkillers_F.p3d"; + descriptionShort = CSTRING(Syringe_morphineIV_10_3_DescShort); + ACE_isMedicalItem = 1; + class ItemInfo: CBA_MiscItem_ItemInfo { + mass = 1; + }; + }; + class kat_syringe_lidocaine_10ml_1: ACE_ItemCore { + scope = 1; + displayName = CSTRING(Syringe_lidocaine_10_1_Display); + picture = QPATHTOF(ui\syringe_item.paa); + model = "\A3\Structures_F_EPA\Items\Medical\Painkillers_F.p3d"; + descriptionShort = CSTRING(Syringe_lidocaine_10_1_DescShort); + ACE_isMedicalItem = 1; + class ItemInfo: CBA_MiscItem_ItemInfo { + mass = 1; + }; + }; + class kat_syringe_ketamine_10ml_1: ACE_ItemCore { + scope = 1; + displayName = CSTRING(Syringe_ketamine_10_1_Display); + picture = QPATHTOF(ui\syringe_item.paa); + model = "\A3\Structures_F_EPA\Items\Medical\Painkillers_F.p3d"; + descriptionShort = CSTRING(Syringe_ketamine_10_1_DescShort); + ACE_isMedicalItem = 1; + class ItemInfo: CBA_MiscItem_ItemInfo { + mass = 1; + }; + }; + class kat_syringe_ketamine_10ml_3: ACE_ItemCore { + scope = 1; + displayName = CSTRING(Syringe_ketamine_10_3_Display); + picture = QPATHTOF(ui\syringe_item.paa); + model = "\A3\Structures_F_EPA\Items\Medical\Painkillers_F.p3d"; + descriptionShort = CSTRING(Syringe_ketamine_10_3_DescShort); + ACE_isMedicalItem = 1; + class ItemInfo: CBA_MiscItem_ItemInfo { + mass = 1; + }; + }; + class kat_syringe_fentanyl_10ml_1: ACE_ItemCore { + scope = 1; + displayName = CSTRING(Syringe_fentanyl_10_1_Display); + picture = QPATHTOF(ui\syringe_item.paa); + model = "\A3\Structures_F_EPA\Items\Medical\Painkillers_F.p3d"; + descriptionShort = CSTRING(Syringe_fentanyl_10_1_DescShort); + ACE_isMedicalItem = 1; + class ItemInfo: CBA_MiscItem_ItemInfo { + mass = 1; + }; + }; + class kat_syringe_fentanyl_10ml_3: ACE_ItemCore { + scope = 1; + displayName = CSTRING(Syringe_fentanyl_10_3_Display); + picture = QPATHTOF(ui\syringe_item.paa); + model = "\A3\Structures_F_EPA\Items\Medical\Painkillers_F.p3d"; + descriptionShort = CSTRING(Syringe_fentanyl_10_3_DescShort); + ACE_isMedicalItem = 1; + class ItemInfo: CBA_MiscItem_ItemInfo { + mass = 1; + }; + }; + class kat_syringe_nalbuphine_10ml_1: ACE_ItemCore { + scope = 1; + displayName = CSTRING(Syringe_nalbuphine_10_1_Display); + picture = QPATHTOF(ui\syringe_item.paa); + model = "\A3\Structures_F_EPA\Items\Medical\Painkillers_F.p3d"; + descriptionShort = CSTRING(Syringe_nalbuphine_10_1_DescShort); + ACE_isMedicalItem = 1; + class ItemInfo: CBA_MiscItem_ItemInfo { + mass = 1; + }; + }; + class kat_syringe_nalbuphine_10ml_3: ACE_ItemCore { + scope = 1; + displayName = CSTRING(Syringe_nalbuphine_10_3_Display); + picture = QPATHTOF(ui\syringe_item.paa); + model = "\A3\Structures_F_EPA\Items\Medical\Painkillers_F.p3d"; + descriptionShort = CSTRING(Syringe_nalbuphine_10_3_DescShort); + ACE_isMedicalItem = 1; + class ItemInfo: CBA_MiscItem_ItemInfo { + mass = 1; + }; + }; + class kat_syringe_txa_5ml_1: ACE_ItemCore { + scope = 1; + displayName = CSTRING(Syringe_txa_5_1_Display); + picture = QPATHTOF(ui\syringe_item.paa); + model = "\A3\Structures_F_EPA\Items\Medical\Painkillers_F.p3d"; + descriptionShort = CSTRING(Syringe_txa_5_1_DescShort); + ACE_isMedicalItem = 1; + class ItemInfo: CBA_MiscItem_ItemInfo { + mass = 1; + }; + }; + class kat_syringe_txa_5ml_3: ACE_ItemCore { + scope = 1; + displayName = CSTRING(Syringe_txa_5_3_Display); + picture = QPATHTOF(ui\syringe_item.paa); + model = "\A3\Structures_F_EPA\Items\Medical\Painkillers_F.p3d"; + descriptionShort = CSTRING(Syringe_txa_5_3_DescShort); + ACE_isMedicalItem = 1; + class ItemInfo: CBA_MiscItem_ItemInfo { + mass = 1; + }; + }; + class kat_syringe_eaca_5ml_1: ACE_ItemCore { + scope = 1; + displayName = CSTRING(Syringe_eaca_5_1_Display); + picture = QPATHTOF(ui\syringe_item.paa); + model = "\A3\Structures_F_EPA\Items\Medical\Painkillers_F.p3d"; + descriptionShort = CSTRING(Syringe_eaca_5_1_DescShort); + ACE_isMedicalItem = 1; + class ItemInfo: CBA_MiscItem_ItemInfo { + mass = 1; + }; + }; + class kat_syringe_eaca_5ml_3: ACE_ItemCore { + scope = 1; + displayName = CSTRING(Syringe_eaca_5_3_Display); + picture = QPATHTOF(ui\syringe_item.paa); + model = "\A3\Structures_F_EPA\Items\Medical\Painkillers_F.p3d"; + descriptionShort = CSTRING(Syringe_eaca_5_3_DescShort); + ACE_isMedicalItem = 1; + class ItemInfo: CBA_MiscItem_ItemInfo { + mass = 1; + }; + }; + class kat_syringe_norepinephrine_5ml_1: ACE_ItemCore { + scope = 1; + displayName = CSTRING(Syringe_norepinephrine_5_1_Display); + picture = QPATHTOF(ui\syringe_item.paa); + model = "\A3\Structures_F_EPA\Items\Medical\Painkillers_F.p3d"; + descriptionShort = CSTRING(Syringe_norepinephrine_5_1_DescShort); + ACE_isMedicalItem = 1; + class ItemInfo: CBA_MiscItem_ItemInfo { + mass = 1; + }; + }; + class kat_syringe_norepinephrine_5ml_3: ACE_ItemCore { + scope = 1; + displayName = CSTRING(Syringe_norepinephrine_5_3_Display); + picture = QPATHTOF(ui\syringe_item.paa); + model = "\A3\Structures_F_EPA\Items\Medical\Painkillers_F.p3d"; + descriptionShort = CSTRING(Syringe_norepinephrine_5_3_DescShort); + ACE_isMedicalItem = 1; + class ItemInfo: CBA_MiscItem_ItemInfo { + mass = 1; + }; + }; + class kat_syringe_phenylephrine_5ml_1: ACE_ItemCore { + scope = 1; + displayName = CSTRING(Syringe_phenylephrine_5_1_Display); + picture = QPATHTOF(ui\syringe_item.paa); + model = "\A3\Structures_F_EPA\Items\Medical\Painkillers_F.p3d"; + descriptionShort = CSTRING(Syringe_phenylephrine_5_1_DescShort); + ACE_isMedicalItem = 1; + class ItemInfo: CBA_MiscItem_ItemInfo { + mass = 1; + }; + }; + class kat_syringe_phenylephrine_5ml_3: ACE_ItemCore { + scope = 1; + displayName = CSTRING(Syringe_phenylephrine_5_3_Display); + picture = QPATHTOF(ui\syringe_item.paa); + model = "\A3\Structures_F_EPA\Items\Medical\Painkillers_F.p3d"; + descriptionShort = CSTRING(Syringe_phenylephrine_5_3_DescShort); + ACE_isMedicalItem = 1; + class ItemInfo: CBA_MiscItem_ItemInfo { + mass = 1; + }; + }; + class kat_syringe_nitroglycerin_5ml_1: ACE_ItemCore { + scope = 1; + displayName = CSTRING(Syringe_nitroglycerin_5_1_Display); + picture = QPATHTOF(ui\syringe_item.paa); + model = "\A3\Structures_F_EPA\Items\Medical\Painkillers_F.p3d"; + descriptionShort = CSTRING(Syringe_phenylephrine_5_1_DescShort); + ACE_isMedicalItem = 1; + class ItemInfo: CBA_MiscItem_ItemInfo { + mass = 1; + }; + }; + class kat_syringe_nitroglycerin_5ml_3: ACE_ItemCore { + scope = 1; + displayName = CSTRING(Syringe_nitroglycerin_5_3_Display); + picture = QPATHTOF(ui\syringe_item.paa); + model = "\A3\Structures_F_EPA\Items\Medical\Painkillers_F.p3d"; + descriptionShort = CSTRING(Syringe_nitroglycerin_5_3_DescShort); + ACE_isMedicalItem = 1; + class ItemInfo: CBA_MiscItem_ItemInfo { + mass = 1; + }; + }; + class kat_syringe_amiodarone_5ml_1: ACE_ItemCore { + scope = 1; + displayName = CSTRING(Syringe_amiodarone_5_1_Display); + picture = QPATHTOF(ui\syringe_item.paa); + model = "\A3\Structures_F_EPA\Items\Medical\Painkillers_F.p3d"; + descriptionShort = CSTRING(Syringe_amiodarone_5_1_DescShort); + ACE_isMedicalItem = 1; + class ItemInfo: CBA_MiscItem_ItemInfo { + mass = 1; + }; + }; + class kat_syringe_amiodarone_5ml_3: ACE_ItemCore { + scope = 1; + displayName = CSTRING(Syringe_amiodarone_5_3_Display); + picture = QPATHTOF(ui\syringe_item.paa); + model = "\A3\Structures_F_EPA\Items\Medical\Painkillers_F.p3d"; + descriptionShort = CSTRING(Syringe_amiodarone_5_3_DescShort); + ACE_isMedicalItem = 1; + class ItemInfo: CBA_MiscItem_ItemInfo { + mass = 1; + }; + }; + class kat_syringe_alteplase_5ml_3: ACE_ItemCore { + scope = 1; + displayName = CSTRING(Syringe_alteplase_5_3_Display); + picture = QPATHTOF(ui\syringe_item.paa); + model = "\A3\Structures_F_EPA\Items\Medical\Painkillers_F.p3d"; + descriptionShort = CSTRING(Syringe_alteplase_5_3_DescShort); + ACE_isMedicalItem = 1; + class ItemInfo: CBA_MiscItem_ItemInfo { + mass = 1; + }; + }; + class kat_syringe_epinephrineIV_5ml_1: ACE_ItemCore { + scope = 1; + displayName = CSTRING(Syringe_epinephrineIV_5_1_Display); + picture = QPATHTOF(ui\syringe_item.paa); + model = "\A3\Structures_F_EPA\Items\Medical\Painkillers_F.p3d"; + descriptionShort = CSTRING(Syringe_epinephrineIV_5_1_DescShort); + ACE_isMedicalItem = 1; + class ItemInfo: CBA_MiscItem_ItemInfo { + mass = 1; + }; + }; + class kat_syringe_epinephrineIV_5ml_3: ACE_ItemCore { + scope = 1; + displayName = CSTRING(Syringe_epinephrineIV_5_3_Display); + picture = QPATHTOF(ui\syringe_item.paa); + model = "\A3\Structures_F_EPA\Items\Medical\Painkillers_F.p3d"; + descriptionShort = CSTRING(Syringe_epinephrineIV_5_3_DescShort); + ACE_isMedicalItem = 1; + class ItemInfo: CBA_MiscItem_ItemInfo { + mass = 1; + }; + }; + class kat_syringe_lidocaine_5ml_1: ACE_ItemCore { + scope = 1; + displayName = CSTRING(Syringe_lidocaine_5_1_Display); + picture = QPATHTOF(ui\syringe_item.paa); + model = "\A3\Structures_F_EPA\Items\Medical\Painkillers_F.p3d"; + descriptionShort = CSTRING(Syringe_lidocaine_5_1_DescShort); + ACE_isMedicalItem = 1; + class ItemInfo: CBA_MiscItem_ItemInfo { + mass = 1; + }; + }; + class kat_syringe_lidocaine_5ml_3: ACE_ItemCore { + scope = 1; + displayName = CSTRING(Syringe_lidocaine_5_3_Display); + picture = QPATHTOF(ui\syringe_item.paa); + model = "\A3\Structures_F_EPA\Items\Medical\Painkillers_F.p3d"; + descriptionShort = CSTRING(Syringe_lidocaine_5_3_DescShort); + ACE_isMedicalItem = 1; + class ItemInfo: CBA_MiscItem_ItemInfo { + mass = 1; + }; + }; + class kat_syringe_ketamine_5ml_1: ACE_ItemCore { + scope = 1; + displayName = CSTRING(Syringe_ketamine_5_1_Display); + picture = QPATHTOF(ui\syringe_item.paa); + model = "\A3\Structures_F_EPA\Items\Medical\Painkillers_F.p3d"; + descriptionShort = CSTRING(Syringe_ketamine_5_1_DescShort); + ACE_isMedicalItem = 1; + class ItemInfo: CBA_MiscItem_ItemInfo { + mass = 1; + }; + }; + class kat_syringe_ketamine_5ml_3: ACE_ItemCore { + scope = 1; + displayName = CSTRING(Syringe_ketamine_5_3_Display); + picture = QPATHTOF(ui\syringe_item.paa); + model = "\A3\Structures_F_EPA\Items\Medical\Painkillers_F.p3d"; + descriptionShort = CSTRING(Syringe_ketamine_5_3_DescShort); + ACE_isMedicalItem = 1; + class ItemInfo: CBA_MiscItem_ItemInfo { + mass = 1; + }; + }; + class kat_syringe_fentanyl_5ml_1: ACE_ItemCore { + scope = 1; + displayName = CSTRING(Syringe_fentanyl_5_1_Display); + picture = QPATHTOF(ui\syringe_item.paa); + model = "\A3\Structures_F_EPA\Items\Medical\Painkillers_F.p3d"; + descriptionShort = CSTRING(Syringe_fentanyl_5_1_DescShort); + ACE_isMedicalItem = 1; + class ItemInfo: CBA_MiscItem_ItemInfo { + mass = 1; + }; + }; + class kat_syringe_fentanyl_5ml_3: ACE_ItemCore { + scope = 1; + displayName = CSTRING(Syringe_fentanyl_10_3_Display); + picture = QPATHTOF(ui\syringe_item.paa); + model = "\A3\Structures_F_EPA\Items\Medical\Painkillers_F.p3d"; + descriptionShort = CSTRING(Syringe_fentanyl_10_3_DescShort); + ACE_isMedicalItem = 1; + class ItemInfo: CBA_MiscItem_ItemInfo { + mass = 1; + }; + }; + class kat_syringe_nalbuphine_5ml_1: ACE_ItemCore { + scope = 1; + displayName = CSTRING(Syringe_nalbuphine_5_1_Display); + picture = QPATHTOF(ui\syringe_item.paa); + model = "\A3\Structures_F_EPA\Items\Medical\Painkillers_F.p3d"; + descriptionShort = CSTRING(Syringe_nalbuphine_5_1_DescShort); + ACE_isMedicalItem = 1; + class ItemInfo: CBA_MiscItem_ItemInfo { + mass = 1; + }; + }; + class kat_syringe_nalbuphine_5ml_3: ACE_ItemCore { + scope = 1; + displayName = CSTRING(Syringe_nalbuphine_5_3_Display); + picture = QPATHTOF(ui\syringe_item.paa); + model = "\A3\Structures_F_EPA\Items\Medical\Painkillers_F.p3d"; + descriptionShort = CSTRING(Syringe_nalbuphine_5_3_DescShort); + ACE_isMedicalItem = 1; + class ItemInfo: CBA_MiscItem_ItemInfo { + mass = 1; + }; + }; + class kat_syringe_lorazepam_5ml_1: ACE_ItemCore { + scope = 1; + displayName = CSTRING(Syringe_lorazepam_5_1_Display); + picture = QPATHTOF(ui\syringe_item.paa); + model = "\A3\Structures_F_EPA\Items\Medical\Painkillers_F.p3d"; + descriptionShort = CSTRING(Syringe_lorazepam_5_1_DescShort); + ACE_isMedicalItem = 1; + class ItemInfo: CBA_MiscItem_ItemInfo { + mass = 1; + }; + }; + class kat_syringe_lorazepam_5ml_3: ACE_ItemCore { + scope = 1; + displayName = CSTRING(Syringe_lorazepam_5_3_Display); + picture = QPATHTOF(ui\syringe_item.paa); + model = "\A3\Structures_F_EPA\Items\Medical\Painkillers_F.p3d"; + descriptionShort = CSTRING(Syringe_lorazepam_5_3_DescShort); + ACE_isMedicalItem = 1; + class ItemInfo: CBA_MiscItem_ItemInfo { + mass = 1; + }; + }; + class kat_syringe_flumazenil_5ml_1: ACE_ItemCore { + scope = 1; + displayName = CSTRING(Syringe_flumazenil_5_1_Display); + picture = QPATHTOF(ui\syringe_item.paa); + model = "\A3\Structures_F_EPA\Items\Medical\Painkillers_F.p3d"; + descriptionShort = CSTRING(Syringe_flumazenil_5_1_DescShort); + ACE_isMedicalItem = 1; + class ItemInfo: CBA_MiscItem_ItemInfo { + mass = 1; + }; + }; + class kat_syringe_flumazenil_5ml_3: ACE_ItemCore { + scope = 1; + displayName = CSTRING(Syringe_flumazenil_5_3_Display); + picture = QPATHTOF(ui\syringe_item.paa); + model = "\A3\Structures_F_EPA\Items\Medical\Painkillers_F.p3d"; + descriptionShort = CSTRING(Syringe_flumazenil_5_3_DescShort); + ACE_isMedicalItem = 1; + class ItemInfo: CBA_MiscItem_ItemInfo { + mass = 1; + }; + }; + class kat_syringe_etomidate_5ml_1: ACE_ItemCore { + scope = 1; + displayName = CSTRING(Syringe_etomidate_5_1_Display); + picture = QPATHTOF(ui\syringe_item.paa); + model = "\A3\Structures_F_EPA\Items\Medical\Painkillers_F.p3d"; + descriptionShort = CSTRING(Syringe_etomidate_5_1_DescShort); + ACE_isMedicalItem = 1; + class ItemInfo: CBA_MiscItem_ItemInfo { + mass = 1; + }; + }; + class kat_syringe_etomidate_5ml_3: ACE_ItemCore { + scope = 1; + displayName = CSTRING(Syringe_etomidate_5_3_Display); + picture = QPATHTOF(ui\syringe_item.paa); + model = "\A3\Structures_F_EPA\Items\Medical\Painkillers_F.p3d"; + descriptionShort = CSTRING(Syringe_etomidate_5_3_DescShort); + ACE_isMedicalItem = 1; + class ItemInfo: CBA_MiscItem_ItemInfo { + mass = 1; + }; + }; + class kat_syringe_morphineIV_5ml_1: ACE_ItemCore { + scope = 1; + displayName = CSTRING(Syringe_morphineIV_5_1_Display); + picture = QPATHTOF(ui\syringe_item.paa); + model = "\A3\Structures_F_EPA\Items\Medical\Painkillers_F.p3d"; + descriptionShort = CSTRING(Syringe_morphineIV_5_1_DescShort); + ACE_isMedicalItem = 1; + class ItemInfo: CBA_MiscItem_ItemInfo { + mass = 1; + }; + }; + class kat_syringe_morphineIV_5ml_3: ACE_ItemCore { + scope = 1; + displayName = CSTRING(Syringe_morphineIV_5_3_Display); + picture = QPATHTOF(ui\syringe_item.paa); + model = "\A3\Structures_F_EPA\Items\Medical\Painkillers_F.p3d"; + descriptionShort = CSTRING(Syringe_morphineIV_5_3_DescShort); + ACE_isMedicalItem = 1; + class ItemInfo: CBA_MiscItem_ItemInfo { + mass = 1; + }; + }; + class kat_syringe_atropineIV_5ml_1: ACE_ItemCore { + scope = 1; + displayName = CSTRING(Syringe_atropineIV_5_1_Display); + picture = QPATHTOF(ui\syringe_item.paa); + model = "\A3\Structures_F_EPA\Items\Medical\Painkillers_F.p3d"; + descriptionShort = CSTRING(Syringe_atropineIV_5_1_DescShort); + ACE_isMedicalItem = 1; + class ItemInfo: CBA_MiscItem_ItemInfo { + mass = 1; + }; + }; + class kat_syringe_atropineIV_5ml_3: ACE_ItemCore { + scope = 1; + displayName = CSTRING(Syringe_atropineIV_5_3_Display); + picture = QPATHTOF(ui\syringe_item.paa); + model = "\A3\Structures_F_EPA\Items\Medical\Painkillers_F.p3d"; + descriptionShort = CSTRING(Syringe_atropineIV_5_3_DescShort); + ACE_isMedicalItem = 1; + class ItemInfo: CBA_MiscItem_ItemInfo { + mass = 1; + }; + }; + class kat_syringe_adenosineIV_5ml_1: ACE_ItemCore { + scope = 1; + displayName = CSTRING(Syringe_adenosineIV_5_1_Display); + picture = QPATHTOF(ui\syringe_item.paa); + model = "\A3\Structures_F_EPA\Items\Medical\Painkillers_F.p3d"; + descriptionShort = CSTRING(Syringe_adenosineIV_5_1_DescShort); + ACE_isMedicalItem = 1; + class ItemInfo: CBA_MiscItem_ItemInfo { + mass = 1; + }; + }; + class kat_syringe_adenosineIV_5ml_3: ACE_ItemCore { + scope = 1; + displayName = CSTRING(Syringe_adenosineIV_5_3_Display); + picture = QPATHTOF(ui\syringe_item.paa); + model = "\A3\Structures_F_EPA\Items\Medical\Painkillers_F.p3d"; + descriptionShort = CSTRING(Syringe_adenosineIV_5_3_DescShort); + ACE_isMedicalItem = 1; + class ItemInfo: CBA_MiscItem_ItemInfo { + mass = 1; + }; + }; }; diff --git a/addons/pharma/XEH_PREP.hpp b/addons/pharma/XEH_PREP.hpp index 5072c12df..6f0188df4 100644 --- a/addons/pharma/XEH_PREP.hpp +++ b/addons/pharma/XEH_PREP.hpp @@ -18,30 +18,63 @@ PREP(removeIV); PREP(retrieveIV); PREP(salineCheck); PREP(tourniquetRemove); +PREP(treatmentAdvanced_AdenosineLocal); +PREP(treatmentAdvanced_AdenosineOverdoseLocal); +PREP(treatmentAdvanced_AlteplaseLocal); +PREP(treatmentAdvanced_AlteplaseOverdoseLocal); PREP(treatmentAdvanced_AmiodaroneLocal); +PREP(treatmentAdvanced_AmiodaroneOverdoseLocal); PREP(treatmentAdvanced_AtropineLocal); +PREP(treatmentAdvanced_AtropineOverdoseLocal); PREP(treatmentAdvanced_Caffeine); PREP(treatmentAdvanced_CaffeineLocal); +PREP(treatmentAdvanced_CaffeineOverdoseLocal); PREP(treatmentAdvanced_Carbonate); -PREP(treatmentAdvanced_CWMP); PREP(treatmentAdvanced_CarbonateLocal); +PREP(treatmentAdvanced_CarbonateOverdoseLocal); PREP(treatmentAdvanced_CheckCoag); +PREP(treatmentAdvanced_CWMP); +PREP(treatmentAdvanced_CWMPOverdoseLocal); PREP(treatmentAdvanced_Dialysis); PREP(treatmentAdvanced_DialysisLocal); PREP(treatmentAdvanced_EACALocal); +PREP(treatmentAdvanced_EACAOverdoseLocal); +PREP(treatmentAdvanced_EpinephrineOverdoseLocal); +PREP(treatmentAdvanced_EtomidateOverdoseLocal); PREP(treatmentAdvanced_FentanylLocal); +PREP(treatmentAdvanced_FentanylOverdoseLocal); PREP(treatmentAdvanced_FlumazenilLocal); +PREP(treatmentAdvanced_FlumazenilOverdoseLocal); PREP(treatmentAdvanced_Flush); PREP(treatmentAdvanced_FlushLocal); +PREP(treatmentAdvanced_KetamineLocal); +PREP(treatmentAdvanced_KetamineOverdoseLocal); +PREP(treatmentAdvanced_LidocaineOverdoseLocal); PREP(treatmentAdvanced_LorazepamLocal); +PREP(treatmentAdvanced_LorazepamOverdoseLocal); PREP(treatmentAdvanced_MorphineLocal); +PREP(treatmentAdvanced_MorphineOverdoseLocal); PREP(treatmentAdvanced_NalbuphineLocal); +PREP(treatmentAdvanced_NalbuphineOverdoseLocal); PREP(treatmentAdvanced_Naloxone); PREP(treatmentAdvanced_NaloxoneLocal); +PREP(treatmentAdvanced_NaloxoneOverdoseLocal); +PREP(treatmentAdvanced_NitroglycerinOverdoseLocal); +PREP(treatmentAdvanced_NorepinephrineLocal); +PREP(treatmentAdvanced_NorepinephrineOverdoseLocal); PREP(treatmentAdvanced_Penthrox); +PREP(treatmentAdvanced_PenthroxOverdoseLocal); PREP(treatmentAdvanced_Pervitin); PREP(treatmentAdvanced_PervitinLocal); +PREP(treatmentAdvanced_PervitinOverdoseLocal); +PREP(treatmentAdvanced_PhenylephrineOverdoseLocal); PREP(treatmentAdvanced_Reorientation); PREP(treatmentAdvanced_ReorientationLocal); PREP(treatmentAdvanced_TXALocal); +PREP(treatmentAdvanced_TXAOverdoseLocal); PREP(vehicleCheckDialysis); +PREP(prepareSyringe); +PREP(checkIVType); +PREP(ivCondition); +PREP(AMSCheck); +PREP(overDose); \ No newline at end of file diff --git a/addons/pharma/XEH_postInit.sqf b/addons/pharma/XEH_postInit.sqf index 4ff370185..d657ca7c6 100644 --- a/addons/pharma/XEH_postInit.sqf +++ b/addons/pharma/XEH_postInit.sqf @@ -18,6 +18,7 @@ [QGVAR(ketamineLocal), LINKFUNC(treatmentAdvanced_KetamineLocal)] call CBA_fnc_addEventHandler; [QGVAR(fentanylLocal), LINKFUNC(treatmentAdvanced_FentanylLocal)] call CBA_fnc_addEventHandler; [QGVAR(caffeineLocal), LINKFUNC(treatmentAdvanced_CaffeineLocal)] call CBA_fnc_addEventHandler; +[QGVAR(lidocaineLocal), LINKFUNC(treatmentAdvanced_LidocaineLocal)] call CBA_fnc_addEventHandler; ["kat_fluid", LINKFUNC(fluid)] call CBA_fnc_addEventHandler; diff --git a/addons/pharma/XEH_preInit.sqf b/addons/pharma/XEH_preInit.sqf index f8ca35430..fc6152735 100644 --- a/addons/pharma/XEH_preInit.sqf +++ b/addons/pharma/XEH_preInit.sqf @@ -72,6 +72,33 @@ PREP_RECOMPILE_END; true ] call CBA_Settings_fnc_init; +[ + QGVAR(AMS_Enabled), + "CHECKBOX", + [LLSTRING(advancedMedicationSystem), LLSTRING(advancedMedicationSystem_Desc)], + [CBA_SETTINGS_CAT, ELSTRING(GUI,SubCategory_Basic)], + [false], + true +] call CBA_Settings_fnc_init; + +[ + QGVAR(medLvl_PrepSyringe), + "LIST", + [LLSTRING(medLvl_PrepSyringe), LLSTRING(medLvl_PrepSyringe_Desc)], + [CBA_SETTINGS_CAT, ELSTRING(GUI,SubCategory_Basic)], + [[0, 1, 2], [ACELSTRING(medical_treatment,Anyone), ACELSTRING(medical_treatment,Medics), ACELSTRING(medical_treatment,Doctors)], 0], + true +] call CBA_Settings_fnc_init; + +[ + QGVAR(prepTime_PrepSyringe), + "SLIDER", + [LLSTRING(prepTime_PrepSyringe), LLSTRING(prepTime_PrepSyringe_Desc)], + [CBA_SETTINGS_CAT, ELSTRING(GUI,SubCategory_Basic)], + [1, 15, 6, 0], + true +] call CBA_Settings_fnc_init; + //IV Settings Category [ QGVAR(medLvl_ApplyIV), @@ -82,6 +109,24 @@ PREP_RECOMPILE_END; true ] call CBA_Settings_fnc_init; +[ + QGVAR(medLvl_Apply14IV), + "LIST", + [LLSTRING(medLvl_Apply14IV), LLSTRING(medLvl_Apply14IV_Desc)], + [CBA_SETTINGS_CAT, LSTRING(SubCategory_ApplyIV)], + [[0, 1, 2], [ACELSTRING(medical_treatment,Anyone), ACELSTRING(medical_treatment,Medics), ACELSTRING(medical_treatment,Doctors)], 0], + true +] call CBA_Settings_fnc_init; + +[ + QGVAR(medLvl_Apply20IV), + "LIST", + [LLSTRING(medLvl_Apply20IV), LLSTRING(medLvl_Apply20IV_Desc)], + [CBA_SETTINGS_CAT, LSTRING(SubCategory_ApplyIV)], + [[0, 1, 2], [ACELSTRING(medical_treatment,Anyone), ACELSTRING(medical_treatment,Medics), ACELSTRING(medical_treatment,Doctors)], 0], + true +] call CBA_Settings_fnc_init; + [ QGVAR(treatmentTime_ApplyIV), "SLIDER", @@ -346,6 +391,24 @@ PREP_RECOMPILE_END; true ] call CBA_Settings_fnc_init; +[ + QGVAR(medLvl_TXAIM), + "LIST", + [LLSTRING(medLvl_TXAIM)], + [CBA_SETTINGS_CAT, LSTRING(SubCategory_TXA)], + [[0, 1, 2], [ACELSTRING(medical_treatment,Anyone), ACELSTRING(medical_treatment,Medics), ACELSTRING(medical_treatment,Doctors)], 0], + true +] call CBA_Settings_fnc_init; + +[ + QGVAR(treatmentTime_TXAIM), + "SLIDER", + [LLSTRING(treatmentTime_TXAIM)], + [CBA_SETTINGS_CAT, LSTRING(SubCategory_TXA)], + [0.1, 10, 7, 1], + true +] call CBA_Settings_fnc_init; + [ QGVAR(bandageCycleTime_TXA), "TIME", @@ -469,6 +532,24 @@ PREP_RECOMPILE_END; true ] call CBA_Settings_fnc_init; +[ + QGVAR(medLvl_LidocaineIM), + "LIST", + [LLSTRING(medLvl_LidocaineIM)], + [CBA_SETTINGS_CAT, LSTRING(SubCategory_Lidocaine)], + [[0, 1, 2], [ACELSTRING(medical_treatment,Anyone), ACELSTRING(medical_treatment,Medics), ACELSTRING(medical_treatment,Doctors)], 0], + true +] call CBA_Settings_fnc_init; + +[ + QGVAR(treatmentTime_LidocaineIM), + "SLIDER", + [LLSTRING(treatmentTime_LidocaineIM)], + [CBA_SETTINGS_CAT, LSTRING(SubCategory_Lidocaine)], + [0.1, 10, 7, 1], + true +] call CBA_Settings_fnc_init; + // Atropine Settings Category [ QGVAR(medLvl_Atropine), @@ -488,6 +569,23 @@ PREP_RECOMPILE_END; true ] call CBA_Settings_fnc_init; +[ + QGVAR(medLvl_AtropineIV), + "LIST", + [LLSTRING(medLvl_AtropineIV)], + [CBA_SETTINGS_CAT, LSTRING(SubCategory_Atropine)], + [[0, 1, 2], [ACELSTRING(medical_treatment,Anyone), ACELSTRING(medical_treatment,Medics), ACELSTRING(medical_treatment,Doctors)], 0], + true +] call CBA_Settings_fnc_init; + +[ + QGVAR(treatmentTime_AtropineIV), + "SLIDER", + [LLSTRING(treatmentTime_AtropineIV)], + [CBA_SETTINGS_CAT, LSTRING(SubCategory_Atropine)], + [0.1, 10, 7, 1], + true +] call CBA_Settings_fnc_init; // EACA Settings Category [ @@ -563,6 +661,24 @@ PREP_RECOMPILE_END; true ] call CBA_Settings_fnc_init; +[ + QGVAR(medLvl_KetamineIM), + "LIST", + [LLSTRING(medLvl_KetamineIM)], + [CBA_SETTINGS_CAT, LSTRING(SubCategory_Ketamine)], + [[0, 1, 2], [ACELSTRING(medical_treatment,Anyone), ACELSTRING(medical_treatment,Medics), ACELSTRING(medical_treatment,Doctors)], 0], + true +] call CBA_Settings_fnc_init; + +[ + QGVAR(treatmentTime_KetamineIM), + "SLIDER", + [LLSTRING(treatmentTime_KetamineIM)], + [CBA_SETTINGS_CAT, LSTRING(SubCategory_Ketamine)], + [0.1, 10, 7, 1], + true +] call CBA_Settings_fnc_init; + //Fentanyl Settings Category [ QGVAR(medLvl_Fentanyl), @@ -582,6 +698,24 @@ PREP_RECOMPILE_END; true ] call CBA_Settings_fnc_init; +[ + QGVAR(medLvl_FentanylIM), + "LIST", + [LLSTRING(medLvl_FentanylIM)], + [CBA_SETTINGS_CAT, LSTRING(SubCategory_Fentanyl)], + [[0, 1, 2], [ACELSTRING(medical_treatment,Anyone), ACELSTRING(medical_treatment,Medics), ACELSTRING(medical_treatment,Doctors)], 0], + true +] call CBA_Settings_fnc_init; + +[ + QGVAR(treatmentTime_FentanylIM), + "SLIDER", + [LLSTRING(treatmentTime_FentanylIM)], + [CBA_SETTINGS_CAT, LSTRING(SubCategory_Fentanyl)], + [0.1, 10, 7, 1], + true +] call CBA_Settings_fnc_init; + //Nalbuphine Settings Category [ QGVAR(medLvl_Nalbuphine), @@ -601,6 +735,24 @@ PREP_RECOMPILE_END; true ] call CBA_Settings_fnc_init; +[ + QGVAR(medLvl_NalbuphineIM), + "LIST", + [LLSTRING(medLvl_NalbuphineIM)], + [CBA_SETTINGS_CAT, LSTRING(SubCategory_Nalbuphine)], + [[0, 1, 2], [ACELSTRING(medical_treatment,Anyone), ACELSTRING(medical_treatment,Medics), ACELSTRING(medical_treatment,Doctors)], 0], + true +] call CBA_Settings_fnc_init; + +[ + QGVAR(treatmentTime_NalbuphineIM), + "SLIDER", + [LLSTRING(treatmentTime_NalbuphineIM)], + [CBA_SETTINGS_CAT, LSTRING(SubCategory_Nalbuphine)], + [0.1, 10, 7, 1], + true +] call CBA_Settings_fnc_init; + // Penthrox Settings Category [ QGVAR(medLvl_Penthrox), @@ -853,4 +1005,76 @@ PREP_RECOMPILE_END; true ] call CBA_Settings_fnc_init; +[ + QGVAR(medLvl_morphineIM), + "LIST", + [LLSTRING(medLvl_MorphineIM)], + [CBA_SETTINGS_CAT, LSTRING(SubCategory_Morphine)], + [[0, 1, 2], [ACELSTRING(medical_treatment,Anyone), ACELSTRING(medical_treatment,Medics), ACELSTRING(medical_treatment,Doctors)], 0], + true +] call CBA_Settings_fnc_init; + +[ + QGVAR(treatmentTime_morphineIM), + "SLIDER", + [LLSTRING(treatmentTime_MorphineIM)], + [CBA_SETTINGS_CAT, LSTRING(SubCategory_Morphine)], + [0.1, 10, 7, 1], + true +] call CBA_Settings_fnc_init; + +[ + QGVAR(medLvl_morphineIV), + "LIST", + [LLSTRING(medLvl_MorphineIV)], + [CBA_SETTINGS_CAT, LSTRING(SubCategory_Morphine)], + [[0, 1, 2], [ACELSTRING(medical_treatment,Anyone), ACELSTRING(medical_treatment,Medics), ACELSTRING(medical_treatment,Doctors)], 0], + true +] call CBA_Settings_fnc_init; + +[ + QGVAR(treatmentTime_morphineIV), + "SLIDER", + [LLSTRING(treatmentTime_MorphineIV)], + [CBA_SETTINGS_CAT, LSTRING(SubCategory_Morphine)], + [0.1, 10, 7, 1], + true +] call CBA_Settings_fnc_init; + +[ + QGVAR(medLvl_adenosineIV), + "LIST", + [LLSTRING(medLvl_adenosineIV)], + [CBA_SETTINGS_CAT, LSTRING(SubCategory_AdenosineIV)], + [[0, 1, 2], [ACELSTRING(medical_treatment,Anyone), ACELSTRING(medical_treatment,Medics), ACELSTRING(medical_treatment,Doctors)], 0], + true +] call CBA_Settings_fnc_init; + +[ + QGVAR(treatmentTime_adenosineIV), + "SLIDER", + [LLSTRING(treatmentTime_adenosineIV)], + [CBA_SETTINGS_CAT, LSTRING(SubCategory_AdenosineIV)], + [0.1, 10, 7, 1], + true +] call CBA_Settings_fnc_init; + +[ + QGVAR(medLvl_Alteplase), + "LIST", + [LLSTRING(medLvl_Alteplase)], + [CBA_SETTINGS_CAT, LSTRING(SubCategory_Alteplase)], + [[0, 1, 2], [ACELSTRING(medical_treatment,Anyone), ACELSTRING(medical_treatment,Medics), ACELSTRING(medical_treatment,Doctors)], 0], + true +] call CBA_Settings_fnc_init; + +[ + QGVAR(treatmentTime_Alteplase), + "SLIDER", + [LLSTRING(treatmentTime_Alteplase)], + [CBA_SETTINGS_CAT, LSTRING(SubCategory_Alteplase)], + [0.1, 10, 7, 1], + true +] call CBA_Settings_fnc_init; + ADDON = true; diff --git a/addons/pharma/config.cpp b/addons/pharma/config.cpp index 2e35ef27e..b2ad970aa 100644 --- a/addons/pharma/config.cpp +++ b/addons/pharma/config.cpp @@ -12,16 +12,20 @@ class CfgPatches { "kat_Painkiller", "kat_PainkillerItem", "kat_IV_16", + "kat_IV_14", + "kat_IV_20", + "kat_10ml_syringe", + "kat_5ml_syringe", "kat_IO_FAST", "kat_Carbonate", "kat_CarbonateItem", "kat_naloxone", + "kat_phenylephrineAuto", + "kat_X_AED", "kat_EACA", "kat_TXA", - "kat_X_AED", "kat_norepinephrine", "kat_phenylephrine", - "kat_phenylephrineAuto", "kat_nitroglycerin", "kat_amiodarone", "kat_lidocane", @@ -32,7 +36,46 @@ class CfgPatches { "kat_flumazenil", "kat_lorazepam", "kat_etomidate", - "kat_epinephrineIV" + "kat_epinephrineIV", + "kat_syringe_txa_10ml_1", + "kat_syringe_txa_5ml_1", + "kat_syringe_txa_10ml_2", + "kat_syringe_txa_5ml_2", + "kat_syringe_eaca_5ml_1", + "kat_syringe_eaca_5ml_2", + "kat_syringe_lidocaine_10ml_1", + "kat_syringe_ketamine_10ml_1", + "kat_syringe_ketamine_10ml_2", + "kat_syringe_fentanyl_10ml_1", + "kat_syringe_fentanyl_10ml_2", + "kat_syringe_nalbuphine_10ml_1", + "kat_syringe_nalbuphine_10ml_2", + "kat_syringe_norepinephrine_5ml_1", + "kat_syringe_norepinephrine_5ml_2", + "kat_syringe_phenylephrine_5ml_1", + "kat_syringe_phenylephrine_5ml_2", + "kat_syringe_nitroglycerin_5ml_1", + "kat_syringe_nitroglycerin_5ml_2", + "kat_syringe_amiodarone_5ml_1", + "kat_syringe_amiodarone_5ml_2", + "kat_syringe_epinephrineIV_5ml_1", + "kat_syringe_epinephrineIV_5ml_2", + "kat_syringe_lidocaine_5ml_1", + "kat_syringe_lidocaine_5ml_2", + "kat_syringe_ketamine_5ml_1", + "kat_syringe_ketamine_5ml_2", + "kat_syringe_fentanyl_5ml_1", + "kat_syringe_fentanyl_5ml_2", + "kat_syringe_nalbuphine_5ml_1", + "kat_syringe_nalbuphine_5ml_2", + "kat_syringe_lorazepam_5ml_1", + "kat_syringe_lorazepam_5ml_2", + "kat_syringe_flumazenil_5ml_1", + "kat_syringe_flumazenil_5ml_2", + "kat_syringe_etomidate_5ml_1", + "kat_syringe_etomidate_5ml_2", + "kat_syringe_epinephrineIV_5ml_1", + "kat_syringe_epinephrineIV_5ml_2", }; magazines[] = { }; requiredAddons[] = { diff --git a/addons/pharma/functions/fnc_AMSCheck.sqf b/addons/pharma/functions/fnc_AMSCheck.sqf new file mode 100644 index 000000000..9ce97b8b4 --- /dev/null +++ b/addons/pharma/functions/fnc_AMSCheck.sqf @@ -0,0 +1,18 @@ +#include "..\script_component.hpp" +/* + * Author: Cplhardcore + * Checks for if AMS is enabled and an IV sutible for medications is placed/if an IV is required + * + * Arguments: + * 0: None + * + * Example: + * [] call kat_pharma_fnc_AMScheck; + * + * Public: No + */ +private _medicationsRequireInsIV = GVAR(MedicationsRequireInsIV); +private _amsEnabled = GVAR(AMS_Enabled); +private _removeIV = FUNC(removeIV); + +[false, true] select ((! _medicationsRequireInsIV || _removeIV) && ! _amsEnabled); \ No newline at end of file diff --git a/addons/pharma/functions/fnc_applyIV.sqf b/addons/pharma/functions/fnc_applyIV.sqf index e491ed6bc..5cbf11e65 100644 --- a/addons/pharma/functions/fnc_applyIV.sqf +++ b/addons/pharma/functions/fnc_applyIV.sqf @@ -27,6 +27,7 @@ private _IVarray = _patient getVariable [QGVAR(IV), [0,0,0,0,0,0]]; private _IVactual = _IVarray select _partIndex; private _IVpfh = _patient getVariable [QGVAR(IVpfh), [0,0,0,0,0,0]]; private _IVpfhActual = _IVpfh select _partIndex; +private _IVrate = _patient getVariable [QGVAR(IVrate), [0,0,0,0,0,0]]; if (_IVpfhActual > 0) then { [_IVpfhActual] call CBA_fnc_removePerFrameHandler; @@ -38,29 +39,72 @@ if (_IVpfhActual > 0) then { _IVpfh set [_partIndex, _IVpfhActual]; _patient setVariable [QGVAR(IVpfh), _IVpfh, true]; }; +switch (_usedItem) do { + case "kat_IV_16": { + _IVarray set [_partIndex, 2]; + _IVrate set [_partIndex, 1]; + _patient setVariable [QGVAR(IV), _IVarray, true]; + _patient setVariable [QGVAR(IVrate), _IVrate, true]; + [_patient, "activity", LSTRING(iv_log), [[_medic] call ACEFUNC(common,getName), "16g IV"]] call ACEFUNC(medical_treatment,addToLog); + [_patient, "16g IV"] call ACEFUNC(medical_treatment,addToTriageCard); }; + + case "kat_IV_14": { + _IVarray set [_partIndex, 3]; + _IVrate set [_partIndex, 1.5]; + _patient setVariable [QGVAR(IV), _IVarray, true]; + _patient setVariable [QGVAR(IVrate), _IVrate, true]; + [_patient, "activity", LSTRING(iv_log), [[_medic] call ACEFUNC(common,getName), "14g IV"]] call ACEFUNC(medical_treatment,addToLog); + [_patient, "14g IV"] call ACEFUNC(medical_treatment,addToTriageCard);}; -if (_usedItem isEqualTo "kat_IV_16") then { - _IVarray set [_partIndex, 2]; - _patient setVariable [QGVAR(IV), _IVarray, true]; + case "kat_IV_20": { + _IVarray set [_partIndex, 4]; + _IVrate set [_partIndex, 0.5]; + _patient setVariable [QGVAR(IV), _IVarray, true]; + _patient setVariable [QGVAR(IVrate), _IVrate, true]; + [_patient, "activity", LSTRING(iv_log), [[_medic] call ACEFUNC(common,getName), "20g IV"]] call ACEFUNC(medical_treatment,addToLog); + [_patient, "20g IV"] call ACEFUNC(medical_treatment,addToTriageCard);}; - [_patient, "activity", LSTRING(iv_log), [[_medic] call ACEFUNC(common,getName), "16g IV"]] call ACEFUNC(medical_treatment,addToLog); - [_patient, "16g IV"] call ACEFUNC(medical_treatment,addToTriageCard); -} else { - _IVarray set [_partIndex, 1]; - _patient setVariable [QGVAR(IV), _IVarray, true]; - - private _lidocaineCount = [_patient, "Lidocaine", false] call ACEFUNC(medical_status,getMedicationCount); - private _morphineCount = [_patient, "Morphine", false] call ACEFUNC(medical_status,getMedicationCount); - private _nalbuphineCount = [_patient, "Nalbuphine", false] call ACEFUNC(medical_status,getMedicationCount); - private _fentanylCount = [_patient, "Fentanyl", false] call ACEFUNC(medical_status,getMedicationCount); - private _ketamineCount = [_patient, "Ketamine", false] call ACEFUNC(medical_status,getMedicationCount); - if (_lidocaineCount <= 0.6 && _morphineCount <= 0.6 && _nalbuphineCount <= 0.6 && _fentanylCount <= 0.6 && _ketamineCount <= 0.6) then {[_patient, 0.8] call ACEFUNC(medical_status,adjustPainLevel)}; - - [_patient, "activity", LSTRING(iv_log), [[_medic] call ACEFUNC(common,getName), "FAST IO"]] call ACEFUNC(medical_treatment,addToLog); - [_patient, "FAST IO"] call ACEFUNC(medical_treatment,addToTriageCard); + case "kat_IO_FAST": { + _IVarray set [_partIndex, 1]; + _IVrate set [_partIndex, 0.4]; + _patient setVariable [QGVAR(IV), _IVarray, true]; + _patient setVariable [QGVAR(IVrate), _IVrate, true]; + private _medStack = _patient call ACEFUNC(medical_treatment,getAllMedicationCount); + private _medsToCheck = ["fentanyl", "ketamine", "nalbuphine", "morphine"]; + private _fentanylEffectiveness = 0; + private _ketamineEffectiveness = 0; + private _nalbuphineEffectiveness = 0; + private _morphineEffectiveness = 0; + { + private _medName = toLower (_x select 0); + private _effectiveness = _x select 2; + if ("fentanyl" in _medName) then { + _fentanylEffectiveness = _fentanylEffectiveness max _effectiveness; + }; + if ("ketamine" in _medName) then { + _ketamineEffectiveness = _ketamineEffectiveness max _effectiveness; + }; + if ("nalbuphine" in _medName) then { + _nalbuphineEffectiveness = _nalbuphineEffectiveness max _effectiveness; + }; + if ("morphine" in _medName) then { + _morphineEffectiveness = _morphineEffectiveness max _effectiveness; + }; + } forEach _medStack; + if ( + _fentanylEffectiveness <= 0.8 && + _ketamineEffectiveness <= 0.8 && + _nalbuphineEffectiveness <= 0.8 && + _morphineEffectiveness <= 0.8 + ) then { + [_patient, [0.6, 0.7, 0.8] select (floor random 3)] call ACEFUNC(medical_status,adjustPainLevel); + }; + [_patient, "activity", LSTRING(iv_log), [[_medic] call ACEFUNC(common,getName), "FAST IO"]] call ACEFUNC(medical_treatment,addToLog); + [_patient, "FAST IO"] call ACEFUNC(medical_treatment,addToTriageCard);}; + default {}; }; -if (GVAR(IVdropEnable) && (_usedItem isEqualTo "kat_IV_16")) then { +if (GVAR(IVdropEnable) && ((_usedItem isEqualTo "kat_IV_16") || (_usedItem isEqualTo "kat_IV_14") || (_usedItem isEqualTo "kat_IV_20"))) then { [{ params ["_patient", "_partIndex", "_IVpfhActual"]; @@ -84,10 +128,11 @@ if (GVAR(IVdropEnable) && (_usedItem isEqualTo "kat_IV_16")) then { private _IVactual = _IVarray select _partIndex; if(GVAR(IVreuse)) then { - if (_IVactual == 1) then { - _patient addItem "kat_IO_FAST"; - } else { - _patient addItem "kat_IV_16"; + switch (_IVactual) do { + case "1": {_patient addItem "kat_IO_FAST"}; + case "2": {_patient addItem "kat_IV_16"}; + case "3": {_patient addItem "kat_IV_14"}; + case "4": {_patient addItem "kat_IV_20"}; }; }; diff --git a/addons/pharma/functions/fnc_checkIVType.sqf b/addons/pharma/functions/fnc_checkIVType.sqf new file mode 100644 index 000000000..94137c2ef --- /dev/null +++ b/addons/pharma/functions/fnc_checkIVType.sqf @@ -0,0 +1,36 @@ +#include "..\script_component.hpp" +/* + * Author: Cplhardcore + * Checks the IV from the patient on the given body part. + * Note: Patient may not be local + * + * Arguments: + * 0: Patient + * 1: Body Part + * + * Return Value: + * Check IV + * 0: No IV/IO + * 1: Fast IO + * 2: 16G IV + * 3: 14G IV + * 4: 20G IV + * + * Example: + * [cursorObject, "LeftLeg"] call kat_pharma_fnc_checkIVType; + * + * Public: No + */ + +params ["_patient", "_bodyPart"]; + +private _partIndex = ALL_BODY_PARTS find toLower _bodyPart; +private _IVarray = _patient getVariable [QGVAR(IV), [0,0,0,0,0,0]]; +private _IVactual = _IVarray select _partIndex; +private _return = 0; + +if (_IVactual > 0) then { + _return = _IVactual; +}; + +_return diff --git a/addons/pharma/functions/fnc_clotWound.sqf b/addons/pharma/functions/fnc_clotWound.sqf index 9152bdbe4..950f8ddc2 100644 --- a/addons/pharma/functions/fnc_clotWound.sqf +++ b/addons/pharma/functions/fnc_clotWound.sqf @@ -20,7 +20,7 @@ params ["_unit"]; if !(GVAR(coagulation)) exitWith {}; private _fnc_clotWound = { - params ["_unit", "_bodyPart", "_wounds", "_countTXA", "_countEACA"]; + params ["_unit", "_bodyPart", "_wounds", "_eacaEffectiveness", "_txaEffectiveness"]; { _x params ["_woundClassID", "_amountOf", "_bleeding", "_damage"]; @@ -62,10 +62,10 @@ private _fnc_clotWound = { if (_amountOf * _bleeding > 0) exitWith { - if (_countTXA > 0 || _countEACA > 0) then { + if ((_eacaEffectiveness > 0.3 || _txaEffectiveness > 0.3)) then { _logString = LSTRING(coagulation_Bandaged_TXA); - if (_countEACA > 0 && _countTXA > 0) exitWith { // If TXA & EACA are in system at same time use EACA bandage + if (_eacaEffectiveness > 0.3 && _txaEffectiveness > 0.3) exitWith { // If TXA & EACA are in system at same time use EACA bandage _woundClotTime = round (_woundClotTime / 3 * 2); _bandageToUse = _bandageToUse + "EACA"; }; @@ -113,8 +113,20 @@ private _fnc_clotWound = { private _openWounds = _unit getVariable [VAR_OPEN_WOUNDS, createHashMap]; private _pulse = _unit getVariable [VAR_HEART_RATE, 80]; private _coagulationFactor = _unit getVariable [QGVAR(coagulationFactor), 30]; - private _countTXA = [_unit, "TXA"] call ACEFUNC(medical_status,getMedicationCount); - private _countEACA = [_unit, "EACA"] call ACEFUNC(medical_status,getMedicationCount); + private _medStack = [_patient, false] call ACEFUNC(medical_treatment,getAllMedicationCount); + private _medsToCheck = ["TXA", "EACA"]; + private _eacaEffectiveness = 0; + private _txaEffectiveness = 0; + { + private _medName = toLower (_x select 0); + private _effectiveness = _x select 2; + if ("TXA" in _medName) then { + _txaEffectiveness = _txaEffectiveness max _effectiveness; + }; + if ("EACA" in _medName) then { + _eacaEffectiveness = _eacaEffectiveness max _effectiveness; + }; + } forEach _medStack; private _hasWoundToBandageArray = []; if (_openWounds isEqualTo createHashMap) exitWith {}; // Exit when hashmap not initialized (Will not work when hashmap is set, cause ace only changes value of "woundCount" to 0) @@ -155,11 +167,11 @@ private _fnc_clotWound = { } forEach (_openWounds get _x); // Sets array that specifies if there is a open wound that coag can bandage in body part (here for performance so that the fnc does not get called every time) if (!(GVAR(coagulation_on_all_Bodyparts)) && true in _hasWoundToBandageArray) exitWith { // Check if coag should be present on all body party simultaneously, if not use this exitWith to block next interiation of forEach - [_unit, _x, _openWounds get _x, _countTXA, _countEACA] call _fnc_clotWound; + [_unit, _x, _openWounds get _x, _eacaEffectiveness, _txaEffectiveness] call _fnc_clotWound; }; if (true in _hasWoundToBandageArray) then { // Check if there is a wound to bandage for coag, if not loop through next interiation of forEach - [_unit, _x, _openWounds get _x, _countTXA, _countEACA] call _fnc_clotWound; + [_unit, _x, _openWounds get _x, _eacaEffectiveness, _txaEffectiveness] call _fnc_clotWound; }; } forEach _shuffledKeys; }, missionNamespace getVariable [QGVAR(coagulation_time), 5], [_unit, _fnc_clotWound]] call CBA_fnc_addPerFrameHandler; diff --git a/addons/pharma/functions/fnc_coagRegen.sqf b/addons/pharma/functions/fnc_coagRegen.sqf index c6ffeccaf..4713743c5 100644 --- a/addons/pharma/functions/fnc_coagRegen.sqf +++ b/addons/pharma/functions/fnc_coagRegen.sqf @@ -40,8 +40,20 @@ if !(GVAR(coagulation)) exitWith {}; private _savedCoagFactors = _unit getVariable [QGVAR(coagulationSavedFactors), (_unit getVariable [QGVAR(coagulationFactor), 30])]; private _limitRegenCoagFactors = missionNamespace getVariable [QGVAR(coagulation_factor_count), 30]; private _cooldownON = _unit getVariable [QGVAR(coagulationRegenCooldown), false]; - private _countTXA = [_unit, "TXA"] call ACEFUNC(medical_status,getMedicationCount); - private _countEACA = [_unit, "EACA"] call ACEFUNC(medical_status,getMedicationCount); + private _medStack = [_patient, false] call ACEFUNC(medical_treatment,getAllMedicationCount); + private _medsToCheck = ["TXA", "EACA"]; + private _eacaEffectiveness = 0; + private _txaEffectiveness = 0; + { + private _medName = toLower (_x select 0); + private _effectiveness = _x select 2; + if ("TXA" in _medName) then { + _txaEffectiveness = _txaEffectiveness max _effectiveness; + }; + if ("EACA" in _medName) then { + _eacaEffectiveness = _eacaEffectiveness max _effectiveness; + }; + } forEach _medStack; private _ammountToAdd = 1; if (_currentCoagFactors < _savedCoagFactors) exitWith { @@ -54,8 +66,8 @@ if !(GVAR(coagulation)) exitWith {}; if (_currentCoagFactors == _savedCoagFactors && _currentCoagFactors < _limitRegenCoagFactors) exitWith { - if (_countTXA > 0 || _countEACA > 0) then { // If TXA or EACA are in system add more factors - if (_countTXA > 0 && _countEACA > 0) exitWith { + if (__eacaEffectiveness > 0.3 || _txaEffectiveness > 0.3) then { // If TXA or EACA are in system add more factors + if (_eacaEffectiveness > 0.3 && _txaEffectiveness > 0.3) exitWith { _ammountToAdd = 4; }; _ammountToAdd = 2; @@ -67,7 +79,7 @@ if !(GVAR(coagulation)) exitWith {}; if (_currentCoagFactors > _limitRegenCoagFactors && !(_cooldownON)) exitWith { - if (_countTXA > 0 || _countEACA > 0) exitWith {}; // If TXA or EACA is in system don't remove factor + if ((_countTXA > 0 || _countTXAiV51 > 0 || _countTXAiV53 > 0 || _countTXAiM101 > 0 || _countTXAiM103 > 0) || (_countEACA > 0 || _countEACAIV51 > 0 || _countEACAIV53 > 0)) exitWith {}; // If TXA or EACA is in system don't remove factor _unit setVariable [QGVAR(coagulationFactor), (_currentCoagFactors - 1), true]; _unit setVariable [QGVAR(coagulationSavedFactors), (_currentCoagFactors - 1), true]; diff --git a/addons/pharma/functions/fnc_fullHealLocal.sqf b/addons/pharma/functions/fnc_fullHealLocal.sqf index 289a7c4c7..5a6c92d7d 100644 --- a/addons/pharma/functions/fnc_fullHealLocal.sqf +++ b/addons/pharma/functions/fnc_fullHealLocal.sqf @@ -38,6 +38,7 @@ if (GVAR(RequireInsIV) && GVAR(IVflowControl)) then { }; _patient setVariable [QGVAR(IVpfh), [0,0,0,0,0,0], true]; +_patient setVariable [QGVAR(IVrate), [0,0,0,0,0,0], true]; _patient setVariable [QGVAR(active), false, true]; _patient setVariable [QGVAR(IVPharma_PFH), nil, true]; @@ -47,10 +48,12 @@ _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]; _patient setVariable [QGVAR(kidneyPressure), false, true]; +_patient setVariable [QGVAR(respiratoryRate), 1, true]; _patient setVariable [QGVAR(coagulationFactor), missionNamespace getVariable [QGVAR(coagulation_factor_count), 30], true]; diff --git a/addons/pharma/functions/fnc_getBloodVolumeChange.sqf b/addons/pharma/functions/fnc_getBloodVolumeChange.sqf index cb3de9ef2..44990eb4f 100644 --- a/addons/pharma/functions/fnc_getBloodVolumeChange.sqf +++ b/addons/pharma/functions/fnc_getBloodVolumeChange.sqf @@ -48,9 +48,10 @@ if (!isNil {_unit getVariable [QACEGVAR(medical,ivBags),[]]}) then { private _tourniquets = GET_TOURNIQUETS(_unit); - if ((_tourniquets select _bodyPart isEqualTo 0) && (_IVarray select _bodyPart isNotEqualTo 3)) then { + if ((_tourniquets select _bodyPart isEqualTo 0) && (_IVarray select _bodyPart isNotEqualTo 7)) then { private _IVflow = _unit getVariable [QGVAR(IVflow), [0,0,0,0,0,0]]; - private _bagChange = (_flowCalculation * (_IVflow select _bodyPart)) min _bagVolumeRemaining; // absolute value of the change in miliLiters + private _IVrate = _unit getVariable [QGVAR(IVrate), [0,0,0,0,0,0]]; + private _bagChange = (_flowCalculation * (_IVflow select _bodyPart) * (_IVrate select _bodyPart)) min _bagVolumeRemaining; // absolute value of the change in miliLiters _bagVolumeRemaining = _bagVolumeRemaining - _bagChange; if (_hypothermia) then { diff --git a/addons/pharma/functions/fnc_gui_updateInjuryListPart.sqf b/addons/pharma/functions/fnc_gui_updateInjuryListPart.sqf index 91ea65d69..1a3399722 100644 --- a/addons/pharma/functions/fnc_gui_updateInjuryListPart.sqf +++ b/addons/pharma/functions/fnc_gui_updateInjuryListPart.sqf @@ -24,9 +24,11 @@ private _placed = _target getVariable [QGVAR(IV), [0,0,0,0,0,0]]; private _IVactual = _placed select _selectionN; if (_IVactual > 0) then { - if (_IVactual == 1) then { - _entries pushBack [LLSTRING(IO_45_Display), [0.3, 0.6, 0.3, 1]]; - } else { - _entries pushBack [LLSTRING(IV_16_Display), [0.3, 0.6, 0.3, 1]]; - }; + switch (_IVactual) do { + case 1: { _entries pushBack [LLSTRING(IO_45_Display), [0.3, 0.6, 0.3, 1]]}; + case 2: { _entries pushBack [LLSTRING(IV_16_Display), [0.3, 0.6, 0.3, 1]]}; + case 3: { _entries pushBack [LLSTRING(IV_14_Display), [0.3, 0.6, 0.3, 1]]}; + case 4: { _entries pushBack [LLSTRING(IV_20_Display), [0.3, 0.6, 0.3, 1]]}; + default {}; + }; }; \ No newline at end of file diff --git a/addons/pharma/functions/fnc_handleRespawn.sqf b/addons/pharma/functions/fnc_handleRespawn.sqf index 6c5f1e970..01400000d 100644 --- a/addons/pharma/functions/fnc_handleRespawn.sqf +++ b/addons/pharma/functions/fnc_handleRespawn.sqf @@ -36,7 +36,7 @@ params ["_unit","_dead"]; { _x params ["_medication"]; - if (_medication in ["Epinephrine", "EpinephrineIV", "Phenylephrine", "Nitroglycerin", "Lidocaine", "Norepinephrine"]) exitWith { + if (_medication in ["Epinephrine", "EpinephrineIV", "Phenylephrine", "Nitroglycerin", "Lidocaine", "Norepinephrine", "syringe_norepinephrine_5ml_1", "syringe_norepinephrine_5ml_2", "syringe_phenylephrine_5ml_1", "syringe_phenylephrine_5ml_2", "syringe_nitroglycerin_5ml_1", "syringe_nitroglycerin_5ml_2", "syringe_epinephrineIV_5ml_1", "syringe_epinephrineIV_5ml_2", "syringe_lidocaine_5ml_1", "syringe_lidocaine_5ml_2","syringe_lidocaine_10ml_1"]) exitWith { _action = true; }; } forEach (_medicationArray); @@ -87,7 +87,7 @@ if (GVAR(kidneyAction)) then { if !(_kidneyPressure) then { _unit setVariable [QGVAR(kidneyPressure), true, true]; - [_unit, "KIDNEY", 15, 1200, 30, 0, 15] call ACEFUNC(medical_status,addMedicationAdjustment); + [_unit, "KIDNEY", 15, 1200, 30, 0, 15, "", "", ""] call EFUNC(vitals,addMedicationAdjustment); }; }; default { diff --git a/addons/pharma/functions/fnc_init.sqf b/addons/pharma/functions/fnc_init.sqf index c4194367b..d08d66d3a 100644 --- a/addons/pharma/functions/fnc_init.sqf +++ b/addons/pharma/functions/fnc_init.sqf @@ -38,7 +38,7 @@ if (!local _unit) exitWith {}; { _x params ["_medication"]; - if (_medication in ["Epinephrine", "EpinephrineIV", "Phenylephrine", "Nitroglycerin", "Lidocaine", "Norepinephrine"]) exitWith { + if (_medication in ["Epinephrine", "EpinephrineIV", "Phenylephrine", "Nitroglycerin", "Lidocaine", "Norepinephrine", "syringe_norepinephrine_5ml_1", "syringe_norepinephrine_5ml_2", "syringe_phenylephrine_5ml_1", "syringe_phenylephrine_5ml_2", "syringe_nitroglycerin_5ml_1", "syringe_nitroglycerin_5ml_2", "syringe_epinephrineIV_5ml_1", "syringe_epinephrineIV_5ml_2", "syringe_lidocaine_5ml_1", "syringe_lidocaine_5ml_2","syringe_lidocaine_10ml_1"]) exitWith { _alpha = true; }; } forEach (_medicationArray); @@ -46,7 +46,7 @@ if (!local _unit) exitWith {}; { _x params ["_medication"]; - if (_medication in ["Fentanyl", "Morphine", "Nalbuphine"]) exitWith { + if (_medication in ["Fentanyl", "Morphine", "Nalbuphine", "syringe_fentanyl_5ml_1", "syringe_fentanyl_5ml_2", "syringe_nalbuphine_5ml_1", "syringe_nalbuphine_5ml_2","syringe_fentanyl_10ml_1", "syringe_fentanyl_10ml_2", "syringe_nalbuphine_10ml_1", "syringe_nalbuphine_10ml_2"]) exitWith { _opioid = true; }; } forEach (_medicationArray); @@ -101,7 +101,7 @@ if (GVAR(kidneyAction)) then { if !(_kidneyPressure) then { _unit setVariable [QGVAR(kidneyPressure), true, true]; - [_unit, "KIDNEY", 15, 1200, 30, 0, 15] call ACEFUNC(medical_status,addMedicationAdjustment); + [_unit, "KIDNEY", 15, 1200, 30, 0, 15, "", "", ""] call EFUNC(vitals,addMedicationAdjustment); }; }; default { diff --git a/addons/pharma/functions/fnc_inspectCatheter.sqf b/addons/pharma/functions/fnc_inspectCatheter.sqf index c8178f00e..172e96bc9 100644 --- a/addons/pharma/functions/fnc_inspectCatheter.sqf +++ b/addons/pharma/functions/fnc_inspectCatheter.sqf @@ -23,7 +23,7 @@ private _partIndex = ALL_BODY_PARTS find toLower _bodyPart; private _IVarray = _patient getVariable [QGVAR(IV), [0,0,0,0,0,0]]; private _IVactual = _IVarray select _partIndex; -if (_IVactual == 3) exitWith { +if (_IVactual == 7) exitWith { private _output = LLSTRING(IVblock_closed); [_output, 1.5, _medic] call ACEFUNC(common,displayTextStructured); }; diff --git a/addons/pharma/functions/fnc_ivCondition.sqf b/addons/pharma/functions/fnc_ivCondition.sqf new file mode 100644 index 000000000..13b8b1838 --- /dev/null +++ b/addons/pharma/functions/fnc_ivCondition.sqf @@ -0,0 +1,33 @@ +#include "..\script_component.hpp" +/* + * Author: Cplhardcore + * Checks if an IV is present and medication can be pushed + * Note: Patient may not be local + * + * Arguments: + * 0: Medic + * 1: Patient + * 2: Body Part + * + * Return Value: + * Check IV Condition + * + * Example: + * [player, cursorObject, "LeftLeg"] call kat_pharma_fnc_ivCondition; + * + * Public: No + */ + +params ["_medic", "_patient", "_bodyPart"]; + +private _removeIV = [_medic, _patient, _bodyPart] call FUNC(removeIV); +private _ivType = [_patient, _bodyPart] call FUNC(checkIVType); +private _return = false; + +if (_removeIV && _ivType != 3) then { + _return = true; +} else { + _return = false; +}; + +_return \ No newline at end of file diff --git a/addons/pharma/functions/fnc_medicationLocal.sqf b/addons/pharma/functions/fnc_medicationLocal.sqf index 3c42367e6..33d14341a 100644 --- a/addons/pharma/functions/fnc_medicationLocal.sqf +++ b/addons/pharma/functions/fnc_medicationLocal.sqf @@ -42,7 +42,6 @@ if !(ACEGVAR(medical_treatment,advancedMedication)) exitWith { if !(_sedated) then { [QACEGVAR(medical,WakeUp), _patient] call CBA_fnc_localEvent; }; - }; case "EpinephrineIV": { private _sedated = _patient getVariable [QEGVAR(surgery,sedated), false]; @@ -61,7 +60,7 @@ TRACE_1("Running treatmentMedicationLocal with Advanced configuration for",_pati private _partIndex = ALL_BODY_PARTS find toLower _bodyPart; // Handle IV blockage -if (((_patient getVariable [QGVAR(IV), [0,0,0,0,0,0]]) select _partIndex) isEqualTo 3) exitWith { +if (((_patient getVariable [QGVAR(IV), [0,0,0,0,0,0]]) select _partIndex) isEqualTo 7) exitWith { private _occludedMedications = _patient getVariable [QACEGVAR(medical,occludedMedications), []]; _occludedMedications pushBack [_partIndex, _classname]; _patient setVariable [QACEGVAR(medical,occludedMedications), _occludedMedications, true]; @@ -79,20 +78,35 @@ if (HAS_TOURNIQUET_APPLIED_ON(_patient,_partIndex)) exitWith { private _defaultConfig = configFile >> QUOTE(ACE_ADDON(Medical_Treatment)) >> "Medication"; private _medicationConfig = _defaultConfig >> _classname; -private _painReduce = GET_NUMBER(_medicationConfig >> "painReduce",getNumber (_defaultConfig >> "painReduce")); -private _timeInSystem = GET_NUMBER(_medicationConfig >> "timeInSystem",getNumber (_defaultConfig >> "timeInSystem")); -private _timeTillMaxEffect = GET_NUMBER(_medicationConfig >> "timeTillMaxEffect",getNumber (_defaultConfig >> "timeTillMaxEffect")); -private _maxDose = GET_NUMBER(_medicationConfig >> "maxDose",getNumber (_defaultConfig >> "maxDose")); -private _maxDoseDeviation = GET_NUMBER(_medicationConfig >> "maxDoseDeviation",getNumber (_defaultConfig >> "maxDoseDeviation")); -private _viscosityChange = GET_NUMBER(_medicationConfig >> "viscosityChange",getNumber (_defaultConfig >> "viscosityChange")); -private _hrIncreaseLow = GET_ARRAY(_medicationConfig >> "hrIncreaseLow",getArray (_defaultConfig >> "hrIncreaseLow")); -private _hrIncreaseNormal = GET_ARRAY(_medicationConfig >> "hrIncreaseNormal",getArray (_defaultConfig >> "hrIncreaseNormal")); -private _hrIncreaseHigh = GET_ARRAY(_medicationConfig >> "hrIncreaseHigh",getArray (_defaultConfig >> "hrIncreaseHigh")); +private _bloodloss = (GET_BODY_FLUID(unit) select 4); +private _maxbloodloss = 1; +private _minbloodloss = 6000; +private _minDrugMult = 1; +private _maxDrugMult = 2; +private _drugMult = _minDrugMult + ((_bloodloss - _maxbloodloss) / (_minbloodloss - _maxbloodloss)) * (_maxDrugMult - _minDrugMult); + +private _maxHR = 160; +private _minHR = 1; +private _minHRMult = 0.1; +private _maxHRMult = 1.6; +private _hrMult = _minHRMult + ((_heartRate - _maxHR) / (_minHR - _maxHR)) * (_maxHRMult - _minHRMult); + + +private _painReduce = GET_NUMBER(_medicationConfig >> "painReduce",getNumber (_defaultConfig >> "painReduce")) / _drugMult; +private _timeInSystem = GET_NUMBER(_medicationConfig >> "timeInSystem",getNumber (_defaultConfig >> "timeInSystem")) * _drugMult; +private _timeTillMaxEffect = GET_NUMBER(_medicationConfig >> "timeTillMaxEffect",getNumber (_defaultConfig >> "timeTillMaxEffect")) * _hrMult; +private _viscosityChange = GET_NUMBER(_medicationConfig >> "viscosityChange",getNumber (_defaultConfig >> "viscosityChange")) * _drugMult; +private _alphaFactor = GET_NUMBER(_medicationConfig >> "alphaFactor",getNumber (_defaultConfig >> "alphaFactor")) * _drugMult; +private _opioidRelief = GET_NUMBER(_medicationConfig >> "opioidRelief",getNumber (_defaultConfig >> "opioidRelief")) * _drugMult; +private _opioidEffect = GET_NUMBER(_medicationConfig >> "opioidEffect",getNumber (_defaultConfig >> "opioidEffect")) * _drugMult; +private _respiratoryRate = GET_NUMBER(_medicationConfig >> "respiratoryRate",getNumber (_defaultConfig >> "respiratoryRate")) * _drugMult; +private _opioidDepression = GET_NUMBER(_medicationConfig >> "opioidDepression",getNumber (_defaultConfig >> "opioidDepression")) * _drugMult; +private _hrIncreaseLow = GET_ARRAY(_medicationConfig >> "hrIncreaseLow",getArray (_defaultConfig >> "hrIncreaseLow")) apply { _x * _drugMult }; +private _hrIncreaseNormal = GET_ARRAY(_medicationConfig >> "hrIncreaseNormal",getArray (_defaultConfig >> "hrIncreaseNormal")) apply { _x * _drugMult }; +private _hrIncreaseHigh = GET_ARRAY(_medicationConfig >> "hrIncreaseHigh",getArray (_defaultConfig >> "hrIncreaseHigh")) apply { _x * _drugMult }; private _incompatibleMedication = GET_ARRAY(_medicationConfig >> "incompatibleMedication",getArray (_defaultConfig >> "incompatibleMedication")); -private _alphaFactor = GET_NUMBER(_medicationConfig >> "alphaFactor",getNumber (_defaultConfig >> "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 _dose = GET_NUMBER(_medicationConfig >> "dose",getNumber (_defaultConfig >> "dose")); private _heartRate = GET_HEART_RATE(_patient); private _hrIncrease = [_hrIncreaseLow, _hrIncreaseNormal, _hrIncreaseHigh] select (floor ((0 max _heartRate min 110) / 55)); @@ -106,18 +120,90 @@ if (_maxRelief > 0) then { _painReduce = _painReduce / 4; }; }; +if (QGVAR(AMS_Enabled)) then { + private _medicationParts = (_className splitString "_"); -// 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); + if (count _medicationParts > 3) then { + _medicationName = (_medicationParts select 0) + "_" + (_medicationParts select 1); + }; + // Adjust the medication effects and add the medication to the list + TRACE_3("adjustments",_heartRateChange,_painReduce,_viscosityChange); + [_patient, _medicationName, _timeTillMaxEffect, _timeInSystem, _heartRateChange, _painReduce, _viscosityChange, _dose, _alphaFactor, _opioidRelief, _opioidEffect, _opioidDepression, _respiratoryRate] call EFUNC(vitals,addMedicationAdjustment); + + // Check for medication compatiblity + [_patient, _medicationName, _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, _dose, _alphaFactor, _opioidRelief, _opioidEffect, _opioidDepression, _respiratoryRate] call EFUNC(vitals,addMedicationAdjustment); + + // Check for medication compatiblity + [_patient, _className, _incompatibleMedication] call ACEFUNC(medical_treatment,onMedicationUsage); +}; -// Check for medication compatiblity -[_patient, _className, _maxDose, _maxDoseDeviation, _incompatibleMedication] call ACEFUNC(medical_treatment,onMedicationUsage); +if (QGVAR(AMS_Enabled)) then { -if (_className in ["Lorazepam","EACA","TXA","Atropine","Amiodarone","Flumazenil"]) then { - [format ["kat_pharma_%1Local", toLower _className], [_patient, _bodyPart], _patient] call CBA_fnc_targetEvent; -}; + private _medicationParts = (_className splitString "_"); + + if (count _medicationParts > 3) then { + _medicationName = _medicationParts select 1; + + if (_medicationName in ["lorazepam","EACA","TXA","amiodarone","flumazenil","lidocaine"]) then { + [format ["kat_pharma_%1Local", toLower _medicationName], [_patient, _bodyPart], _patient] call CBA_fnc_targetEvent; + }; + + if (_medicationName in ["ketamine","atropine","adenosine","alteplase","lidocaine"]) then { + [format ["kat_pharma_%1Local", toLower _medicationName], [_patient, _bodyPart, _classname], _patient] call CBA_fnc_targetEvent; + }; + + if (_medicationName in ["fentanyl","morphine","nalbuphine"]) then { + [format ["kat_pharma_%1Local", toLower _medicationName], [_patient, _bodyPart, _opioidRelief], _patient] call CBA_fnc_targetEvent; + }; -if (_className in ["Fentanyl","Morphine","Nalbuphine"]) then { + } else { + diag_log format ["Unexpected _className format: %1", _className]; + }; +} else { + + if (_className in ["Lorazepam","Ketamine","EACA","TXA","Atropine","Amiodarone","Flumazenil","lidocaine"]) then { + [format ["kat_pharma_%1Local", toLower _className], [_patient, _bodyPart, _classname], _patient] call CBA_fnc_targetEvent; + }; + + if (_className in ["Fentanyl","Morphine","Nalbuphine"]) then { [format ["kat_pharma_%1Local", toLower _className], [_patient, _bodyPart, _opioidRelief], _patient] call CBA_fnc_targetEvent; + }; }; +if (QGVAR(AMSEnabled)) then { +private _TXAmedications = ["syringe_TXA_5ml_1", "syringe_TXA_10ml_1"]; + if (_classname in _TXAmedications) then { + private _medication = _classname; + private _administered = _patient getVariable ["meds_administered", []]; + private _effectTriggered = _patient getVariable ["effect_triggered", false]; + private _windowActive = _patient getVariable ["meds_window_active", false]; + if (!(_medication in _administered)) then { + _administered pushBack _medication; + _patient setVariable ["meds_administered", _administered, true]; + }; + if (count _administered == 1) then { + _patient setVariable ["meds_window_active", false, true]; + [{ + params ["_patient"]; + _patient setVariable ["meds_window_active", true, true]; + }, + [_patient], 180] call CBA_fnc_waitAndExecute; + [{ + params ["_patient"]; + _patient setVariable ["meds_window_active", false, true]; + }, + [_patient], 300] call CBA_fnc_waitAndExecute; + }; + if ((count _administered == count _TXAmedications) && (_patient getVariable ["meds_window_active", false]) && {!_effectTriggered}) then { + _effectTriggered = true; + [_patient, "EACA", 15, 360, "", "", "", "", "", "", "", ""] call EFUNC(vitals,addMedicationAdjustment); + [_patient, "Body"] call FUNC(treatmentAdvanced_EACALocal); + _patient setVariable ["effect_triggered", false, true]; + _patient setVariable ["meds_administered", [], true]; + _patient setVariable ["meds_window_active", false, true]; + }; + }; +}; \ No newline at end of file diff --git a/addons/pharma/functions/fnc_onMedicationUsage.sqf b/addons/pharma/functions/fnc_onMedicationUsage.sqf new file mode 100644 index 000000000..98be2bee6 --- /dev/null +++ b/addons/pharma/functions/fnc_onMedicationUsage.sqf @@ -0,0 +1,82 @@ +#include "..\script_component.hpp" +/* + * Author: Glowbal, Cplhardcore + * Handles the medication given to a patient. + * + * Arguments: + * 0: Patient + * 1: Medication Treatment classname + * 2: Incompatible medication > + * + * Return Value: + * None + * + * Example: + * [player, "morphine", [["x", 1]]] call ace_medical_treatment_fnc_onMedicationUsage + * + * Public: No + */ + +params ["_target", "_className", "_incompatibleMedication"]; +TRACE_3("onMedicationUsage",_target,_className,_incompatibleMedication); + +if (QGVAR(AMS_Enabled)) then { + private _medicationParts = (_className splitString "_"); + + if (count _medicationParts > 3) then { + _medicationName = _medicationParts select 1; { + private _defaultConfig = configFile >> QUOTE(ADDON) >> "Medication"; + private _medicationConfig = _defaultConfig >> _medicationName; + private _maxDose = GET_NUMBER(_medicationConfig >> "maxDose",getNumber (_defaultConfig >> "maxDose")); + + if (_maxDose > 0) then { + private _maxDoseDeviation = GET_NUMBER(_medicationConfig >> "maxDoseDeviation",getNumber (_defaultConfig >> "maxDoseDeviation")); + private _currentDose = [_target, _medicationName] call EFUNC(medical_status,getMedicationCount) select 0; + // Because both {floor random 0} and {floor random 1} return 0 + if (_maxDoseDeviation > 0) then { + _maxDoseDeviation = _maxDoseDeviation + 1; + }; + + private _limit = _maxDose + (floor random _maxDoseDeviation); + if (_currentDose > _limit) then { + TRACE_1("exceeded max dose",_currentDose); + [_target, _medicationName, _currentDose, _limit, _incompatibleMed] call FUNC(overDose); + }; + { + _x params ["_xMed", "_xLimit"]; + private _inSystem = ([_target, _xMed] call EFUNC(medical_status,getMedicationCount)) select 0; + if (_inSystem > _xLimit) then { + [_target, _medicationName, _inSystem, _xLimit, _xMed] call FUNC(overDose); + }; + } forEach _incompatibleMedication; + }; + }; + }; +} else { + private _defaultConfig = configFile >> QUOTE(ADDON) >> "Medication"; + private _medicationConfig = _defaultConfig >> _classname; + private _maxDose = GET_NUMBER(_medicationConfig >> "maxDose",getNumber (_defaultConfig >> "maxDose")); + + if (_maxDose > 0) then { + private _maxDoseDeviation = GET_NUMBER(_medicationConfig >> "maxDoseDeviation",getNumber (_defaultConfig >> "maxDoseDeviation")); + private _currentDose = [_target, _className] call EFUNC(medical_status,getMedicationCount) select 0; + // Because both {floor random 0} and {floor random 1} return 0 + if (_maxDoseDeviation > 0) then { + _maxDoseDeviation = _maxDoseDeviation + 1; + }; + + private _limit = _maxDose + (floor random _maxDoseDeviation); + if (_currentDose > _limit) then { + TRACE_1("exceeded max dose",_currentDose); + [_target, _classname, _currentDose, _limit, _classname] call FUNC(overDose); + }; + }; + +// Check incompatible medication (format [med,limit]) + { + _x params ["_xMed", "_xLimit"]; + private _inSystem = ([_target, _xMed] call EFUNC(medical_status,getMedicationCount)) select 0; + if (_inSystem > _xLimit) then { + [_target, _classname, _inSystem, _xLimit, _xMed] call FUNC(overDose); + }; + } forEach _incompatibleMedication;} diff --git a/addons/pharma/functions/fnc_overDose.sqf b/addons/pharma/functions/fnc_overDose.sqf new file mode 100644 index 000000000..0d1a9f3fc --- /dev/null +++ b/addons/pharma/functions/fnc_overDose.sqf @@ -0,0 +1,49 @@ +#include "..\script_component.hpp" +/* + * Author: Cplhardcore + * Handles the overdose effects of a medication. + * + * Arguments: + * 0: The patient + * 1: Medication Treatment classname + * 2: Incompatable medication > + * + * Return Value: + * None + * + * Example: + * [player, "morphine"] call kat_pharma_fnc_overDose + * Public: No + */ + +params ["_unit", "_className", "_dose", "_limit", "_incompatibleMedication"]; +if (QGVAR(AMS_Enabled)) then { + [format ["kat_pharma_%1OverdoseLocal", toLower _className], [_patient], _patient] call CBA_fnc_targetEvent; + } +else { +private _defaultConfig = configFile >> QUOTE(ACE_ADDON(Medical_Treatment)) >> "Medication"; +private _medicationConfig = (configFile >> "ace_medical_treatment" >> _classname); +private _onOverDose = getText (_medicationConfig >> "onOverDose"); + + if (isClass _medicationConfig) then { + _medicationConfig = _medicationConfig >> _classname; + if (isText (_medicationConfig >> "onOverDose")) then { + _onOverDose = getText (_medicationConfig >> "onOverDose"); + }; + }; + TRACE_2("overdose",_classname,_onOverDose); + + [QEGVAR(medical,overdose), [_unit, _classname, _dose, _limit, _incompatibleMed]] call CBA_fnc_localEvent; + + if (_onOverDose == "") exitWith { + TRACE_1("CriticalVitals Event",_unit); + [QEGVAR(medical,CriticalVitals), _unit] call CBA_fnc_localEvent; + }; + + _onOverDose = if (missionNamespace isNil _onOverDose) then { + compile _onOverDose + } else { + missionNamespace getVariable _onOverDose + }; + + [_unit, _classname, _dose, _limit, _incompatibleMed] call _onOverDose}; \ No newline at end of file diff --git a/addons/pharma/functions/fnc_prepareSyringe.sqf b/addons/pharma/functions/fnc_prepareSyringe.sqf new file mode 100644 index 000000000..58749053a --- /dev/null +++ b/addons/pharma/functions/fnc_prepareSyringe.sqf @@ -0,0 +1,36 @@ +#include "..\script_component.hpp" +/* + * Author: Katalam, modified by Cplhardcore + * Removes a syringe and a given medication and + * returns a "crafted" syringe with fluid + * + * Arguments: + * 0: Player + * 1: Class name of medication + * 2: Syringe type + * 3: Dose type + * + * Return Value: + * None + * + * Example: + * [player, "TXA", "5ml", "1"] call kat_pharma_fnc_prepareSyringe; + * + * Public: No + */ +params ["_player", "_medicationType", "_syringeType", "_doseType"]; + +private _syringeClassName = format ["kat_syringe_%1_%2_%3", _medicationType, _syringeType, _doseType]; +private _hasSyringe = isClass (configFile >> "CfgWeapons" >> _syringeClassName); +if (!_hasSyringe) exitWith { + hint format ["This syringe combination does not exist. kat_syringe %1 %2 %3", _medicationType, _syringeType, _doseType]; + [{hint ""}, [], 5] call CBA_fnc_waitAndExecute; +}; +private _baseSyringe = format ["kat_%1_syringe", _syringeType]; +_player removeItem _baseSyringe; +_katClassName = "kat_" + _medicationType; +_player removeItem _katClassName; +_player addItem _syringeClassName; +private _syringeDisplayName = getText (configFile >> "CfgWeapons" >> _syringeClassName >> "displayName"); +hint format ["Prepared syringe: %1", _syringeDisplayName]; +[{hint ""}, [], GVAR(prepTime_PrepSyringe)] call CBA_fnc_waitAndExecute; \ No newline at end of file diff --git a/addons/pharma/functions/fnc_retrieveIV.sqf b/addons/pharma/functions/fnc_retrieveIV.sqf index a3e68c693..d15317b80 100644 --- a/addons/pharma/functions/fnc_retrieveIV.sqf +++ b/addons/pharma/functions/fnc_retrieveIV.sqf @@ -25,11 +25,13 @@ private _newArray = _patient getVariable [QACEGVAR(medical,ivBags), []]; private _IVactual = _IVarray select _partIndex; if(GVAR(IVreuse)) then { - if (_IVactual == 1) then { - _medic addItem "kat_IO_FAST"; - } else { - _medic addItem "kat_IV_16"; - }; + switch (_IVactual) do { + case 1: {_patient addItem "kat_IO_FAST"}; + case 2: {_patient addItem "kat_IV_16"}; + case 3: {_patient addItem "kat_IV_14"}; + case 4: {_patient addItem "kat_IV_20"}; + default {}; + }; }; _IVarray set [_partIndex, 0]; diff --git a/addons/pharma/functions/fnc_salineCheck.sqf b/addons/pharma/functions/fnc_salineCheck.sqf index 574c8db41..96e249386 100644 --- a/addons/pharma/functions/fnc_salineCheck.sqf +++ b/addons/pharma/functions/fnc_salineCheck.sqf @@ -22,7 +22,7 @@ params ["_medic", "_patient", "_bodyPart"]; private _partIndex = ALL_BODY_PARTS find toLower _bodyPart; private _IVarray = _patient getVariable [QGVAR(IV), [0,0,0,0,0,0]]; private _IVactual = _IVarray select _partIndex; -if (_IVactual != 3) exitWith {false}; +if (_IVactual != 7) exitWith {false}; private _fluidCheck = _patient getVariable [QACEGVAR(medical,ivBags), []]; private _check = false; diff --git a/addons/pharma/functions/fnc_tourniquetRemove.sqf b/addons/pharma/functions/fnc_tourniquetRemove.sqf index e15a5e54b..a8ce76c2c 100644 --- a/addons/pharma/functions/fnc_tourniquetRemove.sqf +++ b/addons/pharma/functions/fnc_tourniquetRemove.sqf @@ -55,7 +55,7 @@ if (_medic call ACEFUNC(common,isPlayer)) then { private _occludedMedications = _patient getVariable [QACEGVAR(medical,occludedMedications), []]; private _arrayModified = false; -if !(((_patient getVariable [QGVAR(IV), [0,0,0,0,0,0]]) select _partIndex) isEqualTo 3) then { +if !(((_patient getVariable [QGVAR(IV), [0,0,0,0,0,0]]) select _partIndex) isEqualTo 7) then { { _x params ["_bodyPartN", "_medication"]; diff --git a/addons/pharma/functions/fnc_treatmentAdvanced_AdenosineLocal.sqf b/addons/pharma/functions/fnc_treatmentAdvanced_AdenosineLocal.sqf new file mode 100644 index 000000000..9611a9ce2 --- /dev/null +++ b/addons/pharma/functions/fnc_treatmentAdvanced_AdenosineLocal.sqf @@ -0,0 +1,24 @@ +#include "..\script_component.hpp" +/* + * Author:Cplhardcore + * Does the AV block effect of adenosine + * + * Arguments: + * 0: Patient + * + * Return Value: + * None + * + * Example: + * [cursorTarget, "ACE_adenosine"] call kat_pharma_fnc_treatmentAdvanced_AdenosineLocal; + * + * Public: No + */ +params ["_patient", "_classname"]; +if (_classname isEqualTo "ACE_adenosine") exitWith {}; +private _cardiacRhythm = _patient getVariable [QEGVAR(circulation,cardiacArrestType), 0]; +_patient setVariable [QEGVAR(circulation,cardiacArrestType), 1]; +[{ + params ["_patient", "_cardiacRhythm"]; + _patient setVariable [QEGVAR(circulation,cardiacArrestType), _cardiacRhythm]; +}, [_patient, _cardiacRhythm], random(8) + 8] call CBA_fnc_waitAndExecute; \ No newline at end of file diff --git a/addons/pharma/functions/fnc_treatmentAdvanced_AdenosineOverdoseLocal.sqf b/addons/pharma/functions/fnc_treatmentAdvanced_AdenosineOverdoseLocal.sqf new file mode 100644 index 000000000..cd3771f89 --- /dev/null +++ b/addons/pharma/functions/fnc_treatmentAdvanced_AdenosineOverdoseLocal.sqf @@ -0,0 +1,72 @@ +#include "..\script_component.hpp" +/* + * Author:Cplhardcore + * Handles the overdose effect of Adenosine + * + * Arguments: + * 0: Patient + * + * Return Value: + * None + * + * Example: + * [cursorTarget] call kat_pharma_fnc_treatmentAdvanced_AdenosineOverdoseLocal; + * + * Public: No + */ +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; +private _medStack = [_patient, false] call ACEFUNC(medical_treatment,getAllMedicationCount); +private _medIndex = _medStack find "Adenosine"; +private _hasMed = false; +if (_medIndex > -1) then { + private _medCount = _medStack select (_medIndex + 1); + _hasMed = (_medCount > 0); +}; +[_hasmed, {},{ + 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, 120] call CBA_fnc_waitUntilAndExecute; \ No newline at end of file diff --git a/addons/pharma/functions/fnc_treatmentAdvanced_AlteplaseLocal.sqf b/addons/pharma/functions/fnc_treatmentAdvanced_AlteplaseLocal.sqf new file mode 100644 index 000000000..b3501bcce --- /dev/null +++ b/addons/pharma/functions/fnc_treatmentAdvanced_AlteplaseLocal.sqf @@ -0,0 +1,48 @@ +#include "..\script_component.hpp" +/* + * Author: Cplhardcore + * Handles the overdose effect of Alteplase + * + * Arguments: + * 0: Patient + * + * Return Value: + * None + * + * Example: + * [cursorTarget] call kat_pharma_fnc_treatmentAdvanced_AlteplaseLocal; + * + * Public: No + */ +params ["_patient"]; +private _medicationArray = _patient getVariable [QACEGVAR(medical,medications), []]; +{ + _x params ["_medication"]; + private _lowerMed = toLower _medication; + if ( + (_lowerMed find "txa" != -1) || + (_lowerMed find "eaca" != -1) + ) then { + _medicationArray deleteAt (_medicationArray find _x); + }; +} forEach _medicationArray; + +_patient setVariable [QACEGVAR(medical,medications), _medicationArray, true]; +[{ + params ["_patient"]; + private _AlteplaseTarget = 0; + [{ + params ["_patient", "_idPFH"]; + if (!(alive _patient)) exitWith { + [_idPFH] call CBA_fnc_removePerFrameHandler; + }; + _AlteplaseTarget = _AlteplaseTarget + 1; + if (_AlteplaseTarget > 24) exitWith { + [_idPFH] call CBA_fnc_removePerFrameHandler;}; + private _surfaceArea = (_patient getVariable [QEGVAR(breathing,lungSurfaceArea), 400]) + 5; + _patient setVariable [QEGVAR(breathing,lungSurfaceArea), _surfaceArea]; + 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; diff --git a/addons/pharma/functions/fnc_treatmentAdvanced_AlteplaseOverdoseLocal.sqf b/addons/pharma/functions/fnc_treatmentAdvanced_AlteplaseOverdoseLocal.sqf new file mode 100644 index 000000000..abf11f257 --- /dev/null +++ b/addons/pharma/functions/fnc_treatmentAdvanced_AlteplaseOverdoseLocal.sqf @@ -0,0 +1,39 @@ +#include "..\script_component.hpp" +/* + * Author: Cplhardcore + * Handles the overdose effect of Alteplase + * + * Arguments: + * 0: Patient + * + * Return Value: + * None + * + * Example: + * [cursorTarget] call kat_pharma_fnc_treatmentAdvanced_AlteplaseLocal; + * + * Public: No + */ +params ["_patient"]; +private _hrAdjust = 10 + floor random ((25 - 10) + 1); +[_patient, AlteplaseOverdose, 30, 600, _hrAdjust, "", "", 0.2, "", ""] call EFUNC(vitals,addMedicationAdjustment); +_patient setVariable [QACEGVAR(medical,medications), _medicationArray, true]; +[{ + params ["_patient"]; + private _AlteplaseTarget = 0; + [{ + params ["_patient", "_idPFH"]; + if (!(alive _patient)) exitWith { + [_idPFH] call CBA_fnc_removePerFrameHandler; + }; + _AlteplaseTarget = _AlteplaseTarget + 1; + if (_AlteplaseTarget > 24) exitWith { + [_idPFH] call CBA_fnc_removePerFrameHandler;}; + private _bloodlevels = GET_BODY_FLUID(_patient); + _bloodlevels set [0, (_bloodlevels select 0) - 50]; + _patient setVariable [QEGVAR(circulation,bodyFluid), _bloodlevels, true]; + private _coagulationFactor = (_patient getVariable [QGVAR(coagulationFactor), 30]); + private _factorstoremove = 2; + _patient setVariable [QGVAR(coagulationFactor), (_coagulationFactor - _factorstoremove), true]; + }, 15, [_patient]] call CBA_fnc_addPerFrameHandler; +}, _patient, 15] call CBA_fnc_waitAndExecute; diff --git a/addons/pharma/functions/fnc_treatmentAdvanced_AmiodaroneLocal.sqf b/addons/pharma/functions/fnc_treatmentAdvanced_AmiodaroneLocal.sqf index 04073ee61..40920f1a5 100644 --- a/addons/pharma/functions/fnc_treatmentAdvanced_AmiodaroneLocal.sqf +++ b/addons/pharma/functions/fnc_treatmentAdvanced_AmiodaroneLocal.sqf @@ -1,6 +1,6 @@ #include "..\script_component.hpp" /* - * Author: Mazinski.H, Edited by MiszczuZPolski + * Author: Mazinski.H, Edited by MiszczuZPolski and Cplhardcore * Applies Bradycardia randomly * * Arguments: @@ -14,10 +14,10 @@ * * Public: No */ - params ["_patient"]; private _random = random 3; if (_random <= 1) then { - [_patient, "BRADYCARDIA", 120, 1200, -40, 0, 0] call ACEFUNC(medical_status,addMedicationAdjustment); + private _hrAdjust = -50 + floor random ((-30 - -50) + 1); + [_patient, "BRADYCARDIA", 120, 1200, _hrAdjust, "", "", "", "", ""] call EFUNC(vitals,addMedicationAdjustment); }; diff --git a/addons/pharma/functions/fnc_treatmentAdvanced_AmiodaroneOverdoseLocal.sqf b/addons/pharma/functions/fnc_treatmentAdvanced_AmiodaroneOverdoseLocal.sqf new file mode 100644 index 000000000..adc3a79b8 --- /dev/null +++ b/addons/pharma/functions/fnc_treatmentAdvanced_AmiodaroneOverdoseLocal.sqf @@ -0,0 +1,20 @@ +#include "..\script_component.hpp" +/* + * Author: Mazinski.H, Edited by MiszczuZPolski and Cplhardcore + * Handles the overdose effect Amiodarone + * + * Arguments: + * 0: Patient + * + * Return Value: + * None + * + * Example: + * [cursorTarget] call kat_pharma_fnc_treatmentAdvanced_AmiodaroneOverdoseLocal; + * + * Public: No + */ +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); diff --git a/addons/pharma/functions/fnc_treatmentAdvanced_AtropineLocal.sqf b/addons/pharma/functions/fnc_treatmentAdvanced_AtropineLocal.sqf index 478cd95ff..f5d98b333 100644 --- a/addons/pharma/functions/fnc_treatmentAdvanced_AtropineLocal.sqf +++ b/addons/pharma/functions/fnc_treatmentAdvanced_AtropineLocal.sqf @@ -1,7 +1,7 @@ #include "..\script_component.hpp" /* * Author: Mazinski.H - * Locates and Removes Bradycardia Effect. + * * * Arguments: * 0: Patient @@ -10,21 +10,9 @@ * None * * Example: - * [player] call kat_pharma_fnc_treatmentAdvanced_AtropineLocal; + * [player, syringe_atropine_5ml_2] call kat_pharma_fnc_treatmentAdvanced_AtropineLocal; * * Public: No */ -params ["_patient"]; - -private _medicationArray = _patient getVariable [QACEGVAR(medical,medications), []]; - -{ - _x params ["_medication"]; - - if (_medication isEqualTo "BRADYCARDIA") exitWith { - _medicationArray deleteAt (_medicationArray find _x); - }; -} forEach (_medicationArray); - -_patient setVariable [QACEGVAR(medical,medications), _medicationArray, true]; +params ["_patient", "_classname"]; diff --git a/addons/pharma/functions/fnc_treatmentAdvanced_AtropineOverdoseLocal.sqf b/addons/pharma/functions/fnc_treatmentAdvanced_AtropineOverdoseLocal.sqf new file mode 100644 index 000000000..83f6a8387 --- /dev/null +++ b/addons/pharma/functions/fnc_treatmentAdvanced_AtropineOverdoseLocal.sqf @@ -0,0 +1,76 @@ +#include "..\script_component.hpp" +/* + * Author: Mazinski.H + * Locates and Removes Bradycardia Effect. + * + * Arguments: + * 0: Patient + * + * Return Value: + * None + * + * Example: + * [player, syringe_atropine_5ml_2] call kat_pharma_fnc_treatmentAdvanced_AtropineOverdoseLocal; + * + * Public: No + */ +params ["_patient"]; +[{ + params ["_patient"]; + private _atropineOverdoseTarget = 0; + [{ + params ["_patient", "_idPFH"]; + if (!(alive _patient)) exitWith { + [_idPFH] call CBA_fnc_removePerFrameHandler; + }; + _atropineOverdoseTarget = _atropineOverdoseTarget + 1; + if (_atropineOverdoseTarget > 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 "atropineOD"}) == -1) then { + _ht pushBack "atropineOD"; + + 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; +private _medStack = [_patient, false] call ACEFUNC(medical_treatment,getAllMedicationCount); +private _medIndex = _medStack find "Atropine"; +private _hasMed = false; +if (_medIndex > -1) then { + private _medCount = _medStack select (_medIndex + 1); + _hasMed = (_medCount > 0); +}; +[_hasmed, {}, { + params ["_patient"]; + private _atropineTarget = 0; + [{ + params ["_patient", "_idPFH"]; + if (!(alive _patient)) exitWith { + [_idPFH] call CBA_fnc_removePerFrameHandler; + }; + _atropineTarget = _atropineTarget + 1; + if (_atropineTarget > 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, 0] call CBA_fnc_waitUntilAndExecute; diff --git a/addons/pharma/functions/fnc_treatmentAdvanced_CWMPOverdoseLocal.sqf b/addons/pharma/functions/fnc_treatmentAdvanced_CWMPOverdoseLocal.sqf new file mode 100644 index 000000000..ce0d00ee9 --- /dev/null +++ b/addons/pharma/functions/fnc_treatmentAdvanced_CWMPOverdoseLocal.sqf @@ -0,0 +1,60 @@ +#include "..\script_component.hpp" +/* + * Author: Cplhardcore + * Begins CWMP Treatment + * + * Arguments: + * 0: patient + * + * Return Value: + * None + * + * Example: + * [player] call kat_pharma_fnc_treatmentAdvanced_CWMPOverdoseLocal; + * + * Public: No + */ +params ["_patient"]; +[_patient, "CWMPOverdose", 30, 600, "", "", "", 0.3, "", ""] call EFUNC(vitals,addMedicationAdjustment); +if GVAR(kidneyAction) then + {[ + { + params ["_patient"]; + private _kidneyTarget = 0; + [{ + params ["_patient", "_idPFH"]; + if (!(alive _patient)) exitWith { + [_idPFH] call CBA_fnc_removePerFrameHandler; + }; + _kidneyTarget = _kidneyTarget + 1; + if (_kidneyTarget > 12) exitWith { + [_idPFH] call CBA_fnc_removePerFrameHandler;}; + private _ph = _patient getVariable [QGVAR(externalPh), _ph, true] + 100; + _patient setVariable [QGVAR(externalPh), _ph, true]; + }, 10, [_patient]] call CBA_fnc_addPerFrameHandler; + }, _patient, 15] call CBA_fnc_waitAndExecute; +}; +private _medStack = [_patient, false] call ACEFUNC(medical_treatment,getAllMedicationCount); +private _medIndex = _medStack find "CWMP"; +private _hasMed = false; +if (_medIndex > -1) then { + private _medCount = _medStack select (_medIndex + 1); + _hasMed = (_medCount > 0); +}; +[_hasmed, {}, { + params ["_patient"]; + private _bpTarget = 0; + [{ + params ["_patient", "_idPFH"]; + if (!(alive _patient)) exitWith { + [_idPFH] call CBA_fnc_removePerFrameHandler; + }; + _bpTarget = _bpTarget + 1; + 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_waitUntilAndExecute; \ No newline at end of file diff --git a/addons/pharma/functions/fnc_treatmentAdvanced_CaffeineOverdoseLocal.sqf b/addons/pharma/functions/fnc_treatmentAdvanced_CaffeineOverdoseLocal.sqf new file mode 100644 index 000000000..10718f427 --- /dev/null +++ b/addons/pharma/functions/fnc_treatmentAdvanced_CaffeineOverdoseLocal.sqf @@ -0,0 +1,57 @@ +#include "..\script_component.hpp" +/* + * Author: Cplhardcore + * + * Arguments: + * 0: Patient + * + * Return Value: + * None + * + * Example: + * [player] call kat_pharma_fnc_treatmentAdvanced_CaffeineOverdoseLocal; + * + * Public: No + */ +params ["_patient"]; +[{ + params ["_patient"]; + private _CaffineOverdoseTarget = 0; + [{ + params ["_patient", "_idPFH"]; + if (!(alive _patient)) exitWith { + [_idPFH] call CBA_fnc_removePerFrameHandler; + }; + _CaffineOverdoseTarget = _CaffineOverdoseTarget + 1; + if (_CaffineOverdoseTarget > 12) exitWith { + [_idPFH] call CBA_fnc_removePerFrameHandler; + }; + private _hr = _patient getVariable [VAR_HEART_RATE, 80]; + private _hrAdd = (_hr + 3); + _patient setVariable [VAR_HEART_RATE, _hrAdd, true]; + }, 10, [_patient]] call CBA_fnc_addPerFrameHandler; +}, _patient, 10] call CBA_fnc_waitAndExecute; +private _medStack = [_patient, false] call ACEFUNC(medical_treatment,getAllMedicationCount); +private _medIndex = _medStack find "Caffeine"; +private _hasMed = false; +if (_medIndex > -1) then { + private _medCount = _medStack select (_medIndex + 1); + _hasMed = (_medCount > 0); +}; +[_hasmed, {}, { + params ["_patient"]; + private _CaffineOverdoseTarget = 0; + [{ + params ["_patient", "_idPFH"]; + if (!(alive _patient)) exitWith { + [_idPFH] call CBA_fnc_removePerFrameHandler; + }; + _CaffineOverdoseTarget = _CaffineOverdoseTarget + 1; + if (_CaffineOverdoseTarget > 12) exitWith { + [_idPFH] call CBA_fnc_removePerFrameHandler; + }; + private _hr = _patient getVariable [VAR_HEART_RATE, 80]; + private _hrAdd = (_hr - 3); + _patient setVariable [VAR_HEART_RATE, _hrAdd, true]; + }, 10, [_patient]] call CBA_fnc_addPerFrameHandler; +}, _patient, 150] call CBA_fnc_waitUntilAndExecute; \ No newline at end of file diff --git a/addons/pharma/functions/fnc_treatmentAdvanced_CarbonateOverdoseLocal.sqf b/addons/pharma/functions/fnc_treatmentAdvanced_CarbonateOverdoseLocal.sqf new file mode 100644 index 000000000..da0eaf421 --- /dev/null +++ b/addons/pharma/functions/fnc_treatmentAdvanced_CarbonateOverdoseLocal.sqf @@ -0,0 +1,52 @@ +#include "..\script_component.hpp" +/* + * Author: Cplhardcore + * Checks for Carbonate Wakeup values to restore consciousness + * + * Arguments: + * 1: Patient + * + * Return Value: + * None + *` + * Example: + * [player, cursorTarget] call kat_pharma_fnc_treatmentAdvanced_CarbonateOverdoseLocal; + * + * Public: No + */ +params ["_patient"]; +[{ + params ["_patient"]; + private _CarbonateOverdoseTarget = 0; + [{ + params ["_patient", "_idPFH"]; + if (!(alive _patient)) exitWith { + [_idPFH] call CBA_fnc_removePerFrameHandler; + }; + _CarbonateOverdoseTarget = _CarbonateOverdoseTarget + 1; + if (_CarbonateOverdoseTarget > 18) exitWith { + [_idPFH] call CBA_fnc_removePerFrameHandler; + }; + private _hr = _patient getVariable [VAR_HEART_RATE, 80]; + private _hrAdd = (_hr + 1); + _patient setVariable [VAR_HEART_RATE, _hrAdd, true]; + }, 10, [_patient]] call CBA_fnc_addPerFrameHandler; +}, _patient, 10] call CBA_fnc_waitAndExecute; +[{ + params ["_patient"]; + private _CarbonateOverdoseTarget = 0; + [{ + params ["_patient", "_idPFH"]; + if (!(alive _patient)) exitWith { + [_idPFH] call CBA_fnc_removePerFrameHandler; + }; + _CarbonateOverdoseTarget = _CarbonateOverdoseTarget + 1; + if (_CarbonateOverdoseTarget > 18) exitWith { + [_idPFH] call CBA_fnc_removePerFrameHandler; + }; + private _hr = _patient getVariable [VAR_HEART_RATE, 80]; + private _hrAdd = (_hr - 2); + _patient setVariable [VAR_HEART_RATE, _hrAdd, true]; + }, 10, [_patient]] call CBA_fnc_addPerFrameHandler; +}, _patient, 150] call CBA_fnc_waitAndExecute; + diff --git a/addons/pharma/functions/fnc_treatmentAdvanced_EACALocal.sqf b/addons/pharma/functions/fnc_treatmentAdvanced_EACALocal.sqf index 2a815a6df..6ad9bb210 100644 --- a/addons/pharma/functions/fnc_treatmentAdvanced_EACALocal.sqf +++ b/addons/pharma/functions/fnc_treatmentAdvanced_EACALocal.sqf @@ -21,7 +21,16 @@ params ["_patient", "_bodyPart"]; private _partIndex = ALL_BODY_PARTS find toLower _bodyPart; private _IVarray = _patient getVariable [QGVAR(IV), [0,0,0,0,0,0]]; private _IVactual = _IVarray select _partIndex; -private _countEACA = [_patient, "EACA"] call ACEFUNC(medical_status,getMedicationCount); +private _medStack = [_patient, false] call ACEFUNC(medical_treatment,getAllMedicationCount); +private _medsToCheck = ["EACA"]; +private _eacaEffectiveness = 0; +{ + private _medName = toLower (_x select 0); + private _effectiveness = _x select 2; + if ("EACA" in _medName) then { + _eacaEffectiveness = _eacaEffectiveness max _effectiveness; + }; +} forEach _medStack; private _allowStack = missionNamespace getVariable [QGVAR(allowStackScript_EACA), true]; private _keepRunning = missionNamespace getVariable [QGVAR(keepScriptRunning_EACA), false]; private _cycleTime = missionNamespace getVariable [QGVAR(bandageCycleTime_EACA), 5]; @@ -29,27 +38,27 @@ private _cycleTime = missionNamespace getVariable [QGVAR(bandageCycleTime_EACA), if (_IVactual > 1) then { private _randomNumber = random 100; - if (_IVactual != 4) exitWith { + if (_IVactual != 8) exitWith { if (_randomNumber < GVAR(blockChance)) then { [{ params ["_patient", "_IVarray", "_partIndex"]; - if (_IVactual > 1 && _IVactual != 4) exitWith {}; - _IVarray set [_partIndex, 3]; + if (_IVactual > 1 && _IVactual != 8) exitWith {}; + _IVarray set [_partIndex, 7]; _patient setVariable [QGVAR(IV), _IVarray, true]; }, [_patient, _IVarray, _partIndex], (random 300)] call CBA_fnc_waitAndExecute; }; }; - _IVarray set [_partIndex, 2]; + _IVarray set [_partIndex, 6]; _patient setVariable [QGVAR(IV), _IVarray, true]; }; if (!(GVAR(coagulation)) || GVAR(coagulation_allow_EACA_script)) then { - if (_IVactual != 3) then { - if (_countEACA > 1 && !(_allowStack)) exitWith {}; + if (_IVactual != 7) then { + if (_eacaEffectiveness > 0.3)&& !(_allowStack) exitWith {}; [{ params ["_args", "_idPFH"]; diff --git a/addons/pharma/functions/fnc_treatmentAdvanced_EACAOverdoseLocal.sqf b/addons/pharma/functions/fnc_treatmentAdvanced_EACAOverdoseLocal.sqf new file mode 100644 index 000000000..0a59ab7a0 --- /dev/null +++ b/addons/pharma/functions/fnc_treatmentAdvanced_EACAOverdoseLocal.sqf @@ -0,0 +1,57 @@ +#include "..\script_component.hpp" +/* + * Author: Cplhardcore + * Handles the overdose effect of EACA + * + * Arguments: + * 0: Patient + * + * + * Return Value: + * None + * + * Example: + * [_patient] call kat_pharma_fnc_treatmentAdvanced_EACAOverdoseLocal; + * + * Public: No + */ +params ["_patient"]; +[_patient, EACAOverdose, 1, 900, "", "", -90, -0.3, "", ""] call EFUNC(vitals,addMedicationAdjustment); +[{ + params ["_patient"]; + private _EACAOverdoseTarget = 0; + [{ + params ["_patient", "_idPFH"]; + if (!(alive _patient)) exitWith { + [_idPFH] call CBA_fnc_removePerFrameHandler; + }; + _EACAOverdoseTarget = _EACAOverdoseTarget + 1; + if (_EACAOverdoseTarget > 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 "eacaOD"}) == -1) then { + _ht pushBack "eacaOD"; + 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 _surface = (_patient getVariable [QEGVAR(breathing,lungSurfaceArea), 400]); + if (_surface < 150) then { + } else { + private _surfaceArea = _surface - 10; + _patient setVariable [QEGVAR(breathing,lungSurfaceArea), _surfaceArea]; + }; + private _coagulationFactor = (_patient getVariable [QGVAR(coagulationFactor), 30]); + private _factorstoremove = 1; + _patient setVariable [QGVAR(coagulationFactor), (_coagulationFactor - _factorstoremove), true]; + if ((random 10000) < 1) then {_patient setDamage 1;}; + }, 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_EpinephrineOverdoseLocal.sqf b/addons/pharma/functions/fnc_treatmentAdvanced_EpinephrineOverdoseLocal.sqf new file mode 100644 index 000000000..ba1c1830e --- /dev/null +++ b/addons/pharma/functions/fnc_treatmentAdvanced_EpinephrineOverdoseLocal.sqf @@ -0,0 +1,26 @@ +#include "..\script_component.hpp" +/* + * Author: Cplhardcore + * Local function for Epi Overdose + * + * Arguments: + * 0: Patient + * 1: Body Part + * + * Return Value: + * None + * + * Example: + * [_patient] call kat_pharma_fnc_treatmentAdvanced_EpinephrineOverdoseLocal; + * + * Public: No + */ + +params ["_patient"]; +private _hrAdjust = 30 + floor random ((60 - 30) + 1); +[_patient, "TACHYCARDIA", 30, 1200, _hrAdjust, "", "", "", "", ""] call EFUNC(vitals,addMedicationAdjustment); +if (random 10 < 1) then { + private _randomValue = [3, 4]; + private _randomRhythm = selectRandom _randomValue; + _patient setVariable [QEGVAR(circulation,cardiacArrestType), _randomRhythm]; +}; \ No newline at end of file diff --git a/addons/pharma/functions/fnc_treatmentAdvanced_EtomidateOverdoseLocal.sqf b/addons/pharma/functions/fnc_treatmentAdvanced_EtomidateOverdoseLocal.sqf new file mode 100644 index 000000000..7e02e6a68 --- /dev/null +++ b/addons/pharma/functions/fnc_treatmentAdvanced_EtomidateOverdoseLocal.sqf @@ -0,0 +1,186 @@ +#include "..\script_component.hpp" +/* + * Author: Cplhardcore + * Handles the overdose effect of Etomidate + * + * Arguments: + * 0: Patient + * + * Return Value: + * None + * + * Example: + * [player] call kat_pharma_fnc_treatmentAdvanced_EtomidateOverdoseLocal; + * + * Public: No + */ +params ["_patient"]; +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 _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) < 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 _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); + [{ + 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 4: { + 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 diff --git a/addons/pharma/functions/fnc_treatmentAdvanced_FentanylOverdoseLocal.sqf b/addons/pharma/functions/fnc_treatmentAdvanced_FentanylOverdoseLocal.sqf new file mode 100644 index 000000000..74f9d7b0d --- /dev/null +++ b/addons/pharma/functions/fnc_treatmentAdvanced_FentanylOverdoseLocal.sqf @@ -0,0 +1,51 @@ +#include "..\script_component.hpp" +/* + * Author: Cplhardcore + * Handles the overdose effect of Fentanyl + * + * Arguments: + * 0: Patient + * + * Return Value: + * None + * + * Example: + * [player] call kat_pharma_fnc_treatmentAdvanced_FentanylOverdoseLocal; + * + * Public: No + */ +params ["_patient"]; +private _bpAdjust = -30 + floor random ((-15 - -30) + 1); +[_patient, _bpAdjust, _bpAdjust, "fentanylOverdose"] call kat_circulation_fnc_updateBloodPressureChange; +private _hrAdjust = -50 + floor random ((-30 - -50) + 1); +[_patient, "fentanylOverdose", 120, 1200, _hrAdjust, "", "", "", "", ""] call EFUNC(vitals,addMedicationAdjustment); +[{ + params ["_patient"]; + private _fentanylOverdoseTarget = 0; + [{ + params ["_patient", "_idPFH"]; + if (!(alive _patient)) exitWith { + [_idPFH] call CBA_fnc_removePerFrameHandler; + }; + _fentanylOverdoseTarget = _fentanylOverdoseTarget + 1; + if (_fentanylOverdoseTarget > 6) exitWith { + [{ + params ["_args", "_idPFH"]; + _args params ["_patient"]; + private _ht = _patient getVariable [QEGVAR(circulation,ht), []]; + if ((_ht findIf {_x isEqualTo "opioidOD"}) == -1) then { + _ht pushBack "opioidOD"; + 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], 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,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..782d3fdd4 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"} != -1) 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 new file mode 100644 index 000000000..2f6611d65 --- /dev/null +++ b/addons/pharma/functions/fnc_treatmentAdvanced_FlumazenilOverdoseLocal.sqf @@ -0,0 +1,30 @@ +#include "..\script_component.hpp" +/* + * Author: MiszczuZPolski + * Begins Flumazenil unsedating process + * + * Arguments: + * 0: Patient + * + * Return Value: + * None + * + * Example: + * [player] call kat_pharma_fnc_treatmentAdvanced_FlumazenilOverdoseLocal; + * + * Public: No + */ +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_FlushLocal.sqf b/addons/pharma/functions/fnc_treatmentAdvanced_FlushLocal.sqf index 5ffaf00f9..8043d2004 100644 --- a/addons/pharma/functions/fnc_treatmentAdvanced_FlushLocal.sqf +++ b/addons/pharma/functions/fnc_treatmentAdvanced_FlushLocal.sqf @@ -23,7 +23,7 @@ private _partIndex = ALL_BODY_PARTS find toLower _bodyPart; private _IVarray = _patient getVariable [QGVAR(IV), [0,0,0,0,0,0]]; private _IVactual = _IVarray select _partIndex; -_IVarray set [_partIndex, 4]; +_IVarray set [_partIndex, 8]; _patient setVariable [QGVAR(IV), _IVarray, true]; private _occludedMedications = _patient getVariable [QACEGVAR(medical,occludedMedications), []]; diff --git a/addons/pharma/functions/fnc_treatmentAdvanced_KetamineLocal.sqf b/addons/pharma/functions/fnc_treatmentAdvanced_KetamineLocal.sqf new file mode 100644 index 000000000..4db378c33 --- /dev/null +++ b/addons/pharma/functions/fnc_treatmentAdvanced_KetamineLocal.sqf @@ -0,0 +1,28 @@ +#include "..\script_component.hpp" +/* + * Author: Cplhardcore + * Sedates the patient + * + * Arguments: + * 0: Patient + * 1: bodypart + * 2 classname + * + * Return Value: + * None + * + * Example: + * [player, leftLeg, syringe_ketamine_5ml_3] call kat_pharma_fnc_treatmentAdvanced_ketamineLocal; + * + * Public: No + */ + +params ["_patient", "_bodyPart", "_classname"]; +if !(_classname isEqualTo "syringe_ketamine_5ml_3") exitWith {}; + +_patient setVariable [QEGVAR(surgery,sedated), true, true]; +[_patient, true] call ACEFUNC(medical,setUnconscious); + +[{ + _patient setVariable ["kat_surgery_sedated", false, true]; +}, 30] call CBA_fnc_waitAndExecute; diff --git a/addons/pharma/functions/fnc_treatmentAdvanced_KetamineOverdoseLocal.sqf b/addons/pharma/functions/fnc_treatmentAdvanced_KetamineOverdoseLocal.sqf new file mode 100644 index 000000000..1131b93d6 --- /dev/null +++ b/addons/pharma/functions/fnc_treatmentAdvanced_KetamineOverdoseLocal.sqf @@ -0,0 +1,50 @@ +#include "..\script_component.hpp" +/* + * Author: Cplhardcore + * Handles the overdose effect of Ketamine + * + * Arguments: + * 0: Patient + * + * Return Value: + * None + * + * Example: + * [player] call kat_pharma_fnc_treatmentAdvanced_KetamineOverdoseLocal; + * + * Public: No + */ +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 new file mode 100644 index 000000000..11e00b911 --- /dev/null +++ b/addons/pharma/functions/fnc_treatmentAdvanced_LidocaineOverdoseLocal.sqf @@ -0,0 +1,54 @@ +#include "..\script_component.hpp" +/* + * Author: Cplhardcore + * Handles the overdose effect of Lidocaine + * + * Arguments: + * 0: Patient + * + * Return Value: + * None + * + * Example: + * [player] call kat_pharma_fnc_treatmentAdvanced_LidocaineOverdoseLocal; + * + * 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), []]; + 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_LorazepamLocal.sqf b/addons/pharma/functions/fnc_treatmentAdvanced_LorazepamLocal.sqf index 52e9e9db3..640329672 100644 --- a/addons/pharma/functions/fnc_treatmentAdvanced_LorazepamLocal.sqf +++ b/addons/pharma/functions/fnc_treatmentAdvanced_LorazepamLocal.sqf @@ -19,7 +19,9 @@ params ["_patient"]; private _random = random 3; if (_random <= 1) then { - [_patient, "BRADYCARDIA", 120, 1200, -40, 0, 0] call ACEFUNC(medical_status,addMedicationAdjustment); + private _hrValue = [-40, -30, -50]; + private _hrAdjust = selectRandom _hrValue; + [_patient, "BRADYCARDIA", 120, 1200, _hrAdjust, 0, 0, "", "", ""] call EFUNC(vitals,addMedicationAdjustment); }; _patient setVariable [QEGVAR(surgery,sedated), true, true]; diff --git a/addons/pharma/functions/fnc_treatmentAdvanced_LorazepamOverdoseLocal.sqf b/addons/pharma/functions/fnc_treatmentAdvanced_LorazepamOverdoseLocal.sqf new file mode 100644 index 000000000..d1ce1f184 --- /dev/null +++ b/addons/pharma/functions/fnc_treatmentAdvanced_LorazepamOverdoseLocal.sqf @@ -0,0 +1,62 @@ +#include "..\script_component.hpp" +/* + * Author: Cplhardcore + * Handles the overdose effect of Lorazepam + * + * Arguments: + * 0: Patient + * + * Return Value: + * None + * + * Example: + * [player] call kat_pharma_fnc_treatmentAdvanced_LorazepamOverdoseLocal; + * + * 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 new file mode 100644 index 000000000..53fb20cd9 --- /dev/null +++ b/addons/pharma/functions/fnc_treatmentAdvanced_MorphineOverdoseLocal.sqf @@ -0,0 +1,51 @@ +#include "..\script_component.hpp" +/* + * Author: Cplhardcore + * Handles the overdose effect of Morphine + * + * Arguments: + * 0: Patient + * + * Return Value: + * None + * + * Example: + * [player] call kat_pharma_fnc_treatmentAdvanced_MorphineOverdoseLocal; + * + * Public: No + */ +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); +[_patient, "morphineOverdose", 120, 1200, _hrAdjust, "", "", "", "", ""] call EFUNC(vitals,addMedicationAdjustment); +[{ + params ["_patient"]; + private _morphineOverdoseTarget = 0; + [{ + params ["_patient", "_idPFH"]; + if (!(alive _patient)) exitWith { + [_idPFH] call CBA_fnc_removePerFrameHandler; + }; + _morphineOverdoseTarget = _morphineOverdoseTarget + 1; + if (_morphineOverdoseTarget > 6) exitWith { + [{ + params ["_args", "_idPFH"]; + _args params ["_patient"]; + private _ht = _patient getVariable [QEGVAR(circulation,ht), []]; + if ((_ht findIf {_x isEqualTo "opioidOD"}) == -1) then { + _ht pushBack "opioidOD"; + 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], 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,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 new file mode 100644 index 000000000..6906ed505 --- /dev/null +++ b/addons/pharma/functions/fnc_treatmentAdvanced_NalbuphineOverdoseLocal.sqf @@ -0,0 +1,52 @@ +#include "..\script_component.hpp" +/* + * Author: Cplhardcore + * Handles the overdose effect of Nalbuphine + * + * Arguments: + * 0: Patient + * + * Return Value: + * None + * + * Example: + * [player] call kat_pharma_fnc_treatmentAdvanced_NalbuphineOverdoseLocal; + * + * Public: No + */ +params ["_patient"]; +params ["_patient"]; +private _bpAdjust = -30 + floor random ((-15 - -30) + 1); +[_patient, _bpAdjust, _bpAdjust, "nalbuphineOverdose"] call kat_circulation_fnc_updateBloodPressureChange; +private _hrAdjust = -50 + floor random ((-30 - -50) + 1); +[_patient, "nalbuphineOverdose", 120, 1200, _hrAdjust, "", "", "", "", ""] call EFUNC(vitals,addMedicationAdjustment); +[{ + params ["_patient"]; + private _nalbuphineOverdoseTarget = 0; + [{ + params ["_patient", "_idPFH"]; + if (!(alive _patient)) exitWith { + [_idPFH] call CBA_fnc_removePerFrameHandler; + }; + _nalbuphineOverdoseTarget = _nalbuphineOverdoseTarget + 1; + if (_nalbuphineOverdoseTarget > 6) exitWith { + [{ + params ["_args", "_idPFH"]; + _args params ["_patient"]; + private _ht = _patient getVariable [QEGVAR(circulation,ht), []]; + if ((_ht findIf {_x isEqualTo "opioidOD"}) == -1) then { + _ht pushBack "opioidOD"; + 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], 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,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_NaloxoneLocal.sqf b/addons/pharma/functions/fnc_treatmentAdvanced_NaloxoneLocal.sqf index 7bfb9f37c..9e9eb6765 100644 --- a/addons/pharma/functions/fnc_treatmentAdvanced_NaloxoneLocal.sqf +++ b/addons/pharma/functions/fnc_treatmentAdvanced_NaloxoneLocal.sqf @@ -18,12 +18,28 @@ params ["_patient"]; private _medicationArray = _patient getVariable [QACEGVAR(medical,medications), []]; +private _medicationDeleted = false; { _x params ["_medication"]; - if (_medication isEqualTo "Morphine" || _medication isEqualTo "Fentanyl" || _medication isEqualTo "Nalbuphine") then { - _medicationArray deleteAt (_medicationArray find _x); + private _lowerMed = toLower _medication; + if ( + (_lowerMed find "morphine" != -1) || + (_lowerMed find "morphineOverdose" != -1) || + (_lowerMed find "fentanyl" != -1) || + (_lowerMed find "fentanylOverdose" != -1) || + (_lowerMed find "nalbuphine" != -1) || + (_lowerMed find "nalbuphineOverdose" != -1) + ) then { + if (random 1 < 0.33) then { + _medicationArray deleteAt (_medicationArray find _x); + _medicationDeleted = true; + _patient setVariable [QEGVAR(pharma,opioidFactor), 1]; + }; }; + + if (_medicationDeleted) exitWith {}; + } forEach _medicationArray; -_patient setVariable [QACEGVAR(medical,medications), _medicationArray, true]; +_patient setVariable [QACEGVAR(medical,medications), _medicationArray, true]; \ No newline at end of file diff --git a/addons/pharma/functions/fnc_treatmentAdvanced_NaloxoneOverdoseLocal.sqf b/addons/pharma/functions/fnc_treatmentAdvanced_NaloxoneOverdoseLocal.sqf new file mode 100644 index 000000000..bca14bb6d --- /dev/null +++ b/addons/pharma/functions/fnc_treatmentAdvanced_NaloxoneOverdoseLocal.sqf @@ -0,0 +1,17 @@ +#include "..\script_component.hpp" +/* + * Author: Cplhardcore + * Handles the overdose effect of Naloxone. + * + * Arguments: + * 0: Patient + * + * Return Value: + * None + * + * Example: + * [player] call kat_pharma_fnc_treatmentAdvanced_NaloxoneOverdoseLocal; + * + * Public: No + */ +params ["_patient"]; diff --git a/addons/pharma/functions/fnc_treatmentAdvanced_NitroglycerinOverdoseLocal.sqf b/addons/pharma/functions/fnc_treatmentAdvanced_NitroglycerinOverdoseLocal.sqf new file mode 100644 index 000000000..87362c55c --- /dev/null +++ b/addons/pharma/functions/fnc_treatmentAdvanced_NitroglycerinOverdoseLocal.sqf @@ -0,0 +1,24 @@ +#include "..\script_component.hpp" +/* + * Author: Cplhardcore + * Handles the overdose effect of Nitroglycerin. + * + * Arguments: + * 0: Patient + * + * Return Value: + * None + * + * Example: + * [player] call kat_pharma_fnc_treatmentAdvanced_NitroglycerinOverdoseLocal; + * + * Public: No + */ +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 new file mode 100644 index 000000000..57a63abce --- /dev/null +++ b/addons/pharma/functions/fnc_treatmentAdvanced_NorepinephrineLocal.sqf @@ -0,0 +1,17 @@ +#include "..\script_component.hpp" +/* + * Author: Cplhardcore + * + * + * Arguments: + * 0: Patient + * + * Return Value: + * None + * + * Example: + * [player] call kat_pharma_fnc_treatmentAdvanced_NorepinephrineLocal; + * + * Public: No + */ +params ["_patient"]; diff --git a/addons/pharma/functions/fnc_treatmentAdvanced_NorepinephrineOverdoseLocal.sqf b/addons/pharma/functions/fnc_treatmentAdvanced_NorepinephrineOverdoseLocal.sqf new file mode 100644 index 000000000..25ebd1b92 --- /dev/null +++ b/addons/pharma/functions/fnc_treatmentAdvanced_NorepinephrineOverdoseLocal.sqf @@ -0,0 +1,24 @@ +#include "..\script_component.hpp" +/* + * Author: Cplhardcore + * Applies Norepinephrine Overdose Effects + * + * Arguments: + * 0: Patient + * + * Return Value: + * None + * + * Example: + * [player] call kat_pharma_fnc_treatmentAdvanced_NorepinephrineOverdoseLocal; + * + * Public: No + */ + params ["_patient"]; +private _hrAdjust = 30 + floor random ((50 - 30) + 1); +[_patient, "TACHYCARDIA", 120, 1200, _hrAdjust, "", "", "", "", ""] call EFUNC(vitals,addMedicationAdjustment); +if (random 10 < 1) then { + private _randomValue = [3, 4]; + private _randomRhythm = selectRandom _randomValue; + _patient setVariable [QEGVAR(circulation,cardiacArrestType), _randomRhythm]; +}; \ No newline at end of file diff --git a/addons/pharma/functions/fnc_treatmentAdvanced_PenthroxOverdoseLocal.sqf b/addons/pharma/functions/fnc_treatmentAdvanced_PenthroxOverdoseLocal.sqf new file mode 100644 index 000000000..7bcd7a42f --- /dev/null +++ b/addons/pharma/functions/fnc_treatmentAdvanced_PenthroxOverdoseLocal.sqf @@ -0,0 +1,72 @@ +#include "..\script_component.hpp" +/* + * Author: Cplhardcore + * Handles the overdose effect of Penthrox + * + * Arguments: + * 0: Medic + * 1: Patient + * 2: Body Part + * 3: Treatment + * 4: Item User (not used) + * 5: Used Item + * + * Return Value: + * None + * + * Example: + * [player] call kat_pharma_fnc_treatmentAdvanced_PenthroxOverdoseLocal; + * + * Public: No + */ +params ["_patient"]; +[{ + params ["_patient"]; + private _PenthroxOverdoseTarget = 0; + [{ + params ["_patient", "_idPFH"]; + if (!(alive _patient)) exitWith { + [_idPFH] call CBA_fnc_removePerFrameHandler; + }; + _PenthroxOverdoseTarget = _PenthroxOverdoseTarget + 1; + if (_PenthroxOverdoseTarget > 6) exitWith { + [{ + if (random 25 < 1) then { + private _randomValue = [3, 4]; + private _randomRhythm = selectRandom _randomValue; + _patient setVariable [QEGVAR(circulation,cardiacArrestType), _randomRhythm]; + }; + }, [_patient], 20] call CBA_fnc_waitAndExecute; + [_idPFH] call CBA_fnc_removePerFrameHandler; + }; + private _surfaceArea = (_patient getVariable [QGVAR(lungSurfaceArea), 400]) - 5; + _patient setVariable [QGVAR(lungSurfaceArea), _surfaceArea]; + private _respRate = _patient getVariable [VAR_BREATHING_RATE, 15]; + _patient setVariable [VAR_BREATHING_RATE, (_respRate + 1), true]; + if ((random 1000) < 1) then {_patient setDamage 1;}; + }, 20, [_patient]] call CBA_fnc_addPerFrameHandler; +}, _patient, 20] call CBA_fnc_waitAndExecute; +private _medStack = [_patient, false] call ACEFUNC(medical_treatment,getAllMedicationCount); +private _medIndex = _medStack find "Penthrox"; +private _hasMed = false; +if (_medIndex > -1) then { + private _medCount = _medStack select (_medIndex + 1); + _hasMed = (_medCount > 0); +}; +[_hasmed, {}, { + params ["_patient"]; + private _PenthroxOverdoseTarget = 0; + [{ + params ["_patient", "_idPFH"]; + if (!(alive _patient)) exitWith { + [_idPFH] call CBA_fnc_removePerFrameHandler; + }; + _PenthroxOverdoseTarget = _PenthroxOverdoseTarget + 1; + if (_PenthroxOverdoseTarget > 6) exitWith { + [_idPFH] call CBA_fnc_removePerFrameHandler; + }; + private _surfaceArea = (_patient getVariable [QGVAR(lungSurfaceArea), 400]) + 5; + _patient setVariable [QGVAR(lungSurfaceArea), _surfaceArea]; + }, 60, [_patient]] call CBA_fnc_addPerFrameHandler; +}, _patient, 150] call CBA_fnc_waitUntilAndExecute; + diff --git a/addons/pharma/functions/fnc_treatmentAdvanced_PervitinOverdoseLocal.sqf b/addons/pharma/functions/fnc_treatmentAdvanced_PervitinOverdoseLocal.sqf new file mode 100644 index 000000000..16744f700 --- /dev/null +++ b/addons/pharma/functions/fnc_treatmentAdvanced_PervitinOverdoseLocal.sqf @@ -0,0 +1,52 @@ +#include "..\script_component.hpp" +/* + * Author: Cplhardcore + * Handles the overdose effect of Pervatin + * + * + * Arguments: + * 0: Patient + * + * Return Value: + * None + * + * Example: + * [player] call kat_pharma_fnc_treatmentAdvanced_PervitinOverdoseLocal; + * + * Public: No + */ +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/pharma/functions/fnc_treatmentAdvanced_PhenylephrineOverdoseLocal.sqf b/addons/pharma/functions/fnc_treatmentAdvanced_PhenylephrineOverdoseLocal.sqf new file mode 100644 index 000000000..6ae0171de --- /dev/null +++ b/addons/pharma/functions/fnc_treatmentAdvanced_PhenylephrineOverdoseLocal.sqf @@ -0,0 +1,27 @@ +#include "..\script_component.hpp" +/* + * Author: Cplhardcore + * Handles the overdose effect of Phenylephrine + * + * Arguments: + * 0: Patient + + * Return Value: + * None + * + * Example: + * [player] call kat_pharma_fnc_treatmentAdvanced_PhenylephrineOverdoseLocal; + * + * Public: No + */ +params ["_patient"]; +private _hrValue = [20, 25, 30, 35, 40, 45]; +private _hrAdjust = selectRandom _hrValue; +private _alphaValue = [-0.7, -0.6, -0.8]; +private _alphaAdjust = selectRandom _alphaValue; +[_patient, PhenylephrineOverdose, 30, 1200, _hrAdjust, "", "", _alphaAdjust, "", ""] call EFUNC(vitals,addMedicationAdjustment); +if (random 5 < 1) then { + private _randomValue = [3, 4]; + private _randomRhythm = selectRandom _randomValue; + _patient setVariable [QEGVAR(circulation,cardiacArrestType), _randomRhythm]; +}; \ No newline at end of file diff --git a/addons/pharma/functions/fnc_treatmentAdvanced_TXALocal.sqf b/addons/pharma/functions/fnc_treatmentAdvanced_TXALocal.sqf index c52d0a4be..ea55fa021 100644 --- a/addons/pharma/functions/fnc_treatmentAdvanced_TXALocal.sqf +++ b/addons/pharma/functions/fnc_treatmentAdvanced_TXALocal.sqf @@ -21,7 +21,16 @@ params ["_patient", "_bodyPart"]; private _partIndex = ALL_BODY_PARTS find toLower _bodyPart; private _IVarray = _patient getVariable [QGVAR(IV), [0,0,0,0,0,0]]; private _IVactual = _IVarray select _partIndex; -private _countTXA = [_patient, "TXA"] call ACEFUNC(medical_status,getMedicationCount); +private _medStack = [_patient, false] call ACEFUNC(medical_treatment,getAllMedicationCount); +private _medsToCheck = ["TXA"]; +private _txaEffectiveness = 0; +{ + private _medName = toLower (_x select 0); + private _effectiveness = _x select 2; + if ("TXA" in _medName) then { + _txaEffectiveness = _txaEffectiveness max _effectiveness; + }; +} forEach _medStack; private _allowStack = missionNamespace getVariable [QGVAR(allowStackScript_TXA), true]; private _keepRunning = missionNamespace getVariable [QGVAR(keepScriptRunning_TXA), false]; private _cycleTime = missionNamespace getVariable [QGVAR(bandageCycleTime_TXA), 5]; @@ -29,28 +38,28 @@ private _cycleTime = missionNamespace getVariable [QGVAR(bandageCycleTime_TXA), if (_IVactual > 1) then { private _randomNumber = random 100; - if (_IVactual != 4) exitWith { + if (_IVactual != 8) exitWith { if (_randomNumber < GVAR(blockChance)) then { [{ params["_patient", "_IVarray", "_partIndex"]; - if (_IVactual > 1 && _IVactual != 4) exitWith {}; - _IVarray set [_partIndex, 3]; + if (_IVactual > 1 && _IVactual != 8) exitWith {}; + _IVarray set [_partIndex, 7]; _patient setVariable [QGVAR(IV), _IVarray, true]; }, [_patient, _IVarray, _partIndex], (random 300)] call CBA_fnc_waitAndExecute; }; }; - _IVarray set [_partIndex, 2]; + _IVarray set [_partIndex, 6]; _patient setVariable [QGVAR(IV), _IVarray, true]; }; if (!(GVAR(coagulation)) || GVAR(coagulation_allow_TXA_script)) then { - if (_IVactual != 3) then { + if (_IVactual != 7) then { - if (_countTXA > 1 && !(_allowStack)) exitWith {}; + if ((_txaEffectiveness > 0.3) && !(_allowStack)) exitWith {}; [{ params ["_args", "_idPFH"]; diff --git a/addons/pharma/functions/fnc_treatmentAdvanced_TXAOverdoseLocal.sqf b/addons/pharma/functions/fnc_treatmentAdvanced_TXAOverdoseLocal.sqf new file mode 100644 index 000000000..7f2b47c17 --- /dev/null +++ b/addons/pharma/functions/fnc_treatmentAdvanced_TXAOverdoseLocal.sqf @@ -0,0 +1,60 @@ +#include "..\script_component.hpp" +/* + * Author: Cplhardcore + * Handles the overdose effect of TXA + * + * Arguments: + * 0: Medic + * + * Return Value: + * None + * + * Example: + * [player] call kat_pharma_fnc_treatmentAdvanced_TXAOverdoseLocal; + * + * Public: No + */ + +params ["_patient"]; + +[_patient, TXAOverdose, 1, 900, "", "", -90, -0.3, "", ""] call EFUNC(vitals,addMedicationAdjustment); +[{ + params ["_patient"]; + private _TXAOverdoseTarget = 0; + [{ + params ["_patient", "_idPFH"]; + if (!(alive _patient)) exitWith { + [_idPFH] call CBA_fnc_removePerFrameHandler; + }; + _TXAOverdoseTarget = _TXAOverdoseTarget + 1; + if (_TXAOverdoseTarget > 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 "txaOD"}) == -1) then { + _ht pushBack "txaOD"; + + 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 _surface = (_patient getVariable [QEGVAR(breathing,lungSurfaceArea), 400]); + if (_surface < 150) then { + } else { + private _surfaceArea = _surface - 10; + _patient setVariable [QEGVAR(breathing,lungSurfaceArea), _surfaceArea]; + }; + private _coagulationFactor = (_patient getVariable [QGVAR(coagulationFactor), 30]); + private _factorstoremove = 1; + _patient setVariable [QGVAR(coagulationFactor), (_coagulationFactor - _factorstoremove), true]; + if ((random 10000) < 1) then {_patient setDamage 1;}; + }, 15, [_patient]] call CBA_fnc_addPerFrameHandler; +}, _patient, 15] call CBA_fnc_waitAndExecute; diff --git a/addons/pharma/stringtable.xml b/addons/pharma/stringtable.xml index 6a6058359..608c5b3de 100644 --- a/addons/pharma/stringtable.xml +++ b/addons/pharma/stringtable.xml @@ -2,7 +2,7 @@ - Allow applying IV + Allow applying 16g IV Poziom wyszkolenia medycznego dla IV 允许使用IV Permetti utilizzo IV @@ -18,7 +18,7 @@ IV plaatsing niveau - Changes what medical level is required to set IVs + Changes what medical level is required to set 16 gauge IVs Benötigter medizinischer Grad, welcher für das Legen von IVs erforderlich ist Poziom wyszkolenia medycznego potrzebnego do założenia kaniul IV Niveau nécessaire pour poser une IV @@ -35,6 +35,18 @@ Muuttaa, mitä lääketieteen koulutustasoa tarvitaan IV:n lisäämiseen Bepaald welk medisch niveau benodigd is om IV's aan te kunnen leggen + + Allow applying 14g IV + + + Changes what medical level is required to set 14 gauge IVs + + + Allow applying 20g IV + + + Changes what medical level is required to set 20 gauge IVs + Allow applying IO Poziom wyszkolenia medycznego dla IO @@ -372,6 +384,12 @@ Amiodaroni Amiodaron + + Used to reverse TXA and EACA overdose + + + Alteplase + Push Amiodarone Amiodaron verabreichen @@ -445,7 +463,7 @@ Injecteer Lidocaïne - Used to treat chemical exposure + Used to treat chemical exposure and bradycardia Zur Behandlung von Bradykardie Używany do zwalczania bradykardii Utiliser pour traiter une bradycardie @@ -480,6 +498,9 @@ Atropiini Atropine autoinjector + + Atropine IV + Inject Atropine Atropin verabreichen @@ -498,6 +519,9 @@ Työnnä atropiinia Injecteer Atropine + + Inject Atropine IV + Encourages clot formation Fördert die Gerinnungsbildung @@ -923,6 +947,40 @@ 16g IV 16g IV + + 14g IV + 14g IV + 14g IV + 14g IV + 14g IV + 14g IV + 14g IV + 14g IV + 14g IV + 14g IV + 14g IV + 14g IV + 14r IV + 14g IV + 14g IV + + + 20g IV + 20g IV + 20g IV + 20g IV + 20g IV + 20g IV + 20g IV + 20g IV + 20g IV + 20g IV + 20g IV + 20g IV + 20r IV + 20g IV + 20g IV + Intravenous Needle Intravenöse Kanüle @@ -1844,6 +1902,12 @@ Время обработки для TXA Behandeltijd van TXA + + Medical level required for IM TXA + + + Treatment time for IM TXA + Medical level required for Norepinephrine Poziom wyszkolenia medycznego dla Noradrenaliny @@ -1972,6 +2036,12 @@ Время обработки Амиодароном Behandeltijd van Amiodaron + + Medical level required for Alteplase + + + Treatment time for Alteplase + Medical level required for Lidocaine Poziom wyszkolenia medycznego dla Lidokainy @@ -2004,6 +2074,12 @@ Время обработки Лидокаином Behandeltijd van Lidocaïne + + Medical level required for IM Lidocaine + + + Treatment time for IM Lidocaine + Medical level required for Atropine Poziom wyszkolenia medycznego dla Atropiny @@ -2036,6 +2112,12 @@ Время обратки Атропином Behandeltijd van Atropine + + Medical level required for Atropine IV + + + Treatment time for Atropine IV + Medical level required for EACA Poziom wyszkolenia medycznego dla EACA @@ -2196,6 +2278,12 @@ Время обработки Кетамином Behandeltijd van Ketamine + + Medical level required for IM Ketamine + + + Treatment time for IM Ketamine + Medical level required for Fentanyl Poziom wyszkolenia medycznego dla Fentanylu @@ -2228,6 +2316,12 @@ Время обработки Фентанилом Behandeltijd van Fentanyl + + Medical level required for IM Fentanyl + + + Treatment time for IM Fentanyl + Medical level required for Nalbuphine Poziom wyszkolenia medycznego dla Nalbuphinu @@ -2260,6 +2354,12 @@ Время обработки Налбуфином Behandeltijd van Nalbufine + + Medical level required for IM Nalbuphine + + + Treatment time for IM Nalbuphine + Medical level required for Penthrox Inhaler ペンスロックス吸入器の許可 @@ -2490,6 +2590,9 @@ Настройки Амиодарона Amiodaron instellingen + + Alteplase Settings + Lidocaine Settings Ustawienia Lidokainy @@ -3839,7 +3942,7 @@ Epinéphrine IV - IV Epinephrine + Epinephrine IV アドレナリン静脈注射 (IV) Epinefrina IV IV Adrenaline @@ -3852,5 +3955,635 @@ Injecteer IV Adrenaline Administrer l'épinéphrine + + 5ml Syringe + + + For IV medications + + + 10ml Syringe + + + For IM medications + + + 10ml Syringe/1g TXA + + + 10ml Syringe loaded with 1 gram of TXA + + + 10ml Syringe/2g TXA + + + 10ml Syringe loaded with 2 grams of TXA + + + 10ml Syringe/40mg Lidocaine + + + 10ml Syringe loaded with 40mg of Lidocaine + + + 10ml Syringe/25mg Ketamine + + + 10ml Syringe loaded with 25mg of Ketamine + + + 10ml Syringe/80mg Ketamine + + + 10ml Syringe loaded with 80mg of Ketamine + + + 10ml Syringe/40mcg Fentanyl + + + 10ml Syringe loaded with 40mcg of Fentanyl + + + 10ml Syringe/80mcg Fentanyl + + + 10ml Syringe loaded with 80mcg of Fentanyl + + + 10ml Syringe/10mg Nalbuphine + + + 10ml Syringe loaded with 10mg of Nalbuphine + + + 10ml Syringe/20mg Nalbuphine + + + 10ml Syringe loaded with 20mg of Nalbuphine + + + 5ml Syringe/150mcg Norepinephrine + + + 5ml Syringe loaded with 150mcg of Norepinephrine + + + 5ml Syringe/240mcg Norepinephrine + + + 5ml Syringe loaded with 240mcg of Norepinephrine + + + 5ml Syringe/100mcg Phenylephrine + + + 5ml Syringe loaded with 100mcg of Phenylephrine + + + 5ml Syringe/200mcg Phenylephrine + + + 5ml Syringe loaded with 200mcg of Phenylephrine + + + 5ml Syringe/50mcg Nitroglycerin + + + 5ml Syringe loaded with 50mcg of Nitroglycerin + + + 5ml Syringe/100mcg Nitroglycerin + + + 5ml Syringe loaded with 100mcg of Nitroglycerin + + + 5ml Syringe/150mg Amiodarone + + + 5ml Syringe loaded with 150mg of Amiodarone + + + 5ml Syringe/300mg Amiodarone + + + 5ml Syringe loaded with 300mg of Amiodarone + + + 5ml Syringe/50mg Alteplase + + + 5ml Syringe loaded with 50mg of Alteplase + + + 5ml Syringe/40mg Lidocaine + + + 5ml Syringe loaded with 40mg of Lidocaine + + + 5ml Syringe/80mg Lidocaine + + + 5ml Syringe loaded with 80mg of Lidocaine + + + 5ml Syringe/0.6mg Atropine + + + 5ml Syringe loaded with 0.6mg of Atropine + + + 5ml Syringe/2mg Atropine + + + 5ml Syringe loaded with 2mg of Atropine + + + 5ml Syringe/25mg Ketamine + + + 5ml Syringe loaded with 25mg of Ketamine + + + 5ml Syringe/80mg Ketamine + + + 5ml Syringe loaded with 80mg of Ketamine + + + 5ml Syringe/40mcg Fentanyl + + + 5ml Syringe loaded with 40mcg of Fentanyl + + + 5ml Syringe/80mcg Fentanyl + + + 5ml Syringe loaded with 80mcg of Fentanyl + + + 5ml Syringe/10mg Nalbuphine + + + 5ml Syringe loaded with 10mg of Nalbuphine + + + 5ml Syringe/20mg Nalbuphine + + + 5ml Syringe loaded with 20mg of Nalbuphine + + + 5ml Syringe/2.4mg Lorazepam + + + 5ml Syringe loaded with 2.4mg of Lorazepam + + + 5ml Syringe/4mg Lorazepam + + + 5ml Syringe loaded with 4mg of Lorazepam + + + 5ml Syringe/0.1mg Flumazenil + + + 5ml Syringe loaded with 0.1mg of Flumazenil + + + 5ml Syringe/0.2mg Flumazenil + + + 5ml Syringe loaded with 0.2mg of Flumazenil + + + 5ml Syringe/20mg Etomidate + + + 5ml Syringe loaded with 20mg of Etomidate + + + 5ml Syringe/30mg Etomidate + + + 5ml Syringe loaded with 30mg of Etomidate + + + 5ml Syringe/10mcg Epinephrine + + + 5ml Syringe loaded with 10mcg of Epinephrine + + + 5ml Syringe/1mg Epinephrine + + + 5ml Syringe loaded with 1mg of Epinephrine + + + 5ml Syringe/1g TXA + + + 5ml Syringe loaded with 1 gram of TXA + + + 5ml Syringe/2g TXA + + + 5ml Syringe loaded with 2 grams of TXA + + + 5ml Syringe/7.5g EACA + + + 5ml Syringe loaded with 7.5 grams of EACA + + + 5ml Syringe/15g EACA + + + 5ml Syringe loaded with 15 grams of EACA + + + 5ml Syringe/10mg Morphine + + + 5ml Syringe loaded with 10mg of Morphine + + + 5ml Syringe/20mg Morphine + + + 5ml Syringe loaded with 20mg of Morphine + + + 5ml Syringe/6mg Adenosine + + + 5ml Syringe loaded with 6 mg of Adenosine + + + 5ml Syringe/12mg Adenosine + + + 5ml Syringe loaded with 12mg of Adenosine + + + Push 1g TXA IV + + + Push 2g TXA IV + + + Push 7.5g EACA IV + + + Push 15g EACA IV + + + Pushing 1g TXA IV + + + Pushing 2g TXA IV + + + Pushing 7.5g EACA IV + + + Pushing 15g EACA IV + + + Pushing 10mg Morphine IV + + + Pushing 20mg Morphine IV + + + Push 150mg Norepinephrine IV + + + Push 240mg Norepinephrine IV + + + Push 100mcg Phenylephrine IV + + + Push 200mcg Phenylephrine IV + + + Push 50mcg Nitroglycerin IV + + + Push 100mcg Nitroglycerin IV + + + Push 150mg Amiodarone IV + + + Push 300mg Amiodarone IV + + + Push 50mg Alteplase IV + + + Push 40mg Lidocaine IV + + + Push 80mg Lidocaine IV + + + Push 0.6mg Atropine IV + + + Push 2mg Atropine IV + + + Push 25mg Ketamine IV + + + Push 80mg Ketamine IV + + + Push 40mcg Fentanyl IV + + + Push 80mcg Fentanyl IV + + + Push 10mg Nalbuphine IV + + + Push 20mg Nalbuphine IV + + + Push 2.4mg Lorazepam IV + + + Push 4mg Lorazepam IV + + + Push 0.1mg Flumazenil IV + + + Push 0.2mg Flumazenil IV + + + Push 0.2mg Etomidate IV + + + Push 0.3mg Etomidate IV + + + Push 10mcg Epinephrine IV + + + Push 1mg Epinephrine IV + + + Push 10mg Morphine IV + + + Push 20mg Morphine IV + + + Push 6mg Adenosine IV + + + Push 12mg Adenosine IV + + + Pushing 150mg Norepinephrine IV + + + Pushing 240mg Norepinephrine IV + + + Pushing 100mcg Phenylephrine IV + + + Pushing 200mcg Phenylephrine IV + + + Pushing 50mcg Nitroglycerin IV + + + Pushing 100mcg Nitroglycerin IV + + + Pushing 150mg Amiodarone IV + + + Pushing 300mg Amiodarone IV + + + Pushing 50mg Alteplase IV + + + Pushing 40mg Lidocaine IV + + + Pushing 80mg Lidocaine IV + + + Pushing 0.6mg Atropine IV + + + Pushing 2mg Atropine IV + + + Pushing 25mg Ketamine IV + + + Pushing 80mg Ketamine IV + + + Pushing 40mcg Fentanyl IV + + + Pushing 80mcg Fentanyl IV + + + Pushing 10mg Nalbuphine IV + + + Pushing 20mg Nalbuphine IV + + + Pushing 2.4mg Lorazepam IV + + + Pushing 4mg Lorazepam IV + + + Pushing 0.1mg Flumazenil IV + + + Pushing 0.2mg Flumazenil IV + + + Pushing 0.2mg Etomidate IV + + + Pushing 0.3mg Etomidate IV + + + Pushing 10mcg Epinephrine IV + + + Pushing 1mg Epinephrine IV + + + Pushing 6mg Adenosine IV + + + Pushing 12mg Adenosine IV + + + Inject 1g TXA IM + + + Inject 2g TXA IM + + + Inject 40mg Lidocaine IM + + + Inject 25mg Ketamine IM + + + Inject 80mg Ketamine IM + + + Inject 40mcg Fentanyl IM + + + Inject 80mcg Fentanyl IM + + + Inject 10mg Nalbuphine IM + + + Inject 20mg Nalbuphine IM + + + Inject 10mg Morphine IM + + + Inject 20mg Morphine IM + + + Injecting 1g TXA IM + + + Injecting 2g TXA IM + + + Injecting 10mg Morphine IM + + + Injecting 20mg Morphine IM + + + Injecting 40mg Lidocaine IM + + + Injecting 25mg Ketamine IM + + + Injecting 80mg Ketamine IM + + + Injecting 40mcg Fentanyl IM + + + Injecting 80mcg Fentanyl IM + + + Injecting 10mg Nalbuphine IM + + + Injecting 20mg Nalbuphine IM + + + 10ml Syringe/10mg Morphine + + + 10ml Syringe loaded with 10mg of Morphine + + + 10ml Syringe/20mg Morphine + + + 10ml Syringe loaded with 20mg of Morphine + + + Establish 14g IV + + + Establish 20g IV + + + Syringe Prep level + + + Medical level required to prep syringes + + + Syringe Prep Time + + + Time required to prep syringes + + + Enable Advanced Medication System + + + Enables Advanced Medication System and disables Basic System + + + KAT Morphine Settings + + + Morphine IV + + + Morphine IV + + + Medical level required for Morphine IV + + + Treatment time for Morphine IV + + + Medical level required for IM Morphine + + + Treatment time for IM Morphine + + + Push Morphine IV + + + Adenosine IV + + + Medical level required for Adenosine IV + + + Treatment time for Adenosine IV + + + Adenosine IV + + + Adenosine IV + + + Push Adenosine IV + diff --git a/addons/pharma/ui/icon_AdenosineIV.paa b/addons/pharma/ui/icon_AdenosineIV.paa new file mode 100644 index 000000000..3d5d733ba Binary files /dev/null and b/addons/pharma/ui/icon_AdenosineIV.paa differ diff --git a/addons/pharma/ui/icon_Alteplase.paa b/addons/pharma/ui/icon_Alteplase.paa new file mode 100644 index 000000000..82914ba8f Binary files /dev/null and b/addons/pharma/ui/icon_Alteplase.paa differ diff --git a/addons/pharma/ui/icon_AtropineIV.paa b/addons/pharma/ui/icon_AtropineIV.paa new file mode 100644 index 000000000..82b6115fe Binary files /dev/null and b/addons/pharma/ui/icon_AtropineIV.paa differ diff --git a/addons/pharma/ui/icon_MorphineIV.paa b/addons/pharma/ui/icon_MorphineIV.paa new file mode 100644 index 000000000..4aecda0d5 Binary files /dev/null and b/addons/pharma/ui/icon_MorphineIV.paa differ diff --git a/addons/pharma/ui/syringe.paa b/addons/pharma/ui/syringe.paa new file mode 100644 index 000000000..6a1ca193c Binary files /dev/null and b/addons/pharma/ui/syringe.paa differ diff --git a/addons/pharma/ui/syringe_item.paa b/addons/pharma/ui/syringe_item.paa new file mode 100644 index 000000000..a970fd4d8 Binary files /dev/null and b/addons/pharma/ui/syringe_item.paa differ diff --git a/addons/surgery/functions/fnc_closedReductionLocal.sqf b/addons/surgery/functions/fnc_closedReductionLocal.sqf index 9446413f6..272fb6dbf 100644 --- a/addons/surgery/functions/fnc_closedReductionLocal.sqf +++ b/addons/surgery/functions/fnc_closedReductionLocal.sqf @@ -22,14 +22,35 @@ params ["_medic", "_patient", "_bodyPart"]; private _part = ALL_BODY_PARTS find toLower _bodyPart; private _activeFracture = GET_FRACTURES(_patient); private _fractureArray = _patient getVariable [QGVAR(fractures), [0,0,0,0,0,0]]; -private _lidocaineCount = [_patient, "Lidocaine", false] call ACEFUNC(medical_status,getMedicationCount); -private _morphineCount = [_patient, "Morphine", false] call ACEFUNC(medical_status,getMedicationCount); -private _nalbuphineCount = [_patient, "Nalbuphine", false] call ACEFUNC(medical_status,getMedicationCount); -private _fentanylCount = [_patient, "Fentanyl", false] call ACEFUNC(medical_status,getMedicationCount); -private _ketamineCount = [_patient, "Ketamine", false] call ACEFUNC(medical_status,getMedicationCount); -if (_lidocaineCount <= 0.6 && _morphineCount <= 0.8 && _nalbuphineCount <= 0.8 && _fentanylCount <= 0.8 && _ketamineCount <= 0.8) then { - private _pain = random [0.7, 0.8, 0.9]; - [_patient, _pain] call ACEFUNC(medical_status,adjustPainLevel); +private _medStack = _patient call ACEFUNC(medical_treatment,getAllMedicationCount); +private _medsToCheck = ["fentanyl", "ketamine", "nalbuphine", "morphine"]; +private _fentanylEffectiveness = 0; +private _ketamineEffectiveness = 0; +private _nalbuphineEffectiveness = 0; +private _morphineEffectiveness = 0; +{ + private _medName = toLower (_x select 0); + private _effectiveness = _x select 2; + if ("fentanyl" in _medName) then { + _fentanylEffectiveness = _fentanylEffectiveness max _effectiveness; + }; + if ("ketamine" in _medName) then { + _ketamineEffectiveness = _ketamineEffectiveness max _effectiveness; + }; + if ("nalbuphine" in _medName) then { + _nalbuphineEffectiveness = _nalbuphineEffectiveness max _effectiveness; + }; + if ("morphine" in _medName) then { + _morphineEffectiveness = _morphineEffectiveness max _effectiveness; + }; +} forEach _medStack; +if ( + _fentanylEffectiveness <= 0.8 && + _ketamineEffectiveness <= 0.8 && + _nalbuphineEffectiveness <= 0.8 && + _morphineEffectiveness <= 0.8 +) then { + [_patient, [0.6, 0.7, 0.8] select (floor random 3)] call ACEFUNC(medical_status,adjustPainLevel); }; playSound3D [QPATHTOF_SOUND(sounds\reduction.wav), _patient, false, getPosASL _patient, 8, 1, 15]; diff --git a/addons/surgery/functions/fnc_incisionLocal.sqf b/addons/surgery/functions/fnc_incisionLocal.sqf index 9c78beb4c..c294aa15a 100644 --- a/addons/surgery/functions/fnc_incisionLocal.sqf +++ b/addons/surgery/functions/fnc_incisionLocal.sqf @@ -52,13 +52,13 @@ _patient setVariable [QGVAR(fractures), _fractureArray, true]; }; if (((GVAR(Surgery_ConsciousnessRequirement) in [0,1]) && (!(IS_UNCONSCIOUS(_patient)) || _count == 0)) || (GVAR(Surgery_ConsciousnessRequirement) == 3 && _count == 0)) exitWith { - [_patient, "Pain", 10, 40, 200, 0, 40] call ACEFUNC(medical_status,addMedicationAdjustment); + [_patient, "Pain", 10, 40, 200, 0, 40, "", "", ""] call EFUNC(vitals,addMedicationAdjustment); [_patient, true] call ACEFUNC(medical,setUnconscious); }; if (GVAR(Surgery_ConsciousnessRequirement) == 2 && _count == 0) then { [_patient, 0.4] call ACEFUNC(medical_status,adjustPainLevel); - [_patient, "Pain", 10, 40, 30, 0, 40] call ACEFUNC(medical_status,addMedicationAdjustment); + [_patient, "Pain", 10, 40, 30, 0, 40, "", "", ""] call EFUNC(vitals,addMedicationAdjustment); }; }, GVAR(etomidateTime), [_patient, _part]] call CBA_fnc_addPerFrameHandler; diff --git a/addons/vitals/XEH_PREP.hpp b/addons/vitals/XEH_PREP.hpp index 9295e7f53..ce42ccbab 100644 --- a/addons/vitals/XEH_PREP.hpp +++ b/addons/vitals/XEH_PREP.hpp @@ -8,5 +8,7 @@ PREP(handleRespawn); PREP(handleOxygenFunction); PREP(hasStableVitals); PREP(init); +PREP(updateOpioidDepression); PREP(updateOpioidEffect); -PREP(updateOpioidRelief); \ No newline at end of file +PREP(updateOpioidRelief); +PREP(updateRespiratoryRate); \ No newline at end of file diff --git a/addons/vitals/functions/fnc_addMedicationAdjustment.sqf b/addons/vitals/functions/fnc_addMedicationAdjustment.sqf index c293d1345..e113bc7a6 100644 --- a/addons/vitals/functions/fnc_addMedicationAdjustment.sqf +++ b/addons/vitals/functions/fnc_addMedicationAdjustment.sqf @@ -11,17 +11,18 @@ * 4: Heart Rate Adjust * 5: Pain Suppress Adjust * 6: Flow Adjust + * 7: Dose * * Return Value: * None * * Example: - * [player, "Morphine", 120, 60, -10, 0.8, -10] call ace_medical_status_fnc_addMedicationAdjustment + * [player, "Morphine", 120, 60, -10, 0.8, -10, 1] call ace_medical_status_fnc_addMedicationAdjustment * * Public: No */ -params ["_unit", "_medication", "_timeToMaxEffect", "_maxTimeInSystem", "_hrAdjust", "_painAdjust", "_flowAdjust", "_alphaFactor", "_opioidRelief", "_opioidEffect"]; -TRACE_7("addMedicationAdjustment",_unit,_medication,_timeToMaxEffect,_maxTimeInSystem,_hrAdjust,_painAdjust,_flowAdjust); +params ["_unit", "_medication", "_timeToMaxEffect", "_maxTimeInSystem", "_hrAdjust", "_painAdjust", "_flowAdjust", "_dose", "_alphaFactor", "_opioidRelief", "_opioidEffect", "_opioidDepression", "_respiratoryRate"]; +TRACE_8("addMedicationAdjustment",_unit,_medication,_timeToMaxEffect,_maxTimeInSystem,_hrAdjust,_painAdjust,_flowAdjust,_dose); if (_maxTimeInSystem <= 0) exitWith { WARNING_1("bad value for _maxTimeInSystem - %1",_this); }; _timeToMaxEffect = _timeToMaxEffect max 1; @@ -29,6 +30,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, _dose, _alphaFactor, _opioidRelief, _opioidEffect, _opioidDepression, _respiratoryRate]; _unit setVariable [VAR_MEDICATIONS, _adjustments, true]; diff --git a/addons/vitals/functions/fnc_handleOxygenFunction.sqf b/addons/vitals/functions/fnc_handleOxygenFunction.sqf index 23d8c5bdc..0ef055e1c 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(pharma,respiratoryRate), 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))) 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..9624ad944 100644 --- a/addons/vitals/functions/fnc_handleUnitVitals.sqf +++ b/addons/vitals/functions/fnc_handleUnitVitals.sqf @@ -91,12 +91,13 @@ 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 { private _deleted = false; { - _x params ["_medication", "_timeAdded", "_timeTillMaxEffect", "_maxTimeInSystem", "_hrAdjust", "_painAdjust", "_flowAdjust", "_alphaFactor", "_opioidRelief", "_opioidEffect"]; + _x params ["_medication", "_timeAdded", "_timeTillMaxEffect", "_maxTimeInSystem", "_hrAdjust", "_painAdjust", "_flowAdjust", "_alphaFactor", "_opioidRelief", "_opioidEffect", "_opioidDepression", "_respiratoryRate"]; private _timeInSystem = CBA_missionTime - _timeAdded; if (_timeInSystem >= _maxTimeInSystem) then { _deleted = true; @@ -109,6 +110,8 @@ 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; }; + if (_respiratoryRate != 0) then {_respiratoryRateAdjustment = _respiratoryRateAdjustment + _respiratoryRate * _effectRatio; }; }; } forEach _adjustments; @@ -122,6 +125,8 @@ 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, _opioidDepressionAdjustment, _deltaT, _syncValues] call FUNC(updateOpioidDepression); +[_unit, _respiratoryRateAdjustment, _deltaT, _syncValues] call FUNC(updateRespiratoryRate); private _heartRate = [_unit, _hrTargetAdjustment, 0, _bloodVolume, _deltaT, _syncValues] call FUNC(handleCardiacFunction); @@ -129,7 +134,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]; diff --git a/addons/vitals/functions/fnc_updateRespiratoryRate.sqf b/addons/vitals/functions/fnc_updateRespiratoryRate.sqf new file mode 100644 index 000000000..daba412b9 --- /dev/null +++ b/addons/vitals/functions/fnc_updateRespiratoryRate.sqf @@ -0,0 +1,23 @@ +#include "..\script_component.hpp" +/* + * Author: Cplhardcore + * Update the respiratoryRate effect + * + * Arguments: + * 0: The Unit + * 1: respiratoryRate Adjustments + * 2: Time since last update + * 3: Sync value? + * + * Return Value: + * None + * + * Example: + * [player, 0, 1, false] call kat_vitals_fnc_updaterespiratoryRate + * + * Public: No + */ + +params ["_unit", "_respiratoryRateAdjustment", "_deltaT", "_syncValue"]; + +_unit setVariable [QEGVAR(pharma,respiratoryRate), _respiratoryRateAdjustment, _syncValue];