public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState) { Card cardType = currentPlayer.RequestPlayerNameACard(gameState); currentPlayer.RevealCardsFromDeck(3, gameState); while (currentPlayer.cardsBeingRevealed.HasCard(cardType)) { currentPlayer.MoveRevealedCardToTrash(cardType, gameState); } currentPlayer.RequestPlayerPutRevealedCardsBackOnDeck(gameState); }
public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState) { Card namedCard = currentPlayer.RequestPlayerNameACard(gameState); int cardFoundCount = 0; while(true) { Card revealedCard = currentPlayer.DrawAndRevealOneCardFromDeck(gameState); if (revealedCard == null) break; if (revealedCard == namedCard) continue; cardFoundCount++; if (cardFoundCount >= 3) break; } currentPlayer.MoveRevealedCardsToHand(card => card != namedCard); currentPlayer.MoveRevealedCardsToDiscard(gameState); }
public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState) { Card cardType = currentPlayer.RequestPlayerNameACard(gameState); Card foundCard = null; gameState.gameLog.PushScope(); while (true) { foundCard = currentPlayer.DrawAndRevealOneCardFromDeck(); if (foundCard == null) break; if (foundCard.isVictory && foundCard != cardType) { break; } } currentPlayer.MoveRevealedCardsToDiscard(cardToMove => !cardToMove.Equals(foundCard), gameState); gameState.gameLog.PopScope(); if (foundCard != null) { int cardCost = foundCard.CurrentCoinCost(currentPlayer); currentPlayer.MoveRevealedCardToTrash(foundCard, gameState); currentPlayer.RequestPlayerGainCardFromSupply(gameState, acceptableCard => acceptableCard.isVictory && acceptableCard.CurrentCoinCost(currentPlayer) <= cardCost + 3 && acceptableCard.potionCost == foundCard.potionCost, "Gain a victory card costing up to 3 more than the trashed card."); } }