Example #1
0
        protected override void AddObstacle()
        {
            var obstacle = new LinearProjectileObstacle(this, this.Ability.Owner.Position)
            {
                EndCastTime     = this.EndCastTime,
                EndObstacleTime = this.EndCastTime + this.Ability.ActivationDelay + (this.RangedAbility.Range / this.RangedAbility.Speed)
            };

            this.Pathfinder.AddObstacle(obstacle);
        }
Example #2
0
        public void AddParticle(Particle particle, string name)
        {
            var time          = GameManager.RawGameTime - (GameManager.Ping / 2000);
            var startPosition = particle.GetControlPoint(0);
            var endPosition   = particle.GetControlPoint(1);

            var obstacle = new LinearProjectileObstacle(this, startPosition, endPosition)
            {
                EndCastTime     = time,
                EndObstacleTime = time + (this.RangedAbility.Range / this.RangedAbility.Speed)
            };

            this.Pathfinder.AddObstacle(obstacle);
        }
Example #3
0
        public void AddParticle(ParticleEffect particle, string name)
        {
            if (!this.Owner.IsVisible)
            {
                return;
            }

            var time = Game.RawGameTime - (Game.Ping / 2000);

            var obstacle = new LinearProjectileObstacle(this, this.Ability.Owner.Position)
            {
                EndCastTime     = time,
                EndObstacleTime = time + this.Ability.ActivationDelay + (this.RangedAbility.Range / this.RangedAbility.Speed)
            };

            this.Pathfinder.AddObstacle(obstacle);
        }
Example #4
0
        public void AddParticle(Particle particle, string name)
        {
            var time           = GameManager.RawGameTime - (GameManager.Ping / 2000);
            var casterPosition = particle.GetControlPoint(0);
            var landPosition   = particle.GetControlPoint(1);

            //todo improve evade timings
            var obstacle = new LinearProjectileObstacle(
                this,
                landPosition.Extend2D(casterPosition, this.RangedAbility.Radius / 2),
                casterPosition.Extend2D(landPosition, 2000))
            {
                EndCastTime     = time,
                EndObstacleTime = time + this.Ability.ActivationDelay + (this.RangedAbility.Range / this.RangedAbility.Speed)
            };

            this.Pathfinder.AddObstacle(obstacle);
        }
Example #5
0
        public void AddParticle(Particle particle, string name)
        {
            if (name.Contains("impact"))
            {
                this.Pathfinder.CancelObstacle(this.Ability.Handle);
                return;
            }

            if (this.Owner.IsVisible)
            {
                return;
            }

            var time = GameManager.RawGameTime - (GameManager.Ping / 2000);

            UpdateManager.BeginInvoke(

                () =>
            {
                try
                {
                    if (!particle.IsValid)
                    {
                        return;
                    }

                    var startPosition = particle.GetControlPoint(0);
                    var endPosition   = particle.GetControlPoint(1);

                    var obstacle = new LinearProjectileObstacle(this, startPosition, endPosition)
                    {
                        EndCastTime     = time,
                        EndObstacleTime = time + (this.RangedAbility.Range / this.RangedAbility.Speed)
                    };

                    this.Pathfinder.AddObstacle(obstacle);
                }
                catch (Exception e)
                {
                    Logger.Error(e);
                }
            });
        }
Example #6
0
        public void AddParticle(ParticleEffect particle, string name)
        {
            if (name.Contains("ground"))
            {
                this.Pathfinder.CancelObstacle(this.Ability.Handle, false, true);
                return;
            }

            var time = Game.RawGameTime - (Game.Ping / 2000);

            UpdateManager.BeginInvoke(
                () =>
            {
                try
                {
                    if (!particle.IsValid)
                    {
                        return;
                    }

                    var start     = particle.GetControlPoint(0);
                    var spirit    = particle.GetControlPoint(1);
                    var direction = spirit + start;

                    var obstacle = new LinearProjectileObstacle(this, start, direction)
                    {
                        EndCastTime     = time,
                        EndObstacleTime = time + (this.RangedAbility.Range / this.RangedAbility.Speed)
                    };

                    this.Pathfinder.AddObstacle(obstacle);
                }
                catch (Exception e)
                {
                    Logger.Error(e);
                }
            });
        }
Example #7
0
        public void AddParticle(Particle particle, string name)
        {
            var time = GameManager.RawGameTime - (GameManager.Ping / 2000);

            if (this.Owner.IsVisible)
            {
                var startPosition = this.Owner.Position;

                UpdateManager.BeginInvoke(
                    10,
                    () =>
                {
                    try
                    {
                        if (!particle.IsValid)
                        {
                            return;
                        }

                        var endPosition = particle.GetControlPoint(0);

                        var obstacle = new LinearProjectileObstacle(this, startPosition, endPosition)
                        {
                            EndCastTime     = time,
                            EndObstacleTime = time + (this.RangedAbility.Range / this.RangedAbility.Speed)
                        };

                        this.Pathfinder.AddObstacle(obstacle);
                    }
                    catch (Exception e)
                    {
                        Logger.Error(e);
                    }
                });
            }
            else
            {
                UpdateManager.BeginInvoke(
                    async() =>
                {
                    try
                    {
                        if (!particle.IsValid)
                        {
                            return;
                        }

                        var startPosition = particle.GetControlPoint(0);

                        await Task.Delay(50);

                        if (!particle.IsValid)
                        {
                            return;
                        }

                        var endPosition = particle.GetControlPoint(0);

                        var obstacle = new LinearProjectileObstacle(this, startPosition, endPosition)
                        {
                            EndCastTime     = time,
                            EndObstacleTime = time + (this.RangedAbility.Range / this.RangedAbility.Speed)
                        };

                        this.Pathfinder.AddObstacle(obstacle);
                    }
                    catch (Exception e)
                    {
                        Logger.Error(e);
                    }
                });
            }
        }