Exemplo n.º 1
0
        public override void Trigger(IGame game, IEffectHandle handle)
        {
            var defeatedEnemies = new List <IEnemyInPlay>();

            foreach (var enemy in game.StagingArea.CardsInStagingArea.OfType <IEnemyInPlay>())
            {
                if (enemy.Damage >= enemy.Card.PrintedHitPoints)
                {
                    defeatedEnemies.Add(enemy);
                }
            }

            foreach (var player in game.Players)
            {
                foreach (var enemy in player.EngagedEnemies)
                {
                    if (enemy.Damage >= enemy.Card.PrintedHitPoints)
                    {
                        defeatedEnemies.Add(enemy);
                    }
                }
            }

            foreach (var enemy in defeatedEnemies)
            {
                var defeatedEffect = new EnemyDefeatedEffect(game, enemy, attackers);
                var defeatedHandle = defeatedEffect.GetHandle(game);
                game.AddEffect(defeatedEffect);
                game.TriggerEffect(defeatedHandle);
            }

            handle.Resolve(GetCompletedStatus());
        }
Exemplo n.º 2
0
            public void DuringEncounterCardRevealed(IGame game)
            {
                var questPhase = game.CurrentPhase as IQuestPhase;

                if (questPhase == null)
                {
                    return;
                }

                var revealed = game.StagingArea.RevealedEncounterCard;

                if (revealed == null)
                {
                    return;
                }

                if (!(revealed is IEnemyInPlay))
                {
                    return;
                }

                if (!questPhase.IsCommittedToQuest(source.Id))
                {
                    return;
                }

                game.AddEffect(this);
            }
Exemplo n.º 3
0
            private void PlayerDiscardsOneCard(IGame game, IEffectHandle handle, IPlayer player, IPlayerCard card)
            {
                if (player.Hand.Cards.Count() == 0)
                {
                    handle.Cancel(string.Format("{0} does not have any cards in their hand to discard", player.Name));
                    return;
                }

                player.DiscardFromHand(new List <IPlayerCard> {
                    card
                });

                var controller = game.GetController(CardSource.Id);

                if (controller == null)
                {
                    handle.Cancel(string.Format("Could not determine the controller of {0}", CardSource.Title));
                    return;
                }

                var willpowerful = controller.CardsInPlay.OfType <IWillpowerfulInPlay>().Where(x => x.Card.Id == source.Id).FirstOrDefault();

                if (willpowerful == null)
                {
                    handle.Cancel(string.Format("'{0}' is no longer in play", CardSource.Title));
                    return;
                }

                game.AddEffect(new WillpowerModifier(game.CurrentPhase.Code, source, willpowerful, TimeScope.Phase, 1));

                handle.Resolve(string.Format("{0} discarded a card to give '{0}' +1 Willpower until the end of the phase", player.Name, CardSource.Title));
            }
Exemplo n.º 4
0
        public virtual void Travel(IGame game)
        {
            if (game.QuestArea.ActiveLocation != null)
                return;

            game.AddEffect(this);
        }
Exemplo n.º 5
0
            //public override void Validate(IGame game, IEffectHandle handle)
            //{
            //    var resourcePayment = handle.Payment as IResourcePayment;
            //    if (resourcePayment == null)
            //    {
            //        handle.Reject();
            //        return;
            //    }

            //    if (resourcePayment.Characters.Count() != 1)
            //    {
            //        handle.Reject();
            //        return;
            //    }

            //    var hero = resourcePayment.Characters.First() as IHeroInPlay;
            //    if (hero == null || !hero.HasResourceIcon(Sphere.Spirit))
            //    {
            //        handle.Reject();
            //        return;
            //    }

            //    if (resourcePayment.GetPaymentBy(hero.Card.Id) != 1)
            //    {
            //        handle.Reject();
            //        return;
            //    }

            //    hero.Resources -= 1;

            //    handle.Accept();
            //}

            public override void Trigger(IGame game, IEffectHandle handle)
            {
                var card = CardSource as IPlayerCard;

                if (card == null || card.Owner == null)
                {
                    handle.Cancel(GetCancelledString());
                    return;
                }

                var ally = card.Owner.Hand.Cards.Where(x => x.Id == source.Id).FirstOrDefault() as IAllyCard;

                if (ally == null)
                {
                    handle.Cancel(GetCancelledString());
                    return;
                }

                card.Owner.Hand.RemoveCards(new List <IPlayerCard> {
                    ally
                });
                card.Owner.AddCardInPlay(new AllyInPlay(game, ally));

                game.AddEffect(new ReturnToHandAfterSuccessfulQuest(CardSource));

                handle.Resolve(GetCompletedStatus());
            }
        public override void Trigger(IGame game, IEffectHandle handle)
        {
            var defeatedEnemies = new List<IEnemyInPlay>();

            foreach (var enemy in game.StagingArea.CardsInStagingArea.OfType<IEnemyInPlay>())
            {
                if (enemy.Damage >= enemy.Card.PrintedHitPoints)
                {
                    defeatedEnemies.Add(enemy);
                }
            }

            foreach (var player in game.Players)
            {
                foreach (var enemy in player.EngagedEnemies)
                {
                    if (enemy.Damage >= enemy.Card.PrintedHitPoints)
                    {
                        defeatedEnemies.Add(enemy);
                    }
                }
            }

            foreach (var enemy in defeatedEnemies)
            {
                var defeatedEffect = new EnemyDefeatedEffect(game, enemy, attackers);
                var defeatedHandle = defeatedEffect.GetHandle(game);
                game.AddEffect(defeatedEffect);
                game.TriggerEffect(defeatedHandle);
            }

            handle.Resolve(GetCompletedStatus());
        }
Exemplo n.º 7
0
            private void PlayerDiscardsOneCard(IGame game, IEffectHandle handle, IPlayer player, IPlayerCard card)
            {
                if (player.Hand.Cards.Count() == 0)
                {
                    handle.Cancel(string.Format("{0} does not have any cards in their hand to discard", player.Name));
                    return;
                }

                player.DiscardFromHand(new List<IPlayerCard> { card });

                var controller = game.GetController(CardSource.Id);
                if (controller == null)
                {
                    handle.Cancel(string.Format("Could not determine the controller of {0}", CardSource.Title));
                    return;
                }

                var willpowerful = controller.CardsInPlay.OfType<IWillpowerfulInPlay>().Where(x => x.Card.Id == source.Id).FirstOrDefault();
                if (willpowerful == null)
                {
                    handle.Cancel(string.Format("'{0}' is no longer in play", CardSource.Title));
                    return;
                }

                game.AddEffect(new WillpowerModifier(game.CurrentPhase.Code, source, willpowerful, TimeScope.Phase, 1));

                handle.Resolve(string.Format("{0} discarded a card to give '{0}' +1 Willpower until the end of the phase", player.Name, CardSource.Title));
            }
Exemplo n.º 8
0
            private void PutAllyIntoPlayFromYourHand(IGame game, IEffectHandle handle, IPlayer player, IAllyCard allyCard)
            {
                player.Hand.RemoveCards(new List<IPlayerCard> { allyCard });
                player.AddCardInPlay(new AllyInPlay(game, allyCard));
                game.AddEffect(new AtEndOfPhaseReturnAllyToYourHand(CardSource, allyCard.Id));

                handle.Resolve(GetCompletedStatus());
            }
        private void TriggerEffect(IGame game, IEffectHandle handle, ICardEffect cardEffect)
        {
            game.AddEffect(cardEffect);
            var playEffectHandle = cardEffect.GetHandle(game);

            game.TriggerEffect(playEffectHandle);
            handle.Resolve(string.Format("{0} triggered {1}", player.Name, cardEffect.ToString()));
        }
Exemplo n.º 10
0
        public virtual void Travel(IGame game)
        {
            if (game.QuestArea.ActiveLocation != null)
            {
                return;
            }

            game.AddEffect(this);
        }
Exemplo n.º 11
0
        public void AddEffect(IEffect effect)
        {
            if (effect == null)
            {
                throw new ArgumentNullException("effect");
            }

            game.AddEffect(effect);
        }
Exemplo n.º 12
0
            protected override void AfterCostPaid(IGame game, IEffectHandle handle, IEnumerable<Tuple<ICharacterInPlay, byte>> charactersAndPayments)
            {
                var allyCard = source as IAllyCard;
                var allyInPlay = new AllyInPlay(game, allyCard);
                player.AddCardInPlay(allyInPlay);
                player.Hand.RemoveCards(new List<IPlayerCard> { allyCard });

                game.AddEffect(new ReturnToHandAfterSuccessfulQuest(cardSource));
            }
Exemplo n.º 13
0
        protected override void AfterCostPaid(IGame game, IEffectHandle handle, IEnumerable<Tuple<ICharacterInPlay, byte>> charactersAndPayments)
        {
            var eventEffect = eventCard.Text.Effects.First();
            var eventHandle = eventEffect.GetHandle(game);

            player.Hand.RemoveCards(new List<IPlayerCard> { eventCard });

            game.AddEffect(eventEffect);
            game.TriggerEffect(eventHandle);
        }
Exemplo n.º 14
0
            private void PutAllyIntoPlayFromYourHand(IGame game, IEffectHandle handle, IPlayer player, IAllyCard allyCard)
            {
                player.Hand.RemoveCards(new List <IPlayerCard> {
                    allyCard
                });
                player.AddCardInPlay(new AllyInPlay(game, allyCard));
                game.AddEffect(new AtEndOfPhaseReturnAllyToYourHand(CardSource, allyCard.Id));

                handle.Resolve(GetCompletedStatus());
            }
Exemplo n.º 15
0
        private void PlayCardFromHand(IGame game, IEffectHandle handle, IPlayableFromHand playableCard)
        {
            var playCardEffect = playableCard.GetPlayFromHandEffect(game, player);

            game.AddEffect(playCardEffect);
            var playCardHandle = playCardEffect.GetHandle(game);

            game.TriggerEffect(playCardHandle);
            handle.Resolve(string.Format("{0} played {1} from their hand", player.Name, playableCard.Title));
        }
Exemplo n.º 16
0
            protected override void AfterCostPaid(IGame game, IEffectHandle handle, IEnumerable <Tuple <ICharacterInPlay, byte> > charactersAndPayments)
            {
                var allyCard   = source as IAllyCard;
                var allyInPlay = new AllyInPlay(game, allyCard);

                player.AddCardInPlay(allyInPlay);
                player.Hand.RemoveCards(new List <IPlayerCard> {
                    allyCard
                });

                game.AddEffect(new ReturnToHandAfterSuccessfulQuest(cardSource));
            }
Exemplo n.º 17
0
            public override void Trigger(IGame game, IEffectHandle handle)
            {
                var enemyAttack = game.CurrentPhase.GetEnemyAttacks().Where(x => x.Enemy.Card.Id == source.Id).FirstOrDefault();
                if (enemyAttack == null)
                    { handle.Cancel(GetCancelledString()); return; }

                var bonus = enemyAttack.IsUndefended ? 3 : 1;

                game.AddEffect(new AttackModifier(game.CurrentPhase.Code, source, enemyAttack.Enemy, TimeScope.None, bonus));

                handle.Resolve(GetCompletedStatus());
            }
Exemplo n.º 18
0
        protected override void AfterCostPaid(IGame game, IEffectHandle handle, IEnumerable <Tuple <ICharacterInPlay, byte> > charactersAndPayments)
        {
            var eventEffect = eventCard.Text.Effects.First();
            var eventHandle = eventEffect.GetHandle(game);

            player.Hand.RemoveCards(new List <IPlayerCard> {
                eventCard
            });

            game.AddEffect(eventEffect);
            game.TriggerEffect(eventHandle);
        }
Exemplo n.º 19
0
            public override void Trigger(IGame game, IEffectHandle handle)
            {
                var enemy = game.GetCardInPlay<IEnemyInPlay>(source.Id);
                if (enemy == null || enemy.Resources == 0)
                    { handle.Cancel(GetCancelledString()); return; }

                var bonus = enemy.Resources * 2;

                game.AddEffect(new AttackModifier(game.CurrentPhase.Code, source, enemy, TimeScope.None, bonus));

                handle.Resolve(GetCompletedStatus());
            }
Exemplo n.º 20
0
            public void AfterCommittingToQuest(IGame game)
            {
                var questPhase = game.CurrentPhase as IQuestPhase;
                if (questPhase == null)
                    return;

                var self = questPhase.GetAllCharactersCommittedToQuest().Where(x => x.Card.Id == source.Id).FirstOrDefault();
                if (self == null)
                    return;

                game.AddEffect(this);
            }
Exemplo n.º 21
0
            public void DuringEncounterCardRevealed(IGame game)
            {
                if (game.StagingArea.RevealedEncounterCard == null)
                {
                    return;
                }

                if ((!(game.StagingArea.RevealedEncounterCard is IRevealableCard)) || (!(game.StagingArea.RevealedEncounterCard is ITreacheryCard)))
                {
                    return;
                }

                game.AddEffect(this);
            }
Exemplo n.º 22
0
            public override void Trigger(IGame game, IEffectHandle handle)
            {
                foreach (var player in game.Players)
                {
                    //TODO: Check for IDuringDrawingCards effects here

                    var drawEffect = new DrawingCardsEffect(game, player, 1);
                    var drawHandle = drawEffect.GetHandle(game);
                    game.AddEffect(drawEffect);
                    game.TriggerEffect(drawHandle);
                }

                handle.Resolve(GetCompletedStatus());
            }
Exemplo n.º 23
0
            public override void Trigger(IGame game, IEffectHandle handle)
            {
                foreach (var player in game.Players)
                {
                    //TODO: Check for IDuringDrawingCards effects here

                    var drawEffect = new DrawingCardsEffect(game, player, 1);
                    var drawHandle = drawEffect.GetHandle(game);
                    game.AddEffect(drawEffect);
                    game.TriggerEffect(drawHandle);
                }

                handle.Resolve(GetCompletedStatus());
            }
Exemplo n.º 24
0
            public override void Trigger(IGame game, IEffectHandle handle)
            {
                var enemyAttack = game.CurrentPhase.GetEnemyAttacks().Where(x => x.Enemy.Card.Id == source.Id).FirstOrDefault();

                if (enemyAttack == null)
                {
                    handle.Cancel(GetCancelledString()); return;
                }

                var bonus = enemyAttack.IsUndefended ? 3 : 1;

                game.AddEffect(new AttackModifier(game.CurrentPhase.Code, source, enemyAttack.Enemy, TimeScope.None, bonus));

                handle.Resolve(GetCompletedStatus());
            }
Exemplo n.º 25
0
            public void BeforeChoosingEnemyToAttack(IGame game)
            {
                var combatPhase = game.CurrentPhase as ICombatPhase;
                if (combatPhase == null)
                    return;

                var chooseEnemy = game.CurrentPhase.GetEnemiesChosenToAttack().Where(x => x.Attackers.Any(y => y.Card.Id == source.Id)).FirstOrDefault();
                if (chooseEnemy == null)
                    return;

                if (chooseEnemy.Attackers.Count() != 1)
                    return;

                game.AddEffect(this);
            }
Exemplo n.º 26
0
            public override void Trigger(IGame game, IEffectHandle handle)
            {
                var enemy = game.GetCardInPlay <IEnemyInPlay>(source.Id);

                if (enemy == null || enemy.Resources == 0)
                {
                    handle.Cancel(GetCancelledString()); return;
                }

                var bonus = enemy.Resources * 2;

                game.AddEffect(new AttackModifier(game.CurrentPhase.Code, source, enemy, TimeScope.None, bonus));

                handle.Resolve(GetCompletedStatus());
            }
Exemplo n.º 27
0
            public override void Trigger(IGame game, IEffectHandle handle)
            {
                var questPhase = game.CurrentPhase as IQuestPhase;

                if (questPhase == null)
                {
                    handle.Cancel(GetCancelledString()); return;
                }

                foreach (var willpowerful in questPhase.GetAllCharactersCommittedToQuest())
                {
                    game.AddEffect(new WillpowerModifier(game.CurrentPhase.Code, source, willpowerful, TimeScope.Phase, -1));
                }

                handle.Resolve(GetCompletedStatus());
            }
Exemplo n.º 28
0
        private void ShufflePlayerDeck(IPlayer player)
        {
            var shuffleEffect = new PlayerShufflesDeck(game, player);
            var shuffleHandle = shuffleEffect.GetHandle(game);

            shuffleEffect.DuringSetup(game);

            //game.Prepare(shuffleHandle);
            game.AddEffect(shuffleEffect);
            game.TriggerEffect(shuffleHandle);
        }
Exemplo n.º 29
0
            public override void Trigger(IGame game, IEffectHandle handle)
            {
                if (game.StagingArea.CardsInStagingArea.Count() == 0)
                {
                    game.StagingArea.RevealEncounterCard();
                    {
                        handle.Cancel(GetCancelledString());
                        return;
                    }
                }

                foreach (var threatening in game.StagingArea.CardsInStagingArea.OfType<IThreateningInPlay>())
                {
                    game.AddEffect(new ThreatModifier(game.CurrentPhase.Code, source, threatening, TimeScope.Phase, 1));
                }

                handle.Resolve(GetCompletedStatus());
            }
Exemplo n.º 30
0
            public override void Trigger(IGame game, IEffectHandle handle)
            {
                IEnemyInPlay enemy = null;

                foreach (var player in game.Players)
                {
                    enemy = player.EngagedEnemies.Where(x => x.Card.Id == source.Id).FirstOrDefault();
                    if (enemy != null)
                        break;
                }

                if (enemy == null)
                    { handle.Cancel(GetCancelledString()); return; }

                game.AddEffect(new AttackModifier(game.CurrentPhase.Code, source, enemy, TimeScope.Round, 1));

                handle.Resolve(GetCompletedStatus());
            }
Exemplo n.º 31
0
            public void DuringEncounterCardRevealed(IGame game)
            {
                var questPhase = game.CurrentPhase as IQuestPhase;
                if (questPhase == null)
                    return;

                var revealed = game.StagingArea.RevealedEncounterCard;
                if (revealed == null)
                    return;

                if (!(revealed is IEnemyInPlay))
                    return;

                if (!questPhase.IsCommittedToQuest(source.Id))
                    return;

                game.AddEffect(this);
            }
Exemplo n.º 32
0
            public override void Trigger(IGame game, IEffectHandle handle)
            {
                if (game.StagingArea.CardsInStagingArea.Count() == 0)
                {
                    game.StagingArea.RevealEncounterCard();
                    {
                        handle.Cancel(GetCancelledString());
                        return;
                    }
                }

                foreach (var threatening in game.StagingArea.CardsInStagingArea.OfType <IThreateningInPlay>())
                {
                    game.AddEffect(new ThreatModifier(game.CurrentPhase.Code, source, threatening, TimeScope.Phase, 1));
                }

                handle.Resolve(GetCompletedStatus());
            }
Exemplo n.º 33
0
            public void AfterCommittingToQuest(IGame game)
            {
                var questPhase = game.CurrentPhase as IQuestPhase;

                if (questPhase == null)
                {
                    return;
                }

                var committed = questPhase.GetAllCharactersCommittedToQuest().Where(x => x.Card.Id == CardSource.Id).FirstOrDefault();

                if (committed == null)
                {
                    return;
                }

                game.AddEffect(this);
            }
        public override void Trigger(IGame game, IEffectHandle handle)
        {
            var defeatedState = new EnemyDefeated(game, enemy, attackers);

            foreach (var card in game.GetCardsInPlayWithEffect <ICardInPlay, IBeforeEnemyDefeated>())
            {
                foreach (var effect in card.BaseCard.Text.Effects.OfType <IBeforeEnemyDefeated>())
                {
                    effect.BeforeEnemyDefeated(defeatedState);
                }
            }

            foreach (var card in game.GetCardsInPlayWithEffect <ICardInPlay, IDuringEnemyDefeated>())
            {
                foreach (var effect in card.BaseCard.Text.Effects.OfType <IDuringEnemyDefeated>())
                {
                    effect.DuringEnemyDefeated(defeatedState);
                }
            }

            if (!defeatedState.IsEnemyDefeated)
            {
                handle.Cancel(GetCancelledString()); return;
            }

            foreach (var card in game.GetCardsInPlayWithEffect <ICardInPlay, IAfterEnemyDefeated>())
            {
                foreach (var effect in card.BaseCard.Text.Effects.OfType <IAfterEnemyDefeated>())
                {
                    effect.AfterEnemyDefeated(defeatedState);
                }
            }

            var leavingPlayEffect = new CardLeavesPlayEffect(game, enemy);

            game.AddEffect(leavingPlayEffect);
            var leavingPlayHandle = leavingPlayEffect.GetHandle(game);

            game.TriggerEffect(leavingPlayHandle);

            handle.Resolve(GetCompletedStatus());
        }
Exemplo n.º 35
0
            public override void Trigger(IGame game, IEffectHandle handle)
            {
                IEnemyInPlay enemy = null;

                foreach (var player in game.Players)
                {
                    enemy = player.EngagedEnemies.Where(x => x.Card.Id == source.Id).FirstOrDefault();
                    if (enemy != null)
                    {
                        break;
                    }
                }

                if (enemy == null)
                {
                    handle.Cancel(GetCancelledString()); return;
                }

                game.AddEffect(new AttackModifier(game.CurrentPhase.Code, source, enemy, TimeScope.Round, 1));

                handle.Resolve(GetCompletedStatus());
            }
        public override void Trigger(IGame game, IEffectHandle handle)
        {
            var defeatedState = new EnemyDefeated(game, enemy, attackers);

            foreach (var card in game.GetCardsInPlayWithEffect<ICardInPlay, IBeforeEnemyDefeated>())
            {
                foreach (var effect in card.BaseCard.Text.Effects.OfType<IBeforeEnemyDefeated>())
                {
                    effect.BeforeEnemyDefeated(defeatedState);
                }
            }

            foreach (var card in game.GetCardsInPlayWithEffect<ICardInPlay, IDuringEnemyDefeated>())
            {
                foreach (var effect in card.BaseCard.Text.Effects.OfType<IDuringEnemyDefeated>())
                {
                    effect.DuringEnemyDefeated(defeatedState);
                }
            }

            if (!defeatedState.IsEnemyDefeated)
                { handle.Cancel(GetCancelledString()); return; }

            foreach (var card in game.GetCardsInPlayWithEffect<ICardInPlay, IAfterEnemyDefeated>())
            {
                foreach (var effect in card.BaseCard.Text.Effects.OfType<IAfterEnemyDefeated>())
                {
                    effect.AfterEnemyDefeated(defeatedState);
                }
            }

            var leavingPlayEffect = new CardLeavesPlayEffect(game, enemy);
            game.AddEffect(leavingPlayEffect);
            var leavingPlayHandle = leavingPlayEffect.GetHandle(game);
            game.TriggerEffect(leavingPlayHandle);

            handle.Resolve(GetCompletedStatus());
        }
Exemplo n.º 37
0
            public void BeforeChoosingEnemyToAttack(IGame game)
            {
                var combatPhase = game.CurrentPhase as ICombatPhase;

                if (combatPhase == null)
                {
                    return;
                }

                var chooseEnemy = game.CurrentPhase.GetEnemiesChosenToAttack().Where(x => x.Attackers.Any(y => y.Card.Id == source.Id)).FirstOrDefault();

                if (chooseEnemy == null)
                {
                    return;
                }

                if (chooseEnemy.Attackers.Count() != 1)
                {
                    return;
                }

                game.AddEffect(this);
            }
Exemplo n.º 38
0
 private void TriggerEffect(IGame game, IEffectHandle handle, ICardEffect cardEffect)
 {
     game.AddEffect(cardEffect);
     var playEffectHandle = cardEffect.GetHandle(game);
     game.TriggerEffect(playEffectHandle);
     handle.Resolve(string.Format("{0} triggered {1}", player.Name, cardEffect.ToString()));
 }
Exemplo n.º 39
0
            //public override void Validate(IGame game, IEffectHandle handle)
            //{
            //    var resourcePayment = handle.Payment as IResourcePayment;
            //    if (resourcePayment == null)
            //    {
            //        handle.Reject();
            //        return;
            //    }

            //    if (resourcePayment.Characters.Count() != 1)
            //    {
            //        handle.Reject();
            //        return;
            //    }

            //    var hero = resourcePayment.Characters.First() as IHeroInPlay;
            //    if (hero == null || !hero.HasResourceIcon(Sphere.Spirit))
            //    {
            //        handle.Reject();
            //        return;
            //    }

            //    if (resourcePayment.GetPaymentBy(hero.Card.Id) != 1)
            //    {
            //        handle.Reject();
            //        return;
            //    }

            //    hero.Resources -= 1;

            //    handle.Accept();
            //}

            public override void Trigger(IGame game, IEffectHandle handle)
            {
                var card = CardSource as IPlayerCard;
                if (card == null || card.Owner == null)
                {
                    handle.Cancel(GetCancelledString());
                    return;
                }

                var ally = card.Owner.Hand.Cards.Where(x => x.Id == source.Id).FirstOrDefault() as IAllyCard;
                if (ally == null)
                {
                    handle.Cancel(GetCancelledString());
                    return;
                }

                card.Owner.Hand.RemoveCards(new List<IPlayerCard> { ally });
                card.Owner.AddCardInPlay(new AllyInPlay(game, ally));

                game.AddEffect(new ReturnToHandAfterSuccessfulQuest(CardSource));

                handle.Resolve(GetCompletedStatus());
            }
 public virtual void WhenRevealed(IGame game)
 {
     game.AddEffect(this);
 }
 public virtual void WhenRevealed(IGame game)
 {
     game.AddEffect(this);
 }
Exemplo n.º 42
0
 private void PlayCardFromHand(IGame game, IEffectHandle handle, IPlayableFromHand playableCard)
 {
     var playCardEffect = playableCard.GetPlayFromHandEffect(game, player);
     game.AddEffect(playCardEffect);
     var playCardHandle = playCardEffect.GetHandle(game);
     game.TriggerEffect(playCardHandle);
     handle.Resolve(string.Format("{0} played {1} from their hand", player.Name, playableCard.Title));
 }
Exemplo n.º 43
0
 public virtual void Shadow(IGame game)
 {
     game.AddEffect(this);
 }
Exemplo n.º 44
0
            public void DuringEncounterCardRevealed(IGame game)
            {
                if (game.StagingArea.RevealedEncounterCard == null)
                    return;

                if ((!(game.StagingArea.RevealedEncounterCard is IRevealableCard)) || (!(game.StagingArea.RevealedEncounterCard is ITreacheryCard)))
                    return;

                game.AddEffect(this);
            }
Exemplo n.º 45
0
 public virtual void Shadow(IGame game)
 {
     game.AddEffect(this);
 }