Skip to content

Commit

Permalink
Merge pull request #1586 from acemod/dynamicPAKtreatmentTime
Browse files Browse the repository at this point in the history
PAK treatment time based on total amount of damage.
  • Loading branch information
thojkooi committed Jun 13, 2015
2 parents 6dba8b3 + 6d6c3a4 commit 1c066a0
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
2 changes: 1 addition & 1 deletion addons/medical/ACE_Medical_Treatments.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "";
Expand Down
1 change: 1 addition & 0 deletions addons/medical/XEH_preInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit 1c066a0

Please sign in to comment.