• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# IDamageableEntity类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: OnDamagedEffect

 internal void OnDamagedEffect(IDamageableEntity target, int damageDealt)
 {
     if (target == this)
     {
         this.Owner.DrawCard();
     }
 }
开发者ID:kwluo90,项目名称:HearthAnalyzer,代码行数:7,代码来源:AcolyteofPain.cs


示例2: Battlecry

        public void Battlecry(IDamageableEntity subTarget)
        {
            if (subTarget != null &&
                !GameEngine.GameState.CurrentPlayerPlayZone.Any(card => card != null && card.CurrentAttackPower >= BATTLECRY_POWER && card != this) &&
                !GameEngine.GameState.WaitingPlayerPlayZone.Any(card => card != null && card.CurrentAttackPower >= BATTLECRY_POWER))
            {
                throw new InvalidOperationException("No valid targets!");
            }

            if (subTarget == null &&
                (GameEngine.GameState.CurrentPlayerPlayZone.Any(card => card != null && card.CurrentAttackPower >= BATTLECRY_POWER && card != this) ||
                GameEngine.GameState.WaitingPlayerPlayZone.Any(card => card != null && card.CurrentAttackPower >= BATTLECRY_POWER)))
            {
                throw new InvalidOperationException("There is a valid target, must select one!");
            }

            if (subTarget != null && !(subTarget is BaseMinion))
            {
                throw new InvalidOperationException("Must target minions!");
            }

            var targetMinion = subTarget as BaseMinion;
            if (targetMinion != null)
            {
                if (targetMinion.CurrentAttackPower < BATTLECRY_POWER)
                {
                    throw new InvalidOperationException(
                        string.Format(
                            "Invalid minion {0}! It does not have enough attack power! Needs to be at least {1}",
                            targetMinion, BATTLECRY_POWER));
                }

                targetMinion.Die();
            }
        }
开发者ID:kwluo90,项目名称:HearthAnalyzer,代码行数:35,代码来源:BigGameHunter.cs


示例3: 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


示例4: Battlecry

 public void Battlecry(IDamageableEntity subTarget)
 {
     BaseWeapon weapon = GameEngine.GameState.CurrentPlayer.Weapon;
     if (weapon != null) {
         weapon.TakeBuff(BATTLECRY_BUFF_VALUE, BATTLECRY_BUFF_VALUE);
     }
 }
开发者ID:kwluo90,项目名称:HearthAnalyzer,代码行数:7,代码来源:CaptainGreenskin.cs


示例5: Battlecry

 public void Battlecry(IDamageableEntity subTarget)
 {
     if (this.Owner.Weapon != null)
     {
         this.TakeBuff(this.Owner.Weapon.CurrentAttackPower, 0);
     }
 }
开发者ID:kwluo90,项目名称:HearthAnalyzer,代码行数:7,代码来源:BloodsailRaider.cs


示例6: Battlecry

 public void Battlecry(IDamageableEntity subTarget)
 {
     var enemy = GameEngine.GameState.WaitingPlayer;
     if (enemy.Weapon != null)
     {
         enemy.Weapon.Die();
     }
 }
开发者ID:kwluo90,项目名称:HearthAnalyzer,代码行数:8,代码来源:AcidicSwampOoze.cs


示例7: OnSpellCasting

 private void OnSpellCasting(BaseSpell spell, IDamageableEntity target, out bool shouldAbort)
 {
     if (spell.Owner == this.Owner) {
         var fireball = HearthEntityFactory.CreateCard<Fireball> ();
         this.Owner.AddCardToHand (fireball);
     }
     shouldAbort = false;
 }
开发者ID:kwluo90,项目名称:HearthAnalyzer,代码行数:8,代码来源:ArchmageAntonidas.cs


示例8: OnDamageDealt

 private void OnDamageDealt(IDamageableEntity target, int damageDealt)
 {
     var targetMinion = target as BaseMinion;
     if (targetMinion != null && GameEngine.GameState.CurrentPlayerPlayZone.Contains(targetMinion))
     {
         this.Owner.Armor++;
     }
 }
开发者ID:kwluo90,项目名称:HearthAnalyzer,代码行数:8,代码来源:Armorsmith.cs


示例9: 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


示例10: DeathrattleHealTarget

        /// <summary>
        /// Constructs an instance of DeathrattleHealTarget
        /// </summary>
        /// <param name="owner">The owner of the deathrattle</param>
        /// <param name="healTarget">The target to heal</param>
        /// <param name="healAmount">The amount to heal</param>
        public DeathrattleHealTarget(BaseCard owner, IDamageableEntity healTarget, int healAmount)
        {
            if (owner == null) throw new ArgumentNullException("owner");
            if (healTarget == null) throw new ArgumentNullException("healTarget");

            this.owner = owner;
            this.healTarget = healTarget;
            this.healAmount = healAmount;
        }
开发者ID:kwluo90,项目名称:HearthAnalyzer,代码行数:15,代码来源:DeathrattleHealTarget.cs


示例11: Battlecry

        public void Battlecry(IDamageableEntity subTarget)
        {
            if (subTarget is BasePlayer)
            {
                throw new InvalidOperationException("Can't buff players!");
            }

            subTarget.TakeTemporaryBuff(BATTLECRY_POWER);
        }
开发者ID:kwluo90,项目名称:HearthAnalyzer,代码行数:9,代码来源:AbusiveSergeant.cs


示例12: Battlecry

        public void Battlecry(IDamageableEntity subTarget)
        {
            var targetPlayer = subTarget as BasePlayer;
            if (targetPlayer == null)
            {
                throw new InvalidOperationException("Target must be a player!");
            }

            targetPlayer.Health = 15;
        }
开发者ID:kwluo90,项目名称:HearthAnalyzer,代码行数:10,代码来源:Alexstrasza.cs


示例13: OnHealing

        private void OnHealing(BasePlayer healer, IDamageableEntity target, int healAmount, out bool shouldAbort)
        {
            shouldAbort = false;

            if (healer == this.Owner)
            {
                shouldAbort = true;
                // Instead, do damage!
                target.TakeDamage(healAmount);
            }
        }
开发者ID:kwluo90,项目名称:HearthAnalyzer,代码行数:11,代码来源:AuchenaiSoulpriest.cs


示例14: 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


示例15: Attack

        public virtual void Attack(IDamageableEntity target)
        {
            // Fire attacking event
            bool shouldAbort;
            GameEventManager.Attacking(this, target, isRetaliation: false, shouldAbort: out shouldAbort);

            if (!shouldAbort)
            {
                // Use up a durability charge
                this.TakeDamage(1);
                GameEngine.TriggerDeathrattles();
            }
        }
开发者ID:kwluo90,项目名称:HearthAnalyzer,代码行数:13,代码来源:BaseWeapon.cs


示例16: Battlecry

        public void Battlecry(IDamageableEntity subTarget)
        {
            var targetMinion = subTarget as BaseMinion;
            var targetPlayer = subTarget as BasePlayer;

            if (targetMinion != null)
            {
                targetMinion.ApplyStatusEffects(MinionStatusEffects.FROZEN);
            }
            else if (targetPlayer != null)
            {
                targetPlayer.ApplyStatusEffects(PlayerStatusEffects.FROZEN);
            }
        }
开发者ID:kwluo90,项目名称:HearthAnalyzer,代码行数:14,代码来源:FrostElemental.cs


示例17: Battlecry

        public void Battlecry(IDamageableEntity subTarget)
        {
            var battleAxe = HearthEntityFactory.CreateCard<BattleAxe>();

            // kill the old weapon
            if (this.Owner.Weapon != null)
            {
                this.Owner.Weapon.Die();
            }

            this.Owner.Weapon = battleAxe;
            battleAxe.Owner = this.Owner;
            battleAxe.WeaponOwner = this.Owner;
        }
开发者ID:kwluo90,项目名称:HearthAnalyzer,代码行数:14,代码来源:ArathiWeaponsmith.cs


示例18: 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


示例19: Battlecry

 public void Battlecry(IDamageableEntity subTarget)
 {
     var opponent = GameEngine.GameState.WaitingPlayer;
     if (opponent.Weapon != null)
     {
         if (opponent.Weapon is Gorehowl)
         {
             // HACK: this card can bypass gorehowl's override of TakeDamage
             ((Gorehowl)opponent.Weapon).TakeDamage(BATTLECRY_DAMAGE, forceUseBaseImplementation: true);
         }
         else
         {
             opponent.Weapon.TakeDamage(BATTLECRY_DAMAGE);
         }
     }
 }
开发者ID:kwluo90,项目名称:HearthAnalyzer,代码行数:16,代码来源:BloodsailCorsair.cs


示例20: Battlecry

        public void Battlecry(IDamageableEntity subTarget)
        {
            var targetMinion = subTarget as BaseMinion;
            if (targetMinion == null)
            {
                throw new InvalidOperationException("Target needs to be a minion!");
            }

            if (!GameEngine.GameState.WaitingPlayerPlayZone.Contains(targetMinion))
            {
                throw new InvalidOperationException("Target must be an enemy");
            }

            var attackToSubtract = targetMinion.CurrentAttackPower - 1;
            targetMinion.TakeBuff(-attackToSubtract, 0);
        }
开发者ID:kwluo90,项目名称:HearthAnalyzer,代码行数:16,代码来源:AldorPeacekeeper.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IDaoFactory类代码示例发布时间:2022-05-24
下一篇:
C# IDalSession类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap