Add blood pressure status macro

This commit is contained in:
SilentSpike 2018-05-08 09:28:16 +01:00
parent 6eb9c7e940
commit 65f57361a4
6 changed files with 8 additions and 7 deletions

View File

@ -50,13 +50,13 @@
// Heart:
private _cardiacOutput = [_unit] call EFUNC(medical,getCardiacOutput);
private _heartRate = _unit getVariable [QEGVAR(medical,heartRate), DEFAULT_HEART_RATE];
([_unit] call EFUNC(medical,getBloodPressure)) params ["_bpLow", "_bpHigh"];
GET_BLOOD_PRESSURE(_unit) params ["_bpLow", "_bpHigh"];
_return pushBack format ["CardiacOutput %1", _cardiacOutput toFixed 5];
_return pushBack format [" - [HR: %1] [BP: %2 / %3]", _heartRate toFixed 1, _bpLow toFixed 1, _bpHigh toFixed 1];
// Pain:
private _pain = _unit getVariable [QEGVAR(medical,pain), 0];
private _painSuppress = _unit getVariable [QEGVAR(medical,painSuppress), 0];
private _pain = GET_PAIN_TOTAL(_unit);
private _painSuppress = _unit getVariable [QEGVAR(medical_status,painSuppress), 0];
private _painLevel = GET_PAIN_PERCEIVED(_unit);
_return pushBack format ["Effective Pain: %1", _painLevel toFixed 3];
_return pushBack format [" - [Pain: %1] [Suppress: %2]", _pain toFixed 3, _painSuppress toFixed 3];

View File

@ -65,5 +65,6 @@
#define GET_HEART_RATE(unit) (unit getVariable [QEGVAR(medical_status,heartRate), DEFAULT_HEART_RATE])
#define GET_BLOOD_VOLUME(unit) (unit getVariable [QEGVAR(medical_status,bloodVolume), DEFAULT_BLOOD_VOLUME])
#define GET_BLOOD_LOSS(unit) ([unit] call EFUNC(medical_status,getBloodLoss)) // Just for consistency
#define GET_BLOOD_PRESSURE(unit) ([unit] call EFUNC(medical_status,getBloodPressure)) // Just for consistency
#define IS_UNCONSCIOUS(unit) (unit getVariable [QEGVAR(medical_status,isUnconscious), false])
#define IS_IN_PAIN(unit) (GET_PAIN_PERCEIVED(unit) > 0)

View File

@ -24,7 +24,7 @@ private _cardiacOutput = [_unit] call FUNC(getCardiacOutput);
private _bloodLoss = GET_BLOOD_LOSS(_unit);
if (_bloodLoss > (BLOOD_LOSS_KNOCK_OUT_THRESHOLD * _cardiacOutput) / 2) exitWith { false };
private _bloodPressure = [_unit] call FUNC(getBloodPressure);
private _bloodPressure = GET_BLOOD_PRESSURE(_unit);
_bloodPressure params ["_bloodPressureL", "_bloodPressureH"];
if (_bloodPressureL < 50 || {_bloodPressureH < 60}) exitWith { false };

View File

@ -19,7 +19,7 @@ params ["_caller", "_target", "_bodyPart"];
private _bloodPressure = [0, 0];
if (alive _target && !([_target, _bodyPart] call EFUNC(medical,hasTourniquetAppliedTo))) then {
_bloodPressure = _target call EFUNC(medical,getBloodPressure);
_bloodPressure = GET_BLOOD_PRESSURE(_target);
};
private _bloodPressureOutput = ELSTRING(medical,Check_Bloodpressure_Output_6);

View File

@ -95,7 +95,7 @@ private _heartRate = [_unit, _deltaT, _syncValues] call FUNC(updateHeartRate);
[_unit, _deltaT, _syncValues] call FUNC(updatePainSuppress);
[_unit, _deltaT, _syncValues] call FUNC(updatePeripheralResistance);
private _bloodPressure = [_unit] call FUNC(getBloodPressure);
private _bloodPressure = GET_BLOOD_PRESSURE(_unit);
_unit setVariable [QGVAR(bloodPressure), _bloodPressure, _syncValues];
private _cardiacOutput = [_unit] call FUNC(getCardiacOutput);

View File

@ -50,7 +50,7 @@ if (!(_unit getVariable [QGVAR(inCardiacArrest), false])) then {
private _hrChange = 0;
private _bloodVolume = _unit getVariable [QGVAR(bloodVolume), DEFAULT_BLOOD_VOLUME];
if (_bloodVolume > BLOOD_VOLUME_CLASS_4_HEMORRHAGE) then {
([_unit] call FUNC(getBloodPressure)) params ["_bloodPressureL", "_bloodPressureH"];
GET_BLOOD_PRESSURE(_unit) params ["_bloodPressureL", "_bloodPressureH"];
private _meanBP = (2/3) * _bloodPressureH + (1/3) * _bloodPressureL;
private _painLevel = GET_PAIN_PERCEIVED(_unit);