예제 #1
0
 public virtual bool ChooseAttackCard()
 {
     Console.WriteLine();
     if (playerAttackCards.Count > 0)
     {
         Console.WriteLine("Please select an attack card to mount");
         for (int i = 0; i < playerAttackCards.Count; i++)
         {
             Console.WriteLine((i + 1) + ": " + playerAttackCards[i].Name + " - " + playerAttackCards[i].Attack + " HP");
         }
         int userChoice = Int32.Parse(Console.ReadLine());
         MountCard(playerAttackCards[userChoice - 1]);
         Console.WriteLine();
         return(true);
     }
     else
     {
         if (playerDefenseCards.Count > 0)
         {
             Console.WriteLine("You are all out of attack cards. You must play a defense card now");
             ChooseDefenseCard();
         }
         else
         {
             Console.WriteLine("You are all out of cards. Generating an attack card for you...");
             MountCard(CardDealer.GenerateAttackCard(this));
         }
         return(false);
     }
 }
예제 #2
0
 public override bool ChooseAttackCard()
 {
     if (playerAttackCards.Count > 0)
     {
         MountCard(playerAttackCards[r.Next(0, playerAttackCards.Count)]);
         return(true);
     }
     else
     {
         Console.WriteLine("Your opponent is out of attack cards. Generating one...");
         MountCard(CardDealer.GenerateAttackCard(this));
         return(false);
     }
 }