From 0f0d0b459b4700fd9c9b0f913c64ef53e16123d9 Mon Sep 17 00:00:00 2001
From: Serg Vergun <1197314+severgun@users.noreply.github.com>
Date: Wed, 25 Aug 2021 19:04:42 +0300
Subject: [PATCH 1/6] Add PAIN_UNCONSCIOUS slider
Add PAIN_UNCONSCIOUS slider to ACE Medical settings
---
addons/medical_damage/functions/fnc_woundsHandler.sqf | 2 +-
addons/medical_damage/functions/fnc_woundsHandlerSQF.sqf | 2 +-
addons/medical_damage/initSettings.sqf | 9 +++++++++
addons/medical_damage/stringtable.xml | 8 ++++++++
4 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/addons/medical_damage/functions/fnc_woundsHandler.sqf b/addons/medical_damage/functions/fnc_woundsHandler.sqf
index 049437fdf5b..98101046912 100644
--- a/addons/medical_damage/functions/fnc_woundsHandler.sqf
+++ b/addons/medical_damage/functions/fnc_woundsHandler.sqf
@@ -134,7 +134,7 @@ _bodyPartVisParams call EFUNC(medical_engine,updateBodyPartVisuals);
[QEGVAR(medical,injured), [_unit, _painLevel]] call CBA_fnc_localEvent;
-if (_critialDamage || {_painLevel > PAIN_UNCONSCIOUS}) then {
+if (_critialDamage || {_painLevel >= PAIN_UNCONSCIOUS}) then {
[_unit] call FUNC(handleIncapacitation);
};
diff --git a/addons/medical_damage/functions/fnc_woundsHandlerSQF.sqf b/addons/medical_damage/functions/fnc_woundsHandlerSQF.sqf
index b0de1f6e4ab..3c5f0d9c17f 100644
--- a/addons/medical_damage/functions/fnc_woundsHandlerSQF.sqf
+++ b/addons/medical_damage/functions/fnc_woundsHandlerSQF.sqf
@@ -201,7 +201,7 @@ _bodyPartVisParams call EFUNC(medical_engine,updateBodyPartVisuals);
[QEGVAR(medical,injured), [_unit, _painLevel]] call CBA_fnc_localEvent;
-if (_critialDamage || {_painLevel > PAIN_UNCONSCIOUS}) then {
+if (_critialDamage || {_painLevel >= PAIN_UNCONSCIOUS}) then {
[_unit] call FUNC(handleIncapacitation);
};
diff --git a/addons/medical_damage/initSettings.sqf b/addons/medical_damage/initSettings.sqf
index 14dac50f1a5..c8918195d27 100644
--- a/addons/medical_damage/initSettings.sqf
+++ b/addons/medical_damage/initSettings.sqf
@@ -34,6 +34,15 @@
true
] call CBA_fnc_addSetting;
+[
+ QEGVAR(medical,const_painUnconscious),
+ "SLIDER",
+ [LSTRING(PainUnconsciousThreshold_DisplayName), LSTRING(PainUnconsciousThreshold_Description)],
+ ELSTRING(medical,Category),
+ [0, 1, 0.5, 2, false],
+ true
+] call CBA_fnc_addSetting;
+
[
QEGVAR(medical,deathChance),
"SLIDER",
diff --git a/addons/medical_damage/stringtable.xml b/addons/medical_damage/stringtable.xml
index 7d3619e9ded..45933296ccc 100644
--- a/addons/medical_damage/stringtable.xml
+++ b/addons/medical_damage/stringtable.xml
@@ -705,6 +705,14 @@
La probabilidad de que una persona caiga inconsciente cuando su dolor está por encima del umbral al haber recibido daño.
La probabilité pour qu'une personne perde connaissance lorsque la douleur ressentie est supérieure à son seuil de tolérance.
+
+ Pain Unconscious Threshold
+ Порог боли для потери сознания
+
+
+ Sets the amount of pain from the received wound, at which a unit can lose consciousness.
+ Устанавливает количество боли от полученной травмы, при котором юнит может потерять сознание.
+
Fatal Injury Death Chance
Вероятность смерти от смертельной травмы
From b37652c767af6750c7c1a18ae96cb8d2c4cf7951 Mon Sep 17 00:00:00 2001
From: Serg Vergun <1197314+severgun@users.noreply.github.com>
Date: Wed, 25 Aug 2021 19:37:16 +0300
Subject: [PATCH 2/6] fix GVAR name
---
addons/medical_damage/initSettings.sqf | 2 +-
addons/medical_engine/script_macros_medical.hpp | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/addons/medical_damage/initSettings.sqf b/addons/medical_damage/initSettings.sqf
index c8918195d27..0ce21319e2a 100644
--- a/addons/medical_damage/initSettings.sqf
+++ b/addons/medical_damage/initSettings.sqf
@@ -35,7 +35,7 @@
] call CBA_fnc_addSetting;
[
- QEGVAR(medical,const_painUnconscious),
+ QEGVAR(medical,painUnconsciousThreshold),
"SLIDER",
[LSTRING(PainUnconsciousThreshold_DisplayName), LSTRING(PainUnconsciousThreshold_Description)],
ELSTRING(medical,Category),
diff --git a/addons/medical_engine/script_macros_medical.hpp b/addons/medical_engine/script_macros_medical.hpp
index f2d4fb9a094..2f70ad40d3e 100644
--- a/addons/medical_engine/script_macros_medical.hpp
+++ b/addons/medical_engine/script_macros_medical.hpp
@@ -73,7 +73,7 @@
#define DAMAGE_TOTAL_COLORS 10
// --- pain
-#define PAIN_UNCONSCIOUS EGVAR(medical,const_painUnconscious)
+#define PAIN_UNCONSCIOUS EGVAR(medical,painUnconsciousThreshold)
#define PAIN_UNCONSCIOUS_DEFAULT 0.5
// Pain fade out time (time it takes until pain is guaranteed to be completly gone)
From 9aad293b58f7bafbc1b9b1dc0aa51f1661ac9a5c Mon Sep 17 00:00:00 2001
From: Serg Vergun <1197314+severgun@users.noreply.github.com>
Date: Wed, 1 Sep 2021 21:04:52 +0300
Subject: [PATCH 3/6] Update addons/medical_damage/stringtable.xml
Co-authored-by: Salluci <69561145+Salluci@users.noreply.github.com>
---
addons/medical_damage/stringtable.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/addons/medical_damage/stringtable.xml b/addons/medical_damage/stringtable.xml
index 45933296ccc..297a7a2c8e0 100644
--- a/addons/medical_damage/stringtable.xml
+++ b/addons/medical_damage/stringtable.xml
@@ -710,7 +710,7 @@
Порог боли для потери сознания
- Sets the amount of pain from the received wound, at which a unit can lose consciousness.
+ Sets the threshold for severe pain, at which unit can lose consciouness when receiving a wound.
Устанавливает количество боли от полученной травмы, при котором юнит может потерять сознание.
From c6ea8bceb10c82486a3ee57a798793e728687272 Mon Sep 17 00:00:00 2001
From: Serg Vergun <1197314+severgun@users.noreply.github.com>
Date: Thu, 2 Sep 2021 15:38:14 +0300
Subject: [PATCH 4/6] Update addons/medical_damage/stringtable.xml
Co-authored-by: jonpas
---
addons/medical_damage/stringtable.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/addons/medical_damage/stringtable.xml b/addons/medical_damage/stringtable.xml
index 297a7a2c8e0..df893e44716 100644
--- a/addons/medical_damage/stringtable.xml
+++ b/addons/medical_damage/stringtable.xml
@@ -710,7 +710,7 @@
Порог боли для потери сознания
- Sets the threshold for severe pain, at which unit can lose consciouness when receiving a wound.
+ Sets the threshold for severe pain, at which unit can lose consciousness when receiving a wound.
Устанавливает количество боли от полученной травмы, при котором юнит может потерять сознание.
From 085fa8c8667a79ab89daed9c2721ae113e27c5de Mon Sep 17 00:00:00 2001
From: LinkIsGrim
Date: Sat, 29 Jul 2023 08:39:51 +0300
Subject: [PATCH 5/6] stringtable
---
addons/medical_damage/stringtable.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/addons/medical_damage/stringtable.xml b/addons/medical_damage/stringtable.xml
index 3197e617f5d..74c29d97a71 100644
--- a/addons/medical_damage/stringtable.xml
+++ b/addons/medical_damage/stringtable.xml
@@ -782,7 +782,7 @@
Порог боли для потери сознания
- Sets the threshold for severe pain, at which unit can lose consciousness when receiving a wound.
+ Sets the threshold for severe pain, above which a person can fall unconscious upon receiving damage.
Устанавливает количество боли от полученной травмы, при котором юнит может потерять сознание.
From 48091dc305f7b6a93cdad95a59409d8a9a120ec6 Mon Sep 17 00:00:00 2001
From: PabstMirror
Date: Thu, 3 Aug 2023 21:25:47 -0500
Subject: [PATCH 6/6] remove setter in preInit and cleanup
PAIN_UNCONSCIOUS_DEFAULT
---
addons/medical_engine/XEH_preInit.sqf | 1 -
addons/medical_engine/script_macros_medical.hpp | 1 -
2 files changed, 2 deletions(-)
diff --git a/addons/medical_engine/XEH_preInit.sqf b/addons/medical_engine/XEH_preInit.sqf
index 8157baa4ec5..da2ab02141c 100644
--- a/addons/medical_engine/XEH_preInit.sqf
+++ b/addons/medical_engine/XEH_preInit.sqf
@@ -14,7 +14,6 @@ if (isNil QUOTE(ORGAN_DAMAGE_THRESHOLD)) then {ORGAN_DAMAGE_THRESHOLD = ORGAN_DA
if (isNil QUOTE(HEART_HIT_CHANCE)) then {HEART_HIT_CHANCE = HEART_HIT_CHANCE_DEFAULT};
if (isNil QUOTE(PENETRATION_THRESHOLD)) then {PENETRATION_THRESHOLD = PENETRATION_THRESHOLD_DEFAULT};
if (isNil QUOTE(BLOOD_LOSS_KNOCK_OUT_THRESHOLD)) then {BLOOD_LOSS_KNOCK_OUT_THRESHOLD = BLOOD_LOSS_KNOCK_OUT_THRESHOLD_DEFAULT};
-if (isNil QUOTE(PAIN_UNCONSCIOUS)) then {PAIN_UNCONSCIOUS = PAIN_UNCONSCIOUS_DEFAULT};
if (isNil QUOTE(PAIN_FADE_TIME)) then {PAIN_FADE_TIME = PAIN_FADE_TIME_DEFAULT};
if (isNil QUOTE(LIMPING_DAMAGE_THRESHOLD)) then {LIMPING_DAMAGE_THRESHOLD = LIMPING_DAMAGE_THRESHOLD_DEFAULT};
if (isNil QUOTE(FRACTURE_DAMAGE_THRESHOLD)) then {FRACTURE_DAMAGE_THRESHOLD = FRACTURE_DAMAGE_THRESHOLD_DEFAULT};
diff --git a/addons/medical_engine/script_macros_medical.hpp b/addons/medical_engine/script_macros_medical.hpp
index 1ddb3077fc1..2924d83b132 100644
--- a/addons/medical_engine/script_macros_medical.hpp
+++ b/addons/medical_engine/script_macros_medical.hpp
@@ -74,7 +74,6 @@
// --- pain
#define PAIN_UNCONSCIOUS EGVAR(medical,painUnconsciousThreshold)
-#define PAIN_UNCONSCIOUS_DEFAULT 0.5
// Pain fade out time (time it takes until pain is guaranteed to be completly gone)
#define PAIN_FADE_TIME EGVAR(medical,const_painFadeTime)