示例#1
0
 public void AddEffect(Hero x)
 {
     if (GetId == 0)
     {
         Particle.AddOrUpdate(x, "showIllusion" + x.Handle, ShowIllusionList[GetId], ParticleAttachment.AbsOrigin);
     }
     else
     {
         var size = new Vector3(IllusionSize, ClrA, 0);
         Particle.AddOrUpdate(x, "showIllusion" + x.Handle, ShowIllusionList[GetId], ParticleAttachment.AbsOrigin,
                              RestartType.FullRestart,
                              1, size, 2, GetColor);
     }
 }
示例#2
0
文件: Slark.cs 项目: beminee/BAIO
        private void OnPounce()
        {
            if (Pounce.Level <= 0)
            {
                return;
            }

            if (DrawPouncePosition == true)
            {
                var          pounceCastPos = UnitExtensions.InFront(Owner, PounceDistance + PounceRadius);
                var          red           = new Vector3(255, 0, 0);
                var          green         = new Vector3(0, 255, 0);
                const string file          = "materials/ensage_ui/particles/rectangle.vpcf";
                particle.AddOrUpdate(Owner, $"DrawLine_{1}", file, ParticleAttachment.AbsOrigin, RestartType.None, 1, this.Owner.InFront(0), 2, pounceCastPos,
                                     3, new Vector3(95, 100, 0), 4, red);

                var targets = EntityManager <Hero> .Entities.FirstOrDefault(
                    x => x.IsAlive && x.Team != this.Owner.Team &&
                    x.Distance2D(this.Owner) < 1500 && !x.IsIllusion);

                if (targets != null && AbilityExtensions.CanBeCasted(this.Pounce) && this.Pounce != null &&
                    !UnitExtensions.IsMagicImmune(targets) && !targets.IsInvulnerable())
                {
                    var vectorOfMovement = new Vector2((float)Math.Cos(targets.RotationRad) * targets.MovementSpeed, (float)Math.Sin(targets.RotationRad) * targets.MovementSpeed);
                    var hitPosition      = Intercepts(targets.Position, vectorOfMovement, this.Owner.Position, 933.33f);
                    var hitPosMod        = hitPosition + new Vector3(vectorOfMovement.X * (TimeToTurn(this.Owner, hitPosition)), vectorOfMovement.Y * (TimeToTurn(this.Owner, hitPosition)), 0);
                    var hitPosMod2       = hitPosition + new Vector3(vectorOfMovement.X * (TimeToTurn(this.Owner, hitPosMod)), vectorOfMovement.Y * (TimeToTurn(this.Owner, hitPosMod)), 0);

                    if (this.Owner.Distance2D(hitPosMod2) > ((PounceDistance + PounceRadius) + targets.HullRadius))
                    {
                        return;
                    }

                    if (IsFacing(this.Owner, targets))
                    {
                        particle.AddOrUpdate(Owner, $"DrawLine_{1}", file, ParticleAttachment.AbsOrigin, RestartType.None, 1, this.Owner.InFront(0), 2, pounceCastPos,
                                             3, new Vector3(95, 100, 0), 4, green);
                    }
                }
            }
            else
            {
                particle.Remove($"DrawLine_{1}");
            }
        }
示例#3
0
文件: Nevermore.cs 项目: beminee/BAIO
        private void OnUpdate()
        {
            if (RazeShort.Level <= 0)
            {
                return;
            }

            Razes = new List <Ability> {
                RazeShort, RazeMedium, RazeLong
            };

            if (DrawRazeRange == true)
            {
                var raze1 = UnitExtensions.InFront(Owner, this.RazeShort.GetAbilitySpecialData("shadowraze_range"));
                var raze2 = UnitExtensions.InFront(Owner, this.RazeMedium.GetAbilitySpecialData("shadowraze_range"));
                var raze3 = UnitExtensions.InFront(Owner, this.RazeLong.GetAbilitySpecialData("shadowraze_range"));

                var file = "materials/ensage_ui/particles/alert_range.vpcf";
                Particle.AddOrUpdate(Owner, $"DrawRange_{1}", file, ParticleAttachment.AbsOrigin, RestartType.None, 0,
                                     raze1,
                                     1, new Vector3(255, 0, 0), 2, new Vector3(200, 255, 40));
                Particle.AddOrUpdate(Owner, $"DrawRange_{2}", file, ParticleAttachment.AbsOrigin, RestartType.None, 0,
                                     raze2,
                                     1, new Vector3(255, 0, 0), 2, new Vector3(200, 255, 40));
                Particle.AddOrUpdate(Owner, $"DrawRange_{3}", file, ParticleAttachment.AbsOrigin, RestartType.None, 0,
                                     raze3,
                                     1, new Vector3(255, 0, 0), 2, new Vector3(200, 255, 40));

                var targets = EntityManager <Hero> .Entities.FirstOrDefault(
                    x => x.IsAlive && x.Team != this.Owner.Team &&
                    x.Distance2D(this.Owner) < 1500 && !x.IsIllusion);


                if (targets != null && this.RazeShort.CanBeCasted() && !UnitExtensions.IsMagicImmune(targets) && !targets.IsInvulnerable() &&
                    CanHit(this.RazeShort, targets, GetRazeDelay(targets, RazeShort), true))
                {
                    Particle.AddOrUpdate(Owner, $"DrawRange_{1}", file, ParticleAttachment.AbsOrigin, RestartType.None,
                                         0,
                                         raze1, 1, new Vector3(0, 255, 0), 2, new Vector3(200, 255, 40));
                }

                if (targets != null && this.RazeMedium.CanBeCasted() && !UnitExtensions.IsMagicImmune(targets) && !targets.IsInvulnerable() &&
                    CanHit(this.RazeMedium, targets, GetRazeDelay(targets, RazeMedium), true))
                {
                    Particle.AddOrUpdate(Owner, $"DrawRange_{2}", file, ParticleAttachment.AbsOrigin, RestartType.None,
                                         0,
                                         raze2, 1, new Vector3(0, 255, 0), 2, new Vector3(200, 255, 40));
                }

                if (targets != null && this.RazeLong.CanBeCasted() && !UnitExtensions.IsMagicImmune(targets) && !targets.IsInvulnerable() &&
                    CanHit(this.RazeLong, targets, GetRazeDelay(targets, RazeLong), true))
                {
                    Particle.AddOrUpdate(Owner, $"DrawRange_{3}", file, ParticleAttachment.AbsOrigin, RestartType.None,
                                         0,
                                         raze3, 1, new Vector3(0, 255, 0), 2, new Vector3(200, 255, 40));
                }
            }
            else
            {
                Particle.Remove($"DrawRange_{1}");
                Particle.Remove($"DrawRange_{2}");
                Particle.Remove($"DrawRange_{3}");
            }
        }