コード例 #1
0
        public static void ManageNeutralMinion(Card.Cards card)
        {
            //<= max mana
            var boardCard = new BoardCard(card);

            if (boardCard.ResultingBoardCard.Quality >= ValueReader.MinCardQualityToInstantAddMinion) //epic by default
            {
                MainLists.chosenCards.Add(card);
            }
            else
            {
                //card quality not hight enoughbut <= max mana
                if (!ValueReader.AttendMinionValue ||
                    boardCard.ResultingBoardCard.Cost < ValueReader.MinManaCostToAttendValue)
                {
                    //mana <= max cost & mana < MinManaCostToAttendValue
                    MainLists.chosenCards.Add(card);
                }
                else if (boardCard.ResultingBoardCard.Cost >= ValueReader.MinManaCostToAttendValue)
                {
                    var minionCard = new NeutralMinion(card);
                    MinionValue.Value requiredMinNeutralMinionValue =
                        minionCard.minionBoardCard.IsMaxManaCard && ValueReader.IncreaseMinMinionValueIfMaxCost
                            ? ValueReader.IncreasedMinNeutralMinionValue
                            : ValueReader.MinNeutralMinionValue;

                    if (minionCard.thisCardValue >= requiredMinNeutralMinionValue)
                    {
                        MainLists.chosenCards.Add(card);
                    }
                }
            }
        }
コード例 #2
0
        public static void ManageNeutralMinion(Card.Cards card)
        {
            //<= max mana
            var boardCard = new BoardCard(card);

            if (boardCard.ResultingBoardCard.Quality >= ValueReader.MinCardQualityToInstantAddMinion) //epic by default
                MainLists.chosenCards.Add(card);
            else
            {
                //card quality not hight enoughbut <= max mana
                if (!ValueReader.AttendMinionValue ||
                    boardCard.ResultingBoardCard.Cost < ValueReader.MinManaCostToAttendValue)
                    //mana <= max cost & mana < MinManaCostToAttendValue
                    MainLists.chosenCards.Add(card);
                else if (boardCard.ResultingBoardCard.Cost >= ValueReader.MinManaCostToAttendValue)
                {
                    var minionCard = new NeutralMinion(card);
                    MinionValue.Value requiredMinNeutralMinionValue =
                        minionCard.minionBoardCard.IsMaxManaCard && ValueReader.IncreaseMinMinionValueIfMaxCost
                            ? ValueReader.IncreasedMinNeutralMinionValue
                            : ValueReader.MinNeutralMinionValue;

                    if (minionCard.thisCardValue >= requiredMinNeutralMinionValue)
                        MainLists.chosenCards.Add(card);
                }
            }
        }
コード例 #3
0
        public static bool HasGoodEffect(Card.Cards _card)
        {
            var card = new BoardCard(_card).ResultingBoardCard;

            return(card.Charge || card.Divineshield || card.Enrage || card.Freeze ||
                   card.Stealth || card.Taunt || card.Windfury || card.Spellpower > 0);
        }
コード例 #4
0
ファイル: MinionValue.cs プロジェクト: DanThePman/Hearthstone
        public static Value SetCardValue(BoardCard minionBoardCard)
        {
            Value resultingValue;

            float rawValue = (minionBoardCard.ResultingBoardCard.Atk + minionBoardCard.ResultingBoardCard.Health) / 2;
            float resultingValueFloat = rawValue - minionBoardCard.ResultingBoardCard.Cost;

            if (resultingValueFloat > 0)
                resultingValue = Value.Good;
            else if (resultingValueFloat == 0)
                resultingValue = Value.Medium;
            else
                resultingValue = Value.Bad;

            if (CardEffects.HasBadEffect(minionBoardCard.ResultingBoardCard))
                resultingValue = ReduceCardValue(resultingValue);

            if (CardEffects.HasGoodEffect(minionBoardCard.ResultingBoardCard))
                resultingValue = IncreaseCardValue(resultingValue);

            if (CardEffects.HasInspire(minionBoardCard.ResultingBoardCard))
                resultingValue = Value.Excellent;

            return resultingValue;
        }
コード例 #5
0
        private NeutralMinion(Card.Cards NeutralMinionMulliganCard)
        {
            minionBoardCard = new BoardCard(NeutralMinionMulliganCard).IsClassCard() ||
                NeutralMinionMulliganCard.ToString() == "GAME_005"
                ?
                null
                :
                new BoardCard(NeutralMinionMulliganCard);

            thisCardValue =
                minionBoardCard != null
                    ? MinionValue.SetCardValue(minionBoardCard)
                    : MinionValue.Value.NotANeutralMinion;

            if (minionBoardCard != null && MainLists.whiteList.Contains(minionBoardCard.ResultingBoardCard.Name))
                thisCardValue = MinionValue.Value.InWhiteList;
        }
コード例 #6
0
        private NeutralMinion(Card.Cards NeutralMinionMulliganCard)
        {
            minionBoardCard = new BoardCard(NeutralMinionMulliganCard).IsClassCard() ||
                              NeutralMinionMulliganCard.ToString() == "GAME_005"
                ?
                              null
                :
                              new BoardCard(NeutralMinionMulliganCard);

            thisCardValue =
                minionBoardCard != null
                    ? MinionValue.SetCardValue(minionBoardCard)
                    : MinionValue.Value.NotANeutralMinion;

            if (minionBoardCard != null && MainLists.whiteList.Contains(minionBoardCard.ResultingBoardCard.Name))
            {
                thisCardValue = MinionValue.Value.InWhiteList;
            }
        }
コード例 #7
0
        public static Value SetCardValue(BoardCard minionBoardCard)
        {
            Value resultingValue;

            float rawValue            = (minionBoardCard.ResultingBoardCard.Atk + minionBoardCard.ResultingBoardCard.Health) / 2;
            float resultingValueFloat = rawValue - minionBoardCard.ResultingBoardCard.Cost;

            if (resultingValueFloat > 0)
            {
                resultingValue = Value.Good;
            }
            else if (resultingValueFloat == 0)
            {
                resultingValue = Value.Medium;
            }
            else
            {
                resultingValue = Value.Bad;
            }

            if (CardEffects.HasBadEffect(minionBoardCard.ResultingBoardCard))
            {
                resultingValue = ReduceCardValue(resultingValue);
            }

            if (CardEffects.HasGoodEffect(minionBoardCard.ResultingBoardCard))
            {
                resultingValue = IncreaseCardValue(resultingValue);
            }

            if (CardEffects.HasInspire(minionBoardCard.ResultingBoardCard))
            {
                resultingValue = Value.Excellent;
            }

            return(resultingValue);
        }
コード例 #8
0
ファイル: CardEffects.cs プロジェクト: DanThePman/Hearthstone
 public static bool HasInspire(Card.Cards _card)
 {
     var card = new BoardCard(_card).ResultingBoardCard;
     return card.Inspire;
 }
コード例 #9
0
ファイル: CardEffects.cs プロジェクト: DanThePman/Hearthstone
 public static bool HasGoodEffect(Card.Cards _card)
 {
     var card = new BoardCard(_card).ResultingBoardCard;
     return card.Charge || card.Divineshield || card.Enrage || card.Freeze ||
         card.Stealth || card.Taunt || card.Windfury || card.Spellpower > 0;
 }
コード例 #10
0
ファイル: CardEffects.cs プロジェクト: DanThePman/Hearthstone
 public static bool HasBadEffect(Card.Cards _card)
 {
     var card = new BoardCard(_card).ResultingBoardCard;
     return CardsWithBadProperties.Contains(card.Name) || card.Overload > 0;
 }
コード例 #11
0
        public static bool HasInspire(Card.Cards _card)
        {
            var card = new BoardCard(_card).ResultingBoardCard;

            return(card.Inspire);
        }
コード例 #12
0
        public static bool HasBadEffect(Card.Cards _card)
        {
            var card = new BoardCard(_card).ResultingBoardCard;

            return(CardsWithBadProperties.Contains(card.Name) || card.Overload > 0);
        }