public override void Play(Player player) { base.Play(player); player.AddToken(new CoinToken()); }
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); } }
public override void Play(Player player) { base.Play(player); Choice choice = new Choice("You may choose a Treasure card to discard", this, player.Hand[Cards.Category.Treasure], player, false, 0, 1); ChoiceResult result = player.MakeChoice(choice); if (result.Cards.Count > 0) { player.Discard(DeckLocation.Hand, result.Cards[0]); player.AddToken(new CoinToken()); } }
public override void Play(Player player) { base.Play(player); Choice choice = new Choice("Choose 1:", this, new CardCollection() { this }, new List<string>() { "Perform attack", String.Format("+<coin>{0}</coin> (from Pirate Ship tokens)", player.TokenPiles[TypeClass.PirateShipToken].Count) }, player); ChoiceResult result = player.MakeChoice(choice); if (result.Options.Contains("Perform attack")) { // Perform attack on every player (including you) IEnumerator<Player> enumerator = player._Game.GetPlayersStartingWithEnumerator(player); enumerator.MoveNext(); Boolean anyTrashed = false; while (enumerator.MoveNext()) { Player attackee = enumerator.Current; if (this.IsAttackBlocked[attackee]) continue; attackee.Draw(2, DeckLocation.Revealed); CardCollection treasures = attackee.Revealed[Category.Treasure]; Choice choiceTrash = new Choice(String.Format("Choose a Treasure card of {0} to trash", attackee), this, treasures, attackee); ChoiceResult resultTrash = player.MakeChoice(choiceTrash); if (resultTrash.Cards.Count > 0) { attackee.Trash(attackee.RetrieveCardFrom(DeckLocation.Revealed, resultTrash.Cards[0])); anyTrashed = true; } attackee.DiscardRevealed(); } if (anyTrashed) player.AddToken(new PirateShipToken()); } else { CardBenefit benefit = new CardBenefit(); benefit.Currency += new Coin(player.TokenPiles[TypeClass.PirateShipToken].Count); player.ReceiveBenefit(this, benefit); } }