Beispiel #1
0
        public static bool isPlayRuleOK(HREngine.Private.Rule rule, Playfield p)
        {
            bool retval = true;
            RuleEntity entity = (RuleEntity)rule.Entity;
            RuleMethod method = (RuleMethod)rule.Method;
            // wrong target
            if (entity == RuleEntity.PlayerMinionField)
            {
                List<int> values = new List<int>();
                foreach (Minion m in p.ownMinions)
                {
                    if (method == RuleMethod.GetAttack)
                    {
                        values.Add(m.Angr);
                    }
                    if (method == RuleMethod.GetHealth)
                    {
                        values.Add(m.Hp);
                    }
                    if (method == RuleMethod.GetMana)
                    {
                        values.Add(m.Hp);
                    }
                }
                
            }

            if (entity == RuleEntity.EnemyMinionField) return false;
            return retval;
        }
Beispiel #2
0
 public Handcard(HREngine.Bots.Handmanager.Handcard hc)
 {
     this.position = hc.position;
     this.entity = hc.entity;
     this.manacost = hc.manacost;
     this.card = new CardDB.Card(hc.card);
     this.addattack = hc.addattack;
     this.addHp = hc.addHp;
 }
Beispiel #3
0
        public Minion(HREngine.Bots.Minion m)
        {
            //dont silence----------------------------
            this.anzGotDmg = m.anzGotDmg;
            this.isHero = m.isHero;
            this.own = m.own;

            this.name = (CardDB.cardName)Enum.Parse(typeof(CardDB.cardName), m.name.ToString());
            this.cardClass = (TAG_CLASS)Enum.Parse(typeof(TAG_CLASS), m.cardClass.ToString());
            this.handcard = new Handmanager.Handcard(m.handcard);//new?
            this.entitiyID = m.entitiyID;
            this.zonepos = m.zonepos;

            this.allreadyAttacked = m.allreadyAttacked;


            this.playedThisTurn = m.playedThisTurn;
            this.numAttacksThisTurn = m.numAttacksThisTurn;
            this.immuneWhileAttacking = m.immuneWhileAttacking;

            //---------------------------------------
            this.shadowmadnessed = m.shadowmadnessed;

            this.ancestralspirit = m.ancestralspirit;
            this.destroyOnOwnTurnStart = m.destroyOnOwnTurnStart; // depends on own!
            this.destroyOnEnemyTurnStart = m.destroyOnEnemyTurnStart; // depends on own!
            this.destroyOnOwnTurnEnd = m.destroyOnOwnTurnEnd; // depends on own!
            this.destroyOnEnemyTurnEnd = m.destroyOnEnemyTurnEnd; // depends on own!

            this.concedal = m.concedal;
            this.souloftheforest = m.souloftheforest;

            this.ownBlessingOfWisdom = m.ownBlessingOfWisdom;
            this.enemyBlessingOfWisdom = m.enemyBlessingOfWisdom;
            this.spellpower = m.spellpower;

            this.Hp = m.Hp;
            this.maxHp = m.maxHp;
            this.armor = m.armor;

            this.Angr = m.Angr;
            this.AdjacentAngr = m.AdjacentAngr;
            this.tempAttack = m.tempAttack;

            this.Ready = m.Ready;

            this.taunt = m.taunt;
            this.wounded = m.wounded;

            this.divineshild = m.divineshild;
            this.windfury = m.windfury;
            this.frozen = m.frozen;
            this.stealth = m.stealth;
            this.immune = m.immune;
            this.exhausted = m.exhausted;

            this.charge = m.charge;
            this.poisonous = m.poisonous;
            this.cantLowerHPbelowONE = m.cantLowerHPbelowONE;

            this.silenced = m.silenced;

            // Drew: fixed
            this.cantBeTargetedBySpellsOrHeroPowers = m.cantBeTargetedBySpellsOrHeroPowers;
        }
Beispiel #4
0
 public Card(HREngine.Bots.CardDB.Card c)
 {
     this.playrequires = new List<ErrorType2>();
     //this.entityID = c.entityID;
     this.rarity = c.rarity;
     this.AdjacentBuff = c.AdjacentBuff;
     this.Attack = c.Attack;
     this.Aura = c.Aura;
     this.battlecry = c.battlecry;
     //this.CardID = c.CardID;
     this.Charge = c.Charge;
     this.choice = c.choice;
     this.Combo = c.Combo;
     this.cost = c.cost;
     this.deathrattle = c.deathrattle;
     //this.description = c.description;
     this.Durability = c.Durability;
     this.Elite = c.Elite;
     this.Enrage = c.Enrage;
     this.Freeze = c.Freeze;
     this.GrantCharge = c.GrantCharge;
     this.HealTarget = c.HealTarget;
     this.Health = c.Health;
     this.immuneToSpellpowerg = c.immuneToSpellpowerg;
     this.immuneWhileAttacking = c.immuneWhileAttacking;
     this.Morph = c.Morph;
     this.name = (cardName)Enum.Parse(typeof(cardName), c.name.ToString());
     this.needEmptyPlacesForPlaying = c.needEmptyPlacesForPlaying;
     this.needMinionsCapIfAvailable = c.needMinionsCapIfAvailable;
     this.needMinNumberOfEnemy = c.needMinNumberOfEnemy;
     this.needMinTotalMinions = c.needMinTotalMinions;
     this.needRaceForPlaying = c.needRaceForPlaying;
     this.needWithMaxAttackValueOf = c.needWithMaxAttackValueOf;
     this.needWithMinAttackValueOf = c.needWithMinAttackValueOf;
     this.oneTurnEffect = c.oneTurnEffect;
     foreach (CardDB.ErrorType2 e in c.playrequires)
     {
         ErrorType2 mError = (ErrorType2)Enum.Parse(typeof(ErrorType2), e.ToString());
         this.playrequires.Add(mError);
     }
     this.poisionous = c.poisionous;
     this.race = c.race;
     this.Recall = c.Recall;
     this.recallValue = c.recallValue;
     this.Secret = c.Secret;
     this.Shield = c.Shield;
     this.Silence = c.Silence;
     this.Spellpower = c.Spellpower;
     this.spellpowervalue = c.spellpowervalue;
     this.Stealth = c.Stealth;
     this.tank = c.tank;
     this.target = c.target;
     //this.targettext = c.targettext;
     this.type = (cardtype)Enum.Parse(typeof(cardtype), c.type.ToString());
     this.windfury = c.windfury;
     this.cardIDenum = (cardIDEnum)Enum.Parse(typeof(cardIDEnum), c.cardIDenum.ToString());
     this.sim_card = Instance.getSimCard(this.cardIDenum);
     this.isToken = c.isToken;
 }