public override void OverpayOnPurchase(PlayerState currentPlayer, GameState gameState, int overpayAmount) { for (int i = 0; i < overpayAmount; ++i) { if (!currentPlayer.deck.Any()) break; currentPlayer.LookAtCardsFromDeck(1, gameState); DeckPlacement deckPlacement = currentPlayer.actions.ChooseBetweenTrashTopDeckDiscard(gameState, currentPlayer.CardsBeingLookedAt.SomeCard()); switch (deckPlacement) { case DeckPlacement.Trash: currentPlayer.RequestPlayerTrashLookedAtCard(gameState); break; case DeckPlacement.Discard: currentPlayer.MoveLookedAtCardsToDiscard(gameState); break; case DeckPlacement.Deck: currentPlayer.MoveLookedAtCardToTopOfDeck(); break; default: throw new Exception("Invalid option"); } } }
public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState) { currentPlayer.GainCardFromSupply(Silver.card, gameState); // look at the top card of the deck and discard or put it back Card card = currentPlayer.DrawAndLookAtOneCardFromDeck(); if (card != null) { if (currentPlayer.actions.ShouldPlayerDiscardCardFromDeck(gameState, currentPlayer, card)) { currentPlayer.gameLog.PushScope(); currentPlayer.MoveLookedAtCardsToDiscard(gameState); currentPlayer.gameLog.PlayerDiscardCard(currentPlayer, card); currentPlayer.gameLog.PopScope(); } else { currentPlayer.MoveLookedAtCardToTopOfDeck(card); } } currentPlayer.DrawUntilCountInHand(5); currentPlayer.RequestPlayerTrashCardFromHand(gameState, acceptableCard => !acceptableCard.isTreasure, isOptional: true); }
public override void OverpayOnPurchase(PlayerState currentPlayer, GameState gameState, int overpayAmount) { for (int i = 0; i < overpayAmount; ++i) { if (!currentPlayer.deck.Any()) break; currentPlayer.LookAtCardsFromDeck(1); PlayerActionChoice choice = currentPlayer.RequestPlayerChooseBetween(gameState, acceptableChoice => acceptableChoice == PlayerActionChoice.Trash || acceptableChoice == PlayerActionChoice.Discard || acceptableChoice == PlayerActionChoice.TopDeck); switch (choice) { case PlayerActionChoice.Trash: currentPlayer.RequestPlayerTrashLookedAtCard(gameState); break; case PlayerActionChoice.Discard: currentPlayer.MoveLookedAtCardsToDiscard(gameState); break; case PlayerActionChoice.TopDeck: currentPlayer.MoveLookedAtCardToTopOfDeck(); break; default: throw new Exception("Unhandled case"); } } }