예제 #1
0
        CardDB.Card kid = CardDB.Instance.getCardDataFromID(CardDB.cardIDEnum.ICC_833t); //Water Elemental

        public override void onCardPlay(Playfield p, bool ownplay, Minion target, int choice)
        {
            p.setNewHeroPower(CardDB.cardIDEnum.ICC_833h, ownplay); // Icy Touch
            if (ownplay)
            {
                p.ownHero.armor += 5;
            }
            else
            {
                p.enemyHero.armor += 5;
            }

            int pos = (ownplay) ? p.ownMinions.Count : p.enemyMinions.Count;

            p.CallKid(kid, pos, ownplay);
        }
예제 #2
0
        CardDB.Card kid = CardDB.Instance.getCardDataFromID(CardDB.cardIDEnum.EX1_623); //6/6 Temple Enforcer

        public override void onTurnEndsTrigger(Playfield p, Minion triggerEffectMinion, bool turnEndOfOwner)
        {
            if (triggerEffectMinion.own == turnEndOfOwner)
            {
                int pos = (triggerEffectMinion.own) ? p.ownMinions.Count : p.enemyMinions.Count;
                p.CallKid(kid, pos, triggerEffectMinion.own, false);
                if (triggerEffectMinion.own)
                {
                    p.ownDeckSize--;
                }
                else
                {
                    p.enemyDeckSize--;
                }
            }
        }
예제 #3
0
        CardDB.Card kid = CardDB.Instance.getCardDataFromID(CardDB.cardIDEnum.ICC_900t); //Ghoul 2/2

        public override void onMinionDiedTrigger(Playfield p, Minion m, Minion diedMinion)
        {
            int diedMinions = (m.own) ? p.tempTrigger.ownMinionsDied : p.tempTrigger.enemyMinionsDied;

            if (diedMinions == 0)
            {
                return;
            }
            int residual = (p.pID == m.pID) ? diedMinions - m.extraParam2 : diedMinions;

            m.pID         = p.pID;
            m.extraParam2 = diedMinions;
            for (int i = 0; i < residual; i++)
            {
                p.CallKid(kid, m.zonepos, m.own);
            }
        }
예제 #4
0
 /// <summary>
 /// Battlecry: For each spell in your hand, summon a random minion of the same Cost.
 /// 战吼:你手牌中每有一张法术牌,便召唤一个法力值消耗与法术牌相同的随机随从。
 /// </summary>
 /// <param name="p"></param>
 /// <param name="own"></param>
 /// <param name="target"></param>
 /// <param name="choice"></param>
 public override void getBattlecryEffect(Playfield p, Minion own, Minion target, int choice)
 {
     if (own.own)
     {
         foreach (Handmanager.Handcard hc in p.owncards)
         {
             if (hc.card.type == CardDB.cardtype.SPELL)
             {
                 p.CallKid(p.getRandomCardForManaMinion(hc.manacost), p.ownMinions.Count, own.own);
             }
             if (p.ownMinions.Count == 7)
             {
                 break;
             }
         }
     }
 }
예제 #5
0
        // Deathrattle: Summon a minion from your deck with less Attack than this minion.

        public override void onDeathrattle(Playfield p, Minion m)
        {
            CardDB.cardIDEnum cId = CardDB.cardIDEnum.None;
            for (int i = m.Attack - 1; i >= 0; i--)
            {
                cId = p.prozis.getDeckCardsForCost(i);
                if (cId != CardDB.cardIDEnum.None)
                {
                    break;
                }
            }
            if (cId != CardDB.cardIDEnum.None)
            {
                CardDB.Card kid = CardDB.Instance.getCardDataFromID(cId);
                p.CallKid(kid, m.zonepos - 1, m.own);
            }
        }
예제 #6
0
        public override void onCardIsGoingToBePlayed(Playfield p, Handmanager.Handcard hc, bool wasOwnCard, Minion triggerEffectMinion)
        {
            if (triggerEffectMinion.own == wasOwnCard && hc.card.type == CardDB.cardtype.SPELL)
            {
                CardDB.Card kid;
                int         otherTotems = 0;
                bool        wrath       = false;
                foreach (Minion m in (wasOwnCard) ? p.ownMinions : p.enemyMinions)
                {
                    switch (m.name)
                    {
                    case CardDB.cardName.searingtotem: otherTotems++; continue;

                    case CardDB.cardName.stoneclawtotem: otherTotems++; continue;

                    case CardDB.cardName.healingtotem: otherTotems++; continue;

                    case CardDB.cardName.wrathofairtotem: wrath = true; continue;
                    }
                }
                if (p.isLethalCheck)
                {
                    if (otherTotems == 3 && !wrath)
                    {
                        kid = wrathofair;
                    }
                    else
                    {
                        kid = healing;
                    }
                }
                else
                {
                    if (!wrath)
                    {
                        kid = wrathofair;
                    }
                    else
                    {
                        kid = searing;
                    }
                }
                p.CallKid(kid, triggerEffectMinion.zonepos, wasOwnCard);
            }
        }
예제 #7
0
        CardDB.Card kid = CardDB.Instance.getCardDataFromID(CardDB.cardIDEnum.LOOT_357l); //Treasure Chest

        public override void getBattlecryEffect(Playfield p, Minion m, Minion target, int choice)
        {
            int pos = (m.own) ? p.enemyMinions.Count : p.ownMinions.Count;

            p.CallKid(kid, pos, !m.own);

            if (pos < 7)
            {
                if (m.own)
                {
                    p.evaluatePenality -= 40;
                }
                else
                {
                    p.evaluatePenality += 40;
                }
            }
        }
예제 #8
0
        // Battlecry: Summon a Jade Golem. Give it Taunt.

        public override void getBattlecryEffect(Playfield p, Minion m, Minion target, int choice)
        {
            p.CallKid(p.getNextJadeGolem(m.own), m.zonepos, m.own);
            Minion mnn = m.own ? p.ownMinions[m.zonepos] : p.enemyMinions[m.zonepos];

            if (mnn.playedThisTurn && !mnn.taunt)
            {
                mnn.taunt = true;
                if (mnn.own)
                {
                    p.anzOwnTaunt++;
                }
                else
                {
                    p.anzEnemyTaunt++;
                }
            }
        }
예제 #9
0
        CardDB.Card kid = CardDB.Instance.getCardDataFromID(CardDB.cardIDEnum.ICC_085t); //Ghoul Infestor

        public override void onCardPlay(Playfield p, bool ownplay, Minion target, int choice)
        {
            int dmg = (ownplay) ? p.getSpellDamageDamage(5) : p.getEnemySpellDamageDamage(5);

            p.minionGetDamageOrHeal(target, dmg);

            p.drawACard(CardDB.cardName.unknown, ownplay);
            p.drawACard(CardDB.cardName.unknown, ownplay);
            p.drawACard(CardDB.cardName.unknown, ownplay);
            p.drawACard(CardDB.cardName.unknown, ownplay);
            p.drawACard(CardDB.cardName.unknown, ownplay);

            p.minionGetArmor(ownplay ? p.ownHero : p.enemyHero, 5);

            int pos = (ownplay) ? p.ownMinions.Count : p.enemyMinions.Count;

            p.CallKid(kid, pos, ownplay);
        }
예제 #10
0
        CardDB.Card kid = CardDB.Instance.getCardDataFromID(CardDB.cardIDEnum.BOT_224); //Ë«ÉúС¹í


        public override void getBattlecryEffect(Playfield p, Minion m, Minion target, int choice)
        {
            p.CallKid(kid, m.zonepos, m.own);
            List <Minion> temp  = (m.own) ? p.ownMinions : p.enemyMinions;
            int           count = 0;

            foreach (Minion mnn in temp)
            {
                if (mnn.name == CardDB.cardName.doublingimp && m.entitiyID != mnn.entitiyID && mnn.playedThisTurn)
                {
                    mnn.setMinionToMinion(m);
                    count++;
                    if (count >= 1)
                    {
                        break;
                    }
                }
            }
        }
예제 #11
0
        CardDB.Card kid = CardDB.Instance.getCardDataFromID(CardIdEnum.AT_106);         //Light's Champion

        public override void getBattlecryEffect(Playfield p, Minion m, Minion target, int choice)
        {
            List <Minion> list = (m.own) ? p.ownMinions : p.enemyMinions;
            int           anz  = list.Count;

            p.CallKid(kid, m.zonepos, m.own);
            if (anz < 7 && !list[m.zonepos].taunt)
            {
                list[m.zonepos].taunt = true;
                if (m.own)
                {
                    p.anzOwnTaunt++;
                }
                else
                {
                    p.anzEnemyTaunt++;
                }
            }
        }
예제 #12
0
        public override void getBattlecryEffect(Playfield p, Minion m, Minion target, int choice)
        {
            int count = (m.own) ? p.ownMinions.Count : p.enemyMinions.Count;

            for (int i = 7; i > count; i--)
            {
                p.CallKid(kid, m.zonepos, m.own);
            }

            List <Minion> temp = (m.own) ? p.ownMinions : p.enemyMinions;

            foreach (Minion mnn in temp)
            {
                if (mnn.name == CardDB.cardName.hireekthebat && m.entitiyID != mnn.entitiyID && mnn.playedThisTurn)
                {
                    mnn.setMinionToMinion(m);
                }
            }
        }
예제 #13
0
        /// <summary>
        /// Battlecry: Summon a random 2-Cost minion.
        /// 战吼:随机召唤一个法力值消耗为2点的随从。
        /// </summary>
        /// <param name="p"></param>
        /// <param name="m"></param>
        /// <param name="target"></param>
        /// <param name="choice"></param>
        public override void getBattlecryEffect(Playfield p, Minion m, Minion target, int choice)
        {
            CardDB.Card   kid  = CardDB.Instance.getCardDataFromID(CardIdEnum.CS2_121);
            List <Minion> list = (m.own) ? p.ownMinions : p.enemyMinions;
            int           anz  = list.Count;

            p.CallKid(kid, m.zonepos, m.own);
            if (anz < 7 && !list[m.zonepos].taunt)
            {
                list[m.zonepos].taunt = true;
                if (m.own)
                {
                    p.anzOwnTaunt++;
                }
                else
                {
                    p.anzEnemyTaunt++;
                }
            }
        }
예제 #14
0
        // Choose One - Summon a Jade Golem; or Shuffle 3 copies of this card into your deck.

        public override void onCardPlay(Playfield p, bool ownplay, Minion target, int choice)
        {
            if (choice == 1 || (p.ownFandralStaghelm > 0 && ownplay))
            {
                int pos = (ownplay) ? p.ownMinions.Count : p.enemyMinions.Count;
                p.CallKid(p.getNextJadeGolem(ownplay), pos, ownplay);
            }
            if (choice == 2 || (p.ownFandralStaghelm > 0 && ownplay))
            {
                if (ownplay)
                {
                    p.ownDeckSize      += 3;
                    p.evaluatePenality -= 11;
                }
                else
                {
                    p.enemyDeckSize += 3;
                }
            }
        }
예제 #15
0
        //Secret: When one of your minions dies, return it to life with 1 Health.

        public override void onSecretPlay(Playfield p, bool ownplay, int number)
        {
            CardDB.Card   kid = CardDB.Instance.getCardDataFromID(ownplay ? p.revivingOwnMinion : p.revivingEnemyMinion);
            List <Minion> tmp = ownplay ? p.ownMinions : p.enemyMinions;
            int           pos = tmp.Count;

            p.CallKid(kid, pos, ownplay, true, true);

            if (tmp.Count >= 1)
            {
                Minion summonedMinion = tmp[pos];
                if (summonedMinion.handcard.card.cardIDenum == kid.cardIDenum)
                {
                    summonedMinion.HealthPoints = 1;
                    summonedMinion.wounded      = false;
                    if (summonedMinion.HealthPoints < summonedMinion.maxHp)
                    {
                        summonedMinion.wounded = true;
                    }
                }
            }
        }
예제 #16
0
        public override void getBattlecryEffect(Playfield p, Minion own, Minion target, int choice)
        {
            if (choice == 2 || (p.ownFandralStaghelm > 0 && own.own))
            {
                if (own.own)
                {
                    if (p.ownMaxMana > 8)
                    {
                        p.evaluatePenality += 15;
                    }
                    p.ownMaxMana = Math.Min(10, p.ownMaxMana + 1);
                }
                else
                {
                    p.enemyMaxMana = Math.Min(10, p.enemyMaxMana + 1);
                }
            }

            if (choice == 1 || (p.ownFandralStaghelm > 0 && own.own))
            {
                p.CallKid(kid, own.zonepos, own.own);
            }
        }
예제 #17
0
        CardDB.Card kid = CardDB.Instance.getCardDataFromID(CardDB.cardIDEnum.EX1_160t); //panther


        public override void onCardPlay(Playfield p, bool ownplay, Minion target, int choice)
        {
            if (choice == 1 || (p.ownFandralStaghelm > 0 && ownplay))
            {
                p.minionGetBuffed(target, 2, 4);
                if (!target.taunt)
                {
                    target.taunt = true;
                    if (target.own)
                    {
                        p.anzOwnTaunt++;
                    }
                    else
                    {
                        p.anzEnemyTaunt++;
                    }
                }
            }
            if (choice == 2 || (p.ownFandralStaghelm > 0 && ownplay))
            {
                int pos = (ownplay) ? p.ownMinions.Count : p.enemyMinions.Count;
                p.CallKid(kid, pos, ownplay, false);
            }
        }
예제 #18
0
        public override void onTurnStartTrigger(Playfield p, Minion triggerEffectMinion, bool turnStartOfOwner)
        {
            if (turnStartOfOwner != triggerEffectMinion.own)
            {
                return;
            }
            List <Minion> temp = (turnStartOfOwner) ? p.ownMinions : p.enemyMinions;
            int           anz  = 0;

            foreach (Minion m in temp)
            {
                if ((TAG_RACE)m.handcard.card.race == TAG_RACE.MECHANICAL && m.HealthPoints >= 1)
                {
                    anz++;
                }
            }
            if (anz >= 3)
            {
                anz = 0;
                foreach (Minion m in temp)
                {
                    if ((TAG_RACE)m.handcard.card.race == TAG_RACE.MECHANICAL)
                    {
                        p.minionGetDestroyed(m);
                        anz++;
                        if (anz == 3)
                        {
                            break;
                        }
                    }
                }

                int pos = (triggerEffectMinion.own) ? p.ownMinions.Count : p.enemyMinions.Count;
                p.CallKid(kid, pos, triggerEffectMinion.own, false, true); // we allow to summon one minion more (because 3 are destroyed)
            }
        }
예제 #19
0
        CardDB.Card kid = CardDB.Instance.getCardDataFromID(CardIdEnum.EX1_066); //acidicswampooze

        public override void getBattlecryEffect(Playfield p, Minion m, Minion target, int choice)
        {
            int zonepos = (m.own) ? p.enemyMinions.Count : p.ownMinions.Count;

            p.CallKid(kid, zonepos, !m.own);
        }
예제 #20
0
 public override void onDeathrattle(Playfield p, Minion m)
 {
     p.CallKid(kid, m.zonepos - 1, m.own);
 }
예제 #21
0
        //Deathrattle: Summon a random minion you discarded this game.

        public override void onDeathrattle(Playfield p, Minion m)
        {
            p.CallKid(CardDB.Instance.getCardDataFromID(CardIdEnum.KAR_205), m.zonepos - 1, m.own);           //Silverware Golem.
        }
예제 #22
0
        private void doSomeBasicEnemyAi(Playfield p)
        {
            if (p.enemyHeroName == HeroEnum.mage)
            {
                if (Probabilitymaker.Instance.enemyCardsOut.ContainsKey(CardDB.cardIDEnum.EX1_561))
                {
                    p.ownHero.HealthPoints = Math.Max(5, p.ownHero.HealthPoints - 7);
                }
            }

            //play some cards (to not overdraw)
            if (p.enemyAnzCards >= 8)
            {
                p.enemyAnzCards--;
                p.triggerCardsChanged(false);
            }
            if (p.enemyAnzCards >= 4)
            {
                p.enemyAnzCards--;
                p.triggerCardsChanged(false);
            }
            if (p.enemyAnzCards >= 2)
            {
                p.enemyAnzCards--;
                p.triggerCardsChanged(false);
            }
            int buffn = 0;//只buff一只

            if (p.enemyAnzCards >= 2 && p.enemyMinions.Count > 2)
            {
                foreach (Minion m in p.enemyMinions.ToArray())
                {
                    if (m.silenced)
                    {
                        continue;
                    }
                    int anz = 0;
                    int nm = 0; int nm2 = 0;
                    int prob1 = Probabilitymaker.Instance.getProbOfEnemyHavingCardInHand(CardDB.cardIDEnum.CS2_122, p.enemyAnzCards, p.enemyDeckSize);

                    /*prob1 =p.ProbRd(prob1);
                     * if(p.enemyAnzCards >= 2 &&p.enemyMinions.Count>2)p.minionGetBuffed(m, prob1, prob1);
                     *
                     * if (p.enemyHeroStartClass == TAG_CLASS.PALADIN && buffn <1)
                     * {
                     *      buffn++;
                     *  if(p.enemyHeroPowerCostLessOnce==0||p.enemyHeroAblility.manacost!=1)//buff随从
                     *  {
                     *      prob1 = Probabilitymaker.Instance.getProbOfEnemyHavingCardInHand(CardDB.cardIDEnum.CS2_092, p.enemyAnzCards, p.enemyDeckSize);
                     *      //nm = (int)(prob1/100+0.5);
                     *      nm =p.ProbRd(prob1);
                     *      if(p.enemyMaxMana>=4) p.minionGetBuffed(m, 4*nm, 4*nm);//王者祝福
                     *      if(p.enemyMaxMana>=6) //剑龙骑术
                     *      {
                     *          //p.minionGetBuffed(m, 2*nm, 6*nm);
                     *              m.taunt=true;
                     *      }
                     *  }
                     *  else
                     *  {
                     *      prob1 = Probabilitymaker.Instance.getProbOfEnemyHavingCardInHand(CardDB.cardIDEnum.CS2_087, p.enemyAnzCards, p.enemyDeckSize);
                     *      nm = (int)(prob1/100+0.5);
                     *      p.minionGetBuffed(m, 3*nm, 0);//力量祝福
                     *  }
                     * }*/
                    if (p.enemyHeroStartClass == TAG_CLASS.SHAMAN)//防萨满突变 进化
                    {
                        //if(m.own &&m.name==CardDB.cardName.mogufleshshaper)p.evaluatePenality +=2;//Mogu Fleshshaper魔古血肉塑造者
                        //else if(m.own &&m.name==CardDB.cardName.gigglinginventor)p.evaluatePenality +=2;



                        int minionvalue = m.HealthPoints * 2 + m.Attack;
                        if (m.divineshild)
                        {
                            minionvalue = minionvalue * 3 / 2;
                        }
                        minionvalue += p.prozis.penman.getValueOfUsefulNeedKeepPriority(m.handcard.card.name);

                        CardDB.Card cofm   = p.getRandomCardForManaMinion(m.handcard.card.cost);
                        int         cvalue = cofm.Health * 2 + cofm.Attack;
                        if (cofm.Shield)
                        {
                            cvalue = cvalue * 3 / 2;
                        }
                        cvalue += p.prozis.penman.getValueOfUsefulNeedKeepPriority(cofm.name);
                        if (minionvalue - cvalue > 7)
                        {
                            p.evaluatePenality += 1;
                        }
                        if (minionvalue - cvalue > 12)
                        {
                            p.evaluatePenality += 1;
                        }
                    }


                    if (p.enemyAnzCards >= 2 && (m.name == CardDB.cardName.gadgetzanauctioneer || m.name == CardDB.cardName.starvingbuzzard))
                    {
                        if (p.enemyDeckSize >= 1)
                        {
                            p.drawACard(CardDB.cardName.unknown, false);
                        }
                    }
                    switch (m.name)
                    {
                    //****************************************heal
                    case CardDB.cardName.northshirecleric:
                        anz = 0;
                        foreach (Minion mnn in p.enemyMinions)
                        {
                            if (mnn.wounded)
                            {
                                anz++;
                            }
                        }
                        anz = Math.Min(anz, 3);
                        for (int i = 0; i < anz; i++)
                        {
                            if (p.enemyDeckSize >= 1)
                            {
                                p.drawACard(CardDB.cardName.unknown, false);
                            }
                        }
                        continue;

                    case CardDB.cardName.crystalsmithkangor://水晶工匠坎格尔
                        p.minionGetDamageOrHeal(p.enemyHero, -4);

                        continue;

                    case CardDB.cardName.devilsauregg:
                        if (p.enemyAnzCards >= 3)
                        {
                            p.CallKid(CardDB.Instance.getCardDataFromID(CardDB.cardIDEnum.EX1_tk29), p.enemyMinions.Count, false);
                        }
                        continue;

                    case CardDB.cardName.scavenginghyena://食腐土狼
                        nm    = p.enemyMinions.Count - 1;
                        prob1 = Probabilitymaker.Instance.getProbOfEnemyHavingCardInHand(CardDB.cardIDEnum.EX1_538, p.enemyAnzCards, p.enemyDeckSize);
                        int prob2 = Probabilitymaker.Instance.getProbOfEnemyHavingCardInHand(CardDB.cardIDEnum.TRL_348, p.enemyAnzCards, p.enemyDeckSize);
                        int prob3 = Probabilitymaker.Instance.getProbOfEnemyHavingCardInHand(CardDB.cardIDEnum.TRL_348t, p.enemyAnzCards, p.enemyDeckSize);
                        if (p.enemyMaxMana < 4)
                        {
                            nm2 = (p.ownMinions.Count) * prob1 > 2 * prob2 + prob3 ? (int)((p.ownMinions.Count) * prob1 / 100 + 0.5):(int)(2 * prob2 / 100 + prob3 / 100 + 0.5);
                        }
                        else
                        {
                            nm2 = (int)((p.ownMinions.Count) * prob1 / 100 + 2 * prob2 / 100 + prob3 / 100 + 0.5);
                        }
                        if (nm2 < 1 && nm == 0)
                        {
                            nm2 = 1;
                        }
                        if (p.enemyAnzCards >= 1)
                        {
                            p.minionGetBuffed(m, 2 * nm2, nm2);
                        }
                        p.minionGetBuffed(m, 2 * nm, nm);
                        continue;

                    case CardDB.cardName.shadowboxer:
                        anz = 0;
                        foreach (Minion mnn in p.enemyMinions)
                        {
                            if (mnn.wounded)
                            {
                                anz++;
                            }
                        }
                        if (anz > 0)
                        {
                            anz = Math.Min(anz, 3);
                            Minion target = p.ownHero;
                            for (; anz > 0; anz--)
                            {
                                if (p.ownMinions.Count > 0)
                                {
                                    target = p.searchRandomMinion(p.ownMinions, searchmode.searchLowestHP);
                                }
                                if (target == null)
                                {
                                    target = p.ownHero;
                                }
                                p.minionGetDamageOrHeal(target, 1);
                            }
                        }
                        continue;

                    case CardDB.cardName.lightwarden:
                        anz = 0;
                        foreach (Minion mnn in p.enemyMinions)
                        {
                            if (mnn.wounded)
                            {
                                anz++;
                            }
                        }
                        if (p.enemyHero.wounded)
                        {
                            anz++;
                        }
                        if (anz >= 2)
                        {
                            p.minionGetBuffed(m, 2, 0);
                        }
                        continue;

                    //****************************************
                    //****************************************spell
                    case CardDB.cardName.manaaddict:
                        if (p.enemyAnzCards >= 1)
                        {
                            p.minionGetTempBuff(m, 2, 0);
                            if (p.enemyAnzCards >= 3 && p.enemyMaxMana >= 5)
                            {
                                p.minionGetTempBuff(m, 2, 0);
                            }
                        }
                        continue;

                    case CardDB.cardName.manawyrm:
                        if (p.enemyAnzCards >= 1)
                        {
                            p.minionGetBuffed(m, 1, 0);
                            if (p.enemyAnzCards >= 3 && p.enemyMaxMana >= 5)
                            {
                                p.minionGetBuffed(m, 1, 0);
                            }
                        }
                        continue;

                    case CardDB.cardName.dragonkinsorcerer:
                        if (p.enemyAnzCards >= 1)
                        {
                            p.minionGetTempBuff(m, 1, 1);
                            if (p.enemyAnzCards >= 3 && p.enemyMaxMana >= 5)
                            {
                                p.minionGetBuffed(m, 1, 1);
                            }
                        }
                        continue;

                    case CardDB.cardName.violetteacher:
                        if (p.enemyAnzCards >= 1)
                        {
                            p.CallKid(CardDB.Instance.getCardDataFromID(CardDB.cardIDEnum.NEW1_026t), p.enemyMinions.Count, false);
                            if (p.enemyAnzCards >= 3 && p.enemyMaxMana >= 5)
                            {
                                p.CallKid(CardDB.Instance.getCardDataFromID(CardDB.cardIDEnum.NEW1_026t), p.enemyMinions.Count, false);
                            }
                        }
                        continue;

                    case CardDB.cardName.warsongcommander:
                        p.CallKid(CardDB.Instance.getCardDataFromID(CardDB.cardIDEnum.EX1_165t1), p.enemyMinions.Count, false, false);
                        continue;

                    case CardDB.cardName.gadgetzanauctioneer:
                        if (p.enemyAnzCards >= 1)
                        {
                            p.drawACard(CardDB.cardName.unknown, false);
                            if (p.enemyAnzCards >= 3 && p.enemyMaxMana >= 5)
                            {
                                p.drawACard(CardDB.cardName.unknown, false);
                            }
                        }
                        continue;

                    case CardDB.cardName.archmageantonidas:
                        if (p.ownMinions.Count < 1)
                        {
                            p.minionGetDamageOrHeal(p.ownHero, 6);
                        }
                        else
                        {
                            Minion target = new Minion();
                            foreach (Minion mnn in p.ownMinions)
                            {
                                if (mnn.HealthPoints <= 6 && (mnn.HealthPoints + mnn.Attack) > (target.HealthPoints + target.Attack))
                                {
                                    target = mnn;
                                }
                            }
                            p.minionGetDamageOrHeal(target, 6);
                        }
                        continue;

                    case CardDB.cardName.gazlowe:
                        if (p.enemyAnzCards >= 1)
                        {
                            p.drawACard(CardDB.cardName.unknown, false);
                            if (p.enemyAnzCards >= 3 && p.enemyMaxMana >= 5)
                            {
                                p.drawACard(CardDB.cardName.unknown, false);
                            }
                        }
                        continue;

                    case CardDB.cardName.flamewaker:
                        anz = 0;
                        if (p.enemyAnzCards >= 1)
                        {
                            anz++;
                        }
                        if (p.enemyAnzCards >= 3 && p.enemyMaxMana >= 5)
                        {
                            anz++;
                        }
                        if (anz > 0)
                        {
                            Minion target = p.ownHero;
                            anz = anz * 2 - 1;
                            p.minionGetDamageOrHeal(target, 1);
                            for (; anz > 0; anz--)
                            {
                                if (p.ownMinions.Count > 0)
                                {
                                    target = p.searchRandomMinion(p.ownMinions, searchmode.searchLowestHP);
                                }
                                if (target == null)
                                {
                                    target = p.ownHero;
                                }
                                p.minionGetDamageOrHeal(target, 1);
                            }
                        }
                        continue;

                    //****************************************
                    //****************************************secret
                    case CardDB.cardName.secretkeeper:
                        if (p.enemyAnzCards >= 3)
                        {
                            p.minionGetBuffed(m, 1, 1);
                        }
                        continue;

                    case CardDB.cardName.etherealarcanist:
                        if (p.enemyAnzCards >= 3 || p.enemySecretCount > 0)
                        {
                            p.minionGetBuffed(m, 2, 2);
                        }
                        continue;

                    //****************************************
                    //****************************************play
                    case CardDB.cardName.illidanstormrage:
                        if (p.enemyAnzCards >= 1)
                        {
                            p.CallKid(flame, p.enemyMinions.Count, false);
                        }
                        continue;

                    case CardDB.cardName.questingadventurer:
                        if (p.enemyAnzCards >= 1)
                        {
                            p.minionGetBuffed(m, 1, 1);
                            if (p.enemyAnzCards >= 3 && p.enemyMaxMana >= 5)
                            {
                                p.minionGetBuffed(m, 1, 1);
                            }
                        }
                        continue;

                    case CardDB.cardName.unboundelemental:
                        if (p.enemyAnzCards >= 2)
                        {
                            p.minionGetBuffed(m, 1, 1);
                        }
                        continue;

                    //****************************************
                    //****************************************turn
                    //****************************************armor
                    case CardDB.cardName.siegeengine:
                        anz = 0;
                        foreach (Minion mnn in p.enemyMinions)
                        {
                            if (mnn.name == CardDB.cardName.armorsmith)
                            {
                                anz++;
                            }
                        }
                        if (p.enemyAnzCards >= 3)
                        {
                            anz++;
                        }
                        if (anz > 0)
                        {
                            p.minionGetBuffed(m, anz, 0);
                        }
                        continue;

                    //****************************************summon
                    case CardDB.cardName.murloctidecaller:
                        if (p.enemyAnzCards >= 2)
                        {
                            p.minionGetBuffed(m, 1, 0);
                        }
                        continue;

                    case CardDB.cardName.undertaker:
                        if (p.enemyAnzCards >= 2)
                        {
                            p.minionGetBuffed(m, 1, 0);
                        }
                        continue;

                    case CardDB.cardName.starvingbuzzard:
                        if (p.enemyAnzCards >= 2)
                        {
                            p.drawACard(CardDB.cardName.unknown, false);
                        }
                        continue;

                    case CardDB.cardName.cobaltguardian:
                        if (p.enemyAnzCards >= 2)
                        {
                            m.divineshild = true;
                        }
                        continue;

                    case CardDB.cardName.knifejuggler:
                        anz = Math.Min(p.enemyAnzCards, (int)p.enemyMaxMana / 2);
                        if (anz > 0)
                        {
                            Minion target = p.ownHero;
                            for (; anz > 0; anz--)
                            {
                                if (p.ownMinions.Count > 0)
                                {
                                    target = p.searchRandomMinion(p.ownMinions, searchmode.searchLowestHP);
                                }
                                if (target == null)
                                {
                                    target = p.ownHero;
                                }
                                p.minionGetDamageOrHeal(target, 1);
                            }
                        }
                        continue;

                    case CardDB.cardName.shipscannon:
                        if (p.enemyAnzCards >= 2)
                        {
                            Minion target = p.ownHero;
                            if (p.ownMinions.Count > 0)
                            {
                                target = p.searchRandomMinion(p.ownMinions, searchmode.searchLowestHP);
                            }
                            if (target == null)
                            {
                                target = p.ownHero;
                            }
                            p.minionGetDamageOrHeal(target, 1);
                        }
                        continue;

                    case CardDB.cardName.tundrarhino:
                        p.CallKid(CardDB.Instance.getCardDataFromID(CardDB.cardIDEnum.CS2_125), p.enemyMinions.Count, false, true, true);
                        continue;

                    case CardDB.cardName.houndmastershaw://驯犬大师肖尔
                        p.CallKid(CardDB.Instance.getCardDataFromID(CardDB.cardIDEnum.CS2_125), p.enemyMinions.Count, false, true, true);
                        continue;

                    //****************************************
                    //****************************************damage
                    case CardDB.cardName.frothingberserker:
                        nm  = p.ownMinions.Count > p.enemyMinions.Count - 1 ? p.enemyMinions.Count - 1:p.ownMinions.Count;
                        nm2 = (int)((p.ownMinions.Count + p.enemyMinions.Count) * 0.2 + 0.5);
                        if (m.HealthPoints >= 2 && p.enemyAnzCards >= 3 && nm == 0)
                        {
                            p.minionGetBuffed(m, nm2, 0);
                        }
                        else
                        {
                            p.minionGetBuffed(m, 2 * nm, 0);
                        }
                        continue;

                    case CardDB.cardName.gurubashiberserker:
                        if (m.HealthPoints >= 4 && p.enemyAnzCards >= 3)
                        {
                            p.minionGetBuffed(m, 3, 0);
                        }
                        continue;

                    case CardDB.cardName.floatingwatcher:
                        if (p.enemyMaxMana >= p.enemyAnzCards * 2)
                        {
                            p.minionGetBuffed(m, 2, 2);
                        }
                        continue;

                    case CardDB.cardName.armorsmith:
                        if (p.enemyMinions.Count >= 3)
                        {
                            p.minionGetArmor(p.enemyHero, 1);
                        }
                        continue;

                    case CardDB.cardName.gahzrilla:
                        if (m.HealthPoints >= 4 && p.enemyAnzCards >= 3)
                        {
                            p.minionGetBuffed(m, m.Attack * 2, 0);
                        }
                        continue;

                    case CardDB.cardName.acolyteofpain:
                        if (m.HealthPoints >= 3 && p.enemyAnzCards >= 3)
                        {
                            p.drawACard(CardDB.cardName.unknown, false);
                        }
                        continue;

                    case CardDB.cardName.mechbearcat:
                        if (m.HealthPoints >= 3 && p.enemyAnzCards >= 3)
                        {
                            p.drawACard(CardDB.cardName.unknown, false);
                        }
                        continue;

                    case CardDB.cardName.grimpatron:
                        if (m.HealthPoints >= 3 && p.enemyAnzCards >= 3)
                        {
                            p.CallKid(CardDB.Instance.getCardDataFromID(CardDB.cardIDEnum.BRM_019), p.enemyMinions.Count, false);
                        }
                        continue;

                    case CardDB.cardName.dragonegg:
                        if (p.enemyAnzCards >= 3)
                        {
                            p.CallKid(CardDB.Instance.getCardDataFromID(CardDB.cardIDEnum.BRM_022t), p.enemyMinions.Count, false);
                        }
                        continue;

                    case CardDB.cardName.impgangboss:
                        if (m.HealthPoints >= 3 && p.enemyAnzCards >= 3)
                        {
                            p.CallKid(CardDB.Instance.getCardDataFromID(CardDB.cardIDEnum.BRM_006t), p.enemyMinions.Count, false);
                        }
                        continue;

                    case CardDB.cardName.axeflinger:
                        if (m.HealthPoints >= 3 && p.enemyAnzCards >= 3)
                        {
                            p.minionGetDamageOrHeal(p.ownHero, 2);
                        }
                        continue;

                    case CardDB.cardName.brannbronzebeard:
                        p.minionGetBuffed(m, 0, 6);
                        continue;

                    case CardDB.cardName.obsidiandestroyer:
                        if (p.enemyMinions.Count < 6)
                        {
                            p.CallKid(CardDB.Instance.getCardDataFromID(CardDB.cardIDEnum.LOE_009t), p.enemyMinions.Count, false);
                        }
                        continue;

                    case CardDB.cardName.tunneltrogg:
                        p.minionGetBuffed(m, 1, 0);
                        continue;

                    case CardDB.cardName.summoningstone:
                        if (p.enemyMinions.Count < 6)
                        {
                            p.CallKid(CardDB.Instance.getCardDataFromID(CardDB.cardIDEnum.LOE_017), p.enemyMinions.Count, false);
                        }
                        continue;
                        //****************************************
                        //****************************************dies (rough approximation)
                        //****************************************
                    }
                }
            }
            p.doDmgTriggers();
        }
예제 #23
0
        public void simulateEnemysTurn(Playfield rootfield, bool simulateTwoTurns, bool playaround, bool print, int pprob, int pprob2)
        {
            if (rootfield.bestEnemyPlay == null)
            {
                bool havedonesomething = true;
                posmoves.Clear();

                posmoves.Add(new Playfield(rootfield));
                posmoves[0].isLethalCheck = false;
                posmoves[0].startTurn();
                rootfield.guessingHeroHP = posmoves[0].guessingHeroHP;
                List <Playfield> temp = new List <Playfield>();
                int deep     = 0;
                int enemMana = Math.Min(rootfield.enemyMaxMana + 1, 10);

                if (playaround && !rootfield.loatheb)
                {
                    float oldval = Ai.Instance.botBase.getPlayfieldValue(posmoves[0]);
                    posmoves[0].value = int.MinValue;
                    enemMana          = posmoves[0].EnemyCardPlaying(rootfield.enemyHeroStartClass, enemMana, rootfield.enemyAnzCards, pprob, pprob2);
                    if (posmoves[0].wehaveCounterspell > 1)
                    {
                        posmoves[0].ownSecretsIDList.Remove(CardDB.cardIDEnum.EX1_287);
                        posmoves[0].evaluatePenality -= 7;
                    }
                    float newval = Ai.Instance.botBase.getPlayfieldValue(posmoves[0]);
                    posmoves[0].value = int.MinValue;
                    posmoves[0].enemyAnzCards--;
                    posmoves[0].triggerCardsChanged(false);
                    if (oldval < newval)
                    {
                        posmoves.Clear();
                        posmoves.Add(new Playfield(rootfield));
                        posmoves[0].startTurn();
                    }
                }

                if (posmoves[0].ownHeroHasDirectLethal())
                {
                    if (posmoves[0].value >= -2000000)
                    {
                        rootfield.value -= 10000;
                    }
                    else
                    {
                        rootfield.value = -10000;
                    }

                    return;
                }

                doSomeBasicEnemyAi(posmoves[0]);

                //play ability!
                if (rootfield.enemyHeroPowerCostLessOnce <= 0 && posmoves[0].enemyAbilityReady && enemMana >= rootfield.enemyHeroAblility.manacost && posmoves[0].enemyHeroAblility.card.canplayCard(posmoves[0], 0, false) && !rootfield.loatheb)
                {
                    int           abilityPenality = 0;
                    List <Minion> trgts           = posmoves[0].enemyHeroAblility.card.getTargetsForHeroPower(posmoves[0], false);
                    foreach (Minion trgt in trgts)
                    {
                        Action    a  = new Action(actionEnum.useHeroPower, posmoves[0].enemyHeroAblility, null, 0, trgt, abilityPenality, 0);
                        Playfield pf = new Playfield(posmoves[0]);
                        pf.doAction(a);
                        posmoves.Add(pf);
                    }
                }

                int boardcount = 0;
                //movegen...

                int       i     = 0;
                int       count = 0;
                Playfield p     = null;

                Playfield bestold = null;
                havedonesomething = true;
                float bestoldval = int.MaxValue;
                while (havedonesomething)
                {
                    temp.Clear();
                    temp.AddRange(posmoves);
                    havedonesomething = false;
                    count             = temp.Count;
                    for (i = 0; i < count; i++)
                    {
                        p = temp[i];
                        if (p.complete)
                        {
                            continue;
                        }
                        List <Action> actions = movegen.GetMoveList(p, false, true, false);

                        foreach (Action a in actions)
                        {
                            havedonesomething = true;
                            Playfield pf = new Playfield(p);
                            pf.doAction(a);
                            posmoves.Add(pf);
                            boardcount++;
                        }

                        p.endTurn();
                        p.complete       = true;
                        p.guessingHeroHP = rootfield.guessingHeroHP;
                        if (Ai.Instance.botBase.getPlayfieldValue(p) < bestoldval) // want the best enemy-play-> worst for us
                        {
                            bestoldval = Ai.Instance.botBase.getPlayfieldValue(p);
                            bestold    = p;
                        }
                        posmoves.Remove(p);
                        if (boardcount >= maxwide)
                        {
                            break;
                        }
                    }


                    cuttingposibilitiesET();

                    deep++;
                    if (boardcount >= maxwide)
                    {
                        break;
                    }
                }

                posmoves.Add(bestold);
                float     bestval  = int.MaxValue;
                Playfield bestplay = bestold;
                count = posmoves.Count;
                for (i = 0; i < count; i++)
                {
                    p = posmoves[i];
                    if (!p.complete)
                    {
                        p.endTurn();
                        p.complete = true;
                    }
                    p.guessingHeroHP = rootfield.guessingHeroHP;
                    float val = Ai.Instance.botBase.getPlayfieldValue(p);
                    if (p.enemyMinions.Count > 6)
                    {
                        val += 12;
                    }
                    if (bestval > val)// we search the worst value
                    {
                        bestplay = p;
                        bestval  = val;
                    }
                }
                if (bestplay.enemyMinions.Count < 7)
                {
                    if (bestplay.enemyAnzCards > 0)
                    {
                        if (bestplay.enemyMaxMana > 5)
                        {
                            bestplay.CallKid(this.spellbreaker43, bestplay.enemyMinions.Count, false, false);
                        }
                        else
                        {
                            bestplay.CallKid(this.flame, bestplay.enemyMinions.Count, false, false);
                        }
                        int tmp = bestplay.enemyMinions.Count;
                        bestplay.simulateTrapsEndEnemyTurn();

                        if (tmp == bestplay.enemyMinions.Count)
                        {
                            int bval = 1;
                            if (bestplay.enemyMaxMana > 4)
                            {
                                bval = 2;
                            }
                            if (bestplay.enemyMaxMana > 7)
                            {
                                bval = 3;
                            }
                            if (bestplay.enemyMinions.Count >= 1)
                            {
                                bestplay.minionGetBuffed(bestplay.enemyMinions[bestplay.enemyMinions.Count - 1], bval - 1, bval);
                            }
                        }
                    }
                }
                bestplay.startTurn();
                bestplay.ownAbilityReady = false;
                bestplay.owncarddraw     = rootfield.owncarddraw;
                bestplay.complete        = true;
                bestplay.isLethalCheck   = rootfield.isLethalCheck;
                Ai.Instance.botBase.getPlayfieldValue(bestplay);
                bestval         = bestplay.value;
                rootfield.value = bestplay.value;

                if (twotsamount > 0 || (rootfield.isLethalCheck && berserkIfCanFinishNextTour > 0))
                {
                    rootfield.bestEnemyPlay       = new Playfield(bestplay);
                    rootfield.bestEnemyPlay.value = bestval;
                }
            }



            if ((simulateTwoTurns || (rootfield.isLethalCheck && berserkIfCanFinishNextTour > 0)) && rootfield.bestEnemyPlay != null && rootfield.bestEnemyPlay.value > -1000)
            {
                float bestval = rootfield.bestEnemyPlay.value;
                rootfield.bestEnemyPlay.complete = false;
                rootfield.bestEnemyPlay.value    = int.MinValue;
                rootfield.value = Settings.Instance.firstweight * bestval + Settings.Instance.secondweight * Ai.Instance.nextTurnSimulator[this.thread].doallmoves(rootfield.bestEnemyPlay, print);
            }
        }
예제 #24
0
        CardDB.Card kid = CardDB.Instance.getCardDataFromID(CardDB.cardIDEnum.CS2_125);        //Ironfur Grizzly

        public override void onSecretPlay(Playfield p, bool ownplay, int number)
        {
            int place = (ownplay) ? p.ownMinions.Count : p.enemyMinions.Count;

            p.CallKid(kid, place, ownplay);
        }
예제 #25
0
        // Battlecry and Deathrattle: Summon a Jade Golem.

        public override void getBattlecryEffect(Playfield p, Minion m, Minion target, int choice)
        {
            p.CallKid(p.getNextJadeGolem(m.own), m.zonepos, m.own);
        }
예제 #26
0
        CardDB.Card kid = CardDB.Instance.getCardDataFromID(CardIdEnum.BRMA02_2t);        //Dark Iron Spectator

        public override void onCardPlay(Playfield p, bool ownplay, Minion target, int choice)
        {
            int place = (ownplay) ? p.ownMinions.Count : p.enemyMinions.Count;

            p.CallKid(kid, place, ownplay, false);
        }
예제 #27
0
        public override void onDeathrattle(Playfield p, Minion m)
        {
            int pos = (m.own) ? p.ownMinions.Count : p.enemyMinions.Count;

            p.CallKid(kid, pos, m.own, false);
        }
예제 #28
0
        CardDB.Card kid = CardDB.Instance.getCardDataFromID(CardDB.cardIDEnum.CFM_648t); //6/6 Ogre

        public override void getBattlecryEffect(Playfield p, Minion m, Minion target, int choice)
        {
            p.CallKid(kid, m.zonepos, m.own);
        }
예제 #29
0
        CardDB.Card c = CardDB.Instance.getCardDataFromID(CardDB.cardIDEnum.EX1_612);//kirintormage

        public override void onDeathrattle(Playfield p, Minion m)
        {
            int place = (m.own) ? p.enemyMinions.Count : p.ownMinions.Count;

            p.CallKid(c, place, !m.own, false);
        }
예제 #30
0
        CardDB.Card kid = CardDB.Instance.getCardDataFromID(CardDB.cardIDEnum.ICC_838t); //Frozen Champion

        public override void getBattlecryEffect(Playfield p, Minion own, Minion target, int choice)
        {
            p.CallKid(kid, own.zonepos - 1, own.own); //1st left
            p.CallKid(kid, own.zonepos, own.own);
        }