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


C# Hero.IsStunned方法代码示例

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


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

示例1: CastSpellsIfCanOrAttack

        private static void CastSpellsIfCanOrAttack(Ability ability, Unit source,  Hero target, bool cStun, byte targetType, Vector3 targetPos, float range = 0f)
        {

            if (range == 0f)
            {
                if ((cStun ? !target.IsStunned() : true) && CanCast(source, ability) && !target.IsInvul())
                { 
                    switch(targetType) {
                        case 0:
                            ability.UseAbility();
                            break;
                        case 1:
                            ability.UseAbility(target);
                            break;
                        case 2:
                            ability.UseAbility(targetPos);
                            break;
                    }
                    Utils.Sleep(ability.ChannelTime + Game.Ping, ability.Handle.ToString());
                }
                else if (Utils.SleepCheck(ability.Handle.ToString())) AttackIfCan(source, target);
            }
            else
            {
                if ((cStun ? !target.IsStunned() : true) && CanCast(source, ability) && !target.IsInvul() && source.Distance2D(target) <= range) { ability.UseAbility(); Utils.Sleep(ability.ChannelTime + Game.Ping, ability.Handle.ToString()); }
                else if (Utils.SleepCheck(ability.Handle.ToString())) AttackIfCan(source, target);
            }
        }
开发者ID:LimbViolencer,项目名称:EnsageSharp-6,代码行数:28,代码来源:EzUnitControl.cs

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

示例3: IsInDanger

        private static bool IsInDanger(Hero ally)
        {
            if (ally != null && ally.IsAlive)
            {
                var projectiles = ObjectMgr.Projectiles.Where(x => Equals(x.Target, ally)).ToList();

                if (projectiles.Any())
                {
                    foreach (var projectile in projectiles)
                    {
                        if (projectile.Source != null && Equals(projectile.Target, ally))
                        {
                            return true;
                        }
                    }
                }

                var percHealth = ally.Health <= (ally.MaximumHealth*0.7);
                var enemies =
                    ObjectMgr.GetEntities<Hero>()
                        .Where(
                            entity =>
                                entity.Team != ally.Team && entity.IsAlive && entity.IsVisible && !entity.IsIllusion)
                        .ToList();
                if (enemies.Any() && percHealth)
                {
                    foreach (var enemy in enemies)
                    {
                        if (ally.Distance2D(enemy) < enemy.AttackRange + 50)
                        {
                            return true;
                        }
                        if (enemy.Spellbook.Spells.Any(abilities => ally.Distance2D(enemy) < abilities.CastRange + 50))
                        {
                            return true;
                        }
                    }
                }

                var buffs = new[]
                {
                    "modifier_item_urn_damage", "modifier_doom_bringer_doom", "modifier_axe_battle_hunger",
                    "modifier_queenofpain_shadow_strike", "modifier_phoenix_fire_spirit_burn",
                    "modifier_venomancer_poison_nova", "modifier_venomancer_venomous_gale",
                    "modifier_silencer_curse_of_the_silent", "modifier_silencer_last_word", "modifier_bane_fiends_grip",
                    "modifier_earth_spirit_magnetize", "modifier_jakiro_macropyre", "modifier_nerolyte_reapers_scythe",
                    "modifier_batrider_flaming_lasso", "modifier_sniper_assassinate", "modifier_pudge_dismember",
                    "modifier_enigma_black_hole_pull", "modifier_disruptor_static_storm", "modifier_sand_king_epicenter",
                    "modifier_bloodseeker_rupture", "modifier_dual_breath_burn", "modifier_jakiro_liquid_fire_burn",
                    "modifier_axe_battle_hunger", "modifier_viper_corrosive_skin", "modifier_viper_poison_attack",
                    "modifier_viper_viper_strike"
                };

                foreach (var buff in buffs)
                {
                    return ally.Modifiers.Any(x => x.Name == buff);
                }

                if ((ally.IsStunned() ||
                     (ally.IsSilenced() &&
                      ((ally.FindItem("item_manta_style") == null || ally.FindItem("item_manta_style").Cooldown > 0) ||
                       (ally.FindItem("item_black_king_bar") == null ||
                        ally.FindItem("item_black_king_bar").Cooldown > 0))) ||
                     ally.IsHexed() ||
                     ally.IsRooted()) && !ally.IsInvul()
                    )
                {
                    return true;
                }

                return false;
            }
            return false;
        }
开发者ID:evezus,项目名称:EnsageSharp,代码行数:74,代码来源:Program.cs

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

示例5: DoCombo

        private static void DoCombo(Hero target)
        {
            var theClosestMeepo = _meepoList.OrderBy(target.Distance2D).First();
            var dist = theClosestMeepo.Distance2D(target)+MyHero.HullRadius+target.HullRadius;
            var targetPos = target.Position;

            #region GetItems&Spells

            if (OrderStates[MyHero.Handle] != OrderState.Escape)
            {
                if (_blink != null && _blink.CanBeCasted() && dist <= 1150 && dist >= 250 && Utils.SleepCheck("Blink"))
                {
                    _blink.UseAbility(targetPos);
                    Utils.Sleep(250, "Blink");
                }
                var bkb = target.FindItem("item_black_king_bar");
                if (bkb != null && bkb.CanBeCasted() && _hex != null && _hex.CanBeCasted(target) &&
                    Utils.SleepCheck("hex"))
                {
                    _hex.UseAbility(target);
                    Utils.Sleep(250, "hex");
                }
                if (_orchid != null && _orchid.CanBeCasted(target) && !target.IsHexed() && Utils.SleepCheck("orchid") &&
                    Utils.SleepCheck("hex"))
                {
                    _orchid.UseAbility(target);
                    Utils.Sleep(250, "orchid");
                }
                if (_hex != null && _hex.CanBeCasted(target) && !target.IsSilenced() && Utils.SleepCheck("hex") &&
                    Utils.SleepCheck("orchid"))
                {
                    _hex.UseAbility(target);
                    Utils.Sleep(250, "hex");
                }
                if (_eb != null && _eb.CanBeCasted(target) && Utils.SleepCheck("eb"))
                {
                    _eb.UseAbility(target);
                    Utils.Sleep(250, "eb");
                }
            }

            #endregion

            foreach (
                var handle in
                    _meepoList.Where(x => x.IsAlive && OrderStates[x.Handle] != OrderState.Escape)
                        .Select(meepo => meepo.Handle))
            {
                OrderStates[handle] = OrderState.InCombo;
            }
            foreach (var meepo in _meepoList.Where(x => x.IsAlive && OrderStates[x.Handle] == OrderState.InCombo).OrderBy(y=>y.Distance2D(target)))
            {
                #region gettings spells and drawing effects

                var handle = meepo.Handle;
                DrawEffects(meepo, target);

                Ability q, w;
                if (!SpellQ.TryGetValue(handle, out q))
                    SpellQ[handle] = meepo.Spellbook.Spell1;
                if (!SpellW.TryGetValue(handle, out w))
                    SpellW[handle] = meepo.Spellbook.Spell2;
                #region Change Orders

                if (SafeTp(meepo, w))
                    continue;

                #endregion
                #endregion

                #region CastQ

                var mod = target.FindModifier("modifier_meepo_earthbind");
                var remTime = mod?.RemainingTime ?? 0;

                if ((_blink==null || !_blink.CanBeCasted()) && q != null && q.CanBeCasted() && dist <= q.CastRange &&
                    (mod == null || remTime <= .7) &&
                    Utils.SleepCheck("Period_q"))
                {
                    if (q.CastSkillShot(target))
                    //if (q.CastStun(target))
                    {
                        Utils.Sleep(q.GetHitDelay(target)*1000+100, "Period_q");
                    }
                }

                #endregion

                #region CastW

                if (w != null)
                {
                    var castRange = w.GetRealCastRange();
                    if ((!Equals(theClosestMeepo, meepo) || target.IsHexed() || target.IsStunned() ||
                         target.MovementSpeed <= 200 || (remTime > 1.3)) && w.CanBeCasted() &&
                        dist <= castRange &&
                        Utils.SleepCheck("Period_w" + handle))
                    {
                        w.UseAbility(theClosestMeepo);
                        Utils.Sleep(1500, "Period_w" + handle);
//.........这里部分代码省略.........
开发者ID:JumpAttacker,项目名称:EnsageSharp,代码行数:101,代码来源:Program.cs

示例6: DisabledAlly

 public static bool DisabledAlly(Hero target)
 {
     return target.IsStunned() || target.IsHexed() || target.IsRooted();
 }
开发者ID:Ray0fHope,项目名称:EnsageSharp,代码行数:4,代码来源:CastingChecks.cs

示例7: IsDisbled

 private static bool IsDisbled(Hero unit) {
     return (unit.IsHexed() || unit.IsStunned() ||
             (unit.IsSilenced() && unit.PrimaryAttribute == Attribute.Intelligence) ||
             unit.Modifiers.Any(
                 x =>
                     x.Name == "modifier_doom_bringer_doom" || x.Name == "modifier_axe_berserkers_call" ||
                     (x.Name == "modifier_legion_commander_duel" &&
                      unit.ClassID != ClassID.CDOTA_Unit_Hero_Legion_Commander)) &&
             Menu.Item("autoHealWhenDisabled").GetValue<HeroToggler>().IsEnabled(unit.Name)) &&
            unit.Modifiers.All(x => x.Name != "modifier_winter_wyvern_cold_embrace");
 }
开发者ID:RetiredQQ,项目名称:Ensage,代码行数:11,代码来源:Program.cs

示例8: ItemUsage

        /**
        * ItemUsage takes in a Hero me, its inventory inv, a Hero target, the distance between me and target, a boolean usebkb and byillusion
        * and uses all items as necessary
        * 1) Uses blink dagger to a point given by Dagger.CloseRange menu option
        * 2) Uses all other items specified in the Items list (line 53)
        * 3) Uses diffusal blade (to purge or dispel) if enabled
        * 4) Uses bkb if enabled
        * 5) Uses ultimate if all items expect of refresher was casted
        **/
        private static bool ItemUsage(Hero me, IEnumerable<Item> inv, Hero target, double distance, bool useBkb, bool byIllusion = false)
        {
            if (me.IsChanneling() || !Utils.SleepCheck("DaggerTime") || me.IsStunned()) return false;
            // use all items given in Items list (line 53)
            var enumerable = inv as Item[] ?? inv.ToArray();
            var phase =
                enumerable.Find(
                    x =>
                        x.StoredName() == HideItemList[0] && byIllusion &&
                        SpellBaseList.Find(z => z.Name == x.Name) == null && Utils.SleepCheck(x.Name + me.Handle));
            if (phase != null)
            {
                phase.UseAbility();
                Utils.Sleep(250, $"{phase.StoredName() + me.Handle}");
            }
            var inventory =
                enumerable.Where(
                    x =>
                        (IsItemEnable(x.StoredName(), byIllusion) || CloneOnlyComboItems.Contains(x.StoredName()) ||
                         x.StoredName() == "item_dust" || x.StoredName() == "item_black_king_bar") && x.CanBeCasted() &&
                        (!byIllusion || SpellBaseList.Find(z => z.Name == x.Name) == null)
                            /* && Menu.Item("Items").GetValue<AbilityToggler>().IsEnabled(x.Name)*/ && CheckForPike(me,target,distance,x) ).ToList();
            var items =
                inventory.Where(
                    x =>
                        Utils.SleepCheck(x.Name + me.Handle) && Items.Keys.Contains(x.Name) &&
                        ((x.CastRange == 0 &&
                          distance <=
                          (x.Name == "item_blink" ? 1150 + Menu.Item("Dagger.CloseRange").GetValue<Slider>().Value : 1000)) ||
                         /*x.CastRange+50 >= distance*/x.CanHit(target))).OrderByDescending(y => GetComboOrder(y, byIllusion));
            var slarkMod = target.HasModifiers(new[] { "modifier_slark_dark_pact", "modifier_slark_dark_pact_pulses" }, false);
            foreach (var item in items)
            {
                var name = item.StoredName();
                if (name == "item_ethereal_blade")
                    _ethereal.Sleep(1000);
                if (name == "item_dagon" || name == "item_dagon_2" || name == "item_dagon_3" || name == "item_dagon_4" || name == "item_dagon_5")
                    if (_ethereal.Sleeping && !target.HasModifier("modifier_item_ethereal_blade_ethereal"))
                        continue;
                if (name == "item_hurricane_pike")
                {
                    item.UseAbility(me);
                    Utils.Sleep(250, $"{name + me.Handle}");
                    continue;
                }
                if (item.IsAbilityBehavior(AbilityBehavior.NoTarget))
                {
                    item.UseAbility();
                    Print($"[Using]: {item.Name} (10)", print: false);
                }
                else if (item.IsAbilityBehavior(AbilityBehavior.UnitTarget))
                    if (item.TargetTeamType == TargetTeamType.Enemy || item.TargetTeamType == TargetTeamType.All ||
                        item.TargetTeamType == TargetTeamType.Custom)
                    {
                        if (item.IsDisable())
                        {
                            if (!slarkMod && !target.IsLinkensProtected())
                                if (item.CastStun(target))
                                {
                                    Print($"[Using]: {item.Name} (9)", print: false);
                                    Utils.Sleep(350, $"{item.Name + me.Handle}");
                                    continue;
                                }
                        }
                        else if (item.IsSilence())
                        {
                            if (!slarkMod)
                                if (!target.IsSilenced())
                                {
                                    item.UseAbility(target);
                                    Print($"[Using]: {item.Name} (8)", print: false);
                                }
                        }
                        else if ((item.StoredName().Contains("dagon") || item.StoredName() == "item_ethereal_blade") &&
                                 target.HasModifiers(
                                     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}");
//.........这里部分代码省略.........
开发者ID:JumpAttacker,项目名称:EnsageSharp,代码行数:101,代码来源:Core.cs

示例9: ComboInAction


//.........这里部分代码省略.........
                                                (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");
                                    }
                                }
                                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 (tornadoMod != null && tornadoMod.RemainingTime < timing)
                                {
                                    UseSpell(_spellForCast, target);
                                    _stage++;
                                    Utils.Sleep(250, "StageCheck");
                                }
                            }

                        }
                        else
                        {
                            SpellStruct s;
                            if (SpellInfo.TryGetValue(_spellForCast.Name, out s))
                            {
                                if (invoke.CanBeCasted())
                                {
                                    var spells = s.GetNeededAbilities();
                                    if (spells[0] != null) spells[0].UseAbility();
                                    if (spells[1] != null) spells[1].UseAbility();
                                    if (spells[2] != null) spells[2].UseAbility();
                                    invoke.UseAbility();
                                    Utils.Sleep(70, "StageCheck");
                                }
                            }
                            else
                                try
                                {
                                    PrintError("couldnt find data for spell: " + _spellForCast.Name);
                                }
                                catch (Exception)
                                {
                                    PrintError("couldnt find data for spell: ERROR");
                                }
                        }
                    }
                    break;*/

                    #endregion
            }
            if (_autoUseRefresher && refresher != null && refresher.AbilityState == AbilityState.Ready && _stage>=5)
            {
                refresher.UseAbility();
                _stage = 3;

            }
            if (_stage>2 && !target.IsHexed() && !target.IsStunned())
            {
                if (hex != null && hex.CanBeCasted(target))
                    hex.UseAbility(target);
            }
        }
开发者ID:popopxD,项目名称:JumpAttacker_EnsageSharp_fork,代码行数:101,代码来源:Program.cs

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


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