コード例 #1
0
ファイル: Mode.cs プロジェクト: tyljeff9408/EnsageSharp-1
        private void OnUpdate()
        {
            if (TargetSelector.IsActive)
            {
                OffTarget = TargetSelector.Active.GetTargets().FirstOrDefault();
                Context.Particle.Remove("Text");
            }
            else
            {
                /*Context.Particle.AddOrUpdate(
                 *  Owner,
                 *  "Text",
                 *  "materials/ensage_ui/particles/text.vpcf",
                 *  ParticleAttachment.AbsOrigin,
                 *  RestartType.None,
                 *  0,
                 *  Owner.Position - new Vector3(0, 200, 0),
                 *  1,
                 *  new Vector3(121, 8611111, 231651),
                 *  2,
                 *  new Vector3(111, 1111121, 115111),
                 *  3,
                 *  new Vector3(113, 1151114, 111111),
                 *  4,
                 *  new Vector3(111, 1111111, 111118),
                 *  5,
                 *  new Vector3(111, 1111511, 111111),
                 *  6,
                 *  new Vector3(111, 1111111, 111111),
                 *  7,
                 *  new Vector3(511, 1111111, 111111),
                 *  10,
                 *  new Vector3(50, 16, 0),
                 *  11,
                 *  new Vector3(255, 0, 0));*/
            }

            var Targets =
                EntityManager <Hero> .Entities.OrderBy(x => x == OffTarget).Where(
                    x => x.IsValid && x.IsVisible && x.Team != Owner.Team && !x.IsIllusion).ToList();

            if (OffTarget != null)
            {
                var Input =
                    new PredictionInput(
                        Owner,
                        OffTarget,
                        1,
                        float.MaxValue,
                        2000,
                        420,
                        PredictionSkillshotType.SkillshotCircle,
                        true,
                        Targets)
                {
                    CollisionTypes = CollisionTypes.None
                };

                Output = Prediction.GetPrediction(Input);
            }

            if (OffTarget != null &&
                OffTarget.Distance2D(Output.CastPosition) <= 1000 && Output.AoeTargetsHit.Count >= (Config.AmountItem.Value == 1 ? 0 : Config.AmountItem.Value))
            {
                Context.Particle.AddOrUpdate(
                    Owner,
                    "BlackHoleRadius",
                    "particles/ui_mouseactions/drag_selected_ring.vpcf",
                    ParticleAttachment.AbsOrigin,
                    RestartType.None,
                    0,
                    Output.CastPosition,
                    1,
                    Color.Aqua,
                    2,
                    420 * 1.1f);
            }
            else
            {
                Context.Particle.Remove("BlackHoleRadius");
            }

            Lens = Owner.GetItemById(AbilityId.item_aether_lens);

            if (Blink != null && Config.ComboRadiusItem.Value)
            {
                Context.Particle.DrawRange(
                    Owner,
                    "ComboRadius",
                    Blink.CastRange + (Lens != null ? Lens.GetCastRange() : 0),
                    Color.Aqua);
            }
            else
            {
                Context.Particle.Remove("ComboRadius");
            }

            if (Target != null || OffTarget != null)
            {
                Context.Particle.DrawTargetLine(
                    Owner,
                    "Target",
                    Target != null ? Target.Position : (Output != null && Output.AoeTargetsHit.Count
                                                        >= (Config.AmountItem.Value == 1 ? 0 : Config.AmountItem.Value))
                    ? Output.CastPosition : OffTarget.Position,
                    Target != null ? Color.Red : Color.Aqua);
            }
            else
            {
                Context.Particle.Remove("Target");
            }

            if (!CanExecute && Target != null)
            {
                Target = null;
            }
        }
コード例 #2
0
ファイル: Mode.cs プロジェクト: tyljeff9408/EnsageSharp-1
        public override async Task ExecuteAsync(CancellationToken token)
        {
            if (TargetSelector.IsActive)
            {
                Target = TargetSelector.Active.GetTargets().FirstOrDefault();
            }

            if (Target != null)
            {
                if (Output.Unit != null && Output.AoeTargetsHit.Count >= (Config.AmountItem.Value == 1 ? 0 : Config.AmountItem.Value) &&
                    (BlackHole == null || !BlackHole.Ability.IsChanneling))
                {
                    Elsecount = 0;

                    // Blink
                    if (Blink != null &&
                        BlackHole != null &&
                        BlackHole.IsReady &&
                        Owner.Distance2D(Output.CastPosition) <= Blink.CastRange
                        + (Lens != null ? Lens.GetCastRange() : 0) &&
                        Config.ItemsToggler.Value.IsEnabled(Blink.Item.Name) &&
                        Blink.CanBeCasted &&
                        Owner.Distance2D(Output.CastPosition) >= 400)
                    {
                        Blink.UseAbility(Output.CastPosition);
                        await Await.Delay(Blink.GetCastDelay(Target.Position), token);
                    }

                    if (Blink == null || !Blink.CanBeCasted || !Config.ItemsToggler.Value.IsEnabled(Blink.Item.Name) || Owner.Distance2D(Output.CastPosition) <= 400)
                    {
                        UseItem(token);
                    }

                    // BlackHole
                    if (BlackHole != null &&
                        Config.AbilityToggler.Value.IsEnabled(BlackHole.Ability.Name) &&
                        BlackHole.CanBeCasted &&
                        Elsecount == 6)
                    {
                        BlackHole.UseAbility(Output.CastPosition);
                        await Await.Delay(BlackHole.GetCastDelay(Output.CastPosition), token);
                    }
                    else
                    {
                        Elsecount += 1;
                    }

                    // Refresher
                    if (Refresher != null &&
                        Config.ItemsToggler.Value.IsEnabled(Refresher.Item.Name) &&
                        Refresher.CanBeCasted &&
                        BlackHole != null && !BlackHole.CanBeCasted && !BlackHole.Ability.IsChanneling &&
                        Elsecount == 7)
                    {
                        Refresher.UseAbility();
                        await Await.Delay(Refresher.GetCastDelay(), token);
                    }
                }

                if (Target.IsAttackImmune() || Target.IsInvulnerable() && (BlackHole == null || !BlackHole.Ability.IsChanneling))
                {
                    Orbwalker.Move(Game.MousePosition);
                }
                else if (BlackHole == null || !BlackHole.Ability.IsChanneling)
                {
                    Orbwalker.OrbwalkTo(Target);
                }
            }
            else if (BlackHole == null || !BlackHole.Ability.IsChanneling)
            {
                Orbwalker.Move(Game.MousePosition);
            }
        }