2016-12-05 20:34:20 +00:00
|
|
|
/*
|
2017-04-22 15:57:32 +00:00
|
|
|
* Author: Ruthberg
|
|
|
|
* Check if a unit has stable vitals (required to become conscious)
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: The patient <OBJECT>
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* Has stable vitals <BOOL>
|
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* [player] call ace_medical_fnc_hasStableVitals
|
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
2016-12-05 20:34:20 +00:00
|
|
|
#include "script_component.hpp"
|
|
|
|
|
|
|
|
params ["_unit"];
|
|
|
|
|
|
|
|
if (_unit getVariable [QGVAR(bloodVolume), DEFAULT_BLOOD_VOLUME] < BLOOD_VOLUME_CLASS_2_HEMORRHAGE) exitWith { false };
|
|
|
|
if (_unit getVariable [QGVAR(inCardiacArrest), false]) exitWith { false };
|
|
|
|
|
|
|
|
private _cardiacOutput = [_unit] call FUNC(getCardiacOutput);
|
|
|
|
private _bloodLoss = _unit call FUNC(getBloodLoss);
|
|
|
|
if (_bloodLoss > (BLOOD_LOSS_KNOCK_OUT_THRESHOLD * _cardiacOutput) / 2) exitWith { false };
|
|
|
|
|
|
|
|
private _bloodPressure = [_unit] call FUNC(getBloodPressure);
|
|
|
|
_bloodPressure params ["_bloodPressureL", "_bloodPressureH"];
|
|
|
|
if (_bloodPressureL < 50 || {_bloodPressureH < 60}) exitWith { false };
|
|
|
|
|
2016-12-09 11:57:27 +00:00
|
|
|
private _heartRate = _unit getVariable [QGVAR(heartRate), DEFAULT_HEART_RATE];
|
2016-12-05 20:34:20 +00:00
|
|
|
if (_heartRate < 40) exitWith { false };
|
|
|
|
|
|
|
|
true
|