// Token: 0x060002D0 RID: 720 RVA: 0x0001A898 File Offset: 0x00018A98
        public override void AddDrawableAbility(List <IDrawableAbility> drawableAbilities, ParticleEffect particle, Team allyTeam, INotificator notificator)
        {
            Vector3 position = particle.GetControlPoint(base.ControlPoint);

            if (EntityManager9.Heroes.Any((Hero9 x) => x.IsUnit && x.Team == allyTeam && x.IsAlive && x.Distance(position) < 800f))
            {
                return;
            }
            SimpleDrawableAbility drawableAbility = new SimpleDrawableAbility
            {
                AbilityTexture = base.AbilityId + "_rounded",
                ShowUntil      = Game.RawGameTime + base.TimeToShow,
                Position       = (base.RawParticlePosition ? particle.Position : particle.GetControlPoint(base.ControlPoint)).SetZ(new float?((float)350))
            };

            if (base.Replace)
            {
                IDrawableAbility drawableAbility2 = drawableAbilities.LastOrDefault((IDrawableAbility x) => x.AbilityTexture == drawableAbility.AbilityTexture && x.HeroTexture == drawableAbility.HeroTexture);
                if (drawableAbility2 != null)
                {
                    drawableAbilities.Remove(drawableAbility2);
                }
            }
            drawableAbilities.Add(drawableAbility);
            if (base.ShowNotification && notificator != null)
            {
                notificator.PushNotification(new AbilityNotification(null, base.AbilityId.ToString()));
            }
        }
Example #2
0
        public override void AddDrawableAbility(
            List <IDrawableAbility> drawableAbilities,
            Particle particle,
            Team allyTeam,
            INotificator notificator)
        {
            var position = particle.GetControlPoint(this.ControlPoint);

            if (EntityManager9.Heroes.Any(x => x.IsUnit && x.Team == allyTeam && x.IsAlive && x.Distance(position) < 800))
            {
                return;
            }

            var drawableAbility = new SimpleDrawableAbility
            {
                AbilityTexture = this.AbilityId.ToString(),
                ShowUntil      = GameManager.RawGameTime + this.TimeToShow,
                Position       = (this.RawParticlePosition ? particle.Position : particle.GetControlPoint(this.ControlPoint)).SetZ(350)
            };

            if (this.Replace)
            {
                var exist = drawableAbilities.LastOrDefault(
                    x => x.AbilityTexture == drawableAbility.AbilityTexture && x.HeroTexture == drawableAbility.HeroTexture);

                if (exist != null)
                {
                    drawableAbilities.Remove(exist);
                }
            }

            drawableAbilities.Add(drawableAbility);

            if (this.ShowNotification)
            {
                notificator?.PushNotification(new AbilityNotification(null, this.AbilityId.ToString()));
            }
        }
Example #3
0
        public override void AddDrawableAbility(
            List <IDrawableAbility> drawableAbilities,
            Particle particle,
            Team allyTeam,
            INotificator notificator)
        {
            var position = particle.GetControlPoint(this.ControlPoint);
            var blinks   = EntityManager9.Abilities.Where(
                x => (x.Id == this.AbilityId || x.Id == AbilityId.item_flicker) && x.Owner.CanUseAbilities && x.Owner.IsAlive)
                           .ToList();

            if (blinks.Count == 0 || blinks.All(x => x.Owner.Team == allyTeam))
            {
                return;
            }

            if (blinks.Any(x => x.Owner.IsVisible && x.Owner.Distance(position) < 1500 && x.TimeSinceCasted < 0.5f))
            {
                return;
            }

            var enemyBlinks = blinks.Where(x => x.Owner.Team != allyTeam && x.RemainingCooldown <= 0).ToList();

            if (enemyBlinks.Count == 0)
            {
                return;
            }

            if (enemyBlinks.Count == 1)
            {
                var owner           = enemyBlinks[0].Owner;
                var drawableAbility = new DrawableAbility
                {
                    AbilityTexture     = this.AbilityId.ToString(),
                    HeroTexture        = owner.Name,
                    MinimapHeroTexture = owner.Name,
                    ShowUntil          = GameManager.RawGameTime + this.TimeToShow,
                    Position           = GameManager.RawGameTime - owner.LastVisibleTime < 0.5f
                                   ? owner.InFront(enemyBlinks[0].Range - 200)
                                   : position.SetZ(350)
                };

                owner.ChangeBasePosition(drawableAbility.Position);
                drawableAbilities.Add(drawableAbility);
            }
            else
            {
                var owner = enemyBlinks.Find(x => x.Owner.Distance(position) < 100 && GameManager.RawGameTime - x.Owner.LastVisibleTime < 0.5f)
                            ?.Owner;

                if (owner != null)
                {
                    var drawableAbility = new DrawableAbility
                    {
                        AbilityTexture     = this.AbilityId.ToString(),
                        HeroTexture        = owner.Name,
                        MinimapHeroTexture = owner.Name,
                        ShowUntil          = GameManager.RawGameTime + this.TimeToShow,
                        Position           = owner.InFront(enemyBlinks[0].Range - 200)
                    };

                    owner.ChangeBasePosition(drawableAbility.Position);
                    drawableAbilities.Add(drawableAbility);
                }
                else
                {
                    var drawableAbility = new SimpleDrawableAbility
                    {
                        AbilityTexture = this.AbilityId.ToString(),
                        ShowUntil      = GameManager.RawGameTime + this.TimeToShow,
                        Position       = (this.RawParticlePosition ? particle.Position : particle.GetControlPoint(this.ControlPoint)).SetZ(350)
                    };

                    drawableAbilities.Add(drawableAbility);
                }
            }
        }
Example #4
0
        // Token: 0x0600031A RID: 794 RVA: 0x0001B924 File Offset: 0x00019B24
        public override void AddDrawableAbility(List <IDrawableAbility> drawableAbilities, ParticleEffect particle, Team allyTeam, INotificator notificator)
        {
            Vector3         position = particle.GetControlPoint(base.ControlPoint);
            List <Ability9> list     = (from x in EntityManager9.Abilities
                                        where x.Id == this.AbilityId && x.Owner.CanUseAbilities && x.Owner.IsAlive
                                        select x).ToList <Ability9>();

            if (list.Count == 0 || list.All((Ability9 x) => x.Owner.Team == allyTeam))
            {
                return;
            }
            if (list.Any((Ability9 x) => x.Owner.IsVisible && x.Owner.Distance(position) < 1500f && x.TimeSinceCasted < 0.5f))
            {
                return;
            }
            List <Ability9> list2 = (from x in list
                                     where x.Owner.Team != allyTeam && !x.Owner.IsVisible && x.RemainingCooldown <= 0f
                                     select x).ToList <Ability9>();

            if (list2.Count == 0)
            {
                return;
            }
            if (list2.Count == 1)
            {
                Unit9           owner = list2[0].Owner;
                DrawableAbility item  = new DrawableAbility
                {
                    AbilityTexture     = base.AbilityId + "_rounded",
                    HeroTexture        = owner.Name + "_rounded",
                    MinimapHeroTexture = owner.Name + "_icon",
                    ShowUntil          = Game.RawGameTime + base.TimeToShow,
                    Position           = ((Game.RawGameTime - owner.LastVisibleTime < 0.5f) ? owner.InFront(list2[0].Range - 200f, 0f, true) : position.SetZ(new float?((float)350)))
                };
                drawableAbilities.Add(item);
                return;
            }
            Ability9 ability = list2.Find((Ability9 x) => x.Owner.Distance(position) < 100f && Game.RawGameTime - x.Owner.LastVisibleTime < 0.5f);
            Unit9    unit    = (ability != null) ? ability.Owner : null;

            if (unit != null)
            {
                DrawableAbility item2 = new DrawableAbility
                {
                    AbilityTexture     = base.AbilityId + "_rounded",
                    HeroTexture        = unit.Name + "_rounded",
                    MinimapHeroTexture = unit.Name + "_icon",
                    ShowUntil          = Game.RawGameTime + base.TimeToShow,
                    Position           = unit.InFront(list2[0].Range - 200f, 0f, true)
                };
                drawableAbilities.Add(item2);
                return;
            }
            SimpleDrawableAbility item3 = new SimpleDrawableAbility
            {
                AbilityTexture = base.AbilityId + "_rounded",
                ShowUntil      = Game.RawGameTime + base.TimeToShow,
                Position       = (base.RawParticlePosition ? particle.Position : particle.GetControlPoint(base.ControlPoint)).SetZ(new float?((float)350))
            };

            drawableAbilities.Add(item3);
        }