Beispiel #1
0
        //call by unit when all action is depleted
        public static void SelectedUnitMoveDepleted()
        {
            if (GameControl.GetGamePhase() == _GamePhase.Over)
            {
                return;
            }

            if (instance.turnMode == _TurnMode.FactionPerTurn)
            {
                //if not in free move order, cant switch to next unit without end turn
                if (instance.moveOrder != _MoveOrder.Free)
                {
                    TBTK.OnAllUnitOutOfMove();
                    if (GameControl.GetSelectedUnit().HP <= 0)
                    {
                        instance.StartCoroutine(instance.AutoEndTurn());
                    }
                }
                else
                {
                    if (!FactionManager.SelectNextUnitInFaction_Free())
                    {
                        TBTK.OnAllUnitOutOfMove();
                    }
                }
            }
            else if (instance.turnMode == _TurnMode.FactionUnitPerTurn)
            {
                TBTK.OnAllUnitOutOfMove();
                if (GameControl.GetSelectedUnit().HP <= 0)
                {
                    instance.StartCoroutine(instance.AutoEndTurn());
                }
            }
            else if (instance.turnMode == _TurnMode.UnitPerTurn)
            {
                TBTK.OnAllUnitOutOfMove();
                if (GameControl.GetSelectedUnit().HP <= 0)
                {
                    instance.StartCoroutine(instance.AutoEndTurn());
                }
            }
        }