Esempio n. 1
0
 public override void Check()
 {
     if (particleAdded && !AbilityOwner.IsTurning())
     {
         StartPosition = AbilityOwner.NetworkPosition;
         EndPosition   = AbilityOwner.InFront(GetCastRange());
         EndCast       = StartCast + channelTime + GetCastRange() / GetProjectileSpeed();
         Obstacle      = Pathfinder.AddObstacle(StartPosition, EndPosition, GetRadius(), Obstacle);
         particleAdded = false;
     }
     else if (Obstacle != null && !Ability.IsChanneling && !channelFix)
     {
         var time = Game.RawGameTime;
         channelFix     = true;
         channelingTime = time - StartCast;
         EndCast        = time + GetCastRange() / GetProjectileSpeed();
     }
     else if (StartCast > 0 && Game.RawGameTime > EndCast)
     {
         End();
     }
     else if (Obstacle != null && !Ability.IsChanneling)
     {
         Pathfinder.UpdateObstacle(Obstacle.Value, GetProjectilePosition(), EndPosition);
     }
 }
Esempio n. 2
0
        public override void Check()
        {
            if (StartCast <= 0 && IsInPhase && AbilityOwner.IsVisible)
            {
                StartCast = Game.RawGameTime;
                EndCast   = StartCast + CastPoint + GetCastRange() / GetProjectileSpeed();
            }
            else if (StartCast > 0 && Obstacle == null && CanBeStopped() && !AbilityOwner.IsTurning())
            {
                var tree = ChainTreePosition(AbilityOwner.InFront(GetCastRange()));

                if (tree == null)
                {
                    return;
                }

                StartPosition   = AbilityOwner.NetworkPosition;
                EndPosition     = tree.Position;
                AdditionalDelay = EndPosition.Distance2D(StartPosition) / GetProjectileSpeed();
                EndCast         = StartCast + CastPoint + AdditionalDelay * 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());
            }
        }
Esempio n. 3
0
 public override void Check()
 {
     if (StartCast <= 0 && IsInPhase && AbilityOwner.IsVisible)
     {
         StartCast = Game.RawGameTime;
         EndCast   = StartCast + CastPoint + 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(), Obstacle);
     }
     else if (Obstacle == null && particleEffect != null && !particleAdded)
     {
         particleAdded = true;
         StartPosition = particleEffect.GetControlPoint(0);
         EndPosition   = StartPosition.Extend(particleEffect.GetControlPoint(1), GetCastRange() + GetRadius() / 2);
         StartCast     = Game.RawGameTime;
         EndCast       = StartCast + GetCastRange() / GetProjectileSpeed();
         Obstacle      = Pathfinder.AddObstacle(StartPosition, EndPosition, GetRadius(), Obstacle);
     }
     else if (StartCast > 0 && Game.RawGameTime > EndCast)
     {
         End();
     }
     else if (Obstacle != null && !CanBeStopped())
     {
         Pathfinder.UpdateObstacle(Obstacle.Value, GetProjectilePosition(), GetRadius(), GetEndRadius());
     }
 }
Esempio n. 4
0
        public override void Check()
        {
            if (fowCast && Obstacle == null)
            {
                if (!IsAbilityUnitValid() || !abilityUnit.IsVisible)
                {
                    return;
                }

                var position = StartPosition.Extend(abilityUnit.Position.SetZ(350), GetShipRange());

                if (position.Distance2D(StartPosition) < 50)
                {
                    return;
                }

                StartPosition = position.SetZ(350);
                Obstacle      = Pathfinder.AddObstacle(StartPosition, GetRadius(), Obstacle);
            }
            else if (StartCast <= 0 && IsInPhase && AbilityOwner.IsVisible)
            {
                StartCast = Game.RawGameTime;
                EndCast   = StartCast + CastPoint + GetDelay();
            }
            else if (StartCast > 0 && Obstacle == null && CanBeStopped() && !AbilityOwner.IsTurning())
            {
                StartPosition = AbilityOwner.InFront(castRange);
                Obstacle      = Pathfinder.AddObstacle(StartPosition, GetRadius(), Obstacle);
            }
            else if (StartCast > 0 && Game.RawGameTime > EndCast)
            {
                End();
            }
        }
Esempio n. 5
0
 public override void Check()
 {
     if (StartCast <= 0 && IsInPhase && AbilityOwner.IsVisible)
     {
         StartCast = Game.RawGameTime;
         EndCast   = StartCast + CastPoint + GetDuration();
     }
     else if (StartCast > 0 && Obstacle == null && CanBeStopped() && !AbilityOwner.IsTurning())
     {
         StartPosition = AbilityOwner.NetworkPosition;
         EndPosition   = AbilityOwner.InFront(GetCastRange() + 150);
         Obstacle      = Pathfinder.AddObstacle(StartPosition, EndPosition, GetRadius(), Obstacle);
     }
     else if (StartCast > 0 && Game.RawGameTime > EndCast && !IgnoreRemainingTime(null))
     {
         End();
     }
 }
Esempio n. 6
0
 public override void Check()
 {
     if (StartCast <= 0 && IsInPhase && AbilityOwner.IsVisible)
     {
         StartCast = Game.RawGameTime;
         EndCast   = StartCast + CastPoint + AdditionalDelay + GetDuration();
     }
     else if (StartCast > 0 && Obstacle == null && CanBeStopped() && !AbilityOwner.IsTurning())
     {
         StartPosition = AbilityOwner.InFront(-GetRadius() * 0.9f);
         EndPosition   = AbilityOwner.InFront(GetCastRange() + GetRadius() / 5);
         Obstacle      = Pathfinder.AddObstacle(StartPosition, EndPosition, GetRadius(), Obstacle);
     }
     else if (StartCast > 0 && Game.RawGameTime > EndCast)
     {
         End();
     }
 }
Esempio n. 7
0
 public override void Check()
 {
     if (StartCast <= 0 && IsInPhase && AbilityOwner.IsVisible)
     {
         StartCast = Game.RawGameTime;
         EndCast   = StartCast + CastPoint + channelTime;
     }
     else if (StartCast > 0 && Obstacle == null && CanBeStopped() && !AbilityOwner.IsTurning())
     {
         StartPosition = AbilityOwner.InFront(-GetRadius() * 0.9f);
         EndPosition   = AbilityOwner.InFront(GetCastRange() + GetRadius() * 0.8f);
         Obstacle      = Pathfinder.AddObstacle(StartPosition, EndPosition, GetRadius(), Obstacle);
     }
     else if (StartCast > 0 && (Game.RawGameTime > EndCast || !fowCast && !CanBeStopped() && !Ability.IsChanneling))
     {
         End();
     }
 }
Esempio n. 8
0
        public override void Check()
        {
            var time  = Game.RawGameTime;
            var phase = IsInPhase && AbilityOwner.IsVisible;

            if (phase && StartCast + CastPoint <= time && time > EndCast)
            {
                StartCast = time;
                EndCast   = StartCast + CastPoint + GetCastRange() / GetProjectileSpeed();
            }
            else if ((phase && Obstacle == null && !AbilityOwner.IsTurning()) || (fowCast && Obstacle == null))
            {
                if (fowCast && (!IsValidArrow() || !arrow.IsVisible))
                {
                    return;
                }

                if (fowCast)
                {
                    EndPosition = StartPosition.Extend(arrow.Position.SetZ(AbilityOwner.Position.Z), GetCastRange());

                    if (EndPosition.Distance2D(StartPosition) < 10)
                    {
                        return;
                    }
                }
                else
                {
                    StartPosition = AbilityOwner.NetworkPosition;
                    EndPosition   = AbilityOwner.InFront(GetCastRange() + GetRadius() / 2);
                }

                Obstacle = Pathfinder.AddObstacle(StartPosition, EndPosition, GetRadius(), Obstacle);
            }
            else if ((StartCast > 0 && time > EndCast) || (fowCast && !IsValidArrow()))
            {
                End();
            }
            else if (Obstacle != null && !phase)
            {
                Pathfinder.UpdateObstacle(Obstacle.Value, GetProjectilePosition(fowCast), GetRadius());
            }
        }
Esempio n. 9
0
 public override void Check()
 {
     if (StartCast <= 0 && IsInPhase && AbilityOwner.IsVisible &&
         !AbilityOwner.HasModifier("modifier_nyx_assassin_burrow"))
     {
         StartCast = Game.RawGameTime;
         EndCast   = StartCast + CastPoint + AdditionalDelay;
     }
     else if (StartCast > 0 && Obstacle == null && CanBeStopped() && !AbilityOwner.IsTurning())
     {
         StartPosition = AbilityOwner.NetworkPosition;
         EndPosition   = AbilityOwner.InFront(GetCastRange() + 150);
         Obstacle      = Pathfinder.AddObstacle(StartPosition, EndPosition, GetRadius(), Obstacle);
     }
     else if (StartCast > 0 && Game.RawGameTime > EndCast)
     {
         End();
     }
 }
Esempio n. 10
0
        public override void Check()
        {
            if (fowCast && Obstacle == null)
            {
                if (!IsAbilityUnitValid() || !abilityUnit.IsVisible)
                {
                    return;
                }

                var position = StartPosition.Extend(abilityUnit.Position.SetZ(350), GetCastRange());

                if (position.Distance2D(StartPosition) < 50)
                {
                    return;
                }

                EndPosition = position.SetZ(350);
                Obstacle    = Pathfinder.AddObstacle(StartPosition, EndPosition, GetRadius(), GetEndRadius(), Obstacle);
            }
            else if (StartCast <= 0 && IsInPhase && AbilityOwner.IsVisible)
            {
                StartCast = Game.RawGameTime;
                EndCast   = StartCast + CastPoint + 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 ||
                                       (Game.RawGameTime > StartCast + (fowCast ? 0 : CastPoint) + 0.1f &&
                                        !IsAbilityUnitValid())))
            {
                End();
            }
            else if (Obstacle != null && !IsInPhase)
            {
                Pathfinder.UpdateObstacle(Obstacle.Value, GetProjectilePosition(), GetRadius(), GetEndRadius());
            }
        }
Esempio n. 11
0
 public override void Check()
 {
     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 || waveModifier != null && !waveModifier.IsValid))
     {
         End();
     }
     else if (Obstacle != null && !CanBeStopped())
     {
         Pathfinder.UpdateObstacle(Obstacle.Value, GetProjectilePosition(), GetRadius(), GetEndRadius());
     }
 }
Esempio n. 12
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()));
                    }
                }
            }
        }