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


C# CardEffect类代码示例

本文整理汇总了C#中CardEffect的典型用法代码示例。如果您正苦于以下问题:C# CardEffect类的具体用法?C# CardEffect怎么用?C# CardEffect使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: UseCardEffect

        /// <summary>
        /// First Effect: Draw 2 cards
        /// Second Effect: Restore 5 Health
        /// </summary>
        /// <param name="cardEffect">The card effect to use</param>
        /// <param name="target">The target of the heal</param>
        public void UseCardEffect(CardEffect cardEffect, IDamageableEntity target = null)
        {
            if (cardEffect == CardEffect.FIRST)
            {
                // Draw cards
                this.Owner.DrawCards(DRAW_COUNT);
            }
            else if (cardEffect == CardEffect.SECOND)
            {
                // Heal
                if (target == null)
                {
                    throw new InvalidOperationException("Needs to have a target!");
                }

                bool shouldAbort;
                GameEventManager.Healing(this.Owner, target, HEAL_AMOUNT, out shouldAbort);

                if (!shouldAbort)
                {
                    target.TakeHealing(HEAL_AMOUNT);
                }
            }
            else
            {
                throw new InvalidOperationException("You must choose a card effect to play it!");
            }
        }
开发者ID:kwluo90,项目名称:HearthAnalyzer,代码行数:34,代码来源:AncientofLore.cs

示例2: Activate

 public override void Activate(IDamageableEntity target = null, CardEffect cardEffect = CardEffect.NONE)
 {
     int totalSpellDamage = MAX_SPELL_POWER + this.BonusSpellPower;
     GameEngine.GameState.CurrentPlayer.TakeDamage(totalSpellDamage);
     GameEngine.GameState.WaitingPlayer.TakeDamage(totalSpellDamage);
     GameEngine.GameState.CurrentPlayerPlayZone.Where(card => card != null).ToList().ForEach(card => ((IDamageableEntity)card).TakeDamage(totalSpellDamage));
     GameEngine.GameState.WaitingPlayerPlayZone.Where(card => card != null).ToList().ForEach(card => ((IDamageableEntity)card).TakeDamage(totalSpellDamage));
 }
开发者ID:kwluo90,项目名称:HearthAnalyzer,代码行数:8,代码来源:Hellfire.cs

示例3: Activate

        public override void Activate(IDamageableEntity target = null, CardEffect cardEffect = CardEffect.NONE)
        {
            if (target == null)
            {
                throw new ArgumentNullException("Fireball must be cast with target in mind");
            }

            // Deal damage to the target
            var damageToDeal = MAX_SPELL_POWER + this.BonusSpellPower;
            target.TakeDamage(damageToDeal);
        }
开发者ID:kwluo90,项目名称:HearthAnalyzer,代码行数:11,代码来源:Fireball.cs

示例4: UseCardEffect

 public void UseCardEffect(CardEffect cardEffect, IDamageableEntity target = null)
 {
     if (cardEffect == CardEffect.FIRST)
     {
         this.TakeBuff(ATTACK_BUFF, 0);
     }
     else if (cardEffect == CardEffect.SECOND)
     {
         this.TakeBuff(0, HEALTH_BUFF);
         this.ApplyStatusEffects(MinionStatusEffects.TAUNT);
     }
     else
     {
         throw new InvalidOperationException("You must choose a card effect to play!");
     }
 }
开发者ID:kwluo90,项目名称:HearthAnalyzer,代码行数:16,代码来源:AncientofWar.cs

示例5: Activate

 public override void Activate(IDamageableEntity target = null, CardEffect cardEffect = CardEffect.NONE)
 {
     throw new NotImplementedException();
 }
开发者ID:kwluo90,项目名称:HearthAnalyzer,代码行数:4,代码来源:HandofProtection.cs

示例6: Activate

 public override void Activate(IDamageableEntity target = null, CardEffect cardEffect = CardEffect.NONE)
 {
     this.Owner.Mana = Math.Min(this.Owner.Mana + 1, Constants.MAX_MANA_CAPACITY);
 }
开发者ID:kwluo90,项目名称:HearthAnalyzer,代码行数:4,代码来源:TheCoin.cs

示例7: Activate

 /// <summary>
 /// Activates the spell card with an optional target
 /// </summary>
 /// <param name="target">The target for the spell card if applicable</param>
 /// <param name="cardEffect">The card effect to use</param>
 public abstract void Activate(IDamageableEntity target = null, CardEffect cardEffect = CardEffect.NONE);
开发者ID:kwluo90,项目名称:HearthAnalyzer,代码行数:6,代码来源:BaseSpell.cs

示例8: Activate

 public override void Activate(IDamageableEntity target = null, CardEffect cardEffect = CardEffect.NONE)
 {
     GameEngine.GameState.WaitingPlayerPlayZone.ForEach(minion => this.HealTarget((BaseMinion)minion, MAX_SPELL_POWER));
     GameEngine.GameState.CurrentPlayerPlayZone.ForEach(minion => this.HealTarget((BaseMinion)minion, MAX_SPELL_POWER));
 }
开发者ID:kwluo90,项目名称:HearthAnalyzer,代码行数:5,代码来源:CircleofHealing.cs


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