当前位置: 首页>>代码示例>>C#>>正文


C# Player.ReceiveBenefit方法代码示例

本文整理汇总了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);
		}
开发者ID:micahpaul,项目名称:dominion_net_multi,代码行数:8,代码来源:Prosperity.cs

示例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);
		}
开发者ID:micahpaul,项目名称:dominion_net_multi,代码行数:21,代码来源:Intrigue.cs

示例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) });
		}
开发者ID:micahpaul,项目名称:dominion_net_multi,代码行数:9,代码来源:Guilds.cs

示例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 });
			}
		}
开发者ID:micahpaul,项目名称:dominion_net_multi,代码行数:16,代码来源:Alchemy.cs

示例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 });
		}
开发者ID:micahpaul,项目名称:dominion_net_multi,代码行数:10,代码来源:Base.cs

示例6: player_PlusCard

		internal void player_PlusCard(Player player, ref TrashEventArgs e)
		{
			player.ReceiveBenefit(this, new CardBenefit() { Cards = 3 });

			e.HandledBy.Add(this);
		}
开发者ID:micahpaul,项目名称:dominion_net_multi,代码行数:6,代码来源:DarkAges.cs

示例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) });

		}
开发者ID:micahpaul,项目名称:dominion_net_multi,代码行数:18,代码来源:DarkAges.cs

示例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);
		}
开发者ID:micahpaul,项目名称:dominion_net_multi,代码行数:12,代码来源:Cornucopia.cs

示例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);
		}
开发者ID:micahpaul,项目名称:dominion_net_multi,代码行数:11,代码来源:Hinterlands.cs

示例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));
		}
开发者ID:micahpaul,项目名称:dominion_net_multi,代码行数:7,代码来源:Cornucopia.cs


注:本文中的DominionBase.Players.Player.ReceiveBenefit方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。