Пример #1
0
		public override void Play(Player player)
		{
			base.Play(player);
			player.AddToken(new CoinToken());
			player.AddToken(new CoinToken());

			Choice choiceTrash = new Choice("You may choose a card to trash", this, player.Hand, player, false, 0, 1);
			ChoiceResult resultTrash = player.MakeChoice(choiceTrash);

			if (resultTrash.Cards.Count > 0)
			{
				player.Trash(player.RetrieveCardsFrom(DeckLocation.Hand, resultTrash.Cards));

				List<String> options = new List<string>();
				for (int i = 0; i <= player.TokenPiles[TypeClass.CoinToken].Count; i++)
					options.Add(i.ToString());
				Choice choiceOverpay = new Choice("You may pay any number of Coin tokens", this, new CardCollection() { this }, options, player);
				ChoiceResult resultOverpay = player.MakeChoice(choiceOverpay);

				int overpayAmount = int.Parse(resultOverpay.Options[0]);
				player._Game.SendMessage(player, this, overpayAmount);
				player.RemoveTokens(TypeClass.CoinToken, overpayAmount);

				Cost trashedCardCost = player._Game.ComputeCost(resultTrash.Cards[0]);
				SupplyCollection gainableSupplies = player._Game.Table.Supplies.FindAll(supply => supply.CanGain() && supply.CurrentCost <= (trashedCardCost + new Coin(overpayAmount)));
				Choice choice = new Choice("Gain a card", this, gainableSupplies, player, false);
				ChoiceResult result = player.MakeChoice(choice);
				if (result.Supply != null)
					player.Gain(result.Supply);
			}
		}