Added a function to calculate the PAK treatmentTime

This commit is contained in:
ulteq 2015-06-12 11:42:49 +02:00
parent 99b13a584a
commit 46a73f3177
3 changed files with 23 additions and 1 deletions

View File

@ -219,7 +219,7 @@ class ACE_Medical_Actions {
items[] = {"ACE_personalAidKit"};
treatmentLocations[] = {QGVAR(useLocation_PAK)};
requiredMedic = QGVAR(medicSetting_PAK);
treatmentTime = "10 max (call {_sum = 0; { _sum = _sum + _x; } forEach ((_this select 1) getVariable ['ACE_Medical_bodyPartStatus', []]); _sum * 10}) min 120";
treatmentTime = QUOTE((_this select 1) call FUNC(treatmentAdvanced_fullHealTreatmentTime));
callbackSuccess = QUOTE(DFUNC(treatmentAdvanced_fullHeal));
itemConsumed = QGVAR(consumeItem_PAK);
animationPatient = "";

View File

@ -76,6 +76,7 @@ PREP(treatmentAdvanced_CPR);
PREP(treatmentAdvanced_CPRLocal);
PREP(treatmentAdvanced_fullHeal);
PREP(treatmentAdvanced_fullHealLocal);
PREP(treatmentAdvanced_fullHealTreatmentTime);
PREP(treatmentAdvanced_medication);
PREP(treatmentAdvanced_medicationLocal);
PREP(treatmentAdvanced_surgicalKit_onProgress);

View File

@ -0,0 +1,21 @@
/**
* fn_healTreatmentTime.sqf
* @Descr: N/A
* @Author: Ruthberg
*
* @Arguments: []
* @Return:
* @PublicAPI: false
*/
#include "script_component.hpp"
private ["_target", "_totalDamage"];
_target = _this;
_totalDamage = 0;
{
_totalDamage = _totalDamage + _x;
} forEach (_target getVariable [QGVAR(bodyPartStatus), []]);
(10 max (_totalDamage * 10) min 120)