當前位置: 首頁>>代碼示例>>C#>>正文


C# Card.GetEquipped方法代碼示例

本文整理匯總了C#中Card.GetEquipped方法的典型用法代碼示例。如果您正苦於以下問題:C# Card.GetEquipped方法的具體用法?C# Card.GetEquipped怎麽用?C# Card.GetEquipped使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Card的用法示例。


在下文中一共展示了Card.GetEquipped方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Modify

        protected override void Modify(Card card)
        {
            base.Modify(card);
            card.PotentialPhysicalAttack = () => 2;

            card.CreateAbility()
                .EquipWeapon(Attr.PhysicalAttack, 2)
                .On(Phase.Equip);

            card.AddEventHandler(
                events =>
                events.Subscribe<SelectingCards>(
                    message =>
                        {
                            if (message.TriggeringAbility != null && message.TriggeringAbility.Phase == Phase.Battle && card.IsEquipped)
                                message.Selection.Remove(card.GetEquipped().First());
                        }));
        }
開發者ID:Slugburn,項目名稱:Thunderstone,代碼行數:18,代碼來源:Pike.cs

示例2: Modify

        protected override void Modify(Card card)
        {
            base.Modify(card);

            card.PotentialPhysicalAttack = () => 5;

            card.CreateAbility()
                .EquipWeapon((player, hero) =>
                                 {
                                     hero.AddModifier(new SetMod(card, Attr.PhysicalAttack, 0));
                                     hero.AddModifier(new SetMod(card, Attr.MagicalAttack, 0));
                                 }).On(Phase.Equip);

            card.AddEventHandler(events => events.Subscribe<AttackRankSelected>(e =>
                                                              {
                                                                  if (e.AttackedRank.Number >= 2 && card.IsEquipped)
                                                                      card.GetEquipped().First().AddModifier(new PlusMod(card, Attr.PhysicalAttack, 5));
                                                              }));
        }
開發者ID:Slugburn,項目名稱:Thunderstone,代碼行數:19,代碼來源:FalconArbalest.cs

示例3: Create

        public Card Create(Game game)
        {
            var card = new Card(game)
                           {
                               Type = CardType.Hero,
                               Name = "Regular",
                               Gold = 0,
                               Strength = 3,
                               Cost = 0,
                               Text = "<b>Physical Attack +1</b>"
                                      + "<br/><br/>"
                                      + "<b>Dungeon:</b> If equipped with a polearm, draw a card.",
                               PhysicalAttack = 1,
                               Xp = 2,
                               Owner = CardOwner.Village
                           };
            card.SetTags("Level 0", "Basic");
            card.CreateAbility()
                .DrawCards(1)
                .Condition(player => card.IsEquipped && card.GetEquipped().First().HasTag("Polearm"))
                .On(Phase.Dungeon);

            return card;
        }
開發者ID:Slugburn,項目名稱:Thunderstone,代碼行數:24,代碼來源:Regular.cs

示例4: From

 public static CardModel From(Card card)
 {
     return card == null
                ? null
                : new CardModel
                      {
                          Name = card.Name,
                          Cost = card.Cost,
                          Gold = card.Gold,
                          Health = card.Health,
                          Id = card.Id,
                          Level = card.Level,
                          Light = card.Light,
                          Darkness =  card.Darkness,
                          MagicAttack = card.MagicAttack,
                          PhysicalAttack = card.PhysicalAttack,
                          PotentialMagicAttack = card.PotentialMagicAttack == null ? null : card.PotentialMagicAttack(),
                          PotentialPhysicalAttack = card.PotentialPhysicalAttack == null ? null : card.PotentialPhysicalAttack(),
                          Rank = card.Rank == null ? (int?) null : card.Rank.Number,
                          Strength = card.Strength,
                          Tags = card.Tags,
                          Text = card.Text,
                          Type = card.Type.ToString(),
                          Vp = card.Vp,
                          Xp = card.Xp,
                          Owner = card.Owner.ToString(),
                          Equipped = card.IsEquipped ? card.GetEquipped().Select(c=>c.Name).ToArray() : null
                      };
 }
開發者ID:Slugburn,項目名稱:Thunderstone,代碼行數:29,代碼來源:CardModel.cs


注:本文中的Card.GetEquipped方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。