本文整理汇总了C#中Dominion.Rules.TurnContext.DiscardCards方法的典型用法代码示例。如果您正苦于以下问题:C# TurnContext.DiscardCards方法的具体用法?C# TurnContext.DiscardCards怎么用?C# TurnContext.DiscardCards使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dominion.Rules.TurnContext
的用法示例。
在下文中一共展示了TurnContext.DiscardCards方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Attack
public override void Attack(Player victim, TurnContext context, ICard source)
{
if (victim.Hand.CardCount > 4)
{
context.DiscardCards(victim, victim.Hand);
victim.DrawCards(4);
}
}
示例2: Play
public void Play(TurnContext context)
{
if(context.ActivePlayer.Hand.CardCount > 0)
{
context.DiscardCards(context.ActivePlayer, context.ActivePlayer.Hand);
context.AddLongLivedEffect(new TacticianEffect(this));
}
else
{
context.Game.Log.LogMessage("{0} did not have any cards to discard to the Tactician.", context.ActivePlayer.Name);
}
}
示例3: Resolve
public override void Resolve(TurnContext context, ICard source)
{
if(context.ActivePlayer.Hand.CardCount < 4)
{
context.DiscardCards(context.ActivePlayer, context.ActivePlayer.Hand);
}
else
{
var discardActivity = Activities.DiscardCards(context, context.ActivePlayer, 3, source);
_activities.Add(discardActivity);
}
}
示例4: Resolve
public override void Resolve(TurnContext context, ICard source)
{
Action discardAction = () =>
{
context.DiscardCards(context.ActivePlayer, context.ActivePlayer.Hand);
context.DrawCards(4);
DistributeAttacks(context, source);
};
Action moneyAction = () => context.AvailableSpend += 2;
var activity = Activities.ChooseYesOrNo(context.Game.Log, context.ActivePlayer, "Discard your hand?",
source, discardAction, moneyAction);
_activities.Add(activity);
}
示例5: Resolve
public override void Resolve(TurnContext context, ICard source)
{
var activity = new SelectCardsActivity(
context,
"Select any number of cards to discard, you will draw 1 new card for each discard",
SelectionSpecifications.SelectUpToXCards(context.ActivePlayer.Hand.CardCount), source);
activity.AfterCardsSelected = cards =>
{
context.DiscardCards(activity.Player, cards);
context.DrawCards(cards.Count());
};
_activities.Add(activity);
}
示例6: Resolve
public override void Resolve(TurnContext context)
{
var activity = new SelectCardsActivity(
context,
"Select any number of cards to discard, you will gain $1 per card",
SelectionSpecifications.SelectUpToXCards(context.ActivePlayer.Hand.CardCount));
activity.AfterCardsSelected = cards =>
{
context.DiscardCards(activity.Player, cards);
context.AvailableSpend += cards.Count();
};
_activities.Add(activity);
}
示例7: Attack
public override void Attack(Player victim, TurnContext context, ICard source)
{
Action discardCards;
if (victim.Hand.CardCount > 2)
discardCards = () => _activities.Add(Activities.DiscardCards(context, victim, 2, source));
else if(victim.Hand.CardCount > 0)
discardCards = () => context.DiscardCards(victim, victim.Hand);
else
discardCards = () => context.Game.Log.LogMessage("{0} had no cards to discard.", victim.Name);
Action gainCurse = () => new GainUtility(context, victim).Gain<Curse>(victim.Hand);
var decideActivity = Activities.ChooseYesOrNo(context.Game.Log, victim, "Discard two cards to Torturer?",
source, discardCards, gainCurse);
_activities.Add(decideActivity);
}