示例#1
0
 public Minion(Minion m)
 {
     this.id = m.id;
     this.Posix = m.Posix;
     this.Posiy = m.Posiy;
     this.Hp = m.Hp;
     this.maxHp = m.maxHp;
     this.Angr = m.Angr;
     this.Ready = m.Ready;
     this.taunt = m.taunt;
     this.wounded = m.wounded;
     this.name = m.name;
     this.handcard = m.handcard;
     this.divineshild = m.divineshild;
     this.windfury = m.windfury;
     this.frozen = m.frozen;
     this.zonepos = m.zonepos;
     this.stealth = m.stealth;
     this.immune = m.immune;
     this.exhausted = m.exhausted;
     this.numAttacksThisTurn = m.numAttacksThisTurn;
     this.playedThisTurn = m.playedThisTurn;
     this.charge = m.charge;
     this.poisonous = m.poisonous;
     this.silenced = m.silenced;
     this.entitiyID = m.entitiyID;
     this.enchantments= new List<Enchantment>(m.enchantments);
     this.cantLowerHPbelowONE = m.cantLowerHPbelowONE;
 }
示例#2
0
 public BoardObj(BoardObj bo)
 {
     this.Name                = bo.Name;
     this.card                = bo.card;
     this.type                = bo.type;
     this.Transport           = bo.Transport;
     this.affectOn            = bo.affectOn;
     this.Position            = bo.Position;
     this.own                 = bo.own;
     this.pID                 = bo.pID; //-????????
     this.Line                = bo.Line;
     this.GId                 = bo.GId;
     this.cost                = bo.cost;
     this.DeployTime          = bo.DeployTime;
     this.DamageRadius        = bo.DamageRadius;
     this.MaxHP               = bo.MaxHP;
     this.HP                  = bo.HP;
     this.Atk                 = bo.Atk;
     this.Shield              = bo.Shield;
     this.Speed               = bo.Speed;
     this.HitSpeed            = bo.HitSpeed;
     this.MinRange            = bo.MinRange;
     this.Range               = bo.Range;
     this.SightRange          = bo.SightRange;
     this.TargetType          = bo.TargetType;
     this.MaxTargets          = bo.MaxTargets;
     this.attacking           = bo.attacking;
     this.attacked            = bo.attacked;
     this.LifeTime            = bo.LifeTime;
     this.SpawnNumber         = bo.SpawnNumber;
     this.SpawnInterval       = bo.SpawnInterval;
     this.SpawnTime           = bo.SpawnTime;
     this.SpawnCharacterLevel = bo.SpawnCharacterLevel;
     this.frozen              = bo.frozen;
     this.clone               = bo.clone;
     this.startFrozen         = bo.startFrozen;
     this.attacker            = bo.attacker;
     this.target              = bo.target;
     this.DeathEffect         = bo.DeathEffect;
     this.Tower               = bo.Tower;
     this.extraData           = bo.extraData;
 }
示例#3
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;
 }
示例#4
0
 public BoardObj(CardDB.cardName cName, int lvl = 0)
 {
     CardDB.Card c = CardDB.Instance.getCardDataFromName(cName, lvl);
     this.card      = c;
     this.Name      = c.name;
     this.type      = c.type;
     this.Transport = c.Transport;
     this.affectOn  = c.affectType;
     //this.Position = c.Position;
     //this.own = c.own;
     //this.pID = c.pID; //-????????
     //this.Line = c.Line;
     //this.GId = c.GId;
     this.cost         = c.cost;
     this.DeployTime   = c.DeployTime;
     this.DamageRadius = c.DamageRadius;
     this.MaxHP        = c.MaxHP;
     this.HP           = c.MaxHP;
     this.Atk          = c.Atk;
     this.Shield       = c.Shield;
     this.Speed        = c.Speed;
     this.HitSpeed     = c.HitSpeed;
     this.MinRange     = c.MinRange;
     this.Range        = c.MaxRange;
     this.SightRange   = c.SightRange;
     this.TargetType   = c.TargetType;
     this.MaxTargets   = c.MultipleTargets;
     //this.attacking = c.attacking;
     //this.attacked = c.attacked;
     this.LifeTime            = c.LifeTime;
     this.SpawnNumber         = c.SpawnNumber;
     this.SpawnInterval       = c.SpawnInterval;
     this.SpawnTime           = c.SpawnPause;
     this.SpawnCharacterLevel = c.SpawnCharacterLevel;
     //this.frozen = c.frozen;
     //this.startFrozen = c.startFrozen;
     //this.attacker = c.attacker;
     //this.target = c.target;
     this.DeathEffect = c.DeathEffect;
     //this.Tower = c.Tower;
 }
示例#5
0
文件: Minion.cs 项目: shuyi3/AIPJ
        public Minion(HRSim.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;
        }
示例#6
0
        public Minion(Minion m)
        {
            //dont silence----------------------------
            this.anzGotDmg       = m.anzGotDmg;
            this.gotDmgRaw       = m.gotDmgRaw;
            this.isHero          = m.isHero;
            this.own             = m.own;
            this.canAttackNormal = m.canAttackNormal;
            this.name            = m.name;
            this.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.cantBeTargetedBySpellsOrHeroPowers = m.cantBeTargetedBySpellsOrHeroPowers;
            //---------------------------------------
            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.explorersHat = m.explorersHat;

            this.ownBlessingOfWisdom   = m.ownBlessingOfWisdom;
            this.enemyBlessingOfWisdom = m.enemyBlessingOfWisdom;
            this.ownPowerWordGlory     = m.ownPowerWordGlory;
            this.enemyPowerWordGlory   = m.enemyPowerWordGlory;
            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;
            if (m.deathrattles != null)
            {
                this.deathrattles = new List <int>();
                foreach (int dr in m.deathrattles)
                {
                    this.deathrattles.Add(dr);
                }
            }
        }
示例#7
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;
 }
示例#8
0
 public void setMinionTominion(Minion m)
 {
     this.id = m.id;
     this.Posix = m.Posix;
     this.Posiy = m.Posiy;
     this.Hp = m.Hp;
     this.maxHp = m.maxHp;
     this.Angr = m.Angr;
     this.Ready = m.Ready;
     this.taunt = m.taunt;
     this.wounded = m.wounded;
     this.name = m.name;
     this.handcard = m.handcard;
     this.divineshild = m.divineshild;
     this.windfury = m.windfury;
     this.frozen = m.frozen;
     this.zonepos = m.zonepos;
     this.stealth = m.stealth;
     this.immune = m.immune;
     this.exhausted = m.exhausted;
     this.numAttacksThisTurn = m.numAttacksThisTurn;
     this.playedThisTurn = m.playedThisTurn;
     this.charge = m.charge;
     this.poisonous = m.poisonous;
     this.silenced = m.silenced;
     this.entitiyID = m.entitiyID;
     this.enchantments.Clear();
     this.enchantments.AddRange(m.enchantments);
 }
示例#9
0
文件: Minion.cs 项目: shuyi3/AIPJ
        public void setMinionTominion(Minion m)
        {
            //dont silence----------------------------
            this.anzGotDmg = m.anzGotDmg;
            this.isHero    = m.isHero;
            this.own       = m.own;

            this.name      = m.name;
            this.cardClass = m.cardClass;
            this.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 > 0)? m.Hp: m.maxHp;
            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;
        }
示例#10
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();
        }
示例#11
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);
        }
示例#12
0
        public Playfield(Playfield p)
        {
            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);
            
            /*foreach (CardDB.cardIDEnum 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.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.startedWithnerubarweblord = p.startedWithnerubarweblord;

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

            this.nerubarweblord = p.nerubarweblord;
            this.zauberlehrling = p.zauberlehrling;
            this.winzigebeschwoererin = p.winzigebeschwoererin;
            this.managespenst = p.managespenst;
            this.soeldnerDerVenture = p.soeldnerDerVenture;
            this.enemyhasorcanplayKelThuzad = p.enemyhasorcanplayKelThuzad;
            this.ownhasorcanplayKelThuzad = false;
            this.loatheb = p.loatheb;
            this.auchenaiseelenpriesterin = p.auchenaiseelenpriesterin;

            foreach (Minion m in this.ownMinions)
            {
                

                if (m.silenced) continue;

                //if (m.handcard.card.name == CardDB.cardName.prophetvelen) this.doublepriest++;
                spellpower = spellpower + m.handcard.card.spellpowervalue;
                /*if (m.handcard.card.name == CardDB.cardName.auchenaisoulpriest) this.auchenaiseelenpriesterin = true;
                if (m.handcard.card.name == CardDB.cardName.pintsizedsummoner) this.winzigebeschwoererin++;
                if (m.handcard.card.name == CardDB.cardName.sorcerersapprentice) this.zauberlehrling++;
                if (m.handcard.card.name == CardDB.cardName.manawraith) this.managespenst++;
                if (m.handcard.card.name == CardDB.cardName.venturecomercenary) this.soeldnerDerVenture++;
                if (m.handcard.card.name == CardDB.cardName.summoningportal) this.beschwoerungsportal++;
                if (m.handcard.card.name == CardDB.cardName.baronrivendare)
                {
                    this.ownBaronRivendare = true;
                }
                if (m.name == CardDB.cardName.nerubarweblord)
                {
                    this.nerubarweblord++;
                }*/
                if (m.handcard.card.name == CardDB.cardName.kelthuzad)
                {
                    this.ownhasorcanplayKelThuzad = true;
                }
                
            }
            foreach (Handmanager.Handcard hc in this.owncards)
            {
                if (hc.card.name == CardDB.cardName.kelthuzad)
                {
                    this.ownhasorcanplayKelThuzad = true;
                }
            }

            foreach (Minion m in this.enemyMinions)
            {
                if (m.silenced) continue;
                this.enemyspellpower = this.enemyspellpower + m.handcard.card.spellpowervalue;

                /*if (m.handcard.card.name == CardDB.cardName.prophetvelen) this.enemydoublepriest++;
                if (m.handcard.card.name == CardDB.cardName.manawraith) this.managespenst++;
                if (m.name == CardDB.cardName.nerubarweblord) this.nerubarweblord++;
                if (m.handcard.card.name == CardDB.cardName.baronrivendare) this.enemyBaronRivendare = true;
                if (m.handcard.card.name == CardDB.cardName.kelthuzad) this.enemyhasorcanplayKelThuzad = true;*/
            }
            if (this.ownhasorcanplayKelThuzad || this.enemyhasorcanplayKelThuzad) this.diedMinions = new List<Minion>();
        }
示例#13
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.AddRange(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.nerubarweblord = 0;

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

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

            ownhasorcanplayKelThuzad = false;
            enemyhasorcanplayKelThuzad = false;
            this.loatheb = false;

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

                if (m.silenced) continue;

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

                if (m.name == CardDB.cardName.pintsizedsummoner)
                {
                    this.winzigebeschwoererin++;
                    this.startedWithWinzigebeschwoererin++;
                }
                if (m.name == CardDB.cardName.sorcerersapprentice)
                {
                    this.zauberlehrling++;
                    this.startedWithZauberlehrling++;
                }
                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 = true;
                }
                if (m.handcard.card.name == CardDB.cardName.kelthuzad)
                {
                    this.ownhasorcanplayKelThuzad = true;
                }

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

            }
            foreach (Handmanager.Handcard hc in this.owncards)
            {
                if (hc.card.name == CardDB.cardName.kelthuzad)
                {
                    this.ownhasorcanplayKelThuzad = true;
                }
            }

            foreach (Minion m in this.enemyMinions)
            {
                if (m.silenced) continue;
                this.enemyspellpower = this.enemyspellpower + m.handcard.card.spellpowervalue;
                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 = true;
                }
                if (m.handcard.card.name == CardDB.cardName.kelthuzad)
                {
                    this.enemyhasorcanplayKelThuzad = true;
                }
            }
            if (this.ownhasorcanplayKelThuzad || this.enemyhasorcanplayKelThuzad) this.diedMinions = new List<Minion>();

        }
示例#14
0
        private void updateDecks(HRSim.Playfield p, bool own)
        {
            HRSim.Player mPlayer, ePlayer;
            if (own)
            {
                mPlayer = p.playerFirst;
                ePlayer = p.playerSecond;
            }
            else
            {
                mPlayer = p.playerSecond;
                ePlayer = p.playerFirst;
            }

            List <CardDB.cardIDEnum> ownCards   = new List <CardDB.cardIDEnum>();
            List <CardDB.cardIDEnum> enemyCards = new List <CardDB.cardIDEnum>();
            List <GraveYardItem>     graveYard  = new List <GraveYardItem>();

            //own hands
            foreach (HRSim.Handmanager.Handcard c in mPlayer.owncards)
            {
                CardDB.cardIDEnum mCardID = (CardDB.cardIDEnum)Enum.Parse(typeof(CardDB.cardIDEnum), c.card.cardIDenum.ToString());
                ownCards.Add(mCardID);
            }
            //own minions
            foreach (HRSim.Minion m in mPlayer.ownMinions)
            {
                CardDB.cardIDEnum mCardID = (CardDB.cardIDEnum)Enum.Parse(typeof(CardDB.cardIDEnum), m.handcard.card.cardIDenum.ToString());
                ownCards.Add(mCardID);
            }
            //own secret
            foreach (HRSim.CardDB.cardIDEnum c in mPlayer.ownSecretsIDList)
            {
                CardDB.cardIDEnum mCardID = (CardDB.cardIDEnum)Enum.Parse(typeof(CardDB.cardIDEnum), c.ToString());
                ownCards.Add(mCardID);
            }
            //own weapon
            CardDB.cardName weaponName = (CardDB.cardName)Enum.Parse(typeof(CardDB.cardName), mPlayer.ownWeaponName.ToString());
            ownCards.Add(CardDB.Instance.getCardData(weaponName).cardIDenum);

            //playerSecond.own minions
            foreach (HRSim.Minion m in p.playerSecond.ownMinions)
            {
                Minion mMinion = new Minion(m);
                ownCards.Add(mMinion.handcard.card.cardIDenum);
            }
            //playerSecond.own weapon
            weaponName = (CardDB.cardName)Enum.Parse(typeof(CardDB.cardName), p.playerSecond.ownWeaponName.ToString());
            ownCards.Add(CardDB.Instance.getCardData(weaponName).cardIDenum);

            //grave yard
            foreach (HRSim.GraveYardItem g in p.graveYard)
            {
                CardDB.cardIDEnum graveCardID = (CardDB.cardIDEnum)Enum.Parse(typeof(CardDB.cardIDEnum), g.cardid.ToString());
                GraveYardItem     mGraveItem  = new GraveYardItem(graveCardID, g.entity, g.own);
                graveYard.Add(mGraveItem);
            }

            Probabilitymaker.setOwnCards(ownCards);
            Probabilitymaker.setEnemyCards(enemyCards);
            bool isTurnStart = false;

            if (Ai.nextMoveGuess.mana == -100)
            {
                isTurnStart = true;
                Ai.updateTwoTurnSim();
            }
            Probabilitymaker.setGraveYard(graveYard, isTurnStart);
        }
示例#15
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++;
            }*/
            }
示例#16
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);
        }
示例#17
0
        private void lowerWeaponDurability(int value, bool own)
        {
            if (own)
            {
                this.ownWeaponDurability -= value;
                if (this.ownWeaponDurability <= 0)
                {
                    //deathrattle deathsbite
                    if (this.ownWeaponName == CardDB.cardName.deathsbite)
                    {
                        int anz = 1;
                        if (this.ownBaronRivendare) anz = 2;
                        for (int i = 0; i < anz; i++)
                        {
                            int dmg = getSpellDamageDamage(1);
                            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);
                            }
                        }

                    }


                    this.ownheroAngr -= this.ownWeaponAttack;
                    this.ownWeaponDurability = 0;
                    this.ownWeaponAttack = 0;
                    this.ownWeaponName = CardDB.cardName.unknown;

                    foreach (Minion m in this.ownMinions)
                    {
                        if (m.playedThisTurn && m.name == CardDB.cardName.southseadeckhand)
                        {
                            m.Ready = false;
                            m.charge = false;
                        }
                    }
                }
            }
            else
            {
                this.enemyWeaponDurability -= value;
                if (this.enemyWeaponDurability <= 0)
                {
                    //deathrattle deathsbite
                    if (this.enemyWeaponName == CardDB.cardName.deathsbite)
                    {
                        int anz = 1;
                        if (this.enemyBaronRivendare) anz = 2;
                        for (int i = 0; i < anz; i++)
                        {
                            int dmg = getSpellDamageDamage(1);
                            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);
                            }
                        }

                    }

                    this.enemyheroAngr -= this.enemyWeaponAttack;
                    this.enemyWeaponDurability = 0;
                    this.enemyWeaponAttack = 0;
                    this.enemyWeaponName = CardDB.cardName.unknown;
                }
            }
        }
示例#18
0
        public void setMinionToMinion(Minion m)
        {
            //dont silence----------------------------
            this.anzGotDmg    = m.anzGotDmg;
            this.GotDmgValue  = m.GotDmgValue;
            this.anzGotHealed = m.anzGotHealed;
            this.gotInspire   = m.gotInspire;
            this.isHero       = m.isHero;
            this.own          = m.own;

            this.name         = m.name;
            this.cardClass    = m.cardClass;
            this.synergy      = m.synergy;
            this.handcard     = m.handcard;
            this.deathrattle2 = m.deathrattle2;

            this.zonepos = m.zonepos;


            this.allreadyAttacked = m.allreadyAttacked;


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


            this.shadowmadnessed = m.shadowmadnessed;

            this.ancestralspirit         = m.ancestralspirit;
            this.desperatestand          = m.desperatestand;
            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.changeOwnerOnTurnStart  = m.changeOwnerOnTurnStart;

            this.conceal         = m.conceal;
            this.souloftheforest = m.souloftheforest;
            this.stegodon        = m.stegodon;
            this.livingspores    = m.livingspores;
            this.explorershat    = m.explorershat;
            this.returnToHand    = m.returnToHand;
            this.infest          = m.infest;

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

            this.HealthPoints = m.HealthPoints;
            this.maxHp        = m.maxHp;
            this.armor        = m.armor;

            this.Attack         = m.Attack;
            this.AdjacentAttack = m.AdjacentAttack;
            this.tempAttack     = m.tempAttack;


            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.untouchable = m.untouchable;
            this.exhausted   = m.exhausted;

            this.charge  = m.charge;
            this.hChoice = m.hChoice;
            if (m.charge > 0 && !m.frozen && !m.silenced)
            {
                this.Ready = true;
            }
            else
            {
                this.Ready = false;
            }
            this.poisonous           = m.poisonous;
            this.lifesteal           = m.lifesteal;
            this.cantLowerHPbelowONE = m.cantLowerHPbelowONE;

            this.silenced = m.silenced;

            this.cantBeTargetedBySpellsOrHeroPowers = m.cantBeTargetedBySpellsOrHeroPowers;
            this.cantAttackHeroes = m.cantAttackHeroes;
            this.cantAttack       = m.cantAttack;
        }
示例#19
0
        private void equipWeapon(CardDB.Card c)
        {
            if (this.ownWeaponDurability >= 1)
            {
                this.lostWeaponDamage += this.ownWeaponDurability * this.ownWeaponAttack * this.ownWeaponAttack;
                this.lowerWeaponDurability(1000, true);
            }

            this.ownheroAngr = c.Attack;
            this.ownWeaponAttack = c.Attack;
            this.ownWeaponDurability = c.Durability;
            this.ownWeaponName = c.name;
            if (c.name == CardDB.cardName.doomhammer)
            {
                this.ownHeroWindfury = true;
            }
            else
            {
                this.ownHeroWindfury = false;
            }
            if ((this.ownHeroNumAttackThisTurn == 0 || (this.ownHeroWindfury && this.ownHeroNumAttackThisTurn == 1)) && !this.ownHeroFrozen)
            {
                this.ownHeroReady = true;
            }
            if (c.name == CardDB.cardName.gladiatorslongbow)
            {
                this.heroImmuneWhileAttacking = true;
            }
            else
            {
                this.heroImmuneWhileAttacking = false;
            }

            foreach (Minion m in this.ownMinions)
            {
                if (m.playedThisTurn && m.name == CardDB.cardName.southseadeckhand)
                {
                    minionGetCharge(m);
                }
            }

        }
示例#20
0
文件: Player.cs 项目: shuyi3/AIPJ
        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;

        }
示例#21
0
文件: Playfield.cs 项目: shuyi3/AIPJ
        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;


        }
示例#22
0
        public Minion(Minion m)
        {
            //dont silence----------------------------
            //this.anzGotDmg = m.anzGotDmg;
            //this.GotDmgValue = m.GotDmgValue;
            //this.anzGotHealed = m.anzGotHealed;
            this.gotInspire = m.gotInspire;
            this.isHero     = m.isHero;
            this.own        = m.own;

            this.name         = m.name;
            this.cardClass    = m.cardClass;
            this.synergy      = m.synergy;
            this.handcard     = m.handcard;//new?
            this.deathrattle2 = m.deathrattle2;
            this.entitiyID    = m.entitiyID;
            this.zonepos      = m.zonepos;

            this.allreadyAttacked = m.allreadyAttacked;


            this.playedThisTurn       = m.playedThisTurn;
            this.playedPrevTurn       = m.playedPrevTurn;
            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.explorershat    = m.explorershat;
            this.infest          = m.infest;

            this.ownBlessingOfWisdom   = m.ownBlessingOfWisdom;
            this.enemyBlessingOfWisdom = m.enemyBlessingOfWisdom;
            this.ownPowerWordGlory     = m.ownPowerWordGlory;
            this.enemyPowerWordGlory   = m.enemyPowerWordGlory;
            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;

            this.cantBeTargetedBySpellsOrHeroPowers = m.cantBeTargetedBySpellsOrHeroPowers;
            this.cantAttackHeroes = m.cantAttackHeroes;
        }
示例#23
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);
            }


        }
示例#24
0
        //lower durability of weapon + destroy them (deathrattle) 
        //todo: test death's bite's dearthrattle
        public void lowerWeaponDurability(int value, bool own)
        {

            if (own)
            {
                if (this.ownWeaponDurability <= 0) return;
                this.ownWeaponDurability -= value;
                if (this.ownWeaponDurability <= 0)
                {
                    //todo deathrattle deathsbite

                    if (this.ownWeaponName == CardDB.cardName.powermace && this.ownMinions.Count>=1)
                    {
                        int sum = 1000;
                        Minion t = null;

                        foreach (Minion m in ownMinions)
                        {
                            if ((TAG_RACE)m.handcard.card.race == TAG_RACE.MECHANICAL)
                            {
                                int s = m.maxHp + m.Angr;
                                if (s < sum)
                                {
                                    t = m;
                                    sum = s;
                                }
                            }

                        }

                        if (t != null && sum < 999)
                        {
                            this.minionGetBuffed(t, 2, 2);
                        }
                    }

                    if (this.ownWeaponName == CardDB.cardName.deathsbite)
                    {
                        int anz = 1;
                        if (this.ownBaronRivendare >= 1) anz = 2;
                        int dmg = getSpellDamageDamage(1);
                        foreach (Minion m in this.ownMinions)
                        {
                            this.minionGetDamageOrHeal(m, anz * dmg);
                        }
                        foreach (Minion m in this.enemyMinions)
                        {
                            this.minionGetDamageOrHeal(m, anz * dmg);
                        }
                        this.doDmgTriggers();

                    }


                    this.ownHero.Angr -= this.ownWeaponAttack;
                    this.ownWeaponDurability = 0;
                    this.ownWeaponAttack = 0;
                    this.ownWeaponName = CardDB.cardName.unknown;
                    this.ownHero.windfury = false;

                    foreach (Minion m in this.ownMinions)
                    {
                        if (m.playedThisTurn && m.name == CardDB.cardName.southseadeckhand)
                        {
                            m.charge--;
                            m.updateReadyness();
                        }
                    }
                    this.ownHero.updateReadyness();
                }
            }
            else
            {
                if (this.enemyWeaponDurability <= 0) return;
                this.enemyWeaponDurability -= value;
                if (this.enemyWeaponDurability <= 0)
                {
                    //deathrattle deathsbite

                    if (this.ownWeaponName == CardDB.cardName.powermace && this.enemyMinions.Count >= 1)
                    {
                        int sum = 1000;
                        Minion t = null;

                        foreach (Minion m in enemyMinions)
                        {
                            if ((TAG_RACE)m.handcard.card.race == TAG_RACE.MECHANICAL)
                            {
                                int s = m.maxHp + m.Angr;
                                if (s < sum)
                                {
                                    t = m;
                                    sum = s;
                                }
                            }

                        }

                        if (t != null && sum < 999)
                        {
                            this.minionGetBuffed(t, 2, 2);
                        }
                    }

                    if (this.enemyWeaponName == CardDB.cardName.deathsbite)
                    {
                        int anz = 1;
                        if (this.enemyBaronRivendare >= 1) anz = 2;
                        int dmg = getEnemySpellDamageDamage(1);
                        foreach (Minion m in this.ownMinions)
                        {
                            this.minionGetDamageOrHeal(m, anz * dmg);
                        }
                        foreach (Minion m in this.enemyMinions)
                        {
                            this.minionGetDamageOrHeal(m, anz * dmg);
                        }
                        this.doDmgTriggers();
                    }

                    this.enemyHero.Angr -= this.enemyWeaponAttack;
                    this.enemyWeaponDurability = 0;
                    this.enemyWeaponAttack = 0;
                    this.enemyWeaponName = CardDB.cardName.unknown;
                    this.enemyHero.windfury = false;
                    this.enemyHero.updateReadyness();
                }
            }
        }
示例#25
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;

        }
示例#26
0
 public void updateEnemyHero(string weapon, int watt, int wdur, int heroatt, int herohp, int herodef, string heron, bool frozen, CardDB.Card eab, bool ehisim, int enemMM)
 {
     this.enemyHeroWeapon = CardDB.Instance.cardNamestringToEnum(weapon);
     this.enemyWeaponAttack = watt;
     this.enemyWeaponDurability = wdur;
     this.enemyAtk = heroatt;
     this.enemyHp = herohp;
     this.enemyHeroname = this.heroNametoEnum(heron);
     this.enemyDefence = herodef;
     this.enemyfrozen = frozen;
     this.enemyAbility = eab;
     this.enemyHeroImmune = ehisim;
     this.enemyMaxMana = enemMM;
 }
示例#27
0
文件: Player.cs 项目: shuyi3/AIPJ
        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;
                }
            }
        }
示例#28
0
        public void setMinionTominion(Minion m)
        {
            //dont silence----------------------------
            this.anzGotDmg = m.anzGotDmg;
            this.gotDmgRaw = m.gotDmgRaw;
            this.GotDmgValue = m.GotDmgValue;
            this.gotInspire = m.gotInspire;
            this.isHero = m.isHero;
            this.own = m.own;
            this.canAttackNormal = m.canAttackNormal;
            this.name = m.name;
            this.cardClass = m.cardClass;
            this.synergy = m.synergy;
            this.handcard = m.handcard;//new?
            this.deathrattle2 = m.deathrattle2;
            //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.explorershat = m.explorershat;
            this.infest = m.infest;

            this.ownBlessingOfWisdom = m.ownBlessingOfWisdom;
            this.enemyBlessingOfWisdom = m.enemyBlessingOfWisdom;
            this.ownPowerWordGlory = m.ownPowerWordGlory;
            this.enemyPowerWordGlory = m.enemyPowerWordGlory;
            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;

            this.cantBeTargetedBySpellsOrHeroPowers = m.cantBeTargetedBySpellsOrHeroPowers;

            if (m.deathrattles != null)
            {
                this.deathrattles = new List<int>();
                foreach (int dr in m.deathrattles)
                {
                    this.deathrattles.Add(dr);
                }
            }
        }
示例#29
0
文件: Player.cs 项目: shuyi3/AIPJ
        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;
        }
示例#30
0
        private void addRule(string line)
        {
            try
            {
                bool            holdrule   = (line.Split(';')[0].ToLower() == "hold");
                string          ownclass   = line.Split(';')[1].ToLower();
                string          enemyclass = line.Split(';')[2].ToLower();
                string          card       = line.Split(';')[3];
                CardDB.cardName cardEnum   = CardDB.Instance.cardNamestringToEnum(card);
                if (cardEnum != CardDB.cardName.unknown)
                {
                    card = CardDB.Instance.getCardData(cardEnum).cardIDenum.ToString();
                }
                int coinrule = 0;

                if (line.Split(';').Length >= 5)
                {
                    string coin = line.Split(';')[4];
                    if (coin == "nocoin")
                    {
                        coinrule = 1;
                    }
                    if (coin == "coin")
                    {
                        coinrule = 2;
                    }
                }

                if (card.Contains(":"))
                {
                    if ((card.Split(':')).Length == 3)
                    {
                        cardlist.Add(new mulliitem(holdrule, card.Split(':')[0], ownclass, enemyclass, Convert.ToInt32(card.Split(':')[1]), card.Split(':')[2].Split('/'), coinrule, -1));
                    }
                    else
                    {
                        cardlist.Add(new mulliitem(holdrule, card.Split(':')[0], ownclass, enemyclass, Convert.ToInt32(card.Split(':')[1]), null, coinrule, -1));
                    }
                }
                else
                {
                    cardlist.Add(new mulliitem(holdrule, card, ownclass, enemyclass, 2, null, coinrule, -1));
                }

                if (line.Split(';').Length >= 6)
                {
                    string mr = (line.Split(';')[5]);
                    if (mr == "")
                    {
                        return;
                    }
                    int manarule = Convert.ToInt32(mr);
                    if (manarule <= 0)
                    {
                        return;
                    }
                    //Console.WriteLine("[Mulligan] found MANA rule: " + mr);
                    cardlist.Add(new mulliitem(holdrule, "#MANARULE", ownclass, enemyclass, 2, null, coinrule, manarule));
                }
            }
            catch
            {
                Helpfunctions.Instance.ErrorLog("[Mulligan] cant read: " + line);
            }
        }
示例#31
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);

        }
示例#32
0
        public Minion(Minion m)
        {
            //dont silence----------------------------
            this.anzGotDmg = m.anzGotDmg;
            this.gotDmgRaw = m.gotDmgRaw;
            this.isHero = m.isHero;
            this.own = m.own;
            this.canAttackNormal = m.canAttackNormal;
            this.name = m.name;
            this.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.cantBeTargetedBySpellsOrHeroPowers = m.cantBeTargetedBySpellsOrHeroPowers;
            //---------------------------------------
            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.ownPowerWordGlory = m.ownPowerWordGlory;
            this.enemyPowerWordGlory = m.enemyPowerWordGlory;
            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;
        }
示例#33
0
        //lower durability of weapon + destroy them (deathrattle) 
        //todo: test death's bite's dearthrattle
        public void lowerWeaponDurability(int value, bool own)
        {

            if (own)
            {
                if (this.ownWeaponDurability <= 0) return;
                this.ownWeaponDurability -= value;
                if (this.ownWeaponDurability <= 0)
                {
                    //todo deathrattle deathsbite
                    if (this.ownWeaponName == CardDB.cardName.deathsbite)
                    {
                        int anz = 1;
                        if (this.ownBaronRivendare >= 1) anz = 2;
                        int dmg = getSpellDamageDamage(1);
                        foreach (Minion m in this.ownMinions)
                        {
                            this.minionGetDamageOrHeal(m, anz * dmg);
                        }
                        foreach (Minion m in this.enemyMinions)
                        {
                            this.minionGetDamageOrHeal(m, anz * dmg);
                        }
                        this.doDmgTriggers();

                    }


                    this.ownHero.Angr -= this.ownWeaponAttack;
                    this.ownWeaponDurability = 0;
                    this.ownWeaponAttack = 0;
                    this.ownWeaponName = CardDB.cardName.unknown;

                    foreach (Minion m in this.ownMinions)
                    {
                        if (m.playedThisTurn && m.name == CardDB.cardName.southseadeckhand)
                        {
                            m.charge--;
                            m.updateReadyness();
                        }
                    }
                }
            }
            else
            {
                if (this.enemyWeaponDurability <= 0) return;
                this.enemyWeaponDurability -= value;
                if (this.enemyWeaponDurability <= 0)
                {
                    //deathrattle deathsbite
                    if (this.enemyWeaponName == CardDB.cardName.deathsbite)
                    {
                        int anz = 1;
                        if (this.enemyBaronRivendare >= 1) anz = 2;
                        int dmg = getEnemySpellDamageDamage(1);
                        foreach (Minion m in this.ownMinions)
                        {
                            this.minionGetDamageOrHeal(m, anz * dmg);
                        }
                        foreach (Minion m in this.enemyMinions)
                        {
                            this.minionGetDamageOrHeal(m, anz * dmg);
                        }
                        this.doDmgTriggers();
                    }

                    this.enemyHero.Angr -= this.enemyWeaponAttack;
                    this.enemyWeaponDurability = 0;
                    this.enemyWeaponAttack = 0;
                    this.enemyWeaponName = CardDB.cardName.unknown;
                }
            }
        }
示例#34
0
            public int isMultiTurnComboTurn1(List <Handmanager.Handcard> hand, int omm, List <Minion> ownmins, CardDB.cardName weapon)
            {
                if (!twoTurnCombo)
                {
                    return(0);
                }
                int cardsincombo = 0;
                Dictionary <CardDB.cardIDEnum, int> combocardscopy = new Dictionary <CardDB.cardIDEnum, int>(this.combocardsTurn1);

                foreach (Handmanager.Handcard hc in hand)
                {
                    if (combocardscopy.ContainsKey(hc.card.cardIDenum) && combocardscopy[hc.card.cardIDenum] >= 1)
                    {
                        cardsincombo++;
                        combocardscopy[hc.card.cardIDenum]--;
                    }
                }
                if (cardsincombo == this.combot1len && omm < this.neededMana)
                {
                    return(1);
                }

                if (cardsincombo == this.combot1len)
                {
                    //search for required minions on field
                    int turn0requires = 0;
                    foreach (CardDB.cardIDEnum s in combocardsTurn0Mobs.Keys)
                    {
                        foreach (Minion m in ownmins)
                        {
                            if (!m.playedThisTurn && m.handcard.card.cardIDenum == s)
                            {
                                turn0requires++;
                                break;
                            }
                        }
                    }

                    if (requiredWeapon != CardDB.cardName.unknown && requiredWeapon != weapon)
                    {
                        return(1);
                    }

                    if (turn0requires >= combot0len)
                    {
                        return(2);
                    }

                    return(1);
                }
                if (cardsincombo >= 1)
                {
                    return(1);
                }
                return(0);
            }
示例#35
0
        public void equipWeapon(CardDB.Card c, bool own)
        {
            if (own)
            {
                if (this.ownWeaponDurability >= 1)
                {
                    this.lostWeaponDamage += this.ownWeaponDurability * this.ownWeaponAttack * this.ownWeaponAttack;
                    this.lowerWeaponDurability(1000, true);
                }
                this.ownWeaponAttack = c.Attack;
                this.ownWeaponDurability = c.Durability;
                this.ownWeaponName = c.name;
            }
            else
            {
                this.enemyWeaponAttack = c.Attack;
                this.enemyWeaponDurability = c.Durability;
                this.enemyWeaponName = c.name;
            }

            Minion hero = (own) ? this.ownHero : this.enemyHero;

            if (own)
            {
                hero.tempAttack = 0;
                hero.Angr = c.Attack;
            }

            if (c.name == CardDB.cardName.doomhammer)
            {
                hero.windfury = true;

            }
            else
            {
                hero.windfury = false;
            }
            hero.updateReadyness();

            if (c.name == CardDB.cardName.gladiatorslongbow)
            {
                hero.immuneWhileAttacking = true;
            }
            else
            {
                hero.immuneWhileAttacking = false;
            }

            List<Minion> temp = (own) ? this.ownMinions : this.enemyMinions;
            foreach (Minion m in temp)
            {
                if (m.playedThisTurn && m.name == CardDB.cardName.southseadeckhand)
                {
                    minionGetCharge(m);
                }
            }

        }
示例#36
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);
            }
示例#37
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;
            //#########################################

        }
示例#38
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;
 }
示例#39
0
文件: Minion.cs 项目: shuyi3/AIPJ
        public Minion(SilverfishAi.Minion m)
        {
            this.targetProb = 1.0;
            //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;
        }
示例#40
0
        public void updateEnemyHero(string weapon, int weaponAttack, int weaponDurability, string heron,int enemMaxMana, CardDB.Card eab, Minion enemyHero)
        {
            this.enemyHeroWeapon = CardDB.Instance.cardNamestringToEnum(weapon);
            this.enemyWeaponAttack = weaponAttack;
            this.enemyWeaponDurability = weaponDurability;

            this.enemyMaxMana = enemMaxMana;

            this.enemyHeroname = this.heroNametoEnum(heron);

            this.enemyAbility = eab;

            this.enemyHero = new Minion(enemyHero);
            
        }
示例#41
0
文件: Player.cs 项目: shuyi3/AIPJ
        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;
                }
            }
        }