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


C# Player.GainCard方法代码示例

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


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

示例1: ReactToAttack

 public override bool ReactToAttack(GameModel gameModel, Player targetPlayer)
 {
     int choice = targetPlayer.Chooser.ChooseOneEffect(EffectChoiceType.DiscardBeggar, "You may discard Beggar to gain two Silvers", choices, choiceText);
     if (choice == 0)
     {
         targetPlayer.DiscardCard(this);
         targetPlayer.GainCard(typeof(Silver), GainLocation.TopOfDeck);
         targetPlayer.GainCard(typeof(Silver));
     }
     return false;
 }
开发者ID:alanjg,项目名称:MajorDomo,代码行数:11,代码来源:Beggar.cs

示例2: OnTrash

 public override void OnTrash(GameModel gameModel, Player owner)
 {
     int choice = owner.Chooser.ChooseOneEffect(EffectChoiceType.GainForHuntingGrounds, "Gain a Duchy or 3 Estates", choices, choices);
     if (choice == 0)
     {
         owner.GainCard(typeof(Duchy));
     }
     else
     {
         for (int i = 0; i < 3; i++)
         {
             owner.GainCard(typeof(Estate));
         }
     }
 }
开发者ID:alanjg,项目名称:MajorDomo,代码行数:15,代码来源:HuntingGrounds.cs

示例3: OnTrash

 public override void OnTrash(GameModel gameModel, Player owner)
 {
     Pile pile = owner.Chooser.ChooseOnePile(CardChoiceType.Gain, "Gain an Attack card", gameModel.SupplyPiles.Where(p => p.Count > 0 && p.Card.Is(CardType.Attack)));
     if (pile != null)
     {
         owner.GainCard(pile);
     }
 }
开发者ID:alanjg,项目名称:MajorDomo,代码行数:8,代码来源:Squire.cs

示例4: OnTrash

 public override void OnTrash(GameModel gameModel, Player owner)
 {
     IEnumerable<Pile> piles = gameModel.SupplyPiles.Where(p => (p.GetCost() < gameModel.GetCost(this) && (!p.CostsPotion || this.CostsPotion)) || p.GetCost() == gameModel.GetCost(this) && !p.CostsPotion && this.CostsPotion);
     if(piles.Any())
     {
         Pile choice = owner.Chooser.ChooseOnePile(CardChoiceType.Gain, "Gain a card costing less than $" + gameModel.GetCost(this), piles);
         owner.GainCard(choice);
     }
 }
开发者ID:alanjg,项目名称:MajorDomo,代码行数:9,代码来源:Catacombs.cs

示例5: OnTrash

 public override void OnTrash(GameModel gameModel, Player owner)
 {
     owner.GainCard(typeof(Gold));
 }
开发者ID:alanjg,项目名称:MajorDomo,代码行数:4,代码来源:SirVander.cs

示例6: OnGain

 public override void OnGain(GameModel gameModel, Player player)
 {
     player.GainCard(gameModel.Ruins);
     player.GainCard(gameModel.Ruins);
 }
开发者ID:alanjg,项目名称:MajorDomo,代码行数:5,代码来源:DeathCart.cs

示例7: OnGain

 public override void OnGain(GameModel gameModel, Player player)
 {
     Pile pile = gameModel.SupplyPiles.FirstOrDefault(p => p.Card is Duchess);
     if (pile != null && pile.Count > 0)
     {
         int choice = player.Chooser.ChooseOneEffect(EffectChoiceType.GainDuchess, "Do you want to gain a duchess?", choices, choices);
         if (choice == 0)
         {
             player.GainCard(pile);
         }
     }
 }
开发者ID:alanjg,项目名称:MajorDomo,代码行数:12,代码来源:Victorys.cs


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