Exemplo n.º 1
0
 public static int CompareCardAttack(ClientCard cardA, ClientCard cardB)
 {
     if (cardA.Attack < cardB.Attack)
         return -1;
     if (cardA.Attack == cardB.Attack)
         return 0;
     return 1;
 }
Exemplo n.º 2
0
 public virtual bool OnPreBattleBetween(ClientCard attacker, ClientCard defender)
 {
     if (defender.IsMonsterInvincible())
     {
         if (defender.IsMonsterDangerous() || defender.IsDefense())
             return false;
     }
     return true;
 }
Exemplo n.º 3
0
 public static int CompareDefensePower(ClientCard cardA, ClientCard cardB)
 {
     if (cardA == null && cardB == null)
         return 0;
     if (cardA == null)
         return -1;
     if (cardB == null)
         return 1;
     int powerA = cardA.GetDefensePower();
     int powerB = cardB.GetDefensePower();
     if (powerA < powerB)
         return -1;
     if (powerA == powerB)
         return 0;
     return 1;
 }
Exemplo n.º 4
0
        private bool RebornEffect()
        {
            if (Duel.Player == 0 && Duel.CurrentChain.Count > 0)
            {
                // Silver's Cry spsummon Dragon Spirit at chain 2 will miss the timing
                return(false);
            }
            if (Duel.Player == 0 && (Duel.Phase == DuelPhase.Draw || Duel.Phase == DuelPhase.Standby))
            {
                // Let Azure-Eyes spsummon first
                return(false);
            }
            IList <int> targets = new[] {
                CardId.HopeHarbingerDragonTitanicGalaxy,
                CardId.GalaxyEyesDarkMatterDragon,
                CardId.AlternativeWhiteDragon,
                CardId.AzureEyesSilverDragon,
                CardId.BlueEyesSpiritDragon,
                CardId.WhiteDragon,
                CardId.DragonSpiritOfWhite
            };

            if (!Bot.HasInGraveyard(targets))
            {
                return(false);
            }
            ClientCard floodgate = Enemy.SpellZone.GetFloodgate();

            if (floodgate != null && Bot.HasInGraveyard(CardId.DragonSpiritOfWhite))
            {
                AI.SelectCard(CardId.DragonSpiritOfWhite);
            }
            else
            {
                AI.SelectCard(targets);
            }
            return(true);
        }
Exemplo n.º 5
0
        public override BattlePhaseAction OnSelectAttackTarget(ClientCard attacker, IList <ClientCard> defenders)
        {
            if (attacker.IsCode(CardId.BlueEyesChaosMaxDragon) && !attacker.IsDisabled() &&
                this.Enemy.HasInMonstersZone(new[] { CardId.DeviritualTalismandra, CardId.DevirrtualCandoll }))
            {
                for (int i = 0; i < defenders.Count; i++)
                {
                    ClientCard defender = defenders[i];
                    attacker.RealPower = attacker.Attack;
                    defender.RealPower = defender.GetDefensePower();
                    if (!this.OnPreBattleBetween(attacker, defender))
                    {
                        continue;
                    }

                    if (defender.IsCode(CardId.DevirrtualCandoll, CardId.DeviritualTalismandra))
                    {
                        return(this.AI.Attack(attacker, defender));
                    }
                }
            }
            return(base.OnSelectAttackTarget(attacker, defenders));
        }
Exemplo n.º 6
0
        private bool CrossoutDesignatorEffect()
        {
            ClientCard LastChainCard = Util.GetLastChainCard();

            if (LastChainCard == null || Duel.LastChainPlayer != 1)
            {
                return(false);
            }
            return(CrossoutDesignatorCheck(LastChainCard, CardId.AquamancerOfTheSanctuary, 3) ||
                   CrossoutDesignatorCheck(LastChainCard, CardId.Sangan, 3) ||
                   CrossoutDesignatorCheck(LastChainCard, CardId.AshBlossomJoyousSpring, 3) ||
                   CrossoutDesignatorCheck(LastChainCard, CardId.MaxxC, 2) ||
                   CrossoutDesignatorCheck(LastChainCard, CardId.EffectVeiler, 1) ||
                   CrossoutDesignatorCheck(LastChainCard, CardId.RiteofAramesia, 3) ||
                   CrossoutDesignatorCheck(LastChainCard, CardId.HarpiesFeatherDuster, 1) ||
                   CrossoutDesignatorCheck(LastChainCard, CardId.FusionDestiny, 3) ||
                   CrossoutDesignatorCheck(LastChainCard, CardId.FoolishBurial, 1) ||
                   CrossoutDesignatorCheck(LastChainCard, CardId.MonsterReborn, 1) ||
                   CrossoutDesignatorCheck(LastChainCard, CardId.CalledByTheGrave, 2) ||
                   CrossoutDesignatorCheck(LastChainCard, CardId.CrossoutDesignator, 3) ||
                   CrossoutDesignatorCheck(LastChainCard, CardId.InfiniteImpermanence, 3)
                   );
        }
Exemplo n.º 7
0
        private bool ScoutActivate()
        {
            if (Card.Location != CardLocation.Hand)
            {
                return(false);
            }
            ClientCard l = Util.GetPZone(0, 0);
            ClientCard r = Util.GetPZone(0, 1);

            if (l == null && r == null)
            {
                return(true);
            }
            if (l == null && r.RScale != Card.LScale)
            {
                return(true);
            }
            if (r == null && l.LScale != Card.RScale)
            {
                return(true);
            }
            return(false);
        }
Exemplo n.º 8
0
        public int GetBestAttack(ClientField field, bool onlyatk)
        {
            int bestAtk = -1;

            for (int i = 0; i < 7; ++i)
            {
                ClientCard card = field.MonsterZone[i];
                if (card == null)
                {
                    continue;
                }
                if (onlyatk && card.IsDefense())
                {
                    continue;
                }
                int ennemyValue = card.GetDefensePower();
                if (ennemyValue > bestAtk)
                {
                    bestAtk = ennemyValue;
                }
            }
            return(bestAtk);
        }
Exemplo n.º 9
0
        /// <summary>
        /// Return problematic monster, and if this card become target, return any enemy monster.
        /// </summary>
        protected bool DefaultCompulsoryEvacuationDevice()
        {
            ClientCard target = AI.Utils.GetProblematicMonsterCard();

            if (target != null)
            {
                AI.SelectCard(target);
                return(true);
            }
            foreach (ClientCard card in Duel.ChainTargets)
            {
                if (Card.Equals(card))
                {
                    ClientCard monster = AI.Utils.GetAnyEnemyMonster();
                    if (monster != null)
                    {
                        AI.SelectCard(monster);
                        return(true);
                    }
                }
            }
            return(false);
        }
Exemplo n.º 10
0
 private bool S5sssww()
 {
     if (Card.Location == CardLocation.Grave)
     {
         AI.SelectCard(CardId.S14);
         return(true);
     }
     else if (Card.Location == CardLocation.Hand && (Bot.HasInHand(CardId.S4) || Bot.HasInHand(CardId.S7) || Bot.HasInHand(CardId.S5)))
     {
         ClientCard target = Util.GetProblematicEnemyMonster(Card.GetDefensePower());
         if (target != null)
         {
             AI.SelectCard(
                 CardId.S5,
                 CardId.S7,
                 CardId.S4
                 );
             AI.SelectNextCard(target);
             return(true);
         }
     }
     return(false);
 }
Exemplo n.º 11
0
        /// <summary>
        /// Get the best ATK or DEF power of the field.
        /// </summary>
        /// <param name="field">Bot or Enemy.</param>
        /// <param name="onlyATK">Only calculate attack.</param>
        public int GetBestPower(ClientField field, bool onlyATK = false)
        {
            int bestPower = -1;

            for (int i = 0; i < 7; ++i)
            {
                ClientCard card = field.MonsterZone[i];
                if (card == null || card.Data == null)
                {
                    continue;
                }
                if (onlyATK && card.IsDefense())
                {
                    continue;
                }
                int newPower = card.GetDefensePower();
                if (newPower > bestPower)
                {
                    bestPower = newPower;
                }
            }
            return(bestPower);
        }
Exemplo n.º 12
0
        private bool 应进行灵摆召唤()
        {
            ClientCard l = AI.Utils.GetPZone(0, 0);
            ClientCard r = AI.Utils.GetPZone(0, 1);

            if (l != null && r != null && l.LScale != r.RScale)
            {
                int count = 0;
                foreach (ClientCard card in Bot.Hand.GetMonsters())
                {
                    count++;
                }
                foreach (ClientCard card in Bot.ExtraDeck.GetMonsters())
                {
                    if (card.HasType(CardType.Pendulum) && card.IsFaceup())
                    {
                        count++;
                    }
                }
                return(count > 1);
            }
            return(false);
        }
Exemplo n.º 13
0
        private bool 应进行灵摆召唤()
        {
            ClientCard l = Duel.Fields[0].SpellZone[6];
            ClientCard r = Duel.Fields[0].SpellZone[7];

            if (l != null && r != null && l.LScale != r.RScale)
            {
                int count = 0;
                foreach (ClientCard card in Duel.Fields[0].Hand.GetMonsters())
                {
                    count++;
                }
                foreach (ClientCard card in Duel.Fields[0].ExtraDeck.GetMonsters())
                {
                    if (card.HasType(CardType.Pendulum) && card.IsFaceup())
                    {
                        count++;
                    }
                }
                return(count > 1);
            }
            return(false);
        }
Exemplo n.º 14
0
        private bool 机壳工具丑恶发动()
        {
            if (Card.Location != CardLocation.Hand)
            {
                return(false);
            }
            ClientCard l = Duel.Fields[0].SpellZone[6];
            ClientCard r = Duel.Fields[0].SpellZone[7];

            if (l == null && r == null)
            {
                return(true);
            }
            if (l == null && r.RScale != Card.LScale)
            {
                return(true);
            }
            if (r == null && l.LScale != Card.RScale)
            {
                return(true);
            }
            return(false);
        }
Exemplo n.º 15
0
        private bool AttackUpEffect()
        {
            ClientCard bestMy       = this.Bot.GetMonsters().GetHighestAttackMonster();
            ClientCard bestEnemyATK = this.Enemy.GetMonsters().GetHighestAttackMonster();
            ClientCard bestEnemyDEF = this.Enemy.GetMonsters().GetHighestDefenseMonster();

            if (bestMy == null || (bestEnemyATK == null && bestEnemyDEF == null))
            {
                return(false);
            }

            if (bestEnemyATK != null && bestMy.Attack < bestEnemyATK.Attack)
            {
                return(true);
            }

            if (bestEnemyDEF != null && bestMy.Attack < bestEnemyDEF.Defense)
            {
                return(true);
            }

            return(false);
        }
Exemplo n.º 16
0
        public bool Ring_act()
        {
            if (Duel.LastChainPlayer == 0 && AI.Utils.GetLastChainCard() != null)
            {
                return(false);
            }
            ClientCard target = AI.Utils.GetProblematicEnemyMonster();

            if (target == null && AI.Utils.IsChainTarget(Card))
            {
                target = AI.Utils.GetBestEnemyMonster(true, true);
            }
            if (target != null)
            {
                if (Bot.LifePoints <= target.Attack)
                {
                    return(false);
                }
                AI.SelectCard(target);
                return(true);
            }
            return(false);
        }
Exemplo n.º 17
0
        private bool 机壳工具丑恶发动()
        {
            if (Card.Location != CardLocation.Hand)
            {
                return(false);
            }
            ClientCard l = AI.Utils.GetPZone(0, 0);
            ClientCard r = AI.Utils.GetPZone(0, 1);

            if (l == null && r == null)
            {
                return(true);
            }
            if (l == null && r.RScale != Card.LScale)
            {
                return(true);
            }
            if (r == null && l.LScale != Card.RScale)
            {
                return(true);
            }
            return(false);
        }
Exemplo n.º 18
0
        private bool DragoEff()
        {
            // summon to negate
            ClientCard chainCard = Util.GetLastChainCard();

            if (Duel.LastChainPlayer == 1 && chainCard != null && !chainCard.IsShouldNotBeMonsterTarget()) // NOTE: Can check for already has counter?
            {
                AI.SelectCard(chainCard);
                return(true);
            }

            if (Duel.Phase == DuelPhase.End)
            {
                ClientCard enemyMon = Util.GetBestEnemyMonster(true, true);
                if (enemyMon != null)
                {
                    AI.SelectCard(enemyMon);
                }
                return(true);
            }

            return(false);
        }
Exemplo n.º 19
0
        private bool DridentEffect()
        {
            if (Duel.LastChainPlayer == 0)
            {
                return(false);
            }
            ClientCard target = Util.GetBestEnemyCard(true);

            if (target == null)
            {
                return(false);
            }
            AI.SelectCard(
                CardId.Broadbull,
                CardId.Tigermortar,
                CardId.Chakanine,
                CardId.Thoroughblade,
                CardId.Ratpier,
                CardId.Whiptail
                );
            AI.SelectNextCard(target);
            return(true);
        }
Exemplo n.º 20
0
        public IActionResult SaveDatabase([FromBody] ClientCardFromBody clientCardFromBody)
        {
            ClientCard clientCard;

            try
            {
                clientCard = ClientCard.ConvertToClientCard(clientCardFromBody);
            }
            catch (EntitiesException ex)
            {
                return(this.StatusCode(406, ex.Message));
            }

            try
            {
                this.dbService.AddClientCardWithContext(clientCard, this.context);
                return(this.Ok("Saved"));
            }
            catch (DatabaseException ex)
            {
                return(this.StatusCode(208, ex.Message));
            }
        }
Exemplo n.º 21
0
        private bool AlmirajSummon()
        {
            if (SkipSummonforKnightmare())
            {
                return(false);
            }
            if (Bot.GetMonsterCount() > 1)
            {
                return(false);
            }
            ClientCard mat = Bot.GetMonsters().First();

            if (mat.IsCode(new[] {
                CardId.JetSynchron,
                CardId.ThePhantomKnightsofAncientCloak,
                CardId.ThePhantomKnightsofSilentBoots
            }))
            {
                AI.SelectMaterials(mat);
                return(true);
            }
            return(false);
        }
Exemplo n.º 22
0
 public override bool OnPreBattleBetween(ClientCard attacker, ClientCard defender)
 {
     if (attacker.IsCode(CardId.CrystalWingSynchroDragon))
     {
         if (defender.Level >= 5)
         {
             attacker.RealPower = attacker.Attack + defender.Attack;
         }
         return(true);
     }
     else if (attacker.IsCode(CardId.DaigustoSphreez))
     {
         attacker.RealPower = attacker.Attack + defender.Attack + defender.Defense;
         return(true);
     }
     else if (Bot.HasInMonstersZone(CardId.DaigustoSphreez) &&
              attacker.IsCode(CardId.DaigustoSphreez, CardId.GustoGulldo, CardId.GustoEgul, CardId.WindaPriestessOfGusto, CardId.PilicaDescendantOfGusto, CardId.DaigustoGulldos))
     {
         attacker.RealPower = attacker.Attack + defender.Attack + defender.Defense;
         return(true);
     }
     return(base.OnPreBattleBetween(attacker, defender));
 }
Exemplo n.º 23
0
        protected bool DefaultCompulsoryEvacuationDevice()
        {
            ClientCard target = AI.Utils.GetProblematicMonsterCard();

            if (target != null)
            {
                AI.SelectCard(target);
                return(true);
            }
            foreach (ClientCard card in Duel.ChainTargets)
            {
                if (Card.Equals(card))
                {
                    List <ClientCard> monsters = Duel.Fields[1].GetMonsters();
                    foreach (ClientCard monster in monsters)
                    {
                        AI.SelectCard(monster);
                        return(true);
                    }
                }
            }
            return(false);
        }
Exemplo n.º 24
0
        private async Task <string> CheckClient(ClientCard clientCard)
        {
            var model = _repository.ClientCard.FirstOrDefault(m => m.ClientId == clientCard.ClientId);

            if (model == null)
            {
                try
                {
                    string src = await _repository.AddClientCardAsync(clientCard);

                    if (src != null)
                    {
                        logger.Error(src);
                        return(src);
                    }
                }
                catch (System.Exception ex)
                {
                    logger.Error("error: {0}", ex.Message);
                }
            }
            return(null);
        }
Exemplo n.º 25
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);
        }
Exemplo n.º 26
0
        /// <summary>
        /// Destroy face-down cards first, in our turn.
        /// </summary>
        protected bool DefaultMysticalSpaceTyphoon()
        {
            if (this.Duel.CurrentChain.Any(card => card.IsCode(CardId.MysticalSpaceTyphoon)))
            {
                return(false);
            }

            List <ClientCard> spells = this.Enemy.GetSpells();

            if (spells.Count == 0)
            {
                return(false);
            }

            ClientCard selected = this.Enemy.SpellZone.GetFloodgate();

            if (selected == null)
            {
                if (this.Duel.Player == 0)
                {
                    selected = spells.FirstOrDefault(card => card.IsFacedown());
                }

                if (this.Duel.Player == 1)
                {
                    selected = spells.FirstOrDefault(card => card.HasType(CardType.Continuous) || card.HasType(CardType.Equip) || card.HasType(CardType.Field));
                }
            }

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

            this.AI.SelectCard(selected);
            return(true);
        }
Exemplo n.º 27
0
        private bool 机壳别名愚钝效果()
        {
            if (Card.Location == CardLocation.Hand)
            {
                return(false);
            }
            ClientCard target = AI.Utils.GetProblematicCard();

            if (target != null)
            {
                AI.SelectCard(target);
                return(true);
            }
            List <ClientCard> monsters = Duel.Fields[1].GetMonsters();

            foreach (ClientCard monster in monsters)
            {
                AI.SelectCard(monster);
                return(true);
            }
            List <ClientCard> spells = Duel.Fields[1].GetSpells();

            foreach (ClientCard spell in spells)
            {
                if (spell.IsFacedown())
                {
                    AI.SelectCard(spell);
                    return(true);
                }
            }
            foreach (ClientCard spell in spells)
            {
                AI.SelectCard(spell);
                return(true);
            }
            return(false);
        }
Exemplo n.º 28
0
        public virtual BattlePhaseAction OnBattle(IList <ClientCard> attackers, IList <ClientCard> defenders)
        {
            if (attackers.Count == 0)
            {
                return(AI.ToMainPhase2());
            }

            if (defenders.Count == 0)
            {
                return(AI.Attack(attackers[0], null));
            }

            for (int i = defenders.Count - 1; i >= 0; --i)
            {
                ClientCard defender = defenders[i];
                int        value    = defender.GetDefensePower();
                for (int j = 0; j < attackers.Count; ++j)
                {
                    ClientCard attacker = attackers[j];
                    if (!OnPreBattleBetween(attacker, defender))
                    {
                        continue;
                    }
                    if (attacker.Attack > value || (attacker.Attack >= value && j == attackers.Count - 1))
                    {
                        return(AI.Attack(attacker, defender));
                    }
                }
            }

            if (!Battle.CanMainPhaseTwo)
            {
                return(AI.Attack(attackers[attackers.Count - 1], defenders[0]));
            }

            return(AI.ToMainPhase2());
        }
Exemplo n.º 29
0
 private bool CyberDragonInfinityEffect()
 {
     if (CurrentChain.Count > 0)
     {
         return(LastChainPlayer == 1);
     }
     else
     {
         ClientCard bestmonster = null;
         foreach (ClientCard monster in Enemy.GetMonsters())
         {
             if (monster.IsAttack() && (bestmonster == null || monster.Attack >= bestmonster.Attack))
             {
                 bestmonster = monster;
             }
         }
         if (bestmonster != null)
         {
             AI.SelectCard(bestmonster);
             return(true);
         }
     }
     return(false);
 }
Exemplo n.º 30
0
        /// <summary>
        /// Decide which card should the attacker attack.
        /// </summary>
        /// <param name="attacker">Card that attack.</param>
        /// <param name="defenders">Cards that defend.</param>
        /// <returns>BattlePhaseAction including the target, or null (in this situation, GameAI will check the next attacker)</returns>
        public override BattlePhaseAction OnSelectAttackTarget(ClientCard attacker, IList <ClientCard> defenders)
        {
            foreach (ClientCard defender in defenders)
            {
                attacker.RealPower = attacker.Attack;
                defender.RealPower = defender.GetDefensePower();
                if (!OnPreBattleBetween(attacker, defender))
                {
                    continue;
                }

                if (attacker.RealPower > defender.RealPower || (attacker.RealPower >= defender.RealPower && attacker.IsLastAttacker && defender.IsAttack()))
                {
                    return(AI.Attack(attacker, defender));
                }
            }

            if (attacker.CanDirectAttack)
            {
                return(AI.Attack(attacker, null));
            }

            return(null);
        }
Exemplo n.º 31
0
        private bool UnendingNightmareeff()
        {
            ClientCard card = null;

            foreach (ClientCard check in Enemy.GetSpells())
            {
                if (check.HasType(CardType.Continuous) || check.HasType(CardType.Field))
                {
                    card = check;
                }
                break;
            }
            int count = 0;

            foreach (ClientCard check in Enemy.GetSpells())
            {
                if (check.Type == 16777218)
                {
                    count++;
                }
            }
            if (count == 2)
            {
                if (Util.GetPZone(1, 1) != null && Util.GetPZone(1, 1).Type == 16777218)
                {
                    card = Util.GetPZone(1, 1);
                }
            }

            if (card != null && Bot.LifePoints > 1000)
            {
                AI.SelectCard(card);
                return(true);
            }
            return(false);
        }
Exemplo n.º 32
0
        public ClientCard GetBestEnemySpell(bool onlyFaceup = false)
        {
            ClientCard card = GetProblematicEnemySpell();

            if (card != null)
            {
                return(card);
            }

            var spells = Enemy.GetSpells();

            card = spells.FirstOrDefault(ecard => ecard.IsFaceup() && (ecard.HasType(CardType.Continuous) || ecard.HasType(CardType.Field)));
            if (card != null)
            {
                return(card);
            }

            if (spells.Count > 0 && !onlyFaceup)
            {
                return(spells[0]);
            }

            return(null);
        }
Exemplo n.º 33
0
        public void SelectSTPlace(ClientCard card = null, bool avoid_Impermanence = false, List <int> avoid_list = null)
        {
            List <int> list = new List <int> {
                0, 1, 2, 3, 4
            };
            int n = list.Count;

            while (n-- > 1)
            {
                int index = Program._rand.Next(n + 1);
                int temp  = list[index];
                list[index] = list[n];
                list[n]     = temp;
            }
            foreach (int seq in list)
            {
                int zone = (int)System.Math.Pow(2, seq);
                if (this.Bot.SpellZone[seq] == null)
                {
                    if (card != null && card.Location == CardLocation.Hand && avoid_Impermanence)
                    {
                        continue;
                    }

                    if (avoid_list != null && avoid_list.Contains(seq))
                    {
                        continue;
                    }

                    this.AI.SelectPlace(zone);
                    return;
                }
                ;
            }
            this.AI.SelectPlace(0);
        }
Exemplo n.º 34
0
 public void SetCard(ExecutorType type, ClientCard card, int description)
 {
     Type = type;
     Card = card;
     ActivateDescription = description;
 }
Exemplo n.º 35
0
 public virtual void OnChaining(int player, ClientCard card)
 {
     CurrentChain.Add(card);
     LastChainPlayer = player;
 }
Exemplo n.º 36
0
 private bool IsExodiaPart(ClientCard card)
 {
     if (ExodiaParts.Contains(card.Id))
         return true;
     return false;
 }
Exemplo n.º 37
0
 public override void OnChaining(int player, ClientCard card)
 {
     base.OnChaining(player, card);
     LastChainer = player;
     if (card.Id == (int)CardId.Ryko)
         RykoEffect();
     else if (card.Id == (int)CardId.EclipseWyvern)
         WyvernEffect(card);
 }
Exemplo n.º 38
0
        private bool WyvernEffect(ClientCard Card)
        {
            if (Card.Location == CardLocation.Grave)
            {
                ClientField field = Duel.Fields[0];

                //Search for Red-Eyes Darkness Metal Dragon
                bool redmdsearch = true;
                if (field.HasInHand((int)CardId.REDMD))
                    redmdsearch = false;
                else if (field.HasInGraveyard((int)CardId.REDMD))
                    redmdsearch = false;
                else if (field.HasInMonstersZone((int)CardId.REDMD))
                    redmdsearch = false;
                else
                    foreach (ClientCard card in field.Banished)
                        if (card.Id == (int)CardId.REDMD)
                            redmdsearch = false;
                if (redmdsearch) {
                    AI.SelectCard((int)CardId.REDMD);
                    return true;
                }

                //Search for Galaxy-Eyes Photon Dragon
                int GEPD = (int)CardId.GalaxyEyesPhotonDragon;
                int remaining = 3;
                foreach (ClientCard card in field.Hand)
                    if (card.Id == GEPD) remaining--;
                foreach (ClientCard card in field.Graveyard)
                    if (card.Id == GEPD) remaining--;
                foreach (ClientCard card in field.Banished)
                    if (card.Id == GEPD) remaining--;
                foreach (ClientCard card in field.MonsterZone)
                    if (card != null && card.Id == GEPD)
                        remaining--;
                if (remaining > 0) {
                    AI.SelectCard(GEPD);
                    return true;
                }

                //Search for Dark Armed Dragon
                bool dadsearch = true;
                if (field.HasInHand((int)CardId.DAD))
                    dadsearch = false;
                else if (field.HasInGraveyard((int)CardId.DAD))
                    dadsearch = false;
                else if (field.HasInMonstersZone((int)CardId.DAD))
                    dadsearch = false;
                else
                    foreach (ClientCard card in field.Banished)
                        if (card.Id == (int)CardId.DAD)
                            dadsearch = false;
                if (dadsearch == true) {
                    AI.SelectCard((int)CardId.DAD);
                    return true;
                }

                //Else return False
                return false;
            }
            else if (Card.Location == CardLocation.Removed)
                return true;
            return false;
        }
Exemplo n.º 39
0
 public override bool OnPreBattleBetween(ClientCard attacker, ClientCard defender)
 {
     if (defender.IsMonsterInvincible() && !defender.IsMonsterDangerous() && attacker.Id == 83104731)
         return true;
     return base.OnPreBattleBetween(attacker, defender);
 }
Exemplo n.º 40
0
 private bool IsCounterCard(ClientCard card)
 {
     if (CounterCards.Contains(card.Id))
         return true;
     return false;
 }
Exemplo n.º 41
0
 public override bool OnPreBattleBetween(ClientCard attacker, ClientCard defender)
 {
     if (attacker.Id == (int)CardId.Unifrog || attacker.Id == (int)CardId.DewdarkOfTheIceBarrier)
         return true;
     if (defender.IsMonsterInvincible() && !defender.IsMonsterDangerous() && attacker.Id == (int)CardId.SubmarineFrog)
         return true;
     return base.OnPreBattleBetween(attacker, defender);
 }
Exemplo n.º 42
-2
 public CardSelector(ClientCard card)
 {
     _type = SelectType.Card;
     _card = card;
 }