当前位置: 首页>>代码示例>>C#>>正文


C# Hero.FindAngleBetween方法代码示例

本文整理汇总了C#中Hero.FindAngleBetween方法的典型用法代码示例。如果您正苦于以下问题:C# Hero.FindAngleBetween方法的具体用法?C# Hero.FindAngleBetween怎么用?C# Hero.FindAngleBetween使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Hero的用法示例。


在下文中一共展示了Hero.FindAngleBetween方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CastIceWall

 private static void CastIceWall(Hero me, Hero target, bool b, Ability icewall)
 {
     if (!b)
     {
         if (!me.CanMove() || !Utils.SleepCheck("icewallmove")) return;
         var angle = me.FindAngleBetween(target.Position, true);
         var point =
             new Vector3(
                 (float)(target.Position.X -
                          200 *
                          Math.Cos(angle)),
                 (float)(target.Position.Y -
                          200 *
                          Math.Sin(angle)), 0);
         me.Move(point);
         Utils.Sleep(300, "icewallmove");
     }
     else
     {
         icewall.UseAbility();
         _stage++;
         Utils.Sleep(250, "StageCheck");
     }
 }
开发者ID:LimbViolencer,项目名称:EnsageSharp-1,代码行数:24,代码来源:Program.cs

示例2: Game_OnUpdate

        private static void Game_OnUpdate(EventArgs args)
        {
            me = ObjectManager.LocalHero;

            if (!Game.IsInGame || Game.IsWatchingGame || me==null || me.ClassID != ClassID.CDOTA_Unit_Hero_EmberSpirit) return;
            Active = Game.IsKeyDown(Menu.Item("keyBind").GetValue<KeyBind>().Key);

            Push = Game.IsKeyDown(Menu.Item("keyEscape").GetValue<KeyBind>().Key);
            wKey = Game.IsKeyDown(Menu.Item("wKey").GetValue<KeyBind>().Key);
            oneULT = Menu.Item("oneult").IsActive();
            if (!Menu.Item("enabled").IsActive())
                return;

            e = me.ClosestToMouseTarget(1800);
            if (Push)
            {
                Unit fount = ObjectManager.GetEntities<Unit>().FirstOrDefault(x => x.Team == me.Team && x.ClassID == ClassID.CDOTA_Unit_Fountain);
                var remnant = ObjectManager.GetEntities<Unit>().Where(unit => unit.IsValid && unit.IsAlive && unit.Team == me.Team && unit.Name == "npc_dota_ember_spirit_remnant").ToList();

                if (fount != null)
                {
                    float angle = me.FindAngleBetween(fount.Position, true);
                    Vector3 pos = new Vector3((float)(me.Position.X + R.GetCastRange() * Math.Cos(angle)),
                        (float)(me.Position.Y + R.GetCastRange() * Math.Sin(angle)), 0);

                    if (remnant.Count(x => x.Distance2D(me) <= 10000) == 0)
                    {
                        if (R != null && R.CanBeCasted()
                            && me.FindModifier("modifier_ember_spirit_fire_remnant_charge_counter").StackCount >= 1
                            && Utils.SleepCheck("z"))
                        {
                            R.UseAbility(pos);
                            Utils.Sleep(1000, "z");
                        }
                    }
                    if (remnant.Count(x => x.Distance2D(me) <= 10000) > 0)
                    {
                        if (D != null && D.CanBeCasted())
                        {
                            for (int i = 0; i < remnant.Count; ++i)
                            {
                                var kill =
                                    remnant[i].Modifiers.Where(y => y.Name == "modifier_ember_spirit_fire_remnant_thinker")
                                        .DefaultIfEmpty(null)
                                        .FirstOrDefault();

                                if (kill != null
                                    && kill.RemainingTime < 44
                                    && Utils.SleepCheck("Rem"))
                                {
                                    D.UseAbility(fount.Position);
                                    Utils.Sleep(300, "Rem");
                                }
                            }
                        }
                    }
                }
            }

            Q = me.Spellbook.SpellQ;

            W = me.Spellbook.SpellW;

            E = me.Spellbook.SpellE;

            R = me.Spellbook.SpellR;

            D = me.Spellbook.SpellD;

            ethereal = me.FindItem("item_ethereal_blade");
            mom = me.FindItem("item_mask_of_madness");
            urn = me.FindItem("item_urn_of_shadows");
            dagon =
                me.Inventory.Items.FirstOrDefault(
                    item =>
                        item.Name.Contains("item_dagon"));
            halberd = me.FindItem("item_heavens_halberd");
            mjollnir = me.FindItem("item_mjollnir");
            orchid = me.FindItem("item_orchid") ?? me.FindItem("item_bloodthorn");
            abyssal = me.FindItem("item_abyssal_blade");
            mail = me.FindItem("item_blade_mail");
            bkb = me.FindItem("item_black_king_bar");
            satanic = me.FindItem("item_satanic");
            blink = me.FindItem("item_blink");
            medall = me.FindItem("item_medallion_of_courage") ?? me.FindItem("item_solar_crest");
            if (e == null) return;
            sheep = e.ClassID == ClassID.CDOTA_Unit_Hero_Tidehunter ? null : me.FindItem("item_sheepstick");
            vail = me.FindItem("item_veil_of_discord");
            cheese = me.FindItem("item_cheese");
            ghost = me.FindItem("item_ghost");
            atos = me.FindItem("item_rod_of_atos");
            soul = me.FindItem("item_soul_ring");
            arcane = me.FindItem("item_arcane_boots");
            stick = me.FindItem("item_magic_stick") ?? me.FindItem("item_magic_wand");
            Shiva = me.FindItem("item_shivas_guard");

            var stoneModif = e.Modifiers.Any(y => y.Name == "modifier_medusa_stone_gaze_stone");

            var v =
                ObjectManager.GetEntities<Hero>()
//.........这里部分代码省略.........
开发者ID:VickTheRock,项目名称:ReworkAllScripts,代码行数:101,代码来源:Program.cs

示例3: DoCombo

        private static void DoCombo(Hero me, Hero target)
        {
            var darkPact = me.Spellbook.SpellQ;
            var pounce = me.Spellbook.SpellW;
            var shadowDance = me.Spellbook.SpellR;
            var distance = me.Distance2D(target);

            var inSb = me.Modifiers.Any(x => x.Name == "modifier_item_silver_edge_windwalk" || x.Name == "modifier_item_invisibility_edge_windwalk");
            if (inSb)
            {
                if (!Utils.SleepCheck("attacking")) return;
                me.Attack(target);
                Utils.Sleep(200, "attacking");
                return;
            }
            if (Utils.SleepCheck("items"))
            {
                /*foreach (var item in me.Inventory.Items)
                {
                    Game.PrintMessage(item.Name+": "+item.AbilityBehavior,MessageType.ChatMessage);
                }*/
                var items =
                    me.Inventory.Items.Where(
                        x =>
                            Items.Contains(x.Name) && x.CanBeCasted() && Menu.Item("Items").GetValue<AbilityToggler>().IsEnabled(x.Name) &&
                            (x.CastRange==0 || x.CastRange >= distance) && Utils.SleepCheck(x.Name)).ToList();
                foreach (var item in items)
                {
                    switch (item.ClassID)
                    {
                        case ClassID.CDOTA_Item_BlinkDagger:
                            var p = Prediction.InFront(target, 100);
                            var dist = me.Distance2D(p);
                            if (dist <= 1150 && dist >= 400 && pounce != null && pounce.CanBeCasted())
                            {
                                item.UseAbility(p);
                                Utils.Sleep(200, item.Name);
                            }
                            break;
                        default:
                            if (item.IsAbilityBehavior(AbilityBehavior.UnitTarget))
                            {
                                if (!target.IsStunned() && !target.IsHexed())
                                {
                                    item.UseAbility(target);
                                }
                                item.UseAbility(me);
                            }
                            else
                            {
                                item.UseAbility();
                            }
                            Utils.Sleep(200, item.Name);
                            break;
                    }
                }
            }

            if (Utils.SleepCheck("dp") && darkPact != null && darkPact.CanBeCasted() && darkPact.CanHit(target))
            {
                darkPact.UseAbility();
                Utils.Sleep(100, "dp");
            }
            var angle = (float) Math.Max(
                Math.Abs(me.RotationRad - Utils.DegreeToRadian(me.FindAngleBetween(target.Position))) - 0.20, 0);
            if (Utils.SleepCheck("pounce") && pounce != null && pounce.CanBeCasted() && distance <= 300 && angle == 0)
            {
                pounce.UseAbility();
                Utils.Sleep(100, "pounce");
            }

            if (me.Health <= me.MaximumHealth / 100 * Menu.Item("minHp").GetValue<Slider>().Value && Utils.SleepCheck("dance") && shadowDance != null && shadowDance.CanBeCasted())
            {
                shadowDance.UseAbility();
                Utils.Sleep(100, "dance");
            }

            if (!Utils.SleepCheck("attacking")) return;
            me.Attack(target);
            Utils.Sleep(200, "attacking");
        }
开发者ID:dendimonster,项目名称:EnsageSharp-1,代码行数:81,代码来源:Program.cs

示例4: ComboInAction

        private static void ComboInAction(Hero me, Hero target)
        {
            if (!Utils.SleepCheck("nextAction")) return;
            var duel = me.Spellbook.Spell4;

            if (duel==null) return;
            if (!duel.CanBeCasted(target)) return;

            //var steal = me.Spellbook.Spell1;
            var heal = me.Spellbook.Spell2;

            var dagger = me.FindItem("item_blink");
            var neededMana = me.Mana-duel.ManaCost;

            var allitems = me.Inventory.Items.Where(x => x.CanBeCasted() && x.ManaCost <= neededMana);
            var dpActivated =
                target.Modifiers.Any(
                    x => x.Name == "modifier_slark_dark_pact" || x.Name == "modifier_slark_dark_pact_pulses");
            var enumerable = allitems as Item[] ?? allitems.ToArray();
            var itemOnTarget =
                enumerable.FirstOrDefault(
                    x =>
                        x.Name == "item_abyssal_blade" || x.Name == "item_orchid" ||
                        x.Name == "item_heavens_halberd" || x.Name == "item_sheepstick" ||
                        x.Name == "item_urn_of_shadows" || x.Name == "item_medallion_of_courage" ||
                        x.Name == "item_solar_crest");
            var itemWithOutTarget = enumerable.FirstOrDefault(
                    x =>
                        x.Name == "item_soul_ring" || (x.Name == "item_armlet" && !x.IsToggled) ||
                        x.Name == "item_mask_of_madness" || x.Name == "item_satanic" ||
                        x.Name == "item_blade_mail");
            var itemOnMySelf = enumerable.FirstOrDefault(
                x =>
                    x.Name == "item_mjollnir");
            Item bkb = null;
            if (_shoulUseBkb)
            {
                bkb = me.FindItem("item_black_king_bar");
            }
            var distance = me.Distance2D(target);
            if (distance >= 1150)
            {
                me.Move(target.Position);
                Utils.Sleep(200, "nextAction");
                return;
            }
            if (itemOnMySelf != null && _buffme)
            {
                itemOnMySelf.UseAbility(me);
                Utils.Sleep(50, "nextAction");
                return;
            }
            if (itemWithOutTarget != null && _buffme)
            {
                if (itemWithOutTarget.Name == "item_armlet")
                {
                    itemWithOutTarget.ToggleAbility();
                    Utils.Sleep(50, "nextAction");
                    return;
                }
                itemWithOutTarget.UseAbility();
                Utils.Sleep(50, "nextAction");
                return;
            }

            if (dagger != null && dagger.CanBeCasted())
            {
                if (!me.IsMagicImmune() && heal.CanBeCasted() && heal.ManaCost <= neededMana && _shoulUseHeal)
                {
                    heal.UseAbility(me);
                    Utils.Sleep(500, "nextAction");
                    return;
                }
                var point = new Vector3(
                    (float)(target.Position.X - 60 * Math.Cos(me.FindAngleBetween(target.Position, true))),
                    (float)(target.Position.Y - 60 * Math.Sin(me.FindAngleBetween(target.Position, true))),
                    target.Position.Z);
                dagger.UseAbility(point);
                Utils.Sleep(50, "nextAction");
                return;
            }
            if (distance>duel.CastRange)
            {
                me.Move(target.Position);
                Utils.Sleep(200, "nextAction");
                return;
            }
            if (itemOnTarget != null && !dpActivated && _debuffenemy)
            {
                itemOnTarget.UseAbility(target);
                Utils.Sleep(50, "nextAction");
                return;
            }
            if (_shoulUseBkb && bkb != null && bkb.CanBeCasted())
            {
                bkb.UseAbility();
            }
            duel.UseAbility(target);
            Utils.Sleep(300, "nextAction");
        }
开发者ID:popopxD,项目名称:JumpAttacker_EnsageSharp_fork,代码行数:100,代码来源:Program.cs

示例5: ItemUsage

 private static void ItemUsage(Hero me, IEnumerable<Item> inv, Hero target, float distance, bool useBkb, bool byIllusion = false)
 {
     if (me.IsChanneling()) return;
     var inventory = inv.Where(x => Utils.SleepCheck(x.Name + me.Handle) && x.CanBeCasted()/* && Menu.Item("Items").GetValue<AbilityToggler>().IsEnabled(x.Name)*/).ToList();
     var items =
         inventory.Where(
             x =>
                 Items.Contains(x.Name) &&
                 ((x.CastRange == 0 && distance <= 1150 + Menu.Item("Dagger.CloseRange").GetValue<Slider>().Value) ||
                  x.CastRange >= distance)).ToList();
     foreach (var item in items)
     {
         if (item.Name == "item_blink")
         {
             if (distance > 1150)
             {
                 var point = new Vector3(
                     (float)
                         (target.Position.X -
                          Menu.Item("Dagger.CloseRange").GetValue<Slider>().Value*
                          Math.Cos(me.FindAngleBetween(target.Position, true))),
                     (float)
                         (target.Position.Y -
                          Menu.Item("Dagger.CloseRange").GetValue<Slider>().Value*
                          Math.Sin(me.FindAngleBetween(target.Position, true))),
                     target.Position.Z);
                 var dist = me.Distance2D(point);
                 if (dist >= Menu.Item("Dagger.MinDistance").GetValue<Slider>().Value && dist <= 1150)
                 {
                     item.UseAbility(point);
                     Utils.Sleep(500, item.Name + me.Handle);
                 }
             }
             else if (distance>Menu.Item("Dagger.MinDistance").GetValue<Slider>().Value)
             {
                 item.UseAbility(target.Position);
                 Utils.Sleep(500, item.Name + me.Handle);
             }
             continue;
         }
         item.UseAbility();
         item.UseAbility(target);
         item.UseAbility(target.Position);
         item.UseAbility(me);
         Utils.Sleep(500, item.Name + me.Handle);
     }
     var underDiff = target.Modifiers.Any(x => x.Name == "modifier_item_diffusal_blade_slow");
     //Game.PrintMessage("Under SLow?: "+target.Modifiers.Any(x=>x.Name=="modifier_item_diffusal_blade_slow"),MessageType.ChatMessage);
     if (byIllusion && !underDiff && !target.IsStunned() && !target.IsHexed())
     {
         var items2 = inventory.Where(x => CloneOnlyComboItems.Contains(x.Name) && ((x.CastRange == 0 && distance <= 650) || x.CastRange >= distance)).ToList();
         foreach (var item in items2)
         {
             item.UseAbility(target);
             Utils.Sleep(500, item.Name + me.Handle);
         }
     }
     if (useBkb && distance<650)
     {
         var bkb = inventory.FirstOrDefault(x => x.Name == "item_black_king_bar");
         if (bkb != null && bkb.CanBeCasted() && Utils.SleepCheck(bkb.Name + me.Handle))
         {
             bkb.UseAbility();
             Utils.Sleep(500, bkb.Name + me.Handle);
         }
     }
     if (!items.Any()) return;
     {
         var r = me.Spellbook.SpellR;
         if (r == null || r.CanBeCasted()) return;
         var refresher = inventory.FirstOrDefault(x => x.Name == "item_refresher");
         refresher?.UseAbility();
         Utils.Sleep(500, refresher?.Name + me.Handle);
     }
 }
开发者ID:dendimonster,项目名称:EnsageSharp-1,代码行数:75,代码来源:Program.cs

示例6: CheckForPike

 private static bool CheckForPike(Hero me, Hero target, double distance, Item x)
 {
     if (x.StoredName() != "item_hurricane_pike")
         return true;
     var angle = (float)Math.Max(
         Math.Abs(me.RotationRad -
                  Utils.DegreeToRadian(me.FindAngleBetween(target.Position))) - 0.20, 0);
     return !Prediction.IsTurning(me) && angle == 0 && distance >= 600;
 }
开发者ID:JumpAttacker,项目名称:EnsageSharp,代码行数:9,代码来源:Core.cs

示例7: LetsAddEffects

 private static void LetsAddEffects(Hero me, Unit target, Unit t, Ability shackleshot)
 {
     var dist = me.Distance2D(target) >= me.Distance2D(t);
     var angle = (float)(Math.Max(
             Math.Abs(me.FindAngleBetween(t.Position, true) - (me.FindAngleBetween(target.Position, true))) - .19, 0));
     // ReSharper disable once CompareOfFloatsByEqualityOperator
     if (angle == 0 && dist)
     {
         if (!EffectMaster.ContainsKey(t))
             EffectMaster.Add(t, new ParticleMasterOnTimer(target, new ParticleEffect(WrEffect, t, ParticleAttachment.WorldOrigin)));
         if (shackleshot != null && shackleshot.CanBeCasted() && Utils.SleepCheck("shshot") && (_shackleshotHelper))
         {
             shackleshot.UseAbility(t);
             Utils.Sleep(250, "shshot");
         }
     }
 }
开发者ID:dendimonster,项目名称:EnsageSharp-1,代码行数:17,代码来源:Program.cs

示例8: ItemUsage


//.........这里部分代码省略.........
                                     new[]
                                     {
                                         "modifier_templar_assassin_refraction_absorb",
                                         "modifier_templar_assassin_refraction_absorb_stacks",
                                         "modifier_oracle_fates_edict",
                                         "modifier_abaddon_borrowed_time"
                                     }, false))
                        {
                            Print("can damage this shit", print: false);
                            continue;
                        }
                        else
                        {
                            item.UseAbility(target);
                            Print($"[Using]: {item.Name} (1)", print: false);
                            Utils.Sleep(350, $"{item.Name + me.Handle}");
                            continue;
                        }

                        /*item.UseAbility(target);
                        Print($"[Using]: {item.Name} (3)", print: false);*/
                    }
                    else
                    {
                        item.UseAbility(me);
                        Print($"[Using]: {item.Name} (4)", print: false);
                    }
                else
                {
                    if (name == "item_blink")
                    {
                        if (distance > 1150)
                        {
                            var angle = me.FindAngleBetween(target.Position, true);
                            var point = new Vector3(
                                (float)
                                    (target.Position.X -
                                     CloseRange*
                                     Math.Cos(angle)),
                                (float)
                                    (target.Position.Y -
                                     CloseRange*
                                     Math.Sin(angle)),
                                target.Position.Z);
                            var dist = me.Distance2D(point);
                            if (dist >= MinDistance && dist <= 1150)
                            {
                                item.UseAbility(point);
                                Print($"[Using]: {item.Name} (5)", print: false);
                            }
                        }
                        else if (distance > MinDistance)
                        {
                            var angle = me.FindAngleBetween(target.Position, true);
                            var point = new Vector3(
                                (float)
                                    (target.Position.X -
                                     ExtraDistance*
                                     Math.Cos(angle)),
                                (float)
                                    (target.Position.Y -
                                     ExtraDistance*
                                     Math.Sin(angle)),
                                target.Position.Z);
                            item.UseAbility(point);
                            Print($"[Using]: {item.Name} (6)", print: false);
开发者ID:JumpAttacker,项目名称:EnsageSharp,代码行数:67,代码来源:Core.cs

示例9: ComboInAction

        private static void ComboInAction(Hero me, Hero target)
        {
            
            if (!Utils.SleepCheck("nextAction")) return;
            var dist = me.Distance2D(target);
            switch (_stage)
            {
                case 0:
                    if (target.Modifiers.Any(x => x.Name == "modifier_earth_spirit_magnetize") && !CanCastCombo()) { _stage = 5; }
                    if (Menu.Item("dagger").GetValue<StringList>().SelectedIndex == (int)DaggerStage.OnStartCombo)
                    {
                        var blink = me.FindItem("item_blink");
                        if (dist >= Pull.CastRange && blink != null && blink.CanBeCasted())
                        {
                            if (dist >= Pull.CastRange + 1100)
                            {
                                me.Move(target.Position);
                                Utils.Sleep(200, "nextAction");
                                break;
                            }
                            var ang = me.FindAngleBetween(target.Position, true);
                            var p = new Vector2((float)(me.Position.X + 1100 * Math.Cos(ang)), (float)(me.Position.Y + 1100 * Math.Sin(ang)));
                            blink.UseAbility(p.ToVector3(true));
                            Utils.Sleep(100, "nextAction");
                            break;
                        }
                    }
                    if (AnyStoneNear(me) && dist <= 1900)
                    {
                        if (Menu.Item("debug").GetValue<bool>()) PrintInfo("stone near you finded");
                        _stage++;
                        break;
                    }
                    if (Remnant.CanBeCasted())
                    {
                        if (dist <= 1900)
                        {
                            if (me.NetworkActivity == NetworkActivity.Move)
                                me.Stop();
                            Remnant.UseAbility(Prediction.InFront(me, 100));
                            Utils.Sleep(50 + Remnant.FindCastPoint(), "nextAction");
                            _stage++;
                            if (Menu.Item("debug").GetValue<bool>()) PrintInfo("remnant create");
                        }
                        else
                        {
                            me.Move(target.Position);
                            Utils.Sleep(50 + Remnant.FindCastPoint(), "nextAction");
                        }

                    }
                    break;
                case 1:
                    if (Push.CanBeCasted())
                    {
                        var last = GetLastRemnant(me);

                        if (last != null)
                        {
                            if (Menu.Item("debug").GetValue<bool>()) PrintInfo("push casted");
                            Push.UseAbility(target.Position);
                            Utils.Sleep(100 + Push.FindCastPoint(), "nextAction");
                        }
                    }
                    else
                        _stage++;
                    break;
                case 2:
                    if (Pull.CanBeCasted())
                    {
                        var last = GetLastRemnant(me);
                        if (last != null)
                        {
                            if (target.Distance2D(last) <= 400)
                            {
                                if (me.Distance2D(target) <= Pull.CastRange)
                                {
                                    /*var pos =
                                        new Vector3(
                                            (float)
                                                (last.Position.X +
                                                 (1200*Game.Ping/1000+30)*
                                                 Math.Cos(me.FindAngleBetween(last.Position))),
                                            (float)
                                                (last.Position.Y +
                                                 (1200*Game.Ping/1000+30)*
                                                 Math.Sin(me.FindAngleBetween(last.Position))), 0);
                                    */
                                    Pull.UseAbility(Prediction.InFront(me, (float) (me.Distance2D(last) + (1200 * 0.1 + Game.Ping / 1000))));
                                    
                                    if (Menu.Item("debug").GetValue<bool>())
                                    {
                                        Game.PrintMessage((1200*0.1 + Game.Ping / 1000).ToString(), MessageType.ChatMessage);
                                        //globalPos = pos;
                                        PrintInfo("last pos: " + last.Position.X);
                                        PrintInfo("pull casted. Distance: " + target.Distance2D(last));
                                    }
                                    //Utils.Sleep(Game.Ping + Pull.FindCastPoint(), "nextAction");

                                }
//.........这里部分代码省略.........
开发者ID:dendimonster,项目名称:EnsageSharp-1,代码行数:101,代码来源:Program.cs

示例10: LetAghanimCombo

        private static void LetAghanimCombo(Hero me,Hero target)
        {
            if (!Utils.SleepCheck("nextAction")) return;
            var ability = me.FindSpell("earth_spirit_petrify");
            if (ability==null) return;
            if (ability.Level==0) return;

            var inStone = target.Modifiers.Any(x=>x.Name=="modifier_earthspirit_petrify");

            var dist = me.Distance2D(target);
            if (ability.CanBeCasted() && !inStone)
            {
                if (Menu.Item("dagger").GetValue<StringList>().SelectedIndex == (int)DaggerStage.OnStartCombo || Menu.Item("dagger").GetValue<StringList>().SelectedIndex == (int)DaggerStage.AfterSmash)
                {
                    var blink = me.FindItem("item_blink");
                    if (dist >= ability.CastRange && blink!=null && blink.CanBeCasted())
                    {
                        var ang = me.FindAngleBetween(target.Position, true);
                        var p = new Vector2((float)(target.Position.X - 100 * Math.Cos(ang)), (float)(target.Position.Y - 100 * Math.Sin(ang)));
                        blink.UseAbility(p.ToVector3(true));
                    }
                }
                ability.UseAbility(target);
                Utils.Sleep(150 + ability.FindCastPoint(), "nextAction");
                return;
            }
            if (Pull != null && Pull.CanBeCasted() && inStone)
            {
                Pull.UseAbility(target.Position);
                //PrintInfo(Roll.CastSkillShot(target).ToString());
                Utils.Sleep(300 + Pull.FindCastPoint(), "nextAction");
                return;
            }
            if (Push != null && Push.CanBeCasted() && inStone && dist<=150)
            {
                Push.UseAbility(Game.MousePosition);
                if (Roll != null && Roll.CanBeCasted())
                {
                    if (Remnant != null && Remnant.CanBeCasted())
                    {
                        var ang = me.FindAngleBetween(Game.MousePosition, true);
                        var p = new Vector2((float) (me.Position.X + 100 * Math.Cos(ang)), (float) (me.Position.Y + 100 * Math.Sin(ang)));
                        Remnant.UseAbility(p.ToVector3(true));
                    }
                    Roll.UseAbility(Game.MousePosition,true);
                }
                Utils.Sleep(300 + Push.FindCastPoint(), "nextAction");
            }
        }
开发者ID:dendimonster,项目名称:EnsageSharp-1,代码行数:49,代码来源:Program.cs

示例11: ComboInAction


//.........这里部分代码省略.........
                                        Utils.Sleep(250, "StageCheck");
                                    }
                                }
                                else if (!Equals(_spellForCast, ss) && !Equals(_spellForCast, chaosmeteor))
                                {
                                    UseSpell(_spellForCast, target);
                                    _stage++;
                                    Utils.Sleep(250, "StageCheck");
                                }

                                var timing = (Equals(_spellForCast, ss))
                                    ? 1.7
                                    : (Equals(_spellForCast, chaosmeteor)) ? 1.3 : 0;
                                timing += Game.Ping / 1000 - 0.005;
                                //PrintInfo(timing.ToString(CultureInfo.InvariantCulture));
                                if (eulmodif != null && eulmodif.RemainingTime < timing)
                                {
                                    UseSpell(_spellForCast, target);
                                    _stage++;
                                    Utils.Sleep(250, "StageCheck");
                                }
                            }
                            else if (Equals(_spellForCast, icewall))
                            {
                                var dist = me.Distance2D(target) <= 300;
                                if (!dist)
                                {
                                    if (me.CanMove() && Utils.SleepCheck("icewallmove"))
                                    {
                                        var point =
                                            new Vector3(
                                                (float) (target.Position.X -
                                                         200*
                                                         Math.Cos(me.FindAngleBetween(target.Position, true))),
                                                (float) (target.Position.Y -
                                                         200*
                                                         Math.Sin(me.FindAngleBetween(target.Position, true))), 0);
                                        me.Move(point);
                                        Utils.Sleep(300, "icewallmove");
                                    }

                                }
                                else
                                {
                                    _spellForCast.UseAbility();
                                    _stage++;
                                    Utils.Sleep(250, "StageCheck");
                                }
                            }
                            else
                            {
                                var tornadoMod = target.Modifiers.FirstOrDefault(x => x.Name == "modifier_invoker_tornado");
                                if (Equals(_spellForCast, deafblast))
                                {
                                    if (tornadoMod != null &&
                                        tornadoMod.RemainingTime <= me.Distance2D(target) / 1100 - .1 - Game.Ping / 1000)
                                    {
                                        UseSpell(_spellForCast, target);
                                        _stage++;
                                        Utils.Sleep(250, "StageCheck");
                                    }
                                    else if (tornadoMod == null)
                                    {
                                        UseSpell(_spellForCast, target);
                                        _stage++;
                                        Utils.Sleep(250, "StageCheck");
开发者ID:MikeTeok,项目名称:EnsageSharp-1,代码行数:67,代码来源:Program.cs

示例12: JungleFarm

        private static void JungleFarm(Hero me)
        {
            var s = JungleCamps.FindClosestCamp(me, Menu.Item("JungleFarm.TeamCheck").GetValue<bool>(),
                Menu.Item("JungleFarm.Ancient").GetValue<bool>());
            string name;

            var enemyHeroes = Heroes.GetByTeam(me.GetEnemyTeam()).Where(x => x.IsAlive).ToList();
            var dist = Menu.Item("JungleFarm.EscapeRange").GetValue<Slider>().Value;
            if (Menu.Item("JungleFarm.EscapeFromAnyEnemyHero").GetValue<bool>() &&
                    enemyHeroes.Any(x => x.Distance2D(me) <= dist)) //escape from hero
            {
                var handle = me.Handle;
                OrderStates[handle] = OrderState.Escape;
                NeedHeal[handle] = true;
            }

            if (s == null)
            {
                s = JungleCamps.GetCamps.OrderBy(x => x.CampPosition.Distance2D(me)).FirstOrDefault();
                if (s != null)
                {
                    name = MeepoSet.Find(x => Equals(x.Hero, me)).Handle.ToString();
                    if (Utils.SleepCheck("MOVIER_jungle" + name))
                    {
                        me.Move(s.StackPosition);
                        Utils.Sleep(500, "MOVIER_jungle" + name);
                    }
                }
                return;
            }
            name = MeepoSet.Find(x => Equals(x.Hero, me)).Handle.ToString();
            var anyMeepo =
                MeepoSet.Where(
                    x =>
                        x.CurrentOrderState == OrderState.Jungle && x.IsAlive && x.Handle != me.Handle &&
                        x.Hero.Health >= Menu.Item("Escape.MinRange").GetValue<Slider>().Value)
                    .OrderBy(y => y.Hero.Distance2D(me))
                    .FirstOrDefault();
            if (anyMeepo != null && me.Health <= 500 && anyMeepo.Hero.Distance2D(MyHero) <= 400 &&
                CheckForChangedHealth(me))
            {
                if (!Utils.SleepCheck(name + "attack_test")) return;
                Utils.Sleep(200, name + "attack_test");
                var enemy =
                    ObjectManager.GetEntities<Unit>()
                        .FirstOrDefault(
                            x =>
                                x.IsAlive && x.IsVisible && x.Team != MyHero.Team && x.Distance2D(MyHero) <= 500 &&
                                !x.IsWaitingToSpawn);
                if (enemy != null)
                {
                    var creep = enemy.Position;
                    var ang = me.FindAngleBetween(creep, true);
                    var p = new Vector3((float) (me.Position.X - 250*Math.Cos(ang)),
                        (float) (me.Position.Y - 250*Math.Sin(ang)), 0);
                    me.Move(p);
                }
                me.Attack(anyMeepo.Hero, true);
                return;
            }

            var mySet = MeepoSet.Find(x => Equals(x.Hero, me));
            var w = mySet.SpellW;
            if (w != null && Menu.Item("JungleFarm.AutoW").GetValue<bool>() && w.CanBeCasted())
            {
                var enemy =
                    ObjectManager
                        .GetEntities<Unit>(
                        )
                        .FirstOrDefault(
                            x =>
                                x.IsAlive && x.Health > 80 && x.IsVisible && x.Team != MyHero.Team &&
                                x.Distance2D(me) <= 375 &&
                                !x.IsWaitingToSpawn);
                if (enemy != null && Utils.SleepCheck("jungle_farm_w" + name))
                {
                    w.UseAbility(enemy.Position);
                    Utils.Sleep(1500, "jungle_farm_w_inCasting" + name);
                    Utils.Sleep(250, "jungle_farm_w" + name);
                }
                else if (enemy == null && !Utils.SleepCheck("jungle_farm_w_inCasting" + name) &&
                         Utils.SleepCheck("jungle_farm_w_stop" + name))
                {
                    me.Stop();
                    Utils.Sleeps.Remove("jungle_farm_w_inCasting" + name);
                    Utils.Sleep(500, "jungle_farm_w_stop" + name);
                }
            }
            if (!Utils.SleepCheck(name + "attack") || me.IsAttacking()) return;
            Utils.Sleep(500, name + "attack");
            me.Attack(s.CampPosition);
        }
开发者ID:JumpAttacker,项目名称:EnsageSharp,代码行数:92,代码来源:Program.cs

示例13: ComboInAction

 private static void ComboInAction(Hero me, Hero target)
 {
     if (!Utils.SleepCheck("nextAction")) return;
     var ss = me.Spellbook.Spell1; //Shadow Strike
     var blink = me.Spellbook.Spell2; //Blink
     var scream = me.Spellbook.Spell3; //Scream of Pain
     var sonic = me.Spellbook.Spell4; // Sonic Wave
     Item orchid = null;
     if (Menu.Item("enabledAbilities").GetValue<AbilityToggler>().IsEnabled("item_orchid"))
     {
         orchid = me.FindItem("item_orchid"); //Orchid [Silence]
     }
     Item hex = null;
     if (Menu.Item("enabledAbilities").GetValue<AbilityToggler>().IsEnabled("item_sheepstick"))
     {
         hex = me.FindItem("item_sheepstick"); //Hex [Disable]
     }
     Item mask = null;
     if (Menu.Item("enabledAbilities").GetValue<AbilityToggler>().IsEnabled("item_mask_of_madness"))
     {
         mask = me.FindItem("item_mask_of_madness"); //Mask of Madness [Attack Speed]
     }
     Item mjo = null;
     if (Menu.Item("enabledAbilities").GetValue<AbilityToggler>().IsEnabled("item_mjollnir"))
     { mjo = me.FindItem("item_mjollnir"); //Mjollnir Buff [AoE lightning]
     }
     Item shivas = null;
     if (Menu.Item("enabledAbilities").GetValue<AbilityToggler>().IsEnabled("item_shivas_guard"))
     {
         shivas = me.FindItem("item_shivas_guard"); //Shivas [AoE Slow]
     }
     var neededMana = me.Mana - sonic.ManaCost;
     var allitems = me.Inventory.Items.Where(x => x.CanBeCasted() && x.ManaCost <= neededMana);
     var enumerable = allitems as Item[] ?? allitems.ToArray();
     var itemOnTarget =
         enumerable.FirstOrDefault(
             x =>
                 x.Name == "item_orchid");
     var itemWithOutTarget = enumerable.FirstOrDefault(
             x =>
                 x.Name == "item_shivas_guard");
     var itemOnMySelf = enumerable.FirstOrDefault(
         x =>
             x.Name == "item_mjollnir");
     Item bkb = null;
     if (Menu.Item("enabledAbilities").GetValue<AbilityToggler>().IsEnabled("item_black_king_bar"))
     {
         bkb = me.FindItem("item_black_king_bar");
     }
     var distance = me.Distance2D(target); //Target Distance
     var attackRange = 550;			  //Attack Range
     if (distance >= 1350)             //Move to Target if Distance too far to blink
     {
         me.Move(target.Position);
         Utils.Sleep(200 + Game.Ping, "nextAction");
         return;
     }
     #region Items
     //Mjollnir
     if (itemOnMySelf != null && Menu.Item("enabledAbilities").GetValue<AbilityToggler>().IsEnabled("item_mjollnir"))
     {
         itemOnMySelf.UseAbility(me);
         Utils.Sleep(50 + Game.Ping, "nextAction");
         return;
     }
     //Blink to Target
     if (blink != null && !Menu.Item("harass").GetValue<bool>() && blink.CanBeCasted() && distance >= attackRange && Utils.SleepCheck("blink"))
     {
         var point = new Vector3(
             (float)(target.Position.X - 20 * Math.Cos(me.FindAngleBetween(target.Position, true))),
             (float)(target.Position.Y - 20 * Math.Sin(me.FindAngleBetween(target.Position, true))),
             target.Position.Z);
         blink.UseAbility(point);
         Utils.Sleep(200 + Game.Ping, "blink");
         return;
     }
     //Orchid & Hex
     if (itemOnTarget != null && Menu.Item("enabledAbilities").GetValue<AbilityToggler>().IsEnabled("item_orchid"))
     {
         orchid.UseAbility(target);
         Utils.Sleep(50 + Game.Ping, "nextAction");
         return;
     }
     if (Menu.Item("enabledAbilities").GetValue<AbilityToggler>().IsEnabled("item_sheepstick") && hex !=null && hex.CanBeCasted() && Utils.SleepCheck("nextAction"))
     {
         hex.UseAbility(target);
         Utils.Sleep(50 + Game.Ping, "nextAction");
         return;
     }
     //Shivas Guard
     if (itemWithOutTarget != null && Menu.Item("enabledAbilities").GetValue<AbilityToggler>().IsEnabled("item_shivas_guard"))
     {
         itemWithOutTarget.UseAbility();
         Utils.Sleep(100 + Game.Ping, "nextAction");
         return;
     }
     //BKB
     if (Menu.Item("enabledAbilities").GetValue<AbilityToggler>().IsEnabled("item_black_king_bar") && bkb != null && bkb.CanBeCasted() && Utils.SleepCheck("bkb"))
     {
         bkb.UseAbility();
//.........这里部分代码省略.........
开发者ID:potassiumsquare,项目名称:QoP,代码行数:101,代码来源:Program.cs

示例14: ItemUsage

        private static void ItemUsage(Hero me, IEnumerable<Item> inv, Hero target, float distance, bool useBkb, bool byIllusion = false)
        {
            if (me.IsChanneling()) return;
            var inventory = inv.Where(x => Utils.SleepCheck(x.Name + me.Handle) && x.CanBeCasted()/* && Menu.Item("Items").GetValue<AbilityToggler>().IsEnabled(x.Name)*/).ToList();
            var items =
                inventory.Where(
                    x =>
                        Items.Contains(x.Name) &&
                        ((x.CastRange == 0 && distance <= 1150 + Menu.Item("Dagger.CloseRange").GetValue<Slider>().Value) ||
                         x.CastRange >= distance)).ToList();
            foreach (var item in items)
            {
                if (item.Name == "item_blink")
                {
                    if (distance > 1150)
                    {
                        var point = new Vector3(
                            (float)
                                (target.Position.X -
                                 Menu.Item("Dagger.CloseRange").GetValue<Slider>().Value*
                                 Math.Cos(me.FindAngleBetween(target.Position, true))),
                            (float)
                                (target.Position.Y -
                                 Menu.Item("Dagger.CloseRange").GetValue<Slider>().Value*
                                 Math.Sin(me.FindAngleBetween(target.Position, true))),
                            target.Position.Z);
                        var dist = me.Distance2D(point);
                        if (dist >= Menu.Item("Dagger.MinDistance").GetValue<Slider>().Value && dist <= 1150)
                        {
                            item.UseAbility(point);
                            Utils.Sleep(500, item.Name + me.Handle);
                        }
                    }
                    else if (distance>Menu.Item("Dagger.MinDistance").GetValue<Slider>().Value)
                    {
                        item.UseAbility(target.Position);
                        Utils.Sleep(500, item.Name + me.Handle);
                    }
                    continue;
                }
                item.UseAbility();
                item.UseAbility(target);
                item.UseAbility(target.Position);
                item.UseAbility(me);
                Utils.Sleep(500, item.Name + me.Handle);
            }
            //var underDiff = target.Modifiers.Any(x => x.Name == "modifier_item_diffusal_blade_slow");
            //Game.PrintMessage("Under SLow?: "+target.Modifiers.Any(x=>x.Name=="modifier_item_diffusal_blade_slow"),MessageType.ChatMessage);
            
            //var PurgeMain = Menu.Item("Diffusal.PurgEnemy").GetValue<StringList>().SelectedIndex == (int)PurgeSelection.MainTarget;
            var purgeAll = Menu.Item("Diffusal.PurgEnemy").GetValue<StringList>().SelectedIndex == (int)PurgeSelection.AllEnemies;

            
            if (byIllusion)
            {
                var targets =
                ObjectMgr.GetEntities<Hero>()
                    .Where(
                        x =>
                            x.IsValid && x.IsAlive && x.IsVisible && x.Team!=me.Team && x.Distance2D(me) <= 650 &&
                            (purgeAll || Equals(target, x)) &&
                             !x.IsStunned() && !x.IsHexed())
                    .ToList();
                foreach (var hero in targets)
                {
                    var mod =
                        hero.Modifiers.Any(modifierName => modifierName.Name == "modifier_item_diffusal_blade_slow");
                    if (mod) continue;
                    var items2 =
                    inventory.Where(
                        x =>
                            CloneOnlyComboItems.Contains(x.Name) &&
                            (me.Distance2D(hero) <= 650)).ToList();
                    foreach (var item in items2)
                    {
                        item.UseAbility(hero);
                        Utils.Sleep(500, item.Name + me.Handle);
                    }
                }
            }
            var both = Menu.Item("Diffusal.Dispel").GetValue<StringList>().SelectedIndex == (int)DispelSelection.Both;
            var main = Menu.Item("Diffusal.Dispel").GetValue<StringList>().SelectedIndex == (int)DispelSelection.Me;
            var tempest = Menu.Item("Diffusal.Dispel").GetValue<StringList>().SelectedIndex == (int)DispelSelection.Tempest;
            if (byIllusion&& (both || main || tempest))
            {
                TryToDispell(me, inventory.Where(
                    x =>
                        CloneOnlyComboItems.Contains(x.Name)).ToList(),both,main,tempest);
            }
            if (useBkb && distance<650)
            {
                var bkb = inventory.FirstOrDefault(x => x.Name == "item_black_king_bar");
                if (bkb != null && bkb.CanBeCasted() && Utils.SleepCheck(bkb.Name + me.Handle))
                {
                    bkb.UseAbility();
                    Utils.Sleep(500, bkb.Name + me.Handle);
                }
            }
            if (!items.Any()) return;
            {
//.........这里部分代码省略.........
开发者ID:DevGdos,项目名称:EnsageSharp,代码行数:101,代码来源:Program.cs

示例15: ComboInAction

        private static void ComboInAction(Hero me, Hero target)
        {
            #region Init
            /*
            var q = me.Spellbook.SpellQ;
            var w = me.Spellbook.SpellW;
            var e = me.Spellbook.SpellE;
            var active1 = me.Spellbook.Spell4;
            var active2 = me.Spellbook.Spell5;
            */
            var invoke = me.FindSpell("invoker_invoke");
            
            var eul = me.FindItem("item_cyclone");
            var dagger = me.FindItem("item_blink");
            var refresher = me.FindItem("item_refresher");
            var icewall = me.FindSpell("invoker_ice_wall");
            var deafblast = me.FindSpell("invoker_deafening_blast");
            var hex = me.FindItem("item_sheepstick");
            var urn = me.FindItem("item_urn_of_shadows");
            var orchid = me.FindItem("item_orchid");
            var meteor = me.FindSpell("invoker_chaos_meteor");
            var ss = me.FindSpell("invoker_sun_strike");
            //var emp = me.FindSpell("invoker_emp");
            /*
            
            var coldsnap = me.FindSpell("invoker_cold_snap");
            var ghostwalk = me.FindSpell("invoker_ghost_walk");
            
            var tornado = me.FindSpell("invoker_tornado");
            
            var forge = me.FindSpell("invoker_forge_spirit");
            
            var alacrity = me.FindSpell("invoker_alacrity");
            
            */
            if (!_initNewCombo)
            {
                _initNewCombo = true;
                _stage = 1;
                //PrintInfo("Starting new combo! " + $"[{_combo + 1}] target: {target.Name}");
            }
            if (!Utils.SleepCheck("StageCheck")) return;
            #endregion

            /*var modif = target.Modifiers.Where(x=>x.IsDebuff);
            PrintInfo("===========================");
            foreach (var s in modif)
            {
                PrintInfo(s.Name);
            }*/
            var myBoys = ObjectMgr.GetEntities<Unit>().Where(x => x.Team == me.Team && x.IsControllable && x.IsAlive && Utils.SleepCheck(x.Handle.ToString()));
            foreach (var myBoy in myBoys)
            {
                myBoy.Attack(target);
                Utils.Sleep(300, myBoy.Handle.ToString());
            }
            if (me.CanUseItems())
            {
                if (urn != null && urn.CanBeCasted(target))
                {
                    var urnMod = target.Modifiers.Any(x => x.Name == "modifier_item_urn_damage") &&
                                 Utils.SleepCheck(urn.Name);
                    if (!urnMod)
                    {
                        urn.UseAbility(target);
                        Utils.Sleep(300, urn.Name);
                    }
                }
                if (_stage > 2 && !target.IsHexed() && !target.IsStunned())
                {
                    if (hex != null && hex.CanBeCasted(target) &&
                        Menu.Item("items").GetValue<AbilityToggler>().IsEnabled(hex.Name) &&
                        Utils.SleepCheck("items"))
                    {
                        hex.UseAbility(target);
                        Utils.Sleep(300, "items");
                    }
                    if (orchid != null && orchid.CanBeCasted(target) &&
                        Menu.Item("items").GetValue<AbilityToggler>().IsEnabled(orchid.Name) &&
                        Utils.SleepCheck("items"))
                    {
                        orchid.UseAbility(target);
                        Utils.Sleep(300, "items");
                    }
                }
                if (dagger != null && Menu.Item("items").GetValue<AbilityToggler>().IsEnabled(dagger.Name) &&
                    dagger.CanBeCasted() && Utils.SleepCheck("blinker") && me.Distance2D(target) >= 700)
                {
                    var dist = 300;
                    var angle = me.FindAngleBetween(target.Position, true);
                    var point =
                        new Vector3(
                            (float) (target.Position.X -
                                     dist*
                                     Math.Cos(angle)),
                            (float) (target.Position.Y -
                                     dist*
                                     Math.Sin(angle)), 0);
                    if (me.Distance2D(target) <= 1150 + 700)
                        dagger.UseAbility(point);
//.........这里部分代码省略.........
开发者ID:dendimonster,项目名称:EnsageSharp-1,代码行数:101,代码来源:Program.cs


注:本文中的Hero.FindAngleBetween方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。