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


C# Hero.Stop方法代码示例

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


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

示例1: Stop

 public void Stop(Hero hero)
 {
     hero.Stop();
     Sleeper.Sleep(Game.Ping);
 }
开发者ID:IdcNoob,项目名称:Ensage,代码行数:5,代码来源:TimberChain.cs

示例2: 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

示例3: 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

示例4: cancelult

        public static void cancelult()
        {
            me = ObjectMgr.LocalHero;
            if (me.HasItem(ClassID.CDOTA_Item_UltimateScepter))
            {
                rDmg = new int[3] {440, 540, 640};
            }
            else
            {
                rDmg = new int[3] {225, 350, 475};
            }
            var momd = vhero.Modifiers.Any(x => x.Name == "modifier_item_mask_of_madness_berserk");
            var damage = Math.Floor(rDmg[me.Spellbook.Spell4.Level - 1]*(1 - vhero.MagicDamageResist));
            if (Menu.Item("stealEdmg").GetValue<bool>() && me.Distance2D(vhero) < 1200)
                damage = damage + eDmg[me.Spellbook.Spell3.Level] * 0.01 * vhero.Health * (1 - vhero.MagicDamageResist);
            if (vhero.NetworkName == "CDOTA_Unit_Hero_Spectre" && vhero.Spellbook.Spell3.Level > 0)
            {
                damage =
                    Math.Floor(rDmg[me.Spellbook.Spell4.Level - 1] *
                               (1 - (0.10 + vhero.Spellbook.Spell3.Level * 0.04)) * (1 - vhero.MagicDamageResist));
                if (Menu.Item("stealEdmg").GetValue<bool>() && me.Distance2D(vhero) < 1150)
                    damage = damage + eDmg[me.Spellbook.Spell3.Level] * 0.01 * vhero.Health * (1 - vhero.MagicDamageResist);
            }
            if (vhero.NetworkName == "CDOTA_Unit_Hero_SkeletonKing" &&
                vhero.Spellbook.SpellR.CanBeCasted())
                damage = 0;
            if (vhero.NetworkName == "CDOTA_Unit_Hero_Tusk" &&
                vhero.Spellbook.SpellW.CooldownLength - 3 > vhero.Spellbook.SpellQ.Cooldown)
                damage = 0;
            if (lens) damage = damage * 1.08;
            var kunkkarum = vhero.Modifiers.Any(x => x.Name == "modifier_kunkka_ghost_ship_damage_absorb");
            if (kunkkarum) damage = damage * 0.5;
            if (momd) damage = damage*1.3;
            var unkillabletarget1 = vhero.Modifiers.Any(
                x => x.Name == "modifier_abaddon_borrowed_time" || x.Name == "modifier_dazzle_shallow_grave" ||
                     x.Name == "modifier_obsidian_destroyer_astral_imprisonment_prison" ||
                     x.Name == "modifier_puck_phase_shift" ||
                     x.Name == "modifier_brewmaster_storm_cyclone" || x.Name == "modifier_eul_cyclone" ||
                     x.Name == "modifier_item_aegis" || x.Name == "modifier_slark_shadow_dance" || x.Name == "modifier_ember_spirit_flame_guard" ||
                     x.Name == "modifier_abaddon_aphotic_shield" || x.Name == "modifier_phantom_lancer_doppelwalk_phase" ||
                     x.Name == "modifier_shadow_demon_disruption" || x.Name == "modifier_nyx_assassin_spiked_carapace" ||
                     x.Name == "modifier_templar_assassin_refraction_absorb" || x.Name == "modifier_necrolyte_reapers_scythe" ||
                     x.Name == "modifier_storm_spirit_ball_lightning" || x.Name == "modifier_ember_spirit_sleight_of_fist_caster_invulnerability" ||
                     x.Name == "modifier_ember_spirit_fire_remnant" || x.Name == "modifier_snowball_movement" || x.Name == "modifier_snowball_movement_friendly");

            if (vhero.Health > damage || !vhero.IsAlive || vhero.IsIllusion || unkillabletarget1 || vhero.IsMagicImmune() || (vhero.Name == "npc_dota_hero_slark" && !vhero.IsVisible)) me.Stop();
            vhero = null;
        }
开发者ID:Evervolv1337,项目名称:Ensage,代码行数:48,代码来源:Program.cs


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