public override void Resolve(TurnContext context, ICard source) { var player = context.ActivePlayer; var log = context.Game.Log; if (player.Hand.OfType<IActionCard>().Any()) { var activity = new SelectCardsActivity( log, player, "Select an action to play twice", SelectionSpecifications.SelectExactlyXCards(1), source); activity.Hint = ActivityHint.PlayCards; activity.Specification.CardTypeRestriction = typeof (IActionCard); activity.AfterCardsSelected = cards => { var actionCard = cards.OfType<IActionCard>().Single(); log.LogMessage("{0} selected {1} to be played twice.", player.Name, actionCard.Name); actionCard.MoveTo(context.ActivePlayer.PlayArea); context.AddEffect(source, new PlayCardEffect(actionCard)); context.AddEffect(source, new PlayCardEffect(actionCard)); }; _activities.Add(activity); } }
public void Play(TurnContext context) { context.DrawCards(1); context.RemainingActions += 1; context.AddEffect(this, new UpgradeEffect()); }
private IActivity CreateChooseActionActivity(TurnContext context, RevealZone revealZone, ICard source) { var selectTreasure = new SelectFromRevealedCardsActivity(context.Game.Log, context.ActivePlayer, revealZone, "Select the action to play first.", SelectionSpecifications.SelectExactlyXCards(1), source); selectTreasure.AfterCardsSelected = cards => { var first = cards.OfType<IActionCard>().Single(); var second = revealZone.OfType<IActionCard>().Single(c => c != first); // Reverse order because we're on a stack. context.AddEffect(source, new PlayCardEffect(second)); context.AddEffect(source, new PlayCardEffect(first)); }; return selectTreasure; }
public override void BeginResolve(TurnContext context) { if(_hasHadReactionStep) { base.BeginResolve(context); } else { _hasHadReactionStep = true; if (context.Opponents.Any(o => o.Hand.OfType<IReactionCard>().Any())) context.AddEffect(Source, new ReactionEffect(this)); else base.BeginResolve(context); } }
public override void BeginResolve(TurnContext context) { if (_hasHadReactionStep) { base.BeginResolve(context); } else { _hasHadReactionStep = true; if (context.Opponents.Any(o => o.Hand.OfType <IReactionCard>().Any())) { context.AddEffect(Source, new ReactionEffect(this)); } else { base.BeginResolve(context); } } }
public void Play(TurnContext context) { context.AddEffect(new WorkshopEffect()); }
public void Play(TurnContext context) { context.AddEffect(this, new KingsCourtEffect()); }
public void Play(TurnContext context) { context.AddEffect(this, new ChapelEffect()); }
public void Play(TurnContext context) { context.DrawCards(3); context.AddEffect(this, new RabbleAttack()); }
public void Play(TurnContext context) { context.ActivePlayer.DrawCards(2); context.AddEffect(this, new GhostShipAttack()); }
public void React(AttackEffect attackEffect, Player player, TurnContext currentTurn) { currentTurn.AddEffect(this, new SecretChamberReactionEffect(player)); currentTurn.Game.Log.LogMessage("{0} revealed a Secret Chamber.", player); }
public void Play(TurnContext context) { context.DrawCards(2); context.AddEffect(this, new WitchAttack()); }
public void Play(TurnContext context) { context.AvailableSpend += 2; context.AddEffect(new ChancellorEffect()); }
public void Play(TurnContext context) { context.RemainingActions += 1; context.AddEffect(this, new CellarEffect()); }
public void Play(TurnContext context) { context.AddEffect(this, new MoneylenderEffect()); }
public void Play(TurnContext context) { context.RemainingActions += 1; context.AddEffect(this, new ApprenticeEffect()); }
public void Play(TurnContext context) { context.Trash(context.ActivePlayer, this); context.AddEffect(this, new FeastEffect()); }
public void Play(TurnContext context) { context.AddEffect(this, new ThiefAttack()); }
public void Play(TurnContext context) { context.AvailableSpend += 2; context.AddEffect(this, new MilitiaAttack()); }
public void Play(TurnContext context) { context.RemainingActions += 1; context.AddEffect(new ChapelEffect()); }
public void Play(TurnContext context) { context.DrawCards(1); context.RemainingActions += 2; context.AddEffect(this, new MiningVillageEffect(this)); }
public void Play(TurnContext context) { context.AvailableSpend += 2; context.AddEffect(new MountebankAttack()); }
public void Play(TurnContext context) { context.DrawCards(1); context.RemainingActions += 1; context.AddEffect(new FamiliarAttack()); }
public void Play(TurnContext context) { context.AddEffect(this, new SecretChamberActionEffect()); }
public void Play(TurnContext context) { var effect = new EnvoyEffect(); context.AddEffect(this, effect); }
public void Play(TurnContext context) { context.AddEffect(this, new ThroneRoomEffect()); }
public void Play(TurnContext context) { context.Buys += 1; context.AddEffect(this, new SalvagerEffect()); }
public void Play(TurnContext context) { context.AddEffect(this, new NoblesEffect()); }
public void Play(TurnContext context) { context.AddEffect(this, new BaronEffect()); context.Buys += 1; }
public void Play(TurnContext context) { context.RemainingActions += 1; context.AddEffect(this, new MinionAttackEffect()); }
public void Play(TurnContext context) { context.AddEffect(new MineEffect()); }