コード例 #1
0
        protected override bool AbilityControl(CHero target, CAbility ability)
        {
            var concussiveShot = Abilities.ConcussiveShot;

            if (ability == concussiveShot && target != concussiveShot.TargetHit)
            {
                return(true);
            }

            return(false);
        }
コード例 #2
0
        public static float SpellAmplification(this CAbility ability)
        {
            var owner = ability.Owner;

            if (owner == null)
            {
                return(0.0f);
            }

            return(owner.GetSpellAmplification());
        }
コード例 #3
0
        protected override float GetMagicalDamage(CAbility ability, CHero hero, float magicalDamageReduction, float magicalCurrentHealth, bool canHitActive)
        {
            var mysticFlare = (ability as MysticFlare);

            if (mysticFlare != null)
            {
                if (!canHitActive)
                {
                    return(DamageHelpers.GetSpellDamage(mysticFlare.GetTotalDamage(hero), magicalDamageReduction - 1));
                }

                return(0);
            }

            return(ability.GetDamage(hero, magicalDamageReduction - 1, magicalCurrentHealth));
        }
コード例 #4
0
        // TODO REWORK
        protected bool CanBeCasted(CAbility ability)
        {
            if (!ability.IsReady)
            {
                return(false);
            }

            var owner  = ability.Owner;
            var isItem = ability is CItem;

            if (owner.IsStunned() || isItem && owner.IsMuted() || !isItem && owner.IsSilenced())
            {
                return(false);
            }

            return(true);
        }
コード例 #5
0
        protected override bool IsHitTime(CHero target, CAbility ability)
        {
            if (ability == Abilities.Ethereal)
            {
                return(Helpers.MultiSleeper <string> .Sleeping($"IsHitTime_{target.Name}_{ability.Name}"));
            }

            if (ability == Abilities.ConcussiveShot)
            {
                return(Helpers.MultiSleeper <string> .Sleeping($"IsHitTime_{target.Name}_{ability.Name}"));
            }

            if (ability == Abilities.ArcaneBolt)
            {
                return(Helpers.MultiSleeper <string> .Sleeping($"IsHitTime_{target.Name}_{ability.Name}"));
            }

            return(false);
        }
コード例 #6
0
        public static float GetDamageReduction(this CAbility ability, Unit target, DamageType damageType)
        {
            // TODO: modifiers
            if ((damageType & DamageType.HealthRemoval) == DamageType.HealthRemoval)
            {
                return(0.0f);
            }

            var reduction = 0.0f;

            switch (damageType)
            {
            case DamageType.Magical:
                reduction = target.MagicDamageResist;
                break;

            case DamageType.Physical:
                reduction = target.DamageResist;
                break;
            }

            return(reduction);
        }
コード例 #7
0
 protected virtual float GetMagicalDamage(CAbility ability, Hero hero, float magicalDamageReduction, float magicalCurrentHealth, bool canHitActive)
 {
     return(ability.GetDamage(hero, magicalDamageReduction - 1, magicalCurrentHealth));
 }
コード例 #8
0
 protected virtual float PureDamageHealth(CAbility ability, Hero hero, float pureDamageReduction, float health, float pureDamage)
 {
     return(0);
 }
コード例 #9
0
 protected virtual bool IsHitTime(Hero hero, CAbility ability)
 {
     return(false);
 }
コード例 #10
0
 protected virtual bool AbilityControl(Hero hero, CAbility ability)
 {
     return(false);
 }
コード例 #11
0
 public static float GetDamageReduction(this CAbility ability, Unit target)
 {
     return(GetDamageReduction(ability, target, ability.DamageType));
 }