2017-06-17 23:28:16 +00:00
|
|
|
// Manual transitions applied to this statemachine
|
|
|
|
// - medical_fnc_handleRespawn:18
|
2016-06-30 21:43:25 +00:00
|
|
|
class ACE_Medical_StateMachine {
|
2016-11-29 11:35:26 +00:00
|
|
|
list = "allUnits select {local _x}";
|
|
|
|
skipNull = 1;
|
|
|
|
|
2016-06-30 21:43:25 +00:00
|
|
|
class Default {
|
2016-07-07 09:46:55 +00:00
|
|
|
onState = QUOTE(DFUNC(handleStateDefault));
|
2016-06-30 21:43:25 +00:00
|
|
|
class Injury {
|
|
|
|
targetState = "Injured";
|
2016-12-05 20:34:20 +00:00
|
|
|
events[] = {QGVAR(Injury)};
|
2016-06-30 21:43:25 +00:00
|
|
|
};
|
|
|
|
class CriticalInjuryOrVitals {
|
|
|
|
targetState = "Unconscious";
|
2017-06-05 16:42:46 +00:00
|
|
|
events[] = {QGVAR(CriticalInjury), QGVAR(CriticalVitals), QGVAR(knockOut)};
|
|
|
|
};
|
|
|
|
class FatalVitals {
|
|
|
|
targetState = "CardiacArrest";
|
|
|
|
events[] = {QGVAR(FatalVitals)};
|
2016-06-30 21:43:25 +00:00
|
|
|
};
|
2016-11-07 21:21:07 +00:00
|
|
|
class FatalInjury {
|
|
|
|
targetState = "FatalInjury";
|
2016-12-05 20:34:20 +00:00
|
|
|
events[] = {QGVAR(FatalInjury)};
|
2016-06-30 21:43:25 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
class Injured {
|
2016-07-07 09:46:55 +00:00
|
|
|
onState = QUOTE(DFUNC(handleStateInjured));
|
2016-06-30 21:43:25 +00:00
|
|
|
class FullHeal {
|
|
|
|
targetState = "Default";
|
2016-11-07 21:21:07 +00:00
|
|
|
events[] = {QGVAR(FullHeal)};
|
2016-06-30 21:43:25 +00:00
|
|
|
};
|
|
|
|
class CriticalInjuryOrVitals {
|
|
|
|
targetState = "Unconscious";
|
2017-06-05 16:42:46 +00:00
|
|
|
events[] = {QGVAR(CriticalInjury), QGVAR(CriticalVitals), QGVAR(knockOut)};
|
2016-06-30 21:43:25 +00:00
|
|
|
};
|
2016-11-07 21:21:07 +00:00
|
|
|
class FatalVitals {
|
|
|
|
targetState = "CardiacArrest";
|
|
|
|
events[] = {QGVAR(FatalVitals)};
|
|
|
|
};
|
|
|
|
class FatalInjury {
|
|
|
|
targetState = "FatalInjury";
|
2016-12-05 20:34:20 +00:00
|
|
|
events[] = {QGVAR(FatalInjury)};
|
2016-06-30 21:43:25 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
class Unconscious {
|
2016-07-07 09:46:55 +00:00
|
|
|
onState = QUOTE(DFUNC(handleStateUnconscious));
|
2017-06-05 16:42:46 +00:00
|
|
|
onStateEntered = QUOTE([ARR_2(_this,(true))] call FUNC(setUnconsciousStatemachine));
|
2017-05-22 20:16:18 +00:00
|
|
|
class DeathAI {
|
|
|
|
targetState = "Dead";
|
|
|
|
condition = QUOTE(!isPlayer _this && {GVAR(unconsciousConditionAI)});
|
|
|
|
};
|
2016-12-05 20:34:20 +00:00
|
|
|
class WakeUp {
|
2016-06-30 21:43:25 +00:00
|
|
|
targetState = "Injured";
|
2016-11-07 21:21:07 +00:00
|
|
|
condition = QUOTE(_this call FUNC(hasStableVitals));
|
2016-12-05 20:34:20 +00:00
|
|
|
events[] = {QGVAR(WakeUp)};
|
2017-06-05 16:42:46 +00:00
|
|
|
onTransition = QUOTE([ARR_2(_this,(false))] call FUNC(setUnconsciousStatemachine));
|
2016-06-30 21:43:25 +00:00
|
|
|
};
|
|
|
|
class FatalTransitions {
|
2016-11-07 21:21:07 +00:00
|
|
|
targetState = "CardiacArrest";
|
2016-12-05 20:34:20 +00:00
|
|
|
events[] = {QGVAR(FatalVitals)};
|
2016-06-30 21:43:25 +00:00
|
|
|
};
|
2016-11-07 21:21:07 +00:00
|
|
|
class FatalInjury {
|
|
|
|
targetState = "FatalInjury";
|
2016-12-05 20:34:20 +00:00
|
|
|
events[] = {QGVAR(FatalInjury)};
|
2016-06-30 21:43:25 +00:00
|
|
|
};
|
2016-11-07 21:21:07 +00:00
|
|
|
};
|
|
|
|
class FatalInjury {
|
|
|
|
// Transition state for handling instant death
|
2016-11-07 22:46:10 +00:00
|
|
|
// This state raises the next transition in the same frame
|
2016-11-07 21:21:07 +00:00
|
|
|
onStateEntered = QUOTE(DFUNC(enteredStateFatalInjury));
|
2017-05-22 20:16:18 +00:00
|
|
|
class DeathAI {
|
|
|
|
events[] = {QGVAR(FatalInjuryInstantTransition)};
|
|
|
|
targetState = "Dead";
|
|
|
|
condition = QUOTE(!isPlayer _this && {GVAR(fatalInjuryConditionAI)});
|
|
|
|
};
|
2016-11-09 18:01:55 +00:00
|
|
|
class SecondChance {
|
2016-11-07 22:46:10 +00:00
|
|
|
events[] = {QGVAR(FatalInjuryInstantTransition)};
|
2016-11-07 21:21:07 +00:00
|
|
|
targetState = "CardiacArrest";
|
2017-05-22 18:53:00 +00:00
|
|
|
condition = QUOTE(GVAR(fatalInjuryCondition) > 0);
|
2016-11-09 18:01:55 +00:00
|
|
|
onTransition = QUOTE(DFUNC(transitionSecondChance));
|
2016-06-30 21:43:25 +00:00
|
|
|
};
|
2016-11-09 18:01:55 +00:00
|
|
|
class Death {
|
2016-11-07 22:46:10 +00:00
|
|
|
events[] = {QGVAR(FatalInjuryInstantTransition)};
|
2016-06-30 21:43:25 +00:00
|
|
|
targetState = "Dead";
|
2016-11-07 21:21:07 +00:00
|
|
|
condition = "true";
|
2016-06-30 21:43:25 +00:00
|
|
|
};
|
2016-11-07 21:21:07 +00:00
|
|
|
};
|
|
|
|
class CardiacArrest {
|
|
|
|
onStateEntered = QUOTE(DFUNC(enteredStateCardiacArrest));
|
2016-12-05 20:34:20 +00:00
|
|
|
onStateLeaving = QUOTE(DFUNC(leftStateCardiacArrest));
|
|
|
|
class Timeout {
|
2016-06-30 21:43:25 +00:00
|
|
|
targetState = "Dead";
|
2016-11-09 18:01:55 +00:00
|
|
|
condition = QUOTE(DFUNC(conditionCardiacArrestTimer));
|
2016-06-30 21:43:25 +00:00
|
|
|
};
|
2016-12-05 20:34:20 +00:00
|
|
|
class Reanimation {
|
2016-11-07 21:21:07 +00:00
|
|
|
targetState = "Unconscious";
|
|
|
|
events[] = {QGVAR(CPRSucceeded)};
|
|
|
|
};
|
2016-11-08 18:37:56 +00:00
|
|
|
class Execution {
|
|
|
|
targetState = "Dead";
|
|
|
|
condition = QUOTE(DFUNC(conditionExecutionDeath));
|
2016-12-05 20:34:20 +00:00
|
|
|
events[] = {QGVAR(FatalInjury)};
|
2016-11-08 18:37:56 +00:00
|
|
|
};
|
2016-11-07 21:21:07 +00:00
|
|
|
};
|
|
|
|
class Dead {
|
|
|
|
onStateEntered = "_this setDamage 1"; // killing a unit also exits the state machine for this unit
|
2016-06-30 21:43:25 +00:00
|
|
|
};
|
|
|
|
};
|