// Token: 0x0600030D RID: 781 RVA: 0x0001B590 File Offset: 0x00019790
        public override void AddDrawableAbility(List <IDrawableAbility> drawableAbilities, ParticleEffect particle, Team allyTeam, INotificator notificator)
        {
            if (particle.Name.Contains("dash"))
            {
                drawableAbilities.RemoveAll((IDrawableAbility x) => x is DrawableFireRemnantAbility);
                return;
            }
            Unit9 unit = EntityManager9.GetUnit(particle.Owner.Owner.Handle);

            if (unit == null)
            {
                return;
            }
            Vector3 startPosition = particle.GetControlPoint(this.StartControlPoint);

            if (!unit.IsVisible)
            {
                DrawableAbility item = new DrawableAbility
                {
                    AbilityTexture     = base.AbilityId + "_rounded",
                    HeroTexture        = unit.Name + "_rounded",
                    MinimapHeroTexture = unit.Name + "_icon",
                    ShowUntil          = Game.RawGameTime + base.TimeToShow,
                    Position           = startPosition.SetZ(new float?((float)350))
                };
                drawableAbilities.Add(item);
            }
            DrawableFireRemnantAbility[] remnants = drawableAbilities.OfType <DrawableFireRemnantAbility>().ToArray <DrawableFireRemnantAbility>();
            Unit unit2 = ObjectManager.GetEntitiesFast <Unit>().Concat(ObjectManager.GetDormantEntities <Unit>()).FirstOrDefault((Unit x) => x.IsAlive && x.Name == "npc_dota_ember_spirit_remnant" && x.Distance2D(startPosition) < 1500f && remnants.All((DrawableFireRemnantAbility z) => z.Unit != x));

            if (unit2 == null)
            {
                return;
            }
            DrawableFireRemnantAbility item2 = new DrawableFireRemnantAbility
            {
                AbilityTexture     = base.AbilityId + "_rounded",
                HeroTexture        = unit.Name + "_rounded",
                MinimapHeroTexture = unit.Name + "_icon",
                Position           = particle.GetControlPoint(base.ControlPoint).SetZ(new float?((float)350)),
                Duration           = base.Duration,
                ShowUntil          = Game.RawGameTime + base.Duration,
                ShowHeroUntil      = Game.RawGameTime + base.TimeToShow,
                Owner = unit.BaseEntity,
                Unit  = unit2
            };

            drawableAbilities.Add(item2);
        }
Exemplo n.º 2
0
        public override void AddDrawableAbility(
            List <IDrawableAbility> drawableAbilities,
            Particle particle,
            Team allyTeam,
            INotificator notificator)
        {
            if (particle.Name.Contains("dash"))
            {
                drawableAbilities.RemoveAll(x => x is DrawableFireRemnantAbility);
            }
            else
            {
                var owner = EntityManager9.GetUnit(particle.Owner.Owner.Handle);
                if (owner == null)
                {
                    return;
                }

                var startPosition = particle.GetControlPoint(this.StartControlPoint);

                if (!owner.IsVisible)
                {
                    var drawableAbilityStart = new DrawableAbility
                    {
                        AbilityTexture     = this.AbilityId.ToString(),
                        HeroTexture        = owner.Name,
                        MinimapHeroTexture = owner.Name,
                        ShowUntil          = GameManager.RawGameTime + this.TimeToShow,
                        Position           = startPosition.SetZ(350)
                    };

                    owner.ChangeBasePosition(drawableAbilityStart.Position);
                    drawableAbilities.Add(drawableAbilityStart);
                }

                var remnants = drawableAbilities.OfType <DrawableFireRemnantAbility>().ToArray();
                var unit     = EntityManager.GetEntities <Unit>()
                               .FirstOrDefault(
                    x => x.IsAlive && x.Name == "npc_dota_ember_spirit_remnant" && x.Distance2D(startPosition) < 1500 &&
                    remnants.All(z => z.Unit != x));

                if (unit == null)
                {
                    return;
                }

                var drawableAbility = new DrawableFireRemnantAbility
                {
                    AbilityTexture     = this.AbilityId.ToString(),
                    HeroTexture        = owner.Name,
                    MinimapHeroTexture = owner.Name,
                    Position           = particle.GetControlPoint(this.ControlPoint).SetZ(350),
                    Duration           = this.Duration,
                    ShowUntil          = GameManager.RawGameTime + this.Duration,
                    ShowHeroUntil      = GameManager.RawGameTime + this.TimeToShow,
                    Owner = owner.BaseEntity,
                    Unit  = unit
                };

                drawableAbilities.Add(drawableAbility);
            }
        }