Beispiel #1
0
        private bool MonsterReborn()
        {
            List <ClientCard> cards = new List <ClientCard>(Bot.Graveyard.GetMatchingCards(card => card.IsCanRevive()));

            cards.Sort(CardContainer.CompareCardAttack);
            ClientCard selectedCard = null;

            for (int i = cards.Count - 1; i >= 0; --i)
            {
                ClientCard card = cards[i];
                if (card.Attack < 2000)
                {
                    break;
                }
                if (card.IsCode(CardId.StardustDragonAssaultMode, CardId.FiveHeadedDragon))
                {
                    continue;
                }
                if (card.IsMonster())
                {
                    selectedCard = card;
                    break;
                }
            }
            cards = new List <ClientCard>(Enemy.Graveyard.GetMatchingCards(card => card.IsCanRevive()));
            cards.Sort(CardContainer.CompareCardAttack);
            for (int i = cards.Count - 1; i >= 0; --i)
            {
                ClientCard card = cards[i];
                if (card.Attack < 2000)
                {
                    break;
                }
                if (card.IsMonster() && card.HasType(CardType.Normal) && (selectedCard == null || card.Attack > selectedCard.Attack))
                {
                    selectedCard = card;
                    break;
                }
            }
            if (selectedCard != null)
            {
                AI.SelectCard(selectedCard);
                return(true);
            }
            return(false);
        }
Beispiel #2
0
        private bool MonsterReborn()
        {
            List <ClientCard> cards = new List <ClientCard>(this.Bot.Graveyard.GetMatchingCards(card => card.IsCanRevive()));

            cards.Sort(CardContainer.CompareCardAttack);
            ClientCard selectedCard = null;

            for (int i = cards.Count - 1; i >= 0; --i)
            {
                ClientCard card = cards[i];
                if (card.Attack < 1000)
                {
                    break;
                }

                if (card.IsMonster())
                {
                    selectedCard = card;
                    break;
                }
            }
            cards = new List <ClientCard>(this.Enemy.Graveyard.GetMatchingCards(card => card.IsCanRevive()));
            cards.Sort(CardContainer.CompareCardAttack);
            for (int i = cards.Count - 1; i >= 0; --i)
            {
                ClientCard card = cards[i];
                if (card.Attack < 1000)
                {
                    break;
                }

                if (card.IsMonster() && card.HasType(CardType.Normal) && (selectedCard == null || card.Attack > selectedCard.Attack))
                {
                    selectedCard = card;
                    break;
                }
            }
            if (selectedCard != null)
            {
                this.AI.SelectCard(selectedCard);
                return(true);
            }
            return(false);
        }