public static IActivity SelectARevealedCardToPutOnTopOfDeck(IGameLog log, Player player, RevealZone revealZone, string message, ICard source) { return(new SelectFromRevealedCardsActivity(log, player, revealZone, message, SelectionSpecifications.SelectExactlyXCards(1), source) { AfterCardsSelected = cards => { player.Deck.MoveToTop(cards.Single()); if (revealZone.CardCount == 1) { var lastCard = revealZone.Single(); player.Deck.MoveToTop(lastCard); //log.LogMessage("{0} put a {1} on top.", player.Name, lastCard.Name); } }, Hint = ActivityHint.RedrawCards }); }
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 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 static IActivity ChooseWhetherToMillTopCard(TurnContext context, Player choosingPlayer, Player targetPlayer, ICard source) { var revealZone = new RevealZone(targetPlayer); targetPlayer.Deck.TopCard.MoveTo(revealZone); revealZone.LogReveal(context.Game.Log); var otherPlayerMessage = string.Format("Put {0}'s card in the discard pile?", targetPlayer.Name); var selfMessage = "Put your own card in the discard pile?"; var activity = new ChooseBasedOnRevealedCardsActivity( context.Game.Log, choosingPlayer, revealZone, choosingPlayer == targetPlayer ? selfMessage : otherPlayerMessage, source, Choice.Yes, Choice.No ); activity.ActOnChoice = choice => { var card = revealZone.Single(); string actionDescription; if (choice == Choice.Yes) { actionDescription = "into the discard pile"; card.MoveTo(targetPlayer.Discards); } else { actionDescription = "back on top"; targetPlayer.Deck.MoveToTop(card); } var message = string.Format("{0} put {1}'s {2} {3}.", context.ActivePlayer, targetPlayer, card.Name, actionDescription); context.Game.Log.LogMessage(message); }; return(activity); }
public static IActivity ChooseWhetherToMillTopCard(TurnContext context, Player choosingPlayer, Player targetPlayer, ICard source) { var revealZone = new RevealZone(targetPlayer); targetPlayer.Deck.TopCard.MoveTo(revealZone); revealZone.LogReveal(context.Game.Log); var otherPlayerMessage = string.Format("Put {0}'s card in the discard pile?", targetPlayer.Name); var selfMessage = "Put your own card in the discard pile?"; var activity = new ChooseBasedOnRevealedCardsActivity( context.Game.Log, choosingPlayer, revealZone, choosingPlayer == targetPlayer ? selfMessage : otherPlayerMessage, source, Choice.Yes, Choice.No ); activity.ActOnChoice = choice => { var card = revealZone.Single(); string actionDescription; if (choice == Choice.Yes) { actionDescription = "into the discard pile"; card.MoveTo(targetPlayer.Discards); } else { actionDescription = "back on top"; targetPlayer.Deck.MoveToTop(card); } var message = string.Format("{0} put {1}'s {2} {3}.", context.ActivePlayer, targetPlayer, card.Name, actionDescription); context.Game.Log.LogMessage(message); }; return activity; }
public static IActivity SelectARevealedCardToPutOnTopOfDeck(IGameLog log, Player player, RevealZone revealZone, string message, ICard source) { return new SelectFromRevealedCardsActivity(log, player, revealZone, message, SelectionSpecifications.SelectExactlyXCards(1), source) { AfterCardsSelected = cards => { player.Deck.MoveToTop(cards.Single()); if(revealZone.CardCount == 1) { var lastCard = revealZone.Single(); player.Deck.MoveToTop(lastCard); //log.LogMessage("{0} put a {1} on top.", player.Name, lastCard.Name); } }, Hint = ActivityHint.RedrawCards }; }