From 57d91377973cf5b6fddd5eee857724e24d85ec80 Mon Sep 17 00:00:00 2001 From: Daniel Gibson Date: Tue, 2 Jun 2020 16:58:44 -0400 Subject: [PATCH 1/8] Added Bandage Reopening Chance Modifier --- .../medical_treatment/functions/fnc_handleBandageOpening.sqf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/medical_treatment/functions/fnc_handleBandageOpening.sqf b/addons/medical_treatment/functions/fnc_handleBandageOpening.sqf index f2966d5f9ce..7e3bb69039f 100644 --- a/addons/medical_treatment/functions/fnc_handleBandageOpening.sqf +++ b/addons/medical_treatment/functions/fnc_handleBandageOpening.sqf @@ -26,7 +26,7 @@ private _className = EGVAR(medical_damage,woundClassNamesComplex) select _classI private _reopeningChance = DEFAULT_BANDAGE_REOPENING_CHANCE; private _reopeningMinDelay = DEFAULT_BANDAGE_REOPENING_MIN_DELAY; private _reopeningMaxDelay = DEFAULT_BANDAGE_REOPENING_MAX_DELAY; - +private _reopeningModifer = 0.5; // Get the default values for the used bandage private _config = configFile >> QUOTE(ADDON) >> "Bandaging"; @@ -84,7 +84,7 @@ _target setVariable [VAR_BANDAGED_WOUNDS, _bandagedWounds, true]; TRACE_1("",_reopeningChance); // Check if we are ever going to reopen this -if (random 1 <= _reopeningChance) then { +if (random 1 <= _reopeningChance * _reopeningModifer) then { private _delay = _reopeningMinDelay + random (_reopeningMaxDelay - _reopeningMinDelay); TRACE_1("Will open",_delay); [{ From 6492d65b99fde28c2f869627dc9c6dca8904ead4 Mon Sep 17 00:00:00 2001 From: Daniel Gibson Date: Tue, 2 Jun 2020 17:16:16 -0400 Subject: [PATCH 2/8] Added Wound Reopen Chance Addon Setting --- .../functions/fnc_handleBandageOpening.sqf | 2 +- addons/medical_treatment/initSettings.sqf | 10 ++++++++++ addons/medical_treatment/stringtable.xml | 12 ++++++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/addons/medical_treatment/functions/fnc_handleBandageOpening.sqf b/addons/medical_treatment/functions/fnc_handleBandageOpening.sqf index 7e3bb69039f..cfd7fac08cf 100644 --- a/addons/medical_treatment/functions/fnc_handleBandageOpening.sqf +++ b/addons/medical_treatment/functions/fnc_handleBandageOpening.sqf @@ -26,7 +26,7 @@ private _className = EGVAR(medical_damage,woundClassNamesComplex) select _classI private _reopeningChance = DEFAULT_BANDAGE_REOPENING_CHANCE; private _reopeningMinDelay = DEFAULT_BANDAGE_REOPENING_MIN_DELAY; private _reopeningMaxDelay = DEFAULT_BANDAGE_REOPENING_MAX_DELAY; -private _reopeningModifer = 0.5; +private _reopeningModifer = GVAR(woundReopenChance); // Get the default values for the used bandage private _config = configFile >> QUOTE(ADDON) >> "Bandaging"; diff --git a/addons/medical_treatment/initSettings.sqf b/addons/medical_treatment/initSettings.sqf index f027b23b57a..004e0d08c28 100644 --- a/addons/medical_treatment/initSettings.sqf +++ b/addons/medical_treatment/initSettings.sqf @@ -25,6 +25,16 @@ true ] call CBA_settings_fnc_init; +[ + QGVAR(woundReopenChance), + "SLIDER", + [LSTRING(WoundReopenChance_DisplayName), LSTRING(WoundReopenChance_Description)], + [ELSTRING[medical,Category, LSTRING(SubCategory_Treatment)], + [0, 2, 1, 2, true], + true + call CBA_settings_fnc_init; +] + [ QGVAR(clearTraumaAfterBandage), "CHECKBOX", diff --git a/addons/medical_treatment/stringtable.xml b/addons/medical_treatment/stringtable.xml index fe7e0216d7b..ef1f8349020 100644 --- a/addons/medical_treatment/stringtable.xml +++ b/addons/medical_treatment/stringtable.xml @@ -106,6 +106,18 @@ 有効 & 再開放 Zapnuto & Úrazy se mohou znovu otevřít Включено и может открыться заново + + + Wound Reopen Chance + Chance de réouverture de blessure + Zranění ran znovu + Рана вновь открывается шанс + + + Enabled & Can Reopen + Contrôle les chances de réouverture des blessures si les bandages avancés, la réouverture peut être activée. Une valeur de 2 est de 200%, tandis qu'une valeur de 0 est de 0%. + Řídí šanci na opětovné otevření ran, pokud je povoleno Advanced Bandage, Can Reopen. Hodnota 2 je 200%, zatímco hodnota 0 je 0%. + Управляет шансом повторного открытия ран, если включены дополнительные повязки, Can Reopen. Значение 2 составляет 200%, а значение 0 - 0%. Clear Trauma After Bandage From 58d06bc41d08092a6007ac70102b97807c0f9476 Mon Sep 17 00:00:00 2001 From: Daniel Gibson Date: Tue, 2 Jun 2020 17:18:51 -0400 Subject: [PATCH 3/8] Fixed dumb error in localization setup --- addons/medical_treatment/stringtable.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/medical_treatment/stringtable.xml b/addons/medical_treatment/stringtable.xml index ef1f8349020..7716ca4b845 100644 --- a/addons/medical_treatment/stringtable.xml +++ b/addons/medical_treatment/stringtable.xml @@ -113,8 +113,8 @@ Zranění ran znovu Рана вновь открывается шанс - - Enabled & Can Reopen + + Controls the chance of wounds reopening if Advanced Bandages, Can Reopen is enabled. A value of 2 is 200%, while a value of 0 is 0%. Contrôle les chances de réouverture des blessures si les bandages avancés, la réouverture peut être activée. Une valeur de 2 est de 200%, tandis qu'une valeur de 0 est de 0%. Řídí šanci na opětovné otevření ran, pokud je povoleno Advanced Bandage, Can Reopen. Hodnota 2 je 200%, zatímco hodnota 0 je 0%. Управляет шансом повторного открытия ран, если включены дополнительные повязки, Can Reopen. Значение 2 составляет 200%, а значение 0 - 0%. From a2ebd59a12c8418fcb9be37601fe4fa25d0f1b01 Mon Sep 17 00:00:00 2001 From: Daniel Gibson Date: Tue, 2 Jun 2020 20:25:18 -0400 Subject: [PATCH 4/8] Credit! --- AUTHORS.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS.txt b/AUTHORS.txt index 83fe4d0fb73..cbe4ed55d7c 100644 --- a/AUTHORS.txt +++ b/AUTHORS.txt @@ -63,6 +63,7 @@ Codingboy Coren Crusty C0kkie +dgibso29 Dharma Bellamkonda Dimaslg diwako From 3dd73e6f3e692e6b7812e427b8494bc0244e6e52 Mon Sep 17 00:00:00 2001 From: Daniel Gibson Date: Tue, 2 Jun 2020 22:17:00 -0400 Subject: [PATCH 5/8] Resolved issue with Addon Settings definition & removed testing values. --- .../functions/fnc_handleBandageOpening.sqf | 3 ++- addons/medical_treatment/initSettings.sqf | 7 +++---- addons/medical_treatment/stringtable.xml | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/addons/medical_treatment/functions/fnc_handleBandageOpening.sqf b/addons/medical_treatment/functions/fnc_handleBandageOpening.sqf index cfd7fac08cf..4ed5d008e48 100644 --- a/addons/medical_treatment/functions/fnc_handleBandageOpening.sqf +++ b/addons/medical_treatment/functions/fnc_handleBandageOpening.sqf @@ -27,6 +27,7 @@ private _reopeningChance = DEFAULT_BANDAGE_REOPENING_CHANCE; private _reopeningMinDelay = DEFAULT_BANDAGE_REOPENING_MIN_DELAY; private _reopeningMaxDelay = DEFAULT_BANDAGE_REOPENING_MAX_DELAY; private _reopeningModifer = GVAR(woundReopenChance); + // Get the default values for the used bandage private _config = configFile >> QUOTE(ADDON) >> "Bandaging"; @@ -43,7 +44,7 @@ if (isClass (_config >> _className)) then { private _woundTreatmentConfig = _config >> _className; if (isNumber (_woundTreatmentConfig >> "reopeningChance")) then { - _reopeningChance = getNumber (_woundTreatmentConfig >> "reopeningChance"); + _reopeningChance = getNumber (_woundTreatmentConfig >> "reopeningChance"); }; if (isNumber (_woundTreatmentConfig >> "reopeningMinDelay")) then { diff --git a/addons/medical_treatment/initSettings.sqf b/addons/medical_treatment/initSettings.sqf index 004e0d08c28..b765e103152 100644 --- a/addons/medical_treatment/initSettings.sqf +++ b/addons/medical_treatment/initSettings.sqf @@ -29,11 +29,10 @@ QGVAR(woundReopenChance), "SLIDER", [LSTRING(WoundReopenChance_DisplayName), LSTRING(WoundReopenChance_Description)], - [ELSTRING[medical,Category, LSTRING(SubCategory_Treatment)], - [0, 2, 1, 2, true], + [ELSTRING(medical,Category), LSTRING(SubCategory_Treatment)], + [0, 2, 1, 2], true - call CBA_settings_fnc_init; -] +] call CBA_settings_fnc_init; [ QGVAR(clearTraumaAfterBandage), diff --git a/addons/medical_treatment/stringtable.xml b/addons/medical_treatment/stringtable.xml index 7716ca4b845..0eaec81ebbe 100644 --- a/addons/medical_treatment/stringtable.xml +++ b/addons/medical_treatment/stringtable.xml @@ -107,13 +107,13 @@ Zapnuto & Úrazy se mohou znovu otevřít Включено и может открыться заново - + Wound Reopen Chance Chance de réouverture de blessure Zranění ran znovu Рана вновь открывается шанс - + Controls the chance of wounds reopening if Advanced Bandages, Can Reopen is enabled. A value of 2 is 200%, while a value of 0 is 0%. Contrôle les chances de réouverture des blessures si les bandages avancés, la réouverture peut être activée. Une valeur de 2 est de 200%, tandis qu'une valeur de 0 est de 0%. Řídí šanci na opětovné otevření ran, pokud je povoleno Advanced Bandage, Can Reopen. Hodnota 2 je 200%, zatímco hodnota 0 je 0%. From 4b430fc55e4a06e4f33eb89469da1ad4ba1171ce Mon Sep 17 00:00:00 2001 From: Daniel Gibson Date: Wed, 3 Jun 2020 08:23:13 -0400 Subject: [PATCH 6/8] PR Feedback #1 - Removed unnecessary whitespace on LN 46 - Call global var directly at LN 87 - Updated Wound Reopen Chance localized name & description --- .../functions/fnc_handleBandageOpening.sqf | 5 ++--- addons/medical_treatment/stringtable.xml | 18 ++++++++++-------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/addons/medical_treatment/functions/fnc_handleBandageOpening.sqf b/addons/medical_treatment/functions/fnc_handleBandageOpening.sqf index 4ed5d008e48..daa8b5f2eff 100644 --- a/addons/medical_treatment/functions/fnc_handleBandageOpening.sqf +++ b/addons/medical_treatment/functions/fnc_handleBandageOpening.sqf @@ -26,7 +26,6 @@ private _className = EGVAR(medical_damage,woundClassNamesComplex) select _classI private _reopeningChance = DEFAULT_BANDAGE_REOPENING_CHANCE; private _reopeningMinDelay = DEFAULT_BANDAGE_REOPENING_MIN_DELAY; private _reopeningMaxDelay = DEFAULT_BANDAGE_REOPENING_MAX_DELAY; -private _reopeningModifer = GVAR(woundReopenChance); // Get the default values for the used bandage private _config = configFile >> QUOTE(ADDON) >> "Bandaging"; @@ -44,7 +43,7 @@ if (isClass (_config >> _className)) then { private _woundTreatmentConfig = _config >> _className; if (isNumber (_woundTreatmentConfig >> "reopeningChance")) then { - _reopeningChance = getNumber (_woundTreatmentConfig >> "reopeningChance"); + _reopeningChance = getNumber (_woundTreatmentConfig >> "reopeningChance"); }; if (isNumber (_woundTreatmentConfig >> "reopeningMinDelay")) then { @@ -85,7 +84,7 @@ _target setVariable [VAR_BANDAGED_WOUNDS, _bandagedWounds, true]; TRACE_1("",_reopeningChance); // Check if we are ever going to reopen this -if (random 1 <= _reopeningChance * _reopeningModifer) then { +if (random 1 <= _reopeningChance * GVAR(woundReopenChance)) then { private _delay = _reopeningMinDelay + random (_reopeningMaxDelay - _reopeningMinDelay); TRACE_1("Will open",_delay); [{ diff --git a/addons/medical_treatment/stringtable.xml b/addons/medical_treatment/stringtable.xml index 0eaec81ebbe..aa8fd651def 100644 --- a/addons/medical_treatment/stringtable.xml +++ b/addons/medical_treatment/stringtable.xml @@ -108,16 +108,18 @@ Включено и может открыться заново - Wound Reopen Chance - Chance de réouverture de blessure - Zranění ran znovu - Рана вновь открывается шанс + Wound Reopening Coefficient + Coefficient de réouverture des plaies + Wundwiederöffnungskoeffizient + Koeficient opětovného otevření rány + Коэффициент повторного открытия раны - Controls the chance of wounds reopening if Advanced Bandages, Can Reopen is enabled. A value of 2 is 200%, while a value of 0 is 0%. - Contrôle les chances de réouverture des blessures si les bandages avancés, la réouverture peut être activée. Une valeur de 2 est de 200%, tandis qu'une valeur de 0 est de 0%. - Řídí šanci na opětovné otevření ran, pokud je povoleno Advanced Bandage, Can Reopen. Hodnota 2 je 200%, zatímco hodnota 0 je 0%. - Управляет шансом повторного открытия ран, если включены дополнительные повязки, Can Reopen. Значение 2 составляет 200%, а значение 0 - 0%. + Coefficient for controlling the wound reopening chance. The final reopening chance is determined by multiplying this value with the specific reopening chance for the wound type and bandage used. + Coefficient de contrôle des chances de réouverture de la plaie. La chance de réouverture finale est déterminée en multipliant cette valeur par la chance de réouverture spécifique pour le type de plaie et le bandage utilisés. + Koeffizient zur Kontrolle der Wundöffnungswahrscheinlichkeit. Die endgültige Wiedereröffnungschance wird bestimmt, indem dieser Wert mit der spezifischen Wiedereröffnungschance für den verwendeten Wundtyp und Verband multipliziert wird. + Koeficient pro řízení šance na opětovné otevření rány. Konečná šance na opětovné otevření se stanoví vynásobením této hodnoty specifickou šancí na opětovné otevření pro použitý typ rány a obvaz. + Коэффициент контроля вероятности повторного открытия раны. Окончательный шанс повторного открытия определяется путем умножения этого значения на определенный шанс повторного открытия для используемого типа раны и повязки. Clear Trauma After Bandage From 5473c72e237d275d227e5c263b1dd8b55b300eca Mon Sep 17 00:00:00 2001 From: Daniel Gibson Date: Wed, 3 Jun 2020 10:21:02 -0400 Subject: [PATCH 7/8] PR Feedback #2 - Increased reopen coefficient upper limit from 2 to 5. --- addons/medical_treatment/initSettings.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/medical_treatment/initSettings.sqf b/addons/medical_treatment/initSettings.sqf index b765e103152..3b68a0409f2 100644 --- a/addons/medical_treatment/initSettings.sqf +++ b/addons/medical_treatment/initSettings.sqf @@ -30,7 +30,7 @@ "SLIDER", [LSTRING(WoundReopenChance_DisplayName), LSTRING(WoundReopenChance_Description)], [ELSTRING(medical,Category), LSTRING(SubCategory_Treatment)], - [0, 2, 1, 2], + [0, 5, 1, 2], true ] call CBA_settings_fnc_init; From 200d38f8fe4f6ff83280d8f6a7524d71b77bc038 Mon Sep 17 00:00:00 2001 From: Daniel Gibson Date: Wed, 3 Jun 2020 10:24:14 -0400 Subject: [PATCH 8/8] Changed author credit to reflect GitHub email. --- AUTHORS.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AUTHORS.txt b/AUTHORS.txt index cbe4ed55d7c..dfcbff9d996 100644 --- a/AUTHORS.txt +++ b/AUTHORS.txt @@ -63,7 +63,7 @@ Codingboy Coren Crusty C0kkie -dgibso29 +dgibso29 Dharma Bellamkonda Dimaslg diwako