コード例 #1
0
ファイル: DragunityExecutor.cs プロジェクト: IMJoyJ/windbot
        private bool SetUselessCards()
        {
            ClientField field = this.Bot;

            if (field.HasInSpellZone(CardId.FireFormationTenki))
            {
                return(false);
            }

            if (field.HasInSpellZone(CardId.AssaultTeleport))
            {
                return(false);
            }

            if (field.HasInSpellZone(CardId.CardsOfConsonance))
            {
                return(false);
            }

            if (field.HasInSpellZone(CardId.DragonsMirror))
            {
                return(false);
            }

            return(this.Bot.GetSpellCountWithoutField() < 4);
        }
コード例 #2
0
        private bool ScrapDragonEffect()
        {
            ClientCard invincible = GetProblematicCard();

            if (invincible == null && !AI.Utils.IsOneEnnemyBetterThanValue(2800 - 1, false))
            {
                return(false);
            }

            ClientField field = Duel.Fields[0];

            int tributeId = -1;

            if (field.HasInSpellZone((int)CardId.FireFormationTenki))
            {
                tributeId = (int)CardId.FireFormationTenki;
            }
            else if (field.HasInSpellZone((int)CardId.Terraforming))
            {
                tributeId = (int)CardId.Terraforming;
            }
            else if (field.HasInSpellZone((int)CardId.DragonsMirror))
            {
                tributeId = (int)CardId.DragonsMirror;
            }
            else if (field.HasInSpellZone((int)CardId.CardsOfConsonance))
            {
                tributeId = (int)CardId.CardsOfConsonance;
            }
            else if (field.HasInSpellZone((int)CardId.AssaultTeleport))
            {
                tributeId = (int)CardId.AssaultTeleport;
            }
            else if (field.HasInSpellZone((int)CardId.AssaultModeActivate))
            {
                tributeId = (int)CardId.AssaultModeActivate;
            }
            else if (field.HasInSpellZone((int)CardId.DragonRavine))
            {
                tributeId = (int)CardId.DragonRavine;
            }

            List <ClientCard> monsters = Duel.Fields[1].GetMonsters();

            monsters.Sort(AIFunctions.CompareCardAttack);

            ClientCard destroyCard = invincible;

            if (destroyCard == null)
            {
                for (int i = monsters.Count - 1; i >= 0; --i)
                {
                    if (monsters[i].IsAttack())
                    {
                        destroyCard = monsters[i];
                        break;
                    }
                }
            }

            if (destroyCard == null)
            {
                return(false);
            }

            if (tributeId != -1)
            {
                AI.SelectCard(tributeId);
            }

            AI.SelectNextCard(destroyCard);

            return(true);
        }