mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Medical - Rename private version of setUnconscious (#7237)
This commit is contained in:
parent
8c7f8d7d6a
commit
9ac543aacc
@ -43,7 +43,7 @@ class ACE_Medical_StateMachine {
|
|||||||
};
|
};
|
||||||
class Unconscious {
|
class Unconscious {
|
||||||
onState = QFUNC(handleStateUnconscious);
|
onState = QFUNC(handleStateUnconscious);
|
||||||
onStateEntered = QUOTE([ARR_2(_this,true)] call EFUNC(medical_status,setUnconscious));
|
onStateEntered = QUOTE([ARR_2(_this,true)] call EFUNC(medical_status,setUnconsciousState));
|
||||||
class DeathAI {
|
class DeathAI {
|
||||||
targetState = "Dead";
|
targetState = "Dead";
|
||||||
condition = QUOTE(!GVAR(AIUnconsciousness) && {!isPlayer _this});
|
condition = QUOTE(!GVAR(AIUnconsciousness) && {!isPlayer _this});
|
||||||
@ -52,7 +52,7 @@ class ACE_Medical_StateMachine {
|
|||||||
targetState = "Injured";
|
targetState = "Injured";
|
||||||
condition = QEFUNC(medical_status,hasStableVitals);
|
condition = QEFUNC(medical_status,hasStableVitals);
|
||||||
events[] = {QEGVAR(medical,WakeUp)};
|
events[] = {QEGVAR(medical,WakeUp)};
|
||||||
onTransition = QUOTE([ARR_2(_this,false)] call EFUNC(medical_status,setUnconscious));
|
onTransition = QUOTE([ARR_2(_this,false)] call EFUNC(medical_status,setUnconsciousState));
|
||||||
};
|
};
|
||||||
class FatalTransitions {
|
class FatalTransitions {
|
||||||
targetState = "CardiacArrest";
|
targetState = "CardiacArrest";
|
||||||
|
@ -28,4 +28,4 @@ _unit setVariable [QGVAR(cardiacArrestTimeLastUpdate), CBA_missionTime];
|
|||||||
TRACE_3("enteredStateCardiacArrest",_unit,_time,CBA_missionTime);
|
TRACE_3("enteredStateCardiacArrest",_unit,_time,CBA_missionTime);
|
||||||
|
|
||||||
// Update the unit status to reflect cardiac arrest
|
// Update the unit status to reflect cardiac arrest
|
||||||
[_unit, true] call EFUNC(medical_status,setCardiacArrest);
|
[_unit, true] call EFUNC(medical_status,setCardiacArrestState);
|
||||||
|
@ -22,4 +22,4 @@ TRACE_1("leftStateCardiacArrest",_unit);
|
|||||||
_unit setVariable [QGVAR(cardiacArrestTimeLeft), nil];
|
_unit setVariable [QGVAR(cardiacArrestTimeLeft), nil];
|
||||||
_unit setVariable [QGVAR(cardiacArrestTimeLastUpdate), nil];
|
_unit setVariable [QGVAR(cardiacArrestTimeLastUpdate), nil];
|
||||||
|
|
||||||
[_unit, false] call EFUNC(medical_status,setCardiacArrest);
|
[_unit, false] call EFUNC(medical_status,setCardiacArrestState);
|
||||||
|
@ -29,14 +29,14 @@ if (_isLocal) then {
|
|||||||
switch (true) do {
|
switch (true) do {
|
||||||
case (IN_CRDC_ARRST(_unit)): {
|
case (IN_CRDC_ARRST(_unit)): {
|
||||||
if (_currentState == "CardiacArrest") exitWith {};
|
if (_currentState == "CardiacArrest") exitWith {};
|
||||||
_unit setVariable [VAR_CRDC_ARRST, false]; // force reset vars so setCardiacArrest can run (enteredStateCardiacArrest will also be called)
|
_unit setVariable [VAR_CRDC_ARRST, false]; // force reset vars so setCardiacArrestState can run (enteredStateCardiacArrest will also be called)
|
||||||
_unit setVariable [VAR_UNCON, false];
|
_unit setVariable [VAR_UNCON, false];
|
||||||
TRACE_1("manually changing state to CardiacArrest",_currentState);
|
TRACE_1("manually changing state to CardiacArrest",_currentState);
|
||||||
[_unit, EGVAR(medical,STATE_MACHINE), _currentState, "CardiacArrest", {}, "LocalityChange"] call CBA_statemachine_fnc_manualTransition;
|
[_unit, EGVAR(medical,STATE_MACHINE), _currentState, "CardiacArrest", {}, "LocalityChange"] call CBA_statemachine_fnc_manualTransition;
|
||||||
};
|
};
|
||||||
case (IS_UNCONSCIOUS(_unit)): {
|
case (IS_UNCONSCIOUS(_unit)): {
|
||||||
if (_currentState == "Unconscious") exitWith {};
|
if (_currentState == "Unconscious") exitWith {};
|
||||||
_unit setVariable [VAR_UNCON, false]; // force reset var so ace_medical_status_fnc_setUnconscious can run
|
_unit setVariable [VAR_UNCON, false]; // force reset var so ace_medical_status_fnc_setUnconsciousState can run
|
||||||
TRACE_1("manually changing state to Unconscious",_currentState);
|
TRACE_1("manually changing state to Unconscious",_currentState);
|
||||||
[_unit, EGVAR(medical,STATE_MACHINE), _currentState, "Unconscious", {}, "LocalityChange"] call CBA_statemachine_fnc_manualTransition;
|
[_unit, EGVAR(medical,STATE_MACHINE), _currentState, "Unconscious", {}, "LocalityChange"] call CBA_statemachine_fnc_manualTransition;
|
||||||
};
|
};
|
||||||
|
@ -11,7 +11,7 @@ PREP(initUnit);
|
|||||||
PREP(isBeingCarried);
|
PREP(isBeingCarried);
|
||||||
PREP(isBeingDragged);
|
PREP(isBeingDragged);
|
||||||
PREP(isInStableCondition);
|
PREP(isInStableCondition);
|
||||||
PREP(setCardiacArrest);
|
PREP(setCardiacArrestState);
|
||||||
PREP(setDead);
|
PREP(setDead);
|
||||||
PREP(setUnconscious);
|
PREP(setUnconsciousState);
|
||||||
PREP(updateWoundBloodLoss);
|
PREP(updateWoundBloodLoss);
|
||||||
|
@ -13,13 +13,13 @@
|
|||||||
* None
|
* None
|
||||||
*
|
*
|
||||||
* Example:
|
* Example:
|
||||||
* [player, true] call ace_medical_status_fnc_setCardiacArrest
|
* [player, true] call ace_medical_status_fnc_setCardiacArrestState
|
||||||
*
|
*
|
||||||
* Public: No
|
* Public: No
|
||||||
*/
|
*/
|
||||||
|
|
||||||
params ["_unit", "_active"];
|
params ["_unit", "_active"];
|
||||||
TRACE_2("setCardiacArrest",_unit,_active);
|
TRACE_2("setCardiacArrestState",_unit,_active);
|
||||||
|
|
||||||
// No change to make
|
// No change to make
|
||||||
if (_active isEqualTo IN_CRDC_ARRST(_unit)) exitWith { TRACE_2("no change",_active,IN_CRDC_ARRST(_unit)); };
|
if (_active isEqualTo IN_CRDC_ARRST(_unit)) exitWith { TRACE_2("no change",_active,IN_CRDC_ARRST(_unit)); };
|
||||||
@ -29,6 +29,6 @@ _unit setVariable [VAR_CRDC_ARRST, _active, true];
|
|||||||
_unit setVariable [VAR_HEART_RATE, [40, 0] select _active, true];
|
_unit setVariable [VAR_HEART_RATE, [40, 0] select _active, true];
|
||||||
|
|
||||||
// Cardiac arrest is an extension of unconsciousness
|
// Cardiac arrest is an extension of unconsciousness
|
||||||
[_unit, _active] call FUNC(setUnconscious);
|
[_unit, _active] call FUNC(setUnconsciousState);
|
||||||
|
|
||||||
["ace_cardiacArrest", [_unit, _active]] call CBA_fnc_localEvent;
|
["ace_cardiacArrest", [_unit, _active]] call CBA_fnc_localEvent;
|
@ -12,13 +12,13 @@
|
|||||||
* Success <BOOL>
|
* Success <BOOL>
|
||||||
*
|
*
|
||||||
* Example:
|
* Example:
|
||||||
* [player, true] call ace_medical_status_fnc_setUnconscious
|
* [player, true] call ace_medical_status_fnc_setUnconsciousState
|
||||||
*
|
*
|
||||||
* Public: No
|
* Public: No
|
||||||
*/
|
*/
|
||||||
|
|
||||||
params ["_unit", "_active"];
|
params ["_unit", "_active"];
|
||||||
TRACE_2("setUnconscious",_unit,_active);
|
TRACE_2("setUnconsciousState",_unit,_active);
|
||||||
|
|
||||||
// No change to make
|
// No change to make
|
||||||
if (_active isEqualTo IS_UNCONSCIOUS(_unit)) exitWith { TRACE_2("no change",_active,IS_UNCONSCIOUS(_unit)); };
|
if (_active isEqualTo IS_UNCONSCIOUS(_unit)) exitWith { TRACE_2("no change",_active,IS_UNCONSCIOUS(_unit)); };
|
Loading…
Reference in New Issue
Block a user