diff --git a/AUTHORS.txt b/AUTHORS.txt index 96f11a8f44..1540880b8b 100644 --- a/AUTHORS.txt +++ b/AUTHORS.txt @@ -41,6 +41,7 @@ Alganthe Andrea "AtixNeon" Verano Anthariel Anton +Arcanum417 Arkhir Asgar Serran BaerMitUmlaut diff --git a/addons/medical_treatment/ACE_Medical_Treatment_Actions.hpp b/addons/medical_treatment/ACE_Medical_Treatment_Actions.hpp index eda67eda38..6d1335701b 100644 --- a/addons/medical_treatment/ACE_Medical_Treatment_Actions.hpp +++ b/addons/medical_treatment/ACE_Medical_Treatment_Actions.hpp @@ -306,6 +306,7 @@ class GVAR(Actions) { items[] = {"ACE_medKit"}; treatmentLocations[] = {QEGVAR(medical,useLocation_MedKit)}; requiredMedic = QEGVAR(medical,medicSetting_MedKit); + treatmentTime = QUOTE(_target call FUNC(HealTimeMedkit)); callbackSuccess = QFUNC(treatmentPartialHeal); itemConsumed = QEGVAR(medical,consumeItem_MedKit); }; diff --git a/addons/medical_treatment/ACE_Settings.hpp b/addons/medical_treatment/ACE_Settings.hpp index 2fce6faa6b..ef2baa1b6e 100644 --- a/addons/medical_treatment/ACE_Settings.hpp +++ b/addons/medical_treatment/ACE_Settings.hpp @@ -30,4 +30,18 @@ class ACE_Settings { typeName = "BOOL"; value = 1; }; + class EGVAR(medical,MedkitTime) { + category = ECSTRING(medical,Category_Medical); + displayName = CSTRING(MedkitTime); + description = CSTRING(MedkitTime_Description); + typeName = "SCALAR"; + value = 0; + }; + class EGVAR(medical,PAKTime) { + category = ECSTRING(medical,Category_Medical); + displayName = CSTRING(PAKTime); + description = CSTRING(PAKTime_Description); + typeName = "SCALAR"; + value = 0; + }; }; diff --git a/addons/medical_treatment/XEH_PREP.hpp b/addons/medical_treatment/XEH_PREP.hpp index be8f316967..451ad2ead7 100644 --- a/addons/medical_treatment/XEH_PREP.hpp +++ b/addons/medical_treatment/XEH_PREP.hpp @@ -46,6 +46,7 @@ PREP(dropDownTriageCard); PREP(getTriageStatus); PREP(handleBandageOpening); PREP(healTime); +PREP(HealTimeMedkit); PREP(isBeingCarried); PREP(isBeingDragged); PREP(onMedicationUsage); diff --git a/addons/medical_treatment/config.cpp b/addons/medical_treatment/config.cpp index 9dad6833f9..0791254619 100644 --- a/addons/medical_treatment/config.cpp +++ b/addons/medical_treatment/config.cpp @@ -8,7 +8,7 @@ class CfgPatches { requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"ace_medical"}; author = ECSTRING(common,ACETeam); - authors[] = {""}; + authors[] = {"Glowbal", "KoffeinFlummi", "Arcanum"}; url = ECSTRING(main,URL); VERSION_CONFIG; }; diff --git a/addons/medical_treatment/functions/fnc_HealTimeMedkit.sqf b/addons/medical_treatment/functions/fnc_HealTimeMedkit.sqf new file mode 100644 index 0000000000..28e58c40b1 --- /dev/null +++ b/addons/medical_treatment/functions/fnc_HealTimeMedkit.sqf @@ -0,0 +1,31 @@ +/* + * Author: Ruthberg, Arcanum + * Calculates the personal aid kit treatment time based on amount of damage to heal + * + * Arguments: + * unit + * + * Return Value: + * treatment time + * + * Example: + * [_target] call ace_medical_treatment_fnc_HealTimeMedkit + * + * Public: No + */ +#include "script_component.hpp" + +params ["_unit"]; + +private _totalDamage = 0; +private _treatTime = 0; + +{ + _totalDamage = _totalDamage + _x; +} forEach (_unit getVariable [QEGVAR(medical,bodyPartDamage), []]); +if (EGVAR(medical,MedkitTime) > 0) then { + _treatTime = EGVAR(medical,MedkitTime); +} else { + _treatTime = 10 max (_totalDamage * 5) min 180; +}; +_treatTime diff --git a/addons/medical_treatment/functions/fnc_healTime.sqf b/addons/medical_treatment/functions/fnc_healTime.sqf index 9f0c4adfbc..5178d50a1f 100644 --- a/addons/medical_treatment/functions/fnc_healTime.sqf +++ b/addons/medical_treatment/functions/fnc_healTime.sqf @@ -18,9 +18,14 @@ params ["_unit"]; private _totalDamage = 0; +private _treatTime = 0; { _totalDamage = _totalDamage + _x; } forEach (_unit getVariable [QEGVAR(medical,bodyPartDamage), []]); - -10 max (_totalDamage * 5) min 180 +if (EGVAR(medical,PAKTime) > 0) then { + _treatTime = EGVAR(medical,PAKTime); +} else { + _treatTime = 10 max (_totalDamage * 5) min 180; +}; +_treatTime diff --git a/addons/medical_treatment/stringtable.xml b/addons/medical_treatment/stringtable.xml index 085bdd2e0b..72b3f308d7 100644 --- a/addons/medical_treatment/stringtable.xml +++ b/addons/medical_treatment/stringtable.xml @@ -86,6 +86,17 @@ Milyen sokáig legyenek jelen a szemétobjektumok (másodpercben)? A -1 végtelen időt jelent. Per quanto devono restare le barelle? In secondi. -1 è permanente 医療廃棄物オブジェクトが表示されつづける時間を設定しますか?-1 は永遠です。 + + How long should PAK take to apply ? + + + How long should PAK take to apply ? Use 0 for default (based on damage) + + + How long should Medkit take to apply ? + + + How long should Medkit take to apply ? Use 0 for default (based on damage)