Use more status macros

This commit is contained in:
SilentSpike 2018-04-27 16:03:55 +01:00
parent 7d55163463
commit 6559665b8b
9 changed files with 17 additions and 17 deletions

View File

@ -41,8 +41,8 @@
_return pushBack format ["<t color='#%1'>State: %2</t> [StableVitals: %3] %4", _color, _targetState, _hasStableVitals, _unconcFlag];
// Blood:
private _bloodVolume = _unit getVariable [QEGVAR(medical,bloodVolume), DEFAULT_BLOOD_VOLUME];
private _bloodLoss = [_unit] call EFUNC(medical,getBloodLoss);
private _bloodVolume = GET_BLOOD_VOLUME(_unit);
private _bloodLoss = GET_BLOOD_LOSS(_unit);
private _secondsToHeartstop = if (_bloodLoss != 0) then {format ["[<t color ='#FF9999'>Time Left:</t> %1 sec]", (((_bloodVolume - BLOOD_VOLUME_CLASS_4_HEMORRHAGE) max 0) / _bloodLoss) toFixed 1]} else {""};
_return pushBack format ["Blood: %1", _bloodVolume toFixed 3];
_return pushBack format [" - [Loss: %1] %2", _bloodLoss toFixed 5, _secondsToHeartstop];

View File

@ -18,12 +18,12 @@
// Player will have to do this manually of course
if ([_this] call EFUNC(common,isPlayer)) exitWith {};
// Can't heal self when unconscious
if (_this getVariable ["ACE_isUnconscious", false]) exitWith {};
if IS_UNCONSCIOUS(_this) exitWith {};
// Check if we're still treating
if ((_this getVariable [QGVAR(treatmentOverAt), CBA_missionTime]) > CBA_missionTime) exitWith {};
private _needsBandaging = ([_this] call EFUNC(medical,getBloodLoss)) > 0;
private _needsMorphine = (_this getVariable [QEGVAR(medical,pain), 0]) > 0.2;
private _needsBandaging = GET_BLOOD_LOSS(_this) > 0;
private _needsMorphine = GET_PAIN_TOTAL(_this) > 0.2;
switch (true) do {
case _needsBandaging: {

View File

@ -52,9 +52,9 @@ _this setVariable [QGVAR(movingToInjured), false];
_this forceSpeed 0;
_target forceSpeed 0;
private _needsBandaging = ([_target] call EFUNC(medical,getBloodLoss)) > 0;
private _needsMorphine = (_target getVariable [QEGVAR(medical,pain), 0]) > 0.2;
private _needsEpinephrine = _target getVariable ["ACE_isUnconscious", false];
private _needsBandaging = GET_BLOOD_LOSS(_target) > 0;
private _needsMorphine = GET_PAIN_TOTAL(_target) > 0.2;
private _needsEpinephrine = IS_UNCONSCIOUS(_target);
switch (true) do {
case _needsBandaging: {

View File

@ -17,8 +17,8 @@
if !(alive _this) exitWith {false};
private _bloodLoss = [_this] call EFUNC(medical,getBloodLoss);
private _pain = [_this] call EFUNC(medical,getPainLevel);
private _unconscious = _this getVariable ["ACE_isUnconscious", false];
private _bloodLoss = GET_BLOOD_LOSS(_this);
private _pain = GET_PAIN_TOTAL(_this);
private _unconscious = IS_UNCONSCIOUS(_this);
(_bloodLoss > 0) || {_pain > 0.2} || _unconscious

View File

@ -20,7 +20,7 @@ params ["_unit"];
if (((vehicle _unit) != _unit) && {!((vehicle _unit) isKindOf "StaticWeapon")}) exitWith {}; // Don't bleed on ground if mounted
private _lastTime = _unit getVariable [QGVAR(lastTime), -10];
private _bloodLoss = (if (GVAR(useAceMedical)) then {([_unit] call EFUNC(medical,getBloodLoss)) * 2.5} else {getDammage _unit * 2}) min 6;
private _bloodLoss = (if (GVAR(useAceMedical)) then {GET_BLOOD_LOSS(_unit) * 2.5} else {getDammage _unit * 2}) min 6;
TRACE_1("",_bloodLoss);
if ((CBA_missionTime - _lastTime) + _bloodLoss >= 8 + random 2) then {

View File

@ -20,7 +20,7 @@
params ["_unit", "_deltaT", "_syncValues"];
private _bloodVolume = _unit getVariable [QGVAR(bloodVolume), DEFAULT_BLOOD_VOLUME];
private _bloodVolumeChange = -_deltaT * (_unit call FUNC(getBloodLoss));
private _bloodVolumeChange = -_deltaT * GET_BLOOD_LOSS(_unit);
if (!isNil {_unit getVariable QGVAR(ivBags)}) then {
private _bloodBags = _unit getVariable [QGVAR(ivBags), []];

View File

@ -21,7 +21,7 @@ if (_unit getVariable [QGVAR(bloodVolume), DEFAULT_BLOOD_VOLUME] < BLOOD_VOLUME_
if (_unit getVariable [QGVAR(inCardiacArrest), false]) exitWith { false };
private _cardiacOutput = [_unit] call FUNC(getCardiacOutput);
private _bloodLoss = _unit call FUNC(getBloodLoss);
private _bloodLoss = GET_BLOOD_LOSS(_unit);
if (_bloodLoss > (BLOOD_LOSS_KNOCK_OUT_THRESHOLD * _cardiacOutput) / 2) exitWith { false };
private _bloodPressure = [_unit] call FUNC(getBloodPressure);

View File

@ -19,8 +19,8 @@
params ["_unit"];
if (!alive _unit) exitWith { false };
if (_unit getVariable ["ACE_isUnconscious", false]) exitWith { false };
if (_unit call FUNC(getBloodLoss) > 0) exitWith { false };
if IS_UNCONSCIOUS(_unit) exitWith { false };
if (GET_BLOOD_LOSS(_unit) > 0) exitWith { false };
if (!(_unit call FUNC(hasStableVitals))) exitWith { false };
true

View File

@ -58,7 +58,7 @@ if (_bloodVolume < BLOOD_VOLUME_CLASS_1_HEMORRHAGE) then {
};
};
private _bloodLoss = _unit call FUNC(getBloodLoss);
private _bloodLoss = GET_BLOOD_LOSS(_unit);
if (_bloodLoss > 0) then {
_unit setVariable [QGVAR(bloodloss), _bloodLoss, _syncValues];