2015-02-08 09:01:32 +00:00
|
|
|
/*
|
|
|
|
* Author: Glowbal
|
|
|
|
* Calculate the total blood loss of a unit.
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: The Unit <OBJECT>
|
|
|
|
*
|
|
|
|
* ReturnValue:
|
|
|
|
* Total blood loss of unit <NUMBER>
|
2015-02-07 22:55:48 +00:00
|
|
|
*
|
2015-02-08 09:01:32 +00:00
|
|
|
* Public: No
|
2015-02-07 22:55:48 +00:00
|
|
|
*/
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2015-08-22 14:25:10 +00:00
|
|
|
params ["_unit"];
|
2015-02-07 22:55:48 +00:00
|
|
|
|
2016-06-13 10:18:56 +00:00
|
|
|
private _totalBloodLoss = 0;
|
|
|
|
private _tourniquets = _unit getVariable [QGVAR(tourniquets), [0,0,0,0,0,0]];
|
2016-10-12 19:59:32 +00:00
|
|
|
|
2016-06-13 10:18:56 +00:00
|
|
|
{
|
2016-10-12 19:59:32 +00:00
|
|
|
if (_tourniquets select (_x select 2) == 0) then {
|
2016-06-13 10:18:56 +00:00
|
|
|
// total bleeding ratio * percentage of injury left
|
2015-02-28 18:28:05 +00:00
|
|
|
_totalBloodLoss = _totalBloodLoss + ((_x select 4) * (_x select 3));
|
2016-06-13 10:18:56 +00:00
|
|
|
};
|
|
|
|
} forEach (_unit getVariable [QGVAR(openWounds), []]);
|
|
|
|
|
|
|
|
{
|
|
|
|
_totalBloodLoss = _totalBloodLoss + ((_x select 4) * (_x select 3));
|
|
|
|
} forEach (_unit getVariable [QGVAR(internalWounds), []]);
|
2015-02-13 21:55:13 +00:00
|
|
|
|
2016-10-10 15:30:42 +00:00
|
|
|
_totalBloodLoss * ((_unit getVariable [QGVAR(bleedingCoefficient), GVAR(bleedingCoefficient)]) max 0) * DEFAULT_BLOOD_VOLUME / 100;
|