示例#1
0
            public override IEffectHandle GetHandle(IGame game)
            {
                var limit = new Limit(PlayerScope.AnyPlayer, TimeScope.Round, 1);

                var handSize = game.ActivePlayer.Hand.Cards.Count();

                if (handSize == 0)
                {
                    return base.GetHandle(game);
                }
                else
                {
                    var builder =
                        new ChoiceBuilder(string.Format("The active player may discard a card from their hand to give '{0}' +1 Willpower until the end of the phase", CardSource.Title), game, game.ActivePlayer);

                    if (handSize == 1)
                    {
                        builder.Question("You only have 1 card in your hand, do you want to discard it?")
                            .Answer("Yes, I will discard it", game.ActivePlayer.Hand.Cards.First(), (source, handle, card) => PlayerDiscardsOneCard(source, handle, game.ActivePlayer, card))
                            .LastAnswer("No, I will not discard my last card from my hand", false, (source, handle, item) => CancelDiscard(source, handle, game.ActivePlayer));
                    }
                    else
                    {
                        builder.Question(string.Format("{0}, do you want to discard a card from your hand?", game.ActivePlayer.Name))
                            .Answer("Yes, I will discard a card from my hand", true)
                                .Question("Which card will you discard?")
                                    .LastAnswers(game.ActivePlayer.Hand.Cards.ToList(), (item) => item.Title, (source, handle, card) => PlayerDiscardsOneCard(source, handle, game.ActivePlayer, card))
                            .LastAnswer("No, I will not discard a card from my hand", false, (source, handle, item) => CancelDiscard(source, handle, game.ActivePlayer));
                    }

                    return new EffectHandle(this, builder.ToChoice());
                }
            }
示例#2
0
            public override IEffectHandle GetHandle(IGame game)
            {
                var limit = new Limit(PlayerScope.Controller, TimeScope.Round, 1);

                var controller = game.GetController(CardSource.Id);
                if (controller == null)
                    return base.GetHandle(game);

                var exhaustable = controller.CardsInPlay.OfType<IExhaustableInPlay>().Where(x => x.BaseCard.Id == source.Id).FirstOrDefault();
                if (exhaustable == null || exhaustable.IsExhausted)
                    return base.GetHandle(game);

                var builder =
                    new ChoiceBuilder(string.Format("Exhaust '{0}' to have a plyer draw 2 cards", CardSource.Title), game, controller);
                
                if (game.Players.Count() == 1)
                {
                    builder.Question(string.Format("You are the only player, exhaust '{0}' to draw 2 cards?", CardSource.Title))
                        .Answer(string.Format("Yes, I want to exhaust '{0}' to draw 2 cards", CardSource.Title), controller, (source, handle, player) => ExhaustAndPlayerDrawsTwoCards(source, handle, controller, exhaustable, player))
                        .LastAnswer("No, I do not want to exhaust '{0}' to draw 2 cards", false, (source, handle, item) => CancelEffect(source, handle, controller));
                }
                else
                {
                    builder.Question(string.Format("{0}, do you want to exhaust '{1}' to have a player draw 2 cards?", controller.Name))
                        .Answer(string.Format("Yes, I will exhaust '{0}' to have a player draw 2 cards", CardSource.Title), true)
                            .Question("Which player should draw 2 cards?")
                                .LastAnswers(game.Players.ToList(), item => item.Name, (source, handle, player) => ExhaustAndPlayerDrawsTwoCards(game, handle, controller, exhaustable, player))
                        .LastAnswer(string.Format("No, I do not want to exhaust '{0}' to have a player draw 2 cards", CardSource.Title), false, (source, handle, item) => CancelEffect(source, handle, controller));
                        
                }

                var choice = builder.ToChoice();

                return new EffectHandle(this, choice, limit);
            }
            public override IEffectHandle GetHandle(IGame game)
            {
                var limit = new Limit(PlayerScope.None, TimeScope.Round, 1);

                var controller = game.GetController(CardSource.Id);
                if (controller == null)
                    return base.GetHandle(game);

                var resourceful = controller.CardsInPlay.OfType<ICharacterInPlay>().Where(x => x.Card.Id == source.Id).FirstOrDefault();
                if (resourceful == null || resourceful.Resources == 0)
                    return base.GetHandle(game);

                var characters = game.GetAllCardsInPlay<ICharacterInPlay>().Where(x => x.Damage > 0).ToList();
                if (characters.Count == 0)
                    return base.GetHandle(game);

                var builder =
                    new ChoiceBuilder("Choose a wounded character in play to heal", game, controller)
                        .Question("Which character do you want to heal 1 damage on?")
                            .Answers(characters, item => string.Format("{0} ({1} damage of {2} hit points)", item.Title, item.Damage, item.Card.PrintedHitPoints), (source, handle, character) => HealOneDamageOnCharacter(game, handle, controller, resourceful, character))
                            .LastAnswer(string.Format("No, I do not want to pay 1 resource from '{0}' to heal a character", CardSource.Title), false, (source, handle, item) => handle.Cancel(string.Format("{0} chose not to pay 1 resource from '{1}' to heal a character", controller.Name, CardSource.Title)));
                
                return new EffectHandle(this, builder.ToChoice(), limit);
            }