public void Handle(IGameMessage @event, IReactionScope scope) { if (@event is AttackCardPlayed) { @event.ActionScope.Publish(new CanRevealCardEvent(this, scope)); } }
public void Resolve(IReactionScope scope) { bool validCardFound; bool hasReshuffled = false; Card card; CardSet revealedCards = new CardSet(); do { card = scope.RevealCardFromDeck(); validCardFound = card != null && scope.GetPrice(card) >= 3; if (card == null && !hasReshuffled) { scope.ReactingPlayer.ShuffleDiscardPileIntoDeck(scope); hasReshuffled = true; } if (!validCardFound) { revealedCards.Add(card, scope); } } while (!validCardFound && card != null); if (card == null) { return; } scope.PutCardInTrash(card); scope.Publish(new SelectReplacementCardForSaboteur(scope, card)); }
public void Handle(IGameMessage @event, IReactionScope scope) { if (Next != null) { Next.Handle(@event, scope); } }
public void Resolve(IReactionScope scope) { while (scope.ReactingPlayer.Hand.Count() > 3) { scope.ReactingPlayer.Handle(new DiscardReactionCommand(scope, "You must discard down to 3 cards [Militia]."), scope); } }
public DiscardReactionCommand(IReactionScope receiverScope, string description) : base(receiverScope.OriginatingTurnScope) { Description = description; _receiverScope = receiverScope; GetAvailableResponses = () => _receiverScope.ReactingPlayer.Hand.Select(c => new DiscardCardReaction(_receiverScope, c)); }
public void Resolve(IReactionScope scope) { Card curse = null; try { scope.GainCardFromSupply(BasicCards.Curse); } catch (Exception) { } }
public void Resolve(IReactionScope scope) { var revealedTreasures = new CardSet(); 2.Times(() => { var revealedCard = scope.RevealCardFromDeck(); if (revealedCard.IsTreasure && !revealedTreasures.Contains(revealedCard)) { revealedTreasures.Add(revealedCard, scope); } }); if (revealedTreasures.Count() == 1) { scope.Publish(new TrashTreasureCardFromThief(TurnScope, scope, revealedTreasures.Single())); } else if (revealedTreasures.Count() == 2) { TurnScope.Publish(new ChooseTreasureCardToTrashFromThief(TurnScope, scope, revealedTreasures)); } }
public void Handle(IGameMessage @event, IReactionScope scope) { if (@event is DeckDepletedEvent) { Handle(@event as DeckDepletedEvent); return; } if (@event is IAttackEffect) { HandleAttack(@event as IAttackEffect, scope); } Hand.Handle(@event, scope); if (@event.GetAvailableResponses().Count() == 1) { @event.GetDefaultResponse().Execute(); } else { _controller.HandleGameEvent(@event, scope).Execute(); } }
public RevealHandWithNoVictoryCardsForBureaucratGameEventReaction(IReactionScope scope) : base(scope) { }
public RevealVictoryCardForBureaucrat(IReactionScope scope, Card card) : base(scope, card) { }
public SelectVictoryCardToRevealForBureaucrat(IReactionScope scope) : base(scope) { Description = "Select a victory card to reveal [Bureaucrat]"; GetAvailableResponses = GetResponses; }
public void Resolve(IReactionScope scope) { scope.DrawCardsIntoHand(1); }
public void RevealCard(Card card, IReactionScope externalEventScope) { }
public void Handle(IGameMessage @event, IReactionScope scope) { Front.Handle(@event, scope); }
public IEventResponse HandleGameEvent(IGameMessage @event, IReactionScope scope) { return(@event.GetDefaultResponse()); }
public void Resolve(IReactionScope scope) { TurnScope.Publish(new ChooseToDiscardOrReturnTopCardFromSpy(TurnScope, scope)); }
public ChooseTreasureCardToTrashFromThief(IActionScope turnScope, IReactionScope reactionScope, CardSet cards) : base(turnScope) { Description = "Choose a treasure card for " + reactionScope.ReactingPlayer.Name + " to trash [Thief]"; GetAvailableResponses = () => cards.Select(card => new TrashTreasureCardFromThief(turnScope, reactionScope, card)); }
public IEventResponse HandleGameEvent(IGameMessage @event, IReactionScope scope) { throw new NotImplementedException(); }
public void RevealCard(Card card, IReactionScope externalEventScope) { Hand.RevealCard(card, externalEventScope, this); }
private void HandleAttack(IAttackEffect attackEffect, IReactionScope scope) { attackEffect.Resolve(scope); }
public void FilterMessage(IGameMessage message, IReactionScope scope, IHandleExternalEvents next) { Front.Handle(message, scope); }
public void RevealCard(Card card, IReactionScope externalEventScope, Player player) { card.Reveal(externalEventScope, player); }
public IEventResponse HandleGameEvent(IGameMessage @event, IReactionScope scope) { return(_ai.HandleGameEvent(@event, scope)); }
public override void OnRevealed(IReactionScope externalEventScope, Player player) { externalEventScope.RegisterEventFilter(MoatEffect()); }
public void Reveal(IReactionScope externalEventScope, Player player) { externalEventScope.Publish(new PlayerRevealedCardEvent(externalEventScope, this)); OnRevealed(externalEventScope, player); }
public virtual void OnRevealed(IReactionScope externalEventScope, Player player) { }
public void Handle(IGameMessage @event, IReactionScope scope) { this.OfType <IHandleExternalEvents>().ForEach(card => card.Handle(@event, scope)); }
public void Resolve(IReactionScope scope) { scope.Publish(new SelectVictoryCardToRevealForBureaucrat(scope)); }
public void Handle(IGameMessage @event, IReactionScope scope) { }
protected GameEventReaction(IReactionScope scope) : base(scope) { ReactionScope = scope; }