Example #1
0
        // for class/deck mulligan paths
        public string heroEnumtoCommonName(HeroEnum he)
        {
            switch (he)
            {
            case HeroEnum.druid: return("Druid");

            case HeroEnum.hunter: return("Hunter");

            case HeroEnum.mage: return("Mage");

            case HeroEnum.pala: return("Paladin");

            case HeroEnum.priest: return("Priest");

            case HeroEnum.shaman: return("Shaman");

            case HeroEnum.thief: return("Rogue");

            case HeroEnum.warlock: return("Warlock");

            case HeroEnum.warrior: return("Warrior");

            default: return("none");
            }
        }
Example #2
0
        public TAG_CLASS heroEnumtoTagClass(HeroEnum he)
        {
            switch (he)
            {
            case HeroEnum.druid: return(TAG_CLASS.DRUID);

            case HeroEnum.hunter: return(TAG_CLASS.HUNTER);

            case HeroEnum.mage: return(TAG_CLASS.MAGE);

            case HeroEnum.pala: return(TAG_CLASS.PALADIN);

            case HeroEnum.priest: return(TAG_CLASS.PRIEST);

            case HeroEnum.shaman: return(TAG_CLASS.SHAMAN);

            case HeroEnum.thief: return(TAG_CLASS.ROGUE);

            case HeroEnum.warlock: return(TAG_CLASS.WARLOCK);

            case HeroEnum.warrior: return(TAG_CLASS.WARRIOR);

            case HeroEnum.all: return(TAG_CLASS.ALL);

            default: return(TAG_CLASS.INVALID);
            }
        }
Example #3
0
        public static string heroEnumtoName(HeroEnum he)
        {
            switch (he)
            {
            case HeroEnum.druid: return("druid");

            case HeroEnum.hunter: return("hunter");

            case HeroEnum.mage: return("mage");

            case HeroEnum.pala: return("pala");

            case HeroEnum.priest: return("priest");

            case HeroEnum.shaman: return("shaman");

            case HeroEnum.thief: return("thief");

            case HeroEnum.warlock: return("warlock");

            case HeroEnum.warrior: return("warrior");

            case HeroEnum.lordjaraxxus: return("lordjaraxxus");

            case HeroEnum.ragnarosthefirelord: return("ragnarosthefirelord");

            case HeroEnum.hogger: return("hogger");

            default: return("druid");
            }
        }
Example #4
0
        private string getMullRuleKey(CardIdEnum cardIDM = CardIdEnum.None, HeroEnum ownMHero = HeroEnum.None, HeroEnum enemyMHero = HeroEnum.None, int isExtraRule = 0)
        {
            StringBuilder MullRuleKey = new StringBuilder("", 500);

            MullRuleKey.Append(cardIDM).Append(";").Append(ownMHero).Append(";").Append(enemyMHero).Append(";").Append(isExtraRule);
            return(MullRuleKey.ToString());
        }
Example #5
0
    public void SelectHero(HeroEnum heroType, bool save = false)
    {
        var hero = Heroes.Where(h => h.HeroType == heroType).FirstOrDefault();

        SelectedHero = hero;

        var  renderer   = PlayerScript.GetComponent <SpriteRenderer>();
        bool isUnlocked = hero.IsUnlocked();

        renderer.sprite = hero.ShowoffSprite;
        renderer.color  = isUnlocked ? Color.white : Color.black;
        string unlockText = isUnlocked ? hero.Description : string.Format(GameEvents.ActionDisplayString(hero.GameCounter), SaveGame.Members.GetCounter(hero.GameCounter), hero.Req);

        TextHeroUnlock.text           = unlockText;
        TextHeroName.text             = hero.Name;
        Orc.Mood                      = hero.OrcMood;
        SaveGame.Members.SelectedHero = (int)hero.HeroType;

        UpdateButtonStates();

        if (save)
        {
            SaveGame.Save();
        }
    }
        public void updateHero(Weapon w, string heron, CardDB.Card ability, bool abrdy, int abCost, Minion hero, int enMaxMana = 10)
        {
            if (w.name == CardDB.cardName.foolsbane)
            {
                w.cantAttackHeroes = true;
            }

            if (hero.own)
            {
                this.ownWeapon = new Weapon(w);

                this.ownHero        = new Minion(hero);
                this.heroname       = this.heroNametoEnum(heron);
                this.heronameingame = heron;
                if (this.ownHeroStartClass == TAG_CLASS.INVALID)
                {
                    this.ownHeroStartClass = hero.cardClass;
                }
                this.ownHero.poisonous = this.ownWeapon.poisonous;
                this.ownHero.lifesteal = this.ownWeapon.lifesteal;
                if (this.ownWeapon.name == CardDB.cardName.gladiatorslongbow)
                {
                    this.ownHero.immuneWhileAttacking = true;
                }

                this.heroAbility       = ability;
                this.ownHeroPowerCost  = abCost;
                this.ownAbilityisReady = abrdy;
            }
            else
            {
                this.enemyWeapon = new Weapon(w);
                this.enemyHero   = new Minion(hero);;

                this.enemyHeroname       = this.heroNametoEnum(heron);
                this.enemyHeronameingame = heron;
                if (this.enemyHeroStartClass == TAG_CLASS.INVALID)
                {
                    this.enemyHeroStartClass = enemyHero.cardClass;
                }
                this.enemyHero.poisonous = this.enemyWeapon.poisonous;
                this.enemyHero.lifesteal = this.enemyWeapon.lifesteal;
                if (this.enemyWeapon.name == CardDB.cardName.gladiatorslongbow)
                {
                    this.enemyHero.immuneWhileAttacking = true;
                }

                this.enemyAbility       = ability;
                this.enemyHeroPowerCost = abCost;

                this.enemyMaxMana = enMaxMana;
            }
        }
Example #7
0
        public static string heroEnumtoName(HeroEnum s)
        {
            if (s == HeroEnum.hogger)
            {
                return("hogger");
            }
            if (s == HeroEnum.hunter)
            {
                return("hunter");
            }
            if (s == HeroEnum.priest)
            {
                return("priest");
            }
            if (s == HeroEnum.druid)
            {
                return("druid");
            }
            if (s == HeroEnum.warlock)
            {
                return("warlock");
            }
            if (s == HeroEnum.thief)
            {
                return("thief");
            }
            if (s == HeroEnum.pala)
            {
                return("pala");
            }
            if (s == HeroEnum.warrior)
            {
                return("warrior");
            }
            if (s == HeroEnum.shaman)
            {
                return("shaman");
            }
            if (s == HeroEnum.mage)
            {
                return("mage");
            }
            if (s == HeroEnum.lordjaraxxus)
            {
                return("lordjaraxxus");
            }
            if (s == HeroEnum.ragnarosthefirelord)
            {
                return("ragnarosthefirelord");
            }

            return("druid");
        }
Example #8
0
        public bool shouldConcede(HeroEnum ownhero, HeroEnum enemHero)
        {
            foreach (concedeItem ci in concedelist)
            {
                if (ci.urhero == ownhero && ci.enemhero.Contains(enemHero))
                {
                    return(true);
                }
            }

            return(false);
        }
Example #9
0
File: Hrtprozis.cs Project: tnd34/e
        public void updateOwnHero(string weapon, int watt, int wdur, string heron, CardDB.Card hab, bool habrdy, Minion Hero)
        {
            this.ownHeroWeapon = CardDB.Instance.cardNamestringToEnum(weapon);
            this.heroWeaponAttack = watt;
            this.heroWeaponDurability = wdur;

            this.heroname = this.heroNametoEnum(heron);

            this.heroAbility = hab;
            this.ownAbilityisReady = habrdy;

            this.ownHero = new Minion(Hero);
            this.ownHero.updateReadyness();
        }
Example #10
0
		 public TAG_CLASS heroEnumtoTagClass(HeroEnum he)
        {
            switch (he)
            {
                case HeroEnum.druid: return TAG_CLASS.DRUID;
                case HeroEnum.hunter: return TAG_CLASS.HUNTER;
                case HeroEnum.mage: return TAG_CLASS.MAGE;
                case HeroEnum.pala: return TAG_CLASS.PALADIN;
                case HeroEnum.priest: return TAG_CLASS.PRIEST;
                case HeroEnum.shaman: return TAG_CLASS.SHAMAN;
                case HeroEnum.thief: return TAG_CLASS.ROGUE;
                case HeroEnum.warlock: return TAG_CLASS.WARLOCK;
                case HeroEnum.warrior: return TAG_CLASS.WARRIOR;
                default: return TAG_CLASS.INVALID;
            }
        }
Example #11
0
 public static Hero GetHero(HeroEnum heroId)
 {
     switch (heroId)
     {
         case HeroEnum.Archer:
             return new Archer("Some name", 10, 100, 20);
         case HeroEnum.Barbarian:
             return new Barbarian("Barbarian name", 10, 90, 30);
         case HeroEnum.Sorcerer:
             return new Sorcerer("Sorcer name", 10, 120, 25);
         case HeroEnum.Spearman:
             return new Spearman("Spearman name", 10, 100, 30);
         case HeroEnum.Dwarf:
             return new Dwarf("Dwarf name", 10, 90, 25);
         default:
             throw new NotImplementedException();
     }
 }
Example #12
0
 public void updateOwnHero(string weapon, int watt, int wdur, bool heroimunewhileattack, int heroatt, int herohp, int herodef, string heron, bool heroready, bool frozen, CardDB.Card hab, bool habrdy, int numAttacksTTurn, bool windfury, bool hisim)
 {
     this.ownHeroWeapon                    = CardDB.Instance.cardNamestringToEnum(weapon);
     this.heroWeaponAttack                 = watt;
     this.heroWeaponDurability             = wdur;
     this.heroImmuneToDamageWhileAttacking = heroimunewhileattack;
     this.heroAtk                   = heroatt;
     this.heroHp                    = herohp;
     this.heroDefence               = herodef;
     this.heroname                  = this.heroNametoEnum(heron);
     this.ownheroisread             = heroready;
     this.herofrozen                = frozen;
     this.heroAbility               = hab;
     this.ownAbilityisReady         = habrdy;
     this.ownHeroWindfury           = windfury;
     this.ownHeroNumAttacksThisTurn = numAttacksTTurn;
     this.heroImmune                = hisim;
 }
Example #13
0
 public static Weapon GetWeapon(HeroEnum heroId)
 {
     switch (heroId)
     {
         case HeroEnum.Archer:
             return new Bow();
         case HeroEnum.Barbarian:
             return new ThrowingAxe();
         case HeroEnum.Dwarf:
             return new ThrowingAxe();
         case HeroEnum.Sorcerer:
             return new Scepter();
         case HeroEnum.Spearman:
             return new Javelin();
         default:
             throw new NotImplementedException();
     }
 }
Example #14
0
 public void clearAll()
 {
     ownHeroEntity             = -1;
     enemyHeroEntitiy          = -1;
     currentMana               = 0;
     heroHp                    = 30;
     enemyHp                   = 30;
     heroAtk                   = 0;
     enemyAtk                  = 0;
     heroDefence               = 0; enemyDefence = 0;
     ownheroisread             = false;
     ownAbilityisReady         = false;
     ownHeroNumAttacksThisTurn = 0;
     ownHeroWindfury           = false;
     ownSecretList.Clear();
     enemySecretCount                 = 0;
     heroname                         = HeroEnum.druid;
     enemyHeroname                    = HeroEnum.druid;
     heroAbility                      = new CardDB.Card();
     enemyAbility                     = new CardDB.Card();
     herofrozen                       = false;
     enemyfrozen                      = false;
     numMinionsPlayedThisTurn         = 0;
     cardsPlayedThisTurn              = 0;
     owedRecall                       = 0;
     ownMaxMana                       = 0;
     enemyMaxMana                     = 0;
     enemyWeaponDurability            = 0;
     enemyWeaponAttack                = 0;
     heroWeaponDurability             = 0;
     heroWeaponAttack                 = 0;
     heroImmuneToDamageWhileAttacking = false;
     ownMinions.Clear();
     enemyMinions.Clear();
     heroImmune                = false;
     enemyHeroImmune           = false;
     numberMinionsDiedThisTurn = 0;
     ownCurrentRecall          = 0;
     this.ownHeroWeapon        = CardDB.cardName.unknown;
     this.enemyHeroWeapon      = CardDB.cardName.unknown;
     //this.LastPlayedCard = CardDB.cardIDEnum.None;
     noDuplicates             = true;
     anzOwnElementalsLastTurn = 0;
 }
Example #15
0
        public void getEnemySecretGuesses(List <int> enemySecretIds, HeroEnum enemyHeroName)
        {
            List <SecretItem> newlist = new List <SecretItem>();

            foreach (int i in enemySecretIds)
            {
                if (i >= 1000)
                {
                    continue;
                }
                Helpfunctions.Instance.logg("detect secret with id" + i);
                SecretItem sec = getNewSecretGuessedItem(i, enemyHeroName);

                newlist.Add(new SecretItem(sec));
            }

            this.enemySecrets.Clear();
            this.enemySecrets.AddRange(newlist);
        }
Example #16
0
        public void updateOwnHero(CardDB.Card weapon, int watt, int wdur, string heron, CardDB.Card hab, bool habrdy, int habcost, Minion Hero)
        {
            this.ownWeaponCard        = weapon;
            this.heroWeaponAttack     = watt;
            this.heroWeaponDurability = wdur;

            this.heroname       = this.heroNametoEnum(heron);
            this.heronameingame = heron;
            if (this.ownHeroStartClass == TAG_CLASS.INVALID)
            {
                this.ownHeroStartClass = Hero.cardClass;
            }

            this.heroAbility       = hab;
            this.ownHeroPowerCost  = habcost;
            this.ownAbilityisReady = habrdy;

            this.ownHero = new Minion(Hero);
        }
Example #17
0
 public void clearAll()
 {
     ownHeroEntity             = -1;
     enemyHeroEntitiy          = -1;
     tempwounded               = false;
     currentMana               = 0;
     heroHp                    = 30;
     enemyHp                   = 30;
     heroAtk                   = 0;
     enemyAtk                  = 0;
     heroDefence               = 0; enemyDefence = 0;
     ownheroisread             = false;
     ownAbilityisReady         = false;
     ownHeroNumAttacksThisTurn = 0;
     ownHeroWindfury           = false;
     ownSecretList.Clear();
     enemySecretCount                 = 0;
     heroname                         = HeroEnum.druid;
     enemyHeroname                    = HeroEnum.druid;
     heroAbility                      = new CardDB.Card();
     enemyAbility                     = new CardDB.Card();
     anzEnemys                        = 0;
     anzOwn                           = 0;
     herofrozen                       = false;
     enemyfrozen                      = false;
     numMinionsPlayedThisTurn         = 0;
     cardsPlayedThisTurn              = 0;
     ueberladung                      = 0;
     ownMaxMana                       = 0;
     enemyMaxMana                     = 0;
     enemyWeaponDurability            = 0;
     enemyWeaponAttack                = 0;
     heroWeaponDurability             = 0;
     heroWeaponAttack                 = 0;
     heroImmuneToDamageWhileAttacking = false;
     ownMinions.Clear();
     enemyMinions.Clear();
     heroImmune           = false;
     enemyHeroImmune      = false;
     this.ownHeroWeapon   = CardDB.cardName.unknown;
     this.enemyHeroWeapon = CardDB.cardName.unknown;
 }
Example #18
0
 public void clearAllRecalc()
 {
     pId                       = 0;
     ownHeroEntity             = -1;
     enemyHeroEntitiy          = -1;
     currentMana               = 0;
     heroHp                    = 30;
     enemyHp                   = 30;
     heroAtk                   = 0;
     enemyAtk                  = 0;
     heroDefence               = 0; enemyDefence = 0;
     ownheroisread             = false;
     ownAbilityisReady         = false;
     ownHeroNumAttacksThisTurn = 0;
     ownHeroWindfury           = false;
     ownSecretList.Clear();
     enemySecretCount         = 0;
     heroname                 = HeroEnum.None;
     enemyHeroname            = HeroEnum.None;
     heronameingame           = "";
     enemyHeronameingame      = "";
     heroAbility              = new CardDB.Card();
     enemyAbility             = new CardDB.Card();
     herofrozen               = false;
     enemyfrozen              = false;
     numMinionsPlayedThisTurn = 0;
     cardsPlayedThisTurn      = 0;
     ueberladung              = 0;
     lockedMana               = 0;
     ownMaxMana               = 0;
     enemyMaxMana             = 0;
     enemyWeaponDurability    = 0;
     enemyWeaponAttack        = 0;
     heroWeaponDurability     = 0;
     heroWeaponAttack         = 0;
     ownMinions.Clear();
     enemyMinions.Clear();
     ownWeaponCard   = new CardDB.Card();
     enemyWeaponCard = new CardDB.Card();
     noDuplicates    = false;
     turnDeck.Clear();
 }
Example #19
0
    public void HeroChange(int direction = 0)
    {
        if (direction != 0)
        {
            PlayMenuSound();
        }

        HeroEnum nextHero = SelectedHero.HeroType + direction;

        if (nextHero < 0)
        {
            nextHero = HeroEnum.Last - 1;
        }

        if (nextHero >= HeroEnum.Last)
        {
            nextHero = HeroEnum.StarterKnight;
        }

        SelectHero(nextHero, save: true);
    }
Example #20
0
        public void doDeckData(string data)
        {
            data = data.Trim();
            //Helpfunctions.Instance.ErrorLog(data);
            string   deckname      = data.Split(';')[0];
            string   ownname       = data.Split(';')[1];
            string   enemyname     = data.Split(';')[2];
            HeroEnum heroname      = Hrtprozis.Instance.heroNametoEnum(ownname);
            HeroEnum enemyHeroname = Hrtprozis.Instance.heroNametoEnum(enemyname);

            if (Hrtprozis.Instance.deckName != deckname || heroname != Hrtprozis.Instance.heroname)
            {
                Hrtprozis.Instance.setDeckName(deckname);
                Hrtprozis.Instance.setHeroName(ownname);
                ComboBreaker.Instance.updateInstance();
                Discovery.Instance.updateInstance();
                Mulligan.Instance.updateInstance();
            }
            if (Hrtprozis.Instance.deckName != deckname || heroname != Hrtprozis.Instance.heroname || enemyHeroname != Hrtprozis.Instance.enemyHeroname)
            {
                Hrtprozis.Instance.setEnemyHeroName(enemyname);
                Settings.Instance.updateInstance();
            }
        }
Example #21
0
        private void doBattleCryWithoutTargeting(Minion c, int position, bool own, int choice)
        {
            //only nontargetable battlecrys!

            //druid choices

            //urtum des krieges:
            if (c.name == "ancientofwar")
            {
                if (choice == 1)
                {
                    minionGetBuffed(c, 5, 0, true);
                }
                if (choice == 2)
                {
                    minionGetBuffed(c, 0, 5, true);
                    c.taunt = true;
                }
            }

            if (c.name == "ancientoflore")
            {
                if (choice == 1)
                {
                    //this.owncarddraw += 2;
                    this.drawACard("", own);
                    this.drawACard("", own);
                }

            }

            if (c.name == "druidoftheclaw")
            {
                if (choice == 1)
                {
                    minionGetCharge(c);
                }
                if (choice == 2)
                {
                    minionGetBuffed(c, 0, 2, true);
                    c.taunt = true;
                }
            }

            if (c.name == "cenarius")
            {
                if (choice == 1)
                {
                    foreach (Minion m in this.ownMinions)
                    {
                        minionGetBuffed(m, 2, 2, true);
                    }
                }
                //choice 2 = spawn 2 kids
            }

            //normal ones

            if (c.name == "mindcontroltech")
            {
                if (this.enemyMinions.Count >= 4)
                {
                    List<Minion> temp = new List<Minion>();

                    List<Minion> temp2 = new List<Minion>(this.enemyMinions);
                    temp2.Sort((a, b) => a.Angr.CompareTo(b.Angr));//we take the weekest

                    temp.AddRange(Helpfunctions.TakeList(temp2, 2));
                    Minion target = new Minion();
                    target = temp[0];
                    if (target.taunt && !temp[1].taunt) target = temp[1];
                    minionGetControlled(target, true, false);

                }
            }

            if (c.name == "felguard")
            {
                this.ownMaxMana--;
            }
            if (c.name == "arcanegolem")
            {
                this.enemyMaxMana++;
            }

            if (c.name == "edwinvancleef" && this.cardsPlayedThisTurn >= 1)
            {
                minionGetBuffed(c, this.cardsPlayedThisTurn * 2, this.cardsPlayedThisTurn * 2, own);
            }

            if (c.name == "doomguard")
            {
                this.owncarddraw -= Math.Min(2, this.owncards.Count);
                this.owncards.RemoveRange(0, Math.Min(2, this.owncards.Count));
            }

            if (c.name == "succubus")
            {
                this.owncarddraw -= Math.Min(1, this.owncards.Count);
                this.owncards.RemoveRange(0, Math.Min(1, this.owncards.Count));
            }

            if (c.name == "lordjaraxxus")
            {
                this.ownHeroAblility = CardDB.Instance.getCardDataFromID("EX1_tk33");
                this.ownHeroName = HeroEnum.lordjaraxxus;
                this.ownHeroHp = c.Hp;
            }

            if (c.name == "flameimp")
            {
                attackOrHealHero(3, own);
            }
            if (c.name == "pitlord")
            {
                attackOrHealHero(5, own);
            }

            if (c.name == "voidterror")
            {
                List<Minion> temp = new List<Minion>();
                if (own)
                {
                    temp.AddRange(this.ownMinions);
                }
                else
                {
                    temp.AddRange(this.enemyMinions);
                }

                int angr = 0;
                int hp = 0;
                foreach (Minion m in temp)
                {
                    if (m.id == position || m.id == position - 1)
                    {
                        angr += m.Angr;
                        hp += m.Hp;
                    }
                }
                foreach (Minion m in temp)
                {
                    if (m.id == position || m.id == position - 1)
                    {
                        minionGetDestroyed(m, own);
                    }
                }
                minionGetBuffed(c, angr, hp, own);

            }

            if (c.name == "frostwolfwarlord")
            {
                minionGetBuffed(c, this.ownMinions.Count, this.ownMinions.Count, own);
            }
            if (c.name == "bloodsailraider")
            {
                c.Angr += this.ownWeaponAttack;
            }

            if (c.name == "southseadeckhand" && this.ownWeaponDurability >= 1)
            {
                minionGetCharge(c);
            }

            if (c.name == "bloodknight")
            {
                int shilds = 0;
                foreach (Minion m in this.ownMinions)
                {
                    if (m.divineshild)
                    {
                        m.divineshild = false;
                        shilds++;
                    }
                }
                foreach (Minion m in this.enemyMinions)
                {
                    if (m.divineshild)
                    {
                        m.divineshild = false;
                        shilds++;
                    }
                }
                minionGetBuffed(c, 3 * shilds, 3 * shilds, own);

            }

            if (c.name == "kingmukla")
            {
                this.enemycarddraw += 2;
            }

            if (c.name == "coldlightoracle")
            {
                //this.enemycarddraw += 2;
                //this.owncarddraw += 2;
                this.drawACard("", true);
                this.drawACard("", true);
                this.drawACard("", false);
                this.drawACard("", false);
            }

            if (c.name == "arathiweaponsmith")
            {
                CardDB.Card wcard = CardDB.Instance.getCardData("battleaxe");
                this.equipWeapon(wcard);

            }
            if (c.name == "bloodsailcorsair")
            {
                this.lowerWeaponDurability(1, false);
            }

            if (c.name == "acidicswampooze")
            {
                this.lowerWeaponDurability(1000, false);
            }
            if (c.name == "noviceengineer")
            {
                //this.owncarddraw++;
                drawACard("",true);
            }
            if (c.name == "gnomishinventor")
            {
                //this.owncarddraw++;
                drawACard("", true);
            }

            if (c.name == "darkscalehealer")
            {
                List<Minion> temp = new List<Minion>(this.ownMinions);
                foreach (Minion m in temp)
                {

                    if (this.auchenaiseelenpriesterin)
                    { minionGetDamagedOrHealed(m, 2, 0, true); }
                    else { minionGetDamagedOrHealed(m, 0, 2, true); }

                }
                if (this.auchenaiseelenpriesterin)
                { attackOrHealHero(2, true); }
                else { attackOrHealHero(-2, true); }

            }
            if (c.name == "nightblade")
            {
                attackOrHealHero(3, !own);
            }

            if (c.name == "twilightdrake")
            {
                minionGetBuffed(c, 0, this.owncards.Count, true);
            }

            if (c.name == "azuredrake")
            {
                //this.owncarddraw++;
                drawACard("", true);
            }

            if (c.name == "harrisonjones")
            {
                this.enemyWeaponAttack = 0;
                //this.owncarddraw += enemyWeaponDurability;
                for (int i = 0; i < enemyWeaponDurability; i++)
                {
                    drawACard("", true);
                }
                this.enemyWeaponDurability = 0;
            }

            if (c.name == "guardianofkings")
            {
                attackOrHealHero(-6, true);
            }

            if (c.name == "captaingreenskin")
            {
                if (this.ownWeaponName != "")
                {
                    this.ownheroAngr += 1;
                    this.ownWeaponAttack++;
                    this.ownWeaponDurability++;
                }
            }

            if (c.name == "priestessofelune")
            {
                attackOrHealHero(-4, true);
            }
            if (c.name == "injuredblademaster")
            {
                minionGetDamagedOrHealed(c, 4, 0, true);
            }

            if (c.name == "dreadinfernal")
            {
                List<Minion> temp = new List<Minion>(this.ownMinions);
                foreach (Minion m in temp)
                {
                    minionGetDamagedOrHealed(m, 1, 0, true);
                }
                temp.Clear();
                temp.AddRange(this.enemyMinions);
                foreach (Minion m in temp)
                {
                    minionGetDamagedOrHealed(m, 1, 0, false);
                }
                attackOrHealHero(1, false);
                attackOrHealHero(1, true);
            }

            if (c.name == "tundrarhino")
            {
                minionGetCharge(c);
                List<Minion> temp = new List<Minion>(this.ownMinions);
                foreach (Minion m in temp)
                {
                    if ((TAG_RACE)m.handcard.card.race == TAG_RACE.PET)
                    {
                        minionGetCharge(m);
                    }
                }
            }

            if (c.name == "stampedingkodo")
            {
                List<Minion> temp = new List<Minion>();
                List<Minion> temp2 = new List<Minion>(this.enemyMinions);
                temp2.Sort((a, b) => a.Hp.CompareTo(b.Hp));//destroys the weakest
                temp.AddRange(temp2);
                foreach (Minion enemy in temp)
                {
                    if (enemy.Angr <= 2)
                    {
                        minionGetDestroyed(enemy, false);
                        break;
                    }
                }
            }

            if (c.name == "sunfuryprotector")
            {
                List<Minion> temp = new List<Minion>(this.ownMinions);
                foreach (Minion m in temp)
                {
                    if (m.id == position - 1 || m.id == position)
                    {
                        m.taunt = true;
                    }
                }
            }

            if (c.name == "ancientmage")
            {
                List<Minion> temp = new List<Minion>(this.ownMinions);
                foreach (Minion m in temp)
                {
                    if (m.id == position - 1 || m.id == position )
                    {
                        m.handcard.card.spellpowervalue++;
                    }
                }
            }

            if (c.name == "defenderofargus")
            {
                List<Minion> temp = new List<Minion>(this.ownMinions);
                foreach (Minion m in temp)
                {
                    if (m.id == position - 1 || m.id == position)//position and position -1 because its not placed jet
                    {
                        Enchantment e = CardDB.getEnchantmentFromCardID("EX1_093e");
                        e.creator = c.entitiyID;
                        e.controllerOfCreator = this.ownController;
                        addEffectToMinionNoDoubles(m, e, own);
                    }
                }
            }

            if (c.name == "coldlightseer")
            {
                List<Minion> temp = new List<Minion>(this.ownMinions);
                foreach (Minion m in temp)
                {
                    if ((TAG_RACE)m.handcard.card.race == TAG_RACE.MURLOC)
                    {
                        minionGetBuffed(m, 0, 2, true);
                    }
                }
                temp.Clear();
                temp.AddRange(this.enemyMinions);
                foreach (Minion m in temp)
                {
                    if ((TAG_RACE)m.handcard.card.race == TAG_RACE.MURLOC)
                    {
                        minionGetBuffed(m, 0, 2, false);
                    }
                }
            }

            if (c.name == "deathwing")
            {
                List<Minion> temp = new List<Minion>(this.ownMinions);
                foreach (Minion enemy in temp)
                {
                    minionGetDestroyed(enemy, true);
                }
                temp.Clear();
                temp.AddRange(this.enemyMinions);
                foreach (Minion enemy in temp)
                {
                    minionGetDestroyed(enemy, false);
                }
                this.owncards.Clear();
                this.owncarddraw = 0;
                this.enemyAnzCards = 0;
                this.enemycarddraw = 0;

            }

            if (c.name == "captainsparrot")
            {
                //this.owncarddraw++;
                drawACard("", true);

            }
        }
Example #22
0
 private string getMullRuleKey(CardDB.cardIDEnum cardIDM = CardDB.cardIDEnum.None, HeroEnum ownMHero = HeroEnum.None, HeroEnum enemyMHero = HeroEnum.None, bool HoldM = false)
 {
     StringBuilder MullRuleKey = new StringBuilder("", 500);
     MullRuleKey.Append(cardIDM).Append(";").Append(ownMHero).Append(";").Append(enemyMHero).Append(";").Append(HoldM ? "Hold" : "Discard");
     return MullRuleKey.ToString();
 }
Example #23
0
        public int checkIfComboWasPlayed(List <Action> alist, CardDB.cardName weapon, HeroEnum heroname)
        {
            if (this.combos.Count == 0)
            {
                return(0);
            }
            //returns a penalty only if the combo could be played, but is not played completely
            List <Handmanager.Handcard> playedcards = new List <Handmanager.Handcard>();
            List <combo> searchingCombo             = new List <combo>();
            // only check the cards, that are in a combo that can be played:
            int mana = Math.Max(hp.ownMaxMana, hp.currentMana);

            foreach (Action a in alist)
            {
                if (a.actionType != ActionType.PLAY_CARD && a.actionType != ActionType.USE_HERO_POWER)
                {
                    continue;
                }
                CardDB.Card crd = a.card.card;
                //playedcards.Add(a.handcard);
                foreach (combo c in this.combos)
                {
                    if ((c.oHero == HeroEnum.NONE || c.oHero == heroname) && c.isCardInCombo(crd))
                    {
                        int iia = c.isInCombo(hm.handCards, hp.ownMaxMana);
                        int iib = c.isMultiTurnComboTurn1(hm.handCards, mana, hp.ownMinions, weapon);
                        int iic = Math.Max(iia, iib);
                        if (iia == 2 && iib != 2 && c.isMultiTurn1Card(crd))
                        {
                            iic = 1;
                        }
                        if (iic == 2)
                        {
                            playedcards.Add(a.card); // add only the cards, which dont get a penalty
                        }
                    }
                }
            }

            if (playedcards.Count == 0)
            {
                return(0);
            }
            bool wholeComboPlayed = false;

            int bonus = 0;

            foreach (combo c in this.combos)
            {
                int iia = c.hasPlayedCombo(playedcards);
                int iib = c.hasPlayedTurn0Combo(playedcards);
                int iic = c.hasPlayedTurn1Combo(playedcards);
                int iie = iia + iib + iic;
                if (iie >= 1)
                {
                    wholeComboPlayed = true;
                    bonus           -= iie;
                }
            }

            if (wholeComboPlayed)
            {
                return(bonus);
            }
            return(250);
        }
Example #24
0
        public int checkIfComboWasPlayed(Playfield p)
        {
            if (this.combos.Count == 0)
            {
                return(0);
            }

            List <Action> alist = p.playactions;

            CardDB.cardName weapon   = p.ownWeaponCard.name;
            HeroEnum        heroname = p.ownHeroName;

            //returns a penalty only if the combo could be played, but is not played completely
            List <Handmanager.Handcard> playedcards = new List <Handmanager.Handcard>();
            List <combo> searchingCombo             = new List <combo>();
            // only check the cards, that are in a combo that can be played:
            int mana = Math.Max(p.ownMaxMana, p.mana);

            foreach (Action a in alist)
            {
                if (a.actionType != actionEnum.playcard)
                {
                    continue;
                }
                CardDB.Card crd = a.card.card;
                foreach (combo c in this.combos)
                {
                    if ((c.oHero == HeroEnum.None || c.oHero == p.ownHeroName) && c.isCardInCombo(crd))
                    {
                        int iia = c.isInCombo(p.owncards, p.ownMaxMana);
                        int iib = c.isMultiTurnComboTurn1(p.owncards, mana, p.ownMinions, weapon);
                        int iic = Math.Max(iia, iib);
                        if (iia == 2 && iib != 2 && c.isMultiTurn1Card(crd))
                        {
                            iic = 1;
                        }
                        if (iic == 2)
                        {
                            playedcards.Add(a.card); // add only the cards, which dont get a penalty
                        }
                    }
                }
            }

            if (playedcards.Count == 0)
            {
                return(0);
            }
            bool wholeComboPlayed = false;

            int bonus = 0;

            foreach (combo c in this.combos)
            {
                int iia = c.hasPlayedCombo(playedcards);
                int iib = c.hasPlayedTurn0Combo(playedcards);
                int iic = c.hasPlayedTurn1Combo(playedcards);
                int iie = iia + iib + iic;
                if (iie >= 1)
                {
                    wholeComboPlayed = true;
                    bonus           -= iie;
                }
            }

            if (wholeComboPlayed)
            {
                return(bonus);
            }
            return(250);
        }
Example #25
0
        public Playfield()
        {
            this.nextEntity = 1000;
            //this.simulateEnemyTurn = Ai.Instance.simulateEnemyTurn;
            this.ownController = Hrtprozis.Instance.getOwnController();

            //this.ownHeroEntity = Hrtprozis.Instance.ownHeroEntity;
            //this.enemyHeroEntity = Hrtprozis.Instance.enemyHeroEntitiy;

            this.mana = Hrtprozis.Instance.currentMana;
            this.manaTurnEnd = this.mana;
            this.ownMaxMana = Hrtprozis.Instance.ownMaxMana;
            this.enemyMaxMana = Hrtprozis.Instance.enemyMaxMana;
            this.evaluatePenality = 0;
            this.ownSecretsIDList.AddRange(Hrtprozis.Instance.ownSecretList);
            this.enemySecretCount = Hrtprozis.Instance.enemySecretCount;


            this.attackFaceHP = Hrtprozis.Instance.attackFaceHp;

            this.complete = false;

            addMinionsReal(Hrtprozis.Instance.ownMinions, ownMinions);
            addMinionsReal(Hrtprozis.Instance.enemyMinions, enemyMinions);
            this.ownHero = new Minion(Hrtprozis.Instance.ownHero);
            this.enemyHero = new Minion(Hrtprozis.Instance.enemyHero);
            addCardsReal(Handmanager.Instance.handCards);

            this.enemySecretList.Clear();
            if (Settings.Instance.useSecretsPlayArround)
            {
                foreach (SecretItem si in Probabilitymaker.Instance.enemySecrets)
                {
                    this.enemySecretList.Add(new SecretItem(si));
                }
            }

            this.ownHeroName = Hrtprozis.Instance.heroname;
            this.enemyHeroName = Hrtprozis.Instance.enemyHeroname;


            //####buffs#############################

            this.anzOwnRaidleader = 0;
            this.anzEnemyRaidleader = 0;
            this.anzOwnStormwindChamps = 0;
            this.anzEnemyStormwindChamps = 0;
            this.anzOwnTundrarhino = 0;
            this.anzEnemyTundrarhino = 0;
            this.anzOwnTimberWolfs = 0;
            this.anzEnemyTimberWolfs = 0;
            this.anzMurlocWarleader = 0;
            this.anzGrimscaleOracle = 0;
            this.anzOwnAuchenaiSoulpriest = 0;
            this.anzEnemyAuchenaiSoulpriest = 0;
            this.anzOwnsorcerersapprentice = 0;
            this.anzOwnsorcerersapprenticeStarted = 0;
            this.anzEnemysorcerersapprentice = 0;
            this.anzEnemysorcerersapprenticeStarted = 0;
            this.anzOwnSouthseacaptain = 0;
            this.anzEnemySouthseacaptain = 0;

            this.feugenDead = Probabilitymaker.Instance.feugenDead;
            this.stalaggDead = Probabilitymaker.Instance.stalaggDead;

            this.doublepriest = 0;
            this.enemydoublepriest = 0;

            this.ownDragonConsort = Hrtprozis.Instance.ownDragonConsort;
            this.enemyDragonConsort = Hrtprozis.Instance.enemyDragonConsort;

            this.weHavePlayedMillhouseManastorm = (Hrtprozis.Instance.enemyMillhouse >= 1) ? true : false; //jeah... really, enemymillhouse
            this.enemyHavePlayedMillhouseManastorm = (Hrtprozis.Instance.ownMillhouse >= 1) ? true : false;//jeah... really, ownmillhouse
            this.ownloatheb = Hrtprozis.Instance.enemyLoatheb;//dont ask...
            this.enemyloatheb = Hrtprozis.Instance.ownLoatheb;//dont ask... :D
            this.playedmagierinderkirintor = (Hrtprozis.Instance.ownKirinTorEffect>=1)? true:false;
            this.playedPreparation = (Hrtprozis.Instance.ownPreparation >= 1) ? true : false;

            this.ownBaronRivendare = 0;
            this.enemyBaronRivendare = 0;
            //#########################################

            this.ownWeaponDurability = Hrtprozis.Instance.heroWeaponDurability;
            this.ownWeaponAttack = Hrtprozis.Instance.heroWeaponAttack;
            this.ownWeaponName = Hrtprozis.Instance.ownHeroWeapon;
            this.owncarddraw = 0;


            this.enemyWeaponAttack = Hrtprozis.Instance.enemyWeaponAttack;//dont know jet
            this.enemyWeaponName = Hrtprozis.Instance.enemyHeroWeapon;
            this.enemyWeaponDurability = Hrtprozis.Instance.enemyWeaponDurability;
            this.enemycarddraw = 0;

            this.enemyAnzCards = Handmanager.Instance.enemyAnzCards;

            this.ownAbilityReady = Hrtprozis.Instance.ownAbilityisReady;
            this.ownHeroAblility = new Handmanager.Handcard(Hrtprozis.Instance.heroAbility);
            this.enemyHeroAblility = new Handmanager.Handcard(Hrtprozis.Instance.enemyAbility);
            this.enemyAbilityReady = false;


            this.mobsplayedThisTurn = Hrtprozis.Instance.numMinionsPlayedThisTurn;
            this.cardsPlayedThisTurn = Hrtprozis.Instance.cardsPlayedThisTurn;
            //todo:
            this.optionsPlayedThisTurn = Hrtprozis.Instance.numOptionsPlayedThisTurn;

            this.owedRecall = Hrtprozis.Instance.owedRecall;
            this.currentRecall = Hrtprozis.Instance.ownCurrentRecall;
            this.enemyRecall = Hrtprozis.Instance.enemyRecall;
            this.enemyCurrentRecall = 0;

            this.ownHeroFatigue = Hrtprozis.Instance.ownHeroFatigue;
            this.enemyHeroFatigue = Hrtprozis.Instance.enemyHeroFatigue;
            this.ownDeckSize = Hrtprozis.Instance.ownDeckSize;
            this.enemyDeckSize = Hrtprozis.Instance.enemyDeckSize;


            

            this.winzigebeschwoererin = 0;
            this.managespenst = 0;
            this.soeldnerDerVenture = 0;
            this.beschwoerungsportal = 0;
            this.nerubarweblord = 0;

            this.ownBaronRivendare = 0;
            this.enemyBaronRivendare = 0;

            needGraveyard = false;

            

            this.spellpower = 0;
            this.enemyspellpower = 0;

            int i = -1;
            int anz = this.ownMinions.Count;
            foreach (Minion m in this.ownMinions)
            {
                i++;
                if (m.playedThisTurn && m.name == CardDB.cardName.loatheb) this.ownloatheb ++;

                spellpower = spellpower + m.spellpower;
                if (m.silenced) continue;
                spellpower += m.handcard.card.spellpowervalue;
                if (m.name == CardDB.cardName.prophetvelen) this.doublepriest++;

                if (m.name == CardDB.cardName.weespellstopper)
                {
                    if (i > 0) this.ownMinions[i - 1].cantBeTargetedBySpellsOrHeroPowers = true;
                    if (i < anz - 1) this.ownMinions[i + 1].cantBeTargetedBySpellsOrHeroPowers = true;
                }
                if (m.name == CardDB.cardName.faeriedragon || m.name == CardDB.cardName.laughingsister || m.name == CardDB.cardName.spectralknight || m.name == CardDB.cardName.arcanenullifierx21) m.cantBeTargetedBySpellsOrHeroPowers = true;

                if (m.name == CardDB.cardName.pintsizedsummoner)
                {
                    this.winzigebeschwoererin++;
                }

                if (m.name == CardDB.cardName.manawraith)
                {
                    this.managespenst++;
                }
                if (m.name == CardDB.cardName.nerubarweblord)
                {
                    this.nerubarweblord++;
                }
                if (m.name == CardDB.cardName.venturecomercenary)
                {
                    this.soeldnerDerVenture++;
                }
                if (m.name == CardDB.cardName.summoningportal)
                {
                    this.beschwoerungsportal++;
                }

                if (m.handcard.card.name == CardDB.cardName.baronrivendare)
                {
                    this.ownBaronRivendare++;
                }
                if (m.handcard.card.name == CardDB.cardName.kelthuzad)
                {
                    this.needGraveyard = true;
                }

                if (m.name == CardDB.cardName.raidleader) this.anzOwnRaidleader++;
                if (m.name == CardDB.cardName.malganis) this.anzOwnMalGanis++;
                if (m.name == CardDB.cardName.stormwindchampion) this.anzOwnStormwindChamps++;
                if (m.name == CardDB.cardName.tundrarhino) this.anzOwnTundrarhino++;
                if (m.name == CardDB.cardName.timberwolf) this.anzOwnTimberWolfs++;
                if (m.name == CardDB.cardName.murlocwarleader) this.anzMurlocWarleader++;
                if (m.name == CardDB.cardName.grimscaleoracle) this.anzGrimscaleOracle++;
                if (m.name == CardDB.cardName.auchenaisoulpriest) this.anzOwnAuchenaiSoulpriest++;
                if (m.name == CardDB.cardName.sorcerersapprentice)
                {
                    this.anzOwnsorcerersapprentice++;
                    this.anzOwnsorcerersapprenticeStarted++;
                }
                if (m.name == CardDB.cardName.southseacaptain) this.anzOwnSouthseacaptain++;
                if (m.name == CardDB.cardName.mechwarper)
                {
                    this.anzOwnMechwarper++;
                    this.anzOwnMechwarperStarted++;
                }
                if (m.name == CardDB.cardName.steamwheedlesniper && this.ownHeroName == HeroEnum.hunter)
                {
                    this.weHaveSteamwheedleSniper = true;
                }

            }

            foreach (Handmanager.Handcard hc in this.owncards)
            {

                if (hc.card.name == CardDB.cardName.kelthuzad)
                {
                    this.needGraveyard = true;
                }
            }

            i = - 1;
            anz = this.enemyMinions.Count;
            foreach (Minion m in this.enemyMinions)
            {
                i++;
                this.enemyspellpower = this.enemyspellpower + m.spellpower;
                enemyspellpower += m.handcard.card.spellpowervalue;
                
                if (m.silenced) continue;

                if (m.name == CardDB.cardName.weespellstopper)
                {
                    if (i > 0) this.enemyMinions[i - 1].cantBeTargetedBySpellsOrHeroPowers = true;
                    if (i < anz - 1) this.enemyMinions[i + 1].cantBeTargetedBySpellsOrHeroPowers = true;
                }
                if (m.name == CardDB.cardName.faeriedragon || m.name == CardDB.cardName.laughingsister || m.name == CardDB.cardName.spectralknight || m.name == CardDB.cardName.arcanenullifierx21) m.cantBeTargetedBySpellsOrHeroPowers = true;

                if (m.name == CardDB.cardName.prophetvelen) this.enemydoublepriest++;
                if (m.name == CardDB.cardName.manawraith)
                {
                    this.managespenst++;
                }
                if (m.name == CardDB.cardName.nerubarweblord)
                {
                    this.nerubarweblord++;
                }
                if (m.handcard.card.name == CardDB.cardName.baronrivendare)
                {
                    this.enemyBaronRivendare++;
                }
                if (m.handcard.card.name == CardDB.cardName.kelthuzad)
                {
                    this.needGraveyard = true;
                }

                if (m.name == CardDB.cardName.raidleader) this.anzEnemyRaidleader++;
                if (m.name == CardDB.cardName.malganis) this.anzEnemyMalGanis++;
                if (m.name == CardDB.cardName.stormwindchampion) this.anzEnemyStormwindChamps++;
                if (m.name == CardDB.cardName.tundrarhino) this.anzEnemyTundrarhino++;
                if (m.name == CardDB.cardName.timberwolf) this.anzEnemyTimberWolfs++;
                if (m.name == CardDB.cardName.murlocwarleader) this.anzMurlocWarleader++;
                if (m.name == CardDB.cardName.grimscaleoracle) this.anzGrimscaleOracle++;
                if (m.name == CardDB.cardName.auchenaisoulpriest) this.anzEnemyAuchenaiSoulpriest++;
                if (m.name == CardDB.cardName.sorcerersapprentice)
                {
                    this.anzEnemysorcerersapprentice++;
                    this.anzEnemysorcerersapprenticeStarted++;
                }
                if (m.name == CardDB.cardName.southseacaptain) this.anzEnemySouthseacaptain++;
                if (m.name == CardDB.cardName.mechwarper)
                {
                    this.anzEnemyMechwarper++;
                    this.anzEnemyMechwarperStarted++;
                }
                if (m.name == CardDB.cardName.steamwheedlesniper && this.enemyHeroName == HeroEnum.hunter)
                {
                    this.enemyHaveSteamwheedleSniper = true;
                }
            }
            if (this.enemySecretCount >= 1) this.needGraveyard = true;
            if (this.needGraveyard) this.diedMinions = new List<GraveYardItem>(Probabilitymaker.Instance.turngraveyard);
            this.anzMinionsDiedThisTurn = Hrtprozis.Instance.numberMinionsDiedThisTurn;

            this.tempanzOwnCards = this.owncards.Count;
            this.tempanzEnemyCards = this.enemyAnzCards;

            //calculate the "real"-manacosts of a card
            foreach (Handmanager.Handcard hm in this.owncards)
            {
                hm.manacost = hm.card.getStartManaCosts(this, hm.manacost);
            }


        }
Example #26
0
        private void doBattleCryWithoutTargeting(Minion c, int position, bool own, int choice)
        {
            //only nontargetable battlecrys!

            //druid choices

            //urtum des krieges:
            if (c.name == CardDB.cardName.ancientofwar)
            {
                if (choice == 1)
                {
                    minionGetBuffed(c, 5, 0, true);
                }
                if (choice == 2)
                {
                    minionGetBuffed(c, 0, 5, true);
                    c.taunt = true;
                }
            }

            if (c.name == CardDB.cardName.ancientoflore)
            {
                if (choice == 1)
                {
                    //this.owncarddraw += 2;
                    this.drawACard(CardDB.cardName.unknown, own);
                    this.drawACard(CardDB.cardName.unknown, own);
                }

            }

            if (c.name == CardDB.cardName.druidoftheclaw)
            {
                if (choice == 1)
                {
                    minionGetCharge(c);
                }
                if (choice == 2)
                {
                    minionGetBuffed(c, 0, 2, true);
                    c.taunt = true;
                }
            }

            if (c.name == CardDB.cardName.cenarius)
            {
                if (choice == 1)
                {
                    foreach (Minion m in this.ownMinions)
                    {
                        minionGetBuffed(m, 2, 2, true);
                    }
                }
                //choice 2 = spawn 2 kids
            }

            //normal ones

            if (c.name == CardDB.cardName.mindcontroltech)
            {
                if (this.enemyMinions.Count >= 4)
                {
                    List<Minion> temp = new List<Minion>();

                    List<Minion> temp2 = new List<Minion>(this.enemyMinions);
                    temp2.Sort((a, b) => a.Angr.CompareTo(b.Angr));//we take the weekest

                    temp.AddRange(Helpfunctions.TakeList(temp2, 2));
                    Minion target = new Minion();
                    target = temp[0];
                    if (target.taunt && !temp[1].taunt) target = temp[1];
                    minionGetControlled(target, true, false);

                }
            }

            if (c.name == CardDB.cardName.felguard)
            {
                this.ownMaxMana--;
            }
            if (c.name == CardDB.cardName.arcanegolem)
            {
                this.enemyMaxMana++;
            }

            if (c.name == CardDB.cardName.edwinvancleef && this.cardsPlayedThisTurn >= 1)
            {
                minionGetBuffed(c, this.cardsPlayedThisTurn * 2, this.cardsPlayedThisTurn * 2, own);
            }

            if (c.name == CardDB.cardName.doomguard)
            {
                this.owncarddraw -= Math.Min(2, this.owncards.Count);
                this.owncards.RemoveRange(0, Math.Min(2, this.owncards.Count));
            }

            if (c.name == CardDB.cardName.succubus)
            {
                this.owncarddraw -= Math.Min(1, this.owncards.Count);
                this.owncards.RemoveRange(0, Math.Min(1, this.owncards.Count));
            }

            if (c.name == CardDB.cardName.lordjaraxxus)
            {
                this.ownHeroAblility = CardDB.Instance.getCardDataFromID(CardDB.cardIDEnum.EX1_tk33);
                this.ownHeroName = HeroEnum.lordjaraxxus;
                this.ownHeroHp = c.Hp;
            }

            if (c.name == CardDB.cardName.flameimp)
            {
                attackOrHealHero(3, own);
            }

            if (c.name == CardDB.cardName.pitlord)
            {
                attackOrHealHero(5, own);
            }

            if (c.name == CardDB.cardName.voidterror)
            {
                List<Minion> temp;
                if (own)
                {
                    temp = this.ownMinions;
                }
                else
                {
                    temp = this.enemyMinions;
                }

                int angr = 0;
                int hp = 0;
                foreach (Minion m in temp)
                {
                    if (m.id == position || m.id == position - 1)
                    {
                        angr += m.Angr;
                        hp += m.Hp;
                    }
                }
                foreach (Minion m in temp.ToArray())
                {
                    if (m.id == position || m.id == position - 1)
                    {
                        minionGetDestroyed(m, own);
                    }
                }
                minionGetBuffed(c, angr, hp, own);

            }

            if (c.name == CardDB.cardName.frostwolfwarlord)
            {
                minionGetBuffed(c, this.ownMinions.Count, this.ownMinions.Count, own);
            }
            if (c.name == CardDB.cardName.bloodsailraider)
            {
                c.Angr += this.ownWeaponAttack;
            }

            if (c.name == CardDB.cardName.southseadeckhand && this.ownWeaponDurability >= 1)
            {
                minionGetCharge(c);
            }



            if (c.name == CardDB.cardName.bloodknight)
            {
                int shilds = 0;
                foreach (Minion m in this.ownMinions)
                {
                    if (m.divineshild)
                    {
                        m.divineshild = false;
                        shilds++;
                    }
                }
                foreach (Minion m in this.enemyMinions)
                {
                    if (m.divineshild)
                    {
                        m.divineshild = false;
                        shilds++;
                    }
                }
                minionGetBuffed(c, 3 * shilds, 3 * shilds, own);

            }

            if (c.name == CardDB.cardName.kingmukla)
            {
                //this.enemycarddraw += 2; //ai will not use it :D
            }

            if (c.name == CardDB.cardName.coldlightoracle)
            {
                //this.enemycarddraw += 2;
                //this.owncarddraw += 2;
                this.drawACard(CardDB.cardName.unknown, true);
                this.drawACard(CardDB.cardName.unknown, true);
                this.drawACard(CardDB.cardName.unknown, false);
                this.drawACard(CardDB.cardName.unknown, false);
            }

            if (c.name == CardDB.cardName.arathiweaponsmith)
            {
                CardDB.Card wcard = CardDB.Instance.getCardDataFromID(CardDB.cardIDEnum.EX1_398t);//battleaxe
                this.equipWeapon(wcard);


            }
            if (c.name == CardDB.cardName.bloodsailcorsair)
            {
                this.lowerWeaponDurability(1, false);
            }

            if (c.name == CardDB.cardName.acidicswampooze)
            {
                this.lowerWeaponDurability(1000, false);
            }
            if (c.name == CardDB.cardName.noviceengineer)
            {
                //this.owncarddraw++;
                drawACard(CardDB.cardName.unknown, true);
            }
            if (c.name == CardDB.cardName.gnomishinventor)
            {
                //this.owncarddraw++;
                drawACard(CardDB.cardName.unknown, true);
            }

            if (c.name == CardDB.cardName.darkscalehealer)
            {
                List<Minion> temp = new List<Minion>(this.ownMinions);
                foreach (Minion m in temp)
                {

                    if (this.auchenaiseelenpriesterin)
                    { minionGetDamagedOrHealed(m, 2, 0, true); }
                    else { minionGetDamagedOrHealed(m, 0, 2, true); }

                }
                if (this.auchenaiseelenpriesterin)
                { attackOrHealHero(2, true); }
                else { attackOrHealHero(-2, true); }

            }
            if (c.name == CardDB.cardName.nightblade)
            {
                attackOrHealHero(3, !own);
            }

            if (c.name == CardDB.cardName.twilightdrake)
            {
                minionGetBuffed(c, 0, this.owncards.Count, true);
            }

            if (c.name == CardDB.cardName.azuredrake)
            {
                //this.owncarddraw++;
                drawACard(CardDB.cardName.unknown, true);
            }

            if (c.name == CardDB.cardName.harrisonjones)
            {
                this.enemyWeaponAttack = 0;
                //this.owncarddraw += enemyWeaponDurability;
                for (int i = 0; i < enemyWeaponDurability; i++)
                {
                    drawACard(CardDB.cardName.unknown, true);
                }
                this.enemyWeaponDurability = 0;
            }

            if (c.name == CardDB.cardName.guardianofkings)
            {
                attackOrHealHero(-6, true);
            }

            if (c.name == CardDB.cardName.captaingreenskin)
            {
                if (this.ownWeaponName != CardDB.cardName.unknown)
                {
                    this.ownheroAngr += 1;
                    this.ownWeaponAttack++;
                    this.ownWeaponDurability++;
                }
            }

            if (c.name == CardDB.cardName.priestessofelune)
            {
                attackOrHealHero(-4, true);
            }
            if (c.name == CardDB.cardName.injuredblademaster)
            {
                minionGetDamagedOrHealed(c, 4, 0, true);
            }

            if (c.name == CardDB.cardName.dreadinfernal)
            {
                List<Minion> temp = this.ownMinions;
                foreach (Minion m in temp.ToArray())
                {
                    minionGetDamagedOrHealed(m, 1, 0, true);
                }
                temp = this.enemyMinions;
                foreach (Minion m in temp.ToArray())
                {
                    minionGetDamagedOrHealed(m, 1, 0, false);
                }
                attackOrHealHero(1, false);
                attackOrHealHero(1, true);
            }

            if (c.name == CardDB.cardName.madbomber)
            {

                for (int i = 0; i < 3; i++)
                {
                    if (this.ownHeroHp <= 3)
                    {
                        attackOrHealHero(1, true);
                        continue;
                    }
                    List<Minion> temp = new List<Minion>(this.enemyMinions);
                    if (temp.Count == 0)
                    {
                        temp.AddRange(this.ownMinions);
                    }
                    temp.Sort((a, b) => a.Hp.CompareTo(b.Hp));//destroys the weakest

                    foreach (Minion m in temp)
                    {
                        bool target = true;
                        if (m.id >= 10) target = false;
                        minionGetDamagedOrHealed(m, 1, 0, target);
                        break;
                    }
                    attackOrHealHero(1, false);
                }
            }

            if (c.name == CardDB.cardName.tinkmasteroverspark)
            {
                int oc = this.ownMinions.Count;
                int ec = this.enemyMinions.Count;
                if (oc == 0 && ec == 0) return;
                if (oc > ec)
                {
                    List<Minion> temp = new List<Minion>(this.ownMinions);
                    temp.AddRange(this.enemyMinions);
                    temp.Sort((a, b) => a.Hp.CompareTo(b.Hp));//transform the weakest
                    foreach (Minion m in temp)
                    {
                        minionTransform(m, CardDB.Instance.getCardDataFromID(CardDB.cardIDEnum.EX1_tk29), true);
                        break;
                    }
                }
                else
                {
                    List<Minion> temp = new List<Minion>(this.ownMinions);
                    temp.AddRange(this.enemyMinions);
                    temp.Sort((a, b) => -a.Hp.CompareTo(b.Hp));//transform the strongest
                    foreach (Minion m in temp)
                    {
                        minionTransform(m, CardDB.Instance.getCardDataFromID(CardDB.cardIDEnum.EX1_tk28), true);
                        break;
                    }
                }
            }

            if (c.name == CardDB.cardName.tundrarhino)
            {
                minionGetCharge(c);
                List<Minion> temp = this.ownMinions;
                foreach (Minion m in temp)
                {
                    if ((TAG_RACE)m.handcard.card.race == TAG_RACE.PET)
                    {
                        minionGetCharge(m);
                    }
                }
            }

            if (c.name == CardDB.cardName.stampedingkodo)
            {
                List<Minion> temp2 = new List<Minion>(this.enemyMinions);
                temp2.Sort((a, b) => a.Hp.CompareTo(b.Hp));//destroys the weakest
                foreach (Minion enemy in temp2)
                {
                    if (enemy.Angr <= 2)
                    {
                        minionGetDestroyed(enemy, false);
                        break;
                    }
                }
            }

            if (c.name == CardDB.cardName.sunfuryprotector)
            {
                List<Minion> temp = this.ownMinions;
                foreach (Minion m in temp)
                {
                    if (m.id == position - 1 || m.id == position)
                    {
                        m.taunt = true;
                    }
                }
            }

            if (c.name == CardDB.cardName.ancientmage)
            {
                List<Minion> temp = this.ownMinions;
                foreach (Minion m in temp)
                {
                    if (m.id == position - 1 || m.id == position)
                    {
                        m.handcard.card.spellpowervalue++;
                    }
                }
            }

            if (c.name == CardDB.cardName.defenderofargus)
            {
                List<Minion> temp = this.ownMinions;
                foreach (Minion m in temp.ToArray())
                {
                    if (m.id == position - 1 || m.id == position)//position and position -1 because its not placed jet
                    {
                        Enchantment e = CardDB.getEnchantmentFromCardID(CardDB.cardIDEnum.EX1_093e);
                        e.creator = c.entitiyID;
                        e.controllerOfCreator = this.ownController;
                        addEffectToMinionNoDoubles(m, e, own);
                    }
                }
            }

            if (c.name == CardDB.cardName.coldlightseer)
            {
                List<Minion> temp = this.ownMinions;
                foreach (Minion m in temp.ToArray())
                {
                    if ((TAG_RACE)m.handcard.card.race == TAG_RACE.MURLOC)
                    {
                        minionGetBuffed(m, 0, 2, true);
                    }
                }
                temp = this.enemyMinions;
                foreach (Minion m in temp.ToArray())
                {
                    if ((TAG_RACE)m.handcard.card.race == TAG_RACE.MURLOC)
                    {
                        minionGetBuffed(m, 0, 2, false);
                    }
                }
            }

            if (c.name == CardDB.cardName.deathwing)
            {
                this.owncards.Clear();
                this.owncarddraw = 0;
                this.enemyAnzCards = 0;
                this.enemycarddraw = 0;
                List<Minion> temp = this.ownMinions;
                foreach (Minion enemy in temp.ToArray())
                {
                    minionGetDestroyed(enemy, true);
                }
                temp = this.enemyMinions;
                foreach (Minion enemy in temp.ToArray())
                {
                    minionGetDestroyed(enemy, false);
                }
                

            }

            if (c.name == CardDB.cardName.captainsparrot)
            {
                //this.owncarddraw++;
                drawACard(CardDB.cardName.unknown, true);

            }
            if (c.name == CardDB.cardName.wailingsoul)
            {
                //this.owncarddraw++;
                List<Minion> temp = new List<Minion>(this.ownMinions);
                foreach (Minion m in temp)
                {
                    minionGetSilenced(m, true);
                }

            }

            if (c.name == CardDB.cardName.prophetvelen) this.doublepriest++;
            if (c.name == CardDB.cardName.auchenaisoulpriest) this.auchenaiseelenpriesterin = true;
            if (c.name == CardDB.cardName.pintsizedsummoner) this.winzigebeschwoererin++;
            if (c.name == CardDB.cardName.sorcerersapprentice) this.zauberlehrling++;
            if (c.name == CardDB.cardName.manawraith) this.managespenst++;
            if (c.name == CardDB.cardName.venturecomercenary) this.soeldnerDerVenture++;
            if (c.name == CardDB.cardName.summoningportal) this.beschwoerungsportal++;
            if (c.name == CardDB.cardName.baronrivendare) this.ownBaronRivendare = true;
            if (c.name == CardDB.cardName.nerubarweblord) this.nerubarweblord++;
            if (c.name == CardDB.cardName.loatheb) this.loatheb = true;


        }
Example #27
0
        public Player(Player p) {

            //this.isOwnTurn = p.isOwnTurn;

            this.attacked = p.attacked;
            this.sEnemTurn = p.sEnemTurn;
            this.ownController = p.ownController;
            //this.ownHeroEntity = p.ownHeroEntity;
            //this.enemyHeroEntity = p.enemyHeroEntity;

            this.evaluatePenality = p.evaluatePenality;
            this.ownSecretsIDList.AddRange(p.ownSecretsIDList);

            this.mana = p.mana;
            this.manaTurnEnd = p.manaTurnEnd;
            this.ownMaxMana = p.ownMaxMana;
            addMinionsReal(p.ownMinions, ownMinions);
            this.ownHero = new Minion(p.ownHero);
            addCardsReal(p.owncards);

            this.ownHeroName = p.ownHeroName;

            this.playactions.AddRange(p.playactions);
            this.lastTurnActions.AddRange(p.lastTurnActions);

            this.attackFaceHP = p.attackFaceHP;

            this.owncarddraw = p.owncarddraw;

            this.ownWeaponDurability = p.ownWeaponDurability;
            this.ownWeaponAttack = p.ownWeaponAttack;
            this.ownWeaponName = p.ownWeaponName;

            this.lostDamage = p.lostDamage;
            this.lostWeaponDamage = p.lostWeaponDamage;
            this.lostHeal = p.lostHeal;

            this.ownAbilityReady = p.ownAbilityReady;
            this.ownHeroAblility = new Handmanager.Handcard(p.ownHeroAblility);

            this.spellpower = 0;
            this.mobsplayedThisTurn = p.mobsplayedThisTurn;
            this.startedWithMobsPlayedThisTurn = p.startedWithMobsPlayedThisTurn;
            this.optionsPlayedThisTurn = p.optionsPlayedThisTurn;
            this.cardsPlayedThisTurn = p.cardsPlayedThisTurn;
            this.ueberladung = p.ueberladung;

            this.ownDeckSize = p.ownDeckSize;
            this.ownHeroFatigue = p.ownHeroFatigue;

            //need the following for manacost-calculation
            this.ownHeroHpStarted = p.ownHeroHpStarted;
            this.ownWeaponAttackStarted = p.ownWeaponAttackStarted;
            this.ownCardsCountStarted = p.ownCardsCountStarted;
            this.ownMobsCountStarted = p.ownMobsCountStarted;

            //this.startedWithWinzigebeschwoererin = p.startedWithWinzigebeschwoererin;
            this.playedmagierinderkirintor = p.playedmagierinderkirintor;

            //this.startedWithWinzigebeschwoererin = p.startedWithWinzigebeschwoererin;
            //this.startedWithManagespenst = p.startedWithManagespenst;
            //this.startedWithsoeldnerDerVenture = p.startedWithsoeldnerDerVenture;
            //this.startedWithbeschwoerungsportal = p.startedWithbeschwoerungsportal;
            //this.startedWithnerubarweblord = p.startedWithnerubarweblord;

            //this.startedWithDamagedMinions = p.startedWithDamagedMinions;

            this.nerubarweblord = p.nerubarweblord;
            this.winzigebeschwoererin = p.winzigebeschwoererin;
            this.managespenst = p.managespenst;
            this.soeldnerDerVenture = p.soeldnerDerVenture;
            //this.loatheb = p.loatheb;

            this.spellpower = p.spellpower;

            this.ownLastDiedMinion = p.ownLastDiedMinion;

            //####buffs#############################

            this.anzOwnRaidleader = p.anzOwnRaidleader;
            this.anzOwnMalGanis = p.anzOwnMalGanis;
            this.anzOwnStormwindChamps = p.anzOwnStormwindChamps;
            this.anzOwnTundrarhino = p.anzOwnTundrarhino;
            this.anzOwnTimberWolfs = p.anzOwnTimberWolfs;
            this.anzMurlocWarleader = p.anzMurlocWarleader;
            this.anzGrimscaleOracle = p.anzGrimscaleOracle;
            this.anzOwnAuchenaiSoulpriest = p.anzOwnAuchenaiSoulpriest;
            this.anzOwnsorcerersapprentice = p.anzOwnsorcerersapprentice;
            //this.anzOwnsorcerersapprenticeStarted = p.anzOwnsorcerersapprenticeStarted;
            this.anzOwnSouthseacaptain = p.anzOwnSouthseacaptain;
            this.anzOwnMechwarper = p.anzOwnMechwarper;
            //this.anzOwnMechwarperStarted = p.anzOwnMechwarperStarted;
            this.anzOwnChromaggus = p.anzOwnChromaggus;
            this.anzOwnDragonConsort = p.anzOwnDragonConsort;
            //this.anzOwnDragonConsortStarted = p.anzOwnDragonConsortStarted;

            //implementation of loatheb
            this.enemyLoatheb = p.enemyLoatheb;
            this.enemyMillhouse = p.enemyMillhouse; 
            //end

            this.ownMinionsDiedTurn = p.ownMinionsDiedTurn;

            //this.feugenDead = p.feugenDead;
            //this.stalaggDead = p.stalaggDead;

            this.doublepriest = p.doublepriest;

            this.ownBaronRivendare = p.ownBaronRivendare;

            this.weHaveSteamwheedleSniper = p.weHaveSteamwheedleSniper;
            //#########################################

            this.tempanzOwnCards = this.owncards.Count;

        }
Example #28
0
        public Playfield(Playfield p)
        {

            this.nextEntity = p.nextEntity;

            this.isOwnTurn = p.isOwnTurn;
            this.turnCounter = p.turnCounter;

            this.attacked = p.attacked;
            this.sEnemTurn = p.sEnemTurn;
            this.ownController = p.ownController;
            this.ownHeroEntity = p.ownHeroEntity;
            this.enemyHeroEntity = p.enemyHeroEntity;

            this.evaluatePenality = p.evaluatePenality;
            this.ownSecretsIDList.AddRange(p.ownSecretsIDList);

            this.enemySecretCount = p.enemySecretCount;
            this.mana = p.mana;
            this.ownMaxMana = p.ownMaxMana;
            this.enemyMaxMana = p.enemyMaxMana;
            addMinionsReal(p.ownMinions, ownMinions);
            addMinionsReal(p.enemyMinions, enemyMinions);
            this.ownHero = new Minion(p.ownHero);
            this.enemyHero = new Minion(p.enemyHero);
            addCardsReal(p.owncards);

            this.ownHeroName = p.ownHeroName;
            this.enemyHeroName = p.enemyHeroName;

            this.playactions.AddRange(p.playactions);
            this.complete = false;

            this.attackFaceHP = p.attackFaceHP;

            this.owncarddraw = p.owncarddraw;

            this.enemyWeaponAttack = p.enemyWeaponAttack;
            this.enemyWeaponDurability = p.enemyWeaponDurability;
            this.enemyWeaponName = p.enemyWeaponName;
            this.enemycarddraw = p.enemycarddraw;
            this.enemyAnzCards = p.enemyAnzCards;

            this.ownWeaponDurability = p.ownWeaponDurability;
            this.ownWeaponAttack = p.ownWeaponAttack;
            this.ownWeaponName = p.ownWeaponName;

            this.lostDamage = p.lostDamage;
            this.lostWeaponDamage = p.lostWeaponDamage;
            this.lostHeal = p.lostHeal;

            this.ownAbilityReady = p.ownAbilityReady;
            this.enemyAbilityReady = p.enemyAbilityReady;
            this.ownHeroAblility = new Handmanager.Handcard(p.ownHeroAblility);
            this.enemyHeroAblility = new Handmanager.Handcard(p.enemyHeroAblility);

            this.spellpower = 0;
            this.mobsplayedThisTurn = p.mobsplayedThisTurn;
            this.startedWithMobsPlayedThisTurn = p.startedWithMobsPlayedThisTurn;
            this.optionsPlayedThisTurn = p.optionsPlayedThisTurn;
            this.cardsPlayedThisTurn = p.cardsPlayedThisTurn;
            this.ueberladung = p.ueberladung;

            this.ownDeckSize = p.ownDeckSize;
            this.enemyDeckSize = p.enemyDeckSize;
            this.ownHeroFatigue = p.ownHeroFatigue;
            this.enemyHeroFatigue = p.enemyHeroFatigue;

            //need the following for manacost-calculation
            this.ownHeroHpStarted = p.ownHeroHpStarted;
            this.ownWeaponAttackStarted = p.ownWeaponAttackStarted;
            this.ownCardsCountStarted = p.ownCardsCountStarted;
            this.ownMobsCountStarted = p.ownMobsCountStarted;

            this.startedWithWinzigebeschwoererin = p.startedWithWinzigebeschwoererin;
            this.playedmagierinderkirintor = p.playedmagierinderkirintor;

            this.startedWithWinzigebeschwoererin = p.startedWithWinzigebeschwoererin;
            this.startedWithManagespenst = p.startedWithManagespenst;
            this.startedWithsoeldnerDerVenture = p.startedWithsoeldnerDerVenture;
            this.startedWithbeschwoerungsportal = p.startedWithbeschwoerungsportal;
            this.startedWithnerubarweblord = p.startedWithnerubarweblord;

            this.nerubarweblord = p.nerubarweblord;
            this.winzigebeschwoererin = p.winzigebeschwoererin;
            this.managespenst = p.managespenst;
            this.soeldnerDerVenture = p.soeldnerDerVenture;
            this.loatheb = p.loatheb;

            this.spellpower = p.spellpower;
            this.enemyspellpower = p.enemyspellpower;

            this.hasorcanplayKelThuzad = p.hasorcanplayKelThuzad;
            if (p.hasorcanplayKelThuzad) this.diedMinions = new List<GraveYardItem>(p.diedMinions);

            //####buffs#############################

            this.anzOwnRaidleader = p.anzOwnRaidleader;
            this.anzEnemyRaidleader = p.anzEnemyRaidleader;
            this.anzOwnStormwindChamps = p.anzOwnStormwindChamps;
            this.anzEnemyStormwindChamps = p.anzEnemyStormwindChamps;
            this.anzOwnTundrarhino = p.anzOwnTundrarhino;
            this.anzEnemyTundrarhino = p.anzEnemyTundrarhino;
            this.anzOwnTimberWolfs = p.anzOwnTimberWolfs;
            this.anzEnemyTimberWolfs = p.anzEnemyTimberWolfs;
            this.anzMurlocWarleader = p.anzMurlocWarleader;
            this.anzGrimscaleOracle = p.anzGrimscaleOracle;
            this.anzOwnAuchenaiSoulpriest = p.anzOwnAuchenaiSoulpriest;
            this.anzEnemyAuchenaiSoulpriest = p.anzEnemyAuchenaiSoulpriest;
            this.anzOwnsorcerersapprentice = p.anzOwnsorcerersapprentice;
            this.anzOwnsorcerersapprenticeStarted = p.anzOwnsorcerersapprenticeStarted;
            this.anzEnemysorcerersapprentice = p.anzEnemysorcerersapprentice;
            this.anzEnemysorcerersapprenticeStarted = p.anzEnemysorcerersapprenticeStarted;
            this.anzOwnSouthseacaptain = p.anzOwnSouthseacaptain;
            this.anzEnemySouthseacaptain = p.anzEnemySouthseacaptain;

            this.feugenDead = p.feugenDead;
            this.stalaggDead = p.stalaggDead;

            this.weHavePlayedMillhouseManastorm = p.weHavePlayedMillhouseManastorm;

            this.doublepriest = p.doublepriest;
            this.enemydoublepriest = p.enemydoublepriest;

            this.ownBaronRivendare = p.ownBaronRivendare;
            this.enemyBaronRivendare = p.enemyBaronRivendare;
            //#########################################

        }
Example #29
0
        public bool shouldConcede(HeroEnum ownhero, HeroEnum enemHero)
        {

            foreach (concedeItem ci in concedelist)
            {
                if (ci.urhero == ownhero && ci.enemhero.Contains(enemHero)) return true;
            }

            return false;
        }
Example #30
0
 public void clearAll()
 {
     ownHeroEntity = -1;
     enemyHeroEntitiy = -1;
     currentMana = 0;
     heroHp = 30;
     enemyHp = 30;
     heroAtk = 0;
     enemyAtk = 0;
     heroDefence = 0; enemyDefence = 0;
     ownheroisread = false;
     ownAbilityisReady = false;
     ownHeroNumAttacksThisTurn = 0;
     ownHeroWindfury = false;
     ownSecretList.Clear();
     enemySecretCount = 0;
     heroname = HeroEnum.druid;
     enemyHeroname = HeroEnum.druid;
     heroAbility = new CardDB.Card();
     enemyAbility = new CardDB.Card();
     herofrozen = false;
     enemyfrozen = false;
     numMinionsPlayedThisTurn = 0;
     cardsPlayedThisTurn = 0;
     ueberladung = 0;
     ownMaxMana = 0;
     enemyMaxMana = 0;
     enemyWeaponDurability = 0;
     enemyWeaponAttack = 0;
     heroWeaponDurability = 0;
     heroWeaponAttack = 0;
     heroImmuneToDamageWhileAttacking = false;
     ownMinions.Clear();
     enemyMinions.Clear();
     heroImmune = false;
     enemyHeroImmune = false;
     this.ownHeroWeapon = CardDB.cardName.unknown;
     this.enemyHeroWeapon = CardDB.cardName.unknown;
 }
Example #31
0
        public SecretItem getNewSecretGuessedItem(int entityid, HeroEnum enemyHeroName)
        {
            foreach (SecretItem si in this.enemySecrets)
            {
                if (si.entityId == entityid && entityid < 1000)
                {
                    return(si);
                }
            }

            SecretItem sec = new SecretItem {
                entityId = entityid
            };

            if (enemyHeroName == HeroEnum.hunter)
            {
                sec.canBe_counterspell = false;
                sec.canBe_icebarrier   = false;
                sec.canBe_iceblock     = false;
                sec.canBe_mirrorentity = false;
                sec.canBe_spellbender  = false;
                sec.canBe_vaporize     = false;
                sec.canBe_duplicate    = false;

                sec.canBe_eyeforaneye    = false;
                sec.canBe_noblesacrifice = false;
                sec.canBe_redemption     = false;
                sec.canBe_repentance     = false;
                sec.canBe_avenge         = false;

                sec.canBe_competivespirit = false;
                sec.canBe_effigy          = false;

                sec.canBe_Trial = false;



                if (enemyCardsPlayed.ContainsKey(CardDB.cardIDEnum.EX1_554) && enemyCardsPlayed[CardDB.cardIDEnum.EX1_554] >= 2)
                {
                    sec.canBe_snaketrap = false;
                }

                if (enemyCardsPlayed.ContainsKey(CardDB.cardIDEnum.EX1_609) && enemyCardsPlayed[CardDB.cardIDEnum.EX1_609] >= 2)
                {
                    sec.canBe_snipe = false;
                }

                if (enemyCardsPlayed.ContainsKey(CardDB.cardIDEnum.EX1_610) && enemyCardsPlayed[CardDB.cardIDEnum.EX1_610] >= 2)
                {
                    sec.canBe_explosive = false;
                }

                if (enemyCardsPlayed.ContainsKey(CardDB.cardIDEnum.EX1_611) && enemyCardsPlayed[CardDB.cardIDEnum.EX1_611] >= 2)
                {
                    sec.canBe_freezing = false;
                }

                if (enemyCardsPlayed.ContainsKey(CardDB.cardIDEnum.EX1_533) && enemyCardsPlayed[CardDB.cardIDEnum.EX1_533] >= 2)
                {
                    sec.canBe_missdirection = false;
                }

                if (enemyCardsPlayed.ContainsKey(CardDB.cardIDEnum.AT_060) && enemyCardsPlayed[CardDB.cardIDEnum.AT_060] >= 2)
                {
                    sec.canBe_beartrap = false;
                }

                if (enemyCardsPlayed.ContainsKey(CardDB.cardIDEnum.LOE_021) && enemyCardsPlayed[CardDB.cardIDEnum.LOE_021] >= 2)
                {
                    sec.canBe_Dart = false;
                }
            }

            if (enemyHeroName == HeroEnum.mage)
            {
                sec.canBe_snaketrap     = false;
                sec.canBe_snipe         = false;
                sec.canBe_explosive     = false;
                sec.canBe_freezing      = false;
                sec.canBe_missdirection = false;

                sec.canBe_eyeforaneye    = false;
                sec.canBe_noblesacrifice = false;
                sec.canBe_redemption     = false;
                sec.canBe_repentance     = false;
                sec.canBe_avenge         = false;

                sec.canBe_competivespirit = false;
                sec.canBe_beartrap        = false;

                sec.canBe_Trial = false;
                sec.canBe_Dart  = false;

                if (enemyCardsPlayed.ContainsKey(CardDB.cardIDEnum.EX1_287) && enemyCardsPlayed[CardDB.cardIDEnum.EX1_287] >= 2)
                {
                    sec.canBe_counterspell = false;
                }

                if (enemyCardsPlayed.ContainsKey(CardDB.cardIDEnum.EX1_289) && enemyCardsPlayed[CardDB.cardIDEnum.EX1_289] >= 2)
                {
                    sec.canBe_icebarrier = false;
                }

                if (enemyCardsPlayed.ContainsKey(CardDB.cardIDEnum.EX1_295) && enemyCardsPlayed[CardDB.cardIDEnum.EX1_295] >= 2)
                {
                    sec.canBe_iceblock = false;
                }

                if (enemyCardsPlayed.ContainsKey(CardDB.cardIDEnum.EX1_294) && enemyCardsPlayed[CardDB.cardIDEnum.EX1_294] >= 2)
                {
                    sec.canBe_mirrorentity = false;
                }

                if (enemyCardsPlayed.ContainsKey(CardDB.cardIDEnum.tt_010) && enemyCardsPlayed[CardDB.cardIDEnum.tt_010] >= 2)
                {
                    sec.canBe_spellbender = false;
                }

                if (enemyCardsPlayed.ContainsKey(CardDB.cardIDEnum.EX1_594) && enemyCardsPlayed[CardDB.cardIDEnum.EX1_594] >= 2)
                {
                    sec.canBe_vaporize = false;
                }

                if (enemyCardsPlayed.ContainsKey(CardDB.cardIDEnum.FP1_018) && enemyCardsPlayed[CardDB.cardIDEnum.FP1_018] >= 2)
                {
                    sec.canBe_duplicate = false;
                }

                if (enemyCardsPlayed.ContainsKey(CardDB.cardIDEnum.AT_002) && enemyCardsPlayed[CardDB.cardIDEnum.AT_002] >= 2)
                {
                    sec.canBe_effigy = false;
                }
            }

            if (enemyHeroName == HeroEnum.pala)
            {
                sec.canBe_snaketrap     = false;
                sec.canBe_snipe         = false;
                sec.canBe_explosive     = false;
                sec.canBe_freezing      = false;
                sec.canBe_missdirection = false;

                sec.canBe_counterspell = false;
                sec.canBe_icebarrier   = false;
                sec.canBe_iceblock     = false;
                sec.canBe_mirrorentity = false;
                sec.canBe_spellbender  = false;
                sec.canBe_vaporize     = false;
                sec.canBe_duplicate    = false;

                sec.canBe_effigy   = false;
                sec.canBe_beartrap = false;
                sec.canBe_Dart     = false;



                if (enemyCardsPlayed.ContainsKey(CardDB.cardIDEnum.EX1_132) && enemyCardsPlayed[CardDB.cardIDEnum.EX1_132] >= 2)
                {
                    sec.canBe_eyeforaneye = false;
                }

                if (enemyCardsPlayed.ContainsKey(CardDB.cardIDEnum.EX1_130) && enemyCardsPlayed[CardDB.cardIDEnum.EX1_130] >= 2)
                {
                    sec.canBe_noblesacrifice = false;
                }

                if (enemyCardsPlayed.ContainsKey(CardDB.cardIDEnum.EX1_136) && enemyCardsPlayed[CardDB.cardIDEnum.EX1_136] >= 2)
                {
                    sec.canBe_redemption = false;
                }

                if (enemyCardsPlayed.ContainsKey(CardDB.cardIDEnum.EX1_379) && enemyCardsPlayed[CardDB.cardIDEnum.EX1_379] >= 2)
                {
                    sec.canBe_repentance = false;
                }

                if (enemyCardsPlayed.ContainsKey(CardDB.cardIDEnum.FP1_020) && enemyCardsPlayed[CardDB.cardIDEnum.FP1_020] >= 2)
                {
                    sec.canBe_avenge = false;
                }

                if (enemyCardsPlayed.ContainsKey(CardDB.cardIDEnum.AT_073) && enemyCardsPlayed[CardDB.cardIDEnum.AT_073] >= 2)
                {
                    sec.canBe_competivespirit = false;
                }

                if (enemyCardsPlayed.ContainsKey(CardDB.cardIDEnum.LOE_027) && enemyCardsPlayed[CardDB.cardIDEnum.LOE_027] >= 2)
                {
                    sec.canBe_Trial = false;
                }
            }

            return(sec);
        }
Example #32
0
        public int EnemyCardPlaying(HeroEnum enemyHeroNamee, int currmana, int cardcount, int playAroundProb, int pap2)
        {
            int mana = currmana;
            if (cardcount == 0) return currmana;

            bool useAOE = false;
            int mobscount = 0;
            foreach (Minion min in this.ownMinions)
            {
                if (min.maxHp >= 2 && min.Angr >= 2) mobscount++;
            }

            if (mobscount >= 3) useAOE = true;

            if (enemyHeroNamee == HeroEnum.warrior)
            {
                bool usewhirlwind = true;
                foreach (Minion m in this.enemyMinions)
                {
                    if (m.Hp == 1) usewhirlwind = false;
                }
                if (this.ownMinions.Count <= 3) usewhirlwind = false;

                if (usewhirlwind)
                {
                    mana = EnemyPlaysACard(CardDB.cardName.whirlwind, mana, playAroundProb, pap2);
                }
            }

            if (!useAOE) return mana;

            if (enemyHeroNamee == HeroEnum.mage)
            {
                mana = EnemyPlaysACard(CardDB.cardName.flamestrike, mana, playAroundProb, pap2);
                mana = EnemyPlaysACard(CardDB.cardName.blizzard, mana, playAroundProb, pap2);
            }

            if (enemyHeroNamee == HeroEnum.hunter)
            {
                mana = EnemyPlaysACard(CardDB.cardName.unleashthehounds, mana, playAroundProb, pap2);
            }

            if (enemyHeroNamee == HeroEnum.priest)
            {
                mana = EnemyPlaysACard(CardDB.cardName.holynova, mana, playAroundProb, pap2);
            }

            if (enemyHeroNamee == HeroEnum.shaman)
            {
                mana = EnemyPlaysACard(CardDB.cardName.lightningstorm, mana, playAroundProb, pap2);
            }

            if (enemyHeroNamee == HeroEnum.pala)
            {
                mana = EnemyPlaysACard(CardDB.cardName.consecration, mana, playAroundProb, pap2);
            }

            if (enemyHeroNamee == HeroEnum.druid)
            {
                mana = EnemyPlaysACard(CardDB.cardName.swipe, mana, playAroundProb, pap2);
            }



            return mana;
        }
Example #33
0
        public void loadCards(string path)
        {
            try
            {
                this.settings = System.IO.File.ReadAllText(path + "simsettings.txt");
            }
            catch
            {
                this.settings = "control 5000 face 15 twoturnsim 1000 ntss 6 20 200 ets 40 ets2 200 ents 40 plcmnt";
            }

            string data = System.IO.File.ReadAllText(path + "deck.txt");
            int    i    = 0;

            foreach (String ss in data.Split(new string[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries))
            {
                String s = ss;
                if (s.Contains(" "))
                {
                    s = s.Split(' ')[0];
                }
                if (s.Contains("/"))
                {
                    s = s.Split('/')[0];
                }
                if (s.Contains(";"))
                {
                    s = s.Split(';')[0];
                }
                //Console.WriteLine("read: " + s);
                if (i == 0)
                {
                    //hero:

                    this.hero     = Hrtprozis.Instance.heroNametoEnum(s);
                    this.heroname = s;
                    Console.WriteLine("heroname: " + s);
                    CardDB.cardIDEnum arbilityenum = CardDB.cardIDEnum.CS2_102;
                    if (this.hero == HeroEnum.druid)
                    {
                        arbilityenum = CardDB.cardIDEnum.CS2_017;
                    }
                    if (this.hero == HeroEnum.hunter)
                    {
                        arbilityenum = CardDB.cardIDEnum.DS1h_292;
                    }
                    if (this.hero == HeroEnum.lordjaraxxus)
                    {
                        arbilityenum = CardDB.cardIDEnum.EX1_tk33;
                    }
                    if (this.hero == HeroEnum.mage)
                    {
                        arbilityenum = CardDB.cardIDEnum.CS2_034;
                    }
                    if (this.hero == HeroEnum.pala)
                    {
                        arbilityenum = CardDB.cardIDEnum.CS2_101;
                    }
                    if (this.hero == HeroEnum.priest)
                    {
                        arbilityenum = CardDB.cardIDEnum.CS1h_001;
                    }
                    if (this.hero == HeroEnum.ragnarosthefirelord)
                    {
                        arbilityenum = CardDB.cardIDEnum.BRM_027p;
                    }
                    if (this.hero == HeroEnum.shaman)
                    {
                        arbilityenum = CardDB.cardIDEnum.CS2_049;
                    }
                    if (this.hero == HeroEnum.thief)
                    {
                        arbilityenum = CardDB.cardIDEnum.CS2_083b;
                    }
                    if (this.hero == HeroEnum.warlock)
                    {
                        arbilityenum = CardDB.cardIDEnum.CS2_056;
                    }
                    if (this.hero == HeroEnum.warrior)
                    {
                        arbilityenum = CardDB.cardIDEnum.CS2_102;
                    }


                    this.heroAbility = CardDB.Instance.getCardDataFromID(arbilityenum);
                }
                else
                {
                    usedCards.Add(cdb.cardIdstringToEnum(s));
                }
                i++;
            }

            if (this.usedCards.Count != 30)
            {
                Console.WriteLine("ERROR, deck contains not 30 cards");
            }
            foreach (CardDB.cardIDEnum cie in usedCards)
            {
                //Console.WriteLine(cie.ToString() + "");
            }
        }
Example #34
0
        public SecretItem getNewSecretGuessedItem(int entityid, HeroEnum enemyHeroName)
        {
            foreach (SecretItem si in this.enemySecrets)
            {
                if (si.entityId == entityid && entityid < 1000) return si;
            }

            SecretItem sec = new SecretItem { entityId = entityid };
            if (enemyHeroName == HeroEnum.hunter)
            {

                sec.canBe_counterspell = false;
                sec.canBe_icebarrier = false;
                sec.canBe_iceblock = false;
                sec.canBe_mirrorentity = false;
                sec.canBe_spellbender = false;
                sec.canBe_vaporize = false;
                sec.canBe_duplicate = false;

                sec.canBe_eyeforaneye = false;
                sec.canBe_noblesacrifice = false;
                sec.canBe_redemption = false;
                sec.canBe_repentance = false;
                sec.canBe_avenge = false;

                if (enemyCardsPlayed.ContainsKey(CardDB.cardIDEnum.EX1_554) && enemyCardsPlayed[CardDB.cardIDEnum.EX1_554] >= 2)
                {
                    sec.canBe_snaketrap = false;
                }

                if (enemyCardsPlayed.ContainsKey(CardDB.cardIDEnum.EX1_609) && enemyCardsPlayed[CardDB.cardIDEnum.EX1_609] >= 2)
                {
                    sec.canBe_snipe = false;
                }

                if (enemyCardsPlayed.ContainsKey(CardDB.cardIDEnum.EX1_610) && enemyCardsPlayed[CardDB.cardIDEnum.EX1_610] >= 2)
                {
                    sec.canBe_explosive = false;
                }

                if (enemyCardsPlayed.ContainsKey(CardDB.cardIDEnum.EX1_611) && enemyCardsPlayed[CardDB.cardIDEnum.EX1_611] >= 2)
                {
                    sec.canBe_freezing = false;
                }

                if (enemyCardsPlayed.ContainsKey(CardDB.cardIDEnum.EX1_533) && enemyCardsPlayed[CardDB.cardIDEnum.EX1_533] >= 2)
                {
                    sec.canBe_missdirection = false;
                }
            }

            if (enemyHeroName == HeroEnum.mage)
            {
                sec.canBe_snaketrap = false;
                sec.canBe_snipe = false;
                sec.canBe_explosive = false;
                sec.canBe_freezing = false;
                sec.canBe_missdirection = false;

                sec.canBe_eyeforaneye = false;
                sec.canBe_noblesacrifice = false;
                sec.canBe_redemption = false;
                sec.canBe_repentance = false;
                sec.canBe_avenge = false;

                if (enemyCardsPlayed.ContainsKey(CardDB.cardIDEnum.EX1_287) && enemyCardsPlayed[CardDB.cardIDEnum.EX1_287] >= 2)
                {
                    sec.canBe_counterspell = false;
                }

                if (enemyCardsPlayed.ContainsKey(CardDB.cardIDEnum.EX1_289) && enemyCardsPlayed[CardDB.cardIDEnum.EX1_289] >= 2)
                {
                    sec.canBe_icebarrier = false;
                }

                if (enemyCardsPlayed.ContainsKey(CardDB.cardIDEnum.EX1_295) && enemyCardsPlayed[CardDB.cardIDEnum.EX1_295] >= 2)
                {
                    sec.canBe_iceblock = false;
                }

                if (enemyCardsPlayed.ContainsKey(CardDB.cardIDEnum.EX1_294) && enemyCardsPlayed[CardDB.cardIDEnum.EX1_294] >= 2)
                {
                    sec.canBe_mirrorentity = false;
                }

                if (enemyCardsPlayed.ContainsKey(CardDB.cardIDEnum.tt_010) && enemyCardsPlayed[CardDB.cardIDEnum.tt_010] >= 2)
                {
                    sec.canBe_spellbender = false;
                }

                if (enemyCardsPlayed.ContainsKey(CardDB.cardIDEnum.EX1_594) && enemyCardsPlayed[CardDB.cardIDEnum.EX1_594] >= 2)
                {
                    sec.canBe_vaporize = false;
                }

                if (enemyCardsPlayed.ContainsKey(CardDB.cardIDEnum.FP1_018) && enemyCardsPlayed[CardDB.cardIDEnum.FP1_018] >= 2)
                {
                    sec.canBe_duplicate = false;
                }
            }

            if (enemyHeroName == HeroEnum.pala)
            {

                sec.canBe_snaketrap = false;
                sec.canBe_snipe = false;
                sec.canBe_explosive = false;
                sec.canBe_freezing = false;
                sec.canBe_missdirection = false;

                sec.canBe_counterspell = false;
                sec.canBe_icebarrier = false;
                sec.canBe_iceblock = false;
                sec.canBe_mirrorentity = false;
                sec.canBe_spellbender = false;
                sec.canBe_vaporize = false;
                sec.canBe_duplicate = false;

                if (enemyCardsPlayed.ContainsKey(CardDB.cardIDEnum.EX1_132) && enemyCardsPlayed[CardDB.cardIDEnum.EX1_132] >= 2)
                {
                    sec.canBe_eyeforaneye = false;
                }

                if (enemyCardsPlayed.ContainsKey(CardDB.cardIDEnum.EX1_130) && enemyCardsPlayed[CardDB.cardIDEnum.EX1_130] >= 2)
                {
                    sec.canBe_noblesacrifice = false;
                }

                if (enemyCardsPlayed.ContainsKey(CardDB.cardIDEnum.EX1_136) && enemyCardsPlayed[CardDB.cardIDEnum.EX1_136] >= 2)
                {
                    sec.canBe_redemption = false;
                }

                if (enemyCardsPlayed.ContainsKey(CardDB.cardIDEnum.EX1_379) && enemyCardsPlayed[CardDB.cardIDEnum.EX1_379] >= 2)
                {
                    sec.canBe_repentance = false;
                }

                if (enemyCardsPlayed.ContainsKey(CardDB.cardIDEnum.FP1_020) && enemyCardsPlayed[CardDB.cardIDEnum.FP1_020] >= 2)
                {
                    sec.canBe_avenge = false;
                }

            }

            return sec;
        }
Example #35
0
        public bool getHoldList(MulliganData mulliganData, Behavior behave)
        {
            cards.Clear();
            readRules(behave.BehaviorName());
            if (!mulliganRulesLoaded)
            {
                return(false);
            }
            if (!(mulliganData.Cards.Count == 3 || mulliganData.Cards.Count == 4))
            {
                Helpfunctions.Instance.ErrorLog("[Mulligan] Mulligan is not used, since it got number of cards: " + cards.Count.ToString());
                return(false);
            }

            Log.InfoFormat("[Mulligan] Apply the {0} rules:", behave.BehaviorName());

            for (var i = 0; i < mulliganData.Cards.Count; i++)
            {
                cards.Add(new CardIDEntity(mulliganData.Cards[i].Entity.Id, i));
            }
            HeroEnum ownHeroClass   = Hrtprozis.Instance.heroTAG_CLASSstringToEnum(mulliganData.UserClass.ToString());
            HeroEnum enemyHeroClass = Hrtprozis.Instance.heroTAG_CLASSstringToEnum(mulliganData.OpponentClass.ToString());

            int    manaRule    = 4;
            string MullRuleKey = getMullRuleKey(CardIdEnum.None, ownHeroClass, enemyHeroClass, 1);

            if (MulliganRules.ContainsKey(MullRuleKey))
            {
                string[] temp = MulliganRules[MullRuleKey].Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
                manaRule = Convert.ToInt32(temp[2]);
            }
            else
            {
                MullRuleKey = getMullRuleKey(CardIdEnum.None, ownHeroClass, HeroEnum.None, 1);
                if (MulliganRules.ContainsKey(MullRuleKey))
                {
                    string[] temp = MulliganRules[MullRuleKey].Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
                    manaRule = Convert.ToInt32(temp[2]);
                }
            }

            CardIDEntity Coin = new CardIDEntity("GAME_005", -888);

            if (cards.Count == 4)
            {
                cards.Add(Coin);                   //we have a coin
            }
            foreach (CardIDEntity CardIDEntityC in cards)
            {
                CardDB.Card c = CardDB.Instance.getCardDataFromID(CardIDEntityC.id);
                if (CardIDEntityC.hold == 0 && CardIDEntityC.holdByRule == 0)
                {
                    if (c.cost < manaRule)
                    {
                        CardIDEntityC.holdByManarule = 2;
                        CardIDEntityC.holdReason     = joinSomeTxt("hold because the card cost:", c.cost.ToString(), " is less then Manarule cost:", manaRule.ToString());
                    }
                    else
                    {
                        CardIDEntityC.holdByManarule = -2;
                        CardIDEntityC.holdReason     = joinSomeTxt("discard because the card cost:", c.cost.ToString(), " is not less then Manarule cost:", manaRule.ToString());
                    }
                }

                int  allowedQuantitySimple = 0;
                int  allowedQuantityExtra  = 0;
                bool hasRuleClassSimple    = false;

                bool   hasRule           = false;
                string MullRuleKeySimple = getMullRuleKey(c.cardIDenum, ownHeroClass, enemyHeroClass, 0); //Simple key for Class enemy
                if (MulliganRules.ContainsKey(MullRuleKeySimple))
                {
                    hasRule = true; hasRuleClassSimple = true;
                }
                else
                {
                    MullRuleKeySimple = getMullRuleKey(c.cardIDenum, ownHeroClass, HeroEnum.None, 0); //Simple key for ALL enemy
                    if (MulliganRules.ContainsKey(MullRuleKeySimple))
                    {
                        hasRule = true;
                    }
                }
                if (hasRule)
                {
                    string[] val = MulliganRules[MullRuleKeySimple].Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
                    allowedQuantitySimple = ((val[1] == "2") ? 2 : 1) * ((val[0] == "Hold") ? 1 : -1);
                }

                hasRule = false;
                string MullRuleKeyExtra = getMullRuleKey(c.cardIDenum, ownHeroClass, enemyHeroClass, 1); //Extra key for Class enemy
                if (MulliganRules.ContainsKey(MullRuleKeyExtra))
                {
                    hasRule = true;
                }
                else if (!hasRuleClassSimple)
                {
                    MullRuleKeyExtra = getMullRuleKey(c.cardIDenum, ownHeroClass, HeroEnum.None, 1); //Extra key for ALL enemy
                    if (MulliganRules.ContainsKey(MullRuleKeyExtra))
                    {
                        hasRule = true;
                    }
                }
                if (hasRule)
                {
                    string[] val = MulliganRules[MullRuleKeyExtra].Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
                    allowedQuantityExtra = ((val[1] == "2") ? 2 : 1) * ((val[0] == "Hold") ? 1 : -1);
                }

                //superimpose Class rules to All rules
                bool useHold        = false;
                bool useDiscard     = false;
                bool useHoldRule    = false;
                bool useDiscardRule = false;

                if (allowedQuantitySimple != 0 && allowedQuantitySimple != allowedQuantityExtra)
                {
                    if (allowedQuantitySimple > 0)
                    {
                        useHold = true;
                    }
                    else
                    {
                        useDiscard = true;
                    }
                }
                if (allowedQuantityExtra != 0)
                {
                    if (allowedQuantityExtra < 0)
                    {
                        useDiscardRule = true;
                    }
                    else
                    {
                        useHoldRule = true;
                    }
                }

                //apply the rules
                string[] MullRuleValueExtra = new string[3];
                if (allowedQuantityExtra != 0)
                {
                    MullRuleValueExtra = MulliganRules[MullRuleKeyExtra].Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
                }
                if (useDiscardRule)
                {
                    if (MullRuleValueExtra[2] != "/")
                    {
                        string[] addedCards = MullRuleValueExtra[2].Split(new string[] { "/" }, StringSplitOptions.RemoveEmptyEntries);
                        MulliganRulesManual.Clear();
                        foreach (string s in addedCards)
                        {
                            MulliganRulesManual.Add(CardDB.Instance.cardIdstringToEnum(s), "");
                        }

                        foreach (CardIDEntity tmp in cards)
                        {
                            if (CardIDEntityC.entitiy == tmp.entitiy)
                            {
                                continue;
                            }
                            if (MulliganRulesManual.ContainsKey(tmp.id))
                            {
                                CardIDEntityC.holdByRule = -2;
                                CardIDEntityC.holdReason = joinSomeTxt("discard by rule: ", getClearRule(MullRuleKeyExtra));
                                break;
                            }
                        }
                    }
                }
                else if (useDiscard)
                {
                    CardIDEntityC.hold       = -2;
                    CardIDEntityC.holdReason = joinSomeTxt("discard by rule: ", getClearRule(MullRuleKeySimple));
                }

                if (useHoldRule)
                {
                    if (CardIDEntityC.holdByRule == 0)
                    {
                        string[] addedCards = MullRuleValueExtra[2].Split(new string[] { "/" }, StringSplitOptions.RemoveEmptyEntries);
                        MulliganRulesManual.Clear();
                        foreach (string s in addedCards)
                        {
                            MulliganRulesManual.Add(CardDB.Instance.cardIdstringToEnum(s), "");
                        }

                        bool foundFreeCard = false;
                        for (int i = 0; i < cards.Count; i++)
                        {
                            if (CardIDEntityC.entitiy == cards[i].entitiy)
                            {
                                continue;
                            }
                            if (MulliganRulesManual.ContainsKey(cards[i].id))
                            {
                                CardIDEntityC.holdByRule = 2;
                                CardIDEntityC.holdReason = joinSomeTxt("hold by rule: ", getClearRule(MullRuleKeyExtra));
                                if (cards[i].holdByRule < 0)
                                {
                                    for (int j = i; j < cards.Count; j++)
                                    {
                                        if (CardIDEntityC.entitiy == cards[j].entitiy)
                                        {
                                            continue;
                                        }
                                        if (MulliganRulesManual.ContainsKey(cards[j].id))
                                        {
                                            if (cards[j].holdByRule < 0)
                                            {
                                                continue;
                                            }
                                            foundFreeCard       = true;
                                            cards[j].holdByRule = 2;
                                            cards[j].holdReason = joinSomeTxt("hold by rule: ", getClearRule(MullRuleKeyExtra));
                                            break;
                                        }
                                    }
                                    if (!foundFreeCard)
                                    {
                                        foundFreeCard       = true;
                                        cards[i].holdByRule = 2;
                                        cards[i].holdReason = joinSomeTxt("hold by rule: ", getClearRule(MullRuleKeyExtra));
                                        break;
                                    }
                                }
                                else
                                {
                                    foundFreeCard       = true;
                                    cards[i].holdByRule = 2;
                                    cards[i].holdReason = joinSomeTxt("hold by rule: ", getClearRule(MullRuleKeyExtra));
                                }

                                if (allowedQuantityExtra == 1)
                                {
                                    foreach (CardIDEntity tmp in cards)
                                    {
                                        if (tmp.entitiy == CardIDEntityC.entitiy)
                                        {
                                            continue;
                                        }
                                        if (tmp.id == CardIDEntityC.id)
                                        {
                                            tmp.holdByRule = -2;
                                            tmp.holdReason = joinSomeTxt("discard by rule: ", getClearRule(MullRuleKeyExtra));
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
                if (useHold && CardIDEntityC.holdByRule != -2)
                {
                    if (CardIDEntityC.hold == 0)
                    {
                        CardIDEntityC.hold       = 2;
                        CardIDEntityC.holdReason = joinSomeTxt("hold by rule: ", getClearRule(MullRuleKeySimple));
                        if (allowedQuantitySimple == 1)
                        {
                            CardIDEntityC.hold = 1;
                            foreach (CardIDEntity tmp in cards)
                            {
                                if (tmp.entitiy == CardIDEntityC.entitiy)
                                {
                                    continue;
                                }
                                if (tmp.id == CardIDEntityC.id)
                                {
                                    tmp.hold       = -2;
                                    tmp.holdReason = joinSomeTxt("discard Second card by rule: ", getClearRule(MullRuleKeySimple));
                                }
                            }
                        }
                    }
                }
            }

            if (cards.Count == 5)
            {
                cards.Remove(Coin);
            }

            foreach (CardIDEntity c in cards)
            {
                if (c.holdByRule == 0)
                {
                    if (c.hold == 0)
                    {
                        c.holdByRule = c.holdByManarule;
                    }
                    else
                    {
                        c.holdByRule = c.hold;
                    }
                }
            }

            for (var i = 0; i < mulliganData.Cards.Count; i++)
            {
                mulliganData.Mulligans[i] = (cards[i].holdByRule > 0) ? false : true;
                Log.InfoFormat("[Mulligan] {0} {1}.", mulliganData.Cards[i].Entity.Name, cards[i].holdReason);
            }
            return(true);
        }
Example #36
0
 public void setHeroName(string heron)
 {
     this.heroname = this.heroNametoEnum(heron);
 }
Example #37
0
        public Playfield()
        {
            this.nextEntity = 1000;
            //this.simulateEnemyTurn = Ai.Instance.simulateEnemyTurn;
            this.ownController = Hrtprozis.Instance.getOwnController();

            this.ownHeroEntity = Hrtprozis.Instance.ownHeroEntity;
            this.enemyHeroEntity = Hrtprozis.Instance.enemyHeroEntitiy;

            this.mana = Hrtprozis.Instance.currentMana;
            this.ownMaxMana = Hrtprozis.Instance.ownMaxMana;
            this.enemyMaxMana = Hrtprozis.Instance.enemyMaxMana;
            this.evaluatePenality = 0;
            this.ownSecretsIDList.AddRange(Hrtprozis.Instance.ownSecretList);
            this.enemySecretCount = Hrtprozis.Instance.enemySecretCount;


            this.attackFaceHP = Hrtprozis.Instance.attackFaceHp;

            this.complete = false;

            addMinionsReal(Hrtprozis.Instance.ownMinions, ownMinions);
            addMinionsReal(Hrtprozis.Instance.enemyMinions, enemyMinions);
            this.ownHero = new Minion(Hrtprozis.Instance.ownHero);
            this.enemyHero = new Minion(Hrtprozis.Instance.enemyHero);
            addCardsReal(Handmanager.Instance.handCards);

            this.ownHeroName = Hrtprozis.Instance.heroname;
            this.enemyHeroName = Hrtprozis.Instance.enemyHeroname;

            /*
            this.enemyHeroHp = Hrtprozis.Instance.enemyHp;
            this.ownHeroHp = Hrtprozis.Instance.heroHp;
            this.ownHeroReady = Hrtprozis.Instance.ownheroisread;
            this.ownHeroWindfury = Hrtprozis.Instance.ownHeroWindfury;
            this.ownHeroNumAttackThisTurn = Hrtprozis.Instance.ownHeroNumAttacksThisTurn;
            this.ownHeroFrozen = Hrtprozis.Instance.herofrozen;
            this.enemyHeroFrozen = Hrtprozis.Instance.enemyfrozen;
            this.ownheroAngr = Hrtprozis.Instance.heroAtk;
            this.heroImmuneWhileAttacking = Hrtprozis.Instance.heroImmuneToDamageWhileAttacking;
            this.ownHeroDefence = Hrtprozis.Instance.heroDefence;
            this.enemyHeroDefence = Hrtprozis.Instance.enemyDefence;
             */

            //####buffs#############################

            this.anzOwnRaidleader = 0;
            this.anzEnemyRaidleader = 0;
            this.anzOwnStormwindChamps = 0;
            this.anzEnemyStormwindChamps = 0;
            this.anzOwnTundrarhino = 0;
            this.anzEnemyTundrarhino = 0;
            this.anzOwnTimberWolfs = 0;
            this.anzEnemyTimberWolfs = 0;
            this.anzMurlocWarleader = 0;
            this.anzGrimscaleOracle = 0;
            this.anzOwnAuchenaiSoulpriest = 0;
            this.anzEnemyAuchenaiSoulpriest = 0;
            this.anzOwnsorcerersapprentice = 0;
            this.anzOwnsorcerersapprenticeStarted = 0;
            this.anzEnemysorcerersapprentice = 0;
            this.anzEnemysorcerersapprenticeStarted = 0;
            this.anzOwnSouthseacaptain = 0;
            this.anzEnemySouthseacaptain = 0;

            this.feugenDead = Probabilitymaker.Instance.feugenDead;
            this.stalaggDead = Probabilitymaker.Instance.stalaggDead;

            this.weHavePlayedMillhouseManastorm = false;

            this.doublepriest = 0;
            this.enemydoublepriest = 0;

            this.ownBaronRivendare = 0;
            this.enemyBaronRivendare = 0;
            //#########################################

            this.ownWeaponDurability = Hrtprozis.Instance.heroWeaponDurability;
            this.ownWeaponAttack = Hrtprozis.Instance.heroWeaponAttack;
            this.ownWeaponName = Hrtprozis.Instance.ownHeroWeapon;
            this.owncarddraw = 0;


            this.enemyWeaponAttack = Hrtprozis.Instance.enemyWeaponAttack;//dont know jet
            this.enemyWeaponName = Hrtprozis.Instance.enemyHeroWeapon;
            this.enemyWeaponDurability = Hrtprozis.Instance.enemyWeaponDurability;
            this.enemycarddraw = 0;

            this.enemyAnzCards = Handmanager.Instance.enemyAnzCards;

            this.ownAbilityReady = Hrtprozis.Instance.ownAbilityisReady;
            this.ownHeroAblility = new Handmanager.Handcard(Hrtprozis.Instance.heroAbility);
            this.enemyHeroAblility = new Handmanager.Handcard(Hrtprozis.Instance.enemyAbility);
            this.enemyAbilityReady = false;


            this.mobsplayedThisTurn = Hrtprozis.Instance.numMinionsPlayedThisTurn;
            this.startedWithMobsPlayedThisTurn = Hrtprozis.Instance.numMinionsPlayedThisTurn;// only change mobsplayedthisturm
            this.cardsPlayedThisTurn = Hrtprozis.Instance.cardsPlayedThisTurn;
            //todo:
            this.optionsPlayedThisTurn = 0;

            this.ueberladung = Hrtprozis.Instance.ueberladung;

            this.ownHeroFatigue = Hrtprozis.Instance.ownHeroFatigue;
            this.enemyHeroFatigue = Hrtprozis.Instance.enemyHeroFatigue;
            this.ownDeckSize = Hrtprozis.Instance.ownDeckSize;
            this.enemyDeckSize = Hrtprozis.Instance.enemyDeckSize;

            //need the following for manacost-calculation
            this.ownHeroHpStarted = this.ownHero.Hp;
            this.enemyHeroHpStarted = this.enemyHero.Hp;
            this.ownWeaponAttackStarted = this.ownWeaponAttack;
            this.ownCardsCountStarted = this.owncards.Count;
            this.ownMobsCountStarted = this.ownMinions.Count + this.enemyMinions.Count;

            this.playedmagierinderkirintor = false;
            this.playedPreparation = false;

            this.winzigebeschwoererin = 0;
            this.managespenst = 0;
            this.soeldnerDerVenture = 0;
            this.beschwoerungsportal = 0;
            this.nerubarweblord = 0;

            this.startedWithnerubarweblord = 0;
            this.startedWithbeschwoerungsportal = 0;
            this.startedWithManagespenst = 0;
            this.startedWithWinzigebeschwoererin = 0;
            this.startedWithsoeldnerDerVenture = 0;

            this.ownBaronRivendare = 0;
            this.enemyBaronRivendare = 0;

            hasorcanplayKelThuzad = false;
            this.loatheb = false;
            this.spellpower = 0;
            this.enemyspellpower = 0;

            foreach (Minion m in this.ownMinions)
            {
                if (m.playedThisTurn && m.name == CardDB.cardName.loatheb) this.loatheb = true;

                spellpower = spellpower + m.spellpower;
                spellpower += m.handcard.card.spellpowervalue;

                if (m.silenced) continue;

                if (m.name == CardDB.cardName.prophetvelen) this.doublepriest++;


                if (m.name == CardDB.cardName.pintsizedsummoner)
                {
                    this.winzigebeschwoererin++;
                    this.startedWithWinzigebeschwoererin++;
                }

                if (m.name == CardDB.cardName.manawraith)
                {
                    this.managespenst++;
                    this.startedWithManagespenst++;
                }
                if (m.name == CardDB.cardName.nerubarweblord)
                {
                    this.nerubarweblord++;
                    this.startedWithnerubarweblord++;
                }
                if (m.name == CardDB.cardName.venturecomercenary)
                {
                    this.soeldnerDerVenture++;
                    this.startedWithsoeldnerDerVenture++;
                }
                if (m.name == CardDB.cardName.summoningportal)
                {
                    this.beschwoerungsportal++;
                    this.startedWithbeschwoerungsportal++;
                }

                if (m.handcard.card.name == CardDB.cardName.baronrivendare)
                {
                    this.ownBaronRivendare++;
                }
                if (m.handcard.card.name == CardDB.cardName.kelthuzad)
                {
                    this.hasorcanplayKelThuzad = true;
                }

                if (m.name == CardDB.cardName.raidleader) this.anzOwnRaidleader++;

                if (m.name == CardDB.cardName.stormwindchampion) this.anzOwnStormwindChamps++;
                if (m.name == CardDB.cardName.tundrarhino) this.anzOwnTundrarhino++;
                if (m.name == CardDB.cardName.timberwolf) this.anzOwnTimberWolfs++;
                if (m.name == CardDB.cardName.murlocwarleader) this.anzMurlocWarleader++;
                if (m.name == CardDB.cardName.grimscaleoracle) this.anzGrimscaleOracle++;
                if (m.name == CardDB.cardName.auchenaisoulpriest) this.anzOwnAuchenaiSoulpriest++;
                if (m.name == CardDB.cardName.sorcerersapprentice)
                {
                    this.anzOwnsorcerersapprentice++;
                    this.anzOwnsorcerersapprenticeStarted++;
                }
                if (m.name == CardDB.cardName.southseacaptain) this.anzOwnSouthseacaptain++;


            }

            foreach (Handmanager.Handcard hc in this.owncards)
            {

                if (hc.card.name == CardDB.cardName.kelthuzad)
                {
                    this.hasorcanplayKelThuzad = true;
                }
            }

            foreach (Minion m in this.enemyMinions)
            {
                this.enemyspellpower = this.enemyspellpower + m.spellpower;
                enemyspellpower += m.handcard.card.spellpowervalue;
                if (m.silenced) continue;
                if (m.name == CardDB.cardName.prophetvelen) this.enemydoublepriest++;
                if (m.name == CardDB.cardName.manawraith)
                {
                    this.managespenst++;
                    this.startedWithManagespenst++;
                }
                if (m.name == CardDB.cardName.nerubarweblord)
                {
                    this.nerubarweblord++;
                    this.startedWithnerubarweblord++;
                }
                if (m.handcard.card.name == CardDB.cardName.baronrivendare)
                {
                    this.enemyBaronRivendare++;
                }
                if (m.handcard.card.name == CardDB.cardName.kelthuzad)
                {
                    this.hasorcanplayKelThuzad = true;
                }

                if (m.name == CardDB.cardName.raidleader) this.anzEnemyRaidleader++;
                if (m.name == CardDB.cardName.stormwindchampion) this.anzEnemyStormwindChamps++;
                if (m.name == CardDB.cardName.tundrarhino) this.anzEnemyTundrarhino++;
                if (m.name == CardDB.cardName.timberwolf) this.anzEnemyTimberWolfs++;
                if (m.name == CardDB.cardName.murlocwarleader) this.anzMurlocWarleader++;
                if (m.name == CardDB.cardName.grimscaleoracle) this.anzGrimscaleOracle++;
                if (m.name == CardDB.cardName.auchenaisoulpriest) this.anzEnemyAuchenaiSoulpriest++;
                if (m.name == CardDB.cardName.sorcerersapprentice)
                {
                    this.anzEnemysorcerersapprentice++;
                    this.anzEnemysorcerersapprenticeStarted++;
                }
                if (m.name == CardDB.cardName.southseacaptain) this.anzEnemySouthseacaptain++;
            }
            if (this.hasorcanplayKelThuzad) this.diedMinions = new List<GraveYardItem>(Probabilitymaker.Instance.turngraveyard);

        }
Example #38
0
        public Playfield(Silverfish sf)
        {
            this.sf = sf;

            this.nextEntity = sf.hrtprozis.getMaxEntity();
            //this.simulateEnemyTurn = sf.Ai.simulateEnemyTurn;
            this.ownController = sf.Hrtprozis.getOwnController();

            //this.ownHeroEntity = sf.Hrtprozis.ownHeroEntity;
            //this.enemyHeroEntity = sf.Hrtprozis.enemyHeroEntitiy;

            this.mana = sf.Hrtprozis.currentMana;
            this.manaTurnEnd = this.mana;
            this.ownMaxMana = sf.Hrtprozis.ownMaxMana;
            this.enemyMaxMana = sf.Hrtprozis.enemyMaxMana;
            this.evaluatePenality = 0;
            this.ownSecretsIDList.AddRange(sf.Hrtprozis.ownSecretList);
            this.enemySecretCount = sf.Hrtprozis.enemySecretCount;


            this.attackFaceHP = sf.Hrtprozis.attackFaceHp;

            this.complete = false;

            addMinionsReal(sf.Hrtprozis.ownMinions, ownMinions);
            addMinionsReal(sf.Hrtprozis.enemyMinions, enemyMinions);
            this.ownHero = new Minion(sf.Hrtprozis.ownHero);
            this.enemyHero = new Minion(sf.Hrtprozis.enemyHero);
            addCardsReal(sf.Handmanager.handCards);

            this.enemySecretList.Clear();
            if (sf.Settings.useSecretsPlayArround)
            {
                foreach (SecretItem si in sf.Probabilitymaker.enemySecrets)
                {
                    this.enemySecretList.Add(new SecretItem(si));
                }
            }

            this.ownHeroName = sf.Hrtprozis.heroname;
            this.enemyHeroName = sf.Hrtprozis.enemyHeroname;
            this.ownHeroStartClass = sf.Hrtprozis.ownHeroStartClass;
            this.enemyHeroStartClass = sf.Hrtprozis.enemyHeroStartClass;

            /*
            this.enemyHeroHp = sf.Hrtprozis.enemyHp;
            this.ownHeroHp = sf.Hrtprozis.heroHp;
            this.ownHeroReady = sf.Hrtprozis.ownheroisread;
            this.ownHeroWindfury = sf.Hrtprozis.ownHeroWindfury;
            this.ownHeroNumAttackThisTurn = sf.Hrtprozis.ownHeroNumAttacksThisTurn;
            this.ownHeroFrozen = sf.Hrtprozis.herofrozen;
            this.enemyHeroFrozen = sf.Hrtprozis.enemyfrozen;
            this.ownheroAngr = sf.Hrtprozis.heroAtk;
            this.heroImmuneWhileAttacking = sf.Hrtprozis.heroImmuneToDamageWhileAttacking;
            this.ownHeroDefence = sf.Hrtprozis.heroDefence;
            this.enemyHeroDefence = sf.Hrtprozis.enemyDefence;
             */

            //####buffs#############################

            this.anzOwnRaidleader = 0;
            this.anzEnemyRaidleader = 0;
            this.anzOwnStormwindChamps = 0;
            this.anzEnemyStormwindChamps = 0;
            this.anzOwnTundrarhino = 0;
            this.anzEnemyTundrarhino = 0;
            this.anzOwnTimberWolfs = 0;
            this.anzEnemyTimberWolfs = 0;
            this.anzMurlocWarleader = 0;
            this.anzGrimscaleOracle = 0;
            this.anzOwnAuchenaiSoulpriest = 0;
            this.anzEnemyAuchenaiSoulpriest = 0;
            this.anzOwnsorcerersapprentice = 0;
            this.anzOwnsorcerersapprenticeStarted = 0;
            this.anzEnemysorcerersapprentice = 0;
            this.anzEnemysorcerersapprenticeStarted = 0;
            this.anzOwnSouthseacaptain = 0;
            this.anzEnemySouthseacaptain = 0;
            this.anzOwnDragonConsortStarted = 0;
            
            this.anzEnemyTaunt = 0;
            this.ownMinionsDiedTurn = 0;
            this.enemyMinionsDiedTurn = 0;

            this.feugenDead = sf.Probabilitymaker.feugenDead;
            this.stalaggDead = sf.Probabilitymaker.stalaggDead;

            this.weHavePlayedMillhouseManastorm = false;

            this.doublepriest = 0;
            this.enemydoublepriest = 0;

            this.ownBaronRivendare = 0;
            this.enemyBaronRivendare = 0;
            //#########################################

            this.ownWeaponDurability = sf.Hrtprozis.heroWeaponDurability;
            this.ownWeaponAttack = sf.Hrtprozis.heroWeaponAttack;
            this.ownWeaponName = sf.Hrtprozis.ownHeroWeapon;
            this.owncarddraw = 0;


            this.enemyWeaponAttack = sf.Hrtprozis.enemyWeaponAttack;//dont know jet
            this.enemyWeaponName = sf.Hrtprozis.enemyHeroWeapon;
            this.enemyWeaponDurability = sf.Hrtprozis.enemyWeaponDurability;
            this.enemycarddraw = 0;

            this.enemyAnzCards = sf.Handmanager.enemyAnzCards;

            this.ownAbilityReady = sf.Hrtprozis.ownAbilityisReady;
            this.ownHeroAblility = new Handmanager.Handcard(sf.Hrtprozis.heroAbility);
            this.enemyHeroAblility = new Handmanager.Handcard(sf.Hrtprozis.enemyAbility);
            this.enemyAbilityReady = false;


            this.mobsplayedThisTurn = sf.Hrtprozis.numMinionsPlayedThisTurn;
            this.startedWithMobsPlayedThisTurn = sf.Hrtprozis.numMinionsPlayedThisTurn;// only change mobsplayedthisturm
            this.cardsPlayedThisTurn = sf.Hrtprozis.cardsPlayedThisTurn;
            //todo:
            this.optionsPlayedThisTurn = sf.Hrtprozis.numOptionsPlayedThisTurn;

            this.ueberladung = sf.Hrtprozis.ueberladung;

            this.ownHeroFatigue = sf.Hrtprozis.ownHeroFatigue;
            this.enemyHeroFatigue = sf.Hrtprozis.enemyHeroFatigue;
            this.ownDeckSize = sf.Hrtprozis.ownDeckSize;
            this.enemyDeckSize = sf.Hrtprozis.enemyDeckSize;

            //need the following for manacost-calculation
            this.ownHeroHpStarted = this.ownHero.Hp;
            this.enemyHeroHpStarted = this.enemyHero.Hp;
            this.ownWeaponAttackStarted = this.ownWeaponAttack;
            this.ownCardsCountStarted = this.owncards.Count;
            this.enemyCardsCountStarted = this.enemyAnzCards;
            this.ownMobsCountStarted = this.ownMinions.Count + this.enemyMinions.Count;

            this.playedmagierinderkirintor = false;
            this.playedPreparation = false;

            this.winzigebeschwoererin = 0;
            this.managespenst = 0;
            this.soeldnerDerVenture = 0;
            this.beschwoerungsportal = 0;
            this.nerubarweblord = 0;

            this.startedWithnerubarweblord = 0;
            this.startedWithbeschwoerungsportal = 0;
            this.startedWithManagespenst = 0;
            this.startedWithWinzigebeschwoererin = 0;
            this.startedWithsoeldnerDerVenture = 0;

            this.ownBaronRivendare = 0;
            this.enemyBaronRivendare = 0;

            needGraveyard = false;
            this.loatheb = false;
            this.spellpower = 0;
            this.enemyspellpower = 0;

            this.startedWithDamagedMinions = false;

            foreach (Minion m in this.ownMinions)
            {
                if (m.Hp < m.maxHp && m.Hp >= 1) this.startedWithDamagedMinions = true;
                if (m.playedThisTurn && m.name == CardDB.cardName.loatheb) this.loatheb = true;

                spellpower = spellpower + m.spellpower;
                if (m.silenced) continue;
                spellpower += m.handcard.card.spellpowervalue;
                if (m.name == CardDB.cardName.prophetvelen) this.doublepriest++;


                if (m.name == CardDB.cardName.pintsizedsummoner)
                {
                    this.winzigebeschwoererin++;
                    this.startedWithWinzigebeschwoererin++;
                }

                if (m.name == CardDB.cardName.manawraith)
                {
                    this.managespenst++;
                    this.startedWithManagespenst++;
                }
                if (m.name == CardDB.cardName.nerubarweblord)
                {
                    this.nerubarweblord++;
                    this.startedWithnerubarweblord++;
                }
                if (m.name == CardDB.cardName.venturecomercenary)
                {
                    this.soeldnerDerVenture++;
                    this.startedWithsoeldnerDerVenture++;
                }
                if (m.name == CardDB.cardName.summoningportal)
                {
                    this.beschwoerungsportal++;
                    this.startedWithbeschwoerungsportal++;
                }

                if (m.handcard.card.name == CardDB.cardName.baronrivendare)
                {
                    this.ownBaronRivendare++;
                }
                if (m.handcard.card.name == CardDB.cardName.kelthuzad)
                {
                    this.needGraveyard = true;
                }

                if (m.name == CardDB.cardName.raidleader) this.anzOwnRaidleader++;
                if (m.name == CardDB.cardName.malganis) this.anzOwnMalGanis++;
                if (m.name == CardDB.cardName.stormwindchampion) this.anzOwnStormwindChamps++;
                if (m.name == CardDB.cardName.tundrarhino) this.anzOwnTundrarhino++;
                if (m.name == CardDB.cardName.timberwolf) this.anzOwnTimberWolfs++;
                if (m.name == CardDB.cardName.murlocwarleader) this.anzMurlocWarleader++;
                if (m.name == CardDB.cardName.grimscaleoracle) this.anzGrimscaleOracle++;
                if (m.name == CardDB.cardName.auchenaisoulpriest) this.anzOwnAuchenaiSoulpriest++;
                if (m.name == CardDB.cardName.sorcerersapprentice)
                {
                    this.anzOwnsorcerersapprentice++;
                    this.anzOwnsorcerersapprenticeStarted++;
                }
                if (m.name == CardDB.cardName.southseacaptain) this.anzOwnSouthseacaptain++;
                if (m.name == CardDB.cardName.chromaggus) this.anzOwnChromaggus++;
                if (m.name == CardDB.cardName.dragonconsort && anzOwnDragonConsort > 0) this.anzOwnDragonConsortStarted++;
                if (m.name == CardDB.cardName.mechwarper)
                {
                    this.anzOwnMechwarper++;
                    this.anzOwnMechwarperStarted++;
                }
                if (m.name == CardDB.cardName.steamwheedlesniper && this.ownHeroName == HeroEnum.hunter)
                {
                    this.weHaveSteamwheedleSniper = true;
                }

            }

            foreach (Handmanager.Handcard hc in this.owncards)
            {

                if (hc.card.name == CardDB.cardName.kelthuzad)
                {
                    this.needGraveyard = true;
                }
            }

            foreach (Minion m in this.enemyMinions)
            {
                this.enemyspellpower = this.enemyspellpower + m.spellpower;
                enemyspellpower += m.handcard.card.spellpowervalue;
                if (m.silenced) continue;
                if (m.taunt) anzEnemyTaunt++;
                if (m.name == CardDB.cardName.prophetvelen) this.enemydoublepriest++;
                if (m.name == CardDB.cardName.manawraith)
                {
                    this.managespenst++;
                    this.startedWithManagespenst++;
                }
                if (m.name == CardDB.cardName.nerubarweblord)
                {
                    this.nerubarweblord++;
                    this.startedWithnerubarweblord++;
                }
                if (m.handcard.card.name == CardDB.cardName.baronrivendare)
                {
                    this.enemyBaronRivendare++;
                }
                if (m.handcard.card.name == CardDB.cardName.kelthuzad)
                {
                    this.needGraveyard = true;
                }

                if (m.name == CardDB.cardName.raidleader) this.anzEnemyRaidleader++;
                if (m.name == CardDB.cardName.malganis) this.anzEnemyMalGanis++;
                if (m.name == CardDB.cardName.stormwindchampion) this.anzEnemyStormwindChamps++;
                if (m.name == CardDB.cardName.tundrarhino) this.anzEnemyTundrarhino++;
                if (m.name == CardDB.cardName.timberwolf) this.anzEnemyTimberWolfs++;
                if (m.name == CardDB.cardName.murlocwarleader) this.anzMurlocWarleader++;
                if (m.name == CardDB.cardName.grimscaleoracle) this.anzGrimscaleOracle++;
                if (m.name == CardDB.cardName.auchenaisoulpriest) this.anzEnemyAuchenaiSoulpriest++;
                if (m.name == CardDB.cardName.sorcerersapprentice)
                {
                    this.anzEnemysorcerersapprentice++;
                    this.anzEnemysorcerersapprenticeStarted++;
                }
                if (m.name == CardDB.cardName.southseacaptain) this.anzEnemySouthseacaptain++;
                if (m.name == CardDB.cardName.chromaggus) this.anzEnemyChromaggus++;
                if (m.name == CardDB.cardName.mechwarper)
                {
                    this.anzEnemyMechwarper++;
                    this.anzEnemyMechwarperStarted++;
                }
                if (m.name == CardDB.cardName.steamwheedlesniper && this.enemyHeroName == HeroEnum.hunter)
                {
                    this.enemyHaveSteamwheedleSniper = true;
                }
            }
            if (this.enemySecretCount >= 1) this.needGraveyard = true;
            if (this.needGraveyard) this.diedMinions = new List<GraveYardItem>(sf.Probabilitymaker.turngraveyard);

            this.tempanzOwnCards = this.owncards.Count;
            this.tempanzEnemyCards = this.enemyAnzCards;


        }
Example #39
0
        public Player(Player p)
        {
            //this.isOwnTurn = p.isOwnTurn;

            this.attacked      = p.attacked;
            this.sEnemTurn     = p.sEnemTurn;
            this.ownController = p.ownController;
            this.hasCoin       = p.hasCoin;
            //this.ownHeroEntity = p.ownHeroEntity;
            //this.enemyHeroEntity = p.enemyHeroEntity;

            //this.evaluatePenality = p.evaluatePenality;
            this.ownSecretsIDList.AddRange(p.ownSecretsIDList);

            this.mana        = p.mana;
            this.manaTurnEnd = p.manaTurnEnd;
            this.ownMaxMana  = p.ownMaxMana;
            addMinionsReal(p.ownMinions, ownMinions);
            this.ownHero = new Minion(p.ownHero);
            addCardsReal(p.owncards);

            this.ownHeroName = p.ownHeroName;

            this.playactions.AddRange(p.playactions);
            this.lastTurnActions.AddRange(p.lastTurnActions);
            this.playMacros.AddRange(p.playMacros);
            this.lastTurnMacros.AddRange(p.lastTurnMacros);

            this.attackFaceHP = p.attackFaceHP;

            this.owncarddraw = p.owncarddraw;

            this.ownWeaponDurability = p.ownWeaponDurability;
            this.ownWeaponAttack     = p.ownWeaponAttack;
            this.ownWeaponName       = p.ownWeaponName;

            this.lostDamage       = p.lostDamage;
            this.lostWeaponDamage = p.lostWeaponDamage;
            this.lostHeal         = p.lostHeal;

            this.ownAbilityReady = p.ownAbilityReady;
            this.ownHeroAblility = new Handmanager.Handcard(p.ownHeroAblility);

            this.spellpower                    = 0;
            this.mobsplayedThisTurn            = p.mobsplayedThisTurn;
            this.startedWithMobsPlayedThisTurn = p.startedWithMobsPlayedThisTurn;
            this.optionsPlayedThisTurn         = p.optionsPlayedThisTurn;
            this.cardsPlayedThisTurn           = p.cardsPlayedThisTurn;
            this.ueberladung                   = p.ueberladung;

            //this.ownDeckSize = p.ownDeckSize;
            this.ownHeroFatigue = p.ownHeroFatigue;

            //need the following for manacost-calculation
            this.ownHeroHpStarted       = p.ownHeroHpStarted;
            this.ownWeaponAttackStarted = p.ownWeaponAttackStarted;
            this.ownCardsCountStarted   = p.ownCardsCountStarted;
            this.ownMobsCountStarted    = p.ownMobsCountStarted;

            //this.startedWithWinzigebeschwoererin = p.startedWithWinzigebeschwoererin;
            this.playedmagierinderkirintor = p.playedmagierinderkirintor;

            //this.startedWithWinzigebeschwoererin = p.startedWithWinzigebeschwoererin;
            //this.startedWithManagespenst = p.startedWithManagespenst;
            //this.startedWithsoeldnerDerVenture = p.startedWithsoeldnerDerVenture;
            //this.startedWithbeschwoerungsportal = p.startedWithbeschwoerungsportal;
            //this.startedWithnerubarweblord = p.startedWithnerubarweblord;

            //this.startedWithDamagedMinions = p.startedWithDamagedMinions;

            this.nerubarweblord       = p.nerubarweblord;
            this.winzigebeschwoererin = p.winzigebeschwoererin;
            this.managespenst         = p.managespenst;
            this.soeldnerDerVenture   = p.soeldnerDerVenture;
            //this.loatheb = p.loatheb;

            this.spellpower = p.spellpower;

            this.ownLastDiedMinion = p.ownLastDiedMinion;

            //####buffs#############################

            this.anzOwnRaidleader          = p.anzOwnRaidleader;
            this.anzOwnMalGanis            = p.anzOwnMalGanis;
            this.anzOwnStormwindChamps     = p.anzOwnStormwindChamps;
            this.anzOwnTundrarhino         = p.anzOwnTundrarhino;
            this.anzOwnTimberWolfs         = p.anzOwnTimberWolfs;
            this.anzMurlocWarleader        = p.anzMurlocWarleader;
            this.anzGrimscaleOracle        = p.anzGrimscaleOracle;
            this.anzOwnAuchenaiSoulpriest  = p.anzOwnAuchenaiSoulpriest;
            this.anzOwnsorcerersapprentice = p.anzOwnsorcerersapprentice;
            //this.anzOwnsorcerersapprenticeStarted = p.anzOwnsorcerersapprenticeStarted;
            this.anzOwnSouthseacaptain = p.anzOwnSouthseacaptain;
            this.anzOwnMechwarper      = p.anzOwnMechwarper;
            //this.anzOwnMechwarperStarted = p.anzOwnMechwarperStarted;
            this.anzOwnChromaggus    = p.anzOwnChromaggus;
            this.anzOwnDragonConsort = p.anzOwnDragonConsort;
            //this.anzOwnDragonConsortStarted = p.anzOwnDragonConsortStarted;

            //implementation of loatheb
            this.enemyLoatheb   = p.enemyLoatheb;
            this.enemyMillhouse = p.enemyMillhouse;
            //end

            this.ownMinionsDiedTurn = p.ownMinionsDiedTurn;

            //this.feugenDead = p.feugenDead;
            //this.stalaggDead = p.stalaggDead;

            this.doublepriest = p.doublepriest;

            this.ownBaronRivendare = p.ownBaronRivendare;

            this.weHaveSteamwheedleSniper = p.weHaveSteamwheedleSniper;
            //#########################################

            this.tempanzOwnCards = this.owncards.Count;
        }
Example #40
0
        public void getHoldList(MulliganData mulliganData)
        {
            cards.Clear();

            for (var i = 0; i < mulliganData.Cards.Count; i++)
            {
                cards.Add(new CardIDEntity(mulliganData.Cards[i].Entity.Id, i));
            }
            HeroEnum ownHeroClass   = heroTAG_CLASSstringToEnum(mulliganData.UserClass.ToString());
            HeroEnum enemyHeroClass = heroTAG_CLASSstringToEnum(mulliganData.OpponentClass.ToString());

            if (!(cards.Count == 3 || cards.Count == 4))
            {
                Helpfunctions.Instance.ErrorLog("[Mulligan] Mulligan is not used, since it got number of cards: " + cards.Count.ToString());
                return;
            }

            int    manaRule    = 4;
            string MullRuleKey = getMullRuleKey(CardDB.cardIDEnum.None, ownHeroClass, enemyHeroClass, false);

            if (MulliganRules.ContainsKey(MullRuleKey))
            {
                string[] temp = MulliganRules[MullRuleKey].Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
                manaRule = Convert.ToInt32(temp[1]);
            }
            else
            {
                MullRuleKey = getMullRuleKey(CardDB.cardIDEnum.None, ownHeroClass, HeroEnum.None, false);
                if (MulliganRules.ContainsKey(MullRuleKey))
                {
                    string[] temp = MulliganRules[MullRuleKey].Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
                    manaRule = Convert.ToInt32(temp[1]);
                }
            }

            CardIDEntity Coin = new CardIDEntity("GAME_005", -888);

            if (cards.Count == 4)
            {
                cards.Add(Coin);                   //we have a coin
            }
            foreach (CardIDEntity CardIDEntityC in cards)
            {
                int         allowedQuantity = 2;
                CardDB.Card c = CardDB.Instance.getCardDataFromID(CardIDEntityC.id);
                if (CardIDEntityC.hold == 0 && CardIDEntityC.holdByRule == 0)
                {
                    if (c.cost < manaRule)
                    {
                        CardIDEntityC.holdByManarule = 2;
                        CardIDEntityC.holdReason     = joinSomeTxt("hold because the card cost:", c.cost.ToString(), " is less then Manarule cost:", manaRule.ToString());
                    }
                    else
                    {
                        CardIDEntityC.holdByManarule = -2;
                        CardIDEntityC.holdReason     = joinSomeTxt("discard because the card cost:", c.cost.ToString(), " is not less then Manarule cost:", manaRule.ToString());
                    }
                }

                //check Hold
                int hasRuleHold    = 0; //0=None, 1=All, 2=Class, 11=All+Rule, 12=Class+Rule
                int hasRuleDiscard = 0; //0=None, -1=All, -2=Class, -11=All+Rule, -12=Class+Rule

                string MullRuleValueHold = "";
                string MullRuleKeyHold   = getMullRuleKey(c.cardIDenum, ownHeroClass, enemyHeroClass, true);
                if (MulliganRules.ContainsKey(MullRuleKeyHold))
                {
                    MullRuleValueHold = MulliganRules[MullRuleKeyHold];
                    hasRuleHold       = 2;
                }
                else
                {
                    MullRuleKeyHold = getMullRuleKey(c.cardIDenum, ownHeroClass, HeroEnum.None, true); //key for ALL enemy
                    if (MulliganRules.ContainsKey(MullRuleKeyHold))
                    {
                        MullRuleValueHold = MulliganRules[MullRuleKeyHold]; hasRuleHold = 1;
                    }
                }

                if (MullRuleValueHold != "")
                {
                    string[] temp = MullRuleValueHold.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
                    if (temp[0] == "1")
                    {
                        allowedQuantity = 1;
                    }
                    if (temp[1] != "/")
                    {
                        hasRuleHold += 10;
                    }
                }
                else
                {
                    hasRuleHold = 0;
                }

                //check Discard
                string MullRuleValueDiscard = "";
                string MullRuleKeyDiscard   = getMullRuleKey(c.cardIDenum, ownHeroClass, enemyHeroClass, false);
                if (MulliganRules.ContainsKey(MullRuleKeyDiscard))
                {
                    MullRuleValueDiscard = MulliganRules[MullRuleKeyDiscard];
                    hasRuleDiscard       = -2;
                }
                else
                {
                    MullRuleKeyDiscard = getMullRuleKey(c.cardIDenum, ownHeroClass, HeroEnum.None, false); //key for ALL enemy
                    if (MulliganRules.ContainsKey(MullRuleKeyDiscard))
                    {
                        MullRuleValueDiscard = MulliganRules[MullRuleKeyDiscard]; hasRuleDiscard = -1;
                    }
                }

                if (MullRuleValueDiscard != "")
                {
                    string[] temp = MullRuleValueDiscard.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
                    if (temp[1] != "/")
                    {
                        hasRuleDiscard -= 10;
                    }
                }
                else
                {
                    hasRuleDiscard = 0;
                }

                //superimpose Class rules to All rules
                bool useHold        = false;
                bool useDiscard     = false;
                bool useHoldRule    = false;
                bool useDiscardRule = false;

                if (hasRuleHold == 2)
                {
                    useHold = true;
                    if (hasRuleDiscard < -10)
                    {
                        useDiscardRule = true;
                    }
                }
                else if (hasRuleDiscard == -2)
                {
                    useDiscard = true;
                    if (hasRuleHold > 10)
                    {
                        useHoldRule = true;
                    }
                }

                if (hasRuleHold == 1)
                {
                    if (hasRuleDiscard == 0 || hasRuleDiscard < -10)
                    {
                        useHold = true;
                    }
                    if (hasRuleDiscard < -10)
                    {
                        useDiscardRule = true;
                    }
                }
                else if (hasRuleDiscard == -1)
                {
                    if (hasRuleHold == 0 || hasRuleHold > 10)
                    {
                        useDiscard = true;
                    }
                    if (hasRuleHold > 10)
                    {
                        useHoldRule = true;
                    }
                }

                if (hasRuleDiscard == 0 && hasRuleHold > 10)
                {
                    useHoldRule = true;
                }
                else if (hasRuleHold == 0 && hasRuleDiscard < -10)
                {
                    useDiscardRule = true;
                }

                //apply the rules
                if (useDiscardRule)
                {
                    string[] temp = MullRuleValueDiscard.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);

                    if (temp[1] != "/")
                    {
                        string[] addedCards = temp[1].Split(new string[] { "/" }, StringSplitOptions.RemoveEmptyEntries);
                        MulliganRulesManual.Clear();
                        foreach (string s in addedCards)
                        {
                            MulliganRulesManual.Add(CardDB.Instance.cardIdstringToEnum(s), "");
                        }

                        foreach (CardIDEntity tmp in cards)
                        {
                            if (CardIDEntityC.entitiy == tmp.entitiy)
                            {
                                continue;
                            }
                            if (MulliganRulesManual.ContainsKey(tmp.id))
                            {
                                CardIDEntityC.holdByRule = -2;
                                CardIDEntityC.holdReason = joinSomeTxt("discard by rule: ", MullRuleKeyDiscard, ":", MulliganRules[MullRuleKeyDiscard]);
                                break;
                            }
                        }
                    }
                }
                else if (useDiscard)
                {
                    CardIDEntityC.hold       = -2;
                    CardIDEntityC.holdReason = joinSomeTxt("discard by rule: ", MullRuleKeyDiscard, ":", MulliganRules[MullRuleKeyDiscard]);
                }

                if (useHoldRule)
                {
                    string[] temp = MullRuleValueHold.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
                    if (CardIDEntityC.holdByRule == 0)
                    {
                        string[] addedCards = temp[1].Split(new string[] { "/" }, StringSplitOptions.RemoveEmptyEntries);
                        MulliganRulesManual.Clear();
                        foreach (string s in addedCards)
                        {
                            MulliganRulesManual.Add(CardDB.Instance.cardIdstringToEnum(s), "");
                        }

                        bool foundFreeCard = false;
                        for (int i = 0; i < cards.Count; i++)
                        {
                            if (CardIDEntityC.entitiy == cards[i].entitiy)
                            {
                                continue;
                            }
                            if (MulliganRulesManual.ContainsKey(cards[i].id)) //we found the right card
                            {
                                CardIDEntityC.holdByRule = 2;
                                CardIDEntityC.holdReason = joinSomeTxt("hold by rule: ", MullRuleKeyHold, ":", MulliganRules[MullRuleKeyHold]);
                                if (cards[i].holdByRule < 0) //if the right card is busy, check other cards
                                {
                                    for (int j = i; j < cards.Count; j++)
                                    {
                                        if (CardIDEntityC.entitiy == cards[j].entitiy)
                                        {
                                            continue;
                                        }
                                        if (MulliganRulesManual.ContainsKey(cards[j].id))
                                        {
                                            if (cards[j].holdByRule < 0)
                                            {
                                                continue;
                                            }
                                            foundFreeCard       = true;
                                            cards[j].holdByRule = 2;
                                            cards[j].holdReason = joinSomeTxt("hold by rule: ", MullRuleKeyHold, ":", MulliganRules[MullRuleKeyHold]);
                                            break;
                                        }
                                    }
                                    if (!foundFreeCard)
                                    {
                                        foundFreeCard       = true;
                                        cards[i].holdByRule = 2;
                                        cards[i].holdReason = joinSomeTxt("hold by rule: ", MullRuleKeyHold, ":", MulliganRules[MullRuleKeyHold]);
                                        break;
                                    }
                                }
                                else
                                {
                                    foundFreeCard       = true;
                                    cards[i].holdByRule = 2;
                                    cards[i].holdReason = joinSomeTxt("hold by rule: ", MullRuleKeyHold, ":", MulliganRules[MullRuleKeyHold]);
                                }

                                if (allowedQuantity == 1)
                                {
                                    foreach (CardIDEntity tmp in cards)
                                    {
                                        if (tmp.entitiy == CardIDEntityC.entitiy)
                                        {
                                            continue;
                                        }
                                        if (tmp.id == CardIDEntityC.id)
                                        {
                                            tmp.holdByRule = -2;
                                            tmp.holdReason = joinSomeTxt("discard by rule: ", MullRuleKeyHold, ":", MulliganRules[MullRuleKeyHold]);
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
                else if (useHold && CardIDEntityC.holdByRule != -2)
                {
                    if (CardIDEntityC.hold == 0)
                    {
                        CardIDEntityC.hold       = 2;
                        CardIDEntityC.holdReason = joinSomeTxt("hold by rule: ", MullRuleKeyHold, ":", MulliganRules[MullRuleKeyHold]);
                        if (allowedQuantity == 1)
                        {
                            CardIDEntityC.hold = 1;
                            foreach (CardIDEntity tmp in cards)
                            {
                                if (tmp.entitiy == CardIDEntityC.entitiy)
                                {
                                    continue;
                                }
                                if (tmp.id == CardIDEntityC.id)
                                {
                                    tmp.hold       = -2;
                                    tmp.holdReason = joinSomeTxt("discard Second card by rule: ", MullRuleKeyHold, ":", MulliganRules[MullRuleKeyHold]);
                                }
                            }
                        }
                    }
                }
            }

            if (cards.Count == 5)
            {
                cards.Remove(Coin);
            }

            foreach (CardIDEntity c in cards)
            {
                if (c.holdByRule == 0)
                {
                    if (c.hold == 0)
                    {
                        c.holdByRule = c.holdByManarule;
                    }
                    else
                    {
                        c.holdByRule = c.hold;
                    }
                }
            }


            for (var i = 0; i < mulliganData.Cards.Count; i++)
            {
                mulliganData.Mulligans[i] = (cards[i].holdByRule > 0) ? false : true;
                Log.InfoFormat("[Mulligan] {0} {1}.", mulliganData.Cards[i].Entity.Name, cards[i].holdReason);
            }
            return;
        }
Example #41
0
        public Player(int player)
        {
            this.ownController = player;
            this.hasCoin       = (player == 1) ? true : false;

            this.mana        = (player == 0)? 1: 0;
            this.manaTurnEnd = this.mana;
            this.ownMaxMana  = mana;
            //this.evaluatePenality = 0;

            this.attackFaceHP = 15;

            //this.complete = false;

            this.ownHero           = new Minion();
            this.ownHero.cardClass = TAG_CLASS.MAGE;

            //implementation
            this.ownHero.isHero    = true;
            this.ownHero.own       = (player == 0) ? true : false;
            this.ownHero.maxHp     = 30;
            this.ownHero.entitiyID = player;

            this.ownHero.Angr   = 0;
            this.ownHero.Hp     = 30;
            this.ownHero.armor  = 0;
            this.ownHero.frozen = false;
            this.ownHero.immuneWhileAttacking = false;
            this.ownHero.immune             = false;
            this.ownHero.numAttacksThisTurn = 0;
            this.ownHero.windfury           = false;

            //end of implementation

            //addCardsReal(homeHandManager.handCards);

            this.ownHeroName       = HeroEnum.mage;
            this.ownHeroStartClass = TAG_CLASS.MAGE;

            /*
             * this.enemyHeroHp = hrtprozis.enemyHp;
             * this.ownHeroHp = hrtprozis.heroHp;
             * this.ownHeroReady = hrtprozis.ownheroisread;
             * this.ownHeroWindfury = hrtprozis.ownHeroWindfury;
             * this.ownHeroNumAttackThisTurn = hrtprozis.ownHeroNumAttacksThisTurn;
             * this.ownHeroFrozen = hrtprozis.herofrozen;
             * this.enemyHeroFrozen = hrtprozis.enemyfrozen;
             * this.ownheroAngr = hrtprozis.heroAtk;
             * this.heroImmuneWhileAttacking = hrtprozis.heroImmuneToDamageWhileAttacking;
             * this.ownHeroDefence = hrtprozis.heroDefence;
             * this.enemyHeroDefence = hrtprozis.enemyDefence;
             */

            //####buffs#############################

            this.anzOwnRaidleader          = 0;
            this.anzOwnStormwindChamps     = 0;
            this.anzOwnTundrarhino         = 0;
            this.anzOwnTimberWolfs         = 0;
            this.anzMurlocWarleader        = 0;
            this.anzGrimscaleOracle        = 0;
            this.anzOwnAuchenaiSoulpriest  = 0;
            this.anzOwnsorcerersapprentice = 0;
            //this.anzOwnsorcerersapprenticeStarted = 0;
            this.anzOwnSouthseacaptain = 0;
            //this.anzOwnDragonConsortStarted = 0;

            this.ownMinionsDiedTurn = 0;

            //this.feugenDead = false;
            //this.stalaggDead = false;

            this.doublepriest = 0;

            this.ownBaronRivendare = 0;
            //#########################################

            this.ownWeaponDurability = 0;
            this.ownWeaponAttack     = 0;
            this.ownWeaponName       = CardDB.cardName.unknown;
            this.owncarddraw         = 0;

            this.ownAbilityReady = true;
            this.ownHeroAblility = new Handmanager.Handcard(CardDB.Instance.getCardData(CardDB.Instance.cardNamestringToEnum("fireblast")));

            this.mobsplayedThisTurn = 0;
            //this.startedWithMobsPlayedThisTurn = 0;// only change mobsplayedthisturm
            this.cardsPlayedThisTurn = 0;
            //todo:
            this.optionsPlayedThisTurn = 0;

            this.ueberladung = 0;

            this.ownHeroFatigue = 0;
            //this.ownDeckSize = 30;

            //need the following for manacost-calculation
            //this.ownHeroHpStarted = this.ownHero.Hp;
            //this.ownWeaponAttackStarted = this.ownWeaponAttack;
            //this.ownCardsCountStarted = this.owncards.Count;
            //this.ownMobsCountStarted = this.ownMinions.Count + this.enemyMinions.Count;

            this.playedmagierinderkirintor = false;
            this.playedPreparation         = false;

            this.winzigebeschwoererin = 0;
            this.managespenst         = 0;
            this.soeldnerDerVenture   = 0;
            this.beschwoerungsportal  = 0;
            this.nerubarweblord       = 0;

            //this.startedWithnerubarweblord = 0;
            //this.startedWithbeschwoerungsportal = 0;
            //this.startedWithManagespenst = 0;
            //this.startedWithWinzigebeschwoererin = 0;
            //this.startedWithsoeldnerDerVenture = 0;

            this.ownBaronRivendare = 0;

            //this.loatheb = false;
            this.spellpower = 0;

            //this.startedWithDamagedMinions = false;

            foreach (Minion m in this.ownMinions)
            {
                //if (m.Hp < m.maxHp && m.Hp >= 1) this.startedWithDamagedMinions = true;
                //if (m.playedThisTurn && m.name == CardDB.cardName.loatheb) this.loatheb = true;

                spellpower = spellpower + m.spellpower;
                if (m.silenced)
                {
                    continue;
                }
                spellpower += m.handcard.card.spellpowervalue;
                if (m.name == CardDB.cardName.prophetvelen)
                {
                    this.doublepriest++;
                }


                if (m.name == CardDB.cardName.pintsizedsummoner)
                {
                    this.winzigebeschwoererin++;
                    //this.startedWithWinzigebeschwoererin++;
                }

                if (m.name == CardDB.cardName.manawraith)
                {
                    this.managespenst++;
                    //this.startedWithManagespenst++;
                }
                if (m.name == CardDB.cardName.nerubarweblord)
                {
                    this.nerubarweblord++;
                    //this.startedWithnerubarweblord++;
                }
                if (m.name == CardDB.cardName.venturecomercenary)
                {
                    this.soeldnerDerVenture++;
                    //this.startedWithsoeldnerDerVenture++;
                }
                if (m.name == CardDB.cardName.summoningportal)
                {
                    this.beschwoerungsportal++;
                    //this.startedWithbeschwoerungsportal++;
                }

                if (m.handcard.card.name == CardDB.cardName.baronrivendare)
                {
                    this.ownBaronRivendare++;
                }
                if (m.handcard.card.name == CardDB.cardName.kelthuzad)
                {
                    //this.needGraveyard = true;
                }

                if (m.name == CardDB.cardName.raidleader)
                {
                    this.anzOwnRaidleader++;
                }
                if (m.name == CardDB.cardName.malganis)
                {
                    this.anzOwnMalGanis++;
                }
                if (m.name == CardDB.cardName.stormwindchampion)
                {
                    this.anzOwnStormwindChamps++;
                }
                if (m.name == CardDB.cardName.tundrarhino)
                {
                    this.anzOwnTundrarhino++;
                }
                if (m.name == CardDB.cardName.timberwolf)
                {
                    this.anzOwnTimberWolfs++;
                }
                if (m.name == CardDB.cardName.murlocwarleader)
                {
                    this.anzMurlocWarleader++;
                }
                if (m.name == CardDB.cardName.grimscaleoracle)
                {
                    this.anzGrimscaleOracle++;
                }
                if (m.name == CardDB.cardName.auchenaisoulpriest)
                {
                    this.anzOwnAuchenaiSoulpriest++;
                }
                if (m.name == CardDB.cardName.sorcerersapprentice)
                {
                    this.anzOwnsorcerersapprentice++;
                    //this.anzOwnsorcerersapprenticeStarted++;
                }
                if (m.name == CardDB.cardName.southseacaptain)
                {
                    this.anzOwnSouthseacaptain++;
                }
                if (m.name == CardDB.cardName.chromaggus)
                {
                    this.anzOwnChromaggus++;
                }
                //if (m.name == CardDB.cardName.dragonconsort && anzOwnDragonConsort > 0) this.anzOwnDragonConsortStarted++;
                if (m.name == CardDB.cardName.mechwarper)
                {
                    this.anzOwnMechwarper++;
                    //this.anzOwnMechwarperStarted++;
                }
                if (m.name == CardDB.cardName.steamwheedlesniper && this.ownHeroName == HeroEnum.hunter)
                {
                    this.weHaveSteamwheedleSniper = true;
                }
            }

            foreach (Handmanager.Handcard hc in this.owncards)
            {
                if (hc.card.name == CardDB.cardName.kelthuzad)
                {
                    //this.needGraveyard = true;
                }
            }
        }
Example #42
0
        public static string heroEnumtoName(HeroEnum s)
        {

            if (s ==HeroEnum.hogger )
            {
                return "hogger";
            }
            if (s == HeroEnum.hunter)
            {
                return "hunter";
            }
            if (s == HeroEnum.priest)
            {
                return "priest";
            }
            if (s == HeroEnum.druid)
            {
                return "druid";
            }
            if (s == HeroEnum.warlock)
            {
                return "warlock";
            }
            if (s == HeroEnum.thief)
            {
                return "thief";
            }
            if (s == HeroEnum.pala)
            {
                return "pala";
            }
            if (s == HeroEnum.warrior)
            {
                return "warrior";
            }
            if (s == HeroEnum.shaman)
            {
                return "shaman";
            }
            if (s == HeroEnum.mage)
            {
                return "mage";
            }
            if (s == HeroEnum.lordjaraxxus)
            {
                return "lordjaraxxus";
            }
            if (s == HeroEnum.ragnarosthefirelord)
            {
                return "ragnarosthefirelord";
            }

            return "druid";
        }
Example #43
0
 public void updateOwnHero(string weapon, int watt, int wdur, bool heroimunewhileattack, int heroatt, int herohp, int herodef, string heron, bool heroready, bool frozen, CardDB.Card hab, bool habrdy, int numAttacksTTurn, bool windfury, bool hisim)
 {
     this.ownHeroWeapon = weapon;
     this.heroWeaponAttack = watt;
     this.heroWeaponDurability = wdur;
     this.heroImmuneToDamageWhileAttacking = heroimunewhileattack;
     this.heroAtk = heroatt;
     this.heroHp = herohp;
     this.heroDefence = herodef;
     this.heroname = this.heroNametoEnum(heron);
     this.ownheroisread = heroready;
     this.herofrozen = frozen;
     this.heroAbility = hab;
     this.ownAbilityisReady = habrdy;
     this.ownHeroWindfury = windfury;
     this.ownHeroNumAttacksThisTurn = numAttacksTTurn;
     this.heroImmune = hisim;
 }
Example #44
0
            public combo(string s)
            {
                int i = 0;

                this.neededMana   = 0;
                requiredWeapon    = CardDB.cardName.unknown;
                this.type         = combotype.combo;
                this.twoTurnCombo = false;
                bool fixmana = false;

                if (s.Contains("nxttrn"))
                {
                    this.twoTurnCombo = true;
                }
                if (s.Contains("mana:"))
                {
                    fixmana = true;
                }

                /*foreach (string ding in s.Split(':'))
                 * {
                 *  if (i == 0)
                 *  {
                 *      if (ding == "c") this.type = combotype.combo;
                 *      if (ding == "t") this.type = combotype.target;
                 *      if (ding == "w") this.type = combotype.weaponuse;
                 *  }
                 *  if (ding == "" || ding == string.Empty) continue;
                 *
                 *  if (i == 1 && type == combotype.combo)
                 *  {
                 *      int m = Convert.ToInt32(ding);
                 *      neededMana = -1;
                 *      if (m >= 1) neededMana = m;
                 *  }
                 */
                if (type == combotype.combo)
                {
                    this.combolength   = 0;
                    this.combot0len    = 0;
                    this.combot1len    = 0;
                    this.combot0lenAll = 0;
                    int  manat0 = 0;
                    int  manat1 = -1;
                    bool t1     = false;
                    foreach (string crdl in s.Split(';')) //ding.Split
                    {
                        if (crdl == "" || crdl == string.Empty)
                        {
                            continue;
                        }
                        if (crdl == "nxttrn")
                        {
                            t1 = true;
                            continue;
                        }
                        if (crdl.StartsWith("mana:"))
                        {
                            this.neededMana = Convert.ToInt32(crdl.Replace("mana:", ""));
                            continue;
                        }
                        if (crdl.StartsWith("hero:"))
                        {
                            this.oHero = Hrtprozis.Instance.heroNametoEnum(crdl.Replace("hero:", ""));
                            continue;
                        }
                        if (crdl.StartsWith("bonus:"))
                        {
                            this.bonusForPlaying = Convert.ToInt32(crdl.Replace("bonus:", ""));
                            continue;
                        }
                        if (crdl.StartsWith("bonusfirst:"))
                        {
                            this.bonusForPlayingT0 = Convert.ToInt32(crdl.Replace("bonusfirst:", ""));
                            continue;
                        }
                        if (crdl.StartsWith("bonussecond:"))
                        {
                            this.bonusForPlayingT1 = Convert.ToInt32(crdl.Replace("bonussecond:", ""));
                            continue;
                        }
                        string crd = crdl.Split(',')[0];
                        if (t1)
                        {
                            manat1 += cb.cdb.getCardDataFromID(cb.cdb.cardIdstringToEnum(crd)).cost;
                        }
                        else
                        {
                            manat0 += cb.cdb.getCardDataFromID(cb.cdb.cardIdstringToEnum(crd)).cost;
                        }
                        this.combolength++;

                        if (combocards.ContainsKey(cb.cdb.cardIdstringToEnum(crd)))
                        {
                            combocards[cb.cdb.cardIdstringToEnum(crd)]++;
                        }
                        else
                        {
                            combocards.Add(cb.cdb.cardIdstringToEnum(crd), 1);
                            cardspen.Add(cb.cdb.cardIdstringToEnum(crd), Convert.ToInt32(crdl.Split(',')[1]));
                        }

                        if (this.twoTurnCombo)
                        {
                            if (t1)
                            {
                                if (this.combocardsTurn1.ContainsKey(cb.cdb.cardIdstringToEnum(crd)))
                                {
                                    combocardsTurn1[cb.cdb.cardIdstringToEnum(crd)]++;
                                }
                                else
                                {
                                    combocardsTurn1.Add(cb.cdb.cardIdstringToEnum(crd), 1);
                                }
                                this.combot1len++;
                            }
                            else
                            {
                                CardDB.Card lolcrd = cb.cdb.getCardDataFromID(cb.cdb.cardIdstringToEnum(crd));
                                if (lolcrd.type == CardDB.cardtype.MOB)
                                {
                                    if (this.combocardsTurn0Mobs.ContainsKey(cb.cdb.cardIdstringToEnum(crd)))
                                    {
                                        combocardsTurn0Mobs[cb.cdb.cardIdstringToEnum(crd)]++;
                                    }
                                    else
                                    {
                                        combocardsTurn0Mobs.Add(cb.cdb.cardIdstringToEnum(crd), 1);
                                    }
                                    this.combot0len++;
                                }
                                if (lolcrd.type == CardDB.cardtype.WEAPON)
                                {
                                    this.requiredWeapon = lolcrd.name;
                                }
                                if (this.combocardsTurn0All.ContainsKey(cb.cdb.cardIdstringToEnum(crd)))
                                {
                                    combocardsTurn0All[cb.cdb.cardIdstringToEnum(crd)]++;
                                }
                                else
                                {
                                    combocardsTurn0All.Add(cb.cdb.cardIdstringToEnum(crd), 1);
                                }
                                this.combot0lenAll++;
                            }
                        }
                    }
                    if (!fixmana)
                    {
                        this.neededMana = Math.Max(manat1, manat0);
                    }
                }

                /*if (i == 2 && type == combotype.combo)
                 * {
                 *  int m = Convert.ToInt32(ding);
                 *  penality = 0;
                 *  if (m >= 1) penality = m;
                 * }
                 *
                 * i++;
                 * }*/
                this.bonusForPlaying   = Math.Max(bonusForPlaying, 1);
                this.bonusForPlayingT0 = Math.Max(bonusForPlayingT0, 1);
                this.bonusForPlayingT1 = Math.Max(bonusForPlayingT1, 1);
            }
Example #45
0
        public int checkIfComboWasPlayed(List<Action> alist, CardDB.cardName weapon, HeroEnum heroname)
        {
            if (this.combos.Count == 0) return 0;
            //returns a penalty only if the combo could be played, but is not played completely
            List<Handmanager.Handcard> playedcards = new List<Handmanager.Handcard>();
            List<combo> searchingCombo = new List<combo>();
            // only check the cards, that are in a combo that can be played:
            int mana = Math.Max(hp.ownMaxMana, hp.currentMana);
            foreach (Action a in alist)
            {
                if (!a.cardplay) continue;
                CardDB.Card crd = a.handcard.card;
                //playedcards.Add(a.handcard);
                foreach (combo c in this.combos)
                {
                    if ((c.oHero == HeroEnum.None || c.oHero == heroname) && c.isCardInCombo(crd))
                    {
                        int iia = c.isInCombo(hm.handCards, hp.ownMaxMana);
                        int iib = c.isMultiTurnComboTurn1(hm.handCards, mana, hp.ownMinions, weapon);
                        int iic = Math.Max(iia, iib);
                        if (iia == 2 && iib != 2 && c.isMultiTurn1Card(crd))
                        {
                            iic = 1;
                        }
                        if (iic == 2)
                        {
                            playedcards.Add(a.handcard); // add only the cards, which dont get a penalty
                        }
                    }

                }
            }

            if (playedcards.Count == 0) return 0;

            bool wholeComboPlayed = false;

            int bonus = 0;
            foreach (combo c in this.combos)
            {
                int iia = c.hasPlayedCombo(playedcards);
                int iib = c.hasPlayedTurn0Combo(playedcards);
                int iic = c.hasPlayedTurn1Combo(playedcards);
                int iie = iia + iib + iic;
                if (iie >= 1)
                {
                    wholeComboPlayed = true;
                    bonus -= iie;
                }
            }

            if (wholeComboPlayed) return bonus;
            return 250;

        }
Example #46
0
        private string getMullRuleKey(CardDB.cardIDEnum cardIDM = CardDB.cardIDEnum.None, HeroEnum ownMHero = HeroEnum.None, HeroEnum enemyMHero = HeroEnum.None, bool HoldM = false)
        {
            StringBuilder MullRuleKey = new StringBuilder("", 500);

            MullRuleKey.Append(cardIDM).Append(";").Append(ownMHero).Append(";").Append(enemyMHero).Append(";").Append(HoldM ? "Hold" : "Discard");
            return(MullRuleKey.ToString());
        }
Example #47
0
            public combo(string s)
            {
                int i = 0;
                this.neededMana = 0;
                requiredWeapon = CardDB.cardName.unknown;
                this.type = combotype.combo;
                this.twoTurnCombo = false;
                bool fixmana = false;
                if (s.Contains("nxttrn")) this.twoTurnCombo = true;
                if (s.Contains("mana:")) fixmana = true;

                /*foreach (string ding in s.Split(':'))
                {
                    if (i == 0)
                    {
                        if (ding == "c") this.type = combotype.combo;
                        if (ding == "t") this.type = combotype.target;
                        if (ding == "w") this.type = combotype.weaponuse;
                    }
                    if (ding == "" || ding == string.Empty) continue;

                    if (i == 1 && type == combotype.combo)
                    {
                        int m = Convert.ToInt32(ding);
                        neededMana = -1;
                        if (m >= 1) neededMana = m;
                    }
                */
                if (type == combotype.combo)
                {
                    this.combolength = 0;
                    this.combot0len = 0;
                    this.combot1len = 0;
                    this.combot0lenAll = 0;
                    int manat0 = 0;
                    int manat1 = -1;
                    bool t1 = false;
                    foreach (string crdl in s.Split(';')) //ding.Split
                    {
                        if (crdl == "" || crdl == string.Empty) continue;
                        if (crdl == "nxttrn")
                        {
                            t1 = true;
                            continue;
                        }
                        if (crdl.StartsWith("mana:"))
                        {
                            this.neededMana = Convert.ToInt32(crdl.Replace("mana:", ""));
                            continue;
                        }
                        if (crdl.StartsWith("hero:"))
                        {
                            this.oHero = Hrtprozis.Instance.heroNametoEnum(crdl.Replace("hero:", ""));
                            continue;
                        }
                        if (crdl.StartsWith("bonus:"))
                        {
                            this.bonusForPlaying = Convert.ToInt32(crdl.Replace("bonus:", ""));
                            continue;
                        }
                        if (crdl.StartsWith("bonusfirst:"))
                        {
                            this.bonusForPlayingT0 = Convert.ToInt32(crdl.Replace("bonusfirst:", ""));
                            continue;
                        }
                        if (crdl.StartsWith("bonussecond:"))
                        {
                            this.bonusForPlayingT1 = Convert.ToInt32(crdl.Replace("bonussecond:", ""));
                            continue;
                        }
                        string crd = crdl.Split(',')[0];
                        if (t1)
                        {
                            manat1 += CardDB.Instance.getCardDataFromID(CardDB.Instance.cardIdstringToEnum(crd)).cost;
                        }
                        else
                        {
                            manat0 += CardDB.Instance.getCardDataFromID(CardDB.Instance.cardIdstringToEnum(crd)).cost;
                        }
                        this.combolength++;

                        if (combocards.ContainsKey(CardDB.Instance.cardIdstringToEnum(crd)))
                        {
                            combocards[CardDB.Instance.cardIdstringToEnum(crd)]++;
                        }
                        else
                        {
                            combocards.Add(CardDB.Instance.cardIdstringToEnum(crd), 1);
                            cardspen.Add(CardDB.Instance.cardIdstringToEnum(crd), Convert.ToInt32(crdl.Split(',')[1]));
                        }

                        if (this.twoTurnCombo)
                        {

                            if (t1)
                            {
                                if (this.combocardsTurn1.ContainsKey(CardDB.Instance.cardIdstringToEnum(crd)))
                                {
                                    combocardsTurn1[CardDB.Instance.cardIdstringToEnum(crd)]++;
                                }
                                else
                                {
                                    combocardsTurn1.Add(CardDB.Instance.cardIdstringToEnum(crd), 1);
                                }
                                this.combot1len++;
                            }
                            else
                            {
                                CardDB.Card lolcrd = CardDB.Instance.getCardDataFromID(CardDB.Instance.cardIdstringToEnum(crd));
                                if (lolcrd.type == CardDB.cardtype.MOB)
                                {
                                    if (this.combocardsTurn0Mobs.ContainsKey(CardDB.Instance.cardIdstringToEnum(crd)))
                                    {
                                        combocardsTurn0Mobs[CardDB.Instance.cardIdstringToEnum(crd)]++;
                                    }
                                    else
                                    {
                                        combocardsTurn0Mobs.Add(CardDB.Instance.cardIdstringToEnum(crd), 1);
                                    }
                                    this.combot0len++;
                                }
                                if (lolcrd.type == CardDB.cardtype.WEAPON)
                                {
                                    this.requiredWeapon = lolcrd.name;
                                }
                                if (this.combocardsTurn0All.ContainsKey(CardDB.Instance.cardIdstringToEnum(crd)))
                                {
                                    combocardsTurn0All[CardDB.Instance.cardIdstringToEnum(crd)]++;
                                }
                                else
                                {
                                    combocardsTurn0All.Add(CardDB.Instance.cardIdstringToEnum(crd), 1);
                                }
                                this.combot0lenAll++;
                            }
                        }


                    }
                    if (!fixmana)
                    {
                        this.neededMana = Math.Max(manat1, manat0);
                    }
                }

                /*if (i == 2 && type == combotype.combo)
                {
                    int m = Convert.ToInt32(ding);
                    penality = 0;
                    if (m >= 1) penality = m;
                }

                i++;
            }*/
            }
Example #48
0
        public Playfield()
        {
            //this.simulateEnemyTurn = Ai.Instance.simulateEnemyTurn;
            this.ownController = Hrtprozis.Instance.getOwnController();
            this.ownHeroEntity = Hrtprozis.Instance.ownHeroEntity;
            this.enemyHeroEntity = Hrtprozis.Instance.enemyHeroEntitiy;
            this.mana = Hrtprozis.Instance.currentMana;
            this.ownMaxMana = Hrtprozis.Instance.ownMaxMana;
            this.enemyMaxMana = Hrtprozis.Instance.enemyMaxMana;
            this.evaluatePenality = 0;
            this.ownSecretsIDList = Hrtprozis.Instance.ownSecretList;
            this.enemySecretCount = Hrtprozis.Instance.enemySecretCount;

            this.heroImmune = Hrtprozis.Instance.heroImmune;
            this.enemyHeroImmune = Hrtprozis.Instance.enemyHeroImmune;

            this.attackFaceHP = Hrtprozis.Instance.attackFaceHp;

            addMinionsReal(Hrtprozis.Instance.ownMinions, ownMinions);
            addMinionsReal(Hrtprozis.Instance.enemyMinions, enemyMinions);
            addCardsReal(Handmanager.Instance.handCards);
            this.enemyHeroHp = Hrtprozis.Instance.enemyHp;
            this.ownHeroName = Hrtprozis.Instance.heroname;
            this.enemyHeroName = Hrtprozis.Instance.enemyHeroname;
            this.ownHeroHp = Hrtprozis.Instance.heroHp;
            this.complete = false;
            this.ownHeroReady = Hrtprozis.Instance.ownheroisread;
            this.ownHeroWindfury = Hrtprozis.Instance.ownHeroWindfury;
            this.ownHeroNumAttackThisTurn = Hrtprozis.Instance.ownHeroNumAttacksThisTurn;

            this.ownHeroFrozen = Hrtprozis.Instance.herofrozen;
            this.enemyHeroFrozen = Hrtprozis.Instance.enemyfrozen;
            this.ownheroAngr = Hrtprozis.Instance.heroAtk;
            this.heroImmuneWhileAttacking = Hrtprozis.Instance.heroImmuneToDamageWhileAttacking;
            this.ownWeaponDurability = Hrtprozis.Instance.heroWeaponDurability;
            this.ownWeaponAttack = Hrtprozis.Instance.heroWeaponAttack;
            this.ownWeaponName = Hrtprozis.Instance.ownHeroWeapon;
            this.owncarddraw = 0;
            this.ownHeroDefence = Hrtprozis.Instance.heroDefence;
            this.enemyHeroDefence = Hrtprozis.Instance.enemyDefence;
            this.enemyWeaponAttack = Hrtprozis.Instance.enemyWeaponAttack;//dont know jet
            this.enemyWeaponName = Hrtprozis.Instance.enemyHeroWeapon;
            this.enemyWeaponDurability = Hrtprozis.Instance.enemyWeaponDurability;
            this.enemycarddraw = 0;
            this.enemyAnzCards = Handmanager.Instance.enemyAnzCards;
            this.ownAbilityReady = Hrtprozis.Instance.ownAbilityisReady;
            this.ownHeroAblility = Hrtprozis.Instance.heroAbility;
            this.enemyHeroAblility = Hrtprozis.Instance.enemyAbility;
            this.doublepriest = 0;
            this.spellpower = 0;
            this.mobsplayedThisTurn = Hrtprozis.Instance.numMinionsPlayedThisTurn;
            this.startedWithMobsPlayedThisTurn = Hrtprozis.Instance.numMinionsPlayedThisTurn;// only change mobsplayedthisturm
            this.cardsPlayedThisTurn = Hrtprozis.Instance.cardsPlayedThisTurn;
            this.ueberladung = Hrtprozis.Instance.ueberladung;

            this.ownHeroFatigue = Hrtprozis.Instance.ownHeroFatigue;
            this.enemyHeroFatigue = Hrtprozis.Instance.enemyHeroFatigue;
            this.ownDeckSize = Hrtprozis.Instance.ownDeckSize;
            this.enemyDeckSize = Hrtprozis.Instance.enemyDeckSize;

            //need the following for manacost-calculation
            this.ownHeroHpStarted = this.ownHeroHp;
            this.enemyHeroHpStarted = this.enemyHeroHp;
            this.ownWeaponAttackStarted = this.ownWeaponAttack;
            this.ownCardsCountStarted = this.owncards.Count;
            this.ownMobsCountStarted = this.ownMinions.Count + this.enemyMinions.Count;

            this.playedmagierinderkirintor = false;
            this.playedPreparation = false;

            this.zauberlehrling = 0;
            this.winzigebeschwoererin = 0;
            this.managespenst = 0;
            this.soeldnerDerVenture = 0;
            this.beschwoerungsportal = 0;

            this.startedWithbeschwoerungsportal = 0;
            this.startedWithManagespenst = 0;
            this.startedWithWinzigebeschwoererin = 0;
            this.startedWithZauberlehrling = 0;
            this.startedWithsoeldnerDerVenture = 0;

            this.ownBaronRivendare = false;
            this.enemyBaronRivendare = false;

            foreach (Minion m in this.ownMinions)
            {
                if (m.silenced) continue;

                if (m.name == "prophetvelen") this.doublepriest++;
                spellpower = spellpower + m.handcard.card.spellpowervalue;
                if (m.name == "auchenaisoulpriest") this.auchenaiseelenpriesterin = true;

                if (m.name == "pint-sizedsummoner")
                {
                    this.winzigebeschwoererin++;
                    this.startedWithWinzigebeschwoererin++;
                }
                if (m.name == "sorcerersapprentice")
                {
                    this.zauberlehrling++;
                    this.startedWithZauberlehrling++;
                }
                if (m.name == "manawraith")
                {
                    this.managespenst++;
                    this.startedWithManagespenst++;
                }
                if (m.name == "venturecomercenary")
                {
                    this.soeldnerDerVenture++;
                    this.startedWithsoeldnerDerVenture++;
                }
                if (m.name == "summoningportal")
                {
                    this.beschwoerungsportal++;
                    this.startedWithbeschwoerungsportal++;
                }

                if (m.handcard.card.specialMin == CardDB.specialMinions.baronrivendare)
                {
                    this.ownBaronRivendare = true;
                }

                foreach (Enchantment e in m.enchantments)// only at first init needed, after that its copied
                {
                    if (e.CARDID == "NEW1_036e" || e.CARDID == "NEW1_036e2") m.cantLowerHPbelowONE = true;
                }
            }

            foreach (Minion m in this.enemyMinions)
            {
                if (m.silenced) continue;
                if (m.name == "manawraith")
                {
                    this.managespenst++;
                    this.startedWithManagespenst++;
                }
                if (m.handcard.card.specialMin == CardDB.specialMinions.baronrivendare)
                {
                    this.enemyBaronRivendare = true;
                }
            }
        }
Example #49
0
        public Playfield(Playfield p)
        {

            this.nextEntity = p.nextEntity;

            this.isOwnTurn = p.isOwnTurn;
            this.turnCounter = p.turnCounter;

            this.attacked = p.attacked;
            this.sEnemTurn = p.sEnemTurn;
            this.ownController = p.ownController;
            //this.ownHeroEntity = p.ownHeroEntity;
            //this.enemyHeroEntity = p.enemyHeroEntity;

            this.evaluatePenality = p.evaluatePenality;
            this.ownSecretsIDList.AddRange(p.ownSecretsIDList);

            this.enemySecretCount = p.enemySecretCount;

            this.enemySecretList.Clear();
            if (Settings.Instance.useSecretsPlayArround)
            {
                foreach (SecretItem si in p.enemySecretList)
                {
                    this.enemySecretList.Add(new SecretItem(si));
                }
            }

            this.mana = p.mana;
            this.manaTurnEnd = p.manaTurnEnd;
            this.ownMaxMana = p.ownMaxMana;
            this.enemyMaxMana = p.enemyMaxMana;
            addMinionsReal(p.ownMinions, ownMinions);
            addMinionsReal(p.enemyMinions, enemyMinions);
            this.ownHero = new Minion(p.ownHero);
            this.enemyHero = new Minion(p.enemyHero);
            addCardsReal(p.owncards);

            this.ownHeroName = p.ownHeroName;
            this.enemyHeroName = p.enemyHeroName;

            this.playactions.AddRange(p.playactions);
            this.complete = false;

            this.attackFaceHP = p.attackFaceHP;

            this.owncarddraw = p.owncarddraw;

            this.enemyWeaponAttack = p.enemyWeaponAttack;
            this.enemyWeaponDurability = p.enemyWeaponDurability;
            this.enemyWeaponName = p.enemyWeaponName;
            this.enemycarddraw = p.enemycarddraw;
            this.enemyAnzCards = p.enemyAnzCards;

            this.ownWeaponDurability = p.ownWeaponDurability;
            this.ownWeaponAttack = p.ownWeaponAttack;
            this.ownWeaponName = p.ownWeaponName;

            this.lostDamage = p.lostDamage;
            this.lostWeaponDamage = p.lostWeaponDamage;
            this.lostHeal = p.lostHeal;

            this.ownAbilityReady = p.ownAbilityReady;
            this.enemyAbilityReady = p.enemyAbilityReady;
            this.ownHeroAblility = new Handmanager.Handcard(p.ownHeroAblility);
            this.enemyHeroAblility = new Handmanager.Handcard(p.enemyHeroAblility);

            this.spellpower = 0;
            this.mobsplayedThisTurn = p.mobsplayedThisTurn;
            this.optionsPlayedThisTurn = p.optionsPlayedThisTurn;
            this.cardsPlayedThisTurn = p.cardsPlayedThisTurn;
            this.owedRecall = p.owedRecall;
            this.currentRecall = p.currentRecall;
            this.enemyRecall = p.enemyRecall;
            this.enemyCurrentRecall = p.enemyCurrentRecall;

            this.ownDeckSize = p.ownDeckSize;
            this.enemyDeckSize = p.enemyDeckSize;
            this.ownHeroFatigue = p.ownHeroFatigue;
            this.enemyHeroFatigue = p.enemyHeroFatigue;

            //need the following for manacost-calculation

            this.playedmagierinderkirintor = p.playedmagierinderkirintor;


            this.nerubarweblord = p.nerubarweblord;
            this.winzigebeschwoererin = p.winzigebeschwoererin;
            this.managespenst = p.managespenst;
            this.soeldnerDerVenture = p.soeldnerDerVenture;
            this.ownloatheb = p.ownloatheb;
            this.enemyloatheb = p.enemyloatheb;

            this.spellpower = p.spellpower;
            this.enemyspellpower = p.enemyspellpower;

            this.needGraveyard = p.needGraveyard;
            if (p.needGraveyard) this.diedMinions = new List<GraveYardItem>(p.diedMinions);

            //####buffs#############################

            this.anzOwnRaidleader = p.anzOwnRaidleader;
            this.anzEnemyRaidleader = p.anzEnemyRaidleader;
            this.anzOwnMalGanis = p.anzOwnMalGanis;
            this.anzEnemyMalGanis = p.anzEnemyMalGanis;
            this.anzOwnStormwindChamps = p.anzOwnStormwindChamps;
            this.anzEnemyStormwindChamps = p.anzEnemyStormwindChamps;
            this.anzOwnTundrarhino = p.anzOwnTundrarhino;
            this.anzEnemyTundrarhino = p.anzEnemyTundrarhino;
            this.anzOwnTimberWolfs = p.anzOwnTimberWolfs;
            this.anzEnemyTimberWolfs = p.anzEnemyTimberWolfs;
            this.anzMurlocWarleader = p.anzMurlocWarleader;
            this.anzGrimscaleOracle = p.anzGrimscaleOracle;
            this.anzOwnAuchenaiSoulpriest = p.anzOwnAuchenaiSoulpriest;
            this.anzEnemyAuchenaiSoulpriest = p.anzEnemyAuchenaiSoulpriest;
            this.anzOwnsorcerersapprentice = p.anzOwnsorcerersapprentice;
            this.anzOwnsorcerersapprenticeStarted = p.anzOwnsorcerersapprenticeStarted;
            this.anzEnemysorcerersapprentice = p.anzEnemysorcerersapprentice;
            this.anzEnemysorcerersapprenticeStarted = p.anzEnemysorcerersapprenticeStarted;
            this.anzOwnSouthseacaptain = p.anzOwnSouthseacaptain;
            this.anzEnemySouthseacaptain = p.anzEnemySouthseacaptain;
            this.anzOwnMechwarper = p.anzOwnMechwarper;
            this.anzOwnMechwarperStarted = p.anzOwnMechwarperStarted;
            this.anzEnemyMechwarper = p.anzEnemyMechwarper;
            this.anzEnemyMechwarperStarted = p.anzEnemyMechwarperStarted;

            this.feugenDead = p.feugenDead;
            this.stalaggDead = p.stalaggDead;

            this.weHavePlayedMillhouseManastorm = p.weHavePlayedMillhouseManastorm;
            this.enemyHavePlayedMillhouseManastorm = p.enemyHavePlayedMillhouseManastorm;

            this.doublepriest = p.doublepriest;
            this.enemydoublepriest = p.enemydoublepriest;

            this.ownDragonConsort = p.ownDragonConsort;
            this.enemyDragonConsort = p.enemyDragonConsort;

            this.ownBaronRivendare = p.ownBaronRivendare;
            this.enemyBaronRivendare = p.enemyBaronRivendare;

            this.weHaveSteamwheedleSniper = p.weHaveSteamwheedleSniper;
            this.enemyHaveSteamwheedleSniper = p.enemyHaveSteamwheedleSniper;
            //#########################################

            this.anzMinionsDiedThisTurn = p.anzMinionsDiedThisTurn;

            this.tempanzOwnCards = this.owncards.Count;
            this.tempanzEnemyCards = this.enemyAnzCards;

        }
Example #50
0
        public Playfield(Playfield p)
        {
            this.sEnemTurn = p.sEnemTurn;
            this.ownController = p.ownController;
            this.ownHeroEntity = p.ownHeroEntity;
            this.enemyHeroEntity = p.enemyHeroEntity;

            this.evaluatePenality = p.evaluatePenality;

            foreach(string s in p.ownSecretsIDList)
            { this.ownSecretsIDList.Add(s); }
            this.enemySecretCount = p.enemySecretCount;
            this.mana = p.mana;
            this.ownMaxMana = p.ownMaxMana;
            this.enemyMaxMana = p.enemyMaxMana;
            addMinionsReal(p.ownMinions, ownMinions);
            addMinionsReal(p.enemyMinions, enemyMinions);
            addCardsReal(p.owncards);
            this.enemyHeroHp = p.enemyHeroHp;
            this.ownHeroName = p.ownHeroName;
            this.enemyHeroName = p.enemyHeroName;
            this.ownHeroHp = p.ownHeroHp;
            this.playactions.AddRange(p.playactions);
            this.complete = false;
            this.ownHeroReady = p.ownHeroReady;
            this.enemyHeroReady = p.enemyHeroReady;
            this.ownHeroNumAttackThisTurn = p.ownHeroNumAttackThisTurn;
            this.enemyHeroNumAttackThisTurn = p.enemyHeroNumAttackThisTurn;
            this.ownHeroWindfury = p.ownHeroWindfury;

            this.attackFaceHP = p.attackFaceHP;

            this.heroImmune = p.heroImmune;
            this.enemyHeroImmune = p.enemyHeroImmune;

            this.ownheroAngr = p.ownheroAngr;
            this.enemyheroAngr = p.enemyheroAngr;
            this.ownHeroFrozen = p.ownHeroFrozen;
            this.enemyHeroFrozen = p.enemyHeroFrozen;
            this.heroImmuneWhileAttacking = p.heroImmuneWhileAttacking;
            this.enemyheroImmuneWhileAttacking = p.enemyheroImmuneWhileAttacking;
            this.owncarddraw = p.owncarddraw;
            this.ownHeroDefence = p.ownHeroDefence;
            this.enemyWeaponAttack = p.enemyWeaponAttack;
            this.enemyWeaponDurability = p.enemyWeaponDurability;
            this.enemyWeaponName = p.enemyWeaponName;
            this.enemycarddraw = p.enemycarddraw;
            this.enemyAnzCards = p.enemyAnzCards;
            this.enemyHeroDefence = p.enemyHeroDefence;
            this.ownWeaponDurability = p.ownWeaponDurability;
            this.ownWeaponAttack = p.ownWeaponAttack;
            this.ownWeaponName = p.ownWeaponName;

            this.lostDamage = p.lostDamage;
            this.lostWeaponDamage = p.lostWeaponDamage;
            this.lostHeal = p.lostHeal;

            this.ownAbilityReady = p.ownAbilityReady;
            this.enemyAbilityReady = p.enemyAbilityReady;
            this.ownHeroAblility = p.ownHeroAblility;
            this.enemyHeroAblility = p.enemyHeroAblility;
            this.doublepriest = 0;
            this.spellpower = 0;
            this.mobsplayedThisTurn = p.mobsplayedThisTurn;
            this.startedWithMobsPlayedThisTurn = p.startedWithMobsPlayedThisTurn;
            this.cardsPlayedThisTurn = p.cardsPlayedThisTurn;
            this.ueberladung = p.ueberladung;

            this.ownDeckSize = p.ownDeckSize;
            this.enemyDeckSize = p.enemyDeckSize;
            this.ownHeroFatigue = p.ownHeroFatigue;
            this.enemyHeroFatigue = p.enemyHeroFatigue;

            //need the following for manacost-calculation
            this.ownHeroHpStarted = p.ownHeroHpStarted;
            this.enemyHeroHp = p.enemyHeroHp;
            this.ownWeaponAttackStarted = p.ownWeaponAttackStarted;
            this.ownCardsCountStarted = p.ownCardsCountStarted;
            this.ownMobsCountStarted = p.ownMobsCountStarted;

            this.startedWithWinzigebeschwoererin = p.startedWithWinzigebeschwoererin;
            this.playedmagierinderkirintor = p.playedmagierinderkirintor;

            this.startedWithZauberlehrling = p.startedWithZauberlehrling;
            this.startedWithWinzigebeschwoererin = p.startedWithWinzigebeschwoererin;
            this.startedWithManagespenst = p.startedWithManagespenst;
            this.startedWithsoeldnerDerVenture = p.startedWithsoeldnerDerVenture;
            this.startedWithbeschwoerungsportal = p.startedWithbeschwoerungsportal;

            this.ownBaronRivendare = false;
            this.enemyBaronRivendare = false;

            this.zauberlehrling = 0;
            this.winzigebeschwoererin = 0;
            this.managespenst = 0;
            this.soeldnerDerVenture = 0;
            foreach (Minion m in this.ownMinions)
            {
                if (m.silenced) continue;

                if (m.handcard.card.specialMin == CardDB.specialMinions.prophetvelen) this.doublepriest++;
                spellpower = spellpower + m.handcard.card.spellpowervalue;
                if (m.handcard.card.specialMin == CardDB.specialMinions.auchenaisoulpriest) this.auchenaiseelenpriesterin = true;
                if (m.handcard.card.specialMin == CardDB.specialMinions.pintsizedsummoner) this.winzigebeschwoererin++;
                if (m.handcard.card.specialMin == CardDB.specialMinions.sorcerersapprentice) this.zauberlehrling++;
                if (m.handcard.card.specialMin == CardDB.specialMinions.manawraith) this.managespenst++;
                if (m.handcard.card.specialMin == CardDB.specialMinions.venturecomercenary) this.soeldnerDerVenture++;
                if (m.handcard.card.specialMin == CardDB.specialMinions.summoningportal) this.beschwoerungsportal++;
                if (m.handcard.card.specialMin == CardDB.specialMinions.baronrivendare)
                {
                    this.ownBaronRivendare = true;
                }

            }

            foreach (Minion m in this.enemyMinions)
            {
                if (m.silenced) continue;

                if (m.handcard.card.specialMin == CardDB.specialMinions.manawraith) this.managespenst++;
                if (m.handcard.card.specialMin == CardDB.specialMinions.baronrivendare)
                {
                    this.enemyBaronRivendare = true;
                }
            }
        }
Example #51
0
        public void getEnemySecretGuesses(List<int> enemySecretIds, HeroEnum enemyHeroName)
        {
            List<SecretItem> newlist = new List<SecretItem>();

            foreach (int i in enemySecretIds)
            {
                if (i >= 1000) continue;
                Helpfunctions.Instance.logg("detect secret with id" + i);
                SecretItem sec = getNewSecretGuessedItem(i, enemyHeroName);

                newlist.Add(new SecretItem(sec));
            }

            this.enemySecrets.Clear();
            this.enemySecrets.AddRange(newlist);
        }
Example #52
0
        public void updateOwnHero(string weapon, int watt, int wdur, string heron, CardDB.Card hab, bool habrdy, Minion Hero)
        {
            this.ownHeroWeapon = CardDB.Instance.cardNamestringToEnum(weapon);
            this.heroWeaponAttack = watt;
            this.heroWeaponDurability = wdur;

            this.heroname = this.heroNametoEnum(heron);

            this.heroAbility = hab;
            this.ownAbilityisReady = habrdy;

            this.ownHero = new Minion(Hero);
            this.ownHero.updateReadyness();
        }
Example #53
0
        public Player(int player)
        {

            this.ownController = player;
 
            this.mana = (player == 0)? 1: 0;
            this.manaTurnEnd = this.mana;
            this.ownMaxMana = mana;
            this.evaluatePenality = 0;

            this.attackFaceHP = 15;

            //this.complete = false;

            this.ownHero = new Minion();
            this.ownHero.cardClass = TAG_CLASS.MAGE;

            //implementation
            this.ownHero.isHero = true;
            this.ownHero.own = (player == 0) ? true : false;
            this.ownHero.maxHp = 30;
            this.ownHero.entitiyID = player;

            this.ownHero.Angr = 0;
            this.ownHero.Hp = 30;
            this.ownHero.armor = 0;
            this.ownHero.frozen = false;
            this.ownHero.immuneWhileAttacking = false;
            this.ownHero.immune = false;
            this.ownHero.numAttacksThisTurn = 0;
            this.ownHero.windfury = false;

            //end of implementation

            //addCardsReal(homeHandManager.handCards);

            this.ownHeroName = HeroEnum.mage;
            this.ownHeroStartClass = TAG_CLASS.MAGE;
            /*
            this.enemyHeroHp = hrtprozis.enemyHp;
            this.ownHeroHp = hrtprozis.heroHp;
            this.ownHeroReady = hrtprozis.ownheroisread;
            this.ownHeroWindfury = hrtprozis.ownHeroWindfury;
            this.ownHeroNumAttackThisTurn = hrtprozis.ownHeroNumAttacksThisTurn;
            this.ownHeroFrozen = hrtprozis.herofrozen;
            this.enemyHeroFrozen = hrtprozis.enemyfrozen;
            this.ownheroAngr = hrtprozis.heroAtk;
            this.heroImmuneWhileAttacking = hrtprozis.heroImmuneToDamageWhileAttacking;
            this.ownHeroDefence = hrtprozis.heroDefence;
            this.enemyHeroDefence = hrtprozis.enemyDefence;
             */

            //####buffs#############################

            this.anzOwnRaidleader = 0;
            this.anzOwnStormwindChamps = 0;
            this.anzOwnTundrarhino = 0;
            this.anzOwnTimberWolfs = 0;
            this.anzMurlocWarleader = 0;
            this.anzGrimscaleOracle = 0;
            this.anzOwnAuchenaiSoulpriest = 0;
            this.anzOwnsorcerersapprentice = 0;
            //this.anzOwnsorcerersapprenticeStarted = 0;
            this.anzOwnSouthseacaptain = 0;
            //this.anzOwnDragonConsortStarted = 0;

            this.ownMinionsDiedTurn = 0;

            //this.feugenDead = false;
            //this.stalaggDead = false;

            this.doublepriest = 0;

            this.ownBaronRivendare = 0;
            //#########################################

            this.ownWeaponDurability = 0;
            this.ownWeaponAttack = 0;
            this.ownWeaponName = CardDB.cardName.unknown;
            this.owncarddraw = 0;

            this.ownAbilityReady = true;
            this.ownHeroAblility = new Handmanager.Handcard(CardDB.Instance.getCardData(CardDB.Instance.cardNamestringToEnum("fireblast")));

            this.mobsplayedThisTurn = 0;
            //this.startedWithMobsPlayedThisTurn = 0;// only change mobsplayedthisturm
            this.cardsPlayedThisTurn = 0;
            //todo:
            this.optionsPlayedThisTurn = 0;

            this.ueberladung = 0;

            this.ownHeroFatigue = 0;
            this.ownDeckSize = 30;

            //need the following for manacost-calculation
            //this.ownHeroHpStarted = this.ownHero.Hp;
            //this.ownWeaponAttackStarted = this.ownWeaponAttack;
            //this.ownCardsCountStarted = this.owncards.Count;
            //this.ownMobsCountStarted = this.ownMinions.Count + this.enemyMinions.Count;

            this.playedmagierinderkirintor = false;
            this.playedPreparation = false;

            this.winzigebeschwoererin = 0;
            this.managespenst = 0;
            this.soeldnerDerVenture = 0;
            this.beschwoerungsportal = 0;
            this.nerubarweblord = 0;

            //this.startedWithnerubarweblord = 0;
            //this.startedWithbeschwoerungsportal = 0;
            //this.startedWithManagespenst = 0;
            //this.startedWithWinzigebeschwoererin = 0;
            //this.startedWithsoeldnerDerVenture = 0;

            this.ownBaronRivendare = 0;

            //this.loatheb = false;
            this.spellpower = 0;

            //this.startedWithDamagedMinions = false;

            foreach (Minion m in this.ownMinions)
            {
                //if (m.Hp < m.maxHp && m.Hp >= 1) this.startedWithDamagedMinions = true;
                //if (m.playedThisTurn && m.name == CardDB.cardName.loatheb) this.loatheb = true;

                spellpower = spellpower + m.spellpower;
                if (m.silenced) continue;
                spellpower += m.handcard.card.spellpowervalue;
                if (m.name == CardDB.cardName.prophetvelen) this.doublepriest++;


                if (m.name == CardDB.cardName.pintsizedsummoner)
                {
                    this.winzigebeschwoererin++;
                    //this.startedWithWinzigebeschwoererin++;
                }

                if (m.name == CardDB.cardName.manawraith)
                {
                    this.managespenst++;
                    //this.startedWithManagespenst++;
                }
                if (m.name == CardDB.cardName.nerubarweblord)
                {
                    this.nerubarweblord++;
                    //this.startedWithnerubarweblord++;
                }
                if (m.name == CardDB.cardName.venturecomercenary)
                {
                    this.soeldnerDerVenture++;
                    //this.startedWithsoeldnerDerVenture++;
                }
                if (m.name == CardDB.cardName.summoningportal)
                {
                    this.beschwoerungsportal++;
                    //this.startedWithbeschwoerungsportal++;
                }

                if (m.handcard.card.name == CardDB.cardName.baronrivendare)
                {
                    this.ownBaronRivendare++;
                }
                if (m.handcard.card.name == CardDB.cardName.kelthuzad)
                {
                    //this.needGraveyard = true;
                }

                if (m.name == CardDB.cardName.raidleader) this.anzOwnRaidleader++;
                if (m.name == CardDB.cardName.malganis) this.anzOwnMalGanis++;
                if (m.name == CardDB.cardName.stormwindchampion) this.anzOwnStormwindChamps++;
                if (m.name == CardDB.cardName.tundrarhino) this.anzOwnTundrarhino++;
                if (m.name == CardDB.cardName.timberwolf) this.anzOwnTimberWolfs++;
                if (m.name == CardDB.cardName.murlocwarleader) this.anzMurlocWarleader++;
                if (m.name == CardDB.cardName.grimscaleoracle) this.anzGrimscaleOracle++;
                if (m.name == CardDB.cardName.auchenaisoulpriest) this.anzOwnAuchenaiSoulpriest++;
                if (m.name == CardDB.cardName.sorcerersapprentice)
                {
                    this.anzOwnsorcerersapprentice++;
                    //this.anzOwnsorcerersapprenticeStarted++;
                }
                if (m.name == CardDB.cardName.southseacaptain) this.anzOwnSouthseacaptain++;
                if (m.name == CardDB.cardName.chromaggus) this.anzOwnChromaggus++;
                //if (m.name == CardDB.cardName.dragonconsort && anzOwnDragonConsort > 0) this.anzOwnDragonConsortStarted++;
                if (m.name == CardDB.cardName.mechwarper)
                {
                    this.anzOwnMechwarper++;
                    //this.anzOwnMechwarperStarted++;
                }
                if (m.name == CardDB.cardName.steamwheedlesniper && this.ownHeroName == HeroEnum.hunter)
                {
                    this.weHaveSteamwheedleSniper = true;
                }

            }

            foreach (Handmanager.Handcard hc in this.owncards)
            {

                if (hc.card.name == CardDB.cardName.kelthuzad)
                {
                    //this.needGraveyard = true;
                }
            }
        }