Пример #1
0
        public bool ChooseAttackTarget(Arena.FightState state)
        {
            bool targetChosen = false;
            NewLinked<Team> targetTeams = GetTargets(state);
            NewLinked<Character> targets = new NewLinked<Character>();

            for (int i = 0; i < targetTeams.Length; i++)
                for (int x = 0; x < targetTeams.Get(i)._members.Length; x++)
                {
                    if (!targetTeams.Get(i)._members[x].IsDead)
                        targets.Add(targetTeams.Get(i)._members[x]);
                }

            MenuItem<Character>[] menuItems = MakeMenu(targets);
            for (int i = 0; i < menuItems.Length; i++)
                menuItems[i].NeedsConfirm = false;

            Console.WriteLine("Choose a target to attack:");
            Character attackTarget = Menu<Character>.ShowMenu(menuItems);

            if (attackTarget == null)
                targetChosen = false;
            else
            {
                this.Attack(attackTarget, state);
                targetChosen = true;
            }

            return targetChosen;
        }
Пример #2
0
 protected void DrawCard(NewLinked<Card> hand, int drawCount)
 {
     for (int cardNum = 0; cardNum < drawCount; cardNum++)
     {
         hand.Add(_deckCards.Draw());
     }
 }