예제 #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);
        }
예제 #2
0
        private void PlayDragon()
        {
            /* DRAGON PHASE
             *  The Dragon may attack the party.
             *  To make an attack, an attack card must be discarded from the players hand.
             *  The Dragon may make multiple attacks.
             *  The Dragon may only use one attack type once per turn.
             *  For example: The Dragon may not make 2 Firebreath attacks in one turn.
             *  The Dragon may only use one body part to make one attack type once per turn.
             *  For example: The Bite and Firebreath attacks are both ‘Mouth’ attacks so
             *  only one may be used.
             *  The Slayer player may block an attack by discarding a Blocking Card that
             *  matches the target type.
             *  For example: The Slayer may discard a ‘Shield’ card to negate an attack vs a
             *  Warrior or a Man-at-Arms.
             *  Each attack targets one party member.
             *  Dragons must attack Men-at-Arms first.
             *  After all the Men-at-Arms are killed the Dragon may attack Warriors next.
             *  After all the Warriors are killed the Dragon may attack Archers & Wizards.
             */

            var           typesPlayed = new List <EAttackType>();
            BaseCard      playCard;
            SlayerRecruit playTarget;

            do
            {
                GameMessage("Please choose a card to play...");
                playCard = GetDragonPlayCard();

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

                switch (playCard.CardAction)
                {
                case ECardAction.Attack:
                    if (typesPlayed.Contains(playCard.AttackType))
                    {
                        GameMessage("Sorry, you've already attacked with that type! Please choose again...");
                        continue;
                    }

                    typesPlayed.Add(playCard.AttackType);
                    playTarget = GetDragonAttackTarget();

                    if (playTarget == null)
                    {
                        GameMessage("Sorry, you have to choose a target for that attack! Please try again...");
                        continue;
                    }

                    if (!_dragonCanAttackAnyHero && playTarget.Type != ERecruitType.MenAtArms && Slayer.Party.Any(_ => _.Type == ERecruitType.MenAtArms))
                    {
                        GameMessage("Wait, you must first attack a Man-at-Arms target while they are up! Please try again...");
                        continue;
                    }

                    if (!_dragonCanAttackAnyHero && playTarget.Type != ERecruitType.Warrior && Slayer.Party.Any(_ => _.Type == ERecruitType.Warrior))
                    {
                        GameMessage("Wait, you must first attack a Warrior target while they are up! Please try again...");
                        continue;
                    }

                    var blockingCard = GetSlayerBlockingCard();
                    if (blockingCard == null)
                    {
                        if (!playTarget.Artifact.DamageReduced())
                        {
                            // Damage Applied!
                            Slayer.DamageParty(playCard, playTarget);
                            GameMessage("You successfully attacked the Slayer's party! Do you want to play another card?");
                        }
                        else
                        {
                            GameMessage("Sorry, the Slayer blocked your attack. Do you want to play another card?");
                        }
                    }
                    else
                    {
                        // Damage Blocked!
                        SlayerDeck.DiscardCard(blockingCard, Slayer.Hand);
                        GameMessage("Sorry, the Slayer blocked your attack. Do you want to play another card?");
                    }
                    _dragonCanAttackAnyHero = false;
                    DragonDeck.DiscardCard(playCard, Dragon.Hand);
                    break;

                case ECardAction.DiscardToDraw:
                    DragonDeck.DiscardCard(playCard, Dragon.Hand);
                    DragonDeck.DrawFromDeck(_dragonDrawsLess ? ReducedDrawNumber : NormalDrawNumber, Dragon.Hand, DiscardExtraDragon);
                    GameMessage("You have drawn more cards. Do you want to play another card?");
                    break;

                case ECardAction.AttackAnyHero:
                    DragonDeck.DiscardCard(playCard, Dragon.Hand);
                    _dragonCanAttackAnyHero = true;
                    GameMessage("You can now attack any hero! Do you want to play another card?");
                    break;

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

                case ECardAction.Regenerate:
                    if (Dragon.HitPoints < DragonPlayer.MaxHealth)
                    {
                        DragonDeck.DiscardCard(playCard, Dragon.Hand);
                        Dragon.HitPoints++;
                        GameMessage("You have regenerated some health. Do you want to play another card?");
                    }
                    else
                    {
                        GameMessage("You are already at max health! Do you want to play another card?");
                    }
                    break;
                }

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