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


C# TurnContext.AddEffect方法代码示例

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


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

示例1: Resolve

            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);
                }
                    
            }
开发者ID:anatolilightfoot,项目名称:Dominion,代码行数:28,代码来源:ThroneRoom.cs

示例2: Play

        public void Play(TurnContext context)
        {
            context.DrawCards(1);
            context.RemainingActions += 1;

            context.AddEffect(this, new UpgradeEffect());
        }
开发者ID:anatolilightfoot,项目名称:Dominion,代码行数:7,代码来源:Upgrade.cs

示例3: CreateChooseActionActivity

            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;
            }  
开发者ID:razzielx,项目名称:Dominion,代码行数:17,代码来源:Golem.cs

示例4: BeginResolve

 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);
     }
 }
开发者ID:anatolilightfoot,项目名称:Dominion,代码行数:15,代码来源:AttackEffect.cs

示例5: Play

 public void Play(TurnContext context)
 {
     context.AddEffect(this, new MoneylenderEffect());
 }
开发者ID:razzielx,项目名称:Dominion,代码行数:4,代码来源:Moneylender.cs

示例6: Play

 public void Play(TurnContext context)
 {
     context.ActivePlayer.DrawCards(2);
     context.AddEffect(this, new GhostShipAttack());
 }
开发者ID:razzielx,项目名称:Dominion,代码行数:5,代码来源:GhostShip.cs

示例7: Play

 public void Play(TurnContext context)
 {
     context.AddEffect(this, new KingsCourtEffect());
 }
开发者ID:razzielx,项目名称:Dominion,代码行数:4,代码来源:KingsCourt.cs

示例8: Play

 public void Play(TurnContext context)
 {
     context.DrawCards(1);
     context.RemainingActions += 1;
     context.AddEffect(new FamiliarAttack());
 }
开发者ID:trentkerin,项目名称:Dominion,代码行数:6,代码来源:Familiar.cs

示例9: Play

 public void Play(TurnContext context)
 {
     var effect = new EnvoyEffect();
     context.AddEffect(this, effect);
 }
开发者ID:razzielx,项目名称:Dominion,代码行数:5,代码来源:Envoy.cs

示例10: Play

 public void Play(TurnContext context)
 {
     context.RemainingActions += 1;
     context.AddEffect(this, new CellarEffect());
 }
开发者ID:anatolilightfoot,项目名称:Dominion,代码行数:5,代码来源:Cellar.cs

示例11: Play

 public void Play(TurnContext context)
 {
     context.DrawCards(1);
     context.RemainingActions += 2;
     context.AddEffect(this, new MiningVillageEffect(this));
 }
开发者ID:razzielx,项目名称:Dominion,代码行数:6,代码来源:MiningVillage.cs

示例12: Play

 public void Play(TurnContext context)
 {
     context.AvailableSpend += 2;
     context.AddEffect(new MountebankAttack());
 }
开发者ID:trentkerin,项目名称:Dominion,代码行数:5,代码来源:Mountebank.cs

示例13: Play

 public void Play(TurnContext context)
 {
     context.AddEffect(this, new SecretChamberActionEffect());
 }
开发者ID:anatolilightfoot,项目名称:Dominion,代码行数:4,代码来源:SecretChamber.cs

示例14: Play

 public void Play(TurnContext context)
 {
     context.Trash(context.ActivePlayer, this);
     context.AddEffect(this, new FeastEffect());
 }
开发者ID:razzielx,项目名称:Dominion,代码行数:5,代码来源:Feast.cs

示例15: Play

 public void Play(TurnContext context)
 {
     context.AddEffect(new WorkshopEffect());
 }
开发者ID:trentkerin,项目名称:Dominion,代码行数:4,代码来源:Workshop.cs


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