Ejemplo n.º 1
0
 public ChoiceWeight(RandomExecutorBase executor, DuelPhase phase, int turn, Dialogs dialogs)
 {
     Executor = executor;
     Phase    = phase;
     Turn     = turn;
     Dialogs  = dialogs;
 }
Ejemplo n.º 2
0
 public Duel()
 {
     TurnCount  = 0;
     Phase      = DuelPhase.Draw;
     PlayerTurn = true;
     CanMove    = false;
     AI         = new AI(this);
 }
Ejemplo n.º 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);
            }
        }
Ejemplo n.º 4
0
 public void DoDraw(Player player)
 {
     if (PlayerTurn)
     {
         if (Phase == DuelPhase.Draw)
         {
             Phase   = DuelPhase.Action;
             CanMove = true;
         }
     }
 }
Ejemplo n.º 5
0
        public void DoComputerDraw(Player oponent)
        {
            if (!PlayerTurn)
            {
                if (Phase == DuelPhase.Draw)
                {
                    Phase = DuelPhase.Action;

                    DoComputerAction(oponent);
                }
            }
        }
Ejemplo n.º 6
0
 public void DoComputerEnd(Player player)
 {
     if (!PlayerTurn)
     {
         if (Phase == DuelPhase.End)
         {
             PlayerTurn = true;
             TurnCount += 1;
             Phase      = DuelPhase.Start;
         }
     }
 }
Ejemplo n.º 7
0
 public void DoEndTurn(Player player)
 {
     if (PlayerTurn)
     {
         if (Phase == DuelPhase.End)
         {
             CanMove    = false;
             PlayerTurn = false;
             TurnCount += 1;
             Phase      = DuelPhase.Start;
         }
     }
 }
Ejemplo n.º 8
0
        public void EndTurn(Player player)
        {
            Phase = DuelPhase.End;

            DoEndTurn(player);
        }