本文整理汇总了C#中DominionBase.Players.Player.ReceiveBenefit方法的典型用法代码示例。如果您正苦于以下问题:C# Player.ReceiveBenefit方法的具体用法?C# Player.ReceiveBenefit怎么用?C# Player.ReceiveBenefit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DominionBase.Players.Player
的用法示例。
在下文中一共展示了Player.ReceiveBenefit方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Play
public override void Play(Player player)
{
base.Play(player);
CardBenefit benefit = new CardBenefit();
benefit.Currency += new Coin(player.InPlay[Category.Treasure].Count);
player.ReceiveBenefit(this, benefit);
}
示例2: Play
public override void Play(Player player)
{
base.Play(player);
if (player.Hand[Cards.Universal.TypeClass.Estate].Count > 0)
{
Choice choice = Choice.CreateYesNoChoice("You may discard an Estate card for +<coin>4</coin>. Do you want to discard?", this, player);
ChoiceResult result = player.MakeChoice(choice);
if (result.Options.Contains("Yes"))
{
player.Discard(DeckLocation.Hand, Cards.Universal.TypeClass.Estate, 1);
CardBenefit benefit = new CardBenefit();
benefit.Currency.Coin += 4;
player.ReceiveBenefit(this, benefit);
return;
}
}
player.Gain(player._Game.Table.Estate);
}
示例3: Play
/// <summary>
/// Used internally by the base Card class -- Don't use this.
/// </summary>
internal override void Play(Player player, int count)
{
if (count <= 0)
throw new ArgumentOutOfRangeException("'count' must be positive!");
player.ReceiveBenefit(this, new CardBenefit() { Currency = new Currency(count) });
}
示例4: Play
public override void Play(Player player)
{
base.Play(player);
Choice choice = new Choice("Choose a card to trash", this, player.Hand, player, false, 1, 1);
ChoiceResult result = player.MakeChoice(choice);
if (result.Cards.Count > 0)
{
player.Trash(player.RetrieveCardFrom(DeckLocation.Hand, result.Cards[0]));
Cost cardCost = player._Game.ComputeCost(result.Cards[0]);
int toDraw = cardCost.Coin.Value;
if (cardCost.Potion.Value > 0)
toDraw += 2;
player.ReceiveBenefit(this, new CardBenefit() { Cards = toDraw });
}
}
示例5: Play
public override void Play(Player player)
{
base.Play(player);
Choice choiceDiscard = new Choice("Choose cards to discard", this, player.Hand, player, false, 0, player.Hand.Count);
ChoiceResult resultDiscard = player.MakeChoice(choiceDiscard);
player.Discard(DeckLocation.Hand, resultDiscard.Cards);
player.ReceiveBenefit(this, new CardBenefit() { Cards = resultDiscard.Cards.Count });
}
示例6: player_PlusCard
internal void player_PlusCard(Player player, ref TrashEventArgs e)
{
player.ReceiveBenefit(this, new CardBenefit() { Cards = 3 });
e.HandledBy.Add(this);
}
示例7: Play
public override void Play(Player player)
{
base.Play(player);
Choice choiceDiscardTheFirst = new Choice("Discard any number of cards. +1 Card per card discarded", this, player.Hand, player, false, 0, player.Hand.Count);
ChoiceResult resultDiscardTheFirst = player.MakeChoice(choiceDiscardTheFirst);
player.Discard(DeckLocation.Hand, resultDiscardTheFirst.Cards);
player.ReceiveBenefit(this, new CardBenefit() { Cards = resultDiscardTheFirst.Cards.Count });
Choice choiceDiscardTheSecond = new Choice("Discard any number of cards. +<coin>1</coin> per card discarded.", this, player.Hand, player, false, 0, player.Hand.Count);
ChoiceResult resultDiscardTheSecond = player.MakeChoice(choiceDiscardTheSecond);
player.Discard(DeckLocation.Hand, resultDiscardTheSecond.Cards);
player.ReceiveBenefit(this, new CardBenefit() { Currency = new Currency(resultDiscardTheSecond.Cards.Count) });
}
示例8: Play
public override void Play(Player player)
{
base.Play(player);
CardCollection newCards = player.Draw(4, DeckLocation.Revealed);
player.DiscardRevealed();
CardBenefit benefit = new CardBenefit();
benefit.Currency += new Coin(newCards.GroupBy(card => card.CardType).Count());
player.ReceiveBenefit(this, benefit);
}
示例9: Play
public override void Play(Player player)
{
base.Play(player);
CardBenefit benefit = new CardBenefit();
benefit.Currency += new Coin(1);
if (player.CurrentTurn.CardsResolved.Count(c => c.CardType == TypeClass.FoolsGold) > 1)
benefit.Currency += new Coin(3);
player.ReceiveBenefit(this, benefit);
}
示例10: PlayDuration
public override void PlayDuration(Player player)
{
base.PlayDuration(player);
player.ReceiveBenefit(this, new CardBenefit() { Cards = 1 });
player.AddCardToHand(player.RetrieveCardFrom(DeckLocation.SetAside, this));
}