public override void Attack(Player victim, TurnContext context, ICard source) { if (victim.Hand.CardCount > 4) { context.DiscardCards(victim, victim.Hand); victim.DrawCards(4); } }
public static ISelectCardsActivity DiscardCards(TurnContext context, Player player, int numberToDiscard) { return new SelectCardsActivity( context.Game.Log, player, string.Format("Select {0} card(s) to discard", numberToDiscard), SelectionSpecifications.SelectExactlyXCards(numberToDiscard)) { AfterCardsSelected = cards => context.DiscardCards(player, cards) }; }
public static ISelectCardsActivity DiscardCards(TurnContext context, Player player, int numberToDiscard, ICard source) { return(new SelectCardsActivity( context.Game.Log, player, string.Format("Select {0} card(s) to discard.", numberToDiscard), SelectionSpecifications.SelectExactlyXCards(numberToDiscard), source) { AfterCardsSelected = cards => context.DiscardCards(player, cards), Hint = ActivityHint.DiscardCards }); }
public void Play(TurnContext context) { if (context.ActivePlayer.Hand.CardCount > 0) { context.DiscardCards(context.ActivePlayer, context.ActivePlayer.Hand); context.AddLongLivedEffect(new TacticianEffect(this)); } else { context.Game.Log.LogMessage("{0} did not have any cards to discard to the Tactician.", context.ActivePlayer.Name); } }
public override void Resolve(TurnContext context, ICard source) { if (context.ActivePlayer.Hand.CardCount < 4) { context.DiscardCards(context.ActivePlayer, context.ActivePlayer.Hand); } else { var discardActivity = Activities.DiscardCards(context, context.ActivePlayer, 3, source); _activities.Add(discardActivity); } }
public override void Resolve(TurnContext context, ICard source) { var activity = new SelectCardsActivity( context, "Select any number of cards to discard, you will gain $1 per card", SelectionSpecifications.SelectUpToXCards(context.ActivePlayer.Hand.CardCount), source); activity.AfterCardsSelected = cards => { context.DiscardCards(activity.Player, cards); context.AvailableSpend += cards.Count(); }; _activities.Add(activity); }
public static IActivity DiscardCardsToDrawCards(TurnContext context, ICard source) { var activity = new SelectCardsActivity( context, "Select any number of cards to discard, you will draw 1 new card for each discard.", SelectionSpecifications.SelectUpToXCards(context.ActivePlayer.Hand.CardCount), source); activity.AfterCardsSelected = cards => { context.DiscardCards(activity.Player, cards); context.DrawCards(cards.Count()); }; return(activity); }
public override void Resolve(TurnContext context, ICard source) { Action discardAction = () => { context.DiscardCards(context.ActivePlayer, context.ActivePlayer.Hand); context.DrawCards(4); DistributeAttacks(context, source); }; Action moneyAction = () => context.AvailableSpend += 2; var activity = Activities.ChooseYesOrNo(context.Game.Log, context.ActivePlayer, "Discard your hand?", source, discardAction, moneyAction); _activities.Add(activity); }
public override void Attack(Player victim, TurnContext context, ICard source) { Action discardCards; if (victim.Hand.CardCount > 2) { discardCards = () => _activities.Add(Activities.DiscardCards(context, victim, 2, source)); } else if (victim.Hand.CardCount > 0) { discardCards = () => context.DiscardCards(victim, victim.Hand); } else { discardCards = () => context.Game.Log.LogMessage("{0} had no cards to discard.", victim.Name); } Action gainCurse = () => new GainUtility(context, victim).Gain <Curse>(victim.Hand); var decideActivity = Activities.ChooseYesOrNo(context.Game.Log, victim, "Discard two cards to Torturer?", source, discardCards, gainCurse); _activities.Add(decideActivity); }
public static IActivity DiscardCardsToDrawCards(TurnContext context, ICard source) { var activity = new SelectCardsActivity( context, "Select any number of cards to discard, you will draw 1 new card for each discard.", SelectionSpecifications.SelectUpToXCards(context.ActivePlayer.Hand.CardCount), source); activity.AfterCardsSelected = cards => { context.DiscardCards(activity.Player, cards); context.DrawCards(cards.Count()); }; return activity; }