Example #1
0
        private void DrawCards()
        {
            /* DRAW PHASE
             *  The Slayer player draws 3 cards from the Slayer Deck.
             *  The Dragon player draws 3 cards from the Dragon Deck.
             *  If a deck runs out shuffle the discard and draw from it.
             *  Maximum hand size is 7 cards. Discard excess cards.
             */

            SlayerDeck.DrawFromDeck(_slayerDrawsLess ? ReducedDrawNumber : NormalDrawNumber, Slayer.Hand, DiscardExtraSlayer);
            SlayerCheckArtifacts();

            DragonDeck.DrawFromDeck(_dragonDrawsLess ? ReducedDrawNumber : NormalDrawNumber, Dragon.Hand, DiscardExtraDragon);
        }
Example #2
0
        private void PlaySlayer()
        {
            /* SLAYER PHASE
             *  The party may attack the Dragon.
             *  To make an attack, an attack card must be discarded from the players hand.
             *  The party may make multiple attacks.
             *  There must also be one party member alive who can make the attack.
             *  For example:  To make a spell attack the party must have at least one Wizard.
             *  Both Warriors & Men-at-Arms may make Sword Attacks.
             *  A party member may make only one attack per turn.
             *  For example:  If you have 2 Wizards you could make 2 spell attacks per turn.
             *  Each attack does a base of 1 point of damage to the Dragon.
             *  Some cards indicate they do a base 2 points of damage.
             *  Warriors inflict an additional point of damage when they attack.
             *  Some artifacts increase the amount of damage done by an attack.
             *  The Dragon player may block an attack by discarding a Blocking
             *  Card that targets the attack type.
             *  For example: The Dragon player may discard a ‘Magic Resistance’ card to
             *  negate a spell attack.
             */

            BaseCard playCard;

            do
            {
                GameMessage("Please choose a card to play...");
                playCard = GetSlayerPlayCard();
                var usedMembers = new List <SlayerRecruit>();

                if (playCard == null)
                {
                    GameMessage("Ok, your turn is over.");
                    break;
                }

                switch (playCard.CardAction)
                {
                case ECardAction.Attack:
                    var playMember = GetSlayerAttackMember();
                    if (playMember == null)
                    {
                        GameMessage("Sorry, you have to choose a member to attack with! Please try again...");
                        continue;
                    }
                    if (usedMembers.Contains(playMember))
                    {
                        GameMessage("Sorry, you've already attacked with that member! Please choose again...");
                        continue;
                    }

                    if (!playMember.CanAttackWith(playCard))
                    {
                        GameMessage("Sorry, this member can't attack like that! Please choose again...");
                        continue;
                    }

                    usedMembers.Add(playMember);

                    var blockingCard = GetDragonBlockingCard();
                    if (blockingCard == null)
                    {
                        // Damage Applied!
                        Dragon.DamageDragon(playCard, playMember);
                        GameMessage("You successfully attacked the Dragon! Do you want to play another card?");
                    }
                    else
                    {
                        // Damage Blocked!
                        DragonDeck.DiscardCard(blockingCard, Dragon.Hand);
                        GameMessage("Sorry, the Dragon blocked your attack. Do you want to play another card?");
                    }

                    // Magic Scrolls don't discard the attack card
                    if (playMember.Artifact != null && playMember.Artifact.Type == EArtifactType.MagicScrolls)
                    {
                        continue;
                    }

                    SlayerDeck.DiscardCard(playCard, Slayer.Hand);
                    break;

                case ECardAction.DiscardToDraw:
                    SlayerDeck.DiscardCard(playCard, Slayer.Hand);
                    SlayerDeck.DrawFromDeck(_slayerDrawsLess ? ReducedDrawNumber : NormalDrawNumber, Slayer.Hand, DiscardExtraSlayer);
                    GameMessage("You have drawn more cards. Do you want to play another card?");
                    break;

                case ECardAction.EnemyDrawsLess:
                    SlayerDeck.DiscardCard(playCard, Slayer.Hand);
                    _dragonDrawsLess = true;
                    GameMessage("You have hindered the Dragon's next draw. Do you want to play another card?");
                    break;

                case ECardAction.Regenerate:
                    var reviveMember = GetSlayerReviveMember();

                    if (reviveMember == null)
                    {
                        GameMessage("No party members revived. Do you want to play another card?");
                        continue;
                    }

                    if (Slayer.Dead.Count > 0)
                    {
                        SlayerDeck.DiscardCard(playCard, Slayer.Hand);
                        Slayer.Dead.Remove(reviveMember);
                        Slayer.Party.Add(reviveMember);
                        GameMessage("You have revived a party member. Do you want to play another card?");
                    }
                    else
                    {
                        GameMessage("You have no party members to revive! Do you want to play another card?");
                    }
                    break;
                }

                if (Dragon.HitPoints <= 0)
                {
                    // YOU WIN!
                    GameMessage("Well done, you have defeated the Dragon!");
                    GameOver(Slayer);
                }
            } while (playCard != null);
        }