2018-07-30 09:22:14 +00:00
|
|
|
#include "script_component.hpp"
|
2016-07-15 10:23:47 +00:00
|
|
|
/*
|
|
|
|
* 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
|
2016-07-15 10:23:47 +00:00
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
|
2016-10-05 22:54:57 +00:00
|
|
|
params ["_unit"];
|
|
|
|
|
2016-07-15 10:23:47 +00:00
|
|
|
private _totalDamage = 0;
|
2017-12-30 12:01:23 +00:00
|
|
|
private _treatTime = 0;
|
2016-07-15 10:23:47 +00:00
|
|
|
|
|
|
|
{
|
|
|
|
_totalDamage = _totalDamage + _x;
|
2016-12-08 10:38:43 +00:00
|
|
|
} forEach (_unit getVariable [QEGVAR(medical,bodyPartDamage), []]);
|
2018-07-29 21:43:14 +00:00
|
|
|
|
2017-12-30 12:01:23 +00:00
|
|
|
if (EGVAR(medical,PAKTime) > 0) then {
|
|
|
|
_treatTime = EGVAR(medical,PAKTime);
|
|
|
|
} else {
|
|
|
|
_treatTime = 10 max (_totalDamage * 5) min 180;
|
|
|
|
};
|
|
|
|
_treatTime
|