Beispiel #1
0
 private QuestManager()
 {
     this.help = Helpfunctions.Instance;
 }
Beispiel #2
0
 private Handmanager()
 {
     this.help = Helpfunctions.Instance;
 }
Beispiel #3
0
        public void Print(bool tobuffer = false)
        {
            Helpfunctions help     = Helpfunctions.Instance;
            string        discover = "";

            if (this.tracking >= 1)
            {
                discover = " discover " + tracking;
            }
            if (tobuffer)
            {
                if (this.actionType == ActionType.PLAY_CARD)
                {
                    string playaction = "play ";

                    playaction += "id " + this.card.entity;
                    if (this.target != null)
                    {
                        playaction += " target " + this.target.entityID;
                    }

                    if (this.place >= 0)
                    {
                        playaction += " pos " + this.place;
                    }

                    if (this.druidchoice >= 1)
                    {
                        playaction += " choice " + this.druidchoice;
                    }

                    help.writeToBuffer(playaction + discover);
                }
                if (this.actionType == ActionType.ATTACK_WITH_MINION && this.target != null)
                {
                    help.writeToBuffer("attack " + this.own.entityID + " enemy " + this.target.entityID + discover);
                }
                if (this.actionType == ActionType.ATTACK_WITH_HERO && this.target != null)
                {
                    help.writeToBuffer("heroattack " + this.target.entityID + discover);
                }
                if (this.actionType == ActionType.USE_HERO_POWER)
                {
                    if (this.target != null)
                    {
                        help.writeToBuffer("useability on target " + this.target.entityID + discover);
                    }
                    else
                    {
                        help.writeToBuffer("useability" + discover);
                    }
                }
                return;
            }

            //todo sepefeets - consider adding names into actions from the start instead of mapping them here
            string    cardname   = "";
            string    targetname = "";
            Playfield tmpPf      = new Playfield();

            if (this.target != null)
            {
                foreach (Minion m in tmpPf.enemyMinions)
                {
                    if (m.entityID == this.target.entityID)
                    {
                        targetname = "" + m.name;
                    }
                }
                if (tmpPf.enemyHero.entityID == this.target.entityID)
                {
                    targetname = "" + tmpPf.enemyHeroName;
                }
            }
            foreach (Minion m in tmpPf.ownMinions)
            {
                if (this.target != null && m.entityID == this.target.entityID)
                {
                    targetname = "" + m.name;
                }
                if (this.card != null && m.entityID == this.card.entity)
                {
                    cardname = "" + m.name;
                }
                if (this.own != null && m.entityID == this.own.entityID)
                {
                    cardname = "" + m.name;
                }
            }
            if (this.target != null && tmpPf.ownHero.entityID == this.target.entityID)
            {
                targetname = "" + tmpPf.ownHeroName;
            }
            foreach (Handmanager.Handcard h in tmpPf.owncards)
            {
                if (this.card != null && h.entity == this.card.entity)
                {
                    cardname = "" + h.card.name;
                }
            }


            if (this.actionType == ActionType.PLAY_CARD && this.card != null)
            {
                string playaction = "play ";
                playaction += cardname;
                playaction += " id " + this.card.entity;

                if (this.target != null)
                {
                    playaction += ", target " + targetname + " id " + this.target.entityID;
                }

                if (this.place >= 0)
                {
                    playaction += ", pos " + this.place;
                }

                if (this.druidchoice >= 1)
                {
                    playaction += ", choice " + this.druidchoice;
                }

                help.logg(playaction + discover);
            }
            if (this.actionType == ActionType.ATTACK_WITH_MINION && this.target != null && this.own != null)
            {
                help.logg("attacker: " + cardname + " id " + this.own.entityID + ", enemy: " + targetname + " id " + this.target.entityID + discover);
            }
            if (this.actionType == ActionType.ATTACK_WITH_HERO && this.target != null)
            {
                help.logg("attack with hero, enemy: " + targetname + " id " + this.target.entityID + discover);
            }
            if (this.actionType == ActionType.USE_HERO_POWER)
            {
                help.logg("useability " + discover);
                if (this.target != null)
                {
                    help.logg("on " + (target.own ? "own " : "enemy ") + targetname + " id " + this.target.entityID + discover);
                }
            }
        }