ACE3/addons/medical_treatment/functions/fnc_healTime.sqf

32 lines
643 B
Plaintext
Raw Normal View History

/*
* 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:
2016-12-08 11:30:59 +00:00
* [_target] call ace_medical_treatment_fnc_healTime
*
* Public: No
*/
#include "script_component.hpp"
params ["_unit"];
private _totalDamage = 0;
private _treatTime = 0;
{
_totalDamage = _totalDamage + _x;
2016-12-08 10:38:43 +00:00
} forEach (_unit getVariable [QEGVAR(medical,bodyPartDamage), []]);
if (EGVAR(medical,PAKTime) > 0) then {
_treatTime = EGVAR(medical,PAKTime);
} else {
_treatTime = 10 max (_totalDamage * 5) min 180;
};
_treatTime