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


C# Spell.GetDamage方法代码示例

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


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

示例1: W

 public static void W(Spell spell)
 {
     foreach (var enemy in HeroManager.Enemies.Where(x => x.IsValidTarget(spell.Range) && x.Health < spell.GetDamage(x)))
     {
         spell.Cast(enemy);
     }
 }
开发者ID:HikigayaAss,项目名称:hikiMarksman,代码行数:7,代码来源:KillSteal.cs

示例2: GetKsDamage

        public static float GetKsDamage(Obj_AI_Base t, Spell QWER)
        {
            var totalDmg = QWER.GetDamage(t);

            if (Player.HasBuff("summonerexhaust"))
                totalDmg = totalDmg * 0.6f;

            if (t.HasBuff("ferocioushowl"))
                totalDmg = totalDmg * 0.7f;

            if (t is Obj_AI_Hero)
            {
                var champion = (Obj_AI_Hero)t;
                if (champion.ChampionName == "Blitzcrank" && !champion.HasBuff("BlitzcrankManaBarrierCD") && !champion.HasBuff("ManaBarrier"))
                {
                    totalDmg -= champion.Mana / 2f;
                }
            }

            var extraHP = t.Health - HealthPrediction.GetHealthPrediction(t, 500);

            totalDmg += extraHP;
            totalDmg -= t.HPRegenRate;
            totalDmg -= t.PercentLifeStealMod * 0.005f * t.FlatPhysicalDamageMod;

            return totalDmg;
        }
开发者ID:adukhuyet,项目名称:AsCarryteam,代码行数:27,代码来源:Program.cs

示例3: GetKillStealDamage

        public static float GetKillStealDamage(Obj_AI_Base e, Spell spell)
        {
            var dmg = spell.GetDamage(e);

            if (Tw_AIO.Player.HasBuff("summonerexhaust"))
                dmg = dmg * 0.6f;

            if (e.HasBuff("ferocioushowl"))
                dmg = dmg * 0.7f;

            if (e is Obj_AI_Hero)
            {
                var champion = (Obj_AI_Hero)e;

                if (champion.ChampionName == "Blitzcrank" && !champion.HasBuff("BlitzcrankManaBarrierCD") && !champion.HasBuff("ManaBarrier"))
                {
                    dmg -= champion.Mana / 2f;
                }
            }

            var extraHP = e.Health - LeagueSharp.Common.HealthPrediction.GetHealthPrediction(e, 500);

            dmg += extraHP;
            dmg -= e.HPRegenRate;
            dmg -= e.PercentLifeStealMod * 0.005f * e.FlatPhysicalDamageMod;

            return dmg;
        }
开发者ID:CjShu,项目名称:L-CC,代码行数:28,代码来源:Heroe.cs

示例4: Killsteal

        /// <summary>
        ///     Called when the game updates itself.
        /// </summary>
        /// <param name="args">The <see cref="EventArgs" /> instance containing the event data.</param>
        public static void Killsteal(EventArgs args)
        {
            /// <summary>
            ///     The KillSteal R Logic.
            /// </summary>
            ///
            var target = TargetSelector.GetTarget(Vars.R.Range, DamageType.True);
            if (target == null || !target.IsValid)
            {
                return;
            }
            if (Vars.getCheckBoxItem(Vars.RMenu, "killsteal") && Vars.R.IsReady() && target.LSIsValidTarget(Vars.R.Range))
            {
                foreach (var hero in
                    ObjectManager.Get<AIHeroClient>().Where(hero => hero.LSIsValidTarget(Vars.R.Range) && !Invulnerable.Check(hero) && !hero.HasBuffOfType(BuffType.SpellShield) && !hero.HasBuff("kindredrnodeathbuff")))
                {
                    var R = new LeagueSharp.Common.Spell(SpellSlot.R, 460);
                    var dmgR = SebbyLib.OktwCommon.GetKsDamage(target, R);
                    if (target.HasBuff("dariushemo"))
                        dmgR += R.GetDamage(target) * target.GetBuff("dariushemo").Count * 0.2f;
                    if (dmgR > hero.Health + target.HPRegenRate)
                    {
                        Vars.R.CastOnUnit(target);
                    }

                    if (dmgR < hero.Health + target.HPRegenRate && hero.CountEnemiesInRange(1200) <= 1)
                    {
                        foreach (var buff in hero.Buffs.Where(buff => buff.Name == "dariushemo"))
                        {
                            if (ObjectManager.Player.LSGetSpellDamage(target, SpellSlot.R, 1) * (1 + buff.Count / 5) - 1
                                > target.Health + target.HPRegenRate)
                            {
                                Vars.R.CastOnUnit(target);
                            }
                        }
                    }
                    if (hero.CountEnemiesInRange(1200) <= 1)
                    {
                        if (RDmg(hero, PassiveCount(hero)) +
                            Hemorrhage(hero, PassiveCount(hero) - 1) >= hero.Health + target.HPRegenRate && 1 <= target.GetBuff("dariushemo").Count)
                        {
                                if (!hero.HasBuff("kindredrnodeathbuff"))
                                    Spellbook["R"].CastOnUnit(hero);
                        }
                    }
                    if (RDmg(hero, PassiveCount(hero)) >= hero.Health +
                        Hemorrhage(hero, 1))
                    {
                            if (!hero.HasBuff("kindredrnodeathbuff"))
                                Spellbook["R"].CastOnUnit(hero);
                    }
                }
            }
        }
开发者ID:yMeliodasNTD,项目名称:PortAIO,代码行数:58,代码来源:Killsteal.cs

示例5: GetNearlyKillableTarget

        public static Obj_AI_Hero GetNearlyKillableTarget(Spell Spell, SpellSlot[] slots, TargetSelector.DamageType DamageType)
        {
            var targetSelectorTarget = TargetSelector.GetTarget(Spell.Range, TargetSelector.DamageType.Magical);
            var targetSelectorTargetIsKillable = Spell.GetDamage(targetSelectorTarget) > targetSelectorTarget.Health + 5;
            
            foreach (var target in HeroManager.Enemies.Where(n => n.IsValidTarget(Spell.Range)))
            {
                var SpellDamage = Spell.GetDamage(target);
                if (target.Health + 5 > SpellDamage 
                    && target.Health + 5 < SpellDamage 
                    + ObjectManager.Player.GetAutoAttackDamage(target) 
                    + ObjectManager.Player.GetComboDamage(target, slots
                    .Except(new List<SpellSlot>() { Spell.Slot }).ToList()))
                {
                    return target;
                }
            }

            return targetSelectorTargetIsKillable ? targetSelectorTarget : null;
        }
开发者ID:DZ191,项目名称:LeagueSharp,代码行数:20,代码来源:DZTargetHelper.cs

示例6: ComboDamage

 /// <summary>
 ///     Thats basically provide combo damage
 /// </summary>
 /// <param name="spell1">Q Spell</param>
 /// <param name="spell2">W Spell</param>
 /// <param name="spell3">E Spell</param>
 /// <param name="spell4">R Spell</param>
 /// <param name="unit">Target</param>
 /// <returns></returns>
 public static float ComboDamage(this Spell spell1, Spell spell2, Spell spell3, Spell spell4, AIHeroClient unit)
 {
     var combodamage = 0f;
     if (spell1.IsReady())
     {
         combodamage += spell1.GetDamage(unit);
     }
     if (spell2.IsReady())
     {
         combodamage += spell2.GetDamage(unit);
     }
     if (spell3.IsReady())
     {
         combodamage += spell2.GetDamage(unit);
     }
     if (spell4.IsReady())
     {
         combodamage += spell2.GetDamage(unit);
     }
     return combodamage;
 }
开发者ID:Xelamats,项目名称:PortAIO,代码行数:30,代码来源:Spells.cs

示例7: CountKillableMinions

 public static float CountKillableMinions(Spell spell, float range)
 {
     int killable = 0;
     foreach (var minion in MinionManager.GetMinions(range))
     {
         if (spell.GetDamage(minion) > minion.Health + 15)
         {
             killable = killable + 1;
         }
     }
     return killable;
 }
开发者ID:LSharpAura,项目名称:LeagueSharp,代码行数:12,代码来源:LastHit.cs

示例8: Add

 public static void Add(Spell spell, bool readyCheck = true)
 {
     try
     {
         if (_menu == null)
         {
             return;
         }
         _menu.AddItem(
             new MenuItem(_menu.Name + "." + spell.Slot, spell.Slot.ToString().ToUpper()).SetValue(false));
         if (readyCheck)
         {
             Functions.Add(spell.Slot.ToString(), hero => spell.IsReady() ? spell.GetDamage(hero) : 0);
         }
         else
         {
             Functions.Add(spell.Slot.ToString(), hero => spell.GetDamage(hero));
         }
     }
     catch (Exception ex)
     {
         Global.Logger.AddItem(new LogItem(ex));
     }
 }
开发者ID:iHeartZigg,项目名称:LeagueSharp-Dev,代码行数:24,代码来源:IndicatorManager.cs

示例9: GetRealDmg

 public static float GetRealDmg(Spell QWER, Obj_AI_Hero target)
 {
     if (Orbwalking.InAutoAttackRange(target) || target.CountAlliesInRange(300) > 0)
         return QWER.GetDamage(target) + (float)ObjectManager.Player.GetAutoAttackDamage(target) * 2;
     else
         return QWER.GetDamage(target);
 }
开发者ID:ngothaison,项目名称:HuyNKSDK,代码行数:7,代码来源:Program.cs

示例10: CanKill

 public static bool CanKill(Obj_AI_Base target, Spell Skill, int Stage = 0)
 {
     return (Skill.GetHealthPrediction(target) + 20 < Skill.GetDamage(target, Stage)) ? true : false;
 }
开发者ID:CupidL0ve,项目名称:LeagueSharp,代码行数:4,代码来源:Program.cs

示例11: GetKsDamage

        public static float GetKsDamage(Obj_AI_Hero t, Spell QWER)
        {
            var totalDmg = QWER.GetDamage(t);
            totalDmg -= t.HPRegenRate;

            if (totalDmg > t.Health)
            {
                if (Player.HasBuff("summonerexhaust"))
                    totalDmg = totalDmg * 0.6f;

                if (t.HasBuff("ferocioushowl"))
                    totalDmg = totalDmg * 0.7f;

                if (t.ChampionName == "Blitzcrank" && !t.HasBuff("BlitzcrankManaBarrierCD") && !t.HasBuff("ManaBarrier"))
                {
                    totalDmg -= t.Mana / 2f;
                }
            }

            totalDmg += (float)GetIncomingDamage(t);
            return totalDmg;
        }
开发者ID:qq2128969,项目名称:LeagueRepo,代码行数:22,代码来源:OktwCommon.cs

示例12: getUnitsInPath

 private static bool getUnitsInPath(Obj_AI_Hero player, Obj_AI_Hero target, Spell spell)
 {
     float distance = player.Distance(target);
     List<Obj_AI_Base> minionList = MinionManager.GetMinions(ObjectManager.Player.ServerPosition, spell.Range,
         MinionTypes.All, MinionTeam.NotAlly);
     int numberOfMinions = (from Obj_AI_Minion minion in minionList
                            let skillshotPosition =
                                V2E(player.Position,
                                    V2E(player.Position, target.Position,
                                        Vector3.Distance(player.Position, target.Position) - spell.Width + 1).To3D(),
                                    Vector3.Distance(player.Position, minion.Position))
                            where skillshotPosition.Distance(minion) < spell.Width
                            select minion).Count();
     int numberOfChamps = (from minion in ObjectManager.Get<Obj_AI_Hero>()
                           let skillshotPosition =
                               V2E(player.Position,
                                   V2E(player.Position, target.Position,
                                       Vector3.Distance(player.Position, target.Position) - spell.Width + 1).To3D(),
                                   Vector3.Distance(player.Position, minion.Position))
                           where skillshotPosition.Distance(minion) < spell.Width && minion.IsEnemy
                           select minion).Count();
     int totalUnits = numberOfChamps + numberOfMinions - 1;
     // total number of champions and minions the projectile will pass through.
     if (totalUnits == -1) return false;
     double damageReduction = 0;
     damageReduction = ((totalUnits > 7)) ? 0.4 : (totalUnits == 0) ? 1.0 : (1 - ((totalUnits) / 12.5));
     // the damage reduction calculations minus percentage for each unit it passes through!
     return spell.GetDamage(target) * damageReduction >= (target.Health + (distance / 2000) * target.HPRegenRate);
     // - 15 is a safeguard for certain kill.
 }
开发者ID:luizssn,项目名称:LeagueSharp,代码行数:30,代码来源:DZDraven_Reloaded.cs

示例13: GetCollision

 public static bool GetCollision(Obj_AI_Base target, Spell QWER, bool champion, bool minion)
 {
     var rDmg = QWER.GetDamage(target);
     int collision = 0;
     PredictionOutput output = QWER.GetPrediction(target);
     Vector2 direction = output.CastPosition.To2D() - ObjectManager.Player.Position.To2D();
     direction.Normalize();
     if (champion)
     {
         foreach (var enemy in Program.Enemies.Where(x => x.IsEnemy && x.IsValidTarget()))
         {
             PredictionOutput prediction = QWER.GetPrediction(enemy);
             Vector3 predictedPosition = prediction.CastPosition;
             Vector3 v = output.CastPosition - ObjectManager.Player.ServerPosition;
             Vector3 w = predictedPosition - ObjectManager.Player.ServerPosition;
             double c1 = Vector3.Dot(w, v);
             double c2 = Vector3.Dot(v, v);
             double b = c1 / c2;
             Vector3 pb = ObjectManager.Player.ServerPosition + ((float)b * v);
             float length = Vector3.Distance(predictedPosition, pb);
             if (length < QWER.Width )
                 return true;
         }
     }
     if (minion)
     {
         var allMinions = MinionManager.GetMinions(ObjectManager.Player.ServerPosition, QWER.Range, MinionTypes.All);
         foreach (var enemy in allMinions.Where(x => x.IsEnemy && x.IsValidTarget()))
         {
             PredictionOutput prediction = QWER.GetPrediction(enemy);
             Vector3 predictedPosition = prediction.CastPosition;
             Vector3 v = output.CastPosition - ObjectManager.Player.ServerPosition;
             Vector3 w = predictedPosition - ObjectManager.Player.ServerPosition;
             double c1 = Vector3.Dot(w, v);
             double c2 = Vector3.Dot(v, v);
             double b = c1 / c2;
             Vector3 pb = ObjectManager.Player.ServerPosition + ((float)b * v);
             float length = Vector3.Distance(predictedPosition, pb);
             if (length < QWER.Width)
                 return true;
         }
     }
     return false;
 }
开发者ID:47110572,项目名称:LeagueRepo,代码行数:44,代码来源:OktwCommon.cs

示例14: CanKillableWith

 public static bool CanKillableWith(this Obj_AI_Base t, Spell spell)
 {
     return t.Health < spell.GetDamage(t) - 5;
 }
开发者ID:CONANLXF,项目名称:AIO,代码行数:4,代码来源:CommonBuffs.cs

示例15: GetKsDamage

        public static float GetKsDamage(AIHeroClient t, Spell QWER)
        {
            var totalDmg = QWER.GetDamage(t);
            totalDmg -= t.HPRegenRate;

            if (totalDmg > t.Health)
            {
                if (Player.HasBuff("summonerexhaust"))
                    totalDmg = totalDmg*0.6f;

                if (t.HasBuff("ferocioushowl"))
                    totalDmg = totalDmg*0.7f;

                if (t.ChampionName == "Blitzcrank" && !t.HasBuff("BlitzcrankManaBarrierCD") && !t.HasBuff("ManaBarrier"))
                {
                    totalDmg -= t.Mana/2f;
                }
            }
            //if (Thunderlord && !Player.HasBuff( "masterylordsdecreecooldown"))
            //totalDmg += (float)Player.CalcDamage(t, Damage.DamageType.Magical, 10 * Player.Level + 0.1 * Player.FlatMagicDamageMod + 0.3 * Player.FlatPhysicalDamageMod);
            totalDmg += (float) GetIncomingDamage(t);
            return totalDmg;
        }
开发者ID:CONANLXF,项目名称:AIO,代码行数:23,代码来源:OktwCommon.cs


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