ACE3/addons/medical_status/functions/fnc_hasStableVitals.sqf

35 lines
932 B
Plaintext
Raw Normal View History

#include "script_component.hpp"
2016-12-05 20:34:20 +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:
2018-05-08 09:16:12 +00:00
* [player] call ace_medical_status_fnc_hasStableVitals
*
* Public: No
*/
2016-12-05 20:34:20 +00:00
params ["_unit"];
2018-05-10 16:44:02 +00:00
if (GET_BLOOD_VOLUME(_unit) < BLOOD_VOLUME_CLASS_2_HEMORRHAGE) exitWith { false };
2018-05-22 17:06:28 +00:00
if IN_CRDC_ARRST(_unit) exitWith { false };
2016-12-05 20:34:20 +00:00
private _cardiacOutput = [_unit] call FUNC(getCardiacOutput);
2018-04-27 15:03:55 +00:00
private _bloodLoss = GET_BLOOD_LOSS(_unit);
2016-12-05 20:34:20 +00:00
if (_bloodLoss > (BLOOD_LOSS_KNOCK_OUT_THRESHOLD * _cardiacOutput) / 2) exitWith { false };
2018-05-08 08:28:16 +00:00
private _bloodPressure = GET_BLOOD_PRESSURE(_unit);
2016-12-05 20:34:20 +00:00
_bloodPressure params ["_bloodPressureL", "_bloodPressureH"];
if (_bloodPressureL < 50 || {_bloodPressureH < 60}) exitWith { false };
2018-05-08 09:16:12 +00:00
private _heartRate = GET_HEART_RATE(_unit);
2016-12-05 20:34:20 +00:00
if (_heartRate < 40) exitWith { false };
true