Example #1
0
 public override void Draw()
 {
     if (Obstacle != null)
     {
         AbilityDrawer.DrawTime(GetRemainingTime(), heroPosition);
     }
 }
Example #2
0
        public override void Check()
        {
            if (StartCast <= 0 && IsInPhase && AbilityOwner.IsVisible)
            {
                StartCast     = Game.RawGameTime;
                EndCast       = StartCast + CastPoint + GetCastRange() / GetProjectileSpeed();
                StartPosition = AbilityOwner.NetworkPosition;
                EndPosition   = AbilityOwner.InFront(GetCastRange());
                Obstacle      = Pathfinder.AddObstacle(StartPosition, EndPosition, GetRadius(), Obstacle);
            }
            else if (ProjectileTarget != null && Obstacle == null && !FowCast)
            {
                FowCast       = true;
                StartCast     = Game.RawGameTime;
                EndCast       = StartCast + GetCastRange() / GetProjectileSpeed();
                StartPosition = AbilityOwner.NetworkPosition;
                EndPosition   = StartPosition.Extend(ProjectileTarget.Position, GetCastRange());
                Obstacle      = Pathfinder.AddObstacle(StartPosition, EndPosition, GetRadius(), Obstacle);
            }
            else if (StartCast > 0 && Game.RawGameTime > EndCast)
            {
                End();
            }
            else if (Obstacle != null)
            {
                if (!ProjectileLaunched())
                {
                    EndPosition = AbilityOwner.InFront(GetCastRange());
                    Pathfinder.UpdateObstacle(Obstacle.Value, StartPosition, EndPosition);
                    AbilityDrawer.UpdateRectanglePosition(StartPosition, EndPosition, GetRadius());
                }
                else if (ProjectileTarget != null)
                {
                    var projectilePosition = GetProjectilePosition(FowCast);
                    if (projectilePosition == lastProjectilePosition)
                    {
                        End();
                        return;
                    }

                    lastProjectilePosition = projectilePosition;

                    AbilityDrawer.Dispose(AbilityDrawer.Type.Rectangle);
                    EndCast = Game.RawGameTime + (ProjectileTarget.Distance2D(projectilePosition) - 20)
                              / GetProjectileSpeed();

                    if (!obstacleToAOE)
                    {
                        Obstacle      = Pathfinder.AddObstacle(ProjectileTarget.Position, jumpRadius, Obstacle);
                        obstacleToAOE = true;
                    }
                    else
                    {
                        Pathfinder.UpdateObstacle(Obstacle.Value, ProjectileTarget.Position, jumpRadius);
                    }
                }
            }
        }
Example #3
0
        public override void Draw()
        {
            if (Obstacle == null)
            {
                return;
            }

            AbilityDrawer.DrawTime(GetRemainingTime(), AbilityOwner.Position);
        }
Example #4
0
        public override void Draw()
        {
            if (Obstacle == null)
            {
                return;
            }

            AbilityDrawer.DrawCircle(StartPosition, GetRadius());
            AbilityDrawer.UpdateCirclePosition(AbilityOwner.NetworkPosition);
        }
Example #5
0
        public override void Draw()
        {
            if (Obstacle == null)
            {
                return;
            }

            AbilityDrawer.DrawTime(GetRemainingTime(), AbilityOwner.Position);
            AbilityDrawer.DrawRectangle(StartPosition, EndPosition, GetRadius());
        }
Example #6
0
        public override void Draw()
        {
            if (Obstacle == null)
            {
                return;
            }

            AbilityDrawer.DrawTime(GetRemainingTime(), StartPosition);
            AbilityDrawer.DrawCircle(StartPosition, GetRadius());
        }
Example #7
0
        public override void End()
        {
            if (Obstacle != null)
            {
                Pathfinder.RemoveObstacle(Obstacle.Value);
            }

            AbilityDrawer.Dispose();
            Obstacle  = null;
            StartCast = 0;
            EndCast   = 0;
        }
Example #8
0
        public override void Draw()
        {
            if (Obstacle == null)
            {
                return;
            }

            AbilityDrawer.DrawTime(GetRemainingTime(), StartPosition);
            AbilityDrawer.DrawArcRectangle(StartPosition, EndPosition, GetRadius(), GetEndRadius());
            AbilityDrawer.DrawCircle(StartPosition, (GetRadius() + GetEndRadius()) / 2);

            AbilityDrawer.UpdateCirclePosition(GetProjectilePosition());
        }
Example #9
0
        public virtual void End()
        {
            if (Obstacle == null)
            {
                return;
            }

            AbilityDrawer.Dispose();
            Pathfinder.RemoveObstacle(Obstacle.Value);
            Obstacle  = null;
            StartCast = 0;
            EndCast   = 0;
        }
Example #10
0
        public override void Draw()
        {
            if (Obstacle == null)
            {
                return;
            }

            AbilityDrawer.DrawTime(GetRemainingTime(), StartPosition);

            if (!modifierAdded)
            {
                AbilityDrawer.DrawDoubleArcRectangle(StartPosition, EndPosition, GetRadius());
            }
        }
Example #11
0
        public override void Draw()
        {
            if (Obstacle == null)
            {
                return;
            }

            var position = AbilityOwner.NetworkPosition;

            AbilityDrawer.DrawTime(GetRemainingTime(), position);
            AbilityDrawer.DrawCircle(position, GetRadius());

            AbilityDrawer.UpdateCirclePosition(position);
        }
Example #12
0
        public override void Check()
        {
            if (ProjectileTarget != null && Obstacle == null && !FowCast)
            {
                FowCast       = true;
                StartCast     = Game.RawGameTime;
                EndCast       = StartCast + GetCastRange() / GetProjectileSpeed();
                StartPosition = AbilityOwner.NetworkPosition;
                EndPosition   = StartPosition.Extend(ProjectileTarget.Position, GetCastRange());
                Obstacle      = Pathfinder.AddObstacle(StartPosition, EndPosition, GetRadius(), Obstacle);
            }
            else if (StartCast > 0 && Game.RawGameTime > EndCast)
            {
                End();
            }
            else if (Obstacle != null)
            {
                if (!ProjectileLaunched())
                {
                    EndPosition = AbilityOwner.InFront(GetCastRange());
                    Pathfinder.UpdateObstacle(Obstacle.Value, StartPosition, EndPosition);
                    AbilityDrawer.UpdateRectaglePosition(StartPosition, EndPosition, GetRadius());
                }
                else if (ProjectileTarget != null)
                {
                    var projectilePosition = GetProjectilePosition(FowCast);

                    if (projectilePosition == LastProjectilePosition)
                    {
                        End();
                        return;
                    }

                    LastProjectilePosition = projectilePosition;

                    AbilityDrawer.Dispose(AbilityDrawer.Type.Rectangle);
                    //    EndCast = Game.RawGameTime + GetProjectilePosition(fowCast).Distance2D(projectileTarget) / GetProjectileSpeed();
                    EndPosition = StartPosition.Extend(
                        ProjectileTarget.Position,
                        ProjectileTarget.Distance2D(StartPosition) + GetRadius());
                    Pathfinder.UpdateObstacle(
                        Obstacle.Value,
                        ProjectileTarget.NetworkPosition.Extend(StartPosition, GetRadius()),
                        ProjectileTarget.NetworkPosition.Extend(EndPosition, GetRadius()));
                }
            }
        }
Example #13
0
        public void AddModifierObstacle(Modifier mod, Unit unit)
        {
            var position = unit.Position;

            modifierAdded = true;

            AbilityDrawer.Dispose(AbilityDrawer.Type.Rectangle);
            AbilityDrawer.DrawCircle(position, GetRadius());

            if (Obstacle == null)
            {
                StartCast = Game.RawGameTime;
                EndCast   = StartCast + AdditionalDelay;
                fowCast   = true;
            }

            Obstacle = Pathfinder.AddObstacle(position, GetRadius(), Obstacle);
        }
Example #14
0
 public override void Check()
 {
     if (StartCast <= 0 && IsInPhase && AbilityOwner.IsVisible)
     {
         StartCast     = Game.RawGameTime;
         EndCast       = StartCast + CastPoint + AdditionalDelay;
         StartPosition = AbilityOwner.NetworkPosition;
         EndPosition   = AbilityOwner.InFront(GetCastRange() + 150);
         Obstacle      = Pathfinder.AddObstacle(StartPosition, EndPosition, GetRadius(), Obstacle);
     }
     else if (StartCast > 0 && Obstacle != null && CanBeStopped())
     {
         EndPosition = AbilityOwner.InFront(GetCastRange());
         Pathfinder.UpdateObstacle(Obstacle.Value, StartPosition, EndPosition);
         AbilityDrawer.UpdateRectanglePosition(StartPosition, EndPosition, GetRadius());
     }
     else if (StartCast > 0 && Game.RawGameTime > EndCast)
     {
         End();
     }
 }
Example #15
0
        public override void Check()
        {
            if (AbilityOwner.AghanimState())
            {
                if (StartCast <= 0 && IsInPhase && AbilityOwner.IsVisible)
                {
                    StartCast = Game.RawGameTime;
                    EndCast   = StartCast + CastPoint + AdditionalDelay + GetCastRange() / GetProjectileSpeed();
                }
                else if (StartCast > 0 && Obstacle == null && CanBeStopped() && !AbilityOwner.IsTurning())
                {
                    StartPosition = AbilityOwner.NetworkPosition;
                    EndPosition   = AbilityOwner.InFront(GetCastRange() + GetRadius() / 2);
                    Obstacle      = Pathfinder.AddObstacle(
                        StartPosition,
                        EndPosition,
                        GetRadius(),
                        GetEndRadius(),
                        Obstacle);
                }
                else if (StartCast > 0 && Game.RawGameTime > EndCast)
                {
                    End();
                }
                else if (Obstacle != null && !CanBeStopped())
                {
                    Pathfinder.UpdateObstacle(Obstacle.Value, GetProjectilePosition(), GetRadius(), GetEndRadius());
                }
            }
            else
            {
                if (StartCast <= 0 && IsInPhase && AbilityOwner.IsVisible)
                {
                    StartCast     = Game.RawGameTime;
                    EndCast       = StartCast + CastPoint + GetCastRange() / GetProjectileSpeed();
                    StartPosition = AbilityOwner.NetworkPosition;
                    EndPosition   = AbilityOwner.InFront(GetCastRange());
                    Obstacle      = Pathfinder.AddObstacle(StartPosition, EndPosition, GetRadius(), Obstacle);
                }
                else if (ProjectileTarget != null && Obstacle == null && !FowCast)
                {
                    FowCast       = true;
                    StartCast     = Game.RawGameTime;
                    EndCast       = StartCast + GetCastRange() / GetProjectileSpeed();
                    StartPosition = AbilityOwner.NetworkPosition;
                    EndPosition   = StartPosition.Extend(ProjectileTarget.Position, GetCastRange());
                    Obstacle      = Pathfinder.AddObstacle(StartPosition, EndPosition, GetRadius(), Obstacle);
                }
                else if (StartCast > 0 && Game.RawGameTime > EndCast)
                {
                    End();
                }
                else if (Obstacle != null)
                {
                    if (!ProjectileLaunched())
                    {
                        EndPosition = AbilityOwner.InFront(GetCastRange());
                        Pathfinder.UpdateObstacle(Obstacle.Value, StartPosition, EndPosition);
                        AbilityDrawer.UpdateRectanglePosition(StartPosition, EndPosition, GetRadius());
                    }
                    else if (ProjectileTarget != null)
                    {
                        var projectilePosition = GetProjectilePosition(FowCast);

                        if (projectilePosition == LastProjectilePosition)
                        {
                            End();
                            return;
                        }

                        LastProjectilePosition = projectilePosition;

                        AbilityDrawer.Dispose(AbilityDrawer.Type.Rectangle);
                        //    EndCast = Game.RawGameTime + GetProjectilePosition(fowCast).Distance2D(projectileTarget) / GetProjectileSpeed();
                        EndPosition = StartPosition.Extend(
                            ProjectileTarget.Position,
                            ProjectileTarget.Distance2D(StartPosition) + GetRadius());
                        Pathfinder.UpdateObstacle(
                            Obstacle.Value,
                            ProjectileTarget.NetworkPosition.Extend(StartPosition, GetRadius()),
                            ProjectileTarget.NetworkPosition.Extend(EndPosition, GetRadius()));
                    }
                }
            }
        }