Exemple #1
0
        protected override bool _TryReact(MAnimal animal)
        {
            if (!animal.HasState(ID))
            {
                return(false);
            }

            switch (type)
            {
            case State_Reaction.Activate:
                return(animal.State_TryActivate(ID));

            case State_Reaction.AllowExit:
                if (animal.ActiveStateID == ID)
                {
                    animal.ActiveState.AllowExit();
                    return(true);
                }
                return(false);

            case State_Reaction.ForceActivate:
                animal.State_Force(ID);
                return(true);

            case State_Reaction.Enable:
                animal.State_Enable(ID);
                return(true);

            case State_Reaction.Disable:
                animal.State_Disable(ID);
                return(true);

            case State_Reaction.SetStatus:
                animal.State_SetStatus(StateStatus);
                return(true);

            default:
                return(false);
            }
        }