示例#1
0
            public override void Attack(Player victim, TurnContext context, ICard source)
            {
                var revealZone = new RevealZone(victim);

                victim.Deck.MoveTop(2, revealZone);
                revealZone.LogReveal(context.Game.Log);

                var revealedTreasures = revealZone.OfType <ITreasureCard>().WithDistinctTypes();

                switch (revealedTreasures.Count())
                {
                case 0:
                    revealZone.MoveAll(victim.Discards);
                    return;

                case 1:
                    var trashedCard        = TrashAndDiscard(context, revealZone, revealedTreasures);
                    var gainChoiceActivity = Activities.GainOpponentsCardChoice(context, trashedCard, revealZone.Owner, source);
                    _activities.Add(gainChoiceActivity);
                    break;

                default:
                    var chooseTreasureActivity = CreateChooseTreasureActivity(context, revealZone, source);
                    _activities.Add(chooseTreasureActivity);
                    break;
                }
            }
示例#2
0
            private IActivity CreateChooseActionActivity(TurnContext context, RevealZone revealZone, ICard source)
            {
                var selectTreasure = new SelectFromRevealedCardsActivity(context.Game.Log, context.ActivePlayer, revealZone,
                                                                         "Select the action to play first.", SelectionSpecifications.SelectExactlyXCards(1), source);

                selectTreasure.AfterCardsSelected = cards =>
                {
                    var first  = cards.OfType <IActionCard>().Single();
                    var second = revealZone.OfType <IActionCard>().Single(c => c != first);

                    // Reverse order because we're on a stack.
                    context.AddEffect(source, new PlayCardEffect(second));
                    context.AddEffect(source, new PlayCardEffect(first));
                };

                return(selectTreasure);
            }
示例#3
0
 private IEnumerable <IActionCard> MatchingActions(RevealZone zone)
 {
     return(zone.OfType <IActionCard>().Where(c => !(c is Golem)));
 }
示例#4
0
 private IEnumerable <ITreasureCard> MatchingCards(RevealZone zone)
 {
     return(zone.OfType <ITreasureCard>());
 }