• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# AttackableUnit类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中AttackableUnit的典型用法代码示例。如果您正苦于以下问题:C# AttackableUnit类的具体用法?C# AttackableUnit怎么用?C# AttackableUnit使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



AttackableUnit类属于命名空间,在下文中一共展示了AttackableUnit类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: AfterAttack

 internal static void AfterAttack(AttackableUnit unit, AttackableUnit target)
 {
     if (target.IsValidTarget() && unit.IsValid<Obj_AI_Hero>() && unit.IsMe)
     {
         LastTarget = target;
     }
 }
开发者ID:DZ191,项目名称:LeagueSharp,代码行数:7,代码来源:PlayerMonitor.cs


示例2: OrbwalkingAfterAttack

        private static void OrbwalkingAfterAttack(AttackableUnit unit, AttackableUnit target)
        {
            if (!unit.IsMe) return;

            if (passiveStacks > 0)
                passiveStacks = passiveStacks - 1;
        }
开发者ID:dougbenham,项目名称:Will-update,代码行数:7,代码来源:PassiveTracker.cs


示例3: Orbwalking_AfterAttack

        private void Orbwalking_AfterAttack(AttackableUnit unit, AttackableUnit target)
        {
            if (Player.ChampionName == "Riven")
                return;

            if (!Menu.Item("use" + Name).GetValue<bool>() || !IsReady())
                return;

            var hero = target as Obj_AI_Hero;
            if (hero.IsValidTarget(Range))
            {
                if (!Parent.Item(Parent.Name + "useon" + hero.NetworkId).GetValue<bool>())
                    return;

                if (hero.Health / hero.MaxHealth * 100 <= Menu.Item("enemylowhp" + Name + "pct").GetValue<Slider>().Value)
                {
                    UseItem(Tar.Player, true);
                }

                if (Player.Health / Player.MaxHealth * 100 <= Menu.Item("selflowhp" + Name + "pct").GetValue<Slider>().Value)
                {
                    UseItem(Tar.Player, true);
                }
            }
        }
开发者ID:Deprive,项目名称:Private,代码行数:25,代码来源:_3077.cs


示例4: getLaneClearPred

 public static float getLaneClearPred(AttackableUnit unit, int msTime, bool ignoreAlmostDead = true)
 {
     float predictedDamage = 0;
     var damageDoneTill = now + msTime;
     foreach (var damager in damagerSources.Values)
     {
         if(!damager.isValidDamager())
             continue;
         var target = damager.getTarget();
         if(target == null || target.NetworkId != unit.NetworkId || (ignoreAlmostDead && almostDead(damager.source)))
             continue;
         if (damager.firstHitAt > damageDoneTill)
             continue;
         predictedDamage += damager.damage;
         //Console.WriteLine(damager.damage);
         //Can be optimized??
         var nextAA = damager.firstHitAt + damager.cycle;
         while (damageDoneTill > nextAA)
         {
             predictedDamage += damager.damage;
             nextAA += damager.cycle;
         }
     }
     //if (predictedDamage > 0)
        // Console.WriteLine("dmg: " + predictedDamage);
     return unit.Health - predictedDamage;
 }
开发者ID:jmj8537,项目名称:GoodGuyJodu,代码行数:27,代码来源:HealthDeath.cs


示例5: Orbwalker_OnPostAttack

        private static void Orbwalker_OnPostAttack(AttackableUnit target, EventArgs args)
        {
            bool newtarget = false;
            if (Settings.useHarrier && (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Combo) || Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Harass)))
            {
                foreach (var e in EntityManager.Heroes.Enemies.Where(t => !t.IsDead && t.IsTargetable && !t.IsZombie && !t.IsInvulnerable && Player.Instance.IsInRange(t, 525)).OrderBy(t => t.MaxHealth))
                {
                    if (e.HasBuff("quinnw"))
                    {
                        Orbwalker.ForcedTarget = e;
                        newtarget = true;

                        break;
                    }
                }
            }
            else if (Settings.useHarrier)
            {
                foreach (var e in EntityManager.MinionsAndMonsters.CombinedAttackable)
                {
                    if (e.HasBuff("quinnw"))
                    {
                        Orbwalker.ForcedTarget = e;
                        newtarget = true;
                        break;
                    }
                }
            }
            if (!newtarget)
            {
                Orbwalker.ForcedTarget = null;
                //Orbwalker.ResetAutoAttack();
            }
        }
开发者ID:denizereer3,项目名称:EloBuddy,代码行数:34,代码来源:Program.cs


示例6: Weaving

        /// <summary>
        ///     Called on orbwalker action.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="target">The target.</param>
        public static void Weaving(AttackableUnit sender, AttackableUnit target)
        {
            var tg = (Obj_AI_Hero)target;
            if (TargetSelector.IsInvulnerable(tg, TargetSelector.DamageType.Physical))
            {
                return;
            }

            /// <summary>
            ///     The Q Weaving Logic.
            /// </summary>
            if (Variables.Q.IsReady() && Variables.QMenu.Item("combo").IsActive())
            {
                if (!Variables.Q.GetPrediction(tg).CollisionObjects.Any())
                {
                    Variables.Q.Cast(Variables.Q.GetPrediction(tg).UnitPosition);
                    return;
                }
            }

            /// <summary>
            ///     The W Weaving Logic.
            /// </summary>
            if (Variables.W.IsReady() && Variables.WMenu.Item("combo").IsActive())
            {
                Variables.W.Cast(Variables.W.GetPrediction(tg).UnitPosition);
            }
        }
开发者ID:nabbhacker,项目名称:ExoryREPO,代码行数:33,代码来源:Weaving.cs


示例7: BuildingClear

        /// <summary>
        ///     Called on orbwalker action.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="target">The target.</param>
        public static void BuildingClear(AttackableUnit sender, AttackableUnit target)
        {
            if (!(target is Obj_HQ) && !(target is Obj_AI_Turret) && !(target is Obj_BarracksDampener))
            {
                return;
            }

            /// <summary>
            ///     The E BuildingClear Logic.
            /// </summary>
            if (Variables.E.IsReady()
                && ObjectManager.Player.ManaPercent
                > ManaManager.GetNeededMana(Variables.E.Slot, Variables.EMenu.Item("buildings"))
                && Variables.EMenu.Item("buildings").GetValue<SliderButton>().Value.Item2)
            {
                Variables.E.Cast(ObjectManager.Player.ServerPosition.Extend(Game.CursorPos, 25));
                return;
            }

            /// <summary>
            ///     The W BuildingClear Logic.
            /// </summary>
            if (Variables.W.IsReady()
                && ObjectManager.Player.ManaPercent
                > ManaManager.GetNeededMana(Variables.W.Slot, Variables.WMenu.Item("buildings"))
                && Variables.WMenu.Item("buildings").GetValue<SliderButton>().Value.Item2)
            {
                Variables.W.Cast(Game.CursorPos);
            }
        }
开发者ID:nabbhacker,项目名称:ExoryREPO,代码行数:35,代码来源:Clear.cs


示例8: afterAttack

        private void afterAttack(AttackableUnit unit, AttackableUnit target)
        {
            if (!unit.IsMe)
                return;
            var t = target as Obj_AI_Hero;

            var dashPosition = Player.Position.Extend(Game.CursorPos, Q.Range);

            if (Q.IsReady() && t.IsValidTarget() && GetWStacks(t) == 1 && t.Position.Distance(Game.CursorPos) < t.Position.Distance(Player.Position) && dashPosition.CountEnemiesInRange(800) < 3)
            {
                Q.Cast(dashPosition, true);
                Program.debug("" + t.Name + GetWStacks(t));
            }
            else if (Q.IsReady() && Program.Farm && Config.Item("farmQ").GetValue<bool>())
            {
                var minions = MinionManager.GetMinions(dashPosition, Player.AttackRange, MinionTypes.All);

                if (minions == null || minions.Count == 0)
                    return;

                int countMinions = 0;

                foreach (var minion in minions.Where(minion => minion.Health < Player.GetAutoAttackDamage(minion) + Q.GetDamage(minion)))
                {
                    countMinions++;
                }

                if (countMinions > 1)
                    Q.Cast(dashPosition, true);
            }
        }
开发者ID:rio4948,项目名称:LeagueRepo,代码行数:31,代码来源:Vayne.cs


示例9: CustomInAutoattackRange

        public int CustomInAutoattackRange(AttackableUnit target)
        {
            if (Orbwalking.InAutoAttackRange(target))
            {
                return 1;
            }

            if (!target.IsValidTarget())
            {
                return 0;
            }

            //Azir's soldiers can't attack structures.
            if (!(target is Obj_AI_Base))
            {
                return 0;
            }

            var soldierAArange = _soldierAARange + 65 + target.BoundingRadius;
            soldierAArange *= soldierAArange;
            foreach (var soldier in SoldiersManager.ActiveSoldiers)
            {
                if (soldier.Distance(target, true) <= soldierAArange)
                {
                    return 2;
                }
            }

            return 0;
        }
开发者ID:ShineSharp,项目名称:LeagueSharp-4,代码行数:30,代码来源:AzirWalker.cs


示例10: JungleClear

        /// <summary>
        ///     Called on orbwalker action.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="target">The target.</param>
        public static void JungleClear(AttackableUnit sender, AttackableUnit target)
        {
            var tg = (Obj_AI_Minion)target;
            if (!Targets.JungleMinions.Contains(tg))
            {
                return;
            }

            /// <summary>
            ///     The W JungleClear Logic.
            /// </summary>
            if (Variables.W.IsReady() && Variables.WMenu.Item("jungleclear").IsActive())
            {
                Variables.W.Cast();
                return;
            }

            /// <summary>
            ///     The Q JungleClear Logic.
            /// </summary>
            if (Variables.Q.IsReady() && Variables.QMenu.Item("jungleclear").IsActive())
            {
                Variables.Q.Cast();
            }
        }
开发者ID:nabbhacker,项目名称:ExoryREPO,代码行数:30,代码来源:Clear.cs


示例11: OnAfterAttack

 private static void OnAfterAttack(AttackableUnit target, EventArgs args)
 {
     if (Settings.UsarQ.CurrentValue)
         if (Orbwalker.ActiveModesFlags.Equals(Orbwalker.ActiveModes.Combo))
         {
             var starget = target as AIHeroClient;
             if (starget != null)
             {
                 if (Settings.FixQ.CurrentValue)
                 {
                     if (starget.IsInRange(Player.Instance, Player.Instance.GetAutoAttackRange()))
                         if (Spells.Q.IsReady()) Spells.Q.Cast();
                 }
                 else if (Settings.FixQ.CurrentValue == false)
                 {
                     if (starget.IsInAutoAttackRange(Player.Instance))
                         if (Spells.Q.IsReady()) Spells.Q.Cast();
                 }
             }
         }
     if (Settings.JusarQ.CurrentValue)
         if (Orbwalker.ActiveModesFlags.Equals(Orbwalker.ActiveModes.JungleClear))
         {
             var monster = target as Obj_AI_Minion;
             if (monster != null)
             {
                 if (monster.IsInRange(Player.Instance, Player.Instance.GetAutoAttackRange()))
                     if (Spells.Q.IsReady()) Spells.Q.Cast();
             }
         }
 }
开发者ID:WeinerCH,项目名称:EB,代码行数:31,代码来源:Events.cs


示例12: OrbwalkerOnOnPostAttack

        private void OrbwalkerOnOnPostAttack(AttackableUnit target, EventArgs args)
        {
            var unit = target as AIHeroClient;

            if (unit == null)
            {
                Orbwalker.OnPostAttack -= OrbwalkerOnOnPostAttack;
                return;
            }

            if (Settings.UseQ && Q.IsReady() && unit.GetSilverStacks() >= 0)
            {
                var sidePolygon = Helpers.GetSidePolygons();
                var positions = new List<Vector2>();

                for (var i = 0; i < 2; i++)
                {
                    positions.Add(sidePolygon[i].Points.Where(index => index.ToVector3().ExtendPlayerVector().IsInRange(unit, Player.Instance.GetAutoAttackRange())).OrderByDescending(
                    index => index.Distance(unit.ServerPosition)).FirstOrDefault());
                }
                Q.Cast(positions.OrderByDescending(index => index.Distance(unit)).FirstOrDefault().ToVector3().ExtendPlayerVector(200));
            }

            if (Settings.UseE && E.IsReady() && unit.GetSilverStacks() == 1 && unit.IsECastableOnEnemy())
            {
                SpellManager.E.Cast(unit);
            }
            Orbwalker.OnPostAttack -= OrbwalkerOnOnPostAttack;
        }
开发者ID:jachicao,项目名称:EloBuddy,代码行数:29,代码来源:Harass.cs


示例13: afterAttack

        private void afterAttack(AttackableUnit unit, AttackableUnit target)
        {
            if (Player.Mana < RMANA + WMANA || !W.IsReady() || !unit.IsMe)
                return;

            var t = target as Obj_AI_Hero;

            if (t.IsValidTarget())
                W.Cast();
            else if (Config.Item("farmW", true).GetValue<bool>())
            {
                var minions = MinionManager.GetMinions(Player.Position, Player.AttackRange, MinionTypes.All);

                if (minions == null || minions.Count == 0)
                    return;

                int countMinions = 0;

                foreach (var minion in minions.Where(minion => minion.Health < W.GetDamage(minion)))
                {
                    countMinions++;
                }

                if (countMinions > 0)
                    W.Cast();
            }
        }
开发者ID:47110572,项目名称:LeagueRepo,代码行数:27,代码来源:Darius.cs


示例14: UseHydraNot

 public static void UseHydraNot(AttackableUnit target)
 {
     if (!Tiamat.IsOwned() && !Hydra.IsOwned()) return;
     if (!Tiamat.IsReady() && !Hydra.IsReady()) return;
     Tiamat.Cast();
     Hydra.Cast();
 }
开发者ID:himrengod,项目名称:Elobuddy-1,代码行数:7,代码来源:ItemManager.cs


示例15: OnAfterAttack

 protected override void OnAfterAttack(AttackableUnit unit, AttackableUnit target)
 {
     if (!unit.IsMe) return;
     if (unit.IsMe)
     {
         if (myOrbwalker.ActiveMode == myOrbwalker.OrbwalkingMode.Combo)
         {
             if (config.Item("UseWCombo").GetValue<bool>() &&
                 !Player.IsWindingUp &&
                 W.IsReady() &&
                 target.IsValidTarget() && Orbwalking.InAutoAttackRange(target)) W.Cast();
         }
         if (myOrbwalker.ActiveMode == myOrbwalker.OrbwalkingMode.Harass)
         {
             if (config.Item("UseWHarass").GetValue<bool>() &&
                 !Player.IsWindingUp &&
                 W.IsReady() &&
                 target.IsValidTarget() && Orbwalking.InAutoAttackRange(target)) W.Cast();
         }
         if (myOrbwalker.ActiveMode == myOrbwalker.OrbwalkingMode.JungleClear)
         {
             if (target is Obj_AI_Minion && target.Team == GameObjectTeam.Neutral && !target.Name.Contains("Mini") &&
                 !Player.IsWindingUp && Orbwalking.InAutoAttackRange(target))
             {
                 if (W.IsReady() && config.Item("UseWJFarm").GetValue<bool>()) W.Cast();
             }
         }
     }
 }
开发者ID:Shpaamyi,项目名称:LeagueSharp,代码行数:29,代码来源:Sivir.cs


示例16: AfterAttack

        private void AfterAttack(AttackableUnit unit, AttackableUnit attackableunit)
        {
            if (!CheckGuardians()
                || Menu.Item("WMana").GetValue<Slider>().Value > ObjectManager.Player.ManaPercent)
            {
                return;
            }

            var heroes = HeroManager.Enemies.Where(x => x.IsValidTarget(Orbwalking.GetRealAutoAttackRange(ObjectManager.Player)));

            foreach (var target in heroes as Obj_AI_Hero[] ?? heroes.ToArray())
            {
                if (Menu.Item("WPred").GetValue<bool>())
                {
                    wSpell.Spell.Cast(target.Position);
                }
                else
                {
                    var wPred = wSpell.Spell.GetPrediction(target, true);

                    if (wPred.Hitchance > HitChance.Medium)
                    {
                        wSpell.Spell.Cast(wPred.CastPosition);
                    }
                }
            }
        }
开发者ID:Nechrito,项目名称:Leaguesharp,代码行数:27,代码来源:WHarass.cs


示例17: OnAfterAttack

 public static void OnAfterAttack(AttackableUnit target, EventArgs args)
 {
     if (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Combo) && target.IsValid &&
         E.IsReady() &&
         GravesTheTrollMeNu.ComboMenu["useEcombo"].Cast<ComboBox>().CurrentValue == 0)
     {
         E.Cast(Side(Player.Position.To2D(), target.Position.To2D(), 65).To3D());
         Orbwalker.ResetAutoAttack();
     }
     if (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Combo) && E.IsReady() && target.IsValid &&
         GravesTheTrollMeNu.ComboMenu["useEcombo"].Cast<ComboBox>().CurrentValue == 1)
     {
         EloBuddy.Player.CastSpell(SpellSlot.E, Game.CursorPos);
         Orbwalker.ResetAutoAttack();
     }
     if (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Combo) && E.IsReady() && target.IsValid &&
         GravesTheTrollMeNu.ComboMenu["useEcombo"].Cast<ComboBox>().CurrentValue == 2)
         if (Player.Position.Extend(Game.CursorPos, 700).CountEnemiesInRange(700) <= 1)
         {
             EloBuddy.Player.CastSpell(SpellSlot.E, Game.CursorPos);
             Orbwalker.ResetAutoAttack();
         }
     if (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.JungleClear) && E.IsReady() && target.IsValid && GravesTheTrollMeNu.JungleE())
     {
         EloBuddy.Player.CastSpell(SpellSlot.E, Game.CursorPos);
         Orbwalker.ResetAutoAttack();
     }
 }
开发者ID:FireBuddy,项目名称:Elobuddy-1,代码行数:28,代码来源:Program.cs


示例18: PostAttack

        public static void PostAttack(AttackableUnit target, EventArgs args)
        {
            var qtarget = TargetSelector.GetTarget(Spells.Q.Range, DamageType.True);
            var hero = target as AIHeroClient;
            var useQ = Menu.ComboMenu["Q"].Cast<CheckBox>().CurrentValue && Spells.Q.IsReady();
            var qmode = Menu.ComboMenu["Qmode"].Cast<ComboBox>().CurrentValue;

            if (qtarget == null || hero == null || hero.Type != GameObjectType.AIHeroClient || qtarget.HasBuff("kindredrnodeathbuff"))
            {
                return;
            }

            var flags = Orbwalker.ActiveModesFlags;
            if (flags.HasFlag(Orbwalker.ActiveModes.Combo) && useQ)
            {
                if (qmode == 0)
                {
                    if (Spells.Q.Cast(qtarget.Position))
                    {
                        Orbwalker.ResetAutoAttack();
                        Player.IssueOrder(GameObjectOrder.AttackUnit, qtarget);
                    }
                }
                else
                {
                    if (Spells.Q.Cast(Game.CursorPos))
                    {
                        Orbwalker.ResetAutoAttack();
                        Player.IssueOrder(GameObjectOrder.AttackUnit, qtarget);
                    }
                }
            }
        }
开发者ID:FireBuddy,项目名称:karthus,代码行数:33,代码来源:OnPostAttack.cs


示例19: AfterAttack

        private void AfterAttack(AttackableUnit unit, AttackableUnit target)
        {
            if (ShouldRun())
            {
                if (!(target is Obj_AI_Hero))
                {
                    return;
                }

                var TargetHero = (Obj_AI_Hero) target;

                var currentMenuItem =
                    Variables.Menu.Item(
                        string.Format("dz191.vhr.activator.offensive.youmuu.{0}", Variables.Orbwalker.ActiveMode.ToString().ToLower()));
                var currentValue = currentMenuItem != null ? currentMenuItem.GetValue<bool>() : false;


                if (currentValue || MenuExtensions.GetItemValue<bool>("dz191.vhr.activator.offensive.youmuu.always"))
                {
                    if (TargetHero.IsValidTarget(ObjectManager.Player.AttackRange + 65f + 65f + 150f))
                    {
                        LeagueSharp.Common.Items.UseItem(3142);
                    }
                }
            }
        }
开发者ID:luizssn,项目名称:LeagueSharp,代码行数:26,代码来源:_Youmuu.cs


示例20: After_Attack

        private static void After_Attack(AttackableUnit unit, AttackableUnit target)
        {
            #region Hydra/Tiamat

            var minion = MinionManager.GetMinions(Player.Position, 800, MinionTypes.All, MinionTeam.Enemy,
                MinionOrderTypes.MaxHealth);
            if (minion != null)
            {
                if (ItemReady(Hydra) || ItemReady(Tiamat))
                {
                    if (GetBool("offensive.hydraminions", typeof(bool)) &&
                        (Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.LaneClear
                         || Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.LastHit
                         || Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.Mixed))
                    {
                        if (minion.Count < GetValue("offensive.hydraminonss"))
                        {
                            SelfCast(HasItem(Hydra) ? Hydra : Tiamat);
                        }
                    }
                }
            }

            var targets = TargetSelector.GetTarget(550, TargetSelector.DamageType.Physical);
            if (targets == null) return;
            if (ItemReady(Hydra) || ItemReady(Tiamat))
            {
                if (GetBool("offensive.hydracombo", typeof(bool)) && Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.Combo)
                {
                    SelfCast(HasItem(Hydra) ? Hydra : Tiamat);
                }
            }

            #endregion
        }
开发者ID:q51251,项目名称:LeagueSharp-2,代码行数:35,代码来源:Offensive.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# AttackableUnitDamageEventArgs类代码示例发布时间:2022-05-24
下一篇:
C# AttackType类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap