Example #1
0
 private bool 没有电子龙可特殊召唤()
 {
     if (CyberDragonInHand() && (Bot.GetMonsterCount() == 0 && Duel.Fields[1].GetMonsterCount() != 0))
     {
         return(false);
     }
     return(true);
 }
Example #2
0
        private bool DragonRavineEffect()
        {
            if (Card.Location != CardLocation.SpellZone)
            {
                return(false);
            }

            ClientField field = Duel.Fields[0];

            int tributeId = -1;

            if (field.HasInHand((int)CardId.DragunityPhalanx))
            {
                tributeId = (int)CardId.DragunityPhalanx;
            }
            else if (field.HasInHand((int)CardId.FireFormationTenki))
            {
                tributeId = (int)CardId.FireFormationTenki;
            }
            else if (field.HasInHand((int)CardId.Terraforming))
            {
                tributeId = (int)CardId.Terraforming;
            }
            else if (field.HasInHand((int)CardId.DragonRavine))
            {
                tributeId = (int)CardId.DragonRavine;
            }
            else if (field.HasInHand((int)CardId.AssaultTeleport))
            {
                tributeId = (int)CardId.AssaultTeleport;
            }
            else if (field.HasInHand((int)CardId.AssaultBeast))
            {
                tributeId = (int)CardId.AssaultBeast;
            }
            else if (field.HasInHand((int)CardId.DragunityArmaMysletainn))
            {
                tributeId = (int)CardId.DragunityArmaMysletainn;
            }
            else
            {
                int count = 0;
                foreach (ClientCard card in Duel.Fields[0].Hand)
                {
                    if (card.Id == (int)CardId.DragunityDux)
                    {
                        ++count;
                    }
                }
                if (count >= 2)
                {
                    tributeId = (int)CardId.DragunityDux;
                }
            }
            if (tributeId == -1 && field.HasInHand((int)CardId.StardustDragonAssaultMode))
            {
                tributeId = (int)CardId.StardustDragonAssaultMode;
            }

            if (tributeId == -1)
            {
                return(false);
            }

            int needId = -1;

            if (!field.HasInMonstersZone((int)CardId.DragunityPhalanx) &&
                !field.HasInGraveyard((int)CardId.DragunityPhalanx))
            {
                needId = (int)CardId.DragunityPhalanx;
            }
            else if (field.GetMonsterCount() == 0)
            {
                needId = (int)CardId.DragunityDux;
            }
            else
            {
                bool hasRealMonster = false;
                foreach (ClientCard card in field.GetMonsters())
                {
                    if (card.Id != (int)CardId.AssaultBeast)
                    {
                        hasRealMonster = true;
                        break;
                    }
                }
                if (!hasRealMonster || GetProblematicCard() != null)
                {
                    needId = (int)CardId.DragunityDux;
                }
            }

            if (needId == -1)
            {
                return(false);
            }

            int option;

            if (tributeId == (int)CardId.DragunityPhalanx)
            {
                needId = (int)CardId.DragunityDux;
            }

            int remaining = 3;

            foreach (ClientCard card in Duel.Fields[0].Hand)
            {
                if (card.Id == needId)
                {
                    remaining--;
                }
            }
            foreach (ClientCard card in Duel.Fields[0].Graveyard)
            {
                if (card.Id == needId)
                {
                    remaining--;
                }
            }
            foreach (ClientCard card in Duel.Fields[0].Banished)
            {
                if (card.Id == needId)
                {
                    remaining--;
                }
            }
            if (remaining <= 0)
            {
                return(false);
            }

            if (needId == (int)CardId.DragunityPhalanx)
            {
                option = 2;
            }
            else
            {
                option = 1;
            }

            if (ActivateDescription != (int)CardId.DragonRavine * 16 + option)
            {
                return(false);
            }

            AI.SelectCard(tributeId);
            AI.SelectNextCard(needId);

            return(true);
        }