当前位置: 首页>>代码示例>>C#>>正文


C# IGame.TriggerEffect方法代码示例

本文整理汇总了C#中IGame.TriggerEffect方法的典型用法代码示例。如果您正苦于以下问题:C# IGame.TriggerEffect方法的具体用法?C# IGame.TriggerEffect怎么用?C# IGame.TriggerEffect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IGame的用法示例。


在下文中一共展示了IGame.TriggerEffect方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Trigger

        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());
        }
开发者ID:bossaia,项目名称:alexandrialibrary,代码行数:33,代码来源:CheckForDefeatedEnemiesEffect.cs

示例2: TriggerResponse

        private void TriggerResponse(IGame game, IEffectHandle handle)
        {
            var responseHandle = responseEffect.GetHandle(game);
            game.TriggerEffect(responseHandle);

            handle.Resolve(string.Format("{0} decided to trigger '{1}'", player.Name, responseEffect));
        }
开发者ID:bossaia,项目名称:alexandrialibrary,代码行数:7,代码来源:PlayerResponseWindow.cs

示例3: AfterCostPaid

        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);
        }
开发者ID:bossaia,项目名称:alexandrialibrary,代码行数:10,代码来源:PlayEventEffect.cs

示例4: Trigger

            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());
            }
开发者ID:bossaia,项目名称:alexandrialibrary,代码行数:14,代码来源:CampfireTales.cs

示例5: Trigger

        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());
        }
开发者ID:bossaia,项目名称:alexandrialibrary,代码行数:38,代码来源:EnemyDefeatedEffect.cs

示例6: TriggerEffect

 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()));
 }
开发者ID:bossaia,项目名称:alexandrialibrary,代码行数:7,代码来源:PlayerActionWindow.cs

示例7: PlayCardFromHand

 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));
 }
开发者ID:bossaia,项目名称:alexandrialibrary,代码行数:8,代码来源:PlayerActionWindow.cs


注:本文中的IGame.TriggerEffect方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。