本文整理汇总了C#中Dominion.Card.CardToMimick方法的典型用法代码示例。如果您正苦于以下问题:C# Card.CardToMimick方法的具体用法?C# Card.CardToMimick怎么用?C# Card.CardToMimick使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dominion.Card
的用法示例。
在下文中一共展示了Card.CardToMimick方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DoPlayAction
internal void DoPlayAction(Card currentCard, GameState gameState, int countTimes = 1)
{
if (!currentCard.isAction)
{
throw new Exception("Can't play a card that isn't a action");
}
this.cardsBeingPlayed.AddCardToTop(currentCard);
Card cardToPlayAs = currentCard.CardToMimick(this, gameState);
gameState.cardContextStack.PushCardContext(this, cardToPlayAs, CardContextReason.CardBeingPlayed);
if (cardToPlayAs != null)
{
for (int i = 0; i < countTimes; ++i)
{
this.gameLog.PlayedCard(this, currentCard);
this.gameLog.PushScope();
this.AddActions(cardToPlayAs.plusAction);
this.AddBuys(cardToPlayAs.plusBuy);
this.AddCoins(cardToPlayAs.plusCoin);
this.AddVictoryTokens(cardToPlayAs.plusVictoryToken);
this.DrawAdditionalCardsIntoHand(cardToPlayAs.plusCard, gameState);
if (cardToPlayAs.isAttack && cardToPlayAs.isAttackBeforeAction)
{
AttackOtherPlayers(gameState, cardToPlayAs.DoSpecializedAttack);
}
cardToPlayAs.DoSpecializedAction(gameState.players.CurrentPlayer, gameState);
if (cardToPlayAs.isAttack && !cardToPlayAs.attackDependsOnPlayerChoice && !cardToPlayAs.isAttackBeforeAction)
{
AttackOtherPlayers(gameState, cardToPlayAs.DoSpecializedAttack);
}
if (this.ownsCardWithSpecializedActionToCardWhileInPlay)
{
foreach(var cardInPlay in this.cardsInPlay)
{
if (cardInPlay.HasSpecializedActionToCardWhileInPlay)
{
gameState.cardContextStack.PushCardContext(this, cardInPlay, CardContextReason.CardReacting);
cardInPlay.DoSpecializedActionToCardWhileInPlay(this, gameState, cardToPlayAs);
gameState.cardContextStack.Pop();
}
}
}
this.gameLog.PopScope();
}
}
gameState.cardContextStack.Pop();
CardHasBeenPlayed(cardToPlayAs, countTimes);
}