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


C# Obj_AI_Hero.IsNearTurret方法代码示例

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


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

示例1: CalcComboDamage

        private float CalcComboDamage(Obj_AI_Hero target, float resMulti, bool rangeCheck, bool q, bool e, bool r)
        {
            try
            {
                if (target == null)
                {
                    return 0;
                }

                var damage = 0f;
                var totalMana = 0f;

                if (r && R.IsReady() && (!rangeCheck || R.IsInRange(target, R.Range + R.Width)))
                {
                    var rMana = R.ManaCost * resMulti;
                    if (totalMana + rMana <= Player.Mana)
                    {
                        totalMana += rMana;
                        damage += R.GetDamage(target);
                        int stacks;
                        if (!IsSpellUpgraded(R))
                        {
                            stacks = target.IsNearTurret(500f) ? 3 : 10;
                            var endTimes =
                                target.Buffs.Where(
                                    t =>
                                        t.Type == BuffType.Charm || t.Type == BuffType.Snare ||
                                        t.Type == BuffType.Knockup || t.Type == BuffType.Polymorph ||
                                        t.Type == BuffType.Fear || t.Type == BuffType.Taunt || t.Type == BuffType.Stun)
                                    .Select(t => t.EndTime)
                                    .ToList();
                            if (endTimes.Any())
                            {
                                var max = endTimes.Max();
                                if (max - Game.Time > 0.5f)
                                {
                                    stacks = 14;
                                }
                            }
                        }
                        else
                        {
                            stacks = 13;
                        }

                        damage += (R.GetDamage(target, 1) * stacks);
                    }
                }
                if (e && E.IsReady() && (!rangeCheck || E.IsInRange(target, E.Range + ELength)))
                {
                    var eMana = E.ManaCost * resMulti;
                    if (totalMana + eMana <= Player.Mana)
                    {
                        totalMana += eMana;
                        damage += E.GetDamage(target);
                    }
                }
                if (q && Q.IsReady() && (!rangeCheck || Q.IsInRange(target)))
                {
                    var qMana = Q.ManaCost * resMulti;
                    if (totalMana + qMana <= Player.Mana)
                    {
                        damage += Q.GetDamage(target);
                        if (Orbwalking.InAutoAttackRange(target))
                        {
                            damage += CalcPassiveDamage(target);
                        }
                    }
                }
                if (HasQBuff() && (!rangeCheck || Orbwalking.InAutoAttackRange(target)))
                {
                    damage += CalcPassiveDamage(target);
                }

                damage *= 1.1f;
                damage += ItemManager.CalculateComboDamage(target, rangeCheck);
                damage += SummonerManager.CalculateComboDamage(target, rangeCheck);
                return damage;
            }
            catch (Exception ex)
            {
                Global.Logger.AddItem(new LogItem(ex));
            }
            return 0;
        }
开发者ID:juan2202,项目名称:LeagueSharp-Standalones,代码行数:85,代码来源:Viktor.cs

示例2: CalcComboDamage

        private float CalcComboDamage(Obj_AI_Hero target, bool q, bool e, bool r)
        {
            try
            {
                if (target == null)
                {
                    return 0;
                }
                var damage = 0f;
                if (HasQBuff() && Orbwalking.InAutoAttackRange(target))
                {
                    damage += CalcPassiveDamage(target);
                }
                if (q && Q.IsReady() && target.IsValidTarget(Q.Range))
                {
                    damage += Q.GetDamage(target);
                    if (Orbwalking.InAutoAttackRange(target))
                    {
                        damage += CalcPassiveDamage(target);
                    }
                }
                if (e && E.IsReady() && target.IsValidTarget(MaxERange))
                {
                    damage += E.GetDamage(target);
                }
                if (r && R.IsReady() && target.IsValidTarget(R.Range + R.Width))
                {
                    damage += R.GetDamage(target);

                    int stacks;
                    if (!IsSpellUpgraded(R))
                    {
                        stacks = target.IsNearTurret(500f) ? 3 : 10;
                        var endTimes =
                            target.Buffs.Where(
                                t =>
                                    t.Type == BuffType.Charm || t.Type == BuffType.Snare || t.Type == BuffType.Knockup ||
                                    t.Type == BuffType.Polymorph || t.Type == BuffType.Fear || t.Type == BuffType.Taunt ||
                                    t.Type == BuffType.Stun).Select(t => t.EndTime).ToList();
                        if (endTimes.Any())
                        {
                            var max = endTimes.Max();
                            if (max - Game.Time > 0.5f)
                            {
                                stacks = 14;
                            }
                        }
                    }
                    else
                    {
                        stacks = 13;
                    }

                    damage += (R.GetDamage(target, 1) * stacks);
                }
                damage += ItemManager.CalculateComboDamage(target);
                damage += SummonerManager.CalculateComboDamage(target);
                return damage;
            }
            catch (Exception ex)
            {
                Global.Logger.AddItem(new LogItem(ex));
            }
            return 0;
        }
开发者ID:q601333824,项目名称:LeagueSharp-Dev,代码行数:65,代码来源:Viktor.cs

示例3: CalcComboDamage

        private float CalcComboDamage(Obj_AI_Hero target,
            float resMulti,
            bool rangeCheck,
            bool q,
            bool w,
            bool e,
            bool r)
        {
            try
            {
                if (target == null)
                {
                    return 0;
                }

                var damage = 0f;
                var totalMana = 0f;

                if (r && R.IsReady() && (!rangeCheck || R.IsInRange(target)))
                {
                    var rMana = R.ManaCost * resMulti;
                    if (totalMana + rMana <= Player.Mana)
                    {
                        totalMana += rMana;
                        damage += R.GetDamage(target);
                    }
                }

                if (q && Q.IsReady() && (!rangeCheck || Q.IsInRange(target)))
                {
                    var qMana = Q.ManaCost * resMulti;
                    if (totalMana + qMana <= Player.Mana)
                    {
                        totalMana += qMana;
                        damage += Q.GetDamage(target);
                    }
                }
                else if (w && W.IsReady() && (!rangeCheck || W.IsInRange(target)))
                {
                    var wMana = W.ManaCost * resMulti;
                    if (totalMana + wMana <= Player.Mana)
                    {
                        totalMana += wMana;
                        damage += W.GetDamage(target);
                    }
                }
                if (e && E.IsReady(3000) && (!rangeCheck || E.IsInRange(target)))
                {
                    var eMana = E.ManaCost * resMulti;
                    var eDamage = E.GetDamage(target);
                    var count = target.IsNearTurret() && !target.IsFacing(Player) ||
                                target.IsNearTurret() && Player.HealthPercent <= 35 || !R.IsReady()
                        ? 5
                        : 8;
                    for (var i = 0; i < count; i++)
                    {
                        if (totalMana + eMana > Player.Mana)
                        {
                            break;
                        }
                        totalMana += eMana;
                        damage += eDamage;
                    }
                }

                damage += ItemManager.CalculateComboDamage(target, rangeCheck);
                damage += SummonerManager.CalculateComboDamage(target, rangeCheck);
                return damage;
            }
            catch (Exception ex)
            {
                Global.Logger.AddItem(new LogItem(ex));
            }
            return 0;
        }
开发者ID:julianrolandi,项目名称:LeagueSharp-Dev,代码行数:75,代码来源:Cassiopeia.cs

示例4: CalcComboDamage

        private float CalcComboDamage(Obj_AI_Hero target, bool q, bool w, bool e, bool r)
        {
            try
            {
                if (target == null)
                {
                    return 0;
                }
                var manaCost = (w && W.IsReady() ? W.Instance.ManaCost : (q ? Q.Instance.ManaCost : 0)) * 2;
                var damage = (w && W.IsReady() ? W.GetDamage(target) : (q ? Q.GetDamage(target) : 0)) * 2;

                if (e)
                {
                    var eMana = E.Instance.ManaCost;
                    var eDamage = E.GetDamage(target);
                    var count = target.IsNearTurret() && !target.IsFacing(Player) ||
                                target.IsNearTurret() && Player.HealthPercent <= 35 || !R.IsReady()
                        ? 5
                        : 10;
                    for (var i = 0; i < count; i++)
                    {
                        if (manaCost + eMana > Player.Mana)
                        {
                            break;
                        }
                        manaCost += eMana;
                        damage += eDamage;
                    }
                }
                if (r)
                {
                    if (manaCost + R.Instance.ManaCost - 10 > Player.Mana)
                    {
                        return damage;
                    }
                    return damage + (R.IsReady() ? R.GetDamage(target) : 0);
                }
                damage += ItemManager.CalculateComboDamage(target);
                damage += SummonerManager.CalculateComboDamage(target);
                return damage;
            }
            catch (Exception ex)
            {
                Global.Logger.AddItem(new LogItem(ex));
            }
            return 0;
        }
开发者ID:47110572,项目名称:LeagueSharp-Dev,代码行数:47,代码来源:Cassiopeia.cs


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