Ejemplo n.º 1
0
        private void getHerostuff()
        {
            HRPlayer ownPlayer   = HRPlayer.GetLocalPlayer();
            HRPlayer enemyPlayer = HRPlayer.GetEnemyPlayer();

            HREntity ownhero        = ownPlayer.GetHero();
            HREntity enemyhero      = enemyPlayer.GetHero();
            HREntity ownHeroAbility = ownPlayer.GetHeroPower();

            //player stuff#########################
            this.currentMana = ownPlayer.GetNumAvailableResources();
            this.ownMaxMana  = ownPlayer.GetNumAvailableResources();//ownPlayer.GetRealTimeTempMana();

            Helpfunctions.Instance.logg("mana " + currentMana + "/" + ownMaxMana);
            this.numMinionsPlayedThisTurn = 0;
            this.cardsPlayedThisTurn      = 0;
            if (ownPlayer.HasCombo())
            {
                this.cardsPlayedThisTurn = 1;
            }
            //this.ueberladung = ownPlayer.re(GAME_TAG.RECALL_OWED);

            //get weapon stuff
            this.ownHeroWeapon        = "";
            this.heroWeaponAttack     = 0;
            this.heroWeaponDurability = 0;



            this.enemyHeroWeapon       = "";
            this.enemyWeaponAttack     = 0;
            this.enemyWeaponDurability = 0;
            if (enemyPlayer.HasWeapon())
            {
                HREntity weapon = enemyPlayer.GetWeaponCard().GetEntity();
                this.enemyHeroWeapon       = CardDB.Instance.getCardDataFromID(weapon.GetCardId()).name;
                this.enemyWeaponAttack     = weapon.GetATK();
                this.enemyWeaponDurability = weapon.GetDurability();
            }


            //own hero stuff###########################
            this.heroAtk     = ownhero.GetATK();
            this.heroHp      = ownhero.GetHealth() - ownhero.GetDamage();
            this.heroDefence = ownhero.GetArmor();
            this.heroname    = Hrtprozis.Instance.heroIDtoName(ownhero.GetCardId());
            bool exausted = false;

            exausted                    = ownhero.IsExhausted();
            this.ownheroisread          = true;
            this.ownheroAlreadyAttacked = false;

            this.heroImmuneToDamageWhileAttacking = (ownhero.IsImmune()) ? true : false;
            this.herofrozen = ownhero.IsFrozen();

            int numberofattacks = ownhero.GetNumAttacksThisTurn();

            //HRLog.Write(ownhero.GetName() + " ready params ex: " + exausted + " " + heroAtk + " " + numberofattacks + " " + herofrozen);

            if (exausted == true)
            {
                this.ownheroisread          = false;
                this.ownheroAlreadyAttacked = true;
            }
            if (exausted == false && this.heroAtk == 0)
            {
                this.ownheroisread = false;
            }
            if (herofrozen)
            {
                ownheroisread = false;
            }


            if (ownPlayer.HasWeapon())
            {
                HREntity weapon = ownPlayer.GetWeaponCard().GetEntity();
                this.ownHeroWeapon                    = CardDB.Instance.getCardDataFromID(weapon.GetCardId()).name;
                this.heroWeaponAttack                 = weapon.GetATK();
                this.heroWeaponDurability             = weapon.GetDurability();
                this.heroImmuneToDamageWhileAttacking = false;
                if (this.ownHeroWeapon == "langbogendesgladiators")
                {
                    this.heroImmuneToDamageWhileAttacking = true;
                }

                //HRLog.Write("weapon: " + ownHeroWeapon + " " + heroWeaponAttack + " " + heroWeaponDurability);
            }

            //enemy hero stuff###############################################################
            this.enemyAtk = enemyhero.GetATK();

            this.enemyHp = enemyhero.GetHealth() - enemyhero.GetDamage();

            this.enemyHeroname = Hrtprozis.Instance.heroIDtoName(enemyhero.GetCardId());

            this.enemyDefence = enemyhero.GetArmor();

            this.enemyfrozen = enemyhero.IsFrozen();



            //own hero ablity stuff###########################################################

            this.heroAbility       = CardDB.Instance.getCardDataFromID(ownHeroAbility.GetCardId());
            this.ownAbilityisReady = (ownHeroAbility.IsExhausted()) ? false : true; // if exhausted, ability is NOT ready
        }