Esempio n. 1
0
        private void updateBehaveString(Behavior botbase)
        {
            this.botbehave = "rush";
            if (botbase is BehaviorControl)
            {
                this.botbehave = "control";
            }
            if (botbase is BehaviorMana)
            {
                this.botbehave = "mana";
            }
            this.botbehave += " " + Ai.maxwide;
            this.botbehave += " face " + Combobreaker.attackFaceHP;
            if (Settings.secondTurnAmount > 0)
            {
                if (Ai.nextMoveGuess.mana == -100)
                {
                    Ai.updateTwoTurnSim();
                }
                this.botbehave += " twoturnsim " + Settings.secondTurnAmount + " ntss " +
                                  Settings.nextTurnDeep + " " + Settings.nextTurnMaxWide + " " +
                                  Settings.nextTurnTotalBoards;
            }

            if (Settings.playarround)
            {
                this.botbehave += " playaround";
                this.botbehave += " " + Settings.playaroundprob + " " + Settings.playaroundprob2;
            }

            this.botbehave += " ets " + Settings.enemyTurnMaxWide;

            if (Settings.simEnemySecondTurn)
            {
                this.botbehave += " ets2 " + Settings.enemyTurnMaxWideSecondTime;
                this.botbehave += " ents " + Settings.enemySecondTurnMaxWide;
            }

            if (Settings.useSecretsPlayArround)
            {
                this.botbehave += " secret";
            }

            if (Settings.secondweight != 0.5f)
            {
                this.botbehave += " weight " + (int)(Settings.secondweight * 100f);
            }

            if (Settings.simulatePlacement)
            {
                this.botbehave += " plcmnt";
            }
        }
Esempio n. 2
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);
        }