Пример #1
0
        public override List <Deathrattle> GenerateDeathrattles(List <BattlegroundCard> playerCards,
                                                                List <BattlegroundCard> opponentCards, int cardIndex, BattlegroundBoard board)
        {
            // Get the two mechs that died first. Note that they are the mechs in their base forms (no buffs attached).
            List <BattlegroundCard> mechsToSummon = new List <BattlegroundCard>();
            List <BattlegroundCard> cards         =
                playerCards == board.playerCards
                    ? board.deadPlayerCards
                    : board.deadOpponentCards;

            foreach (BattlegroundCard card in cards)
            {
                if (card.race == Race.MECHANICAL)
                {
                    mechsToSummon.Add(card);
                }
                if (mechsToSummon.Count == 2)
                {
                    break;
                }
            }
            List <Deathrattle> deathrattles = new List <Deathrattle>();
            Deathrattle        deathrattle  = new Deathrattle();

            deathrattle.playerCardIndex = cardIndex;
            foreach (BattlegroundCard card in mechsToSummon)
            {
                deathrattle.playerCards.Add(Utils.CreateBattlegroundCard(Utils.GetCardFromName(card.name)));
            }
            deathrattles.Add(deathrattle);
            return(deathrattles);
        }
 public Deathrattle(Deathrattle deathrattle, BattlegroundBoard board)
 {
     this._card          = deathrattle._card;
     this._originalBoard = board;
     this._isPlayer      = deathrattle._isPlayer;
     this._cardIndex     = deathrattle._cardIndex;
 }
Пример #3
0
        public Card(int cardId, int healthPoints, int attackPoints, int mana, bool isTaunt, Battlecry baseBattlecry, Deathrattle baseDeathrattle, Dictionary <PlayRequirement, bool> playReqs)
        {
            Place  = CardPlace.DECK;
            CardId = cardId;

            HealthPoints = healthPoints;
            AttackPoints = attackPoints;
            Mana         = mana;

            CurrentHealthPoints = healthPoints;
            CurrentAttackPoints = attackPoints;
            CurrentMana         = mana;

            if (baseBattlecry != null)
            {
                _battlecries += baseBattlecry;
            }

            if (baseDeathrattle != null)
            {
                _deathrattles += baseDeathrattle;
            }

            _playReqs = playReqs;

            IsTaunt = isTaunt;
            IsSpell = false;
        }
            public override List <BattlegroundBoard> ApplyDeathrattle()
            {
                List <BattlegroundBoard> boards     = new List <BattlegroundBoard>();
                List <BattlegroundBoard> tempBoards = new List <BattlegroundBoard>();

                foreach (Deathrattle deathrattle in _deathrattles)
                {
                    // If we have boards previously generated, apply the new deathrattle on those boards.
                    if (boards.Count > 0)
                    {
                        foreach (BattlegroundBoard board in boards)
                        {
                            Deathrattle newDeathrattle = new Deathrattle(deathrattle, board);
                            tempBoards.AddRange(newDeathrattle.ApplyDeathrattle());
                        }
                        boards     = tempBoards;
                        tempBoards = new List <BattlegroundBoard>();
                    }
                    else
                    {
                        boards = deathrattle.ApplyDeathrattle();
                    }
                }
                return(boards);
            }
Пример #5
0
        public override List <Deathrattle> GenerateDeathrattles(List <BattlegroundCard> playerCards,
                                                                List <BattlegroundCard> opponentCards, int cardIndex, BattlegroundBoard board)
        {
            // TODO: Handle unstable ghoul, khadgar effects separately.
            List <string> possibleSummonNames =
                new List <string>(
                    new string[] {
                "Selfless Hero",
                "Mecharoo",
                "Fiendish Servant",
                "Spawn of N'zoth",
                "Kindly Grandmother",
                "Rat Pack",
                "Harvest Golem",
                "Kaboom Bot",
                "Imprisoner",
                "Unstable Ghoul",
                "Infested Wolf",
                "The Beast",
                "Piloted Shredder",
                "Replicating Menace",
                "Mechano-Egg",
                "Goldrinn, the Great Wolf",
                "Savannah Highmane",
                "Voidlord",
                "King Bagurgle",
                "Sneed's Old Shredder",
                "Kangor's Apprentice",
                "Nadina the Red"
            });
            List <Card> possibleSummonCards = new List <Card>();

            foreach (string summonName in possibleSummonNames)
            {
                possibleSummonCards.Add(Utils.GetCardFromName(summonName));
            }
            List <Deathrattle> deathrattles = new List <Deathrattle>();

            // TODO: This does not consider that different orderings may lead to different results. Consider
            // whether this would change results enough to implement.
            for (int i = 0; i < possibleSummonCards.Count; i++)
            {
                for (int j = i + 1; j < possibleSummonCards.Count; j++)
                {
                    Deathrattle deathrattle = new Deathrattle();
                    deathrattle.playerCardIndex = cardIndex;
                    deathrattle.playerCards.Add(Utils.CreateBattlegroundCard(possibleSummonCards[i]));
                    deathrattle.playerCards.Add(Utils.CreateBattlegroundCard(possibleSummonCards[j]));
                    deathrattles.Add(deathrattle);
                }
            }
            return(deathrattles);
        }
        public override List <Deathrattle> GenerateDeathrattles(List <BattlegroundCard> playerCards,
                                                                List <BattlegroundCard> opponentCards, int cardIndex, BattlegroundBoard board)
        {
            Card        finkleEinhorn = Utils.GetCardFromName("Finkle Einhorn");
            Deathrattle deathrattle   = new Deathrattle();

            deathrattle.opponentCardIndex = opponentCards.Count;
            deathrattle.opponentCards.Add(new BattlegroundCard(finkleEinhorn));
            List <Deathrattle> deathrattles = new List <Deathrattle>();

            deathrattles.Add(deathrattle);
            return(deathrattles);
        }
        public override List <Deathrattle> GenerateDeathrattles(List <BattlegroundCard> playerCards,
                                                                List <BattlegroundCard> opponentCards, int cardIndex, BattlegroundBoard board)
        {
            List <Deathrattle> deathrattles = new List <Deathrattle>();

            for (int i = 0; i < playerCards.Count; i++)
            {
                Deathrattle deathrattle = new Deathrattle();
                Buff        buff        = new Buff(0, 0, true);
                buff.playerCardIndices.Add(i);
                deathrattle.buffs.Add(buff);
                deathrattles.Add(deathrattle);
            }
            return(deathrattles);
        }
        public override List <Deathrattle> GenerateDeathrattles(List <BattlegroundCard> playerCards,
                                                                List <BattlegroundCard> opponentCards, int cardIndex, BattlegroundBoard board)
        {
            Deathrattle deathrattle = new Deathrattle();

            deathrattle.playerCardIndex = cardIndex;
            for (int i = 0; i < _summonAmount; i++)
            {
                BattlegroundCard card = new BattlegroundCard(_summonCard);
                deathrattle.playerCards.Add(card);
            }
            return(new List <Deathrattle> {
                deathrattle
            });
        }
        public override List <Deathrattle> GenerateDeathrattles(List <BattlegroundCard> playerCards,
                                                                List <BattlegroundCard> opponentCards, int cardIndex, BattlegroundBoard board)
        {
            List <Deathrattle> deathrattles = new List <Deathrattle>();
            Deathrattle        deathrattle  = new Deathrattle();
            Buff buff = new Buff(0, 0, true);

            for (int i = 0; i < playerCards.Count; i++)
            {
                if (playerCards[i].race == HearthDb.Enums.Race.DRAGON)
                {
                    buff.playerCardIndices.Add(i);
                }
            }
            deathrattle.buffs.Add(buff);
            deathrattles.Add(deathrattle);
            return(deathrattles);
        }
Пример #10
0
        public override List <Deathrattle> GenerateDeathrattles(List <BattlegroundCard> playerCards,
                                                                List <BattlegroundCard> opponentCards, int cardIndex, BattlegroundBoard board)
        {
            List <Deathrattle> deathrattles = new List <Deathrattle>();
            Deathrattle        deathrattle  = new Deathrattle();
            Debuff             debuff       = new Debuff(0, 1);

            for (int i = 0; i < playerCards.Count; i++)
            {
                debuff.playerCardIndices.Add(i);
            }
            for (int i = 0; i < opponentCards.Count; i++)
            {
                debuff.opponentCardIndices.Add(i);
            }
            deathrattle.debuffs.Add(debuff);
            deathrattles.Add(deathrattle);
            return(deathrattles);
        }
Пример #11
0
        public override List <Deathrattle> GenerateDeathrattles(List <BattlegroundCard> playerCards,
                                                                List <BattlegroundCard> opponentCards, int cardIndex, BattlegroundBoard board)
        {
            // Summon rats based on the attack.
            Deathrattle deathrattle = new Deathrattle();

            deathrattle.playerCardIndex = cardIndex;
            deathrattle.playerCards     = new List <BattlegroundCard>();
            Card rat = Utils.GetCardFromName("Rat");

            for (int i = 0; i < attack; i++)
            {
                BattlegroundCard summonCard = new BattlegroundCard(rat);
                deathrattle.playerCards.Add(summonCard);
            }
            List <Deathrattle> deathrattles = new List <Deathrattle>();

            deathrattles.Add(deathrattle);
            return(deathrattles);
        }
        public override List <Deathrattle> GenerateDeathrattles(List <BattlegroundCard> playerCards,
                                                                List <BattlegroundCard> opponentCards, int cardIndex, BattlegroundBoard board)
        {
            // TODO: Handle Khadgar effects (e.g. with micro machines).
            List <string> possibleSummonNames =
                new List <string>(
                    new string[] {
                "Old Murk-Eye",
                "Khadgar",
                "Shifter Zerus",
                "The Beast",
                "Bolvar, Fireblood",
                "Baron Rivendare",
                "Brann Bronzebeard",
                "Goldrinn, the Great Wolf",
                "King Bagurgle",
                "Mal'Ganis",
                "Foe Reaper 4000",
                "Maexxna"
            });
            List <Card> possibleSummonCards = new List <Card>();

            foreach (string summonName in possibleSummonNames)
            {
                possibleSummonCards.Add(Utils.GetCardFromName(summonName));
            }
            List <Deathrattle> deathrattles = new List <Deathrattle>();

            foreach (Card card in possibleSummonCards)
            {
                Deathrattle deathrattle = new Deathrattle();
                deathrattle.playerCardIndex = cardIndex;
                deathrattle.playerCards     = new List <BattlegroundCard>();
                BattlegroundCard summonCard = Utils.CreateBattlegroundCard(card);
                deathrattle.playerCards.Add(summonCard);
                deathrattles.Add(deathrattle);
            }
            return(deathrattles);
        }
        public override List <Deathrattle> GenerateDeathrattles(List <BattlegroundCard> playerCards,
                                                                List <BattlegroundCard> opponentCards, int cardIndex, BattlegroundBoard board)
        {
            // TODO: Handle unstable ghoul, khadgar effects separately.
            List <string> possibleSummonNames =
                new List <string>(
                    new string[] {
                "Dire Wolf Alpha",
                "Vulgar Homunculus",
                "Micro Machine",
                "Murloc Tidehunter",
                "Rockpool Hunter",
                "Dragonspawn Lieutenant",
                "Kindly Grandmother",
                "Scavenging Hyena",
                "Unstable Ghoul",
                "Khadgar"
            });
            List <Card> possibleSummonCards = new List <Card>();

            foreach (string summonName in possibleSummonNames)
            {
                possibleSummonCards.Add(Utils.GetCardFromName(summonName));
            }
            List <Deathrattle> deathrattles = new List <Deathrattle>();

            foreach (Card card in possibleSummonCards)
            {
                Deathrattle deathrattle = new Deathrattle();
                deathrattle.playerCardIndex = cardIndex;
                deathrattle.playerCards     = new List <BattlegroundCard>();
                BattlegroundCard summonCard = Utils.CreateBattlegroundCard(card);
                deathrattle.playerCards.Add(summonCard);
                deathrattles.Add(deathrattle);
            }
            return(deathrattles);
        }
 public void AddDeathrattle(Deathrattle deathrattle)
 {
     _deathrattles.Add(deathrattle);
 }
 private void Start()
 {
     battlecry   = GetComponent <Battlecry>();
     deathrattle = GetComponent <Deathrattle>();
     takeDamage  = GetComponent <TakeDamage>();
 }