Exemple #1
0
 protected override bool OnEndState()
 {
     ForceQuit = false;
     isInit    = false;
     FSM.GetUnitOwner().SetCurrentNode(null);
     FSM.GetUnitOwner().Die();
     FSM = null;
     return(true);
 }
    protected override bool OnEndState()
    {
        isInit    = false;
        ForceQuit = false;
        FSM.GetUnitOwner().ShowFeedbackOnAttacked();
        FSM.ChangeState(UnitFSM.UnitStates.IDLE);

        return(true);
    }
Exemple #3
0
    protected override bool OnEndState()
    {
        FSM.ChangeState(UnitFSM.UnitStates.IDLE);

        //Attack management
        FSM.GetUnitOwner().HasAttacked = true;
        FSM.GetUnitOwner().CanAttack   = false;
        target.DamageTaken    += FSM.GetUnitOwner().Stats.DamageAttackPoints;
        target.HasBeenAttacked = true;
        target.RecalculateHealth();

        isInit    = false;
        ForceQuit = false;
        counter   = 0;
        return(true);
    }
Exemple #4
0
    public override bool ExecuteState(FSM fsm)
    {
        FSM    = fsm as UnitFSM;
        target = FSM.GetUnitOwner().CurrentEnemy;


        if (!isInit)
        {
            UnitFSM targetFSM = target.fSM as UnitFSM;
            targetFSM.ForceChangeState(UnitFSM.UnitStates.ATTACKED);

            isInit = OnStartState();
        }


        if (OnExecuteState() || ForceQuit)
        {
            return(OnEndState());
        }



        return(false);
    }