Пример #1
0
        public override bool CanHit(Unit9 target)
        {
            if (target.IsMagicImmune && ((target.IsEnemy(this.Owner) && !this.CanHitSpellImmuneEnemy) ||
                                         (target.IsAlly(this.Owner) && !this.CanHitSpellImmuneAlly)))
            {
                return(false);
            }

            if (this.Owner.Distance(target) > this.CastRange)
            {
                return(false);
            }

            var grabTarget = EntityManager9.Units
                             .Where(
                x => x.IsUnit && x.IsAlive && x.IsVisible && !x.IsMagicImmune && !x.IsInvulnerable && !x.Equals(this.Owner) &&
                x.Distance(this.Owner) < this.RadiusData.GetValue(this.Level))
                             .OrderBy(x => x.Distance(this.Owner))
                             .FirstOrDefault();

            if (grabTarget == null)
            {
                return(false);
            }

            if (grabTarget.IsHero && !grabTarget.IsIllusion && grabTarget.IsAlly(this.Owner))
            {
                return(false);
            }

            return(true);
        }
Пример #2
0
        // Token: 0x0600107F RID: 4223 RVA: 0x00023C28 File Offset: 0x00021E28
        public override bool CanHit(Unit9 target)
        {
            if (target.IsMagicImmune && ((target.IsEnemy(base.Owner) && !this.CanHitSpellImmuneEnemy) || (target.IsAlly(base.Owner) && !this.CanHitSpellImmuneAlly)))
            {
                return(false);
            }
            PredictionInput9 predictionInput = this.GetPredictionInput(target, null);

            return(this.GetPredictionOutput(predictionInput).HitChance > HitChance.Impossible);
        }
Пример #3
0
        public override bool CanHit(Unit9 target)
        {
            if (target.IsMagicImmune && ((target.IsEnemy(this.Owner) && !this.CanHitSpellImmuneEnemy) ||
                                         (target.IsAlly(this.Owner) && !this.CanHitSpellImmuneAlly)))
            {
                return(false);
            }

            if (this.Owner.Distance(target) > this.CastRange)
            {
                return(false);
            }

            return(true);
        }
Пример #4
0
        private void OnUnitAdded(Unit9 unit)
        {
            try
            {
                if (!unit.IsHero || unit.IsIllusion || !unit.IsEnemy(this.owner.Team))
                {
                    return;
                }

                this.units.Add(new InformationUnit(unit));
            }
            catch (Exception e)
            {
                Logger.Error(e);
            }
        }
Пример #5
0
        // Token: 0x06000BF7 RID: 3063 RVA: 0x0002533C File Offset: 0x0002353C
        public override bool CanHit(Unit9 target)
        {
            if (target.IsMagicImmune && ((target.IsEnemy(base.Owner) && !this.CanHitSpellImmuneEnemy) || (target.IsAlly(base.Owner) && !this.CanHitSpellImmuneAlly)))
            {
                return(false);
            }
            if (base.Owner.Distance(target) > this.CastRange)
            {
                return(false);
            }
            Unit9 unit = (from x in EntityManager9.Units
                          where x.IsUnit && x.IsAlive && x.IsVisible && !x.IsMagicImmune && !x.IsInvulnerable && !x.Equals(base.Owner) && x.Distance(base.Owner) < this.RadiusData.GetValue(this.Level)
                          orderby x.Distance(base.Owner)
                          select x).FirstOrDefault <Unit9>();

            return(!(unit == null) && (!unit.IsHero || unit.IsIllusion || !unit.IsAlly(base.Owner)));
        }
Пример #6
0
        public override bool CanHit(Unit9 target)
        {
            if (target.IsMagicImmune && ((target.IsEnemy(this.Owner) && !this.CanHitSpellImmuneEnemy) ||
                                         (target.IsAlly(this.Owner) && !this.CanHitSpellImmuneAlly)))
            {
                return(false);
            }

            var predictionInput = this.GetPredictionInput(target);
            var output          = this.GetPredictionOutput(predictionInput);

            if (output.HitChance <= HitChance.Impossible)
            {
                return(false);
            }

            return(true);
        }
Пример #7
0
        // Token: 0x060003B1 RID: 945 RVA: 0x0001CDB8 File Offset: 0x0001AFB8
        private static void SetTarget(IEnumerable <Entity> entities, uint targetHandle)
        {
            Unit9 unit = EntityManager9.GetUnit(targetHandle);

            if (unit == null || !unit.IsAlive)
            {
                return;
            }
            foreach (Entity entity in entities)
            {
                Unit9 unitFast = EntityManager9.GetUnitFast(entity.Handle);
                if (unitFast != null && unitFast.IsEnemy(unit))
                {
                    unitFast.Target      = unit;
                    unitFast.IsAttacking = true;
                }
            }
        }
Пример #8
0
        private void OnUnitRemoved(Unit9 unit)
        {
            try
            {
                if (!unit.IsHero || unit.IsIllusion || !unit.IsEnemy(this.owner.Team))
                {
                    return;
                }

                var autoAttackUnit = this.units.Find(x => x.Unit.Handle == unit.Handle);
                if (autoAttackUnit != null)
                {
                    this.units.Remove(autoAttackUnit);
                }
            }
            catch (Exception e)
            {
                Logger.Error(e);
            }
        }
Пример #9
0
 public bool PiercesMagicImmunity(Unit9 target)
 {
     return((target.IsEnemy(this.Owner) && this.CanHitSpellImmuneEnemy) || (target.IsAlly(this.Owner) && this.CanHitSpellImmuneAlly));
 }
Пример #10
0
 // Token: 0x060010F6 RID: 4342 RVA: 0x000295A8 File Offset: 0x000277A8
 public override bool CanHit(Unit9 target)
 {
     return((!target.IsMagicImmune || ((!target.IsEnemy(base.Owner) || this.CanHitSpellImmuneEnemy) && (!target.IsAlly(base.Owner) || this.CanHitSpellImmuneAlly))) && base.Owner.Distance(target) <= this.CastRange);
 }