Merge pull request #1586 from acemod/dynamicPAKtreatmentTime

PAK treatment time based on total amount of damage.
This commit is contained in:
Glowbal 2015-06-13 20:14:57 +02:00
commit 1c066a0b3f
3 changed files with 28 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;
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,26 @@
/*
* Author: Ruthberg
* Calculates the personal aid kit treatment time based on amount of damage to heal
*
* Arguments:
* unit <OBJECT>
*
* Return Value:
* treatment time <NUMBER>
*
* Example:
* [_target] call ace_medical_fnc_treatmentAdvanced_fullHealTreatmentTime
*
* Public: No
*/
#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)