diff --git a/addons/medical_ai/functions/fnc_healingLogic.sqf b/addons/medical_ai/functions/fnc_healingLogic.sqf index f3942ef632..6d10fc5e3b 100644 --- a/addons/medical_ai/functions/fnc_healingLogic.sqf +++ b/addons/medical_ai/functions/fnc_healingLogic.sqf @@ -70,7 +70,7 @@ switch (true) do { _treatmentArgs = [_healer, _target]; _treatmentTime = 15; }; - case (_isMedic && {GET_BLOOD_VOLUME(_target) < BLOOD_VOLUME_CLASS_2_HEMORRHAGE} + case (_isMedic && {GET_BLOOD_VOLUME(_target) < MINIMUM_BLOOD_FOR_STABLE_VITALS} && {([_healer, "@iv"] call FUNC(itemCheck)) # 0}): { // Check if patient's blood volume + remaining IV volume is enough to allow the patient to wake up private _totalIvVolume = 0; //in ml @@ -79,7 +79,7 @@ switch (true) do { _totalIvVolume = _totalIvVolume + _volumeRemaining; } forEach (_target getVariable [QEGVAR(medical,ivBags), []]); - if (GET_BLOOD_VOLUME(_target) + (_totalIvVolume / 1000) > BLOOD_VOLUME_CLASS_2_HEMORRHAGE) exitWith { + if (GET_BLOOD_VOLUME(_target) + (_totalIvVolume / 1000) > MINIMUM_BLOOD_FOR_STABLE_VITALS) exitWith { _treatmentEvent = "#waitForBlood"; }; _treatmentEvent = QEGVAR(medical_treatment,ivBagLocal); diff --git a/addons/medical_engine/XEH_preInit.sqf b/addons/medical_engine/XEH_preInit.sqf index da2ab02141..379b30da4b 100644 --- a/addons/medical_engine/XEH_preInit.sqf +++ b/addons/medical_engine/XEH_preInit.sqf @@ -9,6 +9,8 @@ PREP_RECOMPILE_END; #include "initSettings.sqf" // Define "Constants" variables (both are macros defined in script_macros_medical.hpp, look there for actual variable names) +if (isNil QUOTE(SPONTANEOUS_WAKE_UP_INTERVAL)) then {SPONTANEOUS_WAKE_UP_INTERVAL = SPONTANEOUS_WAKE_UP_INTERVAL_DEFAULT}; +if (isNil QUOTE(MINIMUM_BLOOD_FOR_STABLE_VITALS)) then {MINIMUM_BLOOD_FOR_STABLE_VITALS = MINIMUM_BLOOD_FOR_STABLE_VITALS_DEFAULT}; if (isNil QUOTE(HEAD_DAMAGE_THRESHOLD)) then {HEAD_DAMAGE_THRESHOLD = HEAD_DAMAGE_THRESHOLD_DEFAULT}; if (isNil QUOTE(ORGAN_DAMAGE_THRESHOLD)) then {ORGAN_DAMAGE_THRESHOLD = ORGAN_DAMAGE_THRESHOLD_DEFAULT}; if (isNil QUOTE(HEART_HIT_CHANCE)) then {HEART_HIT_CHANCE = HEART_HIT_CHANCE_DEFAULT}; diff --git a/addons/medical_engine/script_macros_medical.hpp b/addons/medical_engine/script_macros_medical.hpp index 2924d83b13..1f1f2c5aba 100644 --- a/addons/medical_engine/script_macros_medical.hpp +++ b/addons/medical_engine/script_macros_medical.hpp @@ -54,6 +54,10 @@ #define BLOOD_VOLUME_CLASS_4_HEMORRHAGE 3.600 // lost more than 40% blood, Class IV Hemorrhage #define BLOOD_VOLUME_FATAL 3.0 // Lost more than 50% blood, Unrecoverable +// Minimum blood volume, in liters, for a patient to have the chance to wake up +#define MINIMUM_BLOOD_FOR_STABLE_VITALS EGVAR(medical,const_stableVitalsBloodThreshold) +#define MINIMUM_BLOOD_FOR_STABLE_VITALS_DEFAULT BLOOD_VOLUME_CLASS_2_HEMORRHAGE + // IV Change per second calculation: // 250 ml should take 60 seconds to fill. 250 ml / 60 s ~ 4.1667 ml/s. #define IV_CHANGE_PER_SECOND 4.1667 // in milliliters per second @@ -72,7 +76,7 @@ #define DAMAGE_BLUE_THRESHOLD 0.8 #define DAMAGE_TOTAL_COLORS 10 -// --- pain +// Pain above which a unit can go unconscious upon receiving damage #define PAIN_UNCONSCIOUS EGVAR(medical,painUnconsciousThreshold) // Pain fade out time (time it takes until pain is guaranteed to be completly gone) @@ -84,7 +88,8 @@ #define PAIN_SUPPRESSION_FADE_TIME 1800 // Chance to wake up when vitals are stable (checked once every SPONTANEOUS_WAKE_UP_INTERVAL seconds) -#define SPONTANEOUS_WAKE_UP_INTERVAL 15 +#define SPONTANEOUS_WAKE_UP_INTERVAL EGVAR(medical,const_wakeUpCheckInterval) +#define SPONTANEOUS_WAKE_UP_INTERVAL_DEFAULT 15 // Minimum leg damage required for limping #define LIMPING_DAMAGE_THRESHOLD EGVAR(medical,const_limpingDamageThreshold) diff --git a/addons/medical_status/functions/fnc_hasStableVitals.sqf b/addons/medical_status/functions/fnc_hasStableVitals.sqf index 90e2caac93..1c98b89e74 100644 --- a/addons/medical_status/functions/fnc_hasStableVitals.sqf +++ b/addons/medical_status/functions/fnc_hasStableVitals.sqf @@ -17,7 +17,7 @@ params ["_unit"]; -if (GET_BLOOD_VOLUME(_unit) < BLOOD_VOLUME_CLASS_2_HEMORRHAGE) exitWith { false }; +if (GET_BLOOD_VOLUME(_unit) < MINIMUM_BLOOD_FOR_STABLE_VITALS) exitWith { false }; if IN_CRDC_ARRST(_unit) exitWith { false }; private _cardiacOutput = [_unit] call FUNC(getCardiacOutput);