本文整理汇总了C#中Dominion.PlayerState.RequestPlayerGainCardFromSupply方法的典型用法代码示例。如果您正苦于以下问题:C# PlayerState.RequestPlayerGainCardFromSupply方法的具体用法?C# PlayerState.RequestPlayerGainCardFromSupply怎么用?C# PlayerState.RequestPlayerGainCardFromSupply使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dominion.PlayerState
的用法示例。
在下文中一共展示了PlayerState.RequestPlayerGainCardFromSupply方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DoSpecializedWhenGain
public override DeckPlacement DoSpecializedWhenGain(PlayerState currentPlayer, GameState gameState)
{
currentPlayer.RequestPlayerGainCardFromSupply(
gameState,
card => card.CurrentCoinCost(currentPlayer) < this.CurrentCoinCost(currentPlayer) && card.potionCost == 0,
"Must gain a card costing less than this");
return DeckPlacement.Default;
}
示例2: DoSpecializedAction
public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState)
{
PlayerActionChoice choice = currentPlayer.RequestPlayerChooseBetween(gameState,
acceptableChoice => acceptableChoice == PlayerActionChoice.GainCard || acceptableChoice == PlayerActionChoice.Trash);
if (choice == PlayerActionChoice.GainCard)
{
currentPlayer.RequestPlayerGainCardFromTrash(gameState,
acceptableCard => CardValidToGainFromTrash(acceptableCard, currentPlayer),
"Must gain a card costing between 3 and 6",
defaultLocation: DeckPlacement.TopOfDeck);
}
else
{
Card trashedCard = currentPlayer.RequestPlayerTrashCardFromHand(gameState, acceptableCard => CardValidToTrash(acceptableCard), isOptional: false);
if (trashedCard != null)
{
int maxCost = trashedCard.CurrentCoinCost(currentPlayer) + 3;
currentPlayer.RequestPlayerGainCardFromSupply(gameState,
acceptableCard => acceptableCard.CurrentCoinCost(currentPlayer) <= maxCost && acceptableCard.potionCost <= trashedCard.potionCost,
"gain a card costing up to 3 more than the trashed card");
}
}
}
示例3: DoSpecializedAction
public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState)
{
currentPlayer.RequestPlayerGainCardFromSupply(gameState, card => card.isTreasure, "Gain a Treasure");
}
示例4: DoSpecializedAction
public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState)
{
currentPlayer.MoveCardFromPlayToTrash(gameState);
currentPlayer.RequestPlayerGainCardFromSupply(
gameState,
card => card.CurrentCoinCost(currentPlayer) <= 5 && card.potionCost == 0
, "cost of card up to 5");
}
示例5: DoSpecializedAction
public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState)
{
currentPlayer.RequestPlayerGainCardFromSupply(gameState, card => card.isAction && card.CurrentCoinCost(currentPlayer) <= 5 && card.potionCost == 0,
"May gain an action card costing up to 5",
isOptional:true);
}
示例6: DoSpecializedActionOnBuyWhileInPlay
private new void DoSpecializedActionOnBuyWhileInPlay(PlayerState currentPlayer, GameState gameState, Card boughtCard)
{
currentPlayer.RequestPlayerGainCardFromSupply(gameState,
card => !card.isVictory && card.CurrentCoinCost(currentPlayer) < boughtCard.CurrentCoinCost(currentPlayer) && card.potionCost <= boughtCard.potionCost,
"Must gain a non victory card costing less than the bought card");
}
示例7: DoSpecializedAction
public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState)
{
Card trashedCard = currentPlayer.RequestPlayerTrashCardFromHand(gameState, card => true, false);
int trashedCardCost = trashedCard.CurrentCoinCost(currentPlayer);
currentPlayer.RequestPlayerGainCardFromSupply(gameState, card => card.CurrentCoinCost(currentPlayer) == (trashedCardCost - 1) && card.potionCost == trashedCard.potionCost, "Must gain a card costing one less than the trashed card.", isOptional: false, defaultLocation: DeckPlacement.TopOfDeck);
currentPlayer.RequestPlayerGainCardFromSupply(gameState, card => card.CurrentCoinCost(currentPlayer) == (trashedCardCost + 1) && card.potionCost == trashedCard.potionCost, "Must gain a card costing exactly one more than the trashed card.", isOptional: false, defaultLocation: DeckPlacement.TopOfDeck);
// TODO: put the cards on top of your deck in either order.
//throw new NotImplementedException();
}
示例8: DoSpecializedAction
public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState)
{
Card trashedCard = currentPlayer.RequestPlayerTrashCardFromHand(gameState, acceptableCard => acceptableCard.isTreasure, isOptional: true);
PlayerState.AttackAction attackAction = this.DoEmptyAttack;
if (trashedCard != null)
{
attackAction = delegate(PlayerState currentPlayer2, PlayerState otherPlayer, GameState gameState2)
{
if (otherPlayer.Hand.Count >= 5)
{
otherPlayer.DiscardCardFromHand(gameState, trashedCard);
}
};
currentPlayer.RequestPlayerGainCardFromSupply(gameState,
acceptableCard => acceptableCard.isTreasure &&
acceptableCard.CurrentCoinCost(currentPlayer) <= trashedCard.CurrentCoinCost(currentPlayer) + 3 &&
acceptableCard.potionCost == 0,
"Gain a card costing up to 3 more than the trashed card",
isOptional: false,
defaultLocation: DeckPlacement.TopOfDeck);
}
currentPlayer.AttackOtherPlayers(gameState, attackAction);
}
示例9: DoSpecializedAction
public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState)
{
currentPlayer.RequestPlayerTrashCardFromHandOrDiscard(gameState,
CanTrashCard,
isOptional: true);
currentPlayer.RequestPlayerGainCardFromSupply(gameState,
acceptableCard => acceptableCard.CurrentCoinCost(currentPlayer) <= 3 && acceptableCard.potionCost == 0,
"Gain a card costing up to 3");
}
示例10: DoSpecializedTrash
public override void DoSpecializedTrash(PlayerState currentPlayer, GameState gameState)
{
currentPlayer.RequestPlayerGainCardFromSupply(gameState,
card => card.CurrentCoinCost(currentPlayer) < this.CurrentCoinCost(currentPlayer) &&
card.potionCost == 0,
"Must gain a card cheaper than this");
}
示例11: DoSpecializedAction
public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState)
{
bool someOtherPlayerRevealedProvince = false;
bool didRevealProvince = currentPlayer.RequestPlayerRevealCardFromHand(card => card == Cards.Province, gameState) != null;
foreach (PlayerState player in gameState.players.OtherPlayers)
{
someOtherPlayerRevealedProvince |= player.RequestPlayerRevealCardFromHand(card => card == Cards.Province, gameState) != null;
player.MoveAllRevealedCardsToHand();
}
if (didRevealProvince)
{
currentPlayer.RequestPlayerGainCardFromSupply(gameState,
card => card == Cards.Duchy || card.IsType(Cards.Prize),
"Must gain a duchy or a prize",
isOptional: false,
defaultLocation: DeckPlacement.TopOfDeck);
}
if (!someOtherPlayerRevealedProvince)
{
currentPlayer.DrawOneCardIntoHand(gameState);
currentPlayer.AddCoins(1);
}
}
示例12: DoSpecializedAction
public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState)
{
// TODO: trashing potion card is included in total cost
// throw NotImplemented()
Card[] trashedCards = currentPlayer.RequestPlayerTrashCardsFromHand(gameState, currentPlayer.Hand.Count, isOptional: true);
int totalCost = trashedCards.Select(card => card.CurrentCoinCost(currentPlayer)).Sum();
currentPlayer.RequestPlayerGainCardFromSupply(
gameState,
card => card.CurrentCoinCost(currentPlayer) == totalCost,
"Must gain a card costing exactly equal to the total cost of the trashed cards>",
isOptional: false);
}
示例13: DoSpecializedAction
public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState)
{
Card trashedCard = currentPlayer.RequestPlayerTrashCardFromHand(gameState, card => true, false);
int trashedCardCost = trashedCard.CurrentCoinCost(currentPlayer);
CardPredicate validCard = card => (card.CurrentCoinCost(currentPlayer) == (trashedCardCost - 1)
^ card.CurrentCoinCost(currentPlayer) == (trashedCardCost + 1)) && card.potionCost == trashedCard.potionCost;
Card gainedCard = currentPlayer.RequestPlayerGainCardFromSupply(gameState, validCard, "Must gain a card costing one less or one more than the trashed card.", isOptional: false, defaultLocation: DeckPlacement.TopOfDeck);
if (gainedCard != null)
{
validCard = card => card.CurrentCoinCost(currentPlayer) == 2 * trashedCardCost - gainedCard.CurrentCoinCost(currentPlayer)
&& card.potionCost == trashedCard.potionCost;
currentPlayer.RequestPlayerGainCardFromSupply(gameState, validCard, "Must gain a card with the right cost.", isOptional: false, defaultLocation: DeckPlacement.TopOfDeck);
}
}
示例14: OverpayOnPurchase
public override void OverpayOnPurchase(PlayerState currentPlayer, GameState gameState, int overpayAmount)
{
// todo: over pay by potion
// throw new NotImplementedException()
for (int i = 0; i < 2; ++i)
{
currentPlayer.RequestPlayerGainCardFromSupply(
gameState,
acceptableCard => acceptableCard.isAction && acceptableCard.CurrentCoinCost(currentPlayer) == overpayAmount,
"Must gain 2 action cards costing the amount overpaid");
}
}
示例15: DoSpecializedAction
public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState)
{
CollectionCards trashedCards = currentPlayer.RequestPlayerTrashCardsFromHand(gameState, currentPlayer.Hand.Count, isOptional: true);
int totalCoinCost = trashedCards.Select(card => card.CurrentCoinCost(currentPlayer)).Sum();
int totalPotionCost = trashedCards.Select(card => card.potionCost).Sum();
currentPlayer.RequestPlayerGainCardFromSupply(
gameState,
card => card.CurrentCoinCost(currentPlayer) == totalCoinCost && card.potionCost == totalPotionCost,
"Must gain a card costing exactly equal to the total cost of the trashed cards>",
isOptional: false);
}