Added 'DEFAULT_HEART_RATE' constant

This commit is contained in:
ulteq 2016-12-09 12:57:27 +01:00
parent 31bc54ff33
commit 82e88061fc
11 changed files with 16 additions and 10 deletions

View File

@ -26,7 +26,7 @@ params ["_unit"];
if (_unit getVariable [QGVAR(inCardiacArrest), false]) exitWith { 0 };
private _bloodVolume = ((_unit getVariable [QGVAR(bloodVolume), DEFAULT_BLOOD_VOLUME]) / DEFAULT_BLOOD_VOLUME) * 100;
private _heartRate = _unit getVariable [QGVAR(heartRate), 80];
private _cardiacOutput = ((_bloodVolume / MODIFIER_CARDIAC_OUTPUT) + ((_heartRate / 80) - 1)) / 60;
private _heartRate = _unit getVariable [QGVAR(heartRate), DEFAULT_HEART_RATE];
private _cardiacOutput = ((_bloodVolume / MODIFIER_CARDIAC_OUTPUT) + ((_heartRate / DEFAULT_HEART_RATE) - 1)) / 60;
(0 max _cardiacOutput)

View File

@ -8,7 +8,7 @@ if (!alive _unit) exitWith {};
// If locality changed, broadcast the last medical state and finish the local loop
if (!local _unit) exitWith {
_unit setVariable [QGVAR(heartRate), _unit getVariable [QGVAR(heartRate), 80], true];
_unit setVariable [QGVAR(heartRate), _unit getVariable [QGVAR(heartRate), DEFAULT_HEART_RATE], true];
_unit setVariable [QGVAR(bloodPressure), _unit getVariable [QGVAR(bloodPressure), [80, 120]], true];
_unit setVariable [QGVAR(bloodVolume), _unit getVariable [QGVAR(bloodVolume), DEFAULT_BLOOD_VOLUME], true];
};

View File

@ -8,7 +8,7 @@ if (!alive _unit) exitWith {};
// If locality changed, broadcast the last medical state and finish the local loop
if (!local _unit) exitWith {
_unit setVariable [QGVAR(heartRate), _unit getVariable [QGVAR(heartRate), 80], true];
_unit setVariable [QGVAR(heartRate), _unit getVariable [QGVAR(heartRate), DEFAULT_HEART_RATE], true];
_unit setVariable [QGVAR(bloodPressure), _unit getVariable [QGVAR(bloodPressure), [80, 120]], true];
_unit setVariable [QGVAR(bloodVolume), _unit getVariable [QGVAR(bloodVolume), DEFAULT_BLOOD_VOLUME], true];
};

View File

@ -8,7 +8,7 @@ if (!alive _unit) exitWith {};
// If locality changed, broadcast the last medical state and finish the local loop
if (!local _unit) exitWith {
_unit setVariable [QGVAR(heartRate), _unit getVariable [QGVAR(heartRate), 80], true];
_unit setVariable [QGVAR(heartRate), _unit getVariable [QGVAR(heartRate), DEFAULT_HEART_RATE], true];
_unit setVariable [QGVAR(bloodPressure), _unit getVariable [QGVAR(bloodPressure), [80, 120]], true];
_unit setVariable [QGVAR(bloodVolume), _unit getVariable [QGVAR(bloodVolume), DEFAULT_BLOOD_VOLUME], true];
};

View File

@ -86,7 +86,7 @@ _pain = _pain + (count _oldTourniquets) * 0.001 * _deltaT;
[_unit, _deltaT, _syncValues] call FUNC(updatePainSuppress);
[_unit, _deltaT, _syncValues] call FUNC(updatePeripheralResistance);
private _heartRate = _unit getVariable [QGVAR(heartRate), 80];
private _heartRate = _unit getVariable [QGVAR(heartRate), DEFAULT_HEART_RATE];
private _bloodPressure = [_unit] call FUNC(getBloodPressure);
_unit setVariable [QGVAR(bloodPressure), _bloodPressure, _syncValues];

View File

@ -26,7 +26,7 @@ private _bloodPressure = [_unit] call FUNC(getBloodPressure);
_bloodPressure params ["_bloodPressureL", "_bloodPressureH"];
if (_bloodPressureL < 50 || {_bloodPressureH < 60}) exitWith { false };
private _heartRate = _unit getVariable [QGVAR(heartRate), 80];
private _heartRate = _unit getVariable [QGVAR(heartRate), DEFAULT_HEART_RATE];
if (_heartRate < 40) exitWith { false };
true

View File

@ -33,7 +33,7 @@ _unit setVariable [QGVAR(bandagedWounds), [], true];
_unit setVariable [QGVAR(stitchedWounds), [], true];
// vitals
_unit setVariable [QGVAR(heartRate), 80, true];
_unit setVariable [QGVAR(heartRate), DEFAULT_HEART_RATE, true];
_unit setVariable [QGVAR(heartRateAdjustments), [], true];
_unit setVariable [QGVAR(bloodPressure), [80, 120], true];
_unit setVariable [QGVAR(peripheralResistance), 100, true];

View File

@ -31,7 +31,7 @@ private _timeInCardiacArrest = 120 + round(random(600));
params ["_args", "_idPFH"];
_args params ["_unit", "_startTime", "_timeInCardiacArrest"];
private _heartRate = _unit getVariable [QGVAR(heartRate), 80];
private _heartRate = _unit getVariable [QGVAR(heartRate), DEFAULT_HEART_RATE];
if (_heartRate > 20 || !alive _unit) exitWith {
[_idPFH] call CBA_fnc_removePerFrameHandler;
_unit setVariable [QGVAR(inCardiacArrest), nil, true];

View File

@ -41,7 +41,7 @@ if (!(_adjustment isEqualTo [])) then {
_unit setVariable [QGVAR(heartRateAdjustments), _adjustment, _syncValue];
};
private _heartRate = _unit getVariable [QGVAR(heartRate), 80];
private _heartRate = _unit getVariable [QGVAR(heartRate), DEFAULT_HEART_RATE];
if (!(_unit getVariable [QGVAR(inCardiacArrest), false])) then {
private _hrChange = 0;

View File

@ -13,6 +13,8 @@
#define GET_STRING(config,default) (if (isText (config)) then {getText (config)} else {default})
#define GET_ARRAY(config,default) (if (isArray (config)) then {getArray (config)} else {default})
#define DEFAULT_HEART_RATE 80
// --- blood
// 0.077 l/kg * 80kg = 6.16l
#define DEFAULT_BLOOD_VOLUME 6.0 // in liters

View File

@ -34,6 +34,10 @@ if ((_bodyPartDamage select 4) < 0.3 && {(_bodyPartDamage select 5) < 0.3}) then
[_unit, false] call EFUNC(medical_engine,setLimping);
};
private _bloodVolume = _target getVariable [QEGVAR(medical,bloodVolume), DEFAULT_BLOOD_VOLUME];
private _bloodlossRemainder = (DEFAULT_BLOOD_VOLUME - BLOOD_VOLUME_CLASS_4_HEMORRHAGE) * (1 - _healingPower);
_target setVariable [QEGVAR(medical,bloodVolume), _bloodVolume max (DEFAULT_BLOOD_VOLUME - _bloodlossRemainder), true];
// Resetting damage
_target setDamage 0;