示例#1
0
        public void Tick()
        {
            switch (_state)
            {
            case State.Spawn:
                _logic.OnSpawn();
                _state = State.Turn;
                break;

            case State.Move:
                _battle.AskMoveUnitTo(this, _destX, _destY);
                _state = State.Turn;
                break;

            case State.Turn:
                if (Mana != 0 && Mana == MaxMana && _logic.OnAbility())
                {
                    SubMana(MaxMana);
                    break;
                }
                _logic.OnTurn();
                break;

            case State.Stun:
                _logic.OnStun();
                _stunTurnsLeft--;
                if (_stunTurnsLeft <= 0)
                {
                    RemoveStun();
                }
                break;
            }
        }
示例#2
0
        public void Tick()
        {
            switch (_state)
            {
            case State.Spawn:
                _logic.OnSpawn();
                _state = State.Turn;
                break;

            case State.Move:
                _battle.AskMoveUnitTo(this, _destX, _destY);
                _state = State.Turn;
                break;

            case State.Turn:
                if (Mana == MaxMana)
                {
                    _logic.OnAbility();
                    SubMana(MaxMana);
                    break;
                }
                _logic.OnTurn();
                break;

            case State.Die:
                _logic.OnDie();
                break;
            }
        }
示例#3
0
        public void Tick()
        {
            if (Buffs.Count != 0)
            {
                for (int i = 0; i < Buffs.Count; i++)
                {
                    Buffs[i].PreTick();
                }
            }
            switch (_state)
            {
            case State.Spawn:
                _logic.OnSpawn();
                _state = State.Turn;
                break;

            case State.Move:
                if (LockAction)
                {
                    break;
                }
                _battle.AskMoveUnitTo(this, _destX, _destY);
                _state = State.Turn;
                break;

            case State.Turn:
                if (LockAction)
                {
                    break;
                }
                if (Mana == MaxMana)
                {
                    _logic.OnAbility();
                    SubMana(MaxMana);
                    break;
                }
                _logic.OnTurn();
                break;

            case State.Die:
                OnDie();
                break;
            }
            if (!IsAlive())
            {
                return;
            }
            if (Buffs.Count != 0)
            {
                for (int i = 0; i < Buffs.Count; i++)
                {
                    Buffs[i].PostTick();
                }
            }
        }