public override void Attack(Player player, TurnContext context) { var revealZone = new RevealZone(player); player.Deck.MoveTop(3, revealZone); revealZone.LogReveal(context.Game.Log); revealZone.MoveWhere(c => c is IActionCard || c is ITreasureCard, player.Discards); foreach (var activity in Activities.SelectMultipleRevealedCardsToPutOnTopOfDeck(context.Game.Log, player, revealZone)) _activities.Add(activity); }
public override void Resolve(TurnContext context, ICard source) { var leftPlayer = context.Opponents.FirstOrDefault(); if (leftPlayer != null) { var revealZone = new RevealZone(context.ActivePlayer); context.ActivePlayer.Deck.MoveTop(5, revealZone); revealZone.LogReveal(context.Game.Log); var activity = CreateChooseCardActivity(context, revealZone, leftPlayer, source); _activities.Add(activity); } }
public override void Attack(Player victim, TurnContext context, ICard source) { var revealZone = new RevealZone(victim); victim.Deck.MoveTop(3, revealZone); revealZone.LogReveal(context.Game.Log); revealZone.MoveWhere(c => c is IActionCard || c is ITreasureCard, victim.Discards); if(revealZone.CardCount == 1) victim.Deck.MoveToTop(revealZone.Single()); foreach (var activity in Activities.SelectMultipleRevealedCardsToPutOnTopOfDeck(context.Game.Log, victim, revealZone, source)) _activities.Add(activity); }
public override void Resolve(TurnContext context, ICard source) { var revealZone = new RevealZone(context.ActivePlayer); context.ActivePlayer.Deck.MoveTop(4, revealZone); revealZone.LogReveal(context.Game.Log); revealZone.MoveWhere(c => c is Copper || c is Potion, context.ActivePlayer.Hand); if (revealZone.CardCount == 1) context.ActivePlayer.Deck.MoveToTop(revealZone.Single()); foreach (var activity in Activities.SelectMultipleRevealedCardsToPutOnTopOfDeck(context.Game.Log, context.ActivePlayer, revealZone, source)) _activities.Add(activity); }
public override void Resolve(TurnContext context, ICard source) { var deck = context.ActivePlayer.Deck; var revealZone = new RevealZone(context.ActivePlayer); while (deck.TopCard != null && MatchingCards(revealZone).Count() < 2) deck.TopCard.MoveTo(revealZone); revealZone.LogReveal(context.Game.Log); var revealedTreasure = MatchingCards(revealZone).ToList(); var discards = revealZone.Where(c => !revealedTreasure.Cast<ICard>().Contains(c)).ToList(); foreach(var card in discards) card.MoveTo(context.ActivePlayer.Discards); foreach (var card in revealedTreasure) card.MoveTo(context.ActivePlayer.Hand); }
public void Play(TurnContext context) { var leftPlayer = context.Opponents.FirstOrDefault(); if (leftPlayer != null) { var revealZone = new RevealZone(leftPlayer); leftPlayer.Deck.MoveTop(2, revealZone); revealZone.LogReveal(context.Game.Log); foreach (var card in revealZone.WithDistinctTypes()) { if (card is IActionCard) context.RemainingActions += 2; if (card is ITreasureCard) context.AvailableSpend += 2; if (card is IVictoryCard) context.DrawCards(2); } revealZone.MoveAll(leftPlayer.Discards); } }
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; } }
public override void Resolve(TurnContext context, ICard source) { var deck = context.ActivePlayer.Deck; var revealZone = new RevealZone(context.ActivePlayer); while (deck.TopCard != null && MatchingActions(revealZone).Count() < 2) deck.TopCard.MoveTo(revealZone); revealZone.LogReveal(context.Game.Log); var actionsToPlay = MatchingActions(revealZone).ToList(); var discards = revealZone.Where(c => !actionsToPlay.Cast<ICard>().Contains(c)) .ToList(); foreach(var card in discards) card.MoveTo(context.ActivePlayer.Discards); var playUtil = new PlayCardUtility(context); if (actionsToPlay.AllSame(a => a.Name)) playUtil.Play(actionsToPlay); else _activities.Add(CreateChooseActionActivity(context, revealZone, source)); }