From 28a1aa4b4f190bf9c00b246246b8528adf3495ad Mon Sep 17 00:00:00 2001 From: Cplhardcore <135324281+Cplhardcore@users.noreply.github.com> Date: Fri, 11 Oct 2024 07:16:48 -0700 Subject: [PATCH 01/33] Initial Commit --- .hemtt/launch.toml | 2 + addons/medical_status/XEH_PREP.hpp | 3 +- .../functions/fnc_addMedicationAdjustment.sqf | 20 ++--- .../functions/fnc_getAllMedicationCount.sqf | 43 +++++++++ .../functions/fnc_getMedicationCount.sqf | 14 +-- .../ACE_Medical_Treatment.hpp | 6 +- .../ACE_Medical_Treatment_Actions.hpp | 4 + addons/medical_treatment/XEH_PREP.hpp | 1 + .../functions/fnc_medicationLocal.sqf | 9 +- .../functions/fnc_onMedicationUsage.sqf | 46 +++------- .../functions/fnc_onOverdose.sqf | 36 ++++++++ addons/medical_treatment/initSettings.inc.sqf | 90 +++++++++++++++++++ addons/medical_treatment/script_component.hpp | 2 +- addons/medical_treatment/stringtable.xml | 60 +++++++++++++ .../functions/fnc_handleUnitVitals.sqf | 2 +- 15 files changed, 281 insertions(+), 57 deletions(-) create mode 100644 addons/medical_status/functions/fnc_getAllMedicationCount.sqf create mode 100644 addons/medical_treatment/functions/fnc_onOverdose.sqf diff --git a/.hemtt/launch.toml b/.hemtt/launch.toml index d0726cbdded..94623dcf996 100644 --- a/.hemtt/launch.toml +++ b/.hemtt/launch.toml @@ -1,6 +1,8 @@ [default] workshop = [ "450814997", # CBA_A3 + "2369477168", # Advanced Developer Tools's Workshop ID + "1779063631", # ZEN ] [spe] diff --git a/addons/medical_status/XEH_PREP.hpp b/addons/medical_status/XEH_PREP.hpp index 77f9712eb17..710c3c35b38 100644 --- a/addons/medical_status/XEH_PREP.hpp +++ b/addons/medical_status/XEH_PREP.hpp @@ -6,6 +6,7 @@ PREP(getBloodPressure); PREP(getBloodVolumeChange); PREP(getCardiacOutput); PREP(getMedicationCount); +PREP(getAllMedicationCount); PREP(handleKilled); PREP(handleKilledMission); PREP(hasStableVitals); @@ -17,4 +18,4 @@ PREP(setCardiacArrestState); PREP(setDead); PREP(setStatusEffects); PREP(setUnconsciousState); -PREP(updateWoundBloodLoss); +PREP(updateWoundBloodLoss); \ No newline at end of file diff --git a/addons/medical_status/functions/fnc_addMedicationAdjustment.sqf b/addons/medical_status/functions/fnc_addMedicationAdjustment.sqf index 8770eaf0aec..514fd9c85a6 100644 --- a/addons/medical_status/functions/fnc_addMedicationAdjustment.sqf +++ b/addons/medical_status/functions/fnc_addMedicationAdjustment.sqf @@ -1,27 +1,27 @@ #include "..\script_component.hpp" /* - * Author: BaerMitUmlaut, PabstMirror + * Author: BaerMitUmlaut, PabstMirror modified by Cplhardcore * Adds a medication and it's effects * * Arguments: * 0: The Unit * 1: Medication - * 2: Time in system for the adjustment to reach its peak - * 3: Duration the adjustment will have an effect - * 4: Heart Rate Adjust - * 5: Pain Suppress Adjust - * 6: Flow Adjust + * 3: Time in system for the adjustment to reach its peak + * 4: Duration the adjustment will have an effect + * 5: Heart Rate Adjust + * 6: Pain Suppress Adjust + * 7: Flow Adjust * * Return Value: * None * * Example: - * [player, "Morphine", 120, 60, -10, 0.8, -10] call ace_medical_status_fnc_addMedicationAdjustment + * [player, "Morphine", 1, 120, 60, -10, 0.8, -10] call ace_medical_status_fnc_addMedicationAdjustment * * Public: No */ -params ["_unit", "_medication", "_timeToMaxEffect", "_maxTimeInSystem", "_hrAdjust", "_painAdjust", "_flowAdjust"]; -TRACE_7("addMedicationAdjustment",_unit,_medication,_timeToMaxEffect,_maxTimeInSystem,_hrAdjust,_painAdjust,_flowAdjust); +params ["_unit", "_medication", "_dose", "_timeToMaxEffect", "_maxTimeInSystem", "_hrAdjust", "_painAdjust", "_flowAdjust"]; +TRACE_8("addMedicationAdjustment",_unit,_medication,_dose,_timeToMaxEffect,_maxTimeInSystem,_hrAdjust,_painAdjust,_flowAdjust); if (_maxTimeInSystem <= 0) exitWith { WARNING_1("bad value for _maxTimeInSystem - %1",_this); }; _timeToMaxEffect = _timeToMaxEffect max 1; @@ -29,6 +29,6 @@ _timeToMaxEffect = _timeToMaxEffect max 1; private _adjustments = _unit getVariable [VAR_MEDICATIONS, []]; -_adjustments pushBack [_medication, CBA_missionTime, _timeToMaxEffect, _maxTimeInSystem, _hrAdjust, _painAdjust, _flowAdjust]; +_adjustments pushBack [_medication, CBA_missionTime, _dose, _timeToMaxEffect, _maxTimeInSystem, _hrAdjust, _painAdjust, _flowAdjust]; _unit setVariable [VAR_MEDICATIONS, _adjustments, true]; diff --git a/addons/medical_status/functions/fnc_getAllMedicationCount.sqf b/addons/medical_status/functions/fnc_getAllMedicationCount.sqf new file mode 100644 index 00000000000..afaeaf199bc --- /dev/null +++ b/addons/medical_status/functions/fnc_getAllMedicationCount.sqf @@ -0,0 +1,43 @@ +#include "..\script_component.hpp" +/* + * Author: PabstMirror, modified by Cplhardcore + * Gets effective count of all medications in a unit's system + * (each medication dose is scaled from 0..1 based on time till max effect and max time in system) + * + * Arguments: + * 0: The patient + * 1: Get raw count (true) or effect ratio (false) (default: true) + * + * Return Value: + * Dose Count + * Medication effectiveness (float) + * + * Example: + * [player] call ace_medical_status_fnc_getAllMedicationCount + * + * Public: No + */ + +params ["_target", ["_getCount", true]]; + +private _results = []; // Array to store medication info +{ + _x params ["_xMed", "_timeAdded", "_dose", "_timeTillMaxEffect", "_maxTimeInSystem"]; + + private _timeInSystem = CBA_missionTime - _timeAdded; + private _medDose = _dose; + private _medication = _xMed; + private _effectiveness = 0; + + if (_getCount) then { + _effectiveness = linearConversion [_timeTillMaxEffect, _maxTimeInSystem, _timeInSystem, 1, 0, true]; + } else { + _effectiveness = (((_timeInSystem / _timeTillMaxEffect) ^ 2) min 1) * (_maxTimeInSystem - _timeInSystem) / _maxTimeInSystem; + }; + _results pushBack [_medication, _medDose, _effectiveness]; + +} forEach (_target getVariable [VAR_MEDICATIONS, []]); + +TRACE_4("getMedicationCount",_target,_medication,_getCount,_results); + +_results \ No newline at end of file diff --git a/addons/medical_status/functions/fnc_getMedicationCount.sqf b/addons/medical_status/functions/fnc_getMedicationCount.sqf index e98707c7212..2afe54d6ed0 100644 --- a/addons/medical_status/functions/fnc_getMedicationCount.sqf +++ b/addons/medical_status/functions/fnc_getMedicationCount.sqf @@ -1,6 +1,6 @@ #include "..\script_component.hpp" /* - * Author: PabstMirror + * Author: PabstMirror modified by Cplhardcore * Gets effective count of medications in a unit's system * (each medication dose is scaled from 0..1 based on time till max effect and max time in system) * @@ -10,7 +10,8 @@ * 2: Get raw count (true) or effect ratio (false) (default: true) * * Return Value: - * Medication count (float) + * Dose Count + * Medication effectiveness (float) * * Example: * [player, "Epinephrine"] call ace_medical_status_fnc_getMedicationCount @@ -21,10 +22,12 @@ params ["_target", "_medication", ["_getCount", true]]; private _return = 0; +private _medDose = 0; { - _x params ["_xMed", "_timeAdded", "_timeTillMaxEffect", "_maxTimeInSystem"]; + _x params ["_xMed", "_timeAdded", "_dose", "_timeTillMaxEffect", "_maxTimeInSystem"]; if (_xMed == _medication) then { private _timeInSystem = CBA_missionTime - _timeAdded; + _medDose = _medDose + _dose; if (_getCount) then { // just return effective count, a medication will always start at 1 and only drop after reaching timeTilMaxEffect _return = _return + linearConversion [_timeTillMaxEffect, _maxTimeInSystem, _timeInSystem, 1, 0, true]; @@ -35,5 +38,6 @@ private _return = 0; }; } forEach (_target getVariable [VAR_MEDICATIONS, []]); -TRACE_4("getMedicationCount",_target,_medication,_getCount,_return); -_return +TRACE_5("getMedicationCount",_target,_medication,_getCount,_return,_medDose); + +[_medDose, _return] diff --git a/addons/medical_treatment/ACE_Medical_Treatment.hpp b/addons/medical_treatment/ACE_Medical_Treatment.hpp index 267a45dd445..01b734df122 100644 --- a/addons/medical_treatment/ACE_Medical_Treatment.hpp +++ b/addons/medical_treatment/ACE_Medical_Treatment.hpp @@ -571,7 +571,7 @@ class ADDON { // Example with maxDose = 4 and maxDoseDeviation = 2: Dose 4: Safe | Dose 5 and 6: Possible overdose | Dose 7: Guaranteed overdose maxDoseDeviation = 2; // Function to execute upon overdose. Arguments passed to call back are 0: unit , 1: medicationClassName - onOverDose = ""; + onOverDoseCustom = ""; // The viscosity of a fluid is a measure of its resistance to gradual deformation by shear stress or tensile stress. For liquids, it corresponds to the informal concept of "thickness". This value will increase/decrease the viscoty of the blood with the percentage given. Where 100 = max. Using the minus will decrease viscosity viscosityChange = 0; @@ -584,6 +584,7 @@ class ADDON { timeInSystem = 1800; timeTillMaxEffect = 30; maxDose = 4; + dose = 1; incompatibleMedication[] = {}; viscosityChange = -10; }; @@ -595,6 +596,7 @@ class ADDON { timeInSystem = 120; timeTillMaxEffect = 10; maxDose = 9; + dose = 1; incompatibleMedication[] = {}; }; class Adenosine { @@ -605,6 +607,7 @@ class ADDON { timeInSystem = 120; timeTillMaxEffect = 15; maxDose = 5; + dose = 1; incompatibleMedication[] = {}; }; class PainKillers { @@ -615,6 +618,7 @@ class ADDON { timeInSystem = 420; timeTillMaxEffect = 60; maxDose = 5; + dose = 1; incompatibleMedication[] = {}; viscosityChange = 5; }; diff --git a/addons/medical_treatment/ACE_Medical_Treatment_Actions.hpp b/addons/medical_treatment/ACE_Medical_Treatment_Actions.hpp index 4058132e3db..b9d376b60e4 100644 --- a/addons/medical_treatment/ACE_Medical_Treatment_Actions.hpp +++ b/addons/medical_treatment/ACE_Medical_Treatment_Actions.hpp @@ -114,10 +114,12 @@ class GVAR(actions) { class Morphine: FieldDressing { displayName = CSTRING(Inject_Morphine); displayNameProgress = CSTRING(Injecting_Morphine); + medicRequired = QGVAR(medicMorphine); icon = QPATHTOEF(medical_gui,ui\auto_injector.paa); allowedSelections[] = {"LeftArm", "RightArm", "LeftLeg", "RightLeg"}; category = "medication"; items[] = {"ACE_morphine"}; + treatmentLocations = QGVAR(locationMorphine); condition = ""; treatmentTime = QGVAR(treatmentTimeAutoinjector); callbackSuccess = QFUNC(medication); @@ -128,8 +130,10 @@ class GVAR(actions) { class Adenosine: Morphine { displayName = CSTRING(Inject_Adenosine); displayNameProgress = CSTRING(Injecting_Adenosine); + medicRequired = QGVAR(medicAdenosine); condition = QGVAR(advancedMedication); items[] = {"ACE_adenosine"}; + treatmentLocations = QGVAR(locationAdenosine); litter[] = {{"ACE_MedicalLitter_adenosine"}}; }; class Epinephrine: Morphine { diff --git a/addons/medical_treatment/XEH_PREP.hpp b/addons/medical_treatment/XEH_PREP.hpp index 709c97952f4..0dd30bb31fb 100644 --- a/addons/medical_treatment/XEH_PREP.hpp +++ b/addons/medical_treatment/XEH_PREP.hpp @@ -67,3 +67,4 @@ PREP(treatmentFailure); PREP(treatmentSuccess); PREP(unloadUnit); PREP(useItem); +PREP(onOverdose); diff --git a/addons/medical_treatment/functions/fnc_medicationLocal.sqf b/addons/medical_treatment/functions/fnc_medicationLocal.sqf index 18ef4e4d680..52e08134b31 100644 --- a/addons/medical_treatment/functions/fnc_medicationLocal.sqf +++ b/addons/medical_treatment/functions/fnc_medicationLocal.sqf @@ -1,6 +1,6 @@ #include "..\script_component.hpp" /* - * Author: Glowbal, mharis001 + * Author: Glowbal, mharis001, modified by Cplhardcore * Local callback for administering medication to a patient. * * Arguments: @@ -65,8 +65,7 @@ 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 _dose = GET_NUMBER(_medicationConfig >> "dose",getNumber (_defaultConfig >> "dose")); 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")); @@ -80,7 +79,7 @@ private _heartRateChange = _minIncrease + random (_maxIncrease - _minIncrease); // Adjust the medication effects and add the medication to the list TRACE_3("adjustments",_heartRateChange,_painReduce,_viscosityChange); -[_patient, _className, _timeTillMaxEffect, _timeInSystem, _heartRateChange, _painReduce, _viscosityChange] call EFUNC(medical_status,addMedicationAdjustment); +[_patient, _className, _dose, _timeTillMaxEffect, _timeInSystem, _heartRateChange, _painReduce, _viscosityChange] call EFUNC(medical_status,addMedicationAdjustment); // Check for medication compatiblity -[_patient, _className, _maxDose, _maxDoseDeviation, _incompatibleMedication] call FUNC(onMedicationUsage); +[_patient, _className, _incompatibleMedication] call FUNC(onMedicationUsage); diff --git a/addons/medical_treatment/functions/fnc_onMedicationUsage.sqf b/addons/medical_treatment/functions/fnc_onMedicationUsage.sqf index cd26d154242..fb58e4069e5 100644 --- a/addons/medical_treatment/functions/fnc_onMedicationUsage.sqf +++ b/addons/medical_treatment/functions/fnc_onMedicationUsage.sqf @@ -1,32 +1,32 @@ #include "..\script_component.hpp" /* - * Author: Glowbal + * Author: Glowbal, modified by Cplhardcore * Handles the medication given to a patient. * * Arguments: * 0: The patient * 1: Medication Treatment classname - * 2: Max dose (0 to ignore) - * 3: Max dose deviation - * 3: Incompatable medication > + * 2: Incompatable medication > * * Return Value: * None * * Example: - * [player, "morphine", 4, 2, [["x", 1]]] call ace_medical_treatment_fnc_onMedicationUsage + * [player, "morphine", [["x", 1]]] call ace_medical_treatment_fnc_onMedicationUsage * * Public: No */ -params ["_target", "_className", "_maxDose", "_maxDoseDeviation", "_incompatibleMedication"]; -TRACE_5("onMedicationUsage",_target,_className,_maxDose,_maxDoseDeviation,_incompatibleMedication); - -private _overdosedMedications = []; +params ["_target", "_className", "_incompatibleMedication"]; +TRACE_3("onMedicationUsage",_target,_className,_incompatibleMedication); // Check for overdose from current medication +private _defaultConfig = configFile >> QUOTE(ADDON) >> "Medication"; +private _medicationConfig = _defaultConfig >> _classname; +private _maxDose = GET_NUMBER(_medicationConfig >> "maxDose",getNumber (_defaultConfig >> "maxDose")); +private _maxDoseDeviation = GET_NUMBER(_medicationConfig >> "maxDoseDeviation",getNumber (_defaultConfig >> "maxDoseDeviation")); if (_maxDose > 0) then { - private _currentDose = [_target, _className] call EFUNC(medical_status,getMedicationCount); + private _currentDose = [_target, _className] call EFUNC(medical_status,getMedicationCount) select 1; // Because both {floor random 0} and {floor random 1} return 0 if (_maxDoseDeviation > 0) then { _maxDoseDeviation = _maxDoseDeviation + 1; @@ -34,7 +34,7 @@ if (_maxDose > 0) then { if (_currentDose > _maxDose + (floor random _maxDoseDeviation)) then { TRACE_1("exceeded max dose",_currentDose); - _overdosedMedications pushBackUnique _className; + [_target, _classname] call FUNC(onOverdose); }; }; @@ -43,26 +43,6 @@ if (_maxDose > 0) then { _x params ["_xMed", "_xLimit"]; private _inSystem = [_target, _xMed] call EFUNC(medical_status,getMedicationCount); if (_inSystem> _xLimit) then { - _overdosedMedications pushBackUnique _xMed; - }; -} forEach _incompatibleMedication; - -if (_overdosedMedications isNotEqualTo []) then { - private _medicationConfig = (configFile >> "ace_medical_treatment" >> "Medication"); - private _onOverDose = getText (_medicationConfig >> "onOverDose"); - if (isClass (_medicationConfig >> _className)) then { - _medicationConfig = (_medicationConfig >> _className); - if (isText (_medicationConfig >> "onOverDose")) then { _onOverDose = getText (_medicationConfig >> "onOverDose"); }; + [_target, _classname] call FUNC(onOverdose); }; - TRACE_2("overdose",_overdosedMedications,_onOverDose); - if (_onOverDose == "") exitWith { - TRACE_1("CriticalVitals Event",_target); // make unconscious - [QEGVAR(medical,CriticalVitals), _target] call CBA_fnc_localEvent; - }; - if (isNil _onOverDose) then { - _onOverDose = compile _onOverDose; - } else { - _onOverDose = missionNamespace getVariable _onOverDose; - }; - [_target, _className, _overdosedMedications] call _onOverDose; -}; +} forEach _incompatibleMedication; \ No newline at end of file diff --git a/addons/medical_treatment/functions/fnc_onOverdose.sqf b/addons/medical_treatment/functions/fnc_onOverdose.sqf new file mode 100644 index 00000000000..fa8c39d6a9d --- /dev/null +++ b/addons/medical_treatment/functions/fnc_onOverdose.sqf @@ -0,0 +1,36 @@ +#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 ace_medical_treatment_fnc_onOverDose + * Public: No + */ + + params ["_unit", "_classname"]; + +private _medicationConfig = (configFile >> "ace_medical_treatment" >> "_classname"); +private _onOverDoseCustom = getText (_medicationConfig >> "onOverDoseCustom"); +if (isClass (_medicationConfig >> _className)) then { + _medicationConfig = (_medicationConfig >> _className); + if (isText (_medicationConfig >> "onOverDoseCustom")) then { _onOverDoseCustom = getText (_medicationConfig >> "onOverDoseCustom"); }; +}; +TRACE_2("overdose",_classname,_onOverDoseCustom); +if (_onOverDoseCustom == "") exitWith { + TRACE_1("CriticalVitals Event",_target); // make unconscious + [QEGVAR(medical,CriticalVitals), _target] call CBA_fnc_localEvent; +}; +if (isNil _onOverDoseCustom) then { + _onOverDose = compile _onOverDoseCustom; +} else { + _onOverDoseCustom = missionNamespace getVariable _onOverDoseCustom; +}; \ No newline at end of file diff --git a/addons/medical_treatment/initSettings.inc.sqf b/addons/medical_treatment/initSettings.inc.sqf index 7f0fc06764c..a73ba29aa4e 100644 --- a/addons/medical_treatment/initSettings.inc.sqf +++ b/addons/medical_treatment/initSettings.inc.sqf @@ -154,6 +154,96 @@ true ] call CBA_fnc_addSetting; +[ + QGVAR(EpinephrineDoseLimit), + "SLIDER", + [LSTRING(DoseLimitEpinephrine_DisplayName), LSTRING(DoseLimitEpinephrine_DESC)], + [ELSTRING(medical,Category), LSTRING(SubCategory_Treatment)], + [1, 9, 3, 0], + true +] call CBA_fnc_addSetting; + +[ + QGVAR(EpinephrineDoseLimitDeviation), + "SLIDER", + [LSTRING(DoseLimitDeviationEpinephrine_DisplayName), LSTRING(DoseLimitDeviationEpinephrine_DESC)], + [ELSTRING(medical,Category), LSTRING(SubCategory_Treatment)], + [0, 3, 1, 0], + true +] call CBA_fnc_addSetting; + +[ + QGVAR(medicMorphine), + "LIST", + [LSTRING(MedicMorphine_DisplayName), LSTRING(MedicMorphine_Description)], + [ELSTRING(medical,Category), LSTRING(SubCategory_Treatment)], + [[0, 1, 2], [LSTRING(Anyone), LSTRING(Medics), LSTRING(Doctors)], 0], + true +] call CBA_fnc_addSetting; + +[ + QGVAR(locationMorphine), + "LIST", + [LSTRING(LocationMorphine_DisplayName), LSTRING(LocationMorphine_Description)], + [ELSTRING(medical,Category), LSTRING(SubCategory_Treatment)], + [[0, 1, 2, 3, 4], [ELSTRING(common,Anywhere), ELSTRING(common,Vehicle), LSTRING(MedicalFacilities), LSTRING(VehiclesAndFacilities), ELSTRING(common,Disabled)], 0], + true +] call CBA_fnc_addSetting; + +[ + QGVAR(MorphineDoseLimit), + "SLIDER", + [LSTRING(DoseLimitMorphine_DisplayName), LSTRING(DoseLimitMorphine_DESC)], + [ELSTRING(medical,Category), LSTRING(SubCategory_Treatment)], + [1, 9, 3, 0], + true +] call CBA_fnc_addSetting; + +[ + QGVAR(MorphineDoseLimitDeviation), + "SLIDER", + [LSTRING(DoseLimitDeviationMorphine_DisplayName), LSTRING(DoseLimitDeviationMorphine_DESC)], + [ELSTRING(medical,Category), LSTRING(SubCategory_Treatment)], + [0, 3, 1, 0], + true +] call CBA_fnc_addSetting; + +[ + QGVAR(medicAdenosine), + "LIST", + [LSTRING(MedicAdenosine_DisplayName), LSTRING(MedicAdenosine_Description)], + [ELSTRING(medical,Category), LSTRING(SubCategory_Treatment)], + [[0, 1, 2], [LSTRING(Anyone), LSTRING(Medics), LSTRING(Doctors)], 0], + true +] call CBA_fnc_addSetting; + +[ + QGVAR(locationAdenosine), + "LIST", + [LSTRING(LocationAdenosine_DisplayName), LSTRING(LocationAdenosine_Description)], + [ELSTRING(medical,Category), LSTRING(SubCategory_Treatment)], + [[0, 1, 2, 3, 4], [ELSTRING(common,Anywhere), ELSTRING(common,Vehicle), LSTRING(MedicalFacilities), LSTRING(VehiclesAndFacilities), ELSTRING(common,Disabled)], 0], + true +] call CBA_fnc_addSetting; + +[ + QGVAR(AdenosineDoseLimit), + "SLIDER", + [LSTRING(DoseLimitAdenosine_DisplayName), LSTRING(DoseLimitAdenosine_DESC)], + [ELSTRING(medical,Category), LSTRING(SubCategory_Treatment)], + [1, 9, 3, 0], + true +] call CBA_fnc_addSetting; + +[ + QGVAR(AdenosineDoseLimitDeviation), + "SLIDER", + [LSTRING(DoseLimitDeviationAdenosine_DisplayName), LSTRING(DoseLimitDeviationAdenosine_DESC)], + [ELSTRING(medical,Category), LSTRING(SubCategory_Treatment)], + [0, 3, 1, 0], + true +] call CBA_fnc_addSetting; + [ QGVAR(medicPAK), "LIST", diff --git a/addons/medical_treatment/script_component.hpp b/addons/medical_treatment/script_component.hpp index 6a334ed72a3..9f636b9909e 100644 --- a/addons/medical_treatment/script_component.hpp +++ b/addons/medical_treatment/script_component.hpp @@ -2,7 +2,7 @@ #define COMPONENT_BEAUTIFIED Medical Treatment #include "\z\ace\addons\main\script_mod.hpp" -// #define DEBUG_MODE_FULL +#define DEBUG_MODE_FULL // #define DISABLE_COMPILE_CACHE // #define ENABLE_PERFORMANCE_COUNTERS diff --git a/addons/medical_treatment/stringtable.xml b/addons/medical_treatment/stringtable.xml index b0d140d8255..0ebf8bac7ab 100644 --- a/addons/medical_treatment/stringtable.xml +++ b/addons/medical_treatment/stringtable.xml @@ -546,6 +546,66 @@ Controla donde puede sr usada la Epinefrina. 에피네프린을 사용할 수 있는 장소를 정합니다. + + Maximum Dose of Epinephrine + + + The maximum Dose of Epinephrine you can give to a player + + + Maximum Dose Deviation of Epinephrine + + + The number of additional doses you may be able to give of Epinephrine, while risking overdose + + + Allow Morphine + + + Training level required to use Morphine. + + + Locations Morphine + + + Controls where Morphine can be used. + + + Maximum Dose of Morphine + + + The maximum Dose of Morphine you can give to a player + + + Maximum Dose Deviation of Morphine + + + The number of additional doses you may be able to give of Morphine, while risking overdose + + + Allow Adenosine + + + Training level required to use Adenosine. + + + Locations Adenosine + + + Controls where Adenosine can be used. + + + Maximum Dose of Adenosine + + + The maximum Dose of Adenosine you can give to a player + + + Maximum Dose Deviation of Adenosine + + + The number of additional doses you may be able to give of Adenosine, while risking overdose + Allow PAK Доступ к Аптечке diff --git a/addons/medical_vitals/functions/fnc_handleUnitVitals.sqf b/addons/medical_vitals/functions/fnc_handleUnitVitals.sqf index 77aec7fd621..9dc4fb9a1c9 100644 --- a/addons/medical_vitals/functions/fnc_handleUnitVitals.sqf +++ b/addons/medical_vitals/functions/fnc_handleUnitVitals.sqf @@ -81,7 +81,7 @@ private _adjustments = _unit getVariable [VAR_MEDICATIONS,[]]; if (_adjustments isNotEqualTo []) then { private _deleted = false; { - _x params ["_medication", "_timeAdded", "_timeTillMaxEffect", "_maxTimeInSystem", "_hrAdjust", "_painAdjust", "_flowAdjust"]; + _x params ["_medication", "_dose", "_timeAdded", "_timeTillMaxEffect", "_maxTimeInSystem", "_hrAdjust", "_painAdjust", "_flowAdjust"]; private _timeInSystem = CBA_missionTime - _timeAdded; if (_timeInSystem >= _maxTimeInSystem) then { _deleted = true; From e8551a1415a39dcaabbeb8306359c5eca9c0eee2 Mon Sep 17 00:00:00 2001 From: Cplhardcore <135324281+Cplhardcore@users.noreply.github.com> Date: Fri, 11 Oct 2024 07:34:51 -0700 Subject: [PATCH 02/33] Small fix to get all medications --- .../functions/fnc_getAllMedicationCount.sqf | 30 ++++++++++++++----- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/addons/medical_status/functions/fnc_getAllMedicationCount.sqf b/addons/medical_status/functions/fnc_getAllMedicationCount.sqf index afaeaf199bc..2e23a9ada6b 100644 --- a/addons/medical_status/functions/fnc_getAllMedicationCount.sqf +++ b/addons/medical_status/functions/fnc_getAllMedicationCount.sqf @@ -20,24 +20,38 @@ params ["_target", ["_getCount", true]]; -private _results = []; // Array to store medication info +private _medStack = []; // Array to store stacked medication info + { _x params ["_xMed", "_timeAdded", "_dose", "_timeTillMaxEffect", "_maxTimeInSystem"]; private _timeInSystem = CBA_missionTime - _timeAdded; - private _medDose = _dose; - private _medication = _xMed; - private _effectiveness = 0; - + private _effectiveness = 0; + if (_getCount) then { _effectiveness = linearConversion [_timeTillMaxEffect, _maxTimeInSystem, _timeInSystem, 1, 0, true]; } else { _effectiveness = (((_timeInSystem / _timeTillMaxEffect) ^ 2) min 1) * (_maxTimeInSystem - _timeInSystem) / _maxTimeInSystem; }; - _results pushBack [_medication, _medDose, _effectiveness]; + + private _found = false; + { + _x params ["_existingMed", "_totalDose", "_totalEffectiveness"]; + + if (_existingMed isEqualTo _xMed) then { + _found = true; + _medStack set [_forEachIndex, [_existingMed, _totalDose + _dose, _totalEffectiveness + _effectiveness]]; // Stack dose and add effectiveness + true + } else { + false + }; + } forEach _medStack; + if (!_found) then { + _medStack pushBack [_xMed, _dose, _effectiveness]; + }; } forEach (_target getVariable [VAR_MEDICATIONS, []]); -TRACE_4("getMedicationCount",_target,_medication,_getCount,_results); +TRACE_3("getMedicationStack", _target, _medStack, _getCount); -_results \ No newline at end of file +_medStack \ No newline at end of file From d8f078139cd6237dd18e8c67b6f791a796e14c12 Mon Sep 17 00:00:00 2001 From: Cplhardcore <135324281+Cplhardcore@users.noreply.github.com> Date: Fri, 11 Oct 2024 07:37:23 -0700 Subject: [PATCH 03/33] Update launch.toml --- .hemtt/launch.toml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.hemtt/launch.toml b/.hemtt/launch.toml index 94623dcf996..d0726cbdded 100644 --- a/.hemtt/launch.toml +++ b/.hemtt/launch.toml @@ -1,8 +1,6 @@ [default] workshop = [ "450814997", # CBA_A3 - "2369477168", # Advanced Developer Tools's Workshop ID - "1779063631", # ZEN ] [spe] From c3af22315f84fffa1725acdb6bce988901159809 Mon Sep 17 00:00:00 2001 From: Cplhardcore <135324281+Cplhardcore@users.noreply.github.com> Date: Fri, 11 Oct 2024 07:39:51 -0700 Subject: [PATCH 04/33] Small fix and removal of medication dose variables --- .../functions/fnc_addMedicationAdjustment.sqf | 1 + addons/medical_treatment/initSettings.inc.sqf | 36 ------------------- 2 files changed, 1 insertion(+), 36 deletions(-) diff --git a/addons/medical_status/functions/fnc_addMedicationAdjustment.sqf b/addons/medical_status/functions/fnc_addMedicationAdjustment.sqf index 514fd9c85a6..91ac01081cf 100644 --- a/addons/medical_status/functions/fnc_addMedicationAdjustment.sqf +++ b/addons/medical_status/functions/fnc_addMedicationAdjustment.sqf @@ -6,6 +6,7 @@ * Arguments: * 0: The Unit * 1: Medication + * 2: Dose of medication * 3: Time in system for the adjustment to reach its peak * 4: Duration the adjustment will have an effect * 5: Heart Rate Adjust diff --git a/addons/medical_treatment/initSettings.inc.sqf b/addons/medical_treatment/initSettings.inc.sqf index a73ba29aa4e..793a81972fb 100644 --- a/addons/medical_treatment/initSettings.inc.sqf +++ b/addons/medical_treatment/initSettings.inc.sqf @@ -190,24 +190,6 @@ true ] call CBA_fnc_addSetting; -[ - QGVAR(MorphineDoseLimit), - "SLIDER", - [LSTRING(DoseLimitMorphine_DisplayName), LSTRING(DoseLimitMorphine_DESC)], - [ELSTRING(medical,Category), LSTRING(SubCategory_Treatment)], - [1, 9, 3, 0], - true -] call CBA_fnc_addSetting; - -[ - QGVAR(MorphineDoseLimitDeviation), - "SLIDER", - [LSTRING(DoseLimitDeviationMorphine_DisplayName), LSTRING(DoseLimitDeviationMorphine_DESC)], - [ELSTRING(medical,Category), LSTRING(SubCategory_Treatment)], - [0, 3, 1, 0], - true -] call CBA_fnc_addSetting; - [ QGVAR(medicAdenosine), "LIST", @@ -226,24 +208,6 @@ true ] call CBA_fnc_addSetting; -[ - QGVAR(AdenosineDoseLimit), - "SLIDER", - [LSTRING(DoseLimitAdenosine_DisplayName), LSTRING(DoseLimitAdenosine_DESC)], - [ELSTRING(medical,Category), LSTRING(SubCategory_Treatment)], - [1, 9, 3, 0], - true -] call CBA_fnc_addSetting; - -[ - QGVAR(AdenosineDoseLimitDeviation), - "SLIDER", - [LSTRING(DoseLimitDeviationAdenosine_DisplayName), LSTRING(DoseLimitDeviationAdenosine_DESC)], - [ELSTRING(medical,Category), LSTRING(SubCategory_Treatment)], - [0, 3, 1, 0], - true -] call CBA_fnc_addSetting; - [ QGVAR(medicPAK), "LIST", From d6de590f4f65d7b49a542c44db10047b402d84fc Mon Sep 17 00:00:00 2001 From: Cplhardcore <135324281+Cplhardcore@users.noreply.github.com> Date: Fri, 11 Oct 2024 07:41:27 -0700 Subject: [PATCH 05/33] Deleted old entries from stringtable --- addons/medical_treatment/stringtable.xml | 36 ------------------------ 1 file changed, 36 deletions(-) diff --git a/addons/medical_treatment/stringtable.xml b/addons/medical_treatment/stringtable.xml index 0ebf8bac7ab..8051b551fdb 100644 --- a/addons/medical_treatment/stringtable.xml +++ b/addons/medical_treatment/stringtable.xml @@ -546,18 +546,6 @@ Controla donde puede sr usada la Epinefrina. 에피네프린을 사용할 수 있는 장소를 정합니다. - - Maximum Dose of Epinephrine - - - The maximum Dose of Epinephrine you can give to a player - - - Maximum Dose Deviation of Epinephrine - - - The number of additional doses you may be able to give of Epinephrine, while risking overdose - Allow Morphine @@ -570,18 +558,6 @@ Controls where Morphine can be used. - - Maximum Dose of Morphine - - - The maximum Dose of Morphine you can give to a player - - - Maximum Dose Deviation of Morphine - - - The number of additional doses you may be able to give of Morphine, while risking overdose - Allow Adenosine @@ -594,18 +570,6 @@ Controls where Adenosine can be used. - - Maximum Dose of Adenosine - - - The maximum Dose of Adenosine you can give to a player - - - Maximum Dose Deviation of Adenosine - - - The number of additional doses you may be able to give of Adenosine, while risking overdose - Allow PAK Доступ к Аптечке From 42e2097ebf6294621c2db9f72f5259575c76b0c9 Mon Sep 17 00:00:00 2001 From: Cplhardcore <135324281+Cplhardcore@users.noreply.github.com> Date: Fri, 11 Oct 2024 07:54:18 -0700 Subject: [PATCH 06/33] Update addons/medical_treatment/script_component.hpp Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com> --- addons/medical_treatment/script_component.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/medical_treatment/script_component.hpp b/addons/medical_treatment/script_component.hpp index 9f636b9909e..6a334ed72a3 100644 --- a/addons/medical_treatment/script_component.hpp +++ b/addons/medical_treatment/script_component.hpp @@ -2,7 +2,7 @@ #define COMPONENT_BEAUTIFIED Medical Treatment #include "\z\ace\addons\main\script_mod.hpp" -#define DEBUG_MODE_FULL +// #define DEBUG_MODE_FULL // #define DISABLE_COMPILE_CACHE // #define ENABLE_PERFORMANCE_COUNTERS From e22e06b45ab9def59e42d96fc2649c5bf80fa676 Mon Sep 17 00:00:00 2001 From: Cplhardcore <135324281+Cplhardcore@users.noreply.github.com> Date: Fri, 11 Oct 2024 07:58:16 -0700 Subject: [PATCH 07/33] Fixed newline --- addons/medical_status/XEH_PREP.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/medical_status/XEH_PREP.hpp b/addons/medical_status/XEH_PREP.hpp index 710c3c35b38..30a9142565e 100644 --- a/addons/medical_status/XEH_PREP.hpp +++ b/addons/medical_status/XEH_PREP.hpp @@ -18,4 +18,4 @@ PREP(setCardiacArrestState); PREP(setDead); PREP(setStatusEffects); PREP(setUnconsciousState); -PREP(updateWoundBloodLoss); \ No newline at end of file +PREP(updateWoundBloodLoss); From fff711a7b32ef77110ce1799c0f61af88f91200c Mon Sep 17 00:00:00 2001 From: Cplhardcore <135324281+Cplhardcore@users.noreply.github.com> Date: Fri, 11 Oct 2024 08:22:10 -0700 Subject: [PATCH 08/33] Changes for backwards compatibility --- .../medical_treatment/ACE_Medical_Treatment.hpp | 2 +- addons/medical_treatment/XEH_PREP.hpp | 2 +- .../{fnc_onOverdose.sqf => fnc_Overdose.sqf} | 16 ++++++++-------- .../functions/fnc_onMedicationUsage.sqf | 4 ++-- 4 files changed, 12 insertions(+), 12 deletions(-) rename addons/medical_treatment/functions/{fnc_onOverdose.sqf => fnc_Overdose.sqf} (56%) diff --git a/addons/medical_treatment/ACE_Medical_Treatment.hpp b/addons/medical_treatment/ACE_Medical_Treatment.hpp index 01b734df122..144102efff2 100644 --- a/addons/medical_treatment/ACE_Medical_Treatment.hpp +++ b/addons/medical_treatment/ACE_Medical_Treatment.hpp @@ -571,7 +571,7 @@ class ADDON { // Example with maxDose = 4 and maxDoseDeviation = 2: Dose 4: Safe | Dose 5 and 6: Possible overdose | Dose 7: Guaranteed overdose maxDoseDeviation = 2; // Function to execute upon overdose. Arguments passed to call back are 0: unit , 1: medicationClassName - onOverDoseCustom = ""; + onOverDose = ""; // The viscosity of a fluid is a measure of its resistance to gradual deformation by shear stress or tensile stress. For liquids, it corresponds to the informal concept of "thickness". This value will increase/decrease the viscoty of the blood with the percentage given. Where 100 = max. Using the minus will decrease viscosity viscosityChange = 0; diff --git a/addons/medical_treatment/XEH_PREP.hpp b/addons/medical_treatment/XEH_PREP.hpp index 0dd30bb31fb..1ce31a1d709 100644 --- a/addons/medical_treatment/XEH_PREP.hpp +++ b/addons/medical_treatment/XEH_PREP.hpp @@ -67,4 +67,4 @@ PREP(treatmentFailure); PREP(treatmentSuccess); PREP(unloadUnit); PREP(useItem); -PREP(onOverdose); +PREP(Overdose); diff --git a/addons/medical_treatment/functions/fnc_onOverdose.sqf b/addons/medical_treatment/functions/fnc_Overdose.sqf similarity index 56% rename from addons/medical_treatment/functions/fnc_onOverdose.sqf rename to addons/medical_treatment/functions/fnc_Overdose.sqf index fa8c39d6a9d..75eafe33043 100644 --- a/addons/medical_treatment/functions/fnc_onOverdose.sqf +++ b/addons/medical_treatment/functions/fnc_Overdose.sqf @@ -12,25 +12,25 @@ * None * * Example: - * [player, "morphine"] call ace_medical_treatment_fnc_onOverDose + * [player, "morphine"] call ace_medical_treatment_fnc_OverDose * Public: No */ params ["_unit", "_classname"]; private _medicationConfig = (configFile >> "ace_medical_treatment" >> "_classname"); -private _onOverDoseCustom = getText (_medicationConfig >> "onOverDoseCustom"); +private _onOverDose = getText (_medicationConfig >> "onOverDose"); if (isClass (_medicationConfig >> _className)) then { _medicationConfig = (_medicationConfig >> _className); - if (isText (_medicationConfig >> "onOverDoseCustom")) then { _onOverDoseCustom = getText (_medicationConfig >> "onOverDoseCustom"); }; + if (isText (_medicationConfig >> "onOverDose")) then { _onOverDose = getText (_medicationConfig >> "onOverDose"); }; }; -TRACE_2("overdose",_classname,_onOverDoseCustom); -if (_onOverDoseCustom == "") exitWith { +TRACE_2("overdose",_classname,_onOverDose); +if (_onOverDose == "") exitWith { TRACE_1("CriticalVitals Event",_target); // make unconscious [QEGVAR(medical,CriticalVitals), _target] call CBA_fnc_localEvent; }; -if (isNil _onOverDoseCustom) then { - _onOverDose = compile _onOverDoseCustom; +if (isNil _onOverDose) then { + _onOverDose = compile _onOverDose; } else { - _onOverDoseCustom = missionNamespace getVariable _onOverDoseCustom; + _onOverDose = missionNamespace getVariable _onOverDose; }; \ No newline at end of file diff --git a/addons/medical_treatment/functions/fnc_onMedicationUsage.sqf b/addons/medical_treatment/functions/fnc_onMedicationUsage.sqf index fb58e4069e5..b486ed0d5a6 100644 --- a/addons/medical_treatment/functions/fnc_onMedicationUsage.sqf +++ b/addons/medical_treatment/functions/fnc_onMedicationUsage.sqf @@ -34,7 +34,7 @@ if (_maxDose > 0) then { if (_currentDose > _maxDose + (floor random _maxDoseDeviation)) then { TRACE_1("exceeded max dose",_currentDose); - [_target, _classname] call FUNC(onOverdose); + [_target, _classname] call FUNC(Overdose); }; }; @@ -43,6 +43,6 @@ if (_maxDose > 0) then { _x params ["_xMed", "_xLimit"]; private _inSystem = [_target, _xMed] call EFUNC(medical_status,getMedicationCount); if (_inSystem> _xLimit) then { - [_target, _classname] call FUNC(onOverdose); + [_target, _classname] call FUNC(Overdose); }; } forEach _incompatibleMedication; \ No newline at end of file From 70f8f0dc45cb453e5ebba4b20ebc750b078b2fdf Mon Sep 17 00:00:00 2001 From: Cplhardcore <135324281+Cplhardcore@users.noreply.github.com> Date: Sat, 12 Oct 2024 08:22:16 -0700 Subject: [PATCH 09/33] Update addons/medical_status/functions/fnc_addMedicationAdjustment.sqf Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com> --- addons/medical_status/functions/fnc_addMedicationAdjustment.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/medical_status/functions/fnc_addMedicationAdjustment.sqf b/addons/medical_status/functions/fnc_addMedicationAdjustment.sqf index 91ac01081cf..39c7389a28d 100644 --- a/addons/medical_status/functions/fnc_addMedicationAdjustment.sqf +++ b/addons/medical_status/functions/fnc_addMedicationAdjustment.sqf @@ -1,6 +1,6 @@ #include "..\script_component.hpp" /* - * Author: BaerMitUmlaut, PabstMirror modified by Cplhardcore + * Author: BaerMitUmlaut, PabstMirror, Cplhardcore * Adds a medication and it's effects * * Arguments: From 8c5716b8db3ccd8ad924c2f7fdc1ab11278ca837 Mon Sep 17 00:00:00 2001 From: Cplhardcore <135324281+Cplhardcore@users.noreply.github.com> Date: Sat, 12 Oct 2024 08:22:26 -0700 Subject: [PATCH 10/33] Update addons/medical_status/functions/fnc_getAllMedicationCount.sqf Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com> --- addons/medical_status/functions/fnc_getAllMedicationCount.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/medical_status/functions/fnc_getAllMedicationCount.sqf b/addons/medical_status/functions/fnc_getAllMedicationCount.sqf index 2e23a9ada6b..ea9f0b7fe49 100644 --- a/addons/medical_status/functions/fnc_getAllMedicationCount.sqf +++ b/addons/medical_status/functions/fnc_getAllMedicationCount.sqf @@ -6,7 +6,7 @@ * * Arguments: * 0: The patient - * 1: Get raw count (true) or effect ratio (false) (default: true) + * 1: Get raw count (true) or effect ratio (false) (default: true) * * Return Value: * Dose Count From 684d8ec0bb183ba20b474cf7452206661cd16609 Mon Sep 17 00:00:00 2001 From: Cplhardcore <135324281+Cplhardcore@users.noreply.github.com> Date: Sat, 12 Oct 2024 08:22:36 -0700 Subject: [PATCH 11/33] Update addons/medical_status/functions/fnc_getAllMedicationCount.sqf Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com> --- addons/medical_status/functions/fnc_getAllMedicationCount.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/medical_status/functions/fnc_getAllMedicationCount.sqf b/addons/medical_status/functions/fnc_getAllMedicationCount.sqf index ea9f0b7fe49..1bf51f0a0cf 100644 --- a/addons/medical_status/functions/fnc_getAllMedicationCount.sqf +++ b/addons/medical_status/functions/fnc_getAllMedicationCount.sqf @@ -52,6 +52,6 @@ private _medStack = []; // Array to store stacked medication info } forEach (_target getVariable [VAR_MEDICATIONS, []]); -TRACE_3("getMedicationStack", _target, _medStack, _getCount); +TRACE_3("getMedicationStack",_target,_medStack,_getCount); _medStack \ No newline at end of file From 2e227954e4d6b9b0896c06b5bf8e2f760a148e6b Mon Sep 17 00:00:00 2001 From: Cplhardcore <135324281+Cplhardcore@users.noreply.github.com> Date: Sat, 12 Oct 2024 08:55:56 -0700 Subject: [PATCH 12/33] Fixes, maybe? --- .../functions/fnc_addMedicationAdjustment.sqf | 7 +++--- .../functions/fnc_getAllMedicationCount.sqf | 15 +++++------- .../functions/fnc_getMedicationCount.sqf | 2 +- .../functions/fnc_Overdose.sqf | 24 ++++++++++--------- .../functions/fnc_medicationLocal.sqf | 2 +- .../functions/fnc_onMedicationUsage.sqf | 4 ++-- addons/medical_treatment/initSettings.inc.sqf | 18 -------------- .../functions/fnc_handleUnitVitals.sqf | 2 +- 8 files changed, 27 insertions(+), 47 deletions(-) diff --git a/addons/medical_status/functions/fnc_addMedicationAdjustment.sqf b/addons/medical_status/functions/fnc_addMedicationAdjustment.sqf index 39c7389a28d..202bf86e321 100644 --- a/addons/medical_status/functions/fnc_addMedicationAdjustment.sqf +++ b/addons/medical_status/functions/fnc_addMedicationAdjustment.sqf @@ -21,8 +21,8 @@ * * Public: No */ -params ["_unit", "_medication", "_dose", "_timeToMaxEffect", "_maxTimeInSystem", "_hrAdjust", "_painAdjust", "_flowAdjust"]; -TRACE_8("addMedicationAdjustment",_unit,_medication,_dose,_timeToMaxEffect,_maxTimeInSystem,_hrAdjust,_painAdjust,_flowAdjust); +params ["_unit", "_medication", "_timeToMaxEffect", "_maxTimeInSystem", "_hrAdjust", "_painAdjust", "_flowAdjust","_dose",]; +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; @@ -30,6 +30,5 @@ _timeToMaxEffect = _timeToMaxEffect max 1; private _adjustments = _unit getVariable [VAR_MEDICATIONS, []]; -_adjustments pushBack [_medication, CBA_missionTime, _dose, _timeToMaxEffect, _maxTimeInSystem, _hrAdjust, _painAdjust, _flowAdjust]; - +_adjustments pushBack [_medication, CBA_missionTime, _timeToMaxEffect, _maxTimeInSystem, _hrAdjust, _painAdjust, _flowAdjust, _dose]; _unit setVariable [VAR_MEDICATIONS, _adjustments, true]; diff --git a/addons/medical_status/functions/fnc_getAllMedicationCount.sqf b/addons/medical_status/functions/fnc_getAllMedicationCount.sqf index 1bf51f0a0cf..cb89ddb1d79 100644 --- a/addons/medical_status/functions/fnc_getAllMedicationCount.sqf +++ b/addons/medical_status/functions/fnc_getAllMedicationCount.sqf @@ -15,15 +15,15 @@ * Example: * [player] call ace_medical_status_fnc_getAllMedicationCount * - * Public: No + * Public: Yes */ params ["_target", ["_getCount", true]]; -private _medStack = []; // Array to store stacked medication info +private _medStack = []; { - _x params ["_xMed", "_timeAdded", "_dose", "_timeTillMaxEffect", "_maxTimeInSystem"]; + _x params ["_xMed", "_timeAdded", "_timeTillMaxEffect", "_maxTimeInSystem", "_dose"]; private _timeInSystem = CBA_missionTime - _timeAdded; private _effectiveness = 0; @@ -40,11 +40,8 @@ private _medStack = []; // Array to store stacked medication info if (_existingMed isEqualTo _xMed) then { _found = true; - _medStack set [_forEachIndex, [_existingMed, _totalDose + _dose, _totalEffectiveness + _effectiveness]]; // Stack dose and add effectiveness - true - } else { - false - }; + _medStack set [_forEachIndex, [_existingMed, _totalDose + _dose, _totalEffectiveness + _effectiveness]]; + } else {}; } forEach _medStack; if (!_found) then { _medStack pushBack [_xMed, _dose, _effectiveness]; @@ -54,4 +51,4 @@ private _medStack = []; // Array to store stacked medication info TRACE_3("getMedicationStack",_target,_medStack,_getCount); -_medStack \ No newline at end of file +_medStack diff --git a/addons/medical_status/functions/fnc_getMedicationCount.sqf b/addons/medical_status/functions/fnc_getMedicationCount.sqf index 2afe54d6ed0..60bcf721fd7 100644 --- a/addons/medical_status/functions/fnc_getMedicationCount.sqf +++ b/addons/medical_status/functions/fnc_getMedicationCount.sqf @@ -24,7 +24,7 @@ params ["_target", "_medication", ["_getCount", true]]; private _return = 0; private _medDose = 0; { - _x params ["_xMed", "_timeAdded", "_dose", "_timeTillMaxEffect", "_maxTimeInSystem"]; + _x params ["_xMed", "_timeAdded", "_timeTillMaxEffect", "_maxTimeInSystem", "_dose"]; if (_xMed == _medication) then { private _timeInSystem = CBA_missionTime - _timeAdded; _medDose = _medDose + _dose; diff --git a/addons/medical_treatment/functions/fnc_Overdose.sqf b/addons/medical_treatment/functions/fnc_Overdose.sqf index 75eafe33043..b24a8d9a5d0 100644 --- a/addons/medical_treatment/functions/fnc_Overdose.sqf +++ b/addons/medical_treatment/functions/fnc_Overdose.sqf @@ -12,24 +12,26 @@ * None * * Example: - * [player, "morphine"] call ace_medical_treatment_fnc_OverDose + * [player, "morphine"] call ace_medical_treatment_fnc_overDose * Public: No */ - params ["_unit", "_classname"]; - -private _medicationConfig = (configFile >> "ace_medical_treatment" >> "_classname"); +params ["_unit", "_classname"]; +private _medicationConfig = (configFile >> "ace_medical_treatment" >> _classname); private _onOverDose = getText (_medicationConfig >> "onOverDose"); -if (isClass (_medicationConfig >> _className)) then { - _medicationConfig = (_medicationConfig >> _className); - if (isText (_medicationConfig >> "onOverDose")) then { _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); +TRACE_2("overdose", _classname, _onOverDose); if (_onOverDose == "") exitWith { - TRACE_1("CriticalVitals Event",_target); // make unconscious - [QEGVAR(medical,CriticalVitals), _target] call CBA_fnc_localEvent; + TRACE_1("CriticalVitals Event", _unit); + [QEGVAR(medical, CriticalVitals), _unit] call CBA_fnc_localEvent; }; -if (isNil _onOverDose) then { +if (!isNil "_onOverDose" && {isText _onOverDose}) then { _onOverDose = compile _onOverDose; } else { _onOverDose = missionNamespace getVariable _onOverDose; diff --git a/addons/medical_treatment/functions/fnc_medicationLocal.sqf b/addons/medical_treatment/functions/fnc_medicationLocal.sqf index 52e08134b31..86a456a61aa 100644 --- a/addons/medical_treatment/functions/fnc_medicationLocal.sqf +++ b/addons/medical_treatment/functions/fnc_medicationLocal.sqf @@ -65,12 +65,12 @@ 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 _dose = GET_NUMBER(_medicationConfig >> "dose",getNumber (_defaultConfig >> "dose")); 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 _incompatibleMedication = GET_ARRAY(_medicationConfig >> "incompatibleMedication",getArray (_defaultConfig >> "incompatibleMedication")); +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)); diff --git a/addons/medical_treatment/functions/fnc_onMedicationUsage.sqf b/addons/medical_treatment/functions/fnc_onMedicationUsage.sqf index b486ed0d5a6..5d746d855cb 100644 --- a/addons/medical_treatment/functions/fnc_onMedicationUsage.sqf +++ b/addons/medical_treatment/functions/fnc_onMedicationUsage.sqf @@ -34,7 +34,7 @@ if (_maxDose > 0) then { if (_currentDose > _maxDose + (floor random _maxDoseDeviation)) then { TRACE_1("exceeded max dose",_currentDose); - [_target, _classname] call FUNC(Overdose); + [_target, _classname] call FUNC(overDose); }; }; @@ -43,6 +43,6 @@ if (_maxDose > 0) then { _x params ["_xMed", "_xLimit"]; private _inSystem = [_target, _xMed] call EFUNC(medical_status,getMedicationCount); if (_inSystem> _xLimit) then { - [_target, _classname] call FUNC(Overdose); + [_target, _classname] call FUNC(overDose); }; } forEach _incompatibleMedication; \ No newline at end of file diff --git a/addons/medical_treatment/initSettings.inc.sqf b/addons/medical_treatment/initSettings.inc.sqf index 793a81972fb..00bef17240f 100644 --- a/addons/medical_treatment/initSettings.inc.sqf +++ b/addons/medical_treatment/initSettings.inc.sqf @@ -154,24 +154,6 @@ true ] call CBA_fnc_addSetting; -[ - QGVAR(EpinephrineDoseLimit), - "SLIDER", - [LSTRING(DoseLimitEpinephrine_DisplayName), LSTRING(DoseLimitEpinephrine_DESC)], - [ELSTRING(medical,Category), LSTRING(SubCategory_Treatment)], - [1, 9, 3, 0], - true -] call CBA_fnc_addSetting; - -[ - QGVAR(EpinephrineDoseLimitDeviation), - "SLIDER", - [LSTRING(DoseLimitDeviationEpinephrine_DisplayName), LSTRING(DoseLimitDeviationEpinephrine_DESC)], - [ELSTRING(medical,Category), LSTRING(SubCategory_Treatment)], - [0, 3, 1, 0], - true -] call CBA_fnc_addSetting; - [ QGVAR(medicMorphine), "LIST", diff --git a/addons/medical_vitals/functions/fnc_handleUnitVitals.sqf b/addons/medical_vitals/functions/fnc_handleUnitVitals.sqf index 9dc4fb9a1c9..2180467e3ba 100644 --- a/addons/medical_vitals/functions/fnc_handleUnitVitals.sqf +++ b/addons/medical_vitals/functions/fnc_handleUnitVitals.sqf @@ -81,7 +81,7 @@ private _adjustments = _unit getVariable [VAR_MEDICATIONS,[]]; if (_adjustments isNotEqualTo []) then { private _deleted = false; { - _x params ["_medication", "_dose", "_timeAdded", "_timeTillMaxEffect", "_maxTimeInSystem", "_hrAdjust", "_painAdjust", "_flowAdjust"]; + _x params ["_medication", "_timeAdded", "_timeTillMaxEffect", "_maxTimeInSystem", "_hrAdjust", "_painAdjust", "_flowAdjust", ""]; private _timeInSystem = CBA_missionTime - _timeAdded; if (_timeInSystem >= _maxTimeInSystem) then { _deleted = true; From 40abd2a8ab7bb276a53cd9237b540dcc36de01e8 Mon Sep 17 00:00:00 2001 From: Cplhardcore <135324281+Cplhardcore@users.noreply.github.com> Date: Sat, 12 Oct 2024 08:59:41 -0700 Subject: [PATCH 13/33] Overdose fixes --- addons/medical_treatment/functions/fnc_Overdose.sqf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/medical_treatment/functions/fnc_Overdose.sqf b/addons/medical_treatment/functions/fnc_Overdose.sqf index b24a8d9a5d0..8a14c9213e9 100644 --- a/addons/medical_treatment/functions/fnc_Overdose.sqf +++ b/addons/medical_treatment/functions/fnc_Overdose.sqf @@ -35,4 +35,5 @@ if (!isNil "_onOverDose" && {isText _onOverDose}) then { _onOverDose = compile _onOverDose; } else { _onOverDose = missionNamespace getVariable _onOverDose; -}; \ No newline at end of file +}; +[_target, _className] call _onOverDose; From 7c895ba159d32014f9b38eb464f3bbabb33101d8 Mon Sep 17 00:00:00 2001 From: Grim <69561145+LinkIsGrim@users.noreply.github.com> Date: Sat, 12 Oct 2024 16:31:04 -0300 Subject: [PATCH 14/33] trailling comma --- addons/medical_status/functions/fnc_addMedicationAdjustment.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/medical_status/functions/fnc_addMedicationAdjustment.sqf b/addons/medical_status/functions/fnc_addMedicationAdjustment.sqf index 202bf86e321..c894656832b 100644 --- a/addons/medical_status/functions/fnc_addMedicationAdjustment.sqf +++ b/addons/medical_status/functions/fnc_addMedicationAdjustment.sqf @@ -21,7 +21,7 @@ * * Public: No */ -params ["_unit", "_medication", "_timeToMaxEffect", "_maxTimeInSystem", "_hrAdjust", "_painAdjust", "_flowAdjust","_dose",]; +params ["_unit", "_medication", "_timeToMaxEffect", "_maxTimeInSystem", "_hrAdjust", "_painAdjust", "_flowAdjust","_dose"]; TRACE_8("addMedicationAdjustment",_unit,_medication,_timeToMaxEffect,_maxTimeInSystem,_hrAdjust,_painAdjust,_flowAdjust,_dose); if (_maxTimeInSystem <= 0) exitWith { WARNING_1("bad value for _maxTimeInSystem - %1",_this); }; From 768f9abdf4aee39be475e53ae16994f301764186 Mon Sep 17 00:00:00 2001 From: Grim <69561145+LinkIsGrim@users.noreply.github.com> Date: Sat, 12 Oct 2024 16:31:29 -0300 Subject: [PATCH 15/33] Update addons/medical_vitals/functions/fnc_handleUnitVitals.sqf --- addons/medical_vitals/functions/fnc_handleUnitVitals.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/medical_vitals/functions/fnc_handleUnitVitals.sqf b/addons/medical_vitals/functions/fnc_handleUnitVitals.sqf index 2180467e3ba..77aec7fd621 100644 --- a/addons/medical_vitals/functions/fnc_handleUnitVitals.sqf +++ b/addons/medical_vitals/functions/fnc_handleUnitVitals.sqf @@ -81,7 +81,7 @@ private _adjustments = _unit getVariable [VAR_MEDICATIONS,[]]; if (_adjustments isNotEqualTo []) then { private _deleted = false; { - _x params ["_medication", "_timeAdded", "_timeTillMaxEffect", "_maxTimeInSystem", "_hrAdjust", "_painAdjust", "_flowAdjust", ""]; + _x params ["_medication", "_timeAdded", "_timeTillMaxEffect", "_maxTimeInSystem", "_hrAdjust", "_painAdjust", "_flowAdjust"]; private _timeInSystem = CBA_missionTime - _timeAdded; if (_timeInSystem >= _maxTimeInSystem) then { _deleted = true; From 8216db17212f14a38659ab3421dc2c382d3bd104 Mon Sep 17 00:00:00 2001 From: Cplhardcore <135324281+Cplhardcore@users.noreply.github.com> Date: Sat, 12 Oct 2024 20:13:20 -0700 Subject: [PATCH 16/33] aa --- .../functions/{fnc_Overdose.sqf => fnc_zoverDose.sqf} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename addons/medical_treatment/functions/{fnc_Overdose.sqf => fnc_zoverDose.sqf} (100%) diff --git a/addons/medical_treatment/functions/fnc_Overdose.sqf b/addons/medical_treatment/functions/fnc_zoverDose.sqf similarity index 100% rename from addons/medical_treatment/functions/fnc_Overdose.sqf rename to addons/medical_treatment/functions/fnc_zoverDose.sqf From b5c3c5dd2a0679979ff83365edd27a92d7f18786 Mon Sep 17 00:00:00 2001 From: Cplhardcore <135324281+Cplhardcore@users.noreply.github.com> Date: Sat, 12 Oct 2024 20:13:38 -0700 Subject: [PATCH 17/33] there we go --- .../functions/{fnc_zoverDose.sqf => fnc_overDose.sqf} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename addons/medical_treatment/functions/{fnc_zoverDose.sqf => fnc_overDose.sqf} (100%) diff --git a/addons/medical_treatment/functions/fnc_zoverDose.sqf b/addons/medical_treatment/functions/fnc_overDose.sqf similarity index 100% rename from addons/medical_treatment/functions/fnc_zoverDose.sqf rename to addons/medical_treatment/functions/fnc_overDose.sqf From 8443181467e91ab38197ac13a165b449b6d61bcf Mon Sep 17 00:00:00 2001 From: Cplhardcore <135324281+Cplhardcore@users.noreply.github.com> Date: Sat, 12 Oct 2024 20:14:26 -0700 Subject: [PATCH 18/33] Update addons/medical_treatment/functions/fnc_onMedicationUsage.sqf MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Jouni Järvinen --- addons/medical_treatment/functions/fnc_onMedicationUsage.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/medical_treatment/functions/fnc_onMedicationUsage.sqf b/addons/medical_treatment/functions/fnc_onMedicationUsage.sqf index 5d746d855cb..31b5d4e69f6 100644 --- a/addons/medical_treatment/functions/fnc_onMedicationUsage.sqf +++ b/addons/medical_treatment/functions/fnc_onMedicationUsage.sqf @@ -6,7 +6,7 @@ * Arguments: * 0: The patient * 1: Medication Treatment classname - * 2: Incompatable medication > + * 2: Incompatible medication > * * Return Value: * None From 9abb145604329c21dfd4bcc1b9de67b416bbcc05 Mon Sep 17 00:00:00 2001 From: Cplhardcore <135324281+Cplhardcore@users.noreply.github.com> Date: Sat, 12 Oct 2024 20:14:35 -0700 Subject: [PATCH 19/33] Update addons/medical_treatment/functions/fnc_onMedicationUsage.sqf MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Jouni Järvinen --- .../medical_treatment/functions/fnc_onMedicationUsage.sqf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/medical_treatment/functions/fnc_onMedicationUsage.sqf b/addons/medical_treatment/functions/fnc_onMedicationUsage.sqf index 31b5d4e69f6..a13a263d498 100644 --- a/addons/medical_treatment/functions/fnc_onMedicationUsage.sqf +++ b/addons/medical_treatment/functions/fnc_onMedicationUsage.sqf @@ -21,10 +21,10 @@ params ["_target", "_className", "_incompatibleMedication"]; TRACE_3("onMedicationUsage",_target,_className,_incompatibleMedication); // Check for overdose from current medication -private _defaultConfig = configFile >> QUOTE(ADDON) >> "Medication"; +private _defaultConfig = configFile >> QUOTE(ADDON) >> "Medication"; private _medicationConfig = _defaultConfig >> _classname; -private _maxDose = GET_NUMBER(_medicationConfig >> "maxDose",getNumber (_defaultConfig >> "maxDose")); -private _maxDoseDeviation = GET_NUMBER(_medicationConfig >> "maxDoseDeviation",getNumber (_defaultConfig >> "maxDoseDeviation")); +private _maxDose = GET_NUMBER(_medicationConfig >> "maxDose",getNumber (_defaultConfig >> "maxDose")); +private _maxDoseDeviation = GET_NUMBER(_medicationConfig >> "maxDoseDeviation",getNumber (_defaultConfig >> "maxDoseDeviation")); if (_maxDose > 0) then { private _currentDose = [_target, _className] call EFUNC(medical_status,getMedicationCount) select 1; // Because both {floor random 0} and {floor random 1} return 0 From 01504ea72772922d4fe86c6a970e66cdba27325b Mon Sep 17 00:00:00 2001 From: Cplhardcore <135324281+Cplhardcore@users.noreply.github.com> Date: Sat, 12 Oct 2024 20:15:16 -0700 Subject: [PATCH 20/33] Update XEH_PREP.hpp --- addons/medical_treatment/XEH_PREP.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/medical_treatment/XEH_PREP.hpp b/addons/medical_treatment/XEH_PREP.hpp index 1ce31a1d709..f2910f657ae 100644 --- a/addons/medical_treatment/XEH_PREP.hpp +++ b/addons/medical_treatment/XEH_PREP.hpp @@ -67,4 +67,4 @@ PREP(treatmentFailure); PREP(treatmentSuccess); PREP(unloadUnit); PREP(useItem); -PREP(Overdose); +PREP(overDose); From 2ab49a487815871efd4432c04ac527ffb8f0c157 Mon Sep 17 00:00:00 2001 From: Cplhardcore <135324281+Cplhardcore@users.noreply.github.com> Date: Sat, 12 Oct 2024 20:16:56 -0700 Subject: [PATCH 21/33] Update addons/medical_status/functions/fnc_getAllMedicationCount.sqf Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com> --- .../medical_status/functions/fnc_getAllMedicationCount.sqf | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/medical_status/functions/fnc_getAllMedicationCount.sqf b/addons/medical_status/functions/fnc_getAllMedicationCount.sqf index cb89ddb1d79..cf7a89c7148 100644 --- a/addons/medical_status/functions/fnc_getAllMedicationCount.sqf +++ b/addons/medical_status/functions/fnc_getAllMedicationCount.sqf @@ -9,8 +9,9 @@ * 1: Get raw count (true) or effect ratio (false) (default: true) * * Return Value: - * Dose Count - * Medication effectiveness (float) + * Array of medication counts : + * Dose Count + * Medication effectiveness (float) * * Example: * [player] call ace_medical_status_fnc_getAllMedicationCount From 594d02b7c93e5fe2c613586c4ebc7ad96ab19a7d Mon Sep 17 00:00:00 2001 From: Cplhardcore <135324281+Cplhardcore@users.noreply.github.com> Date: Sat, 12 Oct 2024 20:49:34 -0700 Subject: [PATCH 22/33] Grim Misc Fixes --- .../functions/fnc_getAllMedicationCount.sqf | 35 ++----------------- .../functions/fnc_getMedicationCount.sqf | 4 +-- addons/medical_status/script_component.hpp | 2 +- .../functions/fnc_medicationLocal.sqf | 2 +- .../functions/fnc_overDose.sqf | 6 ++-- addons/medical_treatment/script_component.hpp | 2 +- 6 files changed, 11 insertions(+), 40 deletions(-) diff --git a/addons/medical_status/functions/fnc_getAllMedicationCount.sqf b/addons/medical_status/functions/fnc_getAllMedicationCount.sqf index cb89ddb1d79..58fe0ad5752 100644 --- a/addons/medical_status/functions/fnc_getAllMedicationCount.sqf +++ b/addons/medical_status/functions/fnc_getAllMedicationCount.sqf @@ -20,35 +20,6 @@ params ["_target", ["_getCount", true]]; -private _medStack = []; - -{ - _x params ["_xMed", "_timeAdded", "_timeTillMaxEffect", "_maxTimeInSystem", "_dose"]; - - private _timeInSystem = CBA_missionTime - _timeAdded; - private _effectiveness = 0; - - if (_getCount) then { - _effectiveness = linearConversion [_timeTillMaxEffect, _maxTimeInSystem, _timeInSystem, 1, 0, true]; - } else { - _effectiveness = (((_timeInSystem / _timeTillMaxEffect) ^ 2) min 1) * (_maxTimeInSystem - _timeInSystem) / _maxTimeInSystem; - }; - - private _found = false; - { - _x params ["_existingMed", "_totalDose", "_totalEffectiveness"]; - - if (_existingMed isEqualTo _xMed) then { - _found = true; - _medStack set [_forEachIndex, [_existingMed, _totalDose + _dose, _totalEffectiveness + _effectiveness]]; - } else {}; - } forEach _medStack; - if (!_found) then { - _medStack pushBack [_xMed, _dose, _effectiveness]; - }; - -} forEach (_target getVariable [VAR_MEDICATIONS, []]); - -TRACE_3("getMedicationStack",_target,_medStack,_getCount); - -_medStack +private _medicationClasses = (_target getVariable [VAR_MEDICATIONS, []]) apply {_x select 0}; +_medicationClasses = _medicationClasses arrayIntersect _medicationClasses; +_medicationClasses apply {[_target, _x, _getCount] call FUNC(getMedicationCount)} // return \ No newline at end of file diff --git a/addons/medical_status/functions/fnc_getMedicationCount.sqf b/addons/medical_status/functions/fnc_getMedicationCount.sqf index 60bcf721fd7..58f0aa95697 100644 --- a/addons/medical_status/functions/fnc_getMedicationCount.sqf +++ b/addons/medical_status/functions/fnc_getMedicationCount.sqf @@ -24,7 +24,7 @@ params ["_target", "_medication", ["_getCount", true]]; private _return = 0; private _medDose = 0; { - _x params ["_xMed", "_timeAdded", "_timeTillMaxEffect", "_maxTimeInSystem", "_dose"]; + _x params ["_xMed", "_timeAdded", "_timeTillMaxEffect", "_maxTimeInSystem", "", "", "", "_dose"]; if (_xMed == _medication) then { private _timeInSystem = CBA_missionTime - _timeAdded; _medDose = _medDose + _dose; @@ -40,4 +40,4 @@ private _medDose = 0; TRACE_5("getMedicationCount",_target,_medication,_getCount,_return,_medDose); -[_medDose, _return] +[_medication, _medDose, _return] diff --git a/addons/medical_status/script_component.hpp b/addons/medical_status/script_component.hpp index 324fb88078b..817ec494907 100644 --- a/addons/medical_status/script_component.hpp +++ b/addons/medical_status/script_component.hpp @@ -2,7 +2,7 @@ #define COMPONENT_BEAUTIFIED Medical Status #include "\z\ace\addons\main\script_mod.hpp" -// #define DEBUG_MODE_FULL +#define DEBUG_MODE_FULL // #define DISABLE_COMPILE_CACHE // #define ENABLE_PERFORMANCE_COUNTERS diff --git a/addons/medical_treatment/functions/fnc_medicationLocal.sqf b/addons/medical_treatment/functions/fnc_medicationLocal.sqf index 86a456a61aa..b5a44051f07 100644 --- a/addons/medical_treatment/functions/fnc_medicationLocal.sqf +++ b/addons/medical_treatment/functions/fnc_medicationLocal.sqf @@ -79,7 +79,7 @@ private _heartRateChange = _minIncrease + random (_maxIncrease - _minIncrease); // Adjust the medication effects and add the medication to the list TRACE_3("adjustments",_heartRateChange,_painReduce,_viscosityChange); -[_patient, _className, _dose, _timeTillMaxEffect, _timeInSystem, _heartRateChange, _painReduce, _viscosityChange] call EFUNC(medical_status,addMedicationAdjustment); +[_patient, _className, _timeTillMaxEffect, _timeInSystem, _heartRateChange, _painReduce, _viscosityChange, _dose] call EFUNC(medical_status,addMedicationAdjustment); // Check for medication compatiblity [_patient, _className, _incompatibleMedication] call FUNC(onMedicationUsage); diff --git a/addons/medical_treatment/functions/fnc_overDose.sqf b/addons/medical_treatment/functions/fnc_overDose.sqf index 8a14c9213e9..53966e4120e 100644 --- a/addons/medical_treatment/functions/fnc_overDose.sqf +++ b/addons/medical_treatment/functions/fnc_overDose.sqf @@ -26,10 +26,10 @@ if (isClass (_medicationConfig)) then { _onOverDose = getText (_medicationConfig >> "onOverDose"); }; }; -TRACE_2("overdose", _classname, _onOverDose); +TRACE_2("overdose",_classname,_onOverDose); if (_onOverDose == "") exitWith { - TRACE_1("CriticalVitals Event", _unit); - [QEGVAR(medical, CriticalVitals), _unit] call CBA_fnc_localEvent; + TRACE_1("CriticalVitals Event",_unit); + [QEGVAR(medical,CriticalVitals), _unit] call CBA_fnc_localEvent; }; if (!isNil "_onOverDose" && {isText _onOverDose}) then { _onOverDose = compile _onOverDose; diff --git a/addons/medical_treatment/script_component.hpp b/addons/medical_treatment/script_component.hpp index 6a334ed72a3..9f636b9909e 100644 --- a/addons/medical_treatment/script_component.hpp +++ b/addons/medical_treatment/script_component.hpp @@ -2,7 +2,7 @@ #define COMPONENT_BEAUTIFIED Medical Treatment #include "\z\ace\addons\main\script_mod.hpp" -// #define DEBUG_MODE_FULL +#define DEBUG_MODE_FULL // #define DISABLE_COMPILE_CACHE // #define ENABLE_PERFORMANCE_COUNTERS From 8e916cd00806961dcab5c845d4e27ace9b1b59ba Mon Sep 17 00:00:00 2001 From: Cplhardcore <135324281+Cplhardcore@users.noreply.github.com> Date: Sat, 12 Oct 2024 20:51:19 -0700 Subject: [PATCH 23/33] Remove debug --- addons/medical_status/script_component.hpp | 2 +- addons/medical_treatment/script_component.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/medical_status/script_component.hpp b/addons/medical_status/script_component.hpp index 817ec494907..324fb88078b 100644 --- a/addons/medical_status/script_component.hpp +++ b/addons/medical_status/script_component.hpp @@ -2,7 +2,7 @@ #define COMPONENT_BEAUTIFIED Medical Status #include "\z\ace\addons\main\script_mod.hpp" -#define DEBUG_MODE_FULL +// #define DEBUG_MODE_FULL // #define DISABLE_COMPILE_CACHE // #define ENABLE_PERFORMANCE_COUNTERS diff --git a/addons/medical_treatment/script_component.hpp b/addons/medical_treatment/script_component.hpp index 9f636b9909e..6a334ed72a3 100644 --- a/addons/medical_treatment/script_component.hpp +++ b/addons/medical_treatment/script_component.hpp @@ -2,7 +2,7 @@ #define COMPONENT_BEAUTIFIED Medical Treatment #include "\z\ace\addons\main\script_mod.hpp" -#define DEBUG_MODE_FULL +// #define DEBUG_MODE_FULL // #define DISABLE_COMPILE_CACHE // #define ENABLE_PERFORMANCE_COUNTERS From d0a14d86f404c55a33dd9cc030272c4db5a3d23a Mon Sep 17 00:00:00 2001 From: Cplhardcore <135324281+Cplhardcore@users.noreply.github.com> Date: Sat, 12 Oct 2024 20:56:49 -0700 Subject: [PATCH 24/33] Small fixes --- .../functions/fnc_addMedicationAdjustment.sqf | 14 +++++++------- .../functions/fnc_handleUnitVitals.sqf | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/addons/medical_status/functions/fnc_addMedicationAdjustment.sqf b/addons/medical_status/functions/fnc_addMedicationAdjustment.sqf index c894656832b..0b4db589343 100644 --- a/addons/medical_status/functions/fnc_addMedicationAdjustment.sqf +++ b/addons/medical_status/functions/fnc_addMedicationAdjustment.sqf @@ -5,13 +5,13 @@ * * Arguments: * 0: The Unit - * 1: Medication - * 2: Dose of medication - * 3: Time in system for the adjustment to reach its peak - * 4: Duration the adjustment will have an effect - * 5: Heart Rate Adjust - * 6: Pain Suppress Adjust - * 7: Flow Adjust + * 1: Medication + * 2: Time in system for the adjustment to reach its peak + * 3: Duration the adjustment will have an effect + * 4: Heart Rate Adjust + * 5: Pain Suppress Adjust + * 6: Flow Adjust + * 7: Dose of medication * * Return Value: * None diff --git a/addons/medical_vitals/functions/fnc_handleUnitVitals.sqf b/addons/medical_vitals/functions/fnc_handleUnitVitals.sqf index 77aec7fd621..05aeba5036f 100644 --- a/addons/medical_vitals/functions/fnc_handleUnitVitals.sqf +++ b/addons/medical_vitals/functions/fnc_handleUnitVitals.sqf @@ -81,7 +81,7 @@ private _adjustments = _unit getVariable [VAR_MEDICATIONS,[]]; if (_adjustments isNotEqualTo []) then { private _deleted = false; { - _x params ["_medication", "_timeAdded", "_timeTillMaxEffect", "_maxTimeInSystem", "_hrAdjust", "_painAdjust", "_flowAdjust"]; + _x params ["_medication", "_timeAdded", "_timeTillMaxEffect", "_maxTimeInSystem", "_hrAdjust", "_painAdjust", "_flowAdjust", "_dose"]; private _timeInSystem = CBA_missionTime - _timeAdded; if (_timeInSystem >= _maxTimeInSystem) then { _deleted = true; From 528345655fcdd2bab9d65598a0a14b5336416bed Mon Sep 17 00:00:00 2001 From: Grim <69561145+LinkIsGrim@users.noreply.github.com> Date: Sat, 19 Oct 2024 01:59:46 -0300 Subject: [PATCH 25/33] newline --- addons/medical_status/functions/fnc_getAllMedicationCount.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/medical_status/functions/fnc_getAllMedicationCount.sqf b/addons/medical_status/functions/fnc_getAllMedicationCount.sqf index f062372ff0a..f10388dcff6 100644 --- a/addons/medical_status/functions/fnc_getAllMedicationCount.sqf +++ b/addons/medical_status/functions/fnc_getAllMedicationCount.sqf @@ -23,4 +23,4 @@ params ["_target", ["_getCount", true]]; private _medicationClasses = (_target getVariable [VAR_MEDICATIONS, []]) apply {_x select 0}; _medicationClasses = _medicationClasses arrayIntersect _medicationClasses; -_medicationClasses apply {[_target, _x, _getCount] call FUNC(getMedicationCount)} // return \ No newline at end of file +_medicationClasses apply {[_target, _x, _getCount] call FUNC(getMedicationCount)} // return From 383a87be4873b10fd1e2221ce77e6e6172d09c90 Mon Sep 17 00:00:00 2001 From: Grim <69561145+LinkIsGrim@users.noreply.github.com> Date: Sat, 19 Oct 2024 02:08:46 -0300 Subject: [PATCH 26/33] headers --- addons/medical_status/functions/fnc_getAllMedicationCount.sqf | 2 +- addons/medical_status/functions/fnc_getMedicationCount.sqf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/medical_status/functions/fnc_getAllMedicationCount.sqf b/addons/medical_status/functions/fnc_getAllMedicationCount.sqf index f10388dcff6..a412211c9f4 100644 --- a/addons/medical_status/functions/fnc_getAllMedicationCount.sqf +++ b/addons/medical_status/functions/fnc_getAllMedicationCount.sqf @@ -11,7 +11,7 @@ * Return Value: * Array of medication counts : * Dose Count - * Medication effectiveness (float) + * Medication effectiveness (0-1) * * Example: * [player] call ace_medical_status_fnc_getAllMedicationCount diff --git a/addons/medical_status/functions/fnc_getMedicationCount.sqf b/addons/medical_status/functions/fnc_getMedicationCount.sqf index 58f0aa95697..a0505337237 100644 --- a/addons/medical_status/functions/fnc_getMedicationCount.sqf +++ b/addons/medical_status/functions/fnc_getMedicationCount.sqf @@ -11,7 +11,7 @@ * * Return Value: * Dose Count - * Medication effectiveness (float) + * Medication effectiveness (0-1) * * Example: * [player, "Epinephrine"] call ace_medical_status_fnc_getMedicationCount From 90dbb850a76c641a26e59255734d98306f671d42 Mon Sep 17 00:00:00 2001 From: Grim <69561145+LinkIsGrim@users.noreply.github.com> Date: Sat, 19 Oct 2024 02:10:49 -0300 Subject: [PATCH 27/33] code cleanup --- .../medical_treatment/functions/fnc_medicationLocal.sqf | 2 +- .../medical_treatment/functions/fnc_onMedicationUsage.sqf | 2 +- addons/medical_treatment/functions/fnc_overDose.sqf | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/addons/medical_treatment/functions/fnc_medicationLocal.sqf b/addons/medical_treatment/functions/fnc_medicationLocal.sqf index b5a44051f07..5add34104b9 100644 --- a/addons/medical_treatment/functions/fnc_medicationLocal.sqf +++ b/addons/medical_treatment/functions/fnc_medicationLocal.sqf @@ -70,7 +70,7 @@ private _hrIncreaseLow = GET_ARRAY(_medicationConfig >> "hrIncreaseLow" private _hrIncreaseNormal = GET_ARRAY(_medicationConfig >> "hrIncreaseNormal",getArray (_defaultConfig >> "hrIncreaseNormal")); private _hrIncreaseHigh = GET_ARRAY(_medicationConfig >> "hrIncreaseHigh",getArray (_defaultConfig >> "hrIncreaseHigh")); private _incompatibleMedication = GET_ARRAY(_medicationConfig >> "incompatibleMedication",getArray (_defaultConfig >> "incompatibleMedication")); -private _dose = GET_NUMBER(_medicationConfig >> "dose",getNumber (_defaultConfig >> "dose")); +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)); diff --git a/addons/medical_treatment/functions/fnc_onMedicationUsage.sqf b/addons/medical_treatment/functions/fnc_onMedicationUsage.sqf index a13a263d498..c79680ace1d 100644 --- a/addons/medical_treatment/functions/fnc_onMedicationUsage.sqf +++ b/addons/medical_treatment/functions/fnc_onMedicationUsage.sqf @@ -45,4 +45,4 @@ if (_maxDose > 0) then { if (_inSystem> _xLimit) then { [_target, _classname] call FUNC(overDose); }; -} forEach _incompatibleMedication; \ No newline at end of file +} forEach _incompatibleMedication; diff --git a/addons/medical_treatment/functions/fnc_overDose.sqf b/addons/medical_treatment/functions/fnc_overDose.sqf index 53966e4120e..6535e4110cc 100644 --- a/addons/medical_treatment/functions/fnc_overDose.sqf +++ b/addons/medical_treatment/functions/fnc_overDose.sqf @@ -17,11 +17,11 @@ */ params ["_unit", "_classname"]; -private _medicationConfig = (configFile >> "ace_medical_treatment" >> _classname); +private _medicationConfig = configFile >> "ace_medical_treatment" >> _classname; private _onOverDose = getText (_medicationConfig >> "onOverDose"); -if (isClass (_medicationConfig)) then { - _medicationConfig = (_medicationConfig >> _classname); +if (isClass _medicationConfig) then { + _medicationConfig = _medicationConfig >> _classname; if (isText (_medicationConfig >> "onOverDose")) then { _onOverDose = getText (_medicationConfig >> "onOverDose"); }; @@ -36,4 +36,4 @@ if (!isNil "_onOverDose" && {isText _onOverDose}) then { } else { _onOverDose = missionNamespace getVariable _onOverDose; }; -[_target, _className] call _onOverDose; +[_target, _className] call _onOverDose From 522a496c8fca183b2bd6e059544034da135560e9 Mon Sep 17 00:00:00 2001 From: Grim <69561145+LinkIsGrim@users.noreply.github.com> Date: Sat, 19 Oct 2024 02:11:28 -0300 Subject: [PATCH 28/33] more headers --- addons/medical_status/functions/fnc_getAllMedicationCount.sqf | 2 +- addons/medical_status/functions/fnc_getMedicationCount.sqf | 2 +- addons/medical_treatment/functions/fnc_onMedicationUsage.sqf | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/medical_status/functions/fnc_getAllMedicationCount.sqf b/addons/medical_status/functions/fnc_getAllMedicationCount.sqf index a412211c9f4..250f4958ae2 100644 --- a/addons/medical_status/functions/fnc_getAllMedicationCount.sqf +++ b/addons/medical_status/functions/fnc_getAllMedicationCount.sqf @@ -1,6 +1,6 @@ #include "..\script_component.hpp" /* - * Author: PabstMirror, modified by Cplhardcore + * Author: PabstMirror, Cplhardcore * Gets effective count of all medications in a unit's system * (each medication dose is scaled from 0..1 based on time till max effect and max time in system) * diff --git a/addons/medical_status/functions/fnc_getMedicationCount.sqf b/addons/medical_status/functions/fnc_getMedicationCount.sqf index a0505337237..bdb0b529c3d 100644 --- a/addons/medical_status/functions/fnc_getMedicationCount.sqf +++ b/addons/medical_status/functions/fnc_getMedicationCount.sqf @@ -1,6 +1,6 @@ #include "..\script_component.hpp" /* - * Author: PabstMirror modified by Cplhardcore + * Author: PabstMirror, Cplhardcore * Gets effective count of medications in a unit's system * (each medication dose is scaled from 0..1 based on time till max effect and max time in system) * diff --git a/addons/medical_treatment/functions/fnc_onMedicationUsage.sqf b/addons/medical_treatment/functions/fnc_onMedicationUsage.sqf index c79680ace1d..c9662c92f32 100644 --- a/addons/medical_treatment/functions/fnc_onMedicationUsage.sqf +++ b/addons/medical_treatment/functions/fnc_onMedicationUsage.sqf @@ -1,6 +1,6 @@ #include "..\script_component.hpp" /* - * Author: Glowbal, modified by Cplhardcore + * Author: Glowbal, Cplhardcore * Handles the medication given to a patient. * * Arguments: From a5b65224fd8361992efaa072cfaa3b0007aeb8df Mon Sep 17 00:00:00 2001 From: Grim <69561145+LinkIsGrim@users.noreply.github.com> Date: Sat, 19 Oct 2024 02:11:43 -0300 Subject: [PATCH 29/33] drop unneeded _dose --- addons/medical_vitals/functions/fnc_handleUnitVitals.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/medical_vitals/functions/fnc_handleUnitVitals.sqf b/addons/medical_vitals/functions/fnc_handleUnitVitals.sqf index 05aeba5036f..77aec7fd621 100644 --- a/addons/medical_vitals/functions/fnc_handleUnitVitals.sqf +++ b/addons/medical_vitals/functions/fnc_handleUnitVitals.sqf @@ -81,7 +81,7 @@ private _adjustments = _unit getVariable [VAR_MEDICATIONS,[]]; if (_adjustments isNotEqualTo []) then { private _deleted = false; { - _x params ["_medication", "_timeAdded", "_timeTillMaxEffect", "_maxTimeInSystem", "_hrAdjust", "_painAdjust", "_flowAdjust", "_dose"]; + _x params ["_medication", "_timeAdded", "_timeTillMaxEffect", "_maxTimeInSystem", "_hrAdjust", "_painAdjust", "_flowAdjust"]; private _timeInSystem = CBA_missionTime - _timeAdded; if (_timeInSystem >= _maxTimeInSystem) then { _deleted = true; From 7703596971c2f4661a0485a1efb6933ac48e135f Mon Sep 17 00:00:00 2001 From: Grim <69561145+LinkIsGrim@users.noreply.github.com> Date: Sat, 19 Oct 2024 02:12:22 -0300 Subject: [PATCH 30/33] last header --- addons/medical_treatment/functions/fnc_medicationLocal.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/medical_treatment/functions/fnc_medicationLocal.sqf b/addons/medical_treatment/functions/fnc_medicationLocal.sqf index 5add34104b9..b48d7f3be4f 100644 --- a/addons/medical_treatment/functions/fnc_medicationLocal.sqf +++ b/addons/medical_treatment/functions/fnc_medicationLocal.sqf @@ -1,6 +1,6 @@ #include "..\script_component.hpp" /* - * Author: Glowbal, mharis001, modified by Cplhardcore + * Author: Glowbal, mharis001, Cplhardcore * Local callback for administering medication to a patient. * * Arguments: From 7e1e45ff4ed5e6203bade35c9573ae37f7b7c49c Mon Sep 17 00:00:00 2001 From: Grim <69561145+LinkIsGrim@users.noreply.github.com> Date: Sat, 19 Oct 2024 02:18:09 -0300 Subject: [PATCH 31/33] fix getting overdose func/code --- addons/medical_treatment/functions/fnc_overDose.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/medical_treatment/functions/fnc_overDose.sqf b/addons/medical_treatment/functions/fnc_overDose.sqf index 6535e4110cc..a40a50fc1b5 100644 --- a/addons/medical_treatment/functions/fnc_overDose.sqf +++ b/addons/medical_treatment/functions/fnc_overDose.sqf @@ -31,7 +31,7 @@ if (_onOverDose == "") exitWith { TRACE_1("CriticalVitals Event",_unit); [QEGVAR(medical,CriticalVitals), _unit] call CBA_fnc_localEvent; }; -if (!isNil "_onOverDose" && {isText _onOverDose}) then { +if (isNil _onOverDose) then { _onOverDose = compile _onOverDose; } else { _onOverDose = missionNamespace getVariable _onOverDose; From 85a51058f28d38dbe5106694f1b23e0b5d36cf6d Mon Sep 17 00:00:00 2001 From: Grim <69561145+LinkIsGrim@users.noreply.github.com> Date: Sat, 19 Oct 2024 02:21:19 -0300 Subject: [PATCH 32/33] whitespace --- addons/medical_treatment/functions/fnc_overDose.sqf | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/addons/medical_treatment/functions/fnc_overDose.sqf b/addons/medical_treatment/functions/fnc_overDose.sqf index a40a50fc1b5..bfb67cb1fb8 100644 --- a/addons/medical_treatment/functions/fnc_overDose.sqf +++ b/addons/medical_treatment/functions/fnc_overDose.sqf @@ -17,6 +17,7 @@ */ params ["_unit", "_classname"]; + private _medicationConfig = configFile >> "ace_medical_treatment" >> _classname; private _onOverDose = getText (_medicationConfig >> "onOverDose"); @@ -27,13 +28,16 @@ if (isClass _medicationConfig) then { }; }; TRACE_2("overdose",_classname,_onOverDose); + if (_onOverDose == "") exitWith { TRACE_1("CriticalVitals Event",_unit); [QEGVAR(medical,CriticalVitals), _unit] call CBA_fnc_localEvent; }; + if (isNil _onOverDose) then { _onOverDose = compile _onOverDose; } else { _onOverDose = missionNamespace getVariable _onOverDose; }; + [_target, _className] call _onOverDose From 31afab74f1dc869e4f102e7fe6a7d260dec252cb Mon Sep 17 00:00:00 2001 From: Grim <69561145+LinkIsGrim@users.noreply.github.com> Date: Sat, 19 Oct 2024 02:22:38 -0300 Subject: [PATCH 33/33] now the last header --- addons/medical_treatment/functions/fnc_overDose.sqf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/medical_treatment/functions/fnc_overDose.sqf b/addons/medical_treatment/functions/fnc_overDose.sqf index bfb67cb1fb8..c078bebdc3c 100644 --- a/addons/medical_treatment/functions/fnc_overDose.sqf +++ b/addons/medical_treatment/functions/fnc_overDose.sqf @@ -5,8 +5,8 @@ * * Arguments: * 0: The patient - * 1: Medication Treatment classname - * 2: Incompatable medication > + * 1: Medication classname + * 2: Incompatible medication * * Return Value: * None