Beispiel #1
0
		internal void ReceiveBenefit(Token sourceOfBenefit, CardBenefit benefit)
		{
			if (benefit.Any && BenefitReceiving != null)
			{
				BenefitReceivingEventArgs brea = new BenefitReceivingEventArgs(this, benefit);
				BenefitReceiving(sourceOfBenefit, brea);
			}

			if (benefit.Cards > 0)
				this.Draw(benefit.Cards, DeckLocation.Hand);

			this.Actions += benefit.Actions;
			this.Buys += benefit.Buys;
			this.Currency += benefit.Currency;
			for (int count = 0; count < benefit.VictoryPoints; count++)
				this.TokenPiles.Add(new Cards.Prosperity.VictoryToken(), this);
		}
Beispiel #2
0
		internal void ReceiveBenefit(Card sourceOfBenefit, CardBenefit benefit, Boolean isInternal)
		{
			if (benefit.Any && BenefitReceiving != null && 
				((sourceOfBenefit.Category & Category.Action) == Category.Action ||
				((sourceOfBenefit.Category & Category.Treasure) == Category.Treasure && !isInternal)))
			{
				BenefitReceivingEventArgs brea = new BenefitReceivingEventArgs(this, benefit);
				BenefitReceiving(sourceOfBenefit, brea);
			}

			if (benefit.Cards > 0)
				this.Draw(benefit.Cards, DeckLocation.Hand);

			this.Actions += benefit.Actions;
			this.Buys += benefit.Buys;
			this.Currency += benefit.Currency;
			for (int count = 0; count < benefit.VictoryPoints; count++)
				this.TokenPiles.Add(new Cards.Prosperity.VictoryToken(), this);

			if (benefit.Cards < 0)
			{
				Choice choice = new Choice(String.Format("Discard {0}.", Utilities.StringUtility.Plural("card", -benefit.Cards)), sourceOfBenefit, this.Hand, this, false, -benefit.Cards, -benefit.Cards);
				ChoiceResult result = this.MakeChoice(choice);
				this.Discard(DeckLocation.Hand, result.Cards);
			}
		}