Пример #1
0
 public ChoiceWeight(RandomExecutorBase executor, DuelPhase phase, int turn, Dialogs dialogs)
 {
     Executor = executor;
     Phase    = phase;
     Turn     = turn;
     Dialogs  = dialogs;
 }
Пример #2
0
 public Duel()
 {
     TurnCount  = 0;
     Phase      = DuelPhase.Draw;
     PlayerTurn = true;
     CanMove    = false;
     AI         = new AI(this);
 }
Пример #3
0
        public void DrawCard(Player player, List <Card> list)
        {
            Card value = null;

            if (list != null)
            {
                int count = 0;
                int n     = list.Count - 1;

                value = list[n];

                if (count < 1)
                {
                    list.RemoveAt(n);
                }
                count++;
            }

            if (player.Hand[0] == null)
            {
                player.Hand[0] = value;
            }
            else if (player.Hand[1] == null)
            {
                player.Hand[1] = value;
            }
            else if (player.Hand[2] == null)
            {
                player.Hand[2] = value;
            }
            else if (player.Hand[3] == null)
            {
                player.Hand[3] = value;
            }
            else if (player.Hand[4] == null)
            {
                player.Hand[4] = value;
            }
            else if (player.Hand[5] == null)
            {
                player.Hand[5] = value;
            }


            if (PlayerTurn)
            {
                DoDraw(player);
            }
            else
            {
                Phase = DuelPhase.Draw;
                DoComputerDraw(player);
            }
        }
Пример #4
0
 public void DoDraw(Player player)
 {
     if (PlayerTurn)
     {
         if (Phase == DuelPhase.Draw)
         {
             Phase   = DuelPhase.Action;
             CanMove = true;
         }
     }
 }
Пример #5
0
        public void DoComputerDraw(Player oponent)
        {
            if (!PlayerTurn)
            {
                if (Phase == DuelPhase.Draw)
                {
                    Phase = DuelPhase.Action;

                    DoComputerAction(oponent);
                }
            }
        }
Пример #6
0
 public void DoComputerEnd(Player player)
 {
     if (!PlayerTurn)
     {
         if (Phase == DuelPhase.End)
         {
             PlayerTurn = true;
             TurnCount += 1;
             Phase      = DuelPhase.Start;
         }
     }
 }
Пример #7
0
 public void DoEndTurn(Player player)
 {
     if (PlayerTurn)
     {
         if (Phase == DuelPhase.End)
         {
             CanMove    = false;
             PlayerTurn = false;
             TurnCount += 1;
             Phase      = DuelPhase.Start;
         }
     }
 }
Пример #8
0
        public void EndTurn(Player player)
        {
            Phase = DuelPhase.End;

            DoEndTurn(player);
        }