Beispiel #1
0
 //使徒 试炼
 private bool SshilianEffect()
 {
     if (Card.Location == CardLocation.SpellZone)
     {
         ClientCard target = Util.GetBestEnemyCard();
         if (target != null && (target.HasType(CardType.Continuous) || target.HasType(CardType.Effect)))
         {
             AI.SelectCard(target);
             AI.SelectNextCard(should_select);
             AI.SelectThirdCard(should_select);
             return(true);
         }
         else if (target == null)
         {
             AI.SelectCard(CardId.Sshilian);
             AI.SelectNextCard(should_select);
             AI.SelectThirdCard(should_select);
             return(true);
         }
         return(false);
     }
     else if (Card.Location == CardLocation.Hand || Card.Location == CardLocation.Removed || Card.Location == CardLocation.Grave)
     {
         return(true);
     }
     return(false);
 }
Beispiel #2
0
 protected bool DefaultBookOfMoon()
 {
     if (AI.Utils.IsEnnemyBetter(true, true))
     {
         ClientCard monster = Duel.Fields[1].GetMonsters().GetHighestAttackMonster();
         if (monster != null && monster.HasType(CardType.Effect) && (monster.HasType(CardType.Xyz) || monster.Level > 4))
         {
             AI.SelectCard(monster);
             return(true);
         }
     }
     return(false);
 }
Beispiel #3
0
 /// <summary>
 /// Set the highest ATK level 4+ effect enemy monster.
 /// </summary>
 protected bool DefaultBookOfMoon()
 {
     if (Util.IsAllEnemyBetter(true))
     {
         ClientCard monster = Enemy.GetMonsters().GetHighestAttackMonster(true);
         if (monster != null && monster.HasType(CardType.Effect) && !monster.HasType(CardType.Link) && (monster.HasType(CardType.Xyz) || monster.Level > 4))
         {
             AI.SelectCard(monster);
             return(true);
         }
     }
     return(false);
 }
Beispiel #4
0
        //太阳神 黑鸟恐惧
        private bool  XtheiniaokongjuEffect()
        {
            ClientCard LastChainCard = Util.GetLastChainCard();

            if (LastChainCard != null && Duel.LastChainPlayer != 0 && (LastChainCard.HasType(CardType.Spell) || LastChainCard.HasType(CardType.Trap)))
            {
                if (!Bot.HasInMonstersZone(CardId.Tlvmax))
                {
                    if (Bot.HasInSpellZone(CardId.Xtermoqudai, false, false) && Bot.LifePoints > 500)
                    {
                        return(false);
                    }
                    return(true);
                }
                else
                {
                    List <ClientCard> monsters = Bot.GetMonsters();
                    foreach (ClientCard card in monsters)
                    {
                        if (card.IsFaceup() && card.IsCode(CardId.Tlvmax) && !card.IsDisabled())
                        {
                            return(false);
                        }
                        return(true);
                    }
                }
            }
            return(false);
        }
Beispiel #5
0
        private bool BellowOfTheSilverDragon()
        {
            if (Duel.Player == 0 && (Duel.Phase == DuelPhase.Draw || Duel.Phase == DuelPhase.Standby))
            {
                return(false);
            }
            if (Duel.Player == 1 && Duel.Phase == DuelPhase.End)
            {
                return(false);
            }

            List <ClientCard> cards = new List <ClientCard>(Duel.Fields[0].Graveyard);

            cards.Sort(AIFunctions.CompareCardAttack);
            for (int i = cards.Count - 1; i >= 0; --i)
            {
                ClientCard card = cards[i];
                if (card.Attack < 1000)
                {
                    return(false);
                }
                if (card.IsMonster() && card.HasType(CardType.Normal))
                {
                    AI.SelectCard(card);
                    return(true);
                }
            }
            return(false);
        }
        private bool SilversCry()
        {
            if (Duel.Player == 0 && (Duel.Phase == DuelPhase.Draw || Duel.Phase == DuelPhase.Standby))
            {
                return(false);
            }
            if (Duel.Player == 1 && Duel.Phase == DuelPhase.End)
            {
                return(false);
            }

            List <ClientCard> cards = new List <ClientCard>(Bot.Graveyard);

            cards.Sort(CardContainer.CompareCardAttack);
            for (int i = cards.Count - 1; i >= 0; --i)
            {
                ClientCard card = cards[i];
                if (card.Attack < 1000)
                {
                    return(false);
                }
                if (card.IsMonster() && card.HasType(CardType.Normal))
                {
                    AI.SelectCard(card);
                    return(true);
                }
            }
            return(false);
        }
 public override bool OnPreBattleBetween(ClientCard attacker, ClientCard defender)
 {
     if (!defender.IsMonsterHasPreventActivationEffectInBattle())
     {
         if (attacker.HasType(CardType.Fusion) && Bot.HasInHand(CardId.AleisterTheInvoker))
         {
             attacker.RealPower = attacker.RealPower + 1000;
         }
     }
     return(base.OnPreBattleBetween(attacker, defender));
 }
Beispiel #8
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 < 2000)
                {
                    break;
                }

                if (card.IsCode(CardId.StardustDragonAssaultMode, CardId.FiveHeadedDragon))
                {
                    continue;
                }

                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 < 2000)
                {
                    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);
        }
Beispiel #9
0
        private bool MonsterReborn()
        {
            List <ClientCard> cards = new List <ClientCard>(Bot.Graveyard);

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

            for (int i = cards.Count - 1; i >= 0; --i)
            {
                ClientCard card = cards[i];
                if (card.Attack < 2000)
                {
                    break;
                }
                if (card.Id == (int)CardId.StardustDragonAssaultMode ||
                    card.Id == (int)CardId.FiveHeadedDragon)
                {
                    continue;
                }
                if (card.IsMonster())
                {
                    selectedCard = card;
                    break;
                }
            }
            cards = new List <ClientCard>(Enemy.Graveyard);
            cards.Sort(AIFunctions.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 #10
0
        // Token: 0x0600040A RID: 1034 RVA: 0x000228B4 File Offset: 0x00020AB4
        private bool FusheyunEffect()
        {
            ClientCard target = base.Util.GetBestEnemyCard(false, false);
            bool       flag   = this.Hundunjuhe || (target != null && (!target.HasType(CardType.Continuous) || !target.HasType(CardType.Monster)));
            bool       result;

            if (flag)
            {
                result = false;
            }
            else
            {
                bool flag2 = base.Bot.GetMonsterCount() < base.Enemy.GetMonsterCount();
                result = flag2;
            }
            return(result);
        }
 // update stats for battle prediction based on effects
 public override bool OnPreBattleBetween(ClientCard attacker, ClientCard defender)
 {
     if (!defender.IsMonsterHasPreventActivationEffectInBattle())
     {
         if (attacker.IsCode(CardId.ShaddollConstruct) && !attacker.IsDisabled() && defender.IsSpecialSummoned) // NOTE: Possible to check destruction immunity?
         {
             attacker.RealPower = 9999;
         }
         if (attacker.IsCode(CardId.DragmaFleur) && !attacker.IsDisabled() && !FleurAttackUsed)
         {
             attacker.RealPower += 500;
         }
         if (attacker.HasType(CardType.Fusion) && Bot.HasInHand(CardId.InvokedAleister))
         {
             attacker.RealPower += 1000;
         }
     }
     return(base.OnPreBattleBetween(attacker, defender));
 }
Beispiel #12
0
        private bool MonsterReborn()
        {
            List <ClientCard> cards = new List <ClientCard>(Duel.Fields[0].Graveyard);

            cards.Sort(AIFunctions.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>(Duel.Fields[1].Graveyard);
            cards.Sort(AIFunctions.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)
            {
                AI.SelectCard(selectedCard);
                return(true);
            }
            return(false);
        }
Beispiel #13
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 < 1000)
                {
                    break;
                }
                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 < 1000)
                {
                    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 #14
0
 //战斗暴龙兽
 private bool SzhandoubaolongEffect()
 {
     if (ActivateDescription == Util.GetStringId(CardId.Szhandoubaolong, 1))
     {
         int        BotAttack = Util.GetBestAttack(Bot);
         int        EnAttack  = Util.GetBestAttack(Enemy);
         ClientCard chainCard = Util.GetLastChainCard();
         if (SzhandoubaolongDisEffect || Card.Overlays.Count <= 0)
         {
             if (chainCard != null && Duel.LastChainPlayer == 1 && (chainCard.HasType(CardType.Continuous) || chainCard.HasType(CardType.Monster) || chainCard.HasType(CardType.Field)) && (chainCard.Location == CardLocation.MonsterZone || chainCard.Location == CardLocation.SpellZone))
             {
                 return(true);
             }
             return(false);
         }
         return(BotAttack <= EnAttack || Enemy.GetMonsterCount() + Enemy.GetSpellCount() >= Bot.GetMonsterCount() + Enemy.GetSpellCount());
     }
     else if (Card.Overlays.Contains(CardId.Sjixiebaolong) && Duel.CurrentChain.Count > 0)
     {
         if (Duel.LastChainPlayer != 0 && ActivateDescription != Util.GetStringId(CardId.Szhandoubaolong, 1))
         {
             AI.SelectCard(CardId.Sheiqiushou, CardId.Syagu, CardId.Sbaolong, CardId.Szhandoubaolong);
             SzhandoubaolongDisEffect = true;
             return(true);
         }
         return(false);
     }
     else
     {
         ClientCard card = Util.GetBestEnemyMonster();
         if (Enemy.GetMonsterCount() <= 0)
         {
             return(false);
         }
         if (card != null)
         {
             AI.SelectCard(card);
             return(true);
         }
     }
     return(false);
 }
        private bool AleisterEffect()
        {
            // search effect
            if (Card.Location == CardLocation.MonsterZone)
            {
                return(true);
            }

            // activate only in damage calc
            if (!(Duel.Phase == DuelPhase.DamageCal))
            {
                return(false);
            }

            // activate only if fighting a monster where it makes the difference
            ClientCard myMonster = Bot.BattlingMonster;

            if (!myMonster.HasType(CardType.Fusion))
            {
                return(false);
            }
            ClientCard oppMonster = Enemy.BattlingMonster;

            if (oppMonster != null)
            {
                int diff = oppMonster.RealPower - myMonster.Attack;
                if (diff > 0 && (diff < 1000) || Bot.LifePoints - diff < 0)
                {
                    AI.SelectCard(myMonster);
                    return(true);
                }
            }
            if (Enemy.LifePoints - myMonster.Attack <= 1000)
            {
                AI.SelectCard(myMonster);
                return(true);
            }

            return(false);
        }
 //先史遗产 维摩那
 private bool XweimonaEffect()
 {
     foreach (ClientCard card in Bot.GetMonsters())
     {
         if (ActivateDescription == Util.GetStringId(CardId.Xweimona, 0))
         {
             AI.SelectCard(CardId.Xweimona, CardId.Xshuijinglifangti);
             AI.SelectNextCard(CardId.Xmoaishixiang, CardId.Xhuojian, CardId.Xmowaladiqiuyi, CardId.Xxingxiangpan);
             return(true);
         }
         else if (ActivateDescription == Util.GetStringId(CardId.Xweimona, 1))
         {
             ClientCard target = Util.GetLastChainCard();
             if (target.HasType(CardType.Monster) && target.Attack == 0 && card.IsCode(CardId.Xshuijinglifangti) && !card.IsDisabled())
             {
                 return(false);
             }
             return(true);
         }
     }
     return(false);
 }
Beispiel #17
0
        private bool WidowAnchorEffect()
        {
            if (DefaultBreakthroughSkill())
            {
                WidowAnchorTarget = Util.GetLastChainCard();
                return(true);
            }

            if (!HaveThreeSpellsInGrave() || Duel.Player == 1 || Duel.Phase < DuelPhase.Main1 || Duel.Phase >= DuelPhase.Main2 || Util.ChainContainsCard(CardId.WidowAnchor))
            {
                return(false);
            }

            ClientCard target = Util.GetBestEnemyMonster(true, true);

            if (target != null && !target.IsDisabled() && !target.HasType(CardType.Normal))
            {
                WidowAnchorTarget = target;
                AI.SelectCard(target);
                return(true);
            }
            return(false);
        }
Beispiel #18
0
        //装甲 前线准备
        private bool XjinjizhunbeiEffect()
        {
            bool TrapCard = false;

            foreach (ClientCard card in Bot.GetSpells())
            {
                if (card.IsFacedown() && card.HasType(CardType.Trap) && !card.IsCode(CardId.Xjinjizhunbei))
                {
                    TrapCard = true;
                }
            }
            if (!Xjinjizhunbei)
            {
                turnNumber    = Duel.Turn;
                Xjinjizhunbei = true;
                return(true);
            }
            else if (Bot.HasInHand(CardId.Zjiqiangzhishengji) && Bot.GetMonstersInMainZone().Count < 5)
            {
                if (TrapCard)
                {
                    return(false);
                }
                else if (Bot.GetCountCardInZone(Bot.SpellZone, CardId.Xjinjizhunbei) > 1)
                {
                    ClientCard last_card = Util.GetLastChainCard();
                    if (last_card != null && last_card.Controller == 0 && (last_card.HasType(CardType.Trap) || last_card.IsCode(CardId.Zjiqiangzhishengji)))
                    {
                        return(false);
                    }
                    return(true);
                }
                return(false);
            }
            return(false);
        }
Beispiel #19
0
        /// <summary>
        /// Clever enough.
        /// </summary>
        protected bool DefaultDimensionalBarrier()
        {
            const int RITUAL   = 0;
            const int FUSION   = 1;
            const int SYNCHRO  = 2;
            const int XYZ      = 3;
            const int PENDULUM = 4;

            if (Duel.Player != 0)
            {
                List <ClientCard> monsters = Enemy.GetMonsters();
                int[]             levels   = new int[13];
                bool tuner    = false;
                bool nontuner = false;
                foreach (ClientCard monster in monsters)
                {
                    if (monster.HasType(CardType.Tuner))
                    {
                        tuner = true;
                    }
                    else if (!monster.HasType(CardType.Xyz) && !monster.HasType(CardType.Link))
                    {
                        nontuner = true;
                        levels[monster.Level] = levels[monster.Level] + 1;
                    }

                    if (monster.IsOneForXyz())
                    {
                        AI.SelectOption(XYZ);
                        return(true);
                    }
                }
                if (tuner && nontuner)
                {
                    AI.SelectOption(SYNCHRO);
                    return(true);
                }
                for (int i = 1; i <= 12; i++)
                {
                    if (levels[i] > 1)
                    {
                        AI.SelectOption(XYZ);
                        return(true);
                    }
                }
                ClientCard l = Enemy.SpellZone[6];
                ClientCard r = Enemy.SpellZone[7];
                if (l != null && r != null && l.LScale != r.RScale)
                {
                    AI.SelectOption(PENDULUM);
                    return(true);
                }
            }
            ClientCard lastchaincard = Util.GetLastChainCard();

            if (Duel.LastChainPlayer == 1 && lastchaincard != null && !lastchaincard.IsDisabled())
            {
                if (lastchaincard.HasType(CardType.Ritual))
                {
                    AI.SelectOption(RITUAL);
                    return(true);
                }
                if (lastchaincard.HasType(CardType.Fusion))
                {
                    AI.SelectOption(FUSION);
                    return(true);
                }
                if (lastchaincard.HasType(CardType.Synchro))
                {
                    AI.SelectOption(SYNCHRO);
                    return(true);
                }
                if (lastchaincard.HasType(CardType.Xyz))
                {
                    AI.SelectOption(XYZ);
                    return(true);
                }
                if (lastchaincard.IsFusionSpell())
                {
                    AI.SelectOption(FUSION);
                    return(true);
                }
            }
            if (Util.IsChainTarget(Card))
            {
                AI.SelectOption(XYZ);
                return(true);
            }
            return(false);
        }
 //先史遗产 水晶立方体
 private bool XshuijinglifangtiEffect()
 {
     foreach (ClientCard card in Bot.GetMonsters())
     {
         foreach (ClientCard card2 in Bot.Hand)
         {
             if (ActivateDescription != Util.GetStringId(CardId.Xshuijinglifangti, 0) && ActivateDescription != Util.GetStringId(CardId.Xshuijinglifangti, 1) && ActivateDescription != Util.GetStringId(CardId.Xshuijinglifangti, 2))
             {
                 int i = 0;
                 do
                 {
                     if (i == 0)
                     {
                         //超量拉怪
                         AI.SelectCard(CardId.Xtuou, CardId.Xmoaishixiang, CardId.Xhuojian, CardId.Xmowaladiqiuyi, CardId.Xxingxiangpan);
                         AI.SelectNextCard(CardId.Xtuou, CardId.Xmoaishixiang, CardId.Xhuojian, CardId.Xmowaladiqiuyi, CardId.Xxingxiangpan);
                         AI.SelectThirdCard(CardId.Xweimona, CardId.Xchaqiu);
                         AI.SelectPosition(CardPosition.FaceUpAttack);
                         i++;
                         return(true);
                     }
                     else if (i == 1)
                     {
                         //连接检索
                         if (!Xshuijingtougu)
                         {
                             AI.SelectCard(CardId.Xshuijingtougu, CardId.Xsanjushi, CardId.Xshiguan, CardId.Xgankushoujingtougu);
                         }
                         else if (!Bot.HasInHand(CardId.Xsanjushi) && !Bot.HasInSpellZone(CardId.Xsanjushi) && (!Bot.HasInBanished(CardId.Xsanjushi) && !Bot.HasInGraveyard(CardId.Xsanjushi)))
                         {
                             AI.SelectCard(CardId.Xsanjushi, CardId.Xshiguan, CardId.Xgankushoujingtougu);
                         }
                         else
                         {
                             AI.SelectCard(CardId.Xshiguan, CardId.Xgankushoujingtougu);
                         }
                         i++;
                         return(true);
                     }
                 } while (i >= 2); return(false);
             }
             else if (ActivateDescription == Util.GetStringId(CardId.Xshuijinglifangti, 0))
             {
                 //检索
                 if (!Bot.HasInSpellZone(CardId.Xsanjushi, false, true))
                 {
                     AI.SelectCard(CardId.Xmowaladiqiuyi);
                     if ((Bot.GetMonsterCount() <= 3 && Bot.GetMonstersExtraZoneCount() == 0) || (Bot.GetMonsterCount() <= 4 && Bot.GetMonstersExtraZoneCount() >= 1))
                     {
                         if (!Bot.HasInHand(CardId.Xgankushoujingtougu))
                         {
                             AI.SelectNextCard(CardId.Xgankushoujingtougu, CardId.Xtaiyangdushibei);
                         }
                         else
                         {
                             AI.SelectNextCard(CardId.Xtaiyangdushibei, CardId.Xgankushoujingtougu);
                         }
                     }
                     else
                     {
                         AI.SelectNextCard(CardId.Xtaiyangdushibei, CardId.Xgankushoujingtougu);
                     }
                     Xshuijinglifangt = true;
                     return(true);
                 }
                 else if (Bot.HasInSpellZone(CardId.Xsanjushi, false, true))
                 {
                     AI.SelectCard(CardId.Xgankushoujingtougu, CardId.Xtaiyangdushibei);
                     if ((Bot.GetMonsterCount() <= 3 && Bot.GetMonstersExtraZoneCount() == 0) || (Bot.GetMonsterCount() <= 4 && Bot.GetMonstersExtraZoneCount() >= 1))
                     {
                         AI.SelectNextCard(CardId.Xgankushoujingtougu, CardId.Xtaiyangdushibei);
                     }
                     else
                     {
                         if (Bot.HasInHand(CardId.Sxingguangzhili) || Bot.HasInHand(CardId.Shundunzhili))
                         {
                             AI.SelectNextCard(CardId.Xtaiyangdushibei, CardId.Xgankushoujingtougu);
                         }
                         else
                         {
                             AI.SelectNextCard(CardId.Xmoaishixiang, CardId.Xgankushoujingtougu, CardId.Xtaiyangdushibei);
                         }
                     }
                     Xshuijinglifangt = true;
                     return(true);
                 }
                 else
                 {
                     AI.SelectCard(CardId.Xmowaladiqiuyi);
                     if ((Bot.GetMonsterCount() <= 3 && Bot.GetMonstersExtraZoneCount() == 0) || (Bot.GetMonsterCount() <= 4 && Bot.GetMonstersExtraZoneCount() >= 1))
                     {
                         AI.SelectNextCard(CardId.Xgankushoujingtougu, CardId.Xtaiyangdushibei);
                     }
                     else
                     {
                         if (Bot.HasInHand(CardId.Sxingguangzhili) || Bot.HasInHand(CardId.Shundunzhili))
                         {
                             if (card.HasType(CardType.Effect) && Bot.HasInHand(CardId.Xtaiyangdushibei))
                             {
                                 AI.SelectNextCard(CardId.Xtaiyangdushibei, CardId.Xgankushoujingtougu);
                             }
                             return(false);
                         }
                         else
                         {
                             if (Bot.HasInHand(CardId.Xtaiyangdushibei))
                             {
                                 return(false);
                             }
                             {
                                 AI.SelectNextCard(CardId.Xmoaishixiang, CardId.Xgankushoujingtougu, CardId.Xtaiyangdushibei);
                             }
                         }
                     }
                     Xshuijinglifangt = true;
                     return(true);
                 }
             }
             else if (ActivateDescription == Util.GetStringId(CardId.Xshuijinglifangti, 1))
             {
                 //召唤
                 if ((!Xshuijinglifangt && Duel.Player == 0) || (Util.ChainContainsCard(CardId.Xshuijinglifangti) && Duel.LastChainPlayer == 0))
                 {
                     return(false);
                 }
                 {
                     if (card2.Level >= 5 || Bot.GetMonsterCount() >= 5)
                     {
                         return(false);
                     }
                     else if ((Bot.GetMonsterCount() <= 3 && Bot.GetMonstersExtraZoneCount() == 0) || (Bot.GetMonsterCount() <= 4 && Bot.GetMonstersExtraZoneCount() >= 1))
                     {
                         AI.SelectCard(CardId.Xgankushoujingtougu, CardId.Xxingxiangpan, CardId.Xacitekemianjuren, CardId.Xmowaladiqiuyi, CardId.Xhuojian, CardId.Xshuijingtougu);
                         return(true);
                     }
                     else
                     {
                         AI.SelectCard(CardId.Xxingxiangpan, CardId.Xtaiyangdushibei);
                         return(true);
                     }
                 }
             }
             else if (ActivateDescription == Util.GetStringId(CardId.Xshuijinglifangti, 2))
             {
                 if (Duel.LastChainPlayer != 0)
                 {
                     ClientCard target = Util.GetLastChainCard();
                     if (target.HasType(CardType.Monster) && target.Attack == 0)
                     {
                         return(false);
                     }
                     {
                         AI.SelectCard(should_select);
                         return(true);
                     }
                 }
                 return(false);
             }
         }
     }
     return(false);
 }
Beispiel #21
0
 /// <summary>
 /// Is this card shouldn't be tried to be selected as target?
 /// </summary>
 public static bool IsShouldNotBeTarget(this ClientCard card)
 {
     return(!card.IsDisabled() && !card.HasType(CardType.Normal) && Enum.IsDefined(typeof(ShouldNotBeTarget), card.Id));
 }
Beispiel #22
0
 private bool ShouldBeDestroyedBeforeMainPhaseEnd(ClientCard card)
 {
     return(((card.IsMonster() && card.IsFaceup()) || (card.IsFaceup() && (card.HasType(CardType.Continuous) || card.HasType(CardType.Field)))) && this.IsDestroyableCard(card));
 }
Beispiel #23
0
        // Token: 0x0600040B RID: 1035 RVA: 0x00022928 File Offset: 0x00020B28
        private bool HundunjuheEffect()
        {
            ClientCard target = base.Util.GetBestEnemyMonster(false, false);
            bool       flag   = base.Enemy.GetMonsterCount() >= 5 && base.Enemy.GetMonstersExtraZoneCount() >= 1;
            bool       result;

            if (flag)
            {
                result = false;
            }
            else
            {
                bool flag2 = target != null;
                if (flag2)
                {
                    foreach (ClientCard card in base.Bot.MonsterZone)
                    {
                        using (IEnumerator <ClientCard> enumerator = base.Bot.Hand.GetEnumerator())
                        {
                            if (enumerator.MoveNext())
                            {
                                ClientCard card2 = enumerator.Current;
                                bool       flag3 = ((card != null && card.HasType(CardType.Monster) && card.HasSetcode(214)) || (card2 != null && card2.HasType(CardType.Monster) && card2.HasSetcode(214))) && base.Bot.HasInSpellZone(9982051, false, false);
                                if (flag3)
                                {
                                    return(false);
                                }
                                base.AI.SelectCard(target);
                                base.AI.SelectPosition(CardPosition.FaceUpAttack);
                                this.Hundunjuhe = true;
                                return(true);
                            }
                        }
                    }
                }
                else
                {
                    bool flag4 = base.Card.Location == CardLocation.MonsterZone;
                    if (flag4)
                    {
                        bool flag5 = base.Card.IsOriginalCode(8824598);
                        if (flag5)
                        {
                            return(false);
                        }
                        base.AI.SelectPosition(CardPosition.FaceUpDefence);
                        base.AI.SelectPlace(96);
                        return(true);
                    }
                }
                result = false;
            }
            return(result);
        }
Beispiel #24
0
        protected bool DefaultDimensionalBarrier()
        {
            if (Duel.Player != 0)
            {
                List <ClientCard> monsters = Duel.Fields[1].GetMonsters();
                int[]             levels   = new int[13];
                bool tuner    = false;
                bool nontuner = false;
                foreach (ClientCard monster in monsters)
                {
                    if (monster.HasType(CardType.Tuner))
                    {
                        tuner = true;
                    }
                    else if (!monster.HasType(CardType.Xyz))
                    {
                        nontuner = true;
                    }
                    if (monster.IsOneForXyz())
                    {
                        AI.SelectOption(3);
                        return(true);
                    }
                    levels[monster.Level] = levels[monster.Level] + 1;
                }
                if (tuner && nontuner)
                {
                    AI.SelectOption(2);
                    return(true);
                }
                for (int i = 1; i <= 12; i++)
                {
                    if (levels[i] > 1)
                    {
                        AI.SelectOption(3);
                        return(true);
                    }
                }
                ClientCard l = Duel.Fields[1].SpellZone[6];
                ClientCard r = Duel.Fields[1].SpellZone[7];
                if (l != null && r != null && l.LScale != r.RScale)
                {
                    AI.SelectOption(4);
                    return(true);
                }
            }
            ClientCard lastchaincard = GetLastChainCard();

            if (LastChainPlayer == 1 && lastchaincard != null && !lastchaincard.IsDisabled())
            {
                if (lastchaincard.HasType(CardType.Ritual))
                {
                    AI.SelectOption(0);
                    return(true);
                }
                if (lastchaincard.HasType(CardType.Fusion))
                {
                    AI.SelectOption(1);
                    return(true);
                }
                if (lastchaincard.HasType(CardType.Synchro))
                {
                    AI.SelectOption(2);
                    return(true);
                }
                if (lastchaincard.HasType(CardType.Xyz))
                {
                    AI.SelectOption(3);
                    return(true);
                }
                if (lastchaincard.IsFusionSpell())
                {
                    AI.SelectOption(1);
                    return(true);
                }
            }
            foreach (ClientCard card in Duel.ChainTargets)
            {
                if (Card.Equals(card))
                {
                    AI.SelectOption(3);
                    return(true);
                }
            }
            return(false);
        }