Fix GVARs moved out of medical

This commit is contained in:
SilentSpike 2018-05-09 13:37:07 +01:00
parent b81bee2d46
commit dbb538dc56
9 changed files with 18 additions and 18 deletions

View File

@ -47,7 +47,7 @@ class ACE_Medical_StateMachine {
onStateEntered = QUOTE([ARR_2(_this,(true))] call FUNC(setUnconsciousStatemachine)); onStateEntered = QUOTE([ARR_2(_this,(true))] call FUNC(setUnconsciousStatemachine));
class DeathAI { class DeathAI {
targetState = "Dead"; targetState = "Dead";
condition = QUOTE(!isPlayer _this && {GVAR(unconsciousConditionAI)}); condition = QUOTE(!isPlayer _this && {EGVAR(medical,unconsciousConditionAI)});
}; };
class WakeUp { class WakeUp {
targetState = "Injured"; targetState = "Injured";
@ -71,12 +71,12 @@ class ACE_Medical_StateMachine {
class DeathAI { class DeathAI {
events[] = {QGVAR(FatalInjuryInstantTransition)}; events[] = {QGVAR(FatalInjuryInstantTransition)};
targetState = "Dead"; targetState = "Dead";
condition = QUOTE(!isPlayer _this && {GVAR(fatalInjuryConditionAI)}); condition = QUOTE(!isPlayer _this && {EGVAR(medical,fatalInjuryConditionAI)});
}; };
class SecondChance { class SecondChance {
events[] = {QGVAR(FatalInjuryInstantTransition)}; events[] = {QGVAR(FatalInjuryInstantTransition)};
targetState = "CardiacArrest"; targetState = "CardiacArrest";
condition = QUOTE(GVAR(fatalInjuryCondition) > 0); condition = QUOTE(EGVAR(medical,fatalInjuryCondition) > 0);
onTransition = QFUNC(transitionSecondChance); onTransition = QFUNC(transitionSecondChance);
}; };
class Death { class Death {
@ -90,7 +90,7 @@ class ACE_Medical_StateMachine {
onStateLeaving = QFUNC(leftStateCardiacArrest); onStateLeaving = QFUNC(leftStateCardiacArrest);
class DeathAI { class DeathAI {
targetState = "Dead"; targetState = "Dead";
condition = QUOTE(!isPlayer _this && {GVAR(fatalInjuryConditionAI)}); condition = QUOTE(!isPlayer _this && {EGVAR(medical,fatalInjuryConditionAI)});
}; };
class Timeout { class Timeout {
targetState = "Dead"; targetState = "Dead";

View File

@ -15,10 +15,10 @@
params ["_unit"]; params ["_unit"];
// 10% possible variance in cardiac arrest time // 10% possible variance in cardiac arrest time
private _time = GVAR(cardiacArrestTime); private _time = EGVAR(medical,cardiacArrestTime);
_time = _time + random [_time*-0.1, 0, _time*0.1]; _time = _time + random [_time*-0.1, 0, _time*0.1];
_unit setVariable [QGVAR(cardiacArrestTime), _time]; _unit setVariable [QEGVAR(medical,cardiacArrestTime), _time];
_unit setVariable [QGVAR(cardiacArrestStart), CBA_missionTime]; _unit setVariable [QEGVAR(medical,cardiacArrestStart), CBA_missionTime];
[_unit] call EFUNC(medical_status,setCardiacArrest); [_unit] call EFUNC(medical_status,setCardiacArrest);

View File

@ -22,13 +22,13 @@ if (_painLevel > 0) then {
}; };
// Handle spontaneous wakeup from unconsciousness // Handle spontaneous wakeup from unconsciousness
if (GVAR(spontaneousWakeUpChance) > 0) then { if (EGVAR(medical,spontaneousWakeUpChance) > 0) then {
if (_unit call EFUNC(medical_status,hasStableVitals)) then { if (_unit call EFUNC(medical_status,hasStableVitals)) then {
private _lastWakeUpCheck = _unit getVariable [QGVAR(lastWakeUpCheck), CBA_missionTime]; private _lastWakeUpCheck = _unit getVariable [QGVAR(lastWakeUpCheck), CBA_missionTime];
if (CBA_missionTime - _lastWakeUpCheck > SPONTANEOUS_WAKE_UP_INTERVAL) then { if (CBA_missionTime - _lastWakeUpCheck > SPONTANEOUS_WAKE_UP_INTERVAL) then {
TRACE_2("Checking for wake up",_unit,GVAR(spontaneousWakeUpChance)); TRACE_2("Checking for wake up",_unit,EGVAR(medical,spontaneousWakeUpChance));
_unit setVariable [QGVAR(lastWakeUpCheck), CBA_missionTime]; _unit setVariable [QGVAR(lastWakeUpCheck), CBA_missionTime];
if ((random 1) < GVAR(spontaneousWakeUpChance)) then { if ((random 1) < EGVAR(medical,spontaneousWakeUpChance)) then {
TRACE_1("Spontaneous wake up!",_unit); TRACE_1("Spontaneous wake up!",_unit);
[QGVAR(WakeUp), _unit] call CBA_fnc_localEvent; [QGVAR(WakeUp), _unit] call CBA_fnc_localEvent;
}; };

View File

@ -37,4 +37,4 @@ _limbBleedingRate = _limbBleedingRate * (1 - _bodyBleedingRate);
private _cardiacOutput = [_unit] call FUNC(getCardiacOutput); private _cardiacOutput = [_unit] call FUNC(getCardiacOutput);
((_bodyBleedingRate + _limbBleedingRate) * _cardiacOutput * GVAR(bleedingCoefficient)) ((_bodyBleedingRate + _limbBleedingRate) * _cardiacOutput * EGVAR(medical,bleedingCoefficient))

View File

@ -30,7 +30,7 @@ if (!isNil {_unit getVariable QGVAR(ivBags)}) then {
_x params ["_bagVolumeRemaining", "_type", "_bodyPart"]; _x params ["_bagVolumeRemaining", "_type", "_bodyPart"];
if (_tourniquets select _bodyPart == 0) then { if (_tourniquets select _bodyPart == 0) then {
private _bagChange = (_deltaT * GVAR(ivFlowRate) * IV_CHANGE_PER_SECOND) min _bagVolumeRemaining; // absolute value of the change in miliLiters private _bagChange = (_deltaT * EGVAR(medical,ivFlowRate) * IV_CHANGE_PER_SECOND) min _bagVolumeRemaining; // absolute value of the change in miliLiters
_bagVolumeRemaining = _bagVolumeRemaining - _bagChange; _bagVolumeRemaining = _bagVolumeRemaining - _bagChange;
_bloodVolumeChange = _bloodVolumeChange + (_bagChange / 1000); _bloodVolumeChange = _bloodVolumeChange + (_bagChange / 1000);
}; };

View File

@ -21,11 +21,11 @@ params ["_unit", ["_medicN", 1]];
private _class = _unit getVariable [QGVAR(medicClass), [0, 1] select (_unit getUnitTrait "medic")]; private _class = _unit getVariable [QGVAR(medicClass), [0, 1] select (_unit getUnitTrait "medic")];
if (_class >= _medicN min GVAR(medicSetting)) exitWith {true}; if (_class >= _medicN min EGVAR(medical,medicSetting)) exitWith {true};
if (!GVAR(increaseTrainingInLocations)) exitWith {false}; if (!EGVAR(medical,increaseTrainingInLocations)) exitWith {false};
if (([_unit] call FUNC(isInMedicalVehicle)) || {[_unit] call FUNC(isInMedicalFacility)}) then { if (([_unit] call FUNC(isInMedicalVehicle)) || {[_unit] call FUNC(isInMedicalFacility)}) then {
_class = _class + 1; //boost by one: untrained becomes medic, medic becomes doctor _class = _class + 1; //boost by one: untrained becomes medic, medic becomes doctor
}; };
_class >= _medicN min GVAR(medicSetting) _class >= _medicN min EGVAR(medical,medicSetting)

View File

@ -26,4 +26,4 @@ SET_HEART_RATE(_unit,0);
["ace_cardiacArrestEntered", [_unit]] call CBA_fnc_localEvent; ["ace_cardiacArrestEntered", [_unit]] call CBA_fnc_localEvent;
[_unit, true] call FUNC(setUnconsciousStatemachine); [_unit, true] call EFUNC(medical,setUnconsciousStatemachine);

View File

@ -59,7 +59,7 @@ if (_knockOut) then {
}; };
}, [_unit], _minWaitingTime] call CBA_fnc_waitAndExecute; }, [_unit], _minWaitingTime] call CBA_fnc_waitAndExecute;
}; };
if (GVAR(spontaneousWakeUpChance) > 0) then { if (EGVAR(medical,spontaneousWakeUpChance) > 0) then {
_unit setVariable [QGVAR(lastWakeUpCheck), CBA_missionTime + _minWaitingTime - SPONTANEOUS_WAKE_UP_INTERVAL]; _unit setVariable [QGVAR(lastWakeUpCheck), CBA_missionTime + _minWaitingTime - SPONTANEOUS_WAKE_UP_INTERVAL];
}; };
}; };

View File

@ -48,7 +48,7 @@ private _pain = GET_PAIN_TOTAL(_unit);
_unit setVariable [QEGVAR(medical_status,pain), 0 max (_pain - _deltaT / PAIN_FADE_TIME), _syncValue]; _unit setVariable [QEGVAR(medical_status,pain), 0 max (_pain - _deltaT / PAIN_FADE_TIME), _syncValue];
// Handles simple medication // Handles simple medication
if (!GVAR(advancedMedication)) then { if (!EGVAR(medical,advancedMedication)) then {
private _painSupress = _unit getVariable [QGVAR(painSuppress), 0]; private _painSupress = _unit getVariable [QGVAR(painSuppress), 0];
_painSupress = _painSupress - _deltaT / PAIN_SUPPRESSION_FADE_TIME; _painSupress = _painSupress - _deltaT / PAIN_SUPPRESSION_FADE_TIME;
_unit setVariable [QGVAR(painSuppress), 0 max _painSupress, _syncValue]; _unit setVariable [QGVAR(painSuppress), 0 max _painSupress, _syncValue];